query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
ca762f80c4e6c1e97255c0f16991616b | Used by EndProductEstablishment to determine what modifier to use for the effectuation EPs | [
{
"docid": "763da19395ae10e89e86fe7a88bf347a",
"score": "0.662736",
"text": "def valid_modifiers\n HigherLevelReview::END_PRODUCT_MODIFIERS\n end",
"title": ""
}
] | [
{
"docid": "90399706b46352a200f525bdc21b5c63",
"score": "0.6724711",
"text": "def modifier\n fetch('science.modifier')\n end",
"title": ""
},
{
"docid": "4cc47d4349636adb04385c8fa4e5e840",
"score": "0.6467422",
"text": "def modifier\n @modifier\n end",
"title": ""
},
{
"docid": "f9a3746744d995839983e39d85ba43d6",
"score": "0.6241367",
"text": "def dfe_modifier\n return modifier_stage(dfe_stage)\n end",
"title": ""
},
{
"docid": "b2cb08a8865a37fef33021f76b12147e",
"score": "0.62283945",
"text": "def base_eva\n return get_modifiers_armors(:eva)\n end",
"title": ""
},
{
"docid": "d6bdd812d034425bef197b466376416e",
"score": "0.60145426",
"text": "def modifier\n @modifier ||= @opts[:modifier]\n end",
"title": ""
},
{
"docid": "3023a7fccad15ab8707401afed4eb177",
"score": "0.600804",
"text": "def modifier; end",
"title": ""
},
{
"docid": "a56cd647a3eadbe4eb5b6adb5daa91e9",
"score": "0.5990094",
"text": "def atk_modifier\n return stat_multiplier_regular(atk_stage)\n end",
"title": ""
},
{
"docid": "04781fa20d49e13876667d9d66069926",
"score": "0.5955837",
"text": "def atk_modifier\n return modifier_stage(atk_stage)\n end",
"title": ""
},
{
"docid": "8b34ae2f5e044365ab51e2a7104efb3b",
"score": "0.5952936",
"text": "def ats_modifier\n return modifier_stage(ats_stage)\n end",
"title": ""
},
{
"docid": "e054ba2682339ea961f4c4c9d7e1949f",
"score": "0.59060144",
"text": "def dfe_modifier\n return stat_multiplier_regular(dfe_stage)\n end",
"title": ""
},
{
"docid": "ede69edf58f2dbbd098584e071f5f66d",
"score": "0.58434653",
"text": "def base_mdef\n return get_modifiers_equipment(:mdef)\n end",
"title": ""
},
{
"docid": "fa9d97a426f313760d4534cd69fbf00c",
"score": "0.58241445",
"text": "def modifier_names\n [modifier_name]\n end",
"title": ""
},
{
"docid": "97b31b00910a3ff9663364c29eb6e257",
"score": "0.5823339",
"text": "def set_product_modifier\n @product_modifier = ProductModifier.find(params[:id])\n end",
"title": ""
},
{
"docid": "37c0cbc77f8fb5d306c69c8e01b2eef2",
"score": "0.5821953",
"text": "def base_pdef\n return get_modifiers_equipment(:pdef)\n end",
"title": ""
},
{
"docid": "ea9a411c44f1b19c94e9140d5d88a49e",
"score": "0.5773522",
"text": "def ats_modifier\n return stat_multiplier_regular(ats_stage)\n end",
"title": ""
},
{
"docid": "70b6920392d6c6832f5a3846cef59d7a",
"score": "0.56982505",
"text": "def modifier\n 1\n end",
"title": ""
},
{
"docid": "3b4aa2efa37f2288e4359ec1584ba4d5",
"score": "0.56835574",
"text": "def modifiers\n\t\t\t\t\tif !scheduled?\n\t\t\t\t\t\traise \"Schedule event to specific date first.\"\n\t\t\t\t\tend\n\t\t\t\t\treturn RicReservation.event_modifier_model.where(event_id: self.id, schedule_date: self.schedule_date)\n\t\t\t\tend",
"title": ""
},
{
"docid": "2ba26bdda25361675fb28ba0f909e7c2",
"score": "0.5675847",
"text": "def modifier(fenetre)\r\n\t\tFenetreEditerParagraphe.new(self)\r\n\t\tfenetre.modifierTexte()\r\n\tend",
"title": ""
},
{
"docid": "2d3de7de2db3092087d7961a26b818c7",
"score": "0.5648205",
"text": "def modifier?; end",
"title": ""
},
{
"docid": "2d3de7de2db3092087d7961a26b818c7",
"score": "0.5648205",
"text": "def modifier?; end",
"title": ""
},
{
"docid": "b5d76ebf581a8a391f1f9ed65cf62a01",
"score": "0.5637661",
"text": "def defend_modifier\n dexterity = modifier :dexterity \n armor_class + dexterity\n end",
"title": ""
},
{
"docid": "4936a17f51a1d56bfdda7c459b823287",
"score": "0.5624827",
"text": "def get_exp(item)\n return BASE_EXP * item.synthesis_level / synthesis_level\n end",
"title": ""
},
{
"docid": "b470c089eafe42fbc70be35e2f7f1951",
"score": "0.55995655",
"text": "def modifiers\n @@modifiers ||= []\n end",
"title": ""
},
{
"docid": "b470c089eafe42fbc70be35e2f7f1951",
"score": "0.55995655",
"text": "def modifiers\n @@modifiers ||= []\n end",
"title": ""
},
{
"docid": "34007d682c012e8edb733dacfb74ece9",
"score": "0.5582706",
"text": "def eva;party_bonus(ex_attr_eva, :eva);end",
"title": ""
},
{
"docid": "4f2f7441ba00e96e07a6555ae5146f16",
"score": "0.55473864",
"text": "def modeler_description\n return \"Loop through all roofs and set the reflectance and emissivity values to the user specified values. The default values come from the LEED advanced energy modeling guide.\"\n end",
"title": ""
},
{
"docid": "18de0bf01f24709ac39b7e27bae86692",
"score": "0.55409884",
"text": "def modeler_description\n return 'Loop through all roofs and set the reflectance and emissivity values to the user specified values. The default values come from the LEED advanced energy modeling guide.'\n end",
"title": ""
},
{
"docid": "c9a519b8ad32d0a9cfd3e7f6324a330b",
"score": "0.55330676",
"text": "def modeler_description\n return \"This EEM replaces the elevator lighting definition from the baseline value (assumed to coincide with 88 W/elevator cab, or 3.14 W/ft^2) to one representing 100% high-efficacy fixtures, with an effective lighting power of 32 W/elevator cab. The measure identifies the electric equipment load definition whose name includes the words elevator lights and replaces that definition with a new one meeting the high efficacy lighting power. Instance multipliers are applied as per the original load.\"\n end",
"title": ""
},
{
"docid": "be2ce0a1acd1528a033c9ec3d3e0882e",
"score": "0.5524877",
"text": "def renewal_eligiblity_determination; end",
"title": ""
},
{
"docid": "5e306959cca4f2643e54fb35d44a2c64",
"score": "0.552014",
"text": "def has_price_modifier?\n !(price_modifier_type.nil? || price_modifier_type.downcase =~ /none/)\n end",
"title": ""
},
{
"docid": "79dd67c50158eccc0d7233f8555af97c",
"score": "0.54951644",
"text": "def modeler_description\n return \"Change the interior Change the interior equipment components to make their properties match the selected template. components to make their properties match the selected template using the OpenStudio Standards methods. Will replace the existing properties where present.\"\n end",
"title": ""
},
{
"docid": "c54be0a17f4d5cae825c78068699e4fa",
"score": "0.54872537",
"text": "def modifier(fenetre)\r\n\t\tFenetreEditerImage.new(self)\r\n\t\tfenetre.modifierImage()\r\n\tend",
"title": ""
},
{
"docid": "3d8949267471143a3593ef0918ae56a8",
"score": "0.54861355",
"text": "def set_modifier\n self.modifier = '1'\n end",
"title": ""
},
{
"docid": "6b6e0fbaa2f0b64fc00d5cb73eaabc69",
"score": "0.54845387",
"text": "def modifier\n @modifier ||= @options[:with]\n end",
"title": ""
},
{
"docid": "c72d39b9d8f2827348ce8bd67bd3923b",
"score": "0.54799014",
"text": "def modeler_description\n return 'Replaces motors in the model with ECM motors motors matched to ComStock DEER 2020 efficiency level. Does not adjust pump motors on service water or refrigeration loops.'\n end",
"title": ""
},
{
"docid": "9d17c779b21f2755fea966084d279bde",
"score": "0.54605424",
"text": "def modifier_form?; end",
"title": ""
},
{
"docid": "9d17c779b21f2755fea966084d279bde",
"score": "0.54605424",
"text": "def modifier_form?; end",
"title": ""
},
{
"docid": "bc1621db41762412ac8ca45ca280b3c5",
"score": "0.54342645",
"text": "def evasion_mod(target)\n return target.stat_multiplier_acceva(-target.eva_stage) # <=> 1 / ...\n end",
"title": ""
},
{
"docid": "8a4ca721856377d6729407d11007ce5a",
"score": "0.54262656",
"text": "def modeler_description\n return 'This measure goes each water heater, if it finds a small (<12kW, <50gal, as defined on the MICS database), electric non-heatpump water heater it checks its Energy Factor.\n The equations for calculating EF through UA are listed here:\n http://www.energycodes.gov/sites/default/files/documents/PrototypeModelEnhancements_2014_0.pdf (Appendix A: Service Water Heating).\n If the current EF is lower than the chosen one, UA is changed accordingly to increase the EF of the water heater.\n The new UA is calculated using the equations here:\n https://github.com/NREL/openstudio-standards/blob/master/lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb#L90-L102\n Basically RE and EF are related by a regression equations, then the same equation listed in the above PNNL document is employed. '\n end",
"title": ""
},
{
"docid": "cdc20c319dbd0fce6ac8ab31e0db9274",
"score": "0.54076576",
"text": "def quality_modifier\n # If the concert is more than 10 days away, the quality increases by one\n if @sell_in >= 10\n base_quality_modifier\n elsif @sell_in >= 5\n base_quality_modifier * 2\n elsif @sell_in >= 0\n base_quality_modifier * 3\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "dce279d4742e31bdd9f4f9095655ab9f",
"score": "0.53889906",
"text": "def extract_effects()\n \n res = {}\n tmp = split_str(@target.effet, [\"(\",\")\",\"&\",\">\",\"[\",\"]\",], \" \")\n sigles = extract_sigles()\n \n # Parcours de chaque éléments du champ effet, et ajout des paires dans le résultat\n i = 0\n while(i<tmp.size())\n if(tmp[i] == \"M\")\n res[tmp[i+1]] = tmp[i+2]\n i += 3\n elsif(sigles.index(tmp[i])!=nil)\n res[tmp[i]] = true\n i += 1\n elsif(tmp[i] == \"!\")\n res[tmp[i+1]] = false\n i += 2\n else\n res[tmp[i+1]] = tmp[i]\n i += 2\n end\n end\n \n return res\n end",
"title": ""
},
{
"docid": "fb6c6c790ea0c69d4955d4c9700f692e",
"score": "0.53877985",
"text": "def e\n @e ||= deck - s - w - n\n end",
"title": ""
},
{
"docid": "fb6c6c790ea0c69d4955d4c9700f692e",
"score": "0.53877985",
"text": "def e\n @e ||= deck - s - w - n\n end",
"title": ""
},
{
"docid": "9738021516994a14c972d4cfbe39be1a",
"score": "0.5382729",
"text": "def pre_upgrade_corrections\r\r\n item.exp = item.exp_to_level if $imported[:Sel_Equip_Exp_Leveling]\r\r\n \r\r\n end",
"title": ""
},
{
"docid": "18745bf89a8415181fa1426ba875ee32",
"score": "0.53777003",
"text": "def spawn_modifiers\n current_metal, current_energy, current_zetium = current_resources\n max_metal = CONFIG['ss_object.asteroid.wreckage.metal.spawn.max']\n max_energy = CONFIG['ss_object.asteroid.wreckage.energy.spawn.max']\n max_zetium = CONFIG['ss_object.asteroid.wreckage.zetium.spawn.max']\n \n [\n [0, 1 - (current_metal / max_metal)].max,\n [0, 1 - (current_energy / max_energy)].max,\n [0, 1 - (current_zetium / max_zetium)].max\n ]\n end",
"title": ""
},
{
"docid": "4ed66c5e1c8b259baf4fef738ac7d33e",
"score": "0.53605795",
"text": "def renewal_eligiblity_determination\n end",
"title": ""
},
{
"docid": "45b5cd1bc629d6d910baf540d838734c",
"score": "0.5351404",
"text": "def make_specific( modifiers )\n self\n end",
"title": ""
},
{
"docid": "2c9aca0026451726be9c82a73e704a67",
"score": "0.5343369",
"text": "def modeler_description\n return 'DR Setpoint Modification measure for electric resistance water heaters'\n end",
"title": ""
},
{
"docid": "218b6ac2c841203ba05b0f97da7e111e",
"score": "0.5336446",
"text": "def modeler_description\n return \"This measure uses EnergyPlus' Energy Management System to control an electric vehicle (EV) charging load to better align charging power draw with expected energy production from solar PV. There must already be an EV charging load present in the model when this measure is applied, and the measure is configured based on the assumption of a typical office operating schedule.\"\n end",
"title": ""
},
{
"docid": "befd2dcdd43e6b57955d0e9f920fec48",
"score": "0.52826566",
"text": "def index\n @product_modifiers = ProductModifier.all\n end",
"title": ""
},
{
"docid": "e0b3059ba8418cd59de162b9e9a5b820",
"score": "0.5269131",
"text": "def set_modifier\n @modifier = Modifier.find(params[:id])\n end",
"title": ""
},
{
"docid": "5c0de46bc1f9f0a85a612b9764e1ca8e",
"score": "0.5267952",
"text": "def set_expedition\n @expedition = Expedition.find(params[:id]).tap do |e|\n require_owner_of!(e)\n end\n end",
"title": ""
},
{
"docid": "ffe51411b2be057a3b2ba1fb633d87f4",
"score": "0.52675855",
"text": "def determine_epoc_version\n case edition\n when 0, 1\n @epoc_version = [6, 0] # really just version 6, no minor version\n when 2\n case fp\n when 0, 1\n @epoc_version = [7, 0, \"s\"]\n when 6\n @epoc_version = [8, 0, \"a\"]\n when 8\n @epoc_version = [8, 1, \"a\"]\n else\n raise\n end\n when 3\n case fp\n when 0\n @epoc_version = [9, 1]\n when 1\n @epoc_version = [9, 2]\n when 2\n @epoc_version = [9, 3]\n else\n raise\n end\n when 5\n case fp\n when 0\n @epoc_version = [9, 4] # also known as Symbian^1\n when 1\n @epoc_version = [10, 2, \"Symbian^2\"]\n when 2\n @epoc_version = [10, 3, \"Symbian^3\"]\n else\n raise\n end\n else\n raise\n end\n end",
"title": ""
},
{
"docid": "00bcb679bfd261defef6e99d4b992c1a",
"score": "0.5250877",
"text": "def impacto_ambiental\n return @terreno+@gei\n end",
"title": ""
},
{
"docid": "7a48e34acefc085f5032deb0f5adae71",
"score": "0.5244701",
"text": "def modeler_description\n return \"This energy efficiency measure (EEM) replaces all cooling tower objects in a model of the following types: (OS:CoolingTowerPerformanceCoolTools, OS:CoolingTowerPerformanceYorkCalc, OS:CoolingTowerSingleSpeed, OS:CoolingTowerTwoSpeed, or OS:CoolingTowerVariableSpeed) with a new OS:CoolingTower:VariableSpeed object. If an existing cooling tower is already configured for variable speed, the measure will inform the user. When replacing an existing tower object, the following values from the existing tower configuration will be reused: Design Inlet Air Wet Bulb Temp, Design Approach Temperature, Design Range Temperature, Design Water Flow Rate, Design Air Flow Rate, Design Fan Power, Fraction of Tower Capacity in the Free Convection Regime, Basin Heater Capacity, Basin Heater Setpoint Temperature, Basin Heater Operating Schedule, Number of Cells, Cell Control, Cell Minimum and Maximum Water Flow Rate Fractions and Sizing Factor. A performance curve relating fan power to tower airflow rates is used. The curve assumes the fan power ratio is directly proportional to the air flow rate ratio cubed. A Minimum Air Flow Rate Ratio of 20% will be set. To model minimal but realistic water consumption, the Evaporation Loss Mode for new Tower objects will be set to ?Saturated Exit? and Drift Loss Percent will be set to a value of 0.05% of the Design Water Flow. Blowdown water usage will be based on maintaining a Concentration Ratio of 3.0.\"\n end",
"title": ""
},
{
"docid": "9a3e071a73d8ce1ef6a8e2dbbeb6dc2b",
"score": "0.5243286",
"text": "def sentiment_modifier\n @sentiment_modifier ||=\n first_sentiment ? first_sentiment.get('sentiment_modifier') : nil\n end",
"title": ""
},
{
"docid": "b363736d0729023b68adc68b8f2cdf6c",
"score": "0.52388245",
"text": "def calc_ener\n\t\treturn @alimentos.energia\n\tend",
"title": ""
},
{
"docid": "5d715a713040e66163d846c9e4d37f5b",
"score": "0.5231594",
"text": "def modeler_description\n return 'Any supply components or baseboard convective electrics/waters are removed from any existing air/plant loops or zones. Any existing air/plant loops are also removed. A heating DX coil, cooling DX coil, and an on/off supply fan are added to a variable refrigerant flow terminal unit.'\n end",
"title": ""
},
{
"docid": "bc668a6fac983622b444e226948be7fe",
"score": "0.5221478",
"text": "def special_modifier?; end",
"title": ""
},
{
"docid": "bc668a6fac983622b444e226948be7fe",
"score": "0.5221478",
"text": "def special_modifier?; end",
"title": ""
},
{
"docid": "80c15ee5e36534b9cff8d0f84775fe76",
"score": "0.52200127",
"text": "def from_an_edition_kind(item)\n if item.properties[\"edition_kind\"].present? && item.edition_type.name == \"edition only\"\n conj = item.properties[\"edition_kind\"][0].downcase =~ /\\A[^aeiou]/ ? \"a\" : \"an\"\n \"from #{conj} #{item.properties[\"edition_kind\"]} edition\"\n end\n end",
"title": ""
},
{
"docid": "e0f8daaf4ed30ddef971be34567aac87",
"score": "0.5216082",
"text": "def modeler_description\n return 'This measure goes each water heater, if it finds a small (<50gal, as defined on the MICS database), electric non-heatpump water heater, it calculates the COP corresponding to a EF=3.5\n\n The equations for calculating EF and UA are listed here:\n http://www.energycodes.gov/sites/default/files/documents/PrototypeModelEnhancements_2014_0.pdf (Appendix A: Service Water Heating).\n https://github.com/NREL/openstudio-standards/blob/master/lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb#L90-L102\n First a UA corresponding to a high EF for a standard electric SWH is calculated.\n With that UA value and a EF=3.5 (as listed in common commercially available HP water heaters), the water heater thermal efficiency (corresponding to the COP in this case) is calculated,\n through eq. on line 102 in the github page.\n This number is used for the COP in the partial-load curve assigned to the new HP water heater.\n https://www.energystar.gov/productfinder/product/certified-water-heaters/?formId=0d5ff0a5-d583-4bb4-a6d5-76436de5b169&scrollTo=9&search_text=&fuel_filter=&type_filter=Heat+Pump&brand_name_isopen=&input_rate_thousand_btu_per_hour_isopen=&markets_filter=United+States&zip_code_filter=&product_types=Select+a+Product+Category&sort_by=uniform_energy_factor_uef&sort_direction=DESC¤tZipCode=80401&page_number=0&lastpage=0'\n end",
"title": ""
},
{
"docid": "9214380e6227a23f759d8bf69983c26e",
"score": "0.5210421",
"text": "def modeler_description\r\n return \"Change energy use for kitchen.\"\r\n end",
"title": ""
},
{
"docid": "95ffb8f2833ec9ca0cdedb357d19aa52",
"score": "0.5201475",
"text": "def multiplier\n type == EXPENSE ? -1 : 1\n end",
"title": ""
},
{
"docid": "23cffd44c91d36e09a7ed68e58d48e6f",
"score": "0.5195732",
"text": "def getEnEdicion\n\t\treturn obtenerProspectos(7)\n\tend",
"title": ""
},
{
"docid": "f61b81410cee39163c7847f2057a1921",
"score": "0.5195168",
"text": "def modeler_description\n return 'Additional EnergyPlus measures can be placed after this measure in the workflow. Weather file should be described in the seed OSM file or in the OSW file used to run the simulation.'\n end",
"title": ""
},
{
"docid": "c85a2e85e695f628d176caba853c0a1b",
"score": "0.51935625",
"text": "def modeler_description\n return \"Any supply components or baseboard convective electrics/waters are removed from any existing air/plant loops or zones. Any existing air/plant loops are also removed. A heating DX coil, cooling DX coil, and an on/off supply fan are added to a variable refrigerant flow terminal unit.\"\n end",
"title": ""
},
{
"docid": "927ab62495b4a658428e39206b6590be",
"score": "0.5189618",
"text": "def product_modifier_params\n params.require(:product_modifier).permit(:product_id, :modifier_id)\n end",
"title": ""
},
{
"docid": "9516bf556037034b383c0e6c8ef8524f",
"score": "0.5186795",
"text": "def create_modifier_procs(modifiers)\n modifiers.inject({}) do |memo,mod|\n sku = mod[:sku]\n memo[sku] ||= []\n method = \"create_#{mod[:type]}_modifier\"\n memo[sku] << send(method, sku, *mod[:params])\n memo\n end\n end",
"title": ""
},
{
"docid": "04f5d45beb19bac97170bd88845d88b4",
"score": "0.518441",
"text": "def modeler_description\n return 'This energy efficiency measure (EEM) loops through all DX Coil objects of these types: 1) OS:CoilCoolingDXMultiSpeed, 2) OS:CoilCoolingDXSingleSpeed, 3) OS:CoilCoolingDXTwoSpeed, 4) OS:CoilCoolingDXTwoStageWithHumidityControlMode and 5) OS:CoilHeatingDXSingleSpeed. For each DX Cooling Coil object type, the initial Rated COP is modified (reduced) by 11.02%, representing a 30% refrigerant undercharge scenario. For each DX Heating Coil object type, the initial Rated COP is modified (reduced) by 8.24%, representing a 30% refrigerant undercharge scenario.'\n end",
"title": ""
},
{
"docid": "0ffa264ab37aa68d719480bc4fb43877",
"score": "0.5180266",
"text": "def update_modifiers\n begin\n for modifier in params[:modifier]\n # gsub function used replace the \",\" and space values in charge_modifiers using ascii key\n modifier = modifier.gsub('%2520',' ')\n modifier = modifier.gsub('%252C',', ')\n ChargeModifier.create(:charge_entry_id=>params[:charge_entry_id],:modifier=>modifier)\n end\n @charge_entry = ChargeEntry.find(params[:charge_entry_id])\n @id = \"selected_modifier_\" + params[:charge_entry_id]\n rescue => e\n render :text=> \" #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "3dc0ed789c1b4eceff98c464d069c893",
"score": "0.517881",
"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": "39f0c5a846cf8f99fa41f44aa708ab59",
"score": "0.516953",
"text": "def resource_modifiers(refresh=false)\n if not @resource_modifiers or refresh\n # Resource modifiers, Fixnums.\n @resource_modifiers = {\n :metal => 0, :metal_storage => 0,\n :energy => 0, :energy_storage => 0,\n :zetium => 0, :zetium_storage => 0,\n }\n\n resource_modifier_technologies.each do |technology|\n technology.resource_modifiers.each do |type, modifier|\n @resource_modifiers[type] += modifier\n end\n end\n\n @resource_modifiers.keys.each do |type|\n @resource_modifiers[type] += Cfg.planet_boost_amount \\\n if send(:\"#{type}_boosted?\")\n end\n end\n\n @resource_modifiers\n end",
"title": ""
},
{
"docid": "857ffd1a4a33ec7313b086dd58b00c67",
"score": "0.5161576",
"text": "def set_expedition\n @expedition = Expedition.find(params[:id])\n end",
"title": ""
},
{
"docid": "c548d030f7d987120f5d823fc9d173f4",
"score": "0.5140029",
"text": "def matching_end_product\n @matching_end_product ||= veteran.end_products.find { |ep| end_product.matches?(ep) }\n end",
"title": ""
},
{
"docid": "69510e7d73ece849ae1e4236e05f62f2",
"score": "0.5134782",
"text": "def equip_fix?(equip_type)\n case equip_type\n when 0 # Weapon\n return @weapon_fix\n when 1 # Shield\n return @armor1_fix\n when 2 # Head\n return @armor2_fix\n when 3 # Body\n return @armor3_fix\n when 4 # Accessory\n return @armor4_fix\n end\n return false\n end",
"title": ""
},
{
"docid": "b1f81be0e39dc34323f029036207e80f",
"score": "0.5131306",
"text": "def modifier(text = nil)\n if text\n @modifier = text\n self\n else\n @modifier\n end\n end",
"title": ""
},
{
"docid": "23f70aca49ebe9680c2f44a97cb5cf4b",
"score": "0.5128653",
"text": "def calculator\n product_customization_type.calculator\n end",
"title": ""
},
{
"docid": "85c1b33b262bb613d0285dafcfa30014",
"score": "0.51207024",
"text": "def selected_modifier_params\n params.require(:selected_modifier).permit(:item_id, :cart_item_id, :modifier_id, :applied_mod_group_id, :xpos, :ypos, :scrx, :scry, :rapper)\n end",
"title": ""
},
{
"docid": "f41805821f043e002cee9fa3b86a0e40",
"score": "0.51140976",
"text": "def effects; end",
"title": ""
},
{
"docid": "c6abac94154f27b9ed897f7cc4ceae83",
"score": "0.51139057",
"text": "def get_specification()\n\t\tend",
"title": ""
},
{
"docid": "8ed1a5424de13c5041180f48e9ef1bd0",
"score": "0.51087666",
"text": "def eficiencia\n\t\tefi = @alimentos.get_energia\n\t\treturn efi\n\tend",
"title": ""
},
{
"docid": "ea62b3aaa256ade99ccfdacae6490230",
"score": "0.5106064",
"text": "def calcola_valore_armor\n valore = 1.0\n case self.kind\n when 0 #valore per scudo\n valore += self.atk.to_f * 1.3\n valore += self.def.to_f * 4.0\n valore += self.spi.to_f * 1.3\n valore += self.agi.to_f * 1.3\n when 1 #se è un elmo\n valore += self.atk.to_f * 1.3\n valore += self.def.to_f * 3.8\n valore += self.spi.to_f * 1.3\n valore += self.agi.to_f * 1.3\n when 2 #se è un'armatura\n valore += self.atk.to_f * 1.3\n valore += self.def.to_f * 3.0\n valore += self.spi.to_f * 1.3\n valore += self.agi.to_f * 1.3\n when 3 #se è un accessorio\n valore += self.atk.to_f * 2.0\n valore += self.def.to_f * 2.0\n valore += self.spi.to_f * 2.0\n valore += self.agi.to_f * 2.0\n else\n # type code here\n end\n valore += self.state_set.size.to_f * 5.0\n valore += self.element_set.size.to_f * 5.0\n valore += self.eva.to_f * 3.0\n valore += 80.0 if self.auto_hp_recover\n valore += 80.0 if self.half_mp_cost\n valore += 50 if self.prevent_critical\n valore += 80.0 if self.double_exp_gain\n valore = 100.0 if valore > 100\n valore = valore * H87_ItemClass::Icone.size\n valore = valore.to_f / 100.0\n valore *= H87_ItemClass::Prop_Armr / 100.0\n @tier = valore.to_i\n end",
"title": ""
},
{
"docid": "90e25e91de74281fdf5888363140f7c7",
"score": "0.50938517",
"text": "def impacted\n end",
"title": ""
},
{
"docid": "ebe4f6bf53c1a5a078943650e660b818",
"score": "0.5092395",
"text": "def equip_fix?(equip_type)\n case equip_type\n when 0 # Weapon\n return $data_actors[@actor_id].weapon_fix\n when 1 # Shield\n return $data_actors[@actor_id].armor1_fix\n when 2 # Head\n return $data_actors[@actor_id].armor2_fix\n when 3 # Body\n return $data_actors[@actor_id].armor3_fix\n when 4 # Accessory\n return $data_actors[@actor_id].armor4_fix\n end\n return false\n end",
"title": ""
},
{
"docid": "ebe4f6bf53c1a5a078943650e660b818",
"score": "0.5092395",
"text": "def equip_fix?(equip_type)\n case equip_type\n when 0 # Weapon\n return $data_actors[@actor_id].weapon_fix\n when 1 # Shield\n return $data_actors[@actor_id].armor1_fix\n when 2 # Head\n return $data_actors[@actor_id].armor2_fix\n when 3 # Body\n return $data_actors[@actor_id].armor3_fix\n when 4 # Accessory\n return $data_actors[@actor_id].armor4_fix\n end\n return false\n end",
"title": ""
},
{
"docid": "3825cf6257bb6d538670e3533931c25a",
"score": "0.5089205",
"text": "def modeler_description\n return 'Any supply components or baseboard convective electrics/waters are removed from any existing air/plant loops or zones. A ground heat exchanger along with variable speed pump and water to air heat pump coils are added to a condenser plant loop.'\n end",
"title": ""
},
{
"docid": "838d2654c8261d22b66482bafe5b79f0",
"score": "0.50862026",
"text": "def expansivity(asphalt_waferwork, broker_misallotment, odorant_agen)\n cashmere_unsinkability_countershafting(diglottic_wonderer, revelant)\n foredoomer_bestrode_gomphosis(decence_ditriglyph)\n preagony_khediviah(jejunoduodenal)\n end",
"title": ""
},
{
"docid": "3828b4cdd0aefe4d0bb1140f0a60b40f",
"score": "0.5081135",
"text": "def modeler_description\n return \"So far it will only look for chillers of type Chiller:Electric:EIR.\nAlso, it will only accept for EIRFPLR a quadratic or cubic curve, and for EIRFT and CAPFT a biquadratic or bicubic, but modifying it is easy\"\n end",
"title": ""
},
{
"docid": "096fbb7073fdef52757c9f41b574404b",
"score": "0.50803584",
"text": "def armor; :fortified; end",
"title": ""
},
{
"docid": "559b00f517cc7d0b1e997f26a648ba24",
"score": "0.5076682",
"text": "def modifier=(val)\n @modifier = val\n clear\n end",
"title": ""
},
{
"docid": "8289a00550fd79ca9105ec30594a46f6",
"score": "0.50752974",
"text": "def old_reason_for_art_eligibilty\n new_guideline_start_date = GlobalProperty.find_by_property('new.guideline.start.date').property_value.to_date rescue '2011-07-01'.to_date\n who_stage = self.who_stage\n child_at_initiation = self.child_at_initiation?\n adult_or_peds = child_at_initiation ? \"peds\" : \"adult\" #returns peds or adult\n if child_at_initiation.nil?\n #if self.child_at_initiation? returns nil\n adult_or_peds = self.child? ? \"peds\" : \"adult\"\n end\n yes_concept_id = Concept.find_by_name(\"Yes\").id rescue 3\n #check if the first positive hiv test recorded at registaration was PCR\n #check if patient had low cd4 count\n\n low_cd4_count_250 = false\n low_cd4_count_350 = false\n\n latest_cd4_count = self.cd4_count_when_starting rescue nil\n if not latest_cd4_count.values[0][:value_numeric].blank?\n cd4_count = latest_cd4_count.values[0][:value_numeric]\n value_modifier = latest_cd4_count.values[0][:value_modifier]\n if not (value_modifier == \">\") and cd4_count <= 250\n low_cd4_count_250 = true\n elsif value_modifier == \">\" and cd4_count == 250\n low_cd4_count_250 = false\n elsif not(value_modifier == \">\") and cd4_count <= 350\n low_cd4_count_350 = true\n elsif value_modifier == \">\" and cd4_count == 350\n low_cd4_count_350 = false\n elsif cd4_count <= 250\n low_cd4_count_250 = true\n elsif cd4_count <= 350\n low_cd4_count_350 = true\n end\n end unless latest_cd4_count.blank?\n\n latest_cd4_count_not_available = latest_cd4_count.values[0][:value_numeric].blank? rescue true\n if latest_cd4_count_not_available\n cd4_count_available = Concept.find_by_name(\"CD4 count available\")\n cd4_count_done = Observation.find(:first, :conditions =>[\"patient_id = ?\n AND DATE(obs_datetime)=? AND concept_id = ? AND voided = 0\",\n self.id,staging_encounter.encounter_datetime.to_date,\n cd4_count_available.id]).value_coded == yes_concept_id rescue false\n if cd4_count_done\n [\"CD4 Count < 250\",\"CD4 Count < 350\"].each do |c|\n concept_id = Concept.find_by_name(c).concept_id\n cd4_count = Observation.find(:first, :conditions =>[\"patient_id = ?\n AND DATE(obs_datetime)=? AND concept_id = ? AND voided = 0\",\n self.id,staging_encounter.encounter_datetime.to_date,\n concept_id]).value_coded == yes_concept_id rescue false\n if c == \"CD4 Count < 250\" and cd4_count\n low_cd4_count_250 = true\n elsif c == \"CD4 Count < 350\" and cd4_count\n low_cd4_count_350 = true\n end\n end\n end\n end\n\n pregnant_woman = false\n breastfeeding_woman = false\n first_hiv_enc_date = encounters.find(:first,\n :conditions =>[\"encounter_type=?\",EncounterType.find_by_name(\"HIV Staging\").id],\n :order =>\"encounter_datetime desc\").encounter_datetime.to_date rescue \"2010-01-01\".to_date\n\n if self.sex == \"Female\"\n if first_hiv_enc_date >= \"2011-07-01\".to_date\n if self.observations.find(:first,:conditions => [\"concept_id = ? AND value_coded=? AND voided = 0\",Concept.find_by_name(\"Pregnant\").id,yes_concept_id]) != nil\n pregnant_woman = true\n end\n if self.observations.find(:first,:conditions => [\"concept_id = ? AND value_coded=? AND voided = 0\",Concept.find_by_name(\"Breastfeeding\").id,yes_concept_id]) != nil\n breastfeeding_woman = true\n end\n end\n end\n\n if self.child_at_initiation? || self.child?\n date_of_positive_hiv_test = self.date_of_positive_hiv_test\n latest_staging_date = self.encounters.find_last_by_type_name(\"HIV staging\").encounter_datetime rescue Time.now()\n age_in_months = self.age_in_months(latest_staging_date)\n cd4_count_less_than_750 = false\n\n if age_in_months >= 24 and age_in_months < 56\n if not latest_cd4_count.blank?\n cd4_count = latest_cd4_count.values[0][:value_numeric]\n value_modifier = latest_cd4_count.values[0][:value_modifier]\n if not (value_modifier == \">\") and cd4_count <= 750\n cd4_count_less_than_750 = true\n elsif value_modifier == \">\" and cd4_count == 750\n cd4_count_less_than_750 = false\n elsif cd4_count <= 750\n cd4_count_less_than_750 = true\n end\n end\n\n latest_cd4_count_not_available = latest_cd4_count.values[0][:value_numeric].blank? rescue true\n if latest_cd4_count_not_available\n cd4_count_available = Concept.find_by_name(\"CD4 count available\")\n cd4_count_done = Observation.find(:first, :conditions =>[\"patient_id = ?\n AND DATE(obs_datetime)=? AND concept_id = ? AND voided = 0\",\n self.id,staging_encounter.encounter_datetime.to_date,\n cd4_count_available.id]).value_coded == yes_concept_id rescue false\n if cd4_count_done\n [\"CD4 Count < 750\"].each do |c|\n concept_id = Concept.find_by_name(c).concept_id\n cd4_count = Observation.find(:first, :conditions =>[\"patient_id = ?\n AND DATE(obs_datetime)=? AND concept_id = ? AND voided = 0\",\n self.id,staging_encounter.encounter_datetime.to_date,\n concept_id]).value_coded == yes_concept_id rescue false\n if c == \"CD4 Count < 750\" and cd4_count\n cd4_count_less_than_750 = true\n end\n end\n end\n end\n end\n\n presumed_hiv_status_conditions = false\n low_cd4_percent = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"CD4 percentage < 25\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n thresholds = {\n 0=>4000, 1=>4000, 2=>4000,\n 3=>3000, 4=>3000,\n 5=>2500,\n 6=>2000, 7=>2000, 8=>2000, 9=>2000, 10=>2000, 11=>2000, 12=>2000, 13=>2000, 14=>2000, 15=>2000\n }\n low_lymphocyte_count = self.observations.find(:first, :conditions => [\"value_numeric <= ? AND concept_id = ? AND voided = 0\",thresholds[self.age],\n Concept.find_by_name(\"Lymphocyte count\").id]) != nil\n first_hiv_test_was_pcr = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"First positive HIV Test\").id,\n (Concept.find_by_name(\"PCR Test\").id rescue 463)]) != nil\n first_hiv_test_was_rapid = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"First positive HIV Test\").id,\n (Concept.find_by_name(\"Rapid Test\").id rescue 464)]) != nil\n pneumocystis_pneumonia = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Pneumocystis pneumonia\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n candidiasis_of_oesophagus = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Candidiasis of oesophagus\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n #check for Cryptococal meningitis or other extrapulmonary meningitis\n cryptococcal_meningitis = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Cryptococcal meningitis\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n severe_unexplained_wasting = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Severe unexplained wasting / malnutrition not responding to treatment(weight-for-height/ -age less than 70% or MUAC less than 11cm or oedema)\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n toxoplasmosis_of_the_brain = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Toxoplasmosis of the brain (from age 1 month)\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n oral_thrush = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Oral thrush\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n sepsis_severe = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Sepsis, severe\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n pneumonia_severe = self.observations.find(:first,:conditions => [\"(concept_id = ? and value_coded = ? AND voided = 0)\",\n Concept.find_by_name(\"Pneumonia, severe\").id,\n (Concept.find_by_name(\"Yes\").id rescue 3)]) != nil\n hiv_staging = self.encounters.find_by_type_name(\"HIV Staging\").first\n if pneumocystis_pneumonia or candidiasis_of_oesophagus or cryptococcal_meningitis or severe_unexplained_wasting or toxoplasmosis_of_the_brain or (oral_thrush and sepsis_severe) or (oral_thrush and pneumonia_severe) or (sepsis_severe and pneumonia_severe)\n presumed_hiv_status_conditions = true\n end\n if age_in_months <= 17 and first_hiv_test_was_rapid and presumed_hiv_status_conditions\n return Concept.find_by_name(\"Presumed HIV Disease\")\n elsif who_stage >= 3\n return Concept.find_by_name(\"WHO stage #{who_stage} #{adult_or_peds}\")\n elsif age_in_months <= 12 and first_hiv_test_was_pcr and hiv_staging != nil #Prevents assigning reason for art b4 staging encounter\n return Concept.find_by_name(\"PCR Test\")\n elsif age_in_months >= 12 and age_in_months < 24 and first_hiv_enc_date >= new_guideline_start_date\n return Concept.find_by_name(\"Child HIV positive\")\n elsif (age_in_months >= 24 and age_in_months < 56) and cd4_count_less_than_750 and first_hiv_enc_date >= new_guideline_start_date\n return Concept.find_by_name(\"CD4 count < 750\")\n elsif low_cd4_count_350 and first_hiv_enc_date >= new_guideline_start_date\n return Concept.find_by_name(\"CD4 count < 350\")\n elsif low_cd4_count_250\n return Concept.find_by_name(\"CD4 count < 250\")\n elsif low_lymphocyte_count and who_stage == 2\n return Concept.find_by_name(\"Lymphocyte count below threshold with WHO stage 2\")\n elsif pregnant_woman\n return Concept.find_by_name(\"Pregnant\")\n elsif breastfeeding_woman\n return Concept.find_by_name(\"Breastfeeding\")\n end\n else #adult patients\n if(who_stage >= 3)\n return Concept.find_by_name(\"WHO stage #{who_stage} #{adult_or_peds}\")\n else\n if low_cd4_count_350 and first_hiv_enc_date >= new_guideline_start_date\n return Concept.find_by_name(\"CD4 count < 350\")\n elsif low_cd4_count_250\n return Concept.find_by_name(\"CD4 count < 250\")\n elsif low_lymphocyte_count and who_stage == 2\n return Concept.find_by_name(\"Lymphocyte count below threshold with WHO stage 2\")\n elsif pregnant_woman\n return Concept.find_by_name(\"Pregnant\")\n elsif breastfeeding_woman\n return Concept.find_by_name(\"Breastfeeding\")\n end\n end\n return nil\n end\n end",
"title": ""
},
{
"docid": "62da135d6d3a4f4a8fe7daf3cc93ed4c",
"score": "0.50738704",
"text": "def make_enemy_package\n @package = nil\n if Engine == :XP\n if KreadCFG::AIHealy.include?(self.id)\n @package = :healy\n elsif KreadCFG::AIProtect.include?(self.id)\n @package = :protect\n elsif KreadCFG::AISupport.include?(self.id)\n @package = :support\n elsif KreadCFG::AIWild.include?(self.id)\n @package = :wild\n elsif KreadCFG::AIBalanced.include?(self.id)\n @package = :balanced\n end\n else\n self.enemy.note.split(/[\\r\\n]+/).each {|line|\n @package = $1.downcase.intern if line =~ /<(?:PACKAGE|package):[ ](.*)>/i\n }\n end\n end",
"title": ""
},
{
"docid": "16c481d00f643c081069e6ac01e0100b",
"score": "0.50715977",
"text": "def apply_modifiers\n terms_count = terms.count\n terms.each_with_index do |term, i|\n if i+1 < terms_count\n if term.use && (term.is_shifter? || term.is_intensifier?)\n terms[i+1].accumulated_strength *= term.accumulated_strength\n terms[i+1].list_ids += term.list_ids\n term.use = false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7b9a6d839ce98cbf82012a5f6bc43019",
"score": "0.50695765",
"text": "def modeler_description\n return 'This EEM applies an OS:SetpointManager:OutdoorAirReset controller to the supply outlet node of all PlantLoop objects where OS:Sizing:Plant.LoopType = Heating.'\n end",
"title": ""
},
{
"docid": "f4e973b690565b0a874dd19d59aeb2a6",
"score": "0.50644416",
"text": "def modifications\n aa_mods + term_mods\n end",
"title": ""
},
{
"docid": "5f173031305a5137b10a257d71056a27",
"score": "0.506263",
"text": "def modeler_description\n return \"Any supply components or baseboard convective electrics/waters are removed from any existing air/plant loops or zones. A ground heat exchanger along with variable speed pump and water to air heat pump coils are added to a condenser plant loop.\"\n end",
"title": ""
},
{
"docid": "5f173031305a5137b10a257d71056a27",
"score": "0.506263",
"text": "def modeler_description\n return \"Any supply components or baseboard convective electrics/waters are removed from any existing air/plant loops or zones. A ground heat exchanger along with variable speed pump and water to air heat pump coils are added to a condenser plant loop.\"\n end",
"title": ""
},
{
"docid": "3c5aa11fe6242229811403569e118806",
"score": "0.5062479",
"text": "def spd_modifier\n return modifier_stage(spd_stage)\n end",
"title": ""
},
{
"docid": "1bc9762736b41e11975f29c867cc5ac2",
"score": "0.5057478",
"text": "def compensation_and_pension\n select_payments :compensation\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "5a0f59a3dc706df0069631f9af17c8a5",
"score": "0.0",
"text": "def set_user\n @user = current_user.empresa.users.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": ""
}
] |
b5fe405b40ab55f5969afa16026c3615 | Get Originator of an order | [
{
"docid": "dba8ba34eedfd4766b1a5a9b0765370c",
"score": "0.7464935",
"text": "def get_originator_of_order(id)\n goto_customer_info\n find(:xpath, \"//*[@id='atg_commerce_csr_customer_order_searchResultsTable']//a[contains(text(),'#{id}')]/../../td[7]\").text\n end",
"title": ""
}
] | [
{
"docid": "042215ca9adf0a06779e271641ee92b6",
"score": "0.6831207",
"text": "def originator()\n @orignator = self.original_message.sender if @originator.nil?\n return @orignator\n end",
"title": ""
},
{
"docid": "e2a8688e2d39aceb960a59345556d012",
"score": "0.6751569",
"text": "def originator\n\t\t@orignator = self.original_message.sender if @originator.nil?\n\t\treturn @orignator\n\tend",
"title": ""
},
{
"docid": "d400de4d5ae0c03ba96db24769f18dbd",
"score": "0.66911393",
"text": "def originator\n @orignator = self.original_message.sender if @originator.nil?\n return @orignator\n end",
"title": ""
},
{
"docid": "4e38dbe58c176441a30541d2b5163637",
"score": "0.64984125",
"text": "def originator\n @originator ||= original_message.sender\n end",
"title": ""
},
{
"docid": "4e38dbe58c176441a30541d2b5163637",
"score": "0.64984125",
"text": "def originator\n @originator ||= original_message.sender\n end",
"title": ""
},
{
"docid": "00fce987b9c0d9e9db4f417bf829f443",
"score": "0.64658076",
"text": "def originator\n @originator ||= previous.whodunnit rescue nil\n end",
"title": ""
},
{
"docid": "a6bfc63127f9e017945ba8a3eff7808a",
"score": "0.6201342",
"text": "def origin_id\n return @origin_id\n end",
"title": ""
},
{
"docid": "a6bfc63127f9e017945ba8a3eff7808a",
"score": "0.6201342",
"text": "def origin_id\n return @origin_id\n end",
"title": ""
},
{
"docid": "a6bfc63127f9e017945ba8a3eff7808a",
"score": "0.6201342",
"text": "def origin_id\n return @origin_id\n end",
"title": ""
},
{
"docid": "52f9222891466acef0a4e87cb8f41eb5",
"score": "0.6173091",
"text": "def origin\n return @origin\n end",
"title": ""
},
{
"docid": "52f9222891466acef0a4e87cb8f41eb5",
"score": "0.6173091",
"text": "def origin\n return @origin\n end",
"title": ""
},
{
"docid": "af6eaee3281b3e815d7304193262a6af",
"score": "0.6158156",
"text": "def type\n :originator\n end",
"title": ""
},
{
"docid": "1c1c6fc89ddbdf919eb4dc18d0df5cd4",
"score": "0.60311663",
"text": "def paper_trail_originator\n @paper_trail_originator ||= previous.try(:whodunnit)\n end",
"title": ""
},
{
"docid": "df9d5442691f607414a1ca982022dc8a",
"score": "0.60208523",
"text": "def get_origin\n\t\t@origin\n\tend",
"title": ""
},
{
"docid": "4fcb39db65bcad0b18a82d677f191c2a",
"score": "0.60113084",
"text": "def origin\n return unless current_user\n\n node_origin(object, current_user)\n end",
"title": ""
},
{
"docid": "7e5c6f69416d043d476a6608ac305a3c",
"score": "0.59535104",
"text": "def origin\n return unless current_user\n\n node_origin(object)\n end",
"title": ""
},
{
"docid": "77cbd3caa6c4e2c4cf9e3b931bdb75f3",
"score": "0.594055",
"text": "def origin\n self.origin_type.constantize.find(self.origin_id)\n end",
"title": ""
},
{
"docid": "273fd336cc60d150fd724c9df952f912",
"score": "0.59299785",
"text": "def origin\n @Origin\n end",
"title": ""
},
{
"docid": "0eb83264c42bad4606bc8d885f5308b6",
"score": "0.5818592",
"text": "def origin\n\t\t\t@service.origin\n\t\tend",
"title": ""
},
{
"docid": "52bca6dc4ac7c33c20c366fdfa12eb6a",
"score": "0.5784046",
"text": "def origin\n @origin\n end",
"title": ""
},
{
"docid": "52bca6dc4ac7c33c20c366fdfa12eb6a",
"score": "0.5784046",
"text": "def origin\n @origin\n end",
"title": ""
},
{
"docid": "52bca6dc4ac7c33c20c366fdfa12eb6a",
"score": "0.5784046",
"text": "def origin\n @origin\n end",
"title": ""
},
{
"docid": "52bca6dc4ac7c33c20c366fdfa12eb6a",
"score": "0.5784046",
"text": "def origin\n @origin\n end",
"title": ""
},
{
"docid": "52bca6dc4ac7c33c20c366fdfa12eb6a",
"score": "0.5784046",
"text": "def origin\n @origin\n end",
"title": ""
},
{
"docid": "52bca6dc4ac7c33c20c366fdfa12eb6a",
"score": "0.57840407",
"text": "def origin\n @origin\n end",
"title": ""
},
{
"docid": "52bca6dc4ac7c33c20c366fdfa12eb6a",
"score": "0.57840407",
"text": "def origin\n @origin\n end",
"title": ""
},
{
"docid": "50cda1af089ae8224bb1cb94868cd0d9",
"score": "0.5759365",
"text": "def set_originator\n @originator = Originator.find(params[:id])\n end",
"title": ""
},
{
"docid": "50cda1af089ae8224bb1cb94868cd0d9",
"score": "0.5759365",
"text": "def set_originator\n @originator = Originator.find(params[:id])\n end",
"title": ""
},
{
"docid": "daaa352855d65157fb4cd1735addd6de",
"score": "0.5722934",
"text": "def current_order\n @current_order ||= Order.find_by(id: user_id)\n end",
"title": ""
},
{
"docid": "fc9ac5a0496876e2ca445239ab1168cc",
"score": "0.5688881",
"text": "def author\n originator.try(:name)\n end",
"title": ""
},
{
"docid": "c1c595057520d4079259eee6b593793d",
"score": "0.5688255",
"text": "def get_requestor\n User.find(self.requestor_id)\n end",
"title": ""
},
{
"docid": "e946fa77a3b18e9a84356d5c7d88c479",
"score": "0.5669359",
"text": "def buyer\n if self.receiver == self.provider\n return self.sender\n else\n return self.receiver\n end\n end",
"title": ""
},
{
"docid": "83042954b067e7757c5e97f7e05a1e68",
"score": "0.5668406",
"text": "def get_orderid(order)\n return order.number\n end",
"title": ""
},
{
"docid": "2327332eef3e985c5b7686e33f1d585c",
"score": "0.5654978",
"text": "def current_order\n order_for_place(user.current_place)\n end",
"title": ""
},
{
"docid": "ad33fb03cd9d1aa3e5e3bace46a417f0",
"score": "0.5650817",
"text": "def origin\n str = @properties[PROP_ORIGIN]\n ((str || '').empty?) ? nil : str\n end",
"title": ""
},
{
"docid": "3ceb115bc524062b182dac056b4da681",
"score": "0.5649651",
"text": "def get_buyeremail(order)\n return order.email\n end",
"title": ""
},
{
"docid": "d085ea2d62e868c9cae73917cc3d3e2d",
"score": "0.5628988",
"text": "def other_party\n if self.creator.organization == agreement.organization\n agreement.counterparty\n else\n agreement.organization\n end\n end",
"title": ""
},
{
"docid": "b0f80bcb490a8f34d9015c2678a35bf3",
"score": "0.5622243",
"text": "def origin\n\t\t\t@origin ||= stops.first\n\t\tend",
"title": ""
},
{
"docid": "d43ea87dab95cf597bb421228b33a7d3",
"score": "0.56047297",
"text": "def origin\n self.class.origin\n end",
"title": ""
},
{
"docid": "6cf858d80196fdce3db862093fab0adf",
"score": "0.55719686",
"text": "def origin\n @headers[:origin]\n end",
"title": ""
},
{
"docid": "29d7708d1518a89f56b11ac391a0c944",
"score": "0.55716103",
"text": "def origin\n\t\tunless @origin\n\t\t\torigin_uri = self.headers.origin or return nil\n\t\t\t@origin = URI( origin_uri )\n\t\tend\n\n\t\treturn @origin\n\tend",
"title": ""
},
{
"docid": "0b96d90c02a14e4b0716399b36e0b3b6",
"score": "0.55592",
"text": "def owner\n self.roles.each do |role|\n if role.creator?\n return role.user\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "9dfbca1b81a0093bb39b610c9e199136",
"score": "0.55577475",
"text": "def transferor\n return @transferor\n end",
"title": ""
},
{
"docid": "5d8b711b9d4e5961e273d324342a308e",
"score": "0.55324024",
"text": "def ship_origin\n extract_text 'Ship origin'\n end",
"title": ""
},
{
"docid": "56a3d738e9d7df6266a15e9ef2d4a4d8",
"score": "0.5517083",
"text": "def get_buyerphone(order)\n return order.bill_address.phone\n end",
"title": ""
},
{
"docid": "658398c83666e0d65d78b386f69a81ad",
"score": "0.5505623",
"text": "def origin\n header.value_replace_master(:origin)\n end",
"title": ""
},
{
"docid": "f86ce1b5da3fca746cc3cc4f6f0e5198",
"score": "0.5502671",
"text": "def current_order\n if Order.exists?(user_id: current_user.id)\n Order.find_by_user_id(current_user.id)\n else\n Order.create(:user_id => current_user.id)\n end\n end",
"title": ""
},
{
"docid": "2bd5d2ed2f14c710a9b387f2e82f3067",
"score": "0.5445442",
"text": "def origin\n return nil if tracking_is_empty\n\n origin = @tracking_json[\"results\"][0][\"origin\"][\"value\"].strip\n return origin\n end",
"title": ""
},
{
"docid": "1d0042759508cb6ed19f2c700fa6f5dd",
"score": "0.54368204",
"text": "def current_order\n Order.current(cookies)\n end",
"title": ""
},
{
"docid": "1d0042759508cb6ed19f2c700fa6f5dd",
"score": "0.54368204",
"text": "def current_order\n Order.current(cookies)\n end",
"title": ""
},
{
"docid": "043af7b377adc2d71afb6dfd74e6187d",
"score": "0.54312456",
"text": "def author\n if sender.is_a?(User)\n sender.person\n else\n sender\n end\n end",
"title": ""
},
{
"docid": "523fe2ddd1639e64e00f1275022f65f4",
"score": "0.54191935",
"text": "def manager\n return self.order_manager\n end",
"title": ""
},
{
"docid": "2afb038928f8688bc523aba1e27601d5",
"score": "0.5415606",
"text": "def origin \n @origin ||= Location.new(params[:origin])\n end",
"title": ""
},
{
"docid": "b318cb3d01d03e8e89389ff1ed03bb68",
"score": "0.5412462",
"text": "def current_order\n @current_order ||= Order.find_by(id: user_id).all\n end",
"title": ""
},
{
"docid": "37c7f2e5a8b4520ccb3380d65b3a4df8",
"score": "0.5408701",
"text": "def owner_author\n return nil unless user&.orcid.present? # apparently there are cases where user doesn't have an orcid\n\n authors.where(author_orcid: user.orcid).first\n end",
"title": ""
},
{
"docid": "fe93a10a17b470ad21e59f95ac8b59d1",
"score": "0.54004985",
"text": "def current_order\n pending = self.orders.where(:status => 'PENDING')\n pending.first\n end",
"title": ""
},
{
"docid": "78ca5a038e3487e71ed10e179fb0979d",
"score": "0.5395103",
"text": "def origin\n {\n :name => 'Rod Bending Technology',\n :street1 => '4006 N McVicker Ave Apt 3C',\n :city => 'Chicago',\n :state => 'IL',\n :zip => '60634',\n :country => 'US',\n :phone => '+1 773 419 2625',\n :email => 'support@rbtfishing.com'\n }\n end",
"title": ""
},
{
"docid": "3357ca9f2d74e48374c2a014e165b170",
"score": "0.5394992",
"text": "def originator?\n !!@options[:originator]\n end",
"title": ""
},
{
"docid": "f0856db3d3fa8b5891d9de445e39c1ab",
"score": "0.53936875",
"text": "def transfer_originator_get(transfer_originator_get_request, opts = {})\n data, _status_code, _headers = transfer_originator_get_with_http_info(transfer_originator_get_request, opts)\n data\n end",
"title": ""
},
{
"docid": "25054823f23ec42a5c4bd877ff5e1a46",
"score": "0.5386922",
"text": "def current_order\n\t if !session[:order_id].nil?\n\t\t\tOrder.find(session[:order_id])\n\t\telsif current_user\n\t\t\tOrder.new(user_id: session[:user_id])\n\t\telse\n\t\t\tOrder.new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "366846ab3cb9547d2734125e56656241",
"score": "0.53862536",
"text": "def from\n user = User.find(self.from_id)\n if user.typ == :renter\n return user.renter.full_name2\n else\n return LocalizeHelper::get_string(:property_admin)\n end\n end",
"title": ""
},
{
"docid": "1a5288bb094ad176c23cda08ffd20051",
"score": "0.53608453",
"text": "def initiator\n \tid = self.initiator_id\n \treturn User.find(id)\n end",
"title": ""
},
{
"docid": "1206ccba7fbfb2abf6a42ace7e2b6818",
"score": "0.53590953",
"text": "def from\n return transaction_endpoint if deposit?\n return transferred_from if transfer_in?\n return account if withdrawal? or transfer_out?\n end",
"title": ""
},
{
"docid": "66d46505fcf7dd2a8b397eada1344dd7",
"score": "0.5357679",
"text": "def owned_by_user\n object.user.email\n end",
"title": ""
},
{
"docid": "28fea6ed630b2edba35a7b07cbc7f5ec",
"score": "0.5357637",
"text": "def current_order\n if session[:order_id]\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "7712d7324a068f2480f49979b588f7fa",
"score": "0.5355002",
"text": "def origin_system\n return @origin_system\n end",
"title": ""
},
{
"docid": "7712d7324a068f2480f49979b588f7fa",
"score": "0.5355002",
"text": "def origin_system\n return @origin_system\n end",
"title": ""
},
{
"docid": "7712d7324a068f2480f49979b588f7fa",
"score": "0.5355002",
"text": "def origin_system\n return @origin_system\n end",
"title": ""
},
{
"docid": "ebd210e81fe845e44ba77806eee59750",
"score": "0.53518736",
"text": "def origin\n 1\n end",
"title": ""
},
{
"docid": "ebd210e81fe845e44ba77806eee59750",
"score": "0.53518736",
"text": "def origin\n 1\n end",
"title": ""
},
{
"docid": "ebd210e81fe845e44ba77806eee59750",
"score": "0.53518736",
"text": "def origin\n 1\n end",
"title": ""
},
{
"docid": "23196dcfcd7ddc186c5da3664e064cdb",
"score": "0.5339783",
"text": "def origin\n @origin = Origin.new(@id, @xml.xml)\n end",
"title": ""
},
{
"docid": "862ed9be8f241733180d07d4688283c9",
"score": "0.53378296",
"text": "def recipient_login\n puts \"getter\"\n recipient.login if recipient\n end",
"title": ""
},
{
"docid": "94835bbc1796f142d0367f3383361a99",
"score": "0.52998227",
"text": "def current_order\n if !session[:order_id].nil?\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "94835bbc1796f142d0367f3383361a99",
"score": "0.52998227",
"text": "def current_order\n if !session[:order_id].nil?\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "94835bbc1796f142d0367f3383361a99",
"score": "0.52998227",
"text": "def current_order\n if !session[:order_id].nil?\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "94835bbc1796f142d0367f3383361a99",
"score": "0.52998227",
"text": "def current_order\n if !session[:order_id].nil?\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "94835bbc1796f142d0367f3383361a99",
"score": "0.52998227",
"text": "def current_order\n if !session[:order_id].nil?\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "94835bbc1796f142d0367f3383361a99",
"score": "0.52998227",
"text": "def current_order\n if !session[:order_id].nil?\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "349a6d8ec3d73168ac432a57543b72b8",
"score": "0.52943504",
"text": "def origin\n @origin ||= Snail.home_country\n end",
"title": ""
},
{
"docid": "31341b570c9133a76dbc3a726f61893d",
"score": "0.52846646",
"text": "def current_order\n if !session[:order_id].nil?\n Order.find(session[:order_id])\n else\n Order.new\n end\n end",
"title": ""
},
{
"docid": "f111faeb1bfe59f72cd28e480cd22bf5",
"score": "0.5281406",
"text": "def origin\n :local\n end",
"title": ""
},
{
"docid": "a34fafabb3e7dc7e8afc5a082fca7ab6",
"score": "0.52769107",
"text": "def get_origin target = :all\n target = target.to_sym\n return @origin if (target == :all)\n return @origin[target] if (@origin.key?(target))\n return nil\n end",
"title": ""
},
{
"docid": "99b9b198ff347f4662150f668e8c7a65",
"score": "0.52724403",
"text": "def customer\n return @customer\n end",
"title": ""
},
{
"docid": "4228a71d6cc4c4ca35cd2816cc74818a",
"score": "0.527244",
"text": "def from\n Member.find @from.name\n end",
"title": ""
},
{
"docid": "c55f8aa3894366ad42a0317c6e4472d5",
"score": "0.5272426",
"text": "def get_creator\n\t\treturn Account.find(self.account_id)\n\tend",
"title": ""
},
{
"docid": "c2b0f7e4b61d9057c32aa7935eb03f23",
"score": "0.5270365",
"text": "def originator\n previous.try :whodunnit\n end",
"title": ""
},
{
"docid": "5e4bc2788dbe56db6da29aeab0c5b448",
"score": "0.5267567",
"text": "def current_order\n @order ||= Order.find(session[:order_id]) if session[:order_id]\n end",
"title": ""
},
{
"docid": "6f53cf72736e916f257998fdb4bb187e",
"score": "0.52645785",
"text": "def other_user(user)\n user == sender ? recipient : sender\n end",
"title": ""
},
{
"docid": "f9ed65884d36000807eba8bce168ded3",
"score": "0.5262759",
"text": "def find_deliverer_order\n @order = @token.user.assigned_orders.find(params[:id])\n end",
"title": ""
},
{
"docid": "36708ad3f364238da8e4d75506b34fc6",
"score": "0.52606237",
"text": "def origin\n Map.locate_user(params[:address], locate_by_ip)\n end",
"title": ""
},
{
"docid": "e3b88f632cdef5b86db18252b590e08b",
"score": "0.52598596",
"text": "def user\n return object.recipient_user if object.recipient_user != scope\n return object.sender_user if object.sender_user != scope\n end",
"title": ""
},
{
"docid": "fe571bd4c38bb5d6d4c49f0e33fc97da",
"score": "0.525591",
"text": "def get_owner()\n return @owner\n end",
"title": ""
},
{
"docid": "fcdb17f485f01ad823a46a7c7928bb55",
"score": "0.52553546",
"text": "def origin\n data.origin\n end",
"title": ""
},
{
"docid": "6287a8a6413762796b49c41b02f35ea3",
"score": "0.5249096",
"text": "def get_deliveryphone(order)\n return order.ship_address.phone\n end",
"title": ""
},
{
"docid": "4a260434a71a44b89ccbc684435ac79f",
"score": "0.52463216",
"text": "def owner\n @owner ||= Customer.read_by_id(data[:owner_id])\n end",
"title": ""
},
{
"docid": "b1ea50960d99fa64082c2dcc5b685e47",
"score": "0.5241969",
"text": "def owner\n self.roles.where(name: 'owner').first.users.first\n end",
"title": ""
},
{
"docid": "dd2f4651c4954f6e6afd4448ca6dcb81",
"score": "0.52399224",
"text": "def order_address(order)\n\t\taddress = Address.unscoped.where(id: order.address_id).first\n\tend",
"title": ""
},
{
"docid": "dde36f98d217a83acca82648aefe7b8f",
"score": "0.52393734",
"text": "def requestor\n self.creator_name\n end",
"title": ""
},
{
"docid": "d1635a5f751b461b04d96700b740646f",
"score": "0.523622",
"text": "def origin\n nil\n end",
"title": ""
}
] |
eb42a40e9e2af2ef3525c2bbcf47e7c3 | 13.2.5.33 Attribute name state | [
{
"docid": "f36bfa15123a5888be80b29e5a0b023c",
"score": "0.7469912",
"text": "def parse_attribute_name_state\n case consume_next_input_character\n when *WHITESPACE\n when \"\\u002f\", \"\\u003e\", EOF\n # Reconsume in the after attribute name state.\n reconsume(:after_attribute_name)\n when '='\n # Switch to the before attribute value state.\n switch_to(:before_attribute_value)\n when /[A-Z]/\n # Append the lowercase version of the current input character (add 0x0020 to the character's code point) to the current attribute's name.\n @current_tag_token.attributes.last[:name] << current_input_character.downcase\n when \"\\u0000\"\n # This is an unexpected-null-character parse error. Append a U+FFFD REPLACEMENT CHARACTER character to the current attribute's name.\n not_implemented('null')\n # U+0022 QUOTATION MARK (\")\n # U+0027 APOSTROPHE (')\n # U+003C LESS-THAN SIGN (<)\n when \"\\u0022\", \"\\u0027\", \"\\u003c\"\n # This is an unexpected-character-in-attribute-name parse error. Treat it as per the \"anything else\" entry below.\n @current_tag_token.attributes.last[:name] << current_input_character\n else\n # Append the current input character to the current attribute's name.\n @current_tag_token.attributes.last[:name] << current_input_character\n end\n end",
"title": ""
}
] | [
{
"docid": "16d20ba640b02d42c7ede34a10c8168c",
"score": "0.76192236",
"text": "def attribute(name); end",
"title": ""
},
{
"docid": "7b69484fdfc65aba73be562c500711a8",
"score": "0.74637103",
"text": "def attribute_was(attr_name); end",
"title": ""
},
{
"docid": "7b69484fdfc65aba73be562c500711a8",
"score": "0.74637103",
"text": "def attribute_was(attr_name); end",
"title": ""
},
{
"docid": "514a1cb9a5d1623792e6dd02bcc164df",
"score": "0.7452705",
"text": "def attr_name=(_); end",
"title": ""
},
{
"docid": "514a1cb9a5d1623792e6dd02bcc164df",
"score": "0.7452705",
"text": "def attr_name=(_); end",
"title": ""
},
{
"docid": "cf38f19882717b7dd954d09dcff9a1d5",
"score": "0.7425947",
"text": "def visit_Arel_Attributes_Attribute o\n o.name\n end",
"title": ""
},
{
"docid": "16cefd43f1abca23a9ff2be58c4f5212",
"score": "0.7299728",
"text": "def attribute(name = :state)\n name == :state ? @attribute : :\"#{self.name}_#{name}\"\n end",
"title": ""
},
{
"docid": "40fa2d95ac17a7946afef801541949dc",
"score": "0.72149265",
"text": "def attribute(name); @_attributes[name]; end",
"title": ""
},
{
"docid": "7205dd46c22e584b3afcc3a7193ed969",
"score": "0.7197451",
"text": "def attr_name; end",
"title": ""
},
{
"docid": "bf3c508dc585bb44e92db258f32dc6c9",
"score": "0.7182162",
"text": "def name ; read_attribute :name ; end",
"title": ""
},
{
"docid": "7eaeaf278eabbed1b52508b52d9e7cfb",
"score": "0.711043",
"text": "def attribute(name)\n @attributes.add(name.to_sym)\n attr_accessor name\n end",
"title": ""
},
{
"docid": "385e5ecc855d29f81924114ee950fb13",
"score": "0.70906526",
"text": "def name\n @attrs[:name]\n end",
"title": ""
},
{
"docid": "6a43ef08a1c7475cfbeb5ea0047ddbd4",
"score": "0.706744",
"text": "def attribute_previously_was(attr_name); end",
"title": ""
},
{
"docid": "6a43ef08a1c7475cfbeb5ea0047ddbd4",
"score": "0.706744",
"text": "def attribute_previously_was(attr_name); end",
"title": ""
},
{
"docid": "9648741fe960e2d7440adae4dc4cb645",
"score": "0.6961146",
"text": "def test_attribute_name_state\n frag = fragment(\"<p \\u0000>\")\n # 12.2.5.33 Attribute name state\n assert_equal(1, frag.errors.length)\n end",
"title": ""
},
{
"docid": "d0d3658a5bdc9669e942d86266f65966",
"score": "0.6951589",
"text": "def name\n @attrs[:name]\n end",
"title": ""
},
{
"docid": "cb929e3f11f6db4953d7f3a47893a141",
"score": "0.6948629",
"text": "def attribute_name\n name_label.split(\".\").last\n end",
"title": ""
},
{
"docid": "cb929e3f11f6db4953d7f3a47893a141",
"score": "0.6948629",
"text": "def attribute_name\n name_label.split(\".\").last\n end",
"title": ""
},
{
"docid": "935034cfbe0fdfbe1d553e8567d9edc5",
"score": "0.6929508",
"text": "def attribute(name)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "318735ad3f36f97aba5ee1fd7f270a5e",
"score": "0.6929243",
"text": "def name\n @attrib[:name]\n end",
"title": ""
},
{
"docid": "935034cfbe0fdfbe1d553e8567d9edc5",
"score": "0.69286984",
"text": "def attribute(name)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3a30e935772703a0000927c692563e7a",
"score": "0.69040895",
"text": "def attribute_name(name)\n camelized = name.to_s.gsub(/[^\\w]/, '').gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n camelized[0].chr.downcase + camelized[1..-1]\n end",
"title": ""
},
{
"docid": "82192b3eb06a7be30de3e445a3ef6a45",
"score": "0.6874714",
"text": "def attr(name)\n Utility::check_types({ name=>String }) if $DEBUG\n @attrs[name]\n end",
"title": ""
},
{
"docid": "82192b3eb06a7be30de3e445a3ef6a45",
"score": "0.6874714",
"text": "def attr(name)\n Utility::check_types({ name=>String }) if $DEBUG\n @attrs[name]\n end",
"title": ""
},
{
"docid": "e312f6a86db7925c5266fe7d3bd5a6f1",
"score": "0.6848644",
"text": "def name\n attributes[:name]\n end",
"title": ""
},
{
"docid": "0ad3bd9f83d4b014188ae9739a98a793",
"score": "0.6835802",
"text": "def attribute(*names); end",
"title": ""
},
{
"docid": "616d0a47df20e9cdc78e0ab89d486a95",
"score": "0.6834147",
"text": "def name\n @attrs[:name]\n end",
"title": ""
},
{
"docid": "3363df2c2bbe42d24991842ca009b446",
"score": "0.6823037",
"text": "def attribute_names; end",
"title": ""
},
{
"docid": "3363df2c2bbe42d24991842ca009b446",
"score": "0.6823037",
"text": "def attribute_names; end",
"title": ""
},
{
"docid": "3363df2c2bbe42d24991842ca009b446",
"score": "0.6823037",
"text": "def attribute_names; end",
"title": ""
},
{
"docid": "3363df2c2bbe42d24991842ca009b446",
"score": "0.6823037",
"text": "def attribute_names; end",
"title": ""
},
{
"docid": "3363df2c2bbe42d24991842ca009b446",
"score": "0.6823037",
"text": "def attribute_names; end",
"title": ""
},
{
"docid": "3363df2c2bbe42d24991842ca009b446",
"score": "0.6823037",
"text": "def attribute_names; end",
"title": ""
},
{
"docid": "3363df2c2bbe42d24991842ca009b446",
"score": "0.6823037",
"text": "def attribute_names; end",
"title": ""
},
{
"docid": "13cdbec411e27e5c560db5b9b2c93c43",
"score": "0.680014",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "9f8abca44029bb4f0d130a8e78c7c301",
"score": "0.677027",
"text": "def attribute_name(name)\n name = name.to_s.downcase\n name = name[0..-2] if name[-1] == ?=\n name.to_sym\n end",
"title": ""
},
{
"docid": "fc3aedb8040f78b8969af33dcb71b306",
"score": "0.6745352",
"text": "def name\n @attributes['name']\n end",
"title": ""
},
{
"docid": "2bb26b1e8257fc18926e8c636574cadb",
"score": "0.6737946",
"text": "def name\r\n attributes['name'] || nil\r\n end",
"title": ""
},
{
"docid": "c993fd990f39ed36d0d1411ffd71e535",
"score": "0.6733392",
"text": "def name\n @attributes[:name.to_s]\n end",
"title": ""
},
{
"docid": "a8e5dcd7195628582a5fc43b3ef9b060",
"score": "0.67295146",
"text": "def iname=(val)\n attributes['name'] = val\n end",
"title": ""
},
{
"docid": "69aa1ba3076df3567ec3c5dcf1abfb50",
"score": "0.67191005",
"text": "def attribute_was(name)\n change = modifications[name]\n change ? change[0] : attributes[name]\n end",
"title": ""
},
{
"docid": "9eaea0a08bc3b0bc8999945048f36ca5",
"score": "0.6716751",
"text": "def attribute(name:)\n attributes << name\n attr_accessor name\n end",
"title": ""
},
{
"docid": "b41735a190c5827fa0d6bfcaffba7bc2",
"score": "0.6714551",
"text": "def map_attribute_name\n Node::Name.new(input.operand.name.to_s)\n end",
"title": ""
},
{
"docid": "b68e23d268a03bf96163ab44b3304fc5",
"score": "0.6712581",
"text": "def name #method\r\n\t\t@name #attribute\r\n\tend",
"title": ""
},
{
"docid": "2c79b4b05e54992f25837f11d7a17e9d",
"score": "0.67121875",
"text": "def _attribute(name = @name)\n @attributes[name.to_sym]\n end",
"title": ""
},
{
"docid": "2c79b4b05e54992f25837f11d7a17e9d",
"score": "0.67121875",
"text": "def _attribute(name = @name)\n @attributes[name.to_sym]\n end",
"title": ""
},
{
"docid": "bdeeb4b736daa7603fc931e199a78eeb",
"score": "0.6710025",
"text": "def attribute_was(name)\n @attribute_objects[name.to_sym].was\n end",
"title": ""
},
{
"docid": "c68c982f391988615f4f96c81ebef8bd",
"score": "0.67078704",
"text": "def parse_before_attribute_name_state\n case consume_next_input_character\n when *WHITESPACE\n # Ignore the character.\n when '/', '>', EOF\n # Reconsume in the after attribute name state.\n # not_implemented(\"reconsume in after attribute name state\")\n reconsume(:after_attribute_name)\n when '='\n # This is an unexpected-equals-sign-before-attribute-name parse error. Start a new attribute in the current tag token. Set that attribute's name to the current input character, and its value to the empty string. Switch to the attribute name state.\n not_implemented\n else\n # Start a new attribute in the current tag token. Set that attribute name and value to the empty string. Reconsume in the attribute name state.\n @current_tag_token.attributes << { name: String.new, value: String.new } # TODO: track index\n reconsume(:attribute_name)\n end\n end",
"title": ""
},
{
"docid": "655c66ebcf03a5c0ae4a8e534f9ecb90",
"score": "0.6704902",
"text": "def iname=(val)\n attributes['name'] = val\n end",
"title": ""
},
{
"docid": "f69d97c0ba7ff9ad9a32f185a5b9d63b",
"score": "0.6702982",
"text": "def name\n attributes['name'].titleize\n end",
"title": ""
},
{
"docid": "2455be11aa69d70bc2a7dd30dcc8fe85",
"score": "0.66939163",
"text": "def name\n attributes[:name]\n end",
"title": ""
},
{
"docid": "cdd5cb01e444971f53643165ef369f14",
"score": "0.6689641",
"text": "def name\n @name ||= @attrs['name'] || ''\n end",
"title": ""
},
{
"docid": "cdb5884e6a2971e950f27e5b047c4296",
"score": "0.6679586",
"text": "def name\n attribute_name.humanize\n end",
"title": ""
},
{
"docid": "cdb5884e6a2971e950f27e5b047c4296",
"score": "0.6679586",
"text": "def name\n attribute_name.humanize\n end",
"title": ""
},
{
"docid": "5c0f2f6afe9a0251267d1975c30b202f",
"score": "0.6679248",
"text": "def name\n attributes.fetch(:name)\n end",
"title": ""
},
{
"docid": "5c0f2f6afe9a0251267d1975c30b202f",
"score": "0.6679248",
"text": "def name\n attributes.fetch(:name)\n end",
"title": ""
},
{
"docid": "5c0f2f6afe9a0251267d1975c30b202f",
"score": "0.6679248",
"text": "def name\n attributes.fetch(:name)\n end",
"title": ""
},
{
"docid": "5c0f2f6afe9a0251267d1975c30b202f",
"score": "0.6679248",
"text": "def name\n attributes.fetch(:name)\n end",
"title": ""
},
{
"docid": "5c0f2f6afe9a0251267d1975c30b202f",
"score": "0.6679248",
"text": "def name\n attributes.fetch(:name)\n end",
"title": ""
},
{
"docid": "5c0f2f6afe9a0251267d1975c30b202f",
"score": "0.6679248",
"text": "def name\n attributes.fetch(:name)\n end",
"title": ""
},
{
"docid": "c3c2a1c1d11de472abb3151eaf5f1a4a",
"score": "0.6676394",
"text": "def name; @name.nil? ? @name = get_attribute(\"name\") : @name; end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "14c0243c303bf20e7a1581487d6f4ec6",
"score": "0.66666424",
"text": "def name\n @attributes[:name]\n end",
"title": ""
},
{
"docid": "f1308ab15d45818f03f5d0c998c3d52d",
"score": "0.66612226",
"text": "def name\n attributes(:name)\n end",
"title": ""
},
{
"docid": "1f3c4058af0f9b7c4127dd509894b4c1",
"score": "0.6645376",
"text": "def inspect\n \"#<Attributes @names=#{names.join(\", \")}>\"\n end",
"title": ""
},
{
"docid": "b7000137572faf4c0f864b89cf8cc20e",
"score": "0.66425365",
"text": "def name\n attributes['name'] || nil\n end",
"title": ""
},
{
"docid": "af5c4f1744e42b3514a841bbecfa9604",
"score": "0.6623119",
"text": "def attribute(name)\n @common_attrib[name.downcase]\n end",
"title": ""
},
{
"docid": "04fd39fa157dcf1200dcef2c376e5f87",
"score": "0.6609399",
"text": "def attribute_parse_naming\n DEFAULT_ATTRIBUTE_PARSE_NAMING\n end",
"title": ""
},
{
"docid": "2993c28258f111edc65fcd166eabdc93",
"score": "0.66086066",
"text": "def attribute_alias(name); end",
"title": ""
},
{
"docid": "2993c28258f111edc65fcd166eabdc93",
"score": "0.66086066",
"text": "def attribute_alias(name); end",
"title": ""
},
{
"docid": "95adca170a0c4f4f9744bc7455782f82",
"score": "0.65871876",
"text": "def attribute(name)\n\t\t\tattributes.select{|n| n[:name] == name}[0]\n\t\tend",
"title": ""
},
{
"docid": "95adca170a0c4f4f9744bc7455782f82",
"score": "0.65871876",
"text": "def attribute(name)\n\t\t\tattributes.select{|n| n[:name] == name}[0]\n\t\tend",
"title": ""
},
{
"docid": "23b5db143d616fb50d8dee1b7ccf1a1c",
"score": "0.657852",
"text": "def attribute_alias?(new_name); end",
"title": ""
},
{
"docid": "23b5db143d616fb50d8dee1b7ccf1a1c",
"score": "0.657852",
"text": "def attribute_alias?(new_name); end",
"title": ""
},
{
"docid": "dba81402ecaac9a82b1643717a30b7b8",
"score": "0.65544385",
"text": "def _real_attribute_name(m)\n att = m.to_s.sub(/=/, '').to_sym\n attribute_aliases[att]\n end",
"title": ""
},
{
"docid": "900e75a7620b5e36e1f1dfb074b111d4",
"score": "0.6552051",
"text": "def name\n @name ||= __text(OCI_ATTR_NAME)\n end",
"title": ""
},
{
"docid": "5c087a5e8764554067afa48c6ad32ec5",
"score": "0.6549591",
"text": "def attribute?(name)\n attributes.key?(name)\n end",
"title": ""
},
{
"docid": "e4babbee3f29cff270a18e8f244cea42",
"score": "0.6543096",
"text": "def attribute_info(name)\n\t\t\t@header[name] or @header[name.to_sym]\n\t\tend",
"title": ""
},
{
"docid": "4b5032b753be3d8ca9798d164faf3376",
"score": "0.6528859",
"text": "def name\n read_attr :name\n end",
"title": ""
},
{
"docid": "4b5032b753be3d8ca9798d164faf3376",
"score": "0.6528859",
"text": "def name\n read_attr :name\n end",
"title": ""
},
{
"docid": "05378fe72f19616cdb99beb1e55eddda",
"score": "0.65235776",
"text": "def inspect\n \"#<Attributes (#{backend_name}) @names=#{names.join(\", \")}>\"\n end",
"title": ""
},
{
"docid": "591adc30102ef468ba2cb03ff77502cd",
"score": "0.6519183",
"text": "def attribute?(name)\n attributes.key?(name)\n end",
"title": ""
},
{
"docid": "28cd854a88d4c9e5e9dbfef8ea7fe07b",
"score": "0.651848",
"text": "def test_state_names\n fa = ADL::parse_automaton <<-AUTOMATON\n 3 4\n A true false\n B false false\n C false true\n A B a\n B C b\n C C a\n C B b\n AUTOMATON\n\n ['A','B','C'].each do |statename|\n assert_equal statename,fa.get_state(statename)[:name]\n end\n\n assert_equal true,fa.get_state('A').initial?\n assert_equal false,fa.get_state('B').initial?\n assert_equal false,fa.get_state('C').initial?\n\n assert_equal false,fa.get_state('A').accepting?\n assert_equal false,fa.get_state('B').accepting?\n assert_equal true,fa.get_state('C').accepting?\n end",
"title": ""
},
{
"docid": "030950bca9f426bf8c0868161d1c9e84",
"score": "0.65061826",
"text": "def attribute_change(attr_name); end",
"title": ""
},
{
"docid": "030950bca9f426bf8c0868161d1c9e84",
"score": "0.65061826",
"text": "def attribute_change(attr_name); end",
"title": ""
},
{
"docid": "f31c5ae4aa0d1740d761a33e60eadf57",
"score": "0.65052915",
"text": "def attribute_was(name)\n @data.attribute_was(name)\n end",
"title": ""
},
{
"docid": "a8c953a0dc030eb5c145ee953c4f7b7c",
"score": "0.64943814",
"text": "def name\n read_attribute(:name).to_sym rescue nil\n end",
"title": ""
},
{
"docid": "a7e617c95ee9d0b84f86d916d9d59cac",
"score": "0.6489869",
"text": "def name(value)\n attributes[:name] = value\n end",
"title": ""
}
] |
07f75205cc1ccc0b3369e1a15d7827ac | PATCH group_set_admin_path(group_uuid: group.uuid, user_id: user.id) | [
{
"docid": "382593963b4854d50dd0d36098ebce14",
"score": "0.0",
"text": "def set_admin\n # Rende un utente amministratore e gli rimuove il titolo, se lo è già\n @membership.admin = !@membership.admin\n\n if @membership.save\n flash[:success] = \"L'utente #{@user.name} è stato \" +\n (@membership.admin ? \"aggiunto agli\" : \"tolto dagli\") +\n \" amministratori del gruppo.\"\n else\n flash[:error] = \"L'utente #{@user.name} non è stato \" +\n (@membership.admin ? \"aggiunto agli\" : \"tolto dagli\") +\n \" amministratori del gruppo.\"\n end\n\n redirect_to group_path(uuid: @group.uuid)\n end",
"title": ""
}
] | [
{
"docid": "12b751e36302cba9a90b91add23d56dc",
"score": "0.715388",
"text": "def set_group_admin\n @group_admin = GroupAdmin.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b25b7682a58990c8ff754ac5d9d77a2",
"score": "0.70501876",
"text": "def update\n @group = Group.find(params[:id])\n unless @group.owner == current_user || current_user.admin\n redirect_to groups_path\n else\n respond_to do |format|\n if @group.update_attributes(params[:group])\n @group.users << @group.owner\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\n end",
"title": ""
},
{
"docid": "30dc38ddcf3fc3c3267651a1038f0979",
"score": "0.7016521",
"text": "def admin\n @group = Group.find(params[:group_id])\n @membership = Membership.find(params[:id])\n \n @membership.update_attribute(:g_admin, true)\n \n redirect_to group_memberships_url\n end",
"title": ""
},
{
"docid": "c3850a32c5b4c610aa90873c63efc1dc",
"score": "0.70088017",
"text": "def set_admin_group\n @admin_group = Admin::Group.find(params[:id])\n end",
"title": ""
},
{
"docid": "c3850a32c5b4c610aa90873c63efc1dc",
"score": "0.70077777",
"text": "def set_admin_group\n @admin_group = Admin::Group.find(params[:id])\n end",
"title": ""
},
{
"docid": "c3850a32c5b4c610aa90873c63efc1dc",
"score": "0.70077777",
"text": "def set_admin_group\n @admin_group = Admin::Group.find(params[:id])\n end",
"title": ""
},
{
"docid": "249b1bee5db9f9e1ff65c82fc53e0b57",
"score": "0.69882226",
"text": "def update\n @admin_group = Admin::Group.find(params[:id])\n\n respond_to do |format|\n if @admin_group.update_attributes(params[:admin_group])\n format.html { redirect_to @admin_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: @admin_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9fba149a644fb47f2d694f4145dde4",
"score": "0.69823825",
"text": "def update\n @group = Group.find_by_alias params[:id]\n user = User.wrap(params[:group][:owner_id])\n user.join_group(@group)\n\n if @group.update_attributes group_params\n redirect_to edit_admin_group_path(@group)\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "a34c4114f98b8d987107c850186e211b",
"score": "0.6943335",
"text": "def update\n require_privilege(Alberich::Privilege::MODIFY, User)\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n format.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d24cbcf69827b2ae0009eff6a30d9067",
"score": "0.6815331",
"text": "def update\r\n if signed_in?\r\n @group = Group.find(params[:id])\r\n\r\n unless is_admin? @group.id\r\n flash[:error] = \"You must be the group admin to edit it\"\r\n redirect_to groups_url\r\n end\r\n\r\n respond_to do |format|\r\n if @group.update_attributes(params[:group])\r\n format.html { redirect_to @group, notice: 'Group 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: @group.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n else\r\n flash[:error] = \"You must be signed in to view this page\"\r\n redirect_to signin_url\r\n end\r\n end",
"title": ""
},
{
"docid": "b256de05d1b5323a20ddec56a0cbfc09",
"score": "0.67889255",
"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": "d0c78aeb3982755d0ce9367e5bb570da",
"score": "0.6780414",
"text": "def update\n @groups = admin_groups(@groups)\n @groups_user = GroupsUser.where(:group_id => @groups).find(params[:id])\n\n respond_to do |format|\n if @groups_user.update_attributes(params[:groups_user])\n format.html { redirect_to group_path(@groups_user.group), :notice => 'Gruppenfreigabe wurde erfolgreich gespeichert.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @groups_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b363058a39b0feb3d27158ec0fb70cb",
"score": "0.6764268",
"text": "def set_admin_group_permission\n @admin_group_permission = Admin::GroupPermission.find(params[:id])\n end",
"title": ""
},
{
"docid": "ba51d8c458fb9792dc23c93a5cf8920d",
"score": "0.6762974",
"text": "def make_admin_of(group)\n if self.groups.include?(group)\n gm = self.group_members.where(group_id: group.id).first\n gm.admin = true\n gm.save\n end\n end",
"title": ""
},
{
"docid": "5aeb3bff250f4881d90a6f2eafb9011c",
"score": "0.6686166",
"text": "def update\n #not_found() unless current_user\n @group = Group.find(params[:id])\n if @group.user_id != current_user.id\n not_found()\n end\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fce1edead4964ae64cc36bbe906d0e6c",
"score": "0.6670773",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to([:admin, @group]) }\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": "3c5ac46fe581739dfb5b62676bb60ff8",
"score": "0.6658649",
"text": "def update\n authorize_action_for @group, at: current_store\n\n respond_to do |format|\n if @group.update(group_params)\n track @group\n\n format.html { redirect_to edit_admin_group_path(@group), notice: t('.notice', group: @group) }\n format.js { flash.now[:notice] = t('.notice', group: @group) }\n format.json { render :show, status: :ok, location: admin_group_path(@group) }\n else\n format.html { render :edit }\n format.js { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ee64ed93964ca86b3715555759824c2",
"score": "0.66389555",
"text": "def patch_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "dd3f3d03d4f85dda0ece3dec5fb8e708",
"score": "0.66385907",
"text": "def set_group_admin_flag(group, value = true)\n data_bag_entry = get_group_data_bag_item(group)\n data_bag_entry['admin'] = value\n data_bag_entry.save\n end",
"title": ""
},
{
"docid": "b8a00781282f159dde0ee51a8970c147",
"score": "0.6602041",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n # @group.users << current_user\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": "1f7da7c1c755b614267e5909e80c2b18",
"score": "0.6597382",
"text": "def update\n @group = Group.find(params[:id])\n\n # get an array of roles and set the role associations\n params[:group][:roles] = [] if params[:group][:roles].nil?\n roles = params[:group][:roles].collect { |i| Role.find(i) }\n @group.roles = roles\n\n # set parent manually\n if params[:group][:parent].to_s.empty?\n @group.parent = nil\n else\n @group.parent = Group.find(params[:group][:parent])\n end\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to groups_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "95ebe44bdba451b98b0dbd1556b3b24f",
"score": "0.6588112",
"text": "def patch_update\n group = @company.public_send(ScimRails.config.scim_groups_scope).find(params[:id])\n\n json_scim_missing_field_response(params) and return if patch_path.blank?\n\n if patch_path == :members\n case patch_operation.downcase\n when \"add\"\n add_members(group) if members_param.present?\n when \"remove\"\n remove_members(group) if members_param.present?\n end\n else\n update_attribute(group)\n end\n\n json_scim_response(object: group)\n end",
"title": ""
},
{
"docid": "d7221a8857751b171fe0e5a1248c755b",
"score": "0.65873265",
"text": "def set_group\n @user = current_user\n @group = @user.groups.find(params[:id])\n end",
"title": ""
},
{
"docid": "5de927cec9341c607c432592dc3c038f",
"score": "0.6566144",
"text": "def update\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n format.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab1f81568ff04aa0198579c1f9cf0f41",
"score": "0.6559411",
"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": "7462a252d1d7a290d6f134e67ae263c0",
"score": "0.65587217",
"text": "def update\n @group = Group.find(params[:id])\n\n if current_user == nil\n redirect_to :controller => :home, :action => :index\n return\n elsif !current_user.can_access(@group)\n return\n end\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e05b52bb3ebaa9006a5053037239187b",
"score": "0.65502423",
"text": "def update\n @group = current_user.groups.find(params[:id])\n\n if @group.update(group_params)\n redirect_to groups_path, notice: \"修改討論版成功\"\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "b43b9d3dc5952778454b3bf13245ab20",
"score": "0.6549727",
"text": "def update\n\n # Devise integration\n # Do not allow a user to update another user's groups\n # if @group.user_id != current_user.id\n # respond_to do |format|\n # format.html { render :edit }\n # format.json { render json: @group.errors, status: :unauthorized }\n # end\n # return\n # end\n\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "919effa566649e75ef3861a538c78185",
"score": "0.6540838",
"text": "def update\n respond_to do |format|\n\n #if (@group.user_id != current_user.id)\n if @group.can_edit(current_user) == false\n format.html { redirect_to @group, notice: 'Invalid group.' }\n format.json { render json: [\"Invalid group\"], status: :unprocessable_entity }\n else\n\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was updated.' }\n format.json { render :index, 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\n end\n end",
"title": ""
},
{
"docid": "894cd0ce37957ee528f3c77e1bc902a2",
"score": "0.654047",
"text": "def update\n if @user_group.update(user_group_params)\n render :show, status: :ok, location: @user_group\n else\n render json: @user_group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0a7c855fddf59f9534426e3af8dd9c3f",
"score": "0.6538276",
"text": "def update\n @group = Group.find(params[:id])\n authorize! :admin, @group\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { \n if params[:q].nil?\n redirect_to @group\n else\n redirect_to :action => 'edit', :id => @group.id, :q => params[:q]\n end\n }\n format.json { head :ok }\n format.js { 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": "0a7c855fddf59f9534426e3af8dd9c3f",
"score": "0.6538276",
"text": "def update\n @group = Group.find(params[:id])\n authorize! :admin, @group\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { \n if params[:q].nil?\n redirect_to @group\n else\n redirect_to :action => 'edit', :id => @group.id, :q => params[:q]\n end\n }\n format.json { head :ok }\n format.js { 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": "9d126ab753aa0fcbd90bde5dfddf6e78",
"score": "0.65240216",
"text": "def update\n respond_to do |format|\n if @admin_group.update(admin_group_params)\n @admin_groups = Admin::Group.paginate(:page => params[:page])\n format.html { redirect_to @admin_group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_group }\n format.js { render :layout => false }\n else\n format.html { render :edit }\n format.json { render json: @admin_group.errors, status: :unprocessable_entity }\n format.js { render :layout => false }\n end\n end\n end",
"title": ""
},
{
"docid": "f4b8130e1725844ffbd7798d02ef3d59",
"score": "0.65172094",
"text": "def update\n @group = current_user.teached_groups.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n errors = @group.populate_group\n flash[:errors] = \"The following student ids are not valid: #{errors}\" unless errors.blank?\n format.html { redirect_to [:teacher, @group], notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8891f50464c0dfe4fa021c641d5af574",
"score": "0.6495619",
"text": "def update\n# @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n flash[:notice] = 'UserGroup was successfully updated.'\n format.html { redirect_to(@user_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f02bb7f65e6f31a338ba69748a93d999",
"score": "0.6493701",
"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": "830383627cfc7d639014a2f8447478ea",
"score": "0.64890003",
"text": "def remove_from_admin(group)\n if self.groups.include?(group)\n gm = self.group_members.where(group_id: group.id).first\n gm.admin = false\n gm.save\n end\n end",
"title": ""
},
{
"docid": "e4dc98383f05b631a51ea2decca4807c",
"score": "0.6471857",
"text": "def update\n respond_to do |format|\n if @user_group.update(user_group_params)\n format.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1b6f508fcb6837e8efb1368e8f9dc59",
"score": "0.64570063",
"text": "def update\n \n @group.who_updated_id = session[:user_id]\n \n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba7a2388a626ae10a85c348c13e5f3bb",
"score": "0.645684",
"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": "1f436fb9c5736db8595767c1aa830c4f",
"score": "0.6451361",
"text": "def update\n authorize @group\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to group_path(@group.slug), 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": "34216055e22b34c1d3d94606ee1d243c",
"score": "0.64440846",
"text": "def update\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n flash[:notice] = 'UserGroup was successfully updated.'\n format.html { redirect_to(@user_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0971a1b11fc7606a800c33f511aebd3",
"score": "0.6442846",
"text": "def update\n @access_group.user_id = current_user.id\n respond_to do |format|\n if @access_group.update(access_group_params)\n format.html { redirect_to @access_group, notice: \"Access group was successfully updated.\" }\n format.json { render :show, status: :ok, location: @access_group }\n else\n format.html { render :edit }\n format.json { render json: @access_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "679851012eda1e0708f4c57e4508760e",
"score": "0.64347637",
"text": "def edit\n make_sure_user_has_permission!\n @group = Group.find_by_groupname(params[:id])\n end",
"title": ""
},
{
"docid": "ac26ab9949d33cc13f640bd9da2125a0",
"score": "0.6432897",
"text": "def update\n\t\t@user = current_user\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n\t\t\t\tflash[:notice] = 'Group was successfully updated!'\n format.html { redirect_to :action => :show, :user_id => @user.id, :id => @group.id}\n format.json { head :no_content }\n else\n\t\t\t\t@user = current_user\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2980c7c5bd3ce67b98bdee0df3f84fd5",
"score": "0.6431842",
"text": "def update\n @group = @club.groups.find(params[:id])\n @group.parent_id = params[:group][:parent_id];\n @group.bns_parent_id = params[:group][:parent_id];\n respond_to do |format|\n if (@group.is_member_list?)\n flash[:notice] = 'Cannot edit the member list.'\n format.html { redirect_to admin_club_group_path(@club, @group) }\n format.xml { head :ok }\n elsif @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to admin_club_group_path(@club, @group) }\n format.xml { head :ok }\n else\n @grouplist = @club.groups.find(:all, :conditions => [\"parent_id IS NOT ?\", nil], :order => 'lft')\n @grouplist -= @group.all_children << @group\n \n @page_title = \"Editing \" + @group.name\n @site_section = \"admin\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "388aa57100235cf28a23aa0eb16c7432",
"score": "0.6429834",
"text": "def update\n @usergroup = Usergroup.find(params[:id])\n\n respond_to do |format|\n if @usergroup.update_attributes(params[:usergroup])\n format.html { redirect_to @usergroup, notice: 'Usergroup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usergroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "167d8ba41b6b232f316129535935aa74",
"score": "0.6416505",
"text": "def update\n @group = Group.find(params[:id])\n if @group.owner == current_user\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\n end",
"title": ""
},
{
"docid": "967952b5a0052f6e4762a7fc29cd4b0a",
"score": "0.64147204",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html {redirect_to xmt_rbac_groups_path(@group), notice: '用户组更新成功.'}\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": "4e306f6f3de08db17a96308461f28d5f",
"score": "0.64145017",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n unless params[:new_user].blank?\n user = User.find(params[:new_user].to_i)\n @group.users << user unless @group.users.include? user\n user.update_user_group_list\n end\n \n format.html { redirect_to edit_osul_group_path(@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": "ff73ec353a62aa85f82df326bdd029cb",
"score": "0.6408908",
"text": "def update\n authorize! :manage, Group\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: t('action.update.succeed', entity: Group.model_name.human) }\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": "e7ee8e96429d4d80c9e80caaae9e89c7",
"score": "0.640829",
"text": "def update\n @group = Group.find_by_id(params[:id])\n \n respond_to do |format|\n if Group.find_all_by_user_id(current_user).include?(@group)\n if @group.update_attributes(params[:group])\n format.html { redirect_to groups_path, notice: \"Group '#{@group.name}' was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n else\n flash[:error] = \"Group was not found\"\n format.html { redirect_to action: \"index\" }\n end\n end\n end",
"title": ""
},
{
"docid": "99d2d15286ab5be9881786155e328fb2",
"score": "0.640704",
"text": "def update\n respond_to do |format|\n if @admin_group_permission.update(admin_group_permission_params)\n format.html { redirect_to @admin_group_permission, notice: 'Group permission was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_group_permission }\n else\n format.html { render :edit }\n format.json { render json: @admin_group_permission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c9fa319cb5b33c5d5d4e3dc4bb95bb3",
"score": "0.6403908",
"text": "def set_group\n @group = current_user.groups.find(params[:id])\n end",
"title": ""
},
{
"docid": "8c9fa319cb5b33c5d5d4e3dc4bb95bb3",
"score": "0.6403908",
"text": "def set_group\n @group = current_user.groups.find(params[:id])\n end",
"title": ""
},
{
"docid": "8c9fa319cb5b33c5d5d4e3dc4bb95bb3",
"score": "0.6403908",
"text": "def set_group\n @group = current_user.groups.find(params[:id])\n end",
"title": ""
},
{
"docid": "5cf2017f1305ac76464a0221de80a6ed",
"score": "0.64033103",
"text": "def update\n @group = Group.find(params[:id])\n save_permissions\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = t(\"controller.notices.group_updated\")\n format.html { redirect_to groups_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "352fbd3418a29c04970e70679e974cb4",
"score": "0.6402676",
"text": "def update\n respond_to do |format|\n if @user_group.update(user_group_params)\n format.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_group }\n else\n format.html { render :edit }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec36e491aa5e69bc0da0412d4ac49ae8",
"score": "0.6391569",
"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": "af51ade912f709a748dd12eeeb34ac2f",
"score": "0.6383376",
"text": "def update\n authorize! :update, @group\n\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { 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": "3575862475b4b3158507bb73115da5f0",
"score": "0.63797957",
"text": "def update\n @group = find_group(params[:id])\n\n if @group.update(group_params)\n redirect_to @group\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "15cda3f20c8815b0d0530b589240413b",
"score": "0.6375425",
"text": "def update\n raise(CanCan::AccessDenied, 'Wrong password') unless current_user.valid_password?(params[:group].delete(:password))\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "968c396d1a2b05b0870bddef11fe6e4b",
"score": "0.6358907",
"text": "def update\n @group = Group.find(params[:id].to_i)\n \n if request.get?\n # render only\n else\n # get an array of roles and set the role associations\n params[:group][:roles] = [] if params[:group][:roles].nil?\n roles = params[:group][:roles].collect { |i| Role.find(i) }\n @group.roles = roles\n\n # set parent manually\n if params[:group][:parent].to_s.empty?\n @group.parent = nil\n else\n @group.parent = Group.find(params[:group][:parent])\n end\n\n # Bulk-Assign the other attributes from the form.\n if @group.update_attributes(params[:group])\n flash[:success] = 'Group has been updated successfully.'\n redirect_to :action => 'show', :id => @group.to_param\n else\n render :action => 'update'\n end\n end\n\n rescue RecursionInTree\n @role.errors.add :parent, \"must not be a descendant of itself\"\n render :action => 'update'\n rescue ActiveRecord::RecordNotFound\n flash[:error] = 'You sent an invalid request.'\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "dcea0058fd3b37c8b06d814c2e754f05",
"score": "0.63426507",
"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": "84361a7411fd1e60450d4eb3413a0daa",
"score": "0.634147",
"text": "def update\n @bolt_user_group = Bolt::UserGroup.find(params[:id])\n\n respond_to do |format|\n if @bolt_user_group.update_attributes(params[:bolt_user_group])\n format.html { redirect_to @bolt_user_group, notice: 'User group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bolt_user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cba7af6c577f3e9b7caff169163af8f1",
"score": "0.6323981",
"text": "def update\n @usergroup = Usergroup.find(params[:id])\n\n respond_to do |format|\n if @usergroup.update_attributes(params[:usergroup])\n format.html { redirect_to(@usergroup, :notice => 'Usergroup was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usergroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82b1a2d8305b85191e2edc1e6d59751c",
"score": "0.6323396",
"text": "def update\n respond_to do |format|\n if @user_group.update(user_group_params)\n format.html { redirect_to @user_group, notice: '編集完了!' }\n format.json { render :show, status: :ok, location: @user_group }\n else\n format.html { render :edit }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19119d6df7716e80f9023ce1fd30e6e6",
"score": "0.63229626",
"text": "def make_admin_of_group(group)\n self.adminships.create(administrated_group_id: group.id)\n end",
"title": ""
},
{
"docid": "b0b46f4ea47fce44e35bd5039788bd00",
"score": "0.6315844",
"text": "def update\n params.permit!\n @group = Group.find(params[:id])\n redirect_to group_path(@group.course_id) if @group.update(params[:group])\n end",
"title": ""
},
{
"docid": "7d51dd895bc41b4f91bf097a514f5656",
"score": "0.63122755",
"text": "def set_user_group\n @group = authorized_user_groups.find(params[:id])\n end",
"title": ""
},
{
"docid": "c63c7c07e49aa5e69428a1a5a413f309",
"score": "0.63115185",
"text": "def update\n @group_user = GroupUser.find(params[:id])\n\n respond_to do |format|\n if @group_user.update_attributes(params[:group_user])\n format.html { redirect_to @group_user, notice: 'Group user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "038b2a2877dc97cd163b10d55914d369",
"score": "0.6309081",
"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": "b8a4fceea492d0f562544dfda01c9a3e",
"score": "0.63074756",
"text": "def update\n @group = Group.find(params[:id])\n return unless match_user(@group)\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:class] = \"alert alert-success\"\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": "641941ccce9db9b5f592b8748b4f16a7",
"score": "0.6295372",
"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": "5cc11cd2cd46fc75a47d652a25ec8ce3",
"score": "0.6289278",
"text": "def add_to_group(user:, group:)\n response(\n method: :put,\n path: \"#{realm_admin_root}/users/#{user.id}/groups/#{group.id}\",\n data: {\n userId: user.id,\n groupId: group.id,\n realm: @realm.name\n }\n )\n end",
"title": ""
},
{
"docid": "0c4f4fbfa72726882c263800bb894bce",
"score": "0.6282976",
"text": "def update\n @user = User.find(params[:id])\n @user_groups = UserGroup.all\n @current_user_group = UserGroup.find_by_id(@user.user_group_id) \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": "2e5ffa8cb895720057798885877065c2",
"score": "0.62801915",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @user_group.update(user_group_params)\n\t\t\t\tformat.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @user_group.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9f060805af61c31e312d2eedb926fc74",
"score": "0.6279945",
"text": "def update\n respond_to do |format|\n if @usergroup.update(usergroup_params)\n format.html { redirect_to @usergroup, notice: 'Группа успешно изменена.' }\n format.json { render :show, status: :ok, location: @usergroup }\n else\n format.html { render :edit }\n format.json { render json: @usergroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e31342ce864520a55dfa6bcf19f8de32",
"score": "0.6278005",
"text": "def update\n @group = Group.find(params[:id])\n authorize!(:update, @group)\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n # format.json { head :no_content }\n else\n @group = @group.decorate\n format.html { render action: \"edit\" }\n # format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff80b4d4d999e146a8b9da166cfa15a9",
"score": "0.6273657",
"text": "def update\n respond_to do |format|\n @group.users.clear\n users = get_users_from_select(params['group']['users'])\n unless users.blank?\n @group.users = users\n end\n if @group.update({name: params['group']['name']})\n flash.notice = t('global.model_modified', type: t('global.group').downcase)\n format.html { redirect_to @group }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a02fa66a7c3eff3f1feb7b5545ab6b4",
"score": "0.62718046",
"text": "def update\n respond_to do |format|\n if @user_permission_group.update(user_permission_group_params)\n format.html { redirect_to @user_permission_group, notice: 'User permission group was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_permission_group }\n else\n format.html { render :edit }\n format.json { render json: @user_permission_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f130ca742bcba2cf210aab5a04109ab2",
"score": "0.6267303",
"text": "def update\n if current_user && current_user.admin?\n \n FieldGroup.transaction do\n begin\n #@field_group is a variable containing an instance of the \"FieldGroup.rb\" model with attributes updated with data passed in the params of the \"edit.html.slim\" form submit action. \n @field_group = FieldGroup.find(params[:id])\n rescue => e\n # flash[:danger] = e.message\n end\n end\n\n respond_to do |format|\n if @field_group.update_attributes(field_group_params)\n format.html { redirect_to @field_group, notice: 'Fieldgroup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @field_group.errors, status: :unprocessable_fieldgroup }\n end\n end\n \n else\n flash[:danger] = 'Only users can modify fieldgroups! <a href=\"' + new_user_session_path + '\">Log in to continue.</a>'\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "5cdd073c02bd98be5a57cd9facef9cff",
"score": "0.6266436",
"text": "def update\n if current_group.update(group_params)\n redirect_to current_group\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "c22b6b4c5555fa08b690b65e98fb130e",
"score": "0.6256947",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n Group.rebuild!\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": "4e59e48c43795a229e7f85932ba5aec7",
"score": "0.6254722",
"text": "def set_group\n @group = Group.find(params[:group_id])\n end",
"title": ""
},
{
"docid": "4e59e48c43795a229e7f85932ba5aec7",
"score": "0.6254722",
"text": "def set_group\n @group = Group.find(params[:group_id])\n end",
"title": ""
},
{
"docid": "60a4384909757b6a1cbfa31bba78064d",
"score": "0.6249833",
"text": "def update\n @groupuser = Groupuser.find(params[:id])\n\n respond_to do |format|\n if @groupuser.update_attributes(params[:groupuser])\n format.html { redirect_to @groupuser, notice: 'Groupuser was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @groupuser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fe4c98eb136410b5cf2615d62387ada",
"score": "0.6243923",
"text": "def set_user_group\n @user_group = UserGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "5fe4c98eb136410b5cf2615d62387ada",
"score": "0.6243923",
"text": "def set_user_group\n @user_group = UserGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "76b187b371cf0fe9645ecff885239ef6",
"score": "0.62434447",
"text": "def update\n @group = Group.find(params[:id]) || ( not_found and return )\n authorize! :update, @group\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to cooperative.group_url(@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": "0c5cd121d0efbe2544080536e11ca2b2",
"score": "0.6243388",
"text": "def edit\n authorize! :modify, @group\n render 'form', layout: false\n end",
"title": ""
},
{
"docid": "adf25bd49c0611f194e90aec6a7a123e",
"score": "0.6241893",
"text": "def update\n @group = Group.find(params[:id])\n\n authorize! :udpate, @group\n\n if @group.can_access?(current_user)\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: \"Class \\\"#{@group.name}\\\" 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 else\n respond_to do |format|\n format.html { redirect_to action: \"index\"}\n format.json { render json: nil }\n end\n end\n end",
"title": ""
},
{
"docid": "a82a9e2899f2b53d661d0161661c6f95",
"score": "0.6239386",
"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": "6f1f2d82bb5bfcb216d009a5ab67ae47",
"score": "0.62389624",
"text": "def set_group\n @group = Group.find(params[:id])\n authorize @group unless @group.nil?\n end",
"title": ""
},
{
"docid": "52434ae73b5f993f5c6ada2a7688cbbe",
"score": "0.6238878",
"text": "def user_create_group_to_grp_admin_email(group)\n group = params[:id]\n grp_admin = group.user\n UserMailer.user_create_group_to_grp_admin_email(grp_admin).deliver_now\n end",
"title": ""
},
{
"docid": "9490117b525dc971185d60868954f667",
"score": "0.62385386",
"text": "def update\r\n @admin_ms_group = AdminMsGroup.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @admin_ms_group.update_attributes(params[:admin_ms_group])\r\n format.html { redirect_to @admin_ms_group, notice: 'Admin ms group 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: @admin_ms_group.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "5992fab3c28a6f9f0647e985b458882d",
"score": "0.6238198",
"text": "def set_group \n @group = Group.find(params[:group])\n \n end",
"title": ""
},
{
"docid": "0c29d956eeeaca3a5f4dafde9ea4cc6c",
"score": "0.62374026",
"text": "def set_group\n @group = Group.find(params[:group_id] || params[:id])\n end",
"title": ""
},
{
"docid": "976b34129125641e7d054e3ae06fe6a0",
"score": "0.6235875",
"text": "def save_edit_group\n group_already_existing = current_user.groups.find_by_group_name(params[:group][:group_name])\n old_group = Group.find(params[:id])\n if (group_already_existing.nil? or group_already_existing.blank?) and params[:id] == \"1\"\n new_group = Group.new\n new_group.group_name = params[:group][:group_name]\n new_group.tenant_id = current_user.tenant.id\n new_group.user_id = current_user.id\n new_group.save\n current_user.user.find(:all,:conditions => \"group_id = 1\").each { |user|\n user.update_attribute(:group_id, new_group.id)\n update_learner_group_id(current_user.user.find(user.id),new_group.id)\n }\n else\n if group_already_existing.nil? or group_already_existing.blank? then\n old_group.update_attribute(:group_name,params[:group][:group_name])\n if params[:group][:group_name].downcase == \"evaluator\"\n old_group.users.find(:all,:conditions => [\"user_id = ?\",current_user.id]).each {|user|\n user.update_attribute(:typeofuser,\"evaluator\")\n }\n end\n else\n old_group.users.find(:all,:conditions => [\"user_id = ?\",current_user.id]).each {|user|\n user.update_attribute(:group_id,group_already_existing.id)\n unless user.learners.nil?\n update_learner_group_id(user,group_already_existing.id)\n end\n }\n end\n end\n redirect_to(\"/users/learner_groups/#{current_user.id}\")\n end",
"title": ""
},
{
"docid": "ac98d6540daab11839545a935da7eab4",
"score": "0.62355405",
"text": "def set_group\n @group = Group.find(params[:group_id]) \n end",
"title": ""
},
{
"docid": "b5168f8f55e8b2464f894c6760931772",
"score": "0.6228372",
"text": "def update\n @group = Group.find(params[:id])\n if(!params[:user_id].nil?)\n @user = User.find(params[:user_id])\n @group.users << @user unless @group.users.include? @user\n end\n respond_to do |format|\n if @group.update(group_params_update)\n @group.users.each do |user|\n ListMailer.list_email(user).deliver_now\n end\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": ""
}
] |
4125116176b1ef79c4952802564fea98 | (self..x, self.y, width, height) specify the enclosing rectangle angels are degrees | [
{
"docid": "36dcebdbb5924fa60b78a8bf43038b20",
"score": "0.0",
"text": "def fill_arc width, height, starting_angle, arc_angle\r\n \r\n return unless @pen_down\r\n \r\n @gr.fill_arc @x, @y, width, height, starting_angle, arc_angle\r\n \r\n end",
"title": ""
}
] | [
{
"docid": "dfb7652fb423eb4bc5b364fcf8ef427c",
"score": "0.6807039",
"text": "def ann_rect(top, left, width, height)\n end",
"title": ""
},
{
"docid": "c7c39e35a7b78316d63f3f874375f1ee",
"score": "0.6763061",
"text": "def rect; end",
"title": ""
},
{
"docid": "c7c39e35a7b78316d63f3f874375f1ee",
"score": "0.6763061",
"text": "def rect; end",
"title": ""
},
{
"docid": "c7c39e35a7b78316d63f3f874375f1ee",
"score": "0.6763061",
"text": "def rect; end",
"title": ""
},
{
"docid": "c033f24983fbdf36137ff07fabe89578",
"score": "0.6728121",
"text": "def rectangular; end",
"title": ""
},
{
"docid": "a23852cd125b4694563ab2b36cdaa64c",
"score": "0.6707891",
"text": "def initialize\n @x_bound = 4\n @y_bound = 4\n end",
"title": ""
},
{
"docid": "0c91c8db0280bb9eec0a59414904ff8a",
"score": "0.66816396",
"text": "def rect\n complex :rect \n end",
"title": ""
},
{
"docid": "c7417be8fb824a47a0ff7573cda032da",
"score": "0.6620833",
"text": "def rect\n end",
"title": ""
},
{
"docid": "c7417be8fb824a47a0ff7573cda032da",
"score": "0.6620833",
"text": "def rect\n end",
"title": ""
},
{
"docid": "c7417be8fb824a47a0ff7573cda032da",
"score": "0.6620833",
"text": "def rect\n end",
"title": ""
},
{
"docid": "3ec734646e4751bdcc1798d6d0c42254",
"score": "0.6584612",
"text": "def bounds\n Rectangle.new(left_edge, bottom_edge, right_edge, top_edge)\n end",
"title": ""
},
{
"docid": "fce965208e6b29b670fb4e992e5b1b5d",
"score": "0.645455",
"text": "def relative_angles() @angles end",
"title": ""
},
{
"docid": "91ef0edaaf6d7b3e48ce7d72f870cf74",
"score": "0.63656026",
"text": "def rect\n Rect.new(0, 0, width, height)\n end",
"title": ""
},
{
"docid": "6fbc29ca1ac732c3ff33b01a5988e45e",
"score": "0.63587284",
"text": "def rect\r\n return Rect.new(self.x, self.y, self.width, self.height)\r\n end",
"title": ""
},
{
"docid": "bf4e2d8d7f1bb4b75005e65b009c1cf8",
"score": "0.6338273",
"text": "def calculate\n angle = @angle*(Math::PI/180)\n width = Math.cos(angle)*@scale\n height = Math.sin(angle)*@scale\n @x2 = @x + width\n @y2 = @y - height\n end",
"title": ""
},
{
"docid": "0fd06fba1d22d4ce9c6f3794280b4315",
"score": "0.6316652",
"text": "def rect\n [@x, @y, @w / 2, @h / 2]\n end",
"title": ""
},
{
"docid": "c48caff1d831a568c5bf99ff8ab6288e",
"score": "0.6293122",
"text": "def round_rect w, h, arc_width, arc_height\r\n @gr.draw_round_rect @x, @y, w, h, arc_width, arc_height if @pen_down\r\n end",
"title": ""
},
{
"docid": "3cac2200110bca9a96f0e2cfcf6b6152",
"score": "0.6279626",
"text": "def Rect \n @rect\n end",
"title": ""
},
{
"docid": "3e41cf57cbf2e74e709bf85317bf71f9",
"score": "0.62705475",
"text": "def draw_round_rect x, y, w, h, arc_width, arc_height\r\n @gr.draw_round_rect x, y, w, h, arc_width, arc_height\r\n end",
"title": ""
},
{
"docid": "7b0f52041ce3fd8fa1b3500eb6f3924c",
"score": "0.62479204",
"text": "def rect(x=0, y=0, w=20, h=20, reg=@registration)\n if reg == :center\n x = x - w / 2\n y = y - h / 2\n end\n puts \"path.rect at [#{x},#{y}] with #{w}x#{h}\" if @verbose\n CGPathAddRect(@path, @transform, CGRectMake(x,y,w,h))\n self\n end",
"title": ""
},
{
"docid": "ef093bbc5205364d9bb72870d66129b8",
"score": "0.62457246",
"text": "def initialize *args\n case args.size\n when 0\n @x, @y, @width, @height, @ox, @oy, @angle = 0, 0, 1, 1, 0, 0, 0\n when 2\n if args.all? {|x| x.class == Range}\n @x = args[0].first\n @width = args[0].last - @x\n @y = args[1].first\n @height = args[1].last - @y\n else\n @width, @height = *args\n @x, @y = 0, 0\n end\n @ox, @oy, @angle = 0, 0, 0\n when 4\n if args.all? {|x| Numeric === x}\n @x, @y, @width, @height = *args\n @ox, @oy = 0, 0\n else\n @x = args[0].first\n @width = args[0].last - @x\n @width += 1 unless args[0].exclude_end?\n @y = args[1].first\n @height = args[1].last - @y\n @height += 1 unless args[1].exclude_end?\n @ox, @oy = args[2, 2]\n end\n @angle = 0\n when 7\n @x, @y, @width, @height, @ox, @oy, @angle = *args\n else\n fail ArgumentError, 'wrong number of arguments'\n end\n @coords = coords\n self\n end",
"title": ""
},
{
"docid": "0e4eb72aaf9beefba8d70cc1326800c1",
"score": "0.62229264",
"text": "def fill_round_rect x, y, w, h, arc_width, arc_height\r\n @gr.fill_round_rect x, y, w, h, arc_width, arc_height\r\n end",
"title": ""
},
{
"docid": "f153a33245937dd9f3540d87b25398c3",
"score": "0.62214535",
"text": "def ref(x, y, rw, rh)\n translate(x, y) if x != 0 || y != 0\n @width = rw if rw\n @height = rh if rh\n end",
"title": ""
},
{
"docid": "447bc29ae170321a9adf8074c9b22caf",
"score": "0.62168074",
"text": "def rect\n Image::run_cmplx(self) {|x| x.complex :rect}\n end",
"title": ""
},
{
"docid": "c7778262f009ba99c563864fec93516a",
"score": "0.62152517",
"text": "def rect(top, left, width, height, corners = 0)\n # returns Shoes::Shape\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "dfee9f9db24bea04912e16d48ff2fd0b",
"score": "0.6189116",
"text": "def absolute_angles() @absolute_angles end",
"title": ""
},
{
"docid": "390ee512f92cfe8ca2f7c3dfac42cc71",
"score": "0.6181792",
"text": "def initialize(left, bottom, width, height)\n @left = left\n @bottom = bottom\n @right = left + width\n @top = bottom + height\n @width = width\n @height = height\n end",
"title": ""
},
{
"docid": "2f4fd2d3dc72b7a5fcae28d0888fe982",
"score": "0.6144838",
"text": "def bounding_box\n Rectangle.new(bounding_box_top_left, bounding_box_bottom_right)\n end",
"title": ""
},
{
"docid": "a5812f834f050a95386052c5eadffc95",
"score": "0.6142694",
"text": "def rect=(rectangle); end",
"title": ""
},
{
"docid": "048eb7511d01684bc43ffdb970befac6",
"score": "0.6138118",
"text": "def initialize \n @north_side = 0\n @south_side = 0\n @east_side = 0\n @west_side = 0\n end",
"title": ""
},
{
"docid": "5f5c1d92d6e78338674cd88931d07901",
"score": "0.6114138",
"text": "def draw_bounding_box\n # Draw the bounding box of the shape\n# top_left, top_right, bottom_left, bottom_right = self.rotate\n# @window.draw_quad(\n# top_left.x, top_left.y, Colours::RED,\n# top_right.x, top_right.y, Colours::RED,\n# bottom_left.x, bottom_left.y, Colours::RED,\n# bottom_right.x, bottom_right.y, Colours::RED,\n# z=0\n# )\n\n # Draw a wireframe of the shape\n self.class.shape_array.each_with_index do |vector, i|\n prev = self.class.shape_array[i-1]\n @window.translate(@shape.body.p.x, @shape.body.p.y) do\n @window.rotate(@shape.body.a.radians_to_degrees, 0, 0) do\n @window.draw_line(\n prev.x,\n prev.y,\n Colours::WHITE,\n vector.x,\n vector.y,\n Colours::WHITE\n )\n end\n end\n end\n\n # Draw a dot in the middle of the shape\n @window.draw_quad(\n @shape.body.p.x, @shape.body.p.y, Colours::WHITE,\n @shape.body.p.x+1, @shape.body.p.y, Colours::WHITE,\n @shape.body.p.x+1, @shape.body.p.y+1, Colours::WHITE,\n @shape.body.p.x, @shape.body.p.y+1, Colours::WHITE\n )\n end",
"title": ""
},
{
"docid": "6db478c0e8da5b5e97fd369f21844ac1",
"score": "0.61133367",
"text": "def custom_rectangular_position(width, height)\n Class.new(RectangularPosition) do\n @max_width = width\n @max_height = height\n end\nend",
"title": ""
},
{
"docid": "102a9dc69f376a75734770cd53885925",
"score": "0.610452",
"text": "def fill_round_rect w, h, arc_width, arc_height\r\n @gr.fill_round_rect @x, @y, w, h, arc_width, arc_height if @pen_down\r\n end",
"title": ""
},
{
"docid": "659c43598e3a4626e566a669bf080826",
"score": "0.6100384",
"text": "def initialize\n @size_x = 10\n @size_y = 10\n end",
"title": ""
},
{
"docid": "5ca86cd89f54d39869b6854056f741ed",
"score": "0.6096352",
"text": "def roundrect(x=0, y=0, width=20, height=20, roundness=0, reg=@registration)\n if roundness == 0\n p.rect(x, y, width, height, reg)\n else\n if reg == :center\n x = x - self.width / 2\n y = y - self.height / 2\n end\n curve = min(width * roundness, height * roundness)\n p = Path.new\n p.moveto(x, y+curve)\n p.curveto(x, y, x, y, x+curve, y)\n p.lineto(x+width-curve, y)\n p.curveto(x+width, y, x+width, y, x+width, y+curve)\n p.lineto(x+width, y+height-curve)\n p.curveto(x+width, y+height, x+width, y+height, x+width-curve, y+height)\n p.lineto(x+curve, y+height)\n p.curveto(x, y+height, x, y+height, x, y+height-curve)\n p.endpath\n end\n addpath(p)\n self\n end",
"title": ""
},
{
"docid": "b4eec9b5ecc3aa231747ce7417c22962",
"score": "0.6094593",
"text": "def rect_version\n NSMakeRect(\n @x - 0.5 * @width,\n @y - 0.5 * @height,\n @width, @height)\n end",
"title": ""
},
{
"docid": "9a9c195dda8c1873897ded10d38f7bf7",
"score": "0.6093406",
"text": "def full_rectangle\n upper_left = Point[0, 0]\n lower_right = Point[width - 1, height - 1]\n Rectangle[upper_left, lower_right]\n end",
"title": ""
},
{
"docid": "9a9c195dda8c1873897ded10d38f7bf7",
"score": "0.6093406",
"text": "def full_rectangle\n upper_left = Point[0, 0]\n lower_right = Point[width - 1, height - 1]\n Rectangle[upper_left, lower_right]\n end",
"title": ""
},
{
"docid": "306d9f83eb67160b6d9e9acd6b5b8024",
"score": "0.6085885",
"text": "def bounds\n { x: @attrs[:cx] + @attrs[:rx], y: @attrs[:cy] + @attrs[:ry] }\n end",
"title": ""
},
{
"docid": "32c313807acbde79f1f56b6bf8ded5a5",
"score": "0.60669976",
"text": "def rectangle(x, y, w, h = w)\n add_content(\"\\n%.3f %.3f %.3f %.3f re\" % [ x, y, w, h ])\n self\n end",
"title": ""
},
{
"docid": "dc9c2fbbb746dc6df53091914ecdbe18",
"score": "0.6065814",
"text": "def to_center\n self.x = Graphics.width/2 - self.width/2\n self.y = Graphics.height/2 - self.height/2\n end",
"title": ""
},
{
"docid": "dc9c2fbbb746dc6df53091914ecdbe18",
"score": "0.6065814",
"text": "def to_center\n self.x = Graphics.width/2 - self.width/2\n self.y = Graphics.height/2 - self.height/2\n end",
"title": ""
},
{
"docid": "65c45d27047d8539509baa39fc509dc4",
"score": "0.60440147",
"text": "def initialize(x, y, w_top, w_bot, h)\n super()\n if w_top > w_bot \n raise ArgumentError, \"wtop (#{w_top}) > wbot (#{w_bot})\"\n end\n w_in = (w_bot - w_top) / 2\n @rect = Rect.new(x,y-h, w_bot, h )\n @image = Surface.new([w_bot, h])\n @image.set_colorkey([0,0,0]) # TODO: need to base on backround\n @image.draw_polygon_s([[0,h], [w_in,0], [w_in + w_top, 0], [w_bot,h], [0,h]],[100,100,100]) # TODO: fix color\n end",
"title": ""
},
{
"docid": "65c45d27047d8539509baa39fc509dc4",
"score": "0.60440147",
"text": "def initialize(x, y, w_top, w_bot, h)\n super()\n if w_top > w_bot \n raise ArgumentError, \"wtop (#{w_top}) > wbot (#{w_bot})\"\n end\n w_in = (w_bot - w_top) / 2\n @rect = Rect.new(x,y-h, w_bot, h )\n @image = Surface.new([w_bot, h])\n @image.set_colorkey([0,0,0]) # TODO: need to base on backround\n @image.draw_polygon_s([[0,h], [w_in,0], [w_in + w_top, 0], [w_bot,h], [0,h]],[100,100,100]) # TODO: fix color\n end",
"title": ""
},
{
"docid": "f85528dfb594c70bedc633d14b012ebd",
"score": "0.6041808",
"text": "def rectangle(params)\n [ (params[:center][0] - params[:radius]).round,\n (params[:center][1] + params[:radius]).round,\n (params[:center][0] + params[:radius]).round,\n (params[:center][1] - params[:radius]).round ]\n end",
"title": ""
},
{
"docid": "46ac686a230c10e2f8abafba2cc75a7a",
"score": "0.6038987",
"text": "def initialize size=1, angle=0\n super()\n @size = size\n @angle = angle\n self\n end",
"title": ""
},
{
"docid": "811f856bd2c92a90b9900928c312c97d",
"score": "0.60289633",
"text": "def cx\n self.x + width / 2\n end",
"title": ""
},
{
"docid": "17ef8976707ebd0a819fc7a3934a93ff",
"score": "0.6020558",
"text": "def bounds\n { x: @attrs[:cx] + @attrs[:r], y: @attrs[:cy] + @attrs[:r] }\n end",
"title": ""
},
{
"docid": "a002a2e067a6795184a8c7c09010029f",
"score": "0.6014022",
"text": "def bounding_box(&block)\n PDF::Reader::Turtletext::Textangle.new(self,&block)\n end",
"title": ""
},
{
"docid": "caa2af370ca12a1169dba56886e1e635",
"score": "0.5999048",
"text": "def rectangle\n @w = params[:width].to_f\n @h = params[:height].to_f\n @area = @w * @h\n end",
"title": ""
},
{
"docid": "7af371fd3a222f79055c99a8467618f5",
"score": "0.5995974",
"text": "def initialize(options = {})\n options = {\n :left => 0,\n :top => 0,\n :right => 0,\n :bottom => 0\n }.merge(options)\n self.left, self.top, self.right, self.bottom = options[:left], options[:top], options[:right], options[:bottom]\n end",
"title": ""
},
{
"docid": "7af371fd3a222f79055c99a8467618f5",
"score": "0.5995974",
"text": "def initialize(options = {})\n options = {\n :left => 0,\n :top => 0,\n :right => 0,\n :bottom => 0\n }.merge(options)\n self.left, self.top, self.right, self.bottom = options[:left], options[:top], options[:right], options[:bottom]\n end",
"title": ""
},
{
"docid": "fd0be072bf169881e2b1a87e33e7f9b6",
"score": "0.5993683",
"text": "def rect\n [@x, @y, @w, @h]\n end",
"title": ""
},
{
"docid": "fea80ed23f86a50e07df92a7607d7e60",
"score": "0.59768236",
"text": "def rect(x0, y0, x1, y1, stroke_color = T.unsafe(nil), fill_color = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "65ca85cdfd5fbfddcc7558a99a61e161",
"score": "0.59606135",
"text": "def make_rect()\n Rect.new(0,0,10,10)\n end",
"title": ""
},
{
"docid": "f61d048a697098bbc92f398fa7be8e21",
"score": "0.5955065",
"text": "def initialize(x:, y:, heading:, length:)\n self.x = x\n self.y = y\n self.heading = heading\n self.length = length\n rads = to_rad(heading)\n self.x1 = Math.cos(rads) * length + x\n self.y1 = Math.sin(rads) * length + y\n rads = to_rad(heading + 120)\n self.x2 = Math.cos(rads) * length + x\n self.y2 = Math.sin(rads) * length + y\n rads = to_rad(heading - 120)\n self.x3 = Math.cos(rads) * length + x\n self.y3 = Math.sin(rads) * length + y\n end",
"title": ""
},
{
"docid": "d20b982c5c4ef28050eb351d3501840b",
"score": "0.59252477",
"text": "def ball_entry_zone\n Rectangle[@position, Point[width, 20]]\n end",
"title": ""
},
{
"docid": "ad7859dacf0b29240f45d3c594de0849",
"score": "0.5923176",
"text": "def initialize(params = {})\n @left = params[:left].to_f\n @top = params[:top].to_f\n @right = params[:right].to_f\n @bottom = params[:bottom].to_f\n end",
"title": ""
},
{
"docid": "51350f6d24049c5c6c436527a567d0c5",
"score": "0.59105384",
"text": "def area\n w*h\n end",
"title": ""
},
{
"docid": "3b5f5d3210b803d341fae0c9ac318d2f",
"score": "0.5909219",
"text": "def initialize\n @direction = :east\n @pos_x = 0\n @pos_y = 0\n end",
"title": ""
},
{
"docid": "09099f51eb0775885e298bb72479ab1c",
"score": "0.5909197",
"text": "def update_placement\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n end",
"title": ""
},
{
"docid": "09099f51eb0775885e298bb72479ab1c",
"score": "0.5909197",
"text": "def update_placement\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n end",
"title": ""
},
{
"docid": "ebfd94abe52344435203190202ee4e96",
"score": "0.58933306",
"text": "def params_rect_x;\n 250;\n end",
"title": ""
},
{
"docid": "66d5e7988c6c8f33e59dd0e6864c1a70",
"score": "0.5883629",
"text": "def initialize(x, y, width, height)\n end",
"title": ""
},
{
"docid": "66d5e7988c6c8f33e59dd0e6864c1a70",
"score": "0.5883629",
"text": "def initialize(x, y, width, height)\n end",
"title": ""
},
{
"docid": "66d5e7988c6c8f33e59dd0e6864c1a70",
"score": "0.5883629",
"text": "def initialize(x, y, width, height)\n end",
"title": ""
},
{
"docid": "66d5e7988c6c8f33e59dd0e6864c1a70",
"score": "0.5883629",
"text": "def initialize(x, y, width, height)\n end",
"title": ""
},
{
"docid": "93d20cd913002d8bc214757be1ec94aa",
"score": "0.58833843",
"text": "def rectify_theta\r\n wrap_rectify two_pi\r\n end",
"title": ""
},
{
"docid": "71a58da934dd965d5fba8950b6ff4f3c",
"score": "0.5869976",
"text": "def rect\n [real, imag]\n end",
"title": ""
},
{
"docid": "8282dae354ebe347b053c24fb2e84584",
"score": "0.5869844",
"text": "def cy\n self.y + height / 2\n end",
"title": ""
},
{
"docid": "bc851f1d8a03f255c7366e3ececac677",
"score": "0.5866324",
"text": "def initialize(cx,cy,r1,r2,px,py,qx,qy,angle)\n @cx,@cy,@r1,@r2,@px,@py,@qx,@qy=cx,cy,r1,r2,px,py,qx,qy\n @angle=angle\n super()\n end",
"title": ""
},
{
"docid": "3fcf5f2864fc86f63378e54388ffd2b5",
"score": "0.5863361",
"text": "def initialize(x, y, width, height)\n @x = x\n @y = y\n @width = width\n @height = height\n end",
"title": ""
},
{
"docid": "740e594c70f4694e2395415d2f384673",
"score": "0.5854303",
"text": "def rect(*args)\n Rafa::Elements::Rect.new(self, *args)\n end",
"title": ""
},
{
"docid": "b95075164c682a8852ee80cb5347a08c",
"score": "0.5826513",
"text": "def area_of_rectangle(width, height)\n # TODO: Implement me!\nend",
"title": ""
},
{
"docid": "8ebb69794c4035457c8be91bddc1b0ec",
"score": "0.5824637",
"text": "def top_angle\n\t\treturn Math.atan2(@width,@height) * ( 180 / Math::PI )\n\tend",
"title": ""
},
{
"docid": "5733539e47be9dc6cfa1c2d46cf765f7",
"score": "0.58223766",
"text": "def rect_points\n case @direction\n when :up\n [0, @origin_y, RAY_THICKNESS, @origin_y - @growth]\n when :down\n [0, 0, RAY_THICKNESS, @growth]\n when :left\n [@origin_x, 0, @origin_x - @growth, RAY_THICKNESS]\n when :right\n [0, 0, @growth, RAY_THICKNESS]\n end\n end",
"title": ""
},
{
"docid": "fd37e3fa93e6e24745ce9489ad01a227",
"score": "0.5807687",
"text": "def recta(m, x, x_o, y_o)\n y = m*(x-x_o)+y_o\n return y.floor\n end",
"title": ""
},
{
"docid": "8a10932eb382c207509c4b3471ba2d99",
"score": "0.5788755",
"text": "def inside_screen\n x_max, y_max = 440, 440\n x = 0 if self.x < 0 \n y = 0 if self.y < 0 \n x = x_max if self.x > x_max \n y = y_max if self.y > y_max \n end",
"title": ""
},
{
"docid": "42057f68bc9b478908f84984a425646d",
"score": "0.57821035",
"text": "def rectangleArea(w, h)\r\n w * h\r\nend",
"title": ""
},
{
"docid": "39834140ebcfe3468bf992267bffcba4",
"score": "0.5776451",
"text": "def getArea\n getWidth() * getHeight\n end",
"title": ""
},
{
"docid": "39834140ebcfe3468bf992267bffcba4",
"score": "0.5776451",
"text": "def getArea\n getWidth() * getHeight\n end",
"title": ""
},
{
"docid": "c19c2f21d479b6e119200facb5d87d20",
"score": "0.5762349",
"text": "def area\n width * height\n end",
"title": ""
},
{
"docid": "c19c2f21d479b6e119200facb5d87d20",
"score": "0.5762349",
"text": "def area\n width * height\n end",
"title": ""
},
{
"docid": "54c7a711984d2ebb16989072f8e85efd",
"score": "0.5760272",
"text": "def area\n @width*@height\n end",
"title": ""
},
{
"docid": "24581835618ba3c95c17d411ceaed09d",
"score": "0.5747389",
"text": "def rect_plot coordinate\n return perspective_projection( physical_projection( coordinate ))\n end",
"title": ""
},
{
"docid": "8e828d960a731866346864af313bdf82",
"score": "0.5743586",
"text": "def getArea\n (@base * @height)/2\n end",
"title": ""
},
{
"docid": "a074618d9208ff70f9fab7563d7faf06",
"score": "0.5742647",
"text": "def bounding_box(&block)\n PDF::Reader::Textangle.new(self,&block)\n end",
"title": ""
},
{
"docid": "7a24fab0af841c5bd6447d20d091ed54",
"score": "0.573335",
"text": "def area\n\t\t\t@area ||= bounding_box.area\n\t\tend",
"title": ""
},
{
"docid": "7a24fab0af841c5bd6447d20d091ed54",
"score": "0.573335",
"text": "def area\n\t\t\t@area ||= bounding_box.area\n\t\tend",
"title": ""
},
{
"docid": "35b1ed963844e8ce36a73811dce68045",
"score": "0.5732879",
"text": "def rectangleArea(h,w)\n h * w \nend",
"title": ""
},
{
"docid": "92251b03f302ce84460136d153ab090a",
"score": "0.57243687",
"text": "def rectangleArea(w, h)\n w * h \nend",
"title": ""
},
{
"docid": "16c4422259ab269d283bf3582521584d",
"score": "0.57220626",
"text": "def centerY\n y + height * 0.5\n end",
"title": ""
},
{
"docid": "2e0abc82dd7b67a479f3a67e6175b7f4",
"score": "0.57183284",
"text": "def upper_y\n self.y - self.oy;\n end",
"title": ""
},
{
"docid": "f6cc26dbcac9d23fa70cadd083d62a89",
"score": "0.5717358",
"text": "def initialize(x=0,y=0,w=0,h=0)\n if x.is_a? Float\n x1 = Loc.cvt_latlong_to_int(x)\n y1 = Loc.cvt_latlong_to_int(y)\n w = Loc.cvt_latlong_to_int(x+w) - x1\n h = Loc.cvt_latlong_to_int(y+h) - y1\n x,y = x1,y1\n end\n\n @x = x\n @y = y\n @w = w\n @h = h\n end",
"title": ""
},
{
"docid": "7e3300fc157796efdb3de076bc6a9a85",
"score": "0.57107645",
"text": "def angle()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "354431c2b774db411cd673c6d9537fcd",
"score": "0.5710364",
"text": "def area\n convert(self, :width) * convert(self, :height)\n end",
"title": ""
},
{
"docid": "3f6dca90506ee4985c076c3f9e04db1d",
"score": "0.5710199",
"text": "def initialize(upper_right_x, upper_right_y)\n parse_dimensions(upper_right_x, upper_right_y)\n end",
"title": ""
},
{
"docid": "56af79e059b6ff7453f79c6a7a7a7fc8",
"score": "0.5709349",
"text": "def display\n fill(0)\n stroke(0)\n stroke_weight(1)\n rect_mode(CENTER)\n a = b.get_angle\n push_matrix\n translate(x, y)\n rotate(-a)\n rect(0, 0, w, h)\n pop_matrix\n end",
"title": ""
},
{
"docid": "04343445a7aee2fcfd2f28388dcdcd17",
"score": "0.57090044",
"text": "def rectangleArea(l,w)\n l*w \nend",
"title": ""
},
{
"docid": "0e043632dc54704db6a669b59f943153",
"score": "0.5700356",
"text": "def getArea\n getWidth() * getHeight\n end",
"title": ""
},
{
"docid": "0e043632dc54704db6a669b59f943153",
"score": "0.5700356",
"text": "def getArea\n getWidth() * getHeight\n end",
"title": ""
}
] |
f0306409af3499ff68d9b2fac5191f1b | You need to specify a product. For a static library you can use PBXFileReference.new_static_library. | [
{
"docid": "e323b7f0ab4f0c7314ea6c823004d4de",
"score": "0.5709724",
"text": "def initialize(project, *)\n super\n self.name ||= product_name\n self.build_rule_references ||= []\n self.dependency_references ||= []\n\n unless build_phase_references\n self.build_phase_references = []\n\n source_build_phases.new\n copy_files_build_phases.new\n #shell_script_build_phases.new\n\n phase = frameworks_build_phases.new\n if frameworks_group = @project.groups.where(:name => 'Frameworks')\n frameworks_group.files.each { |framework| phase << framework }\n end\n end\n\n unless build_configuration_list\n self.build_configuration_list = project.objects.add(XCConfigurationList, {\n 'defaultConfigurationIsVisible' => '0',\n 'defaultConfigurationName' => 'Release',\n })\n # TODO or should this happen in buildConfigurationList?\n build_configuration_list.build_configurations.new_debug\n build_configuration_list.build_configurations.new_release\n end\n\n unless product\n self.product = @project.files.new_static_library(product_name)\n end\n end",
"title": ""
}
] | [
{
"docid": "8a24039c4ec6eda6408b26fb07008efe",
"score": "0.695657",
"text": "def new_product_ref_for_target(group, product_basename, product_type)\n if product_type == :static_library\n prefix = 'lib'\n end\n extension = Constants::PRODUCT_UTI_EXTENSIONS[product_type]\n path = \"#{prefix}#{product_basename}\"\n path += \".#{extension}\" if extension\n ref = new_reference(group, path, :built_products)\n ref.include_in_index = '0'\n ref.set_explicit_file_type\n ref\n end",
"title": ""
},
{
"docid": "8ae4787bbff61afbae3192ef0ffb18be",
"score": "0.66713345",
"text": "def new_bundle(product_basename)\n FileReferencesFactory.new_bundle(self, product_basename)\n end",
"title": ""
},
{
"docid": "b0fbdbd41304f4370f75c416cd700408",
"score": "0.6644887",
"text": "def new_bundle(group, product_basename)\n ref = new_reference(group, \"#{product_basename}.bundle\", :built_products)\n ref.include_in_index = '0'\n ref.set_explicit_file_type('wrapper.cfbundle')\n ref\n end",
"title": ""
},
{
"docid": "0b27c3ec139baf1ee2c7fc25d4f7c2ae",
"score": "0.61454797",
"text": "def static_library_extension\n self.is_windows? ? '.lib' : '.a'\n end",
"title": ""
},
{
"docid": "f215269df089ac8391e4e9abafd93793",
"score": "0.6083338",
"text": "def new_product_ref_for_target(product_basename, product_type)\n FileReferencesFactory.new_product_ref_for_target(self, product_basename, product_type)\n end",
"title": ""
},
{
"docid": "c9ed96acb48aca33ac58fe281b193dbc",
"score": "0.60121626",
"text": "def handle_new_library(asset)\n case asset['lang']\n when Conflux::Langs::RUBY\n Conflux::Langs.install_ruby_gem(asset['name'], version: asset['version'], add_to_gemfile: true)\n end\n end",
"title": ""
},
{
"docid": "f3ce817eb2f14837566e3a4cc3e939c4",
"score": "0.57678723",
"text": "def newExternalProduct(externalProductFileName, fileType, containerItemProxy)\n # serious error: containerItemProxy undefined or is the wrong type of proxy.\n throw :bad_container_item_proxy unless @p['objects'].include?(containerItemProxy) && @p['objects'][containerItemProxy]['isa'] == 'PBXContainerItemProxy' && @p['objects'][containerItemProxy]['proxyType'] == @PROXYTYPE_PRODUCT\n \n newObject('PBXReferenceProxy', {\n 'path' => externalProductFileName,\n 'fileType' => fileType,\n 'remoteRef' => containerItemProxy, # The containerItemProxy for the product (@PROXYTYPE_PRODUCT)\n 'sourceTree' => 'BUILT_PRODUCTS_DIR'\n })\n end",
"title": ""
},
{
"docid": "32d0a38137d1e725141ad44643918529",
"score": "0.5755347",
"text": "def library component,system_config\n ext_obj,ext_lib,ext_exe = *system_config.extensions(component.platform)\n File.join(system_config.out,component.platform,component.name,\"#{component.name}#{ext_lib}\")\n end",
"title": ""
},
{
"docid": "d5098943188ffd7ab9a3560136c11431",
"score": "0.5706846",
"text": "def create_library(name, sample)\n library = name + '_library'\n cmd = 'genome library create --sample=' + sample + ' --name=' + library\n $file.puts(cmd)\n return library \nend",
"title": ""
},
{
"docid": "0fc687555267f324057c5d0826713869",
"score": "0.56597394",
"text": "def library(component, system_config)\n _, ext_lib, ext_exe = *system_config.extensions(component.platform)\n File.join(system_config.out, component.platform, component.name, \"#{component.name}#{ext_lib}\")\n end",
"title": ""
},
{
"docid": "0c38c95cb677314b0e0b32d5b8c3ff89",
"score": "0.56534487",
"text": "def source_file\n return PRODUCT_FILE\n end",
"title": ""
},
{
"docid": "4e7060ae38387ddc59fa50bb8adeab5d",
"score": "0.5602058",
"text": "def add_earlgrey_product\n return @add_earlgrey_product if @add_earlgrey_product\n framework_path = if carthage\n '${SRCROOT}/Carthage/Build/iOS/EarlGrey.framework'\n else\n '${SRCROOT}/Pods/EarlGrey/EarlGrey-1.0.0/EarlGrey.framework'\n end\n\n framework_ref = user_project.products_group.files.find { |f| f.path == framework_path }\n return @add_earlgrey_product = framework_ref if framework_ref\n\n framework_ref = user_project.products_group.new_file(framework_path)\n framework_ref.source_tree = 'SRCROOT'\n\n @add_earlgrey_product = framework_ref\n end",
"title": ""
},
{
"docid": "830a7cc5208a668e1fa635b69beef890",
"score": "0.55622953",
"text": "def library_name\n\t\tRex::Text::rand_text_alpha(8) + \".dll\"\n\tend",
"title": ""
},
{
"docid": "23c55c166e971b69f4ee72e44ad7f6ba",
"score": "0.5543357",
"text": "def lib(params)\n\t\tsym = requireParam(params, :sym)\n\t\tname = canonicalizeFilepath(Pathname.new(params[:name] || sym.to_s), Pathname.pwd())\n\t\tmodules = requireParam(params, :modules)\n\t\tmodules = canonicalizeFilepaths(modules.map {|modpath| Pathname.new modpath}, Pathname.pwd())\n\t\tStaticLibBuilder.new(:name => name, :modules => modules)\n\tend",
"title": ""
},
{
"docid": "5036fa8ecb542652db403ae108db364c",
"score": "0.5539216",
"text": "def init()\n # status = LexActivator.SetProductFile(\"ABSOLUTE_PATH_OF_PRODUCT.DAT_FILE\")\n status = LexActivator.SetProductData(LexActivator::encode_utf16(\"PASTE_CONTENT_OF_PRODUCT.DAT_FILE\"))\n if LexStatusCodes::LA_OK != status\n puts \"Error Code: #{status}\"\n exit(status)\n end\n\n status = LexActivator.SetProductId(LexActivator::encode_utf16(\"PASTE_PRODUCT_ID\"), LexActivator::PermissionFlags::LA_USER)\n if LexStatusCodes::LA_OK != status\n puts \"Error Code: #{status}\"\n exit(status)\n end\n\n status = LexActivator.SetAppVersion(LexActivator::encode_utf16(\"PASTE_YOUR_APP_VERION\"))\n if LexStatusCodes::LA_OK != status\n puts \"Error Code: #{status}\"\n exit(status)\n end\nend",
"title": ""
},
{
"docid": "2b5efcb1fe346b81c5f80bf3236e48a0",
"score": "0.5446729",
"text": "def newBuiltResourceFile(name, group, targets=[], buildPhase = 'PBXResourcesBuildPhase')\n fileRef = newProductFileReference(getFileTypeForFile(name), name)\n addToGroup(fileRef, group)\n if targets\n targets.each { |target|\n # create PBXBuildFile\n uuidBuildFile = newObject('PBXBuildFile', {'fileRef' => fileRef, 'comment' => File.basename(name)})\n uuidBuildPhase = ensureBuildPhaseForTarget(buildPhase, target)\n @p['objects'][uuidBuildPhase]['files'].push(uuidBuildFile)\n }\n end\n fileRef\n end",
"title": ""
},
{
"docid": "142318156961cba29d99cd3622da9df0",
"score": "0.544647",
"text": "def library_obj_argument(val)\n val = lib_path_argument(val)\n ::Boson.invoke :load_library, val\n val\n end",
"title": ""
},
{
"docid": "7d73bc6bc7a75e8b2ae6ee76653d7bed",
"score": "0.5437303",
"text": "def liburi name=nil\n @liburi = name unless name.nil?\n @liburi\n end",
"title": ""
},
{
"docid": "19913d891936dbace9acb14dfafe1572",
"score": "0.5398926",
"text": "def process_lib src, file_name\n LibraryProcessor.new(@tracker).process_library src, file_name\n end",
"title": ""
},
{
"docid": "7fd45a2b4376a1066974de1758686801",
"score": "0.53861374",
"text": "def vendor(filename, data = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "84419676ea4cf274f95d19506c65fcfa",
"score": "0.5382528",
"text": "def make_reference(project, path)\n fileRef = project.new(Xcodeproj::Project::Object::PBXFileReference)\n fileRef.path = path\n return fileRef\nend",
"title": ""
},
{
"docid": "84419676ea4cf274f95d19506c65fcfa",
"score": "0.5382528",
"text": "def make_reference(project, path)\n fileRef = project.new(Xcodeproj::Project::Object::PBXFileReference)\n fileRef.path = path\n return fileRef\nend",
"title": ""
},
{
"docid": "84419676ea4cf274f95d19506c65fcfa",
"score": "0.5382528",
"text": "def make_reference(project, path)\n fileRef = project.new(Xcodeproj::Project::Object::PBXFileReference)\n fileRef.path = path\n return fileRef\nend",
"title": ""
},
{
"docid": "fad2129a63613b32764dbc6644a3590e",
"score": "0.53614956",
"text": "def lib; end",
"title": ""
},
{
"docid": "a39725765934ccb577a4fb592766b500",
"score": "0.5357044",
"text": "def add_asset_include_in_library(asset)\n click_add_new_asset asset\n if asset.type == 'File'\n enter_file_path_for_upload asset.file_name\n enter_file_metadata(asset)\n check_add_file_to_library_cbx\n click_add_files_button\n else\n enter_url_metadata asset\n check_add_link_to_library_cbx\n click_add_url_button\n end\n end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.5323557",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.5323557",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.5323557",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.5323557",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.5322908",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "0a8b1249c808b96ffd92ea8e33509e80",
"score": "0.5321617",
"text": "def add_library_file(file_name, folder_id, description, source, file_type, contents)\n Services::LibraryService.add_library_file(file_name, folder_id, description, source, file_type, contents)\n end",
"title": ""
},
{
"docid": "740941ea1b1d9d95e1c67d930337fcbc",
"score": "0.53213227",
"text": "def add_file(file_path, group, project)\n file = group.new_file(file_path)\n if file.last_known_file_type == 'folder.assetcatalog' # check if is asset catalog to add as a resource\n project.native_targets.each { |target| target.add_resources([file]) if !target.test_target_type? }\n else\n project.native_targets.each { |target| target.add_file_references([file]) if !target.test_target_type? }\n end\nend",
"title": ""
},
{
"docid": "3feb47cc036b57268c2827b8799a60eb",
"score": "0.53200865",
"text": "def newExternalTargetDependency(externalProjectPath, externalTargetUUID, externalTargetName, externalProductUUID, externalProductName)\n unless isID?(externalTargetUUID) && isID?(externalProductUUID)\n $stderr.puts \"ERROR: invalid external target id '#{externalTargetUUID}'\" unless isID?(externalTargetUUID)\n $stderr.puts \"ERROR: invalid external product id '#{externalProductUUID}'\" unless isID?(externalProductUUID)\n throw :invalid_parameter\n end\n # We need a reference to the project file..\n xprojRef = newExternalProject(externalProjectPath)\n # Add the project file to the main group.. (REVIEW: Do we want these elsewhere? Either automatically, or as an option?)\n addToGroup(xprojRef, self.rootGroup)\n # We need container item proxies for the external target and product..\n targetContainerItemProxy = newContainerItemProxy(xprojRef, externalTargetUUID, externalTargetName, @PROXYTYPE_TARGET)\n productContainerItemProxy = newContainerItemProxy(xprojRef, externalProductUUID, externalProductName, @PROXYTYPE_PRODUCT)\n # We need a reference proxy for the external product (this takes the place of a PBXFileReference)..\n externalProduct = newExternalProduct(externalProductName, getFileTypeForFile(externalProductName), productContainerItemProxy)\n # We need a new 'Products' group to hold the reference to the external product...\n productGroupForExternalProduct = newGroupExplicit('Products', nil)\n # Add this product group to the global list..\n setObjectProperty(self.project, 'productReferences', []) unless objectHasProperty?(self.project, 'productReferences')\n @p['objects'][self.project]['productReferences'].push(productGroupForExternalProduct)\n # Add the product reference proxy to that product group..\n addToGroup(externalProduct, productGroupForExternalProduct)\n # Create the target dependency..\n targetDependency = newObject('PBXTargetDependency', {'name' => externalTargetName, 'targetProxy' => targetContainerItemProxy})\n # RETURN targetDependency\n end",
"title": ""
},
{
"docid": "14a2ec58d0db199600e0ea93da8bcd77",
"score": "0.530348",
"text": "def perhaps_use_library_image\n self.file = open(library_image.file.file) if library_image\n end",
"title": ""
},
{
"docid": "eb96227bcfae9c3d4544b4269953cc6d",
"score": "0.52993083",
"text": "def add_earlgrey_product(project, carthage)\n framework_path = if carthage\n CARTHAGE_FRAMEWORK_PATH\n else\n POD_FRAMEWORK_PATH\n end\n\n framework_ref = project.frameworks_group.files.find do |f|\n # TODO: should have some md5 check on the actual binary\n f.path == framework_path\n end\n unless framework_ref\n framework_ref = project.frameworks_group.new_file(framework_path)\n framework_ref.source_tree = 'SOURCE_ROOT'\n end\n framework_ref\n end",
"title": ""
},
{
"docid": "6f46bd34dba332578397acdc96ad607b",
"score": "0.52784234",
"text": "def initialize(product: nil,\n platform: nil,\n data_formats: [],\n files: nil)\n @product_id = product\n @platform = platform\n @data_formats = data_formats\n @hash = {}\n if files\n @files = files\n else\n @files = Dir.glob(__dir__ + '/cmd_ref/*.yaml')\n end\n\n build_cmd_ref\n end",
"title": ""
},
{
"docid": "e118abb60cf68da9f0eef92359093fc3",
"score": "0.5251826",
"text": "def create_package(product_code='DSO', flavor='OPENSOURCE')\n check_if_type_supplied(product_code, flavor)\n\n depends :init, :compile\n call_actions :__assemble, :__package\n end",
"title": ""
},
{
"docid": "59d0346c3c5b95d7071c128cf7dff28b",
"score": "0.52338505",
"text": "def create_package(product_code='DSO', flavor=OPENSOURCE)\n check_if_type_supplied(product_code, flavor)\n\n depends :init, :compile\n call_actions :__assemble, :__package\n end",
"title": ""
},
{
"docid": "39b7740eefd1557b0d2723caf4aac79e",
"score": "0.52313185",
"text": "def library(name, base_path = __FILE__) \n QEDProject::Libraries::Base.libs ||= {}\n QEDProject::Libraries::Base.libs[name] = self\n class_eval do\n define_method :library do\n name\n end\n \n define_method :vendor_root do\n File.expand_path(\"../../../../vendor\", base_path)\n end\n \n end\n end",
"title": ""
},
{
"docid": "398b26846b067572d33c3be92eb901d5",
"score": "0.5218147",
"text": "def build_library\n filter_tasks('Installed Libraries', /^determine_library_/)\n end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.5202109",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.5202109",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.5202109",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.5202109",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.5202109",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "67a132e3a89b89669bdbac767564af89",
"score": "0.5200283",
"text": "def library_start\n end",
"title": ""
},
{
"docid": "67a132e3a89b89669bdbac767564af89",
"score": "0.5200283",
"text": "def library_start\n end",
"title": ""
},
{
"docid": "4825f6249a2fae354d0de7547a6d9f0d",
"score": "0.5187926",
"text": "def cplib\n DELIV::confEnsureLoaded\n raise \"cplib is not valid from here\" unless branch != 'trunk' and sourceOrLib == 'Sources'\n raise \"Accroding to the configuration file, this module cannot be delivered as library.\" unless DELIV::conf.libDeliveryCopy\n updateDelivInfo(:library)\n puts \"preparing to copy '/Sources/#{moduleName}/#{branch}/...'\"\n\n release=nextRelease\n puts \"to '#{@releasePath}#{release}/'.\"\n\n upToDateCheck\n checkLog(:library,release)\n\n tempdir=ENV['TMPDIR']\n tempdir='/tmp' unless tempdir\n tempdir+=\"/deliv_lib_#{ENV['USER']}#{@releasePath.gsub(/\\/(Libraries\\/)?/,'_')}#{release}\"\n puts \"preparing delivery in #{tempdir}...\"\n SVN::checkout(@releaseUrl,tempdir,\"--depth empty\")\n\n libReldir=\"#{tempdir}/#{release}\"\n SVN::mkdir(libReldir)\n DELIV::conf.libDeliveryCopy.each { |e|\n puts \"- #{e}:\"\n dirs=e.split('/')\n mod=dirs.pop\n r=''\n while(d=dirs.shift) do\n r+=d+'/'\n puts \" svn mkdir [LIB]/#{r}\"\n SVN::mkdir(\"#{libReldir}/#{r}\") unless FileTest.directory?(\"#{libReldir}/#{r}\")\n end\n puts \" svn copy [SRC]/#{e} [LIB]/#{e}\"\n SVN::copy(e,\"#{libReldir}/#{e}\")\n }\n if !FileTest.exist?(\"#{libReldir}/#{CHANGELOG_FILENAME}\") then\n puts \" svn copy [SRC]/#{CHANGELOG_FILENAME} [LIB]/#{CHANGELOG_FILENAME}\"\n SVN::copy(CHANGELOG_FILENAME,\"#{libReldir}/#{CHANGELOG_FILENAME}\")\n end\n SVN::commit(libReldir,\"Delivery of #{moduleName} Libraries into #{release}\")\n puts \"Cleaning up #{tempdir}...\"\n system \"rm -rf #{tempdir}\"\n if $? != 0 then\n puts \"cound not remove temporary directory: '#{tempdir}'\"\n end\n end",
"title": ""
},
{
"docid": "7a1362a541e47537c30ec0f2653e3450",
"score": "0.51796794",
"text": "def new_so (name) \n tgts = File.expand_path(name)\n tgtd = File.dirname(name)\n $stderr.puts \"new_so: #{tgtd} from #{tgts}\"\n objs = []\n SubDirs.each do |f|\n d = File.dirname(f)\n objs = objs + FileList[\"#{d}/*.o\"] \n end\n objs = objs + FileList[\"shoes/native/gtk/*.o\"]\n main_o = 'shoes/main.o'\n objs = objs - [main_o]\n sh \"ar -rc #{tgtd}/shoes.lib #{objs.join(' ')}\"\n sh \"ranlib #{tgtd}/shoes.lib\" \n end",
"title": ""
},
{
"docid": "bdc2fd4a2c713e4fd26498a83dcb0c6c",
"score": "0.5165353",
"text": "def change_platform(platform_name_str)\n require \"#{LIBNAME}/platforms/\" + platform_name_str\n $platform_name = platform_name_str\nend",
"title": ""
},
{
"docid": "6f09a2b5e9f846ce4f8f63392edcba58",
"score": "0.51611054",
"text": "def define\n lib('.', 'package.rb')\n end",
"title": ""
},
{
"docid": "6f09a2b5e9f846ce4f8f63392edcba58",
"score": "0.51611054",
"text": "def define\n lib('.', 'package.rb')\n end",
"title": ""
},
{
"docid": "6f09a2b5e9f846ce4f8f63392edcba58",
"score": "0.51611054",
"text": "def define\n lib('.', 'package.rb')\n end",
"title": ""
},
{
"docid": "b12d729f0807ac93c0da2b5bdd2f88e2",
"score": "0.5148038",
"text": "def object_file_path aSimId # :nodoc:\n path = File.expand_path File.join(OBJECT_PATH, \"#{aSimId}.so\")\n\n unless File.exist? path\n raise \"Object file #{path.inspect} is missing. Rebuild Ruby-VPI.\"\n end\n\n path\nend",
"title": ""
},
{
"docid": "2050cd7178bbd3d00944072fd8a9e90f",
"score": "0.5141072",
"text": "def lib(filename, data = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "455f6f1a0d244366ea62b657ebbaaed8",
"score": "0.51326036",
"text": "def use\n Mortar::BaconBits::Lib.ensure_dir_exists \"vendor\"\n bacon_bits_dir = Mortar::BaconBits::Lib.install_dir()\n FileUtils.cp_r(\"#{bacon_bits_dir}/macros\", \"vendor\")\n FileUtils.cp_r(\"#{bacon_bits_dir}/udfs\", \"vendor\")\n end",
"title": ""
},
{
"docid": "5b38f9a3bfd9371baf36dcd7c8ee8f7a",
"score": "0.51218235",
"text": "def product(product_code)\n case product_code\n when \"VS5\"\n Product::VegemiteScroll.new\n when \"MB11\"\n Product::BlueberryMuffin.new\n when \"CF\"\n Product::Croissant.new\n else\n raise \"This product is unavailable!\"\n end\n end",
"title": ""
},
{
"docid": "c9d930db9d607ef58be4ceac4b6debaf",
"score": "0.51192355",
"text": "def newNativeTarget(name, dependencies, buildConfigurationList, productType, explicitFileType)\n uuid = newObject('PBXNativeTarget', {\n 'buildConfigurationList' => buildConfigurationList,\n 'buildPhases' => [],\n 'buildRules' => [],\n 'dependencies' => dependencies,\n 'name' => self.strip_ext(name),\n 'productName' => self.strip_ext(name),\n 'productReference' => newProductFileReference(explicitFileType, name),\n 'productType' => productType,\n 'comment' => \"target #{name}\"\n })\n \n @p['objects'][self.project]['targets'].push(uuid)\n \n uuid\n end",
"title": ""
},
{
"docid": "8ed343e6c76467858a2fec26494d5700",
"score": "0.51134896",
"text": "def action\n server = BuildServer.new\n server.build_partial_bundle_for_platform(@platform, @filename)\n end",
"title": ""
},
{
"docid": "3af99b76a3b95098ec593dc391c27025",
"score": "0.51086795",
"text": "def libs; end",
"title": ""
},
{
"docid": "e532e115dd8cfef491935fd48babf7a1",
"score": "0.5100159",
"text": "def postscript(ant, build_environment, product_directory, *args)\n return if @no_demo\n return if @no_external_resources\n\n args.each do |resource_def|\n assemble_external_resource(resource_def)\n end\n end",
"title": ""
},
{
"docid": "c80534bd17e4115e6c0a7b852c1e7140",
"score": "0.5088939",
"text": "def ffi_lib(*)\n super(Spotify::Heroku.libspotify_path)\n end",
"title": ""
},
{
"docid": "67fb2f3be8566d766b11d3abc469cbff",
"score": "0.5073505",
"text": "def shlib_file name, objs\n implib = distdir('lib', \n File.basename(name.sub(/#{shlibext}$/, implibext)))\n expfile = implib.sub(/#{implibext}$/, '.exp')\n manifest = \"#{name}.manifest\"\n\n file name => objs do\n make_shared_library(name, objs, implib)\n end\n\n CLEAN.include objs\n CLOBBER.include name, implib, manifest, expfile\n\n name\n end",
"title": ""
},
{
"docid": "b4a0e74be039ad34d7a342005e8aa3b8",
"score": "0.5068664",
"text": "def add_library_file(access_token, file_name, folder_id, description, source, file_type, contents)\n Services::LibraryService.add_library_file(access_token, file_name, folder_id, description, source, file_type, contents)\n end",
"title": ""
},
{
"docid": "b54972850a19695459dafb60999c3173",
"score": "0.50672096",
"text": "def library_of_name(name)\n raise ArgumentError, \"name is not a String (got #{name.class})\" unless name.is_a? String\n\n CppLibrary.new(name, self)\n end",
"title": ""
},
{
"docid": "aa228d905aff1c52742ac7a5023e6db6",
"score": "0.50576025",
"text": "def link_dll(project)\n begin\n # Check for object files\n raise \" No object files found\" if @obj_files.empty?\n \n # Run the linker command\n command = \"g++ -shared -o lib#{project.name}.so \" + @obj_files.join(' ')\n system(command + ' &> ' + COMPILER_OUTPUT_FILEPATH)\n \n # If the command failed, raise the errors\n raise Utils.read_file(COMPILER_OUTPUT_FILEPATH, ' ') if !$?.success?\n rescue => e\n raise raise \"Linker Errors:\\n\\n#{e.message}\\n\"\n end\n end",
"title": ""
},
{
"docid": "aa040d4e99d6aad98e128e6cb47d7965",
"score": "0.50529873",
"text": "def library\n library = Library::fetch_library(self.library_code)\n end",
"title": ""
},
{
"docid": "1e88ba7ccf414f8a9b3dfabf775a7033",
"score": "0.5043553",
"text": "def add_library name, path\n if path.is_a?(Array)\n path = path.collect { |p| expand_local_path(p) }\n else\n path = expand_local_path path\n end\n library = Sprout::Library.new( :name => name, :path => path, :file_target => self )\n libraries << library\n library\n end",
"title": ""
},
{
"docid": "8725c6410cf40ef505c96349acffbad4",
"score": "0.50352496",
"text": "def make_so(name)\n puts \"make_so: #{name}\"\n name = 'dist/shoes.a'\n sh \"ar rc #{name} #{OBJ.join(' ')}\"\n sh \"ranlib #{name}\"\n end",
"title": ""
},
{
"docid": "c9bef7525dfa81b519a9c105e25fad44",
"score": "0.50165594",
"text": "def bundle_framework(framework_name)\n framework_id, framework_values = object_for_name(framework_name)\n \n # create a new file wrapper for in the copy build phase\n framework_in_build_phase_id = generate_object_id\n framework_in_build_phase_values = {\n 'isa' => 'PBXBuildFile',\n 'fileRef' => framework_id\n }\n add_object(framework_in_build_phase_id, framework_in_build_phase_values)\n \n # get or define the Copy Frameworks build phase\n build_phase = object_for_name('Copy Frameworks')\n if build_phase.nil?\n build_phase_id, build_phase_values = new_framework_copy_build_phase\n # add the new build phase to the objects\n add_object(build_phase_id, build_phase_values)\n \n # add the new build phase to the project target\n add_build_phase_to_project_target(build_phase_id)\n else\n build_phase_id, build_phase_values = build_phase\n end\n # add the framework to the build phase\n add_object_to_build_phase(framework_in_build_phase_id, build_phase_id)\n end",
"title": ""
},
{
"docid": "1cd7eecc23c755fed41c01d752fb7980",
"score": "0.5015368",
"text": "def add_file_to_frameworks(name, guid)\n #return self.add_file_to_group(name, guid, 'Frameworks')\n end",
"title": ""
},
{
"docid": "990fd92efc9175cf81fe47990a756c08",
"score": "0.5008521",
"text": "def library\n @library ||= Boson.library(@lib)\n end",
"title": ""
},
{
"docid": "be0fa052e66175a79a18265c37a38dc6",
"score": "0.5004297",
"text": "def tailor_package_resource_to_platform\n @package.source(download_path)\n end",
"title": ""
},
{
"docid": "be0fa052e66175a79a18265c37a38dc6",
"score": "0.5004297",
"text": "def tailor_package_resource_to_platform\n @package.source(download_path)\n end",
"title": ""
},
{
"docid": "c020d09f403dbb58d0257ee0f1e5cf8e",
"score": "0.5000438",
"text": "def libs = [\"hscript\", \"mcli\", \"tink_lang\", \"dox\"]",
"title": ""
},
{
"docid": "b10ddc76e3a7c2db9768aa8accdb8bbb",
"score": "0.49984458",
"text": "def format_linking(file, build_variant, arch)\n start_new_compilation_phase\n EMPTY;\n end",
"title": ""
},
{
"docid": "df00c74849acb4352278f646ed0ce7c1",
"score": "0.49978703",
"text": "def object_file src,component,system_config\n ext_obj,ext_lib,ext_exe = *system_config.extensions(component.platform)\n src.pathmap(\"#{system_config.out}/#{component.platform}/#{component.parent ? component.parent.name : ''}/#{component.name}/%n#{ext_obj}\")\n end",
"title": ""
},
{
"docid": "320671f5de09f9ae2c7818e29dea9171",
"score": "0.49950635",
"text": "def section\n 'libs'\n end",
"title": ""
},
{
"docid": "1c4f38b27af6d403d78c2afab5edd128",
"score": "0.49847832",
"text": "def get_library_name\n\t\tend",
"title": ""
},
{
"docid": "42c391bcefdccbbf42728ffcb58885d2",
"score": "0.4981611",
"text": "def release\n\t java_opts = @droplet.java_opts\n\t java_opts.add_system_property('java.library.path', \"$PWD/#{(@droplet.sandbox).relative_path_from(@droplet.root)}\")\n end",
"title": ""
},
{
"docid": "6f37a3f2eb6c3ac54e3789db6844828b",
"score": "0.49749696",
"text": "def isReflibs\n @RecordType == REFLIBS\n end",
"title": ""
},
{
"docid": "bce7ed8c7d432ab2ca9b9ca65067daeb",
"score": "0.49681795",
"text": "def new_subproject(group, path, source_tree)\n ref = new_file_reference(group, path, source_tree)\n ref.include_in_index = nil\n\n product_group_ref = find_products_group_ref(group, true)\n\n subproj = Project.open(path)\n subproj.products_group.files.each do |product_reference|\n container_proxy = group.project.new(PBXContainerItemProxy)\n container_proxy.container_portal = ref.uuid\n container_proxy.proxy_type = Constants::PROXY_TYPES[:reference]\n container_proxy.remote_global_id_string = product_reference.uuid\n container_proxy.remote_info = 'Subproject'\n\n reference_proxy = group.project.new(PBXReferenceProxy)\n extension = File.extname(product_reference.path)[1..-1]\n reference_proxy.file_type = Constants::FILE_TYPES_BY_EXTENSION[extension]\n reference_proxy.path = product_reference.path\n reference_proxy.remote_ref = container_proxy\n reference_proxy.source_tree = 'BUILT_PRODUCTS_DIR'\n\n product_group_ref << reference_proxy\n end\n\n attribute = PBXProject.references_by_keys_attributes.find { |attrb| attrb.name == :project_references }\n project_reference = ObjectDictionary.new(attribute, group.project.root_object)\n project_reference[:project_ref] = ref\n project_reference[:product_group] = product_group_ref\n group.project.root_object.project_references << project_reference\n\n ref\n end",
"title": ""
},
{
"docid": "e452bdb27bf6828047da500e52112f60",
"score": "0.49609473",
"text": "def new\n @library = Library.new\n end",
"title": ""
},
{
"docid": "7635a8c0f191f313e97528daae2fa168",
"score": "0.49584642",
"text": "def library_type; end",
"title": ""
},
{
"docid": "f7ab6aa3256e847e29fd98873e6125a7",
"score": "0.49569342",
"text": "def static_setup (so_list)\n $stderr.puts \"setup: dir=#{`pwd`}\"\n rbvt = RUBY_V\n rbvm = RUBY_V[/^\\d+\\.\\d+/]\n mkdir_p \"#{TGT_DIR}/lib\"\n mkdir_p \"#{TGT_DIR}/fonts\"\n cp_r \"fonts\", \"#{TGT_DIR}/fonts\"\n mkdir_p \"#{TGT_DIR}/lib\"\n cp \"lib/shoes.rb\", \"#{TGT_DIR}/lib\"\n cp_r \"lib/shoes\", \"#{TGT_DIR}/lib\"\n cp_r \"lib/exerb\", \"#{TGT_DIR}/lib\"\n cp_r \"samples\", \"#{TGT_DIR}/samples\"\n cp_r \"static\", \"#{TGT_DIR}/static\"\n cp \"README.md\", \"#{TGT_DIR}/README.txt\"\n cp \"CHANGELOG\", \"#{TGT_DIR}/CHANGELOG.txt\"\n cp \"COPYING\", \"#{TGT_DIR}/COPYING.txt\"\n # clean out leftovers from last build\n #rm_f \"#{TGT_DIR}/libruby.so\" if File.exist? \"#{TGT_DIR}/libruby.so\"\n #rm_f \"#{TGT_DIR}/libruby.so.#{rbvm}\" if File.exist? \"#{TGT_DIR}/libruby.so.#{rbvm}\"\n #rm_f \"#{TGT_DIR}/libruby.so.#{rbvt}\" if File.exist? \"#{TGT_DIR}/libruby.so.#{rbvt}\"\n cp_r \"#{EXT_RUBY}/lib/ruby\", \"#{TGT_DIR}/lib\", remove_destination: true\n # copy and link libruby.so\n cp \"#{EXT_RUBY}/lib/libruby.so.#{rbvm}\", \"#{TGT_DIR}\"\n\n # copy include files - it might help build gems\n mkdir_p \"#{TGT_DIR}/lib/ruby/include/ruby-#{rbvt}\"\n cp_r \"#{EXT_RUBY}/include/ruby-#{rbvt}/\", \"#{TGT_DIR}/lib/ruby/include\"\n chdir TGT_DIR do\n ln_s \"libruby.so.#{rbvm}\", \"libruby.so\"\n end \n SOLOCS.each_value do |path|\n cp \"#{path}\", \"#{TGT_DIR}\"\n end \n end",
"title": ""
},
{
"docid": "21f1867ad31bb7fa213f361bba51c1af",
"score": "0.49537987",
"text": "def bundle_identifier\n value_for_build_setting('PRODUCT_BUNDLE_IDENTIFIER')\nend",
"title": ""
},
{
"docid": "60bddd0947cde2936fce17887ed3d753",
"score": "0.49527937",
"text": "def cargo_shared_library\n @cargo_shared_library ||= begin\n filename = \"#{library_name}.#{shared_ext}\"\n filename = \"lib#{filename}\" unless Gem.win_platform?\n filename\n end\n end",
"title": ""
},
{
"docid": "0ba21bab914c0e4e0c89086a79fcc2ac",
"score": "0.49514195",
"text": "def lib(package_dir, include, exclude = '')\n files(package_dir, \"#{Automation::FET_DIR}/#{@name}\", include, exclude)\n end",
"title": ""
},
{
"docid": "9db3c940611625fdad1a431087f4d1a1",
"score": "0.49480173",
"text": "def uhook_new_asset\n ::AssetPublic.new\n end",
"title": ""
},
{
"docid": "4210fb755aa544540a99ef326dae0329",
"score": "0.49447012",
"text": "def link_binary_with_libraries_phase(target)\n puts \"Link binary with libraryes\"\n phase = target.build_phases.find { |phase| phase.is_a?(Xcodeproj::Project::Object::PBXFrameworksBuildPhase) }\n $frameworks.each do | fw |\n file_ref = Xcodeproj::Project::Object::PBXFileReference.new($project, $project.generate_uuid)\n file_ref.path = fw\n file_ref.source_tree = \"<group>\"\n file_ref.last_known_file_type = \"wrapper.framework\"\n file_ref.name = /.*\\/(.*)\\.framework/.match(fw)[1]\n phase.add_file_reference(file_ref, true)\n end\nend",
"title": ""
},
{
"docid": "10489c48e3b67dbadd00b290ada77b3c",
"score": "0.49434757",
"text": "def ld(lib)\n load lib.to_s + '.rb'\nend",
"title": ""
},
{
"docid": "7f5308842743906813b2d16a0f40965a",
"score": "0.4936323",
"text": "def create_copy_resources_script\n path = library.copy_resources_script_path\n UI.message \"- Generating copy resources script at #{UI.path(path)}\" do\n resources = library.file_accessors.map { |accessor| accessor.resources.flatten.map {|res| project.relativize(res)} }.flatten\n resources << bridge_support_file if bridge_support_file\n generator = Generator::CopyResourcesScript.new(resources)\n generator.save_as(path)\n add_file_to_support_group(path)\n end\n end",
"title": ""
},
{
"docid": "d6d8e4314cfea4ca6daa6f8dd2fe102f",
"score": "0.49203795",
"text": "def test_availability_options_accessible_in_initialize\n generator = Mkrf::Generator.new('testlib', ['lib/*.c'], {:loaded_libs => 'static_ruby'})\n assert_equal ['static_ruby'], generator.available.loaded_libs\n end",
"title": ""
},
{
"docid": "6ad9f72386b687405bb3c7a798e955c9",
"score": "0.49128544",
"text": "def statically_link_only_referenced_classes\n\t\tlibrary_path\n\tend",
"title": ""
},
{
"docid": "d4a33b4041f6220e90c350eeec129b25",
"score": "0.49068445",
"text": "def createAsset(site, relative_dir, file_name, langcode, process = true)\n # Don't process underscore files.\n if relative_dir =~ /^_/\n return nil\n end\n\n # Copy across other assets.\n asset = LanguageAsset.new(site, relative_dir, file_name, langcode)\n site.static_files << asset\n\n return nil\n end",
"title": ""
},
{
"docid": "bbadf0e94a094d831cd0e171539dc91e",
"score": "0.49067283",
"text": "def ffi_lib(*)\n super(Mock.path)\n end",
"title": ""
},
{
"docid": "bbadf0e94a094d831cd0e171539dc91e",
"score": "0.49067283",
"text": "def ffi_lib(*)\n super(Mock.path)\n end",
"title": ""
},
{
"docid": "f582f26e64a87e4a827f9a2499e42d03",
"score": "0.4906674",
"text": "def commercial_use\n nil\n end",
"title": ""
},
{
"docid": "2612d87acc1bf61aa3d3e5bf135bab64",
"score": "0.49053687",
"text": "def build_product\n Product.new(name: 'Product 1', measure_ids: ['8A4D92B2-397A-48D2-0139-B0DC53B034A7'], bundle_id: '4fdb62e01d41c820f6000001')\nend",
"title": ""
},
{
"docid": "4bc4f5e65cb8ea4cb7dc4dc53ecbba80",
"score": "0.49047148",
"text": "def library(name, constraint=nil, &block) #:yield:\n Library.activate(name, constraint, &block)\n end",
"title": ""
}
] |
92644adfe231ee6aca6083f8efd5d5e3 | def get_text_scan_iters(line_num, search_str) st, en = get_line_iters(line_num) s, e = st.forward_search(search_str, Gtk::TextIter::SEARCH_TEXT_ONLY, en) end | [
{
"docid": "a6afcc72ff55286298881ae614af8ce7",
"score": "0.0",
"text": "def apply_tag_to_line(line, tag, search_str = nil)\n\t\t\ts, e = get_line_iters(line, search_str)\n\t\t\tbuffer.apply_tag(tag, s, e)\t\n\tend",
"title": ""
}
] | [
{
"docid": "46d3b96d793ded6d47eefd28c5da8cc6",
"score": "0.7234153",
"text": "def search(ent, txtvu)\n start = txtvu.buffer.start_iter\n first, last = start.forward_search(ent.text, Gtk::TextIter::SEARCH_TEXT_ONLY, nil)\n count = 0\n while (first)\n start.forward_char\n first, last = start.forward_search(ent.text, Gtk::TextIter::SEARCH_TEXT_ONLY, nil)\n start = first\n txtvu.buffer.apply_tag(\"highlight\", first, last)\n count += 1\n end\nend",
"title": ""
},
{
"docid": "d789d4ffcd6d4c120b6b2199a697978c",
"score": "0.6550935",
"text": "def find_clicked(te)\n find = te.search.text\n first, last, success = te.textview.buffer.selection_bounds\n\n first = te.textview.buffer.start_iter unless success\n\n # forward_search(find, flags, limit=(nil==entire text buffer))\n first, last = first.forward_search(find, Gtk::TextIter::SEARCH_TEXT_ONLY, last)\n\n # Select the instance on the screen if the string is found. \n # Otherwise, tell the user it has failed.\n if (first)\n mark = te.textview.buffer.create_mark(nil, first, false)\n # Scrolls the Gtk::TextView the minimum distance so\n # that mark is contained within the visible area. \n te.textview.scroll_mark_onscreen(mark)\n\n te.textview.buffer.delete_mark(mark)\n te.textview.buffer.select_range(first, last)\n else\n # Gtk::MessageDialog.new(parent, flags, message_type, button_type, message = nil)\n dialogue = Gtk::MessageDialog.new(\n nil,\n Gtk::Dialog::MODAL,\n Gtk::MessageDialog::INFO, \n Gtk::MessageDialog::BUTTONS_OK,\n \"The text was not found!\"\n )\n dialogue.run\n dialogue.destroy\n end\n first = last = nil # camcel any previous selections\nend",
"title": ""
},
{
"docid": "b0216ca88da05321a1fb4344402678a2",
"score": "0.64483815",
"text": "def find(string)\n s_iter, e_iter, text_selected = selection_bounds\n s_iter = start_iter unless text_selected\n s_iter, e_iter = s_iter.forward_search(string, Gtk::TextIter::SEARCH_TEXT_ONLY, e_iter)\n s_iter ? create_mark(nil, s_iter, false) : nil\n end",
"title": ""
},
{
"docid": "d249dc1031e2b9f4d538cec989c255e6",
"score": "0.63208663",
"text": "def scan_all_text(&block)\n scan_all(text_criteria,&block)\n end",
"title": ""
},
{
"docid": "01f8fc16e765bd09b880644a0ef23596",
"score": "0.61149967",
"text": "def textSearch(w, string, tag)\n tag.remove('0.0', 'end')\n return if string == \"\"\n cur = '1.0'\n loop {\n cur, len = w.search_with_length(string, cur, 'end')\n break if cur == \"\"\n tag.add(cur, \"#{cur} + #{len} char\")\n cur = w.index(\"#{cur} + #{len} char\")\n }\nend",
"title": ""
},
{
"docid": "18e28aa1cf5b8dd619d549d279251186",
"score": "0.60253614",
"text": "def text_search\n text = ''\n InputDialog.new(self, \"Search for:\", text).execute\n return nil if text.empty?\n\n # Convert \"\\xHH\" to a raw byte denoted by the two hex digits HH\n res = ''\n state = :normal\n hex = ''\n text.each_byte do |c|\n if state == :normal\n if c.chr == '\\\\'\n state = :slash\n else\n res << c.chr\n end\n elsif state == :slash\n if c.chr == 'x'\n state = :hex\n hex = ''\n else\n state = :normal\n if c.chr == 'n'\n res << \"\\n\"\n elsif c.chr == 'r'\n res << \"\\r\"\n elsif c.chr == 't'\n res << \"\\t\"\n elsif c.chr == '0'\n res << \"\\0\"\n else\n res << c.chr\n end\n end\n elsif state == :hex\n hex << c.chr\n if hex.length == 2\n state = :normal\n res << hex.to_i(16).chr\n end\n end\n end\n\n # Perform the actual search, highlighting (and un-highlighting) as we go.\n @column.numItems.times do |i|\n pkt = @packets[@column.getItemText(i).to_i - 1].to_s\n if pkt.include? res\n @column.selectItem(i)\n else\n @column.deselectItem(i)\n end \n end\n end",
"title": ""
},
{
"docid": "5bd0226ac58744bb02986d6d1d85ada6",
"score": "0.6025032",
"text": "def search()\n lno = 0;\n keyword = ARGV[1]\n lines = ARGF.file.readlines()\n regex = /#{keyword}/i\n lines.each {\n |line| \n lno +=1\n if regex.match(line)\n puts \"#{lno}✔︎ #{line}\"\n end\n }\nend",
"title": ""
},
{
"docid": "a77b7b64de94e572c0afd2a1875e4d8a",
"score": "0.5833647",
"text": "def scan_text(text)\n text.each_line do |line|\n scan_line(line.strip)\n end\n end",
"title": ""
},
{
"docid": "5d4d8fea9760c6ae3f4fa159a0d2cc46",
"score": "0.578319",
"text": "def full_search(find_me, direction = :forwards)\n from = nil\n to = nil\n\n if direction == :forwards\n to = @lines.size - 1\n if @mode == :notfound\n from = 0\n else\n from = last_line + 1\n if from >= @lines.size\n from = @lines.size - 1\n end\n end\n else\n to = 0\n if @mode == :notfound\n from = @lines.size - 1\n else\n from = first_line - 1\n if from < 0\n from = 0\n end\n end\n end\n\n return search_range(from, to, find_me)\n end",
"title": ""
},
{
"docid": "e2bbbe481f5d1165e952a8727ab80c89",
"score": "0.5773804",
"text": "def on_txtSearch_changed_wait\n return nil if @gui[\"window\"].destroyed?\n \n @enum = nil\n @result_i = 0\n @results = []\n \n text = @gui[\"txtSearch\"].text\n words = text.split(/\\s+/).map{|ele| ele.downcase}\n \n if !words.empty?\n #Need to use threadded enumerator because of fiber failure otherwise.\n @enum = Threadded_enumerator.new(:enum => @args[:rdo].plugin.send(:text => text, :words => words))\n end\n \n self.update_res\n end",
"title": ""
},
{
"docid": "7b531fa450c11b2346f3348735dbd9fb",
"score": "0.5745433",
"text": "def RectTextSearch (reader, pos)\n\telement = reader.Next\n\tsrch_str2 = \"\"\n\twhile !element.nil? do\n\t\tcase element.GetType\n\t\twhen Element::E_text\n\t\t\tbbox = element.GetBBox\n\t\t\tif bbox.IntersectRect(bbox, pos)\n\t\t\t\tarr = element.GetTextString\n\t\t\t\tsrch_str2 += arr\n\t\t\t\tsrch_str2 += \"\\n\"\n\t\t\tend\n\t\twhen Element::E_text_new_line\n\t\twhen Element::E_form\n\t\t\treader.FormBegin\n\t\t\tsrch_str2 += RectTextSearch(reader, pos)\n\t\t\tputs srch_str2\n\t\t\treader.End\n\t\tend\n\t\telement = reader.Next\n\tend\n\treturn srch_str2\nend",
"title": ""
},
{
"docid": "33e7191c07e53ebcbfa151143a727457",
"score": "0.5696807",
"text": "def find_text\n return @find_text\n end",
"title": ""
},
{
"docid": "c269a00600e7a5d40b7b25fd514b14c9",
"score": "0.56759864",
"text": "def search_line(filename, lineno, line)\n occurrences = []\n offset = 0\n match = false\n until match.nil?\n match = line.index(@search, offset)\n offset = match + 2 if match.is_a?(Integer)\n # Don't log a match if there isn't one or if the replacement on a regex would yield no change\n next if !match.is_a?(Integer) || (!@replacement.nil? && line.gsub(@search, @replacement) == line)\n occurrences << Occurrence.new(filename, lineno, match + 1, line)\n end\n occurrences\n end",
"title": ""
},
{
"docid": "80491fc6deb5625f4978870282f4299a",
"score": "0.56756383",
"text": "def search_goto_line line\n page_down while line >= botline\n page_up while line < topline\n set_cursor_pos line\n end",
"title": ""
},
{
"docid": "2d8761599858bf4678809d6d5e614616",
"score": "0.5654611",
"text": "def scan(text, regex, type)\n text\n .enum_for(:scan, regex)\n .map do\n {\n start_offset: Regexp.last_match.begin(0),\n end_offset: Regexp.last_match.begin(0) + Regexp.last_match.to_s.length,\n value: Regexp.last_match.to_s,\n type: type\n }\n end\nend",
"title": ""
},
{
"docid": "cb3948de6d4328439651dfbb6051c483",
"score": "0.5598008",
"text": "def search_text\n current_tab do |component|\n component.text\n end\n end",
"title": ""
},
{
"docid": "ed196746f94054bcf0bd76697b64fd09",
"score": "0.5595056",
"text": "def text_searcher(sequencetext)\n @sequencetext = sequencetext\n @sequences = []\n @text_sequence = \"\"\n @sequencetext.extend Textual\n @sequencetextualed = @sequencetext.to_textual\n @sequencetextualed.extend Textual\n @sequencetextdecommaed = @sequencetextualed.de_comma\n @sequencetextdecommaed.extend Textual\n @sequencetextdespaced = @sequencetextdecommaed.de_space\n @sequencetextdespaced.extend Textual\n @text_sequence = text_sequencer(@sequencetext)\n if (@text_sequence == \"\") then\n @sequences = [\"no letters remain after processing\"]\n else\n @sequences = Sequence.find_all_by_sequence_text(@text_sequence) # Array\n end\n end",
"title": ""
},
{
"docid": "a01178dcf667700d3a10a078b34205fc",
"score": "0.55836535",
"text": "def each_text_run\r\n text_runs.each { |tr| yield(tr) }\r\n end",
"title": ""
},
{
"docid": "a01178dcf667700d3a10a078b34205fc",
"score": "0.55836535",
"text": "def each_text_run\r\n text_runs.each { |tr| yield(tr) }\r\n end",
"title": ""
},
{
"docid": "94b4fa5f434829ce5b0f333055e04ebe",
"score": "0.5583575",
"text": "def find_results_for(string)\n IndexedSearch::Entry.find_results(IndexedSearch::Query.new(string), 25)\nend",
"title": ""
},
{
"docid": "2b67dd9502fb846a78e76dbd8c258378",
"score": "0.5581439",
"text": "def search_paragraphs(search_term, chapter)\n paragraphs = []\n chapter.split(/\\n\\n/).each_with_index do |paragraph, index|\n paragraphs << [paragraph, index] if paragraph.include?(search_term)\n end\n paragraphs\nend",
"title": ""
},
{
"docid": "0e21efc4c7d82df6b474dbd6de6bcafe",
"score": "0.55772114",
"text": "def search_next(field, offset, from)\n\t\t#puts \"LOOKING FOR #{field}\"\n\t\txi = 0\n\t\tmatched = false\n\t\t@content.lines[offset..@content.lines.size-field.width].each.with_index do |line, y_full|\n\t\t\ty = offset + y_full\n\t\t\tif field.width > 1\n\t\t\t\tline = Multiline.generate @content.lines[y, field.width]\n\t\t\tend\n\t\t\t#puts \"#{RegexHelper.strip_wildchar(line[from..-1]).to_s}<\"\n\t\t\tline[from..-1].match(field.regex){|m|\n\t\t\t\t#puts \"match\".green\n\t\t\t\txi = from + m.offset(0)[0]\n\t\t\t\txf = (from + m.offset(0)[1] + field.text.length*Setup::Read.text_expand).to_i\n\t\t\t\tif m.is_a? MultiMatchData\n\t\t\t\t\twidth = (field.is_a? SingleField and field.enforced_width) ? field.width : m.offset[3]-m.offset[2]+1\n\t\t\t\t\tif field.orientation > 7 or field.orientation < 3\n\t\t\t\t\t\ttop_y = y + m.offset[2]\n\t\t\t\t\telsif field.orientation < 7 and field.orientation > 3\n\t\t\t\t\t\ttop_y = y + m.offset[3] - (width)\n\t\t\t\t\telse\n\t\t\t\t\t\ttop_y = y + m.offset[2]/2 + m.offset[3]/2 - width/2 + 1\n\t\t\t\t\tend\n\t\t\t\t\tfield.position = TextNode.new(xi, xf-1, top_y+1) \n\t\t\t\t\tfield.width = width \n\t\t\t\telse\n\t\t\t\t\tfield.position = TextNode.new(xi, xf-1, y) \n\t\t\t\tend\n\t\t\t\tmatched = true\n\t\t\t}\n\t\t\tbreak if matched\n\t\tend\n\t\tif matched\n\t\t\t#puts \"CUAK: #{field.top}, #{field.width} [#{field.right}, #{field.left}]\".yellow\n\t\t\tscope = field.width > 1 ? @content.lines[field.top, field.width] : @content.lines[field.top]\n\t\t\ttext = Multiline.generate scope\n\t\t\tindex = field.right\n\t\t\twhile index > field.left\n\t\t\t\tindex -= 1\n\t\t\t\ttext[index..field.right].match(field.regex) do |m|\n\t\t\t\t\tfield.left = index + m.offset(0)[0]\n\t\t\t\t\tfield.right = field.right\n\t\t\t\t\treturn true\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e65be5d0b9fed1b3810d8e7a5d243a0c",
"score": "0.55706",
"text": "def scan(re, &block)\n results = []\n char_offset = 0\n re.scan(content) do |md|\n results << (yield [md, line_of(char_offset + md.begin(0))])\n \n char_offset += md[0].size + md.pre_match.size\n remaining = md.post_match\n end\n results\n end",
"title": ""
},
{
"docid": "188889253074002a3f19e51613b8be5b",
"score": "0.5569485",
"text": "def scan(string); end",
"title": ""
},
{
"docid": "9203c7967a8749eba6c49a9aae9202d2",
"score": "0.5555164",
"text": "def determine_textlines j\n i=last_line_start[j]\n line_number = (i==0) ? 0 : determine_textlines(i-1)+1\n #puts \"Line number: #{line_number}; First word: #{i}, last word: #{j}\"\n @textlines << [i,j]\n line_number\n end",
"title": ""
},
{
"docid": "f74d12ddb36992a2bb12a3db6b9a5e85",
"score": "0.5544213",
"text": "def scan(pattern) \n yield str\n end",
"title": ""
},
{
"docid": "8e26612f97a03fd169f30352f3f985f0",
"score": "0.5539271",
"text": "def search_in_content(script, str)\n\t\tresults = []\n\t\ti = 0\n\t\t\n\t\tcontent = script.contents\n\t\t\n\t\tloop do\n\t\t\ti = content.index(str, i+1)\n\t\t\t\n\t\t\tif(i == nil)\n\t\t\t\tbreak\n\t\t\tend\n\t\t\t\n\t\t\tsampleStart = content.rindex(\"\\n\", i)\n\t\t\tsampleEnd = content.index(\"\\n\", i)\n\t\t\t\n\t\t\tsampleStr = content[sampleStart, sampleEnd - sampleStart]\n\t\t\t\t\t\t\n\t\t\tresult = SearchStruct.new(script, i, str.size, sampleStr)\n\t\t\t\n\t\t\tresults.push(result)\n\t\tend\n\t\t\n\t\treturn results\n\tend",
"title": ""
},
{
"docid": "c438f8c7deef21413da8eecf9936cb5b",
"score": "0.5533824",
"text": "def scan_text(scanner, max_text)\n start = scanner.pos\n\n until scanner.pos >= (max_text + start) || scan_word(scanner).nil?; end\n\n (scanner.pre_match || scanner.string[start, max_text]).to_s\n end",
"title": ""
},
{
"docid": "c7a6c341ea04d3d0c0b84c58c38a54c7",
"score": "0.55316234",
"text": "def lexigram_searcher(sequencetext)\n @sequencetext = sequencetext\n @sequences = []\n @lexigram_sequence = \"\"\n # @sequencetext.extend Textual\n # @sequencetextualed = @sequencetext.to_textual\n # @sequencetextualed.extend Textual\n # @sequencetextdecommaed = @sequencetextualed.de_comma\n # @sequencetextdecommaed.extend Textual\n # @lexigram_sequence = lexigram_sequencer(@sequencetextdecommaed)\n\t@lexigram_sequence = lexigram_sequencer(@sequencetext)\n if (@lexigram_sequence) === (\"\") then\n @sequences = [\"no letters remain after processing\"]\n else\n @sequences = Sequence.find_all_by_sequence_lexigram(@lexigram_sequence) # Array\n end\n end",
"title": ""
},
{
"docid": "7961f97294d8fbb884a91abda2f81393",
"score": "0.55191195",
"text": "def scan_text_for(all)\n flags = 0\n flags |= Regexp::IGNORECASE if @ignore_case\n searches = all.map do |a|\n a.is_a?(Array) ? a.join(delimiter_re.to_s) : a\n end\n re = Regexp.new(\"\\\\b(#{searches.join('|')})\\\\b\", flags)\n\n any_found = false\n @text.scan(re) do |s, _|\n yield s\n any_found = true\n end\n any_found\n end",
"title": ""
},
{
"docid": "820038290148ea74ba059c84c31bbf99",
"score": "0.549429",
"text": "def search(word)\r\n \r\n end",
"title": ""
},
{
"docid": "820038290148ea74ba059c84c31bbf99",
"score": "0.549429",
"text": "def search(word)\r\n \r\n end",
"title": ""
},
{
"docid": "e682bbc645fc83a5fd8c7e27b08f9614",
"score": "0.54894567",
"text": "def horizontal_search(result, range, regex)\n\t\tcounter = 0\n\t\ttolerance = 0\n\t\tlast_match = \"\"\n\t\tdetected = false\n\t\tlimit = range[1]\n\t\twhile tolerance <= Setup::Read.horizontal_search_range and range[1] + counter < line_size\n\t\t\tcounter += 1\n\t\t\ttolerance += 1 if detected\n\t\t\tlines = (range[3] > 1 ? (range[2]..range[2]+range[3]-1) : range[2] )\n\t\t\ttext = (Multiline.generate @content.lines[lines])[range[1]..range[1]+counter]\n\t\t\ttext = RegexHelper.strip_wildchar(text)\n\t\t\tif text.match regex\n\t\t\t\tdetected = true\n\t\t\t\tif text.is_a? Multiline\n\t\t\t\t\tm_scope = text.multi_match regex\n\t\t\t\t\tscope ||= m_scope\n\t\t\t\t\tm_scope.size do |i|\n\t\t\t\t\t\tscope[i] = true if m_scope[i] and not scope[i]\n\t\t\t\t\t\tdetected = false if scope[i] and not m_scope[i]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif detected\n\t\t\t\t\ttolerance = 0 if text != last_match\n\t\t\t\t\tlast_match = text\n\t\t\t\t\tlimit = range[1] + counter\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tif not last_match.nil? and last_match.match regex\n\t\t\tresult.result = last_match\n\t\telse\n\t\t\tresult.result = Result::NOT_FOUND\n\t\tend\n\t\treturn limit\n\tend",
"title": ""
},
{
"docid": "447f35648131ee655995392eb12b2630",
"score": "0.5481108",
"text": "def search_file(text,file_name)\n line_num = 0\n file_name.read_lines do |line|\n if line.include? text\n return line_num\n end\n line_num += 1\n end\n return -1\n end",
"title": ""
},
{
"docid": "4a36f69f52355e8b42371546d213c63c",
"score": "0.54793453",
"text": "def pattern_search(text, pattern)\nend",
"title": ""
},
{
"docid": "07eb191fd27c1b4c1153cd339105443e",
"score": "0.5475719",
"text": "def text_search(search_text, limit, offset) #(search_text, offset_order_query={})\n total = count_text_search(search_text)\n extra_condition = <<-CONDITION\n WHERE b.id = ? or unaccent(customer_name) ilike unaccent(?) or unaccent(customer_surname) ilike unaccent(?) or customer_email = ? or \n customer_phone = ? or customer_mobile_phone = ? or external_invoice_number = ?\n CONDITION\n data = repository.adapter.select(query_reservation_search(limit, offset, extra_condition),\n search_text.to_i, \"%#{search_text}%\", \"%#{search_text}%\", search_text,\n search_text, search_text, search_text)\n [total, data] \n end",
"title": ""
},
{
"docid": "be5fc226521e20e9d324d0aa4ffb32eb",
"score": "0.54635215",
"text": "def scan(seq, offset, limit) # :nodoc:\n scanner.string = seq\n scanner.pos = offset\n\n while scanner.search_full(cleave_regexp, true, false)\n scanner.search_full(WHITESPACE, true, false)\n pos = scanner.pos\n \n # skip if the next character is the exception character\n next if cterm_exception != nil && seq[pos] == cterm_exception\n \n # break if you scanned past the upper limit\n break if pos > limit\n \n yield pos\n end\n \n scanner.pos\n end",
"title": ""
},
{
"docid": "f79da6f6529015ae0c276533c0614251",
"score": "0.5459912",
"text": "def scan_until(pattern)\n feed_me\n @previous_lineno = @lineno\n if matched = encode_utf8(super)\n @lineno += matched.count(\"\\n\")\n end\n matched\n end",
"title": ""
},
{
"docid": "c7b8841ae22f03eb7a366b780a682108",
"score": "0.54482114",
"text": "def text_include(text_lines)\n @text_end = text_lines.length # actual data length used everywhere\n @text_area = {}\n @exclude_count = 0\n @line_number = -1\n @found = false \n after = false \n text_lines.each do |line_number, text| # read the file line by line\n @line_number = line_number # formal argument cannot be an instance variable\n $search_history.to_h.each_pair do |symbol, pattern| # get the current search patterns\n @pattern = pattern unless pattern == \"\" # formal argument cannot be an instance variable\n @found = true if /#{Regexp.escape(pattern)}/.match(text) unless pattern == \"\"\n end\n if @found # is it what is being looked for?\n if @exclude_count > 0 # yes, none excluded yet?\n @text_area.store(@line_number, [\"before\", @exclude_count]) # no, write out excluded line count\n end \n @text_area.store(@line_number+1, [\"text\", text]) # always write out this line\n @exclude_count = 0 # no lines currently excluded\n else\n @text_area.store(@line_number+1, [\"fill\", \"\"]) unless @line_number == @text_end # line position\n @exclude_count += 1 if @line_number == @text_end # handle single excluded last line\n end \n @exclude_count += 1 unless @found \n @found = false\n end\n if @exclude_count > 0 \n @text_area.store(@line_number+1, [\"after\", @exclude_count])\n @exclude_count = 0\n end\n return @text_area\n end",
"title": ""
},
{
"docid": "b93a26b5305a5718348a4fd562df6540",
"score": "0.54094476",
"text": "def search_text(string)\n\t$tests = $tests + 1\n\tputs \" * test number: \" + $tests.to_s\n\tputs \" searching the displayed page for: \" + string\n\tif $ie.contains_text(string)\n\t\tputs \" ok -- found: \" + string\n\t\t$pass = $pass + 1\n\telse\n\t\tputs \">>>FAIL -- could not find: \" + string\n\t\t$fail = $fail + 1\n\tend\nend",
"title": ""
},
{
"docid": "bf498d469e4969d5d2300b4bf87068da",
"score": "0.54038143",
"text": "def search_text(string)\n\t$tests = $tests + 1\n\tputs \" --+ test number: \" + $tests.to_s\n\tputs \" searching the displayed page for: \" + string\n\tif $ie.contains_text(string)\n\t\tputs \" ok -- found: \" + string\n\t\t$pass = $pass + 1\n\telse\n\t\tputs \">>>FAIL -- could not find: \" + string\n\t\t$fail = $fail + 1\n\tend\nend",
"title": ""
},
{
"docid": "9c57d25cf9e573d53b8442976632c654",
"score": "0.5400901",
"text": "def matching_lines(regex); end",
"title": ""
},
{
"docid": "af2048968ced8050a116afa67800956f",
"score": "0.54007614",
"text": "def scan string\n internal_match(string){|matchdata| yield matchdata}\n nil\n end",
"title": ""
},
{
"docid": "7abb8285dbead651033217d734bca74f",
"score": "0.5397948",
"text": "def extract_substring_positions(text, substr)\n positions = []\n scanner = StringScanner.new(text)\n positions << scanner.pos while scanner.scan(/(.*?)#{substr}/)\n positions\n end",
"title": ""
},
{
"docid": "1b93423196e7d0681cb9794714e012a1",
"score": "0.53866166",
"text": "def get_start_index( text )\n return @computed_start unless @computed_start.nil?\n if starting_with.kind_of?( Regexp )\n# FIXME This was just a test to alter the inner workings. Didn't go too well. Either remove or change the whole class!\n# matchdata = starting_with.match( text )\n# if matchdata && matchdata.captures.size > 0\n# @computed_start = matchdata.begin(0)\n# @computed_end = @computed_start + matchdata.captures.first.size\n# else\n @computed_start = ( text =~ starting_with )\n# end\n elsif starting_with.kind_of?( Fixnum )\n @computed_start = starting_with\n else\n @computed_start = nil\n end\n end",
"title": ""
},
{
"docid": "f74507c215909d22eb5c7dc1d9e92b0b",
"score": "0.5384847",
"text": "def find_again( direction = :down )\n if direction\n buffer_current.find_again( @last_search_regexps, direction )\n else\n buffer_current.find_again( @last_search_regexps )\n end\n show_number_of_matches_found\n end",
"title": ""
},
{
"docid": "4dffba54592c16db7f22c397bede7fa5",
"score": "0.5380943",
"text": "def find_match_forward(text)\n @position = -1 if @position == length - 1 && @cycle\n offset = @position ? @position + 1 : 0\n @history[offset..-1].detect.with_index do |item, index|\n if item.start_with?(text)\n @position = index + offset\n end\n end\n end",
"title": ""
},
{
"docid": "2527c774e3eedbf17978bfc4f961da56",
"score": "0.5357245",
"text": "def parse_text(text, song)\n i = 0\n while i < text.length\n current = text[i]\n if current.text.include?('Jon Mess')\n i += 1\n loop do\n binding.pry\n current = text[i]\n Line.new(song: song, text: current.text)\n i+= 1\n end \n end\n i += 1\n end\n\n end",
"title": ""
},
{
"docid": "dc38d61a436bafa93835c5115286decc",
"score": "0.53545177",
"text": "def search(search_string, max_count: 210, &block)\n return if search_string.blank?\n\n self.class.check_pdfgrep_exists!\n\n max_count = max_count.to_i.to_s\n cmd = [SecureView::Config.pdfgrep_path, '-i', '--max-count', max_count, '-n', '-F', search_string, path]\n IO.popen(cmd, &block)\n end",
"title": ""
},
{
"docid": "45b755de06d69dc5c9fa749015f524d8",
"score": "0.5346466",
"text": "def solution(full_text, search_text)\n sum = 0\n full_text.scan(/#{search_text}/) { |_match| sum += 1 }\n sum\nend",
"title": ""
},
{
"docid": "2b87b8452add9535bb35aaace3bacc29",
"score": "0.533491",
"text": "def do_iteration(line_number)\n begin\n my_translation = MatchTranslation.new(@words[line_number][0], @words[line_number][1])\n matches = my_translation.process_sentences\n matches.each do |key, value|\n p_o_s = @abbreviations[my_translation.part_of_speech[value]] || 'Unk.'\n @result[\"#{key}\\t#{value}\\t#{p_o_s}\"] ||= 0\n @result[\"#{key}\\t#{value}\\t#{p_o_s}\"] += 1\n puts \"#{key}\\t#{value}\\t#{p_o_s}\"\n end\n rescue\n return false\n end\n\n return true\nend",
"title": ""
},
{
"docid": "1e650a6daddae62c4516f9b6de222396",
"score": "0.5330209",
"text": "def extract_substring_positions(text, substr)\n positions = []\n scanner = StringScanner.new(text)\n positions << scanner.charpos while scanner.scan(/(.*?)#{substr}/)\n positions\n end",
"title": ""
},
{
"docid": "fb279200db433881576cf6e6d065080d",
"score": "0.5330165",
"text": "def scan_remainder\n if value = @scanner.scan(/.+/m)\n [:text, value]\n end\n end",
"title": ""
},
{
"docid": "fb279200db433881576cf6e6d065080d",
"score": "0.5330165",
"text": "def scan_remainder\n if value = @scanner.scan(/.+/m)\n [:text, value]\n end\n end",
"title": ""
},
{
"docid": "fbf77478aa8e3453426c793e22ab31a5",
"score": "0.5322098",
"text": "def find_matching_lines file_path, search_string, results\n #puts file_path\n begin\n f = File.new file_path\n i=0\n f.each do |line|\n i += 1\n unless line.index(search_string).nil?\n # match\n results.push \"#{file_path}:#{i}: #{line}\"\n end\n end\n rescue\n # ignore\n end\nend",
"title": ""
},
{
"docid": "4cd9398f64002dbf5dce37933bed0faa",
"score": "0.53218627",
"text": "def matched_text; end",
"title": ""
},
{
"docid": "2412002cb8c4f45a0d06fc0ea5dd5ad3",
"score": "0.53124714",
"text": "def scan(seq, offset, limit, &block) # :nodoc:\n scanner.string = seq\n scanner.pos = offset\n\n while scanner.search_full(cleave_regexp, true, false)\n scanner.search_full(MULTILINE_WHITESPACE, true, false)\n pos = scanner.pos\n\n # skip if the next character is the exception character\n next if cterm_exception != nil && seq[pos] == cterm_exception\n\n # break if you scanned past the upper limit\n break if pos > limit\n\n block.call(pos)\n end\n\n scanner.pos\n end",
"title": ""
},
{
"docid": "68a909306a00028f2673aea435964b8f",
"score": "0.53100395",
"text": "def search(text)\n n = text.length\n i,j = 0, 0\n for i in (0...n)\n for j in (0...m)\n j = @dfa[text[i]][j]\n end\n if (j == m)\n return (i - m)\n else\n return n\n end\n end\n end",
"title": ""
},
{
"docid": "5e9319b0701535f4a1d5e92803fdd6c5",
"score": "0.5303362",
"text": "def scan_text\n text = scan_until(:open)\n \n if text.nil?\n text = self.scanner.rest\n self.scanner.clear\n end\n \n [:text, text]\n end",
"title": ""
},
{
"docid": "6e2acbf2a9e4943b95d4b366c307fafb",
"score": "0.5302954",
"text": "def line(string,number)\n\t\t@line.each do |type|\n\t\t\tline = type.match?(string,number)\n\t\t\treturn line if line\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7af31eb77d60fb6a1781121cf33ec417",
"score": "0.5294347",
"text": "def examine( text )\r\n\t\tend",
"title": ""
},
{
"docid": "fd3fe1376007835093c0274dd5852d89",
"score": "0.5291979",
"text": "def next_match str, startline = nil, _curpos = nil, endline = nil\n return unless str\n\n ## check current line for more occurrences.\n if !startline\n startline = @current_index\n _curpos ||= (@curpos + 1) # FIXME +1 should only happen if a search has already happened\n #_pos = @list[startline].index(str, _curpos)\n _pos = to_searchable(startline).index(str, _curpos)\n return [startline, _pos + search_offset] if _pos\n startline += 1\n end\n ## Check rest of file\n ## loop through array, check after startline to eof\n @list.each_with_index do | line, ix|\n next if ix < startline\n break if endline && ix > endline\n #_found = line.index(str)\n _found = to_searchable(ix).index(str)\n #$log.debug \" next_match: #{line}: #{_found} \" if _found\n return [ix, _found + search_offset] if _found\n end\n if startline > 0\n # this can get called again since startline was made 1 in above block. FIXME\n #return next_match str, 0, @current_index\n end\n return nil\n end",
"title": ""
},
{
"docid": "94410126d3ec5c9b8c7acbfd6ad0553f",
"score": "0.5290262",
"text": "def word_search(source)\r\n word_occur = source.scan(/#{$search_word}/i).count\r\n puts \"Found #{word_occur} occurences of \\\"#{$search_word}\\\"\"\r\nend",
"title": ""
},
{
"docid": "66b62f2eae78d2b4bba6eece571d970a",
"score": "0.52900416",
"text": "def each_text\n function(:each_text)\n end",
"title": ""
},
{
"docid": "ac2dfd33583c64a8b958341182ea5e83",
"score": "0.52898276",
"text": "def e_s_texts\n find_eles :text\n end",
"title": ""
},
{
"docid": "ac2dfd33583c64a8b958341182ea5e83",
"score": "0.52898276",
"text": "def e_s_texts\n find_eles :text\n end",
"title": ""
},
{
"docid": "177188a419def83ebc896af50b52b88b",
"score": "0.5278413",
"text": "def on_words_beg(value); end",
"title": ""
},
{
"docid": "6afb2364007f2a3bfe9fd71c6daab5f9",
"score": "0.52751935",
"text": "def s_texts_exact text\n find_eles_by_text :text, text\n end",
"title": ""
},
{
"docid": "64d82ec40876f91079c02782d0cd59ea",
"score": "0.5275108",
"text": "def search(text, selector, *args)\n line '7', text, selector, *args\n end",
"title": ""
},
{
"docid": "1df3a0ab42f8b55a0e3746afb3b76e46",
"score": "0.526929",
"text": "def find_and_process_tex_inlines(instring,dirname)\n ostring=\"\"\n while s = instring.shift\n while loc = s.index(\"<tex>\") \n\tr = process_tex_inlines(s,instring,dirname)\n\tostring +=r[1]\n\ts = r[0]\n end\n ostring += s+\"\\n\"\n end\n ostring\n end",
"title": ""
},
{
"docid": "a717060b4e8a8ae1f95d201746c29e00",
"score": "0.5254456",
"text": "def newline_offsets_in(text)\n (0..(text.length - 1)).select { |i| text[i] == \"\\n\" }\n end",
"title": ""
},
{
"docid": "86e3f5059f5fbf2236090b1a8fe8de49",
"score": "0.5254341",
"text": "def text_counter(sequencetext)\n @sequencetext = sequencetext\n\t@texts = text_searcher(@sequencetext)\n\tif (@texts === [\"no letters remain after processing\"])\n\t @texts_count = 0\n else\n @texts_count = @texts.count.to_s\n end\n end",
"title": ""
},
{
"docid": "8b0f97426a0d3185a3e4c61f0543696e",
"score": "0.5249833",
"text": "def scroll_page_till_partial_text(text, dir=\"down\", count=10)\n puts \"scroll_page_till_partial_text (#{text})\"\n write_verified_text_to_file \"scroll_page_till_partial_text (#{text})\"\n\n flag=0\n repeat_count=0\n while (repeat_count < count)\n repeat_count+=1\n if check_partial_text_shown(text)\n flag=1\n break\n end\n sleep 1\n puts \"#{text} is not visible yet\"\n scroll_view(dir)\n end\n sleep 2\n #puts \"\\nDEBUG:\\n #{text}\" if flag==0\n fail(\"Searched for the text: #{text} - but the text is not shown\") if flag==0\n end",
"title": ""
},
{
"docid": "9466d843c9807cc598188129e93b7ef6",
"score": "0.52326006",
"text": "def each_line(text)\n each text do |fy, fx, ty, tx|\n fy.upto(ty) do |y|\n yield y, fx, tx\n end\n end\n end",
"title": ""
},
{
"docid": "802ed7583c3fd81d4a41dde2a6ab14cb",
"score": "0.52323663",
"text": "def _find_next regex=@last_regex, start = @search_found_ix, first_time = false\n #raise \"No previous search\" if regex.nil?\n warn \"No previous search\" and return if regex.nil?\n #$log.debug \" _find_next #{@search_found_ix} : #{@current_index}\"\n extra = 1 # first time search on current line, next time skip current line or else we get stuck.\n extra = 0 if first_time\n start ||= 0\n fend = @list.size-1\n if start != fend\n start += extra unless start == fend # used to be +=1 so we don't get stuck in same row\n @last_regex = regex\n @search_start_ix = start\n regex = Regexp.new(regex, Regexp::IGNORECASE) if @search_case\n start.upto(fend) do |ix| \n row1 = @list[ix].to_s\n\n # 2011-09-29 crashing on a character F3 in log file\n # 2013-03-20 - 18:25 187compat\n if row1.respond_to? :encode\n row = row1.encode(\"ASCII-8BIT\", :invalid => :replace, :undef => :replace, :replace => \"?\")\n else\n row = row1\n end\n\n m=row.match(regex)\n if !m.nil?\n @find_offset = m.offset(0)[0]\n @find_offset1 = m.offset(0)[1]\n ix += (@_header_adjustment || 0)\n @search_found_ix = ix\n return ix \n end\n end\n end\n fend = start-1\n start = 0\n if @search_wrap\n start.upto(fend) do |ix| \n row = @list[ix].to_s\n m=row.match(regex)\n if !m.nil?\n @find_offset = m.offset(0)[0]\n @find_offset1 = m.offset(0)[1]\n ix += (@_header_adjustment || 0)\n @search_found_ix = ix\n return ix \n end\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "85fa680eb0f43fbff663db432ce24ff6",
"score": "0.5231284",
"text": "def scan(pattern)\n feed_me\n @previous_lineno = @lineno\n if matched = encode_utf8(super)\n @lineno += matched.count(\"\\n\")\n end\n matched\n end",
"title": ""
},
{
"docid": "06199ea076aee50003529ed687c2c15a",
"score": "0.5226129",
"text": "def grep(filename, phrase)\n File.foreach(filename).with_index do |line, line_number|\n puts \"#{line_number}: #{line}\" if line =~ /\\W#{phrase}\\W/i\n end\nend",
"title": ""
},
{
"docid": "860a2404976e6ce8243ff99233e8bf1f",
"score": "0.52239347",
"text": "def scan_line(str)\n run_scaner(str) do |each|\n each.chomp!\n # add word separator at end of line\n each.concat(' ')\n end\n end",
"title": ""
},
{
"docid": "efe437c6224c44f3abf0296f701c4a96",
"score": "0.5210858",
"text": "def next_match str\n _calculate_column_offsets unless @coffsets\n first = nil\n ## content can be string or Chunkline, so we had to write <tt>index</tt> for this.\n @content.each_with_index do |fields, ix|\n #col = line.index str\n #fields.each_with_index do |f, jx|\n #@chash.each_with_index do |c, jx|\n #next if c.hidden\n each_column do |c,jx|\n f = fields[c.index]\n # value can be numeric\n col = f.to_s.index str\n if col\n col += @coffsets[jx] \n first ||= [ ix, col ]\n if ix > @current_index\n return [ix, col]\n end\n end\n end\n end\n return first\n end",
"title": ""
},
{
"docid": "2b92000d31fee677988b444a25fc7f56",
"score": "0.5207341",
"text": "def find_all_matching(text, &block)\n matches = []\n pos = 0\n text_len = text.length\n \n while pos < text_len do\n container = @trie\n len = 0\n \n pos.upto(text_len - 1) do |i|\n b = text[i]\n break unless container[b] \n container = container[b]\n len += 1\n end\n \n if container[0] # Match\n if block\n block.call(pos, len)\n else\n matches << [pos, len]\n end\n pos += len # Skip over word\n else \n pos += 1\n end\n end\n \n matches\n end",
"title": ""
},
{
"docid": "4b1def86697ea78b35dd210e12cd556c",
"score": "0.52007115",
"text": "def lines(text)\n text.lines.size\nend",
"title": ""
},
{
"docid": "7017623d9f99454a5b62c0f41b1be5e5",
"score": "0.51943016",
"text": "def full_text_search(string)\n enter_keyword string\n hit_enter\n end",
"title": ""
},
{
"docid": "7017623d9f99454a5b62c0f41b1be5e5",
"score": "0.51943016",
"text": "def full_text_search(string)\n enter_keyword string\n hit_enter\n end",
"title": ""
},
{
"docid": "c1d4f6711c224d6051062e883f88a240",
"score": "0.5190031",
"text": "def starting_text_extraction\n end",
"title": ""
},
{
"docid": "c1d4f6711c224d6051062e883f88a240",
"score": "0.5190031",
"text": "def starting_text_extraction\n end",
"title": ""
},
{
"docid": "572be4a7b94d4358fe5da5c9e6393270",
"score": "0.51874286",
"text": "def find( regexps, options = {} )\n return if regexps.nil?\n regexp = regexps[ 0 ]\n return if regexp.nil? || regexp == //\n\n direction = options[ :direction ]\n replacement = options[ :replacement ]\n auto_choice = options[ :auto_choice ]\n from_row = options[ :starting_row ] || @last_row\n from_col = options[ :starting_col ] || @last_col\n show_context_after = options[ :show_context_after ]\n\n if options[:starting]\n @num_matches_found = nil\n end\n\n num_replacements = 0\n\n search_area = @search_area || TextMark.new( 0, 0, @lines.size - 1, @lines[ -1 ].size, nil )\n if ! search_area.contains?( from_row, from_col )\n from_row, from_col = search_area.start_row, search_area.start_col\n end\n\n if direction == :opposite\n case @last_search_direction\n when :up\n direction = :down\n else\n direction = :up\n end\n end\n @last_search_regexps = regexps\n @last_search_direction = direction\n\n wrapped = false\n\n finding, match = catch :found do\n\n if direction == :down\n\n # Check the current row first.\n\n index = @lines[ from_row ].index(\n regexp,\n ( @last_finding ? @last_finding.start_col : from_col ) + 1\n )\n if index\n establish_finding( regexps, search_area, from_row, index, Regexp.last_match )\n end\n\n # Check below the cursor.\n\n ( (from_row + 1)..search_area.end_row ).each do |i|\n line = @lines[ i ]\n if i == search_area.end_row\n line = line[ 0...search_area.end_col ]\n end\n index = line.index( regexp )\n if index\n establish_finding( regexps, search_area, i, index, Regexp.last_match )\n end\n end\n\n if index\n establish_finding( regexps, search_area, search_area.end_row, index, Regexp.last_match )\n end\n\n # Wrap around.\n\n wrapped = true\n\n index = @lines[ search_area.start_row ].index( regexp, search_area.start_col )\n if index\n establish_finding( regexps, search_area, search_area.start_row, index, Regexp.last_match )\n end\n\n ( search_area.start_row+1...from_row ).each do |i|\n index = @lines[ i ].index( regexp )\n if index\n establish_finding( regexps, search_area, i, index, Regexp.last_match )\n end\n end\n\n # And finally, the other side of the current row.\n\n if from_row == search_area.start_row\n index_col = search_area.start_col\n else\n index_col = 0\n end\n if index = @lines[ from_row ].index( regexp, index_col )\n if index <= ( @last_finding ? @last_finding.start_col : from_col )\n establish_finding( regexps, search_area, from_row, index, Regexp.last_match )\n end\n end\n\n elsif direction == :up\n\n # Check the current row first.\n\n col_to_check = ( @last_finding ? @last_finding.end_col : from_col ) - 1\n if ( col_to_check >= 0 ) && ( index = @lines[ from_row ][ 0...col_to_check ].rindex( regexp ) )\n establish_finding( regexps, search_area, from_row, index, Regexp.last_match )\n end\n\n # Check above the cursor.\n\n (from_row - 1).downto( 0 ) do |i|\n if index = @lines[ i ].rindex( regexp )\n establish_finding( regexps, search_area, i, index, Regexp.last_match )\n end\n end\n\n # Wrap around.\n\n wrapped = true\n\n (@lines.length - 1).downto(from_row + 1) do |i|\n if index = @lines[ i ].rindex( regexp )\n establish_finding( regexps, search_area, i, index, Regexp.last_match )\n end\n end\n\n # And finally, the other side of the current row.\n\n search_col = ( @last_finding ? @last_finding.start_col : from_col ) + 1\n if index = @lines[ from_row ].rindex( regexp )\n if index > search_col\n establish_finding( regexps, search_area, from_row, index, Regexp.last_match )\n end\n end\n end\n end\n\n if ! finding\n remove_selection DONT_DISPLAY\n clear_matches DO_DISPLAY\n if ! options[ :quiet ] && ( replacement.nil? || num_replacements == 0 )\n $diakonos.set_iline \"/#{regexp.source}/ not found.\"\n end\n else\n if wrapped && ! options[ :quiet ]\n if @search_area\n $diakonos.set_iline( \"(search wrapped around to start of search area)\" )\n else\n $diakonos.set_iline( \"(search wrapped around BOF/EOF)\" )\n end\n end\n\n remove_selection( DONT_DISPLAY )\n @last_finding = finding\n if @settings[ \"found_cursor_start\" ]\n anchor_selection( finding.end_row, finding.end_col, DONT_DISPLAY )\n cursor_to( finding.start_row, finding.start_col )\n else\n anchor_selection( finding.start_row, finding.start_col, DONT_DISPLAY )\n cursor_to( finding.end_row, finding.end_col )\n end\n if show_context_after\n watermark = Curses::lines / 6\n if @last_row - @top_line > watermark\n pitch_view( @last_row - @top_line - watermark )\n end\n end\n\n @changing_selection = false\n\n if regexps.length == 1\n @highlight_regexp = regexp\n highlight_matches\n else\n clear_matches\n end\n display\n\n if replacement\n # Substitute placeholders (e.g. \\1) in str for the group matches of the last match.\n actual_replacement = replacement.dup\n actual_replacement.gsub!( /\\\\(\\\\|\\d+)/ ) { |m|\n ref = $1\n if ref == \"\\\\\"\n \"\\\\\"\n else\n match[ ref.to_i ]\n end\n }\n\n choice = auto_choice || $diakonos.get_choice(\n \"#{num_matches_found} match#{ num_matches_found != 1 ? 'es' : '' } - Replace this one?\",\n [ CHOICE_YES, CHOICE_NO, CHOICE_ALL, CHOICE_CANCEL, CHOICE_YES_AND_STOP ],\n CHOICE_YES\n )\n case choice\n when CHOICE_YES\n paste [ actual_replacement ]\n num_replacements += 1 + find( regexps, direction: direction, replacement: replacement )\n when CHOICE_ALL\n num_replacements += replace_all( regexp, replacement )\n when CHOICE_NO\n num_replacements += find( regexps, direction: direction, replacement: replacement )\n when CHOICE_CANCEL\n # Do nothing further.\n when CHOICE_YES_AND_STOP\n paste [ actual_replacement ]\n num_replacements += 1\n # Do nothing further.\n end\n end\n end\n\n num_replacements\n end",
"title": ""
},
{
"docid": "e82fff38eddb7a9d8ae2d2956ff616f4",
"score": "0.5186542",
"text": "def find_text=(value)\n @find_text = value\n end",
"title": ""
},
{
"docid": "5c2e386f073075f282f18ce7d81cc448",
"score": "0.5185635",
"text": "def numbered_lines(text)\n # but CodeRay wants to remove the equal sign;\n tag = \"lI\" + \"-Ne\" # avoid the literal tag if we process our own source\n html = CodeRay.scan(text, :ruby).page(line_number_anchors: tag)\n html.gsub(tag, \"line=\")\nend",
"title": ""
},
{
"docid": "7a074afbfb57bf2ec6a638644c08e14e",
"score": "0.5182769",
"text": "def line_of(i)\n return nil if i >= content.size\n char_ct = 0\n l = 0\n while char_ct <= i\n char_ct += lines[l].size\n l += 1\n end\n l\n end",
"title": ""
},
{
"docid": "7d222d8f019012e6adcd0e7ab6f087f2",
"score": "0.5181733",
"text": "def scan_text\r\n \"#{@scanner.getch}#{@scanner.scan(/[^<]*/)}\"\r\n end",
"title": ""
},
{
"docid": "7b0d6569a25fb0d3fb2dfe5ba77fac89",
"score": "0.51773745",
"text": "def progress(text, str, counter)\n speed = (@current_speed == 0 ? $options&.message_speed : @current_speed) || 1\n text.nchar_draw = 0\n text.opacity = contents_opacity\n until text.nchar_draw >= str.size\n break if stop_message_process?\n\n text.nchar_draw += 1\n counter += 1\n if Input.trigger?(:A) || (Mouse.trigger?(:left) && simple_mouse_in?) || panel_skip? # Skip request\n text.nchar_draw = str.size\n return -1\n end\n if counter >= speed\n message_update_processing\n counter = 0\n end\n end\n return counter\n end",
"title": ""
},
{
"docid": "d6effa494b04478c5176dc74111ef2b3",
"score": "0.516638",
"text": "def words_starting_with_un_and_ending_with_ing(text)\n text.scan(/un\\w+ing/)\nend",
"title": ""
},
{
"docid": "5bcec2ed66155f7401ccf03296d5f4f7",
"score": "0.5165043",
"text": "def words_starting_with_un_and_ending_with_ing(text)\n text.scan(/un\\w+ing/)\nend",
"title": ""
},
{
"docid": "febc28c824252f4528c7ec9e9cb8fe7d",
"score": "0.5164956",
"text": "def search(text)\n normal\n type \"/#{text}<cr>\"\n end",
"title": ""
},
{
"docid": "39d7c5797b14ecafbbbfe92e651e79e6",
"score": "0.51602364",
"text": "def search_entry index, n, str\n return nil if @size == 1\n if Config['MIGEMO']\n # migemo check\n migemo = Search\n unless migemo.valid\n Config[\"MIGEMO\"] = false\n search_entry index, n, str\n else\n str = migemo.search(str)\n end\n else\n str = Regexp.escape(str)\n end\n if Config['SEARCH_FORWARD']\n reg = /^#{str}/i\n else\n reg = Regexp.compile(str, 'i')\n end\n unless Config['WRAP_SCAN']\n if n == 1\n return nil if index == @size-1\n @entries[index+1..@size-1].detect do |entry|\n reg =~ entry.name\n end\n else\n return nil if index == 0\n @entries[0..index-1].reverse.detect do |entry|\n reg =~ entry.name\n end\n end\n else\n if n == 1\n (@entries[index+1..@size-1] + @entries[0..index-1]).detect do |entry|\n reg =~ entry.name\n end\n else\n (@entries[0..index-1].reverse! + @entries[index+1..@size-1].reverse!).detect do |entry|\n reg =~ entry.name\n end\n end\n end\n end",
"title": ""
},
{
"docid": "18ead14cd0d0bf3562b7a63c21ef3a02",
"score": "0.51590025",
"text": "def each_line\n number = 0\n @input.each_line do |text|\n number += 1\n next if text =~ %r{\\A\\s*\\z}\n yield(Line.parse(number, text))\n end\n end",
"title": ""
},
{
"docid": "5f5c0c0ec076b0e2bccbcb997c8cd181",
"score": "0.51552624",
"text": "def each_match_range(range, regex); end",
"title": ""
},
{
"docid": "124cd013edb22e6513cc04d9b2c27e7a",
"score": "0.5153282",
"text": "def find_rows_index(tbl,column_index,text)\n rows=[]\n length_of_text_limit = (text.length<30)?(text.length):33\n text_to_find = text[0,length_of_text_limit]\n # for i in 0..tbl.row_count - 2\n for i in 0..tbl.trs.length - 2\n ## puts i\n rows << i if (tbl[i].tds.length > column_index) && (tbl[i][column_index].text.strip =~ /#{text_to_find.strip}/ )\n ## rows << i if (tbl.row_values(i).length > column_index) && (tbl.row_values(i)[column_index].strip =~ /#{text_to_find.strip}/ )\n end\n $logger.error(\"find_row method: Text #{text_to_find} in column # <#{column_index}> is not found\") if rows.length == 0\n return rows\n end",
"title": ""
},
{
"docid": "f339b4d4cf21287105fda112c3b5d37e",
"score": "0.514465",
"text": "def get_lines_for_match (global_lines, num_match)\r\n ret = []\r\n global_lines.each { |line|\r\n unless line.index(num_match) == nil\r\n ret.push line\r\n end\r\n }\r\n ret\r\n end",
"title": ""
},
{
"docid": "8e745d6c258016b27395dd1035fa203c",
"score": "0.5138953",
"text": "def prompt4(search_string, page)\n body = page.body\n body.scan(/\\b#{search_string}\\b/i)\nend",
"title": ""
},
{
"docid": "db590e9be0dff07fceb0be96d6e1b32a",
"score": "0.5137906",
"text": "def matched_text=(_arg0); end",
"title": ""
}
] |
8d97b818d57cd6fb39ab1dfe238f7257 | Baseline implementation for the update_subnet REST call | [
{
"docid": "4d3a9f3328e90e614734e8a898cb4b62",
"score": "0.7373355",
"text": "def update_subnet request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_update_subnet_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
}
] | [
{
"docid": "4e60e0c720b3c48b8ffc43fff5d3d913",
"score": "0.75309676",
"text": "def patch(subnet_name, options = {})\n @uri += \"?api-version=#{api_version}\"\n end",
"title": ""
},
{
"docid": "8aea1cfa7f45661b5776bc34c2e9c8b7",
"score": "0.7395889",
"text": "def update\n @subnet = Subnet.find(params[:id])\n\n respond_to do |format|\n if @subnet.update_attributes(params[:subnet])\n format.html { redirect_to(@subnet, :notice => 'Subnet was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => @subnet }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n format.json { render :json => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "175d7a4689dae20d02e6367d36e5ba24",
"score": "0.73729813",
"text": "def update\n @subnet = Subnet.find(params[:id])\n\n respond_to do |format|\n if @subnet.update_attributes(params[:subnet])\n format.html { redirect_to @subnet, notice: 'Subnet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subnet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8364058ba06f8c362ec92b06183f9dc9",
"score": "0.7263119",
"text": "def update\n @subnet = @object\n\n respond_to do |format|\n if @subnet.update_attributes(params[:subnet])\n flash[:notice] = 'Subnet was successfully updated.'\n format.html { redirect_to subnet_url(@subnet) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subnet.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b26ab1b1450f679272be02a3c925760b",
"score": "0.7231468",
"text": "def update\n @subnet = Subnet.find(params[:id])\n\n respond_to do |format|\n if @subnet.update_attributes(params[:subnet])\n format.html { redirect_to(@subnet, :notice => 'Subnet was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b26ab1b1450f679272be02a3c925760b",
"score": "0.7231468",
"text": "def update\n @subnet = Subnet.find(params[:id])\n\n respond_to do |format|\n if @subnet.update_attributes(params[:subnet])\n format.html { redirect_to(@subnet, :notice => 'Subnet was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5366f8128532f6654c5dfcb58542cdf",
"score": "0.71376127",
"text": "def update\n @subnet = Subnet.find(params[:id])\n\n respond_to do |format|\n if @subnet.update_attributes(params[:subnet])\n flash[:notice] = 'Subnet was successfully updated.'\n format.html { redirect_to(@subnet) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e85bb48999cd18b59b56f9dafcb670d3",
"score": "0.6897599",
"text": "def update\n @subnet_ipaddress = SubnetIpaddress.find(params[:id])\n\n respond_to do |format|\n if @subnet_ipaddress.update_attributes(params[:subnet_ipaddress])\n format.html { redirect_to @subnet_ipaddress, notice: 'Subnet ipaddress was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subnet_ipaddress.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74f7410d23a970c57f319cbe5c18da7b",
"score": "0.6868513",
"text": "def update_subnet(node_id:, payload:, subnet_id:, **options)\n path = subnet_path(user_id: self.user_id, node_id: node_id, subnet_id: subnet_id)\n begin\n subnet = client.patch(path,payload)\n rescue Synapse::Error::Unauthorized\n self.authenticate()\n subnet = client.patch(path,payload)\n end\n Subnet.new(subnet_id: subnet['_id'], payload: subnet, node_id: node_id)\n end",
"title": ""
},
{
"docid": "19a01f8d15ba99169b334f9b90237d77",
"score": "0.68294764",
"text": "def update\n @site_subnet = SiteSubnet.find(params[:id])\n\n respond_to do |format|\n if @site_subnet.update_attributes(params[:site_subnet])\n format.html { redirect_to @site_subnet, notice: 'Site subnet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site_subnet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a86e65f2af4e77fc2155f6ae684e7b9",
"score": "0.66602266",
"text": "def _update_subnet_use(op)\n cmd = []\n cmd << \"c=$(cat #{_subnet_count});\"\n cmd << \"echo $(($c #{op} 1)) > #{_subnet_count};\"\n cmd << \"cat #{_subnet_count}\"\n count = @driver.exec(cmd.join(\" \"))\n @logger.info(\"subnet_count = #{count}\")\n if count.to_i <= 0\n @logger.info(\"deleteting the associated subnet\")\n subnet_id = _find_subnet()\n @oar_driver.delete_job(subnet_id)\n\n end\n\n end",
"title": ""
},
{
"docid": "164d6695ca94bdfd64081407b86aa150",
"score": "0.6468535",
"text": "def update\n @subnet_ip_addressess = SubnetIpAddressess.find(params[:id])\n\n respond_to do |format|\n if @subnet_ip_addressess.update_attributes(params[:subnet_ip_addressess])\n format.html { redirect_to @subnet_ip_addressess, notice: 'Subnet ip addressess was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subnet_ip_addressess.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8659663fbba909f5bc2fef8007985673",
"score": "0.6465417",
"text": "def subnet=(value)\n @subnet = value\n end",
"title": ""
},
{
"docid": "e9e92c81b4fac8bda81fb44d3e7d6723",
"score": "0.6361269",
"text": "def handle_update_request(obj, message)\n subnet = mac = hostname = network_boot = ip = nil\n\n obj.each do |param|\n next if !param.is_a?(Array)\n\n if param.first == :subnet\n subnet = param.second\n elsif param.first == :mac\n mac = param.second\n elsif param.first == :ip\n ip = param.second\n elsif param.first == :hostname\n hostname = param.second\n elsif param.first == :network_boot\n network_boot = param.second.to_i\n end\n end\n \n if check_subnet(subnet)\n logger.info \"DHCP: #{subnet} update #{mac}\"\n result = @ldap.update_host(subnet, mac, ip, hostname, network_boot)\n if result\n success(message)\n else\n failure(message)\n end\n else\n refuse(message, :uknown_subnet)\n end\n end",
"title": ""
},
{
"docid": "ea3b9ddbf2829654ca3c0eb1b236bc44",
"score": "0.61898047",
"text": "def assign_network\n @subnet = Subnet.find(params[:id])\n @vlan_detail = VlanDetail.find(params['vlan_detail_id'])\n\n # Variable holder for attribute update\n u = {}\n begin\n NetAddr.validate_ip_addr(@subnet.cidr.network, :Version => 6)\n u['subnet_v6'] = @subnet.network\n rescue NetAddr::ValidationError\n u['subnet'] = @subnet.network\n end\n\n respond_to do |format|\n if @vlan_detail.update_attributes(u)\n format.html { redirect_to(@vlan_detail, :notice => 'Subnet was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => @vlan_detail }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vlan_detail.errors, :status => :unprocessable_entity }\n format.json { render :json => @vlan_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6eee42db242793cf874d421e22e9bfe9",
"score": "0.6072103",
"text": "def GetSubnet()\n \n end",
"title": ""
},
{
"docid": "01ae74071df4d920ab5650101a94d766",
"score": "0.605491",
"text": "def set_SubnetId(value)\n set_input(\"SubnetId\", value)\n end",
"title": ""
},
{
"docid": "a4fc930e6992e7ef2336bdfa3f9dd8f2",
"score": "0.6029156",
"text": "def create(subnet_name, options = {})\n @uri += \"/#{subnet_name}?api-version=#{api_version}\"\n end",
"title": ""
},
{
"docid": "433be898a189aa3c340cf1b57650dd90",
"score": "0.59805375",
"text": "def aws_subnet_id(subnet_id)\n @platform.aws_subnet_id = subnet_id\n end",
"title": ""
},
{
"docid": "8560838308d53790501f38b7e78308be",
"score": "0.59751916",
"text": "def prepare_subnet(subnet, vpc_name, subnet_ip, cidr, az_list)\n #calculate cidr bits,\n #TODO calculate number of subnets available\n cidr_bits = 32-cidr.to_i\n\n #clone\n subnet_new = deep_copy(subnet)\n subnet_old = deep_copy(subnet['Resources']['mySubnet'])\n az_count = 0;\n\n for x in 0..2\n #assign the values accordingly\n subnet_name = \"Subnet#{x+1}\"\n subnet_new['Resources'][subnet_name] = deep_copy(subnet_old)\n subnet_new['Resources'].delete(\"mySubnet\")\n subnet_new['Resources'][subnet_name]['Properties']['VpcId']['Ref'] = vpc_name\n subnet_new['Resources'][subnet_name]['Properties']['CidrBlock']['Fn::Select'][0] = x\n subnet_new['Resources'][subnet_name]['Properties']['CidrBlock']['Fn::Select'][1][\"Fn::Cidr\"][0] = subnet_ip\n subnet_new['Resources'][subnet_name]['Properties']['CidrBlock']['Fn::Select'][1][\"Fn::Cidr\"][2] = cidr_bits\n subnet_new['Resources'][subnet_name]['Properties']['AvailabilityZone'] = az_list[az_count]\n subnet_new['Resources'][subnet_name]['Properties']['Tags'][0][\"Value\"] = subnet_name\n\n #count according to number of az's in region\n az_count = az_count < (az_list.length-1) ? (az_count = az_count + 1) : (az_count = 0)\n end\n subnet_new\n end",
"title": ""
},
{
"docid": "6b00a19b847751b2cee9e6e64f76b7af",
"score": "0.59535724",
"text": "def set subnet, mac, args\n parse(_post_(args.merge(:mac => mac), \"#{subnet}\"))\n end",
"title": ""
},
{
"docid": "4f7cd8148301aeb38e2c9e5d490384db",
"score": "0.59517795",
"text": "def tag_subnet_with_http_info(id, tag, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.tag_subnet ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.tag_subnet\"\n end\n pattern = Regexp.new(/^\\d+$/)\n if @api_client.config.client_side_validation && id !~ pattern\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.tag_subnet, must conform to the pattern #{pattern}.\"\n end\n\n # verify the required parameter 'tag' is set\n if @api_client.config.client_side_validation && tag.nil?\n fail ArgumentError, \"Missing the required parameter 'tag' when calling DefaultApi.tag_subnet\"\n end\n # resource path\n local_var_path = '/subnets/{id}/tag'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tag) \n\n # return_type\n return_type = opts[:return_type] || 'Array<Tag>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#tag_subnet\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b9f9d725a9cac1efda6c5cec4726abd9",
"score": "0.59326655",
"text": "def update\n logger.info(\" #### BEGINN #### Hier wird ipnets_controller/update aufgerufen #### BEGINN ####\")\n @ipnet = Ipnet.find(params[:id])\n \n #Werte verändern, damit neues Objekt durch Validator läuft!\n @clone = Ipnet.new(params[:ipnet])\n \n\n #Für Validierung\n set_ip_and_netmask\n parent = @ipnet.parent_id\n\n respond_to do |format|\n if @ipnet.am_i_valid?(@clone, parent) && @ipnet.update_attributes(params[:ipnet]) ##????? updte_attributes? MEthode gibt es noch gar nicht\n puts \"UPDATE ERFOLGREICH!!!!!!!\"\n flash[:notice] = 'IP-Netz wurde erfolgreich geändert'\n format.html { redirect_to(:action => \"index\") }\n format.xml { head :ok }\n else\n puts \"UPDATE MISSLUNGEN!\"\n format.html { render :action => \"edit\"}\n format.xml { render :xml => @ipnet.errors, :status => :unprocessable_entity }\n end\n logger.info(\" #### ENDE #### Hier wird ipnets_controller/update beendet #### ENDE ####\")\n end\n end",
"title": ""
},
{
"docid": "7632d0585446455feafcbe87ed3f4630",
"score": "0.5932622",
"text": "def create_ip_block_subnet_with_http_info(ip_block_subnet, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PoolManagementApi.create_ip_block_subnet ...\"\n end\n # verify the required parameter 'ip_block_subnet' is set\n if @api_client.config.client_side_validation && ip_block_subnet.nil?\n fail ArgumentError, \"Missing the required parameter 'ip_block_subnet' when calling PoolManagementApi.create_ip_block_subnet\"\n end\n # resource path\n local_var_path = \"/pools/ip-subnets\"\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(ip_block_subnet)\n auth_names = ['BasicAuth']\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 => 'IpBlockSubnet')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PoolManagementApi#create_ip_block_subnet\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "cea4175ea150f96d491412e4d428de2d",
"score": "0.59120464",
"text": "def delete\n client.delete_subnet(:subnet_id => subnet_id)\n nil\n end",
"title": ""
},
{
"docid": "266c95fbd1f54c40eb4f2999acc2eb18",
"score": "0.59033567",
"text": "def show_subnet_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.show_subnet ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.show_subnet\"\n end\n pattern = Regexp.new(/^\\d+$/)\n if @api_client.config.client_side_validation && id !~ pattern\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.show_subnet, must conform to the pattern #{pattern}.\"\n end\n\n # resource path\n local_var_path = '/subnets/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Subnet' \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\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: DefaultApi#show_subnet\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a94fc7c60bd06cbc1cb5072559c3c6a7",
"score": "0.5866885",
"text": "def untag_subnet_with_http_info(id, tag, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.untag_subnet ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.untag_subnet\"\n end\n pattern = Regexp.new(/^\\d+$/)\n if @api_client.config.client_side_validation && id !~ pattern\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.untag_subnet, must conform to the pattern #{pattern}.\"\n end\n\n # verify the required parameter 'tag' is set\n if @api_client.config.client_side_validation && tag.nil?\n fail ArgumentError, \"Missing the required parameter 'tag' when calling DefaultApi.untag_subnet\"\n end\n # resource path\n local_var_path = '/subnets/{id}/untag'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tag) \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#untag_subnet\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b6eaffd06caed6bd3cb6986057996c67",
"score": "0.5856885",
"text": "def modify_db_subnet_group(name, subnet_ids, description = nil)\n params = { 'Action' => 'ModifyDBSubnetGroup',\n 'DBSubnetGroupName' => name,\n 'DBSubnetGroupDescription' => description,\n :parser => Fog::Parsers::AWS::RDS::ModifyDBSubnetGroup.new }\n params.merge!(Fog::AWS.indexed_param(\"SubnetIds.member\", Array(subnet_ids)))\n request(params)\n end",
"title": ""
},
{
"docid": "8c6ac9e2f6b10a134c32ed363be21503",
"score": "0.5846216",
"text": "def create(opts)\n opts = check_params(opts,[:subnet])\n super(opts)\n end",
"title": ""
},
{
"docid": "c90490f9d2ea2a6234f8dca3cb64e65c",
"score": "0.58408326",
"text": "def new_subnet_address_prefix(vnet_address_prefix, subnets)\n if subnets.empty? ## no subnets exist in the given address space of the virtual network, so divide the network into smaller subnets (based on the network size) and allocate space for the new subnet to be added ##\n divide_network(vnet_address_prefix)\n else ## subnets exist in vnet, calculate new address_prefix for the new subnet based on the space taken by these existing subnets under the given address space of the virtual network ##\n vnet_network_address = IPAddress(vnet_address_prefix)\n subnets = sort_subnets_by_cidr_prefix(subnets)\n available_networks_pool = []\n used_networks_pool = []\n subnets.each do |subnet|\n ## in case the larger network is not divided into smaller subnets but\n ## divided into only 1 largest subnet of the complete network size ##\n if vnet_network_address.prefix == subnet_cidr_prefix(subnet)\n break\n end\n\n ## add all the possible subnets (calculated using the current subnet's\n ## cidr prefix value) into the available_networks_pool ##\n available_networks_pool.push(\n vnet_network_address.subnet(subnet_cidr_prefix(subnet))\n ).flatten!.uniq! { |nwrk| [ nwrk.network.address, nwrk.prefix ].join(\":\") }\n\n ## add current subnet into the used_networks_pool ##\n used_networks_pool.push(\n IPAddress(subnet_address_prefix(subnet))\n )\n\n ## sort both the network pools before trimming the available_networks_pool ##\n available_networks_pool, used_networks_pool = sort_pools(\n available_networks_pool, used_networks_pool\n )\n\n ## trim the available_networks_pool based on the networks already\n ## allocated to the existing subnets ##\n used_networks_pool.each do |subnet_network|\n available_networks_pool.delete_if do |available_network|\n in_use_network?(subnet_network, available_network)\n end\n end\n\n ## sort both the network pools after trimming the available_networks_pool ##\n available_networks_pool, used_networks_pool = sort_pools(\n available_networks_pool, used_networks_pool\n )\n end\n\n ## space available in the vnet_address_prefix network for the new subnet ##\n if !available_networks_pool.empty? && available_networks_pool.first.network?\n available_networks_pool.first.network.address.concat(\"/\" + available_networks_pool.first.prefix.to_s)\n else ## space not available in the vnet_address_prefix network for the new subnet ##\n nil\n end\n end\n end",
"title": ""
},
{
"docid": "fead7ecb6c8b9033be22cedcac292fba",
"score": "0.5822179",
"text": "def manageSubnetGroup\n # Finding subnets, creating security groups/adding holes, create subnet group\n subnet_ids = []\n\ndependencies\n raise MuError.new \"Didn't find the VPC specified for #{@mu_name}\", details: @config[\"vpc\"].to_h unless @vpc\n\n mySubnets.each { |subnet|\n next if @config[\"publicly_accessible\"] and subnet.private?\n subnet_ids << subnet.cloud_id\n }\n\n if @config['creation_style'] == \"existing\"\n srcdb_vpc = @config['source'].kitten.cloud_desc.db_subnet_group.vpc_id\n if srcdb_vpc != @vpc.cloud_id\n MU.log \"#{self} is deploying into #{@vpc.cloud_id}, but our source database, #{@config['identifier']}, is in #{srcdb_vpc}\", MU::ERR\n raise MuError, \"Can't use 'existing' to deploy into a different VPC from the source database; try 'new_snapshot' instead\"\n end\n end\n\n if subnet_ids.empty?\n raise MuError, \"Couldn't find subnets in #{@vpc} to add to #{@config[\"subnet_group_name\"]}. Make sure the subnets are valid and publicly_accessible is set correctly\"\n else\n resp = begin\n MU::Cloud::AWS.rds(region: @region, credentials: @credentials).describe_db_subnet_groups(\n db_subnet_group_name: @config[\"subnet_group_name\"]\n )\n# XXX ensure subnet group matches our config?\n rescue ::Aws::RDS::Errors::DBSubnetGroupNotFoundFault\n # Create subnet group\n resp = MU::Cloud::AWS.rds(region: @region, credentials: @credentials).create_db_subnet_group(\n db_subnet_group_name: @config[\"subnet_group_name\"],\n db_subnet_group_description: @config[\"subnet_group_name\"],\n subnet_ids: subnet_ids,\n tags: @tags.each_key.map { |k| { :key => k, :value => @tags[k] } }\n )\n # The API forces it to lowercase, for some reason? Maybe not\n # always? Just rely on what it says.\n @config[\"subnet_group_name\"] = resp.db_subnet_group.db_subnet_group_name\n resp\n end\n\n myFirewallRules.each { |sg|\n next if sg.cloud_desc.vpc_id != @vpc.cloud_id\n @config[\"vpc_security_group_ids\"] ||= []\n @config[\"vpc_security_group_ids\"] << sg.cloud_id\n }\n end\n\n allowBastionAccess\n end",
"title": ""
},
{
"docid": "a54a0efaccecc4ab63707b92f546ecff",
"score": "0.581015",
"text": "def delete_ip_block_subnet_with_http_info(subnet_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PoolManagementApi.delete_ip_block_subnet ...\"\n end\n # verify the required parameter 'subnet_id' is set\n if @api_client.config.client_side_validation && subnet_id.nil?\n fail ArgumentError, \"Missing the required parameter 'subnet_id' when calling PoolManagementApi.delete_ip_block_subnet\"\n end\n # resource path\n local_var_path = \"/pools/ip-subnets/{subnet-id}\".sub('{' + 'subnet-id' + '}', subnet_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PoolManagementApi#delete_ip_block_subnet\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "265f795f78a48205a2acdcb75686812c",
"score": "0.57275134",
"text": "def delete(subnet_name)\n @uri += \"/#{subnet_name}?api-version=#{api_version}\"\n end",
"title": ""
},
{
"docid": "27293aacf7a0a5ec3f2eb0b02fd8254e",
"score": "0.5710239",
"text": "def update!(**args)\n @network = args[:network] if args.key?(:network)\n @no_external_ip_address = args[:no_external_ip_address] if args.key?(:no_external_ip_address)\n @subnetwork = args[:subnetwork] if args.key?(:subnetwork)\n end",
"title": ""
},
{
"docid": "81d891cfc26e754ebdd917af22a24d3c",
"score": "0.5695564",
"text": "def save\n requires :subnet_id\n options = {\n 'PrivateIpAddress' => private_ip_address,\n 'Description' => description,\n 'GroupSet' => group_set,\n }\n options.delete_if {|key, value| value.nil?}\n data = service.create_network_interface(subnet_id, options).body['networkInterface']\n new_attributes = data.reject {|key,value| key == 'requestId'}\n merge_attributes(new_attributes)\n true\n end",
"title": ""
},
{
"docid": "39c3ef5a5e1845ca7c9e93bc8ded9403",
"score": "0.5667733",
"text": "def create\n if (params[0]) && (params[0][:option] == \"2\")\n \t(params[0][:subnet]).each do |net|\n \t @subnet = Subnet.new (net)\n @subnet.save\n \tend\n else\n @subnet = Subnet.new(params[:subnet])\n end\n\n respond_to do |format|\n if @subnet.save\n flash[:notice] = 'Subnet was successfully created.'\n format.html { redirect_to(@subnet) }\n format.xml { render :xml => @subnet, :status => :created, :location => @subnet }\n format.amf { render :amf => @subnet, :status => :created, :location => @subnet }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n format.amf { render :amf => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48e6a2007d9816af1f1bb5480001e494",
"score": "0.56514794",
"text": "def create # rubocop:disable Metrics/AbcSize\n BmcAuthenticate.new(@options)\n subnet_attr = AttrFinder.new(@instanceparameters)\n subnet_attr.options = @options\n subnet_attr.validate = @validate\n subnet_attr.function = 'subnet'\n vcnapi = OracleBMC::Core::VirtualNetworkClient.new\n subnet_details = OracleBMC::Core::Models::CreateSubnetDetails.new\n subnet_details.cidr_block = @instanceparameters['subnet']['cidr_block']\n subnet_details.compartment_id = subnet_attr.compartment\n subnet_details.availability_domain = subnet_attr.ad\n subnet_details.vcn_id = subnet_attr.vcn\n subnet_attr.param = 'security_list'\n subnet_details.security_list_ids = Array.new\n subnet_details.security_list_ids.push(subnet_attr.security_list)\n subnet_attr.param = 'route_table'\n subnet_details.route_table_id = subnet_attr.route_table\n subnet_details.display_name = @instanceparameters['subnet']['display_name']\n vcnapi.create_subnet(subnet_details)\n end",
"title": ""
},
{
"docid": "e47eb655c4ca0b2c120c4d525a5d3833",
"score": "0.56445867",
"text": "def subnet_id\n data[:subnet_id]\n end",
"title": ""
},
{
"docid": "6edfde71501c7e83d259b06ed87b9e2f",
"score": "0.5630522",
"text": "def subnet\n @subnet\n end",
"title": ""
},
{
"docid": "3ade80d8a3da38a1b03404a34d5c91e1",
"score": "0.56239396",
"text": "def create\n @subnet = Subnet.new(params[:subnet])\n\n respond_to do |format|\n if @subnet.save\n format.html { redirect_to @subnet, notice: 'Subnet was successfully created.' }\n format.json { render json: @subnet, status: :created, location: @subnet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subnet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46f5870313b7afa9640e2290dc0caa70",
"score": "0.5600099",
"text": "def create_ip_block_subnet_with_http_info(ip_block_subnet, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiPoolManagementIpBlocksApi.create_ip_block_subnet ...'\n end\n # verify the required parameter 'ip_block_subnet' is set\n if @api_client.config.client_side_validation && ip_block_subnet.nil?\n fail ArgumentError, \"Missing the required parameter 'ip_block_subnet' when calling ManagementPlaneApiPoolManagementIpBlocksApi.create_ip_block_subnet\"\n end\n # resource path\n local_var_path = '/pools/ip-subnets'\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(ip_block_subnet)\n auth_names = ['BasicAuth']\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 => 'IpBlockSubnet')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiPoolManagementIpBlocksApi#create_ip_block_subnet\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "65863816faece5671f82e93ea2d2ea97",
"score": "0.559925",
"text": "def neutron_subnet_finalizer(resource_name, new_resource, old_resource)\n azs = new_resource[\"Properties\"].delete(\"availability_zone\")\n if azs\n network_name = \"NetworkFor#{resource_name}\"\n translated[\"Resources\"][network_name] = {\n \"type\" => \"OS::Neutron::Network\",\n }\n new_resource[\"Properties\"][\"network\"] = {\"get_resource\" => network_name}\n end\n true\n end",
"title": ""
},
{
"docid": "d640d9732aa68c4bb3cec20af35afdc0",
"score": "0.5585188",
"text": "def update!(**args)\n @external_ip = args[:external_ip] if args.key?(:external_ip)\n @internal_ip = args[:internal_ip] if args.key?(:internal_ip)\n @network = args[:network] if args.key?(:network)\n @subnetwork = args[:subnetwork] if args.key?(:subnetwork)\n end",
"title": ""
},
{
"docid": "f3efc568085789b6024ab4355ad371b2",
"score": "0.5581771",
"text": "def net_subnet; det.form(:name, 'configNetwork').text_field(:id, 'subnetMask'); end",
"title": ""
},
{
"docid": "ed36248e766da2e5865780c7b8375148",
"score": "0.55809677",
"text": "def update!(**args)\n @limit = args[:limit] if args.key?(:limit)\n @subnetworks = args[:subnetworks] if args.key?(:subnetworks)\n end",
"title": ""
},
{
"docid": "782cbcc83d6102976ced453cf4a15b10",
"score": "0.5580044",
"text": "def add_subnet(subnet_name, vnet_config, subnets)\n new_subnet_prefix = nil\n vnet_address_prefix_count = 0\n vnet_address_space = vnet_config[:addressPrefixes]\n\n ## search for space in all the address prefixes of the virtual network ##\n while new_subnet_prefix.nil? && vnet_address_space.length > vnet_address_prefix_count\n new_subnet_prefix = new_subnet_address_prefix(\n vnet_address_space[vnet_address_prefix_count],\n subnets_list_for_specific_address_space(\n vnet_address_space[vnet_address_prefix_count], subnets\n )\n )\n vnet_address_prefix_count += 1\n end\n\n if new_subnet_prefix ## found space for new subnet ##\n vnet_config[:subnets].push(\n subnet(subnet_name, new_subnet_prefix)\n )\n else ## no space available in the virtual network for the new subnet ##\n raise \"Unable to add subnet #{subnet_name} into the virtual network #{vnet_config[:virtualNetworkName]}, no address space available !!!\"\n end\n\n vnet_config\n end",
"title": ""
},
{
"docid": "071ce5dc1eb37f903815463d5c572a87",
"score": "0.5570773",
"text": "def create_update(network_interface)\n\n OOLog.info(\"Updating NIC '#{network_interface.name}' \")\n start_time = Time.now.to_i\n begin\n if(@flag)\n response = @network_client.network_interfaces.get(@rg_name, network_interface.name)\n else\n response = @network_client.network_interfaces.create(name: network_interface.name,\n resource_group: @rg_name,\n location: network_interface.location,\n subnet_id: network_interface.subnet_id,\n public_ip_address_id: network_interface.public_ip_address_id,\n network_security_group_id: network_interface.network_security_group_id,\n ip_configuration_name: network_interface.ip_configuration_name,\n private_ip_allocation_method: network_interface.private_ip_allocation_method,\n load_balancer_backend_address_pools_ids: network_interface.load_balancer_backend_address_pools_ids,\n load_balancer_inbound_nat_rules_ids: network_interface.load_balancer_inbound_nat_rules_ids,\n tags: network_interface.tags,\n enable_accelerated_networking: network_interface.enable_accelerated_networking)\n end\n\n end_time = Time.now.to_i\n duration = end_time - start_time\n puts(\"operation took #{duration} seconds\")\n OOLog.info(\"NIC '#{network_interface.name}' was updated in #{duration} seconds\")\n response\n rescue => ex\n if ex.message =~ /Subnet \\w.* with address prefix \\w.* is already full/i\n raise AzureBase::CustomExceptions::SubnetIsFullError, ex.message\n elsif ex.message.include? 'ResourceNotFound'\n Chef::Log.error('***FAULT:FATAL= NIC is no more available, please consider replacing compute')\n Chef::Log.error('***FAULT:FATAL=' + ex.message)\n else\n OOLog.fatal(\"Error creating/updating NIC. Exception: #{ex.message}\")\n end\n end\n end",
"title": ""
},
{
"docid": "12e53f010aadb28500a5e48d18b7e767",
"score": "0.55701846",
"text": "def subnets=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = OpenStackSubnet.new(value)\n end\n end\n end\n @subnets = list\n end",
"title": ""
},
{
"docid": "135b0561cf177bf739537ccfdf9bc411",
"score": "0.5563777",
"text": "def delete_subnets\n super\n end",
"title": ""
},
{
"docid": "469614c0998d6ca10eeb35dc76ee30d6",
"score": "0.5552654",
"text": "def update\n\t\t if @address.editable?\n\t\t if @address.update_attributes(address_params)\n\t\t flash[:notice] = I18n.t(:successfully_updated, scope: :address_book)\n\t\t #redirect_back_or_default(account_path)\n\t\t save_to_account_params\n\t\t @current_api_user.update_attributes({ship_address_id: @address.id}) if params[:save_to_account]\n\t\t render json: @address, :methods => [:state_name , :country_name, :defult_shippiing_address_id ]\n\t\t else\n\t\t #render :action => 'edit'\n\t\t render json: {:error => true , status: 404}\n\n\t\t end\n\t\t else\n\t\t new_address = @address.clone\n\t\t new_address.attributes = address_params\n\t\t @address.update_attribute(:deleted_at, Time.now)\n\t\t if new_address.save\n\t\t flash[:notice] = I18n.t(:successfully_updated, scope: :address_book)\n\t\t #redirect_back_or_default(account_path)\n\t\t render json: @address, :methods => [:state_name , :country_name ]\n\t\t else\n\t\t #render :action => 'edit'\n\t\t render json: {:error => true , status: 404}\n\t\t end\n\t\t end\n\t\t end",
"title": ""
},
{
"docid": "05da3aaebcfd31f5c4eb26858c0bc9bf",
"score": "0.55505615",
"text": "def get(subnet_name)\n @uri += \"/#{subnet_name}?api-version=#{api_version}\"\n end",
"title": ""
},
{
"docid": "ba5b0147fe3bcc714715ee2ecabebf8f",
"score": "0.554906",
"text": "def update_by_body\n @address = Adress.find(address_update_params[:id])\n\n if @address.update_attributes(address_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error to update a Address', errors: @address.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6060ede853f0347ce138aec96b8fd98b",
"score": "0.55383563",
"text": "def update!(**args)\n @cidr = args[:cidr] if args.key?(:cidr)\n @ip_address = args[:ip_address] if args.key?(:ip_address)\n @mac_address = args[:mac_address] if args.key?(:mac_address)\n @name = args[:name] if args.key?(:name)\n @network = args[:network] if args.key?(:network)\n @state = args[:state] if args.key?(:state)\n @type = args[:type] if args.key?(:type)\n @vlan_id = args[:vlan_id] if args.key?(:vlan_id)\n @vrf = args[:vrf] if args.key?(:vrf)\n end",
"title": ""
},
{
"docid": "2d1ab5ab6432355a31c6eca79c8a2567",
"score": "0.5524308",
"text": "def set_VPCSubnet(value)\n set_input(\"VPCSubnet\", value)\n end",
"title": ""
},
{
"docid": "2d1ab5ab6432355a31c6eca79c8a2567",
"score": "0.5524308",
"text": "def set_VPCSubnet(value)\n set_input(\"VPCSubnet\", value)\n end",
"title": ""
},
{
"docid": "8c26afd45cc993d771cd6fc46122182b",
"score": "0.5517613",
"text": "def perform(params)\n contract_addresses = ClientWhitelistDetail.get_active_contract_addressess\n Request::OpsApi::UpdateSubscription.new.perform({contract_addresses: contract_addresses})\n end",
"title": ""
},
{
"docid": "70369be0d9c2183d190d0637db36f55b",
"score": "0.55089164",
"text": "def update!(**args)\n @ip_address = args[:ip_address] if args.key?(:ip_address)\n @ip_protocol = args[:ip_protocol] if args.key?(:ip_protocol)\n @kind = args[:kind] if args.key?(:kind)\n @load_balancer_type = args[:load_balancer_type] if args.key?(:load_balancer_type)\n @network_url = args[:network_url] if args.key?(:network_url)\n @port = args[:port] if args.key?(:port)\n @project = args[:project] if args.key?(:project)\n @region = args[:region] if args.key?(:region)\n end",
"title": ""
},
{
"docid": "4a2cebaddce5c634853e8ec99f645414",
"score": "0.55065405",
"text": "def update!(**args)\n @cidr = args[:cidr] if args.key?(:cidr)\n @gateway_ip = args[:gateway_ip] if args.key?(:gateway_ip)\n @id = args[:id] if args.key?(:id)\n @ip_address = args[:ip_address] if args.key?(:ip_address)\n @jumbo_frames_enabled = args[:jumbo_frames_enabled] if args.key?(:jumbo_frames_enabled)\n @labels = args[:labels] if args.key?(:labels)\n @mac_address = args[:mac_address] if args.key?(:mac_address)\n @mount_points = args[:mount_points] if args.key?(:mount_points)\n @name = args[:name] if args.key?(:name)\n @pod = args[:pod] if args.key?(:pod)\n @reservations = args[:reservations] if args.key?(:reservations)\n @services_cidr = args[:services_cidr] if args.key?(:services_cidr)\n @state = args[:state] if args.key?(:state)\n @type = args[:type] if args.key?(:type)\n @vlan_id = args[:vlan_id] if args.key?(:vlan_id)\n @vrf = args[:vrf] if args.key?(:vrf)\n end",
"title": ""
},
{
"docid": "1be7b3454eb75bae97e87e14cee7d72b",
"score": "0.5481346",
"text": "def subnet_id\n data.subnet_id\n end",
"title": ""
},
{
"docid": "1be7b3454eb75bae97e87e14cee7d72b",
"score": "0.5481346",
"text": "def subnet_id\n data.subnet_id\n end",
"title": ""
},
{
"docid": "3c78099a884082be761b9bf096dac5f3",
"score": "0.54810417",
"text": "def ship_card(node_id:, payload:, subnet_id:)\n path = node(user_id: self.user_id, node_id: node_id) + \"/subnets/#{subnet_id}/ship\"\n\n begin\n response = client.patch(path,payload)\n rescue Synapse::Error::Unauthorized\n self.authenticate()\n response = client.patch(path,payload)\n end\n Subnet.new(subnet_id: response[\"subnet_id\"], payload: response, node_id: response[\"node_id\"])\n end",
"title": ""
},
{
"docid": "ffa30ace77dfdcafad2bb12ec51f1ea1",
"score": "0.5477497",
"text": "def update\n @network_interface = @object\n\n # If the user specified some IP address info then handle that\n if params.include?(:ip_addresses)\n logger.info \"User included IP info, handling it\"\n\n authoritative = false\n iphashes = []\n if params[:ip_addresses].kind_of?(Hash)\n # Pull out the authoritative flag if the user specified it\n if params[:ip_addresses].include?(:authoritative)\n authoritative = params[:ip_addresses][:authoritative]\n params[:ip_addresses].delete(:authoritative)\n end\n iphashes = params[:ip_addresses].values\n elsif params[:ip_addresses].kind_of?(Array)\n iphashes = params[:ip_addresses]\n end\n \n iphashes.each do |iphash|\n logger.info \"Search for IP #{iphash[:address]}\"\n ip = @network_interface.ip_addresses.find_by_address(iphash[:address])\n if ip.nil?\n logger.info \"IP #{ipash[:address]} doesn't exist, creating it\" + iphash.to_yaml\n IpAddress.create(iphash)\n else\n logger.info \"IP #{ipash[:address]} exists, updating it\" + iphash.to_yaml\n ip.update_attributes(iphash)\n end\n end\n\n # If the client indicated that they were sending us an authoritative\n # set of info for this NIC then remove any IPs stored in the database\n # which the client didn't include in the info it sent\n if authoritative\n ips_from_client = []\n iphashes.each { |iphash| ips_from_client.push(iphash[:address]) }\n @network_interface.ip_addresses.each do |ip|\n if !ips_from_client.include?(ip.address)\n ip.destroy\n end\n end\n end\n\n end # if params.include?(:ip_addresses)\n \n respond_to do |format|\n if @network_interface.update_attributes(params[:network_interface])\n flash[:notice] = 'NetworkInterface was successfully updated.'\n format.html { redirect_to network_interface_url(@network_interface) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @network_interface.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acfa219f82d1eb08c9d27fcb3aeeab1b",
"score": "0.5464714",
"text": "def getSubnet\n end",
"title": ""
},
{
"docid": "fac49ad7d4dfaeb63d257166fae650fd",
"score": "0.54570144",
"text": "def update(address)\n fail ArgumentError, 'address must be of type Address' unless address.is_a? Address\n\n if 'IP_Netmask'.casecmp(address.type) == 0\n xpath = \"/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='#{address.device_group}']/address/entry[@name='#{address.name}']/ip-netmask\"\n element = \"<ip-netmask>#{address.address}</ip-netmask>\"\n elsif 'IP_Range'.casecmp(address.type) == 0\n xpath = \"/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='#{address.device_group}']/address/entry[@name='#{address.name}']/ip-range\"\n element = \"<ip-range>#{address.address}</ip-range>\"\n else # fqdn scenario\n xpath = \"/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='#{address.device_group}']/address/entry[@name='#{address.name}']/fqdn\"\n element = \"<fqdn>#{address.address}</fqdn>\"\n end\n\n begin\n \tset_address_response = RestClient::Request.execute(\n \t\t:method => :post,\n \t\t:verify_ssl => false,\n \t\t:url => @baseurl,\n \t\t:headers => {\n \t\t\t:params => {\n \t\t\t\t:key => @key.value,\n \t\t\t\t:type => 'config',\n \t\t\t\t:action => 'edit',\n \t\t\t\t:xpath => xpath,\n \t\t\t\t:element => element\n \t\t\t}\n \t\t}\n \t)\n update_hash = Crack::XML.parse(set_address_response)\n Chef::Log.info(\"update_address_hash is: #{update_hash}\")\n # It might return from the firewall call successfully, but with an error, so we need to check that.\n raise Exception.new(\"PANOS error updating address: #{update_hash['response']['msg']}\") if update_hash['response']['status'] == 'error'\n rescue => e\n raise Exception.new(\"Exception updating the address: #{e} \")\n end\n end",
"title": ""
},
{
"docid": "4eb60b9de1d1bb50d7b28fabdd665374",
"score": "0.5437724",
"text": "def delete\n attrcheck = { 'vcn' => @options[:vcn] }\n @validate.validate(@options, attrcheck)\n subnet_attr = AttrFinder.new(@instanceparameters)\n subnet_attr.options = @options\n subnet_attr.validate = @validate\n opts = {}\n BmcAuthenticate.new(@options)\n request = OracleBMC::Core::VirtualNetworkClient.new\n request.delete_subnet(subnet_attr.subnet, opts)\n return 'subnet ' + @options[:inst] + ' deleted'\n end",
"title": ""
},
{
"docid": "087807bee734c87ba6fad3815cf4c5c8",
"score": "0.54317236",
"text": "def delete_ip_block_subnet_with_http_info(subnet_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiPoolManagementIpBlocksApi.delete_ip_block_subnet ...'\n end\n # verify the required parameter 'subnet_id' is set\n if @api_client.config.client_side_validation && subnet_id.nil?\n fail ArgumentError, \"Missing the required parameter 'subnet_id' when calling ManagementPlaneApiPoolManagementIpBlocksApi.delete_ip_block_subnet\"\n end\n # resource path\n local_var_path = '/pools/ip-subnets/{subnet-id}'.sub('{' + 'subnet-id' + '}', subnet_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiPoolManagementIpBlocksApi#delete_ip_block_subnet\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "973675fa1abba074d7defbc5ce5f258f",
"score": "0.5425445",
"text": "def rackspace_subnet_finalizer(resource_name, new_resource, old_resource)\n new_resource[\"Properties\"][\"label\"] = resource_name\n end",
"title": ""
},
{
"docid": "f1ae3e2a145b19ef12f78d62d734f132",
"score": "0.54236954",
"text": "def subnet(subnet_name, subnet_prefix)\n {\n \"name\" => subnet_name,\n \"properties\" => {\n \"addressPrefix\" => subnet_prefix,\n },\n }\n end",
"title": ""
},
{
"docid": "668bf721d775eef5183e2da2ee44051f",
"score": "0.54163826",
"text": "def update\n @ip_address = @object\n if params[:network_ports]\n portshashes = params[:network_ports]\n process_network_ports(@ip_address,portshashes)\n params.delete(:network_ports)\n end\n\n respond_to do |format|\n if @ip_address.update_attributes(params[:ip_address])\n flash[:notice] = 'IpAddress was successfully updated.'\n format.html { redirect_to ip_address_url(@ip_address) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ip_address.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be4f09b75e1ec3d214888855cfae4fae",
"score": "0.54110086",
"text": "def create\n @subnet = Subnet.new(params[:subnet])\n\n respond_to do |format|\n if @subnet.save\n flash[:notice] = 'Subnet was successfully created.'\n format.html { redirect_to subnet_url(@subnet) }\n format.xml { head :created, :location => subnet_url(@subnet) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subnet.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f03d381fb3320836f26dccd5f90daa85",
"score": "0.5403077",
"text": "def subnet_name=(value)\n @subnet_name = value\n end",
"title": ""
},
{
"docid": "f03d381fb3320836f26dccd5f90daa85",
"score": "0.5403077",
"text": "def subnet_name=(value)\n @subnet_name = value\n end",
"title": ""
},
{
"docid": "3243b4cfe7cd0a73d5b184ad0b01c166",
"score": "0.5393245",
"text": "def create\n @subnet = Subnet.new(params[:subnet])\n\n respond_to do |format|\n if @subnet.save\n format.html { redirect_to(@subnet, :notice => 'Subnet was successfully created.') }\n format.xml { render :xml => @subnet, :status => :created, :location => @subnet }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3243b4cfe7cd0a73d5b184ad0b01c166",
"score": "0.5393245",
"text": "def create\n @subnet = Subnet.new(params[:subnet])\n\n respond_to do |format|\n if @subnet.save\n format.html { redirect_to(@subnet, :notice => 'Subnet was successfully created.') }\n format.xml { render :xml => @subnet, :status => :created, :location => @subnet }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3243b4cfe7cd0a73d5b184ad0b01c166",
"score": "0.5393245",
"text": "def create\n @subnet = Subnet.new(params[:subnet])\n\n respond_to do |format|\n if @subnet.save\n format.html { redirect_to(@subnet, :notice => 'Subnet was successfully created.') }\n format.xml { render :xml => @subnet, :status => :created, :location => @subnet }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subnet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cfb7867112300d53b1658b6b74f3ba1",
"score": "0.5381024",
"text": "def validate_subnet(subnet)\n invalid(\"subnet mask\") if subnet[0] != 255 || subnet.length != 4\n for i in 1..3\n invalid(\"subnet mask\") if subnet[i-1] < subnet[i]\n end\nend",
"title": ""
},
{
"docid": "2c515331d40ee9692c74e06e24b8fec2",
"score": "0.53744763",
"text": "def update!(**args)\n @assignment = args[:assignment] if args.key?(:assignment)\n @bcast = args[:bcast] if args.key?(:bcast)\n @fqdn = args[:fqdn] if args.key?(:fqdn)\n @ip_address = args[:ip_address] if args.key?(:ip_address)\n @subnet_mask = args[:subnet_mask] if args.key?(:subnet_mask)\n end",
"title": ""
},
{
"docid": "6fc903ae8f17404b73b8366a79c17bd9",
"score": "0.53550345",
"text": "def update!(**args)\n @default_gateway = args[:default_gateway] if args.key?(:default_gateway)\n @id = args[:id] if args.key?(:id)\n @ip_address = args[:ip_address] if args.key?(:ip_address)\n @network = args[:network] if args.key?(:network)\n @network_type = args[:network_type] if args.key?(:network_type)\n end",
"title": ""
},
{
"docid": "9dad395ce4ba3e411476821ccb33b434",
"score": "0.5347883",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n @update_mask = args[:update_mask] if args.key?(:update_mask)\n end",
"title": ""
},
{
"docid": "fedd1eb9ab57a0ec55e88cc9b8f95730",
"score": "0.53359675",
"text": "def update\n if !validate_addresses(true)\n self.resource = resource_class.to_adapter.get!(send(:\"current_#{resource_name}\").to_key)\n resource.errors.add(:address, 'nebyla řádně vyplněna.')\n respond_with resource\n else\n super do |resource|\n if resource.errors.messages.size <=0 && !save_addresses(resource)\n resource.errors.add(:address, 'nebyla řádně vyplněna.')\n return\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a3bc407e52a9e1c6b4b1e1acbaefd7bb",
"score": "0.53289294",
"text": "def update\n @breadcrumb = 'update'\n @contracting_request = ContractingRequest.find(params[:id])\n @contracting_request.updated_by = current_user.id if !current_user.nil?\n # @contracting_request.subscriber_id = params[:SubscriberB].to_i unless params[:SubscriberB].blank?\n # @contracting_request.service_point_id = params[:ServicePointB].to_i unless params[:ServicePointB].blank?\n\n respond_to do |format|\n if @contracting_request.update_attributes(params[:contracting_request])\n if @contracting_request.client.active_bank_account\n @contracting_request.client.active_bank_account.update_attributes(\n bank_account_class_id: BankAccountClass::SERVICIO,\n starting_at: @contracting_request.request_date,\n # country_id: @contracting_request.country_id,\n # iban_dc: @contracting_request.iban_dc,\n # bank_id: @contracting_request.bank_id,\n # bank_office_id: @contracting_request.bank_office_id,\n # ccc_dc: @contracting_request.account_no[0..1],\n # account_no: @contracting_request.account_no,\n iban: @contracting_request.iban,\n holder_fiscal_id: @contracting_request.client.fiscal_id,\n holder_name: @contracting_request.client.to_name)\n else\n ClientBankAccount.create(\n client_id: @contracting_request.client.id,\n bank_account_class_id: BankAccountClass::SERVICIO,\n starting_at: @contracting_request.request_date,\n # country_id: @contracting_request.country_id,\n # iban_dc: @contracting_request.iban_dc,\n # bank_id: @contracting_request.bank_id,\n # bank_office_id: @contracting_request.bank_office_id,\n # ccc_dc: @contracting_request.account_no[0..1],\n # account_no: @contracting_request.account_no,\n iban: @contracting_request.iban,\n holder_fiscal_id: @contracting_request.client.fiscal_id,\n holder_name: @contracting_request.client.to_name)\n end\n format.html { redirect_to @contracting_request,\n notice: (crud_notice('updated', @contracting_request) + \"#{undo_link(@contracting_request)}\").html_safe }\n format.json { head :no_content }\n else\n set_defaults_for_new_and_edit\n format.html { render action: \"edit\" }\n format.json { render json: @contracting_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e2aa6ff34dcc37b797cc9ee6693bf55",
"score": "0.5319978",
"text": "def update\n @subcontract = Subcontract.find(params[:id])\n\n respond_to do |format|\n if @subcontract.update_attributes(params[:subcontract])\n format.html { redirect_to @subcontract, notice: 'Subcontract was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subcontract.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ad1188a18a08739daced252e5549f87",
"score": "0.5309036",
"text": "def update!(**args)\n @address = args[:address] if args.key?(:address)\n @existing_network_id = args[:existing_network_id] if args.key?(:existing_network_id)\n @network_id = args[:network_id] if args.key?(:network_id)\n end",
"title": ""
},
{
"docid": "1ad1188a18a08739daced252e5549f87",
"score": "0.5309036",
"text": "def update!(**args)\n @address = args[:address] if args.key?(:address)\n @existing_network_id = args[:existing_network_id] if args.key?(:existing_network_id)\n @network_id = args[:network_id] if args.key?(:network_id)\n end",
"title": ""
},
{
"docid": "2b491265f4d3e2f0956e5968b8488efb",
"score": "0.53006214",
"text": "def create_subnets(client, our_region, availability_zones, vpc_id)\n # Create private subnet #1.\n puts 'Creating private subnet #1 (10.0.1.0/24) in first AZ...'\n response = client.create_subnet(cidr_block: '10.0.1.0/24',\n vpc_id: vpc_id,\n availability_zone: our_region + availability_zones[0])\n priv_net1_id = response.subnet['subnet_id']\n priv_net1_az = response.subnet['availability_zone']\n puts \"Subnet created; priv_subnet1_id (10.0.1.0/24) = [#{priv_net1_id}]; AZ = [#{priv_net1_az}]\"\n\n # Create private subnet #2.\n puts 'Creating private subnet #2 (10.0.2.0/24) in second AZ...'\n response = client.create_subnet(cidr_block: '10.0.2.0/24',\n vpc_id: vpc_id,\n availability_zone: our_region + availability_zones[1])\n priv_net2_id = response.subnet['subnet_id']\n priv_net2_az = response.subnet['availability_zone']\n puts \"Subnet created; priv_subnet2_id (10.0.2.0/24) = [#{priv_net2_id}]; AZ = [#{priv_net2_az}]\"\n\n # Create PUBLIC subnet #1 (For nat instance) in first AZ.\n puts 'Creating public subnet #1 (10.0.100.0/24) in first AZ...'\n response = client.create_subnet(cidr_block: '10.0.100.0/24',\n vpc_id: vpc_id,\n availability_zone: our_region + availability_zones[0])\n pub_net1_id = response.subnet['subnet_id']\n pub_net1_az = response.subnet['availability_zone']\n puts \"Subnet created; pub_subnet1_id (10.0.100.0/24) = [#{pub_net1_id}]; AZ = [#{pub_net1_az}]\"\n\n # Create PUBLIC subnet #2 (For nat instance) in second AZ.\n puts 'Creating public subnet #2 (10.0.200.0/24) in second AZ...'\n response = client.create_subnet(cidr_block: '10.0.200.0/24',\n vpc_id: vpc_id,\n availability_zone: our_region + availability_zones[1])\n pub_net2_id = response.subnet['subnet_id']\n pub_net2_az = response.subnet['availability_zone']\n puts \"Subnet created; pub_subnet1_id (10.0.200.0/24) = [#{pub_net2_id}]; AZ = [#{pub_net2_az}]\"\n\n # Map a public IPv4 address to all instances launched into public subnet (10.0.100.0/24).\n client.modify_subnet_attribute(map_public_ip_on_launch: { value: true }, subnet_id: pub_net1_id)\n # Map a public IPv4 address to all instances launched into public subnet (10.0.200.0/24).\n client.modify_subnet_attribute(map_public_ip_on_launch: { value: true }, subnet_id: pub_net2_id)\n\n return pub_net1_id, pub_net2_id, priv_net1_id, priv_net2_id\nend",
"title": ""
},
{
"docid": "5cacc0a783af19cde035ba46e490378f",
"score": "0.52992505",
"text": "def subnet_id\n @instance.subnet_id\n end",
"title": ""
},
{
"docid": "469079300700120400da4caae6ee871c",
"score": "0.52961516",
"text": "def update\n @subregion = Subregion.find(params[:id])\n\n respond_to do |format|\n if @subregion.update_attributes(params[:subregion])\n format.html { redirect_to @subregion, notice: 'Registro editado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subregion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e82a8014c1ca92ff28f930ae98971905",
"score": "0.52961487",
"text": "def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end",
"title": ""
},
{
"docid": "91d52b9a5447d29a9dfa69af83db3459",
"score": "0.5295591",
"text": "def create_subnet(node_id:,payload:, **options)\n path = subnet_path(user_id: self.user_id, node_id: node_id)\n begin\n subnet = client.post(path,payload, options)\n rescue Synapse::Error::Unauthorized\n self.authenticate()\n subnet = client.post(path,payload, options)\n end\n Subnet.new(subnet_id: subnet['_id'], payload: subnet, node_id: node_id)\n end",
"title": ""
},
{
"docid": "a7a9b620897117de8d1044203b70d00b",
"score": "0.5286502",
"text": "def update(options={})\n param = { :uniq_id => @uniq_id }.merge options\n if param[:services]\n param[:services] = param[:services].map { |s| s.to_hash }\n end\n param[:session_persistence] = param[:session_persistence] ? 1 : 0\n param[:ssl_includes] = param[:ssl_includes] ? 1 : 0\n param[:ssl_termination] = param[:ssl_termination] ? 1 : 0\n data = Storm::Base::SODServer.remote_call \\\n '/Network/LoadBalancer/update', param\n self.from_hash data\n end",
"title": ""
},
{
"docid": "b806407b0044a17936e6e86e8340ec6a",
"score": "0.52827674",
"text": "def update(base=self) \n \n if self.class.update_url \n response = do_request(\"update_url\", :put) \n if ([\"200\", \"201\"].include? response.code.to_s )\n self.fill_from_response(response.body) \n end\n \n else\n raise ARError, \"This class can't be updated remotely, \\\n Check the Resource Definition\"\n end\n \n if block_given?; yield response; end\n \n end",
"title": ""
},
{
"docid": "d0051d60207981e557ed289610117cc3",
"score": "0.52826273",
"text": "def subnet_name\n @subnet_name\n end",
"title": ""
},
{
"docid": "b6a4b265d78dae70bfdc7bf3acb095e5",
"score": "0.5282567",
"text": "def update!(**args)\n @bandwidth = args[:bandwidth] if args.key?(:bandwidth)\n @cidr = args[:cidr] if args.key?(:cidr)\n @id = args[:id] if args.key?(:id)\n @location = args[:location] if args.key?(:location)\n @service_cidr = args[:service_cidr] if args.key?(:service_cidr)\n @type = args[:type] if args.key?(:type)\n @user_note = args[:user_note] if args.key?(:user_note)\n @vlan_attachments = args[:vlan_attachments] if args.key?(:vlan_attachments)\n end",
"title": ""
},
{
"docid": "b6a4b265d78dae70bfdc7bf3acb095e5",
"score": "0.5282567",
"text": "def update!(**args)\n @bandwidth = args[:bandwidth] if args.key?(:bandwidth)\n @cidr = args[:cidr] if args.key?(:cidr)\n @id = args[:id] if args.key?(:id)\n @location = args[:location] if args.key?(:location)\n @service_cidr = args[:service_cidr] if args.key?(:service_cidr)\n @type = args[:type] if args.key?(:type)\n @user_note = args[:user_note] if args.key?(:user_note)\n @vlan_attachments = args[:vlan_attachments] if args.key?(:vlan_attachments)\n end",
"title": ""
},
{
"docid": "d735e23b886c6cb20702a2563a66586b",
"score": "0.5282251",
"text": "def loadSubnetData subnet\n logger.debug \"loading subnets for #{subnet}\"\n end",
"title": ""
},
{
"docid": "d0051d60207981e557ed289610117cc3",
"score": "0.52813464",
"text": "def subnet_name\n @subnet_name\n end",
"title": ""
},
{
"docid": "5a440778e39d262f5c7cba462ebd0804",
"score": "0.5281077",
"text": "def required_updates(object)\n ret = []\n if desired_options[:db_subnet_group_description] != object[:db_subnet_group_description]\n ret << \" set group description to #{desired_options[:db_subnet_group_description]}\"\n end\n\n if ! xor_array(desired_options[:subnet_ids], subnet_ids(object[:subnets])).empty?\n ret << \" set subnets to #{desired_options[:subnet_ids]}\"\n end\n\n if ! (desired_options[:aws_tags].nil? || desired_options[:aws_tags].empty?)\n # modify_db_subnet_group doesn't support the tags key according to\n # http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/RDS/Client.html#modify_db_subnet_group-instance_method\n Chef::Log.warn \"Updating tags for RDS subnet groups is not supported.\"\n end\n\n ret.unshift(\"update RDS subnet group #{new_resource.name} in #{region}\") unless ret.empty?\n ret\n end",
"title": ""
},
{
"docid": "a1125cf05549f96e64b596540ea1fa93",
"score": "0.5273481",
"text": "def update_ethereum_address\n service_response = AdminManagement::Kyc::UpdateEthereumAddress.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "2e20245a7da41a077eaf8b55ac08c335",
"score": "0.52734554",
"text": "def test_update_ipaddress_success\n register\n ok = pathfinder_node.update_ipaddress(\n container: shared_vars[:container]\n )\n assert_equal(true, ok)\n end",
"title": ""
},
{
"docid": "8a67d59bcfed79f154fdca5f1fc8070b",
"score": "0.5263639",
"text": "def edit_resource(type, id, data)\n bad_attrs = data_includes_invalid_attrs(data)\n\n if bad_attrs.present?\n msg = \"Attribute(s) '#{bad_attrs}' should not be specified for updating a region resource\"\n raise BadRequestError, msg\n end\n\n super\n end",
"title": ""
}
] |
8315968031f9d7fe54421508ee7677d9 | destroys all copies of this standard object | [
{
"docid": "a553f0db1906ed3daed0615d63cb6263",
"score": "0.6680939",
"text": "def destroy_copies\n return unless is_standard?\n\n if self.class.log_replication?\n lines = []\n lines << \"***** DESTROYING COPIES BEFORE DESTROYING STANDARD ***************************************\"\n lines << \"Source obj: #{self}\"\n Rails.logger.debug(lines.join(\"\\n\"))\n end\n\n copies(true).each{|c| c.destroy}\n return true\n end",
"title": ""
}
] | [
{
"docid": "ab77299a38a2493a653395073083a200",
"score": "0.7317082",
"text": "def clear() \n @obj.clear() \n end",
"title": ""
},
{
"docid": "611d0e71e33becff3b8be21fcfb7cadd",
"score": "0.7309369",
"text": "def desist\n self.class.delete self\n end",
"title": ""
},
{
"docid": "99ad34bd1c3e4eb9ab2e0fbe919235f9",
"score": "0.69411296",
"text": "def __clean__(object=self)\n __clean__!(object.dup)\n end",
"title": ""
},
{
"docid": "476169d2747a9b7591e7f5ad930536c2",
"score": "0.69338137",
"text": "def clear\n instance.clear\n end",
"title": ""
},
{
"docid": "8bd9c76946cae6b55de60d59f37047d4",
"score": "0.6801229",
"text": "def destroy\n #primitives in structs are without parent\n parent and parent.children.delete self\n end",
"title": ""
},
{
"docid": "f2a3887b8080142c115d60f17514ddd9",
"score": "0.6757247",
"text": "def clear!; end",
"title": ""
},
{
"docid": "f2a3887b8080142c115d60f17514ddd9",
"score": "0.6757247",
"text": "def clear!; end",
"title": ""
},
{
"docid": "f2a3887b8080142c115d60f17514ddd9",
"score": "0.6757247",
"text": "def clear!; end",
"title": ""
},
{
"docid": "b17759bad507a39c71a3f9d43427c810",
"score": "0.67565453",
"text": "def clean\n self.dup.clean!\n end",
"title": ""
},
{
"docid": "823292dbc58d2653e82199eae90b3190",
"score": "0.67223084",
"text": "def clear() end",
"title": ""
},
{
"docid": "823292dbc58d2653e82199eae90b3190",
"score": "0.67223084",
"text": "def clear() end",
"title": ""
},
{
"docid": "ff3a42920bbde2b44865b86e42a0b2fd",
"score": "0.67065823",
"text": "def destroy\n self.class.destroy(self.hash)\n self\n end",
"title": ""
},
{
"docid": "ee4feaea62b47ecf28fd782917b5b1a9",
"score": "0.66998076",
"text": "def clear\n initialize\n self\n end",
"title": ""
},
{
"docid": "9cd9e70975caf7b97171700d904d74e0",
"score": "0.66829747",
"text": "def clear; end",
"title": ""
},
{
"docid": "9cd9e70975caf7b97171700d904d74e0",
"score": "0.66829747",
"text": "def clear; end",
"title": ""
},
{
"docid": "9cd9e70975caf7b97171700d904d74e0",
"score": "0.66829747",
"text": "def clear; end",
"title": ""
},
{
"docid": "9cd9e70975caf7b97171700d904d74e0",
"score": "0.66829747",
"text": "def clear; end",
"title": ""
},
{
"docid": "9cd9e70975caf7b97171700d904d74e0",
"score": "0.66829747",
"text": "def clear; end",
"title": ""
},
{
"docid": "9cd9e70975caf7b97171700d904d74e0",
"score": "0.66829747",
"text": "def clear; end",
"title": ""
},
{
"docid": "9cd9e70975caf7b97171700d904d74e0",
"score": "0.66829747",
"text": "def clear; end",
"title": ""
},
{
"docid": "d10f82950249672fa453502dff045bbc",
"score": "0.665812",
"text": "def destroy\n\t\tFile.delete @filepath\n\t\t@data_base = nil\n\t\t@data_base.freeze\n\t\tself.freeze\n\tend",
"title": ""
},
{
"docid": "1072735002f428f2e5a73b0247935609",
"score": "0.6639529",
"text": "def cleanup!; end",
"title": ""
},
{
"docid": "1072735002f428f2e5a73b0247935609",
"score": "0.6639529",
"text": "def cleanup!; end",
"title": ""
},
{
"docid": "43e7199cbaea6284812b700a3e8bd099",
"score": "0.6635375",
"text": "def destroy\n self.cleanTitle\n\n # Clear the matrix windows.\n CDK.deleteCursesWindow(@cell[0][0])\n (1..@vrows).each do |x|\n CDK.deleteCursesWindow(@cell[x][0])\n end\n (1..@vcols).each do |x|\n CDK.deleteCursesWindow(@cell[0][x])\n end\n (1..@vrows).each do |x|\n (1..@vcols).each do |y|\n CDK.deleteCursesWindow(@cell[x][y])\n end\n end\n\n CDK.deleteCursesWindow(@shadow_win)\n CDK.deleteCursesWindow(@win)\n\n # Clean the key bindings.\n self.cleanBindings(:MATRIX)\n\n # Unregister this object.\n CDK::SCREEN.unregister(:MATRIX, self)\n end",
"title": ""
},
{
"docid": "bd83126fcbf5b32f611c1532438ea033",
"score": "0.6628896",
"text": "def clear\n initialize\n end",
"title": ""
},
{
"docid": "bd83126fcbf5b32f611c1532438ea033",
"score": "0.6628896",
"text": "def clear\n initialize\n end",
"title": ""
},
{
"docid": "a7c77d60c79856459e522d073d177c17",
"score": "0.66212046",
"text": "def destroy\n self.deactivate\n if @affects\n @affects.dup.each do |affect|\n affect.clear(true)\n end\n end\n # clear affects that have this object as a source and require a source\n if @source_affects\n @source_affects.each do |source_affect|\n\n end\n end\n if @keywords\n @keywords.decrement_use_count\n end\n if @model && @model.temporary\n @model.decrement_use_count\n end\n @affects = nil\n @source_affects = nil\n Game.instance.remove_gameobject(self)\n return\n end",
"title": ""
},
{
"docid": "7dd61bb2906c19bbc9c25d2aa368387e",
"score": "0.6610794",
"text": "def clear\n @mutex.synchronize do\n @tuples.clear\n @objects.clear\n @catdata.clear\n end\n self\n end",
"title": ""
},
{
"docid": "77e6e06f27eeaf203b225a4e3568278a",
"score": "0.6587018",
"text": "def reset\n cleanup(true)\n end",
"title": ""
},
{
"docid": "bf4ca86b0f0ba09cd320f2b69bdd79f0",
"score": "0.65776837",
"text": "def destroy!\n self.destroy\n end",
"title": ""
},
{
"docid": "c4fe6bed297618041988f9f77513455c",
"score": "0.6561072",
"text": "def cleanup\r\n end",
"title": ""
},
{
"docid": "f2aa224c173ae8631d065a2c78228e0f",
"score": "0.65579534",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "f2aa224c173ae8631d065a2c78228e0f",
"score": "0.65579534",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "8d97dd939dd63123cc4200ccb155c81d",
"score": "0.6553583",
"text": "def clear\n @object_id_to_object.clear\n registered_exceptions.clear\n manager.clear\n end",
"title": ""
},
{
"docid": "0ef2a348341832633a6995433c4a981a",
"score": "0.65428454",
"text": "def clear_garbage\n self.tmp_garbage.each do |relation, record|\n if record.is_a? Array\n record.each { |r| r.destroy }\n else\n record.destroy\n end\n end if self.tmp_garbage.present?\n self.tmp_garbage = {}\n end",
"title": ""
},
{
"docid": "8d5809e9d817f95a43621b25dd6d0185",
"score": "0.6528178",
"text": "def clean\n # dispose all damage sprites\n @damages.each {|sprite| sprite.dispose if sprite.is_a?(Sprite)}\n # dispose all beam sprites\n @beams.each {|ary| ary[0].dispose}\n # create new damage sprite buffer and new projectile buffer\n @damages, @remotes, @beams = [], [], []\n # unfreeze all actor's actions\n $BlizzABS.battlers.each {|actor| actor.freeze_action = false}\n # clear observation and path request data\n $BlizzABS.AI = BlizzABS::AI.new\n end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.6526858",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.6526858",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.6526858",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.6526858",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "2bd809b9d59c842666a87978fe3459bd",
"score": "0.6526164",
"text": "def clear_temporary\n @temporary_objects.each_key do |key|\n @temporary_objects[key].remove\n @temporary_objects.delete(key)\n end\n end",
"title": ""
},
{
"docid": "180adc6c9c8499437bf55c22409d8811",
"score": "0.65199935",
"text": "def teardown\n @mem.mem_clear\n end",
"title": ""
},
{
"docid": "c10a82274b3e6a82661ac0b17aaf17e3",
"score": "0.651668",
"text": "def clear\n @hash.clear\n self\n end",
"title": ""
},
{
"docid": "76097d669256b3e054a9069c62baf0e4",
"score": "0.650393",
"text": "def clear_attributes\n @attributes = nil\n end",
"title": ""
},
{
"docid": "5d7b1a1cea1360a54dabe405f9b90976",
"score": "0.64996696",
"text": "def destroy\n delete\n freeze\n end",
"title": ""
},
{
"docid": "4bf304c04de16b481d39cb1d373cb2c0",
"score": "0.6496436",
"text": "def _clear_accessors\n self.__pack = nil\n self._store = nil\n end",
"title": ""
},
{
"docid": "ba74b1a8e9f4c8178b2446eb30dc7b0a",
"score": "0.6479312",
"text": "def cleanup\n super\n end",
"title": ""
},
{
"docid": "ebc225660e4c13c47d379077ab5a68d9",
"score": "0.64660835",
"text": "def dispose\n call Memory.deAlloc(self)\n end",
"title": ""
},
{
"docid": "ebc225660e4c13c47d379077ab5a68d9",
"score": "0.64660835",
"text": "def dispose\n call Memory.deAlloc(self)\n end",
"title": ""
},
{
"docid": "8ccf0f42b14c8c6abe232fe39df37a9b",
"score": "0.6449284",
"text": "def cleanup!\n # This method may be left unimplemented if that is applicable\n end",
"title": ""
},
{
"docid": "a14a02e1a5c976928bbdde8354c578c0",
"score": "0.6446791",
"text": "def cleanup\n super\n end",
"title": ""
},
{
"docid": "8277d2bcb74c930552b795b703ef6a79",
"score": "0.64419925",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "8277d2bcb74c930552b795b703ef6a79",
"score": "0.64419925",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "8277d2bcb74c930552b795b703ef6a79",
"score": "0.64419925",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "8277d2bcb74c930552b795b703ef6a79",
"score": "0.64419925",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "391e427cc7de791bdb4cd7a3c2bc22c8",
"score": "0.6432914",
"text": "def reset\n (@settings||{}).each do |name,instance| \n remove_setter(name)\n remove_getter(name)\n remove_boolean_getter(name)\n instance.destroy\n end\n @settings = Hash.new\n end",
"title": ""
},
{
"docid": "c38353f4a4854f2d3ce49f0806487c97",
"score": "0.6432359",
"text": "def destroy\n self.cleanTitle\n @label = []\n \n # Clean up the windows.\n CDK.deleteCursesWindow(@field_win)\n CDK.deleteCursesWindow(@label_win)\n CDK.deleteCursesWindow(@shadow_win)\n CDK.deleteCursesWindow(@win)\n\n # Clean the key bindings.\n self.cleanBindings(self.object_type)\n\n # Unregister this object\n CDK::SCREEN.unregister(self.object_type, self)\n end",
"title": ""
},
{
"docid": "26bf6f198fafdd73397ba57ef6a24a43",
"score": "0.64313275",
"text": "def clear\n instance_variables.each do |instance_variable|\n instance_variable_set(instance_variable, nil)\n end\n end",
"title": ""
},
{
"docid": "43f80604a4d9537a487e7d3d08fe9646",
"score": "0.6405585",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "43f80604a4d9537a487e7d3d08fe9646",
"score": "0.6405585",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "43f80604a4d9537a487e7d3d08fe9646",
"score": "0.6405585",
"text": "def cleanup\n end",
"title": ""
},
{
"docid": "ba9beb14e19c0ab9dad85a7205680322",
"score": "0.6404292",
"text": "def destroy\n self.littles.each do | little|\n little.big_id = nil;\n end\n self.positions.each do | pos |\n pos.dke_info_id = nil;\n end\n return super\n end",
"title": ""
},
{
"docid": "c103287b2a05cfb21b29bb588f507244",
"score": "0.63931596",
"text": "def reset(_object); end",
"title": ""
},
{
"docid": "c902588907acc48045afad419b664c3c",
"score": "0.63821626",
"text": "def clear_tracking\n ::ObjectSpace.trace_object_allocations_clear\n end",
"title": ""
},
{
"docid": "88ac493d00942df1d981689835215cdf",
"score": "0.6375607",
"text": "def destroy\n kill\n reset\n end",
"title": ""
},
{
"docid": "226525cdcd90488a98d5eb494c7d674f",
"score": "0.63722646",
"text": "def destroy\n object_data.each {|o| ObjectDatum.find_by_guid(o.guid).destroy if o && ObjectDatum.find_by_guid(o.guid)}\n super\n end",
"title": ""
},
{
"docid": "7798e1c79c52d3233dc59263e62decfa",
"score": "0.6354349",
"text": "def destroy\n clear\n save\n end",
"title": ""
},
{
"docid": "89cd0e79a57b029367cfd9a3354d41b1",
"score": "0.63489246",
"text": "def cleanup\n self.objectives.destroy_all\n end",
"title": ""
},
{
"docid": "2a05e7a10f220ae056f02af313203f6e",
"score": "0.63470936",
"text": "def destroy\n @standard.destroy\n end",
"title": ""
},
{
"docid": "3d0e50222f223962327df9de3fea729e",
"score": "0.6339621",
"text": "def purge!\n @data = nil\n end",
"title": ""
},
{
"docid": "3d0e50222f223962327df9de3fea729e",
"score": "0.6339621",
"text": "def purge!\n @data = nil\n end",
"title": ""
},
{
"docid": "8d481ab7e1db9e9cb1111c3e4f3014d3",
"score": "0.63322073",
"text": "def clear\n\t\tif @active\n\t\t\t@active.cleanup\n\t\t\t@active = nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bd4ec7d95794948dbd4c54f2943c82fb",
"score": "0.6327869",
"text": "def destroy\n self.delete_\n end",
"title": ""
},
{
"docid": "7c62acdc7d0ed257fdaceff81c32e848",
"score": "0.63207746",
"text": "def clear\n return\n end",
"title": ""
},
{
"docid": "0ad464299ac02282696abadfaec101a2",
"score": "0.63187444",
"text": "def cleanup\n cleanup_nonces\n cleanup_associations\n end",
"title": ""
},
{
"docid": "4bffccd99d21077a7f329c223e3bce8a",
"score": "0.63186276",
"text": "def destroy!; end",
"title": ""
},
{
"docid": "7fcae145a95ffb32b9e86cc5bf328e26",
"score": "0.63030946",
"text": "def clear!\n end",
"title": ""
},
{
"docid": "78a1e2dee0b71ebf4cdd460f671432ce",
"score": "0.6291873",
"text": "def clear\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "78a1e2dee0b71ebf4cdd460f671432ce",
"score": "0.6291873",
"text": "def clear\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "590d003bff27a45cd7c1bef635837131",
"score": "0.6288974",
"text": "def dealloc\n end",
"title": ""
},
{
"docid": "57bd3fa2addb492e891315203ffd8263",
"score": "0.6282237",
"text": "def cleanup\n self.image = nil\n GC.start\n end",
"title": ""
},
{
"docid": "57bd3fa2addb492e891315203ffd8263",
"score": "0.6282237",
"text": "def cleanup\n self.image = nil\n GC.start\n end",
"title": ""
},
{
"docid": "38d8670d06a4d6c73b3dec5ab244cd74",
"score": "0.6271658",
"text": "def reset\n @instance = nil\n @local_env = nil\n end",
"title": ""
},
{
"docid": "38d8670d06a4d6c73b3dec5ab244cd74",
"score": "0.6271658",
"text": "def reset\n @instance = nil\n @local_env = nil\n end",
"title": ""
},
{
"docid": "9a606ae42219c100f5a9094470bf7514",
"score": "0.62688535",
"text": "def clear\n end",
"title": ""
},
{
"docid": "9a606ae42219c100f5a9094470bf7514",
"score": "0.62688535",
"text": "def clear\n end",
"title": ""
},
{
"docid": "cf2470c33db0c76c6649f8b2f7c3b27e",
"score": "0.62514216",
"text": "def clear_changes!\n remove_instance_variable(:@original_hash) if defined?(@original_hash)\n end",
"title": ""
},
{
"docid": "51ed553d29bb63a29093013bbedb07d5",
"score": "0.6241234",
"text": "def cleanup!\n input.drop\n output.drop\n end",
"title": ""
},
{
"docid": "698783b671af2f9ef48986e5db3d634e",
"score": "0.6239611",
"text": "def unload\n @all = nil\n end",
"title": ""
},
{
"docid": "552668a352362b128f95a3b1ed9c0ff1",
"score": "0.62360525",
"text": "def clear\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "8840b5f10df21008069b5aa8f1d29d5e",
"score": "0.6235935",
"text": "def clear\n # self\n end",
"title": ""
},
{
"docid": "04c444c7b8c28a34f67a6f69cc746ead",
"score": "0.62334204",
"text": "def disable_clear_and_finalize; end",
"title": ""
},
{
"docid": "904c3989ccc8f14255c58e54e2cccfd0",
"score": "0.62327623",
"text": "def clean!\n @data = freezer(@data.merge(@dirty))\n @dirty.clear\n self\n end",
"title": ""
},
{
"docid": "f7e7940c9d08ba5ae2223e787bbf118c",
"score": "0.6232638",
"text": "def reset\n dup.reset!\n end",
"title": ""
},
{
"docid": "ed19377791520cbfcbde8c4de3aae0ca",
"score": "0.622446",
"text": "def clear\n end",
"title": ""
},
{
"docid": "ed19377791520cbfcbde8c4de3aae0ca",
"score": "0.622446",
"text": "def clear\n end",
"title": ""
},
{
"docid": "ed19377791520cbfcbde8c4de3aae0ca",
"score": "0.622446",
"text": "def clear\n end",
"title": ""
},
{
"docid": "5838f33bea2dd90b04713f3dfcc2436b",
"score": "0.62237906",
"text": "def reset!\n self.instance_variables.each { |variable| instance_variable_set(variable, nil) }\n self\n end",
"title": ""
},
{
"docid": "2ea6108afbc8fb3a75a851dacfa06c68",
"score": "0.6217793",
"text": "def destroy\n super\n\n @children.each do |_child_name, child_group|\n child_group.each(&:destroy)\n end\n\n @children = {}\n end",
"title": ""
},
{
"docid": "764bc426adb22249bed9d074f2fe002a",
"score": "0.6216652",
"text": "def purge_all\n initialize\n end",
"title": ""
}
] |
c029c0529189f51f2064606242ed3bcf | Returns an array of Location objects based on the locations found in the page. | [
{
"docid": "a79a9303c6e6d69b0d9b00c965799de7",
"score": "0.6096105",
"text": "def locations\n body_element = hpricot_doc.at(@content_css_selector)\n master_extractor = Extractors::Master.new(body_element)\n master_extractor.locations\n end",
"title": ""
}
] | [
{
"docid": "ef4406a5cf11c2708743de6b135fc76e",
"score": "0.7371326",
"text": "def locations\n Array(location)\n end",
"title": ""
},
{
"docid": "b5b5334893aee549f105bd57e32b15f7",
"score": "0.7181847",
"text": "def locations(options={})\n locator.to_a\n end",
"title": ""
},
{
"docid": "594c394775004146135f6384792198fe",
"score": "0.71442974",
"text": "def locations\n collect\n end",
"title": ""
},
{
"docid": "f66ffd63314b0a3e8facd8610a514daf",
"score": "0.70069677",
"text": "def locations\n @locations ||= @doc.search(\"/user/location-hierarchy/location\").map do |location|\n FireEagle::Location.new(location.to_s)\n end\n end",
"title": ""
},
{
"docid": "fa0903b85d8ecabf6e05c4d0ebe3ea4c",
"score": "0.7000926",
"text": "def get_all_locations\n @locations = []\n Location.all.each do |location|\n @locations.push( location )\n end\n end",
"title": ""
},
{
"docid": "4521d8b2cc11c442e78f9562f60ff687",
"score": "0.6914906",
"text": "def get_all_locations\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "4521d8b2cc11c442e78f9562f60ff687",
"score": "0.6914906",
"text": "def get_all_locations\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "780ce10e0bfc6290982095d784192e93",
"score": "0.6912843",
"text": "def get_all_locations\n @locations = []\n end",
"title": ""
},
{
"docid": "cfd98619f1f2912be66f733c84b3d1e1",
"score": "0.6877563",
"text": "def locations\n return @locations\n end",
"title": ""
},
{
"docid": "cfd98619f1f2912be66f733c84b3d1e1",
"score": "0.6877563",
"text": "def locations\n return @locations\n end",
"title": ""
},
{
"docid": "c5aa296aa895e2c30fb61cb09546b79d",
"score": "0.6862797",
"text": "def locations\n @locations = [{:selected => 0, :content => Location.roots.order(:name)}]\n if params[:selected]\n location = Location.find_by_id params[:selected]\n @locations = location.select_with_selected(true) if location\n end\n if params[:search_by_code_type]\n location = Location.where(:sti_type => params[:search_by_code_type], :code => params[:search_by_code]).first\n @locations = location.select_with_selected(true) if location\n end\n end",
"title": ""
},
{
"docid": "cb89e6b1a0b6d641e7e823785daf5283",
"score": "0.6833731",
"text": "def location_links()\n\t\treturn $test_driver.find_elements(:class, \"location\")\n\tend",
"title": ""
},
{
"docid": "bc5362cbdb79cd2105a6b6ac262de465",
"score": "0.6767627",
"text": "def locations\n Locations.new(@position)\n end",
"title": ""
},
{
"docid": "805e5b54273bb44407911c3295be9010",
"score": "0.6712184",
"text": "def list_locations\n headers = default_headers\n headers['Accept'] = 'text/xml'\t# JSON locations not supported\n Nokogiri.XML(get('/locations', headers))\n end",
"title": ""
},
{
"docid": "34a13a861e0cd4e355e74adb804f1f78",
"score": "0.6681522",
"text": "def get_locations\n data = parse_url[\"geonames\"]\n locations = Array.new\n \n data.each do |loc|\n location = Hash.new\n location[\"name\"] = loc[\"title\"]\n location[\"lat\"] = loc[\"lat\"]\n location[\"long\"] = loc[\"lng\"]\n \n locations.push(location)\n end\n \n return locations\n end",
"title": ""
},
{
"docid": "4679d5bc470a3627f70072cac78f81dc",
"score": "0.6669933",
"text": "def locations\n @locations ||= locations!\n end",
"title": ""
},
{
"docid": "74ebea7f2b30f18fe41bff668b2bd22c",
"score": "0.66653717",
"text": "def get_all_locations\n places = Location.all\n @locations = []\n places.each do |place|\n @locations << place.to_hash\n end\n return\n end",
"title": ""
},
{
"docid": "45adc32543a8979c3c555c32397fbab8",
"score": "0.66258895",
"text": "def get_locations\n location_references =\n lighthouse_appointments.map do |appt|\n reference = appt.resource.participant.first.actor.reference\n\n reference.match(ID_MATCHER)[1]\n end\n\n location_references.each_with_object([]) do |ref, accumulator|\n loc = location_service.get(ref)\n # We're hard coding the identifier value until the Lighthouse team\n # adds this to the Location resources in their Health API.\n # This hard coding will be removed by the end of the sprint\n # scheduled to be completed by 03-23-21\n #############################\n idf = FHIR::Identifier.new\n idf.value = 'vha_534_12975'\n loc.resource.identifier = idf\n #############################\n accumulator << loc\n end\n end",
"title": ""
},
{
"docid": "afece724df61a36fd37ed84b738554f6",
"score": "0.6624404",
"text": "def locations(opts = {})\n find_collection(\"locations\", opts)\n end",
"title": ""
},
{
"docid": "87eca9c95890e8a0183126e25ce1e971",
"score": "0.66181386",
"text": "def find_course_location\n location_ids = []\n\n if location_results_paginated?\n for page_number in 1..total_pages\n jump_to_page(page_number)\n location_ids += fetch_location_ids_from_current_page\n end\n else\n location_ids += fetch_location_ids_from_current_page\n end\n\n location_ids\n end",
"title": ""
},
{
"docid": "ae06b2cf3f88249b1a78fb50cd74fde6",
"score": "0.6599666",
"text": "def locations; end",
"title": ""
},
{
"docid": "ae06b2cf3f88249b1a78fb50cd74fde6",
"score": "0.6599666",
"text": "def locations; end",
"title": ""
},
{
"docid": "ae06b2cf3f88249b1a78fb50cd74fde6",
"score": "0.6599666",
"text": "def locations; end",
"title": ""
},
{
"docid": "3bf846db779e4590849d01e774d49da7",
"score": "0.6581367",
"text": "def locations!\n mashup(self.class.get(\"/\", :query => method_params('aj.jobs.getLocations'))).locations.location\n end",
"title": ""
},
{
"docid": "54e09ecd3d26099c2071e5cad01f2873",
"score": "0.65120476",
"text": "def list_locations\n request = @client.management_request(:get, '/locations')\n response = request.call\n Serialization.locations_from_xml(response)\n end",
"title": ""
},
{
"docid": "5c91fadc82f003065f09166aefab6f6f",
"score": "0.64971536",
"text": "def parse_location_page(page_index=\"\")\n found_locations = Array.new\n locations = Nokogiri::HTML(open(\"#{@all_locations_link}#{page_index}\")).css(\"div.businessresult\")\n locations.each do |location|\n title_link = location.css(\"h4.itemheading a\").first\n url = title_link[:href]\n my_html = read_html \"http://www.yelp.com#{url}?rpp=10&sort_by=date_desc\"\n doc = Nokogiri::HTML(my_html)\n street_address = doc.css(\"span.street-address\").first.inner_html\n puts \"street address text = #{street_address}\"\n street_address_parts = street_address.split(\"<br>\")\n puts \"street address parts #{street_address_parts}\"\n found = Location.new\n found.url = url\n found.name= title_link.inner_html.sub(/[0-9]*\\./,'')\n found.address_line_1 = street_address_parts[0].to_s\n found.address_line_2 = street_address_parts[1].to_s\n found.address_line_3 = street_address_parts[2].to_s\n found.city = doc.css(\"span.locality\").text\n found.state = doc.css(\"span.region\").text\n found.zip = doc.css(\"span.postal-code\").text\n found.phone_number_1 = doc.css(\"span#bizPhone\").text\n found_locations << found\n end\n found_locations\n end",
"title": ""
},
{
"docid": "9eb77066656e7f49c5c4142673b4b8e5",
"score": "0.6481306",
"text": "def extract_locationSet\n locationSet_array = {}\n self.find_by_terms('//vra:locationSet/vra:display').each do |location_display|\n insert_solr_field_value(locationSet_array, \"location_display_tesim\", location_display.text)\n end\n\n # Add a field for each location\n self.find_by_terms('//vra:locationSet/vra:location').each do |location|\n location.xpath('vra:name', 'vra' => 'http://www.vraweb.org/vracore4.htm').map { |name|\n insert_solr_field_value(locationSet_array, \"location_name_tesim\", name.text)\n }\n end\n\n return locationSet_array\n end",
"title": ""
},
{
"docid": "0b34f579670c68923a86bd75b76db0a4",
"score": "0.6449145",
"text": "def get_locations\n data = parse_url\n locations = Array.new\n \n data[\"event\"].each do |item|\n location = Hash.new\n location[\"name\"] = \"#{item['name']}: #{item['start_date']} (#{item['start_time']}) - #{item['end_date']} (#{item['end_time']})\"\n location[\"lat\"] = item[\"latitude\"]\n location[\"long\"] = item[\"longitude\"]\n \n locations.push(location)\n end\n \n return locations\n end",
"title": ""
},
{
"docid": "eaa131f921352c592695bc47626fc03e",
"score": "0.64170575",
"text": "def to_a\n urls.map { |url| url.at('loc').content }\n end",
"title": ""
},
{
"docid": "d2ececb34df0e011e5ff9235db7a8c0e",
"score": "0.6410249",
"text": "def locations(options={})\n get('fullPageLoadLocations', options)\n end",
"title": ""
},
{
"docid": "56577c865169c5a1227066920f893d8e",
"score": "0.64087045",
"text": "def get_locations\n\t\tlist = []\n\t\t\n\t\tbegin\n\t\t\tlist = filter_list(CSV.read(\"#{@locations_home}/placesOfInterest.csv\"))\n\t\trescue\n\t\tend\t\n\n\t\t#puts \"Have a list of #{list.count} locations...\"\n\t\tlist\n\tend",
"title": ""
},
{
"docid": "2b28e54e814b0a90bfe1cb6d8daceb12",
"score": "0.6395697",
"text": "def get_report_locations()\n locations = Location.where(company_id: self.id)\n\n return locations\n end",
"title": ""
},
{
"docid": "2b28e54e814b0a90bfe1cb6d8daceb12",
"score": "0.6395697",
"text": "def get_report_locations()\n locations = Location.where(company_id: self.id)\n\n return locations\n end",
"title": ""
},
{
"docid": "aaca7a6d018aae8ee041e85bd299766d",
"score": "0.6389286",
"text": "def get_all_locations\n @locations = []\n Location.all.each do |x|\n @locations.append({:id=>x.id, :name=>x.name, :latitude=>x.latitude, :longitude=>x.longitude})\n end\n end",
"title": ""
},
{
"docid": "028f875b0d98e8f94792f1af40d3c6e8",
"score": "0.6386159",
"text": "def list_locations\n list_groups(list_organizational_units.select { |g| g.match?(/^OU=Location/) }.first)\n end",
"title": ""
},
{
"docid": "ed4a30a06c1964e3e1b5e2c4b730985c",
"score": "0.63681597",
"text": "def make_location_list\n @known_locations = []\n $game_wmw.maplocations.each do |loc|\n @known_locations.push(loc) if (loc.known || CN_WorldMapWarp::Config::DISPLAY_ALL)\n end\n end",
"title": ""
},
{
"docid": "59d4af4efe31bccd97cc480f9eeed598",
"score": "0.63420343",
"text": "def locations_data_for(record)\n records = ancestry_for(record).reverse\n\n records.each do |record|\n locations = fetch_locations_for(record)\n return locations unless locations.empty?\n end\n\n []\n end",
"title": ""
},
{
"docid": "88f7b46ff7d0d54e282dff2662f6adf6",
"score": "0.6337903",
"text": "def get_locations\n\t\t\n\t\tlist = []\n\t\t\n\t\tbegin\n\t\t\tlist = filter_list(CSV.read(\"#{@locations_home}/placesOfInterest.csv\"))\n\t\trescue\n\t\tend\t\n\n\t\tputs \"Have a list of #{list.count} locations...\"\n\t\tlist\n\tend",
"title": ""
},
{
"docid": "30cf3aaba2cf137b9aad8454273b78d0",
"score": "0.6327055",
"text": "def locations(opts = {})\n get 'locations', opts\n end",
"title": ""
},
{
"docid": "74d58720136ec726e4e28a97aee4ec30",
"score": "0.6321139",
"text": "def get_report_locations()\n locations = Location.where(company_id: self.id)\n\n return locations\n end",
"title": ""
},
{
"docid": "b63e1b4125150b2d954049321db23b35",
"score": "0.6307578",
"text": "def find_locations\n parent = Location.find_by_id params[:id]\n @locations = parent.nil? ? [] : parent.children.order(:name)\n end",
"title": ""
},
{
"docid": "56c93bd1e4462d56bc642344b5c3a28b",
"score": "0.6300866",
"text": "def list_locations\n url = url_with_api_version(configuration.api_version, base_url, 'locations')\n response = rest_get(url)\n Azure::Armrest::ArmrestCollection.create_from_response(response, Location)\n end",
"title": ""
},
{
"docid": "54a34071ac465ef0c86f66a6127e348e",
"score": "0.628731",
"text": "def get_locations(params = {})\n request_list('locations', params).map do |details|\n Ncdc::Results::Location.new(details)\n end\n end",
"title": ""
},
{
"docid": "e08af81ce8236aa7b68011a385aeefc8",
"score": "0.6259901",
"text": "def get_locations\n return @Backend.get_known_locations\n end",
"title": ""
},
{
"docid": "3a2130ca9802ab1ebfa3ce7347ba3152",
"score": "0.6250341",
"text": "def locations\n @locations ||= LocationsApi.new @global_configuration\n end",
"title": ""
},
{
"docid": "07124eb515a3ed01c155f6bb485af32b",
"score": "0.6237737",
"text": "def locations\n\t\t@locations = Location.where(include: true).order(\"location\")\n\t\trender \"index.json.jbuilder\", status: :ok\n\tend",
"title": ""
},
{
"docid": "c159e7085fbc517f20fb81f94fd8d4a7",
"score": "0.62311834",
"text": "def list_locations\n request = Azure::BaseManagement::ManagementHttpRequest.new(:get, '/locations')\n response = request.call\n Serialization.locations_from_xml(response)\n end",
"title": ""
},
{
"docid": "4f74bb2527a7ec6c5783a5c60e9852b7",
"score": "0.6225592",
"text": "def index\n @locations = Location.active.to_a\n end",
"title": ""
},
{
"docid": "ec99c4cd89d09e93d8383956833cd4e8",
"score": "0.6221277",
"text": "def get_report_locations()\n locations = Location.find(:all, :conditions => {:company_id => self.id})\n\n return locations\n end",
"title": ""
},
{
"docid": "3e75bacdc5005f93b78c6b1e8b74f85b",
"score": "0.61965",
"text": "def filming_locations\n get_nodes('#filming_locations .soda dt a', locations_document)\n end",
"title": ""
},
{
"docid": "6e70c38901257e2948abe81a53a63b18",
"score": "0.61937404",
"text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = []\n end",
"title": ""
},
{
"docid": "349cddedbd9a87a3b7d09526f05131e6",
"score": "0.6192899",
"text": "def locations\n case target.class.name\n when 'Location'\n [target]\n when 'Store'\n target.locations\n else\n target.respond_to?(:locations) ? target.locations : []\n end\n end",
"title": ""
},
{
"docid": "2fc9e973a473c75adb2621ad6cd8448a",
"score": "0.61764306",
"text": "def get_report_locations()\n locations = Location.where(company_id: self.id)\n \n return locations\n end",
"title": ""
},
{
"docid": "65c4af3bb82846180b78b394cd59cce8",
"score": "0.6169055",
"text": "def locations\n Rails.cache.fetch(\"area_locations_#{id}\") do\n Location.joins('INNER JOIN places ON places.location_id=locations.id')\n .where(places: { id: place_ids, is_location: true }).group('locations.id').to_a\n end\n end",
"title": ""
},
{
"docid": "4cd5b2b62554b940af752b7678d76598",
"score": "0.6159486",
"text": "def locations(limit = 5)\n Location.where(locatable_type: self.class.to_s, locatable_id: self.id, geocoded: false).order(\"id DESC\").limit(limit)\n end",
"title": ""
},
{
"docid": "b0e40cd0b202325877197c2e053b132d",
"score": "0.61512923",
"text": "def create_single_locations\n @ec = Location.new('Enumerable Canyon', 1, 1)\n @dtb = Location.new('Duck Type Beach', 2, 2)\n @mpc = Location.new('Monkey Patch City', 1, 1)\n @nt = Location.new('Nil Town', 0, 3)\n @m = Location.new('Matzburg', 3, 0)\n @hc = Location.new('Hash Crossing', 2, 2)\n @dp = Location.new('Dynamic Palisades', 2, 2)\nend",
"title": ""
},
{
"docid": "49c3718cdb9ecfa178dd80f254b2713f",
"score": "0.61419696",
"text": "def index\n @locations = Location.includes(:images, :type).all.page params[:page]\n end",
"title": ""
},
{
"docid": "4fe3112403681c3686244eda9abab403",
"score": "0.61415607",
"text": "def locations\n @locations ||= LocationsApi.new config\n end",
"title": ""
},
{
"docid": "a68611268b88951182c9e53ccb2c75a6",
"score": "0.6137678",
"text": "def locations()\n locations_array = [];\n\n self.classrooms.each do |classroom|\n locations_array << classroom.zone.name \n end\n\n locations_array\n end",
"title": ""
},
{
"docid": "4d2e204b2ed925e72813b3a9e64297c8",
"score": "0.6135617",
"text": "def index\n @locations = Location.find(:all)\n end",
"title": ""
},
{
"docid": "45fca98a1f6945993ea504c987c563bc",
"score": "0.61345065",
"text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n places = Location.where(:latitude => swlat..nelat, :longitude => swlng..nelng)\n @locations = []\n places.each do |loc|\n loc_hash = loc.to_hash\n loc_hash[:follows] = User.find(user_id).locations.include? loc\n @locations << loc_hash\n end\n @locations.sort_by! do |loc|\n loc[:latitude]\n end\n @locations = @locations[0..49]\n end",
"title": ""
},
{
"docid": "9427ab4c0455ef2d93e75d90650ac995",
"score": "0.61280966",
"text": "def city\n loc_link.map do |x|\n arr = webpage(x).xpath(\"//span[@class='item']//b//text()\")\n arr = webpage(x).xpath(\"//span[@class='item']//b//text()\") while arr.empty?\n arr\n end\n end",
"title": ""
},
{
"docid": "23f98f887af74a55c84dfbf11b9e7675",
"score": "0.61235356",
"text": "def objects\n self.location_objects.includes(:object).map do |location_object|\n location_object.object\n end\n end",
"title": ""
},
{
"docid": "5f8cc0370868e3f1399642160e8d63fb",
"score": "0.6108697",
"text": "def find_locations\n if params[:id] == '0'\n @parent = Location.new\n @first_depth = 1\n else\n @parent = Location.find_by_id params[:id]\n @first_depth = params[:empty_children].present? ? (@parent.depth + 2) : (@parent.depth + 1)\n end\n @locations = @parent.select_with_selected\n @location_types = LOCATION_TYPES\n end",
"title": ""
},
{
"docid": "48f7e20737bfe181499388584e2fc8e1",
"score": "0.61026037",
"text": "def list_favorite_locations\n list_favorite_things(:location)\n end",
"title": ""
},
{
"docid": "72575987d0c9414ec8c1ba3049550e52",
"score": "0.61003745",
"text": "def get_item_locations(obj_array)\n tab = [['ID', 'Collection Type', 'Location']]\n obj_array.each do |obj|\n tab.push([obj.id, obj.object_type.name, obj.location])\n end\n return tab\n end",
"title": ""
},
{
"docid": "bb84fe0db533868ba1b7f400b8cb1146",
"score": "0.6095433",
"text": "def find_nearby_locations(location)\n row, column = location\n nearby_locations = []\n r = -1\n until r == 2\n c = -1\n until c == 2\n nearby_locations << [row + r, column + c] unless r == 0 && c == 0\n c += 1\n end\n r += 1\n end\n nearby_locations\n end",
"title": ""
},
{
"docid": "eddd5c38ca4f56aecd3f6426e043978b",
"score": "0.609419",
"text": "def index\n @locations = @search_query.locations\n end",
"title": ""
},
{
"docid": "0519a5527f963cef2265bef943b0f6fc",
"score": "0.60894096",
"text": "def data\n locations.map do |location|\n edit_path = link_to(fa_icon('edit lg'), edit_location_path(location))\n delete_path = link_to(fa_icon('trash-o lg'), location, method: :delete, data: { confirm: I18n.t('locations.index.delete_confirm') })\n [\n location.name,\n location.latitude,\n location.longitude,\n \"#{edit_path} #{delete_path}\"\n ]\n end\n end",
"title": ""
},
{
"docid": "122c37041e13c6bdc95298e11167b495",
"score": "0.6079682",
"text": "def locations(type)\n rsp = error_wrap{JSON.parse(open(\"#{api_url}?method=ems.get.locations&type=#{type}&plain=true\").read)}['rsp']\n if rsp['stat'] == Spree::EmsShipping::Constants::RESPONSE_STATE_OK\n return rsp['locations']\n else\n return rsp['err']\n end\n end",
"title": ""
},
{
"docid": "979c2d0a2d1280f97aa77d90a45e0d31",
"score": "0.607078",
"text": "def get_known_locations\n rKnownLocations = {}\n\n return rKnownLocations\n end",
"title": ""
},
{
"docid": "e19bedfc348b968e2f2be2269bb29a03",
"score": "0.6060385",
"text": "def locations()\n auditions = Audition.where(role_id: self.id)\n to_return = auditions.map { |audition|\n return audition.location\n }\n\n return to_return\n end",
"title": ""
},
{
"docid": "e4283b833feb5b3bc430a32ecc5a6f77",
"score": "0.6058803",
"text": "def locations\n @location[@place] = @person\n @location\n end",
"title": ""
},
{
"docid": "928b9134bb6a45be40114b0b8c66d72e",
"score": "0.6025228",
"text": "def people_from_location(loc)\n @people.find { |person| person.location == loc }\n end",
"title": ""
},
{
"docid": "ba15e1ea5dcd1dc6b24167976002aa38",
"score": "0.6018557",
"text": "def locations\n Amadeus::Namespaces::ReferenceData::Locations.new(client)\n end",
"title": ""
},
{
"docid": "c7ad1fb262d83943c59183237d3bf670",
"score": "0.60161084",
"text": "def index\n @class_locations = ClassLocation.order(:name).page params[:page]\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6003098",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.60018915",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "51efce4b326cd824d91966143dae0b53",
"score": "0.60001963",
"text": "def all_for(id)\n raise Error::InvalidLocationError unless valid_params?(id)\n url = generate_url(\"/locations/#{id}/all\")\n Request.get(url)\n end",
"title": ""
},
{
"docid": "5a045e60ef8597f6e1a8e45e32e24111",
"score": "0.6000176",
"text": "def locations(options={})\n get(\"/locations/search\")\n end",
"title": ""
},
{
"docid": "4cee4ced7728b946997e0de8bc284857",
"score": "0.599323",
"text": "def get_all_locations\n @locations = []\n ActiveRecord::Base.connection.execute(\"SELECT * from Locations\").each do |singleLocation|\n @locations << HashWithIndifferentAccess.new(singleLocation)\n end\n nil\n end",
"title": ""
},
{
"docid": "b8d36d788d9a5e4b07a90d087122fedd",
"score": "0.59911203",
"text": "def list_locations\n GLOBAL_CONFIG[:data][:locations]\n end",
"title": ""
},
{
"docid": "b8d36d788d9a5e4b07a90d087122fedd",
"score": "0.59911203",
"text": "def list_locations\n GLOBAL_CONFIG[:data][:locations]\n end",
"title": ""
}
] |
77e87961495d4f567d4f5444affd2638 | Testing default commands, more testing is in test_uwchat_server_command. | [
{
"docid": "27ab5daaeb3ef47fc36940ab88755657",
"score": "0.66267926",
"text": "def test_client_quit_command\n # Replacing mocked command with the real commands\n @server.instance_variable_set( :@my_commands, @real_commands )\n \n user = @users.last\n # insure we have the user\n assert @server.clients[user]\n \n before = @server.clients.size\n @server.process_command( user, \"/quit\" )\n after = @server.clients.size\n \n assert_not_equal before, after\n assert_nil @server.clients[user]\n end",
"title": ""
}
] | [
{
"docid": "614e3b8b7184a5fa5c90fa4baa8dcdb9",
"score": "0.6913863",
"text": "def test_help\n \tassert_equal(UI.parseCommand('help', HelpCmd1*\" \"),UI.main(HelpCmd1))\n \tassert_equal(UI.parseCommand('help', HelpCmdInv*\" \"),UI.main(HelpCmdInv))\n end",
"title": ""
},
{
"docid": "48edc6980da38ba5441389a6cded7a96",
"score": "0.6630724",
"text": "def testCommandLineHelp\n executeSlave( [ '--help' ] )\n end",
"title": ""
},
{
"docid": "132707d3020674c3645009fb7af363c0",
"score": "0.6368599",
"text": "def test_status\n \tassert_equal(UI.parseCommand('status', StatusCmd1*\" \"),UI.main(StatusCmd1))\n \tassert_equal(UI.parseCommand('status', StatusCmdInv*\" \"),UI.main(StatusCmdInv))\n end",
"title": ""
},
{
"docid": "87e9aa95790dc994aff76a7e79260018",
"score": "0.6365155",
"text": "def test_run_without_commands\n output = StringIO.new\n cli = Heroics::CLI.new('cli', {}, output)\n cli.run('help')\n assert_equal('No commands are available.', output.string)\n end",
"title": ""
},
{
"docid": "98cc1c80faf85de6b512130adacf3b8f",
"score": "0.6350166",
"text": "def set_commands; end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.6317218",
"text": "def commands; end",
"title": ""
},
{
"docid": "4467ff64ffe3f0485a91639e0bcac1b4",
"score": "0.62741673",
"text": "def get_commands\n %w{ testchoose testnumberedmenu testdisplay_list testdisplay_text testdir saveas1 }\n end",
"title": ""
},
{
"docid": "8ac50f5167880081f1cd4bcb14f4a0ff",
"score": "0.626569",
"text": "def test2ActionsDifferentTools\n initTestCase do\n $Context[:SlaveActions] = [\n [ 'DummyTool', 'DummyAction', [] ],\n [ 'DummyTool2', 'DummyAction2', [] ]\n ]\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true\n ) do |iError|\n assert_equal( [\n [ 'sendMessage', [ 'DummyUser', {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n },\n 'DummyTool2' => {\n 'DummyAction2' => [\n []\n ]\n }\n } ]\n ]\n ],\n $Variables[:DummySenderCalls]\n )\n assert_equal([], getSlaveClientQueue)\n end\n end\n end",
"title": ""
},
{
"docid": "5c5d01b72793ac90b3e3b23532ba7769",
"score": "0.62273157",
"text": "def handle_commands(command) # rubocop:todo Metrics/CyclomaticComplexity\n case command\n when '/start'\n greet_user\n when '/stop'\n send_message \"Bye, #{message.from.first_name}\"\n when '/help'\n send_message \"Please enter any of the following commands: #{@commands}\"\n when '/news'\n handle_news\n when '/subscribe'\n handle_subscribe command\n when '/update'\n handle_update\n when '/add_birthday'\n @name = message.text if @name_set and @name.empty?\n prompt_user command\n when '/add_my_birthday'\n prompt_user command\n when '/add_anniversary'\n @name = message.text if @name_set and @name.empty?\n prompt_user command\n\n end\n end",
"title": ""
},
{
"docid": "da43e746f7e0121f11677f5020f1fb31",
"score": "0.6178498",
"text": "def test\n @commands_and_opts.push OPTIONAL_OPTS[:test]\n self\n end",
"title": ""
},
{
"docid": "1430a7bc203e759dfa1797ac52267981",
"score": "0.6145837",
"text": "def test(command)\n run(command, :test => true)\n end",
"title": ""
},
{
"docid": "629aa8273e373850b311b515ba4b246e",
"score": "0.6131856",
"text": "def test_command_should_default_to_default_command\n assert_equal \"git\", @source.command\n @source.local { assert_equal \"git\", @source.command }\n end",
"title": ""
},
{
"docid": "223033ad0f1275ffe7f17505d6a8279c",
"score": "0.60938317",
"text": "def testCommandLineHelpShort\n executeSlave( [ '-h' ] )\n end",
"title": ""
},
{
"docid": "9df7292b26fb318e87b1fbf58066d970",
"score": "0.60788774",
"text": "def testNominal\n executeProcess(['--comment', 'DummyComment']) do |iError, iSlaveActions|\n assert_equal(\n {\n Tools::All => {\n Actions::All_Ping => [\n [ 'DummyComment' ]\n ]\n }\n },\n iSlaveActions\n )\n end\n end",
"title": ""
},
{
"docid": "4ada46473fe93ade483e81d6cf7882d6",
"score": "0.60786486",
"text": "def test_init\n \tassert_equal(UI.parseCommand('init', InitCmd1*\" \"),UI.main(InitCmd1))\n \tassert_equal(UI.parseCommand('init', InitCmd2*\" \"),UI.main(InitCmd2))\n \tassert_equal(UI.parseCommand('init', InitCmdInv*\" \"),UI.main(InitCmdInv))\n end",
"title": ""
},
{
"docid": "3f1dc9996c612f93a126e6e373cc171d",
"score": "0.6067143",
"text": "def commands\n {\n \"sample\" => \"A sample command added by the sample plugin\",\n \"notifier_start\" => \"Start session watcher\",\n \"notifier_stop\" => \"Stop session watcher\",\n \"notifier_set_user\" => \"Set Dashboard user name\",\n \"notifier_set_pass\" => \"Set Dashboard password\",\n \"notifier_set_dashboard_url\" => \"Set Dashboard base URL\",\n \"notifier_show_config\" => \"Show notifier config\",\n \"notifier_dashboard_login\" => \"Log in to dashboard\",\n \"notifier_dashboard_permissions\" => \"Get dashbaord user permissions\"\n }\n end",
"title": ""
},
{
"docid": "bd8d25561d8d549fabb49a8acca197da",
"score": "0.60585517",
"text": "def test_push\n \tassert_equal(UI.parseCommand('push', PushCmd1*\" \"),UI.main(PushCmd1))\n \tassert_equal(UI.parseCommand('push', PushCmdInv*\" \"),UI.main(PushCmdInv))\n end",
"title": ""
},
{
"docid": "ea165d10ceed9988b3757a279b71b5ef",
"score": "0.6032201",
"text": "def command\n fail 'Not implemented.'\n end",
"title": ""
},
{
"docid": "07f1ea988b1b7edaf4deec9c83048908",
"score": "0.6031709",
"text": "def test2Actions\n initTestCase do\n $Context[:SlaveActions] = [\n [ 'DummyTool', 'DummyAction', [] ],\n [ 'DummyTool', 'DummyAction2', [] ]\n ]\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true\n ) do |iError|\n assert_equal( [\n [ 'sendMessage', [ 'DummyUser', {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ],\n 'DummyAction2' => [\n []\n ]\n }\n } ]\n ]\n ],\n $Variables[:DummySenderCalls]\n )\n assert_equal([], getSlaveClientQueue)\n end\n end\n end",
"title": ""
},
{
"docid": "69e25bd9be28fe231004a84726630aac",
"score": "0.60246646",
"text": "def test_run_default_directive\n with_fixture do\n out = capture_subprocess_io { system \"dotrun\" }\n assert_includes out.join, \"default result\"\n assert !out.join.include?(\"sample result\")\n end\n end",
"title": ""
},
{
"docid": "ca4d9c75cac178da864bb0a5d7fc0b2e",
"score": "0.60236776",
"text": "def common_tests\n @yail.start_listening\n\n # Wait until all data has been read and check messages\n wait_for_irc\n assert_equal 1, @msg[:welcome]\n assert_equal 1, @msg[:endofmotd]\n assert_equal 3, @msg[:notice]\n\n # Intense notice test - make sure all events were properly translated\n assert_equal ['fakeirc.org', nil, 'fakeirc.org'], @notices.collect {|n| n[:server]}\n assert_equal ['', '', ''], @notices.collect {|n| n[:nick]}\n assert_equal ['AUTH', 'AUTH', 'Bot'], @notices.collect {|n| n[:target]}\n assert_match %r|looking up your host|i, @notices.first[:text]\n assert_match %r|looking up your host|i, @notices[1][:text]\n assert_match %r|you are exempt|i, @notices.last[:text]\n\n # Test magic methods that set up the bot\n assert_equal \"Bot\", @yail.me, \"Should have set @yail.me automatically on welcome handler\"\n assert_equal 1, @msg[:o_mode], \"Should have auto-sent mode +i\"\n\n # Make sure nick change works\n @yail.nick \"Foo\"\n wait_for_irc\n assert_equal \"Foo\", @yail.me, \"Should have set @yail.me on explicit nick change\"\n\n # Join a channel where we've been banned\n @yail.join(\"#banned\")\n wait_for_irc\n assert_equal 1, @msg[:bannedfromchan]\n assert_equal \"#banned\", @out_join[:channel]\n assert_equal \"\", @out_join[:password]\n assert_equal [], @channels\n\n # Join some other channel\n @yail.join(\"#foosball\", \"pass\")\n wait_for_irc\n assert_equal \"#foosball\", @out_join[:channel]\n assert_equal \"pass\", @out_join[:password]\n assert_equal ['#foosball'], @channels\n\n # Mock some chatter to verify PRIVMSG info\n mock_message \":Nerdmaster!nerd@nerdbucket.com PRIVMSG #foosball :#{@yail.me}: Welcome!\" do\n assert_equal 1, @msg[:msg]\n assert_equal 0, @msg[:act]\n assert_equal 0, @msg[:ctcp]\n\n assert_equal \"Nerdmaster\", @privmsg[:nick]\n assert_equal \"#foosball\", @privmsg[:channel]\n assert_equal \"#{@yail.me}: Welcome!\", @privmsg[:text]\n end\n\n # CTCP\n mock_message \":Nerdmaster!nerd@nerdbucket.com PRIVMSG #foosball :\\001CTCP THING\\001\" do\n assert_equal 0, @msg[:msg]\n assert_equal 0, @msg[:act]\n assert_equal 1, @msg[:ctcp]\n\n assert_equal \"Nerdmaster\", @ctcp[:nick]\n assert_equal \"#foosball\", @ctcp[:channel]\n assert_equal \"CTCP THING\", @ctcp[:text]\n end\n\n # ACT\n mock_message \":Nerdmaster!nerd@nerdbucket.com PRIVMSG #foosball :\\001ACTION vomits on you\\001\" do\n assert_equal 0, @msg[:msg]\n assert_equal 1, @msg[:act]\n assert_equal 0, @msg[:ctcp]\n\n assert_equal \"Nerdmaster\", @act[:nick]\n assert_equal \"#foosball\", @act[:channel]\n assert_equal \"vomits on you\", @act[:text]\n end\n\n # PING\n mock_message \"PING boo\" do\n assert_equal 1, @msg[:ping]\n assert_equal 'boo', @ping_message\n end\n\n # User quits\n mock_message \":Nerdmaster!nerd@nerdbucket.com QUIT :Quit: Bye byes\" do\n assert_equal 1, @msg[:quit]\n assert_equal 'Nerdmaster!nerd@nerdbucket.com', @quit[:full]\n assert_equal 'Nerdmaster', @quit[:nick]\n assert_equal 'Quit: Bye byes', @quit[:text]\n end\n end",
"title": ""
},
{
"docid": "35d92b324c20df90e7d331a31be2045c",
"score": "0.6017137",
"text": "def get_commands\n %w{ testchoosedir testchoosefile testnumberedmenu testdisplay_list testdisplay_text testdir }\n end",
"title": ""
},
{
"docid": "bb05fe4dbae42499d194d1c3fe724bf1",
"score": "0.6007689",
"text": "def testToolsAll\n initTestCase do\n $Context[:SlaveActions] = [\n [ 'DummyTool', 'DummyAction', [] ]\n ]\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true\n ) do |iError|\n assert_equal( [\n [ 'sendMessage', [ 'DummyUser', {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n }\n } ]\n ]\n ],\n $Variables[:DummySenderCalls]\n )\n assert_equal([], getSlaveClientQueue)\n end\n end\n end",
"title": ""
},
{
"docid": "23edab5aab00b6ecfa24d5759b3b60f8",
"score": "0.6001218",
"text": "def testNoAction\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true\n ) do |iError|\n assert_equal(nil, $Variables[:DummySenderCalls])\n end\n end",
"title": ""
},
{
"docid": "74b2c7314d2ef1d86a7100e9984a7e45",
"score": "0.5996301",
"text": "def commands\n\t\t\t\t{\n\t\t\t\t\t'twitt_help'\t\t\t\t\t=> \"Displays help\",\n\t\t\t\t\t'twitt_start'\t\t\t\t\t=> \"Start Twitter Plugin after saving settings.\",\n\t\t\t\t\t'twitt_stop'\t\t\t\t\t=> \"Stop monitoring for new sessions.\",\n\t\t\t\t\t'twitt_test'\t\t\t\t\t=> \"Send test message to make sure confoguration is working.\",\n\t\t\t\t\t'twitt_save'\t\t\t\t\t=> \"Save Settings to YAML File #{Twitter_yaml}.\",\n\t\t\t\t\t'twitt_set_consumer_key'\t\t=> \"Sets Twitter Consumer Key.\",\n\t\t\t\t\t'twitt_set_consumer_secret'\t \t=> \"Sets Consumer Secret.\",\n\t\t\t\t\t'twitt_set_oauth_token'\t\t \t=> \"Sets Oauth Token.\",\n\t\t\t\t\t'twitt_set_oauth_token_secret' => \"Sets Oauth Token Secret\",\n\t\t\t\t\t'twitt_set_user'\t\t\t\t=> \"Sets User to whom messages will be sent.\",\n\t\t\t\t\t'twitt_set_source'\t\t\t \t=> \"Sets Source Name from where the messages are sent.\",\n\t\t\t\t\t'twitt_show_parms'\t\t\t \t=> \"Shows currently set parameters.\"\n\n\t\t\t\t}\n\t\t\tend",
"title": ""
},
{
"docid": "1470ce29688bc4a8e170eafd6bb3b6d8",
"score": "0.5980171",
"text": "def helpCommand \n @SocketHandle.puts \"Commands are:\"\n @SocketHandle.puts \" viewall\"\n @SocketHandle.puts \" bookevent\"\n end",
"title": ""
},
{
"docid": "2b09aaa96f06e873aab62ba32cf45e2a",
"score": "0.5974896",
"text": "def auxiliary_commands\n { \"aux_extra_command\" => \"Run this auxiliary test commmand\" }\n end",
"title": ""
},
{
"docid": "564555ddbdd0ca9fe5064ff9a9dcd9bb",
"score": "0.59609264",
"text": "def help\n send_command \"--help\"\n end",
"title": ""
},
{
"docid": "0aa2289d9b288723a033370496647c1d",
"score": "0.5898535",
"text": "def testToolsAllWithAll\n initTestCase do\n $Context[:SlaveActions] = [\n [ Tools::All, 'DummyAction', [] ]\n ]\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true\n ) do |iError|\n assert_equal( [\n [ 'sendMessage', [ 'DummyUser', {\n Tools::All => {\n 'DummyAction' => [\n []\n ]\n }\n } ]\n ]\n ],\n $Variables[:DummySenderCalls]\n )\n assert_equal([], getSlaveClientQueue)\n end\n end\n end",
"title": ""
},
{
"docid": "98655365085efd9b938ff0016706b56f",
"score": "0.58865577",
"text": "def commands\n abstract!\n end",
"title": ""
},
{
"docid": "e0f668536718fe84c2cc973adb16180b",
"score": "0.5886305",
"text": "def default_test\r\n end",
"title": ""
},
{
"docid": "7dbab3ab1cb50dd221d4db75829ee828",
"score": "0.58779943",
"text": "def verify_command(command)\n if [\"list\", \"l\"].include?(command)\n list_command()\n elsif [\"create\", \"c\"].include?(command)\n list_command() if create_command()\n elsif [\"delete\", \"d\"].include?(command)\n list_command() if delete_command()\n elsif [\"search\", \"s\"].include?(command)\n search_command()\n elsif [\"food\", \"f\"].include?(command)\n food_command()\n elsif [\"wash\", \"w\"].include?(command)\n wash_command()\n elsif [\"alive\", \"a\"].include?(command)\n alive_command()\n elsif [\"help\", \"h\"].include?(command)\n help()\n else\n help()\n end\n end",
"title": ""
},
{
"docid": "09618118b2d01b630088cd4795fe523f",
"score": "0.5876738",
"text": "def component_test_full_commands(cmp)\n component_build_vars(cmp)['TEST_FULL_CMDS']\nend",
"title": ""
},
{
"docid": "36b8754e343c372a3c18694d1bc469c3",
"score": "0.5871076",
"text": "def test_clone\n \tassert_equal(UI.parseCommand('clone', CloneCmd1*\" \"),UI.main(CloneCmd1))\n \tassert_equal(UI.parseCommand('clone', CloneCmd2*\" \"),UI.main(CloneCmd2))\n \tassert_equal(UI.parseCommand('clone', CloneCmdInv*\" \"),UI.main(CloneCmdInv))\n end",
"title": ""
},
{
"docid": "bf89b3e3508a6140805e477f6296f307",
"score": "0.58709246",
"text": "def commands\n raise NotImplementedError, \"`command' is not implemented by #{self.class.name}\"\n end",
"title": ""
},
{
"docid": "9f515d5df1aa266c9146a25b5619a606",
"score": "0.5864072",
"text": "def testRun2ActionsDifferentTools\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyAction',\n '--tool', 'DummyTool2',\n '--action', 'DummyAction2'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/AllDummyActionsAvailable'\n ) do |iError|\n assert_equal('DummyUser', $Variables[:DummyAction_User])\n assert_equal('DummyUser', $Variables[:DummyAction2_User])\n end\n end",
"title": ""
},
{
"docid": "ff6b3233641d3fc4019d06f8914d165d",
"score": "0.5860357",
"text": "def test_pull\n \tassert_equal(UI.parseCommand('pull', PullCmd1*\" \"),UI.main(PullCmd1))\n \tassert_equal(UI.parseCommand('pull', PullCmdInv*\" \"),UI.main(PullCmdInv))\n end",
"title": ""
},
{
"docid": "8888c6bfbe482cc2bc75eaddf97ff487",
"score": "0.5853532",
"text": "def test2ActionsDifferentParameters\n initTestCase do\n $Context[:SlaveActions] = [\n [ 'DummyTool', 'DummyAction', ['Param1'] ],\n [ 'DummyTool', 'DummyAction', ['Param2'] ]\n ]\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ],\n :Repository => 'Dummy/MasterServerInstalledWithDummySender',\n :AddRegressionProcesses => true,\n :AddRegressionSenders => true\n ) do |iError|\n assert_equal( [\n [ 'sendMessage', [ 'DummyUser', {\n 'DummyTool' => {\n 'DummyAction' => [\n ['Param1'],\n ['Param2']\n ]\n }\n } ]\n ]\n ],\n $Variables[:DummySenderCalls]\n )\n assert_equal([], getSlaveClientQueue)\n end\n end\n end",
"title": ""
},
{
"docid": "e867bb6e934604e416c35630b89bbb05",
"score": "0.5851171",
"text": "def test_self_execute\n assert_nothing_raised { Spoonerize::Cli.execute(fixtures['default_words']) }\n end",
"title": ""
},
{
"docid": "85d5ef8dfd3ace0c5dc03256624676cf",
"score": "0.5849204",
"text": "def commands\n {}\n end",
"title": ""
},
{
"docid": "2b12f915e0d4417e90af4b4c1dfd47dc",
"score": "0.58418757",
"text": "def command; end",
"title": ""
},
{
"docid": "2b12f915e0d4417e90af4b4c1dfd47dc",
"score": "0.58418757",
"text": "def command; end",
"title": ""
},
{
"docid": "2b12f915e0d4417e90af4b4c1dfd47dc",
"score": "0.58418757",
"text": "def command; end",
"title": ""
},
{
"docid": "2b12f915e0d4417e90af4b4c1dfd47dc",
"score": "0.58418757",
"text": "def command; end",
"title": ""
},
{
"docid": "2b12f915e0d4417e90af4b4c1dfd47dc",
"score": "0.58418757",
"text": "def command; end",
"title": ""
},
{
"docid": "2b12f915e0d4417e90af4b4c1dfd47dc",
"score": "0.58418757",
"text": "def command; end",
"title": ""
},
{
"docid": "3f7daa4db6f09615936ee3f3fd61c16f",
"score": "0.58342266",
"text": "def _server_control(command, body = nil)\n @connection.comm.server_message(\"#{command} #{body}\")\nend",
"title": ""
},
{
"docid": "3f00af9fd5ee466e144089985d3c33b4",
"score": "0.58299524",
"text": "def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end",
"title": ""
},
{
"docid": "5c8869505fa334fa50b3afa826944c81",
"score": "0.5825041",
"text": "def command_processor(user_input)\r\n case user_input.downcase\r\n when \"help\"\r\n list_available_commands\r\n when \"create\"\r\n ui_create_event\r\n when \"view-day\"\r\n ui_view_by_day\r\n when \"view-month\"\r\n ui_view_by_month\r\n when \"delete\"\r\n ui_delete_event\r\n when \"modify\"\r\n ui_modify_event\r\n else\r\n puts \"#{user_input} is not a command. type 'help' to see a list of commands\"\r\n end\r\nend",
"title": ""
},
{
"docid": "6d6eaaf91ea4dd93c242f507a0717dac",
"score": "0.58237994",
"text": "def main(testCommands)\n\t\tif testCommands\n\t\t\tcommand = testCommands\n\t\telse \n\t\t\tcommand = ARGV\n\t\tend \n\t\tresult = \"\"\n\t\tif !command.empty?\n\t\t\tcommand.each_with_index{|cmd,i|\n\t\t\t\tif cmd.split(' ').length>1\n\t\t\t\t\tcommand[i] = '\"' + cmd + '\"'\n\t\t\t\tend\n\t\t\t}\n\t\t\tcommand.each_with_index{|cmd,i| \n\t\t\t\tif i==0 && SupportedCmds.include?(cmd)\n\t\t\t\t\tresult = parseCommand(cmd,command*\" \")\n\t\t\t\t\tbreak\n\t\t\t\telse\n\t\t\t\t\tresult = \"Invalid command '\" + cmd + \"'.\\nCommands supported : \" + SupportedCmds.to_s\n\t\t\t \t#result = \"Invalid command '\" + cmd + \"'\"\n\t\t\t end\n\t\t\t}\n\t\t\tdisplayResult(result) #if !testCommands\n\t\tend\n\t\treturn result\n\tend",
"title": ""
},
{
"docid": "66f3c29ff00ebcaf90ef74befc90a603",
"score": "0.58211213",
"text": "def testCommandLineListShort\n executeSlave( [ '-l' ] )\n end",
"title": ""
},
{
"docid": "0c5b3b6563cb27a11be2814e6cdc95c9",
"score": "0.58183384",
"text": "def testRunActionWithoutTool\n executeSlave(\n [\n '--user', 'DummyUser',\n '--action', 'DummyAction'\n ],\n :AddRegressionActions => true,\n :Error => WEACE::Slave::Client::CommandLineError\n )\n end",
"title": ""
},
{
"docid": "4e2f0dcbf014d1ae6fd16f52eda8423f",
"score": "0.57947147",
"text": "def test_checkout\n \tassert_equal(UI.parseCommand('checkout', CheckoutCmd1*\" \"),UI.main(CheckoutCmd1))\n \tassert_equal(UI.parseCommand('checkout', CheckoutCmd2*\" \"),UI.main(CheckoutCmd2))\n \tassert_equal(UI.parseCommand('checkout', CheckoutCmd3*\" \"),UI.main(CheckoutCmd3))\n \tassert_equal(UI.parseCommand('checkout', CheckoutCmd4*\" \"),UI.main(CheckoutCmd4))\n \tassert_equal(UI.parseCommand('checkout', CheckoutCmdInv*\" \"),UI.main(CheckoutCmdInv))\n end",
"title": ""
},
{
"docid": "e6c0c6714a5cc9467f69e06b40393e0c",
"score": "0.5789805",
"text": "def subcommands(cmd); end",
"title": ""
},
{
"docid": "e6c0c6714a5cc9467f69e06b40393e0c",
"score": "0.5789805",
"text": "def subcommands(cmd); end",
"title": ""
},
{
"docid": "9a57380434d77342e570fbdc8a8151be",
"score": "0.57892895",
"text": "def testRunActionWithoutUser\n executeSlave(\n [\n '--tool', 'DummyTool',\n '--action', 'DummyAction'\n ],\n :AddRegressionActions => true,\n :Error => WEACE::Slave::Client::CommandLineError\n )\n end",
"title": ""
},
{
"docid": "aff0608b4f646f3eecd82ffa2b5996f8",
"score": "0.5782713",
"text": "def testRun2ActionsDifferentToolsDifferentProducts\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyAction',\n '--tool', 'DummyTool3',\n '--action', 'DummyAction3'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/AllDummyActionsAvailable'\n ) do |iError|\n assert_equal('DummyUser', $Variables[:DummyAction_User])\n assert_equal('DummyUser', $Variables[:DummyAction3_User])\n end\n end",
"title": ""
},
{
"docid": "9a6e372147cd54eb356fe65bdc31ae7e",
"score": "0.577645",
"text": "def standard_commands\n {\n 'C' => Commands::ClearImageBuffer,\n 'T' => Commands::Feed,\n 'XS' => Commands::Issue\n }\n end",
"title": ""
},
{
"docid": "7eb57f9d5f4e2f0abbb9dd8772203ce0",
"score": "0.5767626",
"text": "def test_diff\n \tassert_equal(UI.parseCommand('diff', DiffCmd1*\" \"),UI.main(DiffCmd1))\n \tassert_equal(UI.parseCommand('diff', DiffCmdInv*\" \"),UI.main(DiffCmdInv))\n end",
"title": ""
},
{
"docid": "beb3f7515682bc1b77beb9f1dd6245d6",
"score": "0.57671666",
"text": "def test_run_with_help_command_and_explicit_command_name\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n client = Heroics::client_from_schema(schema, 'https://example.com')\n output = StringIO.new\n command1 = Heroics::Command.new(\n 'cli', schema.resource('resource').link('list'), client, output)\n command2 = Heroics::Command.new(\n 'cli', schema.resource('resource').link('info'), client, output)\n cli = Heroics::CLI.new('cli', {'resource:list' => command1,\n 'resource:info' => command2}, output)\n cli.run('help', 'resource:info')\n expected = <<-USAGE\nUsage: cli resource:info <uuid_field>\n\nDescription:\n Show a sample resource\nUSAGE\n assert_equal(expected, output.string)\n end",
"title": ""
},
{
"docid": "cb6d930256eba7472592a293365bb6f6",
"score": "0.5764565",
"text": "def test_branch\n \tassert_equal(UI.parseCommand('branch', BranchCmd1*\" \"),UI.main(BranchCmd1))\n \tassert_equal(UI.parseCommand('branch', BranchCmd2*\" \"),UI.main(BranchCmd2))\n \tassert_equal(UI.parseCommand('branch', BranchCmdInv*\" \"),UI.main(BranchCmdInv))\n end",
"title": ""
},
{
"docid": "81fedb1610c561368f44a6752b21bdae",
"score": "0.57597697",
"text": "def add_main_commands\n tm = TactBattleManager\n add_command(tm::VocabTB::Status, :status, true)\n add_command(tm::VocabTB::Attack, :attack, can_attack?)\n add_command(tm::VocabTB::Skill, :skill, skill_ok_tb?)\n add_command(tm::VocabTB::Move, :move, unit_movable?)\n add_command(tm::VocabTB::Item, :item, item_ok_tb?)\n add_command(tm::VocabTB::Equip, :equip, equip_ok?)\n add_command(tm::VocabTB::Trade, :trade, true)\n add_command(tm::VocabTB::Turn, :turn, true)\n add_command(\"Wait\", :wait, true)\n end",
"title": ""
},
{
"docid": "cdb3d993c98d5ce1721dc8baff2ebf4d",
"score": "0.5755455",
"text": "def test_run_with_help_command\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n client = Heroics::client_from_schema(schema, 'https://example.com')\n output = StringIO.new\n command1 = Heroics::Command.new(\n 'cli', schema.resource('resource').link('list'), client, output)\n command2 = Heroics::Command.new(\n 'cli', schema.resource('resource').link('info'), client, output)\n cli = Heroics::CLI.new('cli', {'resource:list' => command1,\n 'resource:info' => command2}, output)\n cli.run('help')\n expected = <<-USAGE\nUsage: cli <command> [<parameter> [...]] [<body>]\n\nHelp topics, type \"cli help <topic>\" for more details:\n\n resource:info Show a sample resource\n resource:list Show all sample resources\nUSAGE\n assert_equal(expected, output.string)\n end",
"title": ""
},
{
"docid": "846b856574910311def5bf7c0d701252",
"score": "0.57529855",
"text": "def commands\n\t\t{ }\n\tend",
"title": ""
},
{
"docid": "18075cfba8a226ac3d6a42d0d59d711e",
"score": "0.5735699",
"text": "def test_echo\n cmd=nil\n assert(cmd=ShellCommand.new(:cmd=>\"echo hello\"))\n assert_instance_of(ShellCommand,cmd)\n assert(!cmd.run?)\n assert(!cmd.success?)\n assert(cmd.run)\n assert(cmd.run?)\n assert(cmd.success?)\n assert_equal(\"hello\",cmd.output.chomp)\n assert_equal(\"\",cmd.error)\n assert_equal(:success,cmd.status)\n end",
"title": ""
},
{
"docid": "dde237735c034c904c0e67cf444d3e04",
"score": "0.5727722",
"text": "def commands\n {\n }\n end",
"title": ""
},
{
"docid": "c9d977f459e03aae14aef2df830cc69d",
"score": "0.57224864",
"text": "def testCommandLineList\n executeSlave( [ '--list' ] )\n end",
"title": ""
},
{
"docid": "a43ae0c2783ec1390c7eea5bbaed76e4",
"score": "0.5715142",
"text": "def commands(arguments, options)\n colors = $stdout.tty?\n\n description = <<-END_OF_DESCRIPTION.gsub(/^ {8}/, '') # |<- 80 cols ends here\n \\e[1mCOMMANDS\\e[0m\n\n The following commands are available in baretest:\n\n \\e[1mcommands\\e[0m\n List the available commands.\n\n \\e[1menv\\e[0m\n Show the baretest environment. This contains all data that influences\n baretests behaviour. That is: ruby version, ruby engine, determined\n test directory, stored data about this suite etc.\n\n \\e[1mformats\\e[0m\n Shows all formats available in \\e[34mrun\\e[0m's -f/--format option.\n\n \\e[1mhelp\\e[0m\n Provides help for all commands. Describes options, arguments and env\n variables each command accepts.\n\n \\e[1minit\\e[0m\n Create a basic skeleton of directories and files to contain baretests test-\n suite. Non-destructive (existing files won't be overriden or deleted).\n\n \\e[1mreset\\e[0m (default command)\n Delete persistent data collected from previous runs.\n\n \\e[1mrun\\e[0m (default command)\n Run the tests and display information about them.\n\n \\e[1mselectors\\e[0m\n Detailed information about the selectors available to \\e[34mrun\\e[0m's\n arguments.\n\n \\e[1mversion\\e[0m\n Show the baretest executable and library versions.\n\n END_OF_DESCRIPTION\n #'# |<- 80 cols ends here\n description.gsub!(/\\e.*?m/, '') unless colors\n\n puts description\n end",
"title": ""
},
{
"docid": "6519478f8406c0b1bde94b21dfe3b39a",
"score": "0.57134354",
"text": "def test_add\n \tassert_equal(UI.parseCommand('add', AddCmd1*\" \"),UI.main(AddCmd1))\n \tassert_equal(UI.parseCommand('add', AddCmd2*\" \"),UI.main(AddCmd2))\n \tassert_equal(UI.parseCommand('add', AddCmd3*\" \"),UI.main(AddCmd3))\n \tassert_equal(UI.parseCommand('add', AddCmdInv*\" \"),UI.main(AddCmdInv))\n end",
"title": ""
},
{
"docid": "bda4a1724c7e5e8d11a2ab2450669646",
"score": "0.57091296",
"text": "def test2ActionsDifferentTools\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n },\n 'DummyTool2' => {\n 'DummyAction2' => [\n []\n ]\n }\n }\n )\n end",
"title": ""
},
{
"docid": "000117fd17c3a26f32a6cb033147871e",
"score": "0.5703739",
"text": "def set_commands\n super\n @commands['clear'] = ConsoleCommand_Clear.new(self)\n @commands['confirm'] = ConsoleCommand_Confirm.new(self)\n end",
"title": ""
},
{
"docid": "48d06f45ed880d6aec13e08c9becb042",
"score": "0.5694759",
"text": "def test_get_command_with_context\n command = RHCP::Command.new(\"test\", \"a test command that is enabled for hosts only\", lambda {})\n command.enabled_through_context_keys = ['host']\n @broker.register_command command\n command2 = RHCP::Command.new(\"test2\", \"a test command should always be enabled\", lambda {})\n @broker.register_command command2\n\n assert @test_broker.get_command(\"test2\")\n assert_raise(RHCP::RhcpException) {\n @test_broker.get_command(\"test\")\n }\n context = RHCP::Context.new()\n context.cookies['host'] = 'deepthought'\n assert @test_broker.get_command(\"test\", context)\n end",
"title": ""
},
{
"docid": "1630b8218c41f859a281c2cd83c785cf",
"score": "0.56944984",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "3c56049dd66f1032f1691f17f56e4323",
"score": "0.5691019",
"text": "def default_test; end",
"title": ""
},
{
"docid": "73b350533c411dd7532a388fed1c1dab",
"score": "0.5682917",
"text": "def test_default_message\n @service.run\n\n assert_equal 'Hello, World!', @env.find('/message').value\n end",
"title": ""
},
{
"docid": "59a568ccb500a53c41cec4f681c17b95",
"score": "0.56795037",
"text": "def test_run_without_arguments\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n client = Heroics::client_from_schema(schema, 'https://example.com')\n output = StringIO.new\n command1 = Heroics::Command.new(\n 'cli', schema.resource('resource').link('list'), client, output)\n command2 = Heroics::Command.new(\n 'cli', schema.resource('resource').link('info'), client, output)\n cli = Heroics::CLI.new('cli', {'resource:list' => command1,\n 'resource:info' => command2}, output)\n cli.run\n expected = <<-USAGE\nUsage: cli <command> [<parameter> [...]] [<body>]\n\nHelp topics, type \"cli help <topic>\" for more details:\n\n resource:info Show a sample resource\n resource:list Show all sample resources\nUSAGE\n assert_equal(expected, output.string)\n end",
"title": ""
},
{
"docid": "86e74c02d9d401dd138244c7e9e23a51",
"score": "0.56791204",
"text": "def test_run_specific_directive\n with_fixture do\n out = capture_subprocess_io { system \"dotrun sample\" }\n assert !out.join.include?(\"default result\")\n assert_includes out.join, \"sample result\"\n end\n end",
"title": ""
},
{
"docid": "7d848bf7188121adf4611c55e483fe40",
"score": "0.5677442",
"text": "def test_001_cmd_help\n# puts __method__\n out = cmd_help(nil, true)\n assert out.is_a?(String), \"Expected a string returned\"\n lines = out.split(\"\\n\").length \n assert lines > 15, \"Expecting lengthy help message\"\n end",
"title": ""
},
{
"docid": "08f79939254988525e98d6412b8cdcd0",
"score": "0.56676733",
"text": "def create_test_command\n command :test do\n syntax = 'test [options] <file>'\n description = 'test description'\n example 'description', 'command'\n example 'description 2', 'command 2'\n option '-v', '--verbose', 'verbose description'\n when_called do |args, _options|\n format('test %s', args.join)\n end\n end\n @command = command :test\n\n\tcommand :nested do\n\t\tcommand :test do\n\t\tend\t\n\tend\n\t@nested_command = command :nested\nend",
"title": ""
},
{
"docid": "b8ab9179210057242404374fa57a6fc3",
"score": "0.5660532",
"text": "def cmd; end",
"title": ""
},
{
"docid": "5fc4688124f1f23f3c550b4b4d544bf3",
"score": "0.5658755",
"text": "def add_commands\n end",
"title": ""
},
{
"docid": "d0b64d26c9fe9cc412bdfb0b3afd48eb",
"score": "0.56584096",
"text": "def help\n puts \"_____________________________________\",\n \"Available commands:\",\n \" m <message> - chat with all players\",\n # \" m /t <player_name> <message> - chat with specified player\" #currently not supported\n \" u list - print all users in game with their states (busy or not)\",\n \" u game <username> - ask for game session with user <username>\",\n \"In game mode:\", #i'll write them later\n \" my hand - gets cards list (in hand)\",\n \" show board - shows my board and opponent's board\",\n \" move <card number> - puts card to board\"\n \"------------------------------------\"\n end",
"title": ""
},
{
"docid": "4ddc474accbd059782f501b141342e72",
"score": "0.56506944",
"text": "def test_merge\n \tassert_equal(UI.parseCommand('merge', MergeCmd1*\" \"),UI.main(MergeCmd1))\n \tassert_equal(UI.parseCommand('merge', MergeCmdInv*\" \"),UI.main(MergeCmdInv))\n end",
"title": ""
},
{
"docid": "45c7bac950ebb553e47fe97772c22279",
"score": "0.56437147",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "45c7bac950ebb553e47fe97772c22279",
"score": "0.56437147",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "368288685744c215675ef86b02f4c1b2",
"score": "0.563799",
"text": "def test_create_standalone_message_about_nothing\r\n reply_to = nil\r\n about = nil\r\n send_message(@andy, @kevin, reply_to, about)\r\n end",
"title": ""
},
{
"docid": "4fa71211b38c9a68be3f4dfd6d8eb691",
"score": "0.56329936",
"text": "def test_change_user_nil\n assert_equal(TEST_CMD, Execute.change_user(TEST_CMD, nil), \"should not modify command if user is nil\")\n end",
"title": ""
},
{
"docid": "9c6ac1206c1b7f8d094e5546bf297722",
"score": "0.56299174",
"text": "def help\n @t.say(\"The available commands are: BUY, SELL, RECENT, BALANCE\")\nend",
"title": ""
},
{
"docid": "e3b3a447e81e7e89f29712472274f087",
"score": "0.5626073",
"text": "def default_command(name)\n abstract!\n end",
"title": ""
},
{
"docid": "81a94703b5a2b2a69ebf189c1696b1ce",
"score": "0.5623563",
"text": "def initialize\n register_script \"Provide on-protocol help for bot scripts and commands.\"\n\n register_command \"help\", :cmd_help, 0, 0, nil, \"Show help for the given command or a list of all commands. Parameters: [command]\"\n register_command \"script\", :cmd_script, 0, 0, nil, \"Show a description of the given script or a list of all scripts. Parameters: [script]\"\nend",
"title": ""
},
{
"docid": "cfe836edca26cf2345a9a9271fcddafd",
"score": "0.5620383",
"text": "def process_simple_command(command, board)\n\n case command\n when \"help\"\n puts command_list\n return true\n when \"display\"\n board.display\n return true\n when \"exit\"\n abort\n end\n\n false\nend",
"title": ""
},
{
"docid": "dad3257a330df640d497a39fe5ddaad6",
"score": "0.5620045",
"text": "def commands\n\t\t{\n\t\t\t\"idletime\" => \"Returns the number of seconds the remote user has been idle\",\n\t\t\t\"uictl\" => \"Control some of the user interface components\",\n\t\t\t\"enumdesktops\" => \"List all accessible desktops and window stations\",\n\t\t\t\"setdesktop\" => \"Move to a different workstation and desktop\",\n\t\t\t\"keyscan_start\" => \"Start capturing keystrokes\",\n\t\t\t\"keyscan_stop\" => \"Stop capturing keystrokes\",\n\t\t\t\"keyscan_dump\" => \"Dump they keystroke buffer\",\n\t\t\t\n\t\t\t# no longer needed with setdesktop\n\t\t\t# \"grabinputdesktop\" => \"Take over the active input desktop\",\n\t\t\t\n\t\t\t# not working yet\n\t\t\t# \"unlockdesktop\" => \"Unlock or lock the workstation (must be inside winlogon.exe)\",\n\t\t}\n\tend",
"title": ""
},
{
"docid": "d4d4297ad493ba3c35ad67a1f0e9011a",
"score": "0.56198186",
"text": "def subcommands!() __subcommands__! end",
"title": ""
},
{
"docid": "ea72546e84e885b0d574e6937138bfec",
"score": "0.5619447",
"text": "def command_name; end",
"title": ""
},
{
"docid": "f20986969a1c74f37fb8ce6b94c4c9eb",
"score": "0.5615237",
"text": "def subcommands() __subcommands__ end",
"title": ""
},
{
"docid": "5b11af9fd0a7e789c1b8d6113fe8b09d",
"score": "0.56130797",
"text": "def test_invalid_command_name\n command_name = 'invalid_command_name'\n socket.puts \"#{command_name} #{key} #{flags} #{exptime} #{value.length}#{Memcached::CMD_ENDING}\"\n assert_equal Memcached::INVALID_COMMAND_NAME_MSG, read_reply\n\n assert_get key, Memcached::END_MSG\n end",
"title": ""
},
{
"docid": "c86a3ff09fba79757cd7a91bc705fc47",
"score": "0.5606348",
"text": "def command(type)\n end",
"title": ""
},
{
"docid": "729828968915392c65cebf64e86e28a2",
"score": "0.5597418",
"text": "def test_options\n c = cli\n assert_equal(fixtures['default_words'], c.options)\n end",
"title": ""
},
{
"docid": "0229c0423d539b34c745cbf7737f7139",
"score": "0.5591981",
"text": "def ok(command)\n end",
"title": ""
},
{
"docid": "569ec5d7d2173343b569183352d740d8",
"score": "0.55871624",
"text": "def we_have_a_command_with_two_subcommands(options = {})\n lambda {\n @run_results = { :add => nil, :rename => nil, :base => nil }\n @app.command :remote do |c|\n\n c.switch :f\n\n c.desc \"add a remote\"\n c.command [:add,:new] do |add|\n\n Array(options[:flags]).each { |_| add.flag _ }\n Array(options[:switches]).each { |_| add.switch _ }\n add.action do |global_options,command_options,args|\n @run_results[:add] = [global_options,command_options,args]\n end\n end\n\n c.desc \"rename a remote\"\n c.command :rename do |rename|\n rename.action do |global_options,command_options,args|\n @run_results[:rename] = [global_options,command_options,args]\n end\n end\n\n c.action do |global_options,command_options,args|\n @run_results[:base] = [global_options,command_options,args]\n end\n end\n ENV['GLI_DEBUG'] = 'true'\n }\n end",
"title": ""
}
] |
6d2bd45f1bb1af688f65fe3fbc2543db | Returns all the attributes | [
{
"docid": "d5bb748b6040b6305d74cb67a586b9d4",
"score": "0.7903287",
"text": "def attributes\n @attributes ||= @raw_attributes.map { |x| Attribute.new(*x.to_a.first) }\n end",
"title": ""
}
] | [
{
"docid": "d62040f3c6111fd20affdf46a5fa74af",
"score": "0.866049",
"text": "def all_attributes\n @attributes\n end",
"title": ""
},
{
"docid": "d62040f3c6111fd20affdf46a5fa74af",
"score": "0.866049",
"text": "def all_attributes\n @attributes\n end",
"title": ""
},
{
"docid": "d62040f3c6111fd20affdf46a5fa74af",
"score": "0.866049",
"text": "def all_attributes\n @attributes\n end",
"title": ""
},
{
"docid": "716d4aa1f15a5ca85249d4bc26bd5a14",
"score": "0.8338543",
"text": "def getAttrs\n @attrs\n end",
"title": ""
},
{
"docid": "d909639467a31b6c2617f5bb7b9c741b",
"score": "0.8271058",
"text": "def all_defined_attributes\n attribute_config.all_attributes\n end",
"title": ""
},
{
"docid": "90b2703ce9ccb96f3826f6494b8a6922",
"score": "0.82673347",
"text": "def attributes()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "90b2703ce9ccb96f3826f6494b8a6922",
"score": "0.82673347",
"text": "def attributes()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "01924cf5a041a173227ec26cc6ae0578",
"score": "0.82659227",
"text": "def get_attributes()\n\t\treturn self.get(\"attribute\",\"\")\n\tend",
"title": ""
},
{
"docid": "ae23789794d0230c044e2dc67cc7b415",
"score": "0.8228499",
"text": "def attributes\n @attributes ||= get.data.symbolize_keys\n end",
"title": ""
},
{
"docid": "33edd9ad1700ff59004c8d7cd1c581b2",
"score": "0.82132983",
"text": "def list_attributes \n attributes = Attribute.all \n attributes.map {|attr| attr[:attr_name]}\n end",
"title": ""
},
{
"docid": "c28f1b3361851a97990959f7dedba93d",
"score": "0.82023436",
"text": "def attributes\n # TODO\n end",
"title": ""
},
{
"docid": "79690a0ff3a12aab2dc841047df869a7",
"score": "0.81897455",
"text": "def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end",
"title": ""
},
{
"docid": "79690a0ff3a12aab2dc841047df869a7",
"score": "0.81897455",
"text": "def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end",
"title": ""
},
{
"docid": "eae7033bad5125e685323bbf24fb7c17",
"score": "0.8180868",
"text": "def attributes\n ATTRIBUTE_NAMES\n end",
"title": ""
},
{
"docid": "eae7033bad5125e685323bbf24fb7c17",
"score": "0.8180868",
"text": "def attributes\n ATTRIBUTE_NAMES\n end",
"title": ""
},
{
"docid": "eae7033bad5125e685323bbf24fb7c17",
"score": "0.8180868",
"text": "def attributes\n ATTRIBUTE_NAMES\n end",
"title": ""
},
{
"docid": "d408b49e7c505508a5099b87e4bb8087",
"score": "0.81760263",
"text": "def get_all_attributes\n result = {}\n current_pointer = self[:attributes]\n while !current_pointer.read_pointer.null?\n attr_name = current_pointer.read_pointer.read_string_to_null\n current_pointer += FFI::Pointer.size\n attr_value = current_pointer.read_pointer.read_string_to_null\n current_pointer += FFI::Pointer.size\n result[attr_name] = attr_value\n end\n result\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.81730396",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.81730396",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.81730396",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.81730396",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "8cedc652f7baa4a95e7941fa7f686395",
"score": "0.81730396",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "3367afb6ade10f5ec895f427f256a0d1",
"score": "0.81727743",
"text": "def attrs()\n @attrs\n end",
"title": ""
},
{
"docid": "c5a183806ee1b3d113f693b0420646df",
"score": "0.8171112",
"text": "def attributes\n map(&:attribute)\n end",
"title": ""
},
{
"docid": "0cc04ab2bdaf1a481eb5662da43cde04",
"score": "0.8165575",
"text": "def attributes\n return @attributes\n end",
"title": ""
},
{
"docid": "ec7568532ad2fc8710aba7753ea41879",
"score": "0.8126679",
"text": "def atts\n\t\t\t@attributes\n\t\tend",
"title": ""
},
{
"docid": "487007a1de5000c24f80c7ca28a9421e",
"score": "0.81161976",
"text": "def attributes\n self.attribute_names.inject({}) do |attrs, name|\n attrs[name] = read_attribute(name)\n attrs\n end\n end",
"title": ""
},
{
"docid": "169c68613cace87427e31191605774af",
"score": "0.8110874",
"text": "def attributes; @attrs; end",
"title": ""
},
{
"docid": "26dea6a64e3d859265792321d04a6bb2",
"score": "0.8078398",
"text": "def attributes\n @attributes ||= []\n end",
"title": ""
},
{
"docid": "5bf8eb3b0fe6ff455b0be044bdcff171",
"score": "0.8067182",
"text": "def attributes\n @attributes ||= find_attributes\n end",
"title": ""
},
{
"docid": "2a20108ac43b423e5b4ebc4e36c75489",
"score": "0.8050101",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "2a20108ac43b423e5b4ebc4e36c75489",
"score": "0.8050101",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "f1fe23c6e9fe16b4dc1bc9f7c2a3c396",
"score": "0.800321",
"text": "def attributes\n unless @attributes_loaded\n load_attributes\n end\n @attributes\n end",
"title": ""
},
{
"docid": "a9a1d71b33f4a3d3fd4f8790a1a05103",
"score": "0.8000192",
"text": "def attributes\n self.class::ATTRIBUTES_NAMES.inject({}) do |attribs, attrib_name|\n value = self.send(attrib_name)\n attribs[attrib_name] = value unless value.nil?\n attribs\n end\n end",
"title": ""
},
{
"docid": "d14f6bfb4045fb86b44b35f254c02e4b",
"score": "0.79920745",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "d14f6bfb4045fb86b44b35f254c02e4b",
"score": "0.79920745",
"text": "def attributes\n @attributes\n end",
"title": ""
},
{
"docid": "768d3d707d52eab8a26386dfac41ed90",
"score": "0.7991876",
"text": "def attrs\n @attrs\n end",
"title": ""
},
{
"docid": "532160521e94174b3487971aed103a0d",
"score": "0.798828",
"text": "def attributes\n @attributes || []\n end",
"title": ""
},
{
"docid": "912a53da9e0b11c55b4fda95beebe9c7",
"score": "0.79776365",
"text": "def attributes\n @_attributes\n end",
"title": ""
},
{
"docid": "929e6acd83bd2badff3e47a1660cd7d8",
"score": "0.7977171",
"text": "def attrs\n @attrs\n end",
"title": ""
},
{
"docid": "929e6acd83bd2badff3e47a1660cd7d8",
"score": "0.7977171",
"text": "def attrs\n @attrs\n end",
"title": ""
},
{
"docid": "929e6acd83bd2badff3e47a1660cd7d8",
"score": "0.7977171",
"text": "def attrs\n @attrs\n end",
"title": ""
},
{
"docid": "adc654939e8159d10e5b5a8cd8d8fb3d",
"score": "0.79762524",
"text": "def attributes ; @attributes end",
"title": ""
},
{
"docid": "f527d412a5e054b9750137f5f0282c73",
"score": "0.79699016",
"text": "def attributes\n @attributes ||= self.class.attributes.inject({}) do |attrs, name|\n next attrs if name == :'attributes'\n attrs[name.to_sym] = send(name)\n attrs\n end\n end",
"title": ""
},
{
"docid": "5c13e7f4a743027a863abf7d08b4de89",
"score": "0.79650676",
"text": "def attributes\n @hash['attributes']\n end",
"title": ""
},
{
"docid": "826c08ab4be137d8c693bfcc9e781664",
"score": "0.79553336",
"text": "def attributes\n data[:attributes]\n end",
"title": ""
},
{
"docid": "826c08ab4be137d8c693bfcc9e781664",
"score": "0.79553336",
"text": "def attributes\n data[:attributes]\n end",
"title": ""
},
{
"docid": "826c08ab4be137d8c693bfcc9e781664",
"score": "0.79553336",
"text": "def attributes\n data[:attributes]\n end",
"title": ""
},
{
"docid": "298215eb0499ad80a8997348da648764",
"score": "0.7952887",
"text": "def _attributes\n @attributes\n end",
"title": ""
},
{
"docid": "9b59d4514b75284cfc8d6320d462ce72",
"score": "0.79471153",
"text": "def attributes\n @attributes ||= {}\n\n @attributes\n end",
"title": ""
},
{
"docid": "050a6ced68ab29d4937de9cf5178bea0",
"score": "0.7910602",
"text": "def attributes\r\n @attributes ||= attributes!\r\n end",
"title": ""
},
{
"docid": "d7a9b9c1478619076c17a1b1d5bd70d7",
"score": "0.7910262",
"text": "def attributes\r\n @@attributes\r\n end",
"title": ""
},
{
"docid": "671c0fd3ce2944d9545d56378f572254",
"score": "0.7909859",
"text": "def attributes\n @attributes.keys.each_with_object({}) do |k, hsh|\n hsh[k] = read_attribute(k)\n end\n end",
"title": ""
},
{
"docid": "7ca1b2b39b6f993238a8dd5954a15815",
"score": "0.79041827",
"text": "def attributes\n []\n end",
"title": ""
},
{
"docid": "3a9eaaeddb82f93efa1286b97be7aab7",
"score": "0.7902529",
"text": "def attributes\n @attributes.inject({}) {|rv, name| rv[name.to_s] = send(name); rv}\n end",
"title": ""
},
{
"docid": "eaad82d36ebd8bdd6fe4309999dc91fd",
"score": "0.7882763",
"text": "def list_attributes\n if @attributes.empty?\n fetch_configuration()\n end\n return @attributes.keys\n end",
"title": ""
},
{
"docid": "c2afd1b2df0252d7c83f2b810d1626d6",
"score": "0.78798497",
"text": "def attrs\n @attrs.keys\n end",
"title": ""
},
{
"docid": "97c63591a810ddf27e03869aa68e488c",
"score": "0.7851227",
"text": "def attributes\n unless(@attributes)\n @attributes = Hash.new\n attribute_list.each do |att|\n @attributes[att] = attribute_read(att)\n end\n end\n @attributes\n end",
"title": ""
},
{
"docid": "c538969e377ba82166c97e51c5c24f1c",
"score": "0.7826324",
"text": "def attributes\n if @attributes.empty?\n fetch_configuration()\n end\n return @attributes\n end",
"title": ""
},
{
"docid": "2acb0924bcf6af7ba3eac5776ff57e89",
"score": "0.78256536",
"text": "def attributes\n data.attributes\n end",
"title": ""
},
{
"docid": "e54e9cd6d0ff0445b6fa42593faab8b9",
"score": "0.78183043",
"text": "def attributes\n attributes = {}\n self.class.attributes.each do |attr|\n attributes[attr] = send(attr)\n end\n attributes\n end",
"title": ""
},
{
"docid": "4a74c5cef2fac99dbf553f61dca46211",
"score": "0.7814577",
"text": "def attributes\n self.class.attributes.each_with_object({}) do |(attr, *), attributes|\n attributes[attr] = self[attr]\n end\n end",
"title": ""
},
{
"docid": "0a39edc419d4103fd069be60955fd8a0",
"score": "0.78125745",
"text": "def allattrs\n raise NotImplementedError, \"allattrs() - return all attribute names in order - probably not used master side\"\n # key_attributes | (parameters & [:provider]) | properties.collect { |property| property.name } | parameters | metaparams\n end",
"title": ""
},
{
"docid": "047ed79335b05f65828ed9cc6bed0ab6",
"score": "0.78075063",
"text": "def read_attributes\n @_attributes\n end",
"title": ""
},
{
"docid": "48296f80d2cd1f63fe457f8a677e415b",
"score": "0.78073597",
"text": "def attributes\n attrs = self.attribute_names.inject({}) do |attrs, name|\n attrs[name] = read_attribute(name)\n attrs\n end\n attrs.symbolize_keys\n end",
"title": ""
},
{
"docid": "dcf32e8f03a8da2bf8fcb7b2ed7ad362",
"score": "0.77842194",
"text": "def attributes\n attrs = Hash.new\n attribute_list.each do |attribute|\n value = self.send(attribute)\n attrs[attribute] = value unless value.nil?\n end\n attrs\n end",
"title": ""
},
{
"docid": "381990efd36f90fc5a2c91239b6fc103",
"score": "0.77822983",
"text": "def attributes\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "3459f28f3d75e8a5c4877fe51c63351e",
"score": "0.77807206",
"text": "def attributes\n ensure_initialized\n @@attributes\n end",
"title": ""
},
{
"docid": "b6f1f4af66166124b2d293f050d56848",
"score": "0.7774849",
"text": "def all_attributes\n attributes_hash_from_attributes_options(self.class.attributes)\n end",
"title": ""
},
{
"docid": "769947254caf72a975c7e1a52a499964",
"score": "0.7768573",
"text": "def attributes; @_attributes; end",
"title": ""
},
{
"docid": "59b86c5870ea674d2dd60a89a63991ce",
"score": "0.77664053",
"text": "def attributes(*) end",
"title": ""
},
{
"docid": "946853fd0be683f7f0123b3deb24249a",
"score": "0.7750708",
"text": "def attributes\n @attributes ||= generalized? ? [] : Attribute.from_model(domain, model)\n end",
"title": ""
},
{
"docid": "f35b48590ad83b487f5125f613db6d61",
"score": "0.7743321",
"text": "def attributes\n @attributes ||= if @cls.nil? or self.abstract?\n []\n else\n Attribute.all_from_klass(self)\n end\n end",
"title": ""
},
{
"docid": "912e3414a43e1fe8620e9742e640e9c4",
"score": "0.7736592",
"text": "def attributes_all\n @attributes_all ||= classes.map{ |m| m.attributes }.flatten.sort\n end",
"title": ""
},
{
"docid": "971fe535026e53ee2897f65522728143",
"score": "0.7727009",
"text": "def attributes\n attrs = Hash.new\n attribute_list.each do |attribute|\n value = self.send(attribute)\n attrs[attribute] = value unless value.nil?\n end\n attrs\n end",
"title": ""
},
{
"docid": "e5a3f8c02936263c302aefcbc6fbfc66",
"score": "0.77168083",
"text": "def attribute_values\n attribute_values = []\n # p @attributes\n\n attributes.each do |key, val|\n attribute_values << val\n end\n\n attribute_values\n end",
"title": ""
},
{
"docid": "015aae2828bc43d4cc0d34c2c21c43cb",
"score": "0.7714711",
"text": "def attributes\n return @attributes if @attributes\n fetch\n end",
"title": ""
},
{
"docid": "9e8ca86226504aa24209b58155a21855",
"score": "0.77125156",
"text": "def list_attributes\n puts \"\"\n @attributes.keys[0..-2].each{|a| print \"#{a}, \"}\n puts attributes.keys.last\n end",
"title": ""
},
{
"docid": "d079663fcd5ebeb29300cc4170decdb4",
"score": "0.7711511",
"text": "def _get_attributes\n self.class.instance_variable_get(:@_ATTRIBUTES)\n end",
"title": ""
},
{
"docid": "d079663fcd5ebeb29300cc4170decdb4",
"score": "0.7711511",
"text": "def _get_attributes\n self.class.instance_variable_get(:@_ATTRIBUTES)\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.770992",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.770992",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.770992",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.770992",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.770992",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "80ae7b50e1f2cd59a592b94f6bbe4c1d",
"score": "0.770992",
"text": "def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"title": ""
},
{
"docid": "d18710e9011c4b738a595057807b5f73",
"score": "0.7707135",
"text": "def attributes\n attrs = {}\n attribute_names.each { |name| attrs[name] = read_attribute(name) }\n attrs\n end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.7697124",
"text": "def attributes; end",
"title": ""
}
] |
29e4bfba1ca480c97da97dbb045dba62 | Return each of the databases in this application (as a Cube object). | [
{
"docid": "0e933842183106a7dd6752edecdb1aa7",
"score": "0.6870734",
"text": "def cubes\n require_relative 'cube'\n try{ @app.getCubes().getAll().to_a }.map{ |c| Cube.new(self, c) }\n end",
"title": ""
}
] | [
{
"docid": "c4b8e9153bfcdd96013361c03479d0f1",
"score": "0.80465895",
"text": "def databases\n Delphix.get(Delphix.database_url).body.result\n end",
"title": ""
},
{
"docid": "722829d2df8640d5212529cc4078b0b9",
"score": "0.7881574",
"text": "def databases\n connection.get \"_all_dbs\"\n end",
"title": ""
},
{
"docid": "2e67fbe3ff24743c6be3044a86aaaf05",
"score": "0.78108186",
"text": "def databases\n return @database.keys\n end",
"title": ""
},
{
"docid": "08ec35c5399aead37f12cf049e16bab0",
"score": "0.77715975",
"text": "def databases\n with(database: :admin).command(listDatabases: 1)\n end",
"title": ""
},
{
"docid": "57883cb36c05015f7d7cb4c18e165515",
"score": "0.774036",
"text": "def getDatabases() \n return @db\n end",
"title": ""
},
{
"docid": "8581e37949786f50eafdfbce816f5e12",
"score": "0.77116877",
"text": "def databases\n CouchRest.get \"#{@uri}/_all_dbs\"\n end",
"title": ""
},
{
"docid": "9f5806bb4ce22f4dd573549a6de44742",
"score": "0.7647897",
"text": "def databases\n if @databases.empty?\n fetch_databases\n end\n return @databases\n end",
"title": ""
},
{
"docid": "60a655ea9e20de71ed6f66023fc333a0",
"score": "0.7570958",
"text": "def databases\n return @dbs.keys\n end",
"title": ""
},
{
"docid": "5e3daf1a70404639619deab2fbfefa35",
"score": "0.74983984",
"text": "def databases\n get('/_all_dbs')\n end",
"title": ""
},
{
"docid": "bfc0cc719579c5e362a052a40fe4e217",
"score": "0.7395681",
"text": "def databases\n CouchRest.get \"#{@uri}/_all_dbs\"\n end",
"title": ""
},
{
"docid": "4094e89c11382ec0ae3b7767a4cde088",
"score": "0.736845",
"text": "def databases\n unless @connected\n errstr = \"Not connected, can't fetch databases\"\n log.error(errstr) if log\n raise errstr\n end\n\n listings = @dmap.find(do_get(\"databases\"),\n \"daap.serverdatabases/dmap.listing\")\n # FIXME check the value of listing\n @databases = []\n unpack_listing(listings) do |value|\n db = Database.new( value.merge(:daap => self) )\n if block_given?\n yield db\n else\n @databases << db\n end\n end\n @databases\n end",
"title": ""
},
{
"docid": "516e586ba8139aec60db7a6fef5d6028",
"score": "0.7329987",
"text": "def databases\n @databases ||= {}\n end",
"title": ""
},
{
"docid": "7d0ba7e03fb56faaae6587bff809aa42",
"score": "0.7319305",
"text": "def database_names\n databases[\"databases\"].map { |database| database[\"name\"] }\n end",
"title": ""
},
{
"docid": "d9390a4f518184e1b58763372c501145",
"score": "0.72746634",
"text": "def all_dbs\n @couch.get(\"_all_dbs\")\n end",
"title": ""
},
{
"docid": "bded2bc852d60140e515207fa6151a30",
"score": "0.72569937",
"text": "def database_names\n get_db_names\n end",
"title": ""
},
{
"docid": "bded2bc852d60140e515207fa6151a30",
"score": "0.72569937",
"text": "def database_names\n get_db_names\n end",
"title": ""
},
{
"docid": "bc3bcd43fd8957ad2cd30e7e85f6b06e",
"score": "0.72514343",
"text": "def database_names\n database_info.keys\n end",
"title": ""
},
{
"docid": "bc3bcd43fd8957ad2cd30e7e85f6b06e",
"score": "0.72514343",
"text": "def database_names\n database_info.keys\n end",
"title": ""
},
{
"docid": "e9c5fccde67c64f6749e511e73bb6f9a",
"score": "0.7156568",
"text": "def databases\n `db2 list db directory | awk '/Database alias/ {print $4}'`.split\n end",
"title": ""
},
{
"docid": "217005578e876e0efad88b80b8061729",
"score": "0.7079126",
"text": "def databases()\n options={:basic_auth => @auth}\n handle_result self.class.get('/databases', options)\n end",
"title": ""
},
{
"docid": "24744717a468dca11806e5c43828bee7",
"score": "0.70407134",
"text": "def databases\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d558d5c0504f47e493d2bdde78fd6700",
"score": "0.70378494",
"text": "def database_names\n names = CouchSpring.get( \"#{uri}/_all_dbs\" )\n end",
"title": ""
},
{
"docid": "ede66205d489b99140608fc50813b30d",
"score": "0.703173",
"text": "def list_dbs\n http_request(\"GET\", \"admin/databases\", \"application/json\", \"\")\n end",
"title": ""
},
{
"docid": "0817770bf9f18dab4c45d1383238cc0c",
"score": "0.703147",
"text": "def dbs\n self.map {|rel| rel[:db] }.uniq\n end",
"title": ""
},
{
"docid": "a2043a1badef0af927cc2badec39e049",
"score": "0.703106",
"text": "def collections\n current_database.collections\n end",
"title": ""
},
{
"docid": "98ce9dc699b6d12cf3dcab88776e9738",
"score": "0.7024098",
"text": "def databases(arg = nil)\n set_or_return(:databases, arg, kind_of: [Array])\n end",
"title": ""
},
{
"docid": "c968cfbd14d604ea12e7de5bd9bf66de",
"score": "0.69758564",
"text": "def databases\n configure_extras(@settings[\"databases\"]) unless @databases || !@settings\n @databases || {}\n end",
"title": ""
},
{
"docid": "387e2f403e10c74bdffbd667ce31aee0",
"score": "0.6958121",
"text": "def list_databases\n if @databases.empty?\n fetch_databases\n end\n return @databases.keys\n end",
"title": ""
},
{
"docid": "4c5aa76f5f05276cad8d1d2c85ea04f7",
"score": "0.69485104",
"text": "def databases\n @@name_cache.keys.sort\n end",
"title": ""
},
{
"docid": "e43df7485dccb06f9fb24b1aec0d5aa1",
"score": "0.69403994",
"text": "def list_databases\n response = @connection.dbreq(\"GET\", @dbmgmthost, \"#{@dbmgmtpath}/instances/#{CloudDB.escape(@id.to_s)}/databases\", @dbmgmtport, @dbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n CloudDB.symbolize_keys(JSON.parse(response.body)[\"databases\"])\n end",
"title": ""
},
{
"docid": "7e88882b26ad807cf82977377e14e892",
"score": "0.69159615",
"text": "def find_all\n result = MysqlAdapter.execute \"SHOW DATABASES\"\n return [] if result.num_rows == 0\n\n array = []\n while row = result.fetch_row\n instance = new\n instance.name = row[0]\n array << instance\n end\n\n array\n end",
"title": ""
},
{
"docid": "96befb86eef3a250527a5cad23944747",
"score": "0.68313754",
"text": "def collections\n db[:collection]\n end",
"title": ""
},
{
"docid": "d7e3735b1256484fcfcf91e056ec3a3c",
"score": "0.67885935",
"text": "def list_databases\n code, body, res = get(\"/v3/database/list\")\n if code != \"200\"\n raise_error(\"List databases failed\", res)\n end\n js = checked_json(body, %w[databases])\n result = {}\n js[\"databases\"].each {|m|\n name = m['name']\n count = m['count']\n created_at = m['created_at']\n updated_at = m['updated_at']\n result[name] = [count, created_at, updated_at, nil] # set nil to org for API compatibiilty\n }\n return result\n end",
"title": ""
},
{
"docid": "7eac40051ec62a902d51a65e4682db12",
"score": "0.67354614",
"text": "def list_databases\n execute_sql 'SELECT datname FROM pg_database WHERE datistemplate = false;'\n end",
"title": ""
},
{
"docid": "4154c808b27c562cc6780f0f79a2d0f9",
"score": "0.66881514",
"text": "def all_dbs\n get('/_all_dbs')\n end",
"title": ""
},
{
"docid": "129c2fff7f18d6feb6551f23769f7598",
"score": "0.66879624",
"text": "def databases\n unless defined?(@databases)\n # only use mutex on initialization\n MUTEX.synchronize do\n # return if another process initialized while we were waiting\n return @databases if defined?(@databases)\n\n @databases = config[\"databases\"].map { |id, c| [id.to_sym, Database.new(id, c)] }.to_h\n end\n end\n\n @databases\n end",
"title": ""
},
{
"docid": "2672c676e1334b020e0b2f7b19e42cb6",
"score": "0.6680025",
"text": "def database_names\n dbs = CouchDB.get( \"#{@uri}/_all_dbs\" )\n dbs.select{|name| name.match(/\\A#{namespace}_?/)}\n end",
"title": ""
},
{
"docid": "7d291af8aec2256dbaa019f6862d75ad",
"score": "0.665469",
"text": "def active_databases\n `db2 list active databases | awk '/Database name/ {print $4}'`.split\n end",
"title": ""
},
{
"docid": "83bd4bbb65c9147e3d4d2ac01e849dee",
"score": "0.6631813",
"text": "def list_databases(options)\n raise NotImplementedError, 'this should be overridden by concrete client'\n end",
"title": ""
},
{
"docid": "04857638ccd8992a5fda40c868c1291b",
"score": "0.659894",
"text": "def db_names\n # TODO: This is throwing an exception right now...\n # @dbs.keys.inspect\n result = []\n @dbs.each { |k,v| result << k }\n result\n end",
"title": ""
},
{
"docid": "411cb9bd4be2ad04488e1a7a19d29bd2",
"score": "0.6562401",
"text": "def syncable_databases\n @tailer.upstream_conn.database_names.map do |db_name|\n next if db_name == 'local'\n @tailer.upstream_conn.db(db_name)\n end.compact\n end",
"title": ""
},
{
"docid": "c04eacf981484e9a17f3234e4270c26b",
"score": "0.65596884",
"text": "def list(options = {})\n server.perform_request('list_databases', options.merge(:\"api.version\" => 1, response_key: 'data'))\n end",
"title": ""
},
{
"docid": "f8f6deccaac6cd9fe7b97a3d1445a000",
"score": "0.6544691",
"text": "def dbs\n @children.keys\n end",
"title": ""
},
{
"docid": "7bddf63cbc9791a7b1a34afb49f417c5",
"score": "0.6477983",
"text": "def database_collection(name)\n db_client[name.to_sym]\n end",
"title": ""
},
{
"docid": "35a556331ef642938302a11e2b46fd11",
"score": "0.6474877",
"text": "def database_instances\n @cache.collection(@mapping, :database_record_type, options)\n end",
"title": ""
},
{
"docid": "e0382c2d46acafede78424f33f72dd53",
"score": "0.64562666",
"text": "def index\n @database_names = DatabaseName.all\n end",
"title": ""
},
{
"docid": "f2951c0fd2e818d890a9ba9a458115ea",
"score": "0.64508533",
"text": "def datastores\n datastores = []\n @_host.datastore.each do |ds|\n datastores << Datastore.wrap(ds)\n end\n datastores\n end",
"title": ""
},
{
"docid": "69b910f6d219336c9cb609030d6ac3f9",
"score": "0.6440512",
"text": "def get_db_list\n mongo = MongoConnection.instance\n conn = mongo.conn\n \n begin\n db_list = {}\n @conn.database_names.each do |db_name|\n unless db_name =~ SPECIAL_PURPOSE_MONGO_DB_NAME_PATTERN then\n db_list[db_name] = @conn.db(db_name).collection_names.reject do |coll_name|\n coll_name =~ SPECIAL_COLLECTION_NAME_PATTERN\n end\n end\n end\n rescue Mongo::OperationFailure\n # Authentication failure. Show the dbs that we have logged on so far.\n @db_logged_in.each do |db_name|\n db_list[db_name] = conn.db(db_name).collection_names.reject do |coll_name|\n coll_name =~ SPECIAL_COLLECTION_NAME_PATTERN\n end\n end\n end\n\n db_list\n end",
"title": ""
},
{
"docid": "079cb8b709ee8d97aaa069853117eda4",
"score": "0.64244926",
"text": "def index\n @targetdatabases = Targetdatabase.all\n end",
"title": ""
},
{
"docid": "7c8eca72c6ef3c676788f119632eb26d",
"score": "0.6423941",
"text": "def database\n @database\n end",
"title": ""
},
{
"docid": "858c6605617a35350015ed66cc3d070c",
"score": "0.6408736",
"text": "def each(*args, &block)\n databases.each(*args, &block)\n end",
"title": ""
},
{
"docid": "5f61ae3ca81f9b08c5c626a46512e77e",
"score": "0.64017624",
"text": "def all_user_databases(server:)\n list_user_databases(server: server).map{ |db| Arango::Database.new(name: db, server: server).reload }\n end",
"title": ""
},
{
"docid": "0bc322a507dd027d552dddacaa7b6207",
"score": "0.64015204",
"text": "def database_info\n doc = self['admin'].command({:listDatabases => 1})\n doc['databases'].inject({}) do |info, db|\n info[db['name']] = db['sizeOnDisk'].to_i\n info\n end\n end",
"title": ""
},
{
"docid": "3c5b9e6661523b5ccbb1c35ba5b95f0c",
"score": "0.63752794",
"text": "def collection_names\n current_database.collection_names\n end",
"title": ""
},
{
"docid": "c6e1a2b6e55b66a8c5f993f4f3d3f35d",
"score": "0.6340433",
"text": "def database\n @project.database instance_id, database_id\n end",
"title": ""
},
{
"docid": "c6e1a2b6e55b66a8c5f993f4f3d3f35d",
"score": "0.6340433",
"text": "def database\n @project.database instance_id, database_id\n end",
"title": ""
},
{
"docid": "06cafad52541c0a32240d3fa6060af43",
"score": "0.63075477",
"text": "def list_dbs(db=nil)\n db &&= db.gsub(/[\\\\\\']/){\"\\\\#{$&}\"}\n query(db ? \"show databases like '#{db}'\" : \"show databases\").map(&:first)\n end",
"title": ""
},
{
"docid": "015b60aa0cf7a9c0d43c1ce3baf4c46e",
"score": "0.6274144",
"text": "def fetch_foundation_schemas\n tenant_schemas = []\n client = mysql_api_connect('root')\n # schemas only start with af* by convention, so check all of them\n results = client.query('show databases')\n results.each do |row|\n row.each do |_col_name, col_val|\n tenant_schemas << col_val\n end\n end\n return tenant_schemas\n end",
"title": ""
},
{
"docid": "697fb7bdb41ab84043469644661e3d40",
"score": "0.6235546",
"text": "def index\n @microapp_dbs = MicroappDb.all\n end",
"title": ""
},
{
"docid": "9f9e1ffa42f245ec9b0f053aef0e58e1",
"score": "0.62217593",
"text": "def schema\n connection.database.collection_names.map(&:to_sym)\n end",
"title": ""
},
{
"docid": "53a4f5cb668718e51e1d520f86d512d6",
"score": "0.61924624",
"text": "def database\n @collection.try(:database) || @database || model.collection.database\n end",
"title": ""
},
{
"docid": "1c7d5061f395e41141447ab5efab2a88",
"score": "0.6191254",
"text": "def query(dbname)\n @databases.each do |db|\n return db if db.database == dbname.downcase\n end\n end",
"title": ""
},
{
"docid": "45b6e0a276840e5dcc83fa67fe5b8012",
"score": "0.6174091",
"text": "def database_info\n doc = self['admin'].command({:listDatabases => 1})\n doc['databases'].each_with_object({}) do |db, info|\n info[db['name']] = db['sizeOnDisk'].to_i\n end\n end",
"title": ""
},
{
"docid": "45b6e0a276840e5dcc83fa67fe5b8012",
"score": "0.6174091",
"text": "def database_info\n doc = self['admin'].command({:listDatabases => 1})\n doc['databases'].each_with_object({}) do |db, info|\n info[db['name']] = db['sizeOnDisk'].to_i\n end\n end",
"title": ""
},
{
"docid": "9e97f43741fa4c1eca08cb46c6f93802",
"score": "0.61657554",
"text": "def db(name: nil)\n if name\n result = get(address: \"_db/#{name}/_api/database/current\")[:result]\n result.keys.each do |key|\n result[key.to_s.underscore.to_sym] = result.delete(key)\n end\n result[:server] = self\n Arangodm::Database.new(result)\n else\n Arangodm::Database.default\n end\n end",
"title": ""
},
{
"docid": "8162b11e7c36e353484e52be2a4c4d0e",
"score": "0.6161405",
"text": "def available_databases\n @available_databases ||= {}\n end",
"title": ""
},
{
"docid": "eda78f61456db4286108cea3b1479d6b",
"score": "0.61587924",
"text": "def database\n Model.database\n end",
"title": ""
},
{
"docid": "6b662aa24f5bc42c21b927d1b6a99443",
"score": "0.61407995",
"text": "def databases\n query = \"info=dbs\"\n responce, result = Net::HTTP.new(@host, @port).post(@path, query)\n return result\n end",
"title": ""
},
{
"docid": "f6ea3ea381239363b50afce9decf5c5d",
"score": "0.6132225",
"text": "def database\n deployment.db\n end",
"title": ""
},
{
"docid": "f71272e0bdb317be1e43e999895d6d47",
"score": "0.6121653",
"text": "def current_database\n database(current_db_name)\n end",
"title": ""
},
{
"docid": "13fcd38cbbd3f0d0d366afa079396021",
"score": "0.6105878",
"text": "def db_groups\n Delphix.get(Delphix.group_url).body.result\n end",
"title": ""
},
{
"docid": "4d4ddee44cbbd69fe5cd6ac04df09f26",
"score": "0.6105115",
"text": "def database\n self.class.database\n end",
"title": ""
},
{
"docid": "68042a3e6bcd099bea4862a1b92b04db",
"score": "0.6098682",
"text": "def all_sequel_databases\n yield pgsql_test_database\n yield sqlite_test_database\n end",
"title": ""
},
{
"docid": "2ee1317f98330f6c014d075ce68dee49",
"score": "0.609638",
"text": "def database\n self.class.database\n end",
"title": ""
},
{
"docid": "2ee1317f98330f6c014d075ce68dee49",
"score": "0.609638",
"text": "def database\n self.class.database\n end",
"title": ""
},
{
"docid": "2ee1317f98330f6c014d075ce68dee49",
"score": "0.609638",
"text": "def database\n self.class.database\n end",
"title": ""
},
{
"docid": "0ec3bcaad10c383f8a44dcb87003b9c8",
"score": "0.6086403",
"text": "def collections_coll(agency)\n settings.send(\"#{agency}_db\")['collections']\n end",
"title": ""
},
{
"docid": "7715f368dff3defced66190011bf48cc",
"score": "0.6077544",
"text": "def index\n @data_bases = DataBase.all\n end",
"title": ""
},
{
"docid": "11e47b3e283adcef43314e30fdebcff0",
"score": "0.6073222",
"text": "def index\n @air_monitor_databases = AirMonitorDatabase.all\n end",
"title": ""
},
{
"docid": "9cb7f43907b087ff25eb561448907e57",
"score": "0.6069177",
"text": "def [](name)\n databases[name]\n end",
"title": ""
},
{
"docid": "3c6a093c0bc38b573b0b244db3b54fc1",
"score": "0.6066307",
"text": "def fetch_databases\n url = @url + '?type=registry'\n document = REXML::Document.new( request( :url => url ) )\n REXML::XPath.each( document, \"//MartURLLocation\" ) do |d|\n if d.attributes[\"visible\"] === \"1\"\n @databases[ d.attributes[\"name\"] ] = Database.new( @url, d.attributes )\n end\n end\n end",
"title": ""
},
{
"docid": "e37fa63185b31cbc40236ac9ffef63af",
"score": "0.6061969",
"text": "def info\n specified_db_or_all { |db| display_db_info db }\n end",
"title": ""
},
{
"docid": "a618c31fee55c6cb69a9decdd87cd7ed",
"score": "0.6055979",
"text": "def show\n @database.each do |database,db_info|\n puts \"Database : #{database}\"\n\n db_info.each do |table, tbl_info|\n puts \" Table : #{table}\"\n puts \" Columns: #{tbl_info.keys.inspect}\"\n puts\n end\n end\n end",
"title": ""
},
{
"docid": "e04c9f7446de42389f1a9a3fd9ce4c66",
"score": "0.60354555",
"text": "def database\n @database ||= Commands::App::DB::Utils::Database[app]\n end",
"title": ""
},
{
"docid": "fea99487ec06e928cecb62ea954ee119",
"score": "0.6031816",
"text": "def db\n object_store.db\n end",
"title": ""
},
{
"docid": "5dcabcfec7e6904255b605716680d21e",
"score": "0.6025061",
"text": "def db\n unless defined?(@db)\n if /Database *\\: *(.*)/m =~ @f0database then\n a = $1.split(/^/)\n a.pop if a.size > 1\n @db = a.collect { |x| x.sub(/\\s+\\z/, '') }.join(' ')\n end\n end #unless\n @db\n end",
"title": ""
},
{
"docid": "815182735c8fabb827e29d5ffddca3a8",
"score": "0.60218567",
"text": "def databases_found\n states.select(&:found?).map(&:database)\n end",
"title": ""
},
{
"docid": "045e8d534579a34b2b96b3f19314c6d7",
"score": "0.6021107",
"text": "def database\n @db.connection\n end",
"title": ""
},
{
"docid": "26a41aa1507d1dd399f770ab027a475e",
"score": "0.60142785",
"text": "def index\n @dbs = Db.all\n end",
"title": ""
},
{
"docid": "d61537ebed24c082e93eaebea512e405",
"score": "0.6010505",
"text": "def list_user_databases(server:)\n result = Arango::Requests::Database::ListAccessible.execute(server: server).result\n end",
"title": ""
},
{
"docid": "d2598234f11d8c7e63c84a8a4768fb21",
"score": "0.59997827",
"text": "def list_databases(options={}) #:nodoc:\n verify_and_sanitize_options(options, { :user => :optional, :password => :optional })\n\n params = { :method => :get, :uri => 'listDatabases', :no_session => true }\n # additional authentication allowed, overriden in 'call_server' if not defined\n params[:user] = options[:user] if options.include? :user\n params[:password] = options[:password] if options.include? :password\n\n response = call_server params\n rslt = process_response(response)\n rslt['databases']\n end",
"title": ""
},
{
"docid": "a27e30d62c990530739b25269943e18f",
"score": "0.59872395",
"text": "def index\n validate_arguments!\n\n if hpg_databases_with_info.empty?\n display(\"#{app} has no heroku-postgresql databases.\")\n else\n hpg_databases_with_info.keys.sort.each do |name|\n display_db name, hpg_databases_with_info[name]\n end\n end\n end",
"title": ""
},
{
"docid": "e3f93c2597b3db7f829b783983191f06",
"score": "0.59717983",
"text": "def get_database(name)\n CloudDB::Database.new(self, name)\n end",
"title": ""
},
{
"docid": "06cee778517ede315bc912c513aa486e",
"score": "0.5956662",
"text": "def current_database\n query_value(\"SELECT current_database()\", \"SCHEMA\")\n end",
"title": ""
},
{
"docid": "787ed598492bd1175f9c6938b66859e6",
"score": "0.5956442",
"text": "def get_queries\n @database.queries\n end",
"title": ""
},
{
"docid": "a41ceaf5f09bd359740c23bbaa2eb549",
"score": "0.59481823",
"text": "def database\n @database ||= determine_database\n end",
"title": ""
},
{
"docid": "12997e3573bbe9e0bbc9de7b28b147c8",
"score": "0.5939633",
"text": "def collections(database)\n options={:basic_auth => @auth}\n handle_result self.class.get(\"/databases/#{database}/collections\", options)\n end",
"title": ""
},
{
"docid": "b173185644c75405503ac438ea99fb2d",
"score": "0.593864",
"text": "def enum_database_names\n dump_table_fields('information_schema.schemata', %w[schema_name]).flatten\n end",
"title": ""
},
{
"docid": "07ddc77334114405376b289bc1eee420",
"score": "0.5936364",
"text": "def index\n @database_postgresqls = DatabasePostgresql.all\n end",
"title": ""
},
{
"docid": "62336070b1b32e5d1550496f7450ba3a",
"score": "0.59325284",
"text": "def db_name\n dump_all? ? '--all-databases' : name\n end",
"title": ""
}
] |
1882140bd2a1b980d0939bee7f507cd5 | intro with coding language specialty | [
{
"docid": "cffa2d6aace24872d045af6030fdf447",
"score": "0.59903467",
"text": "def coding_with_language(#{name}, #{language})\n puts \"Hi, my name is #{name} and I am learning to program in #{language}!\"\nend",
"title": ""
}
] | [
{
"docid": "d5e400832b9856645cc6e7cddd895cfe",
"score": "0.7084321",
"text": "def introduction\r\n\r\n end",
"title": ""
},
{
"docid": "53dd321289b8681a072c6bb1d671f90c",
"score": "0.7046275",
"text": "def introduction_with_language(name,language)\n puts \"Hi, my name is #{name} and I am learning to program in #{language}.\"\nend",
"title": ""
},
{
"docid": "c0cb28e99db557233360f05cf9af1760",
"score": "0.7012324",
"text": "def introduction_with_language(name, language)\n puts \"Hi, my name is #{name} and I am learning to program in #{language}.\"\nend",
"title": ""
},
{
"docid": "9cd952de2ad5a4546fed6d34335246ec",
"score": "0.7006643",
"text": "def introduction_with_language(name, language)\n puts \"Hi, my name is #{name} and I am learning to program in #{language}.\"\nend",
"title": ""
},
{
"docid": "bb65ef2a47aaf3bb4d608ba360dc7e36",
"score": "0.70045656",
"text": "def introduction_with_language(name, language)\n puts \"Hi, my name is #{name} and I am learning to program in #{language}.\\n\"\nend",
"title": ""
},
{
"docid": "2f83176be48ae9eaa7b328fa67b3c1e0",
"score": "0.6865014",
"text": "def intro()\n show do\n title \"Introduction - RNA Quality Control\"\n separator\n note \"In this protocol you will prepare <a href=https://www.labviva.com/pub/static/frontend/Ueg/new/en_US/images/docs/HB-2326-001_1105695_IAS_QX_RNA_Quality_Control_0117_WW.pdf>RNA samples for analysis on the QIAxcel Bioanalyzer</a>.\"\n note \"1. Gather materials and reagents\"\n note \"2. Mix and place samples on thermocycler\"\n note \"3. Dilute\"\n end\n end",
"title": ""
},
{
"docid": "7a631edd59ac41ffbb325abcce49b787",
"score": "0.6844919",
"text": "def intro\n\tputs \"\\nHey, this is Grandma. HOW ARE YOU DEARY?\"\nend",
"title": ""
},
{
"docid": "6ba2332ff6ee9c06a47aa7e6a6124fa3",
"score": "0.6834835",
"text": "def intro()\n show do\n title \"Introduction - Illumina RNA Seq Library Prep\"\n separator\n note \"This is the first step in the: <a href=https://support.illumina.com/downloads/truseq_stranded_total_rna_sample_preparation_guide_15031048.html>Illumina TruSeq Stranded Total RNA with RiboZero Guide</a>\"\n note \"In this protocol, you will be depleting the abundant ribosomal RNA from your sample.\"\n note \"Then, you will be chemically fragmenting the depleted RNA, since the Illumina platform is optimized for short reads.\"\n note \"<b>1.</b> Deplete riboRNA\"\n note \"<b>2.</b> Isolate & Wash Depleted RNA\"\n note \"<b>3.</b> Chemically Fragment RNA\"\n end\n end",
"title": ""
},
{
"docid": "3ff089a800609fb6b8c4364f2382d958",
"score": "0.67405754",
"text": "def mk_intro\n [\"Kære \", \"Hej \", \"Goddag, \"].sample + @name\n end",
"title": ""
},
{
"docid": "5d948e74439ceff467c92d744bff6f05",
"score": "0.66981924",
"text": "def difficulty_intro\n print \"\\nWhat difficulty would you like to play? (e)asy, (m)edium, or (h)ard? \"\n end",
"title": ""
},
{
"docid": "3454c7a8874bcd575974b3eb01c316ff",
"score": "0.66167325",
"text": "def introduction_with_language (name = \"Dan\", language= \"Ember.js\")\n puts \"Hi, my name is #{name} and I am learning to program in #{language}.\"\nend",
"title": ""
},
{
"docid": "7b7695097e50376d0fa3872aac9084bc",
"score": "0.6596388",
"text": "def intro\n expression = 'am a genius'\n puts expression\nend",
"title": ""
},
{
"docid": "bb8d350886ae15c2b663cac936ff05d9",
"score": "0.651268",
"text": "def introduction_with_language_optional(name,language=\"Ruby\")\n puts \"Hi, my name is #{name} and I am learning to program in #{language}.\"\nend",
"title": ""
},
{
"docid": "a5188b2c6ae8ff2f221af08b91f30e35",
"score": "0.6425725",
"text": "def texte_aide\n <<-EOT\n=== Aide pour les tâches ===\\033[0m\n\nAjouter une tâche (avec ou sans description)\n #{jaune('add \"<tâche>\"[ \"description\"][ <priorité>]')}\n La priorité est un nombre de 0 (aucune priorité) à\n 9 (priorité maximale).\n\nMarquer une tâche finie\n #{jaune('close/done <id tâche>')}\n\nVoir toutes les informations de la tâche\n #{jaune('show <id tâche>')}\n\n(Re)définir les attributs d'une tâche\n #{jaune('set <id tâche> m=\"contenu\" d=\"description\" p=[0-9]')}\n p pour la priorité (0 par défaut)\n\nDétruire une tâche\n #{jaune('remove/delete <id tâche>')}\n\nQuitter\n #{jaune('q/quit/quitter')}\n\n EOT\n end",
"title": ""
},
{
"docid": "d5814f05c54fc695ecd84bc836445738",
"score": "0.6418424",
"text": "def introduction(name)\n\t pharase =\"Hi, my name is #{name}.\"\n\t puts pharase\nend",
"title": ""
},
{
"docid": "c393c3e9f50a1219dbce37acdb2794d0",
"score": "0.6374435",
"text": "def lang(orig); end",
"title": ""
},
{
"docid": "0151d834493cd3b94a0af664f6181940",
"score": "0.6342505",
"text": "def introduction_with_language_optional (name = \"Edwin\", language =\"Ruby\" )\n puts \"Hi, my name is #{name} and I am learning to program in #{language}.\"\n\nend",
"title": ""
},
{
"docid": "4d77cddb13a2e5797d040ea86bb4a782",
"score": "0.6318263",
"text": "def intro\n\tputs \"\\nHello, welcome to Secret Number, created by Jonathan Wang.\"\nend",
"title": ""
},
{
"docid": "66fcd87f54cf480de1a42f783171e53e",
"score": "0.63105714",
"text": "def intro(*args); say $terminal.color(format(*args), :bold); say(''); end",
"title": ""
},
{
"docid": "09daacb214cf71c2e965e2be12f1e543",
"score": "0.6290961",
"text": "def start\n title = Artii::Base.new\n title = title.asciify ('ToDo.it')\n puts title.colorize(:blue)\n \n welcome_section\nend",
"title": ""
},
{
"docid": "80fd8607258eb9e5dea2d90458ea6b6e",
"score": "0.62673986",
"text": "def lang=(_arg0); end",
"title": ""
},
{
"docid": "80fd8607258eb9e5dea2d90458ea6b6e",
"score": "0.62673986",
"text": "def lang=(_arg0); end",
"title": ""
},
{
"docid": "5aa8908559109a21b6122725a3e47091",
"score": "0.62665987",
"text": "def eval_lecture_head\n b = \"\"\n b << \"\\\\kurskopf{#{title.escape_for_tex}}\"\n b << \"{#{profs.map { |p| p.fullname.escape_for_tex }.join(' / ')}}\"\n b << \"{#{returned_sheets}}\"\n b << \"{#{id}}\"\n b << \"{#{t(:by)}}\\n\\n\"\n unless note.nil? || note.strip.empty?\n b << RT.small_header(I18n.t(:note))\n b << note.strip\n b << \"\\n\\n\"\n end\n b\n end",
"title": ""
},
{
"docid": "e7cbae2b80e8f88d3204c612ab32a4b7",
"score": "0.6254214",
"text": "def elearning\n @title = \"e-Learning\"\n end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.62503415",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.62503415",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.62503415",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.62503415",
"text": "def language; end",
"title": ""
},
{
"docid": "32b1418c326d528b9d485fbe3937a023",
"score": "0.6207147",
"text": "def learn_english\n puts \"Go learn English!\"\n dyse = \"https://doyouspeakenglish.fr/\"\n puts \"If you're French, go there for FREE: #{dyse}\"\n english_kit = \"http://bit.ly/kit-anglais\"\n puts \"And for only 1€ you can get a complete starter kit here: #{english_kit}\"\n grammar = \"https://learnenglish.britishcouncil.org/skills\"\n puts \"Otherwise go there: #{grammar}\"\n superprof_english = \"http://bit.ly/superprof-anglais\"\n puts \"If you want private lessons, checkout my profile here: #{superprof_english}\"\n podia\nend",
"title": ""
},
{
"docid": "b0b46b8029fe3b8d95ff5c6d7f1ac902",
"score": "0.61906755",
"text": "def home_lessons\n para \"You have no lessons.\", :margin_left => 12, :font => \"Lacuna Regular\"\n end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.61483717",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.61483717",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.61483717",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.61483717",
"text": "def lang; end",
"title": ""
},
{
"docid": "204a980b34bc7df879908f9fc7b5080e",
"score": "0.6121892",
"text": "def introduction_with_language_optional(#{name}, #{language})\n puts \"Hi, my name is #{name} and I am learning to code in #{Ruby}!\nend",
"title": ""
},
{
"docid": "2e962b3776dd066553b656f7baa9321a",
"score": "0.6120132",
"text": "def pr_intro\n show do\n title \"Plate Reader Measurements\"\n \n note \"This protocol will instruct you on how to take measurements on the BioTek Plate Reader.\"\n note \"ODs are a quick and easy way to measure the growth rate of your culture.\"\n note \"GFP measurements help researchers assess a response to a biological condition <i>in vivo</i>.\"\n note \"<b>1.</b> Transfer culture to plate reader plate and add blank.\"\n note \"<b>2.</b> Setup plate reader workspace.\"\n note \"<b>3.</b> Take measurement, save data, & upload.\"\n end\n end",
"title": ""
},
{
"docid": "159cdc91318f44d029d2eb5d42fb5be2",
"score": "0.6100268",
"text": "def introduction\n if title\n clear\n yes_no('Do you want to read the rules and see a live demo?') ? rules : nil\n clear\n difficulty_key = difficulty_menu\n @difficulty = DIFFICULTY[difficulty_key]\n @promptarr = prompt_select(difficulty_key)\n else\n @running = false\n exit\n end\n end",
"title": ""
},
{
"docid": "7fd2fbae6424e41111572d8a02730093",
"score": "0.6098717",
"text": "def lex_en_plain_words=(_arg0); end",
"title": ""
},
{
"docid": "7fd2fbae6424e41111572d8a02730093",
"score": "0.6098717",
"text": "def lex_en_plain_words=(_arg0); end",
"title": ""
},
{
"docid": "7fd2fbae6424e41111572d8a02730093",
"score": "0.6098717",
"text": "def lex_en_plain_words=(_arg0); end",
"title": ""
},
{
"docid": "898e58273c4f53b8085b15c09449ffde",
"score": "0.6096256",
"text": "def intro()\n show do\n title \"Stitching Fragments by Overlap Extention (SOE)\"\n separator\n note \"In this protocol you will be guided in preparing an SOE reaction.\"\n note \"This method takes advantage of DNA fragments that have overlapping sequences.\"\n note \"The overlapping fragments will act as primers themselves and polymerize to create the desired amplicon.\"\n note \"<b>1.</b> Gather materials and fill with KAPA Master Mix\"\n note \"<b>2.</b> Add fragments in either equimolar ratios or similar mass - OPTIMIZE WHICH TO USE\"\n note \"<b>3.</b> Setup thermocycler conditions for SOE\"\n note \"<b>4.</b> Transfer samples from stripwells to labelled microfuge tubes for storage.\"\n end\n end",
"title": ""
},
{
"docid": "b7965a56caf8910f3333cb1703b757ba",
"score": "0.6087022",
"text": "def do_something_else(language)\n puts \"#{language} is the best programming language\"\nend",
"title": ""
},
{
"docid": "6341479b1341bfaffa9d922392504ecc",
"score": "0.60847384",
"text": "def intro\n puts \"************************************************\"\n puts \"Hi #{ @user.strip }, I'm the #{ $0 } script\"\n puts \"************************************************\"\n puts \"\\tWelcome to Talkbox\"\n puts \"\\ttype 'help' to get started\"\n puts \"************************************************\"\n end",
"title": ""
},
{
"docid": "cd28f6fabb6d3511770c9951a3883568",
"score": "0.6062754",
"text": "def intro()\n show do\n title \"Fragment analyzing info\"\n note \"In this protocol, you will do the following:\"\n note \"- gather stripwells of fragments\"\n note \"- organize them in the fragment analyzer machine\"\n note \"- set up and run the analyzer\"\n note \"- upload the analysis results to Aquarium\"\n end\n end",
"title": ""
},
{
"docid": "205cfd9820391f3192f2d2f816a64525",
"score": "0.6057003",
"text": "def emphasis; end",
"title": ""
},
{
"docid": "3460317ac40db766afcab49ca296814a",
"score": "0.6029222",
"text": "def lex_en_interp_string; end",
"title": ""
},
{
"docid": "3460317ac40db766afcab49ca296814a",
"score": "0.6029222",
"text": "def lex_en_interp_string; end",
"title": ""
},
{
"docid": "3460317ac40db766afcab49ca296814a",
"score": "0.6029222",
"text": "def lex_en_interp_string; end",
"title": ""
},
{
"docid": "72674f93c952dfb0728338520b47ca2b",
"score": "0.60261726",
"text": "def lex_en_interp_words=(_arg0); end",
"title": ""
},
{
"docid": "72674f93c952dfb0728338520b47ca2b",
"score": "0.60261726",
"text": "def lex_en_interp_words=(_arg0); end",
"title": ""
},
{
"docid": "72674f93c952dfb0728338520b47ca2b",
"score": "0.60261726",
"text": "def lex_en_interp_words=(_arg0); end",
"title": ""
},
{
"docid": "84af979535cb860e425b8252c264300c",
"score": "0.6025822",
"text": "def lex_en_interp_words; end",
"title": ""
},
{
"docid": "84af979535cb860e425b8252c264300c",
"score": "0.6025822",
"text": "def lex_en_interp_words; end",
"title": ""
},
{
"docid": "84af979535cb860e425b8252c264300c",
"score": "0.6025822",
"text": "def lex_en_interp_words; end",
"title": ""
},
{
"docid": "0ca944022f7186dbbcf59b14dbb607fe",
"score": "0.60181",
"text": "def introduction(name)\n puts \"Hi, my name is #{name}.\\n\"\nend",
"title": ""
},
{
"docid": "389274c5626b892d528f02321acf6156",
"score": "0.60144717",
"text": "def learn_human_languages\n puts \"Do you want to learn English?\"\n puts \"1. Yes\"\n puts \"2. No\"\n\n english = get_data\n\n if english == \"1\"\n learn_english\n else\n babel = \"https://www.youtube.com/playlist?list=PLfKvL-VUSKAnkBk88BAb3oq1MlGVnhwcY\"\n puts \"If you want to learn other languages, check this out for FREE: #{babel}\"\n starter_kit\n podia\n end\nend",
"title": ""
},
{
"docid": "f3474117811d4f784efd978bd673bb7e",
"score": "0.6006759",
"text": "def paragraph; end",
"title": ""
},
{
"docid": "7619cd97dd57ca4fc0ef69603d5c19a4",
"score": "0.59992695",
"text": "def hello_world lang\n if lang == 'de'\n p ' Hallo Welt'\n elsif lang == 'es'\n p 'Hola Mundo' \n elsif lang == 'ru'\n p 'Привет, мир'\n elsif lang == 'ja'\n p 'こんにちは世界'\n else\n p 'Hello World'\n end\nend",
"title": ""
},
{
"docid": "b9dab7c1a6fd35e390953779ef8bed53",
"score": "0.599701",
"text": "def article_title_lang_display(text)\n\t\tarticle_lang_display(text)\n\tend",
"title": ""
},
{
"docid": "8f9497fd0db1423cf3c4f0e5524f4dea",
"score": "0.59788626",
"text": "def content_for_intro(interpret=true)\n if interpret\n render_for_html(body.paragraphs[0])\n else\n body.paragraphs[0]\n end\n end",
"title": ""
},
{
"docid": "07392ee0d761251a3f147015f276a44a",
"score": "0.59617156",
"text": "def introduce_myself\n puts \"I am a world ruler\"\n puts \"I am filty rich\"\n puts \"I own a library\"\nend",
"title": ""
},
{
"docid": "f490f4e4953ed65acad1f6e446f6ec77",
"score": "0.593469",
"text": "def accent(language=\"French\")\n \"I am #{language}! Why do you think I have this outrageous accent?!\"\nend",
"title": ""
},
{
"docid": "bc23326417f194d3ceaad9c43a632111",
"score": "0.5927745",
"text": "def enchantment; end",
"title": ""
},
{
"docid": "b5eced1b81997d54e668d48580b8289f",
"score": "0.592647",
"text": "def introduction(greeting, name)\n puts \"#{greeting}, #{name}.\"\nend",
"title": ""
},
{
"docid": "031439f76444b5a0014ae05fab4040fb",
"score": "0.58839476",
"text": "def student_favourite_programming_language(language)\n return \"I love #{language}\"\n end",
"title": ""
},
{
"docid": "82ed0ba859662730619516aba33b7d3f",
"score": "0.5881117",
"text": "def lex_en_unknown; end",
"title": ""
},
{
"docid": "5d7055a40e6d0c30c04289583c47af14",
"score": "0.58729225",
"text": "def learn_more\n end",
"title": ""
},
{
"docid": "19196f7a3e0030e79e2dd5d77ead4ea1",
"score": "0.58678204",
"text": "def lab\n # STUB\n end",
"title": ""
},
{
"docid": "4da889bebae53528a475d3ac02828de1",
"score": "0.58621484",
"text": "def enchant\n end",
"title": ""
},
{
"docid": "550c7163bc3e814c4c2c938d9100fca8",
"score": "0.58567226",
"text": "def greetings_programmer(name, language = \"computer\")\n puts \"Hello, #{name}. We heard you are a great #{language} programmer.\"\nend",
"title": ""
},
{
"docid": "fe9a72e6d573388d8eee67cc765f6e16",
"score": "0.585128",
"text": "def lex_en_plain_words; end",
"title": ""
},
{
"docid": "fe9a72e6d573388d8eee67cc765f6e16",
"score": "0.585128",
"text": "def lex_en_plain_words; end",
"title": ""
},
{
"docid": "fe9a72e6d573388d8eee67cc765f6e16",
"score": "0.585128",
"text": "def lex_en_plain_words; end",
"title": ""
},
{
"docid": "416c72b2271fe6692539a4c6872e48dd",
"score": "0.5850909",
"text": "def lex_en_plain_string=(_arg0); end",
"title": ""
},
{
"docid": "416c72b2271fe6692539a4c6872e48dd",
"score": "0.5850909",
"text": "def lex_en_plain_string=(_arg0); end",
"title": ""
},
{
"docid": "416c72b2271fe6692539a4c6872e48dd",
"score": "0.5850909",
"text": "def lex_en_plain_string=(_arg0); end",
"title": ""
},
{
"docid": "710570357d1ba3c1b2b8ea21137f7db2",
"score": "0.5847358",
"text": "def meme_phrase; end",
"title": ""
},
{
"docid": "96da1d0edfed68e52890a46726e8161e",
"score": "0.5830596",
"text": "def self_introduction\n \"Hello #{user_link(source_user)}, very nice to meet you!\"\n end",
"title": ""
},
{
"docid": "9df1d7512f4cf1d4e36d3732c798bcc8",
"score": "0.5822424",
"text": "def introduction(name1, name2)\n puts \"Ladies and gentlemen, let me introduce you to Mr. \" + name1 + \" and Mrs. \" + name2 + \"!\"\nend",
"title": ""
},
{
"docid": "bf9da6935ca551fcfec4cb54ea8b4710",
"score": "0.5816538",
"text": "def learning_help(m)\n m.reply \"Learning module\"\n m.reply \"===========\"\n m.reply \"Description: Teach the bot about things, and have it repeat that info back later.\"\n m.reply \"Usage: [botname] [thing] is [information] (to store additional [information] under the keyword [thing].)\"\n m.reply \"[botname] [thing] (to get whatever the bot knows about [thing].)\"\n end",
"title": ""
},
{
"docid": "4d9aa095bb86c5e3b5e226d901cc1322",
"score": "0.5816121",
"text": "def article_lang_display(text)\n\n\t\ttext.split(\"$$\").each_cons(2) do |lang, content|\n\n\t\t\tif lang.eql?('en') and I18n.locale == :en\n\t\t\t\ten_text = content\n\t\t\t\treturn creole(en_text)\n\t\t\telsif lang.eql?('es') and I18n.locale == :es\n\t\t\t\tes_text = content\n\t\t\t\treturn creole(es_text)\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "581476e9317c542bc68ff907195e16d2",
"score": "0.5813472",
"text": "def noun; end",
"title": ""
},
{
"docid": "581476e9317c542bc68ff907195e16d2",
"score": "0.5813472",
"text": "def noun; end",
"title": ""
},
{
"docid": "676a33e43c22dd5215db0fa5b94cd265",
"score": "0.58089477",
"text": "def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"title": ""
},
{
"docid": "676a33e43c22dd5215db0fa5b94cd265",
"score": "0.58089477",
"text": "def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"title": ""
},
{
"docid": "7dd9257b808c722149a3d3a30f5cfbcd",
"score": "0.5798636",
"text": "def lex_en_unknown=(_arg0); end",
"title": ""
},
{
"docid": "0e05634aaa736626bfa68c8939510336",
"score": "0.57936305",
"text": "def head_translations_for(language)\n outdent(%Q{\n #{language}:\n picard: \"enterprise (head trans)\"\n janeway: \"uss voyager (head trans)\"\n sisko: \"deep space nine (head trans)\"\n })\n end",
"title": ""
},
{
"docid": "72e4043d18ccf81a30559feadae854c4",
"score": "0.57905114",
"text": "def print_rationale\n puts \"To start playing, just start typing some Rubinius VM instructions.\"\n puts \"You can find a complete list with documentation here:\"\n puts\n puts \"\\thttp://rubini.us/doc/en/virtual-machine/instructions/\"\n puts\n puts \"To introspect the program you are writing, use the following commands,\"\n puts \"or type \" + bold { \"exit\" } + \" to exit:\"\n puts\n puts \" \" + bold { \"list\" } + \" lists the instruction set of the current program.\"\n puts \" \" + bold { \"reset\" } + \" empties the instruction set and starts a new program.\"\n puts \" \" + bold { \"draw\" } + \" prints a visual representation of the stack after each instruction.\"\n puts\n end",
"title": ""
},
{
"docid": "697a070b7d25ddc1d996e284ddaf93b7",
"score": "0.5787993",
"text": "def osteen\r\n\r\nputs \" You can change yout world by changing your words\"\r\nend",
"title": ""
},
{
"docid": "7199fbd11e167638ec69962561d349f4",
"score": "0.5787911",
"text": "def texts; end",
"title": ""
},
{
"docid": "7e8ef7bb60fe9d25c4a132b5f4566d05",
"score": "0.57748616",
"text": "def favorite_language\n return \"I love Ruby!\"\n end",
"title": ""
},
{
"docid": "bbbc81b4214428e35db82541bc1f27bc",
"score": "0.57743835",
"text": "def help(lang='en')\n readme.to_s(lang)\n end",
"title": ""
},
{
"docid": "2ead301c7fe3c760be6b22772adb2f7e",
"score": "0.5771678",
"text": "def lex_en_line_begin; end",
"title": ""
},
{
"docid": "2ead301c7fe3c760be6b22772adb2f7e",
"score": "0.5771678",
"text": "def lex_en_line_begin; end",
"title": ""
},
{
"docid": "2ead301c7fe3c760be6b22772adb2f7e",
"score": "0.5771678",
"text": "def lex_en_line_begin; end",
"title": ""
},
{
"docid": "69e874bbac5de432718ee2fa3133f337",
"score": "0.5767067",
"text": "def lex_en_interp_string=(_arg0); end",
"title": ""
},
{
"docid": "69e874bbac5de432718ee2fa3133f337",
"score": "0.5767067",
"text": "def lex_en_interp_string=(_arg0); end",
"title": ""
},
{
"docid": "69e874bbac5de432718ee2fa3133f337",
"score": "0.5767067",
"text": "def lex_en_interp_string=(_arg0); end",
"title": ""
},
{
"docid": "6b7d021a74804b4494abba7ac972bc37",
"score": "0.575707",
"text": "def lex_en_plain_string; end",
"title": ""
},
{
"docid": "6b7d021a74804b4494abba7ac972bc37",
"score": "0.575707",
"text": "def lex_en_plain_string; end",
"title": ""
}
] |
baf1adf53508c1846631b10afabe72fc | Returns the bucket index for a value | [
{
"docid": "a7ec59bdda8aa99f4cbe34ea9a79e1d5",
"score": "0.8605435",
"text": "def bucket_index(value)\n return 0 if value < @min_bucket_value\n return @number_of_buckets - 1 if value >= @max_bucket_value\n\n ((Math.log(value) - Math.log(@min_bucket_value)) / @bucket_size).floor\n end",
"title": ""
}
] | [
{
"docid": "3a1e482e5e994ea3c7b63a83a1dbb7ac",
"score": "0.76771814",
"text": "def bucket(hash_value)\n (hash_value.abs % 100) + 1\n end",
"title": ""
},
{
"docid": "d7dc4506469a8d05a0f01ec0cdad8811",
"score": "0.67564315",
"text": "def value_index\n VALUES.index value\n end",
"title": ""
},
{
"docid": "26c0952e6f468300593145ba7ae607c3",
"score": "0.6721687",
"text": "def bucketize(category, value)\n @categories[category][:buckets][bucket_index(value)] += 1\n end",
"title": ""
},
{
"docid": "cfec4452494222e5f8d267ac9794a382",
"score": "0.67099386",
"text": "def get_bucket_value(hash_value, max_value, multiplier = 1)\n ratio = hash_value.to_f / MAX_HASH_VALUE\n multiplied_value = (max_value * ratio + 1) * multiplier\n multiplied_value.to_i\n end",
"title": ""
},
{
"docid": "9a0cdc7a80063abe51682c315b4ce308",
"score": "0.6676597",
"text": "def value_to_index(value)\n value.to_s(2).size - 1\n end",
"title": ""
},
{
"docid": "872c9b79933834ab76a8193a4139fba6",
"score": "0.66685593",
"text": "def index(value)\n iterate do |i, prev, current|\n return i if current.value == value\n end\n -1\n end",
"title": ""
},
{
"docid": "986712c1d912887f12b9c86cb91e25d4",
"score": "0.6666435",
"text": "def bucket_value(index, type = nil)\n case type\n when :begin, :start, :lower, :lower_bound; bucket_lower_bound(index)\n when :end, :finish, :upper, :upper_bound; bucket_upper_bound(index)\n else bucket_average_value(index)\n end\n end",
"title": ""
},
{
"docid": "febbb77c71d117c84f85fa1f81dfcea8",
"score": "0.66288656",
"text": "def [](num)\n # optional but useful; return the bucket corresponding to `num`\n i = num % @num_buckets\n self.store[i]\n end",
"title": ""
},
{
"docid": "271c1190fa95faa0623ea074e2b7493e",
"score": "0.6489516",
"text": "def index_of(value)\n index = 0\n each_node do |node|\n return index if node.value == value\n index += 1\n end\n -1\n end",
"title": ""
},
{
"docid": "1d6efc3de2b27fa71fcca2ebfb31e96e",
"score": "0.64806986",
"text": "def get_bucket(key, offset)\n # Float::to_i simply truncates in ruby.\n bucket_id = Math::log(key.distance_to(@local_id), 2).to_i\n\n # @todo This part to be redone. Worst case, only half of the buckets are\n # actually closest. e.g. with @replication_factor = 5, and initial bucket=0\n # will return 0, 1, 4, 2, 3. With a proper implementation, 4 will not be\n # returned till last, since it is the farthest away.\n if offset.even?\n bucket_id -= offset / 2\n elsif offset.odd?\n bucket_id += offset / 2 + 1\n end\n bucket_id = bucket_id % @routing_table.length\n\n return @routing_table[bucket_id]\n end",
"title": ""
},
{
"docid": "717de0e261eb104c09043af8975e103d",
"score": "0.6448095",
"text": "def bucket_upper_bound(index)\n bucket_lower_bound(index + 1)\n end",
"title": ""
},
{
"docid": "7ad62068fcf155b9a356579d0c43869e",
"score": "0.6383608",
"text": "def bucket_num_to_label(bucket_num)\n min + bucket_size * (bucket_num - 1)\n end",
"title": ""
},
{
"docid": "9f032b0855c4230fa0835f56a217330e",
"score": "0.63732177",
"text": "def index(value)\n hash = Hash['a', 'abc', 'b', 'def', 'c', 'ghi']\n @hh = hash\n return hash.index(value)\n end",
"title": ""
},
{
"docid": "de807ff6bf9319e83c8f45d6018cb492",
"score": "0.6341323",
"text": "def hash_key(hash, value)\n hash.index value\n end",
"title": ""
},
{
"docid": "966704c8ae94210156767ad9830ecef4",
"score": "0.63321465",
"text": "def get_bucket( str )\n sum = 0\n str.each_char do |c|\n sum += c.ord\n end\n sum % @num_buckets\n end",
"title": ""
},
{
"docid": "f2327a990bf2e7e5c9881db94aff68cb",
"score": "0.63265",
"text": "def index(value)\n @values.index(value)\n end",
"title": ""
},
{
"docid": "8073af454c00695d679957f617950f43",
"score": "0.63041216",
"text": "def generate_bucket_value(hash_value, max_value, multiplier = 1)\n ratio = hash_value.to_f / MAX_HASH_VALUE\n multiplied_value = (max_value * ratio + 1) * multiplier\n multiplied_value.to_i\n end",
"title": ""
},
{
"docid": "cac5383be8c439d279cbbc6f36b34e13",
"score": "0.6298848",
"text": "def bucket_for_hash(hash)\n\t\tdistance = calc_distance(@node_id, hash)\n\t\t\t@contact_buckets.each_with_index do |bucket, j|\n\t\t\tif j**2 <= distance && distance < (j+1)**2 then\n\t\t\t\treturn bucket\n\t\t\tend\n\t\tend\n\t\treturn @contact_buckets.last\n\tend",
"title": ""
},
{
"docid": "a93ed9f63465663581b5189b51d2abd1",
"score": "0.62880343",
"text": "def index\n VALUES.index(value)\n end",
"title": ""
},
{
"docid": "8e86279f417dc495695330c6afd8791e",
"score": "0.62739366",
"text": "def [](num)\n @store[num % num_buckets]\n end",
"title": ""
},
{
"docid": "8ab33ffa7541d286009eada3f1834a12",
"score": "0.6256973",
"text": "def bucket_lower_bound(index)\n Math.exp((index * @bucket_size) + Math.log(@min_bucket_value))\n end",
"title": ""
},
{
"docid": "9aa4a5a0815db1d7c92ec6c5fab5b7c6",
"score": "0.62480605",
"text": "def place(value)\n bucket = nil\n boundaries.each_with_index do |boundary, i|\n if value > boundary\n bucket = i\n else\n break\n end\n end\n bucket\n end",
"title": ""
},
{
"docid": "e4e4b60da234f866bd5c90eeb09bb628",
"score": "0.6216435",
"text": "def index(value)\n\t\teach do |k, v|\n\t\t\treturn k if v == value\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "3d96783fcd5b27732f2211a50ac8847f",
"score": "0.6204528",
"text": "def bucket_interval(index)\n Range.new(bucket_lower_bound(index), bucket_upper_bound(index), true)\n end",
"title": ""
},
{
"docid": "276868cbca8ffb64d6163b927e437093",
"score": "0.6199917",
"text": "def get_bucket_from_hash(hash)\n ensure_bucket(hash)\n\n @buckets[hash % @size]\n end",
"title": ""
},
{
"docid": "b4bffb178e8f4ba939afffbe766bc602",
"score": "0.61798966",
"text": "def get_value(value)\n unless @bins.nil?\n return @bins[value]\n end\n nil\n end",
"title": ""
},
{
"docid": "fa1f2287588f4b5881f02b890911c2e7",
"score": "0.61727536",
"text": "def bucket_id\n return @bucket_id\n end",
"title": ""
},
{
"docid": "9771016a22004f3f01197f08ff529cf7",
"score": "0.60954463",
"text": "def num_buckets\n @num_buckets\n end",
"title": ""
},
{
"docid": "9771016a22004f3f01197f08ff529cf7",
"score": "0.60954463",
"text": "def num_buckets\n @num_buckets\n end",
"title": ""
},
{
"docid": "bce1ab38ca0f617c4debbaa8d2ce6348",
"score": "0.6091652",
"text": "def get_index_by_vertex_value(value)\n return vertices.index {|v| v.value == value}\n end",
"title": ""
},
{
"docid": "2ed7c2d2b0bf0f7e1eeca43dbe8f520d",
"score": "0.6077799",
"text": "def index_of(value)\n find_index { |node| node.data == value } || -1\n end",
"title": ""
},
{
"docid": "d1ce16f6e2726db612fe24c290efb9b2",
"score": "0.60550714",
"text": "def my_index(value)\n self.each_with_index {|el, i| return i if el == value}\n nil\n end",
"title": ""
},
{
"docid": "b31cd58a1f794d3b283484011286e90f",
"score": "0.6029303",
"text": "def get_bucket(bucket)\n end",
"title": ""
},
{
"docid": "40f908f2c3b632e2d571e628e87a1203",
"score": "0.60279304",
"text": "def get(key)\n return -1 if (bucket = @store[index(key)]).nil?\n result = bucket.select { |entry| entry.key == key }\n result || -1\n end",
"title": ""
},
{
"docid": "1f447e3cf2ef8106b5ef53e3ee642883",
"score": "0.60127014",
"text": "def bucket_average_value(index)\n (bucket_lower_bound(index) + bucket_upper_bound(index)) / 2\n end",
"title": ""
},
{
"docid": "0c68e927e64ec4adc542ed382afb2375",
"score": "0.60037464",
"text": "def rank\n VALUE_STRINGS.keys.index(self.value) + 1\n end",
"title": ""
},
{
"docid": "3e827c7c04e1f02f7e45d9a4c92516d3",
"score": "0.59579515",
"text": "def value\n RANKS.index(rank)\n end",
"title": ""
},
{
"docid": "db1e116f7df96e57394945425ab983ad",
"score": "0.5956169",
"text": "def index(value)\n value = Scalar.resolve(value, value_data_type)\n compute(\"index\", options: {value: value}).value\n end",
"title": ""
},
{
"docid": "cc23ab2c25f6db33776ecdab816612e2",
"score": "0.59541243",
"text": "def search(key)\r\n\t\tindex = hash_function(key)\r\n\t\tif @table[index] == nil\r\n\t\t\treturn -1\r\n\t\telse\r\n\t\t\tbucket_num = 1\t\r\n\t\t\t@table[index].each do |bucket|\r\n\t\t\t\t\t\r\n\t\t\t\tif bucket[:key] == key\r\n\t\t\t\t\treturn {:location => \"#{index + 1}/#{bucket_num}\", :data => bucket[:value]}\r\n\t\t\t\tend\r\n\t\t\t\tbucket_num += 1 \r\n\t\t\tend\r\n\t\t\treturn -1\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "40ed69fee41b82abae06e867f73dfc1a",
"score": "0.59258586",
"text": "def index(value)\n l, r = 0, @array.size - 1\n\n while l <= r\n m = (r + l) / 2\n\n # similar to (value < @array.at(m)) but works with anything Comparable\n if -1 == (value <=> @array.at(m))\n r = m - 1\n else\n l = m + 1\n end\n end\n\n l\n end",
"title": ""
},
{
"docid": "bfb0798104502da4927a8c9ae23e2e7a",
"score": "0.59105086",
"text": "def index(key, value)\n \tacsii_sum = 0\n \tvalue.each_byte do |i|\n acsii_sum += i\n end\n return acsii_sum % @size\n end",
"title": ""
},
{
"docid": "2ca6f73b0aedefdc89de00497116396b",
"score": "0.59037983",
"text": "def find_bucket_for_node(node)\n @buckets.bsearch do |bucket|\n bucket.end_id >= node.id\n end\n end",
"title": ""
},
{
"docid": "7fa340a45ad1d35c5ad28b988e3f8540",
"score": "0.5885276",
"text": "def buckets=(value)\n @buckets = value\n end",
"title": ""
},
{
"docid": "97a724b1e42ead4e0b7d98c29dd0f841",
"score": "0.58605415",
"text": "def bucket(age)\n @buckets.find {|b| b.covers? age}\n end",
"title": ""
},
{
"docid": "3c24c6cffcb7b8a7fc775b95b08fcb56",
"score": "0.5860183",
"text": "def get_index(value)\n @choices.each_with_index do |choice, index|\n if(choice[:value] == value)\n return index\n end\n end\n end",
"title": ""
},
{
"docid": "f90230229c84c0c92a14536accb7ad09",
"score": "0.58318156",
"text": "def bucket_id=(value)\n @bucket_id = value\n end",
"title": ""
},
{
"docid": "9db9e34d3d1ec985309377430a308cfc",
"score": "0.58081186",
"text": "def find_bucket(bucket_name)\n @buckets[bucket_name]\n end",
"title": ""
},
{
"docid": "c057479de89553ce186778725b757850",
"score": "0.5807549",
"text": "def get_bucket(hash)\n get_bucket_from_hash(hash)\n end",
"title": ""
},
{
"docid": "7c4818b46d1a737e17960c4d3754a7ae",
"score": "0.5796419",
"text": "def index(value)\n # -1 means 'not found' in WxWidgets\n if value.kind_of?(String) && ( i = find_string(value, true) ) && i > -1\n return i\n end\n indices = (0 ... get_count).to_a\n return indices.find { | i | get_item_data(i) == value } \n end",
"title": ""
},
{
"docid": "a5bdec0073fbd70247896dc129ac9599",
"score": "0.57739854",
"text": "def hashValueToInt(value)\n return Digest::SHA256.digest(value).unpack('q').first.abs\n end",
"title": ""
},
{
"docid": "ece4bfbf26c3f13e054db7d58384f6c5",
"score": "0.5759754",
"text": "def key (value, which = :all)\n\tcase which when :all, :ary\n\t pos = index value\n\t return pos unless pos.nil?\n\tend\n\tcase which when :all, :rnd then return @rnd.key(value) end\n\tnil\n end",
"title": ""
},
{
"docid": "c98252adcafd8385d362448fe0f95695",
"score": "0.5748555",
"text": "def current_position\n self.class.bucket(bucket).pluck(:row_order).index(row_order) + 1\n end",
"title": ""
},
{
"docid": "850b57c1fd3095113b59d88d666a4417",
"score": "0.57440907",
"text": "def key_for_min_value(name_hash)\n i = 100\n name_hash.each do |ind, n|\n if i > n\n i = n\n end\n end\n if i == 100\n return nil\n else\n name_hash.collect do |ind, n|\n if name_hash[ind] == i\n return ind\n end\n end\n end\nend",
"title": ""
},
{
"docid": "f1622d67e1eb778d853ccfa3bdd37459",
"score": "0.5741225",
"text": "def target_bucket(key)\n bucket_index = key.hash % @num_buckets\n bucket = @buckets[bucket_index]\n if bucket.nil?\n bucket = Bucket.new\n @buckets[bucket_index] = bucket\n end\n bucket\n end",
"title": ""
},
{
"docid": "ef0c2cb680f72ae2f2c7b91c6bcb0145",
"score": "0.57251877",
"text": "def get(index)\n redis.lindex(@key, index).to_i\n end",
"title": ""
},
{
"docid": "6d1cfd8c497e1d138b408d0ffd343bd6",
"score": "0.5724864",
"text": "def bucket\n @bucket ||= team.buckets.find(bucket_id)\n end",
"title": ""
},
{
"docid": "fb56b15cfa723c6de13114acedb613d1",
"score": "0.5706039",
"text": "def key(value)\n each { |entry| return entry[0] if value == entry[1] }\n nil\n end",
"title": ""
},
{
"docid": "f55796ce682feccb8e52b12c0a17a0e8",
"score": "0.570461",
"text": "def index(key, size)\n hash_index = key.sum % size\n hash_index\n end",
"title": ""
},
{
"docid": "bcf1f4a0dfba525b11ed3233ad738160",
"score": "0.5702707",
"text": "def getHashIndices(value)\n #For the first hash function we'll just use the lookup value \n #(we have to convert the value to string first because SHA256.digest requires a string input)\n @hashIndex = hashValueToInt(value.to_s)%@bitmap.length\n yield\n #On the second, let's salt it.\n @seedIndex = hashValueToInt(value.to_s+'haveSomeSalt')%@bitmap.length\n #Now let's do some math to get the rest of the indices.\n i = 1 \n while (i<@numberOfHashFunctions) do\n @hashIndex = (@hashIndex+@seedIndex)%@bitmap.length\n yield\n i += 1\n end\n end",
"title": ""
},
{
"docid": "c8e95da1a799311965f0eba91070d6b9",
"score": "0.56909657",
"text": "def index(key, size)\n indexAscii = key.sum\n # sum = 0\n # for i in key\n # sum += i.to_i\n # end\n indexValue = indexAscii % size\n end",
"title": ""
},
{
"docid": "45d806bcd729946b42c28188aee0e183",
"score": "0.5690231",
"text": "def index(key, size)\n indexAscii = key.sum\n indexValue = indexAscii % size\n end",
"title": ""
},
{
"docid": "45d806bcd729946b42c28188aee0e183",
"score": "0.5690231",
"text": "def index(key, size)\n indexAscii = key.sum\n indexValue = indexAscii % size\n end",
"title": ""
},
{
"docid": "9c8b00b2d1a9fd2f920e53ec33d5bdf4",
"score": "0.56876796",
"text": "def find_values_index()\r\n\t\t\r\n\r\n\t\tmyindex = self.each_with_index.inject(Hash.new {Array.new}) do |hash, (obj, i)|\r\n\t\t\thash[obj] += [i]\r\n\t\t\thash\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "98125847567b9ec7be279136fde5df65",
"score": "0.5676252",
"text": "def current_position\n team.buckets.pluck(:row_order).index(row_order) + 1\n end",
"title": ""
},
{
"docid": "7ff420e88f89c1fd24e1133f914aaedb",
"score": "0.567406",
"text": "def sindex(base)\n\t\tk = 0\n\t\tself.each do |el|\n\t\t\tif el.coins?(base)\n\t\t\t\tk += 1\n\t\t\t\treturn k \n\t\t\telse\n\t\t\t\treturn nill\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f00b9ca740b772cbcbaf4187a5101686",
"score": "0.56621456",
"text": "def dimension_value_for(value)\n @dimension_value_index[value]\n end",
"title": ""
},
{
"docid": "f00b9ca740b772cbcbaf4187a5101686",
"score": "0.56621456",
"text": "def dimension_value_for(value)\n @dimension_value_index[value]\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.5662103",
"text": "def num_buckets\n @store.length\n end",
"title": ""
},
{
"docid": "6d30cd6381c59d609f9c10d84f6430d7",
"score": "0.56568474",
"text": "def key(value)\n @values.key(value)\n end",
"title": ""
},
{
"docid": "65b9caeea6cc7672b8cc1ef592ce2859",
"score": "0.565158",
"text": "def value_index\n return @value if @option.type == :slider\n @option.values.index(@value) || 0\n end",
"title": ""
},
{
"docid": "638dc6b4762813f4016cb31848b9e4cc",
"score": "0.5638751",
"text": "def buckets\n return @buckets\n end",
"title": ""
},
{
"docid": "5c3db97d3c5b51b334d7d1e8f2d30b2e",
"score": "0.5635899",
"text": "def find(value)\n index = 0\n runner = @head\n until runner.nil?\n if runner.value == value\n return index\n end\n index += 1\n runner = runner.next\n end\n\n nil\n end",
"title": ""
},
{
"docid": "e8e78623629002481e38bef003824cb5",
"score": "0.56358624",
"text": "def value symbol\n index symbol\n end",
"title": ""
},
{
"docid": "7a58511d391ca9744009524e730d9dad",
"score": "0.5630167",
"text": "def value_index(idx)\n node = self\n while node.parent\n idx += node.parent.offsets[node.index_in_parent_node]\n node = node.parent\n end\n\n idx\n end",
"title": ""
},
{
"docid": "5f375868f608e85146e38f0e0667c9e1",
"score": "0.56279755",
"text": "def index\n Values.index(@value)\n end",
"title": ""
},
{
"docid": "3b95866c320998f0b9dcc12c5fa9c40c",
"score": "0.56198376",
"text": "def find(value)\n index = 0\n cur = @head\n until cur == nil\n return index if cur.value == value\n cur = cur.next_node\n index += 1\n end\n nil\n end",
"title": ""
},
{
"docid": "b382d0312a0540fa02a833f17d0ff9c3",
"score": "0.5619417",
"text": "def value_as_index(val)\n if val.kind_of?(Fixnum)\n val\n else\n t.send(val, :numeric)\n end\n end",
"title": ""
},
{
"docid": "a7ea06e59191a783ce7a3b3498341d85",
"score": "0.56022525",
"text": "def index(value)\n @flat.index(value)\n end",
"title": ""
},
{
"docid": "ae6bcf9f93449577b09ff4307ad5d440",
"score": "0.559897",
"text": "def y_bucket(y)\n end",
"title": ""
},
{
"docid": "7cf76a24d0fd3445ed65480153e2453e",
"score": "0.5583829",
"text": "def index(name)\n rawgaps.each_with_index {|g,i| return (i*2)+1 if g.name == name }\n nil\n end",
"title": ""
},
{
"docid": "56804085f82413398c9cac94b9d419ea",
"score": "0.5577579",
"text": "def type\n bucket_type\n end",
"title": ""
},
{
"docid": "06d701d8b3b2ff6da1e59177e375fda0",
"score": "0.5568506",
"text": "def find(value)\n cur = @head\n cur_index = 0\n until cur.nil?\n return cur_index if value == cur.value\n\n cur = cur.next_node\n cur_index += 1\n end\n nil\n end",
"title": ""
},
{
"docid": "82e96812c9ccd19023a8dc537412352a",
"score": "0.556679",
"text": "def index_for(type, value)\n order = Kubes.config.kubectl.order.send(type) # kinds or roles\n index = order.index(value.to_s) || 999\n i = index.to_s.rjust(3, \"0\") # pad with 0\n \"#{i}-#{value}\" # append name so that terms with same index get order alphabetically\n end",
"title": ""
},
{
"docid": "b9b45ca778064e69a934dd4f1d0be2fb",
"score": "0.55622613",
"text": "def find(value)\n each_with_index do |node, idx|\n return idx if node.value == value\n end\n\n nil\n end",
"title": ""
},
{
"docid": "4d6d0917e9dfe968bd62e6dfe4945054",
"score": "0.55542797",
"text": "def to_i\n @index\n end",
"title": ""
},
{
"docid": "30b95112244eb846c2c16a564319e93a",
"score": "0.55526763",
"text": "def key_for_min_value(name_hash)\r\n x = 0\r\n i = nil\r\n name_hash.each do |name, num|\r\n if x == 0 || num < x\r\n x = num\r\n i = name\r\n end\r\n end\r\n i\r\nend",
"title": ""
},
{
"docid": "6623fb5591658b1c6fd15f85b9770321",
"score": "0.55487275",
"text": "def k\n index[:k]\n end",
"title": ""
},
{
"docid": "76c9f783f065fbf34551bc6e9456cf13",
"score": "0.55480033",
"text": "def biodiversity_index(specimens)\n int = 0\n hash = Hash.new(0)\n specimens.each do |value|\n hash[value] += 1\n end\n return hash.keys.size**2\nend",
"title": ""
},
{
"docid": "4e0b8213143188000b31ecdc07367307",
"score": "0.5543583",
"text": "def find_index(value)\r\n # Setup Array of Indexes\r\n indexes = []\r\n # Run Through each with index and add index if the same\r\n each_with_index {|element, index| indexes << index if element == value}\r\n # Return Indexes\r\n return indexes\r\n end",
"title": ""
},
{
"docid": "2931ea741d98dd2d50c588d5fe1d8509",
"score": "0.5539556",
"text": "def biodiversity_index(specimens)\n hash = {}\n specimens.uniq.each { |k| hash[k] = specimens.count(k)}\n value_sort = hash.values.sort\n smallest, largest = value_sort.first, value_sort.last\n hash.count ** 2 * (smallest/largest)\nend",
"title": ""
},
{
"docid": "f578eecff6dec888ccafb5e3c177ff20",
"score": "0.553928",
"text": "def index\n @bucket.objects.map{|obj| obj.key}\n end",
"title": ""
}
] |
6bee304c4ad4eb81b8df328214ea4879 | Requires that the value is a valid sheet view type. valid types must be one of normal, page_break_preview, page_layout | [
{
"docid": "9196af80e696cb64a9253a4a672321b2",
"score": "0.8437417",
"text": "def validate_sheet_view_type(v); end",
"title": ""
}
] | [
{
"docid": "c1468a6599bb28c8f37694aacbad5bdd",
"score": "0.6646245",
"text": "def validate_pane_type(v); end",
"title": ""
},
{
"docid": "7c2783e17335b619a081a09f80cff68b",
"score": "0.6439712",
"text": "def sheet_view; end",
"title": ""
},
{
"docid": "728cf9f7f338ff8cb5d58605dea9b3b4",
"score": "0.59283614",
"text": "def validate_sheet!(sheet)\n case sheet\n when nil\n fail ArgumentError, \"Error: sheet 'nil' not valid\"\n when Integer\n sheets.fetch(sheet) do\n fail RangeError, \"sheet index #{sheet} not found\"\n end\n when String\n unless sheets.include?(sheet)\n fail RangeError, \"sheet '#{sheet}' not found\"\n end\n else\n fail TypeError, \"not a valid sheet type: #{sheet.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "68983059951b19460cbb43c11dcdca2f",
"score": "0.5926023",
"text": "def PresentationFormat=(v) Axlsx::validate_string",
"title": ""
},
{
"docid": "5a16892800146f5d8f7a71d42225a1f3",
"score": "0.59224635",
"text": "def Slides=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "b276a4fd03b11f50fc4e242297967ea2",
"score": "0.583633",
"text": "def Pages=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "cf206fbec77c94e3a0f8faa8666d1831",
"score": "0.54821587",
"text": "def sheet_view\n @sheet_view ||= SheetView.new\n yield @sheet_view if block_given?\n @sheet_view\n end",
"title": ""
},
{
"docid": "8895571f901941649caf8668a7751cfc",
"score": "0.5473589",
"text": "def Paragraphs=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "aef79be3f4767181d2ddb1b248d1d789",
"score": "0.5429584",
"text": "def validate_conditional_formatting_value_object_type(v); end",
"title": ""
},
{
"docid": "6d92b525308b378c92ba6d401ad7c653",
"score": "0.53603244",
"text": "def HiddenSlides=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "6ad87ffed759acea0b67323beab0c562",
"score": "0.53294253",
"text": "def view_type=(value)\n @view_type = value\n end",
"title": ""
},
{
"docid": "0cac0b016b95f555632c622a20f9db9f",
"score": "0.5318899",
"text": "def sheet?\n true\n end",
"title": ""
},
{
"docid": "6f87a528e45f89454c496eb855413d5b",
"score": "0.5288688",
"text": "def sheet_params\n params.require(:sheet).permit(\n :original_code,\n :convert_type_1,\n :convert_type_2\n )\n end",
"title": ""
},
{
"docid": "86756a2e8c0841be351392d145e5510f",
"score": "0.52832395",
"text": "def valid_value? value\n !CLASS_CELLTYPE_MAPPING[value.class.to_s].nil?\n end",
"title": ""
},
{
"docid": "b561eccbd24545d88cf31767a3782b19",
"score": "0.5257467",
"text": "def Words=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "d9c35bf53608c36ffb3b9611b84a5077",
"score": "0.5256362",
"text": "def presentation_type\n val_type = text_validation_type\n val_type = 'none' if val_type.blank?\n\n self.class.presentation_type_for name, val_type\n end",
"title": ""
},
{
"docid": "ff312102a315c97d4ecbb7c269afdf18",
"score": "0.5246137",
"text": "def view_type\n end",
"title": ""
},
{
"docid": "c678b26fbb6d0ae3f315d4f8c13d55f8",
"score": "0.52183104",
"text": "def ShareDoc=(v) Axlsx::validate_boolean",
"title": ""
},
{
"docid": "87c59e399c0badd970d3768be2cdafe4",
"score": "0.52138305",
"text": "def validate_type\n return unless @params[:type]\n raise ArgumentError, \"Invalid parameter: #{@params[:type]}\" unless ConsolidatedScreeningList::TYPES.include?(@params[:type])\n end",
"title": ""
},
{
"docid": "3be1938077af78e0a9c6ee854d81fa31",
"score": "0.5194797",
"text": "def sheet; end",
"title": ""
},
{
"docid": "3de57d33bd50c83a118d8b7e1570ac45",
"score": "0.51847863",
"text": "def validate_slide_type\n errors.add(:slide_id, :doesnt_allow_documents) if @slide && !@slide.allows_document?\n end",
"title": ""
},
{
"docid": "38d5f8e3809e0557a31c8d2806c716db",
"score": "0.5182984",
"text": "def validate_view_visibility(v); end",
"title": ""
},
{
"docid": "f9f744f008d3b0746d7dc0e4d7c7f432",
"score": "0.5174669",
"text": "def valid_type?(value, type)\n @model.send :valid_type?, value, type\n end",
"title": ""
},
{
"docid": "2320b4f51476492f95df91e2e33061a5",
"score": "0.5160444",
"text": "def content_type=(value)\n if content_type && content_type != value\n errors[:content_type] << 'Type of the page is immutable'\n elsif value\n write_attribute(:content_type, value)\n end\n end",
"title": ""
},
{
"docid": "24a6f97512a67f442534988fd71f9d9d",
"score": "0.5154337",
"text": "def validate?(value_type)\n result = true\n @screens.each do |screen|\n screen_ok = screen.validate?(value_type)\n result = result && screen_ok\n end\n\n result\n end",
"title": ""
},
{
"docid": "34fda32b046d110d5e36463a8fa14d49",
"score": "0.51542026",
"text": "def Template=(v) Axlsx::validate_string",
"title": ""
},
{
"docid": "6c487d163b75980c4f9dda0855b77125",
"score": "0.5132032",
"text": "def sheet\n user_specified_options[:sheet] || 0\n end",
"title": ""
},
{
"docid": "2c4c6753145565bbd77a38e049638ac7",
"score": "0.5116569",
"text": "def cell_type_from_value(v)\n if v.is_a?(Date)\n :date\n elsif v.is_a?(Time)\n :time\n elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)\n :boolean\n elsif v.to_s.match(/\\A[+-]?\\d+?\\Z/) #numeric\n :integer\n elsif v.to_s.match(/\\A[+-]?\\d+\\.\\d+?\\Z/) #float\n :float\n else\n :string\n end\n end",
"title": ""
},
{
"docid": "ee02f6dd617931ffee8a4a9a6ffe8a4d",
"score": "0.50960416",
"text": "def DocSecurity=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "cd36263a5ee7e403d59ae26f1057fbab",
"score": "0.5085138",
"text": "def type_valid?\n true\n end",
"title": ""
},
{
"docid": "094a6406cb307fe451df43ffae5be20a",
"score": "0.5082729",
"text": "def sheet_format_pr; end",
"title": ""
},
{
"docid": "057922f031547b837f50aa2686f15824",
"score": "0.5081777",
"text": "def validate_content_type(v); end",
"title": ""
},
{
"docid": "67502910a39cfa15f760cd04d4eb70b6",
"score": "0.50199157",
"text": "def excelx_type(row, col, sheet = nil)\n key = normalize(row, col)\n safe_send(sheet_for(sheet).cells[key], :cell_type)\n end",
"title": ""
},
{
"docid": "495f6a6c6aafc2c320d405cb2c7124c6",
"score": "0.5009226",
"text": "def ensure_proper_display_type\n case reporter.try(:type)\n when :\"choice-multiple\"\n self.display_type = \"bar\" unless %w(bar line).include?(display_type)\n when :\"choice-single\"\n self.display_type = \"bar\" unless %w(bar pie line).include?(display_type)\n when :text\n self.display_type = \"word_cloud\"\n end\n end",
"title": ""
},
{
"docid": "c50915f5856d977c055eb60470846855",
"score": "0.5006887",
"text": "def validate_type( the_type )\n\n return 'public' if the_type.nil?\n case the_type\n when 'all', 'public', 'uva', 'private', 'embargo'\n return( the_type )\n else\n return( 'public' )\n end\n\n end",
"title": ""
},
{
"docid": "19abb34bd889e9b5d090428bd2b09268",
"score": "0.4968384",
"text": "def excel_type\n Cell.excel_type calculated_type\n end",
"title": ""
},
{
"docid": "7b4ac5d181a39bd368122d99f7434741",
"score": "0.49388278",
"text": "def validate_table_element_type(v); end",
"title": ""
},
{
"docid": "1e8143e39ef971b1a0e0580a88d82997",
"score": "0.4931989",
"text": "def validate_data_validation_type(v); end",
"title": ""
},
{
"docid": "fafb927fa37b7749f203c4e0b5c48df0",
"score": "0.49039137",
"text": "def MMClips=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "017bf0b0a3d3594198322cd9d4e9e793",
"score": "0.48854566",
"text": "def document_type=(document_type)\n validator = EnumAttributeValidator.new('String', [\"pdf\", \"xls\", \"xlsx\"])\n unless validator.valid?(document_type)\n fail ArgumentError, \"invalid value for \\\"document_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @document_type = document_type\n end",
"title": ""
},
{
"docid": "05ea185cd1e917c8f241272777d46ab3",
"score": "0.48827767",
"text": "def validate!(value)\n # We're very restrictive here. Realistically Ini files only have string types\n return if value.nil? || value.is_a?(String) || value.is_a?(Integer)\n\n # The only other valid-ish type is a Hash\n raise ArgumentError, format('The setting %{key} may only be a String or Integer, not %{class}', key: qualified_name, class: value.class) unless value.is_a?(Hash)\n\n # Any hashes can only have a single String/Integer value\n value.each do |child_name, child_value|\n next if child_value.nil? || child_value.is_a?(String) || child_value.is_a?(Integer)\n\n raise ArgumentError, format('The setting %{key} may only be a String or Integer, not %{class}', key: \"#{qualified_name}.#{child_name}\", class: child_value.class)\n end\n end",
"title": ""
},
{
"docid": "5b8df1b2979d643b4a5329434857f9c1",
"score": "0.48812887",
"text": "def view_type=(s_type)\n super(s_type.to_s.classify.constantize.base_class.to_s)\n end",
"title": ""
},
{
"docid": "fb9ab130fa06702e32c1379cf1a489cc",
"score": "0.48789757",
"text": "def fit_to_page=(value)\n Axlsx.validate_boolean value\n @fit_to_page = value\n end",
"title": ""
},
{
"docid": "fb9ab130fa06702e32c1379cf1a489cc",
"score": "0.48789757",
"text": "def fit_to_page=(value)\n Axlsx.validate_boolean value\n @fit_to_page = value\n end",
"title": ""
},
{
"docid": "eca56354bf7fd8542c5522e47b4c5bdb",
"score": "0.4873946",
"text": "def excel_valid_param_params\n params.require(:excel_valid_param).permit(:is_required, :excel_col_name, :excel_col_number, :type)\n end",
"title": ""
},
{
"docid": "7deadbb2ab62a761a908f6d9d7800037",
"score": "0.48570725",
"text": "def page_type\r\n if @page[:type]\r\n raise ArgumentError, 'page type must be full, popup, or interruptus' unless ['full','popup', 'interruptus'].include? @page[:type]\r\n end\r\n return @page[:type] || 'full'\r\n end",
"title": ""
},
{
"docid": "40784ef633eff53c6cc9a2cb404f9b62",
"score": "0.48529696",
"text": "def desired_type; end",
"title": ""
},
{
"docid": "40784ef633eff53c6cc9a2cb404f9b62",
"score": "0.48529696",
"text": "def desired_type; end",
"title": ""
},
{
"docid": "40784ef633eff53c6cc9a2cb404f9b62",
"score": "0.48529696",
"text": "def desired_type; end",
"title": ""
},
{
"docid": "eacbc71fa6748dea3d4c503102a91681",
"score": "0.48490137",
"text": "def sheet_pr; end",
"title": ""
},
{
"docid": "60a86ef09169e914a8b1042fd9a5a298",
"score": "0.4842389",
"text": "def valid?\n return false if !super\n slide_show_type_validator = EnumAttributeValidator.new('String', ['BrowsedAtKiosk', 'BrowsedByIndividual', 'PresentedBySpeaker'])\n return false unless slide_show_type_validator.valid?(@slide_show_type)\n true\n end",
"title": ""
},
{
"docid": "e22c8112372000fc6803adbfd48c8c4a",
"score": "0.48336327",
"text": "def valid_visibility?(value)\n # If template doesn't specify a visiblity (i.e. is \"varies\"), then any visibility is valid\n return true if visibility.blank?\n\n # Validate that passed in value matches visibility requirement exactly\n visibility == value\n end",
"title": ""
},
{
"docid": "e3f93515255de433b368d5f9ec67bd1b",
"score": "0.4830142",
"text": "def foa_valid_params_type(value, type)\n value.is_a?(type)\n end",
"title": ""
},
{
"docid": "ecb5e056a40c98747d641fd098b824d3",
"score": "0.4826443",
"text": "def ensure_proper_type; end",
"title": ""
},
{
"docid": "b81929896c0a5334f6c928a7703f23a6",
"score": "0.48260704",
"text": "def Lines=(v) Axlsx::validate_int",
"title": ""
},
{
"docid": "91522669ae1eb8cd9e5d0b008ec87981",
"score": "0.48232397",
"text": "def validate_enumerated_type\n unless @hash_data.key? 'range'\n raise Exceptions::InvalidColumnException, 'The \\'enumerate\\' type needs'\\\n ' \\'range\\' parameter.'\n end\n end",
"title": ""
},
{
"docid": "e9a0a88396277f50ba9deaeed8fcdb01",
"score": "0.48150313",
"text": "def allowed_types; end",
"title": ""
},
{
"docid": "e9a0a88396277f50ba9deaeed8fcdb01",
"score": "0.48150313",
"text": "def allowed_types; end",
"title": ""
},
{
"docid": "dd98d83dbe0a501ccef99bd53829f92e",
"score": "0.4809097",
"text": "def sheet_params\n params.fetch(:sheet, {}).permit(:url, :name, :column_row)\n end",
"title": ""
},
{
"docid": "ac64dfc5934f54a99c90c551fdd21201",
"score": "0.4804873",
"text": "def sheets?\n @gapi.source_format == \"GOOGLE_SHEETS\"\n end",
"title": ""
},
{
"docid": "672344325c8de81ce45d264890f636e9",
"score": "0.4791494",
"text": "def sheet?\n record.fields('007').find do |field|\n field.value.byteslice(0) == 'd' &&\n %w[g j k s].include?(field.value.byteslice(1))\n end\n end",
"title": ""
},
{
"docid": "672344325c8de81ce45d264890f636e9",
"score": "0.4791494",
"text": "def sheet?\n record.fields('007').find do |field|\n field.value.byteslice(0) == 'd' &&\n %w[g j k s].include?(field.value.byteslice(1))\n end\n end",
"title": ""
},
{
"docid": "a251175940ab5ccc88ccc9c04cdb8e40",
"score": "0.47909936",
"text": "def are_sheet_colums_valid?(sheet)\n \n (0..23).each do |i|\n \n correct_name = case\n when i == 0 then \"No\"\n when i == 1 then \"Type\"\n when i == 2 then \"DILocation\"\n when i == 3 then \"Topic\"\n when i == 4 then \"HeaderInstruction\"\n when i == 5 then \"Passage\"\n when i == 6 then \"QueText\"\n when i == 7 then \"QueImage\"\n when i == 8 then \"SolText\"\n when i == 9 then \"SolImage\"\n when i == 10 then \"Quantity-A\"\n when i == 11 then \"Quantity-B\" \n when i == 12 then \"Options\"\n when i == 13 then \"Correct\"\n when i == 14 then \"Option1\"\n when i == 15 then \"Option2\"\n when i == 16 then \"Option3\"\n when i == 17 then \"Option4\"\n when i == 18 then \"Option5\"\n when i == 19 then \"Option6\"\n when i == 20 then \"Option7\"\n when i == 21 then \"Option8\"\n when i == 22 then \"Option9\"\n when i == 23 then \"Option10\" \n end\n \n if sheet.row(0).at(i).to_s != correct_name\n @error_messages << \"Invalid Excel\" << (\"Sheet => #{sheet.name},Incorrect Column # #{(i+1).to_s} => #{sheet.row(0).at(i).to_s},Required Column => #{correct_name}\")\n return false\n end \n\n end\n\n return true\n \n end",
"title": ""
},
{
"docid": "369ce299d5fe09281a6de90da6ea3164",
"score": "0.4783081",
"text": "def timesheet_field_style\n display = \"\"\n if params[:report].nil? || ![\"3\", \"2\"].include?(params[:report][:type])\n display = \"none\"\n end\n\n return \"display: #{ display }\"\n end",
"title": ""
},
{
"docid": "0d07a564dff791adb19ed1812310c646",
"score": "0.4780501",
"text": "def ScaleCrop=(v) Axlsx::validate_boolean",
"title": ""
},
{
"docid": "79224dbb7b3fe65f91d65ec6d4311717",
"score": "0.47522518",
"text": "def set_export_file_type_excel\r\n unless menu_is_excel_2003\r\n try(3){@browser.button(:title, 'Select an action').click}\r\n try(3){@browser.link(:id, 'ui-id-4').click}\r\n end\r\n end",
"title": ""
},
{
"docid": "9877598e64c841d8f3e05b16f23446d7",
"score": "0.4748338",
"text": "def check_w000t_type_params\n return unless params[:type]\n unless TypableUrl::TYPES.include? params[:type].to_sym\n return redirect_to w000ts_me_path, flash: { alert: 'Invalid filter' }\n end\n end",
"title": ""
},
{
"docid": "72c72e29f4696df4b210f03c3d44087b",
"score": "0.4744518",
"text": "def slide_show_type=(slide_show_type)\n validator = EnumAttributeValidator.new('String', ['BrowsedAtKiosk', 'BrowsedByIndividual', 'PresentedBySpeaker'])\n unless validator.valid?(slide_show_type)\n fail ArgumentError, 'invalid value for \"slide_show_type\", must be one of #{validator.allowable_values}.'\n end\n @slide_show_type = slide_show_type\n end",
"title": ""
},
{
"docid": "8b97718ec4429b9efccd70dafa7448ad",
"score": "0.47442293",
"text": "def valid_type?(type)\n type.to_s.deconstantize == Madmin::Field.to_s\n end",
"title": ""
},
{
"docid": "0b95b9df6e1b3c6ddd110eecbdb40097",
"score": "0.47390297",
"text": "def run(sheet)\n validate(sheet)\n end",
"title": ""
},
{
"docid": "337f39da30b3cdc1cbbcc209bca9b562",
"score": "0.4738988",
"text": "def validation_class(answer_sheet = nil, page = nil)\n if required?(answer_sheet, page)\n ' required '\n else\n ''\n end\n end",
"title": ""
},
{
"docid": "2c7521cd7b829ca83a6851eb17e9027b",
"score": "0.47342038",
"text": "def validate_type_in_slide\n errors.add(:media_element_id, :is_not_compatible_with_slide) if @media_element && @slide && @slide.accepted_media_element_sti_type != @media_element.sti_type\n end",
"title": ""
},
{
"docid": "2dd87ca69686dcaaa6e37e61a4c5f880",
"score": "0.4727996",
"text": "def cell_type_from_value(v); end",
"title": ""
},
{
"docid": "654576a1970a7285d0336ce0641ac4ae",
"score": "0.47185484",
"text": "def validateType\n unless Agent_Types.include?(@type)\n raise \"value #{@type} is not a valid agent type value\"\n end\n end",
"title": ""
},
{
"docid": "f23a34a0abaab516158038049d3a1fbf",
"score": "0.47158438",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['current page url', 'customers location', 'customers browsing time', 'number of viewed pages', 'referring website address', 'any page from session'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "7063c0729003125904b123f1afb4047a",
"score": "0.47083938",
"text": "def valid?\n return false if !super\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Title', 'Text', 'TwoColumnText', 'Table', 'TextAndChart', 'ChartAndText', 'Diagram', 'Chart', 'TextAndClipArt', 'ClipArtAndText', 'TitleOnly', 'Blank', 'TextAndObject', 'ObjectAndText', 'Object', 'TitleAndObject', 'TextAndMedia', 'MediaAndText', 'ObjectOverText', 'TextOverObject', 'TextAndTwoObjects', 'TwoObjectsAndText', 'TwoObjectsOverText', 'FourObjects', 'VerticalText', 'ClipArtAndVerticalText', 'VerticalTitleAndText', 'VerticalTitleAndTextOverChart', 'TwoObjects', 'ObjectAndTwoObject', 'TwoObjectsAndObject', 'SectionHeader', 'TwoTextAndTwoObjects', 'TitleObjectAndCaption', 'PictureAndCaption', 'Custom'])\n return false unless type_validator.valid?(@type)\n true\n end",
"title": ""
},
{
"docid": "3f2d929b65e1bfa69788ebfc12471d6c",
"score": "0.4702569",
"text": "def show\n respond_to do |format|\n if @spreadsheet\n @pages = @spreadsheet.pages\n format.html { render :show }\n format.json { render :show, location: @spreadsheet }\n else\n format.html { redirect_to user_spreadsheets_url }\n format.json { render :index }\n end\n end\n end",
"title": ""
},
{
"docid": "77587d91ed924db2a4a13c92b9128027",
"score": "0.47015637",
"text": "def Application=(v) Axlsx::validate_string",
"title": ""
},
{
"docid": "1a4518322b949bd22d33426600e34b28",
"score": "0.4691339",
"text": "def valid_type?(value)\n return value.is_a?(native_type) if respond_to?(:native_type)\n\n raise AttributorException, \"#{self} must implement #valid_type? or #native_type\"\n end",
"title": ""
},
{
"docid": "d821b80e0457cbc2e22d7dd88097f70d",
"score": "0.46863118",
"text": "def select_type\n if params[:type] == \"2\"\n render :partial => '/components/import_type/everything', :formats => [:html]\n elsif params[:type] == \"3\"\n render :partial => '/components/import_type/source', :formats => [:html]\n else\n render :partial => '/components/import_type/top_headline', :formats => [:html]\n end\n end",
"title": ""
},
{
"docid": "918d3ae4874a623b39e215f197e4f16c",
"score": "0.46859822",
"text": "def coerce(value)\n return SpreadSheet.new([value]) if value.is_a?(Numeric)\n return SpreadSheet.new(value) if value.is_a?(Array)\n end",
"title": ""
},
{
"docid": "aef9e997d5271237902524cb60864fcf",
"score": "0.46838263",
"text": "def sheet_index\n {tissue: 0,\n biofluids: 1,\n cell: 2}\n end",
"title": ""
},
{
"docid": "2b75fec669c3e5927517569db1f493cd",
"score": "0.4681205",
"text": "def valid_type?(value)\n return value.is_a?(native_type) if respond_to?(:native_type)\n\n raise AttributorException.new(\"#{self} must implement #valid_type? or #native_type\")\n end",
"title": ""
},
{
"docid": "129f4719ee2a5214d93f13a793e30144",
"score": "0.46808717",
"text": "def check_type(type, allowed_values)\n if allowed_values.empty?\n raise SwaggerInvalidException.new(\"Unknown type [#{type}], no available type\")\n elsif !allowed_values.include?(type)\n raise SwaggerInvalidException.new(\"Unknown type [#{type}]#{list_or_none(allowed_values, 'types')}\")\n end\n end",
"title": ""
},
{
"docid": "c918cfe87a95fb7c555fb1b4ea2784cc",
"score": "0.4678475",
"text": "def validation_class(answer_sheet, page = nil)\n validation = ''\n validation += ' required' if self.required?(answer_sheet, page)\n # validate-number, etc.\n validate_style = ['number', 'currency-dollar', 'email', 'url', 'phone'].find {|v| v == self.style }\n if validate_style\n validation += ' validate-' + validate_style\n end\n validation\n end",
"title": ""
},
{
"docid": "234adfb9339fa2041d84dd4338c2b117",
"score": "0.46701416",
"text": "def validate_parameter_value_by_type\n has_validation_error = false\n case self.parameter_type\n when 'String'\n unless self.parameter_value.start_with?('\"') && self.parameter_value.end_with?('\"')\n has_validation_error = true\n end\n when 'Int'\n unless self.parameter_value.is_a?(Integer)\n has_validation_error = true\n end\n when 'Float'\n unless self.parameter_value.is_a?(Float)\n has_validation_error = true\n end\n when 'File'\n unless self.parameter_value.start_with?('\"gs://')\n has_validation_error = true\n end\n else\n true # complex data types are too complicated to validate, so punt\n end\n if has_validation_error\n errors.add(:parameter_value, \"is not a valid #{self.parameter_type} value: #{self.parameter_value}.\")\n end\n end",
"title": ""
},
{
"docid": "c60bb9a8a9967d51b0a3ea3e8d484fd8",
"score": "0.46699545",
"text": "def view_type\n return @view_type\n end",
"title": ""
},
{
"docid": "14444b7955ff493e481c89c850566de9",
"score": "0.46690926",
"text": "def page_type\n case \n when (!self.url.nil? and !self.url.blank?) then\n ACTION_PAGE_TYPE\n when !self.template.index(\"doc_page\").nil? then \n DOC_PAGE_TYPE\n when !self.template.index(\"blog\").nil? then\n BLOG_PAGE_TYPE\n when !self.template.index(\"home\").nil? then\n DOC_PAGE_TYPE\n when !self.template.index(\"gallery\").nil? then\n GALLERY_PAGE_TYPE\n when !self.template.index(\"video_room\").nil? then\n DOC_PAGE_TYPE\n when !self.template.index(\"about\").nil? then\n DOC_PAGE_TYPE\n when !self.template.index(\"references\").nil? then\n GALLERY_PAGE_TYPE\n else\n BLOG_PAGE_TYPE\n end\n end",
"title": ""
},
{
"docid": "602f8ac854b2a536ca5e9e4cae0c354c",
"score": "0.4668579",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes', 'Treemap', 'Sunburst', 'Histogram', 'ParetoLine', 'BoxAndWhisker', 'Waterfall', 'Funnel', 'Map'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "027fd2db8279068d8b898211c4a7a997",
"score": "0.46654108",
"text": "def validate_content_type!(response)\n return unless media_type\n\n response_content_type = response.content_type\n expected_content_type = Praxis::MediaTypeIdentifier.load(media_type.identifier)\n return if expected_content_type.match(response_content_type)\n\n raise Exceptions::Validation, \"Bad Content-Type header. #{response_content_type}\" \\\n \" is incompatible with #{expected_content_type} as described in response: #{name}\"\n end",
"title": ""
},
{
"docid": "5581d9d4118f4ae58e0d4cb486e9f51e",
"score": "0.46590382",
"text": "def sheet_params\n params.require(:sheet).permit(:url, :title, :passphrase, :onda_id, :tweet_override)\n end",
"title": ""
},
{
"docid": "c8f42804996b21caf51919b7e67999e5",
"score": "0.46573395",
"text": "def select_type\n type = ExpType.find(:first, :select=>'description', :conditions=>{:id=>params[:expense][:exp_type_id]})\n if type != nil && type == 'Anual bill'\n render :partial => 'date_range', :layout => false\n end\n end",
"title": ""
},
{
"docid": "808265854221affa49c9cab14e60aab7",
"score": "0.46571007",
"text": "def create\n @question_sheet = QuestionSheet.new_with_page\n \n respond_to do |format|\n if @question_sheet.save\n format.html { redirect_to question_sheet_path(@question_sheet) }\n format.xml { head :created, :location => question_sheet_path(@question_sheet) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @question_sheet.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "f0707e71a7382c846e7b5afb178767ed",
"score": "0.4654312",
"text": "def show\n respond_to do |format|\n if @spreadsheet && @page\n format.html { render :show }\n format.json { render :show, location: @page }\n elsif !@spreadsheet\n format.html { redirect_to user_spreadsheets_url }\n format.json { render 'spreadsheets/index' }\n else\n format.html { redirect_to [@spreadsheet.user, @spreadsheet] }\n format.json { render :show, location: @spreadsheet }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e73b526926f74c0fbdba5ace146b78",
"score": "0.46520743",
"text": "def set_sheet(sheet)\n if @file_type == \"xls\"\n @excel_sheet = @excel_book.worksheet sheet\n elsif @file_type == \"xlsx\"\n @xlsx_sheet = @xlsx_book.worksheets[sheet].extract_data\n else\n raise RuntimeError, \"File #{@file_name} is not an xls or xlsx file, so cannot change sheet\" \n end\n end",
"title": ""
},
{
"docid": "e9469580edd81edb9a597d23c6e50dd8",
"score": "0.46428654",
"text": "def s_innapropriate_sheet_name__c4; @s_innapropriate_sheet_name__c4 ||= valuetypes_a3; end",
"title": ""
},
{
"docid": "a6ff90af40a62f5c0b8ae6773fbc8d15",
"score": "0.46409532",
"text": "def view_type\n view_discipline.name\n end",
"title": ""
},
{
"docid": "779469fc9c19a82268ac7de6f39ba9b7",
"score": "0.46405977",
"text": "def size_type=(size_type)\n validator = EnumAttributeValidator.new('String', ['OnScreen', 'LetterPaper', 'A4Paper', 'Slide35mm', 'Overhead', 'Banner', 'Custom', 'Ledger', 'A3Paper', 'B4IsoPaper', 'B5IsoPaper', 'B4JisPaper', 'B5JisPaper', 'HagakiCard', 'OnScreen16x9', 'OnScreen16x10', 'Widescreen'])\n unless validator.valid?(size_type)\n fail ArgumentError, 'invalid value for \"size_type\", must be one of #{validator.allowable_values}.'\n end\n @size_type = size_type\n end",
"title": ""
},
{
"docid": "7b9d06f736416dd77531ffd44ea86106",
"score": "0.46379858",
"text": "def value_valid_for_option?(option, value)\n case option\n \n when :html_width then value.is_a? Fixnum\n when :page_dimension then PAGE_DIMENSIONS.include? value\n when :page_orientation then PAGE_ORIENTATIONS.include? value \n when :inset_unit then %(mm pt).include? value\n when :inset_left then value.is_a? Fixnum\n when :inset_top then value.is_a? Fixnum\n when :inset_right then value.is_a? Fixnum\n when :inset_bottom then value.is_a? Fixnum\n when :bookmark_elements then BOOKMARK_ELEMENTS.include? value\n when :allow_annotate then [true, false].include? value \n when :allow_copy then [true, false].include? value \n when :allow_modify then [true, false].include? value \n when :allow_print then [true, false].include? value \n when :debug then [true, false].include? value \n end\n end",
"title": ""
},
{
"docid": "523c4f5cce64ec1166cee441a4c427bb",
"score": "0.46361873",
"text": "def document_spreadsheet_or_powerpoint?(new_file)\n if new_file\n %w( application/mspowerpoint\n application/powerpoint\n application/vnd.ms-powerpoint\n application/x-mspowerpoint\n application/vnd.openxmlformats-officedocument.presentationml.presentation\n application/excel\n application/vnd.ms-excel\n application/x-excel\n application/x-msexcel\n application/vnd.openxmlformats-officedocument.spreadsheetml.sheet ).include? new_file.content_type\n end\n end",
"title": ""
}
] |
6cd5f98763bab4c774fb4acb2380ef21 | Gets the lists of status codes that when matched, traffic will be sent to the "fallback_host". An exception will be thrown if fallback status codes are set when "fallback_host" has not been specified. | [
{
"docid": "fda6545de7647450d860d9fb98f71507",
"score": "0.62355983",
"text": "def fallback_status_code\n super\n end",
"title": ""
}
] | [
{
"docid": "0e0b510d75d83c0452399e10d9b1e498",
"score": "0.6435455",
"text": "def add_fallback_status_code(opts)\n opts = check_params(opts,[:status_codes])\n super(opts)\n end",
"title": ""
},
{
"docid": "13eb1d5e0df318aa8441cd11a06c7623",
"score": "0.62948036",
"text": "def set_default_fallback_status_code\n super\n end",
"title": ""
},
{
"docid": "5d21d37c6aa469ab1d43294de379bfc0",
"score": "0.6066038",
"text": "def remove_fallback_status_code(opts)\n opts = check_params(opts,[:status_codes])\n super(opts)\n end",
"title": ""
},
{
"docid": "84b18e5015cce3c8a5a79d59b9527565",
"score": "0.5896919",
"text": "def status\n if hostname\n { hostname => @status[hostname] }\n else\n @status\n end\n .tap { |x| @http_status = 404 if x.values.compact.empty? }\n end",
"title": ""
},
{
"docid": "3c0f231c03e73b2182ad292a3feeb7a7",
"score": "0.55937123",
"text": "def set_statuscodes(codes)\n @status_codes = codes.split(',')\n end",
"title": ""
},
{
"docid": "d9e7c55418707610180983b10bc47e15",
"score": "0.55832213",
"text": "def fallback_list\n if @fallback_to\n [:mobile, @fallback_to.to_sym]\n else\n [:mobile]\n end\n end",
"title": ""
},
{
"docid": "ed7f6389ccd0aa974b2c7d73c65e5c5b",
"score": "0.55817294",
"text": "def fallbacks\n @fallbacks ||= {}\n end",
"title": ""
},
{
"docid": "1e17fab27bb4fdb5d1982061e51f7c8d",
"score": "0.55737615",
"text": "def http_status(code)\n [code, Rack::Utils::HTTP_STATUS_CODES[code]].join(' ')\n end",
"title": ""
},
{
"docid": "1e17fab27bb4fdb5d1982061e51f7c8d",
"score": "0.55737615",
"text": "def http_status(code)\n [code, Rack::Utils::HTTP_STATUS_CODES[code]].join(' ')\n end",
"title": ""
},
{
"docid": "1e17fab27bb4fdb5d1982061e51f7c8d",
"score": "0.55737615",
"text": "def http_status(code)\n [code, Rack::Utils::HTTP_STATUS_CODES[code]].join(' ')\n end",
"title": ""
},
{
"docid": "2f19b1f576c7a1c2f611459f6dd5f5fb",
"score": "0.5557263",
"text": "def fallback_locale_codes\n fallback_codes = I18n.fallbacks[self.locale.code].map(&:to_sym).reject {|l| :root == l || self.locale.code.to_sym == l}.compact.map(&:to_s)\n fallback_codes << Locale.default_locale.code if Locale.default_locale\n fallback_codes = fallback_codes.uniq.compact\n end",
"title": ""
},
{
"docid": "4251a7776765e0a873791b00259d0147",
"score": "0.5528154",
"text": "def http_status(code)\n [code, Rack::Utils::HTTP_STATUS_CODES[code]].join(' ')\n end",
"title": ""
},
{
"docid": "fdc0f1eaf9797b3d9ffc6fc610b3788d",
"score": "0.543572",
"text": "def http_codes_to_retry=(codes)\n @http_codes_to_retry = Array(codes).map(&:to_int)\n end",
"title": ""
},
{
"docid": "1b4c681db74977e4b1b0815e9c734ed1",
"score": "0.54201144",
"text": "def guess_status(response)\n result = {}\n # response status code returned by php-simple-proxy and php-json-proxy\n if response =~ /\"status\":{\"http_code\":([\\d]+)}/\n result['code'] = $1\n result['message'] = ''\n # generic page titles containing HTTP status\n elsif response =~ />301 Moved</ || response =~ />Document Moved</ || response =~ />Object Moved</\n result['code'] = 301\n result['message'] = 'Document Moved'\n elsif response =~ />302 Found</ || response =~ />302 Moved Temporarily</\n result['code'] = 302\n result['message'] = 'Found'\n elsif response =~ />400 Bad Request</\n result['code'] = 400\n result['message'] = 'Bad Request'\n elsif response =~ />401 Unauthorized</\n result['code'] = 401\n result['message'] = 'Unauthorized'\n elsif response =~ />403 Forbidden</\n result['code'] = 403\n result['message'] = 'Forbidden'\n elsif response =~ />404 Not Found</\n result['code'] = 404\n result['message'] = 'Not Found'\n elsif response =~ />The page is not found</\n result['code'] = 404\n result['message'] = 'Not Found'\n elsif response =~ />413 Request Entity Too Large</\n result['code'] = 413\n result['message'] = 'Request Entity Too Large'\n elsif response =~ />500 Internal Server Error</\n result['code'] = 500\n result['message'] = 'Internal Server Error'\n elsif response =~ />503 Service Unavailable</\n result['code'] = 503\n result['message'] = 'Service Unavailable'\n # getaddrinfo() errors\n elsif response =~ /getaddrinfo: /\n if response =~ /getaddrinfo: nodename nor servname provided/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /getaddrinfo: Name or service not known/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n end\n # getnameinfo() errors\n elsif response =~ /getnameinfo failed: /\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # PHP 'failed to open stream' errors\n elsif response =~ /failed to open stream: /\n # HTTP request failed! HTTP/[version] [code] [message]\n if response =~ %r{failed to open stream: HTTP request failed! HTTP\\/(0\\.9|1\\.0|1\\.1) ([\\d]+) }\n result['code'] = $2.to_s\n result['message'] = ''\n if response =~ %r{failed to open stream: HTTP request failed! HTTP/(0\\.9|1\\.0|1\\.1) [\\d]+ ([a-zA-Z ]+)}\n result['message'] = $2.to_s\n end\n # No route to host\n elsif response =~ /failed to open stream: No route to host in/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection refused\n elsif response =~ /failed to open stream: Connection refused in/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection timed out\n elsif response =~ /failed to open stream: Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n # Success - This likely indicates an SSL/TLS connection failure\n elsif response =~ /failed to open stream: Success in/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n end\n # Java 'java.net' exceptions\n elsif response =~ /java\\.net\\.[^\\s]*Exception: /\n if response =~ /java\\.net\\.ConnectException: No route to host/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.ConnectException: Connection refused/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.ConnectException: Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n elsif response =~ /java\\.net\\.UnknownHostException: Invalid hostname/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.SocketException: Network is unreachable/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.SocketException: Connection reset/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.SocketTimeoutException: Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # C errno\n elsif response =~ /\\[Errno -?[\\d]{1,5}\\]/\n if response =~ /\\[Errno -2\\] Name or service not known/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 101\\] Network is unreachable/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 104\\] Connection reset by peer/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 110\\] Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n elsif response =~ /\\[Errno 111\\] Connection refused/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 113\\] No route to host/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 11004\\] getaddrinfo failed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10053\\] An established connection was aborted/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10054\\] An existing connection was forcibly closed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10055\\] An operation on a socket could not be performed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10060\\] A connection attempt failed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10061\\] No connection could be made/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n end\n # Python urllib errors\n elsif response =~ /HTTPError: HTTP Error \\d+/\n if response =~ /HTTPError: HTTP Error 400: Bad Request/\n result['code'] = 400\n result['message'] = 'Bad Request'\n elsif response =~ /HTTPError: HTTP Error 401: Unauthorized/\n result['code'] = 401\n result['message'] = 'Unauthorized'\n elsif response =~ /HTTPError: HTTP Error 402: Payment Required/\n result['code'] = 402\n result['message'] = 'Payment Required'\n elsif response =~ /HTTPError: HTTP Error 403: Forbidden/\n result['code'] = 403\n result['message'] = 'Forbidden'\n elsif response =~ /HTTPError: HTTP Error 404: Not Found/\n result['code'] = 404\n result['message'] = 'Not Found'\n elsif response =~ /HTTPError: HTTP Error 405: Method Not Allowed/\n result['code'] = 405\n result['message'] = 'Method Not Allowed'\n elsif response =~ /HTTPError: HTTP Error 410: Gone/\n result['code'] = 410\n result['message'] = 'Gone'\n elsif response =~ /HTTPError: HTTP Error 500: Internal Server Error/\n result['code'] = 500\n result['message'] = 'Internal Server Error'\n elsif response =~ /HTTPError: HTTP Error 502: Bad Gateway/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /HTTPError: HTTP Error 503: Service Unavailable/\n result['code'] = 503\n result['message'] = 'Service Unavailable'\n elsif response =~ /HTTPError: HTTP Error 504: Gateway Time-?out/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # Ruby exceptions\n elsif response =~ /Errno::[A-Z]+/\n # Connection refused\n if response =~ /Errno::ECONNREFUSED/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # No route to host\n elsif response =~ /Errno::EHOSTUNREACH/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection timed out\n elsif response =~ /Errno::ETIMEDOUT/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # ASP.NET System.Net.WebClient errors\n elsif response =~ /System\\.Net\\.WebClient/\n # The remote server returned an error: ([code]) [message].\n if response =~ /WebException: The remote server returned an error: \\(([\\d+])\\) /\n result['code'] = $1.to_s\n result['message'] = ''\n if response =~ /WebException: The remote server returned an error: \\(([\\d+])\\) ([a-zA-Z ]+)\\./\n result['message'] = $2.to_s\n end\n # Could not resolve hostname\n elsif response =~ /WebException: The remote name could not be resolved/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Remote server denied connection (port closed)\n elsif response =~ /WebException: Unable to connect to the remote server/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # This likely indicates a plain-text connection to a HTTPS or non-HTTP service\n elsif response =~ /WebException: The underlying connection was closed: An unexpected error occurred on a receive/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # This likely indicates a HTTPS connection to a plain-text HTTP or non-HTTP service\n elsif response =~ /WebException: The underlying connection was closed: An unexpected error occurred on a send/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # The operation has timed out\n elsif response =~ /WebException: The operation has timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # Generic error messages\n elsif response =~ /(Connection refused|No route to host|Connection timed out) - connect\\(\\d\\)/\n # Connection refused\n if response =~ /Connection refused - connect\\(\\d\\)/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # No route to host\n elsif response =~ /No route to host - connect\\(\\d\\)/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection timed out\n elsif response =~ /Connection timed out - connect\\(\\d\\)/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n end\n result\n end",
"title": ""
},
{
"docid": "0891cde24e70941495883a49f04e1695",
"score": "0.5338795",
"text": "def status_codes\n body = invoke(:get_status_codes)\n json = JSON.parse(body)\n json['statusDetails']\n end",
"title": ""
},
{
"docid": "2d5df86c7322dc4988227b2472553bdb",
"score": "0.5299905",
"text": "def map_status_code(code)\n if code.is_a?(Symbol)\n Rack::Utils::SYMBOL_TO_STATUS_CODE[code]\n else\n code\n end\n end",
"title": ""
},
{
"docid": "728c97f9815725d084626cc207379315",
"score": "0.5285256",
"text": "def fallback_response\n {}\n end",
"title": ""
},
{
"docid": "8d78d0d986df50489860bde94d810fbe",
"score": "0.52549237",
"text": "def ignores_fallbacks?\n # if we are not resolved, then somewhere in this value there's\n # a substitution that may need to look at the fallbacks.\n resolve_status == Hocon::Impl::ResolveStatus::RESOLVED\n end",
"title": ""
},
{
"docid": "8d78d0d986df50489860bde94d810fbe",
"score": "0.52549237",
"text": "def ignores_fallbacks?\n # if we are not resolved, then somewhere in this value there's\n # a substitution that may need to look at the fallbacks.\n resolve_status == Hocon::Impl::ResolveStatus::RESOLVED\n end",
"title": ""
},
{
"docid": "394046a0e0293af3f227f6c59b3e3348",
"score": "0.5213781",
"text": "def not_found_response(env)\n if head_request?(env)\n [ 404, { \"Content-Type\" => \"text/plain\", \"Content-Length\" => \"0\", \"X-Cascade\" => \"pass\" }, [] ]\n else\n [ 404, { \"Content-Type\" => \"text/plain\", \"Content-Length\" => \"9\", \"X-Cascade\" => \"pass\" }, [ \"Not found\" ] ]\n end\n end",
"title": ""
},
{
"docid": "0c5a15d5c28224ef2b675d2c2aac1199",
"score": "0.51835173",
"text": "def disabled_hosts\n hosts_array = []\n hosts_with_status.select{|host,state| state != 'Ok'}.each{|host, state| hosts_array << host}\n hosts_array\n end",
"title": ""
},
{
"docid": "624426ce65f61ebf507cf27a0f9ce04c",
"score": "0.5180673",
"text": "def fallback\n head :ok\n end",
"title": ""
},
{
"docid": "0ef1ebde80339faf3a07112d5c72bcc4",
"score": "0.51804364",
"text": "def enabled_hosts\n hosts_array = []\n hosts_with_status.select{|host,state| state == 'Ok'}.each{|host, state| hosts_array << host}\n hosts_array\n end",
"title": ""
},
{
"docid": "42f8155233aebaac91d3e8fe00b5a4f8",
"score": "0.51746845",
"text": "def host_unreachable_exceptions\n [::Faraday::Error::ConnectionFailed, ::Faraday::Error::TimeoutError]\n end",
"title": ""
},
{
"docid": "b06af4f67c3fa5d5c0b2758170cb5f9e",
"score": "0.51203084",
"text": "def status_code\n if params[:fixes]\n @fix = fixes\n @fix[:database] = env[\"action_dispatch.exception\"].class.name.starts_with? \"ActiveRecord\"\n 500\n else\n status = params[:status]\n lookup_context.exists?(\"errors/#{status}\") ? status.to_i : 500\n end\n end",
"title": ""
},
{
"docid": "9c4bf9ed5bfc3ff77780688b3dd7d56e",
"score": "0.51136905",
"text": "def available_statuses\n statuses = []\n statuses << [_(\"Open\"), \"0\"]\n statuses << [_(\"In Progress\"), \"1\"]\n statuses << [_(\"Closed\"), \"2\"]\n statuses << [_(\"Won't Fix\"), \"3\"]\n statuses << [_(\"Invalid\"), \"4\"]\n statuses << [_(\"Duplicate\"), \"5\"]\n statuses << [_(\"Archived\"), \"-2\"]\n\n return statuses\n end",
"title": ""
},
{
"docid": "84b44d679c44a11bc2bdb6c9947c204b",
"score": "0.51094866",
"text": "def response_code\n headers['Status'][0,3].to_i rescue 0\n end",
"title": ""
},
{
"docid": "efe52d8b230c8c5ffbdda55753737746",
"score": "0.50951743",
"text": "def fallbacks\n if @fallbacks.nil?\n @fallbacks = []\n @data.xpath('/verbs/meta/fallbacks/fallback').each do |fallback|\n @fallbacks << {:regex => fallback['regex'], :ref => fallback['ref']}\n end\n end\n \n @fallbacks\n end",
"title": ""
},
{
"docid": "dafbddaf46b9e788ac34021612566626",
"score": "0.508558",
"text": "def normal\n status.inject({ }) do |hash,elem|\n hash[elem.first] = elem.last.try(:[], 'hoststatus')\n hash\n end\n end",
"title": ""
},
{
"docid": "3297f847dfac4e47cf1ee67c84e008f8",
"score": "0.5083881",
"text": "def host_unreachable_exceptions\n [\n ::Manticore::Timeout,\n ::Manticore::SocketException,\n ::Manticore::ClientProtocolException,\n ::Manticore::ResolutionFailure\n ]\n end",
"title": ""
},
{
"docid": "2e14953495e25a75d3e770902b359a88",
"score": "0.5062904",
"text": "def sub_status_codes\n status_codes[:sub] || []\n end",
"title": ""
},
{
"docid": "e9ec0f6a6f01bbbd548b8e8b6f6a2b31",
"score": "0.5054468",
"text": "def verify_via_status_codes(uri, request_uri_builder)\n method = nil\n vulnerable_indicator = nil\n\n # OPTIONS method has precedence \n valid_option_codes = [\"*~1*\", \"*~1**\"].map {|p| request_uri_builder.call(uri, p, :options).code}\n invalid_option_codes = [\"1NTR1Z~9*\", \"1111*****33222\"].map {|p| request_uri_builder.call(uri, p, :options).code} # two different OPTIONS requests to confirm validity\n\n if valid_option_codes.include? \"0\" # if 0 is found in the status code we want to skip it as some WAF's simply drop the request causing typhoeus to timeout thus returning a status code of 0\n _log_error \"Unable to retrieve responses; most likely WAF is dropping the request. Killing scan.\"\n return\n end\n\n unless verify_response_dupes(valid_option_codes, invalid_option_codes) == false \n method = :options \n vulnerable_indicator = {\"status_code\" => valid_option_codes.uniq.first}\n else # OPTIONS did not work - send GET requests as last resort\n valid_get_codes = [\"*~1*\", \"*~1**\"].map {|p| request_uri_builder.call(uri, p, :get).code}\n invalid_get_codes = [\"1NTR1Z~9*\", \"Z1RTN1~9*\"].map {|p| request_uri_builder.call(uri, p, :get).code}\n\n unless verify_response_dupes(valid_get_codes, invalid_get_codes) == false\n method = :get\n vulnerable_indicator = {\"status_code\" => valid_get_codes.uniq.first}\n end\n end\n return method, vulnerable_indicator\n end",
"title": ""
},
{
"docid": "8e3276af0cb2ddbbd923d71685121500",
"score": "0.50465107",
"text": "def message\n httpReason = HTTPStatus::KnownStatuses[@reason_code]\n return httpReason ? httpReason : super\n end",
"title": ""
},
{
"docid": "10236e6b723973d84ee7a179e04e3f90",
"score": "0.5030638",
"text": "def offline_statuses\n [Pod.statuses[:dns_failed],\n Pod.statuses[:net_failed],\n Pod.statuses[:ssl_failed],\n Pod.statuses[:http_failed],\n Pod.statuses[:unknown_error]]\n end",
"title": ""
},
{
"docid": "acc301ca30b638d5c9f334a611e26206",
"score": "0.5005258",
"text": "def symbolize_http_status(http_status)\n h = Rack::Utils::HTTP_STATUS_CODES\n (h[http_status] || h[500]).downcase.gsub(/\\s|-/, '_').to_sym\n end",
"title": ""
},
{
"docid": "7a4d5f5a6ce6d93da900ba4184bcc5f1",
"score": "0.5002188",
"text": "def failing_statuses\n required_statuses.select(&:failure?)\n end",
"title": ""
},
{
"docid": "bdbb1e6b88a4d0f18dfb56f3eda81a70",
"score": "0.49960226",
"text": "def failed_hosts\n @failed_hosts ||= []\n end",
"title": ""
},
{
"docid": "5ed08b6416cad45c614c46f4b8b0a117",
"score": "0.49829444",
"text": "def fetch_status(status_code = nil)\n error_array = [400, 401, 422]\n if status_code.present?\n status_code\n elsif error_array.include?(@code)\n @code\n else\n :ok\n end\n end",
"title": ""
},
{
"docid": "dd96250a74525f80088522e3868ecb65",
"score": "0.49799207",
"text": "def fallbacks(locale = self.locale)\n fallbacks? ? I18n.fallbacks[locale] : [locale.to_sym]\n end",
"title": ""
},
{
"docid": "269b729a3ec901a9b9a0b0f8797fda25",
"score": "0.49662602",
"text": "def translate_error_code(status, response)\n if status / 100 == 4 || status / 100 == 5\n [200, [%Q|{\"errorCode\":#{status}}|]]\n else\n [status, response]\n end\n end",
"title": ""
},
{
"docid": "79dc9c071b8904eb9f313ea995b1cf29",
"score": "0.4929242",
"text": "def status_code\n STATUS_CODE\n end",
"title": ""
},
{
"docid": "cc3c6e48439d46b7019de464cbde8889",
"score": "0.4905754",
"text": "def status_handler_for( status_code )\n\t\tself.log.debug \"[:errors] Looking for a status handler for %d responses\" % [ status_code ]\n\t\thandlers = self.class.status_handlers\n\t\tranges = handlers.keys\n\n\t\tranges.each do |range|\n\t\t\treturn handlers[ range ] if range.include?( status_code )\n\t\tend\n\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "e5475aafcf2fc5af09b1bb8cfdae3eb9",
"score": "0.49057475",
"text": "def not_available_statuses\n (self.class.available_statuses - available_statuses) + [STATUS_RESULT_ANNOUNCED]\n end",
"title": ""
},
{
"docid": "d7369218b411dbc0b3e9abd33952ae49",
"score": "0.4902123",
"text": "def get_status_code\n get_status_code_using(:code)\n end",
"title": ""
},
{
"docid": "d841d6963a1ae887b1230103dfa1ee06",
"score": "0.48833078",
"text": "def status_code\n raise \"Override #status_code\"\n end",
"title": ""
},
{
"docid": "053009da22db6f841329d115012f3118",
"score": "0.48773235",
"text": "def find_http_status_code(actual)\n if @setup.http_status_method.present?\n actual.send(@setup.http_status_method)\n else\n actual\n end\n end",
"title": ""
},
{
"docid": "bfbdc8af2b2634a1f939290fc667ed51",
"score": "0.48761526",
"text": "def not_found_response\n [ 404, { \"Content-Type\" => \"text/plain\", \"Content-Length\" => \"9\", \"X-Cascade\" => \"pass\" }, [ \"Not found\" ] ]\n end",
"title": ""
},
{
"docid": "bfbdc8af2b2634a1f939290fc667ed51",
"score": "0.48761526",
"text": "def not_found_response\n [ 404, { \"Content-Type\" => \"text/plain\", \"Content-Length\" => \"9\", \"X-Cascade\" => \"pass\" }, [ \"Not found\" ] ]\n end",
"title": ""
},
{
"docid": "33b66106d3866bd6fbfeda7b074be1f8",
"score": "0.487595",
"text": "def status\n return :unknown unless has_domain_and_server?\n return @status unless @status.blank?\n [ :registered, :free, :error ].each do |status|\n #return status if Regexp.new(regexes[status].source, 5).match(res)\n return(@status = status) if regexes[status].match_with_inversion(whois_output)\n end\n return @status = :unknown\n end",
"title": ""
},
{
"docid": "108e80e34798e28b72cf8309bd730af8",
"score": "0.48735875",
"text": "def restclient_4xx_errors\n RestClient::Exceptions::EXCEPTIONS_MAP.select { |code, exception|\n (400..499).include? code\n }.values\n end",
"title": ""
},
{
"docid": "c17cbf48444f081020921132aad11142",
"score": "0.4869084",
"text": "def status\n Rack::Utils::SYMBOL_TO_STATUS_CODE[@status]\n end",
"title": ""
},
{
"docid": "4de4fb6442be8ae4bd526b8c1530610a",
"score": "0.4867539",
"text": "def status_not_acceptable\n respond_to do |format|\n format.any { head :not_acceptable }\n end\n end",
"title": ""
},
{
"docid": "4de4fb6442be8ae4bd526b8c1530610a",
"score": "0.4867539",
"text": "def status_not_acceptable\n respond_to do |format|\n format.any { head :not_acceptable }\n end\n end",
"title": ""
},
{
"docid": "4de4fb6442be8ae4bd526b8c1530610a",
"score": "0.4867539",
"text": "def status_not_acceptable\n respond_to do |format|\n format.any { head :not_acceptable }\n end\n end",
"title": ""
},
{
"docid": "76407d3752e086dafd684fb674ae9cc9",
"score": "0.48445454",
"text": "def status_code\n fail \"Override #status_code\"\n end",
"title": ""
},
{
"docid": "d91b5251aa03544dbea9c7c0a0ed85f4",
"score": "0.48439014",
"text": "def downgrade?(code)\n return unless @api[:fallback]\n\n code == 404 || code == 415\n end",
"title": ""
},
{
"docid": "f94d349043328ec98f8acc0e095215c4",
"score": "0.48280245",
"text": "def list_deployment_statuses(deployment_url, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "323b4515bb31b75d9b33ec1caa6c66b3",
"score": "0.4803377",
"text": "def process_status(mongrel_config = CONFIG_FILE)\n mongrel_ports = MongrelPortManager.new.mongrel_ports(mongrel_config)\n return [] if mongrel_ports.empty? || mongrel_ports.nil?\n response_summary = Hash.new\n mongrel_ports.each do |port|\n response = self.http_response(\"http://localhost:#{port}/\")\n response_summary[port] = self.valid_http_response?(response)\n end\n response_summary\n end",
"title": ""
},
{
"docid": "3b1f45f9f4fb70e9114205fa53a8669c",
"score": "0.48019654",
"text": "def check_status_code(retry_data); end",
"title": ""
},
{
"docid": "2796f102e37431a4625ea844540e53c3",
"score": "0.47978264",
"text": "def code\n @status_code == 200 ? 202 : @status_code\n end",
"title": ""
},
{
"docid": "979b8c2bd77dc42693ba9a6a03001299",
"score": "0.47968227",
"text": "def fallbacks; end",
"title": ""
},
{
"docid": "979b8c2bd77dc42693ba9a6a03001299",
"score": "0.47968227",
"text": "def fallbacks; end",
"title": ""
},
{
"docid": "50e84ec5a1c2ef088228c35113f68654",
"score": "0.47909752",
"text": "def status_code\n '202'\n end",
"title": ""
},
{
"docid": "192b8ea9e4f58cb9eec2a72fa4ff32b1",
"score": "0.4776218",
"text": "def status_code\n params[:code] || 500\n end",
"title": ""
},
{
"docid": "192b8ea9e4f58cb9eec2a72fa4ff32b1",
"score": "0.4776218",
"text": "def status_code\n params[:code] || 500\n end",
"title": ""
},
{
"docid": "54083898c35aa540ec5b554affa14e41",
"score": "0.47756773",
"text": "def respond_with_501\n [501, { 'Content-Type' => DEFAULT_CONTENT_TYPE }, ['Not implemented']]\n end",
"title": ""
},
{
"docid": "0da5e9fe224ab6d5ca4845501d0a933f",
"score": "0.4769669",
"text": "def status\n {\n \"local_server_address\" => local_server_address,\n \"known_servers\" => servers.keys\n }\n end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.47642076",
"text": "def status_code; end",
"title": ""
},
{
"docid": "2a62b832d8720421ddce92777c58fba7",
"score": "0.47606882",
"text": "def check( resource_list_yml )\n resources = _load_yaml( resource_list_yml )\n results = resources.inject([]) do | memo, resource_array |\n resource, attributes = resource_array\n if result = _check_status_code( resource,\n attributes['protocol'] ? attributes['protocol'] : 'http',\n attributes['code'].to_i,\n attributes['redirect'] )\n memo << result\n end\n memo\n end\n if results.size > 0\n puts \"Oops, we have a problem with these resources:\"\n puts\n results.each do | result |\n puts \"Error:\"\n puts result[0]\n puts\n puts \"For resource:\"\n puts result[1]\n puts\n puts \"--------------------\"\n puts\n end\n end\n end",
"title": ""
},
{
"docid": "7d35ee393b1606133395a4fc6fc27338",
"score": "0.47505575",
"text": "def deployment_statuses(deployment_url, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9592909077a7f8a3be74695558f3f47e",
"score": "0.47485724",
"text": "def status_check(servers)\n\n\tstatuses = Array.new\n\tservers.each do |server|\n\t\tif server[:method] == 'http'\n\t\t\turi = URI.parse(server[:url])\n http = Net::HTTP.new(uri.host, uri.port)\n \n\t\t\tif uri.scheme == \"https\"\n\t\t\t\thttp.use_ssl=true\n\t\t\t\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n begin\n\t\t\trequest = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n\t\t \n\t\t\tif response.code == \"200\"\n\t\t\t \tresult = 1\n\t\t\t else\n\t\t\t \tresult = 0\n\t\t\t end\n\t\t\trescue\n\t\t\t\tprint $!\n\t\t\t\tresult = 0\n\t\t\tend\n\t\telsif server[:method] == 'ping'\n\t\t\tping_count = 10\n\t\t\tresult = `ping -q -c #{ping_count} #{server[:url]}`\n\t\t\tif ($?.exitstatus == 0)\n\t\t\t\tresult = 1\n\t\t\telse\n\t\t\t\tresult = 0\n\t\t\tend\n\t\tend\n\n\t\tif result == 1\n\t\t\tarrow = \"icon-ok-sign\"\n\t\t\tcolor = \"green\"\n\t\telse\n\t\t\tarrow = \"icon-warning-sign\"\n\t\t\tcolor = \"red\"\n\t\tend\n \n statuses.push({label: server[:name], value: result, arrow: arrow, color: color})\n puts \"statuses #{statuses}\"\n\tend\n\treturn statuses\nend",
"title": ""
},
{
"docid": "b7eb2fecfab2fd432481e322b20b69dc",
"score": "0.4742532",
"text": "def customize_response\n cbs = ExceptionHandler.config.customize_response_by_status\n # could also add support for customizations by exception type\n\n if (cbs.kind_of? Hash) && (cbs[@status].kind_of? Hash)\n customize_response_with(cbs[@status])\n end\n end",
"title": ""
},
{
"docid": "55eabee625b73b64000e2d861c99ebe2",
"score": "0.47380787",
"text": "def convert_vapp_status(status_code)\n case status_code.to_i\n when 0\n 'suspended'\n when 3\n 'paused'\n when 4\n 'running'\n when 8\n 'stopped'\n when 10\n 'mixed'\n else\n \"Unknown #{status_code}\"\n end\n end",
"title": ""
},
{
"docid": "ea3ee294b091d83e1ad4f1ee357b2993",
"score": "0.4736136",
"text": "def each_locale_fallback(&block)\n return to_enum(:each_locale_fallback) unless block_given?\n\n _each_locale_fallback(path_tuples, 0, &block)\n end",
"title": ""
},
{
"docid": "f316e8221278d5f94e5d318d60526e58",
"score": "0.47351992",
"text": "def status_code\n @status_code || 500\n end",
"title": ""
},
{
"docid": "5917c3cb7be5756270aa3ea8e9c181d4",
"score": "0.47218144",
"text": "def have_status_code_ok\n have_no_content(\"The page you were looking for doesn't exist\") && # 404\n have_no_content('The change you wanted was rejected') && # 422\n have_no_content(\"We're sorry, but something went wrong\") # 500\n end",
"title": ""
},
{
"docid": "4e07b59a430eb6e3c0fb6448db4161d1",
"score": "0.47182375",
"text": "def message\n Rack::Utils::HTTP_STATUS_CODES[@status]\n end",
"title": ""
},
{
"docid": "0784eafa54c6884cc9fc4ae604d68306",
"score": "0.4713025",
"text": "def fallback\n @response.status = fallback_response[:status] || 200\n @response.content_type fallback_response[:content_type] || 'text/html'\n @response.content = fallback_response[:body] || fallback_response[:content] || \"\"\n self.succeed\n end",
"title": ""
},
{
"docid": "7fae079876f870faa1581e7a9c5a11e9",
"score": "0.4711315",
"text": "def hosts(status = \"\") # :yields: host\n\t\tshosts = []\n\n\t\t@hosts.each do |host|\n\t\t\tif status.empty? or host.status == status\n\t\t\t\tshosts << host\n\t\t\t\tyield host if block_given?\n\t\t\tend\n\t\tend\n\n\t\tshosts\n\tend",
"title": ""
},
{
"docid": "b41ba6b156cb1077e1be703a8eec1427",
"score": "0.47053012",
"text": "def checkUrls\n urls = %w|http://invalidurl http://bigthink.com/devpatnaik/visionary-businesses-must-play-to-their-strengths http://bigthink.com/ideas/1311|\n\t\turls.each { |url|\n\t\t\trequest = head(url)\n\t\t\tif request.nil?\n\t\t\t\tstatus = \"E\"\n\t\t\telse\n\t\t\t\tstatus = request.response_header.status.to_s\n \t\t\tend\n\t\t\tputs \"#{status}\\t#{url}\"\n\t\t}\n\tend",
"title": ""
},
{
"docid": "1672c56007e8ced46dd42cb24666d1a1",
"score": "0.47023767",
"text": "def status_code\n @status_code ||= get_status_code\n end",
"title": ""
},
{
"docid": "b9db7c5373af4bc8ae71984858b9bdbb",
"score": "0.46990186",
"text": "def statuses\n statuses = results.collect {|r| r.status}\n end",
"title": ""
},
{
"docid": "cb557e1a127e5ded05c4f2c3e80048f4",
"score": "0.4688154",
"text": "def convert_vapp_status(status_code)\n case status_code.to_i\n when 0\n 'suspended'\n when 3\n 'paused'\n when 4\n 'running'\n when 8\n 'stopped'\n when 10\n 'mixed'\n else\n \"Unknown #{status_code}\"\n end\n end",
"title": ""
},
{
"docid": "cb557e1a127e5ded05c4f2c3e80048f4",
"score": "0.4688154",
"text": "def convert_vapp_status(status_code)\n case status_code.to_i\n when 0\n 'suspended'\n when 3\n 'paused'\n when 4\n 'running'\n when 8\n 'stopped'\n when 10\n 'mixed'\n else\n \"Unknown #{status_code}\"\n end\n end",
"title": ""
},
{
"docid": "b9751edda8e7229698f9b9db8744e3ec",
"score": "0.4686496",
"text": "def response_code\n status_code\n end",
"title": ""
},
{
"docid": "01ca76f55408c18fc9534b1c5585614d",
"score": "0.46830282",
"text": "def status\n self.class.get(\n \"#{@my_base_url}/\", \n :headers => @my_headers)\n # response = self.class.get(\"/\")\n # case response.code\n # when 200\n # return response\n # else\n # raise \"#{response[\"statusMessage\"]} (Status code: #{response[\"statusCode\"]})\"\n # end\n end",
"title": ""
},
{
"docid": "5b205fcca8fe25a2f6a443b078cd3b39",
"score": "0.4682355",
"text": "def set_http_status_code(response)\n if response.respond_to?(:status_code)\n @http_status_code = response.status_code if response.has_status_code?\n else\n NewRelic::Agent.logger.warn(\"Cannot extract HTTP Status Code from response #{response.class.to_s}\")\n NewRelic::Agent.record_metric(\"#{name}/#{MISSING_STATUS_CODE}\", 1)\n end\n end",
"title": ""
},
{
"docid": "f3f33c547150c4939b9851a14b19e43c",
"score": "0.4670941",
"text": "def status_not_found\n respond_to do |format|\n format.any { head :not_found }\n end\n end",
"title": ""
},
{
"docid": "f3f33c547150c4939b9851a14b19e43c",
"score": "0.4670941",
"text": "def status_not_found\n respond_to do |format|\n format.any { head :not_found }\n end\n end",
"title": ""
},
{
"docid": "f3f33c547150c4939b9851a14b19e43c",
"score": "0.4670941",
"text": "def status_not_found\n respond_to do |format|\n format.any { head :not_found }\n end\n end",
"title": ""
},
{
"docid": "c8fe70382a5d51abbd1524886caa1ca4",
"score": "0.4670614",
"text": "def statuses\n res = HealthMonitor.check(request: request)\n res.merge(env_vars)\n end",
"title": ""
},
{
"docid": "0872de03fb8e0e060a08514020b041ea",
"score": "0.4665238",
"text": "def return_codes\n return @return_codes\n end",
"title": ""
}
] |
2969baeafd59c13717ea57a9d67e8cdb | call the block with the values as parameters only if they are all present | [
{
"docid": "2441177bba4b14454e21c14aa92911a9",
"score": "0.0",
"text": "def and(*complements)\n raise(TypeError, 'a block is expected') unless block_given?\n options = [self] + complements.each_with_index.map { |o, i| Option.expected!(o, \" at index #{i}\") }\n options.all?(&:some?) ? Option.new(yield(*options.map(&:get_or_raise))) : Option.empty\n end",
"title": ""
}
] | [
{
"docid": "c7f4d17f867d5a858c96eb65b2a3bea7",
"score": "0.6808102",
"text": "def values value=nil, &block\n @values=value || block if value || block_given?\n @values\n end",
"title": ""
},
{
"docid": "b737be105fd3e61cce08722abe0dca64",
"score": "0.6566169",
"text": "def pass_block(*ags, &b)\n collected[:any_block_args] = ags.first.is_a?(Symbol) and args.first == :any\n collected[:block_args] = ags\n collected[:block_callback] = b unless b.nil?\n self\n end",
"title": ""
},
{
"docid": "5e23fe9bf582c932a551165c23d3635a",
"score": "0.64585495",
"text": "def it(*all_args, &block); end",
"title": ""
},
{
"docid": "45b1faa0fa4ba5b0acf4544cd04548d3",
"score": "0.6453016",
"text": "def param_e_given(numbers, &block)\n if block_given?\n numbers.each do |key, value|\n block.call(key, value)\n end\n end\nend",
"title": ""
},
{
"docid": "68187914eda451eda09937ee3cfa6a18",
"score": "0.6386413",
"text": "def all_pairs(&block)\n\t\t# this one is a dummy implementation\n\t\t# it doesn't work\n\t\tblock.call(a,b)\n\tend",
"title": ""
},
{
"docid": "98de83c8afe122702a4cd2d115cb8c57",
"score": "0.6336782",
"text": "def any_block\n lambda { |*args| args }\n end",
"title": ""
},
{
"docid": "730ac4bbb89c6857a2f67fb654504f08",
"score": "0.6315314",
"text": "def foo5(numbers, &block)\n if block_given?\n numbers.each do |key, value|\n block.call(key, value)\n end\n end\nend",
"title": ""
},
{
"docid": "5e6ed0660ba5809da53f890ae3a6657e",
"score": "0.6294688",
"text": "def calculate(values)\n @block.call(values)\n end",
"title": ""
},
{
"docid": "a6659c9ef2ce7dd2310b27a03225823f",
"score": "0.62938976",
"text": "def also *args, █ end",
"title": ""
},
{
"docid": "9b38978ad914f565351ba2875fedb253",
"score": "0.6261556",
"text": "def foo(numbers, &block)\n if block_given?\n numbers.each do |key, value|\n block.call(key, value)\n end\n end\nend",
"title": ""
},
{
"docid": "dae367266e4c43b5339cc97a29b3729d",
"score": "0.6209011",
"text": "def any?(*args)\n return super if args.any? || block_given?\n\n !empty?\n end",
"title": ""
},
{
"docid": "ac076f3467004b546ab358326955a7e9",
"score": "0.61906743",
"text": "def each(&block)\n return values.each(&block) if block.arity == 1\n super(&block)\n end",
"title": ""
},
{
"docid": "027ca9dd9cae924c0f83bae757617bd7",
"score": "0.60947293",
"text": "def foo\n if block_given? # se o block foi dado executa, se não, não executa\n # Call the block\n yield\n else\n puts \"Sem parâmetro do tipo bloco\"\n end\nend",
"title": ""
},
{
"docid": "3ad83e8e1c9544f77a7176ae2f1cbaee",
"score": "0.6075008",
"text": "def in_block=(_arg0); end",
"title": ""
},
{
"docid": "a0d33b3407a0e9eae0a36998f99b9063",
"score": "0.60528743",
"text": "def apply(&block)\n assert_type assert_defined(&block)\n end",
"title": ""
},
{
"docid": "f8b03f2a25c0efcdf9e8af387bec4f92",
"score": "0.60481304",
"text": "def each_value(&block)\n values.each(&block)\n end",
"title": ""
},
{
"docid": "b9527d9bbfdb9643262c2af3a647fe3f",
"score": "0.60398227",
"text": "def each(&block)\n values.each(&block)\n end",
"title": ""
},
{
"docid": "5e6220756289969ff2e7c8db84714318",
"score": "0.6035262",
"text": "def each(arr)\n for val in arr\n return \"no block given\" unless block_given? #block_given is a reserved word to check the block provided by user or not\n result = yield(val)\n puts result\n end\n\nend",
"title": ""
},
{
"docid": "f2bdb26f691682a17cfc95b9807d7d91",
"score": "0.60216427",
"text": "def each_value(&block)\n values.each(&block)\n end",
"title": ""
},
{
"docid": "fbac6c12bb91acaf71ffb78fed2200eb",
"score": "0.6009444",
"text": "def block_params\n end",
"title": ""
},
{
"docid": "69e37b67d434c58b399c8adc30ba6146",
"score": "0.6005573",
"text": "def each_arg(&block)\n arguments.each(&block)\n end",
"title": ""
},
{
"docid": "3284b0e2ffb5bef173d833c5352ea93a",
"score": "0.6000291",
"text": "def eval_block (*arguments, &blk)\n blk.nil? ? puts 'NO BLOCK GIVEN' : blk.call(*arguments)\nend",
"title": ""
},
{
"docid": "11341d5d7eb549cf221e5cd813f0238d",
"score": "0.59816957",
"text": "def each_arg(&block)\n arguments.each(&block)\n end",
"title": ""
},
{
"docid": "d993db82091226b594199c85c58373cb",
"score": "0.59627426",
"text": "def each\n @parameters.each { |param,value|\n yield(param,value)\n }\n end",
"title": ""
},
{
"docid": "c8edc4123b178a0ffd319953c5717c24",
"score": "0.59545857",
"text": "def invocation_blocks; end",
"title": ""
},
{
"docid": "26e3d120070d33e3bf295d31060e3d47",
"score": "0.59540236",
"text": "def eval_block(*args)\n if block_given? \n yield *args\n else \n puts \"NO BLOCK GIVEN!\" \n end\nend",
"title": ""
},
{
"docid": "77be1d2f62c02c9b7514aefa5c09fde3",
"score": "0.59460056",
"text": "def call(*args)\n block.call(*args) if block?\n end",
"title": ""
},
{
"docid": "b8f53c7fd9527ed47ffc279b3db848bb",
"score": "0.59396315",
"text": "def _reduce_694(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "70a484d0176a488389b5062b2b6e0668",
"score": "0.59378046",
"text": "def run(*args)\n block.call(*args) if block \n end",
"title": ""
},
{
"docid": "019edef0665a1273406ba8c2204d0d59",
"score": "0.5930853",
"text": "def for_all(&block)\n yield(@value)\n end",
"title": ""
},
{
"docid": "4ee125276eb2ae3bc60dda5df819c586",
"score": "0.5930077",
"text": "def all &block\n _with_constraint(:any, &block)\n end",
"title": ""
},
{
"docid": "f989d0d576410bd9bac904c913a8ecb9",
"score": "0.59186643",
"text": "def meth1(&block)\n\tblock.call(1, 2, 3)\n\tblock.(2, 3, 4)\n\tblock[3, 4, 5]\n\tblock.[](4, 5, 6)\n\tblock.===(6, 7, 8)\n\tblock === 5\n\t# But sady, the last one can call only one value at a time\nend",
"title": ""
},
{
"docid": "4d7a4fa7c9db40b56e631f7b67b877f7",
"score": "0.59130937",
"text": "def _reduce_687(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n\n result\nend",
"title": ""
},
{
"docid": "1c8e1fc94f08e24ba7ddf7a8f64f57d5",
"score": "0.5908793",
"text": "def a_value_within(*args, &block); end",
"title": ""
},
{
"docid": "7b50555a4a52fcd28dee28e1581d5e51",
"score": "0.5904021",
"text": "def call_block\n return if complete?\n \n begin\n @result = @block.call(*@args)\n rescue Exception => e\n @error = e\n end\n discard\n end",
"title": ""
},
{
"docid": "8ce0d956210be06336d6919a03ec01ac",
"score": "0.5903077",
"text": "def each(&block)\n values.each &block\n end",
"title": ""
},
{
"docid": "8ce0d956210be06336d6919a03ec01ac",
"score": "0.5903077",
"text": "def each(&block)\n values.each &block\n end",
"title": ""
},
{
"docid": "64fdc900fe7c62e1c17a30eed77bb1bf",
"score": "0.5898797",
"text": "def call(args)\n @block.call(args)\n end",
"title": ""
},
{
"docid": "e5d1fe7d414dfa44bcccf78c56e33a27",
"score": "0.58944243",
"text": "def call *args\n case @block.arity\n when 1..Infinity # Normal arguments\n raise ArgumentError,\n \"Wrong number of arguments (#{args.size.to_s} for #{@block.arity.to_s})\" unless\n args.size == @block.arity\n @block[*args]\n \n when 0 # No arguments with bars {|| }\n raise ArgumentError,\n \"Wrong number of arguments (#{args.size.to_s} for none)\" unless\n args.size == 0\n @block.call\n \n when -Infinity..-2 # x-1 arguments plus a splat argument\n raise ArgumentError,\n \"Wrong number of arguments (#{args.size.to_s} for #{(-@block.arity - 1).to_s}+)\" unless\n args.size >= (-@block.arity) - 1\n @block[*args]\n \n when -1 # Arguments handeled on-board {|*args| }, or ignore all args {}\n # Not going to raise any errors, this is the wildcard for script\n # kiddies\n @block[*args]\n \n end\n end",
"title": ""
},
{
"docid": "1cf3bc4cfd0675095757a7478b39b43f",
"score": "0.5892824",
"text": "def my_all_block(result)\n if is_a? Array\n my_each do |item|\n result = false unless yield(item)\n end\n elsif is_a? Hash\n my_each do |k, v|\n result = false unless yield(k, v)\n end\n end\n result\nend",
"title": ""
},
{
"docid": "f34294adfb865c7a60900c0617b09275",
"score": "0.58917207",
"text": "def each_value(except: [], &block)\n values(except: except).each(&block)\n end",
"title": ""
},
{
"docid": "8a216332530fbc95a24e5014ccabf642",
"score": "0.58912164",
"text": "def check_arguments(&body)\n @check_arguments_block = body\n end",
"title": ""
},
{
"docid": "9bf541d10df3294d2f7a4097c76eb810",
"score": "0.587513",
"text": "def block_argument?; end",
"title": ""
},
{
"docid": "9bf541d10df3294d2f7a4097c76eb810",
"score": "0.587513",
"text": "def block_argument?; end",
"title": ""
},
{
"docid": "037b813e9faf1ed30c5f28ea3bcc2d89",
"score": "0.58748287",
"text": "def each(&block)\n @params.each(&block)\n end",
"title": ""
},
{
"docid": "1ef240721b0776d5a4be2f59ed5e5c06",
"score": "0.5865571",
"text": "def each_param(&block) #:yield: name, value\n if @params\n @params.each(&block)\n end\n end",
"title": ""
},
{
"docid": "1ef240721b0776d5a4be2f59ed5e5c06",
"score": "0.5865571",
"text": "def each_param(&block) #:yield: name, value\n if @params\n @params.each(&block)\n end\n end",
"title": ""
},
{
"docid": "1ef240721b0776d5a4be2f59ed5e5c06",
"score": "0.5865571",
"text": "def each_param(&block) #:yield: name, value\n if @params\n @params.each(&block)\n end\n end",
"title": ""
},
{
"docid": "1ef240721b0776d5a4be2f59ed5e5c06",
"score": "0.5865571",
"text": "def each_param(&block) #:yield: name, value\n if @params\n @params.each(&block)\n end\n end",
"title": ""
},
{
"docid": "3150b9e29553acc385aafc99aafc0a1e",
"score": "0.5856831",
"text": "def calculation(a, b, &block) # &block is an explicit (named) parameter\n block.call(a, b)\nend",
"title": ""
},
{
"docid": "fa84f82e6b925ee6b20ab7ebc9213077",
"score": "0.5854547",
"text": "def _reduce_684(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "fa84f82e6b925ee6b20ab7ebc9213077",
"score": "0.5854547",
"text": "def _reduce_684(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "99e78c0612319a7f1879c241611ab2ca",
"score": "0.5854489",
"text": "def _reduce_701(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "b6a4bf6c332784a0e7de864f2f701374",
"score": "0.58540046",
"text": "def values(&proc)\n raise \"no block!\" if !proc\n @values_proc = proc\n end",
"title": ""
},
{
"docid": "fb34c9e9d8647a5a83a8e8121fe448d1",
"score": "0.5850893",
"text": "def call(*args)\n block.call(*args)\n end",
"title": ""
},
{
"docid": "a0b495068def00dcd7ee2f62cf69f3fc",
"score": "0.5846688",
"text": "def all?(&block)\n check :all &block\n end",
"title": ""
},
{
"docid": "4d558706e1f5ed0c82116559eeef315f",
"score": "0.58458024",
"text": "def call(*args)\n @block.call(*args)\n end",
"title": ""
},
{
"docid": "f7ba81d88957d4e34dd4a16d27e8476d",
"score": "0.5840243",
"text": "def _reduce_570(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n\n result\nend",
"title": ""
},
{
"docid": "956550df1cf78aa21e5326cc5ed695ce",
"score": "0.58351034",
"text": "def each( &block )\n each_value( &block )\n end",
"title": ""
},
{
"docid": "6fc0e05f92d3b173e43fd5daef72addb",
"score": "0.5831607",
"text": "def _reduce_570(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "9622b9f7396c180ddac6720846f3bce8",
"score": "0.5831006",
"text": "def block(params, optionals, rest_params, params_after_rest, keywords,\n rest_of_keywords, block_param, body)\n raise NotImplementedError.new('block')\n end",
"title": ""
},
{
"docid": "9ae237762e1d538d1236b9b3b6dd0075",
"score": "0.58271974",
"text": "def multi(&block); end",
"title": ""
},
{
"docid": "f3d34c5d1abe9bd1ea78e2807633351b",
"score": "0.582428",
"text": "def _reduce_558(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "f3d34c5d1abe9bd1ea78e2807633351b",
"score": "0.582428",
"text": "def _reduce_558(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "6fe01004660453931586bd5e1d897bfe",
"score": "0.58242524",
"text": "def eval_block(*args, &proc)\n unless block_given?\n return \"NO BLOCK GIVEN!\"\n end\n \n proc.call(*args)\nend",
"title": ""
},
{
"docid": "a31f133f61806314651fa067bb057ac8",
"score": "0.5821211",
"text": "def each_assigned_argument\n return assigned_arguments if !block_given?\n\t each do |key, value|\n if !TaskArguments.delayed_argument?(value)\n\t\t yield(key, value)\n\t\tend\n\t end\n\tend",
"title": ""
},
{
"docid": "d9e2e9d1211c1382cb326e6636acc1f4",
"score": "0.58162045",
"text": "def foo3\n if block_given?\n yield\n else\n puts \"sem parametro do tipo block\"\n end\nend",
"title": ""
},
{
"docid": "5fcfd178e4bcfdaad3091de8c0519308",
"score": "0.5814687",
"text": "def each(&block)\n raise ArgumentError, 'no block given' unless block\n\n self.then do |val|\n val.each(&block)\n end\n end",
"title": ""
},
{
"docid": "5fcfd178e4bcfdaad3091de8c0519308",
"score": "0.5814687",
"text": "def each(&block)\n raise ArgumentError, 'no block given' unless block\n\n self.then do |val|\n val.each(&block)\n end\n end",
"title": ""
},
{
"docid": "5fcfd178e4bcfdaad3091de8c0519308",
"score": "0.5814687",
"text": "def each(&block)\n raise ArgumentError, 'no block given' unless block\n\n self.then do |val|\n val.each(&block)\n end\n end",
"title": ""
},
{
"docid": "c45e8dd46377e0a96f32929c0f35658e",
"score": "0.5812508",
"text": "def _reduce_508(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "78905cdf0fa64e9618573d9b941f9c92",
"score": "0.5806327",
"text": "def for_all(&block)\n true\n end",
"title": ""
},
{
"docid": "573972326e781da00d040f3957342592",
"score": "0.5804982",
"text": "def _reduce_567(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "573972326e781da00d040f3957342592",
"score": "0.5804982",
"text": "def _reduce_567(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "7a205b43124bc390041464d38fee27f9",
"score": "0.5804176",
"text": "def all_fragments( &block )\n collect_parameters(all_base_parameters, &block)\n end",
"title": ""
},
{
"docid": "54fbcbb30e42f8b7da3433e412b30d9e",
"score": "0.58028346",
"text": "def take_another_block(number,array, &block) # the block must always be the last argument!\n puts \"Before calling the block with paramaters being passed to the method as well!\"\n block.call(number, array)\n puts \"After calling the block!\"\nend",
"title": ""
},
{
"docid": "320a7a2b802a275c4ae8e7f1b3335bde",
"score": "0.57961243",
"text": "def _reduce_566(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "71110de5bbaf1b60c116584c58c9051a",
"score": "0.5795463",
"text": "def _reduce_562(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "14f765aed5ee3bc0acc1a25711cbcb4e",
"score": "0.5792158",
"text": "def eachparameter\n parameters_with_value.each { |parameter| yield parameter }\n end",
"title": ""
},
{
"docid": "c5b6da6417e221e13c1c327a2048b7c8",
"score": "0.5791541",
"text": "def _reduce_560(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n\n result\nend",
"title": ""
},
{
"docid": "bf085c04a09e344a9fc49c9c343e55b9",
"score": "0.57893354",
"text": "def each\n parameters.each { |p,v| yield p, v }\n end",
"title": ""
},
{
"docid": "45e95fba7947b10a6e3b41d6abe92c27",
"score": "0.57871544",
"text": "def my_all?(argv=nil, &block)\n block = Proc.new { |item| item unless item.nil? || !item } unless block_given?\n block = Proc.new { |item| item if argv === item} unless argv.nil?\n self.my_each { |item| return false unless block.call(item) }\n \n true\n end",
"title": ""
},
{
"docid": "72ff1b526af01b33d383f073f1f90629",
"score": "0.5784338",
"text": "def un_metodo_con_parametros_para_el_bloque(param_1, param_2)\n yield(param_1, param_2)\nend",
"title": ""
},
{
"docid": "2b421c9b063df912f7a82e5d75fc8f94",
"score": "0.5782598",
"text": "def each_value(&block)\n each(&block)\n end",
"title": ""
},
{
"docid": "e4ff7dcdf7bbe40d35db4a867da7985b",
"score": "0.5781046",
"text": "def _reduce_560(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "7c97740390bcf4e9d5d5b9013faaa1a4",
"score": "0.5776932",
"text": "def _reduce_510(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "7c7f835ba42d613667a8cd2f772f7f8d",
"score": "0.57762265",
"text": "def my_none_block(result)\n my_each do |k, v|\n if ((is_a? Array) && yield(k)) || ((is_a? Hash) && yield(k, v))\n result = false\n break\n end\n end\n result\nend",
"title": ""
},
{
"docid": "3109d818dc2806da4ebd558212e5b127",
"score": "0.57715327",
"text": "def _reduce_561(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n\n result\nend",
"title": ""
},
{
"docid": "5194c0c272e87f5bca6c36c3af020212",
"score": "0.5770293",
"text": "def _reduce_561(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "47588806e64b37b1db9a495544ea77ad",
"score": "0.5769294",
"text": "def each(&block)\n @values.each(&block)\n end",
"title": ""
},
{
"docid": "706cef28a31b7d4cc517128f1814ca40",
"score": "0.5763334",
"text": "def _reduce_514(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "a5d856d912310770c277fda7ac4f2861",
"score": "0.576247",
"text": "def bloco_com_parametros (valor)\n yield valor\nend",
"title": ""
},
{
"docid": "6e38683088948adfaccf62f17eec6e02",
"score": "0.57614934",
"text": "def each(&block)\n @values.each(&block)\n end",
"title": ""
},
{
"docid": "a186e28c11685163c72abe744f2f837e",
"score": "0.5760162",
"text": "def _reduce_557(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "a186e28c11685163c72abe744f2f837e",
"score": "0.5760162",
"text": "def _reduce_557(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
},
{
"docid": "439438f9b4995cf2de581f76a39b0e4a",
"score": "0.5757761",
"text": "def ejecutar(&block)\n if block_given? #evalua si se paso un block por parametro\n block.call \n else\n puts 'No tiene un bloque'\n end\n \nend",
"title": ""
},
{
"docid": "b0d1c87d4668ba27ce40f999c3d4185c",
"score": "0.57545656",
"text": "def each_assigned_argument\n return assigned_arguments unless block_given?\n\n each do |key, value|\n unless TaskArguments.delayed_argument?(value)\n yield(key, value)\n end\n end\n end",
"title": ""
},
{
"docid": "75430a55eff0466104e3f9758c65ba4d",
"score": "0.5754145",
"text": "def xit(*all_args, &block); end",
"title": ""
},
{
"docid": "93197a56ed615eb9e18905b80a2d28a0",
"score": "0.5746235",
"text": "def any?(*args)\n return false if @none\n\n return super if args.present? || block_given?\n !empty?\n end",
"title": ""
},
{
"docid": "8dd3312def6884b51b9ec00422ede661",
"score": "0.57407224",
"text": "def each_value\n\t\teach false, true do |value| yield value end\n\tend",
"title": ""
},
{
"docid": "a1aa5f6030328946ea13f185b566bb4d",
"score": "0.5732816",
"text": "def _reduce_515(val, _values, result)\n @static_env.declare val[1][0]\n\n result = @builder.blockarg(val[0], val[1])\n \n result\nend",
"title": ""
}
] |
3988a157cef265973607ac16024f2fe9 | Lists all groups that a user belongs to. Warning: Utilizes serverside recursive search but may be slower than walking the tree clientside. | [
{
"docid": "046df91e5955bac2ab74a7a273141399",
"score": "0.71732813",
"text": "def all_ldap_groups(username)\n return [] if service.nil?\n results = service.search(base: group_tree,\n filter: Net::LDAP::Filter.eq('objectcategory', 'group') &\n Net::LDAP::Filter.ex('member:1.2.840.113556.1.4.1941',\n \"CN=#{Net::LDAP::Filter.escape(username)},#{account_tree}\"),\n attributes: ['cn'])\n if results.nil?\n []\n else\n results.collect do |entry|\n entry[:cn].first\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "24e6abcc6cb92c4c8556e93c612ed1df",
"score": "0.766122",
"text": "def groups\n response = @api.request(:get, \"users/#{@userid}/groups\")\n parse_with_meta(response, \"//data/groups/element\")\n end",
"title": ""
},
{
"docid": "bb7b2ade13482ade456ebbc89f5f42b9",
"score": "0.7503141",
"text": "def groups_for_user user_token\n request :get, resource_uri(\"groupsForUser\", @format), {:user_token => user_token}\n end",
"title": ""
},
{
"docid": "b7d9f9ec172e0dc11641fca1f2e3f61d",
"score": "0.7441499",
"text": "def index\n\t\tputs \"returning all groups belonging to user\"\n\t\t@user = User.find_by(id: session[:user_id])\n\t\tgroups = []\n\t\t@user.user_groups.collect { |a| groups.push(a.group) }\n\n\t\trespond_to do |format|\n\t\t\tformat.json { render :json => groups}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2d47275aa163b4169a0305e332664581",
"score": "0.73777896",
"text": "def group_list(user_id, sort='my_activity')\n data = request('/group/list', :id => user_id, :sort => sort)\n Hashie::Mash.new(data['groups']['list'])\n end",
"title": ""
},
{
"docid": "e095538a9bd8967030994ee5aabf443e",
"score": "0.7375673",
"text": "def user_groups(user_id, query_params = nil)\n get_user_children(user_id, __method__, query_params)\n end",
"title": ""
},
{
"docid": "5d21c0edf157ec06705c110d4d17b47d",
"score": "0.73741",
"text": "def get_user_groups(user)\n ret = get_response(\"/usermanagement/1/user/group/direct.json?username=#{user['username']}\")\n \n return nil if ret[:values].nil?\n \n ret = ret[:values]\n \n groups = []\n ret['groups'].each do |group|\n groups << group['name']\n end\n \n return groups\n end",
"title": ""
},
{
"docid": "ffe8acb6d9cf6b8158812f75f7a2e842",
"score": "0.73658806",
"text": "def list_groups_for_user(user_name, options = {})\n request({\n 'Action' => 'ListGroupsForUser',\n 'UserName' => user_name,\n :parser => Fog::Parsers::AWS::IAM::ListGroupsForUser.new\n }.merge!(options))\n end",
"title": ""
},
{
"docid": "bb93cd2032834c1beb1ebfeff41ead6d",
"score": "0.731398",
"text": "def index\n @groups = Group.all\n @user_groups = []\n @groups.each do |group|\n group.users.each do |user|\n if user.id == current_user.id\n @user_groups.push(group)\n end\n end\n end\n @user_groups\n end",
"title": ""
},
{
"docid": "0a6ea808a4b132046d558304d72a9d79",
"score": "0.72567767",
"text": "def get_user_groups\n path = self.api_root + \"/api/groups\"\n process_firecloud_request(:get, path)\n end",
"title": ""
},
{
"docid": "bced5705cdadcb58caa8142f1767c87b",
"score": "0.7217863",
"text": "def get_user_groups(options={})\n response = get(\"get_user_groups/\", options)\n end",
"title": ""
},
{
"docid": "8b0b023fa13d60f6229fc7773fb812a3",
"score": "0.71981174",
"text": "def get_user_groups\n groups = nil\n groups = get_user.groups.collect {|group| group.name} if get_user\n groups\n end",
"title": ""
},
{
"docid": "c7f7cc32d8694d343945f16300fb052a",
"score": "0.7161885",
"text": "def usergroups_list(options = {})\n post('usergroups.list', options)\n end",
"title": ""
},
{
"docid": "8b736d43ab6b5a47185676840389019b",
"score": "0.71502936",
"text": "def list_groups\n @groups = []\n bind_ldap(true) do |ldap_conn|\n ldap_conn.search(@@group_treebase, LDAP::LDAP_SCOPE_SUBTREE, \n \"(cn=*)\") do |entry|\n @groups << entry.to_hash\n end\n end\n @title = \"groups\"\n @groups.sort! { |x,y| x[\"cn\"] <=> y[\"cn\"] }\n end",
"title": ""
},
{
"docid": "5f29d28f66e92f73727fc598b61d9e84",
"score": "0.7137902",
"text": "def groups\n @user = User.find(by_id)\n @groups = @user.groups.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "7f03e6ed1d1cffb73658bc4efc38d03f",
"score": "0.7121018",
"text": "def ldap_groups\n User.walk_ldap_groups(User.ldap_member_of(user_key), []).sort\n end",
"title": ""
},
{
"docid": "3918f94df48503373bf4527997ec3d08",
"score": "0.709128",
"text": "def groups\n groups = []\n\n # Reset our group list\n Etc.setgrent\n\n user = @resource[:name]\n\n # Now iterate across all of the groups, adding each one our\n # user is a member of\n while group = Etc.getgrent\n members = group.mem\n\n groups << group.name if members.include? user\n end\n\n # We have to close the file, so each listing is a separate\n # reading of the file.\n Etc.endgrent\n\n groups.join(\",\")\n end",
"title": ""
},
{
"docid": "97eb5aac4539525f84b93b2d8e97ccab",
"score": "0.7034536",
"text": "def groups\n\n\t\tif params[:id]\n\n\t\t\trender :json => User.find(params[:id]).groups\n\n\t\telse\n\n\t\t\trender :json => current_user.groups\n\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "0f2c68c5583e8eac8e1b3e6754c277c3",
"score": "0.6953748",
"text": "def all_usergroups(group_list=[self], user_list=[])\n retrieve_users_and_groups group_list, user_list\n group_list.sort.uniq\n end",
"title": ""
},
{
"docid": "57549ad956b199746671a63175922e8b",
"score": "0.6946795",
"text": "def get_usergroups(username = nil)\n if username.nil?\n return false unless @logged_in\n get_userlists('groups')['query']['userinfo']['groups']\n else\n info = get_userlists('groups', username)\n info['query']['users'].collect { |i| i['groups'] }.flatten\n end\n end",
"title": ""
},
{
"docid": "f1ec11b91184c02ccfffa635f8115230",
"score": "0.6932873",
"text": "def users\n Log.add_info(request, '') # Not to show passwords.\n\n if params[:group_id].nil?\n group_id = TreeElement::ROOT_ID.to_s\n else\n group_id = params[:group_id]\n end\n\n ary = []\n\n users = Group.get_users(group_id)\n unless users.nil?\n users.each do |user|\n ary << user.id.to_s + ':' + user.get_name\n end\n end\n\n if params[:recursive] == 'true'\n child_ids = Group.get_childs(group_id, true, false)\n\n child_ids.each do |child_id|\n users = Group.get_users(child_id)\n unless users.nil?\n users.each do |user|\n ary << user.id.to_s + ':' + user.get_name\n end\n end\n end\n end\n\n render(:text => ary.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "d82fe5b39e6dca094313bb799a311320",
"score": "0.6907402",
"text": "def groups\n weakref(:groups) do\n Group.list(\"memberUid=#{name}\")\n end\n end",
"title": ""
},
{
"docid": "0fbc7197152b01bef71403e8f7222119",
"score": "0.6885745",
"text": "def all_user_groups\n UserGroup.joins(:user_relationships).uniq.where(\"user_relationships.user_id = ? or user_groups.parent_id IN (?)\", id, admin_user_groups.pluck(:id))\n end",
"title": ""
},
{
"docid": "75b14edd2d4a84b67adc6a027a905420",
"score": "0.6876644",
"text": "def get_groups\n\t\trespond_to do |format|\n if params[:user_id]\n \tuser = User.find(params[:user_id])\n groups = user.groups\n format.json { render :json => groups }\n else\n render :json => \"filtros incompletos\", :status => :unprocessable_entity\n end\n end\t\n end",
"title": ""
},
{
"docid": "2b3307a032314e80228745225bd9bcf9",
"score": "0.68764645",
"text": "def group\n params[:page] = \"a\" if params[:page] == nil\n @users = []\n filter = \"(cn=#{params[:group]})\"\n bind_ldap(true) do |ldap_conn|\n ldap_conn.search(@@group_treebase, LDAP::LDAP_SCOPE_SUBTREE, filter) do |entry|\n @users = entry.to_hash[\"member\"].to_a\n @title = entry.to_hash[\"cn\"][0]\n end\n @users = [] if @users == [\"\"]\n filter = \"(|\"\n if @users.length > 100\n @current = params[:page]\n @url = \"group/#{params[:group]}\"\n @users.each do |dn| \n if dn.split(\",\")[0].split(\"=\")[1][0] == params[:page]\n filter += \"(uid=#{dn.split(\",\")[0].split(\"=\")[1]})\"\n end\n end\n else\n @users.each { |dn| filter += \"(uid=#{dn.split(\",\")[0].split(\"=\")[1]})\" }\n end\n filter += \")\"\n @users = []\n attrs = [\"uid\", \"cn\", \"memberSince\"]\n ldap_conn.search(@@user_treebase, LDAP::LDAP_SCOPE_SUBTREE, filter, attrs) do |entry|\n @users << entry.to_hash\n end\n @users.sort! { |x,y| x[\"uid\"] <=> y[\"uid\"] }\n end\n render 'list_users'\n end",
"title": ""
},
{
"docid": "2405ca278c01aca4c07be4a06aaae6af",
"score": "0.68626827",
"text": "def get_groups\n self.class.get(\"#{@url}/rest/user-management/groups\", basic_auth: @auth)\n end",
"title": ""
},
{
"docid": "43ed183006bfab909dba5da10fdabf43",
"score": "0.681121",
"text": "def all_groups\n all_my_groups = Array.new()\n user_groups.each do |ug|\n all_my_groups << ug\n if (!all_my_groups.include?(ug.parent_group))\n ug.all_super_groups.each do |sg|\n if (!all_my_groups.include?(sg))\n all_my_groups << sg\n end\n end\n end\n end\n return all_my_groups\n end",
"title": ""
},
{
"docid": "c0abca3be528ae58c008a2ee9b0375b3",
"score": "0.6796811",
"text": "def groups\n Log.add_info(request, '') # Not to show passwords.\n\n ary = []\n groups = Group.where(nil).to_a\n unless groups.nil?\n groups_cache = {}\n group_obj_cache = Group.build_cache(groups)\n groups.each do |group|\n ary << group.id.to_s + ':' + Group.get_path(group.id, groups_cache, group_obj_cache)\n end\n end\n\n render(:text => ary.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "283f264767e9e76aa2337afe3c5db00a",
"score": "0.67779",
"text": "def get_user_groups(user)\n log(\"User email information unavailable\") if user['email'].nil?\n \n ret = @ds.retrieve_groups(user['email'])\n \n return nil if ret.nil?\n \n groups = []\n ret.each do |group|\n groups << group.group_id\n end\n \n return groups\n end",
"title": ""
},
{
"docid": "1ab0e07fc43669622d0e5d23bb6069cc",
"score": "0.6759199",
"text": "def zz_api_users_groups\n return unless require_user\n\n zz_api do\n # only accept those not wrapped and not beginning with .\n groups = Group.where(\"user_id = ? AND wrapped_user_id IS NULL AND name NOT LIKE '.%'\", current_user.id).all\n Group.as_sorted_array(groups)\n end\n end",
"title": ""
},
{
"docid": "4be7d89002fc5505ae940559ed6cfe9c",
"score": "0.6737543",
"text": "def index\n @currentUser = getCurrentUser\n @user_groups = @currentUser.groups.all\n end",
"title": ""
},
{
"docid": "0d5f28b9b98e3583896907914158c38e",
"score": "0.6733009",
"text": "def groups\n root.send(:call, \"UserGroup\", \"get_group_collection_from_site\").xpath(\"//spdir:Group\", NS).map do |row|\n attributes = clean_attributes(row.attributes)\n Group.new(root, attributes[\"Name\"])\n end\n end",
"title": ""
},
{
"docid": "c64ade73831ed8da4b833673bb5db769",
"score": "0.6721128",
"text": "def groups_visible_to_user(current_user)\n base = groups_for_projects(public_and_internal_projects)\n\n union = Gitlab::SQL::Union.\n new([base.select(:id), current_user.authorized_groups.select(:id)])\n\n Group.where(\"namespaces.id IN (#{union.to_sql})\")\n end",
"title": ""
},
{
"docid": "d424d9f86fc4e0937b873c8da8b8aefd",
"score": "0.6715729",
"text": "def groups()\n\t\t\t\tuserlist = users()\n\n\t\t\t\tgrouplist = GroupList.new()\n\t\t\t\tFile.open('/etc/group', File::RDONLY) { |fp|\n\t\t\t\t\tregex = /^([a-zA-Z0-9-]+):[^:]+:([0-9]+):([^:]*)/\n\t\t\t\t\tfp.each_line() { |line|\n\t\t\t\t\t\tmatch = regex.match(line)\n\t\t\t\t\t\tif(match != nil)\n\t\t\t\t\t\t\tgroup = GroupInfo.new()\n\t\t\t\t\t\t\tgroup.groupname = match[1]\n\t\t\t\t\t\t\tgroup.gid = match[2].to_i()\n\t\t\t\t\t\t\tgroup.members = UserList.new()\n\t\t\t\t\t\t\tif(match[3] != nil)\n\t\t\t\t\t\t\t\tusers = match[3].split(/,/)\n\t\t\t\t\t\t\t\tusers.each() { |username|\n\t\t\t\t\t\t\t\t\tif(userlist.has_key?(username))\n\t\t\t\t\t\t\t\t\t\tgroup.members[username] = userlist[username]\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tgrouplist[group.groupname] = group\n\t\t\t\t\t\tend\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn(grouplist)\n\t\t\tend",
"title": ""
},
{
"docid": "d424d9f86fc4e0937b873c8da8b8aefd",
"score": "0.6715729",
"text": "def groups()\n\t\t\t\tuserlist = users()\n\n\t\t\t\tgrouplist = GroupList.new()\n\t\t\t\tFile.open('/etc/group', File::RDONLY) { |fp|\n\t\t\t\t\tregex = /^([a-zA-Z0-9-]+):[^:]+:([0-9]+):([^:]*)/\n\t\t\t\t\tfp.each_line() { |line|\n\t\t\t\t\t\tmatch = regex.match(line)\n\t\t\t\t\t\tif(match != nil)\n\t\t\t\t\t\t\tgroup = GroupInfo.new()\n\t\t\t\t\t\t\tgroup.groupname = match[1]\n\t\t\t\t\t\t\tgroup.gid = match[2].to_i()\n\t\t\t\t\t\t\tgroup.members = UserList.new()\n\t\t\t\t\t\t\tif(match[3] != nil)\n\t\t\t\t\t\t\t\tusers = match[3].split(/,/)\n\t\t\t\t\t\t\t\tusers.each() { |username|\n\t\t\t\t\t\t\t\t\tif(userlist.has_key?(username))\n\t\t\t\t\t\t\t\t\t\tgroup.members[username] = userlist[username]\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tgrouplist[group.groupname] = group\n\t\t\t\t\t\tend\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn(grouplist)\n\t\t\tend",
"title": ""
},
{
"docid": "920e4d7cefd7355f8c46ad3fe135ac9d",
"score": "0.67115337",
"text": "def list_groups\n nessus_rest_get('groups')['groups'] || []\n end",
"title": ""
},
{
"docid": "3dadaa6ca0a08325eafaaa67fd3b899f",
"score": "0.66743314",
"text": "def getPublicGroups(user)\n\trequire 'flickr/groups'\n\t\tgroups = @flickr.groups\n\t\tuser = user.nsid if user.class == Flickr::Person\n\t\tres = @flickr.call_method('flickr.people.getPublicGroups',\n\t\t\t'user_id' => user)\n\t\tlist = []\n\t\tres.elements['/groups'].each_element('group') do |e|\n\t\t\tatt = e.attributes\n\t\t\tnsid = att['nsid']\n\n\t\t\tg = @flickr.group_cache_lookup(nsid) ||\n\t\t\t\tFlickr::Group.new(@flickr,nsid)\n\n\t\t\tg.name = att['name']\n\t\t\tg.eighteenplus = att['eighteenplus'].to_i == 1\n\n\t\t\t@flickr.group_cache_store(g)\n\t\t\tlist << g\n\t\tend\n\t\treturn list\n\tend",
"title": ""
},
{
"docid": "30687c809bfc2c062d06f3d194a4b271",
"score": "0.66736746",
"text": "def groups_visible_to_user(current_user)\n base = @user.authorized_groups.visible_to_user(current_user)\n extra = public_and_internal_groups\n union = Gitlab::SQL::Union.new([base.select(:id), extra.select(:id)])\n\n Group.where(\"namespaces.id IN (#{union.to_sql})\")\n end",
"title": ""
},
{
"docid": "2079b28882ba811aafdab4da36c5fc08",
"score": "0.66565746",
"text": "def user_groups()#user, session)\n return @user_groups if @user_groups\n\n @user_groups = @user.groups + default_user_groups\n @user_groups\n end",
"title": ""
},
{
"docid": "733b1fcf125f568eddc1bd9672c371ee",
"score": "0.6641111",
"text": "def get_usergroups\n @slack_user.usergroups_list\n end",
"title": ""
},
{
"docid": "4870f452b6efc8cc8c30cbd5bc4db780",
"score": "0.6640538",
"text": "def index\n @user = User.find(session[:user_id])\n # @groups = @user.groups.ordered_by_name\n @groups = Group.all.ordered_by_name\n end",
"title": ""
},
{
"docid": "5723343460c10c73f87337cee2b8cb9a",
"score": "0.659855",
"text": "def groups\n res = @conn.get 'groups.list', token: @api_token\n Array(JSON.parse(res.body)['groups'])\n end",
"title": ""
},
{
"docid": "6f900293d53030b26cb8013be6dd78ff",
"score": "0.6597006",
"text": "def groups()\n return [] if new_record?\n conn.getUserGroups(self.name)\n end",
"title": ""
},
{
"docid": "e2a866f0bb209721aff7628cc361cb66",
"score": "0.6594898",
"text": "def get_group_users\n Log.add_info(request, params.inspect)\n\n @group_id = nil\n if !params[:tree_node_id].nil?\n @group_id = params[:tree_node_id]\n elsif !params[:group_id].blank?\n @group_id = params[:group_id]\n end\n SqlHelper.validate_token([@group_id])\n\n @users = Group.get_users(@group_id)\n\n render(:partial => 'ajax_select_users', :layout => false)\n end",
"title": ""
},
{
"docid": "fdc427dd6b04713a9d2718e525c05871",
"score": "0.6580077",
"text": "def list\n response = @client.get('groups')\n verify response,\n forbidden: 'You do not have permission to view the groups list'\n end",
"title": ""
},
{
"docid": "ffdd27726cae58f3976f9bc309d809ab",
"score": "0.6568966",
"text": "def index\n @groups = current_user.groups.all\n end",
"title": ""
},
{
"docid": "eb54ad520dc92ceb5dec30374c008156",
"score": "0.65648",
"text": "def query_groups(options = nil)\n require_relative 'group'\n @api.cursor(Group, get_base_api_path() + \"/groups\", options)\n end",
"title": ""
},
{
"docid": "eb54ad520dc92ceb5dec30374c008156",
"score": "0.65648",
"text": "def query_groups(options = nil)\n require_relative 'group'\n @api.cursor(Group, get_base_api_path() + \"/groups\", options)\n end",
"title": ""
},
{
"docid": "eb54ad520dc92ceb5dec30374c008156",
"score": "0.65648",
"text": "def query_groups(options = nil)\n require_relative 'group'\n @api.cursor(Group, get_base_api_path() + \"/groups\", options)\n end",
"title": ""
},
{
"docid": "eb54ad520dc92ceb5dec30374c008156",
"score": "0.6562039",
"text": "def query_groups(options = nil)\n require_relative 'group'\n @api.cursor(Group, get_base_api_path() + \"/groups\", options)\n end",
"title": ""
},
{
"docid": "b18e098d36538bd20f7dd5d2075a4efb",
"score": "0.6552953",
"text": "def index\n\n groups = User.find(params[:user_id]).groups\n @groups = []\n groups.each do |g|\n @groups << g.add_group_users(g.users)\n end\n\n render json: @groups\n end",
"title": ""
},
{
"docid": "7d7796a9c772f2190b9f5eeba0460cc8",
"score": "0.6539549",
"text": "def list(options = {})\n query = options.empty? ? '' : \"?#{URI.encode_www_form(options)}\"\n get(uri: \"/groups/#{query}\")\n end",
"title": ""
},
{
"docid": "3676f8b776d2534b5132441a6a0465c6",
"score": "0.6522438",
"text": "def get_group_users(id)\n endpoint = '/groups'\n user_query = '?include=users'\n url = self.base_url.to_s + endpoint.to_s + \"/\" + id.to_s + self.format.to_s + user_query\n self.get_data(url)\n end",
"title": ""
},
{
"docid": "5ca713c8172a5264b44280dff124eee7",
"score": "0.6498234",
"text": "def gather_list_of_groups\n @groups = (\n [UserGroup.all_users] +\n @description.admin_groups.sort_by(&:name) +\n @description.writer_groups.sort_by(&:name) +\n @description.reader_groups.sort_by(&:name) +\n [UserGroup.reviewers]\n ) + (\n [@description.user] +\n @description.authors.sort_by(&:login) +\n @description.editors.sort_by(&:login) +\n [@user]\n ).map { |user| UserGroup.one_user(user) }\n @groups.uniq!\n @groups = @groups.reject { |g| g.name.match(/^user \\d+$/) } +\n @groups.select { |g| g.name.match(/^user \\d+$/) }\n end",
"title": ""
},
{
"docid": "66d9eabaa79cbb727661541e8e7eded1",
"score": "0.64921683",
"text": "def user_groups\n @values.keys\n .select(&Input.method(:exists?))\n .map(&Input.method(:find))\n .map(&:share_group).compact.uniq\n end",
"title": ""
},
{
"docid": "fe4d3106b336926943c500b69f0b51ae",
"score": "0.6482043",
"text": "def groups\n GroupModelItem.list(self.root)\n end",
"title": ""
},
{
"docid": "c4eea79a6c56c2d907ac5a6bf8bc7b3f",
"score": "0.6471254",
"text": "def get_groups\n\t\tgroups = []\n\t\tcmd_out = read_file(\"/etc/group\").split(\"\\n\")\n\t\tcmd_out.each do |l|\n\t\t\tentry = {}\n\t\t\tuser_field = l.split(\":\")\n\t\t\tentry[:name] = user_field[0]\n\t\t\tentry[:gid] = user_field[2]\n\t\t\tentry[:users] = user_field[3]\n\t\t\tgroups << entry\n\t\tend\n\t\treturn groups\n\tend",
"title": ""
},
{
"docid": "a4be2aee1196495138d3d977f12ec162",
"score": "0.6468529",
"text": "def index\n @groups = Group.get_all(current_user.account_id)\n end",
"title": ""
},
{
"docid": "8059db3f2d975e14cb77b3714d2b8c62",
"score": "0.6462609",
"text": "def user_groups\n user.group_memberships unless user.blank?\n end",
"title": ""
},
{
"docid": "cb796a9ba6022118208208e4edc3afb1",
"score": "0.6453575",
"text": "def user_groups\n # render json: User.groups(params[:uid])\n render json: []\n end",
"title": ""
},
{
"docid": "4f07ac4e1be5b5cd523115226894c89b",
"score": "0.64489126",
"text": "def current_user_groups\n user_group_ids\n @group_ids.collect do |id|\n Group.all.find_by_id(id)\n end\n end",
"title": ""
},
{
"docid": "43f029bca800fc50a82c6c81cf2b411d",
"score": "0.64402664",
"text": "def groups(fb_workplace_id)\n # get_community_path(\"groups\").map{|m| Hashie::Mash.new(m)} rescue nil\n # user = user_from_email(user_email)\n users_managed_groups(fb_workplace_id)\n\n end",
"title": ""
},
{
"docid": "e021211eb7db34a588ee57c664790a4e",
"score": "0.6439951",
"text": "def find_all_groups\n return collect_from_search_paths do |search_path|\n perform_query(search_path,\n \"(|(objectClass=organizationalUnit)(objectClass=group))\", [\"dn\"]\n ).collect { |entry| entry[\"dn\"][0] }\n end #collect_from_search_paths\n end",
"title": ""
},
{
"docid": "2a19dfbb687386e4a0554fe7f30bc55e",
"score": "0.64375794",
"text": "def user_groups_assignable_for_user(usr)\n return [] if usr.nil?\n \n if administrator?(usr)\n UserGroup.find(:all, :order => :name)\n else\n UserGroup.find_by_sql <<-SQL\n select user_groups.* from user_groups, user_groups_users\n where user_groups.id = user_groups_users.user_group_id\n and user_groups_users.user_id = #{usr.id}\t \n order by user_groups.name\n SQL\n end\n end",
"title": ""
},
{
"docid": "8ce97e4a238ad52061874c5468bd0f17",
"score": "0.6427453",
"text": "def groups options ={}\n perform_get_with_object(\"/users/#{get_id}/groups\", options, Vimeo::Entities::Group)\n end",
"title": ""
},
{
"docid": "c19f5deec9949c5b7ee1578335cd368f",
"score": "0.6425941",
"text": "def groups_list(options={})\n post(\"groups.list\", options)\n end",
"title": ""
},
{
"docid": "c19f5deec9949c5b7ee1578335cd368f",
"score": "0.6425941",
"text": "def groups_list(options={})\n post(\"groups.list\", options)\n end",
"title": ""
},
{
"docid": "51485c6429a6227610929db4ef55b99d",
"score": "0.64230996",
"text": "def get_groups()\n resp = conn.get( '/groups/'+name+'/groups/' )\n \n case resp.code.to_i\n when 200\n groups = Array.new()\n JSON.parse( resp.body ).each{ |groupname|\n groups.push(RestAuthGroup.new( conn, groupname ))\n }\n return groups\n when 404\n raise RestAuthGroupNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end",
"title": ""
},
{
"docid": "b45bb6ad980532bd1d0ddbe81c8dd2e4",
"score": "0.6420181",
"text": "def groups\n @groups = @user.memberships\n end",
"title": ""
},
{
"docid": "f91f11512c1f6523e19885cfaaa8f9e4",
"score": "0.641682",
"text": "def index\n @user = current_user\n @groups = @user.groups\n end",
"title": ""
},
{
"docid": "c255402d0d66660f8eb211343c63f28d",
"score": "0.64144164",
"text": "def get_groups_of_person\n @groups = Person.find_by_guid(params[:user_id]).groups\n @groups_hash = @groups.find_all{|g| g.show?(@user)}.collect do |group|\n group.to_hash(@user)\n end\n render_json :entry => @groups and return\n end",
"title": ""
},
{
"docid": "60e008e8b1ddbd0ecea4a19108f58909",
"score": "0.6406948",
"text": "def get_group_users\n Log.add_info(request, params.inspect)\n\n SqlHelper.validate_token([params[:id]])\n begin\n @folder = Folder.find(params[:id])\n rescue => evar\n @folder = nil\n Log.add_error(request, evar)\n end\n\n @group_id = nil\n if !params[:tree_node_id].nil?\n @group_id = params[:tree_node_id]\n elsif !params[:group_id].blank?\n @group_id = params[:group_id]\n end\n SqlHelper.validate_token([@group_id])\n\n @users = Group.get_users(@group_id)\n\n render(:partial => 'ajax_select_users', :layout => false)\n end",
"title": ""
},
{
"docid": "22971ab7dc14f0fbd395e4df126f6993",
"score": "0.6404215",
"text": "def listGroups\n @admin.listGroups.map { |g| g.getName }\n end",
"title": ""
},
{
"docid": "72b864cf8afba2151104e31d20a4bbd0",
"score": "0.63979083",
"text": "def user_groups\n return @user_groups if @user_groups\n\n @user_groups = default_user_groups\n @user_groups |= current_user.groups if current_user.respond_to? :groups\n @user_groups |= ['registered'] if current_user.authorized_patron? || current_user.admin?\n @user_groups\n end",
"title": ""
},
{
"docid": "e1480b2bd75318f31db55ceaf1763aab",
"score": "0.63975996",
"text": "def editUsersGroups\n if session[:username] and params[:user] and params[:user] !~ /[^\\w\\_\\-]/\n # get signed in user and groups owned by the user\n @user = User.find_by_username(session[:username])\n @groups = Group.find_by_sql(\"SELECT groups.* FROM groups WHERE groups.user_id = #{@user.id}\")\n\n # string for finding users\n usersstring = searchtermForSql(params[:user], \"users.username\") + \" OR \" + searchtermForSql(params[:user], \"users.real_name\")\n \n # fill users_and_groups with each found users user.id as the key and an array of\n # group.id's as a value (the groups the user BELONGS to)\n users_and_groups = Hash.new\n Usersingroup.find_by_sql(\"SELECT usersingroups.* FROM groups, usersingroups, users WHERE (\" + usersstring +\n \") AND groups.user_id = #{@user.id} AND usersingroups.user_id = users.id AND \" +\n \"groups.id = usersingroups.group_id ORDER BY usersingroups.user_id\").each do |ug|\n if not users_and_groups.has_key?(ug.user_id)\n users_and_groups.merge!({ug.user_id => []})\n end\n users_and_groups[ug.user_id].push(ug.group_id)\n end\n \n # will include all users found by the searchterm and information wether each\n # of them belongs or not to each group owned by the signed in user\n @users = Hash.new\n \n # create the base of the group-hash that will be included in the @users.hash as a value for each user\n group_hash = Hash.new\n @groups.each do |group|\n \n group_hash.merge!({group.id => false})\n end\n \n # construct @users, key is the user and value is his group_hash (true/false for belonging to each group)\n User.find_by_sql(\"SELECT users.* FROM users WHERE \" + usersstring).each do |u|\n gh = group_hash.dup\n if users_and_groups.has_key?(u.id)\n users_and_groups[u.id].each do |g|\n gh[g] = true\n end\n end\n @users.merge!({u => gh})\n end\n \n end\n end",
"title": ""
},
{
"docid": "e1480b2bd75318f31db55ceaf1763aab",
"score": "0.63975996",
"text": "def editUsersGroups\n if session[:username] and params[:user] and params[:user] !~ /[^\\w\\_\\-]/\n # get signed in user and groups owned by the user\n @user = User.find_by_username(session[:username])\n @groups = Group.find_by_sql(\"SELECT groups.* FROM groups WHERE groups.user_id = #{@user.id}\")\n\n # string for finding users\n usersstring = searchtermForSql(params[:user], \"users.username\") + \" OR \" + searchtermForSql(params[:user], \"users.real_name\")\n \n # fill users_and_groups with each found users user.id as the key and an array of\n # group.id's as a value (the groups the user BELONGS to)\n users_and_groups = Hash.new\n Usersingroup.find_by_sql(\"SELECT usersingroups.* FROM groups, usersingroups, users WHERE (\" + usersstring +\n \") AND groups.user_id = #{@user.id} AND usersingroups.user_id = users.id AND \" +\n \"groups.id = usersingroups.group_id ORDER BY usersingroups.user_id\").each do |ug|\n if not users_and_groups.has_key?(ug.user_id)\n users_and_groups.merge!({ug.user_id => []})\n end\n users_and_groups[ug.user_id].push(ug.group_id)\n end\n \n # will include all users found by the searchterm and information wether each\n # of them belongs or not to each group owned by the signed in user\n @users = Hash.new\n \n # create the base of the group-hash that will be included in the @users.hash as a value for each user\n group_hash = Hash.new\n @groups.each do |group|\n \n group_hash.merge!({group.id => false})\n end\n \n # construct @users, key is the user and value is his group_hash (true/false for belonging to each group)\n User.find_by_sql(\"SELECT users.* FROM users WHERE \" + usersstring).each do |u|\n gh = group_hash.dup\n if users_and_groups.has_key?(u.id)\n users_and_groups[u.id].each do |g|\n gh[g] = true\n end\n end\n @users.merge!({u => gh})\n end\n \n end\n end",
"title": ""
},
{
"docid": "a7b09ebaf4f1765357bb705f0d348433",
"score": "0.639652",
"text": "def list\n @groups = Group.find(:all)\n end",
"title": ""
},
{
"docid": "60af8622b6c1e29b4206a94239a53f34",
"score": "0.6386691",
"text": "def groups_by_username(username)\n token = self.auth_token()\n\n result = HTTParty.get(\"#{@head_url}/users/#{username}/joined_chatgroups\",\n :headers => { 'Content-Type' => 'application/json', 'Authorization'=>\"Bearer #{token}\" } )\n\n if result.response.code.to_i == 200\n return result[\"data\"]\n else\n puts result.response.body.yellow\n nil\n end \n end",
"title": ""
},
{
"docid": "b548d4d02ece6fd0b6a47b6ce9d8babd",
"score": "0.63816833",
"text": "def show\n\t\t@group = Group.find_by(id: params[:id])\n\t\tusers = []\n\t\t@group.user_groups.collect { |a| users.push(a.user) }\n\n\t\trespond_to do |format|\n\t\t\tformat.json { render :json => users}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "76a0e78a5cc84ddc4272288be647d5f8",
"score": "0.638064",
"text": "def index\n\t\t@groups = current_user.groups\n\tend",
"title": ""
},
{
"docid": "0f6d6220a61d7db74b8dc9f582de40f1",
"score": "0.6378342",
"text": "def index\n @groups = current_user.groups\n end",
"title": ""
},
{
"docid": "0f6d6220a61d7db74b8dc9f582de40f1",
"score": "0.6378342",
"text": "def index\n @groups = current_user.groups\n end",
"title": ""
},
{
"docid": "0f6d6220a61d7db74b8dc9f582de40f1",
"score": "0.6378342",
"text": "def index\n @groups = current_user.groups\n end",
"title": ""
},
{
"docid": "0f6d6220a61d7db74b8dc9f582de40f1",
"score": "0.6378342",
"text": "def index\n @groups = current_user.groups\n end",
"title": ""
},
{
"docid": "0f6d6220a61d7db74b8dc9f582de40f1",
"score": "0.6378342",
"text": "def index\n @groups = current_user.groups\n end",
"title": ""
},
{
"docid": "0f6d6220a61d7db74b8dc9f582de40f1",
"score": "0.6378342",
"text": "def index\n @groups = current_user.groups\n end",
"title": ""
},
{
"docid": "8774387cf3db67befc967828d41b8474",
"score": "0.6366879",
"text": "def get_groups_for_user_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersGroupsApi.get_groups_for_user ...\"\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 UsersGroupsApi.get_groups_for_user\"\n end\n # resource path\n local_var_path = \"/users/{user_id}/groups\".sub('{' + 'user_id' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'filter_children'] = opts[:'filter_children'] if !opts[:'filter_children'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<String>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersGroupsApi#get_groups_for_user\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c449413110964807364c22a01ac02ab9",
"score": "0.63580495",
"text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "bcc4edf4035b2110fdb81fc5cb393544",
"score": "0.6356808",
"text": "def all_groups\n search(filter: ALL_GROUPS_FILTER)\n end",
"title": ""
},
{
"docid": "b6f91188720e81acea841d6028dc6747",
"score": "0.635434",
"text": "def index\n @usergroups = Usergroup.all\n end",
"title": ""
},
{
"docid": "2cd010eb3280d0c29430f467f9d7b3ba",
"score": "0.63542765",
"text": "def list(**options)\n query = options.empty? ? '' : '?' + URI.encode_www_form(options)\n get(uri: \"/groups/#{query}\")\n end",
"title": ""
},
{
"docid": "fe0cc0b73a80abbd409c84a8929b400f",
"score": "0.63535345",
"text": "def list_groups\n request(\n 'Action' => 'ListGroups',\n :parser => Fog::Parsers::AWS::IAM::ListGroups.new\n )\n end",
"title": ""
},
{
"docid": "8764c9cdb6235db36624c16237141b5d",
"score": "0.63510853",
"text": "def index\n @user_usergroups = UserUsergroup.all\n end",
"title": ""
},
{
"docid": "d290df0be589ff655bd162b7d26d445a",
"score": "0.6344162",
"text": "def index\n @user_groups = UserGroup.all\n end",
"title": ""
},
{
"docid": "d290df0be589ff655bd162b7d26d445a",
"score": "0.6344162",
"text": "def index\n @user_groups = UserGroup.all\n end",
"title": ""
},
{
"docid": "d290df0be589ff655bd162b7d26d445a",
"score": "0.6344162",
"text": "def index\n @user_groups = UserGroup.all\n end",
"title": ""
},
{
"docid": "3e18d854f89c961ba6899ce9bc23e0ac",
"score": "0.63424057",
"text": "def groups\n RoleMapper.roles(user_key)\n end",
"title": ""
},
{
"docid": "3e18d854f89c961ba6899ce9bc23e0ac",
"score": "0.63424057",
"text": "def groups\n RoleMapper.roles(user_key)\n end",
"title": ""
},
{
"docid": "ec181168a85856b6b990dfb1474c3e3d",
"score": "0.6335329",
"text": "def get_user_groups(bearer) \n return get_info(bearer, \"my/groups\")\n end",
"title": ""
},
{
"docid": "40158a306d172d148ad8c9b38846e2eb",
"score": "0.6334145",
"text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "aaa323b3678e818f5d9369bee1612e4d",
"score": "0.6333925",
"text": "def groups\n db = SQLite3::Database.open('db/db.sqlite')\n groups = []\n for i in db.execute('SELECT * FROM groups WHERE id IN (SELECT group_id FROM memberships WHERE user_id IS ?)', @id)\n groups << Group.new( {id: i[0], name: i[1]})\n end\n return groups\n end",
"title": ""
}
] |
f991e0d502a14552dc85f59578f65ff8 | I worked on this challenge with: Kathryn Your Solution Below | [
{
"docid": "605810bacaf4d08ecec6675b0b2234f2",
"score": "0.0",
"text": "def get_grade(grade)\n if grade >= 90\n return 'A'\n elsif grade >=80 && grade < 90\n return 'B'\n elsif grade >=70 && grade < 80\n return 'C'\n elsif grade >=60 && grade < 70\n return 'D'\n else return 'F'\n end\nend",
"title": ""
}
] | [
{
"docid": "b9960478999684c2b536f76e22f6fc63",
"score": "0.6597748",
"text": "def solution4(input)\n end",
"title": ""
},
{
"docid": "61a5aa5387d7586d627164f40eaf623a",
"score": "0.64431083",
"text": "def solution6(input)\n end",
"title": ""
},
{
"docid": "aa89b26c8848588848ff622b5d313173",
"score": "0.6420614",
"text": "def solution\n 31875000\nend",
"title": ""
},
{
"docid": "e64ab9041d127fd863cb8cc14dea830e",
"score": "0.6394586",
"text": "def solve_challenge(input)\n sum = 0\n last_index = input.length - 1\n char1 = ''\n char2 = ''\n input.split('').each_with_index do |ch, i|\n char1 = ch\n # circle around list if index is at the end\n if i == last_index\n char2 = input[0]\n # otherwise just grab the next character\n else\n char2 = input[i+1]\n end\n # add to sum if the 2 characters match\n sum += char1.to_i if char1 == char2\n end\n sum\nend",
"title": ""
},
{
"docid": "75140bd92377e07bd7367ec852f43d4d",
"score": "0.6362513",
"text": "def solution(arr) end",
"title": ""
},
{
"docid": "6979036015fac47c519d3834b2c5c971",
"score": "0.6359173",
"text": "def sort_string(string)\r\n # your code here\r\n a = string.split(\" \")\r\n b = a.sort{|x,y| x.length <=> y.length}\r\n b[0]<<' '<<b[1]<<' '<<b[2]\r\nend\r\n\r\n\r\n# Select random elements from an array\r\n\r\ndef random_select(array, n)\r\n # your code here\r\n len = array.size\r\n result = []\r\n n.times do \r\n result = result << array[rand(len)] \r\n end\r\n return result\r\nend\r\n\r\n\r\n# Find the length of strings in an array\r\n\r\ndef length_finder(input_array)\r\n out_arr = []\r\n input_array.each do |i|\r\n out_arr = out_arr << i.length\r\n end\r\n return out_arr\r\nend\r\n\r\n\r\n# Hiring Programmers - Boolean Expressions in Ruby\r\n\r\nis_an_experienced_programmer = (\r\n (candidate.years_of_experience >= 2 || candidate.github_points >= 500) && candidate.languages_worked_with.include?(\"Ruby\") && candidate.age >= 15 && !candidate.applied_recently?\r\n )\r\n \r\n \r\n# Palindromes \r\n\r\ndef palindrome?(sentence)\r\n # Write your code here\r\n sentence = sentence.downcase.gsub(' ','')\r\n reverse = ''\r\n i = 1\r\n sentence.length.times do\r\n reverse = reverse << sentence[-i]\r\n i = i.next\r\n end\r\n return reverse == sentence\r\nend\r\n\r\n\r\n# Compute sum of cubes for given range\r\n\r\ndef sum_of_cubes(a, b)\r\n # Write your code here\r\n i = a\r\n result = i**3\r\n loop do\r\n if i == b \r\n break\r\n else\r\n i = i + 1\r\n result = result + i**3\r\n end\r\n end\r\n return result\r\nend\r\n \r\n \r\n# Find non-duplicate values in an Array\r\n\r\ndef non_duplicated_values(values)\r\n # Write your code here\r\n out_arr = values\r\n values.each do |x|\r\n n = values.select {|y| y == x}\r\n if n.length > 1\r\n out_arr.delete_if {|y| y == x}\r\n end\r\n end\r\n return out_arr\r\nend\r\n\r\n\r\n# Check if all elements in an array are Fixnum\r\n\r\ndef array_of_fixnums?(array)\r\n # Write your code here\r\n n = 0\r\n n = array.select {|x| x.is_a?(String) }\r\n if n.length == 0\r\n return true\r\n else \r\n return false\r\n end \r\nend\r\n\r\n\r\n# Kaprekar's Number\r\n\r\ndef kaprekar?(k)\r\n k2 = k**2\r\n n = \"#{k}\".length\r\n num_digits_k2 = \"#{k2}\".length\r\n right_n = k2 % (10**n)\r\n left = k2 / (10**n)\r\n k == (right_n + left)\r\nend\r\n\r\n\r\n# Number shuffle\r\n\r\ndef number_shuffle(number)\r\n # your code here\r\n len = \"#{number}\".length\r\n arr = []\r\n i = 0\r\n num = 1\r\n len.times do \r\n x = number % 10**(i+1)\r\n arr[i] = x / (10**i)\r\n i = i + 1\r\n num = num * i\r\n end\r\n result = []\r\n loop do \r\n if result.length == num\r\n break\r\n else\r\n x = arr.shuffle\r\n y = 0\r\n i = 10**(arr.length-1)\r\n x.each do |k|\r\n y = y + (k * i)\r\n i = i / 10\r\n end\r\n result.push(y)\r\n result = result.uniq\r\n end\r\n end\r\n return result.sort\r\nend\r\n\r\n\r\n# Time to run code\r\n\r\ndef exec_time(proc)\r\n # your code here\r\n h = Time.now\r\n puts proc.call\r\n n = Time.now\r\n return n - h \r\nend\t\r\n\r\n\r\n# Your sum\r\n\r\nclass MyArray\r\n attr_reader :array\r\n\r\n def initialize(array)\r\n @array = array\r\n end\r\n\r\n def sum(initial_value = 0)\r\n if block_given?\r\n res = initial_value\r\n array.each do |i|\r\n res = res + yield(i)\r\n end\r\n return res\r\n else\r\n res = initial_value\r\n array.each do |i|\r\n res = res + i\r\n end\r\n return res\r\n end\r\n end\r\nend\r\n\r\n\r\n# Orders and costs\r\n\r\nclass Restaurant\r\n def initialize(menu)\r\n @menu = menu\r\n end\r\n\r\n def cost(*orders)\r\n # your code here\r\n total = 0\r\n orders.each do |ord|\r\n ord.each do |i, q|\r\n p = @menu[i]\r\n c = p * q\r\n total = total + c\r\n end\r\n end\r\n return total\r\n end\r\nend\r\n\r\n\r\n# Enough Contrast?\r\n\r\nclass Color\r\n attr_reader :r, :g, :b\r\n def initialize(r, g, b)\r\n @r = r\r\n @g = g\r\n @b = b\r\n end\r\n\r\n def brightness_index\r\n # your code here\r\n return ( 299 * r + 587 * g + 114 * b) / 1000\r\n end\r\n\r\n def brightness_difference(another_color)\r\n #your code here\r\n return (brightness_index - another_color.brightness_index).abs\r\n end\r\n\r\n def hue_difference(another_color)\r\n #your code here\r\n return ((r - another_color::r).abs + (g - another_color::g).abs + (b - another_color::b).abs)\r\n end\r\n\r\n def enough_contrast?(another_color)\r\n # your code here\r\n if brightness_difference(another_color) > 125 && hue_difference(another_color) > 500 \r\n true\r\n else\r\n false\r\n end\r\n end\r\nend\r\n\r\n\r\n",
"title": ""
},
{
"docid": "f712d49ec6c615538b2e2aa846391fda",
"score": "0.63420933",
"text": "def challenge; end",
"title": ""
},
{
"docid": "af5213168e0ee82b120bec44b2735af5",
"score": "0.6295653",
"text": "def solution(a)\n size = 0\n value = -1\n (0..(a.length-1)).each do |i|\n if(size == 0)\n size = 1\n value = a[i]\n else\n if(value != a[i])\n size = size - 1\n else\n size = size + 1\n end\n end\n end\n\n candidate = -1\n leader = -1\n count = 0\n leader_indices = []\n\n if(size > 0)\n candidate = value\n end\n\n (0..(a.length-1)).each do |i|\n if a[i] == candidate\n count = count + 1\n end\n leader_indices << count\n end\n\n if count > (a.length/2)\n leader = candidate\n end\n\n leaders_count = 0\n\n if(leader != -1)\n (0..(a.length-1)).each do |i|\n a_1 = a[0..i]\n a_2 = a[(i+1)..(a.length-1)]\n\n count_2 = leader_indices[i]\n\n # puts \"count_2 #{count_2} , count #{a_1.length/2}\"\n # puts \"count_2 #{count_2} , (count-count_2) #{(count-count_2)}, count #{(a_2.length/2)}\"\n\n if count_2 > (a_1.length/2) && (count-count_2) > (a_2.length/2)\n leaders_count = leaders_count + 1\n end\n\n # puts leaders_count\n # puts\n end\n end\n\n leaders_count\nend",
"title": ""
},
{
"docid": "4f7342b3592ec209d29fa49774767bb7",
"score": "0.62883687",
"text": "def solve\n d = %w(1 2 3 4 5 6 7 8 9).permutation.map {|i| i.join}.select {|i| i >= '918273645'}.reverse\n \n d.each do |i|\n 1.upto( 4 ) do |j|\n s = i[0, j]\n n = s.to_i\n\n 2.upto( 5 ) do |k|\n s += (k * n).to_s\n return i.to_i if i == s # puts \"%s (1..%d x %d)\" % [i, k, n]\n\n break if !i.start_with?( s )\n end\n end\n end\n end",
"title": ""
},
{
"docid": "fcdc7a5e867d3db0a4e4c61dc4d4da37",
"score": "0.6273927",
"text": "def solution(a)\n # write your code in Ruby 1.9.3\n go_east = 0\n pass = 0\n a.each do |x|\n if x == 0\n go_east += 1\n else\n pass += go_east\n if pass > 100000\n return -1\n end\n end\n end\n\n return pass\n\nend",
"title": ""
},
{
"docid": "c3cb3e948c27b241ea4299b2df1fa4b3",
"score": "0.62666726",
"text": "def solution5(input)\n end",
"title": ""
},
{
"docid": "c3cb3e948c27b241ea4299b2df1fa4b3",
"score": "0.62666726",
"text": "def solution5(input)\n end",
"title": ""
},
{
"docid": "24f189fd6b3cfc4aaa92f93d03441d85",
"score": "0.6235722",
"text": "def solution(a)\n zeroes = 0\n passes = 0\n a.each do |c|\n zeroes += 1 if c == 0\n passes += zeroes if c == 1\n return -1 if passes > 1000000000\n end\n passes\nend",
"title": ""
},
{
"docid": "95c5d00f6fd8f5d6f4b7368744a1a4b6",
"score": "0.62274164",
"text": "def solution2(input)\n end",
"title": ""
},
{
"docid": "95c5d00f6fd8f5d6f4b7368744a1a4b6",
"score": "0.62274164",
"text": "def solution2(input)\n end",
"title": ""
},
{
"docid": "2d1f5ffbab8c86bc000cce7ee42c2003",
"score": "0.62246716",
"text": "def solution(array)\n array.sort!\n return 0 if array.length == 1 && array.first != 1\n length = array.length\n start = 1\n length.times do |n|\n if array[start-1] != n + 1\n return 0\n end\n start += 1\n end\n return 1\nend",
"title": ""
},
{
"docid": "7a007b872ce37620e3363cea2761da98",
"score": "0.6190897",
"text": "def solution(a)\n # write your code in Ruby 2.2\n sum = a.inject(0, :+)\n n = a.length\n expected = n * (n+1)/2\n diff = sum - expected\n missing = n + 1 - diff\nend",
"title": ""
},
{
"docid": "0b7a616cc7822be314b767ef2b841fa3",
"score": "0.6185495",
"text": "def solution3(input)\n end",
"title": ""
},
{
"docid": "4ad68ebce1b425c551899d5fbdae814f",
"score": "0.61786044",
"text": "def solution(arr)\n\nend",
"title": ""
},
{
"docid": "15a47b49e9abd1e4a0e1f3149d80bbf9",
"score": "0.6175153",
"text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n letters = { 'A' => 1, 'C' => 2, 'G' => 3, 'T' => 4 }\n n = s.size\n res = []\n\n p_sums = Hash.new { |k,v| k[v] = Array.new(n + 1, 0) }\n\n letters.keys.each do |letter|\n for i in 1..n do\n p_sums[letter][i] = p_sums[letter][i -1]\n p_sums[letter][i] += 1 if s[i-1] == letter\n end\n end\n # puts \"#{p_sums}\"\n\n i = 0\n for i in i..p.size-1 do\n # puts \"== #{i}\"\n letters.keys.each do |k|\n # puts \"#{k} | P: #{p[i]} Q: #{q[i]} | #{p_sums[k][p[i]]} #{p_sums[k][q[i]+1]}\"\n if p_sums[k][p[i]] != p_sums[k][q[i]+1]\n res << letters[k]\n break\n end\n end\n end\n res\n\n \nend",
"title": ""
},
{
"docid": "c3a6c4ddb76579e45e3cbe80fba426be",
"score": "0.6159578",
"text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n\r\n l=a.count-1\r\n arr=[]\r\n \r\n \r\n loop do\r\n arr[a[l]-1] = a[l]\r\n \r\n l-=1\r\n break if l<0\r\n end\r\n \r\n if arr.count == a.count\r\n return 1\r\n else\r\n return 0\r\n end\r\n \r\n \r\nend",
"title": ""
},
{
"docid": "49552ab2769a4e7e83c75ae7c3fe0900",
"score": "0.61415195",
"text": "def solution(a)\n size = 0\n value = -1\n (0..(a.length-1)).each do |i|\n if(size == 0)\n size = 1\n value = a[i]\n else\n if(value != a[i])\n size = size - 1\n else\n size = size + 1\n end\n end\n end\n\n candidate = -1\n leader = -1\n count = 0\n index = -1\n\n if(size > 0)\n candidate = value\n end\n\n (0..(a.length-1)).each do |i|\n if a[i] == candidate\n count = count + 1\n index = i\n end\n end\n\n if count > (a.length/2)\n leader = candidate\n else\n index = -1\n end\n\n index\nend",
"title": ""
},
{
"docid": "4a21fd90da81a02895a7e32078bf0946",
"score": "0.61330414",
"text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n \r\n i=0;\r\n l=a.count\r\n arr=[]\r\n p=0\r\n loop do\r\n arr[a[i]-1] = a[i]\r\n i+=1\r\n \r\n if(i==l)\r\n k=1;\r\n \r\n for j in arr\r\n if(k!=j)\r\n p=k\r\n break\r\n end\r\n k+=1\r\n end\r\n \r\n break\r\n end\r\n end\r\n \r\n \r\n p\r\nend",
"title": ""
},
{
"docid": "cef825fbfb3afa754f79670aa333d6ef",
"score": "0.6105981",
"text": "def solution(a)\n east = 0\n west = 0\n passing = 0\n for i in a\n case i\n when 0\n east += 1\n when 1\n west += 1\n passing += east\n end\n return -1 if passing > 1_000_000_000\n end\n passing\nend",
"title": ""
},
{
"docid": "0e4cda0adbc8b5aecd2938d89a067613",
"score": "0.61040074",
"text": "def solution(s)\n\nend",
"title": ""
},
{
"docid": "6f367f283462dbe1cd9f98c60df8033e",
"score": "0.61026967",
"text": "def solution(a)\n return [] if a.empty?\n target = -zero_sum(a)\n output = a\n sum = 0\n i = 0\n while sum != target\n if (target - sum) % (-2) ** i != 0\n output << 1\n sum +=1\n else\n\n end\n end\nend",
"title": ""
},
{
"docid": "ae10f5e1641f5047aa611f426748fe1d",
"score": "0.60993445",
"text": "def solution(s)\n # write your code in Ruby 2.2\n len = s.length\n return 0 if len == 1\n return -1 if len % 2 == 0\n \n mid = s.length / 2\n (0...mid).each do |i|\n j = len - 1 - i\n return -1 if s[i] != s[j]\n end \n \n mid\nend",
"title": ""
},
{
"docid": "afb7c27a8561349d77eac5d9bd751021",
"score": "0.6093756",
"text": "def solution(a)\n # write your code in Ruby 2.2\n east = 0\n pass = 0\n \n a.each do |dir|\n if dir == 0\n east += 1\n else\n pass += east\n return -1 if pass > 1000000000\n end\n end\n \n pass\nend",
"title": ""
},
{
"docid": "5f8f7bef44de8c5fbf543c1650f70262",
"score": "0.60923356",
"text": "def problem_9(sum)\n array = []\n # Divide the number by two and then subtract one \n # to ensure there are no zeros in the triplet.\n ((sum / 2) - 1).downto(1) { |n| array << n }\n\n # Iterate through possible c values. \n array.each do |c|\n remainder = sum - c\n # Create and iterate another array to run through the \n # difference of the sum and c. \n array2 = (1..remainder).to_a\n array2.each do |a|\n b = remainder - a\n if (a**2 + b**2 == c**2)\n return puts a, b, c\n end\n end\n end\nend",
"title": ""
},
{
"docid": "4871d41491c1924c30e4fb427988073d",
"score": "0.6092284",
"text": "def solution(s)\n result = 'Funny'\n s = s.codepoints\n r = s.reverse\n\n for i in (1..s.length - 1)\n sum1 = (s[i] - s[i-1]).abs\n sum2 = (r[i]- r[i-1]).abs\n if sum1 != sum2\n result = 'Not Funny'\n break\n end\n end\n\n result\nend",
"title": ""
},
{
"docid": "ce13cdc311c17978cf37cab76555386d",
"score": "0.60901916",
"text": "def challenge\n end",
"title": ""
},
{
"docid": "d198ce6530d8641577166dd071790bfa",
"score": "0.60851383",
"text": "def hard(string)\n sum = 0\n steps = string.length / 2\n string.length.times do |i|\n j = (i + steps) % string.length\n sum += check(string[i], string[j])\n end\n sum\nend",
"title": ""
},
{
"docid": "f8b13ae90c3f70410bf86714d6d49eef",
"score": "0.6084904",
"text": "def solution(n)\n # write your code in Ruby 2.2\n s = n.to_s(2) \n zeroes = s.split('1') \n zeroes.pop if !n.odd? \n return 0 if zeroes.empty? \n zeroes.map { |x| x.length}.max\nend",
"title": ""
},
{
"docid": "07a10d2fcc160a93377ffbd3e8801775",
"score": "0.6083653",
"text": "def solve(input)\n numbers = input.to_s.split(\"\").map(&:to_i)\n length = numbers.size\n first = numbers[0]\n\n total = 0\n\n step = length / 2\n numbers.each_with_index do |number, index|\n next_position = (index + step) % length\n if numbers[next_position] == number\n total += number\n end\n end\n\n total\nend",
"title": ""
},
{
"docid": "19bcd70b66be6f77d40897ae7a005569",
"score": "0.60804284",
"text": "def solution(a)\n east = 0\n passing = 0\n a.each { |v| \n case v\n when 0\n east += 1\n when 1\n passing += east\n return -1 if passing > 1_000_000_000\n end\n }\n passing\nend",
"title": ""
},
{
"docid": "72bb3b989efb9ec765190d8962bff157",
"score": "0.6060851",
"text": "def solution(a)\n # write your code in Ruby 1.9.3\n count = Array.new(a.length,0)\n a.each do |e|\n return 0 if e > a.length\n count[e-1] += 1 \n end\n \n (1..count.length-1).each do |i|\n return 0 if count[i]!=1 || count[i] > 1\n end\n \n return 1\nend",
"title": ""
},
{
"docid": "1c498ff5848b8ea7cad89ed3ead7eed4",
"score": "0.60543334",
"text": "def solution(a)\n max = a.length + 1\n (1 + max) * max / 2 - a.inject(0, &:+)\nend",
"title": ""
},
{
"docid": "e332393e33f7fc2992053e0a24864665",
"score": "0.6052753",
"text": "def rps_tournament_winner(input_encoded)\n lookup_list=Hash[\"rr\"=>0,\"sr\"=>1,\"pr\"=>0,\"rs\"=>0,\"ss\"=>0,\"ps\"=>1,\"rp\"=>1,\"sp\"=>0,\"pp\"=>0]\n xx=input_encoded.flatten.each_slice(2).to_a.each_slice(2).to_a\n\n #d is the variable that holds the size of the flattened input array.\n #Since each entry in input array consists of two elements: Name and strategy\n #Iterations required are the output value of exp_value (d)-1\n\n d=input_encoded.flatten.size\n iteration=exp_value(d)-1\n for round in 0..(iteration-1)\n c=Array.new(xx.size)\n for i in 0..((xx.size)-1)\n input=xx[i]\n string_check=(\"#{input[0][1]}\"+\"#{input[1][1]}\").downcase\n c[i]=input[lookup_list[string_check]]\n end\n d=c.flatten.size\n xx=c.flatten.each_slice(2).to_a.each_slice(2).to_a\n end\n puts \"#{xx}\"\nend",
"title": ""
},
{
"docid": "200b676337f3c42b05ef229f1de10cfe",
"score": "0.6047759",
"text": "def solution(s)\n binary_digits = s.length\n sum = 0\n decimal = 0\n s.split(//).each do |digit|\n binary_digits -= 1\n decimal = digit.to_i*(2**binary_digits)\n sum += decimal\n end\n\n number_of_steps = 0\n\n while sum != 0 do\n if sum % 2 == 0\n (sum /= 2)\n number_of_steps += 1\n else\n sum -= 1\n number_of_steps += 1\n end\n end\n return number_of_steps\nend",
"title": ""
},
{
"docid": "6c75c688a8c9abcf195476c507e9ea45",
"score": "0.6045781",
"text": "def solution(a)\n leader, count = array_leader(a)\n return 0 unless leader\n\n n = a.size\n head_count = 0\n total_equis = 0\n a.each_with_index do |e, i|\n head_count += 1 if e == leader\n tail_count = count - head_count\n\n if (head_count > (i + 1)/2) && (tail_count > (n - 1 - i)/2)\n total_equis += 1\n end\n end\n\n total_equis\nend",
"title": ""
},
{
"docid": "fbbbcb3b0e2fef3847603a76fc2312d6",
"score": "0.6036726",
"text": "def day_1_part_2(sequence)\n sequence_digits = sequence.chars.map(&:to_i)\n sequence_digits_reference = sequence_digits * 2\n\n sum = 0\n\n sequence_digits.each.with_index do |digit, i|\n sum += digit if digit == sequence_digits_reference[i + sequence.length / 2]\n end\n\n sum\nend",
"title": ""
},
{
"docid": "3f0b67819d2d89164741586a25635d60",
"score": "0.60295814",
"text": "def return_base_candidate(base_char, base_counter, target_char_arr)\n base_candidate = []\n target_counter = 0\n target_char_arr.each do |target_char|\n verdict = base_char == target_char\n base_candidate << (base_counter - target_counter).abs if verdict\n target_counter += 1\n end\n base_candidate\nend",
"title": ""
},
{
"docid": "32a0ef79e59e9f9547a01b3fcc7312dd",
"score": "0.60269624",
"text": "def solution(a)\n acc = 0\n sum = 0\n\n a.each do |n|\n if n == 0\n acc += 1\n else\n sum += acc\n end\n\n return -1 if sum > 1000000000\n end\n\n sum\nend",
"title": ""
},
{
"docid": "285d2e49c760ed24f2673411b06f6a8c",
"score": "0.60246056",
"text": "def solve(arr)\n\n result = []\n\n arr.each do |i|\n if i < 38\n result << i\n else\n mg1 = i+1\n mg2 = i+2\n if mg1%5 == 0\n result << mg1\n elsif mg2%5 == 0\n result << mg2\n else\n result << i\n end\n end\n end\n\n result.each do |r|\n puts r\n end\n\nend",
"title": ""
},
{
"docid": "184978b34707e2c9d190e35b6305dd56",
"score": "0.60239106",
"text": "def solution(n)\n a = n.to_s(2).split('')\n count, start, store = 0,0,0\n a.each do |i|\n start = 1 if i == '1' && count == 0\n count +=1 if i == '0' && start ==1\n if i=='1' && count > 0\n store = count if count > store\n count = 0\n end\n end\n store\nend",
"title": ""
},
{
"docid": "c521b44b316f68b7464f276a8f17939d",
"score": "0.60067403",
"text": "def find_judge_imp(n, trust)\n return -1 if trust.length < n - 1\n return n if trust.empty?\n \n degree = Array.new(n+1, 0)\n trust.each do |t|\n degree[t[0]] -= 1\n degree[t[1]] += 1\n end \n \n (0..n).each do |i|\n return i if degree[i] == n-1\n end\n return -1\nend",
"title": ""
},
{
"docid": "1f0955975a10a26277bd0d9fb51a00f1",
"score": "0.59950626",
"text": "def solution(s)\n t = 0\n (s.length / 3).times do |i|\n slice = s[(3 * i)..(3 * i + 2)]\n t += 1 if slice[0] != 'S'\n t += 1 if slice[1] != 'O'\n t += 1 if slice[2] != 'S'\n end\n t\nend",
"title": ""
},
{
"docid": "c678e24ba57401e9767d528691bd7aa1",
"score": "0.5992472",
"text": "def solution(a)\n n = a.length\n\n expected_sum = (1 + n) * ( n / 2 )\n if n % 2 != 0\n expected_sum += (n / 2.0).ceil\n end\n\n (expected_sum == a.sum) ? 1 : 0\nend",
"title": ""
},
{
"docid": "d03588aa68750f6833edf819df1446ea",
"score": "0.59907126",
"text": "def get_challenge_answer(var1)\n string = '' + var1\n array = string.split('')\n array = array.reverse\n last_digit = array[0].to_i\n array = array.sort\n min_digit = array[0].to_i\n subvar1 = (2 * array[2].to_i) + (array[1].to_i)\n subvar2 = (2 * array[2].to_i).to_s + array[1]\n power = ((array[0].to_i * 1) + 2) ** array[1].to_i\n x = (var1.to_i * 3 + subvar1)\n y = Math.cos(Math::PI * subvar1)\n answer = x * y\n answer -= power\n answer += (min_digit - last_digit)\n answer = answer.floor.to_s + subvar2\n return answer\nend",
"title": ""
},
{
"docid": "d72ccae3f326a4e3222492869096fb16",
"score": "0.5984456",
"text": "def day_one_part_one(input)\n n = input.strip.split('')\n\n\n # ------- SOL 1 ------\n # puts \"n is #{n}\"\n # puts \"n.rotate(1) is #{n.rotate(1)}\"\n # puts \"n.zip(n.rotate(1)) is #{n.zip(n.rotate(1))}\"\n puts n.zip(n.rotate(1))\n .select { |x, y| x == y }\n .map(&:first)\n .map(&:to_i)\n .inject(:+)\n # ------- SOL 2 ------\n # puts \"n.each_cons(2).to_a is #{n.each_cons(2).to_a}\"\n # puts \"n.each_cons(2).to_a.select { |x, y| x == y } is #{n.each_cons(2).to_a.select { |x, y| x == y }}\"\n # puts \"n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first) is #{n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first)}\"\n # puts \"n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first).map(&:to_i) is #{n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first).map(&:to_i)}\"\n # n << n.first\n # puts n.each_cons(2).to_a\n # .select { |x, y| x == y }\n # .map(&:first)\n # .map(&:to_i)\n # .inject(:+)\n #\n # ------- SOL 3 ------\n # sum = 0\n # digits = input.strip.split('')\n # digits.each_index do |i|\n # if i == digits.size - 1\n # sum += digits.last.to_i if digits.last == digits.first\n # elsif digits[i] == digits[i + 1]\n # sum += digits[i].to_i\n # end\n # end\n # puts sum\nend",
"title": ""
},
{
"docid": "578a4c2088c4d8ec64fbe2465745ad9e",
"score": "0.5980696",
"text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #0 -east\r\n #1 - west\r\n \r\n\r\n\r\n arr=[]\r\n n=0\r\n a.each_with_index{|el,i|\r\n \r\n if(el==0)\r\n j=i\r\n loop do\r\n if (a[j] == 1)\r\n n+=1\r\n end\r\n \r\n j+=1 \r\n break if j==a.count \r\n end\r\n \r\n end\r\n \r\n }\r\n \r\n n\r\nend",
"title": ""
},
{
"docid": "b2d1c4efb0ce3d7f6e9ed6262fcfe11a",
"score": "0.5972506",
"text": "def solve(a)\n # Complete this function\n $sum_1=0\n for i in (0..a.size/2-1)\n \t#puts \"a->#{a[i]}\"\n \t$sum_1=$sum_1+a[i]\n\n end\n #puts $sum\n $sum_2=0\n for i in (a.size/2..a.size-1)\n \t#puts \"b->#{a[i]}\"\n $sum_2=$sum_2+a[i]\n end\n #puts $sum\n $temp=$sum_1-$sum_2\n if $temp < 0\n \treturn $temp*-1\n else\n \treturn $temp\n end\n\nend",
"title": ""
},
{
"docid": "104712d8379b7721c9708b9ad8ec479e",
"score": "0.5945643",
"text": "def solution(a)\n return 0\nend",
"title": ""
},
{
"docid": "fdc30d52c9adc32c82e291f2f3bc3b99",
"score": "0.5945632",
"text": "def problem206\n Math.sqrt(1020304050607080900).floor.upto(m = Math.sqrt(1929394959697989990).ceil) do |x|\n if (s = x.to_s)[s.length - 1].to_i % 2 == 0\n puts \"#{x} of #{m}\"\n q = x**2\n if(s = q.to_s)[18].to_i == 0 && s[16].to_i == 9 && s[14].to_i == 8 && s[12].to_i == 7 && s[10].to_i == 6 && s[8].to_i == 5 && s[6].to_i == 4 && s[4].to_i == 3 && s[2].to_i == 2\n puts s\n break\n end\n end\n end\nend",
"title": ""
},
{
"docid": "48f6ccd13854a541bfcb18ff7c741f02",
"score": "0.5939194",
"text": "def part1(input)\n twos = threes = 0\n\n # For each ID, bucket each char and count their instances within the ID.\n # Originally, I'd tried to sort the chars and use a regex, but getting\n # around the awkwardness of backtracking and detecting the twos that aren't\n # also threes (or more) wasn't worth the effort on this exercise.\n input.each do |id|\n counts = id.chars.group_by(&:to_s).values.map(&:size)\n\n twos += 1 if counts.include?(2)\n threes += 1 if counts.include? (3)\n end\n\n return twos * threes\nend",
"title": ""
},
{
"docid": "01d65f828880f2b3ce5cccb589374205",
"score": "0.5929225",
"text": "def problem30\n total = 0\n (10..1000000).each{|n|\n total += n if n == n.to_s.split(\"\").inject(0){|sum,d|sum+=d.to_i**5}\n }\n total\nend",
"title": ""
},
{
"docid": "ebe5a0091303805783ef29b8c45ffb08",
"score": "0.59289664",
"text": "def pe43()\ntotal = 0\narr = [0,1,2,3,4,5,6,7,8,9].permutation\narr.each do |e|\n\tif(e[1..3].join.to_i % 2 != 0) then next end\n\tif(e[2..4].join.to_i % 3 != 0) then next end \n\tif(e[3..5].join.to_i % 5 != 0) then next end \n\tif(e[4..6].join.to_i % 7 != 0) then next end \n\tif(e[5..7].join.to_i % 11 != 0) then next end \n\tif(e[6..8].join.to_i % 13 != 0) then next end \n\tif(e[7..9].join.to_i % 17 != 0) then next end\n\tprintf \"answer %s\\n\", e\n\ttotal += e.join.to_i\n\t#p e\n\tend\n\tprintf \"the total is %d\\n\", total\nend",
"title": ""
},
{
"docid": "9c87bfaded8d5e5ad5b9ba746d98f4e7",
"score": "0.59270376",
"text": "def proof_of_work(previous_proof)\n # Find a number that when multiplied by the previous proof,\n # the hash has 4 leading 0s\n proof = 0\n\n while validate_proof(previous_proof, proof) == false\n proof += 1\n end\n\n return proof\n\n end",
"title": ""
},
{
"docid": "56e2f4c229d68e9d667cf5f5fe1d2177",
"score": "0.5923421",
"text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #a[0] = 1 [-1..1]\r\n #a[1] = 5 [-4..6]\r\n #a[2] = 2 [0..4]\r\n #a[3] = 1 [2..4]\r\n #a[4] = 4 [0..8]\r\n #a[5] = 0 [0]\r\n\r\n i=0\r\n arr=[]\r\n while(i<a.count) do\r\n \r\n arr[i] = (i-a[i].. i+a[i]).to_a\r\n i+=1 \r\n end\r\n \r\n \r\n \r\n l=arr.count\r\n i=0\r\n n=0\r\n while(i<l) do\r\n \r\n \r\n j=i+1\r\n while(j<l) do\r\n if(arr[i] != arr[j])\r\n \r\n if((arr[i] & arr[j]).empty? == false)\r\n n+=1\r\n end\r\n end\r\n j+=1\r\n end \r\n i+=1\r\n end\r\n n\r\nend",
"title": ""
},
{
"docid": "354acc44d23902170d18ef50bb27f5b1",
"score": "0.59163696",
"text": "def dynamic_programming(sorted)\n acc = { sorted.length - 1 => 1 }\n result = 1\n (2..sorted.length).each do |offset|\n (sorted.length - offset + 2...sorted.length).each do |index|\n break unless sorted[index] - sorted[sorted.length - offset] <= 3\n\n result += acc[index]\n end\n acc[sorted.length - offset] = result\n end\n result\nend",
"title": ""
},
{
"docid": "acbebb5b33f0957604a4206455455999",
"score": "0.5915858",
"text": "def solution(array)\n array.sort!\n current = 1\n (0..array.size).step(1) do |n|\n return current unless array[n] == current\n\n current += 1\n end\nend",
"title": ""
},
{
"docid": "41d8272b7c7b14be391f11bb61b8cafe",
"score": "0.59124434",
"text": "def solution(a)\n # write your code in Ruby 2.2\n \n counter = 0\n\ttotal = 0\n\t\n\ta.each do |car|\n\t\tcar == 0 ? counter += 1 : total += counter\n\tend\n\t\n\treturn total > 1_000_000_000 ? -1 : total\nend",
"title": ""
},
{
"docid": "e4bf969521382732ac79be40ffa78c87",
"score": "0.59077924",
"text": "def solution(a)\r\n ones=0\r\n temp=0\r\n ans=0\r\n for i in 0...a.size\r\n if a[i]==1\r\n ones+=1\r\n end\r\n end\r\n \r\n for i in 0...a.size\r\n if a[i]==1\r\n temp+=1\r\n else\r\n ans+=(ones-temp)\r\n end\r\n end\r\n \r\n if ans>1000000000\r\n return -1\r\n else\r\n return ans\r\n end\r\n \r\n \r\nend",
"title": ""
},
{
"docid": "08fde3cd0f8d93fdc1cda3060c4f5885",
"score": "0.590529",
"text": "def greedy_canoe_a(w, max_load)\n skinny, fat = [], []\n\n # Divide w into 2 arrays: skinny, fat\n w.size.times do |i|\n if w[i] + w[-1] <= max_load\n skinny << w[i]\n else\n fat << w[i]\n end\n end\n\n # fat << w[-1] <---mistake in Codility 14-GreedyAlgorithms PDF?\n canoes = 0\n\n while skinny.any? || fat.any?\n puts \"Skinny: #{skinny}, Fat: #{fat}\"\n # put heaviest skinny guy w/ heaviest fat guy\n s = skinny.any? ? skinny.pop : ''\n f = fat.pop\n puts \"Put #{s}, #{f} in 1 canoe\"\n canoes += 1\n\n # after enmptying \"fat\", move heaviest skinny guy back to \"fat\"\n if skinny.any? && fat.empty?\n fat << skinny.pop\n end\n\n # if lightest + heaviest fat guys can fit in canoe,\n # move lightest fat guy to \"skinny,\" so next loop pairs them\n while fat.size > 1 && fat[0] + fat[-1] <= max_load\n skinny << fat.shift\n end\n end\n puts \"Total canoes: #{canoes}\"\n canoes\nend",
"title": ""
},
{
"docid": "6414c693e1602d119655d47413c7c8b6",
"score": "0.5896923",
"text": "def bubunwa\n n, target = gets.chomp.split(\" \").map(&:to_i)\n value = gets.chomp.split(\" \").map(&:to_i)\n dp = Array.new(n+1){ Array.new(target+1, 0) }\n dp[0][0] = 1\n\n n.times do |i|\n (target+1).times do |j|\n dp[i+1][j] |= dp[i][j]\n dp[i+1][j] |= dp[i][j-value[i]] if j >= value[i]\n end\n end\n\n print(dp)\n dp[n][target] == 1 ? 'YES' : 'NO'\nend",
"title": ""
},
{
"docid": "4eca9f41696aadce1b24ca5fa0f6a46b",
"score": "0.58951676",
"text": "def solve input \n return 0 if input <= 1\n return 1 if input == 2\n \n total_slices = 1\n step = 1\n \n 3.upto(input) do |i|\n step += 1 if i%2 == 0\n total_slices += step\n \n end\n\n total_slices\nend",
"title": ""
},
{
"docid": "4ddb265e96896424132c7b9abe9713d5",
"score": "0.5889254",
"text": "def ArithGeo_2(arr)\n#test for arithmetic sequence first\n #sum from i = 1 to n, = n(n+1) / 2 for sum of 1 .. n\n #general sum of an arithmetic sequence\n #a[1] - a[0] = delta\n #a[0] = a\n #arr.size = n\n #sum = a * n + delta( n(n-1) / 2 )\n sum = arr.sum\n arith_sum = arr[0] * arr.size + (arr[1] - arr[0]) * ((arr.size - 1) * (arr.size) / 2 )\n return \"Arithmetic\" if sum == arith_sum\n\n#test for geometric sequence next\n #sum from i = 1 to n, = { (a * (1 - r ** n) ) / (1 - r) }\n r = arr[1] / arr[0]\n a = arr[0]\n n = arr.size\n geo_sum = (a * (1 - (r ** n)) ) / (1 - r) if r != 1\n if r == 1\n return \"-1\"\n end\n return \"Geometric\" if geo_sum == sum\n\n\n return \"-1\"\nend",
"title": ""
},
{
"docid": "22a12438f1c1fc5bbca224af53e738d8",
"score": "0.58873016",
"text": "def solution(a, b)\r\n @a = a\r\n @b = b\r\n \r\n if @a.length < @b.length\r\n return @a + @b + @a\r\n \r\n elsif @b.length < @a.length\r\n return @b + @a + @b\r\n \r\n else\r\n return @a + @b\r\n end\r\nend",
"title": ""
},
{
"docid": "3256c76ba31f5643a4632fa9ba1bcd11",
"score": "0.5880504",
"text": "def threesome (input_array)\r\n\tarr = input_array\r\n\tlen = arr.length\r\n\tif len >= 3 \r\n\t\tfor i in 0..(len-3)\r\n\t\t\tfor j in (i+1)..(len-2)\r\n\t\t\t\tfor k in (j+1)..(len-1)\r\n\t\t\t\t\tsum = arr[i] + arr[j] + arr[k]\r\n\t\t\t\t\tif sum == 0\r\n\t\t\t\t\t\tputs true\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\tputs false\r\nend",
"title": ""
},
{
"docid": "a64e225ff27690e4334e4c789e82bae5",
"score": "0.5870071",
"text": "def solution(n)\r\n # write your code in Ruby 2.2\r\n # puts n\r\n binary = n.to_s(2)\r\n count = 0\r\n temp = 0\r\n \r\n for i in 0..(binary.size)\r\n if binary[i] == \"0\" and binary[i..-1].end_with?(\"1\")\r\n count += 1\r\n else\r\n temp = count if count > temp\r\n count = 0\r\n end\r\n end\r\n temp\r\nend",
"title": ""
},
{
"docid": "4adcd8ce1f663221c3c23c720e9dae18",
"score": "0.5868494",
"text": "def solution(n)\n counter_array = Array.new(n.size+1, 0)\n n.each do |v|\n counter_array[v-1] = 1\n end\n counter_array.find_index(0) + 1\nend",
"title": ""
},
{
"docid": "2a39b32806655d53c64ca78880cebe8a",
"score": "0.58605033",
"text": "def solution3\n large_num = 600_851_475_143\n\n i = 2\n\n loop do\n large_num /= i if large_num % i == 0\n i += 1\n break if i > large_num / 2\n end\n\n large_num\nend",
"title": ""
},
{
"docid": "6125bfd7debc7af3d6a8a4bffb8ddc0a",
"score": "0.58596975",
"text": "def solution(n)\n # write your code in Ruby 2.2\n b = n.to_s(2)\n a = []\n incr = 0\n s = false\n b.each_char do |char|\n if char == '1'\n if s\n a.push(incr)\n incr = 0\n\n else\n s = true\n end\n else\n incr += 1\n end \n end\n a.max || 0\nend",
"title": ""
},
{
"docid": "c47af476a1c9c548b894a4c7c45b09cc",
"score": "0.58594406",
"text": "def solution(a)\n # write your code in Ruby 2.2\n return a[0] if a.length == 1\n\n for i in 0..a.length\n unpaired = a[i + 2] if a[i+2] && a[i] != a[i+2] && a[i+2] % 2 == 0\n end\n\n return unpaired\nend",
"title": ""
},
{
"docid": "e919dd7f275dbbc97c90ea374891336c",
"score": "0.58584416",
"text": "def featured(n)\n star_num = (n / 7) + 1\n while true\n result = star_num * 7\n if result.odd? && (result.to_s.chars.uniq == result.to_s.chars)\n return result\n else\n star_num += 1\n end\n end\nend",
"title": ""
},
{
"docid": "fc35b048eb13fc75ee083d79e84ff6a6",
"score": "0.5853641",
"text": "def thirt(n)\n # your code\n remainders = [1, 10, 9, 12, 3, 4]\n rlen = 6\n num = n\n result = 0\n result_arr = []\n loop do \n num_arr = num.to_s.split('').map { |i| i.to_i}\n while remainders.length <= num_arr.length do \n remainders << (10 ** rlen) % 13\n rlen += 1\n end\n x = 0\n y = num_arr.length - 1\n temp = []\n while x < remainders.length && y >= 0 do \n temp_num = remainders[x] * num_arr[y]\n temp << temp_num\n x += 1\n y -= 1\n end\n num = temp.reduce(:+)\n if num == result_arr[-1]\n result = num \n break\n end\n result_arr << num\n end\n result \nend",
"title": ""
},
{
"docid": "3b7590210d9a83a4486ae8c8776e9f79",
"score": "0.5841965",
"text": "def processLine\n $solution = 0\n i = 0\n while $numbers[i] == 0\n i += 1\n if i == $numbers.length\n puts \"0\"#check if all 0\n end\n end\n while i < $numbers.length-1\n j = i+1\n if $numbers[j] != 0 \n i = j+1\n else\n k = j+1\n counter = 1\n while $numbers[k] == 0\n if k >= $numbers.length-1\n puts $solution\n end\n k += 1\n counter += 1\n end\n i = k\n if i <= $numbers.length-1\n $solution = $solution + ([$numbers[i], $numbers[i-counter-1]].min * counter) \n end\n end\n end\n if $solution > 0\n puts $solution\n else\n puts \"0\"\n end\nend",
"title": ""
},
{
"docid": "ad39c7d5dc657f0494a8726850275ec6",
"score": "0.58389395",
"text": "def number_joy(n)\n\n@n = n\n@counter = 0\n@int_rev = 0\n\ndef integer_total \n arr = @n.to_s.split(\"\").map(&:to_i)\n arr.each do |a| @counter += a\n end \nend\n\ndef is_harshad\n@n%@counter == 0\nend \n\ndef integer_reversed\n@int_rev = @counter.to_s.reverse.to_i\nend\n\ndef joyful_number\nreturn @n == @counter*@int_rev && @n%@counter == 0\nend\n \n\ninteger_total\ninteger_reversed\nis_harshad\njoyful_number\n\nend",
"title": ""
},
{
"docid": "f4c96d4100313827a8ea1055015b143b",
"score": "0.58352566",
"text": "def processLine\n $solution = 0\n i = 0\n while $numbers[i] == 0\n i += 1\n end\n if i == $numbers.length-1 || i == $numbers.length-2\n $solution = 0 #=>all are zero\n puts $solution\n else\n k = $numbers.length-1\n while $numbers[k] == 0\n k -= 1\n end\n if i == k || i == k-1\n $solution = 0\n puts $solution\n else\n $solution = 0\n while i < k\n while $numbers[i+1].to_i >= $numbers[i].to_i\n i += 1\n end\n break if i == k || i == k-1\n counter = 1\n j = i\n while $numbers[j+2] < $numbers[i]\n break if j+2 == k\n j += 1\n counter += 1\n end\n $solution = $solution + ([$numbers[i], $numbers[j+2]].min * counter) \n for m in (i+1)..(j+1)\n $solution = $solution - $numbers[m]\n end\n i = j+2\n end\n puts $solution\n end \n end\nend",
"title": ""
},
{
"docid": "7d39621c48b479f5655668543f90521b",
"score": "0.5831894",
"text": "def solution(x, a)\n # write your code in Ruby 2.2\n\n count = [0]*(x+1)\n sum = 0\n \n a.each_with_index do |v, i|\n if count[v] == 0\n count[v] = 1\n sum += 1\n if sum == x\n return i\n end\n end\n end\n\n return -1\nend",
"title": ""
},
{
"docid": "f8c5a632b40d696f07315ee81b737834",
"score": "0.583139",
"text": "def phasea_phase_two(group)\n #TODO implement for phase 2 in like manner\n wilds = ['AH', 'AD', 'AC', 'AS']\n c_counter = 0\n wilds_counter = 0\n card_num = nil\n\n group.each do |x|\n if wilds.include?(x)\n wilds_counter += 1\n elsif card_num.nil?\n card_num = x[1]\n c_counter += 1\n elsif x[1] == card_num\n c_counter += 1\n end\n end\n\n if group.length == 7 && c_counter >= 2 && (c_counter + wilds_counter == 7)\n 2\n else\n nil\n end\nend",
"title": ""
},
{
"docid": "a3673282e059d6bf8c5ab07271621102",
"score": "0.58215374",
"text": "def algorithm(input)\n\nend",
"title": ""
},
{
"docid": "b4cf37fd3cf4912a388c5df5860e3bb5",
"score": "0.58190376",
"text": "def solve( n = 30 )\n # Solving this with combinatorics quickly turned into a major headache.\n # Instead, tackle it inductively by considering how the total changes as\n # as each new day's trinary string is added one by one. By keeping track\n # of certain characteristics for a string of length m, we can then make\n # simple statements about how those characteristics changes when we in-\n # crease the string's length to m + 1.\n #\n # Given some (valid, \"prize\") string S to which we will prepend either L,\n # O, or A, we know the result will also be valid provided:\n #\n # o We prepend O\n # o We prepend L AND S doesn't contain L already\n # o We prepend A AND S doesn't already start with AA\n #\n # This gives us an idea of what characteristics might be helpful to record\n # for each n:\n #\n # U = count of prize S containing L\n # V = count of prize S starting with A\n # W = count of prize S starting with AA\n # X = count of U ∩ V (contains L and starts with A)\n # Y = count of U ∩ W (contains L and starts with AA)\n # Z = count of prize S\n #\n # Now we can formulate functions to take U, V, W, ... to U', V', W', etc.\n # as n increases. That is, given U_n, V_n, W_n, etc., how do we compute\n # U_(n+1), V_(n+1), W_(n+1), ...?\n #\n # Given U valid strings containing L, we know they'll remain valid after\n # we prepend O, so U' will be at least O. We also know that we can do the\n # same for A, as long as we skip S that start with AA, so we need to in-\n # crease U' by an additional U - Y. Similarly, we know we can create Z - U\n # new L strings by prepending it to existing prizes strings. So, U' will\n # be given by U' = U + (U - Y) + (Z - U) = U - Y + Z.\n #\n # To compute V', note that we will have added A to all strings except the\n # ones starting with AA, but the ones that had started with A shouldn't be\n # counted (since they will now start with AA). V' = Z - V - W.\n #\n # W' is simply the count of valid strings previously starting with A,\n # since those are the only ones that could conceivably now begin with AA.\n # W' = V. Similarly, Y' = X.\n #\n # X' must necessarily be less than U (since not all L strings will start\n # with A), and in fact, we must subtract members that had been counted,\n # since they will have had A prepended and now start with AA. Similarly,\n # we shouldn't count the Y strings toward X' either, since they will not\n # start with A now. X' = U - X - Y.\n #\n # With the first five quantities defined in terms of the previous values,\n # we can now derive a formula for the total number of valid prize strings.\n # For every valid string of length m, there will be corresponding strings\n # of length m + 1 such that:\n #\n # o it is identical except for a new leading L, except for strings that\n # already contain L (Z - U new items),\n # o it is identical except for a new leading O (Z new items), or\n # o it is identical except for a new leading A, except for strings that\n # already started with AA (Z - W new items)\n #\n # Therefore, Z' = Z - U + Z + Z - W = 3Z - U - W.\n u, v, w, x, y, z = 1, 1, 0, 0, 0, 3\n \n (n - 1).times do\n u, v, w, x, y, z = u - y + z, z - v - w, v, u - x - y, x, 3*z - u - w\n end\n\n z\n end",
"title": ""
},
{
"docid": "082f71904c5f076c9ac9f24d2e615d6e",
"score": "0.58180416",
"text": "def find(digits)\n # Generated by gen14.rb\n # 371010124515891677925107\n prefixes = [\n [3, 1, 1, 4, 9], # 0\n [7, 5, 6, 0], # 1\n [1, 1, 1, 4, 9], # 2\n [0, 1, 1, 4, 9], # 3\n [1, 1, 4, 9], # 4\n [0, 1, 4, 9], # 5\n [1, 4, 9], # 6\n [2, 1, 8, 1], # 7\n [4, 9], # 8\n [5, 6, 0], # 9\n ].map(&:freeze).freeze\n suffix = [7]\n\n # first starts at 4\n first_on_suffix = false\n first_track = prefixes[0]\n first_pos = 1\n # second starts at 13\n second_on_suffix = false\n second_track = prefixes[0]\n second_pos = 4\n\n size = 24\n next_write = 31\n\n # state_transitions: good_digits -> new_digit -> Integer (new_good_digits)\n # It's expected that we'll then index into state_transitions with new_good_digits.\n #\n # Let's skip that extra indexing and precompute it, with:\n # next_state: good_digits -> new_digit -> Array (new_digit -> Array)\n #\n # As can be seen, this will be a self-referential structure.\n # When the result is nil, we have all the digits.\n next_state = Array.new(digits.size) { [] }\n next_state.zip(state_transitions(digits)) { |dst, src|\n src.each_with_index { |new_good_digits, i|\n dst[i] = next_state[new_good_digits]\n }\n }\n next_state.each(&:freeze).freeze\n state = next_state[0]\n\n score1 = first_track[first_pos]\n score2 = second_track[second_pos]\n\n # while true is faster than loop\n # https://github.com/JuanitoFatas/fast-ruby#loop-vs-while-true-code\n while true\n new_score = score1 + score2\n\n # Normally, you'd write new_scores = new_score >= 10 ? new_score.divmod(10) : [new_score]\n # and then iterate over new_scores.\n # Instead, here we manually unroll that loop.\n # Unfortunately, the fastest way was code duplication.\n\n if new_score >= 10\n new_score -= 10\n return size + 1 - digits.size unless (state = state[1])\n if size == next_write\n suffix << 1\n next_write += 2\n end\n size += 1\n end\n\n return size + 1 - digits.size unless (state = state[new_score])\n if size == next_write\n suffix << new_score\n next_write += 1 + new_score\n end\n size += 1\n\n unless (score1 = first_track[first_pos += 1])\n first_pos = 0\n if first_on_suffix\n first_track = prefixes[next_write - size]\n first_on_suffix = false\n else\n first_track = suffix\n first_on_suffix = true\n end\n score1 = first_track[0]\n end\n unless (score2 = second_track[second_pos += 1])\n second_pos = 0\n if second_on_suffix\n second_track = prefixes[next_write - size]\n second_on_suffix = false\n else\n second_track = suffix\n second_on_suffix = true\n end\n score2 = second_track[0]\n end\n end\nend",
"title": ""
},
{
"docid": "99fb7178f1715b614ed9876d96f0e2ba",
"score": "0.5812825",
"text": "def solution(a)\n\n count = {}\n permutation = 1\n\n a.each do |a_i|\n if(count[a_i].nil?)\n count[a_i] = 0\n end\n count[a_i] = count[a_i] + 1\n end\n\n (1..a.length).each do |i|\n if count[i].nil?\n permutation = 0\n break\n end\n end\n\n permutation\nend",
"title": ""
},
{
"docid": "4b2b30e235e0baf41954bc8fd2f8997e",
"score": "0.5807528",
"text": "def solution(s)\n s = s.codepoints\n r = s.reverse\n ops = 0\n for i in 0..s.length - 1\n if s[i] != r[i]\n ops += (s[i] - r[i]).abs\n break if s == s.reverse\n end\n end\n\n ops / 2\nend",
"title": ""
},
{
"docid": "4a4eefe9eb4327fd1f51637a3d87b34e",
"score": "0.58063126",
"text": "def solution(a)\n a2 = (1..(a.size+1)).to_a\n r = a2-a\n return r.join(\"\").to_i\nend",
"title": ""
},
{
"docid": "7820c7c2d6fe0c780b15e6ae298593f1",
"score": "0.58044386",
"text": "def candies(s)\n return -1 if s.length <= 1\n s.inject(0){|sum, x| sum + (s.max-x)}\nend",
"title": ""
},
{
"docid": "4dfe50426435b1cf94c032b24eb333cc",
"score": "0.5803379",
"text": "def solution(n)\n n = n >> 1 while n % 2 == 0\n n.to_s(2).split('1').push('').max_by(&:size).size \nend",
"title": ""
},
{
"docid": "d68037289e371e5d37c017896d6d44f4",
"score": "0.58028346",
"text": "def problem_92\n hit = 0\n seen = {0 => 0, 1 => 1, 89 => 89}\n\n check = lambda do |n|\n# puts n.inspect\n index = n.join.to_i\n return 0 if index == 0\n sum = index\n until seen[sum] do\n sum = sum.to_s.each_byte.map {|b| (b-48)*(b-48)}.reduce(&:+)\n end\n# puts \"#{n} => #{seen[sum]}\"\n seen[index] = seen[sum]\n end\n\n values = lambda do |a,off|\n (a[off-1] .. 9).each do |v|\n a[off] = v\n if off == (a.length-1)\n if check.call(a) == 89\n # now many uniq permutations of 'a' are there.\n if true\n hit += a.permutations\n else\n h = {}\n a.my_permutate {|a| h[a.join] = true }\n hit += h.size\n end\n end\n else\n values.call(a,off+1)\n end\n end\n end\n\n a = Array.new(7,0)\n values.call(a,0)\n puts \"seen.length = #{seen.length}\"\n hit\nend",
"title": ""
},
{
"docid": "9b08bf7229e89a24053944eca0877096",
"score": "0.57981455",
"text": "def solution(numbers)\n results = []\n current_range = ''\n \n numbers.each_with_index do |num, idx|\n if index == 0 || (numbers[idx + 1] - num != 1 && num - numbers[idx - 1] != 1)\n results << num.to_s\n else\n \n end\n \n end\nend",
"title": ""
},
{
"docid": "e7dbd8470b8249f8dd5323ce2f51d289",
"score": "0.5797351",
"text": "def featured(n)\n (n+1).upto(9_999_999_999) do |i|\n i_as_array = i.to_s.chars\n if i.odd? &&\n i % 7 == 0 &&\n i_as_array == i_as_array.uniq\n return i\n else\n next\n end\n end\n puts \"There is no possible number that fulfills those requirements\"\nend",
"title": ""
},
{
"docid": "eda747fe4aa95ca303208ac6cbacfbab",
"score": "0.5797279",
"text": "def solution\n\n d8_10s = []\n d7_10s = []\n d6_10s = []\n d5_10s = []\n d4_10s = []\n d3_10s = []\n d2_10s = []\n d1_10s = []\n 17.step(987, 17) do |n| \n n = n.to_s.split(\"\").to_a\n n = [\"0\"] + n if n.count == 2\n d8_10s << n if n.count == n.uniq.count\n end\n \n d8_10s.uniq.each do |d8_10|\n d8_10[0..1].join.to_i.step(987, 100) do |n|\n d7 = (n/100).to_s\n if n % 13 == 0 && !d8_10.include?(d7)\n d7_10s << [d7] + d8_10\n end\n end\n end\n\n \n d7_10s.uniq.each do |d7_10|\n d7_10[0..1].join.to_i.step(987, 100) do |n|\n d6 = (n/100).to_s\n if n % 11 == 0 && !d7_10.include?(d6)\n d6_10s << [d6] + d7_10\n end\n end\n end\n \n d6_10s.uniq.each do |d6_10|\n d6_10[0..1].join.to_i.step(987, 100) do |n|\n d5 = (n/100).to_s\n if n % 7 == 0 && !d6_10.include?(d5)\n d5_10s << [d5] + d6_10\n end\n end\n end\n \n d5_10s.uniq.each do |d5_10|\n d5_10[0..1].join.to_i.step(987, 100) do |n|\n d4 = (n/100).to_s\n if n % 5 == 0 && !d5_10.include?(d4)\n d4_10s << [d4] + d5_10\n end\n end\n end\n \n d4_10s.uniq.each do |d4_10|\n d4_10[0..1].join.to_i.step(987, 100) do |n|\n d3 = (n/100).to_s\n if n % 3 == 0 && !d4_10.include?(d3)\n d3_10s << [d3] + d4_10\n end\n end\n end\n \n d3_10s.uniq.each do |d3_10|\n d3_10[0..1].join.to_i.step(987, 100) do |n|\n d2 = (n/100).to_s\n if n % 2 == 0 && !d3_10.include?(d2)\n d2_10s << [d2] + d3_10\n end\n end\n end\n\n d2_10s.uniq.each do |d2_10|\n 10.times do |d1|\n if !d2_10.include?(d1.to_s)\n d1_10s << ([d1] + d2_10).join.to_i\n end\n end\n end\n \n d1_10s\nend",
"title": ""
},
{
"docid": "3f940bd70b6e1507faf06d772bcfd75a",
"score": "0.57969695",
"text": "def solution(a)\n stack_top = nil\n stack_size = 0\n a.each { |v| \n if stack_size == 0\n stack_top = v\n stack_size += 1\n else\n if stack_top == v\n stack_size += 1\n else\n stack_size -= 1\n end\n end\n }\n candidate = stack_top\n \n equi_leaders = 0\n if stack_size > 0\n total_candidates = a.count { |v| v == candidate }\n count_candidates = 0\n a.each_with_index { |v, i|\n count_candidates += 1 if v == candidate\n if count_candidates > (i + 1) / 2\n equi_leaders += 1 if (total_candidates - count_candidates) > (a.count - i - 1) / 2\n end\n }\n end\n equi_leaders\nend",
"title": ""
},
{
"docid": "8680c940dfaba755439e1e4ddbcde59d",
"score": "0.5793158",
"text": "def solution(s, p, q)\n\n stats_a = []\n stats_c = []\n stats_g = []\n\n minimals = []\n\n stats_a[0] = 0\n stats_c[0] = 0\n stats_g[0] = 0\n (1..(s.length)).each do |i|\n stats_a[i] = stats_a[i-1]\n stats_c[i] = stats_c[i-1]\n stats_g[i] = stats_g[i-1]\n\n if(s[i-1] == \"A\")\n stats_a[i] = stats_a[i] + 1\n elsif(s[i-1] == \"C\")\n stats_c[i] = stats_c[i] + 1\n elsif(s[i-1] == \"G\")\n stats_g[i] = stats_g[i] + 1\n end\n end\n\n (0..(p.length-1)).each do |j|\n start_index = p[j]\n end_index = q[j] + 1\n\n if(stats_a[end_index] - stats_a[start_index] > 0)\n minimals[j] = 1\n elsif(stats_c[end_index] - stats_c[start_index] > 0)\n minimals[j] = 2\n elsif(stats_g[end_index] - stats_g[start_index] > 0)\n minimals[j] = 3\n else\n minimals[j] = 4\n end\n end\n minimals\nend",
"title": ""
},
{
"docid": "8de424cfaddcc7fb40cdc399fe7f346a",
"score": "0.5790544",
"text": "def fairRations(b)\n c=0\n for i in 0...b.length\n if b[i] % 2 != 0\n b[i]+=1\n b[i+1]+=1 if i+1<b.length\n c += 2\n return \"NO\" if i+1>=b.length\n i=0\n else\n i+=1\n end\n end\n c\nend",
"title": ""
},
{
"docid": "051f4958111b5affc5467e0cb5821621",
"score": "0.57893825",
"text": "def solution(n)\n return 1 if n < 10\n str = n.to_s\n len = str.size\n non_zerostr = str.gsub(/0/, '')\n non_zeros = non_zerostr.size\n zeros = len - non_zeros\n unique = non_zerostr.split('').uniq.size\n\n# puts \" -- len: #{len} non-zero: #{non_zeros} zeros: #{zeros} unique: #{unique}\"\n\n perms = (1..unique).inject(:*)\n perms += (perms * zeros) if perms > 1\n perms += (perms * (non_zeros - unique))\n\n return perms\nend",
"title": ""
},
{
"docid": "07819e3afdf5a27c3cfb64e3e0f2ce3a",
"score": "0.5787753",
"text": "def problem33\n num, den = 1, 1\n 10.upto(98) do |x|\n (x+1).upto(99) do |y|\n if (((simplestTerms(x,y)<=>simplestTerms((n = (a = x.to_s)[0].to_i), (d = (b = y.to_s)[1].to_i))) == 0 && a[1] == b[0]) ||\n ((simplestTerms(x,y)<=>simplestTerms((n = a[1].to_i), (d = b[0].to_i))) == 0 && a[0] == b[1]) &&\n (a[0] != b[0] && a[1] != b[1] && a[0] != a[1] && b[0] != b[1]))\n num, den = num * n, den * d\n puts \"#{x}/#{y} == #{n}/#{d}\"\n end\n end\n end\n puts \"#{(r = simplestTerms(num,den))[0]}/#{r[1]}\"\nend",
"title": ""
},
{
"docid": "d126b794382588618d12438a5e46269e",
"score": "0.5787387",
"text": "def solution(a)\n a.sort!\n triplets = 0\n a.each_with_index do |p, i|\n k = i + 2\n a[i+1..-1].each_with_index do |q, j|\n k += 1 while k < a.length && p + q > a[k]\n triplets += k - j - i - 2\n end\n end\n triplets\nend",
"title": ""
},
{
"docid": "dd37cbf0e30ea40cbc34d6ebf39feefe",
"score": "0.57816255",
"text": "def solve(s)\n letters = s.split(/[aeiou]/)\n alphabet = ('a'..'z')\n letters_and_numbers = Hash.new\n \n alphabet.each_with_index do |letter, index|\n letters_and_numbers[letter] = index + 1\n end\n \n letters.map! do |letter|\n if letter.length.eql?(1)\n letters_and_numbers[letter.downcase]\n else\n letter.chars.map do |split_letter|\n letters_and_numbers[split_letter]\n end.sum\n end\n end\n \n letters.sort.pop\n \nend",
"title": ""
},
{
"docid": "7c89b4b7aba1befe09b838aaf0f6814e",
"score": "0.577935",
"text": "def solve(str)\n sub_strings_arr = sub_strings(str)\n odds = []\n sub_strings_arr.each do |string|\n odds << string if string.to_i.odd?\n end\n odds.size\nend",
"title": ""
}
] |
23df619760c72d01dac6a2cd2c67c36a | Returns available options for kinds of notify methods. | [
{
"docid": "6b79e3c5d2101b39f2d490da5bd47384",
"score": "0.6851832",
"text": "def available_options\n [:key, :group, :group_expiry_delay, :notifier, :parameters, :send_email, :send_later, :pass_full_options].freeze\n end",
"title": ""
}
] | [
{
"docid": "449ad7670b9de71568307631fd5fb55f",
"score": "0.6878917",
"text": "def available_notifier_options\n [:printable_notifier_name, :printable_name].freeze\n end",
"title": ""
},
{
"docid": "d5a20411a5a77db2865a9bb5190eb7f2",
"score": "0.6535331",
"text": "def get_options\n @raw_status.methods - Object.methods\n end",
"title": ""
},
{
"docid": "a814623d27e3fe09881c7e5e9e5a7ca2",
"score": "0.6451476",
"text": "def notification_json_options\n {\n include: {\n target: { methods: [:printable_type, :printable_target_name] },\n notifiable: { methods: [:printable_type] },\n group: { methods: [:printable_type, :printable_group_name] },\n notifier: { methods: [:printable_type, :printable_notifier_name] },\n group_members: {}\n },\n methods: [:notifiable_path, :printable_notifiable_name, :group_member_notifier_count, :group_notification_count]\n }\n end",
"title": ""
},
{
"docid": "07f8c716288fe26d5006e57a8cdc4a99",
"score": "0.6432086",
"text": "def poll_options\n return option(:poll_options, {})\n end",
"title": ""
},
{
"docid": "d050b5ec286f178fd3d3efe18396b9fc",
"score": "0.63954407",
"text": "def notification_json_options\n {\n include: {\n target: { methods: [:printable_type, :printable_target_name] },\n notifiable: { methods: [:printable_type] },\n group: { methods: [:printable_type, :printable_group_name] },\n notifier: { methods: [:printable_type, :printable_notifier_name] },\n group_members: {}\n },\n methods: [:notifiable_path, :printable_notifiable_name, :group_member_notifier_count, :group_notification_count, :text]\n }\n end",
"title": ""
},
{
"docid": "2b824a0c607c956837dc5724dcf0bfe2",
"score": "0.6244579",
"text": "def options\n options = {}\n PROPERTY_OPTIONS.each do |method|\n next if (value = send(method)).nil?\n options[method] = value\n end\n options\n end",
"title": ""
},
{
"docid": "f91c1740a29931bcd72932a5426f6748",
"score": "0.6156334",
"text": "def get_methods\n OPTIONS.values.map{ |v| v + [nil]}.inject(&:product).map(&:flatten).map(&:compact)\n end",
"title": ""
},
{
"docid": "d4301674b1e3721cbd5db8c09938c40e",
"score": "0.61502975",
"text": "def method_options(opt); end",
"title": ""
},
{
"docid": "d4301674b1e3721cbd5db8c09938c40e",
"score": "0.61502975",
"text": "def method_options(opt); end",
"title": ""
},
{
"docid": "d4301674b1e3721cbd5db8c09938c40e",
"score": "0.61502975",
"text": "def method_options(opt); end",
"title": ""
},
{
"docid": "d4301674b1e3721cbd5db8c09938c40e",
"score": "0.61502975",
"text": "def method_options(opt); end",
"title": ""
},
{
"docid": "24a3b11e0240ebf1aae7053b86572881",
"score": "0.61332786",
"text": "def options()\n @opts\n end",
"title": ""
},
{
"docid": "24a3b11e0240ebf1aae7053b86572881",
"score": "0.61332786",
"text": "def options()\n @opts\n end",
"title": ""
},
{
"docid": "0a2dec961063f3cd4a3a313a7b291f1e",
"score": "0.61300695",
"text": "def options\n PROPERTY_OPTIONS.inject({}) do |options, method|\n value = send(method)\n options[method.to_sym] = value unless value.nil?; options\n end\n end",
"title": ""
},
{
"docid": "87614312370af9c8eafd784515ad0de3",
"score": "0.6122455",
"text": "def options\n OPTION_KEYS.reduce({}) { |a, e| a.merge!(e => send(e)) }\n end",
"title": ""
},
{
"docid": "b5741b0c6829843b316802a194125fed",
"score": "0.6103682",
"text": "def get_options\n [:include_root, :include_index, :filename, :sitemaps_path, :public_path, :sitemaps_host, :verbose, :default_host].inject({}) do |hash, key|\n hash[key] = send(key)\n hash\n end\n end",
"title": ""
},
{
"docid": "99af8ea231c15a673a8e968ca1cbe600",
"score": "0.6100134",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) { |opts, k| opts[k] = send(k); opts }\n end",
"title": ""
},
{
"docid": "ca17ff62d8b4b5c579f26c92625dcce9",
"score": "0.60402715",
"text": "def options\n @registry.select do |opt|\n opt.kind_of?(Option)\n end\n end",
"title": ""
},
{
"docid": "bd05089e3cfc678ca5ebeba29a17958e",
"score": "0.60283107",
"text": "def get_options; end",
"title": ""
},
{
"docid": "f9ddb48254a2ff18a68f00027e054eb0",
"score": "0.60150814",
"text": "def available_options\n @available_options || begin\n options = {\n # File ownership\n \"force-user\" => { long: [\"force-user\", \"user\", \"owner\"], short: [\"u\"], type: :option, default: \"vagrant\" },\n \"force-group\" => { long: [\"force-group\", \"group\"], short: [\"g\"], type: :option, default: \"vagrant\" },\n \"mirror\" => { long: [\"mirror\"], short: [\"m\"], type: :option, default: nil },\n \"mirror-only\" => { long: [\"mirror-only\"], short: [\"M\"], type: :option, default: nil },\n \"map\" => { long: [\"map\"], short: [], type: :option, default: nil },\n\n # Permission bits\n \"perms\" => { long: [\"perms\"], short: [\"p\"], type: :option, default: \"u=rwX:g=rD:o=rD\" },\n\n # File creation policy\n \"create-as-user\" => { long: [\"create-as-user\"], short: [], type: :flag, default: false },\n \"create-as-mounter\" => { long: [\"create-as-mounter\"], short: [], type: :flag, default: false },\n \"create-for-user\" => { long: [\"create-for-user\"], short: [], type: :option, default: nil },\n \"create-for-group\" => { long: [\"create-for-group\"], short: [], type: :option, default: nil },\n \"create-with-perms\" => { long: [\"create-with-perms\"], short: [], type: :option, default: nil },\n\n # Chown policy\n \"chown-normal\" => { long: [\"chown-normal\"], short: [], type: :flag, default: false },\n \"chown-ignore\" => { long: [\"chown-ignore\"], short: [], type: :flag, default: false },\n \"chown-deny\" => { long: [\"chown-deny\"], short: [], type: :flag, default: false },\n\n # Chgrp policy\n \"chgrp-normal\" => { long: [\"chgrp-normal\"], short: [], type: :flag, default: false },\n \"chgrp-ignore\" => { long: [\"chgrp-ignore\"], short: [], type: :flag, default: false },\n \"chgrp-deny\" => { long: [\"chgrp-deny\"], short: [], type: :flag, default: false },\n\n # Chmod policy\n \"chmod-normal\" => { long: [\"chmod-normal\"], short: [], type: :flag, default: false },\n \"chmod-ignore\" => { long: [\"chmod-ignore\"], short: [], type: :flag, default: false },\n \"chmod-deny\" => { long: [\"chmod-deny\"], short: [], type: :flag, default: false },\n \"chmod-filter\" => { long: [\"chmod-filter\"], short: [], type: :option, default: nil },\n \"chmod-allow-x\" => { long: [\"chmod-allow-x\"], short: [], type: :flag, default: false },\n\n # Extended attribute policy\n \"xattr-none\" => { long: [\"xattr-none\"], short: [], type: :flag, default: false },\n \"xattr-ro\" => { long: [\"xattr-ro\"], short: [], type: :flag, default: false },\n \"xattr-rw\" => { long: [\"xattr-rw\"], short: [], type: :flag, default: false },\n\n # Rate limits\n \"read-rate\" => { long: [\"read-rate\"], short: [], type: :option, default: false },\n \"write-rate\" => { long: [\"write-rate\"], short: [], type: :option, default: false },\n\n # Miscellaneous\n \"no-allow-other\" => { long: [\"no-allow-other\"], short: [\"n\"], type: :flag, default: false },\n \"realistic-permissions\" => { long: [\"realistic-permissions\"], short: [], type: :flag, default: false },\n \"ctime-from-mtime\" => { long: [\"ctime-from-mtime\"], short: [], type: :flag, default: false },\n \"hide-hard-links\" => { long: [\"hide-hard-links\"], short: [], type: :flag, default: false },\n \"multithreaded\" => { long: [\"multithreaded\"], short: [], type: :flag, default: false },\n\n # FUSE options\n \"o\" => { long: [], short: [\"o\"], type: :option, default: nil },\n \"r\" => { long: [], short: [\"r\"], type: :flag, default: false },\n \"d\" => { long: [], short: [\"d\"], type: :flag, default: false },\n \"f\" => { long: [], short: [\"f\"], type: :flag, default: false },\n }\n\n if bindfs_version_lower_than(\"1.12.6\")\n options.delete(\"read-rate\")\n options.delete(\"write-rate\")\n end\n\n if bindfs_version_lower_than(\"1.12.2\")\n options.delete(\"chmod-filter\")\n end\n\n if bindfs_version_lower_than(\"1.12\")\n options[\"user\"] = options.delete(\"force-user\")\n options[\"group\"] = options.delete(\"force-group\")\n end\n\n if bindfs_version_lower_than(\"1.11\")\n options.delete(\"multithreaded\")\n end\n\n if bindfs_version_lower_than(\"1.10\")\n options.delete(\"map\")\n options.delete(\"realistic-permissions\")\n options.delete(\"hide-hard-links\")\n end\n\n # Can't track changes deeper as SVN repository was removed from https://code.google.com/p/bindfs/\n\n options\n end\n end",
"title": ""
},
{
"docid": "e7053185e39cda970ac8d6983b0d9336",
"score": "0.60122055",
"text": "def notify_symbols\n [notify.to_sym]\n end",
"title": ""
},
{
"docid": "a9ae6cedac7de3e94ff30f4d5efb2c74",
"score": "0.5994112",
"text": "def options\n\t\t\tHash[VALID_OPTIONS_KEYS.map { |key | [key, send(key)] }]\n\t\tend",
"title": ""
},
{
"docid": "08b4808427e68ce5b8b3e01d13691b81",
"score": "0.59901506",
"text": "def options\n options = {}\n OPTION_KEYS.each { |key| options[key] = send(key) }\n options\n end",
"title": ""
},
{
"docid": "08b4808427e68ce5b8b3e01d13691b81",
"score": "0.59901506",
"text": "def options\n options = {}\n OPTION_KEYS.each { |key| options[key] = send(key) }\n options\n end",
"title": ""
},
{
"docid": "76c9544c174a1c64bee6d9ddb06a2567",
"score": "0.5978637",
"text": "def options\n\t VALID_OPTIONS_KEYS.inject({}) do |option, key|\n\t option.merge!(key => send(key))\n\t end\n\t end",
"title": ""
},
{
"docid": "660539427c9d06bf2937dd6c84f213e9",
"score": "0.59719473",
"text": "def options\n []\n end",
"title": ""
},
{
"docid": "3837405f077c60c2c19b2c60f7880c0c",
"score": "0.5942605",
"text": "def available_notifiable_options\n [ :targets,\n :group,\n :group_expiry_delay,\n :notifier,\n :parameters,\n :email_allowed,\n :action_cable_allowed,\n :action_cable_api_allowed,\n :notifiable_path,\n :printable_notifiable_name, :printable_name,\n :dependent_notifications,\n :optional_targets\n ].freeze\n end",
"title": ""
},
{
"docid": "7e2dfb03f1b2d15e0f3fa983f4965c69",
"score": "0.5939707",
"text": "def request_method_options\n %w(GET POST PUT DELETE OPTIONS HEAD PATCH)\n end",
"title": ""
},
{
"docid": "5126832285890c8034482d20377bed96",
"score": "0.5937879",
"text": "def options\n options = {}\n VALID_OPTION_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "aced75fdeada2de739831e090c4b2a35",
"score": "0.59265834",
"text": "def available_dependent_notifications_options\n [ :delete_all,\n :destroy,\n :restrict_with_error,\n :restrict_with_exception,\n :update_group_and_delete_all,\n :update_group_and_destroy\n ].freeze\n end",
"title": ""
},
{
"docid": "fe1925cc7a2c446267a6721e1b89b233",
"score": "0.5918898",
"text": "def options()\n @options\n end",
"title": ""
},
{
"docid": "734a3035c8ca1021602843bd3e3053aa",
"score": "0.589588",
"text": "def options\n Hash[*OPTIONS_KEYS.map{ |key| [key, send(key)] }.flatten(1)]\n end",
"title": ""
},
{
"docid": "474b69e437eeb375dded5a5c33b19d40",
"score": "0.5892848",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "43f63c224dd1d31af681532d3dfde556",
"score": "0.58680856",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "43f63c224dd1d31af681532d3dfde556",
"score": "0.58680856",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "43f63c224dd1d31af681532d3dfde556",
"score": "0.58680856",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "43f63c224dd1d31af681532d3dfde556",
"score": "0.58680856",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "e9590c5afc98dd97148e84048c9ec06c",
"score": "0.5859357",
"text": "def supported_options; end",
"title": ""
},
{
"docid": "e9590c5afc98dd97148e84048c9ec06c",
"score": "0.5859357",
"text": "def supported_options; end",
"title": ""
},
{
"docid": "e9590c5afc98dd97148e84048c9ec06c",
"score": "0.5859357",
"text": "def supported_options; end",
"title": ""
},
{
"docid": "ff08fe3bc0713caefd866638565a79b0",
"score": "0.58497",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "dffe56393a883f9c7a6954acde0fc312",
"score": "0.58465165",
"text": "def options\n VALID_OPTION_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "3573805197a64f1146f0153e3f8f3017",
"score": "0.58450764",
"text": "def notification_options=(arg)\n @notification_options = check_state_options(arg, %w(w u c r f s n), 'notification_options')\n end",
"title": ""
},
{
"docid": "da5dc90bf9c3a71396e6473534857b86",
"score": "0.58431613",
"text": "def options\n Hash[ * VALID_OPTIONS_KEYS.map { |key| [key, send(key)] }.flatten ]\n end",
"title": ""
},
{
"docid": "da5dc90bf9c3a71396e6473534857b86",
"score": "0.58431613",
"text": "def options\n Hash[ * VALID_OPTIONS_KEYS.map { |key| [key, send(key)] }.flatten ]\n end",
"title": ""
},
{
"docid": "17d41da1dd239bc6f9e02c0290b19857",
"score": "0.5840846",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "58db2758775e9caffdaf66ff70b7f168",
"score": "0.5840528",
"text": "def valid_notifier_methods\n [:add, :delete, :list, :start, :stop]\n end",
"title": ""
},
{
"docid": "168b2b99edd5dbeca002589e8b75270c",
"score": "0.5837907",
"text": "def options\n Hash[*OPTIONS_KEYS.map{|key| [key, send(key)]}.flatten]\n end",
"title": ""
},
{
"docid": "7bece661f7adf5dbe9e210b2cc9766ae",
"score": "0.58217996",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "7bece661f7adf5dbe9e210b2cc9766ae",
"score": "0.58217996",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "7bece661f7adf5dbe9e210b2cc9766ae",
"score": "0.58217996",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "c197a74e50c042693e74f7c2b94b1c13",
"score": "0.5816268",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "80b14c4f704b424297afb769249b6ced",
"score": "0.5812545",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"title": ""
},
{
"docid": "d7fe07388dcce242a26397ca3670e47d",
"score": "0.5811249",
"text": "def notification_options=(arg)\n @notification_options = check_state_options(arg, %w(d u r f s n), 'notification_options')\n end",
"title": ""
},
{
"docid": "8695895181ce3fb438e7b291ce609e2a",
"score": "0.5801802",
"text": "def options type\n opts = []\n if resource[:options]\n resource[:options].keys.sort.each do |key|\n value = resource[:options][key]\n value = nil if value == :undef\n value = value.to_s\n dashized = dashize(key.strip)\n if predicate(type).call(dashized)\n opts << dashized\n opts << value.strip unless value.strip.empty?\n end\n end\n end\n return opts\n end",
"title": ""
},
{
"docid": "1dd8838bea73336a54709b7f68b26383",
"score": "0.579671",
"text": "def options\n VALID_OPTIONS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "bd397d74769eed00e8d978d70e2906d3",
"score": "0.57952565",
"text": "def method_names\n @method_names ||= default_method_names.merge(options.fetch(:methods, {}))\n end",
"title": ""
},
{
"docid": "dcd29fe9f8e45391e23b5c79194b9a34",
"score": "0.5794022",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "dcd29fe9f8e45391e23b5c79194b9a34",
"score": "0.5794022",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "dcd29fe9f8e45391e23b5c79194b9a34",
"score": "0.5794022",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "eaf5a0de21ba7e3d483c444e0c11b0bd",
"score": "0.5793568",
"text": "def options()\n @options ||= []\n return @options\n end",
"title": ""
},
{
"docid": "328833f7c9359df856f91ec8581f5767",
"score": "0.5777499",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "328833f7c9359df856f91ec8581f5767",
"score": "0.5777499",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "328833f7c9359df856f91ec8581f5767",
"score": "0.5777499",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "328833f7c9359df856f91ec8581f5767",
"score": "0.5777499",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "328833f7c9359df856f91ec8581f5767",
"score": "0.5777499",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "328833f7c9359df856f91ec8581f5767",
"score": "0.5777499",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "e8a6e3c036aa5b53a89ebda29e86d37f",
"score": "0.5775388",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }\n options\n end",
"title": ""
},
{
"docid": "07a2e316c617ef548f1c47c59ed8ce32",
"score": "0.57726127",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option,key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "ebed2d77d499e72f7c421884be982eb6",
"score": "0.57692623",
"text": "def options\n options = {}\n VALID_OPTIONS_KEYS.each do |k|\n options[k] = send(k)\n end\n options\n end",
"title": ""
},
{
"docid": "220139f925d8fe3f0b703b6e20ffbb71",
"score": "0.57574975",
"text": "def options\n []\n end",
"title": ""
},
{
"docid": "220139f925d8fe3f0b703b6e20ffbb71",
"score": "0.57574975",
"text": "def options\n []\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
},
{
"docid": "716fcc784a44c9dc06f23773b5200d70",
"score": "0.5746876",
"text": "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"title": ""
}
] |
79b2c71d467a75ed693fb192e060a48a | Example For picture = ["abc", "ded"] the output should be addBorder(picture) = ["", "abc", "ded", ""] | [
{
"docid": "70d1703fa044358d10caac64e727dfe0",
"score": "0.8701211",
"text": "def addBorder(picture)\n picture.map! { |el| el = '*' + el + '*' }.unshift( '*' * ( picture[0].length) ).push( '*' * ( picture[0].length) )\nend",
"title": ""
}
] | [
{
"docid": "872886e5bd4d99b5ab4b1360f43668ea",
"score": "0.8756257",
"text": "def addBorder(picture)\n border = Array.new\n \n for i in 0..(picture[0].length+1)\n border << \"*\"\n end\n \n border = border.join(\"\")\n \n finalArray = Array.new\n \n for i in 0..(picture.count + 1)\n if (i == 0) or (i == (picture.count + 1))\n finalArray << border\n else\n picture[i-1] = \"*#{picture[i-1]}*\"\n finalArray << picture[i-1]\n end\n end\n \n finalArray\nend",
"title": ""
},
{
"docid": "2b3317a691816679bc8c2cd9d848020f",
"score": "0.6907455",
"text": "def add_border!(arr)\r\n (0...arr.size).each do |i|\r\n (0...arr[i].size).each do |j|\r\n arr[i][j].push(\".\")\r\n arr[i][j].unshift(\".\")\r\n end\r\n arr[i].push((\".\" * (arr[i][0].size)).chars)\r\n arr[i].unshift((\".\" * (arr[i][0].size)).chars)\r\n end\r\n arr.push((0...arr[0].size).map { |_| ((\".\") * (arr[0][0].size)).chars })\r\n arr.unshift((0...arr[0].size).map { |_| ((\".\") * (arr[0][0].size)).chars })\r\n arr\r\nend",
"title": ""
},
{
"docid": "a28686cd87166a3dd747bc23c7d3ba52",
"score": "0.6444095",
"text": "def applyBorder; end",
"title": ""
},
{
"docid": "54f46182fc3e7d2d97ff1e2b56a95249",
"score": "0.61992687",
"text": "def border(image, color = 'black', width = 20)\n %x{ convert #{image} \\\n -bordercolor '#{color}' -border #{width}x#{width} \\\n #{image} }\n image\n end",
"title": ""
},
{
"docid": "cb95845c36b632552c2bd673410121de",
"score": "0.61455005",
"text": "def new_bordered_image(border_height, border_width, border)\n Array.new(radar_image.height + (border_height * 2)) do\n Array.new(radar_image.width + (border_width * 2), border)\n end\n end",
"title": ""
},
{
"docid": "b71f1c0bfaecd77dfea44d3d33cbac91",
"score": "0.6056783",
"text": "def border\n [bottom, top, right, left]\n end",
"title": ""
},
{
"docid": "0f1c184a762fe85261e94acfefc6fdb1",
"score": "0.59745556",
"text": "def new_bordered_image(radar_image, border_height, border_width, border)\n Array.new(radar_image.height + (border_height * 2)) do\n Array.new(radar_image.width + (border_width * 2), border)\n end\n end",
"title": ""
},
{
"docid": "258f2754385f926a0fd5b3e8cf50155c",
"score": "0.59614325",
"text": "def borders(tile)\n [\n tile.first,\n tile.transpose.last,\n tile.last,\n tile.transpose.first\n ]\nend",
"title": ""
},
{
"docid": "d7fda9cfd33a1e3908b16197b2add2ba",
"score": "0.5953979",
"text": "def border borders\n borders = [borders] unless borders.is_a?(Array)\n borders.sort!\n unless i = @borders[borders]\n i = @borders.length\n @borders[borders] = i\n end\n i\n end",
"title": ""
},
{
"docid": "f31742969162f6b45f6540fd6a00d8ab",
"score": "0.59213716",
"text": "def create_border_shorthand! # :nodoc:\n values = BORDER_STYLE_PROPERTIES.map do |property|\n next unless (declaration = declarations[property])\n next if declaration.important\n # can't merge if any value contains a space (i.e. has multiple values)\n # we temporarily remove any spaces after commas for the check (inside rgba, etc...)\n next if declaration.value.gsub(/,\\s/, ',').strip =~ /\\s/\n\n declaration.value\n end.compact\n\n return if values.size != BORDER_STYLE_PROPERTIES.size\n\n BORDER_STYLE_PROPERTIES.each do |property|\n declarations.delete(property)\n end\n\n declarations['border'] = values.join(' ')\n end",
"title": ""
},
{
"docid": "33362fea0e42071da03737a7f3cde259",
"score": "0.58832055",
"text": "def format_border(cell_size)\n \"+\" + (['-' * cell_size] * @board.size).join('+') + \"+\"\n end",
"title": ""
},
{
"docid": "8fe03b4aa2daa2bf8d35a39159814471",
"score": "0.58427924",
"text": "def apply_border(border_height, border_width, bordered_image)\n radar_image.content[0..radar_image.height].each_with_index do |row, row_index|\n width_range = border_width..(border_width + radar_image.width - 1)\n bordered_image[border_height + row_index][width_range] = row\n end\n\n RadarImage.new(radar_image.id, bordered_image)\n end",
"title": ""
},
{
"docid": "4f47e94de74670251de536f3387d4c2c",
"score": "0.5783236",
"text": "def viewize(string_array)\n\t\tborder_size = @border.length*2 + 2\n\t\tstring_array.map do |str|\n\t\t\twrap(str, border_size).map {|s| [[@border, s].join(\" \").ljust(@grid_width-@border.length), @border].join(\" \")}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4f47e94de74670251de536f3387d4c2c",
"score": "0.5783236",
"text": "def viewize(string_array)\n\t\tborder_size = @border.length*2 + 2\n\t\tstring_array.map do |str|\n\t\t\twrap(str, border_size).map {|s| [[@border, s].join(\" \").ljust(@grid_width-@border.length), @border].join(\" \")}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4f47e94de74670251de536f3387d4c2c",
"score": "0.5783236",
"text": "def viewize(string_array)\n\t\tborder_size = @border.length*2 + 2\n\t\tstring_array.map do |str|\n\t\t\twrap(str, border_size).map {|s| [[@border, s].join(\" \").ljust(@grid_width-@border.length), @border].join(\" \")}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4ba862d95382e7845103fed105e7705b",
"score": "0.57231057",
"text": "def borders; end",
"title": ""
},
{
"docid": "ae2303e23629b6aae74447c9421a6a16",
"score": "0.5662551",
"text": "def border_widths\n widths = []\n @borders.each {|entry| widths.push(entry.nil? ? 0 : entry)}\n widths\n end",
"title": ""
},
{
"docid": "a6669fd5fa5f863ee7a444141a5cca99",
"score": "0.56557983",
"text": "def multicell_border(border,first_cell,remainder,w,h)\n if border == 0 then return end\n last_cell = (remainder == nil) || (remainder.length == 0)\n # puts \"multicell_border border #{border} first_cell #{first_cell} last_cell #{last_cell}\"\n border_internal(\n first_cell ? (last_cell ? border : pborder_and(border,'LTR')) :\n (last_cell ? pborder_and(border,'LRB') : pborder_and(border,'LR') ),\n @cur_x,@cur_y+h,@cur_x+w,@cur_y)\n end",
"title": ""
},
{
"docid": "a04085c3b6900ac3d6470fad562e82d1",
"score": "0.56139",
"text": "def tag_border=(_arg0); end",
"title": ""
},
{
"docid": "7ccac36c8269bfd949e0e52575fb71b6",
"score": "0.56006706",
"text": "def add_border(size=3,r=0,g=0,b=0)\n\t\twidth = @x_size+2*size\n\t\theight = @y_size+2*size\n\t\tresampled = image_create_true_color(width,height)\n\t\timage_filled_rectangle(resampled,0,0,width,height, r, g, b)\n\t\timage_copy(@picture,resampled,size,size,0,0,@x_size,@y_size)\n\t\timage_destroy(@picture)\n\t\t@x_size = width\n\t\t@y_size = height\n\t\t@picture = image_create_true_color(@x_size,@y_size)\n\t\timage_filled_rectangle(@picture,0,0,@x_size,@y_size,255,255,255)\n\t\timage_color_transparent(@picture,255,255,255)\n\t\timage_copy(resampled,@picture,0,0,0,0,@x_size,@y_size)\n\tend",
"title": ""
},
{
"docid": "6353be47bc006149a6921eebf5ed7223",
"score": "0.5575852",
"text": "def border!(size, color = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f554010f8c2b03cec52827fbe3d5e0e9",
"score": "0.5553688",
"text": "def draw_borders(pt)\n end",
"title": ""
},
{
"docid": "6eb068cee7f93bb2b16ac63be4777479",
"score": "0.5546915",
"text": "def border(object)\n if object.is_a? Hash\n [\"border : #{object[:width]} solid #{object[:color]}\"]\n else\n [\"border : #{object}\"]\n end\n end",
"title": ""
},
{
"docid": "4e7e58a6b5882bf12278485d7756adf7",
"score": "0.5533892",
"text": "def border_width=(width)\n @border_widths = case\n when width.nil?\n [\"000000\"] * 4\n when Numeric === width # all widths\n [width, width, width, width]\n when width.length == 2 # vert, horiz\n [width[0], width[1], width[0], width[1]]\n when width.length == 3 # top, horiz, bottom\n [width[0], width[1], width[2], width[1]]\n when width.length == 4 # top, right, bottom, left\n [width[0], width[1], width[2], width[3]]\n else\n raise ArgumentError, \":border_width must be a string \" +\n \"or an array [v,h] or [t,r,b,l]\"\n end\n end",
"title": ""
},
{
"docid": "7f0d488a04a0db102e7a223161ac5f87",
"score": "0.5524779",
"text": "def all_borders\n borders = []\n @squares.values.each do |value|\n value['borders'].each do |border|\n borders.push(border)\n borders.push(border.reverse)\n end\n end\n borders\n end",
"title": ""
},
{
"docid": "9b02dccaf2b2371cc4cee6398ab68773",
"score": "0.55215794",
"text": "def border; end",
"title": ""
},
{
"docid": "1cc0e25d380ab010e241c472d5c9c2fe",
"score": "0.55058336",
"text": "def create_border_shorthand! # :nodoc:\n values = []\n \n ['border-width', 'border-style', 'border-color'].each do |property|\n if @declarations.has_key?(property) and not @declarations[property][:is_important]\n # can't merge if any value contains a space (i.e. has multiple values)\n # we temporarily remove any spaces after commas for the check (inside rgba, etc...)\n return if @declarations[property][:value].gsub(/\\,[\\s]/, ',').strip =~ /[\\s]/\n values << @declarations[property][:value]\n end\n end\n\n @declarations.delete('border-width')\n @declarations.delete('border-style')\n @declarations.delete('border-color')\n\n unless values.empty?\n @declarations['border'] = {:value => values.join(' ')}\n end\n end",
"title": ""
},
{
"docid": "0037d1350fd4ca1d8a55b9e3d47154cc",
"score": "0.5499924",
"text": "def border_widths\n widths = []\n @borders.each {|entry| widths.push(entry.nil? ? 0 : entry)}\n widths\n end",
"title": ""
},
{
"docid": "ae994e316303a11eb25722af872b87f3",
"score": "0.5487892",
"text": "def border_classes(sides, class_prefix = 'border')\n if sides.is_a?(String)\n return '' if sides == 'none'\n return class_prefix if sides == 'all'\n \"#{class_prefix}-#{sides}\"\n else\n sides.collect do |side|\n \"#{class_prefix}-#{side}\"\n end.join(' ').rstrip\n end\n end",
"title": ""
},
{
"docid": "f8d18aaeeda34a0fcfc21cd247b4abb7",
"score": "0.5481992",
"text": "def render\n output = []\n output << render_top_border if @border.top?\n\n (@height - @border.top_size - @border.bottom_size).times do |y|\n output << render_left_border(y)\n output << render_content_line(@formatted_lines[y])\n output << render_right_border(y) if @border.right?\n output << @sep unless position?\n end\n\n output << render_bottom_border if @border.bottom?\n output.join\n end",
"title": ""
},
{
"docid": "30082a5fbea6e7a235cf6e1100fc2ab7",
"score": "0.54704934",
"text": "def fix_borders\n self.width.times do |i|\n self[i, 0] = AsciiLocation.new(i, 0, '#')\n self[i, self.height - 1] = AsciiLocation.new(i, self.height - 1, '#')\n end\n \n self.height.times do |j|\n self[0, j] = AsciiLocation.new(0, j, '#')\n self[self.width - 1, j] = AsciiLocation.new(self.width - 1, j, '#')\n end\n end",
"title": ""
},
{
"docid": "9a84890d66e004db72e67608767958e0",
"score": "0.5468968",
"text": "def border_classes(sides, class_prefix = 'border')\n if sides.is_a?(String)\n return '' if sides == 'none'\n\n return class_prefix if sides == 'all'\n\n return \"#{class_prefix}-#{sides}\"\n end\n\n sides.collect do |side|\n \"#{class_prefix}-#{side}\"\n end.join(' ').rstrip\n end",
"title": ""
},
{
"docid": "1c30a5b5d3ad58ab0f63f1c39352c522",
"score": "0.54626215",
"text": "def bottom_border\n \"==========\"\n end",
"title": ""
},
{
"docid": "84831f540ba442bf2b05de4b868a47b9",
"score": "0.5438001",
"text": "def border(width = 20, color = '#cbfe00')\n convert \"#{result.path} -bordercolor #{color} -border #{width}x#{width} #{result.path}\"\n end",
"title": ""
},
{
"docid": "81d76338cb7de17a2ae1b39d6fda5cc2",
"score": "0.54173595",
"text": "def add_borders\n\t\tdistance = 50.0\n\t\t\n\t\tleft_border = new_border(self.size.height, false)\n\t\tleft_border.position = [BORDER_THICKNESS / 2.0 - distance, self.size.height / 2.0]\n\t\t@world_layer.addChild(left_border)\n\t\t\n\t\tright_border = new_border(self.size.height, false)\n\t\tright_border.position = [self.size.width - BORDER_THICKNESS / 2.0 + distance, self.size.height / 2.0]\n\t\tright_border.zRotation = Math::PI\n\t\t@world_layer.addChild(right_border)\n\n\t\ttop_border = new_border(self.size.width, true)\n\t\ttop_border.position = [self.size.width / 2.0, self.size.height - BORDER_THICKNESS / 2.0 + distance]\n\t\ttop_border.zRotation = Math::PI / -2\n\t\t@world_layer.addChild(top_border)\n\n\t\tbottom_border = new_border(self.size.width, true)\n\t\tbottom_border.position = [self.size.width / 2.0, BORDER_THICKNESS / 2.0 - distance]\n\t\tbottom_border.zRotation = Math::PI / 2\n\t\t@world_layer.addChild(bottom_border)\n\t\t\n\t\t# Make the borders appear with a bounce animation.\n\t\tadd_effect_to_border(left_border, left_border.position, CGPointMake(left_border.position.x + distance, left_border.position.y), 0.5)\n\t\tadd_effect_to_border(right_border, right_border.position, CGPointMake(right_border.position.x - distance, right_border.position.y), 0.5)\n\t\tadd_effect_to_border(top_border, top_border.position, CGPointMake(top_border.position.x, top_border.position.y - distance), 1.0)\n\t\tadd_effect_to_border(bottom_border, bottom_border.position, CGPointMake(bottom_border.position.x, bottom_border.position.y + distance),1.0)\n\tend",
"title": ""
},
{
"docid": "3aaf0ebae7e94014101032e33991c2a7",
"score": "0.540425",
"text": "def recolor_border border, r, g, b\n border[4] = r\n border[5] = g\n border[6] = b\n border\n end",
"title": ""
},
{
"docid": "5a74886f883af918a006d3a014b40144",
"score": "0.5377881",
"text": "def pborder(border)\n if border.class == String\n Margins.new(*(['L','T','R','B'].map { |c| border.include?(c) ? 1 : 0 }))\n elsif border == 0\n return Margins.new(0,0,0,0)\n elsif border == 1\n return Margins.new(1,1,1,1)\n else\n raise StandardError, \"border parameter #{border} illegal\"\n end\n end",
"title": ""
},
{
"docid": "d8eeb0a8d8f20c2c3551207ac4ad7d30",
"score": "0.5369464",
"text": "def cell_border x, y, color = nil\n [left_margin + x * grid_size,\n bottom_margin + y * grid_size,\n grid_size,\n grid_size,\n *color]\n end",
"title": ""
},
{
"docid": "3937fed3b9929670cc45061f461f2360",
"score": "0.5367235",
"text": "def border_width=(width)\n size = width.nil? ? 0 : width\n if size > 0\n @borders[TOP] = @borders[RIGHT] = @borders[BOTTOM] = @borders[LEFT] = size.to_i\n else\n @borders = [nil, nil, nil, nil]\n end\n end",
"title": ""
},
{
"docid": "752702b7d3e8e7343dcae3f221f1d303",
"score": "0.5346704",
"text": "def draw_border(thickness = 2,color = @text_color)\n @border_sprite.bitmap.clear\n # Top line\n @border_sprite.bitmap.fill_rect(0,0,self.width,thickness,color)\n # Bottom line\n @border_sprite.bitmap.fill_rect(0,self.height-thickness,self.width,thickness,color)\n # Left line\n @border_sprite.bitmap.fill_rect(0,0,thickness,self.height,color)\n # Right line\n @border_sprite.bitmap.fill_rect(self.width-thickness,0,thickness,self.height,color)\n end",
"title": ""
},
{
"docid": "f6c867d049a5b954a3bd8783ebbe66ce",
"score": "0.5324441",
"text": "def drawBorders\n for x in 0...width do # bottom and top\n self.setBorderOn(x,0,S)\n self.setBorderOn(x,0,SE)\n self.setBorderOn(x,height-1,N)\n self.setBorderOn(x,height-1,NW)\n end\n for y in 0...height do # left and right\n self.setBorderOn(0,y,S)\n self.setBorderOn(0,y,SW)\n self.setBorderOn(width-1,y,N)\n self.setBorderOn(width-1,y,NE)\n end\n end",
"title": ""
},
{
"docid": "bdf7c8afcf34fde6a28cf4e13013a161",
"score": "0.532391",
"text": "def grab_borders(grid)\n length = grid.length\n edge1 = []\n edge2 = []\n length.times do |i|\n edge1.push(grid[i][length - 1])\n edge2.push(grid[i][0])\n end\n # borders are N, E, S, W\n [grid[0], edge1, grid[length - 1], edge2]\n end",
"title": ""
},
{
"docid": "3772722479d132ce86bdc530e9c40aa8",
"score": "0.53065175",
"text": "def border_width=(width)\n size = width.nil? ? 0 : width\n if size > 0\n @borders[TOP] = @borders[RIGHT] = @borders[BOTTOM] = @borders[LEFT] = size.to_i\n else\n @borders = [nil, nil, nil, nil]\n end\n end",
"title": ""
},
{
"docid": "8bdb6ee4a2657f7096cc976c0ed4d4ab",
"score": "0.52941823",
"text": "def color_border(char)\n @border_bg.(@border_fg.(char))\n end",
"title": ""
},
{
"docid": "3dbba7ea5acfd2421f5454a8bcf09efc",
"score": "0.52904236",
"text": "def border_color=(color)\n @border_colors = case\n when color.nil?\n [\"000000\"] * 4\n when String === color # all colors\n [color, color, color, color]\n when color.length == 2 # vert, horiz\n [color[0], color[1], color[0], color[1]]\n when color.length == 3 # top, horiz, bottom\n [color[0], color[1], color[2], color[1]]\n when color.length == 4 # top, right, bottom, left\n [color[0], color[1], color[2], color[3]]\n else\n raise ArgumentError, \":border_color must be a string \" +\n \"or an array [v,h] or [t,r,b,l]\"\n end\n end",
"title": ""
},
{
"docid": "e20391d487146309e83e699ee02ce498",
"score": "0.5282967",
"text": "def export_image\n @assembled_image.map{|row|row.map(&:remove_borders)}.flat_map(&:transpose).map(&:join)\n end",
"title": ""
},
{
"docid": "f0f41114eab786cf04963d2e2e056877",
"score": "0.52639914",
"text": "def trim(border = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ff8670e92123f12fb812e3c76df61b48",
"score": "0.5245511",
"text": "def ends( first, last )\n if direction( first, last ) == \"v\"\n\n if first[0] == 0 # borders left\n a = [ [ last[0] + 1, last[1] ] ]\n elsif last[0] == 9 # borders right\n a = [ [ first[0] - 1, first[1] ] ]\n else # no borders\n a = [ [ first[0] - 1, first[1] ], [ last[0] + 1, last[1] ] ]\n end\n\n elsif direction( first, last ) == \"h\"\n\n if first[1] == 0 # borders top\n a = [ [ last[0], last[1] + 1 ] ]\n elsif last[1] == 9 # borders bottom\n a = [ [ first[0], first[1] - 1 ] ]\n else # no borders\n a = [ [ first[0], first[1] - 1 ], [ last[0], last[1] + 1 ] ]\n end\n\n end \nend",
"title": ""
},
{
"docid": "24f4b94a2e565911d7d3945b14f3b3f6",
"score": "0.52402276",
"text": "def output_border\n puts \"=\" * 30\n puts \" \"\nend",
"title": ""
},
{
"docid": "05358bd29d253b9e8e7ef079b7ba4d59",
"score": "0.5214177",
"text": "def find_border\n {\n top: pixels.first.join,\n left: pixels.map(&:first).join,\n bottom: pixels.last.join,\n right: pixels.map(&:last).join\n }\n end",
"title": ""
},
{
"docid": "b096c4e36b368e9e81f13583f972b6a2",
"score": "0.52132064",
"text": "def border_width()\n @border ||= img_size() / 10\n end",
"title": ""
},
{
"docid": "df577842acffce14e5ffb3f9ad51c745",
"score": "0.52119803",
"text": "def set_border(file)\r\n # Set Border\r\n background.border = file\r\n end",
"title": ""
},
{
"docid": "f9d8ce22cf208ed0e07ead3cfcc79213",
"score": "0.51814866",
"text": "def border(table_data, location)\n symbols = @symbols\n result = []\n result << symbols[:\"#{location}_left\"]\n distribute_widths(max_widths(table_data)).each.with_index do |width, i|\n result << symbols[:\"#{location}_center\"] if i != 0\n result << (symbols[:line] * (width + 2))\n end\n result << symbols[:\"#{location}_right\"]\n styles = Array(@theme[:table])\n @pastel.decorate(result.join, *styles)\n end",
"title": ""
},
{
"docid": "e2935bd5e781926b78dc6c658dbaa72e",
"score": "0.51745325",
"text": "def border!\n border do\n # adds default border\n end\n end",
"title": ""
},
{
"docid": "e2935bd5e781926b78dc6c658dbaa72e",
"score": "0.51745325",
"text": "def border!\n border do\n # adds default border\n end\n end",
"title": ""
},
{
"docid": "7bdb1b569d3674651316b7f79eb22a90",
"score": "0.5168625",
"text": "def border(width)\n print '+'\n width.times { print '-' }\n puts \"+\"\nend",
"title": ""
},
{
"docid": "70f0d36e35a39e621cffbac25d4d9aa0",
"score": "0.5156412",
"text": "def border!(options = {})\r\n options = options.symbolize_keys if options.respond_to?(:symbolize_keys)\r\n defaults = {\r\n :size => '10',\r\n :color => 'white'\r\n }\r\n options = options.is_a?(Hash) ? defaults.update(options) : defaults\r\n \r\n options[:size] = size_to_xy(options[:size])\r\n \r\n # load image\r\n image = rmagick_image\r\n \r\n # apply border\r\n image.border!(options[:size][0], options[:size][1], options[:color])\r\n \r\n # save image\r\n self.rmagick_image = image\r\n self\r\n end",
"title": ""
},
{
"docid": "43e6beda4d7c807bbc1879d2b60adccd",
"score": "0.51511455",
"text": "def border_cells\r\n\t\tborder_cells = [-1, 0, 1].repeated_permutation(2).to_a\r\n\t\tborder_cells.delete([0, 0])\r\n\t\tborder_cells.map do |bx, by|\r\n\t\t\t@field.get_cell(x + bx, y + by)\r\n\t\tend.compact\r\n\tend",
"title": ""
},
{
"docid": "be3c6f775ebdf9f4dd2e31aed626cee1",
"score": "0.5103391",
"text": "def getPictureLines ()\n output = Array.new\n @picture_lines.each_index do |i|\n line = @picture_lines[i]\n vars = @vars[i].dup\n output_line = FormatHolder.new\n output_line.repeat = line.repeat\n line.each do |element|\n val = element.val\n var_name = nil\n var_name = vars.shift() unless (element.unchanging)\n var_name.strip! unless (element.unchanging)\n output_line.push( [val,var_name] ) unless val == \"\"\n end\n output.push( output_line )\n end\n output\n end",
"title": ""
},
{
"docid": "059cd240546ac16b2ddf7a3769873f4b",
"score": "0.5095853",
"text": "def end_border\n puts @border[:bottom_left] +\n (@border[:bottom_center] * (terminal_width - 2)) +\n @border[:bottom_right]\n end",
"title": ""
},
{
"docid": "009704e41a14e3754db284d0b1e721f4",
"score": "0.5041892",
"text": "def border(number)\n number.times do\n puts \"!^!^!\" * 5\n end\n end",
"title": ""
},
{
"docid": "1bffa39b4117fed8d27f0065d5c462e0",
"score": "0.49986586",
"text": "def border(text, opts={})\n # returns Shoes::Border\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "adc88700982efc6dc6e24ba6e4813478",
"score": "0.49919793",
"text": "def pborder_and(border1,border2)\n if (border1 == 0) || (border2 == 0)\n 0\n elsif border1 == 1\n border2\n elsif border2 == 1\n border1\n else\n # Both are strings\n rv = '' \n [\"L\",\"T\",\"R\",\"B\"].each do |c|\n if (border1.include? c) and (border2.include? c)\n rv += c\n end\n end\n rv\n end\n end",
"title": ""
},
{
"docid": "c16d754a48a1abf6bd997516c9806599",
"score": "0.49835208",
"text": "def removeBorders\r\n @separatorList.each_with_index { |element, index|\r\n if element.start_x == @p_block.offsetLeft && element.start_y == @p_block.offsetTop\r\n # remove separators from the blocks\r\n\t\telement.br_side.each { |br_block|\r\n\t\t\tif(element.orientation==0)\r\n\t\t\t\tbr_block.separators[0] = nil\r\n\t\t\telse\r\n\t\t\t\tbr_block.separators[1] = nil\r\n\t\t\tend\r\n\t\t}\r\n\t\tremoveSeparator(element)\r\n elsif element.end_x == @bodyX && element.end_y == @bodyY\r\n #remove separators from the blocks\r\n\t\telement.tl_side.each { |tl_block|\r\n\t\t\tif(element.orientation==0)\r\n\t\t\t\ttl_block.separators[2] = nil\r\n\t\t\telse\r\n\t\t\t\ttl_block.separators[3] = nil\r\n\t\t\tend\r\n\t\t}\r\n\t\tremoveSeparator(element)\r\n end\r\n }\r\n end",
"title": ""
},
{
"docid": "8ada268e6178a346c5b90187b34f90b8",
"score": "0.49814016",
"text": "def border\n puts \"--------------------------------\".center(50, \"--------\")\nend",
"title": ""
},
{
"docid": "cda0633619430bcb770ad8de19ed6ed0",
"score": "0.4976684",
"text": "def add_border(cell_refs, options = nil)\n if options.is_a?(Hash)\n border_edges = options[:edges]\n border_style = options[:style]\n border_color = options[:color]\n else\n border_edges = options\n end\n\n unless cell_refs.is_a?(Array)\n cell_refs = [cell_refs]\n end\n\n cell_refs.each do |cell_ref|\n item = self[cell_ref]\n\n cells = item.is_a?(Array) ? item : [item]\n\n Axlsx::BorderCreator.new(worksheet: self, cells: cells, edges: border_edges, style: border_style, color: border_color).draw\n end\n end",
"title": ""
},
{
"docid": "cb7a7db46705f7bc92e4a7d00bb636db",
"score": "0.49645296",
"text": "def twodimensional\n twod = []\n @image.each do |i|\n @twodimensional = i.join\n @twod = twod << @twodimensional\n end\n end",
"title": ""
},
{
"docid": "571b70596bfef58ff7a2d88683f4e5bf",
"score": "0.49644327",
"text": "def connect_to_borders(yx)\n 2.upto(@gsize-1) do |n|\n AROUND.each do |c|\n i = (c[0]<0 ? @gsize : c[0]*n) + c[1] # n,1,n,gsize\n j = (c[2]<0 ? @gsize : c[2]*n) + c[3] # 1,n,gsize,n\n if yx[j][i]==EMPTY\n i2= (c[0]<0 ? @gsize-1 : c[0]*n) + c[1]*2 # n,2,n,gsize-1\n j2= (c[2]<0 ? @gsize-1 : c[2]*n) + c[3]*2 # 2,n,gsize-1,n\n i3= (c[0]<0 ? @gsize : c[0]*(n+1)) + c[1] # n+1,1,n+1,gsize\n j3= (c[2]<0 ? @gsize : c[2]*(n+1)) + c[3] # 1,n+1,gsize,n+1\n i4= (c[0]<0 ? @gsize : c[0]*(n-1)) + c[1] # n-1,1,n-1,gsize\n j4= (c[2]<0 ? @gsize : c[2]*(n-1)) + c[3] # 1,n-1,gsize,n-1\n next2border = yx[j2][i2]\n if next2border!=EMPTY and yx[j3][i3]==EMPTY and yx[j4][i4]==EMPTY\n add_stone(yx, i, j, next2border)\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1a0f329d3054611d0fddf5ba1e4b9330",
"score": "0.49528474",
"text": "def trim!(border = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "10090f983f21ecb92b3c21eacbf59c07",
"score": "0.49448243",
"text": "def border size, color = nil\n color ||= @fg || @bg\n @borders << Border.new( size.is_a?(Hash) ? size : {:size => size, :color => color} )\n end",
"title": ""
},
{
"docid": "6dca32bf3c6430e44aaa86247530ff5c",
"score": "0.49445134",
"text": "def border!\n @win.box(@vborder, @hborder)\n end",
"title": ""
},
{
"docid": "fbdfab710b70db6405d2e200a48330e8",
"score": "0.4943373",
"text": "def pretty_format_board\n border = '+' + ('-' * @board.first.size) + '+'\n rows = @board\n .map { |row| '|' + row.join + '|' }\n .map { |row| row.gsub(/0/, ' ') }\n\n [border, rows, border].flatten\n end",
"title": ""
},
{
"docid": "3720d5179664269dab175230248a535b",
"score": "0.49405363",
"text": "def test_set_border\n end",
"title": ""
},
{
"docid": "adbc173acb9f0e08346c1c0af9759638",
"score": "0.49348682",
"text": "def list_separator(list); end",
"title": ""
},
{
"docid": "ffc65e333a65c9f43bcf89c5e9cf3a40",
"score": "0.4933567",
"text": "def display_board(board=Array.new(9,\" \"))\n #define borders\n rbs = \"-\"\n cbs = \"|\"\n row_border = Array.new(11,rbs)\n #define and print first row\n puts \" #{board[0]} \" + cbs + \" #{board[1]} \" + cbs + \" #{board[2]} \"\n #print 1st border\n for i in 0...11 do\n print row_border[i]\n end\n puts #this is for adding a newline to the end\n #define and print second row\n puts \" #{board[3]} \" + cbs + \" #{board[4]} \" + cbs + \" #{board[5]} \"\n #print 2nd border\n for i in 0...11 do\n print row_border[i]\n end\n puts #this is for adding a newline to the end\n #define and print the last/third row\n puts \" #{board[6]} \" + cbs + \" #{board[7]} \" + cbs + \" #{board[8]} \"\nend",
"title": ""
},
{
"docid": "336f6baa53f46686d90682ec40b24e5f",
"score": "0.4928514",
"text": "def OLDprint_borders #:nodoc:\n raise \"#{self.class} needs width\" unless @width\n raise \"#{self.class} needs height\" unless @height\n\n $log.debug \" #{@name} print_borders, #{@graphic.name} \"\n\n bordercolor = @border_color || $datacolor\n borderatt = @border_attrib || Ncurses::A_NORMAL\n @graphic.print_border @row, @col, @height-1, @width, bordercolor, borderatt\n print_title\n end",
"title": ""
},
{
"docid": "3e76fa5dae34886f250ed3fee6ba531f",
"score": "0.49257782",
"text": "def clean_tag_borders(string)\n result = string.gsub(/\\s?\\*{2,}.*?\\*{2,}\\s?/) do |match|\n preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do\n match.strip.sub('** ', '**').sub(' **', '**')\n end\n end\n\n result = result.gsub(/\\s?\\_{2,}.*?\\_{2,}\\s?/) do |match|\n preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do\n match.strip.sub('__ ', '__').sub(' __', '__')\n end\n end\n\n result = result.gsub(/\\s?~{2,}.*?~{2,}\\s?/) do |match|\n preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do\n match.strip.sub('~~ ', '~~').sub(' ~~', '~~')\n end\n end\n\n result.gsub(/\\s?\\[.*?\\]\\s?/) do |match|\n preserve_border_whitespaces(match) do\n match.strip.sub('[ ', '[').sub(' ]', ']')\n end\n end\n end",
"title": ""
},
{
"docid": "dab7eb3ead4492bb96d5f67a4f458b95",
"score": "0.49094692",
"text": "def top_border\n \"\\n\" + '╔' + ('═══╤' * (width - 1)) + '═══╗' + \"\\n\" +\n '║'\n end",
"title": ""
},
{
"docid": "0ad05085665bdfa6a495d98b37ced08f",
"score": "0.48969418",
"text": "def borders(workbook, center, heading, _colors)\n worksheet = workbook.add_worksheet('Borders')\n\n worksheet.set_column(0, 4, 10)\n worksheet.set_column(5, 5, 40)\n\n worksheet.write(0, 0, \"Index\", heading)\n worksheet.write(0, 1, \"Index\", heading)\n worksheet.write(0, 3, \"Style\", heading)\n worksheet.write(0, 5, \"The style is highlighted in red for \", heading)\n worksheet.write(1, 5, \"emphasis, the default color is black.\",\n heading)\n\n 14.times do |i|\n format = workbook.add_format\n format.set_border(i)\n format.set_border_color('red')\n format.set_align('center')\n\n worksheet.write((2 * (i + 1)), 0, i, center)\n worksheet.write((2 * (i + 1)),\n 1, sprintf(\"0x%02X\", i), center)\n\n worksheet.write((2 * (i + 1)), 3, \"Border\", format)\n end\n\n worksheet.write(30, 0, \"Diag type\", heading)\n worksheet.write(30, 1, \"Index\", heading)\n worksheet.write(30, 3, \"Style\", heading)\n worksheet.write(30, 5, \"Diagonal Boder styles\", heading)\n\n (1..3).each do |i|\n format = workbook.add_format\n format.set_diag_type(i)\n format.set_diag_border(1)\n format.set_diag_color('red')\n format.set_align('center')\n\n worksheet.write((2 * (i + 15)), 0, i, center)\n worksheet.write((2 * (i + 15)),\n 1, sprintf(\"0x%02X\", i), center)\n\n worksheet.write((2 * (i + 15)), 3, \"Border\", format)\n end\nend",
"title": ""
},
{
"docid": "bfa46bce4ea3248fa45a583c19d00a07",
"score": "0.4895194",
"text": "def add_to_images_list(photos)\n photos.each do |photo|\n img = @image.read(photo['local_path']).first\n img.border!(30, 30, \"#ffffff\")\n @image_list << img\n end\n @image_list\n end",
"title": ""
},
{
"docid": "921614275817f5e9791095b6cc25736e",
"score": "0.488814",
"text": "def create\n @border = current_user.borders.build(border_params)\n @border.count = 0\n\n if @border.save\n flash[:success] = \"세종대 동아리 소개 홈페이지에 오신걸 환영합니다!\"\n redirect_to borders_url\n else\n render :new\n render json: @border.errors\n end\n end",
"title": ""
},
{
"docid": "7b075741a4f37cc978914cd7cb5c54a3",
"score": "0.48830467",
"text": "def get_border_key\n [\n @bottom,\n @bottom_color,\n @diag_border,\n @diag_color,\n @diag_type,\n @left,\n @left_color,\n @right,\n @right_color,\n @top,\n @top_color\n ].join(':')\n end",
"title": ""
},
{
"docid": "7b075741a4f37cc978914cd7cb5c54a3",
"score": "0.48830467",
"text": "def get_border_key\n [\n @bottom,\n @bottom_color,\n @diag_border,\n @diag_color,\n @diag_type,\n @left,\n @left_color,\n @right,\n @right_color,\n @top,\n @top_color\n ].join(':')\n end",
"title": ""
},
{
"docid": "4443792417627a424adfed34cd841e18",
"score": "0.48810044",
"text": "def thing_list(thing, separator)\n (thing >> (whitespaces? >> separator >> whitespaces? >> thing).repeat).repeat\n end",
"title": ""
},
{
"docid": "1660641a9e603d4b8bc9c81e30fef77e",
"score": "0.48757085",
"text": "def borderId; end",
"title": ""
},
{
"docid": "3e21deae810ce21124e2d91400ec8a19",
"score": "0.48755762",
"text": "def start_border(header)\n header = \" #{header} \"\n puts @border[:top_left] +\n header.center((terminal_width - 2), @border[:top_center]) +\n @border[:top_right]\n end",
"title": ""
},
{
"docid": "5653bb2c6d0cb197820a9df7b097b31f",
"score": "0.48734435",
"text": "def create_image_list images, border, options\r\n\r\n gradient_color = nil\r\n item_layout = :horizontal\r\n enable_removal_gesture = false\r\n \r\n if options[0].is_a?(Hash)\r\n \r\n params = options[0]\r\n \r\n if params[:gradient_color]\r\n gradient_color = params[:gradient_color]\r\n params.delete :gradient_color\r\n end\r\n \r\n if not params[:removal_gesture].nil?\r\n enable_removal_gesture = params[:removal_gesture] == true\r\n params.delete :removal_gesture\r\n end\r\n \r\n if not params[:item_layout].nil?\r\n item_layout = params[:item_layout]\r\n params.delete :item_layout\r\n end\r\n \r\n end\r\n \r\n comp = list(images, *options)\r\n \r\n scroll = comp.java_component\r\n imageList = comp.java_component(true)\r\n \r\n scroll.getViewport().setOpaque(false)\r\n imageList.setOpaque(false)\r\n \r\n case item_layout\r\n \r\n when :tile\r\n\r\n imageList.setLayoutOrientation(JList::HORIZONTAL_WRAP)\r\n scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants::HORIZONTAL_SCROLLBAR_ALWAYS)\r\n scroll.setVerticalScrollBarPolicy(ScrollPaneConstants::VERTICAL_SCROLLBAR_ALWAYS)\r\n scroll.getHorizontalScrollBar.setUI(AerithScrollbarUI.new)\r\n scroll.getVerticalScrollBar.setUI(AerithScrollbarUI.new)\r\n \r\n s_bar_h = scroll.getHorizontalScrollBar.getPreferredSize\r\n s_bar_v = scroll.getVerticalScrollBar.getPreferredSize\r\n \r\n scroll.setViewport(GradientViewport.new(gradient_color, 45, GradientViewport::Orientation::HORIZONTAL)) if gradient_color\r\n \r\n when :horizontal\r\n \r\n imageList.setVisibleRowCount(1)\r\n imageList.setLayoutOrientation(JList::HORIZONTAL_WRAP)\r\n scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants::HORIZONTAL_SCROLLBAR_ALWAYS)\r\n scroll.setVerticalScrollBarPolicy(ScrollPaneConstants::VERTICAL_SCROLLBAR_NEVER)\r\n scroll.getHorizontalScrollBar.setUI(AerithScrollbarUI.new)\r\n \r\n s_bar_h = scroll.getHorizontalScrollBar.getPreferredSize\r\n \r\n scroll.setViewport(GradientViewport.new(gradient_color, 45, GradientViewport::Orientation::HORIZONTAL)) if gradient_color\r\n \r\n else\r\n \r\n imageList.setLayoutOrientation(JList::VERTICAL)\r\n scroll.setVerticalScrollBarPolicy(ScrollPaneConstants::VERTICAL_SCROLLBAR_ALWAYS)\r\n scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants::HORIZONTAL_SCROLLBAR_NEVER)\r\n scroll.getVerticalScrollBar.setUI(AerithScrollbarUI.new)\r\n \r\n s_bar_v = scroll.getVerticalScrollBar.getPreferredSize\r\n\r\n # aerith didn't implement VERTICAL gradient....\r\n #scroll.setViewport(GradientViewport.new(gradient_color, 45, GradientViewport::Orientation::VERTICAL)) if gradient_color\r\n \r\n end\r\n\r\n if border\r\n\r\n renderer = org.codehaus.swiby.component.ImageListCellRenderer.new(border)\r\n \r\n renderer.setImageRemovalGestureEnable(imageList, true) if enable_removal_gesture\r\n \r\n imageList.setCellRenderer(renderer)\r\n \r\n end\r\n\r\n scroll.getViewport.setView(imageList)\r\n \r\n insets = scroll.getInsets\r\n s2 = imageList.getPreferredSize\r\n \r\n if item_layout == :horizontal\r\n d = Dimension.new(s2.width + insets.left + insets.right, s_bar_h.height + s2.height + insets.top + insets.bottom)\r\n elsif item_layout == :vertical\r\n d = Dimension.new(s_bar_v.width + s2.width + insets.left + insets.right, s_bar_v.height + insets.top + insets.bottom)\r\n else\r\n d = Dimension.new(s_bar_v.width + s2.width + insets.left + insets.right, s_bar_h.height + s2.height + insets.top + insets.bottom)\r\n end\r\n\r\n scroll.setPreferredSize(d)\r\n\r\n comp\r\n \r\n end",
"title": ""
},
{
"docid": "0a2d18724541c373dc05a116e2550ead",
"score": "0.48546425",
"text": "def set_border(style)\n set_bottom(style)\n set_top(style)\n set_left(style)\n set_right(style)\n end",
"title": ""
},
{
"docid": "fda1c26d70d9204ad5d604775109d0f6",
"score": "0.48488468",
"text": "def append_whitespace(arr_words)\n max_length = arr_words.map(&:size).max\n arr_words.map do |word|\n next if word.length == max_length\n word = (max_length - word.size).times { word << \" \" }\n end\n arr_words\n end",
"title": ""
},
{
"docid": "671e860eb53ed6d6e386b079f1812dea",
"score": "0.48410338",
"text": "def border_internal(fborder,l,t,r,b)\n # puts \"In border_internal with (#{l},#{t},#{r},#{b}) and border #{fborder}\"\n border = pborder(fborder)\n if border.any?\n old_cap_style = @pdoc.cap_style\n @pdoc.cap_style :projecting_square\n mt = @pdoc.method(:move_to)\n lt = @pdoc.method(:line_to)\n @pdoc.stroke do\n @pdoc.move_to l, b\n (border.left != 0 ? lt : mt).call(l,t)\n (border.top != 0 ? lt : mt).call(r,t)\n (border.right != 0 ? lt : mt).call(r,b)\n (border.bottom != 0 ? lt : mt).call(l,b)\n end\n @pdoc.cap_style old_cap_style\n end\n end",
"title": ""
},
{
"docid": "2f3268e9cbf73feb166ba87ec8411b02",
"score": "0.48298496",
"text": "def draw_border(x, y, height, width)\n return unless numeric?(height) && numeric?(width)\n x = 0 unless numeric?(x)\n y = 0 unless numeric?(y)\n\n label_data.push('^FO' + Integer(x * printer_dpi).to_s + ',' +\n Integer(y * printer_dpi).to_s + '^GB' +\n Integer(height * printer_dpi).to_s +\n ',' + Integer(width * printer_dpi).to_s + ',1^FS')\n\n # draw_rectangle(x * pdf_dpi, y * pdf_dpi, height * pdf_dpi, width * pdf_dpi)\n end",
"title": ""
},
{
"docid": "2f3268e9cbf73feb166ba87ec8411b02",
"score": "0.48298496",
"text": "def draw_border(x, y, height, width)\n return unless numeric?(height) && numeric?(width)\n x = 0 unless numeric?(x)\n y = 0 unless numeric?(y)\n\n label_data.push('^FO' + Integer(x * printer_dpi).to_s + ',' +\n Integer(y * printer_dpi).to_s + '^GB' +\n Integer(height * printer_dpi).to_s +\n ',' + Integer(width * printer_dpi).to_s + ',1^FS')\n\n # draw_rectangle(x * pdf_dpi, y * pdf_dpi, height * pdf_dpi, width * pdf_dpi)\n end",
"title": ""
},
{
"docid": "8b270231fd8eeac65a92682f1134cfe0",
"score": "0.48276648",
"text": "def border_left()\n return get_border(:left)\n end",
"title": ""
},
{
"docid": "8b270231fd8eeac65a92682f1134cfe0",
"score": "0.48276648",
"text": "def border_left()\n return get_border(:left)\n end",
"title": ""
},
{
"docid": "d7264a94e38349bd3f789ed30456d510",
"score": "0.48267496",
"text": "def border\n return '' unless block_given?\n\n \"#{border_on}#{yield}#{border_off}\"\n end",
"title": ""
},
{
"docid": "99f0f9576c16c0ecf1ad7166279337f1",
"score": "0.48266482",
"text": "def make_me_match_border!(my_border, target)\n already_matching = @borders.select do |_, v|\n v == target || v.reverse == target\n end\n current = already_matching.keys.first\n\n img_save = @img\n\n # Do we need to rotate?\n if current != my_border && current != OPPOSITE[my_border]\n rotate!\n current = ROTATE[current]\n end\n\n # Do we need to flip?\n if current != my_border\n current == :top || current == :bottom ? flip_v! : flip_h!\n current = OPPOSITE[current]\n end\n\n # Now we're on the same border but are we reversed?\n if make_border(@img, my_border) != target\n current == :top || current == :bottom ? flip_h! : flip_v!\n end\n\n @borders = make_borders(@img) if @img != img_save\n end",
"title": ""
},
{
"docid": "989dc073f854d4f27ca027be239d6e62",
"score": "0.48203766",
"text": "def test_border\n [@window, @sprite, @bitmap].each{|container|\n c = CTriangle.new(container, 0, 50, 100, 50, 50, 100, Color.gauge_back_color, true, Color.gauge_back_color,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "174059a72043813a7c7d63a038e52f19",
"score": "0.48178226",
"text": "def formatted_image_paths\n image_paths.map { |image_path| \"[#{image_path}]\" }.join(' ')\n end",
"title": ""
},
{
"docid": "7ff3f89673e298cbfca7032d1fbed976",
"score": "0.48168427",
"text": "def clean_tag_borders(string); end",
"title": ""
},
{
"docid": "e3e3c79d8c93818a9f0235b8d64788a2",
"score": "0.48086554",
"text": "def test_update_border\n filename = 'TablesGet.docx'\n remote_name = 'TestUpdateBorder.docx'\n index = 0\n border = Border.new({:BorderType => 'Left', :Color => XmlColor.new({:Alpha => 2}),\n :DistanceFromText => 6, :LineStyle => 'DashDotStroker',\n :LineWith => 2, :Shadow => true})\n\n st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_test_folder + test_folder + '/' + filename, \"r\").read\n @storage_api.put_create st_request\n\n request = UpdateBorderRequest.new remote_name, border, 'tables/1/rows/0/cells/0/', index, remote_test_folder + test_folder\n result = @words_api.update_border request\n assert_equal 200, result.code\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "6be7733d07b6acf227af792a7635e329",
"score": "0.0",
"text": "def image_params\n raw_image_params = params.require(:image)\n raw_image_params.permit(:title, :url).merge({\n :aspect_ratio => image_aspect_ratio(raw_image_params[:url])\n })\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": ""
}
] |
745ea8c38bdcd0a70db59a770ceaca4e | Wait for an element to appear in the DOM | [
{
"docid": "f38eff576d4afb6ef1dd0ea7d112de58",
"score": "0.6898806",
"text": "def wait_for_element(id, name, time)\n wait = Selenium::WebDriver::Wait.new(:timeout => time)\n wait.until {@driver.find_element(id => name) }\nend",
"title": ""
}
] | [
{
"docid": "99dfe4e8e958f6276b2bb63f1f553a7a",
"score": "0.8048109",
"text": "def wait_for_element(element)\n @wait.until {\n bool = false\n\n if(element.displayed?)\n bool = true\n @element = element\n break\n end\n\n bool == true\n }\n end",
"title": ""
},
{
"docid": "4d76da3e2eb617533c87ac5029674d66",
"score": "0.79551435",
"text": "def wait_for_element(element)\n @wait.until { find_element(element) }\n end",
"title": ""
},
{
"docid": "d46e48e83e809bef30def5445a1c38d4",
"score": "0.78123546",
"text": "def wait_until_webelement_displays(webelement, timeout=15)\n puts \"Waiting for an Webelement to show up\"\n wait = Selenium::WebDriver::Wait.new(:timeout=> timeout)\n wait.until {webelement.displayed?}\n end",
"title": ""
},
{
"docid": "67daece741372c9fe4d193e831879ae2",
"score": "0.77193755",
"text": "def wait_for_element(element)\n self.send(element).wait_until_present(@ole.explicit_wait)\n end",
"title": ""
},
{
"docid": "3da4484c7fa53480f30f64a8c194e1b4",
"score": "0.7593376",
"text": "def wait_for_element(obj)\n # exists? – Returns whether this element actually exists.\n # present? – Returns true if the element exists and is visible on the page , equivalent to visible and exists\n # visible? – If any parent element isn’t visible then we cannot write to the element. The only reliable way to determine this is to\n # iterate up the DOM element tree checking every element to make sure it’s visible.\n # obj.exists?\n # obj.visible?\n obj.wait_until_present\n obj.present?\n obj.enabled?\n\nend",
"title": ""
},
{
"docid": "b7ef986ec1c2367299ff2c80e29365de",
"score": "0.75066346",
"text": "def wait_for_element(obj)\r\n # exists? – Returns whether this element actually exists.\r\n # present? – Returns true if the element exists and is visible on the page , equivalent to visible and exists\r\n # visible? – If any parent element isn’t visible then we cannot write to the element. The only reliable way to determine this is to\r\n # iterate up the DOM element tree checking every element to make sure it’s visible.\r\n # obj.exists?\r\n # obj.visible?\r\n obj.wait_until_present\r\n obj.present?\r\n obj.enabled?\r\nend",
"title": ""
},
{
"docid": "67a4e04697fb230517e54144a31e66c1",
"score": "0.74784845",
"text": "def wait_for_dom(dom_finder: nil)\n Timeout.timeout(Capybara.default_max_wait_time) do\n loop until element_visible?(dom_finder)\n end\n end",
"title": ""
},
{
"docid": "f6f006acb9732608f3c24087e199c798",
"score": "0.74685365",
"text": "def wait_for_element(element)\n wait = Selenium::WebDriver::Wait.new(timeout: 60)\n wait.until { find_element(element) }\n end",
"title": ""
},
{
"docid": "f6f006acb9732608f3c24087e199c798",
"score": "0.74685365",
"text": "def wait_for_element(element)\n wait = Selenium::WebDriver::Wait.new(timeout: 60)\n wait.until { find_element(element) }\n end",
"title": ""
},
{
"docid": "bf7c9430140fa346f553e4b781119cd4",
"score": "0.74454266",
"text": "def wait_for_element_to_be_visible(id, name, time)\n begin\n element = get_element(id, name)\n !time.times {\n break if element.displayed?\n sleep 1\n }\n rescue\n end\nend",
"title": ""
},
{
"docid": "a6d82ad4192a121afd1b2f7dbf39ce07",
"score": "0.74361634",
"text": "def wait_until(timeout=nil)\n Log.debug('Waiting for new element...')\n timeout = Gridium.config.element_timeout if timeout.nil?\n ElementVerification.new(self, timeout, fail_test=true)\n end",
"title": ""
},
{
"docid": "eaa1c70eb6f5072cb32e9df06c69552b",
"score": "0.7373923",
"text": "def wait_until(timeout: nil)\n Log.debug('Waiting for new element...')\n timeout = Gridium.config.element_timeout if timeout.nil?\n ElementVerification.new(self, timeout, fail_test: true)\n end",
"title": ""
},
{
"docid": "f12745bdc76f0a6b1c5ffcad3804fe36",
"score": "0.7341946",
"text": "def wait_for_element_present(web_element)\n Selenium::WebDriver::Wait.new(:timeout => 60).until {web_element}\n end",
"title": ""
},
{
"docid": "593cc60faf08d2614303e3d657ff6c02",
"score": "0.73154104",
"text": "def waitForElementUtillVisibility(locator)\n wait = Selenium::WebDriver::Wait.new(:timeout => 60)\n return wait.until {\n driver.find_element(locator)\n }\n end",
"title": ""
},
{
"docid": "e10c5357a83bed1b836030c21614c8c4",
"score": "0.72922564",
"text": "def element_waiter locator\n wait_until { element_exists? locator }\n end",
"title": ""
},
{
"docid": "6a680157eda1cf9afa1e121158a68991",
"score": "0.7279535",
"text": "def wait_for_render(how, what)\n\t\t@wait.until {@driver.find_element(how, what).displayed? == true}\n\tend",
"title": ""
},
{
"docid": "9dc87a285e37649d01213b71f235645b",
"score": "0.7258074",
"text": "def wait_until_appears(finder)\n @wait.until { @driver.find_element(finder) }\n end",
"title": ""
},
{
"docid": "3fed933bf2bc0ffa7114e921458628b2",
"score": "0.7197318",
"text": "def wait_until_visible(seconds = nil)\n wait(seconds){visible?}\n rescue\n raise DATPages::Errors::ElementNotFound.new\n end",
"title": ""
},
{
"docid": "4d73c413e82f6612967641b3984aa504",
"score": "0.7179259",
"text": "def wait_for_elements\n adapter.wait_for_elements\n end",
"title": ""
},
{
"docid": "6c8a200b986ac0bc80c5e87dcd9d6107",
"score": "0.7177311",
"text": "def wait_for_element_present(element)\n assert !60.times{ break if (is_element_present(element) rescue false); sleep 1 }\n end",
"title": ""
},
{
"docid": "2aec1d998664581e34edf34228edf559",
"score": "0.7176748",
"text": "def wait_for_elements\n super\n end",
"title": ""
},
{
"docid": "a397b64eea513d32c084d3003ded3f59",
"score": "0.71750253",
"text": "def wait_until_visible\n wait_for_visibility(true) { DriverManager.driver.find_element(@by, @locator).displayed? }\n end",
"title": ""
},
{
"docid": "9249f169025f8082c34fd2036f05abd1",
"score": "0.7146573",
"text": "def wait_for_dom\n uuid = SecureRandom.uuid\n current_session.find(\"body\")\n current_session.evaluate_script <<-EOS\n _.defer(function() {\n $('body').append(\"<div id='#{uuid}'></div>\");\n });\n EOS\n current_session.find(\"div##{uuid}\")\n end",
"title": ""
},
{
"docid": "b5594532576c349c1249c289c6649b21",
"score": "0.71337205",
"text": "def wait_for_ajax_element(obj)\r\n# Add gem watir-dom-wait\r\n obj.wait_until(&:dom_changed?).present?\r\n obj.wait_until(&:dom_changed?).enabled?\r\n obj.wait_while_present # For AJAX and Javascript loads\r\n\r\nend",
"title": ""
},
{
"docid": "ce618a1b470dc0234f8c019aa5b1c8b3",
"score": "0.7121447",
"text": "def wait_for(element)\n case element\n when :page_load\n browser.wait_for(:wait_for => :page)\n when :ajax\n browser.wait_for(:wait_for => :ajax, :javascript_framework => Pyrite.js_framework)\n else\n browser.wait_for(:element => \"jquery=#{element}\")\n end\n end",
"title": ""
},
{
"docid": "09a33d2d43648452cc7aaa323a81af64",
"score": "0.7095485",
"text": "def wait_for_ajax_element(obj)\n# Add gem watir-dom-wait\n obj.wait_until(&:dom_changed?).present?\n obj.wait_until(&:dom_changed?).enabled?\n obj.wait_while_present # For AJAX and Javascript loads\n\nend",
"title": ""
},
{
"docid": "ade7dc4f362fb860b65b8284308abdb0",
"score": "0.7088685",
"text": "def wait_for xpath\n wait_for_element xpath\n end",
"title": ""
},
{
"docid": "91a1063fe8746ee4a3410e98d77d6328",
"score": "0.70751864",
"text": "def wait_for_elements\n @wait_on << :title\n end",
"title": ""
},
{
"docid": "23b108d8e5768dfde46354f936ed630f",
"score": "0.7073441",
"text": "def wait_for_page_to_load\n @wait_on.each { |element| wait_for_element(element) }\n end",
"title": ""
},
{
"docid": "4ff3d58d05ecffd59b3c83c3c02e55ea",
"score": "0.7031294",
"text": "def wait_till_element_visible(element_name, n_retry = 3)\n dbg_msg('info',\"Wait till element #{element_name} is visible\")\n wait_for_visibility(element_name, true, n_retry)\n end",
"title": ""
},
{
"docid": "64780b51634ab456edd33a7f445ab9c3",
"score": "0.7011719",
"text": "def wait_for(element, time = IMPLICIT_WAIT_TIME)\n Selenium::WebDriver::Wait.new(timeout: time).until do\n @@driver.find_element(element).displayed?\n end\n rescue StandardError => er\n puts er.inspect\n take_screenshot\n false\n end",
"title": ""
},
{
"docid": "2e89903b9cc7f63570e5fd3228f9d09b",
"score": "0.7008635",
"text": "def wait_for_element_to_disappear(element)\n @wait.until {\n begin\n !element.displayed?\n rescue\n break\n end\n }\n end",
"title": ""
},
{
"docid": "2751714d5a2092c1030a15e266155201",
"score": "0.699526",
"text": "def wait_for_element(id, waitTime)\n\t\twait_for_elements_exist [\"* marked:'#{id}'\"], timeout: waitTime\n\tend",
"title": ""
},
{
"docid": "5970f9530582563cbf093fc1398cefd7",
"score": "0.6977248",
"text": "def wait_for_search_result_section_to_load\n wait_for_element_present(SEARCH_RESULT_SECTION)\n end",
"title": ""
},
{
"docid": "e527db3fd4115155b36f55250a19c7e0",
"score": "0.6962249",
"text": "def ****_wait(selector, element, timeout = DEFAULT_TIMEOUT)\n begin\n ****_display(selector, element, timeout)\n rescue Exception => e\n raise e.message\n raise e.backtrace.inspect\n end\nend",
"title": ""
},
{
"docid": "272129522f17ffe217421eefa44bb794",
"score": "0.6953679",
"text": "def wait_for_element_to_present(locator, timeout=60000)\r\n timeout = timeout.to_i / 1000\r\n flag = false\r\n for wait_time in 1..timeout\r\n if is_element_present(locator)\r\n flag = true\r\n break\r\n end\r\n sleep 1\r\n end\r\n return flag\r\n end",
"title": ""
},
{
"docid": "95a2f75af4c7b16dacc0c99f149dbd65",
"score": "0.69405687",
"text": "def wait_for_element(locator, timeout_in_seconds=nil)\n\t\t script = <<-EOS\n\t\t var element;\n\t\t try {\n\t\t element = selenium.browserbot.findElement('#{locator}');\n\t\t } catch(e) {\n\t\t element = null;\n\t\t }\n\t\t element != null\n\t\t EOS\n\n\t\t wait_for_condition script, timeout_in_seconds\n\t\t end",
"title": ""
},
{
"docid": "d25c8d0fc95e1244db7755b65edbaec9",
"score": "0.69136345",
"text": "def wait_for_element(options = {})\n puts \"#{method_name}(#{options.inspect})\" if @@debug\n index = 0\n if(options[:index])\n index = options[:index]\n end\n if(options[:timeout])\n timeout = options[:timeout]\n options.delete(:timeout)\n else\n timeout = @@timeout\n end\n refresh_screen\n start_time = Time.now\n until(element_exists?(options)) do\n if Time.now - start_time > timeout\n flunk(\"Timed out after #{timeout} seconds\\n\")\n end\n refresh_screen\n sleep 0.1\n end\n get_all_elements(options)[index]\n end",
"title": ""
},
{
"docid": "24ed3818ff40d443db606615f8bcf792",
"score": "0.6913338",
"text": "def when_present(timeout = ::PageObject.default_element_wait)\n wait = Object::Selenium::WebDriver::Wait.new(timeout: timeout, message: \"Element not present in #{timeout} seconds\")\n wait.until do\n root.exists?\n end\n self\n end",
"title": ""
},
{
"docid": "df66512c47622d5a842b0ff1b62e2c4a",
"score": "0.6910864",
"text": "def wait_for_element_display(times=150)\n 1.upto(times) do |i|\n break unless yield == nil\n raise \"Element does not exist in the viewport.\" if i == times\n sleep 0.2\n end\n end",
"title": ""
},
{
"docid": "52b1063161a304c4dd08c6ed93fea966",
"score": "0.69089794",
"text": "def wait_for_dom\n uuid = SecureRandom.uuid\n page.find(\"body\")\n page.evaluate_script <<-EOS\n _.defer(function() {\n $('body').append(\"<div id='#{uuid}'></div>\");\n });\n EOS\n page.find(\"##{uuid}\")\nend",
"title": ""
},
{
"docid": "75566c36e28b95f7bb0b66fffe56078d",
"score": "0.6889598",
"text": "def wait_for_element(locator, options={})\n\t\t wait_for_condition find_element_script(locator, \"element != null\"), \n\t\t options[:timeout_in_seconds]\n\t\t end",
"title": ""
},
{
"docid": "3c676f9deba03db9d10240abe202b305",
"score": "0.68695223",
"text": "def wait_for_loading(timeout = 20)\n wait_until(timeout) { find('.loading', visible: false).present? }\nend",
"title": ""
},
{
"docid": "38e3eabdf866214f1cff68e5444abd69",
"score": "0.6860728",
"text": "def wait_for_dom(timeout = 15)\n uuid = SecureRandom.uuid\n # make sure body is loaded before appending anything to it\n wait(timeout: timeout, msg: \"Timeout after waiting #{timeout} for body to load\").until do\n is_element_present?(:css, 'body')\n end\n driver.execute_script <<-EOS\n _.defer(function() {\n $('body').append(\"<div id='#{uuid}'></div>\");\n });\n EOS\n wait(timeout: timeout, msg: \"Timeout after waiting #{timeout} for all dom events to finish\").until do\n is_element_present?(:css, \"div[id='#{uuid}']\")\n end\n end",
"title": ""
},
{
"docid": "e53f97e1c888ca0d9fa9fbe0f6b280cc",
"score": "0.68593055",
"text": "def wait_for_element(locator)\n wait_until do\n locator.present? && locator_is_enabled?(locator)\n end\n end",
"title": ""
},
{
"docid": "4b761b815bf94e7e036a3a8a66d7d472",
"score": "0.68529016",
"text": "def wait_until(timeout=::PageObject.default_element_wait, message=nil, &block)\n element.wait_until(timeout: timeout, message: message, &block)\n end",
"title": ""
},
{
"docid": "4b761b815bf94e7e036a3a8a66d7d472",
"score": "0.68529016",
"text": "def wait_until(timeout=::PageObject.default_element_wait, message=nil, &block)\n element.wait_until(timeout: timeout, message: message, &block)\n end",
"title": ""
},
{
"docid": "01ecff459eb4851c2c62963832818c1a",
"score": "0.6847189",
"text": "def wait_for_clickable_element(locator)\n $wait2 = Selenium::WebDriver::Wait.new(:timeout => 10)\n\n $elementx = $wait2.until { $driver.find_element(locator) }\n $wait2.until { $elementx.displayed? }\n $wait2.until { $elementx.enabled? }\n\n return $elementx\nend",
"title": ""
},
{
"docid": "2db9a8a16c4eb66832baa6d573099663",
"score": "0.68371725",
"text": "def click_wait_until_displayed(element, timeout, element_waiting_for, arg = nil, second_arg = nil)\n Log.message(\"Clicking and wait until element #{element_waiting_for.element_id} present >>\")\n\n click(element, arg)\n wait_until_element_displayed(element_waiting_for, timeout, second_arg)\n end",
"title": ""
},
{
"docid": "e96b2c6a9f537dd581a9bd75f8a073b7",
"score": "0.6832796",
"text": "def wait_until_loaded\n wait_for_ajax Watir.default_timeout,\"\\n#{self.class.name}: wait until loaded.\"\n # wait_for.each {|lmnt| self.send(lmnt).wait_until_present } unless wait_for.nil?\n Watir::Wait.until {wait_for.each {|lmnt| self.send(lmnt).present?}} unless wait_for.nil?\n true\n end",
"title": ""
},
{
"docid": "9067276edf0b56df9d21e0d3224a5f41",
"score": "0.6815504",
"text": "def wait_for_element(element, custom=nil)\r\n wait = Selenium::WebDriver::Wait.new(timeout: 10)\r\n if custom\r\n wait.until { find_element(element, custom) }\r\n else\r\n wait.until { find_element(element) }\r\n end\r\n end",
"title": ""
},
{
"docid": "23c901dff70c2d7183b9f09f4fb5883b",
"score": "0.6790222",
"text": "def element\n wait { DriverManager.driver.find_element(@by, @locator) }\n end",
"title": ""
},
{
"docid": "46eb22a94c0613d67d2a50cabe690305",
"score": "0.6788473",
"text": "def wait_for_disable_element(obj)\n # exists? – Returns whether this element actually exists.\n # present? – Returns true if the element exists and is visible on the page , equivalent to visible and exists\n # visible? – If any parent element isn’t visible then we cannot write to the element. The only reliable way to determine this is to\n # obj.exists?\n obj.present?\n obj.wait_until_present\n\nend",
"title": ""
},
{
"docid": "063669ea2f6d4f816b8a996f6ee1091e",
"score": "0.67864054",
"text": "def waitForElement(type,element)\n wait_for(:timeout => @DEFAULT_WAIT_TIME) { element_exists(\"webView #{type}:'#{element}'\") }\n end",
"title": ""
},
{
"docid": "e641b1950d8c85ec8f4297b2badffe0c",
"score": "0.6777625",
"text": "def wait_for_disable_element(obj)\r\n # exists? – Returns whether this element actually exists.\r\n # present? – Returns true if the element exists and is visible on the page , equivalent to visible and exists\r\n # visible? – If any parent element isn’t visible then we cannot write to the element. The only reliable way to determine this is to\r\n # obj.exists?\r\n obj.present?\r\n obj.wait_until_present\r\n\r\nend",
"title": ""
},
{
"docid": "c5f86d48070b585d4624445169daa748",
"score": "0.6773887",
"text": "def check_element_present(selector, element_path)\r\n\r\n # Change the element locator wait to 5 seconds\r\n @browser.driver.manage.timeouts.implicit_wait = 5\r\n\r\n # Return the total count of elements\r\n element_found = @browser.elements(selector.to_sym, element_path).count\r\n\r\n if element_found > 0\r\n element_found = true\r\n else\r\n element_found = false\r\n end\r\n\r\n # Set back the default element locator timeout defined in hooks.rb file\r\n @browser.driver.manage.timeouts.implicit_wait = @@IMPLICIT_WAIT\r\n\r\n element_found\r\nend",
"title": ""
},
{
"docid": "9dbf57f25cb4bba19599f31e370b61a2",
"score": "0.67578065",
"text": "def wait_until_element_displayed(element, timeout, arg = nil)\n Log.message('Waiting until element displayed >>')\n\n if timeout.instance_of?(Integer) && element.instance_of?(ElementLocator)\n Selenium::WebDriver::Wait.new(timeout: timeout).until { displayed?(element, arg, false) }\n elsif !timeout.instance_of?(Integer) && element.instance_of?(ElementLocator)\n Selenium::WebDriver::Wait.new(timeout: 10).until { displayed?(element, arg, false) }\n Log.warning('Param <timeout> is not [Integer] ---Ignored and default used')\n else\n Log.error('Param <element> is not [ElementLocator] ---Ignored')\n end\n end",
"title": ""
},
{
"docid": "ad1dd110143700d5799cfe60e9e7325f",
"score": "0.6748444",
"text": "def wait_until_visible(seconds_to_wait: nil)\n wait_for(seconds_to_wait: seconds_to_wait) do\n exists? && el.visible?\n end\n end",
"title": ""
},
{
"docid": "d49853f94694874d1014ed0e67b12ef2",
"score": "0.6745467",
"text": "def verify_element(element_name)\n timeout = ConfigData.instance.settings[:timeout]\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until { @driver.find_element(:id => element_name) }\n end",
"title": ""
},
{
"docid": "75964f3d2dd69b2ebe35b43d929cfade",
"score": "0.67446584",
"text": "def when_present(timeout=5)\n @element.wait_until_present(timeout)\n self\n end",
"title": ""
},
{
"docid": "3abfa3a69a805d23c053f3741745516e",
"score": "0.6742273",
"text": "def wait_for_element xpath\n start_time_for_wait = Time.now\n\n loop do\n elements = dom_for_gui.search(xpath)\n\n return elements unless elements.empty?\n\n # Important: get the elapsed time AFTER getting the gui and\n # evaluating the xpath.\n elapsed_time_in_seconds = Time.now - start_time_for_wait\n\n return nil if elapsed_time_in_seconds >= @timeout\n end\n end",
"title": ""
},
{
"docid": "0efcbb95951fe6c1f78e44ff98311460",
"score": "0.6729403",
"text": "def wait_until_displayed(locator)\n wait_for { driver.find_element(locator).displayed? } ||\n (raise ElementNotInteractableError, element_not_displayed_err(locator))\n end",
"title": ""
},
{
"docid": "c6aa3744ede4867a2d909db42d8e8ff9",
"score": "0.6728853",
"text": "def wait_for_page_load_successfully\n wait = Selenium::WebDriver::Wait.new(timeout: TimeOut::READ_TIMEOUT)\n wait.until { evaluate_script('document.readyState') == 'complete' }\n end",
"title": ""
},
{
"docid": "3fa6d895b1b37a56c228967ae4ccc9f6",
"score": "0.67259",
"text": "def verify_element(timeout = 20)\n @log.debug('Verifying the ' + @name + ' element')\n\n # Verify the Element is on the page as expected\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until { @element.displayed? }\n rescue Exception => e\n @log.error('Failed while trying to verify element: ' + e.message )\n # Raise error to cucumber so scenario skipped\n raise 'Failed while trying to verify element: ' + e.message\n end\n end",
"title": ""
},
{
"docid": "3fa6d895b1b37a56c228967ae4ccc9f6",
"score": "0.67259",
"text": "def verify_element(timeout = 20)\n @log.debug('Verifying the ' + @name + ' element')\n\n # Verify the Element is on the page as expected\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until { @element.displayed? }\n rescue Exception => e\n @log.error('Failed while trying to verify element: ' + e.message )\n # Raise error to cucumber so scenario skipped\n raise 'Failed while trying to verify element: ' + e.message\n end\n end",
"title": ""
},
{
"docid": "7950c3e2a4978084023ee53e143887ec",
"score": "0.67144555",
"text": "def elem_add\n if @wait.until {elem_btn.displayed?}\n p \"Element button will appear: Element added\"\n else\n p \"Element button will appear: Element not added\"\n end\n end",
"title": ""
},
{
"docid": "d2721f69f213dfefb47e8b8bd6eafe86",
"score": "0.67139703",
"text": "def wait_page_load\n browser.wait_for_load\n end",
"title": ""
},
{
"docid": "4c480ebba75cd3bb5943592c16065ade",
"score": "0.670835",
"text": "def wait_to_appear(sym,id)\n @wait.until {\n stale_ref_wrapper(sym, id) do |element|\n true\n end\n }\n end",
"title": ""
},
{
"docid": "0c1b5c61e5f642a6f2960793ebafe9e6",
"score": "0.6691008",
"text": "def wait_until_gone(seconds = nil)\n wait(seconds){!exists?}\n rescue\n raise DATPages::Errors::ElementVisible.new\n end",
"title": ""
},
{
"docid": "75eb1ed74b32add153284e1e74f7a46e",
"score": "0.6685844",
"text": "def check_element_present(selector, element_path)\n\n # Change the element locator wait to 5 seconds\n @browser.driver.manage.timeouts.implicit_wait = 5\n\n # Return the total count of elements\n element_found = @browser.elements(selector.to_sym, element_path).count\n\n if element_found > 0\n element_found = true\n else\n element_found = false\n end\n\n # Set back the default element locator timeout defined in hooks.rb file\n @browser.driver.manage.timeouts.implicit_wait = @@IMPLICIT_WAIT\n\n element_found\nend",
"title": ""
},
{
"docid": "4f2845b63d61fd72d391482112c42eda",
"score": "0.6662348",
"text": "def wait_until_present(locator)\n wait_until do\n locator.present?\n end\n end",
"title": ""
},
{
"docid": "bf0591f4c6f14cccccad0d4c4a4ee3e5",
"score": "0.6660834",
"text": "def wait_for_js_home\n Watir::Wait.until { @browser.div(:id => \"tier4\").exists? }\nend",
"title": ""
},
{
"docid": "25067ff9d718073694de5af2e8848911",
"score": "0.6654029",
"text": "def wait_for_object location_param\n \tWatir::Wait.until {\n \t@browser.element(xpath: location_param).visible?\n \t}\n \tend",
"title": ""
},
{
"docid": "9d3aeb68f43325ec4796324802ac8e16",
"score": "0.6633359",
"text": "def wait_for_element(*args)\r\n begin\r\n how = args[0]\r\n what =args[1]\r\n msg=\"\"\r\n timeout = 60\r\n if (how.is_a? String)\r\n nLookup = get_element_from_navigation2(how,what)\r\n how = nLookup[0]\r\n what = nLookup[1]\r\n end\r\n if args.size >= 3\r\n msg= args[2] + \" ---->\"\r\n end\r\n if args.size >= 4\r\n timeout= args[3]\r\n end\r\n if @@debug==1\r\n @util.logging(\"-->Waiting for #{msg} #{what} of type #{how}\")\r\n end\r\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\r\n\r\n cb = wait.until {\r\n element = @driver.find_element(how , what)\r\n element if element.enabled?\r\n }\r\n if (cb.enabled? != true)\r\n false\r\n end\r\n\r\n #@driver.find_element(how, what).click\r\n true\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n @util.logging \"1 Failed find element for #{how} and #{what} to click\"\r\n sleep(1)\r\n false\r\n rescue Selenium::WebDriver::Error::StaleElementReferenceError\r\n @util.logging \"Selenium::WebDriver::Error::StaleElementReferenceError: stale element reference: element is not attached to the page document\"\r\n sleep(5)\r\n true\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n @util.logging \"2 Failed find element for #{how} and #{what}\"\r\n sleep(1)\r\n false\r\n else\r\n\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "4f79811f4847fe6c1ed8584d9d6e5a6a",
"score": "0.66328055",
"text": "def wait_for_loading\n wait_until { page.find('html')[:class].include?('ui-loading') }\nrescue Capybara::TimeoutError\n flunk \"Failed at waiting for loading to appear.\"\nend",
"title": ""
},
{
"docid": "da2979e6b524c6cde85947c23863dd63",
"score": "0.6631604",
"text": "def element_visible?\n default_wait = driver.default_wait if driver\n driver.no_wait if driver\n\n if exists?\n driver.set_wait(default_wait) if driver\n true\n else\n false\n end\n rescue RuntimeError\n false\n end",
"title": ""
},
{
"docid": "2595108e0881b723ca8460818d46c0df",
"score": "0.6630202",
"text": "def when_present(timeout=::PageObject.default_element_wait)\n element.wait_until(timeout: timeout, message: \"Element not present in #{timeout} seconds\", &:present?)\n self\n end",
"title": ""
},
{
"docid": "2595108e0881b723ca8460818d46c0df",
"score": "0.6630202",
"text": "def when_present(timeout=::PageObject.default_element_wait)\n element.wait_until(timeout: timeout, message: \"Element not present in #{timeout} seconds\", &:present?)\n self\n end",
"title": ""
},
{
"docid": "be79ff56a96f5345449e168c0053ef82",
"score": "0.66232604",
"text": "def wait_for_js_decks\n Watir::Wait.until { @browser.div(:class => \"comment-add m-b-sm\").exists? }\nend",
"title": ""
},
{
"docid": "36448f09e24def7e12fd1afc92350afb",
"score": "0.6621502",
"text": "def wait_till_exist(how,what,time)\r\n begin\r\n wait = Selenium::WebDriver::Wait.new(:timeout => time)\r\n cb = wait.until {\r\n element = @driver.find_element(how , what)\r\n element if element.displayed?\r\n }\r\n true\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n @util.logging \"1 Failed find element for #{how} and #{what} \"\r\n false\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n @util.logging \"2 Failed find element for #{how} and #{what}\"\r\n false\r\n end\r\n end",
"title": ""
},
{
"docid": "7f0ac3bd29fc91c80659b33954a3390f",
"score": "0.6612387",
"text": "def wait_until_visible\n wait_for_ajax\n end",
"title": ""
},
{
"docid": "45b662205382a6677780bdf51e57c98a",
"score": "0.661014",
"text": "def wait_element(opt = {},time = @timeout)\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => time)\n wait.until {\n search_element(opt).length.equal?(36)\n }\n @logger.info_log('wda_client::driver wait_element',\"waiting for element with #{opt.values } succeed\\n\")\n return true\n rescue\n @logger.error_log('wda_client::driver wait_element',\"waiting for element with #{opt.values } failed\\n\")\n return false\n end\n end",
"title": ""
},
{
"docid": "b11cfa0e331f4fa80386fa0eb07e0ff7",
"score": "0.66097546",
"text": "def IsElementVisible(element)\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n element = @chromedriver.find_element(:class, element)\n wait.until { element.displayed? }\n\n end",
"title": ""
},
{
"docid": "4801d71dfa2d4a51bdd3f5856e2902b8",
"score": "0.66096187",
"text": "def dom_changed?(delay: 1.1)\n element_call do\n begin\n script_timeout = driver.manage.timeouts.script_timeout\n driver.manage.timeouts.script_timeout = delay + Watir::DOM::Wait.minimum_script_timeout\n driver.execute_async_script(DOM_WAIT_JS, wd, delay)\n rescue Selenium::WebDriver::Error::JavascriptError => error\n # sometimes we start script execution before new page is loaded and\n # in rare cases ChromeDriver throws this error, we just swallow it and retry\n retry if error.message.include?('document unloaded while waiting for result')\n raise\n ensure\n driver.manage.timeouts.script_timeout = script_timeout\n end\n end\n end",
"title": ""
},
{
"docid": "c266c73481ed488eced182221423f7c3",
"score": "0.65881497",
"text": "def wait_until(timeout=Druid.default_element_wait, message=nil, &block)\n element.wait_until(timeout: timeout, message: message, &block)\n end",
"title": ""
},
{
"docid": "1febaa4c0074451b6ad99fef11507c94",
"score": "0.6585294",
"text": "def when_visible(timeout = ::PageObject.default_element_wait)\n wait = Object::Selenium::WebDriver::Wait.new(timeout: timeout, message: \"Element not visible in #{timeout} seconds\")\n wait.until do\n root.visible?\n end\n self\n end",
"title": ""
},
{
"docid": "813220c7f3d955903dc577c1990d7c08",
"score": "0.6581568",
"text": "def wait_for_elements\n @wait_on << :loan_button\n @wait_on << :item_field\n end",
"title": ""
},
{
"docid": "dec5e7e267ffbc5507cc588e3009b352",
"score": "0.65774405",
"text": "def when_displayed(locator, timeout)\n when_exists(locator, timeout)\n wait_until(timeout) { element(locator).displayed? }\n end",
"title": ""
},
{
"docid": "c86f1b80267151b0eb32a77a5ac0397a",
"score": "0.65703666",
"text": "def expected_element element_name, timeout=30\n define_method 'expected_element' do\n self.send(element_name).wait_until_present timeout: timeout\n end\n end",
"title": ""
},
{
"docid": "04c7ba38989c2148c83ea7acf6163e9e",
"score": "0.65635896",
"text": "def wait(target:, timeout: 30)\n wait = Selenium::WebDriver::Wait.new(timeout: timeout)\n wait.until { @driver.find_element(:id, target).displayed? }\n end",
"title": ""
},
{
"docid": "e486efa7b29ae0e332dde6148d202f1a",
"score": "0.6553055",
"text": "def element_should_be_present(key)\n wait_for_elements_exist(get_element_locator(key))\n end",
"title": ""
},
{
"docid": "2c7bed0b077cdf7bea9fdb92d106d00b",
"score": "0.65468365",
"text": "def wait_until_elements_text_is_displayed(element, text)\n wait_until_element_is_displayed(element)\n stored_text = get_element_text(element)\n expect(stored_text).to include(text.to_s)\nrescue Selenium::WebDriver::Error::TimeoutError\n raise_with_new_message \"Element text is not displayed\"\nend",
"title": ""
},
{
"docid": "ffaec1e5d3f11a126f1509f033575e22",
"score": "0.65348154",
"text": "def find hash\n assert_nothing_raised do\n wait = Selenium::WebDriver::Wait.new :timeout => 30\n wait.until { @driver.find_element hash }\n end\n @driver.find_element hash\n end",
"title": ""
},
{
"docid": "8c9b19ee53e50613b62218eb34052239",
"score": "0.6527275",
"text": "def wait_for_elements\n @wait_on << :title\n super\n end",
"title": ""
},
{
"docid": "65dee6772c51514e24e8d121c5a90209",
"score": "0.6508308",
"text": "def wait_while_present(locator)\n wait_until do\n !locator.present?\n end\n end",
"title": ""
},
{
"docid": "ce22490180d1014a657f165132ff3a01",
"score": "0.6508055",
"text": "def when_not_present(timeout = ::PageObject.default_element_wait)\n wait = Object::Selenium::WebDriver::Wait.new(timeout: timeout, message: \"Element still present in #{timeout} seconds\")\n wait.until do\n not_present = false\n begin\n not_present = false if root && root.displayed?\n rescue Selenium::WebDriver::Error::ObsoleteElementError\n not_present = true\n end\n not_present\n end\n end",
"title": ""
},
{
"docid": "71f1147af54452e6da802fdd2eb58cf8",
"score": "0.650509",
"text": "def check_visible(timeout=::PageObject.default_element_wait)\n timed_loop(timeout) do |element|\n element.visible?\n end\n end",
"title": ""
},
{
"docid": "71f1147af54452e6da802fdd2eb58cf8",
"score": "0.650509",
"text": "def check_visible(timeout=::PageObject.default_element_wait)\n timed_loop(timeout) do |element|\n element.visible?\n end\n end",
"title": ""
},
{
"docid": "dfe14895660ed3b29566e55c92e1300f",
"score": "0.6502304",
"text": "def wait_to_disappear(sym,id)\n @wait.until {\n element_arr = driver.find_elements(sym,id)\n element_arr.size > 0 and !element_arr[0].displayed? #wait until the element both exists and is displayed\n }\n end",
"title": ""
},
{
"docid": "cb165d46fa5137753c7ea8798b771ece",
"score": "0.650103",
"text": "def expected_element_visible(element_name, timeout=Capybara.default_wait_time)\n define_method(\"has_expected_element_visible?\") do\n expect(self.send(\"#{element_name}_element\")).to be_visible\n end\n end",
"title": ""
}
] |
855b673805357e1da26da40aa91c3b33 | DELETE /channels/1 DELETE /channels/1.json | [
{
"docid": "efe9910516c5904d639a14c84f0d65cc",
"score": "0.69463253",
"text": "def destroy\n @activity = Activity.create(user_id: current_user.id, activity_type: 'Destroy', target_type: 'Channel', target_id: @channel.id)\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url, notice: 'Channel was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
}
] | [
{
"docid": "e09061cfc4fb587636e0e97c35263002",
"score": "0.79550797",
"text": "def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to channels_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0bde1590b7974fa1bece47a867f82177",
"score": "0.79218477",
"text": "def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5ff6df6a6af8c24e1d5e7ed75b5a97d",
"score": "0.7806328",
"text": "def destroy\n @raw_channel = RawChannel.find(params[:id])\n @raw_channel.destroy\n\n respond_to do |format|\n format.html { redirect_to raw_channels_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "faafcbf39a850ca3f6ccce10e5477e83",
"score": "0.7694676",
"text": "def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url, notice: 'Channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "faafcbf39a850ca3f6ccce10e5477e83",
"score": "0.7694676",
"text": "def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channels_url, notice: 'Channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e30a5462253fda786a474a23ccd01f54",
"score": "0.768162",
"text": "def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to(channels_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4e58f59276afc4a55ff8ba667a652c7",
"score": "0.7660245",
"text": "def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_channels_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "43d2df7ef8434448a306e2851c5b0eaa",
"score": "0.76495284",
"text": "def destroy\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to(channels_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b3cd74cd5585e40545c6cdccacb6bd8d",
"score": "0.76293296",
"text": "def destroy\n @universal_channel.destroy\n respond_to do |format|\n format.html { redirect_to universal_channels_url, notice: 'Universal channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "11673abab18393fc061e69a0b97d5e67",
"score": "0.7549158",
"text": "def destroy\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to user_path(current_user.id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c5fbf46922d33c35313d300f194a6447",
"score": "0.7542542",
"text": "def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_with @channel\n end",
"title": ""
},
{
"docid": "9937afbedceec5a5e16eb2df3e6a520f",
"score": "0.7521566",
"text": "def destroy\r\n @channel.destroy\r\n respond_to do |format|\r\n format.html { redirect_to user_channels_path(current_user)}\r\n end\r\n end",
"title": ""
},
{
"docid": "32649402885b24b9fbf65b6baa4dd757",
"score": "0.7494468",
"text": "def destroy\n \n @channel = @channel || ChannelClass.find(params[:id])\n @channel.destroy\n respond_to do |format|\n format.html { redirect_to channel_classes_url, notice: '频道删除成功.' }\n format.json { head :no_content }\n end\n \n end",
"title": ""
},
{
"docid": "15d016b17ebe4b7c20f674fb067b9b11",
"score": "0.7416698",
"text": "def destroy\n @channel_status = ChannelStatus.find(params[:id])\n @channel_status.destroy\n\n respond_to do |format|\n format.html { redirect_to channel_statuses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f14d8113d288397219b3c8e601c1bea6",
"score": "0.73506314",
"text": "def destroy\n @channel = Channel.find(params[:channel_id])\n rescue ActiveRecord::RecordNotFound => e\n respond_to do |format|\n format.html { redirect_to :back, notice: I18n.t('general.failed_to_unsubscribe') }\n format.json { render json: e, status: :unprocessable_entity }\n end\n else\n current_user.channels.delete(@channel) if current_user.channels.include? @channel\n respond_to do |format|\n format.html { redirect_to @channel, notice: I18n.t('general.unsubscribed') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5e8e6399c0d25e7a39aff1b0aa56f872",
"score": "0.7220122",
"text": "def destroy\n @slack_channel.destroy\n respond_to do |format|\n format.html { redirect_to slack_channels_url, notice: 'Slack channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "30e85a0090a293752692fee3c3f16fad",
"score": "0.71960694",
"text": "def destroy\n @tv_channel.destroy\n respond_to do |format|\n format.html { redirect_to tv_channels_url, notice: 'Tv channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a773d1ee9592b87cdfcfc8b2cdf4f0c2",
"score": "0.71878487",
"text": "def destroy\n @channel_type.destroy\n respond_to do |format|\n format.html { redirect_to channel_types_url, notice: 'Channel type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4dd1a62343f49aaaf7f752ae11b28671",
"score": "0.7124905",
"text": "def destroy\n @channel_info = ChannelInfo.find(params[:id])\n @channel_info.destroy\n\n respond_to do |format|\n format.html { redirect_to marketing_channel_infos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4cdeb6186c2d3598c54d102717dd001",
"score": "0.7006395",
"text": "def destroy\n @chatty_crow_channel.destroy\n flash[:notice] = l(:notice_successful_delete)\n redirect_to_plugin_settings\n end",
"title": ""
},
{
"docid": "e1cd460260663f9feee03e6dfcff4faa",
"score": "0.69929445",
"text": "def delete(channels)\n\treturn if not channels.is_a? Array #meh\n\tcurChannels = readCurrentChannels()\n\tcurChannels.reject! { |e| channels.include? e.downcase }\n\twriteChannels(curChannels)\nend",
"title": ""
},
{
"docid": "e6a5271ce2ddc1f3a9a9fa358804d178",
"score": "0.69851613",
"text": "def destroy\n @channel_category = ChannelCategory.find(params[:id])\n @channel_category.destroy\n\n respond_to do |format|\n format.html { redirect_to marketing_channel_categories_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "17730a18a1de2ff84e8dd631cd13b035",
"score": "0.69043654",
"text": "def destroy\n @channel_statistic.destroy\n respond_to do |format|\n format.html { redirect_to channel_statistics_url, notice: 'Channel statistic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "633fec1a967d96358569f9a914df062b",
"score": "0.6892405",
"text": "def destroy\n @sales_channel_api = SalesChannelApi.find(params[:id])\n @sales_channel_api.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_channel_apis_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "753015ceb433b76ab4104754aa7f4e55",
"score": "0.68605506",
"text": "def remove_channel\n channel = Channel.find(params[:channel_id])\n @bss_title_id = BssTitleId.find(params[:id])\n \t@bss_title_id.channels.delete(channel)\n \trespond_to do |format|\n format.html {\n if params[:source] == 'episode_show'\n redirect_to episode_path(@bss_title_id.episode, show_details(:channel, params)), notice: 'Channel: ' + channel.name + ' removed'\n else\n redirect_to bss_title_id_path(@bss_title_id, show_details(:channel, params)), notice: 'Channel: ' + channel.name + ' removed'\n end\n }\n\t \tformat.json {render :show, status: :removed, location: @bss_title_id}\n \tend\n end",
"title": ""
},
{
"docid": "3145161bf99bc3f08c581324b4a7cf34",
"score": "0.6837685",
"text": "def destroy\r\n push_notification :remove\r\n @message.destroy\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel) }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "8dc95047834685401772fcb852c89af8",
"score": "0.68375105",
"text": "def destroy\n @sales_channel = SalesChannel.find(params[:id])\n @sales_channel.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_channels_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9863e9f714f9ecb6ccb699250d00aba6",
"score": "0.6828952",
"text": "def destroy\n @youtubechannel.destroy\n respond_to do |format|\n format.html { redirect_to youtubechannels_url, notice: 'Youtubechannel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3eeac45cfb7f3ceffa8e0deff7ed6dbb",
"score": "0.68288726",
"text": "def destroy\n @youtube_channel.destroy\n respond_to do |format|\n format.html { redirect_to youtube_channels_url, notice: 'Youtube channel was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72f8f2c6a0b3554566512d135c6706dd",
"score": "0.6825764",
"text": "def destroy\n @channel_group.destroy\n respond_to do |format|\n format.html { redirect_to channel_groups_url, notice: 'Channel group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0dd28c0329791c1843968cfec5b5cba2",
"score": "0.6819565",
"text": "def delete\n @channel_control.delete\n end",
"title": ""
},
{
"docid": "b085321056f6bc9467673added910eb4",
"score": "0.6787385",
"text": "def destroy\n @category_of_playlists_channel.destroy\n respond_to do |format|\n format.html { redirect_to category_of_playlists_channels_url, notice: 'Category of playlists channel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "60dd371b18c9d0a40916909bc3b99dbf",
"score": "0.6755336",
"text": "def destroy\n #only user can modify \n unless current_user.has_role?(:admin) || current_user.has_role?(:user)\n redirect_to admin_channels_path, alert: \"没有权限\"\n return\n end\n @admin_channel.destroy\n respond_to do |format|\n format.html { redirect_to admin_channels_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7bea5b953e640bae8066f6a758064026",
"score": "0.67452437",
"text": "def destroy\n @channel_user.destroy\n respond_to do |format|\n format.html { redirect_to channel_users_url, notice: 'Channel user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e36c208961e3e89fa0e2915f22e068fb",
"score": "0.67089707",
"text": "def destroy\n @hub.destroy\n\n respond_to do |format|\n format.html { redirect_to hubs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "788def47d83000c135c95e6a602da47d",
"score": "0.6683316",
"text": "def destroy\n @user_to_channel_subscription.destroy\n respond_to do |format|\n format.html { redirect_to user_to_channel_subscriptions_url, notice: 'User to channel subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "777d51b06e17590c99bdcac01a3984b0",
"score": "0.66770047",
"text": "def destroy\n @chat.destroy\n respond_to do |format|\n format.html { redirect_to chats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "06a230b27ca589a5cd26f00e31b08f27",
"score": "0.6674803",
"text": "def destroy_all\r\n Message.destroy_all(channel: @channel)\r\n respond_to do |format|\r\n format.html { redirect_to channel_messages_url(@channel), notice: 'Chat erfolgreich geleert.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "a9cdf07abd2f7a88bb3bcc4c652167b8",
"score": "0.6665955",
"text": "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f7b8871a4dd0a74a1a1c441c4850b0e4",
"score": "0.666395",
"text": "def destroy\n @v1_message = V1::Message.find(params[:id])\n @v1_message.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "e94d3c5670161dbbbc25f00290a53a18",
"score": "0.6654803",
"text": "def destroy\n @fav_channel = WatchChannel.find(params[:id])\n @fav_channel.delete\n flash.now[:notice] = \"#{@fav_channel.channel.channel_or_cug} #{@fav_channel.channel.name} has been removed from your favorite list\"\n end",
"title": ""
},
{
"docid": "405976e5c46ab2538973ab3e1cf6ccf9",
"score": "0.66393507",
"text": "def delete_channel(data)\n channel = Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n @channels.delete(channel.id)\n server.delete_channel(channel.id)\n elsif channel.pm?\n @pm_channels.delete(channel.recipient.id)\n elsif channel.group?\n @channels.delete(channel.id)\n end\n end",
"title": ""
},
{
"docid": "90b173bd40b0a2a114fa2f2c82165e31",
"score": "0.66104794",
"text": "def destroy\n @chat = Chat.find(params[:id])\n @chat.destroy\n\n respond_to do |format|\n format.html { redirect_to chats_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8c664bde65e9d4ed5abb78fce63c9241",
"score": "0.6607563",
"text": "def delete_channel(data)\n channel = Channel.new(data, self)\n server = channel.server\n\n # Handle normal and private channels separately\n if server\n @channels.delete(channel.id)\n server.channels.reject! { |c| c.id == channel.id }\n else\n @private_channels.delete(channel.id)\n end\n end",
"title": ""
},
{
"docid": "e7dc5c7f8b8738ae068914d51f61ec60",
"score": "0.6570064",
"text": "def destroy\n @chat.destroy\n# respond_to do |format|\n# format.html { redirect_to chats_url }\n# format.json { head :no_content }\n# end\n end",
"title": ""
},
{
"docid": "da934412ec9e985539cf8f21a3284352",
"score": "0.65655994",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to channel_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c8cc4273c44c18c297ed8457a96afe9c",
"score": "0.65510666",
"text": "def destroy\n id = @api_v1_canvas.id\n @api_v1_canvas.destroy\n respond_to do |format|\n format.html do\n redirect_to api_v1_canvases_url, notice: 'Canvas was successfully destroyed.'\n end\n\n format.json do\n msg = { id: id }\n broadcast(\"deleted\", msg)\n head :no_content\n end\n end\n end",
"title": ""
},
{
"docid": "1710890de61b23d3888f01cdf0bf2706",
"score": "0.65419203",
"text": "def delete_facebook_channel(project_id, query_id)\n delete \"/projects/#{project_id}/facebookchannels/#{query_id}\"\n end",
"title": ""
},
{
"docid": "30fc9e44c2b99529d801849a7cf8d875",
"score": "0.65381527",
"text": "def delete options={}, headers={}\n @connection.delete \"subscriptions.json\", options, headers\n end",
"title": ""
},
{
"docid": "320a56ecf7fc22c79f902fbca4087d2e",
"score": "0.65297365",
"text": "def destroy\n\t\tchannel_sid = params[:channel_sid]\n\t\tmessage_sid = params[:id]\n\t\tputs message_sid\n\t\t@client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\t\t# Remove the member\n\t\tservice = @client.chat.v2.services(ENV['service_sid'])\n\t\tchannel = service.channels(channel_sid)\n\t\tresponse = channel.messages(message_sid).delete\n\t\tputs response\n\t\tmessages_response= \"{\\n\\\"message\\\": \\\"Message was deleted\\\"\\n}\"\n\t\tjson_response(messages_response)\n\tend",
"title": ""
},
{
"docid": "2403d1b581320527006eeb179d06f5cc",
"score": "0.65279794",
"text": "def destroy\n @channel_rate.destroy\n respond_to do |format|\n format.html { redirect_to channel_rates_url, notice: 'Channel rate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "55aaef1d729eb32c003911477bf8c381",
"score": "0.6496717",
"text": "def destroy\n @channel_customer.destroy\n respond_to do |format|\n format.html { redirect_to channel_customers_url, notice: 'Channel customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d77d844c7e1cc65c7968ade5d1b00a9",
"score": "0.64908653",
"text": "def destroy\n @direct_chat.destroy\n respond_to do |format|\n format.html { redirect_to direct_chats_url, notice: 'Direct chat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b3e1f0ff7b903e8f185863e6a6c4b033",
"score": "0.64835757",
"text": "def delete(id)\n\t\t\tkparams = {}\n\t\t\t# Live channel id to delete\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('livechannel', 'delete', 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": "76cbb6529edee817891ad5235d9b1396",
"score": "0.6451987",
"text": "def destroy\r\n @chat.destroy\r\n respond_to do |format|\r\n format.html { redirect_to :back }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "681e6d2b5b265ea29c10dc70e24e924e",
"score": "0.64021987",
"text": "def destroy\n @chat.destroy\n respond_to do |format|\n format.html { redirect_to chats_url, notice: \"Chat was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "661e97aad8ebfcfc40a121aa8ad2be46",
"score": "0.639561",
"text": "def destroy\n @chat.destroy\n respond_to do |format|\n format.html { redirect_to chats_url, notice: 'Chat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "661e97aad8ebfcfc40a121aa8ad2be46",
"score": "0.639561",
"text": "def destroy\n @chat.destroy\n respond_to do |format|\n format.html { redirect_to chats_url, notice: 'Chat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "661e97aad8ebfcfc40a121aa8ad2be46",
"score": "0.639561",
"text": "def destroy\n @chat.destroy\n respond_to do |format|\n format.html { redirect_to chats_url, notice: 'Chat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7636ce520bfc924219a0281276ac6103",
"score": "0.63917327",
"text": "def destroy\n # @group = @hub.groups.get(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to hub_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c7f521ea674db0292b3b690e545f8ddd",
"score": "0.6377609",
"text": "def destroy\n @chat = Chat.find(params[:id])\n @chat.destroy\n\n respond_to do |format|\n format.html { redirect_to(chats_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "264ff3bd37ba2b9cd39a66dba80f2766",
"score": "0.63687485",
"text": "def destroy\n @chirp.destroy\n respond_to do |format|\n format.html { redirect_to chirps_url, notice: 'Chirp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f8423b096774d998e64ba2c1b6531e31",
"score": "0.63599956",
"text": "def destroy\n @chirp.destroy\n respond_to do |format|\n format.html { redirect_to chirps_url, notice: \"Chirp was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d5382fbfe363b89f2f2045d4cee1dc4d",
"score": "0.6352695",
"text": "def destroy\n @bot = Bot.find(params[:id])\n @bot.destroy\n\n respond_to do |format|\n format.html { redirect_to bots_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e56d8705cd37be7697191f160dda1508",
"score": "0.6345783",
"text": "def destroy\n @connection.destroy\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.6345377",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "8b79cb83136bedec39a3f70df3bb8b63",
"score": "0.6340986",
"text": "def delete_communication_channel_id(user_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/users/{user_id}/communication_channels/{id}\",\n :user_id => user_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:delete, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:delete, path, query_params, form_params, headers)\n page_params_store(:delete, path)\n CommunicationChannel.new(response)\n end",
"title": ""
},
{
"docid": "518ae41c678b1d29dd73e8622ae90ef6",
"score": "0.63073134",
"text": "def destroy\n @chatline = Chatline.find(params[:id])\n @chatline.destroy\n\n respond_to do |format|\n format.html { redirect_to chatlines_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8777ca2bf541dbd660c79fa7d3c4bd6b",
"score": "0.6302774",
"text": "def destroy\n @cable.destroy\n respond_to do |format|\n format.html { redirect_to cables_url, notice: 'Cable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee6288b02d4d134f29c43e228a1daf39",
"score": "0.62979376",
"text": "def destroy\n @smpl_chat.destroy\n respond_to do |format|\n format.html { redirect_to smpl_chats_url, notice: 'Smpl chat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5714ada4828acd4a3d55ba73a777797a",
"score": "0.6271901",
"text": "def delete(reason = nil)\n API::Channel.delete(@bot.token, @id, reason)\n end",
"title": ""
},
{
"docid": "a69829d1f6fc74ec020305a5ad915001",
"score": "0.62715054",
"text": "def destroy\n @communication_post.destroy\n respond_to do |format|\n format.html { redirect_to root_path(communication: true) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e02d45ee0dd050e6375742a9616dfdf",
"score": "0.62587494",
"text": "def del\n channel = params['channel_id']\n existing = Board.find_by(:channel => channel)\n if existing then\n existing.destroy\n return render json: { :response_type => 'in_channel',\n :text => 'Removed the current game for the channel. It was between *' + existing.player1 + '* and *' + existing.player2 + '*' }\n end\n\n return render json: { :text => 'No ongoing game in the current channel' }\n end",
"title": ""
},
{
"docid": "e9fdbbde0f2feabf04f406af7941882b",
"score": "0.6256186",
"text": "def destroy\n @connection = Connection.find(params[:id])\n @connection.destroy\n\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e9fdbbde0f2feabf04f406af7941882b",
"score": "0.6256186",
"text": "def destroy\n @connection = Connection.find(params[:id])\n @connection.destroy\n\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3768118fe9af96a4c91dad72a6a03568",
"score": "0.62514174",
"text": "def destroy\n @heartbeat = Heartbeat.find(params[:id])\n @heartbeat.destroy\n\n respond_to do |format|\n format.html { redirect_to heartbeats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8b7514d1f9848b8263b8c4240e55868b",
"score": "0.6251038",
"text": "def destroy\n @connection = Connection.find(params[:id])\n @connection.destroy\n\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8872a030432942ab3fdccc7f52b69544",
"score": "0.62447107",
"text": "def destroy\n @convo = Convo.find(params[:id])\n @convo.destroy\n\n respond_to do |format|\n format.html { redirect_to convos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e5ae97286f9eda4cffc85ce72ba8efb",
"score": "0.623016",
"text": "def destroy\n @group_me_bot.destroy\n respond_to do |format|\n format.html { redirect_to group_me_bots_url, notice: 'Group me bot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "09d1012c15b39dea304b0f4c8ce76980",
"score": "0.6226559",
"text": "def destroy\n @crytosubscription.destroy\n respond_to do |format|\n format.html { redirect_to crytosubscriptions_url, notice: 'Crytosubscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0242aa2596a96f42e00760d99ee81e38",
"score": "0.6223933",
"text": "def destroy\n @chatcontent = Chatcontent.find(params[:id])\n @chatcontent.destroy\n\n respond_to do |format|\n format.html { redirect_to chatcontents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d385bd948debe45b202c38bf2922a447",
"score": "0.62227905",
"text": "def destroy\n @convite.destroy\n respond_to do |format|\n format.html { redirect_to convites_url, notice: 'Convite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bd61e3a1671413e0519f3c5e622ed9eb",
"score": "0.6222709",
"text": "def destroy\n @conversation.destroy\n respond_to do |format|\n format.html { redirect_to conversations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bae4328814addee7c28dd030ce46a104",
"score": "0.6222074",
"text": "def destroy\n @post = Post.find(@chat.post_id)\n @chat.destroy\n respond_to do |format|\n format.html { redirect_to @post, notice: 'Chat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33b888c8f2b033bb54789de80c57d692",
"score": "0.62168545",
"text": "def delete\n client.delete(url)\n @deleted = true\nend",
"title": ""
},
{
"docid": "8897392d6bc09eacaa402038a05a759e",
"score": "0.62069386",
"text": "def destroy\n @conversation = Conversation.find(params[:id])\n @conversation.destroy\n\n respond_to do |format|\n format.html { redirect_to conversations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fe6d34f5ad07909f919fd677baaaac4e",
"score": "0.6202241",
"text": "def destroy\r\n @customerchat.destroy\r\n respond_to do |format|\r\n format.html { redirect_to customerchats_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "bfcec321b50dcfc43e9412698b4a3b5d",
"score": "0.6200769",
"text": "def delete_channel_with_http_info(channel_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ChatChannelsApi.delete_channel ...'\n end\n # verify the required parameter 'channel_id' is set\n if @api_client.config.client_side_validation && channel_id.nil?\n fail ArgumentError, \"Missing the required parameter 'channel_id' when calling ChatChannelsApi.delete_channel\"\n end\n # resource path\n local_var_path = '/chat/channels/{channelId}'.sub('{' + 'channelId' + '}', channel_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', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\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 => 'Object')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ChatChannelsApi#delete_channel\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e90a72ba3b7d2cfb840d2985e9cfbb68",
"score": "0.61946833",
"text": "def destroy\n @subscribe.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "10be14cc1b8adf939dadf081e0d87676",
"score": "0.6183781",
"text": "def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "73d3c8a108ba6d048d45485c4b7101f5",
"score": "0.61808866",
"text": "def destroy\n @message = Message.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to conversations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0acbe5a88b0075caae0a8d461a1f79ab",
"score": "0.6175069",
"text": "def destroy\n @chatiw = Chatiw.find(params[:id])\n @chatiw.destroy\n\n respond_to do |format|\n format.html { redirect_to chatiws_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ce1e7cf90aa82857889c1b10e9f7d91a",
"score": "0.6156316",
"text": "def destroy\n @client.delete( name )\n end",
"title": ""
},
{
"docid": "4be041cf1d9a103a89eaa37277572677",
"score": "0.6155924",
"text": "def destroy\n @cord.destroy\n respond_to do |format|\n format.html { redirect_to cords_url, notice: t('cords.destroy.success') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f041eb21f422b5c49b0cbd22f7305394",
"score": "0.6154762",
"text": "def deleteChannel(channelInfo)\r\n\t\tnum = 0\r\n\t\tchannel_id = 0\r\n\t\tchannelInfo.each_pair { | name, value |\r\n\t\t\tif(name == \"channel_id\")\r\n\t\t\t\tchannel_id = value\r\n\t\t\telse\r\n\t\t\t\tputs \"wrong parameter: #{name}\"\r\n\t\t\t\treturn \"wrong parameter: #{name}\"\r\n\t\t\tend\t\t\t\t\r\n\t\t}\r\n\r\n\t\tputs \"Connecting to database...\"\r\n\t\tbegin\r\n\t\t\t# connect to the MySQL server\r\n\t\t\tdbh = DBI.connect(\"DBI:Mysql:#{$db}:#{$db_ip}\",\"#{$user}\", \"#{$pass}\")\r\n\t\t\r\n\t\t\tnum = dbh.do(\"DELETE FROM spectrum WHERE id = '#{channel_id}'\")\r\n\t\t\tif (num == 1)\r\n\t\t\t\tputs \"Channel deleted...\"\r\n\t\t\t\treturn 0\r\n\t\t\tend\r\n\t\t\t\r\n\t\trescue DBI::DatabaseError => e\r\n\t\t\tputs \"An error occurred\"\r\n\t\t\tputs \"Error code: #{e.err}\"\r\n\t\t\tputs \"Error message: #{e.errstr}\"\r\n\t\tensure\r\n\t\t\t# disconnect from server\r\n\t\t\tdbh.disconnect if dbh\r\n\t\tend\r\n\t\t\t\r\n\t\treturn -1\r\n\tend",
"title": ""
},
{
"docid": "3008b093ca9380ad008b1cd6ef403af2",
"score": "0.6152029",
"text": "def destroy\n @cocktail = Cocktail.find(params[:id])\n @cocktail.destroy\n\n respond_to do |format|\n format.html { redirect_to cocktails_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3008b093ca9380ad008b1cd6ef403af2",
"score": "0.6152029",
"text": "def destroy\n @cocktail = Cocktail.find(params[:id])\n @cocktail.destroy\n\n respond_to do |format|\n format.html { redirect_to cocktails_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "137ea8b0058bee03432d63d81b6793b2",
"score": "0.6151377",
"text": "def destroy\n @chronicle.destroy\n respond_to do |format|\n format.html { redirect_to chronicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7708a452c9c1feb362bc8c71fd623a1c",
"score": "0.6145153",
"text": "def destroy\n @ch.destroy\n respond_to do |format|\n format.html { redirect_to ches_url, notice: 'Ch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2d3358da15ff6d4d6e7954d8a938c9e3",
"score": "0.61436594",
"text": "def destroy\n @connection.destroy\n respond_to do |format|\n format.html { redirect_to connections_url, notice: \"Connection was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
d3ea6c8b8d97dda881e66d80fb99ddf2 | confirm new account with email confirmation_token | [
{
"docid": "948aeb06bf43c7e0070f9094beea4720",
"score": "0.70429075",
"text": "def confirm\n @user = User.first(:conditions => { :confirmation_token => params[:id] })\n if @user.nil?\n flash[:notice] = 'This link is not valid..!'\n signin()\n else\n @user.update_attributes(:confirmation_token => nil, :confirmed => 1)\n session[:current_user_id] = @user.id\n\n signin()\n end\n end",
"title": ""
}
] | [
{
"docid": "9fae062e31d44b5082c17b6a609a3040",
"score": "0.8084427",
"text": "def confirm_email\n\t user = User.find_by(confirm_token: params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t} \n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend",
"title": ""
},
{
"docid": "2559c35628df92aa93349ef48b796b81",
"score": "0.8025626",
"text": "def confirm_email\n account = Account.find_by(email_confirmation_token: params[:token])\n\n if account && attempt_confirm(account)\n auto_signin(account)\n flash.notice = t 'success'\n else\n flash.alert = t 'fail'\n end\n\n redirect_to info_path\n end",
"title": ""
},
{
"docid": "475f10e827b530c89bbce9d6085bf67c",
"score": "0.79970765",
"text": "def confirm_email\n \n \n @user = User.find_by_confirm_token(params[:confirm_token])\n \n if @user.present? \n \n @user.email_confirmed = true\n @user.confirm_token = nil\n @user.save!(:validate => false)\n \n puts \"Your email has been confirmed\"\n redirect_to \"https://www.cwaportal.herokuapp.com\"\n \n else\n \n puts \"Sorry. can't find account or its already verified.\"\n redirect_to \"https://www.cwaportal.herokuapp.com\"\n \n end\n end",
"title": ""
},
{
"docid": "c44f174c720679cce7fb2e58b7e0977c",
"score": "0.79828",
"text": "def send_email_confirm\n generate_token(:email_confirm_token)\n save!\n UserMailer.email_confirm(self).deliver\n end",
"title": ""
},
{
"docid": "d6129cfe927258ae0fbf1a59897bccef",
"score": "0.7944232",
"text": "def confirm_email(token)\n user = User.find_by_confirmation_token(token)\n if user.nil?\n fail BadRequestError.resource_not_found(:token), \"User not found by token.\"\n end\n\n user.confirm!\n end",
"title": ""
},
{
"docid": "26a40a9ecc55977e369b67cfbd3efa46",
"score": "0.79392326",
"text": "def confirm_email\n\n puts \"in the registration controllers confirm_email function ==============\"\n\n @user = User.find_by_confirm_token(params[:confirm_token])\n \n if @user.present? \n \n @user.email_confirmed = \"true\"\n @user.confirm_token = nil\n @user.save!(:validate => false)\n \n puts \"Your email has been confirmed\"\n redirect_to \"https://www.floridablaze.io\"\n \n else\n \n puts \"Sorry. can't find account or its already verified.\"\n redirect_to \"https://www.floridablaze.io\"\n \n end\n\n puts \"leaving the registration controllers confirm_email function ==============\"\n\n end",
"title": ""
},
{
"docid": "cab023d8ecc562f210bca233a259e2f4",
"score": "0.7857442",
"text": "def confirm_email\n if (params[:confirm_token] == nil)\n render json: { error: 'Null confirm token'}, status: 401\n else\n user = User.find_by_confirm_token(params[:confirm_token])\n end\n # if the email is valid, the user will receive notifications of the app, if the email isn't valid will show the error to the user\n if user\n user.email_activate\n else\n render json: { error: 'Incorrect credentials' }, status: 401\n end\n end",
"title": ""
},
{
"docid": "ffbb77c8297b1b9d619aa895d33f7f84",
"score": "0.7853267",
"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": "2e1d72adc1778b67361e4daa693347ee",
"score": "0.7796102",
"text": "def confirm\n\t\t@user = Account.find_by_email(params[:email])\n\n\t\tif @user\n\t\t\tif @user.confirmed == true\n\t\t\t\tredirect_to root_url, :notice => \"You've already confirmed your account.\"\n\t\t\telsif Digest::SHA1.hexdigest(@user.salt) == params[:token]\n\t\t\t\t@user.update_attribute(:confirmed, true)\n\t\t\t\tsession[:user_id] = @user.id\n\t\t\t\tredirect_to root_url, :notice => \"You've confirmed your account. Happy Funding!\"\n\t\t\telse\n\t\t\t\tflash[:error] = \"Wrong confirmation token.\"\n\t\t\t\tredirect_to root_url, :action => :index\n\t\t\tend\n\t\telse\n\t\t\tflash[:error] = \"Invalid confirmation URL\"\n\t\t\tredirect_to root_url, :action => :index\n\t\tend\n end",
"title": ""
},
{
"docid": "6d9eac9849c3d8bcec1636dd540db59b",
"score": "0.7766379",
"text": "def email_confirm\n if authenticate\n @user.confirm_email\n success_message(@user.email_confirmed?)\n else\n error_message(@message)\n end\n end",
"title": ""
},
{
"docid": "6ea70d2de54f07ab4e49598f098a386b",
"score": "0.77606523",
"text": "def confirmed_email\n user = User.find_by(confirm_token: params[:mail_token])\n if user\n user.confirm_token = nil\n user.confirm_email = true\n return user.save\n end\n\n render json: { status: 401 }\n end",
"title": ""
},
{
"docid": "1b196ab6a29df210df2e198b16fc1e14",
"score": "0.7715337",
"text": "def confirm_email\n if params[:token].present?\n user = User.find_by(email: Crypt.decrypt(params[:token]))\n user.update(is_email_confirmed: true)\n flash[:success] = t \"account.confirmed\"\n redirect_to account_path\n else\n if !current_user || current_user.is_email_confirmed\n page_403\n else\n render :confirm_email, layout: \"authpage\"\n end\n end\n end",
"title": ""
},
{
"docid": "f535d544fda7fd0405c4c3345c221894",
"score": "0.76864904",
"text": "def create\n @user = User.find_by_url_and_token(params[:user_id], params[:token])\n @user.confirm_email!\n\n sign_user_in(@user)\n flash[:notice] = \"Your account has been confirmed! You may now use PYO.\"\n redirect_to url_after_create\n end",
"title": ""
},
{
"docid": "22e96244af2d4994a0e0e20126b41faa",
"score": "0.7671389",
"text": "def confirm_email\n confirmation_token = params[:confirmation_token]\n @user = User.find_by_id(params[:id])\n if @user.confirmed\n redirect_to root_path, notice: \"You already validated your email\"\n elsif @user.confirmation_token == confirmation_token\n @user.confirmed = true\n @user.save(validate: false)\n redirect_to login_path, flash: {success: \"Your email is confirmed. Please login.\"}\n else\n redirect_to root_path, flash: { error: \"Access denied\"}\n end\n end",
"title": ""
},
{
"docid": "dc7aedb0731378de9d2facbc0875d3af",
"score": "0.76189816",
"text": "def confirm_email\n confirmation_token = params[:confirmation_token]\n @user = User.find_by_id(params[:id])\n if @user.confirmation_token == confirmation_token && !@user.confirmed\n @user.confirmed = true \n @user.save(validate: false)\n elsif @user.confirmed \n redirect_to root_path, flash: { notice: \"You already validated your email\"}\n else\n flash[:error] = \"Access denied\"\n end\n end",
"title": ""
},
{
"docid": "41800d325f837511989b9720d2663418",
"score": "0.7596913",
"text": "def confirm_email\n student = Student.find_by_confirm_token(params[:id])\n if student\n student.email_confirmed = true\n student.confirm_token = nil\n student.save\n flash[:success] = \"Welcome! Your email has been confirmed.\n Please log in to continue.\"\n redirect_to login_path\n else\n flash[:error] = \"Sorry. Student does not exist\"\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "5219e7717cfc188919fd36ad374bcdd9",
"score": "0.75801957",
"text": "def confirm!(token)\n user = active.not_confirmed.where(confirmation_token: token).first\n return nil unless user\n user.confirmed = true\n user.save\n end",
"title": ""
},
{
"docid": "bdfdc83d204cc7076a4b27f8b589c712",
"score": "0.74999017",
"text": "def email_confirmations\n password = Devise.friendly_token[0, 20]\n user = User.new(email: user_params[:email], password: password, password_confirmation: password)\n user.save!\n user.send_confirmation_instructions\n user.authorizations.create(provider: session[:provider], uid: session[:uid])\n session[:provider] = nil\n session[:uid] = nil\n redirect_to root_path, notice: 'Check Your e-mailbox to complete registration'\n end",
"title": ""
},
{
"docid": "95991f92d89d85692618255946118457",
"score": "0.7475658",
"text": "def confirm!(attributes={})\n confirmable = find_or_initialize_by_confirmation_token(attributes[:confirmation_token])\n if confirmable.new_record?\n confirmable.errors.add(:confirmation_token, :invalid)\n else\n confirmable.confirm!\n end\n confirmable\n end",
"title": ""
},
{
"docid": "cf6aa847e3b0abf6e83789bcb1f6e72a",
"score": "0.7451768",
"text": "def confirm_email\n @user = User.load_from_activation_token(params[:activation_token])\n if @user && @user.id == params[:id].to_i\n @user.activate!\n path = logged_in? ? root_path : login_path(email: @user.email)\n redirect_to path, notice: t('users.confirm_email.confirmed')\n else\n not_found\n end\n end",
"title": ""
},
{
"docid": "705b56ea9ccf53223688a4d6048aa4cb",
"score": "0.74327165",
"text": "def confirm\n if super\n self.transactions.create amount: 36, comment: 'Email verification bonus'\n self.verification_events.create what_happened: 'User confirmed email'\n self.update verification_level: 1\n end\n end",
"title": ""
},
{
"docid": "4327040fb3b3075d32cd5877f44789ad",
"score": "0.7428731",
"text": "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n flash[:success] = \"Welcome to the TAMU Course Assignment System! Your email has been confirmed.\\n\n Please sign in to continue.\"\n redirect_to '/login'\n else\n flash[:error] = \"Sorry. User does not exist or already activated.\"\n redirect_to '/login'\n end\nend",
"title": ""
},
{
"docid": "48f9b651ed1bc8301e348f3d17935ebf",
"score": "0.74078196",
"text": "def confirm\n post_redirect = PostRedirect.find_by_email_token(params[:email_token])\n\n if post_redirect.nil?\n render :template => 'user/bad_token.rhtml'\n return\n end\n\n @user = post_redirect.user\n @user.email_confirmed = true\n @user.save!\n\n session[:user_id] = @user.id\n session[:user_circumstance] = post_redirect.circumstance\n\n do_post_redirect post_redirect\n end",
"title": ""
},
{
"docid": "a5102006b2c802166f57809ec654dee2",
"score": "0.73987937",
"text": "def confirm_email \n\t\tapplicant = Applicant.find_by_confirm_token(params[:id])\n\t\tif applicant\t \t\t \n\t\t\tapplicant.email_active\n\t\t\tapplicant.save\t \n\t\t\tlog_in applicant \n\t\t\tflash[:success] = \"Welcome to HIT-CRS! Your email has been confirmed\" \t \n\t\t\tredirect_to '/login' \t \n\t\telse \t \n\t\t\tflash[:error] = \"Sorry. User does not exist.\" \t \n\t\t\tredirect_to '/signup' \t \n\t\tend \t\n\tend",
"title": ""
},
{
"docid": "1434e1ada0bcbed8ef85b87d5a86d8e2",
"score": "0.7378048",
"text": "def confirm_email!(flag = true)\n self.identity(:email).confirm!(flag)\n end",
"title": ""
},
{
"docid": "0f35b9ec8848efc9589c9efd2a081f20",
"score": "0.7334981",
"text": "def reconfirm\n @user = User.find(params[:id])\n\n if @user\n # generate a new token\n @user.generate_token(:token)\n @user.save\n RegistrationMailer.registration_confirmation(@user,\n new_email_confirmation_url(token: @user.token)).deliver\n redirect_to :back, notice: \"A confirmation email has been re-sent! Please click link in email to verify your email address.\"\n else\n redirect_to :back, notice: \"User not found!!\"\n end\n\n end",
"title": ""
},
{
"docid": "9b5f3da5a9b7f4a6fdd0fc32c6e3de0d",
"score": "0.73149",
"text": "def confirm_email\n before_confirm_email\n\n actor = DoorMat::Session.current_session.actor\n token = params[:token]\n encoded_address = params[:email]\n\n actor.with_lock do\n actor.confirm_email_activities.each do |activity|\n if activity.input_valid?(token, encoded_address)\n if actor.has_primary_email?\n activity.email.confirmed!\n else\n activity.email.primary!\n end\n activity.done!\n flash[:notice] = \"Email was confirmed.\"\n\n redirect_to config_url_redirect(:confirm_email_success_url)\n after_confirm_email(activity.email)\n return\n end\n end\n end\n\n after_failed_confirm_email\n lockdown(log_message: 'ERROR: failed request to confirm_email')\n end",
"title": ""
},
{
"docid": "3057a82d0a7cf26c93e00b0d2a597119",
"score": "0.73048776",
"text": "def create\n user = User.find_by(email: confirmation_params[:email])\n\n if user\n user.generate_confirmation_token\n Mailer.delay.email_confirmation(user) if user.save\n end\n redirect_to root_path, notice: t('.promise_resend')\n end",
"title": ""
},
{
"docid": "cc992fcd43840e8a50ea068d529332fe",
"score": "0.73016214",
"text": "def confirm_email(user)\n\t\t@account = user\n\t\t@confirmUrl = \"#{Weeverails::Application.config.domain}/account/confirm?token=#{Digest::SHA1.hexdigest(@account.salt)}&email=#{@account.email}\"\n\t\tmail(:to => user.email, :subject => \"Welcome to Weeve\")\n\tend",
"title": ""
},
{
"docid": "6eec81d84ed9bb3da179e511664d90ae",
"score": "0.7298534",
"text": "def confirm!\n self.confirmed = true\n self.token = false\n self.save\n end",
"title": ""
},
{
"docid": "78b71bc80d53bba7c413d2d08e323c6d",
"score": "0.727387",
"text": "def confirmed_user\n redirect_to \"#{new_user_session_path}?message=Please confirm your email&message_type=failure\" unless resource.confirmed?\n end",
"title": ""
},
{
"docid": "348da0380a857cb55c76e46cc02dc128",
"score": "0.7273674",
"text": "def confirm!\n unless_confirmed do\n clear_confirmation_token\n update_attribute(:confirmed_at, Time.now)\n end\n end",
"title": ""
},
{
"docid": "7dbbe0685ae07e3907f69274e6136969",
"score": "0.72099435",
"text": "def confirm!\n unless_confirmed do\n self.confirmation_token = nil\n self.confirmed_at = Time.now\n save(false)\n end\n end",
"title": ""
},
{
"docid": "95b550e88ff54ac45856d91b00429396",
"score": "0.7196063",
"text": "def reconfirm!\n self.confirmed = false\n self.token = random_token\n self.save!\n end",
"title": ""
},
{
"docid": "13124519f1a342e6413d841245cf9560",
"score": "0.7194059",
"text": "def confirmation\n @user = params[:user]\n @token = params[:token]\n @expire = Time.now.to_i\n\n mail to: @user.email, subject: \"Reset de senha\"\n end",
"title": ""
},
{
"docid": "55ff0fb103119d5e0851e459555ec3b8",
"score": "0.7192577",
"text": "def request_confirmation\n # TODO: send activation email\n end",
"title": ""
},
{
"docid": "e2ce2e0ec822506bff914bbf8b767075",
"score": "0.71769595",
"text": "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end",
"title": ""
},
{
"docid": "9848c2c8515a58bd04cee42fdd5e2ea4",
"score": "0.7173031",
"text": "def confirm\n token = params[:token].to_s\n\n user = User.find_by(confirmation_token: token)\n\n if user.present? && user.confirmation_token_valid?\n user.mark_as_confirmed!\n render json: { status: \"User confirmed successfully\" }, status: :ok\n else\n render json: { status: \"Invalid token\" }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "7fdc0934554cc2065294b34496382253",
"score": "0.71514785",
"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": "6b690aaa4e7829a410c3889c872dc74f",
"score": "0.71455216",
"text": "def confirm\n decoded_token = AuthToken.decode(params[:token])\n if User.find(decoded_token[:user_id])\n user = User.find(decoded_token[:user_id])\n # User is confirmed\n #if user.confirmation_sent_at < 2.hours.ago\n #Link has expired\n #redirect_to \"/#/register\"\n #else\n user.confirmed = \"Y\"\n user.save\n redirect_to root_url\n #end\n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n #redirect_to \"/#/login\"\n end\n end",
"title": ""
},
{
"docid": "a9c3ce59186bf20cb3a05c330955f048",
"score": "0.712759",
"text": "def send_email_confirmation\n end",
"title": ""
},
{
"docid": "721402a9962ce7265bd95e0208300030",
"score": "0.71220434",
"text": "def confirm\n \trsvp = Rsvp.find_by_uid params[:uid]\n \trsvp.confirm_email params[:confirmation_code]\n \tif not rsvp.confirmed?\n flash[:error] = \"You're link doesn't match what we have on record.\"\n redirect_to new_rsvp_path\n \telse\n session[:email] = rsvp.email\n flash[:success] = \"We will update you at #{rsvp.email} with new information as it because available\"\n redirect_to rsvp_path rsvp\n \tend \n end",
"title": ""
},
{
"docid": "e76f7045a779d165127fd0cbe077b6e1",
"score": "0.71088094",
"text": "def request_email_confirmation!( email )\n object = emails.where( email: email ).first\n raise \"Email '#{email}' does not belong to user\" unless object\n object.confirmation_token = User.generate_confirmation_token\n object.save!\n object\n end",
"title": ""
},
{
"docid": "67939b3a79730c71c450f07f09530ef7",
"score": "0.7086098",
"text": "def send_confirmation_email(params)\n url_params = {\n :controller => 'user',\n :action => 'activate',\n :id => @user.id,\n :token => @user.new_token\n }\n url = url_for(url_params)\n UserMailer.deliver_new_user(params, url, @user.token_expiry)\n end",
"title": ""
},
{
"docid": "bef6f15c4514856f0eb4741cfa0a05c3",
"score": "0.7072695",
"text": "def confirm\n if temporary_registration = \\\n TemporaryRegistration.find_by_reference_token(params[:id])\n\n registration = Registrar.confirm_registration(temporary_registration)\n\n if registration.present? && registration.persisted?\n RegistrationMailer.confirmed(registration.id).deliver\n\n flash[:notice] = \"You registration is confirmed!\"\n else\n flash[:error] = \"We were unable to register you for this class.\"\n end\n\n redirect_to lesson_path(temporary_registration.event.lesson, :anchor => \"registration\")\n else\n flash[:error] = \"Temporary registration not found.\"\n\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "be4c77c7fe8887f9ccaa0ab7f715bfa4",
"score": "0.7072565",
"text": "def confirm\n @user = User.find_by_user_confirmation_token(params[:token])\n if @user.present?\n @user.confirmed_user = true\n session[:user_id] = @user.id\n respond_to do |format|\n format.html { redirect_to @user, :notice => \"Your account has been confirmed!\"}\n format.json { head :no_content}\n end\n else\n respond_to do |format|\n format.html { redirect_to sign_in_url, :notice => \"Account not found. Please try resetting your password.\"}\n format.json { head :no_content}\n end\n end\n end",
"title": ""
},
{
"docid": "5af8e9ec723241aef262b939ea3bc61c",
"score": "0.70645016",
"text": "def confirm_account_email(user)\n @user = user\n @confirm_url = confirm_user_url(@user, code: @user.confirmation_code)\n mail(to: @user.email, subject: 'Welcome to PSAP!')\n end",
"title": ""
},
{
"docid": "575a59e1a365e7992f6594e3ddd1da30",
"score": "0.70434093",
"text": "def send_confirmation\n end",
"title": ""
},
{
"docid": "6f480b1b71a9aa12c0855be8a4084062",
"score": "0.70332164",
"text": "def resend_confirmation_token\n unless_confirmed { send_confirmation_instructions }\n end",
"title": ""
},
{
"docid": "86e1d71853016c3161e74ae15aceaf07",
"score": "0.70280576",
"text": "def create_confirmation_digest\n self.confirmation_token = User.new_token\n end",
"title": ""
},
{
"docid": "956dc477a3de173976cbddff34590a3a",
"score": "0.7022394",
"text": "def email_confirmation\n AccountMailer.email_confirmation\n end",
"title": ""
},
{
"docid": "1290365a419709a2981ce119dc95edca",
"score": "0.70145094",
"text": "def confirmation_email(user)\n @user = user\n @url = confirmation_path(user.token, {:only_path => false})\n mail(:to => user.email, :subject => \"New User Confirmation\")\n end",
"title": ""
},
{
"docid": "5cf1f356ee2d5103848136058f576f89",
"score": "0.698964",
"text": "def account_confirmation\n @user = user\n mail to: user.email, :subject => 'Account Confirmation'\n end",
"title": ""
},
{
"docid": "03a8f58762a658d99d5ffe9f2208d8d0",
"score": "0.6979834",
"text": "def test_confirm\n raise \"Auto-confirm method not available in production\" if Rails.env == 'production'\n puts \"Auto-confirming user #{current_user.email}\"\n current_user.confirm\n current_user.email_accounts.each{|a| a.confirm!}\n render text: \"Confirmed user #{current_user.id}\"\n end",
"title": ""
},
{
"docid": "833e37cc91405082d214a19cebcd201f",
"score": "0.697918",
"text": "def confirmed\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "7d30c67524abd885db2ba253309c4137",
"score": "0.69761837",
"text": "def confirm_email!(confirm_hash)\n if self.email_confirmed\n true\n elsif self.email_confirm_hash == confirm_hash\n self.email_confirmed = true\n self.email_confirm_hash = nil\n self.save\n else\n false\n end\n end",
"title": ""
},
{
"docid": "4382f218ef86464fc2f7c2de8027b50a",
"score": "0.697016",
"text": "def call\n context.fail!(message: \"Confirmation token can't be blank\") if context.confirmation_token.blank?\n context.fail!(message: 'Confirmation token is invalid') if context.confirmation_token != context.user.confirmation_token\n context.user.update(confirmed_at: DateTime.now, confirmation_token: nil)\n end",
"title": ""
},
{
"docid": "548778ca6a1e10acdb628444ec594e7c",
"score": "0.69641376",
"text": "def auth_confirm_new_email_post(token, opts = {})\n auth_confirm_new_email_post_with_http_info(token, opts)\n nil\n end",
"title": ""
},
{
"docid": "186783723a6c11458e196702bf4ce094",
"score": "0.6960296",
"text": "def confirm_by_token(confirmation_token)\n confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token)\n confirmable.confirm! unless confirmable.new_record?\n confirmable\n end",
"title": ""
},
{
"docid": "2869daf924486197f34bc43d5902523c",
"score": "0.6946354",
"text": "def confirm_email!\n unless self.unconfirmed_email.blank?\n \n # BEGIN DEBUG\n logger.debug(\"Username: #{self.username}\")\n logger.debug(\"Unconfirmed email: #{self.unconfirmed_email}\")\n logger.debug(\"Confirmed email: #{self.email}\")\n # END DEBUG\n \n # Note: need to bypass the explicitly defined setter for 'email'\n self[:email] = self.unconfirmed_email\n self.email_confirmed_at = Time.now\n self.unconfirmed_email = nil\n \n # Activate user if not previously activated\n unless self.activated?\n self.activated_at = Time.now\n self.account_status = \"sleep\"\n end\n \n return self.save\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "f78c1e07c0c31c13908cbc9f76ed06e8",
"score": "0.6939904",
"text": "def account_confirmation user\n @user = user\n mail to: user.email, subject: \"Welcome to Love And Laughter Playschool.\"\n end",
"title": ""
},
{
"docid": "3dc0f9776765567a2acf696e97c5d4a4",
"score": "0.6932655",
"text": "def confirm_email_change(options)\n raise \"Please provide password\" unless options[:password]\n raise \"Please provide confirmation token\" unless options[:confirmation_token]\n\n signout\n visit user_confirmation_path(confirmation_token: options[:confirmation_token])\n assert_response_contains(\"Confirm change of email address\")\n fill_in \"Your password\", with: options[:password]\n click_button \"Confirm change\"\n end",
"title": ""
},
{
"docid": "a5bca17b8fc2b93814a910e713d8c1cf",
"score": "0.6928053",
"text": "def request_confirmation\n request = Request.first\n request.confirmation_token = Request.new_token\n RequestMailer.request_confirmation(request)\n end",
"title": ""
},
{
"docid": "0ab6d66e5581871f608d98f6f89d4e26",
"score": "0.6920359",
"text": "def confirm_email\n organization = Organization.last\n user = organization.users.first\n user.forgot_password\n user.save\n preview(UserMailer.with(organization: organization, user: user).confirm_email)\n end",
"title": ""
},
{
"docid": "7c616a01002f4e703680b494ff0544f0",
"score": "0.69146335",
"text": "def confirm!\n\tself.update_attributes(\n :unique_token => nil,\n :verifiedstatus => true\n\t\t)\nend",
"title": ""
},
{
"docid": "3ce2b072cd9943a94f68d397a68fd82c",
"score": "0.6910297",
"text": "def confirm_email!\n super\n accept_invitation!\n end",
"title": ""
},
{
"docid": "165928c356995643fe673e440c5039a9",
"score": "0.68911743",
"text": "def npo_confirm_email(user)\n\t\t@account = user\n\t\t@confirmUrl = \"#{Weeverails::Application.config.domain}/account/confirm?token=#{Digest::SHA1.hexdigest(@account.salt)}&email=#{@account.email}\"\n\t\tmail(:to => user.email, :subject => \"Welcome to Weeve\")\n\tend",
"title": ""
},
{
"docid": "04544be407523325f21479614b22a13f",
"score": "0.68877083",
"text": "def subscribe_confirmation\n if @confirmation\n @confirmation.confirmed = true\n @confirmation.save\n redirect_to root_path(), notice: 'The email was successfully confirmed.'\n else\n redirect_to root_path(), alert: 'The email not confirmed.' \n end\n end",
"title": ""
},
{
"docid": "1308c8beb5a7e5585b609dcce52b5a8c",
"score": "0.6877209",
"text": "def registration_confirmation(usuario)\n @usuario = usuario\n #@usuario.confirmed = true\n #@usuario.save!\n mail(to: usuario.email, subject: \"Confirmação de Registro\")\n end",
"title": ""
},
{
"docid": "1b0f0b2b8e98ddaf08895be15a1fa90d",
"score": "0.6875384",
"text": "def email_activate\n \t\tself.email_confirmed = true\n \t\tself.confirm_token = nil\n \t\tsave!(:validate =>false)\n \tend",
"title": ""
},
{
"docid": "e3db1eb0ec7ce33cd4cca28708019c87",
"score": "0.68723476",
"text": "def create\n user = find_user_for_create\n\n if user\n user.generate_confirmation_token(reset_unconfirmed_email: false)\n Mailer.email_confirmation(user).deliver_later if user.save\n end\n redirect_to root_path, notice: t(\".promise_resend\")\n end",
"title": ""
},
{
"docid": "3f89bccdaca48844136eb0ab1d400abc",
"score": "0.6872308",
"text": "def send_confirmation_email\n generate_token!(:confirmation_token)\n UserMailer.delay.confirmation(self._id)\n end",
"title": ""
},
{
"docid": "4ba7b6b4859865c1fb124b1f89af89dd",
"score": "0.68712336",
"text": "def signup_confirmation(attendee)\n @attendee = attendee\n\n mail to: \"encuentro@catec.edu.bo\", subject: \"Nuevo registro para el encuentro 2013\"\n end",
"title": ""
},
{
"docid": "0634e63f96eaefb4696e90b5998c1c4a",
"score": "0.6868359",
"text": "def confirmation_instructions(record, token, opts={})\n @user = record\n @token = token\n\n SendGridService::Email.new(\n 'trainrbio@gmail.com',\n @user.email,\n \"Click the confirmation link to verify your Trainrbio account.\",\n 'text/plain',\n \"https://www.trainr.bio/users/confirmation?confirmation_token=#{@token}\"\n ).send_email\n # super\n end",
"title": ""
},
{
"docid": "64df39d48f557fc35cff727d19c5d0f2",
"score": "0.685797",
"text": "def email_confirmation user\n \t@user = user\n \tuser.send_confirmation\n mail to: user.email, subject: \"Thanks for Starting an Account\"\n end",
"title": ""
},
{
"docid": "bf6f8cf4fa1133371bae174163eba676",
"score": "0.6852348",
"text": "def registration_confirmation(user)\n @user = user\n @url = activate_url(:user => { :reset_code => @user.reset_code })\n mail(:to => user.email, :subject => \"Registration confirmation\")\n end",
"title": ""
},
{
"docid": "50376c08b995dd332924d9bf845f8b0e",
"score": "0.6843439",
"text": "def unconfirmed\n if current_user.generate_confirmation_token(reset_unconfirmed_email: false) && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end",
"title": ""
},
{
"docid": "410a98d0aada77c14f7889f11ea4650d",
"score": "0.68388104",
"text": "def account_activation\n user.activation_token = User.new_token\n UserMailer.account_activation(user)\n end",
"title": ""
},
{
"docid": "5b3eb3bbe0dd4425f3de41a813ca94a9",
"score": "0.68299794",
"text": "def confirm_email\n self.email_confirmed_at = Time.current\n save\n end",
"title": ""
},
{
"docid": "26176cd9ab0f4cec68a38bf7ef96c7b8",
"score": "0.68294424",
"text": "def after_confirmation\n ProfileCreator::Email.new(self).perform\n end",
"title": ""
},
{
"docid": "5bff9c438fddd9b429ab5c0452de37e5",
"score": "0.6826665",
"text": "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Mailer.delay.email_reset(current_user)\n flash[:notice] = t('profiles.update.confirmation_mail_sent')\n else\n flash[:notice] = t('try_again')\n end\n redirect_to edit_profile_path\n end",
"title": ""
},
{
"docid": "e41e7db50ba4d367dca335b882bcaf0b",
"score": "0.6823814",
"text": "def account_confirmation(user)\n @user = user\n mail to: user.email, subject: \"Please Confirm Your Account\"\n end",
"title": ""
},
{
"docid": "bb1a4e91455586d6c333dafa54a60a2d",
"score": "0.6821807",
"text": "def resend_confirmation_token\n unless_confirmed do\n generate_confirmation_token! if self.confirmation_token.nil?\n member_email('member_created', member).deliver if Refinery::Setting.find_or_set(\"memberships_deliver_mail_on_member_created\", true)\n end\n end",
"title": ""
},
{
"docid": "bb1a4e91455586d6c333dafa54a60a2d",
"score": "0.6821807",
"text": "def resend_confirmation_token\n unless_confirmed do\n generate_confirmation_token! if self.confirmation_token.nil?\n member_email('member_created', member).deliver if Refinery::Setting.find_or_set(\"memberships_deliver_mail_on_member_created\", true)\n end\n end",
"title": ""
},
{
"docid": "ffc2012dbf65c950f3a3ca0a338040eb",
"score": "0.68207645",
"text": "def confirm_email(user)\n @user = user\n mail :to => user.email, :subject => \"Confirm registration\"\n\n end",
"title": ""
},
{
"docid": "b0914033f42b8ac68c7585582a578cae",
"score": "0.6816077",
"text": "def show\n mail_token = begin\n Ros::Jwt.new(confirmation_params[:token]).decode\n rescue JWT::DecodeError => e\n render status: :bad_request, json: { errors: e }\n return\n end\n\n return unless mail_token\n\n Apartment::Tenant.switch tenant_schema(mail_token) do\n res = User.confirm_by_token(mail_token[:token])\n if res.confirmed?\n render status: :ok, json: { message: 'ok' }\n else\n render status: :bad_request, json: { errors: res.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "e6a71523c6019d760a704847c8cd144e",
"score": "0.6792524",
"text": "def confirm(to_email, reset_password_url)\n @reset_password_url = reset_password_url\n mail :to => to_email\n end",
"title": ""
},
{
"docid": "22a26159df7bd54c9e4e25314f296e28",
"score": "0.6791638",
"text": "def follow_confirmation_email(user)\n get '/accounts/verify', :key => user.confirmation_key\n end",
"title": ""
},
{
"docid": "6db50dd55ac85224a7948fab92e732cd",
"score": "0.67808557",
"text": "def unconfirmed\n if current_user.generate_confirmation_token(reset_unconfirmed_email: false) && current_user.save\n email_reset(current_user)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end",
"title": ""
},
{
"docid": "897b55ffd0b6a524b812a58e5b4659d9",
"score": "0.67806655",
"text": "def register_confirm(register_user)\n @greeting = \"Hi\"\n\n @register_user = register_user\n\n mail :to => register_user.email, :subject => 'The confirmation email from kid018'\n end",
"title": ""
},
{
"docid": "9c6d7ac3e84d98d51c480352f89168c4",
"score": "0.6779051",
"text": "def generate_confirmation_token\n self.confirmation_token = @confirm_token = SecureRandom.hex(10)\n self.confirmation_sent_at = Time.now\n end",
"title": ""
},
{
"docid": "072d277b1ef4f6a7824c35cdc94a8a39",
"score": "0.6778038",
"text": "def create\n @user = User.where(single_access_token: params[:confirmation_code]).first\n\n if @user\n\n @user.reset_perishable_token\n @user.validated = true\n\n if @user.save\n flash[:notice] = t(\"users.create.flash.success\")\n UserMailer.account_confirmed(@user).deliver\n\n redirect_to root_path\n\n else\n flash[:error] = t(\"scaffolds.generic.flash.error\")\n render body: 'error'\n end\n\n else\n flash[:error] = t(\"scaffolds.generic.flash.error\")\n render body: 'error'\n end\n end",
"title": ""
},
{
"docid": "c99bf37ad9770e1c5d1a61e95f8af9f5",
"score": "0.6774269",
"text": "def confirm_email confirmation_code\n\t\tif (not confirmation_code.nil?) && confirmation_code == self.confirmation_code\n\t\t\tself.confirmed = true\n\t\t\tself.confirmation_code = nil\n\t\t\tsave\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6d973df8d78799430041e74fe1ee3bb1",
"score": "0.67741966",
"text": "def user_registration_email_confirmation(\n success:,\n email: nil,\n failure_reason: nil\n )\n track_event(\n :user_registration_email_confirmation,\n success: success,\n email: email,\n failure_reason: failure_reason,\n )\n end",
"title": ""
},
{
"docid": "cbbcc73ef7cc65ec56898363305bfda0",
"score": "0.67728466",
"text": "def resend_email_confirmation\n email = user_params[:email].downcase \n @user = User.find_by(email: email)\n\n # Send a failure response if no account exists with the given email\n unless @user.present?\n render(fail_response(message: \"User #{email} does not exist\")) and return\n end\n\n @user.send_api_v2_email_confirmation_instructions\n\n render(success_response(message: \"Email confirmation sent to#{email}.\"))\n\n end",
"title": ""
},
{
"docid": "9faae48f429cbe84017d24082329c32c",
"score": "0.6766484",
"text": "def regist_confirm(email, code)\n @username= email\n @userhash = code\n mail :to => email,:subject=>\"沃银网注册确认\"\n end",
"title": ""
},
{
"docid": "5efe95617e548c2ae0eac52c27b36d7b",
"score": "0.67662746",
"text": "def confirm!\n send_welcome_email\n super\n end",
"title": ""
},
{
"docid": "b40d2baa018a81e874bdfcc5684d5da6",
"score": "0.6765182",
"text": "def confirm_email confirmation_code\n\t\tif (not confirmation_code.nil?) && confirmation_code == self.confirmation_code\n\t\t\tconfirm\n\t\t\tself.confirmation_code = nil\n\t\t\tsave\n\t\tend\n\tend",
"title": ""
},
{
"docid": "87a41f5b77de82e84982e366b632b402",
"score": "0.6763698",
"text": "def confirmation_instructions(record, token, opts={})\n @resource = User.find(record['id'])\n @token = token\n mail(to: @resource.email, subject: '[Ripple] Please confirm your email')\n end",
"title": ""
},
{
"docid": "21f500712571a75a2273b8752111625c",
"score": "0.6763241",
"text": "def confirm_by_token(confirmation_token)\n #original_token = confirmation_token\n #confirmation_token = Devise.token_generator.digest(self, :confirmation_token, confirmation_token)\n\n confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token)\n confirmable.confirm! if confirmable.persisted?\n #confirmable.confirmation_token = original_token\n confirmable.confirmation_token = confirmation_token\n confirmable\n end",
"title": ""
}
] |
1d3b315de2e9208454fad7fe93b0e423 | GET /items/1 GET /items/1.json Display a specific item | [
{
"docid": "3a8b68009d65a837bd7dfedbd3c8b291",
"score": "0.0",
"text": "def show\n # Find item from DB\n @item = Item.find(params[:id])\n # Get item location\n #@location = @item.postal_code\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
}
] | [
{
"docid": "41699dd17c12d7e8d1afd1406f087302",
"score": "0.82317936",
"text": "def item(id)\n get(\"/item/#{id}.json\")\n end",
"title": ""
},
{
"docid": "eb354ffc8205e277e16c339add996ccd",
"score": "0.8148269",
"text": "def show\n item = Item.find(params[:id])\n render json: item\n end",
"title": ""
},
{
"docid": "0e3175d07666b24339a1d901013f3a1a",
"score": "0.8092206",
"text": "def show\n @item = Item.find(params[:id])\n render json: @item\n end",
"title": ""
},
{
"docid": "c4bd8be3a67efe7a0c112b82ddcda747",
"score": "0.80820245",
"text": "def show\n render :json => Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "edbe3615c4166ab04bd6dd52d48ceb7c",
"score": "0.8077225",
"text": "def show\n @item = Item.find(params[:id])\n render :json => @item\n end",
"title": ""
},
{
"docid": "f1082b9d415682dd50c0a3cf4f8b12f4",
"score": "0.8020897",
"text": "def item(id)\r\n get(\"item/#{id}\")\r\n end",
"title": ""
},
{
"docid": "fe476c10c46410f64947d209d6bdcb4c",
"score": "0.790109",
"text": "def show\n render json: Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "31426dc34e7a79de5ad52afb0f0aa7a3",
"score": "0.7864735",
"text": "def show\n @item = Item.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "1f50986d73a8382860e494b9790926e7",
"score": "0.7863792",
"text": "def show\n\t\t@item = Item.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @item }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1f50986d73a8382860e494b9790926e7",
"score": "0.7863792",
"text": "def show\n\t\t@item = Item.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @item }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4b9070e111efed469a61ba12e22b9b57",
"score": "0.78524363",
"text": "def show\n item = find_item\n render json: item\n end",
"title": ""
},
{
"docid": "d09a877d0e3428805f7c5fec0322f980",
"score": "0.78323495",
"text": "def get_item\n\t\t@item = Item.find_by_id(params[:id])\n\t\tif item.nil?\n\t\t\trender json:{message:\"Item not found\"},status: :bad_request\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ffb36908180b80ee27642822e5bf66cd",
"score": "0.7826772",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "31b95ddab946add5853ef0d1cefc48cc",
"score": "0.78091717",
"text": "def show\n @item = Item.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "ee565a3dfa18b60e61033f07f1521271",
"score": "0.7801463",
"text": "def show\n item_id = params[:id]\n item = ensure_item_exists(item_id)\n render json: { item: item }, status: :ok\n end",
"title": ""
},
{
"docid": "7e485a9bc462611fb829e18167ccff73",
"score": "0.78005207",
"text": "def show\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "951206923d53dd5f7fa4cc6970c8cbb7",
"score": "0.77901816",
"text": "def show\n @item = @model.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "82a042d2e44f45dbd13a611a4db6327b",
"score": "0.7784427",
"text": "def show\n respond_to do |format|\n if Item.exists?(id: params[:id])\n @item = Item.find(params[:id])\n format.json { render :show, status: :ok, location: @item }\n else\n format.json { render plain: \"Couldn't get item with id = #{params[:id]}\", status: :bad_request }\n end\n end\n end",
"title": ""
},
{
"docid": "a1364aa6a9e719e6521b1277f23d2914",
"score": "0.777681",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "a1364aa6a9e719e6521b1277f23d2914",
"score": "0.777681",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "a1364aa6a9e719e6521b1277f23d2914",
"score": "0.777681",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "b35546c995df6a06443208fbd1610e9c",
"score": "0.7715783",
"text": "def show\n @item = @items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "f576fd7e2180ebbcb2d149e2ebbb2954",
"score": "0.770908",
"text": "def item(id)\n connection.get(\"/items/#{id}\").body\n end",
"title": ""
},
{
"docid": "aed6803dbc293d9e5c8c86be51598799",
"score": "0.7694949",
"text": "def show\n item = Item.find(params[:id])\n render json: ItemSerializer.new(item)\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.76603013",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.76603013",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.76603013",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.76603013",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.76603013",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c57598f48c120a5a403ab1f3ac14626",
"score": "0.76603013",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "adf21e2ab8f07f97ad0b854b02591c78",
"score": "0.76578254",
"text": "def show\n render :json => Item.find(params[:id]).to_json\n end",
"title": ""
},
{
"docid": "6384614efdbcc61a72ea0823ac490fb6",
"score": "0.7603301",
"text": "def show\n render json: @item\n end",
"title": ""
},
{
"docid": "6384614efdbcc61a72ea0823ac490fb6",
"score": "0.7603301",
"text": "def show\n render json: @item\n end",
"title": ""
},
{
"docid": "e629f3b980c96ee2e76584effe313933",
"score": "0.7600016",
"text": "def show\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "dfb48c310100e20586e991c2ca9af85b",
"score": "0.7599358",
"text": "def show\r\n respond_to do |format|\r\n format.html { # show.html.erb\r\n @item_info = ItemInfo.find(params[:id])\r\n }\r\n format.json {\r\n render json: getitem(params[:id])\r\n }\r\n end\r\n end",
"title": ""
},
{
"docid": "0b22e52878d630fa68a577913bfdc48e",
"score": "0.75964624",
"text": "def show\n @item = @package.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "00b430c6230348cb314bddf1dc97fc71",
"score": "0.7574031",
"text": "def show\n respond_with Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "3a0732595227f14402f28c9e28e72726",
"score": "0.7572244",
"text": "def details\n item = Item.find(params[:item_id])\n respond_to do |format|\n format.json { render :json => item.to_json }\n end\n end",
"title": ""
},
{
"docid": "a21ed1a1286295bbd7e0a89f2739f783",
"score": "0.75719607",
"text": "def show\n render json: { item: @item }, status: 200\n end",
"title": ""
},
{
"docid": "88c1b397fc24459dbdba67d35d6139f5",
"score": "0.75716376",
"text": "def getItemById\n if params[:id].present?\n code, @item = Item.getItemById(params[:id])\n if response.code == 404\n render(json: {messages: 'Item not found'}, status: code)\n else\n \n render(json: @item, status: 200)\n end\n\n end\n end",
"title": ""
},
{
"docid": "70661501c39528804038ddacd7ef52f2",
"score": "0.75672996",
"text": "def show \n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "3093ffa75777275742910bb542407075",
"score": "0.7566083",
"text": "def show\n @item = Item.find(params[:id])\n \n end",
"title": ""
},
{
"docid": "5ede2cea1287a945d66a8c422ba7b9aa",
"score": "0.75308233",
"text": "def show\n allow :get, :delete, :put; vary_on :accept\n expires_in 60.seconds\n\n item = find_item(params[:id])\n item.links = links_for_item(item)\n\n respond_to do |format|\n format.g5kitemjson { render :json => item }\n format.json { render :json => item }\n end\n end",
"title": ""
},
{
"docid": "c6e793423bb18a4c5418eb4171e7e2bc",
"score": "0.7522686",
"text": "def show\n @item = @model.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "c290400a59fb18acce8188d9a63426f4",
"score": "0.75174606",
"text": "def cmd_item_show(m, params)\n id = params[:id]\n id = $1.to_i if id.match /(\\d+)/\n begin\n item = api_request.item id\n m.reply item_to_s item\n rescue Exception => e\n m.reply \"class:#{e.class} => #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "947e32c464fdc3c45b804261bf8074c6",
"score": "0.75050014",
"text": "def show\n @item = Item.find(params[:id])\n @item_url = @item.url\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "5cf88c246c59a555b593493e4faf248b",
"score": "0.74853766",
"text": "def show\n @item = Item.get!(params[:id])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "72b000b37dd1281dd1cb38e5f173f214",
"score": "0.7475802",
"text": "def show\n\t\t@item = Item.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @item }\n\t\t\tformat.xml { render xml: @item }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5878d4f1f70b169a1f061bd55da51cc4",
"score": "0.74726117",
"text": "def get_item(id)\n get_request(id, 'item', {})\n end",
"title": ""
},
{
"docid": "96514c3b8b6ff3d706a8b807a9ddb7b6",
"score": "0.7426075",
"text": "def item\n if @item = Item.find_by(id: params[:item])\n render :json => @item.to_json(:include => :subitem)\n else\n error_message(\"Item not found\")\n end\n end",
"title": ""
},
{
"docid": "9dc115545e6bb0551e65698eff4d5b1b",
"score": "0.74182624",
"text": "def get_item(id, params = nil, headers = nil)\n get(\"/api/v1/items/#{id}\", params, headers)\n end",
"title": ""
},
{
"docid": "05c34644953a156f85f73fe8798c1585",
"score": "0.739204",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_with @item\n end",
"title": ""
},
{
"docid": "c5dac8780ac73399714a81dbb10a6a37",
"score": "0.7368375",
"text": "def show\n respond_with Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "a58fafbbe35446a2e4b7c1bd27ce02cf",
"score": "0.7352136",
"text": "def get_item(item_id, params = nil, headers = nil)\n get(\"/api/v2/items/#{item_id}\", params, headers)\n end",
"title": ""
},
{
"docid": "068aae8e9708991b931d62f9209e5738",
"score": "0.73503655",
"text": "def show\n @item = Item.find(params[:id])\n respond_with(@item)\n end",
"title": ""
},
{
"docid": "10faa5d1e37c5a0590c8cfb65ed85eca",
"score": "0.7349525",
"text": "def show\n @item = Item.find(params[:id])\n respond_with @item\n end",
"title": ""
},
{
"docid": "4e5f73dbd5f31fcd1437e2e67a109d0e",
"score": "0.73292357",
"text": "def find_item(id)\n self.class.get(\"/items/#{id}.json?apikey=#{apikey}\")\n end",
"title": ""
},
{
"docid": "57312a19f9fdaeef92ed46ed5d009db1",
"score": "0.7321248",
"text": "def item(id)\n result = get('/' + id.to_s)\n Item.new(result[:item])\n end",
"title": ""
},
{
"docid": "7a9bfe33bf05b3d7de49e210292fc728",
"score": "0.73189986",
"text": "def show\n render json: @item\n end",
"title": ""
},
{
"docid": "7a9bfe33bf05b3d7de49e210292fc728",
"score": "0.73189986",
"text": "def show\n render json: @item\n end",
"title": ""
},
{
"docid": "7a9bfe33bf05b3d7de49e210292fc728",
"score": "0.73189986",
"text": "def show\n render json: @item\n end",
"title": ""
},
{
"docid": "7a9bfe33bf05b3d7de49e210292fc728",
"score": "0.73189986",
"text": "def show\n render json: @item\n end",
"title": ""
},
{
"docid": "0a40620ec295b12e0ca0fa0030c222f2",
"score": "0.7302054",
"text": "def show\n respond_to do |format|\n format.json { render json: @item, status: 200}\n end\n end",
"title": ""
},
{
"docid": "36bdcbba5d7710b978b110d15d4e0688",
"score": "0.7296782",
"text": "def item\n Item.find(id)\n end",
"title": ""
},
{
"docid": "b059b5af65d466b67b6a258d9663477f",
"score": "0.7296189",
"text": "def get_item(item_id)\n get \"v3/market/catalog/item?id=#{item_id}\"\n end",
"title": ""
},
{
"docid": "7f53b59be73b039c68f277e0284de5b5",
"score": "0.72840744",
"text": "def show\n @list_item = ListItem.find(params[:id])\n\n render json: @list_item\n end",
"title": ""
},
{
"docid": "533e74e5d551a3484f610270f2956ff9",
"score": "0.7267918",
"text": "def show\n @user_item = UserItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_item }\n end\n end",
"title": ""
},
{
"docid": "533e74e5d551a3484f610270f2956ff9",
"score": "0.7267918",
"text": "def show\n @user_item = UserItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_item }\n end\n end",
"title": ""
},
{
"docid": "2455ad052867f5f510656cfd27befc3b",
"score": "0.72489774",
"text": "def show\n \n @item = Item.find(params[:id])\n\t@product = @item.product\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "d86b428b56ec0ce9192f68e8f0629d6b",
"score": "0.72488505",
"text": "def show\n @items_list = ItemsList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @items_list }\n end\n end",
"title": ""
},
{
"docid": "c601d92cbfa87e69d3d9a8c9e892da19",
"score": "0.72451544",
"text": "def show\n render json: @item, status: :ok\n end",
"title": ""
},
{
"docid": "3eebff907c26e4dbc288b955e2a77f10",
"score": "0.72337866",
"text": "def show\n @item = @group.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "da4d6482a0c925ba9731b347d4005fa0",
"score": "0.7220354",
"text": "def show\n @clothing_item = ClothingItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clothing_item }\n end\n end",
"title": ""
},
{
"docid": "4f1f1e3dd07489a84d454bde41410c7a",
"score": "0.72201663",
"text": "def get_item(id, params={})\n url = \"/#{HackernewsRuby.api_version}/item/#{id}.json\"\n get(url, params)\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "5810cf14a6b4cc5bf24e314ec953b544",
"score": "0.0",
"text": "def set_artwork\n @artwork = Artwork.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": ""
}
] |
942d574ba63c9d00d2c92b848798017e | Returns an array of ResourceGroup objects for the current subscription. | [
{
"docid": "6d3c5fd4f5d29bde21db43d12468d7cb",
"score": "0.73568976",
"text": "def list_resource_groups\n Azure::Armrest::ResourceGroupService.new(configuration).list\n end",
"title": ""
}
] | [
{
"docid": "ab54ee217a69e568454d3db39cfad5fc",
"score": "0.7703775",
"text": "def resource_groups\n url = url_with_api_version(\n configuration.api_version,\n @base_url,\n 'subscriptions',\n configuration.subscription_id,\n 'resourcegroups'\n )\n response = rest_get(url)\n JSON.parse(response)[\"value\"].map{ |hash| Azure::Armrest::ResourceGroup.new(hash) }\n end",
"title": ""
},
{
"docid": "3410ce364e61cc95726881a6f31c34cc",
"score": "0.74254304",
"text": "def get_resource_groups\n @resource_groups ||= @rgs.list(:all => true)\n end",
"title": ""
},
{
"docid": "8513f30ee1c0d67f32df9af9e62ea066",
"score": "0.7030912",
"text": "def resource_groups\n connection.cloudtools.resource.manager.collection(:list_resource_groups)\n end",
"title": ""
},
{
"docid": "c1eed1385780a23a9f4ffa182d2ee52a",
"score": "0.66433865",
"text": "def resource_groups\n vpc.cloudtools.resource.manager.collection(:list_resource_groups)\n end",
"title": ""
},
{
"docid": "6f900293d53030b26cb8013be6dd78ff",
"score": "0.6641942",
"text": "def groups()\n return [] if new_record?\n conn.getUserGroups(self.name)\n end",
"title": ""
},
{
"docid": "d06623fdaf15ff6094c3c54c63b4a330",
"score": "0.65384924",
"text": "def groups\n Hyrax::Group.all\n end",
"title": ""
},
{
"docid": "4bea022c236e06c6f7f5f57da6f023eb",
"score": "0.6529339",
"text": "def rest_groups\n group_array = []\n self.groups.uniq.each do |group|\n group_array << {\"id\" => group.id, \"name\" => group.name}\n end\n return group_array\n end",
"title": ""
},
{
"docid": "b137e46d8daa9f2ad995dc8d17673cf9",
"score": "0.6513618",
"text": "def groups\n Coop::Resources::Group\n end",
"title": ""
},
{
"docid": "8f22ad1999636c59a83c8cdc996034ca",
"score": "0.64946824",
"text": "def get_groups\n @resource[\"xml.group.list\"].get\n end",
"title": ""
},
{
"docid": "676499b80daddc477bbcad9f103f6290",
"score": "0.63843465",
"text": "def resource_groups\n collector.resource_groups.each do |resource|\n persister.resource_groups.build(\n :ems_ref => resource[:id],\n :name => resource[:name]\n )\n end\n end",
"title": ""
},
{
"docid": "13cc48514ee4c7c41744b5c236d3b3b6",
"score": "0.6354314",
"text": "def list_rs_groups\n @admin.listRSGroups\n end",
"title": ""
},
{
"docid": "831d8c806631d8f1838414fffbe83299",
"score": "0.6331035",
"text": "def get\n begin\n @resource_client.resource_groups.get(@rg_name)\n rescue MsRestAzure::AzureOperationError => e\n OOLog.fatal(\"Error getting resource group: #{e.body}\")\n rescue => ex\n OOLog.fatal(\"Error getting resource group: #{ex.message}\")\n end\n end",
"title": ""
},
{
"docid": "51485c6429a6227610929db4ef55b99d",
"score": "0.63019484",
"text": "def get_groups()\n resp = conn.get( '/groups/'+name+'/groups/' )\n \n case resp.code.to_i\n when 200\n groups = Array.new()\n JSON.parse( resp.body ).each{ |groupname|\n groups.push(RestAuthGroup.new( conn, groupname ))\n }\n return groups\n when 404\n raise RestAuthGroupNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end",
"title": ""
},
{
"docid": "2945baf3bbd6d5b7094e994c7d71506f",
"score": "0.62116796",
"text": "def groups\n return @groups.values\n end",
"title": ""
},
{
"docid": "5723343460c10c73f87337cee2b8cb9a",
"score": "0.62024033",
"text": "def groups\n res = @conn.get 'groups.list', token: @api_token\n Array(JSON.parse(res.body)['groups'])\n end",
"title": ""
},
{
"docid": "d6ad5b764b68657ebe4bc4eb518294d7",
"score": "0.61613923",
"text": "def get_groups\n ret = @ds.retrieve_all_groups\n \n return nil if ret.nil?\n \n groups = []\n ret.each do |group|\n groups << group.group_id\n end\n \n return groups\n end",
"title": ""
},
{
"docid": "788907e5782c91187de83283acf51128",
"score": "0.61144716",
"text": "def groups\n if self.document && self.document[\"groups\"]\n document[\"groups\"].map { |group| Group.new(group) }\n else\n []\n end\n end",
"title": ""
},
{
"docid": "c449413110964807364c22a01ac02ab9",
"score": "0.6093671",
"text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "40158a306d172d148ad8c9b38846e2eb",
"score": "0.60821885",
"text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "735f42dba11d8f33789af69df96a633b",
"score": "0.60736114",
"text": "def resource_groups\n collector.resource_groups.each do |resource|\n persister.resource_groups.build(\n :ems_ref => resource[:id],\n :name => resource[:name]\n )\n end\n rescue IBMCloudSdkCore::ApiException => err\n # If the IBM Cloud API key used in the provider definition belongs to a service ID,\n # collecting resource groups will fail as an account_id is required to make the API call\n raise unless err.message.include?(\"Error: Can not get resource groups without account id in parameter by service id token\")\n\n nil\n end",
"title": ""
},
{
"docid": "74f4046eed426ae030d65a49247f3dce",
"score": "0.60175645",
"text": "def groups\n groups = []\n self.group_relations.each do |r|\n groups.push r.group\n end\n groups\n end",
"title": ""
},
{
"docid": "7e1a78e153e8f25116fb5c17d1238882",
"score": "0.6005497",
"text": "def groups()\n groups = @groups\n\n groups.each do |g|\n groups.concat(g.groups)\n end\n\n return groups\n end",
"title": ""
},
{
"docid": "cf1ddb49828afab8afe98734879c30ae",
"score": "0.5998695",
"text": "def index\n @res_groups = ResGroup.available_groups_for(current_user)\n end",
"title": ""
},
{
"docid": "5e426ea14d78eec5814594a5f164b287",
"score": "0.5997777",
"text": "def all\n @groups\n end",
"title": ""
},
{
"docid": "c55525c8fa4bcefd2a240b30b5b2d2d7",
"score": "0.59928244",
"text": "def list\n url = subscriptions_url + \"?api-version=#{api_version}\"\n response = rest_get(url)\n Azure::Armrest::ArmrestCollection.create_from_response(response, Azure::Armrest::Subscription)\n end",
"title": ""
},
{
"docid": "9ec278d946a4a08d671dbb866559feaa",
"score": "0.59905773",
"text": "def get_groups\n endpoint = '/groups'\n url = self.base_url.to_s + endpoint.to_s + self.format.to_s\n self.get_data(url)\n end",
"title": ""
},
{
"docid": "e98686ad81edbe352bdb7f5509f97657",
"score": "0.5978522",
"text": "def get_asset_groups\n _kenna_api_request(:get, \"asset_groups\")\n end",
"title": ""
},
{
"docid": "50d0e9c58d3fda33b248d118dd7ccea8",
"score": "0.5932089",
"text": "def get_groups\n groups\n end",
"title": ""
},
{
"docid": "d6cc9de14f8ba02b86dc272e00272ce3",
"score": "0.5928749",
"text": "def groups\n return @groups\n end",
"title": ""
},
{
"docid": "d6cc9de14f8ba02b86dc272e00272ce3",
"score": "0.5928749",
"text": "def groups\n return @groups\n end",
"title": ""
},
{
"docid": "c63610dd3a5b6b733a51b044980ee6f3",
"score": "0.5900671",
"text": "def resource_group_info(resource_group = configuration.resource_group)\n url = url_with_api_version(\n configuration.api_version,\n @base_url,\n 'subscriptions',\n configuration.subscription_id,\n 'resourcegroups',\n resource_group\n )\n\n response = rest_get(url)\n Azure::Armrest::ResourceGroup.new(response.body)\n end",
"title": ""
},
{
"docid": "38d8c7663fa1a790aa64d4de85007a82",
"score": "0.58861506",
"text": "def subscriptions\n response = self.class.get \"/GetSubscriptions\"\n\n success = response.fetch \"success\"\n\n if success\n subscriptions = response.fetch \"subscriptions\"\n\n return subscriptions.map do |subscription|\n create_subscription subscription\n end.compact\n else\n raise Error, response.fetch(\"error\")\n end\n end",
"title": ""
},
{
"docid": "593fba7b310beb4e1b61afac0dc9e4f2",
"score": "0.58777905",
"text": "def groups\n group = Group.new\n group.session = session\n group.groups\n end",
"title": ""
},
{
"docid": "97a503464ef264eb3bda13f96a5c0c92",
"score": "0.5875061",
"text": "def getGroups\n\treturn_result = []\n\tgroups = $gm.get(\"groups\", @token)['response']\n\tgroups.each do | group |\n\t if !group['image_url'].nil?\n\t image = group['image_url'] + '.avatar'\n\t hash = { 'name' => group['name'], 'group_id' => group['group_id'], 'image' => image }\n\t return_result.push(hash)\n\t end\n\tend\n\treturn return_result\n end",
"title": ""
},
{
"docid": "67705a7d94a5427eacf0fb76b3f4667f",
"score": "0.58553916",
"text": "def groups\n array = []\n\n Sys::Admin.groups.each do |grp|\n array << grp.name if grp.members.include?(name)\n end\n\n array\n end",
"title": ""
},
{
"docid": "5d5725826a00f4b8caefac36047c5f6b",
"score": "0.58459944",
"text": "def list_in_all_groups\n array = []\n mutex = Mutex.new\n\n Parallel.each(list_resource_groups, :in_threads => 10) do |rg|\n response = rest_get(build_url(rg.name))\n results = JSON.parse(response)['value'].map { |hash| model_class.new(hash) }\n mutex.synchronize { array << results } unless results.blank?\n end\n\n array.flatten\n end",
"title": ""
},
{
"docid": "88be117547e29746f9b9da0e6c65e385",
"score": "0.58258146",
"text": "def subscriptions\n Azure::Armrest::SubscriptionService.new(self).list\n end",
"title": ""
},
{
"docid": "920e4d7cefd7355f8c46ad3fe135ac9d",
"score": "0.5812202",
"text": "def list_groups\n nessus_rest_get('groups')['groups'] || []\n end",
"title": ""
},
{
"docid": "983cf16fa201d2a767f1cd56e31fd554",
"score": "0.5811106",
"text": "def get_subscriptions\r\n Subscription.new.list\r\n end",
"title": ""
},
{
"docid": "0ff9e882d4517ae312decba8ce090266",
"score": "0.58090943",
"text": "def groups\n @groups = groups_get if reset_groups?\n @groups\n end",
"title": ""
},
{
"docid": "d1f3cdbe50805eabbd9a663260879edd",
"score": "0.58018327",
"text": "def groups\n GroupCollection.new(:config => config)\n end",
"title": ""
},
{
"docid": "99db03351c044f7c4635bb1a25b8d0ec",
"score": "0.5800683",
"text": "def get_groups()\n return self.groups\n end",
"title": ""
},
{
"docid": "860b37bc2e456647157edae8c2468850",
"score": "0.57531685",
"text": "def groups\n bugzilla_resource('Group')\n end",
"title": ""
},
{
"docid": "7c934388901ffee9ab8a1708f6cd99b9",
"score": "0.57421875",
"text": "def list(group = @resource_group)\n if group\n @api_version = '2014-06-01'\n url = build_url(@subscription_id, group)\n JSON.parse(rest_get(url))['value'].first\n else\n array = []\n threads = []\n\n resource_groups.each do |group|\n @api_version = '2014-06-01' # Must be set after resource_groups call\n url = build_url(@subscription_id, group['name'])\n\n threads << Thread.new do\n result = JSON.parse(rest_get(url))['value'].first\n array << result if result\n end\n end\n\n threads.each(&:join)\n\n array\n end\n end",
"title": ""
},
{
"docid": "3f2b683c3bf3b9e46ce988baa6ad4880",
"score": "0.5741534",
"text": "def groups\n Group.where(name: self._group_names)\n end",
"title": ""
},
{
"docid": "a50e37263919d938ced3090e9a987146",
"score": "0.57365817",
"text": "def groups\n result = get(\"groups\")\n end",
"title": ""
},
{
"docid": "e10f41b55ec2e1eb33d677149124d25d",
"score": "0.5733507",
"text": "def groups\n p = Plumber.new(connections)\n p.groups\n end",
"title": ""
},
{
"docid": "2abe23fc4143bfa878fdbab5664d4d26",
"score": "0.5730271",
"text": "def list_subscriptions\n Azure::Armrest::SubscriptionService.new(configuration).list\n end",
"title": ""
},
{
"docid": "aa70499747aae688ff67b7cc5ed4f4f1",
"score": "0.57226795",
"text": "def groups\n all_groups = []\n\n @containers.each do |container|\n all_groups += container.groups\n end\n\n all_groups\n end",
"title": ""
},
{
"docid": "86f71d47e43d2664cd782326d901b023",
"score": "0.57213753",
"text": "def groups\n\t\t\treturn [] if memberOf.nil?\n\t\t\t@groups ||= Group.find(:all, :distinguishedname => @entry.memberOf).delete_if { |g| g.nil? }\n\t\tend",
"title": ""
},
{
"docid": "25c52fc67f246ffd6f339bd1e33f5e83",
"score": "0.5720981",
"text": "def groups\n unless @groups\n @groups = convert_to_objects(cn_groups)\n end\n @groups\n end",
"title": ""
},
{
"docid": "22971ab7dc14f0fbd395e4df126f6993",
"score": "0.5708702",
"text": "def listGroups\n @admin.listGroups.map { |g| g.getName }\n end",
"title": ""
},
{
"docid": "0d5f28b9b98e3583896907914158c38e",
"score": "0.5703164",
"text": "def groups\n root.send(:call, \"UserGroup\", \"get_group_collection_from_site\").xpath(\"//spdir:Group\", NS).map do |row|\n attributes = clean_attributes(row.attributes)\n Group.new(root, attributes[\"Name\"])\n end\n end",
"title": ""
},
{
"docid": "cf7040de2bd3fe262f24f71e3006eea2",
"score": "0.5700454",
"text": "def groups\n Groups.new\n end",
"title": ""
},
{
"docid": "43819dd4e3c1bc455a9eb9ec57204a10",
"score": "0.5699544",
"text": "def groups\n @groups ||= []\n end",
"title": ""
},
{
"docid": "43819dd4e3c1bc455a9eb9ec57204a10",
"score": "0.5699544",
"text": "def groups\n @groups ||= []\n end",
"title": ""
},
{
"docid": "43819dd4e3c1bc455a9eb9ec57204a10",
"score": "0.5699544",
"text": "def groups\n @groups ||= []\n end",
"title": ""
},
{
"docid": "f71df94ffd789b858051c877a6ffa2eb",
"score": "0.56980765",
"text": "def get_resource_group(name)\n client.resource_groups.get(name) if exists(name)\n end",
"title": ""
},
{
"docid": "126bb29995203a71dae6b225c4bbca50",
"score": "0.5696181",
"text": "def groups\n @groups\n end",
"title": ""
},
{
"docid": "126bb29995203a71dae6b225c4bbca50",
"score": "0.5696181",
"text": "def groups\n @groups\n end",
"title": ""
},
{
"docid": "126bb29995203a71dae6b225c4bbca50",
"score": "0.5696181",
"text": "def groups\n @groups\n end",
"title": ""
},
{
"docid": "bcae6c0a57c2d99e442977ad489b316f",
"score": "0.5692533",
"text": "def groups\n @groups ||= get_groups\n end",
"title": ""
},
{
"docid": "69b7c2dd15f75849de1e9727a463c705",
"score": "0.5686318",
"text": "def list_in_all_groups(options = {})\n array = []\n mutex = Mutex.new\n headers = nil\n code = nil\n\n Parallel.each(list_resource_groups, :in_threads => configuration.max_threads) do |rg|\n url = build_url(rg.name, options)\n response = rest_get(url)\n json_response = JSON.parse(response.body)['value']\n headers = Azure::Armrest::ResponseHeaders.new(response.headers)\n code = response.code\n results = json_response.map { |hash| model_class.new(hash) }\n mutex.synchronize { array << results } unless results.blank?\n end\n\n array = ArmrestCollection.new(array.flatten)\n\n # Use the last set of headers and response code for the overall result.\n array.response_headers = headers\n array.response_code = code\n\n array\n end",
"title": ""
},
{
"docid": "c992ab1c9be06f029fa8129bf442fdec",
"score": "0.5674002",
"text": "def groups\n data.groups\n end",
"title": ""
},
{
"docid": "5b94bde62604ca677f94bf6575d2a6d0",
"score": "0.566231",
"text": "def subgroups(group)\n subgroups = config(group)['subGroups']\n return [] if subgroups.nil?\n\n subgroups.map { |subgroup| create_instance_of('Group', subgroup) }\n end",
"title": ""
},
{
"docid": "9a19b61ee0c80c9e379f43acbc01ccd3",
"score": "0.5656006",
"text": "def subscriptions\n url = url_with_api_version(configuration.api_version, @base_url, 'subscriptions')\n response = rest_get(url)\n JSON.parse(response.body)[\"value\"].map{ |hash| Azure::Armrest::Subscription.new(hash) }\n end",
"title": ""
},
{
"docid": "35f31b3b311587b19725bc1749f5f0e6",
"score": "0.56558526",
"text": "def groups\n Group.all( {:customer_id => id} )\n end",
"title": ""
},
{
"docid": "94868e0940565157078e640b2161977b",
"score": "0.5654552",
"text": "def subgroups\n subgroups_tree.flatten || []\n end",
"title": ""
},
{
"docid": "d93fe702286f26746ed02ea7b4b1b296",
"score": "0.5644981",
"text": "def subscribed_groups\n\t\tpage = @scraper.get(@LIST_GROUPS)\n\t\tgroups = []\n\t\tpage.search('//a[@class=\"on\"]').each do |link|\n\t\t\tparts = link[:href].split(\"/\")\n\t\t\tgroups << parts[parts.length - 1]\n\t\tend\n\t\t\n\t\tgroups\n\tend",
"title": ""
},
{
"docid": "1bfebe0441f816d95210583b611601d5",
"score": "0.5641262",
"text": "def groups\n group_ids.map { |id| Group.new self, id }\n end",
"title": ""
},
{
"docid": "6e2cacc525ee1012d96836afdd5247bb",
"score": "0.5633429",
"text": "def stack_auto_scaling_groups(stack_name)\n auto_scaling_groups = Array.new()\n stack_resources = self.list_stack_resources(stack_name)\n asg_groups = stack_resources.select do |record|\n record[:resource_type] == \"AWS::AutoScaling::AutoScalingGroup\"\n end\n auto_scaling_groups.concat(asg_groups)\n substacks = stack_resources.select do |record|\n record[:resource_type] == \"AWS::CloudFormation::Stack\"\n end\n if substacks.length > 0 then\n substacks.each do |stack|\n auto_scaling_groups.concat(self.stack_auto_scaling_groups(stack[:physical_resource_id]))\n end\n end\n return auto_scaling_groups\n end",
"title": ""
},
{
"docid": "3accb6f05ae356bd04784219929f27b0",
"score": "0.56324846",
"text": "def all(options = nil)\n request = Request.new(@client)\n path = \"/subscriptions\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n a = Array.new\n body = response.body\n for v in body['subscriptions']\n tmp = Subscription(@client)\n tmp.fill_with_data(v)\n a.push(tmp)\n end\n\n return_values.push(a)\n \n\n \n return_values[0]\n end",
"title": ""
},
{
"docid": "cf02efe4cd5d15fd10702b133b60a89e",
"score": "0.56284195",
"text": "def subgroups\n return @all_groups if @all_groups\n group_and_member_entries\n @all_groups\n end",
"title": ""
},
{
"docid": "04805c173c8d7d347cc00dae0f470086",
"score": "0.5624643",
"text": "def groups\n r = Skype.send_ :command => \"search groups hardwired\", :script_name => \"\"\n r.gsub!(/^\\D+/, \"\")\n group_ids = r.split \", \"\n groups = []\n group_ids.each do |id|\n groups << Group.new(id, Group.get_type(id))\n end\n groups\n end",
"title": ""
},
{
"docid": "1b950423a0cc5514942f16ea6dde2ec1",
"score": "0.56195563",
"text": "def all\n data = service.list_subscriptions.to_h[:subscriptions] || []\n load(data)\n end",
"title": ""
},
{
"docid": "e0756324cb5cf69747f1318c6c5b0523",
"score": "0.5618311",
"text": "def groups\n @groups ||= Group.groups\n end",
"title": ""
},
{
"docid": "dd569bc978668a1ebbe5222804ee7969",
"score": "0.56155366",
"text": "def subgroups\n groups, _ = groups_and_members\n results = groups\n\n cache = load_cache(groups)\n\n loop_cached_groups(groups, cache) do |subgroups, _|\n results.concat subgroups\n end\n\n results\n end",
"title": ""
},
{
"docid": "9d1320eed64d15deb86eb9c3ef5ac222",
"score": "0.56151205",
"text": "def call\n res = client.get('/api/rest/v1/groups.json')\n\n res.map { |i| BrickFTP::Types::Group.new(**i.symbolize_keys) }\n end",
"title": ""
},
{
"docid": "2405ca278c01aca4c07be4a06aaae6af",
"score": "0.56149894",
"text": "def get_groups\n self.class.get(\"#{@url}/rest/user-management/groups\", basic_auth: @auth)\n end",
"title": ""
},
{
"docid": "7c11161bb7e4eea99145f9bb5be84fdc",
"score": "0.5612724",
"text": "def groups\n java_import org.dspace.eperson.Group;\n return Group.allMemberGroups(DSpace.context, @obj);\n end",
"title": ""
},
{
"docid": "e72aa76ff563923837a0e5c64a01e25c",
"score": "0.5609919",
"text": "def groups\n start = Time.now\n debug \"Checking group memberships for device: \\\"#{resource[:hostname]}\\\"\"\n connection = self.class.get_connection(resource[:account])\n group_list = []\n device = get_device_by_display_name(connection, resource[:display_name], 'hostGroupIds') ||\n get_device_by_hostname(connection, resource[:hostname], resource[:collector])\n if device\n device_group_ids = device['hostGroupIds'].split(',')\n device_group_filters = Array.new\n device_group_ids.each do |hg_id|\n device_group_filters << \"id:#{hg_id}\"\n end\n device_group_filters = device_group_filters.join '||'\n\n device_group_response = rest(connection,\n Puppet::Provider::Logicmonitor::DEVICE_GROUPS_ENDPOINT,\n Puppet::Provider::Logicmonitor::HTTP_GET,\n build_query_params(device_group_filters, %w(appliesTo fullPath)))\n if valid_api_response?(device_group_response,true)\n device_group_response['data']['items'].each do |device_group|\n group_list.push \"#{device_group['fullPath'].sub(/^\\//,'')}\" if nil_or_empty?(device_group['appliesTo'])\n end\n else\n alert 'Unable to get Device Groups'\n end\n else\n alert 'Unable to get Device'\n end\n\n debug \"Finished in #{(Time.now-start)*1000.0} ms\"\n group_list\n end",
"title": ""
},
{
"docid": "a850c3ac80e9cb2261c6fe37f95cca0e",
"score": "0.56096137",
"text": "def index\n @api_v1_groups = Api::V1::Group.all\n end",
"title": ""
},
{
"docid": "fe4d3106b336926943c500b69f0b51ae",
"score": "0.5607264",
"text": "def groups\n GroupModelItem.list(self.root)\n end",
"title": ""
},
{
"docid": "97d1f337978219fe75dc6272dfbe89da",
"score": "0.5604655",
"text": "def subgroups\n return [] unless combined_group?\n\n super\n end",
"title": ""
},
{
"docid": "c2b835fdc8163aefc3ff931237cdf712",
"score": "0.5600313",
"text": "def all_groups\n response = @connection.get('/groups')\n raise APIError, 'unable to retrieve list of groups from IPManager' unless response.success?\n\n response.body['groups'].map do |group|\n Group.new(key: group['key'], name: group['name'])\n end\n end",
"title": ""
},
{
"docid": "d82fe5b39e6dca094313bb799a311320",
"score": "0.5596574",
"text": "def groups\n weakref(:groups) do\n Group.list(\"memberUid=#{name}\")\n end\n end",
"title": ""
},
{
"docid": "c4e7ccb6437de7f26b4c0109e137d287",
"score": "0.5585873",
"text": "def get_groups\n `id -G #{name}`.split(' ').map {|g| Group.new(g.to_i)}\n end",
"title": ""
},
{
"docid": "c2ddb862de784fa94a6851aa2e43e9e9",
"score": "0.5580793",
"text": "def groups(access_token)\n url = 'https://api.weixin.qq.com/cgi-bin/groups/get'\\\n \"?access_token=#{access_token}\"\n Helper.http_get(url, { accept: :json }.to_json)\n end",
"title": ""
},
{
"docid": "554cc19e5f04068a886bda551ed52397",
"score": "0.55764973",
"text": "def all_request_groups_from_current_users_groups\n group_ids = self.group_ids\n request_groups = group_ids.map { |id| RequestGroup.where([\"group_id = ?\", id]) }.flatten\n end",
"title": ""
},
{
"docid": "d6f015292c3da463f184841e65a02379",
"score": "0.55764496",
"text": "def get_groups_for_select\n Group.active_only.participants_only.collect{ |g| [ g.code_and_label, g.id ]}\n end",
"title": ""
},
{
"docid": "60f6cf27651d70e1418016b584715bfc",
"score": "0.5567953",
"text": "def get_groups\n\t\tgroups = []\n\t\tself.tickets.each do |ticket|\n\t\t\tgroups << ticket.group\n\t\tend\n\t\tgroups\n\tend",
"title": ""
},
{
"docid": "565d1ad1f85f8d3c877d9fe48d6c0e4d",
"score": "0.5566469",
"text": "def groups()\n get('contactGroupList')\n end",
"title": ""
},
{
"docid": "b0aef9962da534708ac098abe5710bdf",
"score": "0.5559949",
"text": "def get_resource_group(resource_group_name)\n resource_group = nil\n\n url = \"/subscriptions/#{uri_escape(@azure_config.subscription_id)}\"\n url += \"/resourceGroups/#{uri_escape(resource_group_name)}\"\n result = get_resource_by_id(url)\n\n unless result.nil?\n resource_group = {}\n resource_group[:id] = result['id']\n resource_group[:name] = result['name']\n resource_group[:location] = result['location']\n resource_group[:tags] = result['tags']\n resource_group[:provisioning_state] = result['properties']['provisioningState']\n end\n resource_group\n end",
"title": ""
},
{
"docid": "3918f94df48503373bf4527997ec3d08",
"score": "0.5558007",
"text": "def groups\n groups = []\n\n # Reset our group list\n Etc.setgrent\n\n user = @resource[:name]\n\n # Now iterate across all of the groups, adding each one our\n # user is a member of\n while group = Etc.getgrent\n members = group.mem\n\n groups << group.name if members.include? user\n end\n\n # We have to close the file, so each listing is a separate\n # reading of the file.\n Etc.endgrent\n\n groups.join(\",\")\n end",
"title": ""
},
{
"docid": "c665f2e654a248e6f66ca240643b8bff",
"score": "0.55533177",
"text": "def resources(resource_group = nil)\n url_comps = [@base_url, 'subscriptions', configuration.subscription_id]\n url_comps += ['resourcegroups', resource_group] if resource_group\n url_comps << 'resources'\n\n url = url_with_api_version(configuration.api_version, url_comps)\n response = rest_get(url)\n\n JSON.parse(response)[\"value\"].map{ |hash| Azure::Armrest::Resource.new(hash) }\n end",
"title": ""
},
{
"docid": "37ff6ff0e18edc29f716fadca284d2ce",
"score": "0.5550579",
"text": "def list\n @groups = Group.all\n end",
"title": ""
},
{
"docid": "771796397d35310724f8df256a7fe82a",
"score": "0.55502856",
"text": "def groups\n self.class.groups\n end",
"title": ""
},
{
"docid": "ad4ee9d4e24a67b53cce628951a03cb4",
"score": "0.5533754",
"text": "def groups\n list.groups\n end",
"title": ""
},
{
"docid": "ddd0193872a0db29c1854adca4d1f46d",
"score": "0.5526433",
"text": "def account_groups\n ags = admin_account_groups.to_a\n worker_projects.each { |project|\n ags << project.account_group\n }\n return ags.compact.uniq\n end",
"title": ""
},
{
"docid": "0c4f335ecb73f544bb727f9c10d76314",
"score": "0.5523222",
"text": "def variantgroups\n @variantgroups ||= begin\n [].tap do |arr|\n fetch_paginated(\"variantgroups\", include: :variants) do |group|\n arr << group if group['siteId'].to_s == site_id.to_s\n end\n end\n end\n end",
"title": ""
}
] |
8e823715e1d96a0bbd84a44266ffd483 | Sends an arbitary gauge value for the given stat to the statsd server. | [
{
"docid": "ef7e0c1ff3c81c4a6ee76ebd52460c1d",
"score": "0.8351868",
"text": "def gauge(stat, value)\n send stat, value, GAUGE_TYPE\n end",
"title": ""
}
] | [
{
"docid": "ee5cac8c9057466ba67174de0d935b85",
"score": "0.84238493",
"text": "def gauge(stat, value, opts={})\n send_stats stat, value, :g, opts\n end",
"title": ""
},
{
"docid": "bad531ce925835bb9b376ebbec58e3ee",
"score": "0.82858676",
"text": "def gauge(stat, value)\n send_metric StatsdMetrics::GMetric.new(expand_name(stat), value)\n end",
"title": ""
},
{
"docid": "f01b0759ae66a770749c1be0437a5c1c",
"score": "0.8119461",
"text": "def gauge(stat, value, sample_rate=1)\n send_stats stat, value, :g, sample_rate\n end",
"title": ""
},
{
"docid": "f01b0759ae66a770749c1be0437a5c1c",
"score": "0.8119461",
"text": "def gauge(stat, value, sample_rate=1)\n send_stats stat, value, :g, sample_rate\n end",
"title": ""
},
{
"docid": "8d27da855f9f6eb93c8ab8b5e980f012",
"score": "0.7941973",
"text": "def gauge(stat, value, opts = EMPTY_OPTIONS)\n opts = { sample_rate: opts } if opts.is_a?(Numeric)\n send_stats(stat, value, GAUGE_TYPE, opts)\n end",
"title": ""
},
{
"docid": "d1e1f0229ab65dd1181eed1f67d1864b",
"score": "0.7591651",
"text": "def gauge(stats)\n send_stats(stats.map { |s,val|\n if @prefix\n s = \"#{@prefix}.#{s}\"\n end\n \"#{s}:#{val}|g\"\n })\n end",
"title": ""
},
{
"docid": "be3b885154f2c5a2ce0009ba63518046",
"score": "0.7107112",
"text": "def gauge(stat_or_stats, value=nil, opts=nil)\n # Can't use duck-typing here, since String responds to :map\n if stat_or_stats.is_a?(Hash)\n send_stats(stat_or_stats.map { |s,val|\n if @prefix\n s = \"#{@prefix}.#{s}\"\n end\n \"#{s}:#{val}|g\"\n })\n else\n if @prefix\n stat_or_stats = \"#{@prefix}.#{stat_or_stats}\"\n end\n send_stats(\"#{stat_or_stats}:#{value}|g\")\n end\n end",
"title": ""
},
{
"docid": "1ea676291c51f8dcfd7ad99ed94d983b",
"score": "0.66657144",
"text": "def gauge(name, value, opts={})\n send_metric('g', name, value, opts)\n end",
"title": ""
},
{
"docid": "48a0f35b73746b65de8c1e0f9121fc97",
"score": "0.6356327",
"text": "def set(stat, value, opts={})\n send_stats stat, value, :s, opts\n end",
"title": ""
},
{
"docid": "79c9086a68cfcacba0bb63e690788510",
"score": "0.6254781",
"text": "def gauge\n data[:gauge]\n end",
"title": ""
},
{
"docid": "79c9086a68cfcacba0bb63e690788510",
"score": "0.6254781",
"text": "def gauge\n data[:gauge]\n end",
"title": ""
},
{
"docid": "34ceba85b31a08cf2f5128e3893a5934",
"score": "0.6213907",
"text": "def set(stat, value)\n send_metric StatsdMetrics::SMetric.new(expand_name(stat), value)\n end",
"title": ""
},
{
"docid": "0dac24a6baef9db738770b784c9c44fb",
"score": "0.61401254",
"text": "def meter(stat, sample_rate=1)\n send_stats stat, nil, nil, sample_rate\n end",
"title": ""
},
{
"docid": "f9b0acedfefda3034f5108d2ec5a8e89",
"score": "0.6111412",
"text": "def set(stat, value, sample_rate=1)\n send_stats stat, value, :s, sample_rate\n end",
"title": ""
},
{
"docid": "a35f7186cd290802946986f39956cae8",
"score": "0.60923487",
"text": "def draw_param_gauge(x, y, width, value, stat)\n height = 3\n color = param_color(stat)\n max = StatusSettings.max_param(stat)\n min = StatusSettings.min_param(stat)\n contents.fill_rect(x + 24, y + 20, width, height, darken_color(color))\n value = [[min, value].max, max].min\n rate = (value - min).to_f / (max - min).to_f * width\n rate = width if rate > width\n contents.fill_rect(x + 24, y + 20, rate.to_i, height, color)\n end",
"title": ""
},
{
"docid": "ce4341ad54a591def02707fc59e9d6dd",
"score": "0.6076128",
"text": "def gauge(name, value, timestamp=:now, labels={})\n send_to_udp :type => :gauge,\n :name => message_name_prefix + (name || \"\"),\n :value => value,\n :timestamp => epoch_usec(timestamp),\n :labels => default_labels.merge(labels)\n end",
"title": ""
},
{
"docid": "ce4341ad54a591def02707fc59e9d6dd",
"score": "0.6076128",
"text": "def gauge(name, value, timestamp=:now, labels={})\n send_to_udp :type => :gauge,\n :name => message_name_prefix + (name || \"\"),\n :value => value,\n :timestamp => epoch_usec(timestamp),\n :labels => default_labels.merge(labels)\n end",
"title": ""
},
{
"docid": "9a07147cb68b83e4c50c3f2e1884b021",
"score": "0.603495",
"text": "def gauge\n GAUGE_EXAMPLE\n .set({vehicle: :fastest_speed_boat}, Random.rand * 9000 * 2)\n @gauge_value = GAUGE_EXAMPLE\n .get vehicle: :fastest_speed_boat\n end",
"title": ""
},
{
"docid": "20c4c8199fa80474bb43306983a1f279",
"score": "0.5968194",
"text": "def gauge(metric, value = 1, tags = [], sample_rate = 1)\n report(metric, 'g', value, tags, sample_rate)\n end",
"title": ""
},
{
"docid": "f53d82b81a1348cc17eadd78134a73fa",
"score": "0.59290385",
"text": "def set(stat, value, opts = EMPTY_OPTIONS)\n opts = { sample_rate: opts } if opts.is_a?(Numeric)\n send_stats(stat, value, SET_TYPE, opts)\n end",
"title": ""
},
{
"docid": "267eaf8ab92b19df67e126d65b75bb58",
"score": "0.5878812",
"text": "def gauge(gauge, value)\n return if gauge.nil? || gauge.empty?\n\n @repository.add_gauge(gauge, value)\n end",
"title": ""
},
{
"docid": "7182d95af2ccc7af38d1257a12d0324f",
"score": "0.57999504",
"text": "def gauge(metric, value, time = Time.now, count = 1)\n if valid?(metric, value, time, count) &&\n send_command(\"gauge\", metric, value, time.to_i, count.to_i)\n value\n else\n nil\n end\n rescue Exception => e\n report_exception(e)\n nil\n end",
"title": ""
},
{
"docid": "2988b9c3602ff97765aa621d7001b2df",
"score": "0.57698226",
"text": "def add_stat(stat, value)\n stat = stat.to_stat\n if !@stats.dig(stat)\n @stats[stat] = 0\n end\n @stats[stat] += value\n return\n end",
"title": ""
},
{
"docid": "87d2d98efb0d3a624680574817c64132",
"score": "0.5711525",
"text": "def assert_statsd_gauge(metric_name, value = nil, datagrams: nil, client: nil, **options, &block)\n expectation = StatsD::Instrument::Expectation.gauge(metric_name, value, client: client, **options)\n assert_statsd_expectation(expectation, datagrams: datagrams, client: client, &block)\n end",
"title": ""
},
{
"docid": "0c86146d80193233d46e8d1d029f95f2",
"score": "0.57112277",
"text": "def to_gauge(options = {})\n sensor.to_gauge(options)\n end",
"title": ""
},
{
"docid": "bb97b70b16dcb6a4ab84b5637dd067b2",
"score": "0.56936175",
"text": "def set(val)\n @gauge.value = val\n end",
"title": ""
},
{
"docid": "4fd1615405841541f2dcad1e678cafad",
"score": "0.56639934",
"text": "def gauge(key, value, tags = {})\n tags[:hostname] = hostname if hostname\n Appsignal.set_gauge \"sidekiq_#{key}\", value, tags\n end",
"title": ""
},
{
"docid": "4fd1615405841541f2dcad1e678cafad",
"score": "0.56639934",
"text": "def gauge(key, value, tags = {})\n tags[:hostname] = hostname if hostname\n Appsignal.set_gauge \"sidekiq_#{key}\", value, tags\n end",
"title": ""
},
{
"docid": "6a64acefe2eed9e5f9009f6d24b74377",
"score": "0.5653636",
"text": "def create_gauge(params={})\n post('/gauges', params)\n end",
"title": ""
},
{
"docid": "1982d2f1e300eef681d0e5a60bb22113",
"score": "0.56496364",
"text": "def distribution(stat, value, opts = EMPTY_OPTIONS)\n send_stats(stat, value, DISTRIBUTION_TYPE, opts)\n end",
"title": ""
},
{
"docid": "f8f9edcbcb22578f65378b1dbb7aad85",
"score": "0.5621392",
"text": "def gauge(name, value, sample_rate: nil, tags: nil, no_prefix: false)\n sample_rate ||= @default_sample_rate\n return unless sample?(sample_rate)\n emit(datagram_builder(no_prefix: no_prefix).g(name, value, sample_rate, tags))\n end",
"title": ""
},
{
"docid": "93c4521ded734980f02875c458561ca0",
"score": "0.55799395",
"text": "def gauge (pl, pi, t, ti, value) values(pl, pi, t, ti, Array(value).map{|v| [:gauge, v]}); end",
"title": ""
},
{
"docid": "79a5bb8305378ee469b2a74df1ce4061",
"score": "0.5562161",
"text": "def render_gauge(info)\n @gauge_success = info[:success].size\n @gauge_unexpected_error = info[:unexpected_error].size\n @gauge_expected_error = info[:expected_error].size\n @gauge_not_run = info[:not_run].size\n render '_confluence_gauge'\n end",
"title": ""
},
{
"docid": "21d7101f2fb4f2c083ed9f65030af1a4",
"score": "0.55145067",
"text": "def value\n @callback ? @callback.call : @gauge.value\n end",
"title": ""
},
{
"docid": "8c955a7738f6b2151fb201ab4ae9bacf",
"score": "0.54592913",
"text": "def histogram(stat, value, opts={})\n send_stats stat, value, :h, opts\n end",
"title": ""
},
{
"docid": "19775a8aac31ca78ecea2ab260b49aa6",
"score": "0.5452536",
"text": "def on_marketstat(statistics)\n send statistics \n end",
"title": ""
},
{
"docid": "4895171ce7edaaaeb55408fe60424415",
"score": "0.5396702",
"text": "def histogram(stat, value, opts = EMPTY_OPTIONS)\n send_stats(stat, value, HISTOGRAM_TYPE, opts)\n end",
"title": ""
},
{
"docid": "abd10c66085ca7347f046f3252df0a1b",
"score": "0.53956723",
"text": "def gauge(key, value, timestamp = Time.now)\n key = \"gauges:#{key}\"\n value = value.to_f\n timestamp = timestamp.to_i\n\n # Add value to filesystem store (gauges never get written to redis)\n append_value_to_file(key, value, timestamp)\n\n true\n end",
"title": ""
},
{
"docid": "f9299014ec29308c32e99db3928d457a",
"score": "0.53949654",
"text": "def draw_gauge_a(x, y, width, height, value, min, max,\n c1 = hp_gauge_color1, c2 = hp_gauge_color2)\n draw_gauge_b(x, y, width, height, value - min, max - min, c1, c2)\n end",
"title": ""
},
{
"docid": "5383b32222ea4b9fc47f2401b14d525d",
"score": "0.5370152",
"text": "def get_stats(stat)\n api_get(:stats, {:stat => stat})\n end",
"title": ""
},
{
"docid": "43ac9d575e9b062ec97ff7f06d2c4616",
"score": "0.5347385",
"text": "def gauge(text, height=0, width=0, percent=0)\n cmd = \"\"\n cmd << option_string()\n cmd << \" \"\n cmd << \"--gauge\"\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 << percent.to_s\n\n log_debug \"Command:\\n#{cmd}\"\n IO.popen(cmd, \"w\") {|fh| yield fh}\n end",
"title": ""
},
{
"docid": "94b7d0a7bd2bdc3dc0b7feaaef5284a6",
"score": "0.53261226",
"text": "def get(stat)\n value = fraggle.get(\"/stat/#{stat}\").value\n value.empty? ? 0 : value.to_i\n end",
"title": ""
},
{
"docid": "e843bd8040dabbadfce2d1c51938c452",
"score": "0.5317131",
"text": "def stats\n value = params[:value]\n metric = Metric.find(params[:metric_id])\n\n if metric.value_type == \"integer\"\n metric.update_attribute(:integer_value, value)\n elsif metric.value_type == \"knob\"\n metric.update_attribute(:integer_value, value)\n elsif metric.value_type == \"line\"\n metric.update_attribute(:decimal_value, value)\n value = metric.values.create(decimal_value: value)\n else # string and default\n metric.update_attribute(:string_value, value)\n end\n\n render xml: value\n end",
"title": ""
},
{
"docid": "02a40c5a4dfb43fff16a42870c0e4509",
"score": "0.5299333",
"text": "def gauge(text, height=0, width=0, percent=0)\n run([option_string(), '--gauge', text.inspect,\n height, width, percent].join(' ')) { |fh| yield fh }\n end",
"title": ""
},
{
"docid": "a5eaad6f8046537743168028abca3b5f",
"score": "0.529184",
"text": "def update_stat(stat, request)\n self.send(stat).create request\n end",
"title": ""
},
{
"docid": "804518d3520e667bd9562dcb1fca774a",
"score": "0.5262364",
"text": "def stat=(stat)\n if stat.nil?\n fail ArgumentError, 'invalid value for \"stat\", stat cannot be nil.'\n end\n @stat = stat\n end",
"title": ""
},
{
"docid": "13236478cfef574faee51fccacd0b51c",
"score": "0.5234634",
"text": "def incr(stat, by = 1)\n response = fraggle.get(\"/stat/#{stat}\")\n if response.value.empty? && response.rev == 0\n fraggle.set(\"/stat/#{stat}\", by.to_s)\n else\n fraggle.set(\"/stat/#{stat}\", (response.value.to_i + by).to_s, response.rev)\n end\n end",
"title": ""
},
{
"docid": "02031fc7b70e17e8d7a767d150427925",
"score": "0.52242166",
"text": "def librato_send(stats)\n if @librato_api_key.nil? || @librato_api_key.empty? || @librato_email.nil? || @librato_email.empty?\n puts \"No librato api key and email\"\n return\n end\n begin\n Librato::Metrics.authenticate(@librato_email, @librato_api_key)\n\n metrics = {}\n stats[:plugins].keys.sort.each { |name|\n result = stats[:plugins][name]\n metrics[\"dynosaur.#{@heroku_app_name}.#{name}.value\"] = result[\"value\"]\n metrics[\"dynosaur.#{@heroku_app_name}.#{name}.estimate\"] = result[\"estimate\"]\n }\n metrics[\"dynosaur.#{@heroku_app_name}.combined.actual\"] = stats[:after]\n metrics[\"dynosaur.#{@heroku_app_name}.combined.estimate\"] = stats[:estimate]\n\n Librato::Metrics.submit(metrics)\n rescue Exception => e\n puts \"Error sending librato metrics\"\n puts e.message\n end\n end",
"title": ""
},
{
"docid": "f22704e7bf3fb007063ae4bcb15d2006",
"score": "0.5221995",
"text": "def ziya_gauge( url, gauge_options={} )\n options = { :width => \"200\",\n :height => \"200\",\n :align => \"middle\",\n :scale => \"noscale\",\n :salign => \"\",\n :class => \"\", \n :id => \"ziya_gauge\",\n :swf_path => gauge_path,\n :use_cache => false,\n :timeout => false,\n :retry => 2,\n :use_stage => false\n }.merge!(gauge_options)\n \n generate_old_style_flash_tag( url, gauges_swf, options )\n end",
"title": ""
},
{
"docid": "49075d851fa4944f239787bc88a0449b",
"score": "0.521103",
"text": "def ez_value(stat_name, value)\n ez(stat_name, {:value => value})\n end",
"title": ""
},
{
"docid": "bc5a7189b690e484f40e2ea9ba4965e9",
"score": "0.52096623",
"text": "def add_stat(_stat)\n @stats << _stat\n end",
"title": ""
},
{
"docid": "7bc48e431a79bfa8a5f367afc5c2c775",
"score": "0.5181594",
"text": "def gauge\nHTTP_COUNTER.increment\n respond_to do |r|\n r.any do\n render json: {\n message: \"Success\",\n }, status: 200\n end\n end\n end",
"title": ""
},
{
"docid": "ceb297bc923b11068ce35aea50935a0b",
"score": "0.5179886",
"text": "def gauge(metric_name, count, options={})\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "c2c8f9d7bb57d6c6fb028739bcd20e3c",
"score": "0.51660013",
"text": "def create(attributes)\n connection.post(path_prefix, attributes).body['gauge']\n end",
"title": ""
},
{
"docid": "87b68b77bfa6e6724407118c552cc69c",
"score": "0.5144116",
"text": "def gauge(path, value, tags = nil)\n gauge = { path: path, ts: Time.now.to_i, value: value }\n gauge[:tags] = tags if tags\n @buf[:gauges] << gauge\n end",
"title": ""
},
{
"docid": "b2364c13a556aa7246f707763ac481f3",
"score": "0.51422167",
"text": "def draw_gauge_b(x, y, width, height, value, max,\n c1 = hp_gauge_color1, c2 = hp_gauge_color2)\n y += line_height - height\n contents.fill_rect(x, y, width, height, gauge_back_color)\n rate = value.to_f / max.to_f\n gw = (rate * width).to_i\n contents.gradient_fill_rect(x, y, gw, height, c1, c2)\n end",
"title": ""
},
{
"docid": "3f324cdf66dc1973e9def8cf247bef31",
"score": "0.5130097",
"text": "def to_gauge(options = {})\n data = self.to_gauge_data\n options = {\n minorTicks: 5,\n version: 'current'\n }.merge!(options)\n GoogleVisualr::Interactive::Gauge.new(data, options)\n end",
"title": ""
},
{
"docid": "64a0f3d7a4dc641459dc488668e8e706",
"score": "0.512494",
"text": "def statistic\n\t @gstat\n\t end",
"title": ""
},
{
"docid": "be3fdd8a1111a9dcda24287c47eda0f8",
"score": "0.5123496",
"text": "def draw_progress_bar(x, y, width, height)\n max = @achievement.max_value\n val = @achievement.value\n val = [max, val].min\n xa = x + width / 2\n contents.fill_rect(xa, y + (height * 2 / 3), width, height / 3, gauge_back_color)\n per = val * width / max\n contents.gradient_fill_rect(xa, y + (height * 2 / 3), per, height / 3, mp_gauge_color1, mp_gauge_color2)\n draw_text(xa, y, width, height, sprintf(\"%d/%d\", val, max), 1)\n end",
"title": ""
},
{
"docid": "440236b5b517cc6ffc153cd14cee0adc",
"score": "0.5099524",
"text": "def timer(stat, millis, sample_rate=1)\n send_stats stat, millis, :ms, sample_rate\n end",
"title": ""
},
{
"docid": "face287bc13f45f46f6586f91cf800b3",
"score": "0.5085057",
"text": "def send_event_to_statsd(name, payload)\n action = payload[:action] || :increment\n measurement = payload[:measurement]\n value = payload[:value]\n key_name = \"#{name.to_s.capitalize}.#{measurement}\"\n $statsd.__send__ action.to_s, key_name, (value || 1)\nend",
"title": ""
},
{
"docid": "561d15c52a6e5be5c149188edcf2033b",
"score": "0.5072227",
"text": "def send_to_statsd(metric)\n @logger.debug{ \"#{self.class} #{prefix} sending #{metric} to #{@host}:#{@port}\" }\n socket.send_datagram metric, @host, @port\n end",
"title": ""
},
{
"docid": "50dcd06256300d94d0a35906ecf27e0c",
"score": "0.5063732",
"text": "def on_stat( stat, emit_event = true )\n orig_stat = update_stat( stat )\n logger.debug \"Emitting event for #{stat}\"\n emit_event_for( orig_stat, stat ) if emit_event\n end",
"title": ""
},
{
"docid": "ade055586ee462b9772e5c17173a2009",
"score": "0.50582415",
"text": "def set_gauge\n @gauge = Gauge.find(params[:id])\n end",
"title": ""
},
{
"docid": "1f11128f5afab9c5ae2a35aa4146b633",
"score": "0.50538",
"text": "def timing(metric, duration)\n @client.gauge prepare(metric), duration\n end",
"title": ""
},
{
"docid": "094b672abf4bb02594d8013f539caa40",
"score": "0.50372446",
"text": "def query_stats(gauge_ids: [], counter_ids: [], avail_ids: [], rates: false, starts: nil, ends: nil,\n bucket_duration: '3600s')\n path = '/metrics/stats/query'\n metrics = { gauge: gauge_ids, counter: counter_ids, availability: avail_ids }\n data = { metrics: metrics, start: starts, end: ends, bucketDuration: bucket_duration }\n data['types'] = %w[gauge gauge_rate counter counter_rate availability] if rates\n http_post(path, data)\n end",
"title": ""
},
{
"docid": "73fec2ac84dbff7ee3e8d7ab0f798ec9",
"score": "0.5027532",
"text": "def draw_state_gauge(actor, state, x, y)\n steps = actor.remaining_state_steps(state.id)\n width = 20\n x += 2\n y += 20\n height = BAR_HEIGHT\n color = Color.new(Colore[0],Colore[1],Colore[2],Colore[3])\n bg_color = Color.new(Sfondo[0],Sfondo[1],Sfondo[2],Sfondo[3])\n border_color = Color.new(Bordo[0], Bordo[1], Bordo[2], Bordo[3])\n rate = steps.to_f/state.actor_duration.to_f\n fill_width = width * rate\n contents.fill_rect(x-1, y-1, width+2, height+2, border_color)\n contents.fill_rect(x, y, width, height, bg_color)\n contents.fill_rect(x, y, fill_width, height, color)\n end",
"title": ""
},
{
"docid": "96d4a2a617107c449a15faa8cd7bf14e",
"score": "0.5025161",
"text": "def gauge( class_name )\n \"--- #{clazz( class_name, 'Gauges' )}\\n#{dials}\" \n end",
"title": ""
},
{
"docid": "96d4a2a617107c449a15faa8cd7bf14e",
"score": "0.5025161",
"text": "def gauge( class_name )\n \"--- #{clazz( class_name, 'Gauges' )}\\n#{dials}\" \n end",
"title": ""
},
{
"docid": "8e827964f87e1da9b2a6d4023fac41ba",
"score": "0.50160134",
"text": "def histogram(stat, value, sample_rate=1); send stat, value, HISTOGRAM_TYPE, sample_rate end",
"title": ""
},
{
"docid": "e582eb6f92a4a291f9e6330331d42eb0",
"score": "0.5005693",
"text": "def histo(stat, value, sample_rate=1)\n send_stats stat, value, :h, sample_rate\n end",
"title": ""
},
{
"docid": "9c4f52c44a48b0b3a2e9fa9ce4a6a39d",
"score": "0.4997513",
"text": "def update\n respond_to do |format|\n if @gauge.update(gauge_params)\n format.html { redirect_to @gauge, notice: 'Gauge was successfully updated.' }\n format.json { render :show, status: :ok, location: @gauge }\n else\n format.html { render :edit }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2d3308e00296c3b0b22577681ab2b69",
"score": "0.49635938",
"text": "def increment_stat(stat_name)\n if stats[stat_name]\n stats[stat_name] += 1\n else\n stats.merge!({ stat_name => 1 })\n end\n save_stats\n end",
"title": ""
},
{
"docid": "344cb82d8f6cc0e0f31d560c254745ee",
"score": "0.49009508",
"text": "def stat(name)\n Hurl.redis.incr(\"Hurl:stats:#{name}\")\n end",
"title": ""
},
{
"docid": "402a29d5fb082e09f5914320c291ee60",
"score": "0.48859438",
"text": "def set_stat_value(control, value)\n if value >= 0\n control.font.color = Color.power_up_color\n control.text = SHOP_CONFIG::POWERUP_SYMBOL + value.abs.to_s\n else\n control.font.color = Color.power_down_color\n control.text = SHOP_CONFIG::POWERDOWN_SYMBOL + value.abs.to_s\n end\n end",
"title": ""
},
{
"docid": "402a29d5fb082e09f5914320c291ee60",
"score": "0.48859438",
"text": "def set_stat_value(control, value)\n if value >= 0\n control.font.color = Color.power_up_color\n control.text = SHOP_CONFIG::POWERUP_SYMBOL + value.abs.to_s\n else\n control.font.color = Color.power_down_color\n control.text = SHOP_CONFIG::POWERDOWN_SYMBOL + value.abs.to_s\n end\n end",
"title": ""
},
{
"docid": "934689f643b42813b15a42c55066b5f6",
"score": "0.48789784",
"text": "def to_gauge_data\n chart_data = GoogleVisualr::DataTable.new\n chart_data.new_column('string', 'Label')\n chart_data.new_column('number', 'Value')\n\n row =\n if temperature_sensor_statuses.length.zero?\n [\n 'NO DATA', 0\n ]\n else\n [\n temperature_sensor_statuses.last.state,\n temperature_sensor_statuses.last.temperature\n ]\n end\n chart_data.add_row(row)\n\n chart_data\n end",
"title": ""
},
{
"docid": "113f3b102bf6859aad41585838996c76",
"score": "0.48585162",
"text": "def gauge_divisor\n data[:gauge_divisor]\n end",
"title": ""
},
{
"docid": "113f3b102bf6859aad41585838996c76",
"score": "0.48585162",
"text": "def gauge_divisor\n data[:gauge_divisor]\n end",
"title": ""
},
{
"docid": "b6aa36ae3f7fdde79ba94f7f09c3bc71",
"score": "0.4855107",
"text": "def update_progress(progress, file_stat)\n logger.debug(\"Setting Progress #{progress} for ID #{file_stat._id}\")\n file_stat.update(progress: progress)\n end",
"title": ""
},
{
"docid": "d67bb4dbdfb3ccce4442a2eceae8d390",
"score": "0.4834088",
"text": "def avarage_stat(stat)\n value = 0\n for target in @enemies\n value += eval(\"target.#{stat}\")\n end\n value /= [@enemies.size, 1].max\n return value\n end",
"title": ""
},
{
"docid": "b9fa7c54ac44dbfcbb71c3a6903a72a9",
"score": "0.4829506",
"text": "def draw_recharge_gauge(actor, x, y)\n rmax = actor.recharge_max\n rec = actor.recharge_status\n width = rec * BarL / rmax\n if rec >= rmax\n c1 = power_up_color\n c2 = power_up_color\n text = Vocab.ready_dom\n else\n c1 = mp_gauge_color1\n c2 = mp_gauge_color2\n text = sprintf(Vocab.rec_dom, rec, rmax)\n end\n draw_text(x, y, self.width - x - 16, line_height, text)\n contents.fill_rect(x, y + line_height, BarL, BarH, gauge_back_color)\n contents.gradient_fill_rect(x, y + line_height, width, BarH, c1, c2)\n end",
"title": ""
},
{
"docid": "fda8f4ddb911cf738ef3b4c985b49c30",
"score": "0.48279163",
"text": "def update\n respond_to do |format|\n if @measurement_gauge.update(measurement_gauge_params)\n format.html { redirect_to @measurement_gauge, notice: 'Данные сохранены' }\n format.json { render :show, status: :ok, location: @measurement_gauge }\n else\n format.html { render :edit }\n format.json { render json: @measurement_gauge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3590bc1dfc42cd7ff6947207e1be6f03",
"score": "0.48128897",
"text": "def send(url, timestamp, amount)\n headers = {\n 'Content-Type' => 'application/json',\n 'Authorization' => \"OAuth #{API_KEY}\",\n }\n if url\n begin\n data = {\n data: {\n timestamp: timestamp,\n value: amount,\n },\n }\n REST.post(url, data.to_json, headers) do |http|\n http.open_timeout = 5\n http.read_timeout = 5\n end\n rescue REST::Error => e\n $stderr.puts \"[Warning] Timeout when sending stats with #{data}: #{e.message}.\"\n end\n end\n rescue StandardError => e\n $stderr.puts \"[Warning] #{e.inspect}: #{e.backtrace}\"\n end",
"title": ""
},
{
"docid": "6c96ccdddf22007a366305812a7bcc3a",
"score": "0.4794111",
"text": "def send( to, value ) ## address to, uint256 valueInmGAV\r\n if @balances[msg.sender] >= value\r\n @balances[to] += value\r\n @balances[msg.sender] -= value\r\n end\r\n end",
"title": ""
},
{
"docid": "aabb1b1cdcff6e482396643f3049a1e2",
"score": "0.478569",
"text": "def update\n respond_to do |format|\n if @attivita_consolidata_gauge.update(attivita_consolidata_gauge_params)\n format.html { redirect_to @attivita_consolidata_gauge, notice: 'Attivita consolidata gauge was successfully updated.' }\n format.json { render :show, status: :ok, location: @attivita_consolidata_gauge }\n else\n format.html { render :edit }\n format.json { render json: @attivita_consolidata_gauge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c31c30d73d4efd7d12d844542cadb7a9",
"score": "0.47739395",
"text": "def update\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n if @gauge.update_attributes(gauge_params)\n format.html { redirect_to gauges_path, notice: 'Instrument was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fefb1a5821d2cc595fc279e7aef7d5b0",
"score": "0.47693288",
"text": "def gauge(name, &block)\n @registry.register(name, block.to_java(com.codahale.metrics.Gauge))\n end",
"title": ""
},
{
"docid": "155e8dde78cc2d7cbd7fcd1f343b1583",
"score": "0.47567114",
"text": "def receive_gold(g)\n data.ext[:gold] += g\n end",
"title": ""
},
{
"docid": "da67bda128025c82317238f543485783",
"score": "0.47498196",
"text": "def send_stats\n render json: { rate: user.success_rate_stats,\n stats: quiz.progress_stats,\n quizzes: user.total_quizzes_stats }\n end",
"title": ""
},
{
"docid": "766fb61f984dd0e707b201248c7221a8",
"score": "0.4744514",
"text": "def update_stats(active_game)\n\n player_stat.update_stats(active_game)\n\n end",
"title": ""
},
{
"docid": "7c5e101fd7462ae24fb719e433875050",
"score": "0.4743757",
"text": "def total_stat(r,stat)\n total_stat = (\"total_\" + stat + \"=\").to_sym\n stat_per_level = r.send((stat + \"_per_level\").to_sym)\n base = r.send(stat.to_sym)\n total = base + (stat_per_level * 18.0)\n r.send(total_stat, total)\nend",
"title": ""
},
{
"docid": "54622104d124986c0bb5a0296e3903fa",
"score": "0.47343552",
"text": "def set_stat(k,v)\n s = self.stat(k,false)\n unless s\n s = UserStat.new({\n :user => self,\n :name => k.to_s,\n :value => 0,\n })\n end\n s.value = v\n s.save\n end",
"title": ""
},
{
"docid": "b2d02a55a81abd4b6ae7b85d326739a1",
"score": "0.4727376",
"text": "def get(stat)\n data_store.stat(stat)\n end",
"title": ""
},
{
"docid": "2798ab2cdd689e2a726b8823d35183dc",
"score": "0.47218433",
"text": "def metric name, value\n message = \"put #{name} #{Time.now.to_i} #{value} host=#{Socket.gethostname}\"\n\n socket = TCPSocket.new @host, @port\n socket.write message\n socket.close\n\n message\n end",
"title": ""
},
{
"docid": "fa73afdbb0a042cac6cdd2550d6908aa",
"score": "0.47200176",
"text": "def draw_mp_gauge(x, y, width, height)\n contents.fill_rect(x, y, width, height, gauge_back_color)\n mp_rate = alchemist.mp_rate\n cs_rate = (product.mp_cost.to_f * @quantity) / alchemist.mmp\n contents.fill_rect(x, y, width, height, gauge_back_color)\n contents.fill_rect(x, y, mp_rate * width, height, mp_gauge_color2)\n contents.fill_rect(x, y, cs_rate * width, height, knockout_color)\n end",
"title": ""
},
{
"docid": "74c8ee04cca2e2047449dbdcc0811459",
"score": "0.4713145",
"text": "def received\n Log.debug(\"Incrementing total stat\")\n @total += 1\n end",
"title": ""
},
{
"docid": "9b27b7a1c223ddf6502b3c90e4334592",
"score": "0.47125697",
"text": "def add_bonus_stat(stat, amount)\n return if stat == nil || amount == nil\n @added_stats[stat] += amount\n end",
"title": ""
},
{
"docid": "64ffac28b78bcab44743c0c7b9e68349",
"score": "0.4711954",
"text": "def gauge_description\n data[:gauge_description]\n end",
"title": ""
},
{
"docid": "64ffac28b78bcab44743c0c7b9e68349",
"score": "0.4711954",
"text": "def gauge_description\n data[:gauge_description]\n end",
"title": ""
}
] |
e4721dd8100a8b8aad611c0dab6898c2 | Log a debugging message, if the proper environment flag was specified. | [
{
"docid": "deff78e82c33e14b8f688d4647ffd648",
"score": "0.63118905",
"text": "def debug(message)\n return if quiet?\n say('[DEBUG] ' + message, :yellow) if $DEBUG\n end",
"title": ""
}
] | [
{
"docid": "c4946e79ef3d6f52338a9d62e74b2fa9",
"score": "0.73792356",
"text": "def debug(message)\n warn \"==== VLO DEBUG: \" + message if ENV[\"VLO_DEBUG\"] == 'true'\nend",
"title": ""
},
{
"docid": "78d4458951238539ba7faec91e850490",
"score": "0.7206642",
"text": "def log(msg)\n if ENV['LAUNCHY_DEBUG'] == 'true' then\n $stderr.puts \"LAUNCHY_DEBUG: #{msg}\"\n end\n end",
"title": ""
},
{
"docid": "1becc11adbb3ed8913e645b32a0e6972",
"score": "0.713974",
"text": "def debug(message)\n stdout.print(\"#{message}\\n\") if ENV['DEBUG']\n end",
"title": ""
},
{
"docid": "9a86098b9e9837ce3872f29e50455e08",
"score": "0.70302606",
"text": "def debug(message)\n if DEBUG\n log message\n end\nend",
"title": ""
},
{
"docid": "576898eedf7a96c296397c496f18a002",
"score": "0.6971216",
"text": "def debug=(flag)\n ENV['debug'] = nil\n ENV['DEBUG'] = flag.to_s\n end",
"title": ""
},
{
"docid": "d84ac05b3c49a5b4b56fc9217594658e",
"score": "0.6806427",
"text": "def debug(message)\n puts message if debug?\n end",
"title": ""
},
{
"docid": "f8fb2cb454391ad91c3f5b3506cd5b41",
"score": "0.6787162",
"text": "def debug(message, options = { })\n unless ENV['GUARD_ENV'] == 'test'\n reset_line if options[:reset]\n STDERR.puts color(\"DEBUG (#{Time.now.strftime('%T')}): \", :yellow) + message if ::Guard.options && ::Guard.options[:debug]\n end\n end",
"title": ""
},
{
"docid": "ba53ad6384fb515e4b98852d44fd8a85",
"score": "0.6763023",
"text": "def debug(message)\n $stderr.puts(message) if @options[:debug]\nend",
"title": ""
},
{
"docid": "f3a355a9d7ffe84e6794af48b0e3ab78",
"score": "0.67612493",
"text": "def debug(message = nil)\n log(:debug, message) unless message.nil?\n end",
"title": ""
},
{
"docid": "592e4a630a52c6c12fbd732980358a85",
"score": "0.6748779",
"text": "def log(message)\n puts message unless ENV['RUBY_ENV'] == 'test'\n end",
"title": ""
},
{
"docid": "8b544912bd3257a191b6684d9609154f",
"score": "0.6681052",
"text": "def debug_msg(msg)\n if(@options[:debug])\n @log.puts(msg)\n puts msg\n end\nend",
"title": ""
},
{
"docid": "baae69b567d35230377d7bff8fece0e1",
"score": "0.66730356",
"text": "def log(msg)\n puts msg unless ENV['TEST']\n end",
"title": ""
},
{
"docid": "cf1ee45ba84f927f9683c00c6a8dd674",
"score": "0.66488445",
"text": "def debug_msg msg\n puts msg if @options[:debug]\n end",
"title": ""
},
{
"docid": "27bff51777c2d937efdbd3de47820e83",
"score": "0.6647489",
"text": "def debug(message)\n log(0, message)\n end",
"title": ""
},
{
"docid": "e319bd055d787039f4c3224f17d91262",
"score": "0.66376114",
"text": "def log(msg)\n puts(msg) if @info_values['enable_debug_logging'] == \"Yes\"\n end",
"title": ""
},
{
"docid": "23f826ae7529f7d2bcfe697543f9957f",
"score": "0.66208714",
"text": "def say_debug(message)\n puts yellow(message) if self.debug\n end",
"title": ""
},
{
"docid": "4523cca554587147c26f53a16f431cb5",
"score": "0.6616714",
"text": "def debug(message)\n $stdout.puts \"D #{message}\" if @debug\n end",
"title": ""
},
{
"docid": "c8f13efcd6c3333601a3d4b447a703c6",
"score": "0.6603988",
"text": "def debug(msg=nil)\n log \"DEBUG: #{msg}\" if $debug\n end",
"title": ""
},
{
"docid": "f9a14c961271936dd74566146242f065",
"score": "0.65772754",
"text": "def debug_msg(msg=\"\")\n if(@config.debug)\n puts(\"Debug: #{msg}\")\n @file.puts(\"Debug: #{msg}\")\n end\n end",
"title": ""
},
{
"docid": "40f74bc66fcf33191febdc5fcede3919",
"score": "0.6571402",
"text": "def debug(message)\n return unless debugging?\n\n logger.debug(message.to_s)\n nil\n end",
"title": ""
},
{
"docid": "08616cff4b8c08db0580969e243f8216",
"score": "0.6518046",
"text": "def debug(message)\n logger.debug(message) if logger\n end",
"title": ""
},
{
"docid": "cd42bbd727e1db82eeadf3b7104555d6",
"score": "0.65095526",
"text": "def debug(message)\n logger.debug(PROG_NAME) { message }\n end",
"title": ""
},
{
"docid": "e4b526d2382026a21ca46909b91c78e6",
"score": "0.65052867",
"text": "def log_debug(log_entry = \"\")\n entry(Gml::LOG_LEVEL_DEBUG, log_entry, 1)\n end",
"title": ""
},
{
"docid": "0da4e3b213ffa9a1478d4f9910bdbb92",
"score": "0.64909714",
"text": "def debug(msg)\n STDERR.puts msg if options.key? :debug\n end",
"title": ""
},
{
"docid": "3a737edac3099eb79824dbac2776f8e7",
"score": "0.648901",
"text": "def debug(message = \"\", level = 5)\n if $config[:global][:verboselevel] and $config[:global][:verboselevel] >= level\n puts message \n\t\t#logger.info(message)\n Syslog.info(message)\n end\nend",
"title": ""
},
{
"docid": "64a6f540071c625998c9eb82a5159e13",
"score": "0.64786464",
"text": "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend",
"title": ""
},
{
"docid": "64a6f540071c625998c9eb82a5159e13",
"score": "0.64786464",
"text": "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend",
"title": ""
},
{
"docid": "64a6f540071c625998c9eb82a5159e13",
"score": "0.64786464",
"text": "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend",
"title": ""
},
{
"docid": "d043dcaae28bd5131c2de15f8391937a",
"score": "0.6477416",
"text": "def debug message, opts = {}, &block\n log message, opts.merge(:debug => !opts[:log]), &block\n end",
"title": ""
},
{
"docid": "630ac037507134824b1afbb5e9e84f1f",
"score": "0.64572424",
"text": "def debug(message)\n puts \"#{Time.now.strftime(\"%H:%M:%S.%L\")} - \\t#{message}\" if DEBUG\nend",
"title": ""
},
{
"docid": "e89d8046e16dd933b4f24e303a604c37",
"score": "0.6455117",
"text": "def log_debug(debug_message)\n logger.debug(debug_message)\n end",
"title": ""
},
{
"docid": "e89d8046e16dd933b4f24e303a604c37",
"score": "0.6455117",
"text": "def log_debug(debug_message)\n logger.debug(debug_message)\n end",
"title": ""
},
{
"docid": "b0debee007294d906a1f4e0e0f4d15a5",
"score": "0.6453048",
"text": "def debug (msg = \"\")\n if Object.const_defined?('Puppet')\n Puppet.debug msg\n else\n if ENV['FACTER_DEBUG'] == 'true'\n $stdout.puts msg\n $stdout.flush\n end\n end\nend",
"title": ""
},
{
"docid": "d4334ec7e7c5724ecb272e7a94b304ed",
"score": "0.64436144",
"text": "def debug(message) ; @log.debug(message) ; end",
"title": ""
},
{
"docid": "4be0755013ab5ac6780ab083e4f5cabc",
"score": "0.64168507",
"text": "def debug (msg = \"\")\n if Object.const_defined?('Puppet')\n Puppet.debug 'facter(extra_modulepath):'+msg\n else\n if ENV['FACTER_DEBUG'] == 'true'\n $stdout.puts msg\n $stdout.flush\n end\n end\nend",
"title": ""
},
{
"docid": "d4990a3dee66ad5d0c7f5197bb842490",
"score": "0.6413411",
"text": "def debug_on(debug=true)\n ap \"Debugging is ON\"\n @debug = debug\n end",
"title": ""
},
{
"docid": "4ba334b1d73e84f4d2328f89fcc1a7e9",
"score": "0.6402828",
"text": "def log_debug(*debug_infos)\r\n options = debug_infos.extract_options!\r\n options[:development_only] ||= true\r\n\r\n if options[:development_only]\r\n if Rails.env != 'production'\r\n infos = create_info_log_string debug_infos\r\n end\r\n else\r\n infos = create_info_log debug_infos\r\n end\r\n\r\n if options[:write_to] && options[:write_to].to_sym == :error\r\n $log.error infos.join(\"\\n\")\r\n else\r\n $arb_log.info infos.join(\"\\n\")\r\n end\r\nend",
"title": ""
},
{
"docid": "345043faa7e0c899d2272c69eecc04f7",
"score": "0.63914526",
"text": "def debugging?\n ENV['DEBUG'] && ENV['DEBUG'] != ''\nend",
"title": ""
},
{
"docid": "7909333fb7a830b43a9446b3db20bc64",
"score": "0.6377241",
"text": "def debug(msg)\n STDERR.puts msg if @debug\n end",
"title": ""
},
{
"docid": "95164327bdc44ae4150f513a52c2a2a5",
"score": "0.63549405",
"text": "def debug(msg) log(7, msg); end",
"title": ""
},
{
"docid": "9476fd6d4bb2097d7bda3bce788d6f7e",
"score": "0.63509345",
"text": "def debugging(debug_bool)\n Facter::Options[:debug] = debug_bool\n end",
"title": ""
},
{
"docid": "6aa8d8ce870f97673b90ff469e1ff654",
"score": "0.63398933",
"text": "def debug(msg)\n puts \"[watchr debug] #{msg}\" if options.debug\n end",
"title": ""
},
{
"docid": "3ef5b4e3a5f7d58f5f4167d991bdfc51",
"score": "0.6330114",
"text": "def debug_out(debmsg)\n if $gDebug\n puts debmsg\n end\n if ($gTest_params[\"logfile\"])\n $fLOG.write(debmsg)\n end\nend",
"title": ""
},
{
"docid": "393b1f5ea458c884bcb1f9a4ab63fc7a",
"score": "0.632614",
"text": "def log_debug(message) # :nodoc:\n @logger.debug(message) if @logger\n end",
"title": ""
},
{
"docid": "39721bea94bcc3c8ddee9c6a97db91d7",
"score": "0.6321309",
"text": "def setDebugFlag(flag)\n\t\t\t@_debug_flag = flag\n\t\tend",
"title": ""
},
{
"docid": "428065cbcae2dc724e4dcd11d1e04968",
"score": "0.6310888",
"text": "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend",
"title": ""
},
{
"docid": "428065cbcae2dc724e4dcd11d1e04968",
"score": "0.6310888",
"text": "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend",
"title": ""
},
{
"docid": "3e31497d2818adb7744395e745fb1e34",
"score": "0.6301962",
"text": "def log_debug(message)\n Rails.logger.debug message\n puts message\n end",
"title": ""
},
{
"docid": "bfeabda888676b7b14fd6371633b4e71",
"score": "0.6295643",
"text": "def debug message; write DEBUG, message, caller[0] unless level > @level end",
"title": ""
},
{
"docid": "37082ce2db01b687d96629136954efb3",
"score": "0.62947506",
"text": "def debug_out(debmsg)\n if $gDebug \n puts debmsg\n end\n if ($gTest_params[\"logfile\"])\n $fLOG.write(debmsg)\n end\nend",
"title": ""
},
{
"docid": "96ca4a97b047f8d0a987620174edb849",
"score": "0.6290585",
"text": "def debug_message(message)\n logger.debug \"**** - #{message}\"\n end",
"title": ""
},
{
"docid": "3320bbdc2ca823a9dcbfe0a8b23a7450",
"score": "0.62662154",
"text": "def log(message)\n @@logger.debug(message) unless Rails.env.test?\n end",
"title": ""
},
{
"docid": "eac7027b754fcc96d4d18a08e2a77eb7",
"score": "0.62572",
"text": "def debug string\n puts string if $DEBUG\nend",
"title": ""
},
{
"docid": "15a786e4f58a4d212617395a5c816043",
"score": "0.62390816",
"text": "def debug(s) if $DEBUG then $stderr.print(\"#{s}\\n\") end end",
"title": ""
},
{
"docid": "15cd057971324fd43c80eced5686849d",
"score": "0.6231863",
"text": "def log_debug(message)\n return message\n end",
"title": ""
},
{
"docid": "dc8ca507e4f58e730ddc0824c6e78170",
"score": "0.6230933",
"text": "def debug_msg( str )\n puts str if @debug == true\n end",
"title": ""
},
{
"docid": "089855360e14af6c229dde0e9125397e",
"score": "0.6177562",
"text": "def debug(msg); @logger.debug(msg); end",
"title": ""
},
{
"docid": "04b514bd90c934cd3146bf4633af8e72",
"score": "0.6142535",
"text": "def debug_mode=(flag)\r\n self.conf[:debug] = flag\r\n end",
"title": ""
},
{
"docid": "d126cc3f6e25ccdf84bdebb4a194c008",
"score": "0.6132354",
"text": "def debug(msg)\n log.debug msg\n end",
"title": ""
},
{
"docid": "d81c1a4196b82aecfda29fa6420724cf",
"score": "0.6125622",
"text": "def debug(message)\n ostream.puts message if $DEBUG\n end",
"title": ""
},
{
"docid": "bc9d9837ba4ed1d7964e51af224bfebe",
"score": "0.61210173",
"text": "def debug_logging=(value)\n if value\n log.level = Logger::DEBUG\n elsif log.is_a?(Datadog::Logger)\n log.level = Logger::WARN\n end\n end",
"title": ""
},
{
"docid": "25c5d48294a55bbcc3d5443907356b79",
"score": "0.6119505",
"text": "def debug=(val)\n Handsoap::Service.logger = (val ? $stdout : nil)\n @@debug = val\n end",
"title": ""
},
{
"docid": "5a716ba77a00d7c252c60cad4b62d6af",
"score": "0.61176294",
"text": "def debug_message message\n if @quiet\n # noop\n \":\"\n else\n \">&2 echo #{DEBUG_HEADER} #{message}\"\n end\n end",
"title": ""
},
{
"docid": "70e0079c90f39af47c880814310802df",
"score": "0.61133885",
"text": "def debug?\n severity == :DEBUG\n end",
"title": ""
},
{
"docid": "46a211570ae6a4d4dfe3c784249486ad",
"score": "0.6098818",
"text": "def dlog(*args)\n if development?\n $stdout.puts \"\\n================================================\\n\"\n for arg in args\n $stdout.puts arg\n $stdout.puts \"================================================\\n\"\n end\n end\n end",
"title": ""
},
{
"docid": "0643acb53ccb3a85379747d1167615c9",
"score": "0.60944027",
"text": "def logDebug(message)\n found = false\n if ($logMessages)\n\tlogServer = get($serverPath+'log')\n\tif (logServer != nil)\n\t\tlogServer.debug(message)\n\t\tfound = true\n\tend\n end\n if (!found or !$logMessages or $printAllMessages)\n\tprint(message)\n end\n\nend",
"title": ""
},
{
"docid": "6bb58e29f4b81292c7f9879ca165bdf6",
"score": "0.60941637",
"text": "def debug(msg)\r\n prelog\r\n logger.debug(msg)\r\n end",
"title": ""
},
{
"docid": "bfdcdaa19eebd5b4ef34a4eb3fffa60f",
"score": "0.60822755",
"text": "def debug_msg( *msg )\n\t\treturn unless $DEBUG\n\t\t$stderr.puts( *msg )\n\tend",
"title": ""
},
{
"docid": "bfdcdaa19eebd5b4ef34a4eb3fffa60f",
"score": "0.60822755",
"text": "def debug_msg( *msg )\n\t\treturn unless $DEBUG\n\t\t$stderr.puts( *msg )\n\tend",
"title": ""
},
{
"docid": "714e37dfb61b901207a74bd6c7b257ae",
"score": "0.60704845",
"text": "def puts_debug(msg)\r\n if (self.debug) \r\n puts msg\r\n end # end debug\r\n end",
"title": ""
},
{
"docid": "714e37dfb61b901207a74bd6c7b257ae",
"score": "0.60704845",
"text": "def puts_debug(msg)\r\n if (self.debug) \r\n puts msg\r\n end # end debug\r\n end",
"title": ""
},
{
"docid": "ccaa0a6e5d7bb421a6387a57bf5e212f",
"score": "0.60680115",
"text": "def debug!\n self.severity = :DEBUG\n end",
"title": ""
},
{
"docid": "2d43eaba1a58eb290ed822059d43f339",
"score": "0.60623723",
"text": "def debug?; run_options[:debug]; end",
"title": ""
},
{
"docid": "09a96ee74c0cb70296806802d5aca304",
"score": "0.60562414",
"text": "def debug(message)\n asl_log(@aslclient, @aslmsg, ASL_LEVEL_DEBUG, message)\n end",
"title": ""
},
{
"docid": "d22883c3113e193c54199d84a0ca50ab",
"score": "0.60511625",
"text": "def debug_request(flag='on', *_)\n case flag.downcase\n when \"off\", \"false\", \"0\", \"nil\"\n @debug = false\n else\n @debug = true\n end\n end",
"title": ""
},
{
"docid": "fff488bb47a016acd490d2723ac3e046",
"score": "0.60495204",
"text": "def debug(msg = \"\")\n puts \"\\n\\n\\n\"\n puts \" DEBUGGING \".white.on_red\n puts msg\n puts \"\\n\\n\\n\"\n exit\n end",
"title": ""
},
{
"docid": "752ca09d1d12249aa5606d22404d9794",
"score": "0.6041576",
"text": "def debug(message)\n @progress = Time.now.to_f\n buffer_checkpoint(\"debug: #{message}\")\n end",
"title": ""
},
{
"docid": "43a96d4660c372b4157515b5b05b2379",
"score": "0.6024897",
"text": "def print_debug(s)\n config = BeEF::Core::Configuration.instance\n if config.get('beef.debug') || BeEF::Core::Console::CommandLine.parse[:verbose]\n puts Time.now.localtime.strftime(\"[%k:%M:%S]\")+'[>]'.yellow+' '+s.to_s\n end\nend",
"title": ""
},
{
"docid": "191895d940211af82e32702eaaedb94a",
"score": "0.60233754",
"text": "def debug?; @logger.debug? end",
"title": ""
},
{
"docid": "e3c7c1b671e8dd937f1fec21b88c3d46",
"score": "0.6022872",
"text": "def debug?\n DEBUG == log_level\n end",
"title": ""
},
{
"docid": "994efaae0cce9a72584906d0d8019dca",
"score": "0.602257",
"text": "def debug(message, important = false)\n puts \"[DEBUG : #{Thread.current[:discordrb_name]} @ #{Time.now.strftime(LOG_TIMESTAMP_FORMAT)}] #{message}\" if @debug || important\n end",
"title": ""
},
{
"docid": "3af865a6b362a70f556ce0760432c7e6",
"score": "0.6012945",
"text": "def debug\n Puppet::Util::Log.level = :debug\n end",
"title": ""
},
{
"docid": "95ef2e448ebe9e1bb3d0372eeb65a3ba",
"score": "0.60097927",
"text": "def debug(*args)\n log&.debug(*args)\n end",
"title": ""
},
{
"docid": "3eeab18567c7b22a47162a37b3feab59",
"score": "0.6009693",
"text": "def debug?\n debugging || !ENV['DEBUG'].nil?\n end",
"title": ""
},
{
"docid": "691e475c45c29d61b0ce215213816620",
"score": "0.60078585",
"text": "def debug(message)\n Edurange.logger.debug message\n end",
"title": ""
},
{
"docid": "d93172fe5ee8916d22d39d8ad90f98d1",
"score": "0.600156",
"text": "def debug(message = nil, progname = nil, &block)\n add(DEBUG, message, progname, &block)\n end",
"title": ""
},
{
"docid": "b916300fa6b69de909ecf5f04175a87a",
"score": "0.5997632",
"text": "def debug(message, options = { })\n ::Guard::UI.debug(message, options)\n end",
"title": ""
},
{
"docid": "9664fda30fa836c68a1703c02b2aa5ba",
"score": "0.5990093",
"text": "def debug?\n @debug || to_bool( ENV['LAUNCHY_DEBUG'] )\n end",
"title": ""
},
{
"docid": "8d7cd4e3ed9431a6fcbacff71c350216",
"score": "0.59856004",
"text": "def debug?\n @debug || ENV['HATCHET_DEBUG'] || false\n end",
"title": ""
},
{
"docid": "bedfcb90db21cfd5dba6a6452059e9f6",
"score": "0.5970103",
"text": "def debugging?\n Options[:debug]\n end",
"title": ""
},
{
"docid": "fb9ef752720f31dbe146e97ab26a59f1",
"score": "0.5966733",
"text": "def debug_log( arg )\r\n print('DEBUG: ')\r\n puts (arg)\r\nend",
"title": ""
},
{
"docid": "e40793db864b5c033a995e56f4d94d39",
"score": "0.5946876",
"text": "def debug_logging\n log.level == Logger::DEBUG\n end",
"title": ""
},
{
"docid": "818216f1f34ae3a2c6ae2f57187cf6a6",
"score": "0.5929717",
"text": "def log(message)\n if Typescript::Monkey.configuration.logger\n Typescript::Monkey.configuration.logger.debug(message)\n end\n end",
"title": ""
},
{
"docid": "79ca149c70ea68e63161ad485a7314f7",
"score": "0.5928681",
"text": "def debug(str)\n $stderr.puts(str) if @debug\n end",
"title": ""
},
{
"docid": "def9f33ab3c072f5e8dba94c575e2e69",
"score": "0.5921377",
"text": "def debug(msg)\n end",
"title": ""
},
{
"docid": "bd7a4aad7b8aef9c8fbad90c803932fd",
"score": "0.5917813",
"text": "def dbg(msg, msgLevel = 1)\n\tif $options['debug'] >= msgLevel then\n\t\tputs \"#{msg}\"\n\tend\nend",
"title": ""
},
{
"docid": "bd7a4aad7b8aef9c8fbad90c803932fd",
"score": "0.5917813",
"text": "def dbg(msg, msgLevel = 1)\n\tif $options['debug'] >= msgLevel then\n\t\tputs \"#{msg}\"\n\tend\nend",
"title": ""
},
{
"docid": "e2981cef963437cdcc14ff8c55369602",
"score": "0.59146905",
"text": "def log_debug?\n @logger.debug?\n end",
"title": ""
},
{
"docid": "bbe07bb1cc85101fc84817503cb6bd4f",
"score": "0.5911336",
"text": "def debugLog _args\n \"debugLog _args;\" \n end",
"title": ""
},
{
"docid": "3e3a5dad1767ea1e3cd4655e136c8b47",
"score": "0.5906337",
"text": "def setDebugLog(value)\n @fields['debug_log'] = value\n self\n end",
"title": ""
}
] |
21e23cd9245fb4142018d9dcc30ed571 | Get the OG containing the gene (returns the first, if multiple). | [
{
"docid": "24b371aa1232c103487b3df0c4175f7e",
"score": "0.80918205",
"text": "def get_og(gene)\n idx = self.ogs.index { |og| og.include? gene }\n idx.nil? ? nil : self.ogs[idx]\n end",
"title": ""
}
] | [
{
"docid": "294fbb579686975463b8b9f12d1ded28",
"score": "0.8091954",
"text": "def get_og(gene)\n idx = self.ogs.index { |og| og.include? gene }\n idx.nil? ? nil : self.ogs[idx]\n end",
"title": ""
},
{
"docid": "2dc84def7068ed24916e92830840da19",
"score": "0.6717535",
"text": "def get_genome_genes(genome)\n genome_id = Gene.genomes.index(genome)\n self.ogs.map do |og|\n g = og.genes[genome_id]\n g.nil? ? [] : g\n end\n end",
"title": ""
},
{
"docid": "0d454002f1f44c28aa1c0e8cfe8d120a",
"score": "0.6475001",
"text": "def gene_name\n gene_names.first\n end",
"title": ""
},
{
"docid": "0d454002f1f44c28aa1c0e8cfe8d120a",
"score": "0.6475001",
"text": "def gene_name\n gene_names.first\n end",
"title": ""
},
{
"docid": "f19cf32f1ad8429eae6364e411d5ea46",
"score": "0.6273965",
"text": "def next_gene\n return @cur_gene\n end",
"title": ""
},
{
"docid": "887d4d77eb8aaa03ecacec19f66b386e",
"score": "0.62037134",
"text": "def get_gene(symbol)\n self.get_by_symbol_or_title(symbol)\n end",
"title": ""
},
{
"docid": "082ddfd5a1b71289f5fe0d8501ebeb52",
"score": "0.60505974",
"text": "def get_gene_by_acc(acc)\n\t\t\tget_item_by_id(acc)\n\t\tend",
"title": ""
},
{
"docid": "9523b32f3a5b58943ea04e4cdc873466",
"score": "0.6018965",
"text": "def random_gene\n return @genes.at(random_index)\n end",
"title": ""
},
{
"docid": "f0543c653b03f33415639bd4f3ec0266",
"score": "0.60152686",
"text": "def getGEI\n @GEI\n end",
"title": ""
},
{
"docid": "97809cc9eb0fc6b8ec68faff131687a4",
"score": "0.5939248",
"text": "def genome\n @@genomes[self.genome_id]\n end",
"title": ""
},
{
"docid": "99759a9c43d47ae624bf929cefd9b989",
"score": "0.58593947",
"text": "def genome\n @@genomes[self.genome_id]\n end",
"title": ""
},
{
"docid": "99759a9c43d47ae624bf929cefd9b989",
"score": "0.58593947",
"text": "def genome\n @@genomes[self.genome_id]\n end",
"title": ""
},
{
"docid": "05bd7e59757b357bc08bc88ec981cda1",
"score": "0.58254963",
"text": "def getEmisionGEI\n aux = listaAlimentos.head\n aux2 = listaGramos.head\n \n geiTotal = 0\n while aux != nil && aux2 != nil\n geiTotal += aux.value.GEI * (aux2.value / 100)\n aux = aux.next\n aux2 = aux2.next\n end\n geiTotal.round(2)\n end",
"title": ""
},
{
"docid": "0a697d638db71aac8b54c4bf588f5c7a",
"score": "0.56702566",
"text": "def genomes\n (0 .. Gene.genomes.length-1).select do |gno|\n not(self.genes[gno].nil? or self.genes[gno].empty?)\n end\n end",
"title": ""
},
{
"docid": "d0b8a2779ca71729f14f2150d4ec7032",
"score": "0.56531256",
"text": "def next_gene\n # Parse the first line into data structures for current gene\n cur = @next_gff\n if !cur\n return nil\n end\n \n # Make sure the assumption that the first one is an exon is true\n if cur.feature==='exon'\n seqname = cur.seqname\n strand = cur.strand\n source = cur.source\n name = parse_name(cur.attributes)\n \n f = Bio::Location.new\n f.from = cur.start\n f.to = cur.end\n exons = [f]\n cds = []\n protein_id = nil #Unknown until we have a CDS line in the file\n \n # Continue reading until finished gene or finished file\n finished_gene = false\n while !finished_gene and (cur = read_record)\n \n \n # if still in the same gene\n if parse_name(cur.attributes) === name\n if cur.strand != strand or cur.seqname != seqname or cur.source != source\n puts \"EXCEPTION !!!!!!!!!!!!!!!!!!!\"\n raise Exception, 'Data bug in JGI file or parsing is being done incorrectly'\n end\n f = Bio::Location.new\n f.from = cur.start\n f.to = cur.end\n case cur.feature\n when 'exon'\n exons.push f\n when 'CDS'\n cds.push f\n protein_id = parse_protein_id(cur.attributes)\n when 'start_codon' #meh\n when 'stop_codon'\n else\n puts \"EXCEPTION !!!!!!!!!!!!!!!!!!!\"\n raise Exception, \"Unknown feature type #{cur.feature} found.\"\n end\n else \n finished_gene = true\n end\n end\n \n #make ready for the next gene\n @next_gff = cur\n \n #create a new positioned gene with the useful characteristics\n # puts \"Returning gene:\"\n # p exons.length\n # p cds.length\n g = PositionedGene.new\n g.seqname = seqname\n g.name = name\n g.strand = strand\n g.start = exons[0].from\n g.exons = exons\n g.cds = cds\n g.protein_id = protein_id\n return g\n else\n p cur.feature\n # I'm not sure if this is detrimental or not, but to be safe..\n raise Exception, \"Assumption failed: exon is not first feature in the gene\"\n end\n \n end",
"title": ""
},
{
"docid": "a1fa704e3fa6c07b8b87f8262cd7f8ef",
"score": "0.5622011",
"text": "def getGei()\n return @gei\n end",
"title": ""
},
{
"docid": "ca447fc357c9a8bd0b0fbc79aee8bfe8",
"score": "0.56167656",
"text": "def [](gene_name)\n return nil if @chromosomes.nil?\n chromosome_position, gene_position =\n @genome.get_gene_position(gene_name)\n return nil if chromosome_position.nil? || gene_position.nil?\n @chromosomes[chromosome_position][gene_position].value\n end",
"title": ""
},
{
"docid": "9bbf239a0549848b438bdfb1070c10bb",
"score": "0.55886793",
"text": "def gene_names\n gn # set @data['GN'] if it hasn't been already done\n if @data['GN'].first.class == Hash then\n @data['GN'].collect { |element| element[:name] }\n else\n @data['GN'].first\n end\n end",
"title": ""
},
{
"docid": "9bbf239a0549848b438bdfb1070c10bb",
"score": "0.55886793",
"text": "def gene_names\n gn # set @data['GN'] if it hasn't been already done\n if @data['GN'].first.class == Hash then\n @data['GN'].collect { |element| element[:name] }\n else\n @data['GN'].first\n end\n end",
"title": ""
},
{
"docid": "68b5af4b1b8c42edcb4074c16fc8b9fb",
"score": "0.55872804",
"text": "def best_chromosome\n the_best = @population[0]\n @population.each do |chromosome|\n the_best = chromosome if chromosome.fitness > the_best.fitness\n end\n return the_best\n end",
"title": ""
},
{
"docid": "9969f8bc90b7900725aa516b36c56571",
"score": "0.5583994",
"text": "def best_chromosome\n the_best = self.population[0]\n self.population.reject{|x| x.fitness.nil? }.each do |chromosome|\n the_best = chromosome if chromosome.fitness > the_best.fitness\n end\n return the_best\n end",
"title": ""
},
{
"docid": "da2eb0de37dd1995acaf474452c6a434",
"score": "0.5581909",
"text": "def best_chromosome\n the_best = @population[0]\n @population.each do |chromosome|\n the_best = chromosome if chromosome.fitness > the_best.fitness\n end\n return the_best\n end",
"title": ""
},
{
"docid": "7c5259e9ee9827cc89a01e90d42a0a4f",
"score": "0.5566792",
"text": "def get_gene_from_oligo_name(oligo_name, curr_format=nil)\r\n curr_format ||= curr_oligo_format?(oligo_name)\r\n \r\n if curr_format\r\n # new format. allow for possibility of gene containing one or more '_' delimiters\r\n # first split oligo_name into two components using '_ROI_' delimiter\r\n # gene will be the remaining substring starting after the 4th delimiter,\r\n # in the first array element\r\n oligo_array1 = oligo_name.split(/_ROI_/)\r\n oligo_array2 = oligo_array1[0].split(/_/)\r\n gene_code = oligo_array2[4..-1].join(\"_\") \r\n else\r\n # old format. if enzyme code is in format 'enzyme_gapfill' then gene is 4th element in\r\n # array, otherwise 3rd element\r\n oligo_array = oligo_name.split(/_/)\r\n gene_code = (oligo_array[2] == 'gapfill' ? oligo_array[3] : oligo_array[2])\r\n end\r\n \r\n return gene_code\r\n end",
"title": ""
},
{
"docid": "ee65e98c9bfe78c8cf77a26ee13d255c",
"score": "0.5565646",
"text": "def GetHighestFitness(population)\n iGeneIndex = 0 #Index of the gene with highest fitness\n fHighestFitness = 0.0 #Fitness value\n for iIndex in 0...population.length #Iterate population\n if population[iIndex].GetFitness > fHighestFitness\n fHighestFitness = population[iIndex].GetFitness\n iGeneIndex = iIndex\n end\n end\n hFitness = {\"Gene\" => population[iGeneIndex].GetGenesString, \"Fitness\" => fHighestFitness}\n return hFitness\nend",
"title": ""
},
{
"docid": "f1533443e8008eb6f7d4bb3decc76629",
"score": "0.5541891",
"text": "def best_chromosome\n the_best = @population[0]\n @population.each do |chromosome|\n the_best = chromosome if chromosome.fitness > the_best.fitness\n end\n return the_best\n end",
"title": ""
},
{
"docid": "48bf2f29bad20f4af72ed4cec1b028b7",
"score": "0.55097234",
"text": "def genes_obj\n o = []\n (0 .. Gene.genomes.length-1).map do |genome_id|\n o += self.genes[genome_id].map{ |gene_id|\n Gene.new(Gene.genomes[genome_id], gene_id) } unless\n self.genes[genome_id].nil?\n end\n return o\n end",
"title": ""
},
{
"docid": "7e0d2ca37a233e384c6a529d31dd1964",
"score": "0.55082107",
"text": "def best_chromosome\n return @population.min_by(&:fitness)\n end",
"title": ""
},
{
"docid": "94731998564bf2d3fee8ed5083f98289",
"score": "0.54871",
"text": "def getGeoTag( goid )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( goid )\n\n # BIMserver request\n request( { goid: goid } )\n end",
"title": ""
},
{
"docid": "76b5e2e80689ffd49bcc91370d24413d",
"score": "0.5486176",
"text": "def gene_id\n description.andand[/ GN=(\\w+) ?/, 1]\n end",
"title": ""
},
{
"docid": "436d744f3f8df7e1c43907785831109f",
"score": "0.5478707",
"text": "def best_chromosome\n the_best = @population[0]\n @population.each do |chromosome|\n the_best = chromosome if chromosome.fitness > the_best.fitness\n # chromosome.fitness > the_best.fitness will produce the first best chromosome.\n # chromosome.fitness >= the_best.fitness will product the last best chromosome.\n # Hence, it is not a matter of concern unless the risk analysis is important. \n # e.g. high risk approach and low risk approach.\n end\n return the_best\n end",
"title": ""
},
{
"docid": "8303ddd40d530ca8dcd7458a3bd42bb8",
"score": "0.5469566",
"text": "def get_gei\n @gei\n end",
"title": ""
},
{
"docid": "f22950b04bbfef38b34ca3ceb6cd8294",
"score": "0.5450963",
"text": "def gene_id rid\n @r_to_g[rid]\n end",
"title": ""
},
{
"docid": "92d9fe3ba045ea18f7989c2c4f446160",
"score": "0.5436408",
"text": "def findg(nodes)\n\tfor node in nodes\n\t\tif node[\"g\"] == 1\n\t\t\treturn node\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "1871e8bc1c5b68141631c328748e3f46",
"score": "0.54328835",
"text": "def search_gene\n @platform = ['Illumina','Solid']\n @genedefinition = [ 'Refseq','Ensembl','UCSC/Known']\n @exonicFunction =[ 'All','Exonic','Splicing','Intronic','UTR3','UTR5','Downstream','Upstream','Intergenic','ncRNA_exonic','ncRNA_splicing','ncRNA_intronic','ncRNA_UTR3','ncRNA_UTR5']\n @variantFunction = ['All','Nonsynonymous SNV','Synonymous SNV','Stopgain SNV','Stoploss SNV','Frameshift insertion','Frameshift deletion','Frameshift substitution','Nonframeshift insertion','Nonframeshift deletion','Nonframeshift substitution'] \n @vartype = ['SNP','INDEL']\n @subgrp = ['All','spanish'] \n end",
"title": ""
},
{
"docid": "faaef19533ed934dda66a098fe03b594",
"score": "0.54242074",
"text": "def genes_obj\n o = []\n (0 .. Gene.genomes.length-1).map do |genome_id|\n o += self.genes[genome_id].map{ |gene_id| Gene.new(Gene.genomes[genome_id], gene_id) } unless self.genes[genome_id].nil?\n end\n return o\n end",
"title": ""
},
{
"docid": "faaef19533ed934dda66a098fe03b594",
"score": "0.54242074",
"text": "def genes_obj\n o = []\n (0 .. Gene.genomes.length-1).map do |genome_id|\n o += self.genes[genome_id].map{ |gene_id| Gene.new(Gene.genomes[genome_id], gene_id) } unless self.genes[genome_id].nil?\n end\n return o\n end",
"title": ""
},
{
"docid": "5542be96a41f1b3bdf2cefb5ba1f1555",
"score": "0.54044807",
"text": "def search_gene\n @genedefinition = [ 'Refseq','Ensembl','UCSC/Known']\n @exonicFunction =[ 'All','Exonic','Splicing','Intronic','UTR3','UTR5','Downstream','Upstream','Intergenic','ncRNA_exonic','ncRNA_splicing','ncRNA_intronic','ncRNA_UTR3','ncRNA_UTR5']\n @variantFunction = ['All','Nonsynonymous','Synonymous','Stopgain','Stoploss'] \n end",
"title": ""
},
{
"docid": "2009a840b6efad61bfe812280cfd006a",
"score": "0.5402713",
"text": "def og\n unless @data['OG']\n og = Array.new\n if get('OG').size > 0\n ogstr = fetch('OG')\n ogstr.sub!(/\\.$/,'')\n ogstr.sub!(/ and/,'')\n ogstr.sub!(/;/, ',')\n ogstr.split(',').each do |tmp|\n og.push(tmp.strip)\n end\n end\n @data['OG'] = og\n end\n @data['OG']\n end",
"title": ""
},
{
"docid": "f31b7f2dcea3933330d7fc0a0816718c",
"score": "0.54023445",
"text": "def g\n @g\n end",
"title": ""
},
{
"docid": "f31b7f2dcea3933330d7fc0a0816718c",
"score": "0.54023445",
"text": "def g\n @g\n end",
"title": ""
},
{
"docid": "285b6908535205a554e7e635ff08b483",
"score": "0.5385936",
"text": "def GetGenes\n return @aGenes\n end",
"title": ""
},
{
"docid": "e8a612281165391ac65f9f7bff6cbdb1",
"score": "0.538503",
"text": "def pick_one(pool)\n proportional_index = rand(pool.total_normalised_fitness)\n total = 0\n pool.genes.each_with_index do |gene, index|\n total += gene.normalised_fitness(pool.worst_fitness)\n return gene if total >= proportional_index || index == (pool.size - 1)\n end\n end",
"title": ""
},
{
"docid": "3a66b40202fc55879fd9dc2944d22843",
"score": "0.5367465",
"text": "def d_gei\n\t\treturn @gei\n\tend",
"title": ""
},
{
"docid": "1ee7af7e7abf2d141928cd325663046e",
"score": "0.53265876",
"text": "def gi\n unless defined?(@gi) then\n @gi = get_by_type('gi')\n end\n @gi\n end",
"title": ""
},
{
"docid": "1c347661be5c7c61ed37bee6646b6af7",
"score": "0.53220624",
"text": "def gq \n self.samples[\"1\"][\"GQ\"].to_f rescue 0.0\n end",
"title": ""
},
{
"docid": "a81bf72b01733baf2c1a5144058d50fc",
"score": "0.5315007",
"text": "def get_alt_genotype(format, gt)\n format_array = format.split(':')\n gt_idx = format_array.index('GT')\n\n gt = gt[0].split(':')[gt_idx][0...3]\n gt_array = []\n gt_alt = []\n if gt.include? '|'\n gt_array = gt.split('|')\n elsif gt.include? '/'\n gt_array = gt.split('/')\n end\n gt_array.each do |gt_tmp|\n gt_tmp = gt_tmp.to_i\n if gt_tmp != 0 and !gt_alt.include? (gt_tmp - 1)\n gt_alt.push(gt_tmp - 1)\n end\n end\n return gt_alt, gt\n end",
"title": ""
},
{
"docid": "5a3f744d73466af9004e560debf6321c",
"score": "0.5285423",
"text": "def gi\n identifiers.gi\n end",
"title": ""
},
{
"docid": "8ac8b62209b85ba0eaeeda260609f67b",
"score": "0.5236671",
"text": "def fitness_of genome\n fitness = super genome #lol\n update_best genome, fitness\n fitness\n end",
"title": ""
},
{
"docid": "e7e9041768466d687ca6cc7f56188e8f",
"score": "0.523438",
"text": "def get_genename(fasta_file)\n geneid1 = \"\"\n file = Bio::FastaFormat.open(fasta_file)\n file.each do |entry|\n geneid1 = entry.entry_id\n end\n geneid1\nend",
"title": ""
},
{
"docid": "b5839239b05d8bcb7c95a55df451e974",
"score": "0.5222229",
"text": "def get_gases\n\t\treturn @gei\n\tend",
"title": ""
},
{
"docid": "45b59ee78719c95130040b6d8c760f27",
"score": "0.5194317",
"text": "def gear\n if self.group_instances.nil?\n elaborate_descriptor\n end\n \n if scalable\n self.group_instance_map.keys.each { |ginst_name|\n return self.group_instance_map[ginst_name].gears.first if ginst_name.include? self.proxy_cartridge\n }\n end\n\n group_instance = self.group_instances.first\n return nil unless group_instance\n \n return group_instance.gears.first\n end",
"title": ""
},
{
"docid": "e0098f89ee7782c1ba1759e412429d36",
"score": "0.5193775",
"text": "def gga\n # if lat = @gnss[:lat_raw]\n # lat = degree(lat)\n # lat = -lat if @gnss[:ns] == 'S'\n # end\n # if lng = @gnss[:lng_raw]\n # lng = degree(lng)\n # lng = -lng if @gnss[:ew] == 'W'\n # end\n GGA.new(@gnss[:utc], latitude, longitude, @gnss[:hdr])\n end",
"title": ""
},
{
"docid": "89ecf50db46fe42f119e63819cc091fb",
"score": "0.5173824",
"text": "def gei\n aux=@dieta.head\n auxgramos=@gramos.head\n contador=0\n for i in 0...@dieta.size\n contador+=aux.value.get_gei*(auxgramos.value/100.0)\n aux=aux.next unless aux.next.nil?\n auxgramos=auxgramos.next unless auxgramos.next.nil?\n end\n return contador\n end",
"title": ""
},
{
"docid": "061be76330f0d470ab449688bba2fb71",
"score": "0.5172658",
"text": "def random_gene_index\n return (rand * @genes.size).to_i\n end",
"title": ""
},
{
"docid": "71f4b0cefe0cae9e226de98088d52e23",
"score": "0.5120654",
"text": "def get_genus_species(genus_option, self_option)\n return nil if rank_class.nil?\n genus = nil\n name1 = nil\n\n if is_species_rank? # self.rank_string =~ /Species/\n if genus_option == :original\n genus = original_genus\n elsif genus_option == :current\n genus = ancestor_at_rank('genus')\n else\n return false\n end\n\n genus = genus.name if genus.present?\n return nil if genus.blank?\n end\n\n if self_option == :self\n name1 = name\n elsif self_option == :alternative\n name1 = name_with_alternative_spelling\n end\n\n return nil if genus.nil? && name1.nil? # <- hitting this because Genus is never set\n [genus, name1].compact.join(' ')\n # (genus.to_s + ' ' + name1.to_s).squish\n end",
"title": ""
},
{
"docid": "8d1c4178cfb530d2e32fb24acd162dae",
"score": "0.51204664",
"text": "def og_logo\n if logo\n logo_parts = logo.split('.')\n if logo_parts.length > 1\n # Insert '-og' before the extension but after the filename stem\n stem = \"#{logo_parts.first(logo_parts.length - 1).join('.')}-og\"\n else\n # No extension: just append '-og' on the end\n stem = \"#{logo}-og\"\n end\n # Check for stem as .jpg, .jpeg, .png and .gif, then give up\n ogl = nil\n %w(jpg jpeg png gif).each do |ext|\n proposed_filename = \"#{stem}.#{ext}\"\n if image_file_exists?(proposed_filename)\n ogl = proposed_filename\n break\n end\n end\n unless ogl\n # Can't find the og_logo - just go with the project logo\n ogl = logo\n end\n return ogl\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "8d1c4178cfb530d2e32fb24acd162dae",
"score": "0.51204664",
"text": "def og_logo\n if logo\n logo_parts = logo.split('.')\n if logo_parts.length > 1\n # Insert '-og' before the extension but after the filename stem\n stem = \"#{logo_parts.first(logo_parts.length - 1).join('.')}-og\"\n else\n # No extension: just append '-og' on the end\n stem = \"#{logo}-og\"\n end\n # Check for stem as .jpg, .jpeg, .png and .gif, then give up\n ogl = nil\n %w(jpg jpeg png gif).each do |ext|\n proposed_filename = \"#{stem}.#{ext}\"\n if image_file_exists?(proposed_filename)\n ogl = proposed_filename\n break\n end\n end\n unless ogl\n # Can't find the og_logo - just go with the project logo\n ogl = logo\n end\n return ogl\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "ebcd0bd8a5a6ae2123263050f3ff90d6",
"score": "0.5089883",
"text": "def gd \n gf - ga\n end",
"title": ""
},
{
"docid": "b52c5d975a610ed712b385392d4f6d0c",
"score": "0.50602823",
"text": "def gounod\n fetch('opera.french.by_charles_gounod')\n end",
"title": ""
},
{
"docid": "1a678db48e0a828a0385124a31062d33",
"score": "0.5050167",
"text": "def fitness\n fitness_check = []\n self.genome.each do |gene|\n # Add the first element to the check, and every subsequent element that is in order.\n if fitness_check.empty? || gene > fitness_check.last\n fitness_check.push(gene)\n end\n end\n\n # Fitness is the length of the check, which is the number of digits in order from the genome.\n return fitness_check.length\n end",
"title": ""
},
{
"docid": "cb4273b8c9df10b7ec2eafe65ce00742",
"score": "0.5037062",
"text": "def get_gpx\n Find.find(self.get_path) do |path|\n if File.basename(path).end_with?(\".gpx\")\n return path\n end\n end\n end",
"title": ""
},
{
"docid": "09b9de1e2c6064a69621642f29752314",
"score": "0.5030305",
"text": "def gene_region\n region_by_boundaries(gene_start, gene_end)\n end",
"title": ""
},
{
"docid": "00f56ad08d6728668012c48344024171",
"score": "0.5028275",
"text": "def calc_gases\n\t\tgei = @alimentos.gases\n\t\treturn gei\n\tend",
"title": ""
},
{
"docid": "34c69b6eb32157e6c5c826a3bf920bbc",
"score": "0.50258565",
"text": "def owneable_gid\n owneable.try :to_global_id\n end",
"title": ""
},
{
"docid": "141dad7abd919ed94b67cbf512cbde08",
"score": "0.50176334",
"text": "def getGrado\n \treturn @a.size() - 1 \t\n\tend",
"title": ""
},
{
"docid": "8374b21e58f76480a2ff0f73f62defd2",
"score": "0.5015246",
"text": "def genes\n [0,1]\n end",
"title": ""
},
{
"docid": "2f2b5c902746c5be78a7727c20e31b4d",
"score": "0.5014345",
"text": "def stat_gini\n if first.kind_of?(Array)\n if length>1\n al = 0\n each_cons(2) do |left,right|\n w = right[0] - left[0]\n h = (left[1] + right[1])/2.0\n al += w*h\n end\n at = (last[0]*last[1])/2.0\n 1-al/at\n else\n 0\n end\n else\n stat_lorenz.stat_gini\n end\n end",
"title": ""
},
{
"docid": "acd08e718b0b99ea72ded927a22c9cbf",
"score": "0.50039107",
"text": "def include?(gene)\n return false if self.genes[gene.genome_id].nil?\n self.genes[gene.genome_id].include? gene.id\n end",
"title": ""
},
{
"docid": "acd08e718b0b99ea72ded927a22c9cbf",
"score": "0.50039107",
"text": "def include?(gene)\n return false if self.genes[gene.genome_id].nil?\n self.genes[gene.genome_id].include? gene.id\n end",
"title": ""
},
{
"docid": "0971fc9d4b52de8d16067fa91f620a5f",
"score": "0.50022256",
"text": "def include?(gene)\n return false if self.genes[gene.genome_id].nil?\n self.genes[gene.genome_id].include? gene.id\n end",
"title": ""
},
{
"docid": "494e7374c7d6a232044b7f8f5b9b0e96",
"score": "0.49983582",
"text": "def get_g_value(node)\n get_heuristic_distance(@board_handler.start_node, node)\n end",
"title": ""
},
{
"docid": "c764936d20f26459ac07a7cb0e514450",
"score": "0.49915776",
"text": "def major_groove_mobility\n dinucleotide_lookup(@@MAJOR_GROOVE_MOBILITY)\n end",
"title": ""
},
{
"docid": "e5c03758317e75dbc2bdcddaaff8c55e",
"score": "0.49777827",
"text": "def selection(g)\n @max_population && g.length > @max_population ? g.sort_by{|c| -c.fitness}.first(@max_population) : g\n end",
"title": ""
},
{
"docid": "edc08fb956843e72b45b47674e325c86",
"score": "0.4973268",
"text": "def g\n @@g.dup\n end",
"title": ""
},
{
"docid": "be4ab61d88c90f433a055d67c536be72",
"score": "0.49660522",
"text": "def cmd_get\n self.sendCommand('G')\n end",
"title": ""
},
{
"docid": "72b6edb3b72f741382a5a42bbabee7ea",
"score": "0.49642196",
"text": "def advance_generation\n selected_to_breed = selection # Evaluates current population\n offsprings = reproduction selected_to_breed # Generate the population for this new generation\n replace_worst_ranked offsprings\n return best_chromosome\n end",
"title": ""
},
{
"docid": "5ae0fea4bb04b80ffb619b9e9b361ebb",
"score": "0.49572432",
"text": "def fitness\n return @fitness if @fitness\n start_gene = @genes[0]\n cost = 0\n @genes[1..-1].each do | end_gene |\n cost += @@costs[ start_gene ][ end_gene ]\n start_gene = end_gene\n end\n @fitness = -1 * cost\n\n return @fitness\n end",
"title": ""
},
{
"docid": "53708b1b3d9a345878e05259377dea3b",
"score": "0.49529177",
"text": "def fitness_notation\n return @fitness_notation if @fitness_notation\n global_notation = 0\n @meteo_path[1..-1].each do |notation_by_address|\n global_notation += notation_by_address\n end\n @fitness_notation = global_notation\n return @fitness_notation\n end",
"title": ""
},
{
"docid": "4e92004433ea44d7c00d9314ea26551b",
"score": "0.4935981",
"text": "def gei_diario\n auxNodo = @alimentos.head\n auxNodo1 = @gramos.head\n geidiario = 0\n while(auxNodo != nil && auxNodo1 != nil)\n geidiario += (auxNodo.value.gei * auxNodo1.value)\n auxNodo = auxNodo.next\n auxNodo1 = auxNodo1.next\n end\n return geidiario.round(1)\n end",
"title": ""
},
{
"docid": "c63f33ec2b42e38285cf9ba857f30836",
"score": "0.49173456",
"text": "def get_agency_population ori\n query = Queries::Agencies.agency ori\n result = DATABASE.execute query\n return nil if result.first == nil\n result.first['population']\nend",
"title": ""
},
{
"docid": "bda734b661a07d4e4b1dd9031cd7828e",
"score": "0.49138236",
"text": "def emisionesGEI\n\t\temisionesGEI = 0.0\n\t\ti = 0\n\t\twhile i<@lista_alimentos.size do\n\t\t\temisionesGEI += @lista_alimentos[i].gei\n\t\t\ti+=1\n\t\tend\n\t\treturn emisionesGEI\n\tend",
"title": ""
},
{
"docid": "eeadbb7279c944406e13d1ad4ab17160",
"score": "0.49002135",
"text": "def calc_griseous_orb_multiplier(user, target)\n return 1 unless user.db_symbol == :giratina\n return GRISEOUS_ORB_TYPES.include?(type) ? 1.2 : 1\n end",
"title": ""
},
{
"docid": "c19abb8c7a7330483a2796226cf86bb8",
"score": "0.489441",
"text": "def min_glucose\n readings_subset.minimum(:glucose_level)\n end",
"title": ""
},
{
"docid": "f1f2a546f9c3fd7ee9951d81ff6fbe49",
"score": "0.48928052",
"text": "def make_genome(available_genes)\n\t\tgenome = Genome.new\n\n\t\tgenome.add(:neural_allele_pair_action, available_genes[:action_neural_alleles].sample(1)[0])\n\t\tgenome.add(:neural_allele_pair_action, available_genes[:action_neural_alleles].sample(1)[0])\n\n\t\tgenome.add(:neural_allele_pair_target, available_genes[:target_neural_alleles].sample(1)[0])\n\t\tgenome.add(:neural_allele_pair_target, available_genes[:target_neural_alleles].sample(1)[0])\n\n\t\tgenome.add(:neural_allele_pair_defense, available_genes[:defense_neural_alleles].sample(1)[0])\n\t\tgenome.add(:neural_allele_pair_defense, available_genes[:defense_neural_alleles].sample(1)[0])\n\n\t\tNUMBER_OF_PHYSICAL_GENES.times do |time|\n\t\t\tgenome.add(\"physical_allele\".to_sym, available_genes[\"physical_allele_#{time}\".to_sym].sample(1)[0], time)\n\t\t\tgenome.add(\"physical_allele\".to_sym, available_genes[\"physical_allele_#{time}\".to_sym].sample(1)[0], time)\n\t\tend\n\n\t\treturn genome\n\tend",
"title": ""
},
{
"docid": "d9bd0f870dae83994142184d842f88b4",
"score": "0.48796162",
"text": "def get_phrase\n @genes.join('')\n end",
"title": ""
},
{
"docid": "9e5ace267c1fbe5be1bdf7d837d42da9",
"score": "0.48791325",
"text": "def gene_params\n params.fetch(:gene, {})\n end",
"title": ""
},
{
"docid": "ccc110eb222064085665481bd52405df",
"score": "0.48774213",
"text": "def GetGenesString\n return @aGenes.join\n end",
"title": ""
},
{
"docid": "599b8ca43f372e3d010c9f86631fec45",
"score": "0.48763427",
"text": "def get_genre_of_first_song\n #return the genre of the artist's first saved song\n self.songs.first.genre\n end",
"title": ""
},
{
"docid": "08bcec1d679f60b0f04822e207da51d0",
"score": "0.48745307",
"text": "def select_one population=self.population\n select( 1, population ).first\n end",
"title": ""
},
{
"docid": "383d33cd05281b23ca7ae7e2e4ea909c",
"score": "0.48719472",
"text": "def get_energia\n\t\tpuntero=@head\n\t\ttotal_energia=0\n\t\tif(@head!=nil)\n\t\t\twhile(puntero!=nil) do\n\t\t\t\ttotal_energia += puntero.value.irenergia\n\t\t\t\tif(puntero.nest!=nil)\n\t\t\t\t\tpuntero = puntero.nest\n\t\t\t\telse\n\t\t\t\t\tpuntero=nil\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn total_energia\n\tend",
"title": ""
},
{
"docid": "c61a2f2c0b54749b57b125c4fb962304",
"score": "0.48641032",
"text": "def to_s\n self.gene_symbol\n end",
"title": ""
},
{
"docid": "a33b70a632b8b84260fe2d7b8ded2d95",
"score": "0.4861575",
"text": "def get_chromosome\n self\n end",
"title": ""
},
{
"docid": "d3f379f0be99ac3282e8cffcab5bef51",
"score": "0.48476672",
"text": "def gene_seq\n \"[\" + self.collect { |x| x.to_s }.join('|') + \"]\"\n end",
"title": ""
},
{
"docid": "53714b4aa5c541f2dfe4ea5cfb2b034f",
"score": "0.48414162",
"text": "def minor_groove_mobility\n dinucleotide_lookup(@@MINOR_GROOVE_MOBILITY)\n end",
"title": ""
},
{
"docid": "5720403f69461ef4777e010b5d837229",
"score": "0.48409963",
"text": "def addGene\n\n # prefix = ARGV[1]\n # length = @gb.features.length.to_s.length\n gb = @genbanks.next_entry\n\n ftIndex = -1\n gene_to_add = {}\n\n genes_done = {}\n\n gb.features do |ft|\n\n ftIndex += 1\n\n if ft.feature == \"gene\"\n genes_done[ft.position] = 1\n end\n\n next if ft.feature != \"CDS\" and ft.feature != \"rRNA\" and ft.feature != \"tRNA\" and ft.feature != \"ncRNA\"\n\n next if genes_done.has_key? ft.position\n\n new_feature = Bio::Feature.new(\"gene\", ft.position)\n\n ft.qualifiers.each do |q|\n if q.qualifier == \"locus_tag\" or\n q.qualifier == \"gene\" or\n q.qualifier == \"pseudo\" or\n q.qualifier == \"note\"\n new_feature.append(Bio::Feature::Qualifier.new(q.qualifier,q.value))\n end\n end\n\n gene_to_add[ftIndex] = new_feature\n\n end\n\n gene_to_add.sort_by {|k,v| k}.reverse.each do |k,v|\n gb.features.insert(k,v)\n end\n\n puts gb.to_biosequence.output(:genbank)\n\n end",
"title": ""
},
{
"docid": "fa79b58fd17a94eee5c7be5f97d65983",
"score": "0.4839859",
"text": "def genus_group # :yields: TaxonName\n case rank # self.rank\n when \"subspecies\"\n p1 = self.parent # must be a species\n return p1.parent # must be a genus\n when \"species\"\n return self.parent\n when \"subgenus\"\n return self\n when \"genus\"\n return self\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "5534edd4dbf74d562224fa1ba1fa3bd8",
"score": "0.48375386",
"text": "def excess(oc)\n (@genotype.genes.size - oc.genotype.genes.size).abs\n end",
"title": ""
},
{
"docid": "99444e4d1394c8fcdec5c9c53dad415c",
"score": "0.4825898",
"text": "def obtenerGanadorGeneral\n max = 0\n objeto = nil\n\n for p in arreglo_perros\n if p.calcularCalificacion > max \n objeto = p\n max = p.calcularCalificacion\n end\n end\n\n return objeto\n end",
"title": ""
},
{
"docid": "e8da37f3ffa2391b9b48f8b99c4a1cd9",
"score": "0.4821257",
"text": "def geometric_index aln\n by_seq_score = geometric_score aln, \"sequence\"\n by_residue_score = geometric_score aln, \"residue\"\n\n (by_seq_score + by_residue_score) / 2.0\n end",
"title": ""
}
] |
c3f24bb5b9d842c872789a10f8f98ddd | DO THE ACTUAL CONVERTING | [
{
"docid": "cfaf6c5a8056d62038218d75a55bcef1",
"score": "0.0",
"text": "def convert(path, options)\n\n @java_classes = {}\n @java_fields = {}\n @java_lists = {}\n @field_info = {}\n\n @do_chop = true\n @config = Configurator.new\n\n parse_args(path, options)\n\n if !File.exists?(@config.json_file)\n puts \"The file '#{@config.json_file.red}' does not exist!\"\n exit -1\n else\n if !valid_json?(@config.json_file)\n puts \"'#{@config.json_file.red}' is not a valid json file!\"\n exit -1\n end\n end\n\n\n print_intro()\n\n\n @package = @config.package\n\n\n json_file_contents = IO.read(@config.json_file)\n json = JSON.parse(json_file_contents)\n\n @java_classes[@config.top_level_class] = \"TOP_LEVEL_CLASS\"\n setup_data(json, @config.top_level_class)\n @java_classes.each { |class_name, parent| java_class_output(class_name, parent) }\n\nend",
"title": ""
}
] | [
{
"docid": "69101d91fc64f433f2c3740f8d762d21",
"score": "0.75462306",
"text": "def convert(to)\n\n end",
"title": ""
},
{
"docid": "98fb4540f82b0bf969802354d5797900",
"score": "0.75154907",
"text": "def converter; end",
"title": ""
},
{
"docid": "98fb4540f82b0bf969802354d5797900",
"score": "0.75154907",
"text": "def converter; end",
"title": ""
},
{
"docid": "98fb4540f82b0bf969802354d5797900",
"score": "0.75154907",
"text": "def converter; end",
"title": ""
},
{
"docid": "db7714abb849ebf9169b304663835d4d",
"score": "0.68324995",
"text": "def transformation\n end",
"title": ""
},
{
"docid": "db7714abb849ebf9169b304663835d4d",
"score": "0.68324995",
"text": "def transformation\n end",
"title": ""
},
{
"docid": "db7714abb849ebf9169b304663835d4d",
"score": "0.68324995",
"text": "def transformation\n end",
"title": ""
},
{
"docid": "15c4b73e78c6bd54b29111b8a665450d",
"score": "0.67824996",
"text": "def converter_results; end",
"title": ""
},
{
"docid": "d9c71213420de2514acf50f3e2ede9e0",
"score": "0.67454386",
"text": "def convert\n raise \"method #{self.class.name}#convert() is not implemented!\"\n end",
"title": ""
},
{
"docid": "9beb7be53eb5305c63284a0f0a9521ea",
"score": "0.67154014",
"text": "def transform\n end",
"title": ""
},
{
"docid": "72bf4d719eb006e54ccec177d2e25a58",
"score": "0.6686357",
"text": "def call\n convert\n end",
"title": ""
},
{
"docid": "33bd73e61a2929f1a98085081e310bda",
"score": "0.6657814",
"text": "def reverting; end",
"title": ""
},
{
"docid": "33bd73e61a2929f1a98085081e310bda",
"score": "0.6657814",
"text": "def reverting; end",
"title": ""
},
{
"docid": "ee5db650e9589e9ac3afd815a493d1bd",
"score": "0.66519475",
"text": "def __convert(h); end",
"title": ""
},
{
"docid": "20d278e7f12f6d2ffa5c968c25faf7ff",
"score": "0.6638805",
"text": "def convert(val)\n return val\nend",
"title": ""
},
{
"docid": "f53478c78bfb65847a5452ef55a4e8ef",
"score": "0.6599765",
"text": "def transforms; end",
"title": ""
},
{
"docid": "db27fb6cc40f72d90926462b3bd35628",
"score": "0.6593919",
"text": "def converter_results=(_arg0); end",
"title": ""
},
{
"docid": "974922210985be10ffdc6dfcaf74fcc4",
"score": "0.65633357",
"text": "def convert(_data, _first)\n raise NotImplementedError, 'This must be implemented in a subclass.'\n end",
"title": ""
},
{
"docid": "8a5c98e585ff4bf3b01e0f9c26f9024b",
"score": "0.6560366",
"text": "def transform() end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.6552392",
"text": "def transformations; end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.6552392",
"text": "def transformations; end",
"title": ""
},
{
"docid": "79014680095e581da4a2fe2118092f5d",
"score": "0.64775425",
"text": "def apply_changes_from_converted_types\n end",
"title": ""
},
{
"docid": "20ce430dd90f89d4bc3bede37b3e7037",
"score": "0.6477298",
"text": "def convert_tables\r\n end",
"title": ""
},
{
"docid": "94dcbe5a87c89069aedff785f9502ffd",
"score": "0.64569485",
"text": "def convert(format); end",
"title": ""
},
{
"docid": "94dcbe5a87c89069aedff785f9502ffd",
"score": "0.64569485",
"text": "def convert(format); end",
"title": ""
},
{
"docid": "5a921b7bdd43c4707d68fc39b63b8ef1",
"score": "0.63094497",
"text": "def converted_arrays; end",
"title": ""
},
{
"docid": "4bb3be38aef6eb8e6bea0227a967f0fa",
"score": "0.6302017",
"text": "def value_transformation; end",
"title": ""
},
{
"docid": "8fdd574865707d8183dc35956d66d3ae",
"score": "0.6299565",
"text": "def cast; end",
"title": ""
},
{
"docid": "7cc09f72fc7fd6c0080bca3125ea92ac",
"score": "0.62783957",
"text": "def prepare_convert_single(from, to)\n ConvertSingle.new from, to, self\n end",
"title": ""
},
{
"docid": "3d9958908e1ec3d8c5be6a14e398760a",
"score": "0.6234035",
"text": "def transform_values!; end",
"title": ""
},
{
"docid": "dcbdc7f33516fbb9c96c3badacf73874",
"score": "0.62239903",
"text": "def convert(data, _first)\n data\n end",
"title": ""
},
{
"docid": "69b0e2e269f64aacaecfe41b5fd47976",
"score": "0.6215748",
"text": "def convert(key); end",
"title": ""
},
{
"docid": "35349bda0d40404fd598751ae2453e62",
"score": "0.6189508",
"text": "def instance_convert\n # no-op by default, override in you subclass\n end",
"title": ""
},
{
"docid": "6de47d8809779ea7d056f5d88601870c",
"score": "0.6169837",
"text": "def normalize; end",
"title": ""
},
{
"docid": "6de47d8809779ea7d056f5d88601870c",
"score": "0.6169837",
"text": "def normalize; end",
"title": ""
},
{
"docid": "6de47d8809779ea7d056f5d88601870c",
"score": "0.6169837",
"text": "def normalize; end",
"title": ""
},
{
"docid": "6de47d8809779ea7d056f5d88601870c",
"score": "0.6169837",
"text": "def normalize; end",
"title": ""
},
{
"docid": "93f718ec61c926c5458c4a0014778599",
"score": "0.61355555",
"text": "def convert(record)\n s = extract(record)\n if mapped?\n map[s]\n elsif number?\n if precision > 0\n s.to_i / (10.0 ** precision)\n else\n s.to_i\n end\n elsif type == :date\n GDV::Format::parse_date(s)\n else\n s.strip!\n s.encode!(\"UTF-8\")\n s\n end\n end",
"title": ""
},
{
"docid": "b1d87e1c86f6a2bed2994f3e1432e137",
"score": "0.6124725",
"text": "def typecast(value); end",
"title": ""
},
{
"docid": "b1d87e1c86f6a2bed2994f3e1432e137",
"score": "0.6124725",
"text": "def typecast(value); end",
"title": ""
},
{
"docid": "a7477195698e54020b15092e671b8f24",
"score": "0.6120362",
"text": "def to(value); end",
"title": ""
},
{
"docid": "a7477195698e54020b15092e671b8f24",
"score": "0.6120362",
"text": "def to(value); end",
"title": ""
},
{
"docid": "7c8f503998b64d082bde42f2156dc92e",
"score": "0.60860354",
"text": "def convert!(data)\n @converters.each do |field, converter|\n data.each do |submission|\n key = field.to_s\n if submission.has_key?(key)\n c = converter.new(submission[key])\n submission[key] = c.convert\n end\n end\n end\n data\n end",
"title": ""
},
{
"docid": "be5df6ced5d4b37fbc76ab7fc2d50872",
"score": "0.60598",
"text": "def normalize\r\n end",
"title": ""
},
{
"docid": "cdcfb769cc832f4857cb761e93537140",
"score": "0.60244054",
"text": "def cast_value(value); end",
"title": ""
},
{
"docid": "cdcfb769cc832f4857cb761e93537140",
"score": "0.60244054",
"text": "def cast_value(value); end",
"title": ""
},
{
"docid": "45f4cf9421b37a5c734af92753f4c69d",
"score": "0.6012311",
"text": "def convert!\n return @data if @data\n @data = Runtime::Cons.construct(elements[1].elements, true) { |c| c.eval }\n end",
"title": ""
},
{
"docid": "eb27b0c66776bb3302fa0baf92b2324c",
"score": "0.59957355",
"text": "def convert(data)\n @name = data[0]\n @numbering_order = data[1]\n @short_name = data[2]\n @candidate_count = data[3]\n @coalition_name = data[4]\n end",
"title": ""
},
{
"docid": "12fa74b537bac41db6b75fcf55bded95",
"score": "0.59908074",
"text": "def reverting=(_); end",
"title": ""
},
{
"docid": "b4a417957eea39ebcbf68841528de548",
"score": "0.59803945",
"text": "def convert\n self.convert!\n success = system(convert_command)\n if success && $?.exitstatus == 0\n self.converted!\n else\n self.failed!\n end\n end",
"title": ""
},
{
"docid": "b4a417957eea39ebcbf68841528de548",
"score": "0.59803945",
"text": "def convert\n self.convert!\n success = system(convert_command)\n if success && $?.exitstatus == 0\n self.converted!\n else\n self.failed!\n end\n end",
"title": ""
},
{
"docid": "ed66d0297ac90fabb48fdfd0ca2c4610",
"score": "0.5976719",
"text": "def cast(value); end",
"title": ""
},
{
"docid": "ed66d0297ac90fabb48fdfd0ca2c4610",
"score": "0.5976719",
"text": "def cast(value); end",
"title": ""
},
{
"docid": "ed66d0297ac90fabb48fdfd0ca2c4610",
"score": "0.5976719",
"text": "def cast(value); end",
"title": ""
},
{
"docid": "5cf02db87b764ed7068de5784caa7e5b",
"score": "0.595986",
"text": "def convert\n self.convert!\n success = system(convert_command)\n if success && $?.exitstatus == 0\n self.converted!\n else\n self.failure!\n end\n end",
"title": ""
},
{
"docid": "6f8737871b4d595388dff4c5fca7b1ae",
"score": "0.5952463",
"text": "def encoder; end",
"title": ""
},
{
"docid": "6f8737871b4d595388dff4c5fca7b1ae",
"score": "0.5952463",
"text": "def encoder; end",
"title": ""
},
{
"docid": "bdb5e59de52a7ebe0721ae461a716879",
"score": "0.5951019",
"text": "def cast_type; end",
"title": ""
},
{
"docid": "b4d0567e99e2fda14d6a21023dee27e5",
"score": "0.5923731",
"text": "def type_cast(value); end",
"title": ""
},
{
"docid": "c576ed415a560ff37ec116624a69b342",
"score": "0.59178495",
"text": "def normalize!\r\n end",
"title": ""
},
{
"docid": "ac6d9da1a0610514f764dbfc2810dc7f",
"score": "0.5910869",
"text": "def convert_action\n return convert_array_action if @data.is_a?(Array)\n return convert_object_action\n end",
"title": ""
},
{
"docid": "fdacc529478917192184fb3fdfbf958a",
"score": "0.5884728",
"text": "def converter ship\n\n end",
"title": ""
},
{
"docid": "31e3189d4045d71338f2a75cb1061edc",
"score": "0.5878655",
"text": "def convert!(arguments, conversion)\n convertor_for(conversion).convert!(arguments)\n end",
"title": ""
},
{
"docid": "5882a20a67e268d1e162d18e2c27baf0",
"score": "0.5859635",
"text": "def convert(data)\n @name = data[0]\n @numbering_order = data[1]\n @short_name = data[2]\n @alliance_count = data[3]\n end",
"title": ""
},
{
"docid": "74b28bf27da2e024173e476817ddb5fe",
"score": "0.58519155",
"text": "def convert\n @content\n end",
"title": ""
},
{
"docid": "42a8172b86d3d2b7230a1ff631f59160",
"score": "0.58329755",
"text": "def convert(dataModel)\r\n @visMapping.convert(dataModel, self)\r\n end",
"title": ""
},
{
"docid": "52d304cbd8d55dfa5b12db0b9825f548",
"score": "0.5827634",
"text": "def convert(from, to)\n # if we are converting from a metric value\n if(is_metric?(from))\n # because from is metric, convert to centimeters\n cm = self.to_cm(from)\n\n # if we are converting to a metric value, convert the value\n if(is_metric?(to))\n if(to == \"mm\")\n cm.to_mm.round_2\n\n elsif(to == \"cm\")\n cm.round_2\n\n elsif(to == \"m\")\n cm.to_m.round_2\n\n elsif(to == \"km\")\n cm.to_km.round_2\n end\n\n # the value we are converting to is not metric, so convert the value to inches\n else\n inches = cm.to_inches(\"cm\")\n\n # if we are converting to English values, perform the conversion\n if(to == \"in\")\n inches.round_2\n\n elsif(to == \"ft\")\n inches.to_ft.round_2\n\n elsif(to == \"yd\")\n inches.to_yd.round_2\n\n elsif(to == \"mi\")\n inches.to_mi.round_2\n end\n end\n\n else\n # the value we are converting from is not metric\n inches = self.to_inches(from)\n\n # if the value we are converting to is metric, convert inches to centimeters and make the final conversion\n if(is_metric?(to))\n cm = inches.to_cm(\"in\")\n \n if(to == \"mm\")\n cm.to_mm.round_2\n\n elsif(to == \"cm\")\n cm.round_2\n\n elsif(to == \"m\")\n cm.to_m.round_2\n\n elsif(to == \"km\")\n cm.to_km.round_2\n end\n\n # the value we are converting to is in the English system, so perform the conversion\n else\n if(to == \"in\")\n inches.round_2\n\n elsif(to == \"ft\")\n inches.to_ft.round_2\n\n elsif(to == \"yd\")\n inches.to_yd.round_2\n \n elsif(to == \"mi\")\n inches.to_mi.round_2\n end\n end\n end\n end",
"title": ""
},
{
"docid": "cc05bf36a8d239e3ec2be7f22b035c76",
"score": "0.5817836",
"text": "def encoder=(_); end",
"title": ""
},
{
"docid": "274957a92f79eb84896d069c6fe5cda8",
"score": "0.58153385",
"text": "def reverting=(_arg0); end",
"title": ""
},
{
"docid": "1546ffa4d3b63c4b03739a27e186a4ef",
"score": "0.5799867",
"text": "def ruby_input_conversion(obj); obj; end",
"title": ""
},
{
"docid": "f801a53c1dff758445d83b67acb06570",
"score": "0.5797026",
"text": "def convert (*filters)\n dup.convert!(*filters)\n end",
"title": ""
},
{
"docid": "e4bb0e91919c3b88bf79682232ba9a07",
"score": "0.5793212",
"text": "def normalize\n end",
"title": ""
},
{
"docid": "e4bb0e91919c3b88bf79682232ba9a07",
"score": "0.5793212",
"text": "def normalize\n end",
"title": ""
},
{
"docid": "e13689e47c8b1f32756b8bd753454625",
"score": "0.5792404",
"text": "def normalize\n end",
"title": ""
},
{
"docid": "e13689e47c8b1f32756b8bd753454625",
"score": "0.5792404",
"text": "def normalize\n end",
"title": ""
},
{
"docid": "e13689e47c8b1f32756b8bd753454625",
"score": "0.5792404",
"text": "def normalize\n end",
"title": ""
},
{
"docid": "e13689e47c8b1f32756b8bd753454625",
"score": "0.5792404",
"text": "def normalize\n end",
"title": ""
},
{
"docid": "e13689e47c8b1f32756b8bd753454625",
"score": "0.5792404",
"text": "def normalize\n end",
"title": ""
},
{
"docid": "b6aa67d0be0b3d374ea2585048062d4a",
"score": "0.57893413",
"text": "def database_to_internal(value); value.to_f; end",
"title": ""
},
{
"docid": "891c531d01b68e42d4ba7e589852d48e",
"score": "0.5783195",
"text": "def convert(data)\n @candidate_number = data[0]\n @lastname = data[1]\n @firstname = data[2]\n @candidate_name = data[3]\n @alliance_name = data[11]\n end",
"title": ""
},
{
"docid": "124998e0c7a9a4201748c093b6268da6",
"score": "0.57733256",
"text": "def encode\n \n end",
"title": ""
},
{
"docid": "748b49b2f9099b80bdc50eb4f52ec2ef",
"score": "0.57726383",
"text": "def convert(original, source_type, target_type)\n converter_factory.converter(source_type, target_type).convert_content(original)\n end",
"title": ""
},
{
"docid": "876b963c40598a360335b36629211cd7",
"score": "0.57533735",
"text": "def to_a() end",
"title": ""
},
{
"docid": "c2a38727cf07e9f1a621eda9eced5598",
"score": "0.5735735",
"text": "def normalize!; end",
"title": ""
},
{
"docid": "c2a38727cf07e9f1a621eda9eced5598",
"score": "0.5735735",
"text": "def normalize!; end",
"title": ""
},
{
"docid": "c2a38727cf07e9f1a621eda9eced5598",
"score": "0.5735735",
"text": "def normalize!; end",
"title": ""
},
{
"docid": "c2a38727cf07e9f1a621eda9eced5598",
"score": "0.5735735",
"text": "def normalize!; end",
"title": ""
},
{
"docid": "c2a38727cf07e9f1a621eda9eced5598",
"score": "0.5735735",
"text": "def normalize!; end",
"title": ""
},
{
"docid": "e8e937d608f0fd3e9e7a0ce2c607884a",
"score": "0.57283986",
"text": "def bulk_convert_list\n parse_raw_list\n\n @input_list.each do |phrase|\n convert(phrase)\n end\n end",
"title": ""
},
{
"docid": "64696223138bf75c5ec574c36f08b9bf",
"score": "0.5725977",
"text": "def convert_shgc ()\n \n end",
"title": ""
},
{
"docid": "5e696b6583fdcd64aee94fd975250aad",
"score": "0.57203007",
"text": "def convert\n Unparser.unparse(generate_functions(extract_functions(@source)))\n end",
"title": ""
},
{
"docid": "e1e34375f452dc350d801624bf71fd2f",
"score": "0.5714259",
"text": "def do_convert(args, model) \n #puts 'array', args\n if args.is_a? (Array)\n array = []\n args.try(:each) do |arg|\n array << convert_type( arg, model )\n end\n array\n else\n puts 'object'\n convert_type( args, model ) \n end\n end",
"title": ""
},
{
"docid": "2edac5defd3ebf3683f29f452f5525b9",
"score": "0.5705279",
"text": "def convert\n @convert ||= executable(dependency_filename(:convert))\n end",
"title": ""
},
{
"docid": "e12418c86700ed421e29e7229eb5fb8c",
"score": "0.57048887",
"text": "def standardize!; end",
"title": ""
},
{
"docid": "b9dafdd46da0f6cb7460eee941525edb",
"score": "0.57023835",
"text": "def convert(file)\n # Convert the content: delegated to sub-classes.\n self.convert_content(file)\n end",
"title": ""
},
{
"docid": "03b08d89daba57f2ca7616db490f4a42",
"score": "0.5687118",
"text": "def convert(format, page = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "a0ec8b537014849734d85544768bbc48",
"score": "0.5683564",
"text": "def to_foodcalorie(**options) = convert_to('foodcalorie', **options)",
"title": ""
},
{
"docid": "3268b2b223aa8d0bea67d30b8b3a9c5c",
"score": "0.56770074",
"text": "def encoder=(_arg0); end",
"title": ""
},
{
"docid": "700ce1732232c4500909fa42d1fc0640",
"score": "0.5675514",
"text": "def convert_result(value)\n if convert? & !blank?(value)\n converter_registry.(@convert, value)\n else\n value\n end\n end",
"title": ""
},
{
"docid": "37a622b0927f01c934bde2f047fd8aa8",
"score": "0.5672723",
"text": "def convert_encoding(content); end",
"title": ""
},
{
"docid": "350373bc103f8af4d226d290889d5c96",
"score": "0.56716627",
"text": "def convert(args)\n\t\t\t@option = {\n\t\t\t\t:number => nil,\n\t\t\t\t:cust_numerals => nil,\n\t\t\t\t:clr_cust_rn => false\t\n\t\t\t}\n\t\t\t@float = {}\n\t\t\tIntToRn::Config.config(false)\n\t\t\toption_parse(args) if args.class == Array\n\t\t\twork \n\t\tend",
"title": ""
}
] |
2c7a4352535f8d5947da0cec5dd94d95 | Check for a valid physattr name Automatically add the plyrattr if it does not exists Returns the plyrattr object if it exists | [
{
"docid": "8ddc8c8d85e85f94d80a54f1e0acf19f",
"score": "0.76803565",
"text": "def plyrattr_exists?(rattr_name)\n rattr = self.plyrattrs.where(name: rattr_name).first\n\n # We are done if the rattr exists\n return rattr if rattr != nil\n\n # Now check if the name actually exists\n pattr = Physattr.name_exists? rattr_name\n # If the pattr doesn't exist, we are done\n return nil unless pattr != nil\n\n # Since it does exist, we add it to the list\n new = Plyrattr.new\n new.name = pattr.name\n new.base_value = 0\n self.plyrattrs << new\n return new\n end",
"title": ""
}
] | [
{
"docid": "342bd78c2f2e02ad5636a4b936a0d805",
"score": "0.7545392",
"text": "def physattr_exists?(rattr_name)\n plyrattr_exists?(rattr_name)\n end",
"title": ""
},
{
"docid": "351c7745085e41469a9bf2278606ebea",
"score": "0.7037498",
"text": "def physattr_exists?(rattr_name)\n typeattr_exists?(rattr_name)\n end",
"title": ""
},
{
"docid": "91cf4d05ed189250a5a6f8cc6fd91a0e",
"score": "0.66840935",
"text": "def typeattr_exists?(tattr_name)\n tattr_name.capitalize!\n\n tattr = self.typeattrs.where(name: tattr_name).first\n\n # We are done if the tattr exists\n return tattr if tattr != nil\n\n # Now check if the name actually exists\n pattr = Physattr.name_exists? tattr_name\n # If the pattr doesn't exist, we are done\n return nil unless pattr != nil\n\n # Since it does exist, we add it to the list\n new = Raceattr.new\n new.name = pattr.name\n new.value = 0\n self.typeattrs << new\n return new\n end",
"title": ""
},
{
"docid": "8cf16bde16034e22347d6a461665426b",
"score": "0.6047037",
"text": "def valid_attr?(attr_name)\n proc = get_proc(attr_name)\n return true if proc.nil?\n proc.call(self.send(attr_name))\n end",
"title": ""
},
{
"docid": "d7fbb092960c0a2627681860633e9d23",
"score": "0.5952529",
"text": "def attribute_present?(attr_name); end",
"title": ""
},
{
"docid": "02d1147df418fcb1bc06a920b5300919",
"score": "0.58085704",
"text": "def attr!(name)\n @attr_by_name[name] or raise NotFound.new(\"Attribute #{name.inspect} not found\")\n end",
"title": ""
},
{
"docid": "0fbb29e39729ba5177b9191ef922d87e",
"score": "0.57278395",
"text": "def handle_attr(var_name, attr_name, read, write)\n rw = ''\n rw << 'R' if '1' == read\n rw << 'W' if '1' == write\n\n class_name = @known_classes[var_name]\n\n return unless class_name\n\n class_obj = find_class var_name, class_name\n\n return unless class_obj\n\n comment = find_attr_comment var_name, attr_name\n comment = strip_stars comment\n\n name = attr_name.gsub(/rb_intern\\(\"([^\"]+)\"\\)/, '\\1') # \"\n\n attr = RDoc::Attr.new '', name, rw, comment\n\n attr.record_location @top_level\n class_obj.add_attribute attr\n @stats.add_attribute attr\n end",
"title": ""
},
{
"docid": "477daded5fe1fcf4833feef5d28df0b8",
"score": "0.56537133",
"text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end",
"title": ""
},
{
"docid": "774a366b9f69fd65cf48be53dd57842f",
"score": "0.5635507",
"text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end",
"title": ""
},
{
"docid": "6974e94cc8d2942ea4160ab908cdd617",
"score": "0.56070834",
"text": "def attribute(attr = nil)\n return @attribute if attr.nil?\n\n @attribute = if @type.key?(NWTYPE_L2)\n L2NodeAttribute.new(**attr)\n elsif @type.key?(NWTYPE_L3)\n L3NodeAttribute.new(**attr)\n elsif @type.key?(NWTYPE_OPS)\n OpsNodeAttribute.new(**attr)\n elsif @type.key?(NWTYPE_MDDO_L1)\n MddoL1NodeAttribute.new(**attr)\n elsif @type.key?(NWTYPE_MDDO_L2)\n MddoL2NodeAttribute.new(**attr)\n elsif @type.key?(NWTYPE_MDDO_L3)\n MddoL3NodeAttribute.new(**attr)\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "0c2d914d58cea5430969341c15a0ae03",
"score": "0.55742705",
"text": "def attribute(name)\n attributes.each { |a| return a if a.property.id =~ /\\/#{name}$/ }\n nil\n end",
"title": ""
},
{
"docid": "926c028896b367ee6750b88ab984a864",
"score": "0.55115235",
"text": "def attribute(name, raise_if_unfound = false)\n return name if Attribute===name\n a = attributes[name]\n raise \"No such attribute #{name}\" if a.nil? and raise_if_unfound\n a\n end",
"title": ""
},
{
"docid": "1be9e3912779020b5161a3c6c324e74f",
"score": "0.55022436",
"text": "def dangerous_attribute?(name)\n return false if attribute_names.include?(name.to_s)\n\n attribute_methods(name).detect do |method_name|\n allocate.respond_to?(method_name, true)\n end\n end",
"title": ""
},
{
"docid": "80892a3491afa2944e9e7ee03f06409e",
"score": "0.5474282",
"text": "def attribute_in_database(attr_name); end",
"title": ""
},
{
"docid": "e96530cbe4855e15f3f61213ac111c78",
"score": "0.5473569",
"text": "def is_flex_attribute?(attr)\n extended_attribute_names.include? attr.to_s\n rescue\n false\n end",
"title": ""
},
{
"docid": "6b3ec34eb4dbe960ef89f30dfe7e8ff9",
"score": "0.5469197",
"text": "def local_attr?(name, expect_val = nil)\n attr?(name, expect_val, false)\n end",
"title": ""
},
{
"docid": "960fe96716aaa959d1fdb728463bb7c1",
"score": "0.54666525",
"text": "def isPropattr\n @RecordType == PROPATTR\n end",
"title": ""
},
{
"docid": "64877fb5007eff1eed7e0d0d6d6527b9",
"score": "0.5438497",
"text": "def hasAttr(attrName)\n RubyPython::Python.PyObject_HasAttrString(@pointer, attrName) == 1\n end",
"title": ""
},
{
"docid": "64877fb5007eff1eed7e0d0d6d6527b9",
"score": "0.5438497",
"text": "def hasAttr(attrName)\n RubyPython::Python.PyObject_HasAttrString(@pointer, attrName) == 1\n end",
"title": ""
},
{
"docid": "ba87c3e819e48eca03dd818937d4f0b5",
"score": "0.5415253",
"text": "def allow_attribute_removal?(attr)\n if attr.is_a?(SampleAttribute)\n return true if attr.new_record?\n attr = attr.accessor_name\n end\n if attr\n all_blank?(attr)\n else\n true\n end\n end",
"title": ""
},
{
"docid": "d9b97777533de1d5f393fbdb9a23d37c",
"score": "0.53838205",
"text": "def has_attribute?(attr_name)\n attr_name = attr_name.to_s\n attr_name = attribute_aliases[attr_name] || attr_name\n attribute_types.key?(attr_name)\n end",
"title": ""
},
{
"docid": "946f63b4ce95d5c9a2c02761a59e245f",
"score": "0.53820616",
"text": "def add_attribute(attribute_name)\n if self.base_attributes.create(:name => attribute_name)\n return true\n else\n self.base_attributes << BaseAttribute.find_by(:name => attribute)\n end\n end",
"title": ""
},
{
"docid": "4f4d0211723583aced812478202dc3ab",
"score": "0.5380019",
"text": "def attribute_exists?(cn, attribute)\n if cn.nil? || attribute.nil?\n raise AdManagement::ArgumentError, 'Required attribute_exists? parameter(s) not provided!'\n end\n get(cn).key? attribute.downcase.to_sym\n end",
"title": ""
},
{
"docid": "1a3f31e45e3766f426cce489d9300d73",
"score": "0.5364818",
"text": "def set_attr_privilege( attr_name )\n how = self.new_record? ? :initialize_attribute : :update_attribute\n self.class.reflected_privilege( how, attr_name )\n end",
"title": ""
},
{
"docid": "82192b3eb06a7be30de3e445a3ef6a45",
"score": "0.53617996",
"text": "def attr(name)\n Utility::check_types({ name=>String }) if $DEBUG\n @attrs[name]\n end",
"title": ""
},
{
"docid": "82192b3eb06a7be30de3e445a3ef6a45",
"score": "0.53617996",
"text": "def attr(name)\n Utility::check_types({ name=>String }) if $DEBUG\n @attrs[name]\n end",
"title": ""
},
{
"docid": "fefb4fb84c4a837cf5fff9315ce4ae0d",
"score": "0.53549486",
"text": "def normalize_attr( name )\n case name\n when String, nil; name.to_s\n when Symbol; name.to_s\n when Array; name.join('.')\n else\n raise Error, \"cannot convert #{name.inspect} into an attribute identifier\"\n end\n end",
"title": ""
},
{
"docid": "3801a489c5b796a0b192da805e5ff975",
"score": "0.5327071",
"text": "def newattr(name)\n if name.is_a?(Class)\n klass = name\n name = klass.name\n end\n\n klass = self.class.attrclass(name)\n unless klass\n raise Puppet::Error, \"Resource type #{self.class.name} does not support parameter #{name}\"\n end\n\n if provider and ! provider.class.supports_parameter?(klass)\n missing = klass.required_features.find_all { |f| ! provider.class.feature?(f) }\n debug \"Provider %s does not support features %s; not managing attribute %s\" % [provider.class.name, missing.join(\", \"), name]\n return nil\n end\n\n return @parameters[name] if @parameters.include?(name)\n\n @parameters[name] = klass.new(:resource => self)\n end",
"title": ""
},
{
"docid": "aa025950caa9058a6b5c9c8d86e60973",
"score": "0.5325848",
"text": "def xattr name\n # xattr is not permitted on special files and does not work with broken symlinks\n return nil if self.file_type =~ /Fifo|Device/ or (not self.exist?)\n # /usr/bin/xattr does not expose the com.apple.decmpfs extended attribute,\n # and hides com.apple.ResourceFork for files with HFS+ compression enabled\n # in the resource fork. In these cases, we use xattr-util instead of xattr.\n if 'com.apple.decmpfs' == name or ('com.apple.ResourceFork' == name and self.compressed?)\n xattr_util = Pathname.new(__FILE__).parent.parent.parent + 'bin/xattr-util'\n begin\n return (run_baby_run xattr_util, ['--get', name, self], :err => '/dev/null', :sudo => (not self.owned?)).chomp!\n rescue\n return nil\n end\n else\n begin\n return (run_baby_run '/usr/bin/xattr', ['-s', '-p', name, self], :err => '/dev/null', :sudo => (not self.owned?)).chomp!\n rescue\n return nil\n end\n end\n end",
"title": ""
},
{
"docid": "54bddf75740a20593a017e8f26e61c80",
"score": "0.5316692",
"text": "def ldap_attribute_map\n {\n 'uid' => 'uid',\n 'sAMAccountName' => 'uid',\n 'uidNumber' => 'uid_number',\n 'gid' => 'gid',\n 'gidNumber' => 'gid_number',\n 'cn' => Proc.new{self.generate_cn},\n 'givenName' => 'first_name',\n 'sn' => 'last_name',\n 'telephoneNumber' => 'phone',\n 'mail' => 'email',\n 'unicodePwd' => Proc.new{self.ad_encoded_password},\n 'homeDirectory' => 'unix_home_directory',\n 'loginShell' => 'shell',\n 'gecos' => Proc.new{self.generate_gecos},\n 'objectCategory' => Proc.new{object_category},\n 'userAccountControl' => Proc.new{user_account_control},\n }\n end",
"title": ""
},
{
"docid": "a310e2e2203e68484328df84df9e504d",
"score": "0.5309677",
"text": "def has_attribute?(attr_name); end",
"title": ""
},
{
"docid": "a310e2e2203e68484328df84df9e504d",
"score": "0.5309677",
"text": "def has_attribute?(attr_name); end",
"title": ""
},
{
"docid": "81bce4568d76418d4a24bc32a30bce56",
"score": "0.52940047",
"text": "def is_pseudo_attr(model, name)\n # see if there is a method to assign to it\n model.instance_methods.include? (name + \"=\").to_sym\n end",
"title": ""
},
{
"docid": "7894b17eff72ce46e2674e46940562da",
"score": "0.5287837",
"text": "def attribute(which_ldap)\n @LDAP[env][which_ldap][:attribute] || \"uid\"\n end",
"title": ""
},
{
"docid": "46d7aa943c89dda242a93d5125c4bc4b",
"score": "0.52842206",
"text": "def has_attribute?(attr_name)\n @attrs.has_key?(attr_name)\n end",
"title": ""
},
{
"docid": "39aab8312b98eaa7a7a2d13135e8e12a",
"score": "0.5278479",
"text": "def read_attribute_for_cleaning(attr_name)\n send(attr_name)\n end",
"title": ""
},
{
"docid": "771bffb8fbd6a65bd4fcbaf63077f63e",
"score": "0.5269321",
"text": "def create_attr_mapping(attr_name)\r\n #return @attr_hash[attr_name] if @attr_hash[attr_name]\r\n attr_id = @db_interface.increment_hash(@key_builder.attr_mapping_key, Transformer::KeyElementBuilder::ITERATOR_KEY, 1, true)\r\n #result = @db_interface.add_to_hash_ne(@key_builder.attr_mapping_key, attr_name, attr_id, true)\r\n result = true\r\n if result\r\n @db_interface.add_to_hash(@key_builder.attr_mapping_key, [attr_name, attr_id], true)\r\n @attr_hash[attr_name] = attr_id\r\n return attr_id\r\n end\r\n false\r\n end",
"title": ""
},
{
"docid": "2ec37da0c5bc2c41f9bace26699b5172",
"score": "0.52661103",
"text": "def attribute(name)\n @attributes[:basic].select { |p| p.name == name }.first ||\n @attributes[:full].select { |p| p.name == name }.first ||\n @attributes[:expansion].select { |p| p.name == name }.first\n end",
"title": ""
},
{
"docid": "4b5da6b681bbf96877bda7051562929e",
"score": "0.5255921",
"text": "def add_portal_resource(symbol)\n attribute_name = get_attr(\"#{symbol}_name\")\n attribute = get_attr(symbol)\n portal_clazz = \"Portal::#{symbol.to_s.capitalize}\".constantize\n if self.allow_teacher_creation(symbol)\n if attribute_name && (!attribute_name.blank?)\n find_attributes = {:name => attribute_name}\n if @district && (@district.kind_of? Portal::District)\n find_attributes[:district_id] = @district.id\n end\n attribute = portal_clazz.find_by_similar_or_new(find_attributes,'registration')\n if attribute.new_record?\n # TODO: We should probably shouldn't create new\n # records if there isn't a current user ...\n attribute.state = @state\n attribute.save\n end\n set_attr(symbol,attribute) \n return !attribute.nil?\n end\n end\n return false\n return false if @school.nil?\n end",
"title": ""
},
{
"docid": "458896794026206b3871a4a57968eb0e",
"score": "0.5249696",
"text": "def attribute_present?(name)\n @_object.respond_to?(name) ||\n (Rabl.configuration.raise_on_missing_attribute &&\n raise(\"Failed to render missing attribute #{name}\"))\n end",
"title": ""
},
{
"docid": "8ddd82ebcd32ccc061a7e94a94469040",
"score": "0.5247188",
"text": "def check_attribute?(attr_value, attr_name)\n raise Chef::Exceptions::AttributeNotFound, attr_name if attr_value.nil?\n end",
"title": ""
},
{
"docid": "1f3c2f6c663e00c674b90059077eed8b",
"score": "0.52451444",
"text": "def rdn_attribute(dn)\n Chef::Recipe::LDAPUtils.first_item(dn).keys.first.to_sym\n end",
"title": ""
},
{
"docid": "49fb495599e190d51cf2c1b40c23ce32",
"score": "0.52445525",
"text": "def blind_attribute?(attr_name)\n Box.blind_attribute_names.include?(attr_name)\n end",
"title": ""
},
{
"docid": "b698422ab55100fca893a7eb6f01615e",
"score": "0.5234499",
"text": "def get_dynamic_attr(attr_name)\n mapped_data[attr_name]\n end",
"title": ""
},
{
"docid": "16d20ba640b02d42c7ede34a10c8168c",
"score": "0.52174205",
"text": "def attribute(name); end",
"title": ""
},
{
"docid": "ce1df3503d80baea7a1bff5c3bcf138d",
"score": "0.5215038",
"text": "def determine_condition_attribute (attname)\n\n #attname = [ attname ] unless attname.is_a?(Array)\n attname = Array(attname)\n\n attname.each do |aname|\n aname = aname.intern if aname.is_a?(String)\n return aname if has_attribute(aname)\n return aname if has_attribute(\"r#{aname.to_s}\")\n end\n\n nil\n end",
"title": ""
},
{
"docid": "e8a3e3408aad20da6c3d07cf44ffde1f",
"score": "0.52120405",
"text": "def find_attribute(name, ignore_case = false)\n\n if (ignore_case)\n @netcdf_elmt.findAttributeIgnoreCase(name)\n else\n @netcdf_elmt.findAttribute(name)\n end\n\n end",
"title": ""
},
{
"docid": "368b574b797a05dd8c33b76360bb1121",
"score": "0.52031994",
"text": "def uda_attr? attr\n attr.to_s.start_with? \"uda\"\n end",
"title": ""
},
{
"docid": "214c646aa26903ecb46a9467fab85783",
"score": "0.5201509",
"text": "def attribute_present?(name)\n attribute = read_raw_attribute(name)\n !attribute.blank? || attribute == false\n rescue Mongoid::Errors::AttributeNotLoaded\n false\n end",
"title": ""
},
{
"docid": "40fa2d95ac17a7946afef801541949dc",
"score": "0.519606",
"text": "def attribute(name); @_attributes[name]; end",
"title": ""
},
{
"docid": "2acd6d600117e68ee997d524ec2ca95f",
"score": "0.51943225",
"text": "def attr?(name)\n !node.getAttribute(name.to_s).nil?\n end",
"title": ""
},
{
"docid": "16211cf5c513091fb6155ad06627f969",
"score": "0.5185099",
"text": "def getAttr(attrName)\n pyAttr = RubyPython::Python.PyObject_GetAttrString @pointer, attrName\n self.class.new pyAttr\n end",
"title": ""
},
{
"docid": "355c195b5b70c1b664242593412ee96e",
"score": "0.51746833",
"text": "def dangerous_attribute_method?(name)\n method_defined_within?(name, Base)\n end",
"title": ""
},
{
"docid": "05a74793e731fac78b04bc4cc8b1d0a4",
"score": "0.517438",
"text": "def hasAttribute(name)\n !!has_attribute?(name.to_s.downcase)\n end",
"title": ""
},
{
"docid": "9f44497f8a2c095a855f6e29b36cb2ba",
"score": "0.517145",
"text": "def initialize_attr_privilege( attr_name )\n self.class.reflected_privilege( :initialize_attribute, attr_name )\n end",
"title": ""
},
{
"docid": "3746a5014a81d44a0e7c7d05e8f3cf60",
"score": "0.51677376",
"text": "def _read_attribute(attr_name, &block)\n return public_send(attr_name) if SYNTHETIC_KEYS.include?(attr_name.to_sym)\n super\n end",
"title": ""
},
{
"docid": "c389f818fc437da96e45fb98245e4edb",
"score": "0.5158236",
"text": "def local_attr(name, default_val = nil)\n attr(name, default_val, false)\n end",
"title": ""
},
{
"docid": "aaad5833e873a79119dbc53000f132b2",
"score": "0.5149878",
"text": "def getAttr(attrName)\n pyAttr = RubyPython::Python.PyObject_GetAttrString(@pointer, attrName)\n self.class.new pyAttr\n end",
"title": ""
},
{
"docid": "581b165276ed7c3ebb7fa8b0d509592f",
"score": "0.5149355",
"text": "def evaluate_attribute(name, local_attrs = {})\n if name.nil? || (name = name.strip).empty?\n nil\n elsif local_attrs.has_key?(name)\n local_attrs[name]\n elsif (parent = @component_stack.last) && (attr = parent.attributes[name])\n attr\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f5c5e00b7a9861dd2e5d1a74869a56c6",
"score": "0.5145992",
"text": "def safe_attribute?(attr, user=nil)\n safe_attribute_names(user).include?(attr.to_s)\n end",
"title": ""
},
{
"docid": "da934370213a399aaa987f5484b05fbf",
"score": "0.5140214",
"text": "def has_attribute?(attr_name)\n self.has_key?(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "cea10299ceb7ba2232efa2d3c91b55ae",
"score": "0.5138592",
"text": "def attribute?() @type.downcase.start_with?( 'attribute' ); end",
"title": ""
},
{
"docid": "ec47e64b39fa7480a55b92655045a81a",
"score": "0.5135628",
"text": "def safe_attr(obj, attr)\n obj.try(attr).presence || \"0\"\n end",
"title": ""
},
{
"docid": "c8a33d26e7f18fa51f61d9f959296ff8",
"score": "0.5132635",
"text": "def attribute(name)\n attributes.each { |a| return a if a.property.id == name }\n nil\n end",
"title": ""
},
{
"docid": "c8a33d26e7f18fa51f61d9f959296ff8",
"score": "0.5132635",
"text": "def attribute(name)\n attributes.each { |a| return a if a.property.id == name }\n nil\n end",
"title": ""
},
{
"docid": "d4aaad65188625069b85e436afd23e35",
"score": "0.5130633",
"text": "def attr() @records.get_data(GRT_PROPATTR); end",
"title": ""
},
{
"docid": "e34ca10265c8863ffc2c99f0291e322c",
"score": "0.51291335",
"text": "def require_attr(name)\n send(name).tap do |_|\n if _.respond_to?(:body)\n raise AttributeError, \"Attribute must be set: #{name}\" if _.body.nil? || _.body.empty?\n else\n raise AttributeError, \"Attribute must be set: #{name}\" if _.nil?\n end\n end\n end",
"title": ""
},
{
"docid": "004b278442c488026464860b34998483",
"score": "0.5125496",
"text": "def shadow_attr(*args) # :doc:\n attr_persists = true\n for arg in args\n case arg\n when Hash; var_map = arg.sort_by {|var, decl| var.to_s}\n when :reader; reader = true\n when :writer; writer = true\n when :nonpersistent; attr_persists = false\n when :persistent; attr_persists = true\n else\n raise SyntaxError,\n \"Unrecognized shadow_attr argument: #{arg.inspect}\"\n end\n end\n\n source_file = shadow_library_source_file\n ssn = shadow_struct_name\n @shadow_attrs ||= []\n \n meths = nil\n\n var_map.map do |var, decl|\n var = var.intern if var.is_a? String\n meths ||= instance_methods(false).map {|sym| sym.to_s} ## 1.9 compat\n\n if meths.include?(var.to_s) or\n meths.include?(var.to_s + '=')\n raise NameError, \"#{var} already has a Ruby attribute.\"\n end\n\n matches = AttributeTypes.collect { |t|\n [t, t.match(decl)]\n }.select {|t, match| match}\n\n if matches.size > 1\n raise StandardError, %{\n No unique AttributeType for '#{decl}':\n each of #{matches.map{|t|t[0]}.join \", \"} match.\n }.tabto(0)\n end\n\n if matches.size < 1\n raise StandardError, \"No Attribute type matches '#{decl}'.\"\n end\n\n attr_type, match = matches[0]\n attr = attr_type.new self, var, match, attr_persists\n each_shadow_attr { |a|\n if a.var == attr.var or a.cvar == attr.cvar\n unless a.var == attr.var and a.cdecl == attr.cdecl\n raise NameError, \"Attribute #{a.inspect} already exists.\"\n end\n end\n }\n @shadow_attrs << attr\n\n shadow_struct.declare attr.cvar => attr.cdecl\n\n new_method.attr_code attr.init if attr.init\n\n m = attr.mark and mark_function.mark m\n f = attr.free and free_function.free f\n\n if persistent?\n if attr_persists\n _dump_data_method.attr_code attr.dump\n _load_data_method.attr_code attr.load\n else\n i = attr.init and _load_data_method.attr_code i\n end\n end\n\n if reader\n unless attr.reader\n raise ScriptError, \"Can't have a reader method for #{attr}.\"\n end\n r_meth = source_file.define_c_method(self, var)\n r_meth.instance_eval {\n scope :extern\n declare :shadow => \"#{ssn} *shadow\"\n declare :result => \"VALUE result\"\n body \"Data_Get_Struct(self, #{ssn}, shadow)\", attr.reader\n returns \"result\"\n }\n end\n\n if writer\n unless attr.writer\n raise ScriptError, \"Can't have a writer method for #{attr}.\"\n end\n w_meth = source_file.define_c_method(self, \"#{var}=\")\n w_meth.instance_eval {\n scope :extern\n c_array_args {\n required :arg\n typecheck :arg => attr.check\n }\n declare :shadow => \"#{ssn} *shadow\"\n body \"Data_Get_Struct(self, #{ssn}, shadow)\", attr.writer\n returns \"arg\"\n }\n end\n \n [r_meth, w_meth]\n end\n end",
"title": ""
},
{
"docid": "79625c31873b19fc49942132704a2dd2",
"score": "0.5122392",
"text": "def attribute?(name)\n name[0] != ?_ && property?(name)\n end",
"title": ""
},
{
"docid": "cc08565692d82d07f6af756d50d9fc4e",
"score": "0.5114778",
"text": "def valid_attribute?(name)\n return true if defined_attribute_names.include?(name) || Array(deprecated_attributes).include?(name)\n\n unless Array(@reported_invalid_attributes).include? name\n warn \"ig_markets: unrecognized attribute #{self.name}##{name}\"\n (@reported_invalid_attributes ||= []) << name\n end\n\n false\n end",
"title": ""
},
{
"docid": "bdef8d21f71e06b908c2f799acb1a867",
"score": "0.5109506",
"text": "def has_attribute?(attr_name)\n @attributes.has_key?(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "23866cbdddf8ef3c7a918fe353333c4c",
"score": "0.5095558",
"text": "def attribute_present?(name)\n if @_object.respond_to?(name)\n return true\n elsif Rabl.configuration.raise_on_missing_attribute\n raise \"Failed to render missing attribute #{name}\"\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "bccb3693e1dce6dd839a2d9d3e677553",
"score": "0.5094936",
"text": "def set_attribute_unless_exists name, value\n set_attribute name, value unless @attributes.key? name\n nil\n end",
"title": ""
},
{
"docid": "e99c9dd678e880763c7e15bad59456ff",
"score": "0.5092832",
"text": "def has_attribute?(name)\n !attr(name).nil?\n end",
"title": ""
},
{
"docid": "d9211bc516a9e68adb72fe0792ad35ad",
"score": "0.508283",
"text": "def create_no_attr(attr)\n new_rubric_criteria = {\n name: 'somecriteria',\n assignment_id: Assignment.make,\n max_mark: 0.25,\n level_0_name: 'Horrible',\n level_1_name: 'Poor',\n level_2_name: 'Satisfactory',\n level_3_name: 'Good',\n level_4_name: 'Excellent'\n }\n\n new_rubric_criteria.delete(attr) if attr\n RubricCriterion.new(new_rubric_criteria)\n end",
"title": ""
},
{
"docid": "c37ae6f1b6b7f8017329f3f37236a8da",
"score": "0.5076706",
"text": "def attribute_supported_by_sql?(name)\n load_schema\n try(:attribute_alias?, name) ||\n (has_attribute?(name) && (!virtual_attribute?(name) || !!_virtual_arel[name.to_s]))\n end",
"title": ""
},
{
"docid": "c37ae6f1b6b7f8017329f3f37236a8da",
"score": "0.5076706",
"text": "def attribute_supported_by_sql?(name)\n load_schema\n try(:attribute_alias?, name) ||\n (has_attribute?(name) && (!virtual_attribute?(name) || !!_virtual_arel[name.to_s]))\n end",
"title": ""
},
{
"docid": "fdada3b0ca06bb6c507cf6d551307627",
"score": "0.50761724",
"text": "def url_attr?(attr_name)\n return false unless @url_attributes\n case attr_name\n when nil \n return false\n when Symbol\n when String\n attr_name = attr_name.intern\n else\n attr_name = attr_name.to_s.intern\n end\n @url_attributes[attr_name]\n end",
"title": ""
},
{
"docid": "23b5db143d616fb50d8dee1b7ccf1a1c",
"score": "0.50741476",
"text": "def attribute_alias?(new_name); end",
"title": ""
},
{
"docid": "23b5db143d616fb50d8dee1b7ccf1a1c",
"score": "0.50741476",
"text": "def attribute_alias?(new_name); end",
"title": ""
},
{
"docid": "6c4e639c9e2b6d6c800e43bb01a5a551",
"score": "0.50688857",
"text": "def user_set_real_name(attribs, dir_info)\n attribs = user_record_name_alternatives(attribs)\n\n attribs[:value] = attribs[:value] || attribs[:common_name]\n attribs[:value] = attribs[:value] || attribs[:cn]\n attribs[:value] = attribs[:value] || attribs[:realname]\n attribs[:value] = attribs[:value] || attribs[:real_name]\n attribs[:value] = attribs[:value] || attribs[:fullname]\n attribs[:value] = attribs[:value] || attribs[:full_name]\n if attribs[:last_name] or attribs[:first_name]\n attribs[:value] = attribs[:value] || \"#{attribs[:first_name]} #{attribs[:last_name]}\"\n end\n attribs[:value] = attribs[:value] || attribs[:record_name]\n\n check_critical_attribute( attribs, :record_name )\n check_critical_attribute( attribs, :value, :real_name )\n attribs = tidy_attribs(attribs)\n\n command = {action: 'create', scope: 'Users', attribute: 'RealName'}\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": "1c25b75a66197c2f874aeb5d3b6af72e",
"score": "0.50653636",
"text": "def has_attribute?(attr_name)\n @attributes.key?(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "1c25b75a66197c2f874aeb5d3b6af72e",
"score": "0.50653636",
"text": "def has_attribute?(attr_name)\n @attributes.key?(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "a3aad38fc79099c9c78027cdb23c2098",
"score": "0.5063295",
"text": "def _get_attr(name)\n send(name)\n end",
"title": ""
},
{
"docid": "720f1f3c5d53fa3af3c9bf8f30e9a8e7",
"score": "0.5063278",
"text": "def source_attribute_from_preserved_attribute(attribute_name)\n attribute_name.to_s.sub(ORIGINAL_ATTRIBUTE_PREFIX, \"\") if attribute_name.start_with?(ORIGINAL_ATTRIBUTE_PREFIX)\n end",
"title": ""
},
{
"docid": "514a1cb9a5d1623792e6dd02bcc164df",
"score": "0.5061223",
"text": "def attr_name=(_); end",
"title": ""
},
{
"docid": "514a1cb9a5d1623792e6dd02bcc164df",
"score": "0.5061223",
"text": "def attr_name=(_); end",
"title": ""
},
{
"docid": "4ec838c5d52941f30a314af3a32887a7",
"score": "0.50597507",
"text": "def getpwattr(pwattr)\n passwd = Etc.getpwuid(Process::Sys.getuid) || {}\n passwd[pwattr]\n end",
"title": ""
},
{
"docid": "3ad0a9705398e1917742015b25a9aa2a",
"score": "0.50565195",
"text": "def loaded_fully_qualified_attribute?(cookbook, attribute_file)\n loaded_attributes_hash.key?(\"#{cookbook}::#{attribute_file}\")\n end",
"title": ""
},
{
"docid": "3d2acedb7e5392270525fa9b1edfc9e7",
"score": "0.50563645",
"text": "def process_level_up_attr(param, value)\n load_base_attrs(param, value)\n end",
"title": ""
},
{
"docid": "08f80b754170ae02a2670f88c1f15466",
"score": "0.5054948",
"text": "def has_attribute?(attr_name)\n @attributes.has_key?(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "08f80b754170ae02a2670f88c1f15466",
"score": "0.5054654",
"text": "def has_attribute?(attr_name)\n @attributes.has_key?(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "08f80b754170ae02a2670f88c1f15466",
"score": "0.5054654",
"text": "def has_attribute?(attr_name)\n @attributes.has_key?(attr_name.to_s)\n end",
"title": ""
},
{
"docid": "246d8da7b7f950a112f39455873fa39d",
"score": "0.50542945",
"text": "def hasLDAP?\n !attrs['dn'].nil?\n end",
"title": ""
},
{
"docid": "0b5ba0ced42f09b8ca5e598d7e6c12fc",
"score": "0.50527877",
"text": "def dangerous_attribute_method?(name) # :nodoc:\n method_defined_within?(name, Base)\n end",
"title": ""
},
{
"docid": "93801154141c0631f5163844e0df7442",
"score": "0.5041964",
"text": "def allow_name_change?(attr)\n if attr.is_a?(SampleAttribute)\n return true if attr.new_record?\n attr = attr.accessor_name\n end\n if attr\n !samples?\n else\n true\n end\n end",
"title": ""
},
{
"docid": "66a39de76ed027197fbcc6891afd94f9",
"score": "0.5041722",
"text": "def attribute?(attr)\n attribute(attr).present?\n end",
"title": ""
},
{
"docid": "9dbaf0780543362261ca47af31b6a2d0",
"score": "0.5036607",
"text": "def [](attr_name)\n attr = self.class.value_semantics.attributes.find do |attr|\n attr.name.equal?(attr_name)\n end\n\n if attr\n public_send(attr_name)\n else\n raise UnrecognizedAttributes, \"`#{self.class}` has no attribute named `#{attr_name.inspect}`\"\n end\n end",
"title": ""
},
{
"docid": "9e5aec1e6c0516259e6491ad3c1a17a6",
"score": "0.5032565",
"text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tivar = \"@#{attrname}\"\n\t\t\t\tinstance_variable_defined?( ivar ) && instance_variable_get( ivar ) ?\n\t\t\t\t\ttrue :\n\t\t\t\t\tfalse\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "94cca28dc189d21bc9cbb8d365051597",
"score": "0.50323594",
"text": "def take_attr(attr_name)\n new_attr_level = attrs[attr_name] + 1\n if new_attr_level > 10\n return [nil, \"#{attr_name}: Attr level beyond 10\"]\n end\n new_skill_point = skill_point - [0, 1, 1, 1, 2, 2, 3, 3, 4, 5][new_attr_level]\n if new_skill_point < 0\n return [nil, \"#{attr_name}: Insufficient skill point\"]\n end\n [Player.new(level, new_skill_point, attrs.merge(attr_name => new_attr_level), perks), nil]\n end",
"title": ""
}
] |
af2b441aa027e1c5a7712b4d105cbafe | Test that a string of a negative integer value is treated as an invalid positive integer | [
{
"docid": "63040d2d61b974b6932dc311c59c48ef",
"score": "0.72157836",
"text": "def test_verify_pos_int_negative\n refute verify_positive_int('-1')\n end",
"title": ""
}
] | [
{
"docid": "0aad601d361d1a200dbfce4751f5b131",
"score": "0.75520307",
"text": "def is_positive_int(string)\n\t!!(string =~ /^[0-9]+$/)\nend",
"title": ""
},
{
"docid": "ed00a4ff058a13b97fefb01346559453",
"score": "0.75012803",
"text": "def valid_number?(intString)\n intString.to_i.to_s == intString && intString.to_i != 0\nend",
"title": ""
},
{
"docid": "7cb3e53bb83a3ce0846ae38d22248ba6",
"score": "0.74828756",
"text": "def checkInt(s)\n /\\A[-+]?\\d+\\z/ === s\n end",
"title": ""
},
{
"docid": "7d25e9234f738239676d01bfbef1558e",
"score": "0.7337963",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i > -1 && number_string.to_i < 101\nend",
"title": ""
},
{
"docid": "c52a5492c96fb10cf49a9a3acf98a4ad",
"score": "0.7308361",
"text": "def confirm_positive_integer(count_str)\n begin\n count = count_str.to_i\n rescue\n complain(\"Not a valid integer: '#{count_str}'\")\n end\n complain(\"Expecting a positive integer, not '#{count_str}'\") unless count > 0\n count\n end",
"title": ""
},
{
"docid": "74146d74be5ba7d8c67efeef0eb9a71d",
"score": "0.7283006",
"text": "def valid_int(int)\n int > 0 && int.to_s.to_i == int\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "2b9311bff164644da42d6b4ba8d5c3a3",
"score": "0.726349",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "42e9e99e613840a2eac445f64558ad8a",
"score": "0.7236724",
"text": "def valid_number?(number_string)\r\n number_string.to_i.to_s == number_string && number_string.to_i != 0 \r\n end",
"title": ""
},
{
"docid": "00593b5db8a26f15e9d5629ddc6e329f",
"score": "0.72346467",
"text": "def test_neg_val\n set_rules = Rules.new\n input = '-11'\n actual = set_rules.pos_neg_int? input\n expected = true\n assert_equal expected, actual\n end",
"title": ""
},
{
"docid": "2ab954c6a583f5c6239c7cb76dc9291d",
"score": "0.7222577",
"text": "def verify_positive_int(string)\n num_prospectors = Integer(string) rescue nil\n return false unless num_prospectors\n\n num_prospectors >= 0\nend",
"title": ""
},
{
"docid": "1ebe0198bb4f4bffc20267ab99c26e68",
"score": "0.7170505",
"text": "def valid_number?(number_string)\n number_string_to.i.to_s == number_string && number_string.to_ ! = 0\nend",
"title": ""
},
{
"docid": "9928f2050d3716a15b7038304e60ecca",
"score": "0.7161788",
"text": "def valid_number?(number_string)\n\tnumber_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "0960a77f963a029e1266e4c45a25e69d",
"score": "0.71453995",
"text": "def valid_input(string)\n if string == '0' || string.to_i.to_s != string\n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "48005d5636620d350a3f9e9faae3c0b0",
"score": "0.7135789",
"text": "def test_negative_integers\n (-1000..-1).each do |digit|\n assert_tokenises_as digit.to_s, IntegerToken.new(digit)\n end\n assert_tokenises_as '-1 ', IntegerToken.new(-1)\n assert_tokenises_as ' -1', IntegerToken.new(-1)\n end",
"title": ""
},
{
"docid": "b975a247518638b47dff2780d6ced44f",
"score": "0.71119964",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "6a0aa8ae715be9e11dcc38a926c6c6b9",
"score": "0.7106467",
"text": "def validate_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "9962d44f7c8240ed224d25eb4a66c286",
"score": "0.7084908",
"text": "def ensure_non_negative_number(number)\n number > 0 ? number : 0\n end",
"title": ""
},
{
"docid": "94775fdfabf28613f6870a738d86ac9f",
"score": "0.7076902",
"text": "def test_invalid_val_symbol\n set_rule = Rules.new\n actual = set_rule.pos_int? '-'\n expected = false\n assert_equal expected, actual\n end",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "f26b320cbcb190b8e946d22c64edc0e9",
"score": "0.7065991",
"text": "def valid_integer?(string)\n string.to_i.to_s == string\nend",
"title": ""
},
{
"docid": "d60c55feab511c19b0507c4929ace9fe",
"score": "0.7049188",
"text": "def verify_int(string)\n Integer(string) rescue nil\nend",
"title": ""
},
{
"docid": "55809185be271742c3c768318329e18f",
"score": "0.70491755",
"text": "def validate_non_negative_integer(source, value)\n if !value.is_a?(Integer) || value < 0\n raise ArgumentError, \"#{source} must be a non-negative integer\"\n end\n value\n end",
"title": ""
},
{
"docid": "e1df6d20b82c69e94eb27b9a3e06a3e1",
"score": "0.70464045",
"text": "def valid_number?(numbers_string)\n numbers_string.to_i.to_s == numbers_string && numbers_string.to_i != 0\nend",
"title": ""
},
{
"docid": "a7c4f611a5f9059dc1cedfd313731355",
"score": "0.7035535",
"text": "def valid_number_2?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "b5a43ca563c68f790369283f2756cad8",
"score": "0.7030821",
"text": "def test_reject_negatives\n assert_raise( NegativeNumbersNotAllowed ) { @@calc.add(\"-7\") }\n assert_raise( NegativeNumbersNotAllowed ) { @@calc.add(\"-7,-4,-1\") }\n assert_raise( NegativeNumbersNotAllowed ) { @@calc.add(\"3,-4,1\") }\n end",
"title": ""
},
{
"docid": "26a44aaf394733ab29693c1e96c52b1a",
"score": "0.70279443",
"text": "def represents_positive_integer?(string_to_check)\n is_positive_integer = false\n\n if string_to_check =~ /\\A\\d+\\z/ ? true : false\n is_positive_integer = true\n end\n is_positive_integer\n\n end",
"title": ""
},
{
"docid": "a4f5996b924b1c88a076a6a5de2f1e0e",
"score": "0.70140797",
"text": "def validIn? (inStr)\n if inStr.to_i == 0\n puts \"Invalid input!\"\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "ad589ffd1a19f716842a157d78dac24d",
"score": "0.6985923",
"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": "1598c6437419cd0c62af127c0d859463",
"score": "0.69651383",
"text": "def check_interger(num)\n num = num.to_s\n\n if /^[+-]?\\d*\\.?0*$/.match(num) && /\\d/.match(num)\n if num.to_i.positive?\n 'positive'\n elsif num.to_i.negative?\n 'negative'\n else\n 'zero'\n end\n else\n 'invalid'\n end\nend",
"title": ""
},
{
"docid": "df53f1b9f02286090b43bdbdab55089b",
"score": "0.69592726",
"text": "def test_exit_on_non_int_input_string\n assert_equal valid?('one'), 1\n end",
"title": ""
},
{
"docid": "27fdcf96e1b9ebe431832357c19309d6",
"score": "0.6958045",
"text": "def should_be_positive(num)\n return_bad_request('Must be positive number.') if num < 0\n end",
"title": ""
},
{
"docid": "a56493870866a756adb223a733bd952d",
"score": "0.6953628",
"text": "def represents_positive_integer(s)\n return false if s.empty?\n return false if s == '0'\n\n s.each_char do |c|\n return false unless '0123456789'.include? c\n end\n\n return true\nend",
"title": ""
},
{
"docid": "ad1aa419cc8c117f92b8bc7e3f7baf0a",
"score": "0.69427335",
"text": "def valid_number_3?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i != 0\nend",
"title": ""
},
{
"docid": "1b2e3d53302aa326b8ea29b2b183bdaa",
"score": "0.6939649",
"text": "def validate(n)\n unless n.is_a?(Integer) && n >= 0\n raise ArgumentError, \"n must be an integer and >= 0\"\n end\nend",
"title": ""
},
{
"docid": "606b2613411447e4a230d5c4c7caa331",
"score": "0.6920754",
"text": "def integer?(str)\n /\\A[+-]?\\d+\\z/ === str\n end",
"title": ""
},
{
"docid": "3802ed4041cd57f1537d846b242536b5",
"score": "0.6904961",
"text": "def is_int?(string)\n !!(string =~ /^[-+]?[0-9]+$/)\n end",
"title": ""
},
{
"docid": "bc68ba5d6854acb3286b69ba208fd1d5",
"score": "0.68870926",
"text": "def negative(integer)\n string_integer = integer.to_s\n\n return integer if string_integer.include?('-')\n string_integer = \"-#{integer}\"\n string_integer.to_i\nend",
"title": ""
},
{
"docid": "67dfc670a50a680fc7dd10c24f2ca083",
"score": "0.6871999",
"text": "def is_negative(number)\n number.to_i\n if number > 0\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "5cf6df1c58b7556bf838d98296b1f833",
"score": "0.68470883",
"text": "def validInt(inputString)\n\t\tbegin\n\t\t\tInteger(inputString)\n\t\t\treturn true\n\t\trescue\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4777d327214b6cabed402f25777029a2",
"score": "0.68465763",
"text": "def valid_input?(number)\n (number.to_i.abs.to_s == number) && (number.to_i != 0)\nend",
"title": ""
},
{
"docid": "529b62a5d8ab18b2f20e30d06616b5aa",
"score": "0.68403935",
"text": "def is_integer?(string)\n /\\A[-+]?\\d+\\z/ === string\n end",
"title": ""
},
{
"docid": "d9bf1e86bc40740e990448937d898dfc",
"score": "0.68289495",
"text": "def valid_number?(number)\n if number == '0'\n true\n elsif number.to_i == 0\n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "ed281d747027fdf6d390edfa409d156f",
"score": "0.68283075",
"text": "def valid_number?(number_string)\n return false if !number_string\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "9b95e48de9a296ec8f84389936378912",
"score": "0.68087953",
"text": "def test_neg_int(neg_int, exp_result)\n actual_result = Validator.string_of_nums?(neg_int)\n if(actual_result == exp_result)\n puts(\"PASS\")\n else\n puts(\"FAIL\")\n end\n return actual_result\nend",
"title": ""
},
{
"docid": "4a1ff6b69a97a7b3672a10d65065eb66",
"score": "0.6796687",
"text": "def test_can_negate_integer\n assert_eq interpret('-2'), -2\n end",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.67919713",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
}
] |
9e3165e6b60be10744d64796f769d3c5 | Method: updateGameResult Input: Return: | [
{
"docid": "75e53d704004432b6ccb00080a7ef40a",
"score": "0.7032626",
"text": "def updateGameResult\n if(request.post?)\n cGameID = self.findKeyInJSON(params[:params], \"GameID\", 2)\n cStatus = self.findKeyInJSON(params[:params], \"Status\", 2) # 100: Owner Win, 101: Opp Win, 102: draw\n cCoins = self.findKeyInJSON(params[:params], \"Coins\", 2)\n cRedRockets = self.findKeyInJSON(params[:params], \"RedRocket\", 2)\n cRWBRockets = self.findKeyInJSON(params[:params], \"RWBRocket\", 2)\n cOwnerSocialID = self.findKeyInJSON(params[:params], \"OwnerSocialID\", 2)\n cOpponentSocialID = self.findKeyInJSON(params[:params], \"OpponentSocialID\", 2)\n cSocialType = self.findKeyInJSON(params[:params], \"SocialType\", 2)\n cSceneID = self.findKeyInJSON(params[:params], \"SceneID\", 2)\n \n \n begin\n # update Game Status\n a = Game.find(cGameID.to_s)\n a.gameStatus = cStatus.to_s\n a.save\n \n # update ShowBucks & Scene Indexing\n case cStatus.to_s\n when \"102\" # Owner Win\n #winnerID = cOwnerSocialID\n #loserID = cOpponentSocialID\n g = Sbdbindexing.find(\"ongame_\" + cSocialType.to_s + \"_\" + cOwnerSocialID.to_s + \"_\" + cOpponentSocialID.to_s)\n gx = g.arrayvalue\n gz = gx.last\n gz[0][\"scene\"] = 0\n g.arrayvalue = gx\n g.save\n \n h = Sbdbindexing.find(\"ongame_\" + cSocialType.to_s + \"_\" + cOpponentSocialID.to_s + \"_\" + cOwnerSocialID.to_s)\n hx = h.arrayvalue\n hz = hx.last\n hz[0][\"scene\"] = 0\n h.arrayvalue = hx\n h.save\n when \"101\" # Opp Win\n #winnerID = cOpponentSocialID\n #loserID = cOwnerSocialID\n Player.addPlayerCoins(cOpponentSocialID, cSocialType, cCoins)\n Player.addPlayerCoins(cOwnerSocialID, cSocialType, cCoins)\n else\n # winnerID = loserID = nil\n end\n \n #if(winnerID != nil && loserID != nil)\n # Player.updatePlayerCoins(winnerID, loserID, cSocialType, cCoins)\n #end\n \n # update Opponent Rockets\n Player.updatePlayerRockets(cOpponentSocialID, cSocialType, cRedRockets, cRWBRockets)\n \n # update status for this game at Opponent's \"My Scene\"\n Game.updateSceneStatus(cSocialType, cOpponentSocialID, cSceneID, \"myscene\")\n \n # update status for this game at Owner's \"Their Scene\"\n Game.updateSceneStatus(cSocialType, cOwnerSocialID, cSceneID, \"theirscene\")\n \n #\n rStatus = \"100\"\n rescue Exception => e\n rStatus = \"101\"\n end\n \n # Return JSON response\n cRequestID = self.findKeyInJSON(params[:params], \"RequestID\", 1)\n rData = {\"Status\" => \"true\"}\n self.jsonRender(rData, 'Game Result Updated', cRequestID, rStatus)\n end\n end",
"title": ""
}
] | [
{
"docid": "2ec65c90b8b647026e57b7db15e68499",
"score": "0.68413436",
"text": "def process_result(game)\n if game.red == @player\n as_red\n my_score = game.redscore\n opp_score = game.bluescore\n my_rating_diff = game.red_rating_diff\n opp_rating_diff = game.blue_rating_diff\n else\n as_blue\n my_score = game.bluescore\n opp_score = game.redscore\n my_rating_diff = game.blue_rating_diff\n opp_rating_diff = game.red_rating_diff\n end\n if my_rating_diff > 0\n @rating_gain += my_rating_diff\n else\n @rating_loss += my_rating_diff\n end\n @scores << my_score - opp_score\n if my_score > opp_score\n victory\n else\n defeat\n end\n end",
"title": ""
},
{
"docid": "01caa8e1637822289259da62ce5ee1e8",
"score": "0.6736058",
"text": "def update\n if @result.update(result_params) && @result.result_check\n redirect_to @result, notice: t('notice.updated',{model: \"#{t('activerecord.models.admin/result')}\"})\n else\n @games = Admin::Game.where(year: @result.game.year)\n @divisions = Admin::Division.where(game_id: @result.game.id)\n @count = 'おはよう'\n render :edit\n end\n end",
"title": ""
},
{
"docid": "5d2059d0a743d669c38156a90724dc76",
"score": "0.6557134",
"text": "def update\n respond_to do |format|\n if @games_from_result.update(games_from_result_params)\n format.html { redirect_to @games_from_result, notice: 'Games from result was successfully updated.' }\n format.json { render :show, status: :ok, location: @games_from_result }\n else\n format.html { render :edit }\n format.json { render json: @games_from_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13e6853d4653e9e22f68dc750d7f93d7",
"score": "0.65048975",
"text": "def update_points(result)\n if result == \"Win\"\n @points =+ 1\n elsif result == \"Loss\"\n #No change to points\n else\n #error of some kind\n end #End of if\n\n end",
"title": ""
},
{
"docid": "78d433147bc8efdff8f626de654ee0f4",
"score": "0.6464355",
"text": "def question_results\n result = params[:result]\n @result = result\n game_id = params[:game_id]\n subject = params[:subject_title]\n @current_game = Game.find(game_id)\n @current_game.save!\n\n if @current_game.active? && @current_game.players_turn?(current_user.id)\n @current_game.game_stat.apply_question_result(subject, result)\n applied_result = current_user.apply_question_results(subject, result)\n check_question_result(applied_result)\n if @current_game.normal_round?\n @bonus = params[:bonus]\n @current_game.bonus = @bonus\n game_result = @current_game.apply_to_normal_round(subject, current_user.id, @result)\n if game_result == Game::TIE\n @current_game.update_attributes(game_status: Game::ACTIVE, bonus: Game::BONUS_FALSE)\n @current_game.save\n wager = @current_game.get_wagerable_trophies(current_user.id).first\n prize = @current_game.get_winnable_trophies(current_user.id).first\n @challenge = Challenge.create_challenge(@current_game.id, current_user.id, @current_game.opponent_id(current_user.id), wager, prize)\n @challenge.save\n redirect_to game_ask_question_path and return\n end\n if @current_game.finished?\n current_user.apply_game_result(@current_game.id)\n @current_game.opponent(current_user.id).apply_game_result(@current_game.id)\n notify_game_outcome(@current_game)\n back_to_index and return\n elsif @current_game.players_turn?(current_user.id)\n back_to_game(@current_game.id)\n else\n check_new_game\n back_to_index and return\n end\n elsif @current_game.challenge_round?\n @challenge = Challenge::get_ongoing_challenge_by_game(@current_game.id)\n if @challenge\n if @challenge.valid_challenge?\n challenge_result = @challenge.apply_question_result(current_user.id, result, @current_game.bonus)\n if challenge_result == Challenge::RESULT_OPPONENT_TURN\n @current_game.increase_turn_count\n @current_game.end_round(current_user.id)\n back_to_index and return\n elsif challenge_result == Challenge::RESULT_TIE && current_user.id == @challenge.opponent_id\n @current_game.bonus = Game::BONUS_TRUE\n @current_game.save!\n ask_another_question(@current_game.id)\n elsif challenge_result == Challenge::RESULT_WINNER\n @current_game.apply_challenge_results(challenge_result, @challenge.challenger_id, @challenge.winner_id, @challenge.wager, @challenge.prize)\n notify_challenge_outcome(@challenge)\n @current_game.end_challenge(@challenge)\n @current_game.increase_turn_count\n @current_game.end_round(current_user.id)\n if @current_game.finished?\n notify_game_outcome(@current_game)\n end\n back_to_index and return\n else\n ask_another_question(@current_game.id)\n end\n else\n redirect_to game_challenge_path(:game_id => @current_game.id)\n end\n else\n redirect_to game_challenge_path(:game_id => @current_game.id)\n end\n end\n else\n back_to_index\n end\n end",
"title": ""
},
{
"docid": "54b8190927da6fa22b41b139fc698420",
"score": "0.6441081",
"text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n if @game.final? then\n recalculate_points\n end\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51e4c8bae87a97fc4173af9e3ce8464c",
"score": "0.64208573",
"text": "def updateScore(score, result)\n\tif result == \"P1 wins!\"\n\t\tscore[\"Player 1\"] += 1\n\telsif result == \"P2 wins!\"\n\t\tscore[\"Player 2\"] += 1\n\tend\n\tputs result\n\tputs \"Current score:\\n Player 1: \" + score[\"Player 1\"].to_s + \" Player 2: \" + score[\"Player 2\"].to_s + \"\\n\\n\"\n\treturn score\nend",
"title": ""
},
{
"docid": "f9f6b68a212ec4fc3f3bc8e575f9fb02",
"score": "0.64162546",
"text": "def update_record game\n @wins += 1 if game.game_result == 'W'\n @losses += 1 if game.game_result == 'L'\n @ties += 1 if game.game_result == 'T'\n end",
"title": ""
},
{
"docid": "32904f57275b772b97603817040dbf2b",
"score": "0.6351888",
"text": "def update(state_manager, game)\n\n end",
"title": ""
},
{
"docid": "5bf24ee9be8d8f6792a1bd4dc6977d77",
"score": "0.63212407",
"text": "def result_update_to player, dealer_player, odds\r\n if player[:state] == 'won' \r\n amount = (player[:bet].to_f * odds).to_i\r\n player[:total_chips] = player[:total_chips] + amount\r\n\tdealer_player[:total_chips] = dealer_player[:total_chips] - amount\r\n\tplayer[:total_win] = player[:total_win] + 1\r\n\tplayer[:history].push('won')\r\n elsif player[:state] == 'lost'\r\n player[:total_chips] = player[:total_chips] - player[:bet]\r\n\tdealer_player[:total_chips] = dealer_player[:total_chips] + player[:bet]\r\n player[:history].push('lost')\r\n else\r\n player[:history].push('push')\r\n end\r\n player[:total_round] = (player[:state] == 'won' || player[:state] == 'lost')? player[:total_round] + 1 : player[:total_round]\r\n player[:rate] = (player[:total_round] > 0)? player[:total_win].to_f / player[:total_round].to_f : player[:rate]\r\nend",
"title": ""
},
{
"docid": "f48b1f0ede335f669418c5e4bb3f7d1a",
"score": "0.63112104",
"text": "def apply_result(result)\n case result\n when FromScrimmageResult\n @field_position += result.yards_gained\n\n if @field_position >= 100\n touchdown\n elsif @field_position >= @line_to_gain\n first_down\n elsif @field_position <= 0\n safety\n elsif result.repeat_down\n # No-op\n else\n @down += 1\n if @down > 4\n turnover\n end\n end\n\n when OnePointConversionResult\n if result.success\n score(1)\n end\n kickoff\n\n when TwoPointConversionResult\n if result.success\n score(2)\n end\n kickoff\n\n when FieldGoalResult\n if result.success\n score(3)\n kickoff\n else\n change_of_possession\n new_downs\n end\n\n when ReturnableKickResult\n # This handles all three types of returnable kicks\n @field_position += result.kick_distance\n change_of_possession\n\n if result.touchback\n @field_position = result === KickoffResult ? 25 : 20\n else\n @field_position += result.return_distance\n end\n\n # Now check for a TD or safety\n # TODO dedup with scrimmage logic\n if @field_position >= 100\n touchdown\n elsif @field_position <= 0\n safety\n else\n new_downs\n end\n\n when TakeawayResult\n turnover\n @field_position += result.taking_team_yards_gained\n\n if @field_position >= 100\n touchdown\n elsif @field_position <= 0\n # touchback\n # TODO can there be a safety on a takeaway? technically i think yet but very rare\n @field_position = 20\n first_down\n end\n\n else\n raise \"unknown result type #{result.class}\"\n\n end\n\n # advance the clock\n # TODO two minute warning?\n @seconds_remaining -= result.seconds_elapsed\n if (@seconds_remaining <= 0) && (@play_type != :point_after_touchdown)\n @quarter += 1\n @seconds_remaining = 15 * 60\n\n if @quarter == 3\n puts \"--> End of half\"\n @possession = AWAY\n kickoff\n end\n end\n end",
"title": ""
},
{
"docid": "fe1737b90379a52251544f3aa4f464ec",
"score": "0.6298242",
"text": "def updateScore(score, result)\n\tif result == \"Player 1 wins this round!\"\n\t\tscore[0] += 1\n\telsif result == \"Player 2 wins this round!\"\n\t\tscore[1] += 1\n\telsif result == \"Tie!\"\n\t\tscore[2] += 1\n\tend\n\treturn score\nend",
"title": ""
},
{
"docid": "d4f511d22a17ec971bf552d7e75711d8",
"score": "0.6249142",
"text": "def update(input)\n # checks whether updating game or player\n # if game, passes into status.update\n # (drop the first element (which will be the word game) so we are left with just the update (type, value) ,\n # field_width is the amount of columns)\n input[0] == 'game' ? @status.update(input.drop(1), @settings[:field_width]) : update_players(input)\n # Continues listening for the next command (in the IO stream)\n run\n end",
"title": ""
},
{
"docid": "e7ddfbf11833254fde97421a73e25942",
"score": "0.62239563",
"text": "def game_result(result, word)\n end",
"title": ""
},
{
"docid": "31115dbdd250e901e8f38aaa626bebac",
"score": "0.619908",
"text": "def result(result)\n @score += 3 if result == \"win\"\n @score += 1 if result == \"draw\"\n return score\n end",
"title": ""
},
{
"docid": "1e6066a0bbc4be851957518d283f415d",
"score": "0.6185621",
"text": "def check_game_final_status(input)\n game = input[:game]\n return Success(game) if game.steps.filter { |step| step.symbol != '.' }.size < 5\n\n user = input[:user]\n positions = input[:game].steps.pluck(:symbol).join\n\n if Games::Utils.check_positions(positions)\n game.win_player = user\n game.status = :finished\n game.save!\n end\n\n ActionCable.server.broadcast(\n \"game_#{game.id}\",\n {\n game: GameEntity.represent(game),\n action: 'makeMove',\n }\n )\n\n Success(game)\n end",
"title": ""
},
{
"docid": "e2bc309b9c0aefdb7519d7b6fb9a09d1",
"score": "0.61689806",
"text": "def update\n\n @game.turn = params[:game][:turn]\n @game.finished = params[:game][:finished]\n @game.winner = params[:game][:winner]\n @game.overall_score = ActiveSupport::JSON.decode(params[:game][:overall_score])\n @game.game_state = ActiveSupport::JSON.decode(params[:game][:game_state])\n\n respond_to do |format|\n if @game.save\n format.json { head :no_content }\n else\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0762776a8527494c3ae0e7bf1f65ed7",
"score": "0.6164858",
"text": "def update\n for i in 0..@matchday.matches.size-1\n match = @matchday.matches[i]\n unless match.played\n local_data = [params.fetch('local_goals_'+i.to_s), params.fetch('local_yellows_'+i.to_s), params.fetch('local_reds_'+i.to_s)]\n visit_data = [params.fetch('visit_goals_'+i.to_s), params.fetch('visit_yellows_'+i.to_s), params.fetch('visit_reds_'+i.to_s)]\n match.update_result(local_data, visit_data)\n end\n end\n\n redirect_to @matchday.tournament, notice: 'Resultados de Fecha ' + @matchday.number.to_s + ' guardados.'\n end",
"title": ""
},
{
"docid": "e788b34299d7b88df3ea08e45b51c961",
"score": "0.6108508",
"text": "def update!(**args)\n @result = args[:result] if args.key?(:result)\n end",
"title": ""
},
{
"docid": "e788b34299d7b88df3ea08e45b51c961",
"score": "0.6108508",
"text": "def update!(**args)\n @result = args[:result] if args.key?(:result)\n end",
"title": ""
},
{
"docid": "e788b34299d7b88df3ea08e45b51c961",
"score": "0.6108508",
"text": "def update!(**args)\n @result = args[:result] if args.key?(:result)\n end",
"title": ""
},
{
"docid": "cb70e733e8b5c471c5303f5af9dcd9d3",
"score": "0.60918224",
"text": "def update_game_status!(game_status, player_hand, dealer_hand)\n total_up_hand_for_best_option(player_hand, game_status)\n total_up_hand_for_best_option(dealer_hand, game_status)\n update_status_for_the_table(game_status)\n game_status\nend",
"title": ""
},
{
"docid": "cb70e733e8b5c471c5303f5af9dcd9d3",
"score": "0.60918224",
"text": "def update_game_status!(game_status, player_hand, dealer_hand)\n total_up_hand_for_best_option(player_hand, game_status)\n total_up_hand_for_best_option(dealer_hand, game_status)\n update_status_for_the_table(game_status)\n game_status\nend",
"title": ""
},
{
"docid": "30cbbb25b04f4dee4549248ff188480c",
"score": "0.6076558",
"text": "def update\n @team = Team.find(params[:team_id])\n @game = @team.games.find(params[:game_id])\n @convocations = @game.convocations\n @called = @convocations.where(:called => true)\n @options = params[:selection]\n errors = false\n\n num_selected_players = @options.count('1')\n if(@options.count > 18)\n num_bench_players = @options.count('2')\n if(num_selected_players != 11 || num_bench_players != 7)\n redirect_to club_team_game_lineup_path(@team.club, @team, @game), notice: 'You must select 11 initial players and 7 player for the bench!'\n return\n end\n else\n if(num_selected_players != 11)\n redirect_to club_team_game_lineup_path(@team.club, @team, @game), notice: 'You must select 11 initial players!'\n return\n end\n end\n\n respond_to do |format|\n index = 0\n @team.players.each do |player|\n if errors == false\n convocation = @convocations.where(:player_id => player.id).first\n if convocation.called\n if Convocation.update(convocation.id, :initial_condition => @options[index])\n index += 1 \n else\n errors = true #if there is something wrong with the update of the parameter turns on the flag\n end\n end\n end\n end\n\n if errors\n format.html { redirect_to club_team_game_lineup_path(@team.club, @team, @game), notice: 'Error selecting lineup!' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n return\n else\n format.html { redirect_to new_club_team_game_event_path(@team.club, @team, @game), notice: 'Lineup was successfully saved.' }\n format.json { render json: @game, status: :created, location: @game }\n end\n end\n end",
"title": ""
},
{
"docid": "ea14920c403f0441adc86cf3b75b23bb",
"score": "0.60404927",
"text": "def save_result\n @running = Facade::SportSession::Running.find_by id: params[:id]\n\n if not @running.is_confirmed_participant(current_user)\n redirect_to runnings_url, alert: 'Permission denied'\n end\n\n @result = @running.result(current_user)\n\n # read gpx file if present\n track = nil\n if results_params[:file].present?\n @result = Track.create_track_and_update_result(@result, results_params[:file])\n track = @result.track\n else\n @result.time = results_params[:time]\n @result.length = results_params[:length]\n end\n\n if @result.save\n track.save if track.present?\n # Check for new Achievements!\n achievement_checker = AchievementsChecker.new @result\n achievements = achievement_checker.check true\n if achievements.count > 0\n titles = '\"' + achievements.map { |a| a.achievement.title}.join('\", \"') + '\"'\n flash[:notice] = [\"Congratulations, you obtained new achievements: #{titles}\"]\n flash[:notice] << 'Successfully saved results'\n else\n flash[:notice] = 'Successfully saved results'\n end\n\n redirect_to runnings_url\n else\n render :edit_result\n end\n\n end",
"title": ""
},
{
"docid": "42ea95fd9b7270ae1761bb78be597771",
"score": "0.60332376",
"text": "def update_match_results_and_points(match)\n case match[2]\n when 'W'\n $wins[match[0]] = $wins[match[0]].to_i + 1\n $loses[match[1]] = $loses[match[1]].to_i + 1\n $points[match[0]] = $points[match[0]].to_i + 3\n when 'L'\n $loses[match[0]] = $loses[match[0]].to_i + 1\n $wins[match[1]] = $wins[match[1]].to_i + 1\n $points[match[1]] = $points[match[1]].to_i + 3\n else\n $draws[match[0]] = $draws[match[0]].to_i + 1\n $draws[match[1]] = $draws[match[1]].to_i + 1\n $points[match[0]] = $points[match[0]].to_i + 1\n $points[match[1]] = $points[match[1]].to_i + 1\n end\nend",
"title": ""
},
{
"docid": "8cbc22dd17649a075fa06dc42fe68bb5",
"score": "0.5997369",
"text": "def update\n super\n if BattleManager.in_turn?\n process_event\n process_action\n end\n BattleManager.judge_win_loss unless BattleManager.victory_phase?\n if BattleManager.victory_phase?\n if @victory_score.done and @victory_score.active\n sfx = CP::VICTORY::IMAGE_SFX\n vol = CP::VICTORY::SFX_VOL\n pit = CP::VICTORY::SFX_PIT\n RPG::SE.new(sfx, vol, pit).play unless sfx.nil?\n @victory_score.active = false\n @victory_item.active = true\n end\n end\n end",
"title": ""
},
{
"docid": "bf45753b5b48ea16b0bbaa8c30be3988",
"score": "0.5944773",
"text": "def update!(**args)\n @face_match = args[:face_match] if args.key?(:face_match)\n @personal_results = args[:personal_results] if args.key?(:personal_results)\n @voice_match = args[:voice_match] if args.key?(:voice_match)\n end",
"title": ""
},
{
"docid": "0f1fb3fde5f9da188097500dfc610b46",
"score": "0.5907794",
"text": "def update_points(dealer_cards, player_cards, no_of_games = 0, points = [0, 0])\n player = 0\n dealer = 1\n result = detect_result(dealer_cards, player_cards)\n case result\n when :player_busted\n points[dealer] += 1\n when :dealer_busted\n points[player] += 1\n when :player\n points[player] += 1\n when :dealer\n points[dealer] += 1\n end\n\n points\nend",
"title": ""
},
{
"docid": "718541bf05273a16ba7374ae27faced6",
"score": "0.587546",
"text": "def update_players(input)\n # If name is the same as the player's name (@me.name?), then update_player is\n # called on @me and its return value is returned\n return update_player(@me, input) if @me.name?(input.shift)\n # If name is not the same as the player's name, then update_player is called\n # on @opponent and its return value is returned\n update_player(@opponent, input)\n end",
"title": ""
},
{
"docid": "8ba8db8af1ba896a77db490bbbecf6ea",
"score": "0.5847331",
"text": "def update\n\n # Vérifie si il y a les points des matches dans les params\n if (params[:points_manche])\n\n # Additionne tous les points des annonces\n team1_total_point_announce = params[:team1_num0_announce].to_i + params[:team1_num01_announce].to_i + params[:team1_num2_announce].to_i + params[:team1_num3_announce].to_i + params[:team1_num4_announce].to_i\n team2_total_point_announce = params[:team2_num0_announce].to_i + params[:team2_num01_announce].to_i + params[:team2_num2_announce].to_i + params[:team2_num3_announce].to_i + params[:team2_num4_announce].to_i\n\n # Met a jour la manche de la partie\n @game.update(rounds: @game.rounds + 1)\n\n # Permet de définir le nouveau distributeur\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.distributor)\n @distributor_position = player.position\n player.update(distributor: false)\n end\n end\n end\n @new_distributor_position = @distributor_position + 1\n if (@new_distributor_position == 5)\n @new_distributor_position = 1\n end\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.position == @new_distributor_position)\n player.update(distributor: true)\n end\n end\n end\n\n # Permet de définir le joueur qui devra chosir l'atout\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.first_to_play)\n @first_to_play_position = player.position\n player.update(first_to_play: false)\n end\n end\n end\n @new_first_to_play_position = @first_to_play_position + 1\n if (@new_first_to_play_position == 5)\n @new_first_to_play_position = 1\n end\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.position == @new_first_to_play_position)\n player.update(first_to_play: true)\n end\n end\n end\n\n # Verifie si les points de la manche sont a 0 et met a jour les points de l'équipe 2\n if params[:points_manche].to_i == 0\n # Vérifie si il y a un match; Si oui on ajoute 257 points sinon 157\n if params[:match] == \"oui\"\n @game.teams.last.update(points: 257 + @game.teams.last.points.to_i + team2_total_point_announce)\n else\n @game.teams.last.update(points: 157 + @game.teams.last.points.to_i + team2_total_point_announce)\n end\n elsif 157 - params[:points_manche].to_i <= 0\n @game.teams.last.update(points: 0 + @game.teams.last.points.to_i + team2_total_point_announce)\n else\n @game.teams.last.update(points: 157 - params[:points_manche].to_i + @game.teams.last.points.to_i + team2_total_point_announce)\n end\n\n # Met a jour les points de l'équipe 2\n @game.teams.first.update(points: params[:points_manche].to_i + @game.teams.first.points.to_i + team1_total_point_announce )\n\n # Vérifie si il y a un gagnant dans la partie\n if (@game.teams.first.points >= @game.points)\n @game.teams.first.update(winner: true)\n @game.update(winner: true)\n elsif (@game.teams.last.points >= @game.points)\n @game.teams.last.update(winner:true)\n @game.update(winner: true)\n end\n\n # Sauvegarde une partie\n if @game.save\n render json: { success: true, teams: @game.teams, game: @game}\n end\n\n # Met a jour l'atout et affichige l'icone sur le bon joueur (atout)\n elsif (params[:atout] != '')\n @game.update(atout: params[:atout])\n if (params[:chibre] == \"true\")\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.first_to_play)\n @first_to_play_position = player.position\n player.update(first_to_play: false)\n end\n end\n end\n @new_first_to_play_position = @first_to_play_position + 2\n if (@new_first_to_play_position == 5)\n @new_first_to_play_position = 1\n end\n if (@new_first_to_play_position == 6)\n @new_first_to_play_position = 2\n end\n @game.teams.each do |team|\n team.players.each do |player|\n if (player.position == @new_first_to_play_position)\n player.update(first_to_play: true)\n render json: { success: true, teams: @game.teams}\n end\n end\n end\n else\n render json: { success: true, teams: @game.teams}\n end\n\n # Verifie le status de la partie\n elsif (params[:status] != '')\n @game.update(status: params[:status])\n end\n\n end",
"title": ""
},
{
"docid": "a15fed4ccb62b7f6ca4eae87a64f9c07",
"score": "0.5846494",
"text": "def process_result(player, result)\n result_object = nil\n self.results.to_a.each do |result|\n if result.player == player\n result_object = result\n end\n end\n result_object.value = result\n result_object.save!\n calculate\n end",
"title": ""
},
{
"docid": "5002ead25dd0182ed4d2a982393229df",
"score": "0.58444774",
"text": "def update!(**args)\n @result_entity_score = args[:result_entity_score] if args.key?(:result_entity_score)\n end",
"title": ""
},
{
"docid": "772f20ca40f5df65c79e1afd732fd5ed",
"score": "0.5843617",
"text": "def update_inputs\n if Input.trigger?(:A)\n $game_system.se_play($data_system.decision_se)\n if display_message(ext_text(8997, 39), 1, ext_text(8997, 33), ext_text(8997, 34)) == 0\n @return_data = @party_index\n @running = false\n end\n elsif Input.trigger?(:B)\n mouse_quit\n else\n super\n end\n end",
"title": ""
},
{
"docid": "60687a3dc2f4975b0d5339c851c7a07b",
"score": "0.58397865",
"text": "def update\n respond_to do |format|\n if @competition_result.update(competition_result_params)\n format.html { redirect_to @competition_result, notice: 'Competition result was successfully updated.' }\n format.json { render :show, status: :ok, location: @competition_result }\n else\n format.html { render :edit }\n format.json { render json: @competition_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8aa7c63b1d0a9ffa9adbad410d7d4e81",
"score": "0.5836612",
"text": "def update\n respond_to do |format|\n if @round.make_guess(params[\"round\"][\"guessed_letter\"])\n update_current_player\n format.html { redirect_to game_round_path(@game, @round) }\n format.json { render :show, status: :created, location: @round }\n else\n format.html { redirect_to game_round_path(@game, @round), notice: 'Invalid guess' }\n format.json { render :show, status: :created, location: @round }\n end\n end\n end",
"title": ""
},
{
"docid": "a446fab2a077ae9ff312054c2d7ae496",
"score": "0.58342856",
"text": "def result\n @wordcard = Wordcard.find(params[:wordcard_id])\n return if !@wordcard\n result = params.fetch :result\n return if result.nil?\n\n if result == \"true\"\n @wordcard.bin = [@wordcard.bin + 1, 11].min\n notice = \"Correct! '#{@wordcard.word}' was moved to bin #{@wordcard.bin}\"\n elsif result == \"false\"\n @wordcard.bin = 1\n notice = \"Incorrect. '#{@wordcard.word}' was moved back to bin 1\"\n @wordcard.times_wrong += 1\n if @wordcard.times_wrong >= 10\n @wordcard.bin = 13 #unlucky bin..never show again!\n end\n end\n @wordcard.reviewed_at = DateTime.now\n @wordcard.save\n\n redirect_to :root, :notice => notice\n end",
"title": ""
},
{
"docid": "b3b78a3fd680c861304a635d8707d1ce",
"score": "0.5833424",
"text": "def update\n case @game_settings.current_screen\n when \"start\"\n start_screen_inputs\n when \"levels\"\n levels_screen_inputs\n when \"game\"\n if @deck.deck_count == 0 || valid_table(@playing_cards).length == 0\n @game_settings.current_screen = \"gameover\"\n end\n\n if @game_settings.is_cpu_player_enabled\n @mes = computer_move @p1 if @computer_signal.update?\n @true_mes = (@mes == 1) && @computer_signal.display_message?\n @false_mes = (@mes == 0) && @computer_signal.display_message?\n @trying_mes = (@mes == 2) && @computer_signal.display_message?\n end\n\n if @game_settings.p1_init\n game_screen_inputs @p1\n @p2.clean_slate if @game_settings.p2_init && @p1.set_found\n @p1.set_found = false #reset\n end\n\n if @game_settings.p2_init\n game_screen_inputs @p2\n @p1.clean_slate if @game_settings.p1_init && @p2.set_found\n @p2.set_found = false\n end\n\n when \"gameover\"\n game_over_screen_inputs\n end\n end",
"title": ""
},
{
"docid": "b92d2f8935e5fbe9c15f09466b594535",
"score": "0.5830327",
"text": "def save_result\n @cycling = Facade::SportSession::Cycling.find_by id: params[:id]\n\n if not @cycling.is_confirmed_participant(current_user)\n redirect_to cyclings_url, alert: 'Permission denied'\n end\n\n @result = @cycling.result(current_user)\n\n # read gpx file if present\n track = nil\n if results_params[:file].present?\n @result = Track.create_track_and_update_result(@result, results_params[:file])\n track = @result.track\n else\n @result.time = results_params[:time]\n @result.length = results_params[:length]\n end\n\n if @result.save\n track.save if track.present?\n # Check for new Achievements!\n achievement_checker = AchievementsChecker.new @result\n achievements = achievement_checker.check true\n if achievements.count > 0\n titles = '\"' + achievements.map { |a| a.achievement.title}.join('\", \"') + '\"'\n flash[:notice] = [\"Congratulations, you obtained new achievements: #{titles}\"]\n flash[:notice] << 'Successfully saved results'\n else\n flash[:notice] = 'Successfully saved results'\n end\n\n redirect_to cyclings_url\n else\n flash[:notice] = 'Unable to save results'\n render :edit_result\n end\n\n end",
"title": ""
},
{
"docid": "a1ccb5c8e323f5e69cd7a93bfdb31b62",
"score": "0.5826497",
"text": "def result_message(response)\n original_game_card = Card.find_by(id: last_guessed_card)\n if original_game_card.answer == response\n return \"win\"\n else\n return \"lose\"\n end\nend",
"title": ""
},
{
"docid": "14123fd0516eed8576d20226d7425e71",
"score": "0.5821445",
"text": "def update\n\n @gameparam = params[:game]\n\n updategameplayers(params[:local_subs_ids], params[:id], @gameparam[:home_team], \"Sub\")\n updategameplayers(params[:visit_subs_ids], params[:id], @gameparam[:visit_team], 'Sub')\n\n updategameplayers(params[:local_starter_ids], params[:id], @gameparam[:home_team], 'Starter')\n updategameplayers(params[:visit_starter_ids], params[:id], @gameparam[:visit_team], 'Starter') \n\n calculategeneraltable(@game.tournament_id, @game.home_team)\n calculategeneraltable(@game.tournament_id, @game.visit_team)\n\n CreateGameaction(params[:action_id])\n \n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cab84d6381d4d65bc7b776898b8e808f",
"score": "0.5806567",
"text": "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_game }\n else\n format.html { render :edit }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a16f2ae6293c98101e58fc71c9d95db",
"score": "0.579719",
"text": "def update!(**args)\n @results = args[:results] if args.key?(:results)\n end",
"title": ""
},
{
"docid": "2a16f2ae6293c98101e58fc71c9d95db",
"score": "0.579719",
"text": "def update!(**args)\n @results = args[:results] if args.key?(:results)\n end",
"title": ""
},
{
"docid": "4843b4d5ba19b261a2d9a33551a70edc",
"score": "0.57929045",
"text": "def update\n respond_to do |format|\n updated = true\n\n if @game_player.game_round.end_at.present?\n if DateTime.current <= @game_player.game_round.end_at\n updated = @game_player.update(game_player_params)\n end\n end\n\n if updated\n format.html { redirect_to @game_player, notice: 'Game lucky user was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_player }\n else\n format.html { render :edit }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f6930a9752c151203cf1d6368603e24",
"score": "0.5792211",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: \"Game was successfully updated.\" }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f025015fb37cc8c96eb6f9aff8d3b6a1",
"score": "0.57905066",
"text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n flash[:notice] = 'Game was successfully updated.'\n calculate_scores(@game)\n format.html { redirect_to(@game) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "020049f8ec02633249e6bd01249fe883",
"score": "0.5789159",
"text": "def result(outcome)\n @points += 3 if outcome == \"W\"\n @points += 0 if outcome == \"L\" # not really necessary...\n end",
"title": ""
},
{
"docid": "239ce46e849212a2f690b7d7c6c2d88c",
"score": "0.5774215",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_url, notice: \"Game was successfully updated.\" }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99c2474532006379e280b100db65bdf6",
"score": "0.5773918",
"text": "def set_result(opts)\n self.home_score = opts[:home_score]\n self.away_score = opts[:away_score]\n self.winner = self.home_score > self.away_score ? self.home : self.away\n self.finished = true\n end",
"title": ""
},
{
"docid": "02453395611697470dcdd61848fe52a1",
"score": "0.57708204",
"text": "def result_game1\n \n minus_result = @player1.points - @player2.points\n\n # While less than 4 points have been recorded\n while @score_counter < 4\n if minus_result > 0\n return \"Player 1 leads: #{@player1.score} - #{@player2.score}.\"\n elsif minus_result < 0\n return \"Player 2 leads: #{@player2.score} - #{@player1.score}.\"\n else \n return \"The game is tied: #{@player1.score} - #{@player2.score}.\"\n end\n end\n\n # While either 4 or 5 points have been recorded\n while (@score_counter >= 4 && @score_counter < 6)\n if (@player1.points >= 4 || @player2.points >= 4)\n if minus_result > 0\n return \"Congratulations Player 1. YOU WIN!\"\n @player1.points = 0\n elsif minus_result < 0\n return \"Congratulations Player 2. YOU WIN!\"\n @player2.points = 0\n end\n else\n if minus_result > 0\n return \"Player 1 leads: #{@player1.score} - #{@player2.score}.\"\n elsif minus_result < 0\n return \"Player 2 leads: #{@player2.score} - #{@player1.score}.\"\n else \n return \"The game is tied: #{@player1.score} - #{@player2.score}.\"\n end\n end\n end\n\n # Once 6 points have been recorded\n while @score_counter >= 6\n case minus_result\n when 0\n return \"The game is tied. Duece! Next point takes advantage.\"\n when 1\n @player1.player_advantage = true\n return \"Advantage: Player 1\"\n when -1\n @player2.player_advantage = true\n return \"Advantage: Player 2\"\n when 2\n return \"Congratulations Player 1. YOU WIN!\"\n @score_counter = 0\n @player1.points = 0\n else\n return \"Congratulations Player 2. YOU WIN!\"\n @score_counter = 0\n @player2.points = 0\n end\n end\n end",
"title": ""
},
{
"docid": "4098a6e2a49a4a0d9d4074b67a1bff90",
"score": "0.5769624",
"text": "def update\n if @game.user == current_user\n updated = @game.update(game_params)\n @notice = \"Game was sucessfully updated.\"\n else\n @notice = \"Game not updated since it belongs to another user.\"\n end\n respond_to do |format|\n if updated\n format.html { redirect_to @game, notice: @notice }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "580ae8bb98d20120f173e5eb609d444e",
"score": "0.57676315",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n @games = current_club_player.games\n format.html { redirect_to dashboard_path, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a46431e71face799c8052e6de71366d",
"score": "0.576303",
"text": "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a46431e71face799c8052e6de71366d",
"score": "0.576303",
"text": "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21a245878bc095e6d418b73f54e4d82b",
"score": "0.5757835",
"text": "def update\n # Vudo: Recalculate win or loss value based on updated score (if there is one) -- make own endpoint for score?\n update_params = matchup_params\n\n # Handle Spread History\n if @matchup.spread_history.blank?\n spread_object = {\n spread: matchup_params[:vegas_spread],\n date: DateTime.now.strftime('%Q').to_f,\n }\n spread_history = [spread_object].to_json\n update_params[:spread_history] = spread_history\n else\n spread_history = append_spread_to_matchup\n update_params[:spread_history] = spread_history\n end\n\n @matchup.update(update_params)\n @matchup.reload\n\n if !([\"home_team_score\", \"away_team_score\", \"vegas_spread\", \"system_spread\"] & matchup_params.keys).empty?\n @matchup.correct_pick = @matchup.correct_pick?.to_s\n @matchup.save!\n end\n\n render :json => @matchup\n end",
"title": ""
},
{
"docid": "071aa3d305048c1f3305353d5ee63c11",
"score": "0.57574815",
"text": "def result(my_choice, opponent_choice, result)\n #puts \"#{my_choice} #{opponent_choice} #{@last_opponent_choice} #{result}\"\n @last_opponent_choice = opponent_choice\n end",
"title": ""
},
{
"docid": "109c8f41fe6b44680d93f2b40b88e1e5",
"score": "0.5756209",
"text": "def proceed(shot_option: nil)\n if (needs_input? && shot_option.present?)\n self.status = :ready_to_play\n elsif changing_group?\n self.status = :displays_result\n end\n will_toggle_status = true\n @message = nil\n if ready_to_play?\n if current_group.needs_to_choose_shot? && shot_option.nil?\n needs_input!\n return\n end\n group_to_play = current_group\n # TODO: Quit receiving messy string result from Group#play().\n player_id_and_info = group_to_play.play(index_option: shot_option && Integer(shot_option))\n take_leaders_snapshot if group_to_play.final_group? \\\n && ((group_to_play.play_finished && !group_to_play.players_split?) || group_to_play.all_holed_out?)\n if player_id_and_info.nil?\n will_toggle_status = false\n elsif groups.none?(&:players_split?) && group_to_play.play_finished\n changing_group!\n will_toggle_status = false\n end\n update!(play_result: player_id_and_info)\n @message = group_to_play&.message\n if areas.first.open? && areas.second.open? && groups.any?(&:not_started_yet?)\n group = groups.detect(&:not_started_yet?)\n group.tee_up_on(first_hole_number)\n end\n end\n if to_be_finished?\n finished!\n update!(play_result: \"#{self} finished\")\n take_leaders_snapshot\n elsif will_toggle_status\n ready_to_play? ? displays_result! : ready_to_play!\n end\n end",
"title": ""
},
{
"docid": "163020a00cbbe56acdfdb57c29725ddd",
"score": "0.5752095",
"text": "def run(strategy, game)\n strategy.newGame\n while game.gameStatus == :KEEP_GUESSING\n #puts game\n guess = strategy.nextGuess(game)\n #puts guess\n guess.makeGuess(game)\n end\n puts game\n game.currentScore\nend",
"title": ""
},
{
"docid": "9157302fb66243fc990f26bf6e766ea0",
"score": "0.5740947",
"text": "def update\n @game = Game.find(params[:id])\n\n #First update the players table to indicate who is playing this game\n set_player_availability(params)\n \n #Find teams and update their names\n home_team = Team.find(@game.home_team_id)\n home_team.name = params[:home_team_name]\n away_team = Team.find(@game.away_team_id)\n away_team.name = params[:away_team_name]\n \n #Create home and away teams from available players\n build_teams(home_team, away_team)\n \n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c10d70b4c10c332921161a948b761f7",
"score": "0.57356393",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: game_url(@game, format: :json) }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96514cf92219a957118fe66e7bf30bdf",
"score": "0.57352316",
"text": "def process_ok\n Input.update\n $game_party.target_actor = $game_party.members[index] unless @cursor_all\n call_ok_handler\n end",
"title": ""
},
{
"docid": "c02cf2dac303c4eb15a6f7c503bec469",
"score": "0.5723576",
"text": "def update\n respond_to do |format|\n if @game.handle_action(game_params)\n format.html { redirect_to @game, notice: @game.notice_message }\n else\n format.html { redirect_to :back }\n end\n end\n end",
"title": ""
},
{
"docid": "165e59c70a93ace6c21fb4e6a3cf3f2b",
"score": "0.5721778",
"text": "def update_game_state guess\n\t\tif @word.include?(guess)\n\t\t\t@hits << guess\n\t\telse\n\t\t\t@misses << guess\n\t\t\t@guesses_left -= 1\n\t\tend\n\tend",
"title": ""
},
{
"docid": "12c1bc432d414426a9ae03272d093a8c",
"score": "0.57165676",
"text": "def result\n if event.status == 'played'\n score1 = calculate_score(team1) \n score2 = calculate_score(team2) \n\n [ score1, score2 ]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.57143396",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e852924b50b2f4bcde0060af4f45e3",
"score": "0.571273",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6354007bfe072dc891cbc8050962b5f4",
"score": "0.5706719",
"text": "def update\n respond_to do |format|\n if @prediction_game.update(prediction_game_params)\n format.html { redirect_to @prediction_game, notice: 'Prediction game was successfully updated.' }\n format.json { render :show, status: :ok, location: @prediction_game }\n else\n format.html { render :edit }\n format.json { render json: @prediction_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8bed83836355cf4747de52be6d472a9",
"score": "0.57047737",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_path, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1706a752013227ec103bd8d57e7953f",
"score": "0.5695506",
"text": "def update\n begin\n ActiveRecord::Base.transaction do\n closing_game_request? ? close_game : update_game\n respond_to do |format|\n format.html { redirect_to [@organization, @game], notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n end\n end\n rescue => e\n logger.error(e)\n respond_to do |fomat|\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f16d4b2339bee16f14eb8912993e2b60",
"score": "0.5690264",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n sync_update @game\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9177163665e5aad7f8d447e11c965cdd",
"score": "0.5684079",
"text": "def update\n respond_to do |format|\n if @game_player.update(game_player_params)\n format.html { redirect_to case_game_round_path(@game_player.game_round), notice: '玩家信息更新成功.' }\n format.json { render :show, status: :ok, location: @game_player }\n else\n format.html { render :edit }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7f11d94e5b8120c8909538580a0d020",
"score": "0.5681169",
"text": "def set_games_from_result\n @games_from_result = GamesFromResult.find(params[:id])\n end",
"title": ""
},
{
"docid": "31d996235eea97e92ca6c211cf17d6f4",
"score": "0.5679955",
"text": "def update_inputs\n if Input.trigger?(:A)\n $game_system.se_play($data_system.decision_se)\n if display_message(ext_text(8997, 41), 1, ext_text(8997, 33), ext_text(8997, 34)) == 0\n @return_data = true\n @running = false\n end\n elsif Input.trigger?(:B)\n mouse_quit\n end\n end",
"title": ""
},
{
"docid": "7fc70c3c0de60bd1423bae4b0aef4f7b",
"score": "0.5677886",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fc70c3c0de60bd1423bae4b0aef4f7b",
"score": "0.5677886",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fc70c3c0de60bd1423bae4b0aef4f7b",
"score": "0.5677886",
"text": "def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed4ca61702e296754abe77db97c7466",
"score": "0.567627",
"text": "def guess(input)\n @last_guess = input\n compare(input)\n @turns += 1\n end",
"title": ""
},
{
"docid": "0ed4ca61702e296754abe77db97c7466",
"score": "0.567627",
"text": "def guess(input)\n @last_guess = input\n compare(input)\n @turns += 1\n end",
"title": ""
}
] |
62de4bbd8d170777034355be9d7f54fa | Ping the Rails app to get all the AWON station database IDs. Return a Hash e.g. 4751 => 7 (or whatever the ID of Hancock's record is in the database) | [
{
"docid": "cbdf98d7e40a3fe2a33c2fcdfec057c6",
"score": "0.7008868",
"text": "def awon_station_ids(http)\r\n stn_ids = {}\r\n JSON.parse(http.get(\"#{URL_PREFIX}/awon_stations.json\").body).each do |rec|\r\n stn_ids[rec[\"stnid\"]] = rec\r\n end\r\n stn_ids\r\nend",
"title": ""
}
] | [
{
"docid": "cbcde3409e3ec023cf5e09be4c4b1d6e",
"score": "0.6210169",
"text": "def find_stats\n indices = {}\n return indices if (app.nil? || !app.started?)\n\n message = { :droplet => app.id, :version => app.generate_version,\n :states => ['RUNNING'], :include_stats => true }\n opt = { :timeout => 2, :expected => app.instances }\n running_instances = NATS.timed_request('dea.find.droplet', message.to_json, opt)\n\n running_instances.each do |instance|\n instance_json = Yajl::Parser.parse(instance, :symbolize_keys => true)\n index = instance_json[:index]\n if index >= 0 && index < app.instances\n indices[index] = {\n :state => instance_json[:state],\n :stats => instance_json[:stats]\n }\n end\n end\n\n app.instances.times do |index|\n index_entry = indices[index]\n unless index_entry\n indices[index] = {\n :state => :DOWN,\n :since => Time.now.to_i\n }\n end\n end\n\n indices\n end",
"title": ""
},
{
"docid": "e40036ec10e628cc0c41f5e151ec1ac3",
"score": "0.6019125",
"text": "def find_instances\n return [] unless app.started?\n instances = app.instances\n indices = []\n\n message = {\n :droplet => app.id,\n :version => app.generate_version,\n :state => :FLAPPING\n }\n\n flapping_indices_json = NATS.timed_request('healthmanager.status', message.to_json, :timeout => 2).first\n flapping_indices = Yajl::Parser.parse(flapping_indices_json, :symbolize_keys => true) rescue nil\n if flapping_indices && flapping_indices[:indices]\n flapping_indices[:indices].each do |entry|\n index = entry[:index]\n if index >= 0 && index < instances\n indices[index] = {\n :index => index,\n :state => :FLAPPING,\n :since => entry[:since]\n }\n end\n end\n end\n\n message = {\n :droplet => app.id,\n :version => app.generate_version,\n :states => ['STARTING', 'RUNNING']\n }\n\n expected_running_instances = instances - indices.length\n\n if expected_running_instances > 0\n opts = { :timeout => 2, :expected => expected_running_instances }\n running_instances = NATS.timed_request('dea.find.droplet', message.to_json, opts)\n running_instances.each do |instance|\n instance_json = Yajl::Parser.parse(instance, :symbolize_keys => true) rescue nil\n next unless instance_json\n index = instance_json[:index] || instances\n if index >= 0 && index < instances\n indices[index] = {\n :index => index,\n :state => instance_json[:state],\n :since => instance_json[:state_timestamp]\n }\n end\n end\n end\n\n instances.times do |index|\n index_entry = indices[index]\n unless index_entry\n indices[index] = { :index => index, :state => :DOWN, :since => Time.now.to_i }\n end\n end\n indices\n end",
"title": ""
},
{
"docid": "bb2f6bd15563f74f4d71e4d6fa48b708",
"score": "0.598928",
"text": "def registered_nicks\n nicks = db_connect do |db|\n db[$login_collection].find({}, {fields: ['_id']}).to_a\n end\n\n nicks.collect { |n| n['_id'] }\nend",
"title": ""
},
{
"docid": "7fcb9a159049fe1ff259ce401380c377",
"score": "0.56880915",
"text": "def existing_stations\n @stations.keys\n end",
"title": ""
},
{
"docid": "2d8a8bb0ca40f7026518aa001cfed428",
"score": "0.5510155",
"text": "def nearby_bssids\n return [] unless has_wifi\n\n bssids = self.wifi.with_indifferent_access[:bssids]\n\n # if api key hoccer compatible: only clients with hoccer compatible api keys\n # if not: only clients with same api key\n\n if hoccer_compatible?\n query = { \"api_key\" => { \"$in\" => hoccer_compatible_api_keys } }\n else\n query = { \"api_key\" => api_key }\n end\n\n # environment update in last 30s and sharing a bssid\n\n return [] unless bssids\n Environment.where(\n { \"created_at\" => {\"$gt\" => Time.now.to_f - 30}}\n ).where(\n query\n ).any_of(\n *(bssids.map { |bssid| {\"wifi.bssids\" => bssid} })\n ).to_a\n end",
"title": ""
},
{
"docid": "907c38dca002d626f03519f2d02b05b0",
"score": "0.5508892",
"text": "def show\n @stations = Station.where(rent_house_id: set_rent_house.id).all\n end",
"title": ""
},
{
"docid": "49800ee4b875255c8b86d523792983ce",
"score": "0.5501891",
"text": "def stations\n unique_macs.map do |mac|\n station = Station.new(mac: mac)\n dump_rows.each do |row|\n fields = row.split('\"')\n unless station.probes.include?(fields[1])\n station.probes << fields[1] if fields[0].include?(mac)\n end\n end\n station\n end\n end",
"title": ""
},
{
"docid": "55411e0aef994f37080bf5d701611fe3",
"score": "0.5453673",
"text": "def hive_mind_device_identifiers\n { id: @device_id }\n end",
"title": ""
},
{
"docid": "da5e9e5946d459565e15461b3611822a",
"score": "0.54135805",
"text": "def hive_mind_device_identifiers\n { id: @hive_id }\n end",
"title": ""
},
{
"docid": "12ff7081d41fa4c1142d5364f61f078a",
"score": "0.5370751",
"text": "def servers\n @server_ids.keys\n end",
"title": ""
},
{
"docid": "565e310735736e35ab8d45036e102a2d",
"score": "0.5366347",
"text": "def pad_ids\n @instance.client.listPads(@id)[:padIDs].keys\n end",
"title": ""
},
{
"docid": "01c9c23eee6dd82d0c85fe3a13280f1f",
"score": "0.53557026",
"text": "def list_bintip_stations\n\treturn if authorise_for_web(program_name?,'read') == false\n\n\tlist_query = \"@bintip_stations = BintipStation.find(:all)\"\n\tsession[:query] = list_query\n\trender_list_bintip_stations\nend",
"title": ""
},
{
"docid": "b8823de25bdb661f9d262b7ac38efb6e",
"score": "0.53504425",
"text": "def all_ids\n json = JSON.parse(http_client.get(\"computers\"))\n json[\"computers\"].map { |c| c[\"id\"] }\n end",
"title": ""
},
{
"docid": "2bd49cbc42e7e0505bf323ff7b58fe9b",
"score": "0.5346387",
"text": "def index\n @stupids = Stupid.all\n end",
"title": ""
},
{
"docid": "81cbb5f621df2a8de86f7e23141404ab",
"score": "0.5318515",
"text": "def index\n @rack_in_halls = RackInHall.all\n end",
"title": ""
},
{
"docid": "dfda4255627334a247e938fcb14009a6",
"score": "0.5316142",
"text": "def monitor\r\n#\t\tStatus.first.update(pool_size:10)\r\n\t\tEvent.delete_all\r\n#\t\tUser.update_all(online:false)\r\n\t\tloop do \r\n\t\t\tapp.get \"/simulation/monitor?token=#{TOKEN}\"\r\n#\t\t\tp \"clients online count = \" + JSON(app.response.body)[\"clients_online\"].to_s + \" ** events count =\" + JSON(app.response.body)[\"count\"].to_s\r\n\t\t\tp \"Users online: #{User.where(online: true).count}, event_count=#{Event.count}\"\r\n\t\t#\tp \"unique clients: \" + Event.where(event:'signin').pluck(:user_id).uniq.count.to_s\r\n\t\t\tsleep 3\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "3be7e85c7fee90d5e5e58bf5a8234ae1",
"score": "0.5315449",
"text": "def pad_ids\n @client.listAllPads[:padIDs]\n end",
"title": ""
},
{
"docid": "f2e3fa3b31b2fc90e9d92f7740f5b987",
"score": "0.5300488",
"text": "def load_pids()\n pids = []\n\n conn = Faraday.new(:url => @protocol + \"://\" + @host) do |c|\n c.use Faraday::Request::UrlEncoded\n c.use Faraday::Adapter::NetHttp\n end\n conn.basic_auth(@admin, @password)\n\n ri_url = \"/fedora/risearch\"\n ri_query = \"\n select $s\n from <#ri>\n where\n ($s <info:fedora/fedora-system:def/model#hasModel> <info:fedora/york:CModel-Iris>)\n \"\n riresults = conn.post ri_url, {'lang' => 'itql',\n 'format' => 'Sparql',\n 'query' => ri_query\n }\n\n ri_results_doc = Nokogiri::XML(riresults.body.to_s)\n pids_elements = ri_results_doc.xpath('/sp:sparql/sp:results/sp:result/sp:s/@uri', 'sp' => 'http://www.w3.org/2001/sw/DataAccess/rf1/result')\n for pe in pids_elements\n pids << (pe.text.sub! 'info:fedora/','')\n end\n pids\n end",
"title": ""
},
{
"docid": "50723e2ce2a127dc871cd5486647be98",
"score": "0.52930576",
"text": "def load_pids()\n pids = []\n\n conn = Faraday.new(:url => @protocol + \"://\" + @host) do |c|\n c.use Faraday::Request::UrlEncoded\n c.use Faraday::Adapter::NetHttp\n end\n conn.basic_auth(@admin, @password)\n\n ri_url = \"/fedora/risearch\"\n ri_query = \"\n select $s\n from <#ri>\n where\n ($s <info:fedora/fedora-system:def/model#hasModel> <info:fedora/york:CModel-Iris>)\n \"\n riresults = conn.post ri_url, {'lang' => 'itql',\n 'format' => 'Sparql',\n 'query' => ri_query\n }\n\n ri_results_doc = Nokogiri::XML(riresults.body.to_s)\n pids_elements = ri_results_doc.xpath('/sp:sparql/sp:results/sp:result/sp:s/@uri', 'sp' => 'http://www.w3.org/2001/sw/DataAccess/rf1/result')\n for pe in pids_elements\n pids << (pe.text.sub! 'info:fedora/','')\n end\n pids\n end",
"title": ""
},
{
"docid": "eba38160e4db69ba45d7c845de3726cc",
"score": "0.5284356",
"text": "def index\n @no_of_stations = current_user.stations.length\n @station = DataGateway.find(params[:gateway_id]) rescue @stations.try(:first)\n @station = current_user.stations.first if current_user.is_broadcaster? && @station.blank?\n if @station.present?\n @entryways = @station.data_entryways.page(params[:page]).per(DIDS_PAGE_SIZE)\n @station_id = @station.id\n end\n end",
"title": ""
},
{
"docid": "b41ad5143021eedff79b2cb1ab4603f2",
"score": "0.528171",
"text": "def airports\n query_host(\"P\")\n end",
"title": ""
},
{
"docid": "8e7d2c40e74291abee3f943e7cb3427f",
"score": "0.5247691",
"text": "def get_monitors\n if cluster_exists?\n return search(:node, 'recipes:ceph\\:\\:mon').map { |m| m[\"ipaddress\"] }.join(\",\")\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "775d5005001bf945bf418a7e61d7195d",
"score": "0.5242461",
"text": "def get_api_ids\n cb = {api_id: 1, callback: self.method(:on_get_api_id)}\n\n database(cb)\n history(cb)\n network_broadcast(cb)\n\n # this by default is disabled by api-access.json\n # we don't need it normally\n # network_node(cb)\n end",
"title": ""
},
{
"docid": "480eac2f236cbbbd3dc30983e1396f03",
"score": "0.5227451",
"text": "def show\n @server = Server.find(params[:id])\n @users = User.where(hostname: @server.hostname)\n @pids = Pid.where(hostname: @server.hostname)\n @networks = Network.where(hostname: @server.hostname)\n end",
"title": ""
},
{
"docid": "9b35a4872c5e366479646e932a4ffd25",
"score": "0.52149117",
"text": "def index\n @polling_station_masters = PollingStationMaster.all\n end",
"title": ""
},
{
"docid": "860eb742548742179feb9dab4a1306e5",
"score": "0.5208708",
"text": "def instances\n Web::PortletPreferences.find(:all, :conditions => \"plid=#{self.plid} AND portletid LIKE '%INSTANCE%'\")\n end",
"title": ""
},
{
"docid": "bdf89bca12ab712a7f75000569a38855",
"score": "0.52079666",
"text": "def player_id\n\t@id_hash = {}\n\t@rosters = @basketballdb.execute(\"select *from players\")\n\t@rosters.each { |hash| @id_hash[hash[2]] = hash[0] }\n\t@id_hash\nend",
"title": ""
},
{
"docid": "faaa2102c806aa3daf7bd0013a20972c",
"score": "0.51641226",
"text": "def detailQuery(params)\n \n begin\n\n records = []\n\n hostIdentifier = \"%\"\n \n if( params.serverId )\n hostIdentifier = params.serverId\n end\n \n stm = @@connection.prepare(\"SELECT id_host, host_name, ip_address, desc FROM host WHERE id_host LIKE :id\")\n\n rs = stm.execute(hostIdentifier)\n\n rs.each_hash do |row|\n records.push(row)\n end\n\n rescue SQLite3::Exception => e\n puts \"Error occured\" + e.to_s\n exit(14)\n ensure\n stm.close if stm\n end # begin\n\n return records\n \n end",
"title": ""
},
{
"docid": "3594086170f302b5769b2f446e8cb04e",
"score": "0.5163954",
"text": "def index\n @appservers = Appserver.all\n end",
"title": ""
},
{
"docid": "c5e41c0d8fc4920d578306e76a0f7668",
"score": "0.51440567",
"text": "def index\n @ping_urls = PingUrl.all\n end",
"title": ""
},
{
"docid": "053574e002c8033d7be17c1a18614ec9",
"score": "0.51431805",
"text": "def index\n @ping_results = PingResult.all\n end",
"title": ""
},
{
"docid": "d490cc4ff417f0bb37b50f42f604461b",
"score": "0.5140034",
"text": "def index\n @app_servers = AppServer.all\n end",
"title": ""
},
{
"docid": "c4ba8898c92de560f9b0468fd2e5be30",
"score": "0.5136139",
"text": "def get_node_lookup_hash\n @queries += 1\n results = @client.query \"SELECT abc_persid, abc_lasthash FROM #{@config['streamer_table']}\"\n hash_tbl = {}\n results.each{ |res| hash_tbl[res['abc_persid']] = res['abc_lasthash'] }\n hash_tbl\n end",
"title": ""
},
{
"docid": "75866646cf3194de3c925c571ec56f38",
"score": "0.51350045",
"text": "def server_ids\n self.servers.map(&:_id)\n end",
"title": ""
},
{
"docid": "639464715734bd5972201f18282145d2",
"score": "0.51329803",
"text": "def get_on_site_map config, packages\n pids = packages.map { |p| p.islandora_pid }\n return Utils.ping_islandora_for_objects(config.site, pids)\n end",
"title": ""
},
{
"docid": "b4b82205d77179b4597f51c3e0ffb514",
"score": "0.5126863",
"text": "def nap_ids\n alliance_id.nil? ? [] : Alliance.player_ids_for(\n Nap.alliance_ids_for(alliance_id)\n )\n end",
"title": ""
},
{
"docid": "c0751f8a7e3653c8db344978f452c144",
"score": "0.5121194",
"text": "def server_behind_me_ids()\n @ids = []\n for o in vip_servers\n @ids << o.asset_id\n end\n @ids\n end",
"title": ""
},
{
"docid": "31326db3edee3317df4bd31f5efece89",
"score": "0.5118842",
"text": "def index\n @gw_stations = GwStation.all\n end",
"title": ""
},
{
"docid": "0a000a8222bb114ed5a3028922280f77",
"score": "0.5114205",
"text": "def apids\n entries = []\n next_uri = ALL_APIDS_URI\n \n until next_uri.nil? do\n response = @connection.get(next_uri)\n return nil unless successful?(response)\n \n page_entries = parse(response.body)\n \n entries = entries.concat(page_entries['apids'])\n next_uri = page_entries['next_page']\n end\n \n { \"apids\" => entries }\n end",
"title": ""
},
{
"docid": "8f6cf174e072d359c675f16792ff5bf8",
"score": "0.510844",
"text": "def service_ids() ; info[:services] ; end",
"title": ""
},
{
"docid": "c42c57edd9516ad0dec2917f194cb93f",
"score": "0.510713",
"text": "def index\n @database1s = Database1.all\n @server_options = Server.all.map{|u| [ u.server_name, u.id ] }\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @database1s }\n end\n end",
"title": ""
},
{
"docid": "b7baf31ffbd5cdae3c8095592fcfa46a",
"score": "0.51039904",
"text": "def service_ids\n @stashboard.service_ids\n end",
"title": ""
},
{
"docid": "b149173d3e73eb53568b5d4e45597ee3",
"score": "0.5099689",
"text": "def heartbeat\n hb = {}\n hb['usage'] = {}\n @tenantmanagers.each do |id, tm|\n hb['usage'][id] = tm.num_workers\n end\n hb\n end",
"title": ""
},
{
"docid": "11e47b3e283adcef43314e30fdebcff0",
"score": "0.5097394",
"text": "def index\n @air_monitor_databases = AirMonitorDatabase.all\n end",
"title": ""
},
{
"docid": "8a0738d353a13a4484df5175c6212e4b",
"score": "0.509145",
"text": "def index\n @db_insts = DbInst.all\n end",
"title": ""
},
{
"docid": "dc5fe8ea99114ca8a5c6fc56dd1e60c2",
"score": "0.50886744",
"text": "def servers\n @servers = Server.where([\"servers.app_id = ?\", params[:id]])\n if @servers.empty?\n @servers = Server.all\n flash[:notice] = 'No servers assigned to this application yet, showing all servers.'\n render 'servers/index' and return\n end\n render 'servers/index'\n end",
"title": ""
},
{
"docid": "3b12e5023c9e841127c573a29f4fb00d",
"score": "0.50861",
"text": "def all_apps\n @ph.to_h.keys\n end",
"title": ""
},
{
"docid": "51206be0a9ae2a2dff155d71f95817eb",
"score": "0.5084739",
"text": "def list\n results = $db.execute(\"SELECT id, hint FROM secrets\")\n \n puts \"Secrets database contains #{results.length} row(s).\"\n \n results.each do |row|\n puts \" #{row['id']}: #{row['hint']}\"\n end\nend",
"title": ""
},
{
"docid": "047a2e5b9beba303245550ae264ae0f5",
"score": "0.50719917",
"text": "def index\n @stations = Station.all\n if(@stations.empty?)\n get_station\n @stations = Station.all\n end\n gon.stations = @stations\n gon.your_int = 1\n end",
"title": ""
},
{
"docid": "207cdb1ce9ec66d28749737af97aa7ac",
"score": "0.5071706",
"text": "def get_station_list\n uri = URI.parse(\"http://www.citibikenyc.com/stations/json\")\n res = Net::HTTP.get_response(uri)\n json_response = JSON.parse(res.body)\n json_response[\"stationBeanList\"]\n end",
"title": ""
},
{
"docid": "abb3c7f495c4acff6c4b4f364eb50119",
"score": "0.5070907",
"text": "def index\n @client = Client.find(session[:client_id])\n\t @department = Department.find(session[:department_id])\n @site = Site.find(session[:site_id])\n @iotonservers = Iotonserver.all\n end",
"title": ""
},
{
"docid": "207ace34e139c8afda625aed51f355bb",
"score": "0.50689954",
"text": "def marketapp_ids\n array = Array.new\n\n self.each(\"MARKETPLACEAPPS/ID\") do |id|\n array << id.text.to_i\n end\n\n return array\n end",
"title": ""
},
{
"docid": "bc94945d3104379b9a4869ebd92cb013",
"score": "0.506186",
"text": "def network_hosts_all\n begin\n print_verbose \"Retrieving all network hosts\"\n response = RestClient.get \"#{@url}network/hosts\", {:params => {:token => @token}}\n details = JSON.parse(response.body)\n print_good \"Retrieved #{details['count']} network hosts\"\n details\n rescue => e\n print_error \"Could not retrieve network hosts: #{e.message}\"\n end\nend",
"title": ""
},
{
"docid": "eb0c8ef1d6172514454ceb14ea829a2a",
"score": "0.5057189",
"text": "def index\n @port_hub_maps = PortHubMap.all\n end",
"title": ""
},
{
"docid": "6e47865be64513eaa946e88c43181af7",
"score": "0.5054137",
"text": "def services\n services = RingyDingy::RingServer.list_services\n\n services.values.flatten 1\n end",
"title": ""
},
{
"docid": "d24f146d907572b388373cc847d651a3",
"score": "0.505115",
"text": "def find_bin_ids(site_id, device_id, empty=true)\n empty ? command = 'Add' : command = 'Remove'\n bin_ids = {}\n url = 'https://fastsolutions.mroadmin.com/Apex-Device/devicePOGAction_detailPOG.action'\n params = {'comId' => @store, 'siteId' => site_id, 'requestId' => device_id}\n response = @browser.get(url, params).content\n response = Nokogiri::HTML(response)\n row_ids = response.css('.tableContainer tr')\n row_ids = row_ids.select { |node| node.values[0].to_s =~ /tr/ or node.values[0].to_s =~ /lockerTr/ }\n # ['lockerTr52', 'lockerTr53']\n row_ids = row_ids.collect { |node| node.values[0].to_s.scan(/[\\d]+/)[0] }\n row_ids.each do |id|\n addLockerItem = response.css(\"#locker#{command}Text#{id} a\")\n if !addLockerItem.empty?\n addLockerItem = addLockerItem[0]['href'].to_s\n loc_code = addLockerItem.scan(/LOC[\\d]+/)[0]\n position = addLockerItem.scan(/[\\d]*?\\.[\\d]/)[0]\n bin_ids[position] = loc_code\n end\n end\n bin_ids\n end",
"title": ""
},
{
"docid": "4f4c612f0179438d8a80426f2ab992f8",
"score": "0.5049789",
"text": "def collate_pings(list_ping_hash)\r\n\t\tcollated_pings = {}\r\n\t\tlist_ping_hash.each do |ping_hash|\r\n\t\t\tdevice_id = ping_hash[\"device_ID\"]\r\n\t\t\tif collated_pings[device_id] == nil\r\n\t\t\t\tcollated_pings.store(device_id,[ping_hash[\"time\"]])\r\n\t\t\telse\r\n\t\t\t\tcollated_pings[device_id] << ping_hash[\"time\"]\r\n\t\t\tend\r\n\t\tend\r\n\t\treturn collated_pings\r\n\tend",
"title": ""
},
{
"docid": "68afce0d0ddc430e06ece08e53377350",
"score": "0.50432247",
"text": "def ping\n value = get_bus_stops_from_bus(Bus.find(params[:bus_id]), BusStop.find(params[:bus_stop_id]))\n respond_to do |format|\n format.json { render json: value }\n end\n end",
"title": ""
},
{
"docid": "6936eb7d5ab3ad9eb3b3fd3caaa2a609",
"score": "0.50425327",
"text": "def fetch_host_list\n query = <<~SQL\n SELECT site_name FROM customer WHERE active = 1 UNION\n SELECT CONCAT(site_name,\\'-wifi\\') AS site_name FROM backbone WHERE active=1 UNION\n SELECT site_name FROM backbone WHERE active=1 UNION\n SELECT CONCAT(site_name,\\'-wifi\\') AS site_name FROM distribution WHERE active=1 UNION\n SELECT site_name FROM distribution WHERE active=1\n ORDER BY site_name\n SQL\n\n @mysql_conf = WIKK::Configuration.new(MYSQL_CONF)\n WIKK::SQL.connect(@mysql_conf) do |sql|\n sql.each_hash(query) do |row|\n host_name = row['site_name']\n if @ignore_hosts[host_name].nil?\n @host_list << host_name\n @ignore_hosts[host_name] = true\n end\n end\n end\nend",
"title": ""
},
{
"docid": "6c6cd194ad484498c90399a4bac3acbf",
"score": "0.5040678",
"text": "def fetch_host_info(fqdn)\n {\n :ram => 0,\n :cores => 0\n }\n end",
"title": ""
},
{
"docid": "8fa5d1e2fe36832b12479747180647ea",
"score": "0.5039356",
"text": "def getHpks\n rds.smembers(@config[:hpkey])\n end",
"title": ""
},
{
"docid": "8fa5d1e2fe36832b12479747180647ea",
"score": "0.5039356",
"text": "def getHpks\n rds.smembers(@config[:hpkey])\n end",
"title": ""
},
{
"docid": "6b4ff9d9bcfb12d9a99d3fb2531a01c1",
"score": "0.5037295",
"text": "def index\n @power_stations = PowerStation.all\n end",
"title": ""
},
{
"docid": "6ccb903f07e6b1c8d0a975041e66e4e9",
"score": "0.5036997",
"text": "def get_hospital_ids_from_server\n url = NHSChoicesAPI::API_URL + 'identifiermappings.xhtml' + api_key\n doc = Nokogiri::HTML(open(url))\n id_arr = []\n doc.css('#identifierMappings tr td.id').each do |id|\n id_arr << id.content\n end\n return id_arr\n end",
"title": ""
},
{
"docid": "a2ccd4eaf89b7c0b2bf01abaef863485",
"score": "0.5035552",
"text": "def getHpks\n result = rds.smembers(@config[:hpkey])\n end",
"title": ""
},
{
"docid": "69ab8d0c393df1ce608e0e695578f3a4",
"score": "0.50255704",
"text": "def get_connection_ids(connections)\n connections.map { |connection| connection['id'] }\nend",
"title": ""
},
{
"docid": "fbc1b0fd46597e9d0259e48c0f64a06d",
"score": "0.5018574",
"text": "def platform_ids(refresh=false)\n cached_value(\"game_ids\", {}, refresh) do |ids|\n search_doc = Hpricot(open(SEARCH_URL))\n search_doc.search(PLATFORMS_ID_PATH).each do |option|\n ids[option['label']] = option['value']\n end\n end\n end",
"title": ""
},
{
"docid": "b434ba67513e1c11900ae84227cda68d",
"score": "0.5014472",
"text": "def GetSegmentIds()\n i = 1\n segmentIds = Array.new\n manager = Client.new(:host => @host,:community => 'security',:version => :SNMPv1)\n manager.walk(oid: \"1.3.6.1.4.1.43.10.26.1.1.1.5\").each do |oid_code, value|\n if(i > 14 && i < 19)\n segmentIds.push(value)\n end\n i = i + 1\n end\n manager.close\n return segmentIds\nend",
"title": ""
},
{
"docid": "139895eefed107c212318095b90bb79a",
"score": "0.5013105",
"text": "def get_singers #needs room as param\n room_url = @@room_ips[params[:room].to_i]\n res = HTTParty.get(\"#{room_url}singers\")\n list = []\n case res.code\n when 200\n parsed_res = Nokogiri::PList(res)\n parsed_res[\"Playlists\"][0][\"Playlist Items\"].each do |e| \n unless (e[\"SNGR\"].blank? || e[\"siID\"].blank?) \n list << {name: e[\"SNGR\"], siID: (e[\"siID\"]+1)}#I think it's +1 because drop has siID's 0 indexed but singers returns them 1 indexed?\n end\n end\n render json: list\n when 404\n render json: \"404 error\"\n when 500...600\n render json: \"ERROR #{response.code}\"\n end\n end",
"title": ""
},
{
"docid": "2a16f5d00e94c4a936978a1e34320e9d",
"score": "0.5012959",
"text": "def id\n @status.current[:monit][:server][:id]\n end",
"title": ""
},
{
"docid": "baa97483de11be7a469c92dd986e9851",
"score": "0.50116456",
"text": "def graceful_clients # rubocop:disable Metrics/MethodLength\n keyspace = settings['graceful-shutdown']['keyspace']\n\n # Get a list of the stashes\n response = api_request(:GET, '/stashes')\n\n # Make sure we are able to retrieve the stashes\n critical 'Unable to retrieve stashes' if response.code != '200'\n\n #\n all_stashes = JSON.parse(response.body)\n\n # Filter the stathes\n filtered_stashes = []\n all_stashes.each do |stash|\n if match = stash['path'].match(/^#{keyspace}\\/(.*)/) # rubocop:disable all\n filtered_stashes << match.captures[0]\n end\n end\n\n filtered_stashes\n end",
"title": ""
},
{
"docid": "4154c808b27c562cc6780f0f79a2d0f9",
"score": "0.5009124",
"text": "def all_dbs\n get('/_all_dbs')\n end",
"title": ""
},
{
"docid": "66d81ba412c61c6ec962109a365113fc",
"score": "0.5006479",
"text": "def loadbalancer_device(id)\n elektron_amphorae.get(id).body.fetch(\"amphora\", {})\n end",
"title": ""
},
{
"docid": "643fea223ac60b326c16ba68ff7bbfda",
"score": "0.49962965",
"text": "def listings\n @listings ||= Listing.find_all_by_shop_id(shop_id)\n end",
"title": ""
},
{
"docid": "23fc091af63efdf07bd2c246f9775f32",
"score": "0.49960104",
"text": "def index\n @g4_dongal_board_pharms = G4DongalBoardPharm.all\n end",
"title": ""
},
{
"docid": "3a6d114020bc01b1760647cec36e319f",
"score": "0.49953693",
"text": "def index\n #1st you retrieve the location thanks to params[:location_id]\n device = Device.find(params[:device_id])\n #2nd you get all the net_racks of this location\n @devports = device.devports\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @devices }\n end\n end",
"title": ""
},
{
"docid": "4f4e56ade885f3ffee2f357c898a627d",
"score": "0.4994471",
"text": "def list_rebin_label_stations\n\treturn if authorise_for_web(program_name?,'read') == false\n\n\tlist_query = \"@rebin_label_stations = RebinLabelStation.find(:all)\"\n\tsession[:query] = list_query\n\trender_list_rebin_label_stations\nend",
"title": ""
},
{
"docid": "c8da47303e117bb6f59fd01afd5be5b9",
"score": "0.49895355",
"text": "def twitter_id_pool\n # This is a hack to deal with the fact that the backend seems to return an empty Hash when \n # a Moneta::Memory store has an uninitialized value. TODO - take a closer look at this later\n # and see if Moneta needs to be patched or if it's something screwy in the way we're using it.\n res = @backend[twitter_id_pool_key]\n res.nil? || res == { } ? [ ] : res\n end",
"title": ""
},
{
"docid": "0e2b3270808df0ff31fa1a1d9c877ff1",
"score": "0.49880296",
"text": "def list_pallet_label_stations\n\treturn if authorise_for_web(program_name?,'read') == false\n\n\tlist_query = \"@pallet_label_stations = PalletLabelStation.find(:all)\"\n\tsession[:query] = list_query\n\trender_list_pallet_label_stations\nend",
"title": ""
},
{
"docid": "782923bfd26d8d0a94bc228c16eb613c",
"score": "0.4986934",
"text": "def satellites\n @satellites ||= hex_byte_field(8)\n end",
"title": ""
},
{
"docid": "5b7508562f8aa5d2f6798d6db1d42b70",
"score": "0.49859786",
"text": "def nids\n# @table_lock.synchronize { @nid_peers.keys }\n @nid_peers.keys\n end",
"title": ""
},
{
"docid": "93210714ca36a1ebfa6121bec18eaf65",
"score": "0.49856213",
"text": "def network_services_all\n begin\n print_verbose \"Retrieving all network services\"\n response = RestClient.get \"#{@url}network/services\", {:params => {:token => @token}}\n details = JSON.parse(response.body)\n print_good \"Retrieved #{details['count']} network services\"\n details\n rescue => e\n print_error \"Could not retrieve network services: #{e.message}\"\n end\nend",
"title": ""
},
{
"docid": "781ac01ef8aab6d15db940ad8b9e7d70",
"score": "0.4985448",
"text": "def index\n @doku_ids = DokuId.all\n end",
"title": ""
},
{
"docid": "a39bd24d1f186d9202bb36f35d62c464",
"score": "0.49740568",
"text": "def pad_ids\n @instance.client.listPads(groupID: @id)[:padIDs]\n end",
"title": ""
},
{
"docid": "1c38523e0874026ba75c1b7947005242",
"score": "0.49675393",
"text": "def get_all_glassware\n counter = 1\n response_array = []\n while counter < 2\n response_string = RestClient.get('https://sandbox-api.brewerydb.com/v2/glassware/?p='\"#{counter}\"'&key=67caa2c52c8169eeea83e4c37e6d9b14')\n response_hash = JSON.parse(response_string)\n response_array << response_hash[\"data\"]\n counter += 1\n # binding.pry\n end\n response_array.flatten\nend",
"title": ""
},
{
"docid": "2f32542c33195b30ff824f3593ae5b35",
"score": "0.49673438",
"text": "def oldstations_bootstrap()\n MongoClient.open do |mc|\n File.foreach(\"oldstations.txt\") do |line|\n sid = Integer(line.strip())\n # puts JSON.neat_generate({_id: sid})\n mc.insert_bootstrap_station({_id: sid})\n end\n end\nend",
"title": ""
},
{
"docid": "0d39e001e763b125f2fc0092f9d5b197",
"score": "0.49652767",
"text": "def index\n @petrol_pump_stations = PetrolPumpStation.all\n end",
"title": ""
},
{
"docid": "80c4b56572153af2d624091127387348",
"score": "0.49652365",
"text": "def listing_ids\n page = @agent.get(\"https://admin.vrbo.com/admin\")\n page.search(\".prop-card.active\").collect{|e| e[:id]}\n end",
"title": ""
},
{
"docid": "ba9253757b8f8951cc2533edb618d34d",
"score": "0.4963141",
"text": "def get_galera_status\n begin\n client = Mysql2::Client.new(\n host: @server,\n port: @sql_port,\n username: @user,\n password: @password,\n as: :array\n )\n result = client.query \"SHOW STATUS LIKE 'wsrep_%';\"\n if result.count > 0\n\n # We need to do some conversion here in order to get a usable hash\n result.each do |r|\n @status.merge!(Hash[*r])\n end\n end\n client.close\n rescue Exception => message\n # FIXME Properly handle exception\n puts message\n end\n end",
"title": ""
},
{
"docid": "674b76e4638a32e0f3a24d7b416a0afe",
"score": "0.49566278",
"text": "def index\n page = params[:page] || 1\n @raw_pings = RawPing.page(page)\n end",
"title": ""
},
{
"docid": "adbb95429ee754473eea268477423beb",
"score": "0.4949014",
"text": "def index\n #1st you retrieve the location thanks to params[:location_id]\n net_rack = NetRack.find(params[:net_rack_id])\n #2nd you get all the net_racks of this location\n @devices = net_rack.devices\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @net_racks }\n end\n end",
"title": ""
},
{
"docid": "03e72cb34df772b9eb52adc2294e6185",
"score": "0.49450868",
"text": "def get_instance_ids\n client.api_call('describe_instances', layer_id: id)[:instances].map{ |s| s[:instance_id] }\n end",
"title": ""
},
{
"docid": "64b9282aa25dc5bfdc45f92bf099baff",
"score": "0.49428824",
"text": "def find_available_map_servers(count)\n case count\n when 1\n [[\"127.0.0.1\", 9081]]\n when 2\n [[\"127.0.0.1\", 9082], [\"127.0.0.1\", 9083]]\n when 3\n [[\"127.0.0.1\", 9081], [\"127.0.0.1\", 9082], [\"127.0.0.1\", 9083]]\n when 4\n [[\"127.0.0.1\", 9081], [\"127.0.0.1\", 9082], [\"127.0.0.1\", 9083], [\"127.0.0.1\", 9084]]\n when 5\n [[\"127.0.0.1\", 9081], [\"127.0.0.1\", 9082], [\"127.0.0.1\", 9083], [\"127.0.0.1\", 9084], [\"127.0.0.1\", 9085]]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "0fa468b8b2bd92437547d1ee049606ff",
"score": "0.49412033",
"text": "def recordings\n backend = Setting.connect_mythtv_backend\n recordings = backend.query_recordings({ :filter => { :recordid => /^#{mythtv_recordid}$/ }})\n backend.close\n recordings\n end",
"title": ""
},
{
"docid": "c0d24430cc6e7c615dcfc5cc1ebbe87e",
"score": "0.49395835",
"text": "def getdbs\r\n\r\n\tdbs = `mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -Dpsa -e \"SELECT d.name AS DOMAIN, db.name AS DB FROM db_users du, data_bases db, domains d, accounts a WHERE du.db_id = db.id AND db.dom_id=d.id and du.account_id=a.id ORDER BY d.name, db.name;\"`\r\n\tdbs = dbs.split(/\\r?\\n/)\r\n\tdatabases = {}\r\n\tdbs.each_with_index do |d, index|\r\n\t\tif index == 0\r\n\t\t\tnext\r\n\t\telse\r\n\t\t\tparts = d.split(/\\t/)\r\n\t\t\tdatabases[parts[0]] = parts[1]\r\n\t\tend\r\n\tend\r\n\t@databases = databases\r\nend",
"title": ""
},
{
"docid": "3bfd33e022790cf3ab019990ed26f1eb",
"score": "0.4937835",
"text": "def index\n @device_ids = DeviceId.all\n end",
"title": ""
},
{
"docid": "5e95a2ebb3841f76232d37ab030741e9",
"score": "0.49372917",
"text": "def vns db\n db[:network_pool].where(uid: @pe_id).select(:oid).to_a.map { |row| onblock(:vn, row[:oid]) { |vn| vn.info! || vn } }\n end",
"title": ""
},
{
"docid": "5f9806e104fb668a401e1c5e5d3ce8f1",
"score": "0.49356276",
"text": "def get_pids\n pids_ports = []\n pids = `pgrep -f thin`.split\n pids.each do |t|\n #port = `lsof -p #{t} | grep LISTEN`.split[8]\n #port = port.split(\":\")[1]\n port = `ps -ef | grep #{t} | grep -v grep | grep thin | awk '{ print $10 }' | awk -F: '{ print $2 }' | tr --delete '()'`.chomp\n pids_ports << [t,port]\n end\n pids_ports\n end",
"title": ""
},
{
"docid": "89a0410f7bbb2cc37982630847127325",
"score": "0.49328306",
"text": "def get_disconnected_sensors\r\n sensors = query_database( \"SELECT id FROM #{SENSOR_STATUS} WHERE (TIMESTAMPDIFF(MINUTE, updated_time, NOW()) > #{SENSOR_PING_TIME+1})\" )\r\n # Only return the id field\r\n return sensors.entries.map{|m| m[\"id\"]}\r\n end",
"title": ""
},
{
"docid": "784248bc3bbcedf2d316dc2067ee08c4",
"score": "0.4931793",
"text": "def update_rackid(list)\n rackid = q_update_rackid\n maxes = list.transpose.map { |g| g.map(&:length).max }\n\n puts\n print_format = \"%-#{maxes[2]}s %-#{maxes[4]}s\\n\"\n printf print_format, 'Hostname', 'Update to'\n puts \"#{'-' * (maxes[2])} #{'-' * (maxes[4] + rackid.length + 8)}\"\n\n print_format = \"%-#{maxes[2]}s \" \\\n \"%-#{maxes[4]}s => \\e[31m%-#{rackid.length}s\\e[m\\n\"\n\n list.each do |e|\n begin\n host = CM.hosts.find { |k| k[:cm] == e[0] && k[:hostname] == e[2] }\n\n if rackid == host[:rackid]\n printf print_format, host[:hostname], host[:rackid], 'DO NOTHING'\n else\n update_host_rackid(host, rackid)\n printf print_format, host[:hostname], host[:rackid], rackid\n end\n rescue StandardError => e\n print_format = \"%-#{maxes[2]}s %-#{maxes[4]}s\\n\"\n printf print_format, host[:hostname], \"[Error] #{e.message}\"\n end\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "04f09fded54019c559e784d7fb8e9ced",
"score": "0.0",
"text": "def diet_type_params\n params.require(:diet_type).permit(:name)\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": ""
}
] |
dc07a5d59500de1e800759e025eac6df | Get the total Unsubscribed/Pending apartments | [
{
"docid": "59f18b6481e9f878046e2f463147b501",
"score": "0.0",
"text": "def unsubscribed_apartment\n apartments.reject(&:subscribed)\n end",
"title": ""
}
] | [
{
"docid": "1e7e42d705c65b8f91298df0a2393e21",
"score": "0.71544445",
"text": "def total_paid\n @group.subscriptions.sum { |s| s.total_paid }\n end",
"title": ""
},
{
"docid": "875ffd0bb01b76993b14535e5a7debe4",
"score": "0.7045734",
"text": "def total_paid\n self.total_due - self.total_outstanding\n end",
"title": ""
},
{
"docid": "9b4a68976bae93bbf0059e9b81e3564c",
"score": "0.7000702",
"text": "def total\n participations.to_a.sum{ |p| p.payment.to_f }\n end",
"title": ""
},
{
"docid": "1d83e5e73d952ac31b95afc8db1e4f75",
"score": "0.68365985",
"text": "def total_due\n total - paid\n end",
"title": ""
},
{
"docid": "5bfd160161e02d3cc43a8a885e1ea7cf",
"score": "0.6707074",
"text": "def totals(subscriptions)\n @subscriptions.sum { |s| s.total_used }\n end",
"title": ""
},
{
"docid": "235eb7ef863b8ba84dc252de973908b2",
"score": "0.6690347",
"text": "def num_paid\n paid_items.count\n end",
"title": ""
},
{
"docid": "235eb7ef863b8ba84dc252de973908b2",
"score": "0.6690347",
"text": "def num_paid\n paid_items.count\n end",
"title": ""
},
{
"docid": "a3e91091ff829d5c24d632c28b21c54c",
"score": "0.66635096",
"text": "def membership_percent_total\n applied_subscriptions.select {|h| h[:type] == :percentage}.map {|h| h[:amount] }.flatten.reduce(:+).to_i || 0\n end",
"title": ""
},
{
"docid": "9450b40191bc6ac2538631d59609ccde",
"score": "0.6637302",
"text": "def total_requested\n total_amount_of_type 'REQUESTED'\n end",
"title": ""
},
{
"docid": "0a0300899681f07ab9f263a47c2f8f34",
"score": "0.6594961",
"text": "def total_delivered\n self.delivery_entries.where(:is_confirmed => true).sum(\"quantity_sent\")\n end",
"title": ""
},
{
"docid": "7eaba48542f869a3c206d75946665031",
"score": "0.65838784",
"text": "def attending\n self.invitations.sum('actual_attendees')\n end",
"title": ""
},
{
"docid": "2eab4482d3cd74aca2c40d503ba47af4",
"score": "0.6544506",
"text": "def total_lending\n Loan.sum(:amount)\n #Take all the loans and substract all that have been paid\n end",
"title": ""
},
{
"docid": "13b0a0cf54f468f171349bf05544146a",
"score": "0.6542072",
"text": "def total_paid\n transactions.sum :amount\n end",
"title": ""
},
{
"docid": "bb1317d0ef48b1c35796a4a167f1169d",
"score": "0.65171957",
"text": "def total_amount\n total_amount = extract_base_amount + # from all still active member \n extract_run_away_weekly_bail_out_amount + # amount used to bail out the run_away weekly_resolution\n extract_premature_clearance_payment_amount - #premature clearance for that week \n extract_uncollectible_weekly_payment_amount\n \n return total_amount \n end",
"title": ""
},
{
"docid": "9802ab9fada20f583b722340fe567166",
"score": "0.65125895",
"text": "def total_paid\n total = 0\n self.paid.each do |coin, how_many|\n total += coin * how_many\n end\n total\n end",
"title": ""
},
{
"docid": "8ee110c46ea47d0c11c8a0df1ae88500",
"score": "0.648621",
"text": "def invested(domain)\n startup.domain.total_amount\n end",
"title": ""
},
{
"docid": "6822281d54d73da3e6422dbc37d78fcb",
"score": "0.6481725",
"text": "def delivery_drink_count\n self.account_deliveries.sum(:quantity)\n end",
"title": ""
},
{
"docid": "b56dfb728fb80ce93af5af6447daed60",
"score": "0.64636785",
"text": "def total_pending_relatives\n self.pending_invited(false).count + self.pending_invited_by(false).count\n end",
"title": ""
},
{
"docid": "f40b34c90156c8e35afb63cc22acc003",
"score": "0.6455948",
"text": "def amt_paid_and_settled_bills\n bills = self.matter_billings.all(:conditions => [\"id = bill_id\"])\n tot = 0\n bills.each do |e|\n if e.matter_billing_status.lvalue != 'Cancelled'\n tot += e.computed_bill_amount_paid\n end\n end\n return tot\n end",
"title": ""
},
{
"docid": "bddd44f2f4bfb2f888d82c6e26a4335d",
"score": "0.64496994",
"text": "def total_payment_received_from_patient\n patients.compact.inject(0){|sum,patient| (sum + patient.total_amount)}\n end",
"title": ""
},
{
"docid": "35b4ce097bd0cc8083f0a3d1e520e6a1",
"score": "0.64321053",
"text": "def unpaid_invoice_count\r\n unpaid_received_invoices.size rescue 0\r\n end",
"title": ""
},
{
"docid": "c9c14691381b70b66953f4d4c2dbf5cb",
"score": "0.6422757",
"text": "def paid_total\n components.reject {|c| c.kind == 'bonus'}.reduce(SpookAndPuff::Money.zero){|a, c| a + c.total}\n end",
"title": ""
},
{
"docid": "b73e217218145c63d3591f0fdcf824a9",
"score": "0.6420373",
"text": "def collected_money\n loans.active.sum(:quantity)\n end",
"title": ""
},
{
"docid": "edfc51600ad430c93fd8172f9d31f2db",
"score": "0.6419299",
"text": "def calculate_total\n self.total = self.parts * self.recipients\n end",
"title": ""
},
{
"docid": "eb165795bc73445452ca86912132bc4a",
"score": "0.6419001",
"text": "def total_amount_to_be_paid\n self.active_purchase_entries.sum(\"total_purchase_price\")\n end",
"title": ""
},
{
"docid": "deded5139f95ae59b92db9541acca263",
"score": "0.6412212",
"text": "def get_total\n return scheduler.get_total\n end",
"title": ""
},
{
"docid": "bb8e8059817e7bd2cf21b7985a3f4429",
"score": "0.6412101",
"text": "def total_paid_commission\n total_paid_commission_by_lab + total_payment_received_from_patient\n end",
"title": ""
},
{
"docid": "935fe35d831c7b370324c50ddc4f2d82",
"score": "0.6406733",
"text": "def paid_back\n installments.sum(:quantity)\n end",
"title": ""
},
{
"docid": "ffcef940ffac6c1159c2a43410f253d4",
"score": "0.6390812",
"text": "def unpaid_donations_sum_in_cents\n donations.unpaid.empty? ? 0 : donations.unpaid.map(&:amount_in_cents).sum\n end",
"title": ""
},
{
"docid": "ffc7e2be7891f24f2408150681d4c4fb",
"score": "0.6390423",
"text": "def bills_upcoming_total\n bills_upcoming.reduce(0) {|sum,bill| sum+bill.amount}\n end",
"title": ""
},
{
"docid": "1378f2a848339dd66a682248154968ce",
"score": "0.63858944",
"text": "def get_total_fee\r\n @meeting_fee + get_events_fee + get_relays_fee\r\n end",
"title": ""
},
{
"docid": "1ce80034cacda994fe6d9ae6ddb764ac",
"score": "0.63831633",
"text": "def fees_owing\n registrations.unpaid.map(&:fee).sum\n end",
"title": ""
},
{
"docid": "3b36dc21bb209baaec5a1a2c95ad940b",
"score": "0.6376813",
"text": "def out_of_total\n total = 0\n grade_entry_items.each do |grade_entry_item|\n unless grade_entry_item.bonus\n total += grade_entry_item.out_of\n end\n end\n total\n end",
"title": ""
},
{
"docid": "3b36dc21bb209baaec5a1a2c95ad940b",
"score": "0.6376813",
"text": "def out_of_total\n total = 0\n grade_entry_items.each do |grade_entry_item|\n unless grade_entry_item.bonus\n total += grade_entry_item.out_of\n end\n end\n total\n end",
"title": ""
},
{
"docid": "3b36dc21bb209baaec5a1a2c95ad940b",
"score": "0.6376813",
"text": "def out_of_total\n total = 0\n grade_entry_items.each do |grade_entry_item|\n unless grade_entry_item.bonus\n total += grade_entry_item.out_of\n end\n end\n total\n end",
"title": ""
},
{
"docid": "3b36dc21bb209baaec5a1a2c95ad940b",
"score": "0.6376813",
"text": "def out_of_total\n total = 0\n grade_entry_items.each do |grade_entry_item|\n unless grade_entry_item.bonus\n total += grade_entry_item.out_of\n end\n end\n total\n end",
"title": ""
},
{
"docid": "f2cb2ad01335c1d023bc2d9cd1d5ba20",
"score": "0.63733625",
"text": "def total_payment_received_from_patient\n patients.collect{|patient| patient if patient.is_recived_payment_by_doctor?}.compact.inject(0){|sum,patient| (sum + patient.total_amount)}\n end",
"title": ""
},
{
"docid": "b2eb7f1a72ced5ff8b7be011fcdfb3cc",
"score": "0.6369337",
"text": "def received_amount\n self.collection_tranche_pegged? ?\n self.tranche_pegged_items.map(&:received_amount).copmact.reduce(&:+) :\n self.settled_total\n end",
"title": ""
},
{
"docid": "5b432314ea1d111248cad7cf52c86600",
"score": "0.6362193",
"text": "def total_available\n data.fetch('totalAvailable')\n end",
"title": ""
},
{
"docid": "b567626a577d929c353d58d8e08ad05a",
"score": "0.635398",
"text": "def total_subcription_price\n self.subscriptions.map { |sub| sub.price }.sum\n end",
"title": ""
},
{
"docid": "a3a8395d254afb2673f9d46af2b626f2",
"score": "0.63379335",
"text": "def total_attendence\n self.concerts.sum(:attendance)\n end",
"title": ""
},
{
"docid": "7cdbfc8a6435aeda3d3e2ffb5e30d0c2",
"score": "0.6336448",
"text": "def total_donations\n self.donations.inject(0){|t,d| t += d.amount}\n end",
"title": ""
},
{
"docid": "bc41b0d8b01bca6900c894aa256b4f1f",
"score": "0.63342863",
"text": "def expected\n self.invitations.sum('expected_attendees')\n end",
"title": ""
},
{
"docid": "979639069e21e621ce92f447c8db26c0",
"score": "0.63334435",
"text": "def num_selected_items\n num_unpaid(include_incomplete_registrants: true) + num_paid\n end",
"title": ""
},
{
"docid": "03046312525cbcb70f1a310e5e1ee436",
"score": "0.6324703",
"text": "def total_amount_to_be_paid\n self.active_sales_entries.sum(\"total_sales_price\")\n end",
"title": ""
},
{
"docid": "bbf3674b11d4b649ada8b202121ec664",
"score": "0.6321035",
"text": "def total_outgoing\n self.outgoing_amounts.sum(:quantity)\n end",
"title": ""
},
{
"docid": "7126dfeeed684c00ad25b5788dee34d2",
"score": "0.6316331",
"text": "def total_spent\n\t\t@transactions.inject(0) {|sum, transaction| sum + transaction.paid}\n\tend",
"title": ""
},
{
"docid": "b3f77ef193b4a41088fd2974bda812be",
"score": "0.63080287",
"text": "def total_available\n debt_array.inject(0) {|sum, value| sum += (value > 0 ? value : 0) }\n end",
"title": ""
},
{
"docid": "f1c538d69ee1287b9a785e0e59d901b1",
"score": "0.6307929",
"text": "def number_of_paid_registrants\n @number_of_paid_registrants ||= line_items.where(paid: true).count\n end",
"title": ""
},
{
"docid": "2530bfac9b8e585fd279ba214c249d94",
"score": "0.629619",
"text": "def total_points \n\t\treturn (self.current_points + self.points_redeemed)\n\tend",
"title": ""
},
{
"docid": "c5112a9f44b2288d46afc56bb9652eff",
"score": "0.62913257",
"text": "def unpaid_donations_sum_in_cents\n sum = 0\n sum = donations.unpaid.empty? ? 0 : donations.unpaid.map(&:amount_in_cents).sum\n sum = credit_pitches.unpaid.empty? ? 0 : credit_pitches.unpaid.map(&:amount_in_cents).sum.to_f\n end",
"title": ""
},
{
"docid": "082d94a6fb85dbae76e20481ad24a557",
"score": "0.6289862",
"text": "def appears_solicited_amount\n self.soliciteds.count\n end",
"title": ""
},
{
"docid": "4a23000673eaf2d34b694f4487a89b00",
"score": "0.6288814",
"text": "def invested(domain)\n total = 0\n self.funding_rounds.each do |funding|\n if funding.this_startup.domain == domain\n total += funding.investment\n end\n end\n total\n end",
"title": ""
},
{
"docid": "a2e5d97890d6e56a5f1203edc1af315c",
"score": "0.627742",
"text": "def total\n @insurance_fee.to_i + @assistance_fee.to_i + @drivy_fee.to_i\n end",
"title": ""
},
{
"docid": "7f5184e000e3c5f05c9f5cff842e17bc",
"score": "0.6269408",
"text": "def usage_count\n adjustments.eligible.\n joins(:order).\n merge(Spree::Order.complete).\n distinct.\n count(:order_id)\n end",
"title": ""
},
{
"docid": "7f5184e000e3c5f05c9f5cff842e17bc",
"score": "0.6269408",
"text": "def usage_count\n adjustments.eligible.\n joins(:order).\n merge(Spree::Order.complete).\n distinct.\n count(:order_id)\n end",
"title": ""
},
{
"docid": "8a6ae225fc8be5d60fc0eb4cca8f9fbe",
"score": "0.62690616",
"text": "def amt_paid\n services.sum(:amt_paid)\n end",
"title": ""
},
{
"docid": "536d5f74308767f67a6be22d047b029d",
"score": "0.62680316",
"text": "def total_funds\n total = 0\n FundingRound.all.each do |s|\n if s.startup == self\n total += s.investment\n end\n end\n total\n end",
"title": ""
},
{
"docid": "2c80e4a8236b522ae5ad2167b4096cc7",
"score": "0.6264538",
"text": "def settled_bills_total\n tot = 0\n count = 0\n bills = self.matter_billings.all(:conditions => [\"id = bill_id\"])\n bills.each do |e|\n if e.matter_billing_status && e.matter_billing_status.lvalue == 'Settled'\n tot += nil2zero(e.computed_bill_amount_paid)\n count += 1\n end\n end\n return [count, tot]\n end",
"title": ""
},
{
"docid": "03cd0a040e4254908b9cb7d9ce18f559",
"score": "0.62607116",
"text": "def total_funds\n sum = 0\n FundingRound.all.each do |fund_round|\n if fund_round.startup == self \n sum += fund_round.investment\n end\n end\n return sum\n end",
"title": ""
},
{
"docid": "479a4531343c3598f0d38d3fe60ef39f",
"score": "0.62579834",
"text": "def membership_fixed_total\n applied_subscriptions.select {|h| h[:type] == :fixed}.map {|h| h[:amount] }.flatten.reduce(:+).to_i || 0\n end",
"title": ""
},
{
"docid": "fa3f0aaa208abf9b0aadbc0f386a6c07",
"score": "0.62563926",
"text": "def get_total\n return @scheduler.get_total\n end",
"title": ""
},
{
"docid": "e5e4f88f2020226fccaefc783859be77",
"score": "0.6247385",
"text": "def total_pending\n BoincResult.total_pending self.boinc_id\n end",
"title": ""
},
{
"docid": "22f4de322554d974b67187667c511342",
"score": "0.6242956",
"text": "def total_raised\n self.amount_raised = 0\n self.direct_donations.each { |donation| self.amount_raised += donation.amount }\n self.offline_donations.each { |donation| self.amount_raised += donation.amount }\n self.events.each { |event| self.amount_raised += event.total_raised }\n self.amount_raised\n end",
"title": ""
},
{
"docid": "e228544c1ce9d0d2218ce542ea2fbc27",
"score": "0.62374127",
"text": "def total_incoming\n self.incoming_amounts.sum(:quantity)\n end",
"title": ""
},
{
"docid": "e4c503762df2eb5877216d9d2ea50329",
"score": "0.6224705",
"text": "def uncompleted_feats(user)\n self.feats - self.completed_feats(user)\n end",
"title": ""
},
{
"docid": "a9d031cd731116517c4aae4b44d800ab",
"score": "0.62244433",
"text": "def applicants_completed\n registrations.reject do |registration|\n registration.registration_payment.nil? || registration.registration_payment.refunded? || !registration.registration_payment.completed?\n end.map{|registration| registration.attendance}.inject{|sum, applicant| sum + applicant} || 0\n end",
"title": ""
},
{
"docid": "da460bc001e2c2f31cde23be2ec70315",
"score": "0.62241745",
"text": "def receivable_total(type)\n rental_receivable_settlements.map(&type).compact.reduce(0.0, &:+).round_to\n end",
"title": ""
},
{
"docid": "81f361a8774a743776b19142912c612d",
"score": "0.62227845",
"text": "def paid_amount\n payments.collect(&:amount).sum\n end",
"title": ""
},
{
"docid": "64b7f90387e8bc19f79acd885f4e9b66",
"score": "0.6221725",
"text": "def invested(domain)\n total = 0\n funding_rounds.each do |funding|\n total += funding.investment if funding.startup.domain == domain\n end\n total\n end",
"title": ""
},
{
"docid": "820ae34f8edd668df02081399a01d7f3",
"score": "0.6215896",
"text": "def totals; @lp.totals; end",
"title": ""
},
{
"docid": "a457cb3b7a9f6aa020cff319326e22bc",
"score": "0.6213363",
"text": "def total\n @total\n end",
"title": ""
},
{
"docid": "a457cb3b7a9f6aa020cff319326e22bc",
"score": "0.6213363",
"text": "def total\n @total\n end",
"title": ""
},
{
"docid": "a457cb3b7a9f6aa020cff319326e22bc",
"score": "0.6213109",
"text": "def total\n @total\n end",
"title": ""
},
{
"docid": "6af837a8f0bc9c6c27855a74e30dcf64",
"score": "0.6205225",
"text": "def total_payoff\n return @balance + @interest\n end",
"title": ""
},
{
"docid": "dcd130447b2c357c41ef4fa06e757eaf",
"score": "0.62006867",
"text": "def invested(domain)\n total_invested = 0\n self.funding_rounds.each {|fundinground| fundinground.startup.domain == domain ? total_invested += fundinground.investment : nil}\n total_invested\n end",
"title": ""
},
{
"docid": "a2155098b2c90ad719e4755023a9b3a9",
"score": "0.6187504",
"text": "def total_commission\n commission\n end",
"title": ""
},
{
"docid": "3590fa402b372bd57563c22fa44c4538",
"score": "0.6180084",
"text": "def get_total(options={})\n options[:months] ||= 1\n publisher_configs.reduce(0) do |sum, publisher|\n publisher_id = publisher[0]\n sum += publisher[1].journals.to_s.split(\" \").count * options[:months]\n end\n end",
"title": ""
},
{
"docid": "ce19f6080935c0612887ebbad9075eda",
"score": "0.617888",
"text": "def prepaid_units\n return @prepaid_units\n end",
"title": ""
},
{
"docid": "9683437539bb7f6803a8d2062095891c",
"score": "0.6165409",
"text": "def total_pledges_amount\n pledges.active.sum(:amount)\n end",
"title": ""
},
{
"docid": "9a316a000a48249601c302505acf2b10",
"score": "0.61560404",
"text": "def total_owes\n return self.transactions.where.not(:status => 2).sum(:amount)\n end",
"title": ""
},
{
"docid": "ea136f86962eaacbe2a9fe14d17750fd",
"score": "0.61560345",
"text": "def invested(domain) #find a way to test this\n sum = 0\n array = FundingRound.all.select{|fundinground| fundinground.startup.domain == self}\n array.each do |fundinground|\n sum += fundinground.investment \n end \n sum\n end",
"title": ""
},
{
"docid": "f7c77868f7cc24a7560838d974004269",
"score": "0.61475325",
"text": "def funds_earned\n Referral.where(referred_by: self.id, fee_paid: true)\n .map(&:fee).reduce(:+) || 0\n end",
"title": ""
},
{
"docid": "83fc95df51c0ba3560d9937138719cec",
"score": "0.6145293",
"text": "def total_payments\n self.payments.map{|x| x.amount.to_f}.reduce(:+)\n end",
"title": ""
},
{
"docid": "3d101255c1746754d62a09f4e63474be",
"score": "0.61432695",
"text": "def total_payment_received_from_patient_by_doctor\n patients.collect{|patient| patient if patient.is_recived_payment_by_doctor?}.compact.inject(0){|sum,patient| (sum + patient.total_amount)}\n end",
"title": ""
},
{
"docid": "ebe5285d7ae8e2f3e6fd1f5df304badf",
"score": "0.61402684",
"text": "def total_volunteers\n currently_filled = 0\n self.timeslots.each do |timeslot|\n currently_filled += timeslot.arrangements.count\n end\n return currently_filled\n end",
"title": ""
},
{
"docid": "580b9a82f479674fb9d917bc66f409bb",
"score": "0.6137887",
"text": "def total_unread\n return 0 unless unread_replies\n return 0 if unread_replies.empty?\n unread_replies.values.compact.inject(&:+).size\n end",
"title": ""
},
{
"docid": "d1513db5cb9e08c61b7bcf90d57a5e29",
"score": "0.6137684",
"text": "def total_amount_paid\n my_transactions.sum(:amount)\n end",
"title": ""
},
{
"docid": "51238b6445220d70fadc64b4d206424d",
"score": "0.61360914",
"text": "def total_quantity_remaining\n\t\tself.item_checkins.sum('quantity_remaining')\n\tend",
"title": ""
},
{
"docid": "9f8d41536345ba9bd8edf160a8678dbc",
"score": "0.61281806",
"text": "def total_unread\n inject(0) {|i,j| i+j.unread_count}\n end",
"title": ""
},
{
"docid": "42e3a8a1cdef47ccf15090b5f4185d68",
"score": "0.61269265",
"text": "def total_funds\n sum = 0\n FundingRound.all.each do |fundingRound|\n if fundingRound.startup == self\n sum += fundingRound.investment_amount\n end\n end\n sum\n end",
"title": ""
},
{
"docid": "210b0ca8881dad5ea13e002692bcde8f",
"score": "0.6123544",
"text": "def totals\n {\n optimistic: total_optimistic,\n pessimistic: total_pessimistic\n }\n end",
"title": ""
},
{
"docid": "91505a705a3ab0c22039c7ba1e1d893f",
"score": "0.6120273",
"text": "def accepted_total_time\n transactions.accepted.sum(:total_time)\n end",
"title": ""
},
{
"docid": "70c6ac9eecd55ecb29f527f749b23b91",
"score": "0.611675",
"text": "def lessons_unfinished\n lessons_purchased - lessons_completed - reservations.count\n end",
"title": ""
},
{
"docid": "c9073eca3dc756dda41cfa5b3b6f6774",
"score": "0.6112157",
"text": "def get_subtotal\n if is_a_review?\n user_visibility = :peer_visible\n else\n user_visibility = :ta_visible\n end\n Result.get_subtotals([self.id], user_visibility: user_visibility)[self.id]\n end",
"title": ""
},
{
"docid": "f5b76b51b490a7dd196dae9b5c280335",
"score": "0.6110906",
"text": "def total\n return @total\n end",
"title": ""
},
{
"docid": "f5b76b51b490a7dd196dae9b5c280335",
"score": "0.6110906",
"text": "def total\n return @total\n end",
"title": ""
},
{
"docid": "d47660bd0beab35612f144284aa7693b",
"score": "0.6107557",
"text": "def total_participant_count\n return @total_participant_count\n end",
"title": ""
},
{
"docid": "18eb401cda438ee5f126d9df1b02d617",
"score": "0.61071974",
"text": "def revenue\n apartments.map { |apt| apt.rent }.reduce(0, &:+)\n end",
"title": ""
},
{
"docid": "9ad9a9f512d4dab7208c2f98f3112c23",
"score": "0.610637",
"text": "def total_funds\n self.find_startup.reduce(0) {|sum, n| sum + n.investment}\n end",
"title": ""
},
{
"docid": "5aeeb67f10f9d904f781c5272d034583",
"score": "0.6104068",
"text": "def total\n self.items.sum(&:total) + self.tip + self.fee\n end",
"title": ""
}
] |
bd3ff50cc07b625b338e688e364321c1 | GET /home_pictures/1 GET /home_pictures/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "ba8d0949e0018fd15c1674f6f165c041",
"score": "0.7749593",
"text": "def show\n @home_picture = HomePicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_picture }\n end\n end",
"title": ""
},
{
"docid": "2cd178c156a596b37adff5f72b71923e",
"score": "0.7661436",
"text": "def index\n @pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"title": ""
},
{
"docid": "3f8fc8e5f0bf29e7190380551e3dab09",
"score": "0.7648917",
"text": "def index\n #@pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"title": ""
},
{
"docid": "b2245a0f57f49cfd932da9daa3ae6ec1",
"score": "0.7606459",
"text": "def index\n @pictures = Pic.all\n @album = Album.find(params[:album_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"title": ""
},
{
"docid": "bbf8a21fd9d89e915d4a49ab0060b6ec",
"score": "0.755679",
"text": "def index\n @pictures = Picture.page(params[:page]).per(params[:per])\n render json: @pictures\n end",
"title": ""
},
{
"docid": "dd932e8371f5758d385c47944fb9437a",
"score": "0.7522046",
"text": "def fresh\n response = @client.get('photos?rpp=100&feature=fresh')\n @pictures = JSON.parse(response.body)['photos']\n render :index\n end",
"title": ""
},
{
"docid": "6b21ae899533bf245bac34b8d6179688",
"score": "0.74740225",
"text": "def pictures\n perform_get(\"/users/#{get_id}/pictures\")\n end",
"title": ""
},
{
"docid": "17656936558a8c3a46d3385e30f1096f",
"score": "0.74259174",
"text": "def show\r\n @gallery = Gallery.find(params[:id])\r\n @pictures = @gallery.pictures\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @gallery }\r\n end\r\n end",
"title": ""
},
{
"docid": "780a9c2186e1c140d98dab4d2ca5ab5b",
"score": "0.74122036",
"text": "def pictures\n render json: @collection.pictures\n end",
"title": ""
},
{
"docid": "e6d445618d35083d8db5854aa1457bae",
"score": "0.7358005",
"text": "def picture()\n url = \"#{BASE_URL}api_key=#{@api_key}\"\n puts url\n uri = URI(url)\n response = HTTP.get(uri)\n result = JSON.parse(response)\n end",
"title": ""
},
{
"docid": "c936fef1155d45cfa791faaf9996acdf",
"score": "0.7321196",
"text": "def pictures\n perform_get(\"/me/pictures\", {})\n end",
"title": ""
},
{
"docid": "fbda012d31fb11811514ac7dd28acd93",
"score": "0.7300992",
"text": "def index\n @home_pictures = HomePicture.all\n end",
"title": ""
},
{
"docid": "c7529e6f234fca37dfd1d9477d28597b",
"score": "0.7248477",
"text": "def show\n @picture = Pic.find(params[:id])\n @album = Album.find(params[:album_id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5b0f1f06a91a34e7b2546a9a60eaf816",
"score": "0.7246615",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5b0f1f06a91a34e7b2546a9a60eaf816",
"score": "0.7246615",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5b0f1f06a91a34e7b2546a9a60eaf816",
"score": "0.7246615",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5b0f1f06a91a34e7b2546a9a60eaf816",
"score": "0.7246615",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5b0f1f06a91a34e7b2546a9a60eaf816",
"score": "0.7246615",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5b0f1f06a91a34e7b2546a9a60eaf816",
"score": "0.7246615",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "5b0f1f06a91a34e7b2546a9a60eaf816",
"score": "0.7246615",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "09217556227566fdbcb2a249c021e39f",
"score": "0.7240789",
"text": "def show\n @user = User.find(params[:id])\n @pictures = Picture.order_by([:created_at, :desc]).page(params[:page] || 1).per(Pagesize)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user }\n end\n end",
"title": ""
},
{
"docid": "9a6283ea4746e1b8d3d86b6de5805af2",
"score": "0.7236402",
"text": "def index\n album = Album.find(params[:album_id])\n @pictures = album.pictures\n end",
"title": ""
},
{
"docid": "fd8fe960bade0489db94a21ef555de3f",
"score": "0.7223584",
"text": "def show\n @groom_picture = GroomPicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @groom_picture }\n end\n end",
"title": ""
},
{
"docid": "8b881bc8072b2023ce9eeaa00b22ed16",
"score": "0.7222278",
"text": "def show\n @home_image = HomeImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_image }\n end\n end",
"title": ""
},
{
"docid": "0e93926f9b0eb527e78e9e08d625ee04",
"score": "0.72220135",
"text": "def front_page_images\n comics = Comic.order(:id => :desc).limit(80)\n image_paths = comics.map { |comic| \"#{comic['image_url']}/portrait_xlarge.jpg\" }\n respond_to do |format|\n format.json { render :json => image_paths }\n end\n end",
"title": ""
},
{
"docid": "657784ebeeb2df74c777ed23d04a9542",
"score": "0.72186196",
"text": "def index\n @pictures = Picture.where(album_id: params[:album_id])\n if (params.has_key?(:numberGet))\n @pictures = @pictures.last(params[:numberGet]).reverse;\n end\n # loop on pictures and add urlPicture to every picture\n for picture in @pictures\n picture.url = {\n 'tsquare' => picture.file.url(:tsquare), \n 'medium' => picture.file.url(:medium),\n 'small' => picture.file.url(:small)\n }\n end\n render json: @pictures, status: 201\n end",
"title": ""
},
{
"docid": "fbd41949d1b3ca7a34b3f8122f53c7b2",
"score": "0.71937937",
"text": "def index\n @pic_images = []\n @detail_pictures = DetailPicture.all\n @detail_pictures.map { |picture| @pic_images << picture.image.url }\n respond_with @detail_pictures do |format|\n format.json {render :json => @pic_images, :layout => false }\n end\n end",
"title": ""
},
{
"docid": "f400ca40fd693bc3e50f1b0b366f62cd",
"score": "0.71856976",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @picture }\n end\n end",
"title": ""
},
{
"docid": "36bb61e55a564bda51dc5ca250c89c42",
"score": "0.71772885",
"text": "def index\n cached_pictures = get_cached_album_pictures(@album.id)\n render json: cached_pictures\n end",
"title": ""
},
{
"docid": "e060a69d5f248ea9d4f8e9e6e643742d",
"score": "0.71521884",
"text": "def piclist\n @recipe = Recipe.find(params[:id])\n @piclist = page_piclist @recipe.url\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @piclist }\n end\n end",
"title": ""
},
{
"docid": "e060a69d5f248ea9d4f8e9e6e643742d",
"score": "0.71521884",
"text": "def piclist\n @recipe = Recipe.find(params[:id])\n @piclist = page_piclist @recipe.url\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @piclist }\n end\n end",
"title": ""
},
{
"docid": "76feaa62a83866f00852ba6aaaade83d",
"score": "0.7145535",
"text": "def show\n #@picture = Picture.find(params[:id])\n @picture = @product.pictures.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "53f30e5f3e6ca8868905b307e2c37502",
"score": "0.7130501",
"text": "def index\n @life_pulse_stock_pictures = LifePulseStockPicture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @life_pulse_stock_pictures }\n end\n end",
"title": ""
},
{
"docid": "46d43a7c8c471e4b46dc0be9a3a2ab99",
"score": "0.7127865",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workshop.pictures }\n end\n end",
"title": ""
},
{
"docid": "5ea90a5038a3b87934aba8391eb188c1",
"score": "0.71244484",
"text": "def show\n @pic = Pic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic }\n end\n end",
"title": ""
},
{
"docid": "545e9db8f29b4b634c17cc37ac80a4da",
"score": "0.7103032",
"text": "def index\n if current_user.is_admin? \n @pictures = Picture.all\n else\n @pictures = current_user.farm.pictures\n end\n set_page_title\n\n # Display pictures as a list or as thumbs\n if params[:view] == \"list\"\n @listview = true\n else\n @listview = false\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"title": ""
},
{
"docid": "3dd1b2aa99988413f446d6b7981c24ed",
"score": "0.70918125",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.70796025",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "4e086aee24cee8931fb82000db57624f",
"score": "0.7079425",
"text": "def index\n @pictures = Picture.all\n end",
"title": ""
},
{
"docid": "b8ececcea1437ce6178ffb8696e3dddd",
"score": "0.7072855",
"text": "def index\n @pictures = Picture.newest\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"title": ""
},
{
"docid": "dc232b703030c322a6a27fa1d1a37829",
"score": "0.70270437",
"text": "def show\n @album = Album.includes(:pictures).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @album }\n end\n end",
"title": ""
},
{
"docid": "b0991fc57d13bfb64dfea4adc0ea431c",
"score": "0.7024292",
"text": "def show\n @picture = Picture.find(params[:id])\n\n respond_to do |f|\n f.html # show.html.erb\n f.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "73b1cf3c46ffda85ba02d07886276263",
"score": "0.70146763",
"text": "def index\n #@pictures = Picture.all\n @pictures = @product.pictures.order('updated_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"title": ""
},
{
"docid": "2fa307865556f17b226243c2e9e50c12",
"score": "0.7014256",
"text": "def index\n @pictures = @gallery.pictures\n end",
"title": ""
},
{
"docid": "c174db4322fe0e699dac8ff640f59b4c",
"score": "0.7009349",
"text": "def index\n @pictures = picture.all.page(params[:page])\n end",
"title": ""
},
{
"docid": "c25128a7ac09340d7e91f029565d13fc",
"score": "0.70021564",
"text": "def index\n @pics = Pic.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pics }\n end\n end",
"title": ""
},
{
"docid": "a830ab57c6055538be9c6c825680b7c1",
"score": "0.70016855",
"text": "def list params = {}\n @connection.get(build_path(\"/images/json\", params)) \n end",
"title": ""
},
{
"docid": "2a9f730e92e9a957114a5d023d86185d",
"score": "0.6992794",
"text": "def show\n @gallery = Gallery.find(params[:id])\n @picture = @gallery.pictures.build\n @pictures = Picture.find(:all, :conditions => [ 'gallery_id = ?', @gallery.id ])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gallery }\n end\n end",
"title": ""
},
{
"docid": "81acc3bf9e5175c45352dc3129d446c9",
"score": "0.6984537",
"text": "def index\n @pictures = Picture.all\n\n end",
"title": ""
},
{
"docid": "5f89b2e075c7ddb50810e14205c734a2",
"score": "0.6968891",
"text": "def new\n @home_picture = HomePicture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @home_picture }\n end\n end",
"title": ""
},
{
"docid": "90c5253c085f885d75de76e10ced374f",
"score": "0.6967961",
"text": "def show\n @listed_picture = ListedPicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @listed_picture }\n end\n end",
"title": ""
},
{
"docid": "35fab243a5b49206e31bac99467da4f3",
"score": "0.6965597",
"text": "def show\n @ministry_picture = MinistryPicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ministry_picture }\n end\n end",
"title": ""
},
{
"docid": "9dac3d3d8052036617f7c40dd8026e1f",
"score": "0.6953398",
"text": "def show\n render json: Image.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "5fced192c8cb20865dfd68b8b423de6c",
"score": "0.6950316",
"text": "def index\n render json: Pic.all\n end",
"title": ""
},
{
"docid": "6da823adae83ffc416f4f51b2d9f5ee6",
"score": "0.6943829",
"text": "def index\n @pictures = current_user.pictures\n end",
"title": ""
},
{
"docid": "34745e11a467275143003a00c4fc7a50",
"score": "0.6939928",
"text": "def get_pictures\n response = RestClient.get(@url)\n parsed_response = JSON.parse(response)\n\n parsed_response[\"data\"][\"children\"].map do |post|\n photo = post['data']['thumbnail'] \n @posts << {photo: photo}\n end\n end",
"title": ""
},
{
"docid": "11dc43844b8c77ad98591c22151fcd29",
"score": "0.6904252",
"text": "def index\n @photos = @coin.photos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @photos }\n end\n end",
"title": ""
},
{
"docid": "b113c08fe920f1ff771209466d13c0e5",
"score": "0.687604",
"text": "def show\n @picture = Picture.find(params[:id])\n @user = @picture.user\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "7a9b9a77fa4d02d90238d00bd6eff6d4",
"score": "0.68709236",
"text": "def get_album_images(hash)\n response = make_request(\"GET\", \"album/#{hash}/images\")\n return response\nend",
"title": ""
},
{
"docid": "8e03544ff02d8f3a0d284484ed6eca0f",
"score": "0.686555",
"text": "def show\n @photo = Photo.find(params[:id])\n\n render json: @photo\n end",
"title": ""
},
{
"docid": "b37073ec353873baac8a6ff847d4ecfa",
"score": "0.68588245",
"text": "def show\n @images = @album.images\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: [ @album, @images ] }\n end\n end",
"title": ""
},
{
"docid": "b4636831fcbbc4e4b0ef97377718a595",
"score": "0.6842996",
"text": "def index\n @creative = Creative.find(params[:creative_id])\n @pictures = @creative.pictures.load\n @picture = Picture.new\n\n respond_to do |format|\n format.html # index.html.erb\n # format.json { render json: @pictures }\n format.json { render json: @pictures.map{|pic| pic.to_jq_download } }\n end\n end",
"title": ""
},
{
"docid": "a7a15b9253aa9afea293e09aeffee3cc",
"score": "0.68419945",
"text": "def index\n @restaurant_pictures = @restaurant.pictures\n end",
"title": ""
},
{
"docid": "7e18e48172a1b1ed77455e12348df6f3",
"score": "0.6830672",
"text": "def show\n @user_pic = UserPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_pic }\n end\n end",
"title": ""
},
{
"docid": "593f61cb085dccd8ab017fb0b4018f37",
"score": "0.68288356",
"text": "def get_pictures url\r\n login\r\n connect URI.parse(url).host\r\n doc = hpricot_get_url url\r\n \r\n pictures = []\r\n doc.search(\"//div[@id='album']//img\") do |img|\r\n pictures << img.attributes['id']\r\n end\r\n pictures\r\n end",
"title": ""
},
{
"docid": "e41df192ff171192f22dc4aff5413837",
"score": "0.6822652",
"text": "def index\n @pictures = Picture.find(:all, :conditions => [\"activate = ?\", true])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @pictures }\n end\n end",
"title": ""
},
{
"docid": "c76fba8592f02c74f6034da7882fca04",
"score": "0.6817085",
"text": "def index\n @homepage_pics = HomepagePic.all\n end",
"title": ""
},
{
"docid": "8c8d1f0e6cbe4cdcbd626c5f3ede9547",
"score": "0.68117315",
"text": "def index\n \n @photos = @gallery.photos\n\n respond_to do |format|\n\n format.html # index.html.erb\n format.json { render json: @photos }\n \n end\n \n end",
"title": ""
},
{
"docid": "2188d5393353371aa9e1dea901c227ba",
"score": "0.681155",
"text": "def list\n @images = Image.all\n\n respond_to do |format|\n format.html\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "b439257a5422f4ca09dd436791252c68",
"score": "0.68100625",
"text": "def all\n render :json => Photo.all.map{|p| p.pic.url(:thumb_r)}\n end",
"title": ""
},
{
"docid": "62c41299f3dd7071176edde163ba7818",
"score": "0.6802603",
"text": "def list_floor_plans \n get(\"/files.json/floorplan/images\")\nend",
"title": ""
},
{
"docid": "12275e81c753f0f0b3fa97d13eb3484e",
"score": "0.6791415",
"text": "def index\n @pictures = @owner.pictures\n end",
"title": ""
},
{
"docid": "3863f0bf5ed374246e3b8a4fbd82fb6c",
"score": "0.6788685",
"text": "def show\n \n @photo = @gallery.photos.find(params[:id])\n\n respond_to do |format|\n\n format.html # show.html.erb\n format.json { render json: @photo }\n \n end\n \n end",
"title": ""
},
{
"docid": "7373352a9083256998ea2ac125673b12",
"score": "0.6782112",
"text": "def show\n @redcarpet = Redcarpet.find(params[:id])\n @photos = @redcarpet.photos\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redcarpet }\n end\n end",
"title": ""
},
{
"docid": "215503117264a4f72c2efc09e8f45853",
"score": "0.6781276",
"text": "def show\n @image = Image.find(params[:id])\n\n render json: @image\n end",
"title": ""
},
{
"docid": "316326f05277174394e98a14114db018",
"score": "0.67797935",
"text": "def show\n @photo = @coin.photos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @photo }\n end\n end",
"title": ""
},
{
"docid": "9583890f0f1495f21e473aca3b2b0f7a",
"score": "0.6774489",
"text": "def show\n @upload_pic = UploadPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload_pic }\n end\n end",
"title": ""
},
{
"docid": "011720514799372ae1ce4593e05193b1",
"score": "0.67711526",
"text": "def index\n @imagens = Imagem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @imagens }\n end\n end",
"title": ""
},
{
"docid": "ed80a993f78aec77b30f9499d2f47f06",
"score": "0.67673373",
"text": "def show\n @pictures = @room.pictures\n end",
"title": ""
},
{
"docid": "6d5bc2b9b1e73a327f7880720a8e1ecc",
"score": "0.67654103",
"text": "def index\n @albums = Album.includes(:pictures).all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @albums }\n end\n end",
"title": ""
},
{
"docid": "f48d903001e961df3cbf7c93cbf1e9a2",
"score": "0.67553973",
"text": "def index\n @pictures = Picture.find(:all)\n \n @title = 'Viewing Pictures'\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pictures }\n end\n end",
"title": ""
},
{
"docid": "fc1b3ac5f800fbdd585e6f97b2637e2f",
"score": "0.67523104",
"text": "def index\n @projects = Project.includes(:pictures).all\n \n \n respond_to do |format|\n format.html { render :index }\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "ddb7459ae9fd352e117e44a4933c61cb",
"score": "0.6749966",
"text": "def show\n @groom_gallery = GroomGallery.find(params[:id])\n @groom_picture = @groom_gallery.groom_pictures.build\n @groom_pictures = GroomPicture.find(:all, :conditions => [ 'groom_gallery_id = ?', @groom_gallery.id ])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @groom_gallery }\n end\n end",
"title": ""
},
{
"docid": "6c2a8edf9ff3c5ce8668fd148dbc3731",
"score": "0.67464834",
"text": "def new\n @picture = Pic.new\n @album = Album.find(params[:album_id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end",
"title": ""
},
{
"docid": "724270634c460e8ccb3e4ea193d130c7",
"score": "0.6743304",
"text": "def show\n @image = Image.find(params[:id])\n render json: URI.join(request.url, @image.image.url)\n end",
"title": ""
},
{
"docid": "40c272ecfbc9a4496534dc0287475e92",
"score": "0.67316175",
"text": "def index\n @photographies = Photography.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photographies }\n end\n end",
"title": ""
},
{
"docid": "48ee33bd1cee1c98b6419f18d7165a73",
"score": "0.6724703",
"text": "def show\n @picture = Picture.find(params[:id])\n end",
"title": ""
},
{
"docid": "48ee33bd1cee1c98b6419f18d7165a73",
"score": "0.6724703",
"text": "def show\n @picture = Picture.find(params[:id])\n end",
"title": ""
}
] |
5093c6ecb75ba8a547b52bd0a53992a0 | URL of worksheetbased feed of the spreadsheet. | [
{
"docid": "20264254e1a27136d1d73a0830e23ddb",
"score": "0.83388734",
"text": "def worksheets_feed_url\n format(\n 'https://spreadsheets.google.com/feeds/worksheets/%s/private/full', id\n )\n end",
"title": ""
}
] | [
{
"docid": "b6e7bfce7c868a02e05d914d92bf6222",
"score": "0.89711684",
"text": "def worksheet_feed_url\n return '%s/%s' % [spreadsheet.worksheets_feed_url, worksheet_feed_id]\n end",
"title": ""
},
{
"docid": "4b37318311b5718d86d2b049a95f9ffb",
"score": "0.8587348",
"text": "def worksheets_feed_url\n return \"https://spreadsheets.google.com/feeds/worksheets/%s/private/full\" %\n self.id\n end",
"title": ""
},
{
"docid": "1a5e1ef316bcf4f58045270674635243",
"score": "0.84493613",
"text": "def spreadsheet_feed_url\n return \"https://spreadsheets.google.com/feeds/spreadsheets/private/full/\" + self.id\n end",
"title": ""
},
{
"docid": "2fa3b51cdcc983a842395fc3cd7738df",
"score": "0.8381754",
"text": "def worksheet_feed_url\n # I don't know good way to get worksheet feed URL from cells feed URL.\n # Probably it would be cleaner to keep worksheet feed URL and get cells feed URL\n # from it.\n if !(@cells_feed_url =~\n %r{^http://spreadsheets.google.com/feeds/cells/(.*)/(.*)/private/full$})\n raise(GoogleSpreadsheet::Error,\n \"cells feed URL is in unknown format: #{@cells_feed_url}\")\n end\n return \"http://spreadsheets.google.com/feeds/worksheets/#{$1}/private/full/#{$2}\"\n end",
"title": ""
},
{
"docid": "2344b9267fed7ccb43ec5719a6b17b27",
"score": "0.8272468",
"text": "def spreadsheet_feed_url\n return \"https://spreadsheets.google.com/feeds/spreadsheets/private/full/#{self.key}\"\n end",
"title": ""
},
{
"docid": "29db0fbbc9f2469b65467c65aafa4f30",
"score": "0.82335794",
"text": "def spreadsheet_feed_url\n 'https://spreadsheets.google.com/feeds/spreadsheets/private/full/' + id\n end",
"title": ""
},
{
"docid": "3805c949769c6fa00c3fe578ba57aba1",
"score": "0.8024884",
"text": "def cells_feed_url\n worksheet_feed_entry.css(\n \"link[rel='http://schemas.google.com/spreadsheets/2006#cellsfeed']\"\n )[0]['href']\n end",
"title": ""
},
{
"docid": "9beb36f10b2b22fa8a8e7f7a26102758",
"score": "0.7786011",
"text": "def list_feed_url\n @worksheet_feed_entry.css(\n \"link[rel='http://schemas.google.com/spreadsheets/2006#listfeed']\"\n )[0]['href']\n end",
"title": ""
},
{
"docid": "c1e51e9fe7562ecae5016751137cee88",
"score": "0.7601215",
"text": "def tables_feed_url\n return \"http://spreadsheets.google.com/feeds/#{self.key}/tables\"\n end",
"title": ""
},
{
"docid": "81b5b806ae963a0ec4ff61b4305ab8d5",
"score": "0.744528",
"text": "def get_listfeed_uri\n # Fetch the sheet list\n spreadsheets = get_feed(SPREADSHEET_URI, headers)\n doc = XmlSimple.xml_in(spreadsheets.body, 'KeyAttr' => 'name')\n\n # Extract the spreadsheet key\n spreadsheet_key = doc[\"entry\"][0][\"id\"][0][/full\\/(.*)/, 1]\n\n # Obtain the spreadsheet feed\n worksheet_feed_uri = \"http://spreadsheets.google.com/feeds/worksheets/#{spreadsheet_key}/private/full\"\n worksheet_response = get_feed(worksheet_feed_uri, headers)\n\n # Parse the xml into a data structure\n worksheet_data = XmlSimple.xml_in(worksheet_response.body, 'KeyAttr' => 'name')\n\n # Obtain the worksheet\n listfeed_uri = worksheet_data[\"entry\"][0][\"link\"][0][\"href\"]\n\n return listfeed_uri\n end",
"title": ""
},
{
"docid": "933999fc71d4bd534877752632dffa38",
"score": "0.7217496",
"text": "def spreadsheet_url\n\t\"Put your spreadsheet url in JSON form here\"\nend",
"title": ""
},
{
"docid": "2cba24ded9afa66a49a6769a7e97f4f2",
"score": "0.6990579",
"text": "def tables_feed_url\n warn(\n \"DEPRECATED: Google Spreadsheet Table and Record feeds are deprecated and they \" +\n \"will not be available after March 2012.\")\n return \"https://spreadsheets.google.com/feeds/%s/tables\" % self.id\n end",
"title": ""
},
{
"docid": "2e8f9f436a04260deea283d956ed03eb",
"score": "0.6875988",
"text": "def feed_url\n uri\n end",
"title": ""
},
{
"docid": "3f5169c03e54fbdfc9cb6cf161cece20",
"score": "0.68485093",
"text": "def worksheet_feed_entry\n @worksheet_feed_entry ||= @session.request(:get, worksheet_feed_url).root\n end",
"title": ""
},
{
"docid": "52ff5284f5bc5d94e29a7587ea58d507",
"score": "0.68420446",
"text": "def uri\n return @uri if @uri.is_a?(::URI)\n @uri = ::URI.parse t.url\n if @uri.host == 'spreadsheets.google.com' or @uri.host == 'docs.google.com'\n @uri.query = 'output=csv&' + @uri.query.sub(/\\&?output=.*?(\\&|\\z)/, '\\1')\n end\n @uri\n end",
"title": ""
},
{
"docid": "bc61d8ae6c27b764d6f2125bff2457b5",
"score": "0.66806436",
"text": "def worksheets\n doc = @session.request(:get, self.worksheets_feed_url)\n if doc.root.name != \"feed\"\n raise(GoogleDrive::Error,\n \"%s doesn't look like a worksheets feed URL because its root is not <feed>.\" %\n self.worksheets_feed_url)\n end\n return doc.css(\"entry\").map(){ |e| Worksheet.new(@session, self, e) }.freeze\n end",
"title": ""
},
{
"docid": "95949cecf9376ea2b765b52f95b08a47",
"score": "0.6606555",
"text": "def feed\n UrlChecker.get_feed_url( host )\n end",
"title": ""
},
{
"docid": "7d6caad8bdc9815e9a6589133df99f9b",
"score": "0.6597877",
"text": "def document_feed_url\n return \"https://docs.google.com/feeds/documents/private/full/\" + CGI.escape(self.resource_id)\n end",
"title": ""
},
{
"docid": "8294fc5954e1d6df02336964befe9617",
"score": "0.6592894",
"text": "def spreadsheets\n contents_url = concat_url(@collection_feed_url, \"/contents\")\n header = {\"GData-Version\" => \"3.0\", \"Content-Type\" => \"application/atom+xml\"}\n doc = @session.request(:get, contents_url, :header => header, :auth => :writely)\n\n return doc.css(\"feed > entry\").map() do |entry|\n title = entry.css(\"title\").text\n url = entry.css(\n \"link[@rel='http://schemas.google.com/spreadsheets/2006#worksheetsfeed']\")[0][\"href\"]\n GoogleSpreadsheet::Spreadsheet.new(@session, url, title)\n end\n end",
"title": ""
},
{
"docid": "ccb744d6c3517a960844e040793dd5da",
"score": "0.6584141",
"text": "def key\n if !(@worksheets_feed_url =~\n %r{http://spreadsheets.google.com/feeds/worksheets/(.*)/private/full})\n raise(GoogleSpreadsheet::Error,\n \"worksheets feed URL is in unknown format: #{@worksheets_feed_url}\")\n end\n return $1\n end",
"title": ""
},
{
"docid": "ccd6a925fddd8cbe6c8f2e37aa908315",
"score": "0.6557032",
"text": "def feed_url\n blog_index_url(format: :rss)\n end",
"title": ""
},
{
"docid": "ccd6a925fddd8cbe6c8f2e37aa908315",
"score": "0.6557032",
"text": "def feed_url\n blog_index_url(format: :rss)\n end",
"title": ""
},
{
"docid": "ccd6a925fddd8cbe6c8f2e37aa908315",
"score": "0.6557032",
"text": "def feed_url\n blog_index_url(format: :rss)\n end",
"title": ""
},
{
"docid": "bb137e62b4024e2e335682ea1cab6300",
"score": "0.65376645",
"text": "def generate_urls\n @data_worksheet.sanitized_urls\n end",
"title": ""
},
{
"docid": "8e7e479917c2123a1ebc2faefe1cf143",
"score": "0.652725",
"text": "def document_feed_url\n 'https://docs.google.com/feeds/default/private/full/' + CGI.escape(resource_id)\n end",
"title": ""
},
{
"docid": "f0bb4f4ba0124ea96b077d9e4733454f",
"score": "0.65117896",
"text": "def getTimesheetURL\r\n\t\t\t\t\treturn @timesheetUrl\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "f0bb4f4ba0124ea96b077d9e4733454f",
"score": "0.65117896",
"text": "def getTimesheetURL\r\n\t\t\t\t\treturn @timesheetUrl\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "8ba8c6147aa02e97ea56f03d889d9e32",
"score": "0.64568067",
"text": "def feed_url\n # Check attributes\n if @site.config[:base_url].nil?\n raise RuntimeError.new('Cannot build Atom feed: site configuration has no base_url')\n end\n\n @item[:feed_url] || @site.config[:base_url] + @item.rep(:default).path\n end",
"title": ""
},
{
"docid": "1007db4911bfd81b0ab9b89658d4ab1c",
"score": "0.64480567",
"text": "def datasheet\n return nil unless datasheets.length > 0\n datasheets.first.url\n end",
"title": ""
},
{
"docid": "c78afcf4943ec40ffa60285f8b5fe087",
"score": "0.6427115",
"text": "def feed_uri\n extra_parameters = \"\"\n \n if(self.private_feed?)\n extra_parameters = \"?\"\n if(!self.track_user_watchlist?)\n extra_parameters << \"login=#{self.auth_login}&\"\n end\n extra_parameters << \"token=#{self.auth_token}\"\n end\n \n if(self.track_user_watchlist?)\n \"https://www.github.com/#{self.github_username}.#{self.private_feed ? 'private.' : '' }atom\" + extra_parameters\n else\n \"https://www.github.com/#{self.github_username}/#{self.github_repository}/commits/#{self.branch}.atom\" + extra_parameters\n end\n end",
"title": ""
},
{
"docid": "d193092417828d9871076efe7cb2760a",
"score": "0.64253795",
"text": "def spreadsheet\n if !@spreadsheet\n if !(@cells_feed_url =~\n %r{^http://spreadsheets.google.com/feeds/cells/(.*)/(.*)/private/full$})\n raise(GoogleSpreadsheet::Error,\n \"cells feed URL is in unknown format: #{@cells_feed_url}\")\n end\n @spreadsheet = @session.spreadsheet_by_key($1)\n end\n return @spreadsheet\n end",
"title": ""
},
{
"docid": "36ea228af2a49a60aa65b6bf2877dfb8",
"score": "0.639401",
"text": "def document_feed_url\n 'https://docs.google.com/feeds/documents/private/full/' +\n CGI.escape(resource_id)\n end",
"title": ""
},
{
"docid": "4ff2bde616f028ba4c4900ad1e3114fb",
"score": "0.63619596",
"text": "def atom_feed_url\n \"#{root_url}/feed.xml\"\n end",
"title": ""
},
{
"docid": "2f169d8d3c7f8911b0b714e8d6bcbd08",
"score": "0.63513654",
"text": "def ws_url\n body['url']\n end",
"title": ""
},
{
"docid": "476d7e090a48db18b8a7f81116e0c41f",
"score": "0.6327647",
"text": "def google_sheets_export_url(gid)\n GOOGLE_SHEETS_EXPORT_BASE_URL + gid\nend",
"title": ""
},
{
"docid": "a11f649ebccadb0868035929bb9a8472",
"score": "0.63157296",
"text": "def spreadsheet_by_url(url)\n # Tries to parse it as URL of human-readable spreadsheet.\n uri = URI.parse(url)\n if uri.host == \"spreadsheets.google.com\" && uri.path =~ /\\/ccc$/\n if (uri.query || \"\").split(/&/).find(){ |s| s=~ /^key=(.*)$/ }\n return spreadsheet_by_key($1)\n end\n end\n # Assumes the URL is worksheets feed URL.\n return Spreadsheet.new(self, url)\n end",
"title": ""
},
{
"docid": "1510c01316b91d87d45cd1d5079783af",
"score": "0.6313526",
"text": "def document_feed_url\n return \"https://docs.google.com/feeds/default/private/full/document%3A#{self.key}?v=3\"\n end",
"title": ""
},
{
"docid": "acbb2ea10be282ccde375da0dd30155a",
"score": "0.62972677",
"text": "def feed_url\n @feed_url || @feed_url_link || @feed_url_atom10_link\n end",
"title": ""
},
{
"docid": "8082a9523ffd4722b15c0795fa94949f",
"score": "0.6253446",
"text": "def human_url\n # Uses Document feed because Spreadsheet feed returns wrong URL for Apps account.\n return self.feed_entry.css(\"link[rel='alternate']\")[0][\"href\"]\n end",
"title": ""
},
{
"docid": "e7bcd132308988324dfe4b7dfa723c27",
"score": "0.6247239",
"text": "def worksheet_by_url(url)\n return Worksheet.new(self, url)\n end",
"title": ""
},
{
"docid": "157ec500e2ab6f729872382f58fc78e9",
"score": "0.62159973",
"text": "def spreadsheet_by_url(url)\n # Tries to parse it as URL of human-readable spreadsheet.\n uri = URI.parse(url)\n if uri.host == \"spreadsheets.google.com\" && uri.path =~ /\\/ccc$/\n if (uri.query || \"\").split(/&/).find(){ |s| s=~ /^key=(.*)$/ }\n return spreadsheet_by_key($1)\n end\n end\n # Assumes the URL is worksheets feed URL.\n return Spreadsheet.new(self, url)\n end",
"title": ""
},
{
"docid": "aee45caaf39d9ed2a17c6dcb8061f7ef",
"score": "0.62108016",
"text": "def feed_path\n if @site.config[\"feed\"] && @site.config[\"feed\"][\"path\"]\n @site.config[\"feed\"][\"path\"]\n else\n \"feed.xml\"\n end\n end",
"title": ""
},
{
"docid": "804317de1d75943fb6c44dd52c8b45c3",
"score": "0.619704",
"text": "def feed_path\n if @site.config[\"feed\"] && @site.config[\"feed\"][\"path\"]\n @site.config[\"feed\"][\"path\"]\n else\n \"feed.json\"\n end\n end",
"title": ""
},
{
"docid": "8f54e305f89ac0dcd6385454b60553da",
"score": "0.6172453",
"text": "def human_url\n format(\"%s\\#gid=%s\", spreadsheet.human_url, gid)\n end",
"title": ""
},
{
"docid": "a41c400c0f7f25f458cefba3c3e2fde6",
"score": "0.6160129",
"text": "def add_worksheet(title, max_rows = 100, max_cols = 20)\n xml = <<-\"EOS\"\n <entry xmlns='http://www.w3.org/2005/Atom'\n xmlns:gs='http://schemas.google.com/spreadsheets/2006'>\n <title>#{h(title)}</title>\n <gs:rowCount>#{h(max_rows)}</gs:rowCount>\n <gs:colCount>#{h(max_cols)}</gs:colCount>\n </entry>\n EOS\n doc = @session.post(@worksheets_feed_url, xml)\n url = doc.search(\n \"link[@rel='http://schemas.google.com/spreadsheets/2006#cellsfeed']\")[0][\"href\"]\n return Worksheet.new(@session, url, title)\n end",
"title": ""
},
{
"docid": "02dcc91f703fbe77f3edc29090f20877",
"score": "0.6137341",
"text": "def google_sheets_export_url\n \"https://docs.google.com/spreadsheets/d/1J1SShMPYBuGVAHY7LfDiTiHV72Tph8ObxbhlCoo7nn8/export?format=csv&id=1J1SShMPYBuGVAHY7LfDiTiHV72Tph8ObxbhlCoo7nn8&gid=1431929499\"\nend",
"title": ""
},
{
"docid": "f799bb82a1021046c48b743a8ecda736",
"score": "0.61360353",
"text": "def add_worksheet(title, max_rows = 100, max_cols = 20)\n xml = <<-\"EOS\"\n <entry xmlns='http://www.w3.org/2005/Atom'\n xmlns:gs='http://schemas.google.com/spreadsheets/2006'>\n <title>#{h(title)}</title>\n <gs:rowCount>#{h(max_rows)}</gs:rowCount>\n <gs:colCount>#{h(max_cols)}</gs:colCount>\n </entry>\n EOS\n doc = @session.post(@worksheets_feed_url, xml)\n url = as_utf8(doc.search(\n \"link[@rel='http://schemas.google.com/spreadsheets/2006#cellsfeed']\")[0][\"href\"])\n return Worksheet.new(@session, self, url, title)\n end",
"title": ""
},
{
"docid": "d4849548a030e6b11469ddbbc5299d47",
"score": "0.61328447",
"text": "def contents_url\n self.document_feed_url + \"/contents\"\n end",
"title": ""
},
{
"docid": "5938436df7a241167515278de20849db",
"score": "0.6129998",
"text": "def worksheet_by_url(url)\n return Worksheet.new(self, nil, url)\n end",
"title": ""
},
{
"docid": "b3e7313c4112d813e076195526770c7f",
"score": "0.611819",
"text": "def feed\n GET base_url \"/feed\"\n end",
"title": ""
},
{
"docid": "2884f7d79bb06c6479d20e6f577663c4",
"score": "0.6085823",
"text": "def worksheets\n doc = @session.get(@worksheets_feed_url)\n result = []\n for entry in doc.search(\"entry\")\n title = entry.search(\"title\").text\n url = entry.search(\n \"link[@rel='http://schemas.google.com/spreadsheets/2006#cellsfeed']\")[0][\"href\"]\n result.push(Worksheet.new(@session, url, title))\n end\n return result.freeze()\n end",
"title": ""
},
{
"docid": "4cf7d9b197f52bec8535fe4e3b0b8507",
"score": "0.6084108",
"text": "def atom_feed_url(repo_param, ref=nil)\n ref.nil? ? prefix_url(\"#{repo_param}.atom\") : prefix_url(\"#{repo_param}/#{ref}.atom\")\n end",
"title": ""
},
{
"docid": "260a6a8bed90a78d1d42a3867b303fae",
"score": "0.6001924",
"text": "def feed_url\n view_context.question_url(@question, :format => \"atom\")\n end",
"title": ""
},
{
"docid": "ecc5d7c4204bb0acb036d35f2b429b91",
"score": "0.59842604",
"text": "def worksheets\n doc = @session.get(@worksheets_feed_url)\n result = []\n for entry in doc.search(\"entry\")\n title = as_utf8(entry.search(\"title\").text)\n url = as_utf8(entry.search(\n \"link[@rel='http://schemas.google.com/spreadsheets/2006#cellsfeed']\")[0][\"href\"])\n result.push(Worksheet.new(@session, self, url, title))\n end\n return result.freeze()\n end",
"title": ""
},
{
"docid": "0798523b17ecebc3d6022ab2ba9d7aa3",
"score": "0.5885378",
"text": "def feed(options = {})\n session.get_url(link('http://schemas.google.com/g/2005#feed').href, options)\n end",
"title": ""
},
{
"docid": "71c45560eaec1ef3180f5a42ce526b74",
"score": "0.58837074",
"text": "def url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "fac7b12df75e084175a3f7936dee2ee2",
"score": "0.5845314",
"text": "def feed\n url = @doc.match( ['link[@type=\"application/rss+xml\"]', lambda { |el| el.attr('href') }],\n ['link[@type=\"application/atom+xml\"]', lambda { |el| el.attr('href') }]\n )\n \n if url && url !~ /^http/ && @url\n url = URI.join(@url , url).to_s\n end\n \n url\n end",
"title": ""
},
{
"docid": "edc499387d4ce435edeab9033e9a6c5b",
"score": "0.58435184",
"text": "def atom_url\n Config.site['url'].chomp('/') + PostController.r(:atom, name).to_s\n end",
"title": ""
},
{
"docid": "d51efa5e525571d94ed5788781711cd2",
"score": "0.58401215",
"text": "def week_url\n base_url + week_path\n end",
"title": ""
},
{
"docid": "8e618d0371723ba8fde641439fa5e396",
"score": "0.5809142",
"text": "def add_worksheet(title, max_rows = 100, max_cols = 20)\n xml = <<-\"EOS\"\n <entry xmlns='http://www.w3.org/2005/Atom'\n xmlns:gs='http://schemas.google.com/spreadsheets/2006'>\n <title>#{h(title)}</title>\n <gs:rowCount>#{h(max_rows)}</gs:rowCount>\n <gs:colCount>#{h(max_cols)}</gs:colCount>\n </entry>\n EOS\n doc = @session.request(:post, self.worksheets_feed_url, :data => xml)\n return Worksheet.new(@session, self, doc.root)\n end",
"title": ""
},
{
"docid": "b58b2e957396676ba44803ca7aa74107",
"score": "0.5804738",
"text": "def rss_url\n if User.current_user\n feed_events_url(:format => :rss, :key => User.current_user.single_access_token)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "d707bb8f649f9ceefa73b8185b624067",
"score": "0.5800935",
"text": "def path\n if @site.config[\"feed\"] && @site.config[\"feed\"][\"path\"]\n @site.config[\"feed\"][\"path\"]\n else\n \"feed.xml\"\n end\n end",
"title": ""
},
{
"docid": "537d0f1ed9493f27040e0802c9ab0021",
"score": "0.5780034",
"text": "def xlsx_url(force_generate = false)\n url = { :format => :xlsx }\n url[:report] = params[:report] if params[:report]\n url[:action] = 'index' if controller.action_name == 'index'\n url[:generate] = 'true' if force_generate\n return url\n end",
"title": ""
},
{
"docid": "bb6d1bd39822b45bb02b03ce992a4ed3",
"score": "0.5772229",
"text": "def spreadsheets(params = {})\n query = encode_query(params)\n doc = get(\"http://spreadsheets.google.com/feeds/spreadsheets/private/full?#{query}\")\n result = []\n for entry in doc.search(\"entry\")\n title = entry.search(\"title\").text\n url = entry.search(\n \"link[@rel='http://schemas.google.com/spreadsheets/2006#worksheetsfeed']\")[0][\"href\"]\n result.push(Spreadsheet.new(self, url, title))\n end\n return result\n end",
"title": ""
},
{
"docid": "fa08b4b881c5ca1b59938c364229dafa",
"score": "0.5770587",
"text": "def csv_export_url\n 'https://docs.google.com/spreadsheets/d/%s/export?gid=%s&format=csv' %\n [spreadsheet.id, gid]\n end",
"title": ""
},
{
"docid": "b2c3cc0af81fb5e7bc284f4284943763",
"score": "0.57386917",
"text": "def url_for(item)\n # Check attributes\n if @site.config[:base_url].nil?\n raise RuntimeError.new('Cannot build Atom feed: site configuration has no base_url')\n end\n\n # Get path\n path = item[:custom_path_in_feed] || item.rep(:default).path\n return nil if path.nil?\n\n # Build URL\n @site.config[:base_url] + path\n end",
"title": ""
},
{
"docid": "a9d3cf8ae5c411405a186d372b27050a",
"score": "0.5735717",
"text": "def link\n feed[\"link\"]\n end",
"title": ""
},
{
"docid": "a833d9ce3fcf4e25dbd0c0d9b7cf46ca",
"score": "0.573165",
"text": "def onboarding_url\n return @onboarding_url\n end",
"title": ""
},
{
"docid": "5444ead98b20974779491a296fbadfec",
"score": "0.5730077",
"text": "def url\n @site.url_for @data_id\n end",
"title": ""
},
{
"docid": "9a1a4e45a51f0f32d3bdc87350ebd29b",
"score": "0.57229936",
"text": "def get_my_spreadsheets()\n spreadsheet_feed_response = get_feed(SPREADSHEET_FEED)\n create_datastructure_from_xml(spreadsheet_feed_response.body)\n end",
"title": ""
},
{
"docid": "f6ca6e0683dab2649904026708677fcf",
"score": "0.5702473",
"text": "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "f6ca6e0683dab2649904026708677fcf",
"score": "0.5702473",
"text": "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "f6ca6e0683dab2649904026708677fcf",
"score": "0.5702473",
"text": "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "f6ca6e0683dab2649904026708677fcf",
"score": "0.5702473",
"text": "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"title": ""
},
{
"docid": "2e893c3b3a1187ff338d14fa76ced1e4",
"score": "0.5692718",
"text": "def api_url\n ensure_full_data!\n @gapi.self_link\n end",
"title": ""
},
{
"docid": "6c2d9cc9a7eb95bf12243164e4494a35",
"score": "0.5675986",
"text": "def url()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6c2d9cc9a7eb95bf12243164e4494a35",
"score": "0.5675986",
"text": "def url()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "d746da410f4d66f88d64e1d1863e7844",
"score": "0.5669226",
"text": "def url\n end",
"title": ""
},
{
"docid": "91677e390255a218365e4849a19562e5",
"score": "0.5661468",
"text": "def api_url\n ensure_full_data!\n @gapi.self_link\n end",
"title": ""
},
{
"docid": "91677e390255a218365e4849a19562e5",
"score": "0.5661468",
"text": "def api_url\n ensure_full_data!\n @gapi.self_link\n end",
"title": ""
},
{
"docid": "f010d57aadf1413c5794fbaab70280d0",
"score": "0.5656544",
"text": "def document_url\n key = @work.model_name.singular_route_key\n Rails.application.routes.url_helpers.send(key + \"_url\", @work.id)\n end",
"title": ""
},
{
"docid": "95d780b8e79ef1babd03b6f493fd81dd",
"score": "0.564577",
"text": "def observation_url() \n \"http://newsrss.bbc.co.uk/weather/forecast/#{@id}/ObservationsRSS.xml\"\n end",
"title": ""
},
{
"docid": "99f4e1fb9abb6afcec29975814583ce0",
"score": "0.56409293",
"text": "def base_uri\n parent_feed = self.feed\n if parent_feed != nil\n return parent_feed.base_uri\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "7825d0db1aa341f2ac55cf796fd14978",
"score": "0.5628435",
"text": "def feed_source_path\n File.expand_path \"feed.xml\", __dir__\n end",
"title": ""
},
{
"docid": "8ea7706b9173e59ae05225be68690d00",
"score": "0.56218857",
"text": "def url\n \"/users/#{feed.author.username}\"\n end",
"title": ""
},
{
"docid": "8f79a7dc34884ecd31f8660a651c7941",
"score": "0.5620065",
"text": "def forecast_url() \n \"http://newsrss.bbc.co.uk/weather/forecast/#{@id}/Next3DaysRSS.xml\"\n end",
"title": ""
},
{
"docid": "e2ab53b60d34905553f12fb79db33d65",
"score": "0.56040823",
"text": "def feature_feed_url(map)\n puts map.parse_xml.at_css(\"content\")['src']\n map.parse_xml.at_css(\"content\")['src']\n end",
"title": ""
},
{
"docid": "039b1b2507438e918855a8ab18a2ddc0",
"score": "0.55863583",
"text": "def get_data_url\n\n return build_url(PATH + '?format=' + FORMAT + '&idx=' + @index.to_s +\n '&n=1' + '&mkt=' + @market)\n end",
"title": ""
},
{
"docid": "0a52b42da3635bcf7591fbc3d8b6b968",
"score": "0.5585647",
"text": "def spreadsheets(params = {})\n query = encode_query(params)\n doc = get(\"http://spreadsheets.google.com/feeds/spreadsheets/private/full?#{query}\")\n result = []\n for entry in doc.search(\"entry\")\n title = as_utf8(entry.search(\"title\").text)\n url = as_utf8(entry.search(\n \"link[@rel='http://schemas.google.com/spreadsheets/2006#worksheetsfeed']\")[0][\"href\"])\n result.push(Spreadsheet.new(self, url, title))\n end\n return result\n end",
"title": ""
},
{
"docid": "16e24825e3cf6795d5d860fa8c5ffafb",
"score": "0.5582536",
"text": "def url\n \"/#{self.entry_type}/#{self.name}\"\n end",
"title": ""
},
{
"docid": "dcf5d7c96cc49acd4ba576e57ffe53c6",
"score": "0.5581703",
"text": "def google_csv_url\n \"https://docs.google.com/spreadsheets/d/#{ google_local_key }/export?format=csv\"\n end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
},
{
"docid": "48520f7dd400e6ce31300c25f8dd07b0",
"score": "0.55705404",
"text": "def worksheet; end",
"title": ""
}
] |
fc188128dd9f5f4421230c32ef18e8bb | (: (conditional ?c ?ci ?cv) (and (active ?c ?ci ?cv) (not (p ?c ?ci ?cv)) )) | [
{
"docid": "cfa7cedc66c5f20b44514204c6d62d06",
"score": "0.76681644",
"text": "def conditional(c, ci, cv)\n active(c, ci, cv) and not p(c, ci, cv)\nend",
"title": ""
}
] | [
{
"docid": "8c00ae808c928901f9c08a6fecb0d9ac",
"score": "0.65052783",
"text": "def satisfied(c, ci, cv)\n not null(c, ci, cv) and not terminal(c, ci, cv) and q(c, ci, cv)\nend",
"title": ""
},
{
"docid": "993d45abcb1d96311106cbe79ca636f9",
"score": "0.64927197",
"text": "def complex_condition?(condition); end",
"title": ""
},
{
"docid": "759c22a3711619433703d212d6566458",
"score": "0.6433303",
"text": "def active(c, ci, cv)\n state(VAR, c, ci, cv) and\n not terminal(c, ci, cv) and\n not state(PENDING, c, ci, cv) and\n not satisfied(c, ci, cv)\nend",
"title": ""
},
{
"docid": "9748cdaa285aedb909d4e770c14678b7",
"score": "0.64308274",
"text": "def non_complex_expression?(condition); end",
"title": ""
},
{
"docid": "e63457bb5076bc21b2576cdb70976dbd",
"score": "0.6347175",
"text": "def condition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n\n\n begin\n # at line 287:5: IF LP super_expression RP block ( ELSE block )?\n match( IF, TOKENS_FOLLOWING_IF_IN_condition_1597 )\n match( LP, TOKENS_FOLLOWING_LP_IN_condition_1599 )\n\n # --> action\n $cuads.add_falseBottom\n # <-- action\n\n @state.following.push( TOKENS_FOLLOWING_super_expression_IN_condition_1603 )\n super_expression\n @state.following.pop\n\n # --> action\n $cuads.rem_falseBottom\n # <-- action\n\n\n # --> action\n $cuads.goto_falso\n # <-- action\n\n match( RP, TOKENS_FOLLOWING_RP_IN_condition_1608 )\n @state.following.push( TOKENS_FOLLOWING_block_IN_condition_1610 )\n block\n @state.following.pop\n # at line 287:109: ( ELSE block )?\n alt_36 = 2\n look_36_0 = @input.peek( 1 )\n\n if ( look_36_0 == ELSE )\n alt_36 = 1\n end\n case alt_36\n when 1\n # at line 287:110: ELSE block\n match( ELSE, TOKENS_FOLLOWING_ELSE_IN_condition_1613 )\n\n # --> action\n $cuads.goto_else\n # <-- action\n\n @state.following.push( TOKENS_FOLLOWING_block_IN_condition_1618 )\n block\n @state.following.pop\n\n end\n\n # --> action\n $cuads.fill_goto\n # <-- action\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 33 )\n\n\n end\n\n return \n end",
"title": ""
},
{
"docid": "4e9359051000d02f8b2537440d91371e",
"score": "0.63100123",
"text": "def ternary?; end",
"title": ""
},
{
"docid": "4e9359051000d02f8b2537440d91371e",
"score": "0.63100123",
"text": "def ternary?; end",
"title": ""
},
{
"docid": "2cddae1cb00b77f9f8f987027b96239c",
"score": "0.6282451",
"text": "def condition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n\n begin\n # at line 178:5: IF LPAR super_expression RPAR COLON ( estatute )* ( ELSE block | R_END ) IF\n match( IF, TOKENS_FOLLOWING_IF_IN_condition_1612 )\n match( LPAR, TOKENS_FOLLOWING_LPAR_IN_condition_1614 )\n @state.following.push( TOKENS_FOLLOWING_super_expression_IN_condition_1616 )\n super_expression\n @state.following.pop\n match( RPAR, TOKENS_FOLLOWING_RPAR_IN_condition_1618 )\n\n # --> action\n $quads.gotof() \n # <-- action\n\n match( COLON, TOKENS_FOLLOWING_COLON_IN_condition_1622 )\n # at line 178:61: ( estatute )*\n while true # decision 19\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0.between?( ID, IF ) || look_19_0 == PRINT || look_19_0 == WHILE )\n alt_19 = 1\n\n end\n case alt_19\n when 1\n # at line 178:63: estatute\n @state.following.push( TOKENS_FOLLOWING_estatute_IN_condition_1626 )\n estatute\n @state.following.pop\n\n else\n break # out of loop for decision 19\n end\n end # loop for decision 19\n\n # at line 178:75: ( ELSE block | R_END )\n alt_20 = 2\n look_20_0 = @input.peek( 1 )\n\n if ( look_20_0 == ELSE )\n alt_20 = 1\n elsif ( look_20_0 == R_END )\n alt_20 = 2\n else\n raise NoViableAlternative( \"\", 20, 0 )\n\n end\n case alt_20\n when 1\n # at line 178:77: ELSE block\n match( ELSE, TOKENS_FOLLOWING_ELSE_IN_condition_1633 )\n\n # --> action\n $quads.goto() \n # <-- action\n\n @state.following.push( TOKENS_FOLLOWING_block_IN_condition_1637 )\n block\n @state.following.pop\n\n when 2\n # at line 179:77: R_END\n match( R_END, TOKENS_FOLLOWING_R_END_IN_condition_1715 )\n\n end\n\n # --> action\n $quads.fill_program_quad() \n # <-- action\n\n match( IF, TOKENS_FOLLOWING_IF_IN_condition_1721 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n\n end\n\n return \n end",
"title": ""
},
{
"docid": "279e3c617958e07640e304bf1c741400",
"score": "0.6272307",
"text": "def triple_expression?; true; end",
"title": ""
},
{
"docid": "d62638037f8f1d6b6cc0f1de9a92dcad",
"score": "0.6231891",
"text": "def c_bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n\n\n type = C_BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 104:9: ( 'true' | 'false' )\n # at line 104:9: ( 'true' | 'false' )\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0 == 0x74 )\n alt_4 = 1\n elsif ( look_4_0 == 0x66 )\n alt_4 = 2\n else\n raise NoViableAlternative( \"\", 4, 0 )\n\n end\n case alt_4\n when 1\n # at line 104:11: 'true'\n match( \"true\" )\n\n\n when 2\n # at line 104:20: 'false'\n match( \"false\" )\n\n\n end\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 37 )\n\n\n end",
"title": ""
},
{
"docid": "2c9ad9a52b13f18a579162096a68c259",
"score": "0.62295014",
"text": "def condition_applies?(cond,idx)\n # cond is [code,data1.....]\n\n case cond[0]\n\n # Potion\n when '?potion'\n return false if $party.potion_state != cond[1]\n\n # Second\n when '?second'\n return false if !conditions_met?(idx-1)\n return false if !state?(@id,\"second_#{idx-1}\")\n \n\n # Flag\n when '?flag'\n return true if $debug.disable_flags\n return false if !flag?(cond[1])\n when '?nflag'\n return false if flag?(cond[1])\n\n # vars\n when '?var'\n return false if !var?(cond[1],cond[2].to_i)\n \n # Progress\n when '?before'\n return false if !$progress.before?(cond[1])\n when '?progress'\n return false if !$progress.progress?(cond[1])\n when '?after'\n return false if !$progress.beyond?(cond[1])\n\n # States\n when '?state'\n if cond.count > 2\n return false if !$state.state?(gid(cond[1]),cond[2])\n else\n return false if !$state.state?(@id,cond[1])\n end\n\n when '?nstate'\n if cond.count > 2\n return false if $state.state?(gid(cond[1]),cond[2])\n else\n return false if $state.state?(@id,cond[1])\n end\n\n # Active Quest\n when '?active'\n return false if !$progress.active?(cond[1])\n when '?inactive'\n return false if $progress.active?(cond[1])\n when '?complete'\n return false if !$progress.complete?(cond[1])\n when '?incomplete'\n return false if $progress.complete?(cond[1])\n when '?quest'\n return false if !$progress.quest?(cond[1])\n when '?anyquest' # Any of these 3 quests will allow\n return false if !$progress.quest?(cond[1]) && !$progress.quest?(cond[2]) && !$progress.quest?(cond[3])\n\n # Party member check\n when '?boyle', '?boy'\n return false if !$party.has_member?('boy')\n when '?ingrid', '?ing'\n return false if !$party.has_member?('ing')\n when '?myst', '?mys'\n return false if !$party.has_member?('mys')\n when '?robin', '?rob'\n return false if !$party.has_member?('rob')\n when '?hiberu', '?hib'\n return false if !$party.has_member?('hib')\n when '?rowen', '?row'\n return false if !$party.has_member?('row')\n when '?phye', '?phy'\n return false if !$party.has_member?('phy')\n\n when '?leader'\n return false if $party.leader != cond[1]\n\n # Inventory\n when '?gold'\n return false if !$party.has_gold?(cond[1].to_i)\n when '?ngold'\n return false if $party.has_gold?(cond[1].to_i)\n\n when '?item'\n cond[2] = 1 if cond.count < 3\n return false if !($party.item_number(cond[1]) >= cond[2].to_i)\n when '?nitem'\n cond[2] = 1 if cond.count < 3\n return false if ($party.item_number(cond[1]) >= cond[2].to_i)\n\n when '?chosen'\n return false if $menu.chosen_ev != @id\n return false if $menu.chosen == nil\n\n when '?partyloc'\n return false if !$party.party_loc_saved?\n\n when '?attract-boy'\n return false if $progress.attract_boy >= 6\n\n when '?attract-hib'\n return false if $progress.attract_hib >= 4\n\n when '?attract-phy'\n return false if $progress.attract_phy >= 4\n\n\n end\n\n return true\n\n end",
"title": ""
},
{
"docid": "d2d417989deeb53692ec0fdc2a02afde",
"score": "0.61599267",
"text": "def cond_exp(lex, context, options)\n t = lex.eval_lit {\n a = logical_or_exp(lex, context, options)\n next nil if !a\n\n if lex.match_lit(ECMA262::PUNC_CONDIF)\n if b=assignment_exp(lex, context, options) and lex.match_lit(ECMA262::PUNC_CONDELSE) and c=assignment_exp(lex, context, options)\n ECMA262::ExpCond.new(a, b, c)\n else\n raise ParseError.new(\"unexpceted token\", lex)\n end\n else\n a\n end\n }\n t\n end",
"title": ""
},
{
"docid": "9db04c0de136a88d33f724beb7e71746",
"score": "0.60576475",
"text": "def nested_conditional?; end",
"title": ""
},
{
"docid": "9db04c0de136a88d33f724beb7e71746",
"score": "0.60576475",
"text": "def nested_conditional?; end",
"title": ""
},
{
"docid": "ff410fb7a0a2d5909f47152a9c37de64",
"score": "0.6050078",
"text": "def conditional_expression\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 50)\n conditional_expression_start_index = @input.index\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return \n end\n # at line 376:5: logical_or_expression ( '?' expression ':' conditional_expression )?\n @state.following.push(TOKENS_FOLLOWING_logical_or_expression_IN_conditional_expression_1746)\n logical_or_expression\n @state.following.pop\n # at line 376:27: ( '?' expression ':' conditional_expression )?\n alt_53 = 2\n look_53_0 = @input.peek(1)\n\n if (look_53_0 == T__76) \n alt_53 = 1\n end\n case alt_53\n when 1\n # at line 376:28: '?' expression ':' conditional_expression\n match(T__76, TOKENS_FOLLOWING_T__76_IN_conditional_expression_1749)\n @state.following.push(TOKENS_FOLLOWING_expression_IN_conditional_expression_1751)\n expression\n @state.following.pop\n match(T__44, TOKENS_FOLLOWING_T__44_IN_conditional_expression_1753)\n @state.following.push(TOKENS_FOLLOWING_conditional_expression_IN_conditional_expression_1755)\n conditional_expression\n @state.following.pop\n\n end\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 50)\n memoize(__method__, conditional_expression_start_index, success) if @state.backtracking > 0\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "db24872c03ba958d261bd2d729df0841",
"score": "0.60490996",
"text": "def ternaryable?(statement); end",
"title": ""
},
{
"docid": "53a201f272cb0bad597a808f57e2e043",
"score": "0.60072196",
"text": "def condition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n\n begin\n # at line 90:12: IF LPAREN mega_expression RPAREN DDOT ( estatute )* ( ELSE block | FIN ) IF\n match( IF, TOKENS_FOLLOWING_IF_IN_condition_781 )\n match( LPAREN, TOKENS_FOLLOWING_LPAREN_IN_condition_783 )\n @state.following.push( TOKENS_FOLLOWING_mega_expression_IN_condition_785 )\n mega_expression\n @state.following.pop\n match( RPAREN, TOKENS_FOLLOWING_RPAREN_IN_condition_787 )\n\n # --> action\n $quads.gotof() \n # <-- action\n\n match( DDOT, TOKENS_FOLLOWING_DDOT_IN_condition_791 )\n # at line 90:70: ( estatute )*\n while true # decision 12\n alt_12 = 2\n look_12_0 = @input.peek( 1 )\n\n if ( look_12_0.between?( ID, IF ) || look_12_0 == PRINT || look_12_0 == WHILE )\n alt_12 = 1\n\n end\n case alt_12\n when 1\n # at line 90:72: estatute\n @state.following.push( TOKENS_FOLLOWING_estatute_IN_condition_795 )\n estatute\n @state.following.pop\n\n else\n break # out of loop for decision 12\n end\n end # loop for decision 12\n\n # at line 90:84: ( ELSE block | FIN )\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0 == ELSE )\n alt_13 = 1\n elsif ( look_13_0 == FIN )\n alt_13 = 2\n else\n raise NoViableAlternative( \"\", 13, 0 )\n\n end\n case alt_13\n when 1\n # at line 90:86: ELSE block\n match( ELSE, TOKENS_FOLLOWING_ELSE_IN_condition_802 )\n\n # --> action\n $quads.goto() \n # <-- action\n\n @state.following.push( TOKENS_FOLLOWING_block_IN_condition_806 )\n block\n @state.following.pop\n\n when 2\n # at line 90:118: FIN\n match( FIN, TOKENS_FOLLOWING_FIN_IN_condition_810 )\n\n end\n\n # --> action\n $quads.fill_main_quad() \n # <-- action\n\n match( IF, TOKENS_FOLLOWING_IF_IN_condition_816 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n\n end\n\n return \n end",
"title": ""
},
{
"docid": "a03db2673882b0603a9d5081f287f659",
"score": "0.5965289",
"text": "def conditions; end",
"title": ""
},
{
"docid": "a03db2673882b0603a9d5081f287f659",
"score": "0.5965289",
"text": "def conditions; end",
"title": ""
},
{
"docid": "a03db2673882b0603a9d5081f287f659",
"score": "0.5965289",
"text": "def conditions; end",
"title": ""
},
{
"docid": "a03db2673882b0603a9d5081f287f659",
"score": "0.5965289",
"text": "def conditions; end",
"title": ""
},
{
"docid": "17cca22685f65c29f22b304124f6a29e",
"score": "0.5944404",
"text": "def parse_condition; end",
"title": ""
},
{
"docid": "17cca22685f65c29f22b304124f6a29e",
"score": "0.5944404",
"text": "def parse_condition; end",
"title": ""
},
{
"docid": "3ebac29b2deb32c26be1f56ceb5afd9d",
"score": "0.5931536",
"text": "def postfix_conditional?(node); end",
"title": ""
},
{
"docid": "16670bc1eec39f59f9665fc2920dc0bb",
"score": "0.59125537",
"text": "def bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n\n\n type = BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 69:7: ( 'true' | 'false' )\n # at line 69:7: ( 'true' | 'false' )\n alt_1 = 2\n look_1_0 = @input.peek( 1 )\n\n if ( look_1_0 == 0x74 )\n alt_1 = 1\n elsif ( look_1_0 == 0x66 )\n alt_1 = 2\n else\n raise NoViableAlternative( \"\", 1, 0 )\n\n end\n case alt_1\n when 1\n # at line 69:9: 'true'\n match( \"true\" )\n\n\n when 2\n # at line 69:18: 'false'\n match( \"false\" )\n\n\n end\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n\n end",
"title": ""
},
{
"docid": "e720f50ef313d02aec97eb301939cd2b",
"score": "0.59092826",
"text": "def confusing\n\t(true && false) || (false && true) || !(false && false)\nend",
"title": ""
},
{
"docid": "d014bfb9e69844ae6486b90c131e7af7",
"score": "0.58991265",
"text": "def plsql_condition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 141 )\n return_value = PlsqlConditionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n plsql_condition_start_index = @input.index\n\n root_0 = nil\n expr_bool856 = nil\n\n # - - - - @init action - - - -\n @is_sql = false; \n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 804:4: expr_bool\n @state.following.push( TOKENS_FOLLOWING_expr_bool_IN_plsql_condition_5048 )\n expr_bool856 = expr_bool\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expr_bool856.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 141 )\n memoize( __method__, plsql_condition_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "a483fff897fc279ba108326d122b0560",
"score": "0.5899087",
"text": "def pseudo?; false end",
"title": ""
},
{
"docid": "9c61a89138baf08f21faa5b0a01c5e1b",
"score": "0.5888943",
"text": "def condition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n return_value = ConditionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __OR96__ = nil\n op = nil\n orOperand95 = nil\n\n tree_for_OR96 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 178:4: orOperand ( OR op= condition )?\n @state.following.push( TOKENS_FOLLOWING_orOperand_IN_condition_928 )\n orOperand95 = orOperand\n @state.following.pop\n @adaptor.add_child( root_0, orOperand95.tree )\n # --> action\n return_value.result = ( orOperand95.nil? ? nil : orOperand95.result )\n # <-- action\n # at line 179:3: ( OR op= condition )?\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0 == OR )\n alt_22 = 1\n end\n case alt_22\n when 1\n # at line 179:4: OR op= condition\n __OR96__ = match( OR, TOKENS_FOLLOWING_OR_IN_condition_935 )\n\n tree_for_OR96 = @adaptor.create_with_payload( __OR96__ )\n root_0 = @adaptor.become_root( tree_for_OR96, root_0 )\n\n @state.following.push( TOKENS_FOLLOWING_condition_IN_condition_940 )\n op = condition\n @state.following.pop\n @adaptor.add_child( root_0, op.tree )\n # --> action\n return_value.result = [BinaryOperatorTree.new(return_value.result,( op.nil? ? nil : op.result ),Operators.method(:or)),op.tree]\n # <-- action\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "ac46ebf2157462ac1b27d9e6722a61d4",
"score": "0.5880262",
"text": "def visitBooleanExpression(ctx)\n\n end",
"title": ""
},
{
"docid": "912c712e750e34a1340d43f663a15cb6",
"score": "0.5864125",
"text": "def null(c, ci, cv)\n cv.empty? ? @state[VAR].none? {|terms| terms.size == 3 and terms[0] == c and terms[1] == ci and cv.replace(terms[2])} : !state(VAR, c, ci, cv)\nend",
"title": ""
},
{
"docid": "d6dd46a2a4959c1cb3e0eadb9299012f",
"score": "0.58538246",
"text": "def form_conditional line\n\t\t\treturn line if !conditional? line\n\t\t\t# ---- Fetch statement\n\t\t\tline.strip =~ /(\\S+)::/\n\t\t\ts = $1\n\t\t\t# ---- Split on separators\n\t\t\ttoks = s.split(/[.|() !]+/)\n\t\t\toperators = s.split(/[^.| ()!]+/)\n\t\t\tr = 'if'\n\t\t\tidx = 0\n\t\t\t# ---- Check for leading operators\n\t\t\tidx = -1 if toks[0] == ''\n\t\t\ttoks.each do | tok |\n\t\t\t\tr += translate_operators(operators[idx]) + \" isa?('#{tok}')\" if tok != ''\n\t\t\t\tidx += 1\n\t\t\tend\n\t\t\tr += translate_operators(operators[idx])\n\t\t\tr\n\t\tend",
"title": ""
},
{
"docid": "f4fbc48554c0ffa1fef7e739fed6fdb9",
"score": "0.58372694",
"text": "def elsif_conditional?; end",
"title": ""
},
{
"docid": "f4fbc48554c0ffa1fef7e739fed6fdb9",
"score": "0.58372694",
"text": "def elsif_conditional?; end",
"title": ""
},
{
"docid": "ed0ea7241b6ac88690b6ef2704d31ed7",
"score": "0.5834396",
"text": "def condition_is\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 201 )\n return_value = ConditionIsReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_is_start_index = @input.index\n\n root_0 = nil\n string_literal1096 = nil\n string_literal1097 = nil\n string_literal1100 = nil\n sql_expression1095 = nil\n keyNAN1098 = nil\n keyINFINITE1099 = nil\n\n tree_for_string_literal1096 = nil\n tree_for_string_literal1097 = nil\n tree_for_string_literal1100 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1063:4: sql_expression 'IS' ( 'NOT' )? ( keyNAN | keyINFINITE | 'NULL' )\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_is_6622 )\n sql_expression1095 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1095.tree )\n end\n string_literal1096 = match( T__52, TOKENS_FOLLOWING_T__52_IN_condition_is_6624 )\n if @state.backtracking == 0\n\n tree_for_string_literal1096 = @adaptor.create_with_payload( string_literal1096 )\n @adaptor.add_child( root_0, tree_for_string_literal1096 )\n\n end\n # at line 1063:24: ( 'NOT' )?\n alt_282 = 2\n look_282_0 = @input.peek( 1 )\n\n if ( look_282_0 == T__57 )\n alt_282 = 1\n end\n case alt_282\n when 1\n # at line 1063:26: 'NOT'\n string_literal1097 = match( T__57, TOKENS_FOLLOWING_T__57_IN_condition_is_6628 )\n if @state.backtracking == 0\n\n tree_for_string_literal1097 = @adaptor.create_with_payload( string_literal1097 )\n @adaptor.add_child( root_0, tree_for_string_literal1097 )\n\n end\n\n end\n # at line 1063:35: ( keyNAN | keyINFINITE | 'NULL' )\n alt_283 = 3\n look_283_0 = @input.peek( 1 )\n\n if ( look_283_0 == ID )\n look_283_1 = @input.peek( 2 )\n\n if ( ( syntactic_predicate?( :synpred462_Plsql ) ) and ( ( self.input.look(1).text.upcase == (\"NAN\") ) ) )\n alt_283 = 1\n elsif ( ( syntactic_predicate?( :synpred463_Plsql ) ) and ( ( self.input.look(1).text.upcase == (\"INFINITE\") ) ) )\n alt_283 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 283, 1 )\n end\n elsif ( look_283_0 == T__58 )\n alt_283 = 3\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 283, 0 )\n end\n case alt_283\n when 1\n # at line 1063:37: keyNAN\n @state.following.push( TOKENS_FOLLOWING_keyNAN_IN_condition_is_6635 )\n keyNAN1098 = keyNAN\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, keyNAN1098.tree )\n end\n\n when 2\n # at line 1063:46: keyINFINITE\n @state.following.push( TOKENS_FOLLOWING_keyINFINITE_IN_condition_is_6639 )\n keyINFINITE1099 = keyINFINITE\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, keyINFINITE1099.tree )\n end\n\n when 3\n # at line 1063:60: 'NULL'\n string_literal1100 = match( T__58, TOKENS_FOLLOWING_T__58_IN_condition_is_6643 )\n if @state.backtracking == 0\n\n tree_for_string_literal1100 = @adaptor.create_with_payload( string_literal1100 )\n @adaptor.add_child( root_0, tree_for_string_literal1100 )\n\n end\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 201 )\n memoize( __method__, condition_is_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "927dcfa2da11a58ac2b49e0338909c9e",
"score": "0.58309567",
"text": "def condition_and\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 197 )\n return_value = ConditionAndReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_and_start_index = @input.index\n\n root_0 = nil\n string_literal1068 = nil\n condition_not1067 = nil\n condition_not1069 = nil\n\n tree_for_string_literal1068 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1033:4: condition_not ( 'AND' condition_not )*\n @state.following.push( TOKENS_FOLLOWING_condition_not_IN_condition_and_6475 )\n condition_not1067 = condition_not\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_not1067.tree )\n end\n # at line 1033:18: ( 'AND' condition_not )*\n while true # decision 279\n alt_279 = 2\n look_279_0 = @input.peek( 1 )\n\n if ( look_279_0 == T__138 )\n look_279_2 = @input.peek( 2 )\n\n if ( syntactic_predicate?( :synpred442_Plsql ) )\n alt_279 = 1\n\n end\n\n end\n case alt_279\n when 1\n # at line 1033:20: 'AND' condition_not\n string_literal1068 = match( T__138, TOKENS_FOLLOWING_T__138_IN_condition_and_6479 )\n if @state.backtracking == 0\n\n tree_for_string_literal1068 = @adaptor.create_with_payload( string_literal1068 )\n @adaptor.add_child( root_0, tree_for_string_literal1068 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_condition_not_IN_condition_and_6481 )\n condition_not1069 = condition_not\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_not1069.tree )\n end\n\n else\n break # out of loop for decision 279\n end\n end # loop for decision 279\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 197 )\n memoize( __method__, condition_and_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "f72d3b1f613d1592f131d6dd8cb512b1",
"score": "0.58283406",
"text": "def if(condition, if_true, if_false); end",
"title": ""
},
{
"docid": "56b5256331dea7c86618bc56b212ddda",
"score": "0.58192587",
"text": "def if?; end",
"title": ""
},
{
"docid": "56b5256331dea7c86618bc56b212ddda",
"score": "0.58192587",
"text": "def if?; end",
"title": ""
},
{
"docid": "f1c23bb7d5eac963718e41c4885c7fe9",
"score": "0.5808871",
"text": "def condition; end",
"title": ""
},
{
"docid": "f1c23bb7d5eac963718e41c4885c7fe9",
"score": "0.5808871",
"text": "def condition; end",
"title": ""
},
{
"docid": "f1c23bb7d5eac963718e41c4885c7fe9",
"score": "0.5808871",
"text": "def condition; end",
"title": ""
},
{
"docid": "f1c23bb7d5eac963718e41c4885c7fe9",
"score": "0.5808871",
"text": "def condition; end",
"title": ""
},
{
"docid": "82a33d74caade921957e869f998ac220",
"score": "0.5775218",
"text": "def bool\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n return_value = BoolReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __TRUE159__ = nil\n __FALSE160__ = nil\n\n tree_for_TRUE159 = nil\n tree_for_FALSE160 = nil\n\n begin\n # at line 271:2: ( TRUE | FALSE )\n alt_48 = 2\n look_48_0 = @input.peek( 1 )\n\n if ( look_48_0 == TRUE )\n alt_48 = 1\n elsif ( look_48_0 == FALSE )\n alt_48 = 2\n else\n raise NoViableAlternative( \"\", 48, 0 )\n end\n case alt_48\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 271:4: TRUE\n __TRUE159__ = match( TRUE, TOKENS_FOLLOWING_TRUE_IN_bool_1684 )\n\n tree_for_TRUE159 = @adaptor.create_with_payload( __TRUE159__ )\n @adaptor.add_child( root_0, tree_for_TRUE159 )\n\n # --> action\n return_value.result = AtomTree.new(true)\n # <-- action\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 272:5: FALSE\n __FALSE160__ = match( FALSE, TOKENS_FOLLOWING_FALSE_IN_bool_1692 )\n\n tree_for_FALSE160 = @adaptor.create_with_payload( __FALSE160__ )\n @adaptor.add_child( root_0, tree_for_FALSE160 )\n\n # --> action\n return_value.result = AtomTree.new(false)\n # <-- action\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "2bc08908fb64d4c49a0c203b5933bb25",
"score": "0.5774667",
"text": "def condition_or\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 196 )\n return_value = ConditionOrReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_or_start_index = @input.index\n\n root_0 = nil\n string_literal1065 = nil\n condition_and1064 = nil\n condition_and1066 = nil\n\n tree_for_string_literal1065 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1030:4: condition_and ( 'OR' condition_and )*\n @state.following.push( TOKENS_FOLLOWING_condition_and_IN_condition_or_6456 )\n condition_and1064 = condition_and\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_and1064.tree )\n end\n # at line 1030:18: ( 'OR' condition_and )*\n while true # decision 278\n alt_278 = 2\n look_278_0 = @input.peek( 1 )\n\n if ( look_278_0 == T__51 )\n look_278_2 = @input.peek( 2 )\n\n if ( syntactic_predicate?( :synpred441_Plsql ) )\n alt_278 = 1\n\n end\n\n end\n case alt_278\n when 1\n # at line 1030:20: 'OR' condition_and\n string_literal1065 = match( T__51, TOKENS_FOLLOWING_T__51_IN_condition_or_6460 )\n if @state.backtracking == 0\n\n tree_for_string_literal1065 = @adaptor.create_with_payload( string_literal1065 )\n @adaptor.add_child( root_0, tree_for_string_literal1065 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_condition_and_IN_condition_or_6462 )\n condition_and1066 = condition_and\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_and1066.tree )\n end\n\n else\n break # out of loop for decision 278\n end\n end # loop for decision 278\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 196 )\n memoize( __method__, condition_or_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "e1cdab5570f693f92f77960951f748a9",
"score": "0.57680345",
"text": "def p(cn, ci, t)\n @state[COMMITMENT].any? {|cterms|\n c = cterms[0]\n if cterms.size == 4 and cterms[1] == ci and state(VAR, c, ci, t)\n d = cterms[2]\n a = cterms[3]\n case cn\n when C1 then state(DIAGNOSISREQUESTED, a, d) and not violated(c, C2, t) and not violated(c, C3, t)\n when C2 then @state[IAPPOINTMENTREQUESTED].any? {|terms| terms.size == 2 and terms[0] == d}\n when C3 then @state[BAPPOINTMENTREQUESTED].any? {|terms| terms.size == 2 and terms[0] == d}\n when C4 then @state[IMAGINGREQUESTED].any? {|terms| terms.size == 2 and terms[0] == a and list(terms[1]) == t and state(IAPPOINTMENTKEPT, terms[1], d)}\n when C5 then @state[BIOPSYREQUESTED].any? {|terms| terms.size == 2 and terms[0] == a and state(BAPPOINTMENTKEPT, terms[1], d)}\n when C6 then @state[PATHOLOGYREQUESTED].any? {|terms| terms.size == 3 and terms[1] == d and state(TISSUEPROVIDED, terms[2])}\n when C7 then @state[PATIENTREPORTEDTOREGISTRAR].any? {|terms| terms.size == 2 and list(terms[0]) == t and terms[1] == d}\n end\n end\n }\nend",
"title": ""
},
{
"docid": "0be578f824e127a8bdbff1c3f822b41a",
"score": "0.57647526",
"text": "def if_branch; end",
"title": ""
},
{
"docid": "0be578f824e127a8bdbff1c3f822b41a",
"score": "0.57647526",
"text": "def if_branch; end",
"title": ""
},
{
"docid": "5a0e3d9c04d0ac5c6f1310d964de5ab2",
"score": "0.57504666",
"text": "def and\n end",
"title": ""
},
{
"docid": "46ec97a9b7e69aafefb31b6211c0702d",
"score": "0.5729332",
"text": "def bool\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n return_value = BoolReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __TRUE192__ = nil\n __FALSE193__ = nil\n\n tree_for_TRUE192 = nil\n tree_for_FALSE193 = nil\n\n begin\n # at line 329:2: ( TRUE | FALSE )\n alt_43 = 2\n look_43_0 = @input.peek( 1 )\n\n if ( look_43_0 == TRUE )\n alt_43 = 1\n elsif ( look_43_0 == FALSE )\n alt_43 = 2\n else\n raise NoViableAlternative( \"\", 43, 0 )\n end\n case alt_43\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 329:4: TRUE\n __TRUE192__ = match( TRUE, TOKENS_FOLLOWING_TRUE_IN_bool_1854 )\n\n tree_for_TRUE192 = @adaptor.create_with_payload( __TRUE192__ )\n @adaptor.add_child( root_0, tree_for_TRUE192 )\n\n # --> action\n return_value.result = new AtomTree(1)\n # <-- action\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 330:5: FALSE\n __FALSE193__ = match( FALSE, TOKENS_FOLLOWING_FALSE_IN_bool_1862 )\n\n tree_for_FALSE193 = @adaptor.create_with_payload( __FALSE193__ )\n @adaptor.add_child( root_0, tree_for_FALSE193 )\n\n # --> action\n return_value.result = new AtomTree(0)\n # <-- action\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "6d3db46844807411c1d80f7cd9c719ab",
"score": "0.5728703",
"text": "def terminal(c, ci, cv)\n # Free variables de and cr requires special comparison\n @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == c and terms[1] == ci} and\n (state(CANCELLED, c, ci, cv) or state(RELEASED, c, ci, cv) or state(EXPIRED, c, ci, cv))\nend",
"title": ""
},
{
"docid": "abf4063ba21175349965f6ecddefc7d2",
"score": "0.5726738",
"text": "def isolated?; end",
"title": ""
},
{
"docid": "0c67f8c2ed622b0821377f78ae6f9720",
"score": "0.5719968",
"text": "def truthy; end",
"title": ""
},
{
"docid": "4e4437e756b0341fad8d62b7499c7d36",
"score": "0.57068366",
"text": "def active_or_basic?\n basic? || active?\n end",
"title": ""
},
{
"docid": "3e1a40dc75b0bf7affb654963274918e",
"score": "0.57066876",
"text": "def parse_condition\n # :do is needed in the inhibited set because of ugly constructs like\n # \"while cond do end\" where the \"do .. end\" block belongs to \"while\",\n # not to any function in the condition.\n pos = position\n ret = @sexp.parse || @shunting.parse([:do])\n return ret\n end",
"title": ""
},
{
"docid": "65085cc0774a871fd5b4f7f12ed98278",
"score": "0.56952214",
"text": "def boolOperand\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n return_value = BoolOperandReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __NOT100__ = nil\n __LB101__ = nil\n __RB103__ = nil\n __EQ104__ = nil\n __NE105__ = nil\n __LT106__ = nil\n __GT107__ = nil\n __LE108__ = nil\n __GE109__ = nil\n op1 = nil\n op2 = nil\n bool99 = nil\n condition102 = nil\n\n tree_for_NOT100 = nil\n tree_for_LB101 = nil\n tree_for_RB103 = nil\n tree_for_EQ104 = nil\n tree_for_NE105 = nil\n tree_for_LT106 = nil\n tree_for_GT107 = nil\n tree_for_LE108 = nil\n tree_for_GE109 = nil\n\n begin\n # at line 190:2: ( bool | NOT LB condition RB | op1= expression ( EQ (op2= bool | op2= expression ) | NE (op2= bool | op2= expression ) | LT (op2= bool | op2= expression ) | GT (op2= bool | op2= expression ) | LE (op2= bool | op2= expression ) | GE (op2= bool | op2= expression ) ) )\n alt_31 = 3\n case look_31 = @input.peek( 1 )\n when TRUE, FALSE then alt_31 = 1\n when NOT then alt_31 = 2\n when READ, LB, PLUS, MINUS, INT, ID, TO_INT, TO_FLOAT, FLOAT, NEW, STRING, T__64 then alt_31 = 3\n else\n raise NoViableAlternative( \"\", 31, 0 )\n end\n case alt_31\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 190:4: bool\n @state.following.push( TOKENS_FOLLOWING_bool_IN_boolOperand_992 )\n bool99 = bool\n @state.following.pop\n @adaptor.add_child( root_0, bool99.tree )\n # --> action\n return_value.result = ( bool99.nil? ? nil : bool99.result )\n # <-- action\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 191:4: NOT LB condition RB\n __NOT100__ = match( NOT, TOKENS_FOLLOWING_NOT_IN_boolOperand_999 )\n\n tree_for_NOT100 = @adaptor.create_with_payload( __NOT100__ )\n @adaptor.add_child( root_0, tree_for_NOT100 )\n\n __LB101__ = match( LB, TOKENS_FOLLOWING_LB_IN_boolOperand_1001 )\n @state.following.push( TOKENS_FOLLOWING_condition_IN_boolOperand_1004 )\n condition102 = condition\n @state.following.pop\n @adaptor.add_child( root_0, condition102.tree )\n __RB103__ = match( RB, TOKENS_FOLLOWING_RB_IN_boolOperand_1006 )\n # --> action\n return_value.result = !( condition102.nil? ? nil : condition102.result )\n # <-- action\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 192:4: op1= expression ( EQ (op2= bool | op2= expression ) | NE (op2= bool | op2= expression ) | LT (op2= bool | op2= expression ) | GT (op2= bool | op2= expression ) | LE (op2= bool | op2= expression ) | GE (op2= bool | op2= expression ) )\n @state.following.push( TOKENS_FOLLOWING_expression_IN_boolOperand_1016 )\n op1 = expression\n @state.following.pop\n @adaptor.add_child( root_0, op1.tree )\n # at line 192:19: ( EQ (op2= bool | op2= expression ) | NE (op2= bool | op2= expression ) | LT (op2= bool | op2= expression ) | GT (op2= bool | op2= expression ) | LE (op2= bool | op2= expression ) | GE (op2= bool | op2= expression ) )\n alt_30 = 6\n case look_30 = @input.peek( 1 )\n when EQ then alt_30 = 1\n when NE then alt_30 = 2\n when LT then alt_30 = 3\n when GT then alt_30 = 4\n when LE then alt_30 = 5\n when GE then alt_30 = 6\n else\n raise NoViableAlternative( \"\", 30, 0 )\n end\n case alt_30\n when 1\n # at line 192:20: EQ (op2= bool | op2= expression )\n __EQ104__ = match( EQ, TOKENS_FOLLOWING_EQ_IN_boolOperand_1019 )\n\n tree_for_EQ104 = @adaptor.create_with_payload( __EQ104__ )\n root_0 = @adaptor.become_root( tree_for_EQ104, root_0 )\n\n # at line 192:24: (op2= bool | op2= expression )\n alt_24 = 2\n look_24_0 = @input.peek( 1 )\n\n if ( look_24_0.between?( TRUE, FALSE ) )\n alt_24 = 1\n elsif ( look_24_0 == READ || look_24_0 == LB || look_24_0.between?( PLUS, INT ) || look_24_0 == ID || look_24_0.between?( TO_INT, NEW ) || look_24_0 == STRING || look_24_0 == T__64 )\n alt_24 = 2\n else\n raise NoViableAlternative( \"\", 24, 0 )\n end\n case alt_24\n when 1\n # at line 192:26: op2= bool\n @state.following.push( TOKENS_FOLLOWING_bool_IN_boolOperand_1026 )\n op2 = bool\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n when 2\n # at line 192:37: op2= expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_boolOperand_1032 )\n op2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n end\n # --> action\n return_value.result = [BinaryOperatorTree.new(( op1.nil? ? nil : op1.result ),( op2.nil? ? nil : op2.result ),Operators.method(:eq)),op2.tree]\n # <-- action\n\n when 2\n # at line 193:6: NE (op2= bool | op2= expression )\n __NE105__ = match( NE, TOKENS_FOLLOWING_NE_IN_boolOperand_1043 )\n\n tree_for_NE105 = @adaptor.create_with_payload( __NE105__ )\n root_0 = @adaptor.become_root( tree_for_NE105, root_0 )\n\n # at line 193:10: (op2= bool | op2= expression )\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( TRUE, FALSE ) )\n alt_25 = 1\n elsif ( look_25_0 == READ || look_25_0 == LB || look_25_0.between?( PLUS, INT ) || look_25_0 == ID || look_25_0.between?( TO_INT, NEW ) || look_25_0 == STRING || look_25_0 == T__64 )\n alt_25 = 2\n else\n raise NoViableAlternative( \"\", 25, 0 )\n end\n case alt_25\n when 1\n # at line 193:12: op2= bool\n @state.following.push( TOKENS_FOLLOWING_bool_IN_boolOperand_1050 )\n op2 = bool\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n when 2\n # at line 193:23: op2= expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_boolOperand_1056 )\n op2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n end\n # --> action\n return_value.result = [BinaryOperatorTree.new(( op1.nil? ? nil : op1.result ),( op2.nil? ? nil : op2.result ),Operators.method(:ne)),op2.tree]\n # <-- action\n\n when 3\n # at line 194:6: LT (op2= bool | op2= expression )\n __LT106__ = match( LT, TOKENS_FOLLOWING_LT_IN_boolOperand_1067 )\n\n tree_for_LT106 = @adaptor.create_with_payload( __LT106__ )\n root_0 = @adaptor.become_root( tree_for_LT106, root_0 )\n\n # at line 194:10: (op2= bool | op2= expression )\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0.between?( TRUE, FALSE ) )\n alt_26 = 1\n elsif ( look_26_0 == READ || look_26_0 == LB || look_26_0.between?( PLUS, INT ) || look_26_0 == ID || look_26_0.between?( TO_INT, NEW ) || look_26_0 == STRING || look_26_0 == T__64 )\n alt_26 = 2\n else\n raise NoViableAlternative( \"\", 26, 0 )\n end\n case alt_26\n when 1\n # at line 194:12: op2= bool\n @state.following.push( TOKENS_FOLLOWING_bool_IN_boolOperand_1074 )\n op2 = bool\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n when 2\n # at line 194:23: op2= expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_boolOperand_1080 )\n op2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n end\n # --> action\n return_value.result = [BinaryOperatorTree.new(( op1.nil? ? nil : op1.result ),( op2.nil? ? nil : op2.result ),Operators.method(:lt)),op2.tree]\n # <-- action\n\n when 4\n # at line 195:6: GT (op2= bool | op2= expression )\n __GT107__ = match( GT, TOKENS_FOLLOWING_GT_IN_boolOperand_1091 )\n\n tree_for_GT107 = @adaptor.create_with_payload( __GT107__ )\n root_0 = @adaptor.become_root( tree_for_GT107, root_0 )\n\n # at line 195:10: (op2= bool | op2= expression )\n alt_27 = 2\n look_27_0 = @input.peek( 1 )\n\n if ( look_27_0.between?( TRUE, FALSE ) )\n alt_27 = 1\n elsif ( look_27_0 == READ || look_27_0 == LB || look_27_0.between?( PLUS, INT ) || look_27_0 == ID || look_27_0.between?( TO_INT, NEW ) || look_27_0 == STRING || look_27_0 == T__64 )\n alt_27 = 2\n else\n raise NoViableAlternative( \"\", 27, 0 )\n end\n case alt_27\n when 1\n # at line 195:12: op2= bool\n @state.following.push( TOKENS_FOLLOWING_bool_IN_boolOperand_1098 )\n op2 = bool\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n when 2\n # at line 195:23: op2= expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_boolOperand_1104 )\n op2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n end\n # --> action\n return_value.result = [BinaryOperatorTree.new(( op1.nil? ? nil : op1.result ),( op2.nil? ? nil : op2.result ),Operators.method(:gt)),op2.tree]\n # <-- action\n\n when 5\n # at line 196:6: LE (op2= bool | op2= expression )\n __LE108__ = match( LE, TOKENS_FOLLOWING_LE_IN_boolOperand_1115 )\n\n tree_for_LE108 = @adaptor.create_with_payload( __LE108__ )\n root_0 = @adaptor.become_root( tree_for_LE108, root_0 )\n\n # at line 196:10: (op2= bool | op2= expression )\n alt_28 = 2\n look_28_0 = @input.peek( 1 )\n\n if ( look_28_0.between?( TRUE, FALSE ) )\n alt_28 = 1\n elsif ( look_28_0 == READ || look_28_0 == LB || look_28_0.between?( PLUS, INT ) || look_28_0 == ID || look_28_0.between?( TO_INT, NEW ) || look_28_0 == STRING || look_28_0 == T__64 )\n alt_28 = 2\n else\n raise NoViableAlternative( \"\", 28, 0 )\n end\n case alt_28\n when 1\n # at line 196:12: op2= bool\n @state.following.push( TOKENS_FOLLOWING_bool_IN_boolOperand_1122 )\n op2 = bool\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n when 2\n # at line 196:23: op2= expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_boolOperand_1128 )\n op2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n end\n # --> action\n return_value.result = [BinaryOperatorTree.new(( op1.nil? ? nil : op1.result ),( op2.nil? ? nil : op2.result ),Operators.method(:le)),op2.tree]\n # <-- action\n\n when 6\n # at line 197:6: GE (op2= bool | op2= expression )\n __GE109__ = match( GE, TOKENS_FOLLOWING_GE_IN_boolOperand_1139 )\n\n tree_for_GE109 = @adaptor.create_with_payload( __GE109__ )\n root_0 = @adaptor.become_root( tree_for_GE109, root_0 )\n\n # at line 197:10: (op2= bool | op2= expression )\n alt_29 = 2\n look_29_0 = @input.peek( 1 )\n\n if ( look_29_0.between?( TRUE, FALSE ) )\n alt_29 = 1\n elsif ( look_29_0 == READ || look_29_0 == LB || look_29_0.between?( PLUS, INT ) || look_29_0 == ID || look_29_0.between?( TO_INT, NEW ) || look_29_0 == STRING || look_29_0 == T__64 )\n alt_29 = 2\n else\n raise NoViableAlternative( \"\", 29, 0 )\n end\n case alt_29\n when 1\n # at line 197:12: op2= bool\n @state.following.push( TOKENS_FOLLOWING_bool_IN_boolOperand_1146 )\n op2 = bool\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n when 2\n # at line 197:23: op2= expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_boolOperand_1152 )\n op2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, op2.tree )\n\n end\n # --> action\n return_value.result = [BinaryOperatorTree.new(( op1.nil? ? nil : op1.result ),( op2.nil? ? nil : op2.result ),Operators.method(:ge)),op2.tree]\n # <-- action\n\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "24dcc935b6fa7df52c700e5e445e4f0b",
"score": "0.56907856",
"text": "def pyfix_and_or\n return self unless inside_subexpression?\n left_eval = and_or_var_assign left\n ternary = PythonTernary.new [\n and_or_var, # condition\n and_or_var, # when true\n right # when false\n ]\n statement_list, statement_list_child = current_statement_list\n statement_list_child = ternary if statement_list_child == self\n statement_list.late_insert before: statement_list_child, node: left_eval\n return ternary\n end",
"title": ""
},
{
"docid": "56289edddbbbab66ab75f2b11436d19a",
"score": "0.5685504",
"text": "def cond\n @opts[:cond]\n end",
"title": ""
},
{
"docid": "e03f31863e09eb01950489761a79d46a",
"score": "0.56820977",
"text": "def acec_fresh_cond(page_num)\n # memoization FTW! Force tag complicates things, so i intentionaly made room for slower conditions\n return @fresh_conds[page_num] unless @fresh_conds[page_num].nil?\n \n data = parse_page(page_num)\n # check cond tag\n cond = @cond_pages[page_num].nil? ? true : @cond_pages[page_num].call \n # if page ignores originals, then it's true all way sunday\n # if not, then evaluate it\n orig = data[Amphicore::TAG_IGNORE_ORIGINAL_CONDITION] ? true : \n acec_conditions_met?(@event.pages[page_num])\n result = cond && orig\n @fresh_conds[page_num] = result\n result\n end",
"title": ""
},
{
"docid": "e5b1cc4bc6ecab33a1e7f029f8a2efcf",
"score": "0.5677733",
"text": "def supports_condition=(_arg0); end",
"title": ""
},
{
"docid": "6be462a3439ce37e54c0d74d07fcd69b",
"score": "0.56661266",
"text": "def first_not_met_condition\r\n c = @operator.preconditions.find do |pre|\r\n# p @links\r\n# p @links.has_key?(pre)\r\n not (@links.has_key? pre)\r\n end\r\n make_instance(c) unless c.nil?\r\n end",
"title": ""
},
{
"docid": "0babe5786f1dc0b716cb7264ef804fca",
"score": "0.5661806",
"text": "def else_clause; end",
"title": ""
},
{
"docid": "59fd3be79637c0ac898694ce99e8faf3",
"score": "0.56601024",
"text": "def semantic_operator?; end",
"title": ""
},
{
"docid": "59fd3be79637c0ac898694ce99e8faf3",
"score": "0.56601024",
"text": "def semantic_operator?; end",
"title": ""
},
{
"docid": "c002929436125581d00c4026ef3f312e",
"score": "0.56413907",
"text": "def bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 59:9: ( 'true' | 'false' )\n alt_1 = 2\n look_1_0 = @input.peek( 1 )\n\n if ( look_1_0 == 0x74 )\n alt_1 = 1\n elsif ( look_1_0 == 0x66 )\n alt_1 = 2\n else\n raise NoViableAlternative( \"\", 1, 0 )\n end\n case alt_1\n when 1\n # at line 59:11: 'true'\n match( \"true\" )\n\n when 2\n # at line 59:20: 'false'\n match( \"false\" )\n\n end\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end",
"title": ""
},
{
"docid": "da2ca737dd6cec158c44fe5832b07b21",
"score": "0.5640869",
"text": "def supports_condition; end",
"title": ""
},
{
"docid": "03fbd334229402b3e6f982a9238b085b",
"score": "0.562962",
"text": "def accepted?; decision == 'approved'; end",
"title": ""
},
{
"docid": "d4f161405df8a56b6070314ae721e745",
"score": "0.56293726",
"text": "def pyfix_and_or\n return self unless inside_subexpression?\n left_eval = and_or_var_assign left\n ternary = PythonTernary.new [\n and_or_var, # condition\n right, # when true\n and_or_var # when false\n ]\n statement_list, statement_list_child = current_statement_list\n statement_list_child = ternary if statement_list_child == self\n statement_list.late_insert before: statement_list_child, node: left_eval\n return ternary\n end",
"title": ""
},
{
"docid": "52611c931dbd7966ed989444ef2d763a",
"score": "0.56183493",
"text": "def parenthesized?; end",
"title": ""
},
{
"docid": "52611c931dbd7966ed989444ef2d763a",
"score": "0.56183493",
"text": "def parenthesized?; end",
"title": ""
},
{
"docid": "6f24109f31cf1436497c019f4ecf92c1",
"score": "0.56166005",
"text": "def representative\n @cond_type = \"??\"\n @cond_repr = \"??\"\n self\n end",
"title": ""
},
{
"docid": "7e431eecb28403613e36aa618b8deb9c",
"score": "0.5610467",
"text": "def bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 1046:2: ( 'true' | 'false' )\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0 == 0x74 )\n alt_4 = 1\n elsif ( look_4_0 == 0x66 )\n alt_4 = 2\n else\n raise NoViableAlternative( \"\", 4, 0 )\n end\n case alt_4\n when 1\n # at line 1046:4: 'true'\n match( \"true\" )\n\n when 2\n # at line 1046:13: 'false'\n match( \"false\" )\n\n end\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end",
"title": ""
},
{
"docid": "b0f6b09fd6e4258d42cf3c59eb43e6c2",
"score": "0.56102216",
"text": "def IfOp(predicate, truthy, falsy); end",
"title": ""
},
{
"docid": "f7d6974afb4fc64f6899e1cfe82eaff2",
"score": "0.55971295",
"text": "def condition_not\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 198 )\n return_value = ConditionNotReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_not_start_index = @input.index\n\n root_0 = nil\n string_literal1070 = nil\n condition_expr1071 = nil\n condition_expr1072 = nil\n\n tree_for_string_literal1070 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n # at line 1036:2: ( 'NOT' condition_expr | condition_expr )\n alt_280 = 2\n look_280_0 = @input.peek( 1 )\n\n if ( look_280_0 == T__57 )\n alt_280 = 1\n elsif ( look_280_0 == LPAREN || look_280_0.between?( PLUS, QUOTED_STRING ) || look_280_0.between?( ID, DOUBLEQUOTED_STRING ) || look_280_0 == T__58 || look_280_0 == T__100 || look_280_0.between?( T__110, T__111 ) || look_280_0.between?( T__116, T__117 ) || look_280_0.between?( T__140, T__142 ) || look_280_0 == T__144 || look_280_0 == T__146 )\n alt_280 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 280, 0 )\n end\n case alt_280\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1036:4: 'NOT' condition_expr\n string_literal1070 = match( T__57, TOKENS_FOLLOWING_T__57_IN_condition_not_6494 )\n if @state.backtracking == 0\n\n tree_for_string_literal1070 = @adaptor.create_with_payload( string_literal1070 )\n @adaptor.add_child( root_0, tree_for_string_literal1070 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_condition_expr_IN_condition_not_6496 )\n condition_expr1071 = condition_expr\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_expr1071.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1037:4: condition_expr\n @state.following.push( TOKENS_FOLLOWING_condition_expr_IN_condition_not_6501 )\n condition_expr1072 = condition_expr\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_expr1072.tree )\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 198 )\n memoize( __method__, condition_not_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "bd2da01fe55da2e5ecb783f76f7e766b",
"score": "0.5589652",
"text": "def IfNode(predicate, statements, consequent); end",
"title": ""
},
{
"docid": "d0512aa51c9c9a6f360535d0c207272e",
"score": "0.5587332",
"text": "def active?() !!@active end",
"title": ""
},
{
"docid": "f299c7a73350e90aeb24bae85e192c28",
"score": "0.5583372",
"text": "def and!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n type = AND\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 22:7: '&'\n match( 0x26 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end",
"title": ""
},
{
"docid": "c7e2fbb0ace31b59c9a8d1b5f0d64b51",
"score": "0.55782247",
"text": "def process_if exp\n process exp.then_clause if sexp? exp.then_clause\n process exp.else_clause if sexp? exp.else_clause\n exp\n end",
"title": ""
},
{
"docid": "1d1e8e4e18f0711ff27aee4ad7e9e972",
"score": "0.5577545",
"text": "def cramped_operator?(line)\n /\\S[\\=\\+\\-\\*\\%]\\S/.match(line) && !(cramped_comparator?(line))\nend",
"title": ""
},
{
"docid": "bd13867555f21307b7159bb001e36d8b",
"score": "0.5576201",
"text": "def condition_like\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 212 )\n return_value = ConditionLikeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_like_start_index = @input.index\n\n root_0 = nil\n string_literal1185 = nil\n string_literal1186 = nil\n sql_expression1184 = nil\n keyLIKEC1187 = nil\n keyLIKE21188 = nil\n keyLIKE41189 = nil\n sql_expression1190 = nil\n keyESCAPE1191 = nil\n sql_expression1192 = nil\n\n tree_for_string_literal1185 = nil\n tree_for_string_literal1186 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1099:4: sql_expression ( 'NOT' )? ( 'LIKE' | keyLIKEC | keyLIKE2 | keyLIKE4 ) sql_expression ( keyESCAPE sql_expression )?\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_like_7095 )\n sql_expression1184 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1184.tree )\n end\n # at line 1099:19: ( 'NOT' )?\n alt_309 = 2\n look_309_0 = @input.peek( 1 )\n\n if ( look_309_0 == T__57 )\n alt_309 = 1\n end\n case alt_309\n when 1\n # at line 1099:21: 'NOT'\n string_literal1185 = match( T__57, TOKENS_FOLLOWING_T__57_IN_condition_like_7099 )\n if @state.backtracking == 0\n\n tree_for_string_literal1185 = @adaptor.create_with_payload( string_literal1185 )\n @adaptor.add_child( root_0, tree_for_string_literal1185 )\n\n end\n\n end\n # at line 1099:30: ( 'LIKE' | keyLIKEC | keyLIKE2 | keyLIKE4 )\n alt_310 = 4\n look_310_0 = @input.peek( 1 )\n\n if ( look_310_0 == T__134 )\n alt_310 = 1\n elsif ( look_310_0 == ID )\n look_310_2 = @input.peek( 2 )\n\n if ( ( syntactic_predicate?( :synpred505_Plsql ) ) and ( ( self.input.look(1).text.upcase == (\"LIKEC\") ) ) )\n alt_310 = 2\n elsif ( ( syntactic_predicate?( :synpred506_Plsql ) ) and ( ( self.input.look(1).text.upcase == (\"LIKE2\") ) ) )\n alt_310 = 3\n elsif ( ( self.input.look(1).text.upcase == (\"LIKE4\") ) )\n alt_310 = 4\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 310, 2 )\n end\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 310, 0 )\n end\n case alt_310\n when 1\n # at line 1099:32: 'LIKE'\n string_literal1186 = match( T__134, TOKENS_FOLLOWING_T__134_IN_condition_like_7106 )\n if @state.backtracking == 0\n\n tree_for_string_literal1186 = @adaptor.create_with_payload( string_literal1186 )\n @adaptor.add_child( root_0, tree_for_string_literal1186 )\n\n end\n\n when 2\n # at line 1099:41: keyLIKEC\n @state.following.push( TOKENS_FOLLOWING_keyLIKEC_IN_condition_like_7110 )\n keyLIKEC1187 = keyLIKEC\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, keyLIKEC1187.tree )\n end\n\n when 3\n # at line 1099:52: keyLIKE2\n @state.following.push( TOKENS_FOLLOWING_keyLIKE2_IN_condition_like_7114 )\n keyLIKE21188 = keyLIKE2\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, keyLIKE21188.tree )\n end\n\n when 4\n # at line 1099:63: keyLIKE4\n @state.following.push( TOKENS_FOLLOWING_keyLIKE4_IN_condition_like_7118 )\n keyLIKE41189 = keyLIKE4\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, keyLIKE41189.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_like_7122 )\n sql_expression1190 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1190.tree )\n end\n # at line 1099:89: ( keyESCAPE sql_expression )?\n alt_311 = 2\n look_311_0 = @input.peek( 1 )\n\n if ( look_311_0 == ID )\n look_311_1 = @input.peek( 2 )\n\n if ( ( syntactic_predicate?( :synpred507_Plsql ) ) and ( ( self.input.look(1).text.upcase == (\"ESCAPE\") ) ) )\n alt_311 = 1\n end\n end\n case alt_311\n when 1\n # at line 1099:91: keyESCAPE sql_expression\n @state.following.push( TOKENS_FOLLOWING_keyESCAPE_IN_condition_like_7126 )\n keyESCAPE1191 = keyESCAPE\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, keyESCAPE1191.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_like_7128 )\n sql_expression1192 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1192.tree )\n end\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 212 )\n memoize( __method__, condition_like_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "6f77550879a8b75119b8be9c9e0b678a",
"score": "0.55739504",
"text": "def condition_memeber\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 213 )\n return_value = ConditionMemeberReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_memeber_start_index = @input.index\n\n root_0 = nil\n string_literal1194 = nil\n string_literal1196 = nil\n sql_expression1193 = nil\n keyMEMBER1195 = nil\n nested_table_column_name1197 = nil\n\n tree_for_string_literal1194 = nil\n tree_for_string_literal1196 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1102:4: sql_expression ( 'NOT' )? keyMEMBER ( 'OF' )? nested_table_column_name\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_memeber_7141 )\n sql_expression1193 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1193.tree )\n end\n # at line 1102:19: ( 'NOT' )?\n alt_312 = 2\n look_312_0 = @input.peek( 1 )\n\n if ( look_312_0 == T__57 )\n alt_312 = 1\n end\n case alt_312\n when 1\n # at line 1102:21: 'NOT'\n string_literal1194 = match( T__57, TOKENS_FOLLOWING_T__57_IN_condition_memeber_7145 )\n if @state.backtracking == 0\n\n tree_for_string_literal1194 = @adaptor.create_with_payload( string_literal1194 )\n @adaptor.add_child( root_0, tree_for_string_literal1194 )\n\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_keyMEMBER_IN_condition_memeber_7150 )\n keyMEMBER1195 = keyMEMBER\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, keyMEMBER1195.tree )\n end\n # at line 1102:40: ( 'OF' )?\n alt_313 = 2\n look_313_0 = @input.peek( 1 )\n\n if ( look_313_0 == T__106 )\n alt_313 = 1\n end\n case alt_313\n when 1\n # at line 1102:42: 'OF'\n string_literal1196 = match( T__106, TOKENS_FOLLOWING_T__106_IN_condition_memeber_7154 )\n if @state.backtracking == 0\n\n tree_for_string_literal1196 = @adaptor.create_with_payload( string_literal1196 )\n @adaptor.add_child( root_0, tree_for_string_literal1196 )\n\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_nested_table_column_name_IN_condition_memeber_7159 )\n nested_table_column_name1197 = nested_table_column_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, nested_table_column_name1197.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 213 )\n memoize( __method__, condition_memeber_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "befeedff2346ac3c0876be8744417e76",
"score": "0.55727524",
"text": "def process_condition(text, ident_list, type_table)\n expression = parse_condition(text)\n check_expression(expression, ident_list, type_table)\n return simplify_expression(expression)\nend",
"title": ""
},
{
"docid": "d3f473c0bb336f73623238fda06846f7",
"score": "0.55644596",
"text": "def blah\n if 1 == 2 and true != false\n bar\n end\n end",
"title": ""
},
{
"docid": "20494fecb3339a05def194f43835c630",
"score": "0.5561681",
"text": "def process_not(exp)\n thing = process exp.shift\n thing.c_type.unify CType.bool\n return t(:not, thing, CType.bool)\n end",
"title": ""
},
{
"docid": "611a4d064685d080e18ffc68aaba4686",
"score": "0.5546787",
"text": "def mood\n if nausea && happiness\n self.nausea > self.happiness ? \"sad\" : \"happy\"\n end\n #if a ? then b : if not then c\n end",
"title": ""
},
{
"docid": "c5342489255de93c2f8d603fcf868f51",
"score": "0.5546093",
"text": "def conditional_statement\n self[1] if %i[if unless elsif ifop if_mod unless_mod].include? sexp_type\n end",
"title": ""
},
{
"docid": "b006f9dd5b81d7c5e985b86766a8089a",
"score": "0.55417544",
"text": "def bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n\n\n\n type = BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 39:7: 'bool'\n match( \"bool\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 4 )\n\n\n end",
"title": ""
},
{
"docid": "6d2b243e5e91467886f7fe160eaae851",
"score": "0.5534169",
"text": "def make_true; end",
"title": ""
},
{
"docid": "6d2b243e5e91467886f7fe160eaae851",
"score": "0.5534169",
"text": "def make_true; end",
"title": ""
},
{
"docid": "bc27a6b2562ab179446282309242410c",
"score": "0.55329406",
"text": "def conjunction?\n true\n end",
"title": ""
},
{
"docid": "bc27a6b2562ab179446282309242410c",
"score": "0.55329406",
"text": "def conjunction?\n true\n end",
"title": ""
},
{
"docid": "96ad4d0844230ed8eaa3aa8c424cb9a2",
"score": "0.55307966",
"text": "def conditional_level; end",
"title": ""
},
{
"docid": "96ad4d0844230ed8eaa3aa8c424cb9a2",
"score": "0.55307966",
"text": "def conditional_level; end",
"title": ""
},
{
"docid": "c7730dfd5114eaaa8dc2c5d897d3e009",
"score": "0.5527277",
"text": "def parse_condition\n condition = nil\n\n # Right now we can handle very simple unary conditions like:\n # if true\n # if false\n # if 0\n # if 100 (not 0)\n # if defined? SOME_CONSTANT\n #\n # The last case will do a lookup in the registry and then one\n # in the Ruby world (using eval).\n case statement.condition.type\n when :int\n condition = statement.condition[0] != \"0\"\n when :defined\n # defined? keyword used, let's see if we can look up the name\n # in the registry, then we'll try using Ruby's powers. eval() is not\n # *too* dangerous here since code is not actually executed.\n arg = statement.condition.first\n\n if arg.type == :var_ref\n name = arg.source\n obj = YARD::Registry.resolve(namespace, name, true)\n\n begin\n condition = true if obj || (name && Object.instance_eval(\"defined? #{name}\"))\n rescue SyntaxError, NameError\n condition = false\n end\n end\n when :var_ref\n var = statement.condition[0]\n if var == s(:kw, \"true\")\n condition = true\n elsif var == s(:kw, \"false\")\n condition = false\n end\n end\n\n # Invert an unless condition\n if statement.type == :unless || statement.type == :unless_mod\n condition = !condition unless condition.nil?\n end\n condition\n end",
"title": ""
},
{
"docid": "7e72d3bd49986cdbd3169396649258f4",
"score": "0.5521777",
"text": "def compile_if(form, lexical_vars, in_tail_pos)\n if form.count == 4\n test_expr, on_true_expr, on_false_expr = destructure_form(form, 3)\n\n test_clause = compile(test_expr, lexical_vars, false)\n true_clause = compile(on_true_expr, lexical_vars, in_tail_pos)\n false_clause = compile(on_false_expr, lexical_vars, in_tail_pos)\n\n \"(#{test_clause} ? #{true_clause} : #{false_clause})\"\n else\n # Partial application falls back to normal application\n compile_application(form, lexical_vars, in_tail_pos)\n end\n end",
"title": ""
},
{
"docid": "10b048bbb7d6b5245eea904e4dc1ffd6",
"score": "0.5515595",
"text": "def conditionalize(cond, negate=false)\n case cond\n when Nil, False\n negate ? \"true\" : \"false\"\n when True, StringLiteral, NumberLiteral #...\n negate ? \"false\" : \"true\"\n else\n @local_scope.with_temporary_variable {|temp_var|\n str = cond.javascript(:expression)\n tmp = encode(temp_var)\n \"(#{tmp}=(#{str}),#{cond_is(tmp, !negate)})\"\n }\n end\n end",
"title": ""
},
{
"docid": "6130468e64b3d6c868ade7f8e4507734",
"score": "0.55130243",
"text": "def true!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n type = TRUE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 376:8: 'true'\n match( \"true\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 22 )\n\n end",
"title": ""
},
{
"docid": "f1b4f17862052034d46c917a0abe52f2",
"score": "0.5510095",
"text": "def condition_expr\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 199 )\n return_value = ConditionExprReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_expr_start_index = @input.index\n\n root_0 = nil\n condition_exists1073 = nil\n condition_is1074 = nil\n condition_comparison1075 = nil\n condition_group_comparison1076 = nil\n condition_in1077 = nil\n condition_is_a_set1078 = nil\n condition_is_any1079 = nil\n condition_is_empty1080 = nil\n condition_is_of_type1081 = nil\n condition_is_present1082 = nil\n condition_like1083 = nil\n condition_memeber1084 = nil\n condition_between1085 = nil\n condition_regexp_like1086 = nil\n condition_submultiset1087 = nil\n condition_equals_path1088 = nil\n condition_under_path1089 = nil\n condition_paren1090 = nil\n\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n # at line 1040:2: ( condition_exists | condition_is | condition_comparison | condition_group_comparison | condition_in | condition_is_a_set | condition_is_any | condition_is_empty | condition_is_of_type | condition_is_present | condition_like | condition_memeber | condition_between | condition_regexp_like | condition_submultiset | condition_equals_path | condition_under_path | condition_paren )\n alt_281 = 18\n alt_281 = @dfa281.predict( @input )\n case alt_281\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1040:4: condition_exists\n @state.following.push( TOKENS_FOLLOWING_condition_exists_IN_condition_expr_6511 )\n condition_exists1073 = condition_exists\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_exists1073.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1041:4: condition_is\n @state.following.push( TOKENS_FOLLOWING_condition_is_IN_condition_expr_6516 )\n condition_is1074 = condition_is\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_is1074.tree )\n end\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1042:4: condition_comparison\n @state.following.push( TOKENS_FOLLOWING_condition_comparison_IN_condition_expr_6521 )\n condition_comparison1075 = condition_comparison\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_comparison1075.tree )\n end\n\n when 4\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1043:4: condition_group_comparison\n @state.following.push( TOKENS_FOLLOWING_condition_group_comparison_IN_condition_expr_6526 )\n condition_group_comparison1076 = condition_group_comparison\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_group_comparison1076.tree )\n end\n\n when 5\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1044:4: condition_in\n @state.following.push( TOKENS_FOLLOWING_condition_in_IN_condition_expr_6531 )\n condition_in1077 = condition_in\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_in1077.tree )\n end\n\n when 6\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1045:4: condition_is_a_set\n @state.following.push( TOKENS_FOLLOWING_condition_is_a_set_IN_condition_expr_6536 )\n condition_is_a_set1078 = condition_is_a_set\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_is_a_set1078.tree )\n end\n\n when 7\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1046:4: condition_is_any\n @state.following.push( TOKENS_FOLLOWING_condition_is_any_IN_condition_expr_6541 )\n condition_is_any1079 = condition_is_any\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_is_any1079.tree )\n end\n\n when 8\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1047:4: condition_is_empty\n @state.following.push( TOKENS_FOLLOWING_condition_is_empty_IN_condition_expr_6546 )\n condition_is_empty1080 = condition_is_empty\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_is_empty1080.tree )\n end\n\n when 9\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1048:4: condition_is_of_type\n @state.following.push( TOKENS_FOLLOWING_condition_is_of_type_IN_condition_expr_6551 )\n condition_is_of_type1081 = condition_is_of_type\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_is_of_type1081.tree )\n end\n\n when 10\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1049:4: condition_is_present\n @state.following.push( TOKENS_FOLLOWING_condition_is_present_IN_condition_expr_6556 )\n condition_is_present1082 = condition_is_present\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_is_present1082.tree )\n end\n\n when 11\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1050:4: condition_like\n @state.following.push( TOKENS_FOLLOWING_condition_like_IN_condition_expr_6561 )\n condition_like1083 = condition_like\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_like1083.tree )\n end\n\n when 12\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1051:4: condition_memeber\n @state.following.push( TOKENS_FOLLOWING_condition_memeber_IN_condition_expr_6566 )\n condition_memeber1084 = condition_memeber\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_memeber1084.tree )\n end\n\n when 13\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1052:4: condition_between\n @state.following.push( TOKENS_FOLLOWING_condition_between_IN_condition_expr_6571 )\n condition_between1085 = condition_between\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_between1085.tree )\n end\n\n when 14\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1053:4: condition_regexp_like\n @state.following.push( TOKENS_FOLLOWING_condition_regexp_like_IN_condition_expr_6576 )\n condition_regexp_like1086 = condition_regexp_like\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_regexp_like1086.tree )\n end\n\n when 15\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1054:4: condition_submultiset\n @state.following.push( TOKENS_FOLLOWING_condition_submultiset_IN_condition_expr_6581 )\n condition_submultiset1087 = condition_submultiset\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_submultiset1087.tree )\n end\n\n when 16\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1055:4: condition_equals_path\n @state.following.push( TOKENS_FOLLOWING_condition_equals_path_IN_condition_expr_6586 )\n condition_equals_path1088 = condition_equals_path\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_equals_path1088.tree )\n end\n\n when 17\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1056:4: condition_under_path\n @state.following.push( TOKENS_FOLLOWING_condition_under_path_IN_condition_expr_6591 )\n condition_under_path1089 = condition_under_path\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_under_path1089.tree )\n end\n\n when 18\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1057:4: condition_paren\n @state.following.push( TOKENS_FOLLOWING_condition_paren_IN_condition_expr_6596 )\n condition_paren1090 = condition_paren\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_paren1090.tree )\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 199 )\n memoize( __method__, condition_expr_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "b2ea4f89709fb369302fd37bab6ac2b5",
"score": "0.5503553",
"text": "def t__9!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n type = T__9\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 7:8: 'and'\n match( \"and\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n end",
"title": ""
},
{
"docid": "78dd822b5fb8d38b59d7c22abdb4ecd2",
"score": "0.54967207",
"text": "def met\n\t\t@cond_met = COND_MET\n\tend",
"title": ""
}
] |
a4f1ecdbe2437d8f2e75dff9661946a9 | Instantiates a new securityRegistryKeyEvidence and sets the default values. | [
{
"docid": "de3eabd13dae01d22303017926f54e09",
"score": "0.6641544",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.registryKeyEvidence\"\n end",
"title": ""
}
] | [
{
"docid": "ec6ee7167886b962f225179e8b0a3cf4",
"score": "0.59963787",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.containerRegistryEvidence\"\n end",
"title": ""
},
{
"docid": "2fe69a61f50a06ed2337008dc7eaef3a",
"score": "0.54894865",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.kubernetesSecretEvidence\"\n end",
"title": ""
},
{
"docid": "fb44067f415bd80762f364d9b103ae37",
"score": "0.5467983",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.googleCloudResourceEvidence\"\n end",
"title": ""
},
{
"docid": "a89cd482ac466908a7a6b53eff062718",
"score": "0.5439636",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.amazonResourceEvidence\"\n end",
"title": ""
},
{
"docid": "385d1d40c9ef3326f65034b5455e48f1",
"score": "0.5341142",
"text": "def create_default_key_reader\n @key_reader = DefaultKeyReader.new self\n end",
"title": ""
},
{
"docid": "5796e6ec31450b32bcebd79a5d97ba4b",
"score": "0.5237701",
"text": "def initialize(keyid = nil, vcode = nil, scope=\"account\")\n keyid ||= EAAL.config.keyid\n vcode ||= EAAL.config.vcode\n scope = EAAL.config.scope if EAAL.config.scope\n self.keyid = keyid.to_s\n self.vcode = vcode.to_s\n self.scope = scope.to_s\n end",
"title": ""
},
{
"docid": "e914bbd2666a4d643412f058558162a7",
"score": "0.52372473",
"text": "def initialize\n key_pair = ECDSA.generate_key_pair\n self.private_key, self.public_key = key_pair.values_at(:private_key, :public_key)\n end",
"title": ""
},
{
"docid": "7e4bbe1d4e28ddd6b3d1b07f24904d2f",
"score": "0.5228704",
"text": "def initialize(seed)\n Ed25519.validate_key_bytes(seed)\n\n @seed = seed\n @keypair = Ed25519.provider.create_keypair(seed)\n @verify_key = VerifyKey.new(@keypair[32, 32])\n end",
"title": ""
},
{
"docid": "9a3564489cc52310bc850809b70b079d",
"score": "0.5152746",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.azureResourceEvidence\"\n end",
"title": ""
},
{
"docid": "edd77341679e267c292fd1724e28faed",
"score": "0.50937045",
"text": "def init_keystore\n @ks = Hash.new\n @ks[:serial] = 0\n @ks[:family] = Hash.new\n save\n end",
"title": ""
},
{
"docid": "7df6c511169a88ddf5cd7522446a6cc0",
"score": "0.5083019",
"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": ""
},
{
"docid": "2a8ae12721e8c333eff3348c5d4dd463",
"score": "0.5078783",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.processEvidence\"\n end",
"title": ""
},
{
"docid": "d96c760fad7c36055c2e648e122060f0",
"score": "0.5066817",
"text": "def initialize(key=nil)\n super\n end",
"title": ""
},
{
"docid": "95167b2848b3be3aa1710141634d45f8",
"score": "0.5048844",
"text": "def load(key, *dig_keys, **options)\n super\n options[:default]\n end",
"title": ""
},
{
"docid": "a821bcdebd8049e854011c1f45e0ecf8",
"score": "0.50176525",
"text": "def initialize(env, key)\n @env = env\n @key = key\n end",
"title": ""
},
{
"docid": "b00013f53986564ed4223cfe5f352955",
"score": "0.4988793",
"text": "def x509_initvar\n @x509_sign_and_crypt_method ||= @@default_x509_sign_and_crypt_method\n @x509_sign ||= @@default_x509_sign\n @x509_crypt ||= @@default_x509_crypt\n @x509_crypt_cert ||= @@default_x509_crypt_cert\n @x509_crypt_cipher ||= @@default_x509_crypt_cipher\n @x509_sign_cert ||= @@default_x509_sign_cert\n @x509_key ||= @@default_x509_sign_key\n @x509_sign_passphrase ||= @@default_x509_sign_passphrase\n end",
"title": ""
},
{
"docid": "b00013f53986564ed4223cfe5f352955",
"score": "0.4988793",
"text": "def x509_initvar\n @x509_sign_and_crypt_method ||= @@default_x509_sign_and_crypt_method\n @x509_sign ||= @@default_x509_sign\n @x509_crypt ||= @@default_x509_crypt\n @x509_crypt_cert ||= @@default_x509_crypt_cert\n @x509_crypt_cipher ||= @@default_x509_crypt_cipher\n @x509_sign_cert ||= @@default_x509_sign_cert\n @x509_key ||= @@default_x509_sign_key\n @x509_sign_passphrase ||= @@default_x509_sign_passphrase\n end",
"title": ""
},
{
"docid": "4c4578fabd93571ed7c41b63fdc495f4",
"score": "0.49812707",
"text": "def initialize(seed, encoding = :raw)\n seed = Encoder[encoding].decode(seed)\n\n Util.check_length(seed, NaCl::SECRETKEYBYTES, \"seed\")\n\n pk = Util.zeros(NaCl::PUBLICKEYBYTES)\n sk = Util.zeros(NaCl::SECRETKEYBYTES * 2)\n\n NaCl.crypto_sign_seed_keypair(pk, sk, seed) || raise(CryptoError, \"Failed to generate a key pair\")\n\n @seed, @signing_key = seed, sk\n @verify_key = VerifyKey.new(pk)\n end",
"title": ""
},
{
"docid": "3ec78d03f65f06d154f9711527e24341",
"score": "0.49682468",
"text": "def initialize(key)\n @key = key.to_sym\n @defaults = {}\n @file = []\n @validator = nil\n @children = {}\n @env = {}\n end",
"title": ""
},
{
"docid": "3bee6d9054e0e817f9a027e9296f96d2",
"score": "0.49636632",
"text": "def load_or_initialize_site_keys\n case\n when defined? REST_AUTH_SITE_KEY\n if (options[:old_passwords]) && ((! REST_AUTH_SITE_KEY.blank?) || (REST_AUTH_DIGEST_STRETCHES != 1))\n raise \"You have a site key, but --old-passwords will overwrite it. If this is really what you want, move the file #{site_keys_file} and re-run.\"\n end\n $rest_auth_site_key_from_generator = REST_AUTH_SITE_KEY\n $rest_auth_digest_stretches_from_generator = REST_AUTH_DIGEST_STRETCHES\n when options[:old_passwords]\n $rest_auth_site_key_from_generator = nil\n $rest_auth_digest_stretches_from_generator = 1\n $rest_auth_keys_are_new = true\n else\n $rest_auth_site_key_from_generator = make_token\n $rest_auth_digest_stretches_from_generator = 10\n $rest_auth_keys_are_new = true\n end\n end",
"title": ""
},
{
"docid": "4d9c76e7c454be3484ce6133aaa6ce2d",
"score": "0.49626574",
"text": "def initialize(key_value)\n @key_value = key_value\n end",
"title": ""
},
{
"docid": "3274b2dd03bd35b816a0a0191ee6ea44",
"score": "0.49594533",
"text": "def initialize(options)\n super\n self.verified_key = false\n end",
"title": ""
},
{
"docid": "ada8c3a5c2aef5a63faf9d463221a279",
"score": "0.49477148",
"text": "def initialize_default_values!\n Marshal.load(Marshal.dump(self.class.default_values)).each do |k, v|\n self[k] ||= v\n end\n end",
"title": ""
},
{
"docid": "e0a6f297bfd5823279580a333eb88fb2",
"score": "0.49391967",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.oauthApplicationEvidence\"\n end",
"title": ""
},
{
"docid": "3f1cc68abd1d88d0e6e2b1ccfccd4354",
"score": "0.49348125",
"text": "def add_default_verifiers\n public_key_bytes = Crypto::Bytes.from_base64(SERVICE_PUBLIC_KEY)\n public_key = crypto.import_public_key(public_key_bytes)\n @verifiers[SERVICE_CARD_ID] = public_key\n end",
"title": ""
},
{
"docid": "66406f3bdfe2947002ae011c52749c1a",
"score": "0.4930067",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.kubernetesPodEvidence\"\n end",
"title": ""
},
{
"docid": "15086e4525ce21dc76e67a499e01d925",
"score": "0.49227643",
"text": "def initialize(key_encrypting_key:, key_env_var:, encoding: :base64strict)\n @key_env_var = key_env_var\n @key_encrypting_key = key_encrypting_key\n @encoding = encoding\n end",
"title": ""
},
{
"docid": "29712ba2d8985d0c1db9747098aecaab",
"score": "0.49081612",
"text": "def initialize( key_string = nil )\n self.key_string = key_string\n end",
"title": ""
},
{
"docid": "6221447cf2db24928eb06ed52a09f73a",
"score": "0.48932168",
"text": "def initialize(key_base64)\n @key = key_base64\n end",
"title": ""
},
{
"docid": "c82488c8e80bcc4a48b86ceb1da25498",
"score": "0.48862016",
"text": "def initialize(issuer, scope, key)\n self.issuer = issuer\n self.scope = scope\n self.expiry = 60 # 1 min default \n self.key = key\n end",
"title": ""
},
{
"docid": "b9966dd60d6499827b1f104491c2d404",
"score": "0.48539874",
"text": "def add_default_values\n ensure_license\n ensure_publisher\n ensure_resource_type\n end",
"title": ""
},
{
"docid": "f3080f7355a8adc636f967bf38d61936",
"score": "0.48419312",
"text": "def initialize(domain)\n @domain = domain\n @key = OpenSSL::PKey::RSA.new(2048)\n @cert = generate\n end",
"title": ""
},
{
"docid": "9ae47d2df05c2692c205b1db69019690",
"score": "0.4840561",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.mailClusterEvidence\"\n end",
"title": ""
},
{
"docid": "c35ff7ec54c55f7fd6c7dee649e7beaa",
"score": "0.48322698",
"text": "def initialize(key, expiration_time = 10.minutes)\n @key = key\n @expiration_time = expiration_time\n end",
"title": ""
},
{
"docid": "70a6a342385af43ad75c94f3b92ebb5f",
"score": "0.48314077",
"text": "def init\n c = Config['session'] || {}\n @name = (c['name'] || 'spare_me_plz').to_s\n\n if c['key']\n @dsa = OpenSSL::PKey::DSA.new c['key']\n else\n @dsa = OpenSSL::PKey::DSA.generate 256\n end\n\n # DSA can sign on any digest since 1.0.0\n @dss = OpenSSL::VERSION >= '1.0.0' ? OpenSSL::Digest::SHA256 : OpenSSL::Digest::DSS1\n\n @cipher_key = pad_256_bit c['cipher_key']\n end",
"title": ""
},
{
"docid": "e0ac8bb8db2a675dd6b6f9b6462fe701",
"score": "0.4815806",
"text": "def initialize(options = {})\n require_options(options, [:name, :key_name, :image_id])\n @name = options[:name]\n @key_name = options[:key_name]\n @image_id = options[:image_id]\n @instance_type = options[:instance_type]\n @security_groups = options[:security_groups]\n end",
"title": ""
},
{
"docid": "c2e0d9f8de9792ad39680fed01ffd328",
"score": "0.48130053",
"text": "def initialize(verbose = true)\n\n @verbose = verbose\n\n @open_ssl_tool_path = \"/usr/bin/openssl\"\n @plistbuddy_tool_path = \"/usr/libexec/PlistBuddy\"\n @evroots_config_path = File.join(CertTools.certificate_dir, \"CertificateTool/BuildOSXRootKeychain/evroot.config\")\n @evroots_config_data = nil\n\n Utilities.check_path(@evroots_config_path, false)\n\n @evroots_kc_name = \"EVRoots.keychain\"\n @evroots_kc_path = File.join(CertTools.build_dir, @evroots_kc_name)\n\n @evroots_plist_name = \"EVRoots.plist\"\n @evroots_plist_path = File.join(CertTools.output_keychain_path, @evroots_plist_name)\n\n end",
"title": ""
},
{
"docid": "b592d0da018e7eac81dd5c6c181e9961",
"score": "0.47992787",
"text": "def initialize(*)\n super\n\n @encrypted_env_key = \"ENCRYPTED_#{env_key}\"\n @encrypted_key_path = \"#{key_path}.enc\"\n end",
"title": ""
},
{
"docid": "1acd276514c3690aff8a239faf5ddc4f",
"score": "0.4784796",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.fileEvidence\"\n end",
"title": ""
},
{
"docid": "85e45ca6c609a91c758bd8dcf40e7e67",
"score": "0.47616705",
"text": "def initialize(key)\n\t\t@key = key\n\tend",
"title": ""
},
{
"docid": "4e802782cae722183d656748f04abc13",
"score": "0.47582355",
"text": "def initialize(domain_key)\n fail ArgumentError, 'Domain key cannot be nil' if domain_key.nil?\n fail ArgumentError, 'Domain key must be of type string' if domain_key.class.to_s != 'String'\n @domain_key = domain_key\n end",
"title": ""
},
{
"docid": "12576d7957e290dae295c66f33fb98a2",
"score": "0.47338745",
"text": "def initialize(options = {})\n options = options.symbolize_keys\n options.assert_valid_keys(\n :private_key_file,\n :public_key_file,\n :key,\n :algorithm\n )\n options.reverse_merge!(\n :private_key_file => @@default_private_key_file,\n :public_key_file => @@default_public_key_file,\n :algorithm => @@default_algorithm\n )\n \n @public_key = @private_key = nil\n @key = options[:key]\n @algorithm = options[:algorithm]\n \n self.private_key_file = options[:private_key_file]\n self.public_key_file = options[:public_key_file]\n \n super()\n end",
"title": ""
},
{
"docid": "1a27411b69696536087ef794b7148d8b",
"score": "0.47285065",
"text": "def initialize(site_key, api_key, options = {})\n @url_safe = !options.key?(:url_safe) || options[:url_safe]\n @crypto_key = EzCrypto::Key.with_password(site_key, api_key)\n end",
"title": ""
},
{
"docid": "fa2d02e80437fdd20279cf2ac8f6ba34",
"score": "0.47262263",
"text": "def initialize(private_key, options = {})\n @passphrase = options[:passphrase]\n @comment = options[:comment] || \"\"\n self.directives = options[:directives] || []\n\n begin\n @key_object = OpenSSL::PKey::RSA.new(private_key, passphrase)\n @type = \"rsa\"\n @typestr = \"ssh-rsa\"\n rescue OpenSSL::PKey::RSAError\n @type = nil\n end\n\n return if @type\n\n begin\n @key_object = OpenSSL::PKey::DSA.new(private_key, passphrase)\n @type = \"dsa\"\n @typestr = \"ssh-dss\"\n rescue OpenSSL::PKey::DSAError\n @type = nil\n end\n\n return if @type\n\n @key_object = OpenSSL::PKey::EC.new(private_key, passphrase)\n @type = \"ecdsa\"\n bits = ECDSA_CURVES.invert[@key_object.group.curve_name]\n @typestr = \"ecdsa-sha2-nistp#{bits}\"\n end",
"title": ""
},
{
"docid": "4a382f81b879ee875b25e5320b25bec2",
"score": "0.4718585",
"text": "def initialize(_kv_id, _pool_id)\n @kv_id = _kv_id\n @pool_id = _pool_id\n end",
"title": ""
},
{
"docid": "b17ebff7a7e089b5c66ba428c0a733bd",
"score": "0.47143137",
"text": "def initialize(k, v)\n\t\t\tsuper()\n\t\t\t@k = k\n\t\t\t@v = v\n\t\t\treturn\n\t\tend",
"title": ""
},
{
"docid": "91cd85b9f1b98825eb52299a772cabed",
"score": "0.47052652",
"text": "def initialize(key)\n @key = key\n end",
"title": ""
},
{
"docid": "91cd85b9f1b98825eb52299a772cabed",
"score": "0.47052652",
"text": "def initialize(key)\n @key = key\n end",
"title": ""
},
{
"docid": "5d30cf683cc6ce61bb0c26cf0c295e46",
"score": "0.46896353",
"text": "def set_keys\n if self.private_changed? and self.private\n if self.moderator_key.blank?\n self.moderator_key = SecureRandom.hex(4)\n end\n if self.attendee_key.blank?\n self.attendee_key = SecureRandom.hex(4)\n end\n end\n end",
"title": ""
},
{
"docid": "c0285e03f4eaf29a3265a9d6cf1c0ba1",
"score": "0.4651589",
"text": "def initialize(key, value)\n raise ArgumentError.new(\"key cannot be nil\") if key.nil?\n raise ArgumentError.new(\"value cannot be nil\") if value.nil?\n \n @key = key\n @value = value\n end",
"title": ""
},
{
"docid": "2514106da9e762149bc69e64719c3ee7",
"score": "0.46145517",
"text": "def initialize(attributes = {})\n attributes[:api_key] = SecureRandom.hex(32)\n super\n end",
"title": ""
},
{
"docid": "2e28719cb185bc0d3d8b7b2a470f5f72",
"score": "0.46094093",
"text": "def initialize(source_hash = T.unsafe(nil), default = T.unsafe(nil), &blk); end",
"title": ""
},
{
"docid": "a24eaeea6c13c1f5aa02cee820fea5a1",
"score": "0.45960405",
"text": "def initialize(key, ttl:)\n @key = key.to_s\n @ttl = ttl.to_i\n @drift = @ttl * 0.01 + 2.0\n @nonce = SecureRandom.uuid\n end",
"title": ""
},
{
"docid": "9242a5d69d6109e364e54adb9ac9654f",
"score": "0.45953786",
"text": "def set_key(exponent_hex_string, modulus_hex_string)\n @key = RsaKey.new exponent_hex_string, modulus_hex_string\n end",
"title": ""
},
{
"docid": "485450cc538e2352e4d45b038550d80c",
"score": "0.45904198",
"text": "def set_default_exuid\n self.exuid ||=\n SecureRandom.random_bytes(8).unpack('Q').first & 0x7fffffffffffffff\n end",
"title": ""
},
{
"docid": "1b10eb8edd8947f9fa021c2e49ae817d",
"score": "0.45860657",
"text": "def default_key_params(\n name: \"\",\n email: nil,\n comment: \"\",\n creation_date: Time.now,\n key_validity_seconds: 1.year\n )\n case creation_date\n when DateTime, Time, Date then creation_date\n else raise ArgumentError,\n \"creation_date: has to be a DateTime/Time/Date\"\n end\n\n expiration_date = if key_validity_seconds.present?\n date_format(creation_date + key_validity_seconds)\n end\n\n userid = \"#{name}#{comment.present? ? \" (#{comment})\" : ''}#{email.present? ? \" <#{email}>\" : ''}\".strip\n key_params(userid: userid, expiration_date: expiration_date)\n end",
"title": ""
},
{
"docid": "6eff1c22d08e761fa60e70a48e4a3f66",
"score": "0.45812815",
"text": "def initialize(key, options = {})\n @key = sanitize_key(key)\n @default = options[:default]\n @options = options\n @on_change = options[:on_change]\n\n if @default && !redis.exists(self.key)\n redis.set key, self.class.cast_to_redis(@default, @options)\n end\n end",
"title": ""
},
{
"docid": "92e61bb060041dc8b4a8f35c5fd59359",
"score": "0.45751163",
"text": "def set_default_exuid\n self.exuid ||=\n Base32.encode(SecureRandom.random_bytes(16)).downcase.sub(/=*$/, '')\n end",
"title": ""
},
{
"docid": "19d1ebe62284b7a6c7b3c8b6a13640e7",
"score": "0.45727423",
"text": "def initialize(path)\n raise ArgumentError, \"Invalid registry key: #{path}\" unless path.include?('\\\\')\n\n # valuename appears after the the first double backslash\n path, @valuename = path.split('\\\\\\\\', 2)\n # no \\\\ but there is at least a single \\ to split on\n path, _, @valuename = path.rpartition('\\\\') if @valuename.nil?\n @is_default = @valuename.empty?\n\n super(path)\n end",
"title": ""
},
{
"docid": "fbae92b3d680772e06f3dbcf3a76d67e",
"score": "0.4567978",
"text": "def initialize()\n\t\t\t#set key by hash unique value\n\t\t\t@key = Digest::SHA1.hexdigest(Time.now.to_s)\n\t\tend",
"title": ""
},
{
"docid": "e575a045d4d59e1ecac58a01cbeef6c6",
"score": "0.45624924",
"text": "def initialize(*_)\n super\n unless arguments[:salt]\n arguments[:salt] = OpenSSL::Random.random_bytes(16)\n end\n unless arguments[:key]\n raise ArgumentError.new \"Required `:key` argument unset for `Safe::Ssl`!\"\n end\n end",
"title": ""
},
{
"docid": "000a3e26d15d7bf6b518637884235104",
"score": "0.45618254",
"text": "def initialize(event_name, date)\n @key = build_key(event_name, time_format(date))\n end",
"title": ""
},
{
"docid": "8db2960020b49d642089ffe96233fac9",
"score": "0.45564923",
"text": "def initialize\n set_defaults\n end",
"title": ""
},
{
"docid": "8db2960020b49d642089ffe96233fac9",
"score": "0.45564923",
"text": "def initialize\n set_defaults\n end",
"title": ""
},
{
"docid": "bf0457d300137c9a78e6bfc10fae56f5",
"score": "0.45482543",
"text": "def init\n c = Config['session'] ? Config['session'].dup : {}\n @name = Ext.escape (c.delete('name') || 'spare_me_plz').to_s, false\n\n if c['key']\n @dsa = OpenSSL::PKey::DSA.new c.delete 'key'\n else\n @dsa = generate_key\n end\n\n # DSA can sign on any digest since 1.0.0\n @dss = OpenSSL::VERSION >= '1.0.0' ? OpenSSL::Digest::SHA256 : OpenSSL::Digest::DSS1\n\n @cipher_key = pad_256_bit c.delete 'cipher_key'\n\n @expire = c.delete('expire') || c.delete('expires')\n @secure = c.delete('secure')\n\n unless c.empty?\n raise \"unknown options in Nyara::Config[:session]: #{c.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "2882e173cc82fae5d2e0584801fd5a4c",
"score": "0.45462546",
"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": "134fd2ae90e602f389622f2302f57cab",
"score": "0.4546182",
"text": "def test_initialize_default\n keyfile = AuthorizedKeysFile.new(@container)\n assert_same(@container, keyfile.container, \n 'AuthorizedKeysFile container not set correctly')\n assert_equal(@username, keyfile.username, \n 'AuthorizedKeysFile username not set correctly')\n assert_equal(@homedir + \"/.ssh/authorized_keys\", keyfile.filename, \n 'AuthorizedKeysFile filename not set correctly')\n assert_equal('/bin/bash', @container.container_plugin.gear_shell, \n 'AuthorizedKeysFile container shell not set correctly')\n end",
"title": ""
},
{
"docid": "65cb591db790aa3e73b16593686cb8c9",
"score": "0.4541399",
"text": "def initialize(verbose = true)\n @verbose = verbose\n \n @root_cert_file_name = \"SystemRootCertificates.keychain\"\n @root_cert_kc_path = File.join(CertTools.output_keychain_path, @root_cert_file_name)\n\n @settings_file_name = \"SystemTrustSettings.plist\"\n @setting_file_path = File.join(CertTools.output_keychain_path, @settings_file_name)\n\n @temp_kc_name = \"SystemTempCertificates.keychain\"\n @temp_kc_path = File.join(CertTools.build_dir, @temp_kc_name)\n\n end",
"title": ""
},
{
"docid": "cc4d8296caca2588312377f1e9e9940b",
"score": "0.453838",
"text": "def initialize(attrs = {})\n @attributes = {}.with_indifferent_access\n process(defaults.merge(attrs))\n @new_record = true if id.nil?\n generate_key\n end",
"title": ""
},
{
"docid": "9d3f651eeb4d3507351e08ce0e0cd423",
"score": "0.45321232",
"text": "def initialize\n @name = \"\"\n @public_key = nil\n @private_key = nil\n @admin = false\n @validator = false\n @create_key = nil\n end",
"title": ""
},
{
"docid": "4122a9b1da121e2224f8e7c0a2ebb8f1",
"score": "0.45315123",
"text": "def initialize(options = {})\n invalid_options = options.keys - [:private_key_file, :public_key_file, :algorithm, :password]\n raise ArgumentError, \"Unknown key(s): #{invalid_options.join(\", \")}\" unless invalid_options.empty?\n \n options = {\n :private_key_file => AsymmetricCipher.default_private_key_file,\n :public_key_file => AsymmetricCipher.default_public_key_file\n }.merge(options)\n \n @public_key = @private_key = nil\n \n self.private_key_file = options[:private_key_file]\n self.public_key_file = options[:public_key_file]\n raise ArgumentError, 'At least one key file must be specified (:private_key_file or :public_key_file)' unless private_key_file || public_key_file\n \n self.algorithm = options[:algorithm]\n self.password = options[:password]\n \n super()\n end",
"title": ""
},
{
"docid": "ce52113a61187ea67b3454547a99c6be",
"score": "0.4530328",
"text": "def initialize\n @codice_fiscale = CodiceFiscaleConfiguration.new\n @cap_lookup = CapLookupConfiguration.new\n end",
"title": ""
},
{
"docid": "fc1c8385488b79c433b0ccdea509ee83",
"score": "0.4522585",
"text": "def initialize(qualified_key, opts = {})\n @qualified_key = qualified_key\n @service_instance = opts[:service_instance]\n end",
"title": ""
},
{
"docid": "313bac4abe30cf307f6efad71027b9e5",
"score": "0.45186445",
"text": "def initialize(key)\n key ||= Apicasso::Key.new\n cannot :manage, :all\n cannot :read, :all\n key.scope&.each do |permission, klasses_clearances|\n build_permissions(permission: permission, clearance: klasses_clearances)\n end\n end",
"title": ""
},
{
"docid": "e1aaeccd20c81c564988fff952b463c2",
"score": "0.45170042",
"text": "def initialize(id, site_name, description, riskfactor = 1)\n\t\t@id = id\n\t\t@site_name = site_name\n\t\t@description = description\n\t\t@riskfactor = riskfactor\n\tend",
"title": ""
},
{
"docid": "5e2dbc18e2e5b7279feb11b6b17a92d5",
"score": "0.4508026",
"text": "def initialize(key, attrs = {})\n self.key = key\n self.attributes = attrs\n end",
"title": ""
},
{
"docid": "5e2dbc18e2e5b7279feb11b6b17a92d5",
"score": "0.4508026",
"text": "def initialize(key, attrs = {})\n self.key = key\n self.attributes = attrs\n end",
"title": ""
},
{
"docid": "182cceeff9cd2e4d6e42a1cf6180bd10",
"score": "0.45061487",
"text": "def initialize\n @key_files = []\n @host_key_files = []\n @use_agent = true\n @agent = nil\n end",
"title": ""
},
{
"docid": "4b8f2dcd5134a9030a3445f1508e70db",
"score": "0.4503734",
"text": "def initialize(aws_access_key_id=nil, aws_secret_access_key=nil, params={})\n init({ :name => 'EC2', \n :default_host => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).host : DEFAULT_HOST, \n :default_port => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).port : DEFAULT_PORT,\n :default_service => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).path : DEFAULT_PATH, \n :default_protocol => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).scheme : DEFAULT_PROTOCOL }, \n aws_access_key_id || ENV['AWS_ACCESS_KEY_ID'] , \n aws_secret_access_key|| ENV['AWS_SECRET_ACCESS_KEY'],\n params)\n end",
"title": ""
},
{
"docid": "0e182cfc9a96eba5a737929db33a59bf",
"score": "0.44891262",
"text": "def initialize(aws_access_key_id=nil, aws_secret_access_key=nil, params={})\n init({ :name => 'EC2',\n :default_host => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).host : DEFAULT_HOST,\n :default_port => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).port : DEFAULT_PORT,\n :default_service => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).path : DEFAULT_PATH,\n :default_protocol => ENV['EC2_URL'] ? URI.parse(ENV['EC2_URL']).scheme : DEFAULT_PROTOCOL,\n :default_api_version => @@api },\n aws_access_key_id || ENV['AWS_ACCESS_KEY_ID'] , \n aws_secret_access_key|| ENV['AWS_SECRET_ACCESS_KEY'],\n params)\n end",
"title": ""
},
{
"docid": "4295f29fae4e43d547273029106acaa5",
"score": "0.44879594",
"text": "def default_key=(key)\n if @identity_map.key(key)\n @default_key = key\n else\n raise TypeError.new(\"Default key must already exist\")\n end\n end",
"title": ""
},
{
"docid": "2fb10d3507868477db15cb7eddd44cf9",
"score": "0.44874257",
"text": "def initialize(key = \"12345\", date = DateTime.now.strftime('%d%m%y').to_s)\n @key = key\n @date = date\n end",
"title": ""
},
{
"docid": "1184984b441662bb2385269a2309819f",
"score": "0.44828916",
"text": "def initialize(key, properties = nil)\n raise ArgumentError, \"key argument is required\" if key.nil?\n\n @key = Key.wrap(key)\n @properties = Properties.wrap(properties)\n @open = false\n @opened_or_last_checked_at_epoch = 0\n end",
"title": ""
},
{
"docid": "886d2eb44ae382ee23019ba4b88794b4",
"score": "0.44737938",
"text": "def initialize(key)\n raise ArgumentError, 'An API key must be provided' if key.nil?\n @key = key\n end",
"title": ""
},
{
"docid": "0f68b2691971ae756db410ee0c1acd7f",
"score": "0.44716394",
"text": "def initialize(opts={}, prnt=Ec2.new)\n @uniquely_identifiable_by = [:ip, :name, :dns_name, :instance_id]\n @original_options = opts\n @my_cloud = prnt\n super(opts, prnt)\n find_myself(@uniquely_identifiable_by && opts.keys) if prnt.respond_to?(:describe_instances)\n end",
"title": ""
},
{
"docid": "da4525cd5249f6da1e3a26c8769be2cb",
"score": "0.4470604",
"text": "def initialize(params = nil)\n @env = Hash.new\n unless params.nil?\n params.each_pair { |var, typ|\n @env[var] = {type: typ, fixed: true}\n }\n end\n end",
"title": ""
},
{
"docid": "59a8b49913b3aaa33bf4257a9e11a443",
"score": "0.44669122",
"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": "0c41b44dbf29c48c5465341d777346e9",
"score": "0.44626614",
"text": "def set_uninitialized_defaults_as_instance_variables\n DEFAULTS.each do |k, v|\n var_name = \"@#{k}\".to_sym\n if instance_variable_get(var_name).nil?\n self.instance_variable_set(var_name, v)\n end\n end\n end",
"title": ""
},
{
"docid": "bcc16e3938419a020841faba02af7bff",
"score": "0.44564846",
"text": "def initialize(key, encoding = :raw)\n key = Encoder[encoding].decode(key)\n Util.check_length(key, NaCl::ED25519_VERIFYKEY_BYTES, \"key\")\n\n @key = key\n end",
"title": ""
},
{
"docid": "21e7fc98db83060ede462b5754f9ff79",
"score": "0.44563985",
"text": "def initialize(pubkey, privkey, ssl=false)\n @pubkey = pubkey\n @privkey = privkey\n @host = ssl ? 'www.google.com/recaptcha/api':'api.recaptcha.net'\n @vhost = 'api-verify.recaptcha.net'\n @proto = ssl ? 'https' : 'http'\n @ssl = ssl\n @last_error = nil\n end",
"title": ""
},
{
"docid": "6f072f1c8cba72e56c053dd4cda27a91",
"score": "0.4455872",
"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": "53d7ae3482cd93c461c23a2abd6608c5",
"score": "0.44431907",
"text": "def create_default_collection_event_parameters(rep)\n cep = parent.collection_event_parameters if parent\n user = cep.user if cep\n user ||= scg_collector || rep.user || return\n cep = CaTissue::CollectionEventParameters.new(:specimen => self, :user => user)\n logger.debug { \"Created default #{qp} collection event #{cep.qp}.\" }\n cep\n end",
"title": ""
},
{
"docid": "99f451db7433f128240eb38c57f12299",
"score": "0.44408086",
"text": "def initialize(key_type, value_type)\n super(value_type)\n @key_type = check_arg_type(key_type, 'key_type')\n end",
"title": ""
},
{
"docid": "b3b3e16198c98b92698c5369eea7cdbc",
"score": "0.4438378",
"text": "def initialize(key = nil, name = nil, repository = nil)\n @key = key\n @name = name\n @repository = repository || Vedeu.keymaps\n end",
"title": ""
},
{
"docid": "73a727616e0a494ffdc4adbad6a4781e",
"score": "0.4437938",
"text": "def initialize(default_key=nil)\n @items = HashWithIndifferentAccess.new { |hash, key| hash[key] = [] }\n @keys = [default_key.to_s].compact\n @items[default_key.to_s] = [] unless default_key.nil?\n end",
"title": ""
},
{
"docid": "7812d1abfe19268e49ea74a9aa872f78",
"score": "0.4437044",
"text": "def initialize(key, encoding = :raw)\n key = Encoder[encoding].decode(key)\n Util.check_length(key, NaCl::PUBLICKEYBYTES, \"key\")\n\n @key = key\n end",
"title": ""
},
{
"docid": "cad6173dbc168e730216a4fdbe9bbf42",
"score": "0.44243452",
"text": "def initialize(key, secret)\n super()\n self.key = key\n self.secret = secret\n end",
"title": ""
},
{
"docid": "f2c5a2952c4645121c738ca50c305fe6",
"score": "0.4411296",
"text": "def initialize(pvt_key_string)\n @pvt_key_string = pvt_key_string\n @pvt_key = PrivateKey.new pvt_key_string\n log 'pvt key', @pvt_key\n @address = @pvt_key.address_str\n log 'address', @address\n end",
"title": ""
},
{
"docid": "568807bff59ee70e23903cfd5b62f336",
"score": "0.4411028",
"text": "def initialize(kwargs = {})\n super({})\n DEFAULTS.merge(**kwargs).each { |k,v| self[k] = v }\n end",
"title": ""
},
{
"docid": "cc1472ddae36dfdb6e2ba8599b905951",
"score": "0.4401691",
"text": "def initialize(key, log: Loog::NULL)\n raise 'Key can\\'t be nil' if key.nil?\n @key = key\n raise 'Log can\\'t be nil' if log.nil?\n @log = log\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "328fbe27b69d2ed112a360d766e8b49c",
"score": "0.0",
"text": "def compchallenge_params\n params.fetch(:compchallenge, {})\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": ""
}
] |
5c66446129244e49ec8a6836cc28cbca | deletes the assignment from the parent object | [
{
"docid": "8bd9c76946cae6b55de60d59f37047d4",
"score": "0.59724796",
"text": "def destroy\n #primitives in structs are without parent\n parent and parent.children.delete self\n end",
"title": ""
}
] | [
{
"docid": "fefa536e53b8b32b241c90b8f7cca6f8",
"score": "0.7325093",
"text": "def unassign\n self.owner = nil\n save\n end",
"title": ""
},
{
"docid": "63ba6ede23dc9af10be16a98a7739738",
"score": "0.6614776",
"text": "def detach\n @parent, @key_in_parent = nil\n end",
"title": ""
},
{
"docid": "02c7593ea5af3c04b05628cee03e5c55",
"score": "0.6591988",
"text": "def reset_assignment_value\n @assignment_value = nil\n end",
"title": ""
},
{
"docid": "34469b9e668191f9cf9b2a6bb0d12b5a",
"score": "0.6588888",
"text": "def retain()\n res = super(self)\n end",
"title": ""
},
{
"docid": "7433d04f7d3299d41d0095b923f82895",
"score": "0.65349746",
"text": "def nullify\n unbind_one\n _target.save\n end",
"title": ""
},
{
"docid": "7433d04f7d3299d41d0095b923f82895",
"score": "0.65349746",
"text": "def nullify\n unbind_one\n _target.save\n end",
"title": ""
},
{
"docid": "2487b73be292d4574efacc5790e24601",
"score": "0.6375781",
"text": "def detach\n self.tap do\n %i(parent= left_child= right_child=).each do |attr|\n send attr, nil\n end\n end\n end",
"title": ""
},
{
"docid": "30bcc71c9f0104ae5dd763d0ceb76ea7",
"score": "0.6359673",
"text": "def unset; end",
"title": ""
},
{
"docid": "b17dd84aa811302549b21971aa51aa7a",
"score": "0.6299729",
"text": "def nullify\n load! and target.each do |doc|\n base.send(metadata.foreign_key).delete(doc.id)\n dereference(doc)\n end\n target.clear\n end",
"title": ""
},
{
"docid": "f2ee19f93f4c1e07df51088f752b05e4",
"score": "0.6273194",
"text": "def parent=(_); end",
"title": ""
},
{
"docid": "0c9049f9fde5823de9aefafdf1b4f7c8",
"score": "0.6238331",
"text": "def assign_to_or_mark_for_destruction(record, attributes, allow_destroy); end",
"title": ""
},
{
"docid": "99ad34bd1c3e4eb9ab2e0fbe919235f9",
"score": "0.62221587",
"text": "def __clean__(object=self)\n __clean__!(object.dup)\n end",
"title": ""
},
{
"docid": "3e00ac9fc14f911afe9a020ba4254226",
"score": "0.6206868",
"text": "def nullify\n criteria.update(metadata.foreign_key => nil)\n target.clear do |doc|\n unbind_one(doc)\n end\n end",
"title": ""
},
{
"docid": "4ace99c3616710802ba4ca8477ef5b09",
"score": "0.61841065",
"text": "def clear_rhs\n rhs.clear\n end",
"title": ""
},
{
"docid": "7f9e1abb3f416094bf7c6cbb5e2188b5",
"score": "0.61642414",
"text": "def nullify\n unless metadata.forced_nil_inverse?\n criteria.pull(metadata.inverse_foreign_key, base.id)\n end\n if persistable?\n base.set(\n metadata.foreign_key,\n base.send(metadata.foreign_key).clear\n )\n end\n target.clear do |doc|\n unbind_one(doc)\n end\n end",
"title": ""
},
{
"docid": "48b6054f279ecc6c64f4aafa5eeb6a04",
"score": "0.61208284",
"text": "def clear\n\t\tsuper\n\t\t@children.clear\n\t\t@parent = nil\n\tend",
"title": ""
},
{
"docid": "d3d618dd5a9a29bf9b1a76a7379c7ab1",
"score": "0.61149997",
"text": "def sub!(other)\n @value -= cast_value(other)\n self\n end",
"title": ""
},
{
"docid": "26a5cf9f8f1fe54202de49efa3b963a7",
"score": "0.6108285",
"text": "def clear\n value = self.id\n super\n ensure\n store 'id', value\n end",
"title": ""
},
{
"docid": "ef8ecdddec73674044d904cf8ba8ed54",
"score": "0.60825175",
"text": "def parent=(var)\n self[parent_id_field] = nil\n var == \"none\" ? super(nil) : super\n end",
"title": ""
},
{
"docid": "5488a58de0e1d2ffaf8dabe5e559e3ed",
"score": "0.60686624",
"text": "def clean!(from_child=false)\n @child_dirty = @self_dirty = false\n self\n end",
"title": ""
},
{
"docid": "05d85274ceac66050892ce936ec68d1f",
"score": "0.6058214",
"text": "def pid=(pid)\n @object = nil\n super\n end",
"title": ""
},
{
"docid": "9387ab15c2b99b8459d690c46e516183",
"score": "0.6039356",
"text": "def assign_to_or_mark_for_destruction(record, *args)\n name = association_name(record)\n\n if self.class.reflect_on_association(name).collection? &&\n versioned_attribute?(name)\n previous = changed_attributes[name]\n\n # Assume it will change. It may not. We'll handle that scenario\n # after the attributes have been assigned.\n send(\"#{name}_will_change!\")\n super(record, *args)\n\n reset_changes_if_unchanged(record, name, previous)\n else\n super(record, *args)\n end\n end",
"title": ""
},
{
"docid": "9387ab15c2b99b8459d690c46e516183",
"score": "0.6039356",
"text": "def assign_to_or_mark_for_destruction(record, *args)\n name = association_name(record)\n\n if self.class.reflect_on_association(name).collection? &&\n versioned_attribute?(name)\n previous = changed_attributes[name]\n\n # Assume it will change. It may not. We'll handle that scenario\n # after the attributes have been assigned.\n send(\"#{name}_will_change!\")\n super(record, *args)\n\n reset_changes_if_unchanged(record, name, previous)\n else\n super(record, *args)\n end\n end",
"title": ""
},
{
"docid": "d025fe3dd8ceef98b754678fefeb8e4a",
"score": "0.6035939",
"text": "def pop\n synchronize { super }\n end",
"title": ""
},
{
"docid": "de308636c70e80dd84326d57cba6b75f",
"score": "0.6029388",
"text": "def delete!\n @value = ''\n self\n end",
"title": ""
},
{
"docid": "74326064f86f1572c4ccad32785240ea",
"score": "0.6026445",
"text": "def parent=(parent); end",
"title": ""
},
{
"docid": "74326064f86f1572c4ccad32785240ea",
"score": "0.6026445",
"text": "def parent=(parent); end",
"title": ""
},
{
"docid": "74326064f86f1572c4ccad32785240ea",
"score": "0.6026445",
"text": "def parent=(parent); end",
"title": ""
},
{
"docid": "477250c655650b2c7b1ef58404761664",
"score": "0.60244286",
"text": "def removed!\n super if defined? super\n end",
"title": ""
},
{
"docid": "cebe4c2f3f61c7fc1e090ae4fb1ff231",
"score": "0.6015226",
"text": "def clear\n notify_will_change\n\n super\n\n self\n end",
"title": ""
},
{
"docid": "bfcce7c05382ad3be3eaa701ed820e7f",
"score": "0.60140973",
"text": "def clear\n batch_clear(_target.dup)\n update_attributes_hash\n self\n end",
"title": ""
},
{
"docid": "b5d28e12ebf7ab4f09acfa6b0f47eceb",
"score": "0.60090226",
"text": "def clear\n remove_instance_variable(:@left)\n remove_instance_variable(:@right)\n end",
"title": ""
},
{
"docid": "8df249fd5066542db7b8257a7f2a9d9e",
"score": "0.6006098",
"text": "def pop \n\t\tsuper\n\t\t@no_of_attributes -= 1\n\t\t@sum -= @removed_number\n\t\t@removed_number\n\tend",
"title": ""
},
{
"docid": "ef742589850bbe5d5ea8a32f58317bb5",
"score": "0.5991956",
"text": "def reset\n mother.reset\n end",
"title": ""
},
{
"docid": "f2909de70201208f973c75a1f5d04508",
"score": "0.5987786",
"text": "def reset\n @parent_item_id = nil\n @attachments = nil\n @email_address = nil\n end",
"title": ""
},
{
"docid": "65f780326551ec441560b818a4460cd6",
"score": "0.5968046",
"text": "def unlink\n @parent.unlink(self)\n end",
"title": ""
},
{
"docid": "6a5a1448d20b59db9a76d55824672522",
"score": "0.5954889",
"text": "def destroy!\n self.class.references_many_rels.each do |rel|\n send(rel).clear\n end\n \n self.class.has_many_rels.each do |rel|\n send(rel).clear\n end\n \n self.class.has_one_rels.each do |rel|\n send(\"#{rel}=\".to_sym, nil)\n end\n \n # Implicitly prevent the object from being resaved by failing to update its revision\n RelaxDB.db.delete(\"#{_id}?rev=#{_rev}\")\n self\n end",
"title": ""
},
{
"docid": "93d0be8dca6ae0cc8c146d0113752161",
"score": "0.59522647",
"text": "def delete\n super\n nil\n end",
"title": ""
},
{
"docid": "93d0be8dca6ae0cc8c146d0113752161",
"score": "0.59522647",
"text": "def delete\n super\n nil\n end",
"title": ""
},
{
"docid": "bfd9877031ecd49b0c98eb32c71211ac",
"score": "0.5943248",
"text": "def pop\n synchronize { super }\n end",
"title": ""
},
{
"docid": "a023e60ef202669e22abffc0e50adbe2",
"score": "0.59376955",
"text": "def clear\n @_value = nil\n end",
"title": ""
},
{
"docid": "5195bd4fc91615c61da9100d6f07cdb4",
"score": "0.59319067",
"text": "def decr(*args)\n super\n end",
"title": ""
},
{
"docid": "b4ac0b81db32881fb886d76d69c66687",
"score": "0.59296453",
"text": "def destroy!\n self.class.references_many_rels.each do |rel, opts|\n send(rel).clear\n end\n \n self.class.has_many_rels.each do |rel, opts|\n send(rel).clear\n end\n \n self.class.has_one_rels.each do |rel,opts|\n send(\"#{rel}=\".to_sym, nil)\n end\n \n # Implicitly prevent the object from being resaved by failing to update its revision\n RelaxDB.db.delete(\"#{_id}?rev=#{_rev}\")\n self\n end",
"title": ""
},
{
"docid": "d939d9899cc6eba7da8ee2a4136f1e71",
"score": "0.5911929",
"text": "def reset!\n @value_ = @value = nil\n self\n end",
"title": ""
},
{
"docid": "a59c66dbd378338d844f04589f576325",
"score": "0.59052855",
"text": "def ~@\n dc_obj\n end",
"title": ""
},
{
"docid": "efc1f885d5b69538ae44e569a20919eb",
"score": "0.58910745",
"text": "def unassign\n @api.set_assignee '-1'\n end",
"title": ""
},
{
"docid": "78b906c5e105ce8691723f4c6c4f903f",
"score": "0.5887755",
"text": "def erase_old_resource\n if obj.rdf_subject.node?\n final_parent.statements.each do |statement|\n final_parent.send(:delete_statement, statement) if\n statement.subject == obj.rdf_subject\n end\n else\n final_parent.delete [obj.rdf_subject, nil, nil]\n end\n end",
"title": ""
},
{
"docid": "f7c112862361f3042c544b65c8765a84",
"score": "0.5881153",
"text": "def reset\n raise NotImplementedError, \"Implement this method in a child class\"\n end",
"title": ""
},
{
"docid": "6afb5e9d25c5c09b8e1cc3cf5ef4e997",
"score": "0.58808494",
"text": "def assign_to_or_mark_for_destruction(record, attributes, allow_destroy)\n if has_destroy_flag?(attributes) && allow_destroy\n unless record.class.embeddable?\n record.mark_for_destruction\n else\n record._parent_document.class.associations.each do |key, association|\n if association.klass.eql?(record.class)\n record._parent_document.send(key).delete_if {|q| q.id.to_s == record.id.to_s }\n end\n end\n end\n else\n record.attributes = attributes.except(*UNASSIGNABLE_KEYS)\n end\n end",
"title": ""
},
{
"docid": "d429693ce5dde8c1d987438c19dfad43",
"score": "0.58785653",
"text": "def destroy\n self.ballot = nil\n self.poll = nil\n self.option = nil\n super\n end",
"title": ""
},
{
"docid": "ce56ce31549ea0f0347693139909c44c",
"score": "0.58744603",
"text": "def parent=( other )\n return @parent if @parent == other\n @parent.delete self if defined? @parent and @parent\n @parent = other\n end",
"title": ""
},
{
"docid": "6d04bfd60f51870f07f6ebf114a70870",
"score": "0.58653635",
"text": "def destroy!\n self.ballot = nil\n self.poll = nil\n self.option = nil\n super\n end",
"title": ""
},
{
"docid": "b8c558a1bba3c25e7a0d9b3b67ae1cd8",
"score": "0.58581424",
"text": "def clear\n parent.delete([rdf_subject, predicate, nil])\n\n self\n end",
"title": ""
},
{
"docid": "dddd3278130855f04a5ab1f27b0c01e8",
"score": "0.58556205",
"text": "def pop\n return nil unless resource = super\n orphan_resource(resource)\n end",
"title": ""
},
{
"docid": "2f5eb3e2baf95ca3b4f10cce64f34d0b",
"score": "0.5854655",
"text": "def orphan!\r\n return unless @parent\r\n @parent.delete_item(self)\r\n @parent = nil\r\n self\r\n end",
"title": ""
},
{
"docid": "7de67e2da8e967e5a1f80f330fc1d2d6",
"score": "0.58541197",
"text": "def reset\n remove_instance_variable(:@value)\n end",
"title": ""
},
{
"docid": "9fd3b4f2a8df93707dd9f7246d180e35",
"score": "0.58504677",
"text": "def nil!\n @attributes = nil\n end",
"title": ""
},
{
"docid": "8ff778e877f7bbfa6d1d2a3ef87795ba",
"score": "0.58492047",
"text": "def no_direct_assignment; end",
"title": ""
},
{
"docid": "8ff778e877f7bbfa6d1d2a3ef87795ba",
"score": "0.58492047",
"text": "def no_direct_assignment; end",
"title": ""
},
{
"docid": "34adf6f1a74f218edde62882b9024f6c",
"score": "0.5849026",
"text": "def reset!\n reset;save;self\n end",
"title": ""
},
{
"docid": "cb8a4ce5d18238a2cf4bcb8c70226b93",
"score": "0.5845951",
"text": "def destroy(reassign_to = nil)\r\n if reassign_to && reassign_to.is_a?(Enumeration)\r\n OPTIONS[self.opt][:model].update_all(\"#{OPTIONS[self.opt][:foreign_key]} = #{reassign_to.id}\", \"#{OPTIONS[self.opt][:foreign_key]} = #{id}\")\r\n end\r\n destroy_without_reassign\r\n end",
"title": ""
},
{
"docid": "c15d71d2437c117c2f7a8972c2d5b2bc",
"score": "0.5844756",
"text": "def remove\r\n return unless parent? # No need to remove if parentless\r\n\r\n parent_obj = zobj self.parent\r\n sibling_obj = zobj self.sibling\r\n\r\n clear_parent\r\n clear_sibling\r\n\r\n if parent_obj.child == self.id # Am I my parent's child?\r\n parent_obj.child = sibling_obj.id\r\n else\r\n child_obj = zobj parent_obj.child\r\n while self.id != child_obj.sibling # Next Child!\r\n raise \"malformed object tree\" if child_obj.sibling == 0\r\n child_obj = zobj child_obj.sibling\r\n end\r\n child_obj.sibling = sibling_obj.id\r\n end\r\n end",
"title": ""
},
{
"docid": "6c0c049447f13c6785a475f3d4498a59",
"score": "0.5840765",
"text": "def unset \n ::GObject::g_value_unset self\n end",
"title": ""
},
{
"docid": "3f81c06188f9aaf04c0c7f85e19135f5",
"score": "0.5838938",
"text": "def clean_up\n @dirty = false\n end",
"title": ""
},
{
"docid": "1f50273edd31b9178d910b1c45c0d3b1",
"score": "0.58384144",
"text": "def delete=(v); end",
"title": ""
},
{
"docid": "f2a6f55ac54961ebc59b1a4e811ed66d",
"score": "0.5818422",
"text": "def delete\n data.delete( self ); self\n end",
"title": ""
},
{
"docid": "be5d94483b63eb1fee4e091a4c7a5434",
"score": "0.58152264",
"text": "def reset\n raise NotImplementedError, \"Implement this method in a child class\"\n end",
"title": ""
},
{
"docid": "6c3c71687301c5dffe1eff5003d64f34",
"score": "0.5811098",
"text": "def reset\n @new_record = true\n repository.identity_map(model).delete(key)\n original_values.clear\n loaded_attributes.each { |n| original_values[n] = nil }\n end",
"title": ""
},
{
"docid": "b34bd7b701989f8c5403f7ba3eda6a02",
"score": "0.58079755",
"text": "def clear\n\t\t@dirty = false\n\tend",
"title": ""
},
{
"docid": "51845a217cf56febd1ce023954da274c",
"score": "0.5804951",
"text": "def parent!(parent)\n @parent = parent\n self\n end",
"title": ""
},
{
"docid": "996209821d7f27b5f1ab39e69574969a",
"score": "0.580485",
"text": "def desist\n self.class.delete self\n end",
"title": ""
},
{
"docid": "f7f49217a3110e2a8d87d594c516938a",
"score": "0.57913023",
"text": "def clear\n @location = nil\n @parent = nil\n @children = nil\n end",
"title": ""
},
{
"docid": "6058d1bfc1579fea45ef0b5b50e9f4f3",
"score": "0.57834625",
"text": "def flush\n @value = nil\n @suitable = nil\n end",
"title": ""
},
{
"docid": "678dce68d3ed74828e6a3a5341ee1255",
"score": "0.5778024",
"text": "def clear!\n @saved.clear!\n\n self\n end",
"title": ""
},
{
"docid": "fddd4b10f4dcd5934fed8e6877423d70",
"score": "0.57753015",
"text": "def remove_assignment_from_course\n oldpath = begin\n path\n rescue StandardError\n nil\n end\n self.course_id = nil\n save\n newpath = begin\n path\n rescue StandardError\n nil\n end\n FileHelper.update_file_location(oldpath, newpath)\n end",
"title": ""
},
{
"docid": "7a2992b81f2b2818513899dd4d25011a",
"score": "0.5769824",
"text": "def reset\n remove_instance_variable(:@value)\n end",
"title": ""
},
{
"docid": "1b139fed9e54a6baa115424645677e5f",
"score": "0.5764618",
"text": "def ~\n @absolute = true\n self\n end",
"title": ""
},
{
"docid": "61ea241310ee1d749622faea710934ac",
"score": "0.57614815",
"text": "def unset\n ::GObject.g_value_unset self\n end",
"title": ""
},
{
"docid": "18d5b4a3b1a2324df3fc793e66c8c7bb",
"score": "0.5760392",
"text": "def unbind_from_relational_parent(doc)\n check_inverse!(doc)\n bind_foreign_key(doc, nil)\n bind_polymorphic_type(doc, nil)\n bind_inverse(doc, nil)\n bind_inverse_of_field(doc, nil)\n end",
"title": ""
},
{
"docid": "944270df3f8d4c25422d7e00241fea80",
"score": "0.57474476",
"text": "def destroy(reassign_to = nil)\n if reassign_to && reassign_to.is_a?(Enumeration)\n OPTIONS[self.opt][:model].update_all(\"#{OPTIONS[self.opt][:foreign_key]} = #{reassign_to.id}\", \"#{OPTIONS[self.opt][:foreign_key]} = #{id}\")\n end\n destroy_without_reassign\n end",
"title": ""
},
{
"docid": "e1a20130c101ef5dee820c7b90a43c02",
"score": "0.57409537",
"text": "def remove_after\n @other = nil\n end",
"title": ""
},
{
"docid": "d4b00bfb2c79d329aed9eb45a5002898",
"score": "0.5739726",
"text": "def reset!\n @builder = nil\n self.assigns.each do |ivar|\n next unless instance_variable_defined?(ivar)\n remove_instance_variable(ivar)\n end\n end",
"title": ""
},
{
"docid": "d6f5c6565b90a794ebfb354e36ed5204",
"score": "0.57366246",
"text": "def clear!\n self.clear\n end",
"title": ""
},
{
"docid": "d6f5c6565b90a794ebfb354e36ed5204",
"score": "0.57366246",
"text": "def clear!\n self.clear\n end",
"title": ""
},
{
"docid": "6a4f8d1535de280db1b903a34ce48056",
"score": "0.57292527",
"text": "def reset!\n self.value = nil\n end",
"title": ""
},
{
"docid": "2c5d302956020c911af4e6c3109d36c4",
"score": "0.5729019",
"text": "def reset_object!(attributes)\n reset_atomic_updates!\n\n @attributes = attributes\n @attributes_before_type_cast = @attributes.dup\n @changed_attributes = {}\n @previous_changes = {}\n @previous_attributes = {}\n @previously_new_record = false\n\n reset_readonly\n apply_defaults\n reload_relations\n end",
"title": ""
},
{
"docid": "6d558244ee807a0090c435b46799a06a",
"score": "0.57255346",
"text": "def clear\n @value = nil\n end",
"title": ""
},
{
"docid": "271bbfda538e8316510774b4fb698f08",
"score": "0.57254213",
"text": "def reset!\n @modified_attributes = {}\n @attrs = {}\n @new_record = true\n @loaded = false\n end",
"title": ""
},
{
"docid": "406c1e87556896ba16612b387a59eeb0",
"score": "0.5720385",
"text": "def parent=( parent ) @parent = parent end",
"title": ""
},
{
"docid": "792298842bd39969bc71d419f3ce3af4",
"score": "0.57104075",
"text": "def clear\n parent.query(subject, options.predicate).each do |solution|\n # TODO - Recursive delete\n # Delete everythign we're pointing at.\n parent.graph.delete([solution.value, nil, nil]) if solution.value.uri?\n end\n # Delete all the assertions about this object\n parent.graph.delete([subject, nil, nil])\n reset!\n end",
"title": ""
},
{
"docid": "2fc0120e8bd9be8363a0bed1892bebaa",
"score": "0.5709818",
"text": "def parent=(par)\n if self.parent\n self.parent.children.delete(self) #delete ourselves \n end\n \n @parent = par\n self.parent.children << self unless self.parent.nil?\n end",
"title": ""
},
{
"docid": "9d768992b65c7285149147c4a209724b",
"score": "0.5709208",
"text": "def parent=(parent)\n if @parent and parent and !@parent.equal?(parent) then\n # The parent is already defined,it is not to be removed,\n # and the new parent is different, error.\n raise AnyError, \"Parent already defined.\"\n else\n @parent = parent\n end\n end",
"title": ""
},
{
"docid": "4019f02cbf394ebee46854deefc04632",
"score": "0.5704192",
"text": "def dereference(document)\n document.send(metadata.inverse_foreign_key).delete(base.id)\n document.send(metadata.inverse(document)).target.delete(base)\n document.save\n end",
"title": ""
},
{
"docid": "bf630ce7311aa9be53c0747a05c4987b",
"score": "0.569849",
"text": "def uhook_cloned_object( obj )\n obj.content_id = nil\n end",
"title": ""
},
{
"docid": "8667dad633041bd1c60b2e1182504d69",
"score": "0.5695141",
"text": "def make_assigned\n destroy\n end",
"title": ""
},
{
"docid": "95d690028bf28aa918aeb7b78b9852c2",
"score": "0.56915545",
"text": "def free\n\t\t\tself.value = nil\n\t\t\tself.vacated = true\n\t\tend",
"title": ""
},
{
"docid": "654f31a6fb477f534fb17c877625e06b",
"score": "0.5687561",
"text": "def reset\n super\n reset_instance\n end",
"title": ""
},
{
"docid": "2e4b61eac02c1654be16f3feeca68f49",
"score": "0.56872344",
"text": "def forget!\n @values = nil\n @lookup = nil\n @index = -1\n end",
"title": ""
},
{
"docid": "87bcf4fb75c8951351bad269b27de6b9",
"score": "0.56822026",
"text": "def delete *args; Setting.unscoped{ super } end",
"title": ""
},
{
"docid": "8c360ed865691f1a02855129198b5dfb",
"score": "0.5674016",
"text": "def destroy\n super { source.clear }\n end",
"title": ""
}
] |
12e1a57ef9d7151e2e173876e32bb701 | Convenience method for getting the sort options. | [
{
"docid": "177c4fe223c8b990088c203d399a0111",
"score": "0.635123",
"text": "def sort\n self[:sort]\n end",
"title": ""
}
] | [
{
"docid": "1d506dc7d3c6cbc6d33d83ab587eb1c5",
"score": "0.76511866",
"text": "def __sort_option__\n multi.inject({}) do |options, criteria|\n options.merge!(criteria.__sort_pair__)\n options\n end\n end",
"title": ""
},
{
"docid": "d5ed21616d4f722d99964825622c7535",
"score": "0.7508125",
"text": "def get_sort_opts(params)\n\tif(params[:sort].nil?)\n\t\treturn [['_id', 1]] # just sort on the id\n\telse\n\t\tfields = destringify_array(params[:sort])\n\n\t\tresult = []\n\t\tfields.each do |f|\n\t\t\tparts = f.split(\":\")\n\t\t\tif(parts.count != 1)\n\t\t\t\tif(parts[1].to_s == \"desc\")\n\t\t\t\t\tresult << [parts[0].to_s, -1]\n\t\t\t\telse\n\t\t\t\t\tresult << [parts[0].to_s, 1]\n\t\t\t\tend\n\t\t\telse\t\n\t\t\t\tresult << [f.to_s, 1]\n\t\t\tend\t\t\t\n\t\tend\n\t\treturn result\n\tend\nend",
"title": ""
},
{
"docid": "f30d125389d45cfa4ecf2f84e4ae0825",
"score": "0.7355567",
"text": "def setup_sort_options(options)\n options[:sort] = options[:sort] ? options[:sort].dup : []\n end",
"title": ""
},
{
"docid": "8346f3f3c5970cc3c07cf3e1c90ce5cc",
"score": "0.71451586",
"text": "def selector_options sort_order = nil\n self.sort_order = sort_order if sort_order\n\n # options_hash - retrieved from YAML file\n list = options_hash.inject([]) do |res, option| \n select_option = calculator(option).select_option\n res << select_option\n res\n end\n end",
"title": ""
},
{
"docid": "f5560a0f05cdba699ce9c13652f61e04",
"score": "0.71089995",
"text": "def sort_by(options)\n self.sort = options\n end",
"title": ""
},
{
"docid": "3ce3dd3a1d4af6451281dbf5b55240db",
"score": "0.7096996",
"text": "def __sort_option__\n { name => operator }\n end",
"title": ""
},
{
"docid": "bb78190d30afea9659490d8d063c230d",
"score": "0.7038059",
"text": "def __sort_option__\n split(/,/).inject({}) do |hash, spec|\n hash.tap do |_hash|\n field, direction = spec.strip.split(/\\s/)\n _hash[field.to_sym] = Mongoid::Criteria::Translator.to_direction(direction)\n end\n end\n end",
"title": ""
},
{
"docid": "862386a7a4a9d97898ffbe77e2e24c2e",
"score": "0.70120925",
"text": "def sort_by_options(opts)\n opts.map { |by| by.split('.').second }.reject { |by| by == 'kind' }\n end",
"title": ""
},
{
"docid": "92fe0cb52e2ead00d212c43b6c424410",
"score": "0.6919078",
"text": "def sort(sort = nil)\n set_option(:sort, sort)\n end",
"title": ""
},
{
"docid": "f3ca9f1e289288e6f53c439d754b7e6b",
"score": "0.6834726",
"text": "def sort_option\n ['Best match', 'Level', 'Provider(s)']\n end",
"title": ""
},
{
"docid": "7645c495de79606fec9dd18b5c822696",
"score": "0.67927796",
"text": "def filter_and_sort_options(opts={})\n raise ArgumentError, 'parameter hash expected' unless opts.respond_to? :symbolize_keys\n opts.symbolize_keys!\n \n limit, page = calculate_limit_and_page(opts)\n sort = determine_sort(opts)\n conditions, values = get_conditions_and_values(opts)\n \n {:page => page, :per_page => limit, :order => sort, :include => extjs_filterable_options[:include],\n :conditions => [conditions.join(\" and \")].concat(values)}\n end",
"title": ""
},
{
"docid": "25fdc706be71d9bd4792ac6120948571",
"score": "0.6725151",
"text": "def sort_options vals\n @options.zip(vals).sort_by(&:last).map(&:first)\n end",
"title": ""
},
{
"docid": "b7bc8fe27967d90a36faf4a655764ecb",
"score": "0.6691655",
"text": "def sort_options(sort_string)\n sort_string[/['\"]?(\\w+)['\"]? *(asc|desc)?/i]\n [$1, ($2 || 'asc')]\n end",
"title": ""
},
{
"docid": "869b30c526e082e50a5beb85d6fb1db1",
"score": "0.66398424",
"text": "def sort_options\n\t\t[\n\t\t\t['name', 'name', 'Name'], # Will be passed to #order\n\t\t\t['businesses', lambda { |tag| -1 * tag.active_businesses_in_city(@city).length }, 'Number of Businesses']\n\t\t]\n\tend",
"title": ""
},
{
"docid": "3797d1ded698db6a39b0d21901064fc7",
"score": "0.6597746",
"text": "def options_hash\n I18n.t(\"property.sort.options\")\n end",
"title": ""
},
{
"docid": "54e777e79dd76377ce2e73b5c1a0cf66",
"score": "0.65871704",
"text": "def sort_method\n @options[:sort_method] || :self_time\n end",
"title": ""
},
{
"docid": "34dec7f9012865216585c60f9940fdd1",
"score": "0.6571229",
"text": "def sort_opts!(&block)\n block ||= lambda {|option| (option.long || option.short).to_s.sub(/^-+/, '') }\n\n splits = []\n current = []\n\n options = self.options.values.uniq\n registry.each do |option|\n if options.include?(option)\n current << option\n else\n splits << current\n splits << option\n current = []\n end\n end\n\n splits << current\n @registry = splits.collect {|split| split.kind_of?(Array) ? split.sort_by(&block) : split }\n @registry.flatten!\n\n self\n end",
"title": ""
},
{
"docid": "ded5bddcc1c958fbeefeb05d69bbda59",
"score": "0.64926445",
"text": "def sort(key, **options); end",
"title": ""
},
{
"docid": "60a2aed9f97d7c9987fb5aa4a30ee09c",
"score": "0.647777",
"text": "def extract_options!\n option_parser.order!(args)\n end",
"title": ""
},
{
"docid": "14f4a21ad6fe95c8e6ca0e7c2d473af5",
"score": "0.637431",
"text": "def get_options()\n\n all_options = []\n\n @raw.raw_options.each do |set|\n \n set.each do |option|\n all_options.push(option)\n end\n\n end\n\n @options = all_options.flatten.uniq.sort_by(&:downcase)\n\n end",
"title": ""
},
{
"docid": "09a01d39f083fb3d3bcbb6260f860221",
"score": "0.6363264",
"text": "def default_sort_option\n\t\t'name'\n\tend",
"title": ""
},
{
"docid": "2790a72bd9f2d6f80cf199f20661fad7",
"score": "0.62711704",
"text": "def sort(opts = {})\n return [] if not distkey\n \n opts[:by] = sortables[opts[:by]] if opts[:by]\n\n if opts[:start] && opts[:limit]\n opts[:limit] = [opts[:start], opts[:limit]]\n end\n\n objects(distkey.sort(opts))\n end",
"title": ""
},
{
"docid": "ba1686a6fea9db8a902dafdb7358a273",
"score": "0.62608457",
"text": "def order!(&blk) options.order!(self, &blk) end",
"title": ""
},
{
"docid": "eb629d60372df60938fd70dccb9a7e80",
"score": "0.6256101",
"text": "def find_options\n count_options.tap do |fo|\n fo[:order] = sorter.to_find_option if sorter.to_find_option\n fo.merge!({:offset => (page - 1)*page_size, :limit => page_size}) unless page_size.zero?\n end\n end",
"title": ""
},
{
"docid": "c59c1d7f75f3b73e34362e505dbe924c",
"score": "0.62123936",
"text": "def sort sort_option\n unless sort_option.is_a? Fixnum\n raise ArgumentError, 'Sort option must be an integer'\n end\n @sort_option = sort_option.to_s\n self\n end",
"title": ""
},
{
"docid": "c676dbe99a2d8836833027baea3c00c5",
"score": "0.62018216",
"text": "def sort_params\n return [] unless params['sort_by']\n\n orders = (params['sort_order'] ? params['sort_order'].split(\",\") : [\"\"])\n sort_order = params['sort_by'].split(\",\").zip(orders).collect do |attr, order|\n next if attr.blank?\n sort_item = attr\n sort_item << \" ASC\" if order && order.downcase.start_with?(\"asc\")\n sort_item << \" DESC\" if order && order.downcase.start_with?(\"desc\")\n sort_item\n end\n sort_order.compact\n end",
"title": ""
},
{
"docid": "8c44c908bfb8304d60ebb828f6f7e52b",
"score": "0.6196028",
"text": "def user_sort_options(model) #:nodoc:\r\n table_name = (model.class == String ? model : model.to_s).underscore\r\n return nil unless session[table_name][:sort]\r\n\r\n field, direction = session[table_name][:sort].split(' ')\r\n { field.to_sym => direction.to_i }\r\nend",
"title": ""
},
{
"docid": "d7cfa79c4f6e321ee812a069a7cf99b8",
"score": "0.61900294",
"text": "def set_sort_order(opts)\n opts = check_params(opts,[:orders])\n super(opts)\n end",
"title": ""
},
{
"docid": "6821a5f9bc373d8796427c13c2fe7b43",
"score": "0.61554116",
"text": "def options_by_score\n self.options.sort{ |x, y| y.score <=> x.score }\n end",
"title": ""
},
{
"docid": "c8a79c012c12a19a8a20687cbc8e3d7c",
"score": "0.61502683",
"text": "def show_sort_options\n sortDropdown = \"\"\n eds_info.fetch('AvailableSearchCriteria', {}).fetch('AvailableSorts', []).each do |sort_option|\n sortDropdown << \"<li><a href='#{eds_action_url sort_option[\"AddAction\"].to_s}'>#{sort_option[\"Label\"].to_s}</a></li>\"\n end\n sortDropdown.html_safe\n end",
"title": ""
},
{
"docid": "59fa6ae44979577590c84ddc71bacaea",
"score": "0.6146818",
"text": "def sort\n return @sort\n end",
"title": ""
},
{
"docid": "f5d20c7c43a31a1c5f096488771f714d",
"score": "0.6130034",
"text": "def default_options(page)\n @sort_desc = true\n add_sort_option('2013.admissions.sat_scores.25th_percentile.math')\n add_page_option(page)\n add_per_page_option('100')\n end",
"title": ""
},
{
"docid": "62cd4b3233f803590b3b27c817675eda",
"score": "0.61252105",
"text": "def extract_options(opts)\n lastmod = opts.delete(:lastmod)\n changefreq = opts.delete(:changefreq)\n priority = opts.delete(:priority)\n\n [lastmod, changefreq, priority]\n end",
"title": ""
},
{
"docid": "5ea26907738b586f0dcca1b20ad6d3e8",
"score": "0.6103139",
"text": "def sort_params\n @_sort_params ||=\n if params[:sort].present?\n params[:sort].split(',').each_with_object({}) do |field, hash|\n unformatted_field = @request.unformat_key(field)\n desc, field = unformatted_field.to_s.match(/^([-_])?(\\w+)$/i)[1..2]\n hash[field.to_sym] = desc.present? ? :desc : :asc\n end\n end\n end",
"title": ""
},
{
"docid": "424832236f7ea10ff3a9b353a1f186d7",
"score": "0.60694057",
"text": "def sort(_options = nil)\n self.build_settings = sorted_build_settings\n end",
"title": ""
},
{
"docid": "4b3fa92c992545ef6b95ee5eaaf68b73",
"score": "0.60665846",
"text": "def make_options(options)\n\t\tresult = {\n\t\t\t:order => :asc,\n\t\t\t:nulls => :first\n\t\t}.merge(options)\n\t\traise 'Invalid order given.' unless [:asc,:desc].include?(result[:order])\n\t\traise 'Invalid null order given.' unless [:first,:last].include?(result[:nulls])\n\t\traise 'Unrecognized options given.' unless result.size == 2\n\t\tresult\n\tend",
"title": ""
},
{
"docid": "7bd0549d7ee0e1cbeffcac7b7e067ad6",
"score": "0.60512865",
"text": "def order_by(*args)\n clone.tap do |crit|\n arguments = args.size == 1 ? args.first : args\n setup_sort_options(crit.options) unless args.first.nil?\n if arguments.is_a?(Array)\n #[:name, :asc]\n if arguments.size == 2 && (arguments.first.is_a?(Symbol) || arguments.first.is_a?(String))\n build_order_options(arguments, crit)\n else\n arguments.each { |argument| build_order_options(argument, crit) }\n end\n else\n build_order_options(arguments, crit)\n end\n end\n end",
"title": ""
},
{
"docid": "a0f553b6d982847e4505ff2cb97b8982",
"score": "0.6041241",
"text": "def get_options\n @options\n end",
"title": ""
},
{
"docid": "031ef57bf687cd3dc359bec87f903e2a",
"score": "0.6041217",
"text": "def options_with_specifications\n @options_with_specs ||= options.select{|x| x.has_input?}.sort_by{|x| x.option_set.name}\n end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.6030832",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.6030832",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "c1cc90e5b7b6c2c9fdda96750af03712",
"score": "0.6013381",
"text": "def check_sort_options() #:nodoc:\r\n table_name = @tables.first[1]\r\n old_sort = session[table_name][:sort].to_s\r\n sort, direction = old_sort.split(' ')\r\n# sort is requested\r\n if params['sort']\r\n # reverse sort if same selected\r\n if params['sort'] == sort\r\n direction = (direction == '1') ? '-1' : '1'\r\n end\r\n direction ||= 1\r\n sort = params[:sort]\r\n session[table_name][:sort] = \"#{params['sort']} #{direction}\"\r\n session[table_name][:page] = 1\r\n end\r\n @records.sort( sort => direction.to_i ) if session[table_name][:sort]\r\n params['sort'] = nil # otherwise there is problem with other links\r\nend",
"title": ""
},
{
"docid": "0b97a4f692b1934c6069e292b4ae3615",
"score": "0.5989744",
"text": "def sort_methods\n [\n 'score desc',\n 'authors_sort asc',\n 'authors_sort desc',\n 'title_sort asc',\n 'title_sort desc',\n 'journal_sort asc',\n 'journal_sort desc',\n 'year_sort asc',\n 'year_sort desc'\n ]\n end",
"title": ""
},
{
"docid": "5c7c6a73e47e26e22f488e611f1c0674",
"score": "0.59840107",
"text": "def order()\n @options[:order] || DEF_LAST_ORDER\n end",
"title": ""
},
{
"docid": "39c3ab7dda3eed6abeb18f3b73f17ca5",
"score": "0.59684885",
"text": "def order\n order = single_param(\"order\")\n if order.nil?\n return nil\n end\n if order.start_with?('-')\n field = order[1..-1]\n dir = \"desc\"\n else\n field = order\n dir = \"asc\"\n end\n unless ALLOWED_SORT_FIELDS.include?(field)\n @errors << %{\"#{field}\" is not a valid sort field}\n return nil\n end\n return [SORT_MAPPINGS.fetch(field, field), dir]\n end",
"title": ""
},
{
"docid": "ff27cbc88f47539ca669a2d0c97cf3c5",
"score": "0.59648937",
"text": "def apply_criteria_options\n if spec = criteria.options[:sort]\n query.sort(spec)\n end\n if spec = criteria.options[:fields]\n query.select(spec)\n end\n end",
"title": ""
},
{
"docid": "d1f9c96349e00670a6303482632c8bfa",
"score": "0.5953051",
"text": "def build_order_options(arguments, crit)\n case arguments\n when Hash\n if arguments.size > 1\n raise ArgumentError, \"Please don't use hash to define multiple orders \" +\n \"due to the fact that hash doesn't have order this may cause unpredictable results\"\n end\n arguments.each_pair do |field, direction|\n merge_options(crit.options[:sort], [ localize(field), direction ])\n end\n when Array\n merge_options(crit.options[:sort], arguments.map{ |field| localize(field) })\n when Complex\n merge_options(crit.options[:sort], [ localize(arguments.key), arguments.operator.to_sym ])\n end\n end",
"title": ""
},
{
"docid": "1d1ae9e3096563fbd7a5375f61422c50",
"score": "0.59400696",
"text": "def sort\n @sort ||= if order_by_primary_key?\n # Default order is by id DESC\n :desc\n else\n # API defaults to DESC order if param `sort` not present\n request_context.params[:sort]&.to_sym || :desc\n end\n end",
"title": ""
},
{
"docid": "20260d22cd955667fce8fbc7973d3a83",
"score": "0.592686",
"text": "def sort\n (@params[:sort] || :created_at).to_sym\n end",
"title": ""
},
{
"docid": "854bd40a276e49fa42f9514a92673836",
"score": "0.59193647",
"text": "def sort_option_indices vals\n (0...@options.size).to_a.zip(vals).sort_by(&:last).map(&:first)\n end",
"title": ""
},
{
"docid": "7394bbd6732d6cb74dc373e5745b3d93",
"score": "0.5894652",
"text": "def calculate_sort_value options\n dummy_time = dummy_time_for_day opening_hash(options['contract.default'])\n options['model'].sort_value = (dummy_time.to_f * 100).to_i\n end",
"title": ""
},
{
"docid": "3b57a558c625d7e97baac33e79cb2de4",
"score": "0.5882462",
"text": "def sort_by\n unless params[:sort].blank?\n params[:sort] if params[:sort] == 'created_at' || 'vote_score' || 'replies'\n else\n 'created_at'\n end\n end",
"title": ""
},
{
"docid": "fd53eb245a40ee10c01f62d3bfd0f33f",
"score": "0.5878629",
"text": "def hadoop_sort_args\n [\n jobconf(:key_field_separator),\n jobconf(:sort_fields),\n ]\n end",
"title": ""
},
{
"docid": "e2d8d19bd02d421490b395103ab845fc",
"score": "0.5874644",
"text": "def sort_by(att, options = {})\n sort(options.merge(:by => to_key(att)))\n end",
"title": ""
},
{
"docid": "f958ca74ae2d65ba9d06d05f5bd4be1f",
"score": "0.58660203",
"text": "def reporthelp_sorting_selector( form, method )\n return apphelp_select(\n form,\n method,\n [\n [ 'Sort by name', 'title' ],\n [ 'Sort by code', 'code' ],\n [ 'Sort by addition date', 'created_at' ]\n ],\n false\n )\n end",
"title": ""
},
{
"docid": "23b112d3ddde899b89a0bf81bd8e23c9",
"score": "0.5842802",
"text": "def sortable_sort\n @sortable_sort\n end",
"title": ""
},
{
"docid": "4b2bb6b02a8ef898fe6805ce869e91ff",
"score": "0.5828437",
"text": "def sort_order\n sort_string = params[:sort]\n if sort_string\n split = sort_string.split '_'\n sort_field = split[0]\n sort_dir = split[1]\n return {sort_field.to_sym => sort_dir}\n end\n return {text: :asc}\n end",
"title": ""
},
{
"docid": "8c154442b6a65ad17212a5b1296c3aba",
"score": "0.5815866",
"text": "def getSortingOrder #:doc:\n sorting = @default_sorting.dup\n ordering = [\"DESC\", \"ASC\", \"ASC\", \"ASC\"] # default ordering\n \n if @queryparams[:sort_by]\n # get given sort_by-values\n sorts = @queryparams[:sort_by].split(\" \")\n # get given order-values and make sure sorts.size == orders.size\n orders = Array.new(sorts.size, \"DESC\")\n if @queryparams[:order]\n orders = @queryparams[:order].split(\" \")\n if orders.size < sorts.size\n orders += Array.new(sorts.size - orders.size, \"DESC\")\n elsif orders.size > sorts.size\n orders = orders.slice(0, sorts.size)\n end\n orders.each do |o|\n if not (o.upcase == \"ASC\" or o.upcase == \"DESC\") then o = \"ASC\" end\n end \n end\n \n # first sort_by-value has to be processed last (so it gets first on the list)\n sorts = sorts.reverse\n orders = orders.reverse\n \n # check sort_by-values\n sorts.each_index do |i|\n if @sort_by.has_key?(sorts[i])\n # move the sort-attribute to first\n sort_value = @sort_by[sorts[i]]\n ind = sorting.index(\"LOWER(\" + @sort_by[sorts[i]] + \")\")\n if ind != nil\n sorting.delete_at(ind)\n ordering.delete_at(ind)\n sort_value = \"LOWER(\" + sort_value + \")\"\n end\n sorting.unshift(sort_value)\n ordering.unshift(orders[i].upcase)\n end\n end\n end\n \n #combine everything together\n returnable = sorting[0] + \" \" + ordering[0]\n sorting.each_index do |i|\n next if i == 0\n returnable += \", \" + sorting[i] + \" \" + ordering[i]\n end\n return returnable\n end",
"title": ""
},
{
"docid": "5bc6aaecce39c65251d9d805baceb82c",
"score": "0.58113956",
"text": "def sortable(default_order: {})\n # get the parameter\n sort_by = params[:sort] || params[:sort_by]\n\n if sort_by.is_a?(String)\n # split it\n sort_by_attrs = sort_by.gsub(/[^a-zA-Z0-9\\-_,]/, '').split(',')\n\n # save it\n @sortable_sort = {}\n sort_by_attrs.each do |attrb|\n if attrb.match(/^-/)\n @sortable_sort[attrb.gsub(/^-/, '')] = :desc\n else\n @sortable_sort[attrb] = :asc\n end\n end\n else\n @sortable_sort = default_order\n end\n end",
"title": ""
},
{
"docid": "d2bab0e49ff39e9b3521b65ff7093555",
"score": "0.5798115",
"text": "def sortable_attribute_options(attribute)\n sortable_attributes_options.fetch(attribute.to_s, {})\n end",
"title": ""
},
{
"docid": "a8f8f21a2b64f19749ea60ff419728b3",
"score": "0.57963127",
"text": "def ordered_options(current_course, seed = nil)\n return options if !current_course.allow_mrq_options_randomization || !randomize_options || seed.nil?\n\n randomized_options = []\n non_randomized_options = []\n options.each do |option|\n if option.ignore_randomization\n non_randomized_options.append(option)\n else\n randomized_options.append(option)\n end\n end\n\n randomized_options.shuffle(random: Random.new(seed)) + non_randomized_options\n end",
"title": ""
},
{
"docid": "6fd1f2009e80bcf7770cf8822ff7abb3",
"score": "0.57950944",
"text": "def options\n @options ||= Launchr::OrderedHash.new\n @options\n end",
"title": ""
},
{
"docid": "ff227545446df3d6defd1d4990816ca7",
"score": "0.57880974",
"text": "def sort(options = {})\n return [] if empty?\n options[:start] ||= 0\n options[:limit] = [options[:start], options[:limit]] if options[:limit]\n instantiate(db.sort(key, options))\n end",
"title": ""
},
{
"docid": "88fec7fe212bd2d1e96ec341e2fc9192",
"score": "0.5775679",
"text": "def sort_fields\n Blacklight.config[:sort_fields]\n end",
"title": ""
},
{
"docid": "2d643e719d90c5bb30ed39f50d0c0cd1",
"score": "0.5769366",
"text": "def _default_library_find_options\n {\n :by => 'created_at',\n :order => 'desc'\n }\n end",
"title": ""
},
{
"docid": "2d643e719d90c5bb30ed39f50d0c0cd1",
"score": "0.5769366",
"text": "def _default_library_find_options\n {\n :by => 'created_at',\n :order => 'desc'\n }\n end",
"title": ""
},
{
"docid": "97cc7168b6186a7fb42eb7110f7b7399",
"score": "0.5757561",
"text": "def sorted_option_string(options)\n options.map {|k, v| \"#{k}#{v}\" }.sort.join\n end",
"title": ""
},
{
"docid": "4826e792d54dcc7523c8b2c52bb8f877",
"score": "0.5756823",
"text": "def default_sort_order\n ::Mincer.config.sorting.order_attribute\n end",
"title": ""
},
{
"docid": "97dc152c4eb6330790ff6e8d39b07b50",
"score": "0.57436866",
"text": "def calls_sort_option\n column = case params[:iSortCol_0].to_s\n when '1'\n 'number'\n when '2'\n 'caller_id'\n when '3'\n 'providers.name'\n when '4'\n 'answered'\n when '5'\n 'busy'\n when '6'\n 'audio_length'\n when '7'\n 'ring_length'\n end\n column + ' ' + (params[:sSortDir_0] =~ /^A/i ? 'asc' : 'desc') if column\n end",
"title": ""
},
{
"docid": "87137dc64a6b2553a8e5b2793c5d5655",
"score": "0.5743473",
"text": "def order(*args)\n with_opts(:order=>args.freeze)\n end",
"title": ""
},
{
"docid": "4e85dd563fe88725cf6c6d17d73cf8b1",
"score": "0.5740802",
"text": "def order_to_sort_by(sortby)\n if sortby.nil?\n return [nil, nil]\n elsif sortby == 'newest'\n return ['created_at', true]\n elsif sortby == 'described'\n return ['described_at', true] # use this for some RSS\n elsif sortby == 'relevant'\n return [nil, nil]\n else\n raise \"Unknown sort order \" + @sortby\n end\n end",
"title": ""
},
{
"docid": "bd05089e3cfc678ca5ebeba29a17958e",
"score": "0.5736116",
"text": "def get_options; end",
"title": ""
},
{
"docid": "762ccbdb50995f4c1fa854cffb6ab8e2",
"score": "0.57337",
"text": "def order(ordering=nil)\n @options[:order] = ordering if ordering.kind_of?(String)\n end",
"title": ""
},
{
"docid": "e67546defccfda59c4fa6e1684ad4ec0",
"score": "0.5725755",
"text": "def default_sort\n { order: :created_at, direction: :desc }\n end",
"title": ""
},
{
"docid": "cdbf3e8d24b5d0fec0b2da091afcca9c",
"score": "0.5722686",
"text": "def order_params\n if params[:order_by]\n order_from_params\n else\n { created_at: Sortable::DIRECTION_DESC }\n end\n end",
"title": ""
},
{
"docid": "44a3d572457d3fc0676c99bcaec9fce7",
"score": "0.57186055",
"text": "def sort_direction\n params[:direction] || \"asc\"\n end",
"title": ""
},
{
"docid": "11934a64559b538c634a70e48972e746",
"score": "0.56970096",
"text": "def sort_direction\n params[\"order\"][\"0\"][\"dir\"] == \"desc\" ? \"desc\" : \"asc\"\n end",
"title": ""
},
{
"docid": "0234903d8af0426053f47a2be4055a05",
"score": "0.5696494",
"text": "def order\n \"#{sort} #{dir}\"\n end",
"title": ""
},
{
"docid": "2eb51d0badadfeb482e5451c088e18b0",
"score": "0.5683329",
"text": "def sort(options = {})\n if options.has_key?(:get)\n options[:get] = to_key(options[:get])\n\n Stal.solve(redis, [\"SORT\", key, *Utils.sort_options(options)])\n else\n fetch(Stal.solve(redis, [\"SORT\", key, *Utils.sort_options(options)]))\n end\n end",
"title": ""
},
{
"docid": "da5dc90bf9c3a71396e6473534857b86",
"score": "0.5682846",
"text": "def options\n Hash[ * VALID_OPTIONS_KEYS.map { |key| [key, send(key)] }.flatten ]\n end",
"title": ""
},
{
"docid": "c7bee570fee8f7787c5f6adc8cb1363e",
"score": "0.5662863",
"text": "def sort_params params\n if @sortable\n pairs = sort_pairs(params)\n found_pair = false\n pairs.each_with_index{|pair,index|\n if pair[0] == self.name.to_s\n pairs[index][1] = pair[1] == \"asc\" ? \"desc\" : \"asc\"\n found_pair = true\n end\n }\n unless found_pair\n pairs << [self.name.to_s,\"asc\"]\n end\n (pairs.map{|pair| pair.join(\",\")}).join(\"|\")\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "e5a68989ee96194e6aa8507e853dd5d9",
"score": "0.56622803",
"text": "def options\n self.class.instance_variable_get(:@__options) || []\n end",
"title": ""
},
{
"docid": "191a08fcc9c2b4546d7578f058ac1dba",
"score": "0.56604964",
"text": "def initialize(*args)\n if (args.size == 1 && args[0].is_a?(Hash))\n options = args[0]\n @name = options[:name]\n @value = options[:value]\n elsif (args.size == 1 && args[0].nil?)\n # Use the first of the valid sort options as the default\n @name = @@sort_options[0].name\n @value = @@sort_options[0].value\n elsif (args.size == 2)\n @name, @value = args\n else\n raise InvalidSortOption, \"Invalid arguments provided to ProductSortOption constructor\"\n end\n\n end",
"title": ""
},
{
"docid": "4fc9b065700e5a7bba03d93ef2b9ae95",
"score": "0.5658646",
"text": "def options\n unless params[:cancel] == \"true\"\n @per_page = @current_user.pref[:customfields_per_page] || Customfield.per_page\n @outline = @current_user.pref[:customfields_outline] || Customfield.outline\n @sort_by = @current_user.pref[:customfields_sort_by] || Customfield.sort_by\n @sort_by = Customfield::SORT_BY.invert[@sort_by]\n end\n end",
"title": ""
},
{
"docid": "bcf882f40852564321b723525dd3267a",
"score": "0.5656531",
"text": "def convert_sort_params\n @sort_params = []\n #convert sort params to database columns\n if params[:sorting] && params[:sorting].is_a?(Array)\n params[:sorting].each do |p|\n\n sort = sort.reject{|k, v| !@resource.attribute_method?(k) || !['asc', 'desc'].include?(v.downcase)}\n\n @sort_params.push(sort)\n end\n end\n @sort_params\n end",
"title": ""
},
{
"docid": "6db0f801ef3de12a761cef58453dedb8",
"score": "0.5649629",
"text": "def options\n Hash[VALID_OPTIONS.map { |key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "a70cbe99888e0b5744379dd86ccc4baf",
"score": "0.5645964",
"text": "def default_sort_attribute\n ::Mincer.config.sorting.sort_attribute\n end",
"title": ""
},
{
"docid": "202d558fa27d513322b7e54e752565b1",
"score": "0.5633694",
"text": "def list_entries_with_sort\n if params[:sort].present? && sortable?(params[:sort])\n list_entries_without_sort.except(:order).order(sort_expression)\n else\n list_entries_without_sort\n end\n end",
"title": ""
},
{
"docid": "a43acd56b446f254e93feb249e75fbd4",
"score": "0.5630863",
"text": "def sort!\n sort_if_needed\n self\n end",
"title": ""
},
{
"docid": "69238a7288c65e22153c8d9c04ab588a",
"score": "0.5629301",
"text": "def list_filter_options(**opt)\n # May be overridden by the subclass.\n end",
"title": ""
},
{
"docid": "851971ad6c4db32346f4747ae3833ae9",
"score": "0.56126237",
"text": "def options(opt)\n []\n end",
"title": ""
},
{
"docid": "6f9dd934276dec0476dd532e454760f9",
"score": "0.56068623",
"text": "def sort_dir\n params[:sort_dir] == 'desc' ? 'desc' : 'asc'\n end",
"title": ""
},
{
"docid": "5e0f70563bdec658e4e8ee0bba86a437",
"score": "0.5604634",
"text": "def sort_by(att, options = {})\n sort(options.merge(:by => model.key(\"*\", att)))\n end",
"title": ""
},
{
"docid": "61285db2bf702f484ae2b334c56290a2",
"score": "0.5591945",
"text": "def sort_direction\n %w[asc desc].include?(params[:sort]) ? params[:sort] : nil\n end",
"title": ""
},
{
"docid": "61285db2bf702f484ae2b334c56290a2",
"score": "0.5591945",
"text": "def sort_direction\n %w[asc desc].include?(params[:sort]) ? params[:sort] : nil\n end",
"title": ""
},
{
"docid": "897779473d5fe12afc2c61dc783bf5b2",
"score": "0.5587568",
"text": "def options\n return @options\n end",
"title": ""
},
{
"docid": "6a924fec2f6fc4234d45560fbd81a11f",
"score": "0.55873376",
"text": "def options(include_deprecated: false)\n src = File.read(CONFIG_RB_PATH)\n src.scan(OPTION_PATTERN)\n .map { |opt| Option.from_captures(opt) }\n .reject { |opt| !include_deprecated && opt.deprecated? }\n .sort_by { |opt| opt.name }\n end",
"title": ""
},
{
"docid": "7e91e02611441c6e3528a6805e96606c",
"score": "0.55817866",
"text": "def order_by(opt)\n raise ArgumentError, \"invalid order by value\" unless %w(sld tld nsstatus expdate renew).include?(opt)\n @options['orderby'] = opt\n self\n end",
"title": ""
},
{
"docid": "5adf5d5d49c1c6f95e9cc4c35e003dbe",
"score": "0.5578574",
"text": "def sort?(options)\n method == 'GET' && params.fetch(:sort, false) && relation?(options)\n end",
"title": ""
},
{
"docid": "9b338275cb3f685dade99cce83368089",
"score": "0.5566873",
"text": "def get_sorting (default_sort_key)\n \n # Allowed sort fields, can sort by only these fields (are indexed) \n sort_keys = ['name', 'a_id', 'pub_id' , 'popularity_weight', 'category', \n 'sub_category', 'interests', 'release_date', \n 'total_ratings_count', 'total_average_rating',\n 'current_ratings_count', 'current_average_rating',\n 'new_apps', 'new_free_apps', 'new_paid_apps', \n 'top_free_apps_iphone', 'top_paid_apps_iphone',\n 'top_gros_apps_iphone', 'top_free_apps_ipad',\n 'top_paid_apps_ipad', 'top_gros_apps_ipad', 'amount',\n 'pub_name']\n \n # Get the sort_by parameter if it exists, otherwise use the default\n sort_param = request.query_parameters['sort_by'] || default_sort_key\n \n # Make sure the sort parameter is in our allowed list \n sort_key = sort_param if sort_keys.include?sort_param \n return sort_key\n \n end",
"title": ""
}
] |
f476145a9d34bf1f063912d6dba670a7 | generate password reset info (token + digest + send email) after request | [
{
"docid": "29be3d7a9d68dba50d36ccc947998f39",
"score": "0.0",
"text": "def create\n @user = User.find_by(email: params[:password_reset][:email].downcase)\n if @user\n # create token & digest\n @user.create_reset_digest\n # send email to recover the password\n @user.send_password_reset_email\n # redirect to root url\n flash[:info] = \"Password instructions sent to your email\"\n redirect_to root_url\n else\n flash.now[:danger] = \"The email is not recognized\"\n render \"new\"\n end\n end",
"title": ""
}
] | [
{
"docid": "1e90c711a43ad653c531c4af3a95e57b",
"score": "0.77303624",
"text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_digest, User.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n UserMailer.password_reset(self, self.reset_token).deliver_later\n end",
"title": ""
},
{
"docid": "346b7d845e9882f197457a5bc29ed0e0",
"score": "0.7692963",
"text": "def create_reset_digest\n generate_token(:password_reset_token)\n update_attribute(:password_reset_sent_at, Time.zone.now)\n end",
"title": ""
},
{
"docid": "d4df607f0627535d2c9ed52d61aedd52",
"score": "0.76845574",
"text": "def send_reset_password_instructions\n token = set_reset_password_token\n send_reset_password_instructions_notification(token) if email.present?\n send_reset_password_instructions_message(token) if phone.present?\n token\n end",
"title": ""
},
{
"docid": "803c1234fe099d198def28b331728410",
"score": "0.75998783",
"text": "def send_password_reset_email\n generate_token(:reset_digest)\n save!\n # self.password_resets_sent_at = Time.zone.now\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "911551aa859709f09123ac90d3dbe54d",
"score": "0.7544485",
"text": "def send_reset_password_instructions\n token = set_reset_password_token\n send_reset_password_instructions_notification(token)\n\n token\n end",
"title": ""
},
{
"docid": "3e1ca2a2aee2de3db8661c88d2bb19e4",
"score": "0.7537602",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n update(password_reset_time: Time.now)\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "30dbce172c44a39fb03d8137a6741f3b",
"score": "0.75180656",
"text": "def send_api_v1_reset_password_instructions\n token = set_reset_password_token\n UserMailer.api_v1_reset_password_instructions(self, token).deliver\n token\n end",
"title": ""
},
{
"docid": "f87ae9bb5b0de0896f639b7e46fbf4bb",
"score": "0.75042844",
"text": "def send_password_reset_email\n self.reset_token = User.new_token\n update_attribute :reset_digest, User.digest(self.reset_token)\n update_attribute :reset_sent_at, Time.now\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "9386648226fa7a852de05c6bc29cd4a1",
"score": "0.7499807",
"text": "def send_reset_password_instructions\n token = set_reset_password_token\n send_reset_password_instructions_email(token)\n end",
"title": ""
},
{
"docid": "390110efa491042bce39ce63a1924fbe",
"score": "0.7473099",
"text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:forgot_password_digest, User.digest(reset_token))\n update_attribute(:forgot_password_sent_at, Time.zone.now)\n end",
"title": ""
},
{
"docid": "ac78e6ef7ec07537bc04f3e2bfff683b",
"score": "0.74703664",
"text": "def password_reset\n user = User.first\n user.reset_token = SecureRandom.uuid\n user.e_token = User.digest(user.email)\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "96ed5b54d0da20978395fcbe131071ed",
"score": "0.7443242",
"text": "def generate_password_reset!\n self.password_reset_token = SecureRandom.urlsafe_base64\n self.password_reset_sent_at = Time.zone.now\n save_with_identity_password_reset!\n end",
"title": ""
},
{
"docid": "7907a01b96cc3f1cfb6caaba8c2eaf8b",
"score": "0.7442202",
"text": "def send_password_reset\n # generate a new token to reset password after email is asked for\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n # save the token and the password time\n save(validate: false)\n # send the mail with the token\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "ec3a2a9f93c3c368bfda0b3648500a57",
"score": "0.7431145",
"text": "def prepare_to_reset_password\n generate_reset_password_token!\n end",
"title": ""
},
{
"docid": "6943029e32d8cefffc573bffccbcf86c",
"score": "0.74255717",
"text": "def send_reset_password_instructions\n\t\t\n\tend",
"title": ""
},
{
"docid": "0c5a8eef84b64b93ed355d399e7d2cca",
"score": "0.7413226",
"text": "def send_password_reset_email\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n self.save \n Usermail.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "710bdaed24904ec000ee5cd56ad3f1ed",
"score": "0.74011886",
"text": "def reset_password\n self.update(:reset_digest => self.generate_token(:reset_digest))\n\n template = {\n :template => File.join('accounts', 'reset_password'),\n :locals => {\n :reset_digest => self.reset_digest\n }\n }\n message = {\n :subject => \"Reset Password\",\n :to => [ { :email => self.email, :name => self.name } ],\n :merge_vars => [{\n \"rcpt\" => self.email,\n \"vars\" => [{ \"content\" => self.name, \"name\" => \"name\" }]\n }]\n }\n Applyance::Lib::Emails::Sender::send_template(template, message)\n\n end",
"title": ""
},
{
"docid": "e7950e74bffe31a3356c4162636836d6",
"score": "0.7394408",
"text": "def send_password_reset \n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(:validate => false)\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "976dde880b3a06ce58c77a92b292ebec",
"score": "0.73930043",
"text": "def send_password_reset\n generate_token(:reset_password_token)\n self.reset_password_sent_at =Time.zone.now \n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "95feeb9318385de35d3625eb73c70edf",
"score": "0.73896474",
"text": "def request_reset_password\n end",
"title": ""
},
{
"docid": "d6f9fb4ed7d28289fe570e87fc21c3e7",
"score": "0.73825425",
"text": "def send_password_reset\n generate_token(:reset_token)\n self.reset_token_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "773e7e3e003cec9cfe2e80d8fc03b937",
"score": "0.73732877",
"text": "def send_password_reset\n\t generate_token(:password_reset_token)\n\t self.password_reset_sent_at = Time.zone.now\n\t save!\n\t UserMailer.forgot_password(self).deliver \n end",
"title": ""
},
{
"docid": "b4cb67e6746b51c03cdf0967d477469a",
"score": "0.7348272",
"text": "def forgot_password_with_email\n update(reset_password_token: rand(10 ** 8))\n UserMailer.new.forgot_password(self)\n end",
"title": ""
},
{
"docid": "df662be472d873a01044c3a09c555567",
"score": "0.73463243",
"text": "def forgot_password_with_email\n update(reset_password_token: rand(10 ** 8))\n UserMailer.forgot_password(self).deliver_now\n end",
"title": ""
},
{
"docid": "0e68a770b1d893cca11580cad63901c6",
"score": "0.7341785",
"text": "def generate\n user = User.find_by_email(params[:email])\n ResetMailer.reset_password_email(user).deliver\n return render_success({status:\"success\", message:\"email sent\"})\n end",
"title": ""
},
{
"docid": "a9cd16a33ae3b331764dc24e82da1f6b",
"score": "0.73377603",
"text": "def send_password_reset!\n self.resetPasswordCodeExpires = 1.day.from_now\n seed = \"#{email}#{Time.now.to_s.split(//).sort_by {rand}.join}\"\n self.resetPasswordCode = Digest::SHA1.hexdigest(seed)\n self.save\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "4454f7974dc7c2b2aada7b1647cb273f",
"score": "0.73375475",
"text": "def send_new_password\n email= email_reset_params[\"email\"]\n user_info=UserInfo.find_by_email(email)\n if user_info\n user=User.find(user_info.user_id)\n password= SecureRandom.urlsafe_base64(8)\n user.update_attribute(:new_password, password)\n UserMailer.reset_password(email, user.username, password).deliver\n redirect_to signin_path\n else\n flash.now[:error]=\"E-mail not found\"\n render :action => 'forget_password'\n end\n\n end",
"title": ""
},
{
"docid": "6ae329a362410d37a8b12dc6a8ce5fef",
"score": "0.73325306",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n save!\n #generates token, saves into password_reset_token column, saves in place\n UserMailer.password_reset(self).deliver\n # invokes the UserMailer, uses the password_reset on the user, deliver sends the actual message\n end",
"title": ""
},
{
"docid": "2573669648aa30c40b0e2e2f0db4008b",
"score": "0.73286885",
"text": "def create\n @user.update_reset_digest\n @user.send_password_reset_email\n head 201\n end",
"title": ""
},
{
"docid": "4e08e1aedd62af5871799d56bf7d85c3",
"score": "0.7316568",
"text": "def send_reset_password_instructions\n #token = set_reset_password_token\n raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)\n self.reset_password_token = enc\n self.reset_password_sent_at = Time.now.utc\n self.save(validate: false)\n token = raw\n\n if login_is_email?\n send_devise_notification(:reset_password_instructions, token, {})\n else\n text_reset_password_instructions(token)\n end\n\n token\n end",
"title": ""
},
{
"docid": "a88a9cde46df17fa9955b72418283485",
"score": "0.73028743",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.update_attributes(password_reset_time: Time.now)\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "5a465cb1508b79ed0926ab33f21f0623",
"score": "0.730225",
"text": "def send_password_reset\n \t\tgenerate_token(:password_reset_token)\n \t\tself.password_reset_sent_at = Time.zone.now\n \t\tsave!\n \t\tUserMailer.password_reset(self).deliver\n\tend",
"title": ""
},
{
"docid": "af71007295a73e8d6fdfc2497381259d",
"score": "0.72983825",
"text": "def send_reset_password_instructions\n return if a_template_or_batch_user? || !allow_users_to_register?\n\n token = set_reset_password_token\n options = { reset_password_hash: token }\n Users::PasswordRecovery.notify self, options\n token\n end",
"title": ""
},
{
"docid": "9061c5d687ccdd0f3b42b2e3688ef85b",
"score": "0.72627515",
"text": "def send_password_reset_instructions\n email = params[:sessions][\"email\"]\n @user = User.find_by_email(email)\n\n if @user.present?\n @user.password_reset_token = SecureRandom.urlsafe_base64\n @user.password_expires_after = 24.hours.from_now\n @user.save\n UserMailer.reset_password_email(@user).deliver\n flash[:notice] = \"Password instructions have been mailed to you. Please check your inbox.\"\n redirect_to :sign_in\n else\n @user = User.new\n @user.name = params[:sessions][\"name\"]\n @user.errors[\"name\"] = 'is not a registered user.'\n render :action => \"forgot_password\"\n end\n end",
"title": ""
},
{
"docid": "a7247cea15336b71b41c4dd6611aa8bb",
"score": "0.7251948",
"text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_password_token, User.digest(reset_token))\n update_attribute(:reset_password_sent_at, Time.zone.now)\n end",
"title": ""
},
{
"docid": "20af322e12d37a4053a031fe172b3f29",
"score": "0.72465545",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "20af322e12d37a4053a031fe172b3f29",
"score": "0.72465545",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "20af322e12d37a4053a031fe172b3f29",
"score": "0.72465545",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "20af322e12d37a4053a031fe172b3f29",
"score": "0.72465545",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "20af322e12d37a4053a031fe172b3f29",
"score": "0.72465545",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "20af322e12d37a4053a031fe172b3f29",
"score": "0.72465545",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "20af322e12d37a4053a031fe172b3f29",
"score": "0.72465545",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "7eaa96c41e0f2c37ec1721801fc11bb6",
"score": "0.72465163",
"text": "def forgot_password\n reset_perishable_token!\n Notifier.deliver_password_reset(self) \n end",
"title": ""
},
{
"docid": "21a88a48114ebe265855ea6635bb96fd",
"score": "0.72415763",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n #Dont do password check - only email supplied\n self.skip_password = true\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "d28f983521ea1135868c07f57264aa30",
"score": "0.72384423",
"text": "def initiate_password_reset_request!\n make_password_reset_token\n @needs_password_reset_mail = true\n self.save\n end",
"title": ""
},
{
"docid": "9fa7785d38a037ce806b1cc02fff99f9",
"score": "0.72378117",
"text": "def reset_password_instructions\n AccountsMailer.reset_password_instructions(User.first, 'faketoken', {})\n end",
"title": ""
},
{
"docid": "68fd1eee1380493fe61ba159599ce1b5",
"score": "0.7226381",
"text": "def password_reset\n \tuser = User.second\n \tuser.reset_token = User.new_token\n \tuser.update_attribute(:reset_sent_at,Time.zone.now)\n \tuser.update_attributes(reset_digest:User.digest(user.reset_token))\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "286fb3b9733166ac084bd1427a969923",
"score": "0.7225472",
"text": "def forgot_password\n self.make_password_reset_code\n UserMailer.deliver_forgot_password(self)\n end",
"title": ""
},
{
"docid": "4bf82e61c7d514146678ce22b13153e9",
"score": "0.7187606",
"text": "def request_password_reset\n end",
"title": ""
},
{
"docid": "e368000f73ce42846c6faaeda66521b9",
"score": "0.71831536",
"text": "def password_reset(user)\n # return success/fail\n # add code and email pair to somewhere (global variable or database)\n @code = rand() * 1000000\n @code = @code.floor\n @user = user\n \n ResetPwd.create(:email => @user.email, :reset_token => @code)\n \n @msg = mail to: user.email, subject: \"reset password\"\n end",
"title": ""
},
{
"docid": "cc5d17d3ec081198f09212efdf4cae75",
"score": "0.7165736",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.forgot_password(self).deliver# This sends an e-mail with a link for the user to reset the password\n end",
"title": ""
},
{
"docid": "10bb6a50ee49339dbe6d8fb783a1e8f2",
"score": "0.7158563",
"text": "def send_email_password_reset\n\t\tlogger.debug 'send_email_passuword_reset'\n\t\tlogger.debug @user.perishable_token\n\t\tcorpo = <<-CODE\n\t\t<b>Instrucoes para mudar a senha<br /></b>\n\t\t<b>Login: </b>#{@user.login}<br />\n\t\t<b>E-mail: </b>#{@user.email}<br />\n\t\t<b>Para trocar a senha <b>Link: </b><a href='#{edit_password_reset_url(@user.perishable_token)}'>clique aqui.</a>\n\t\tCODE\n\t\tEmail.deliver_padrao(:corpo => corpo, :assunto => \"Instrucoes para trocar a senha\", :para => @user.email)\n\tend",
"title": ""
},
{
"docid": "e5ae7e77f850ad11784e7e2873f6473f",
"score": "0.7153875",
"text": "def password_recovery(user)\n @token = user.reset_password_code\n @until_time = user.reset_password_code_until.localtime\n\n mail :to => user.email\n end",
"title": ""
},
{
"docid": "86b26a7868a25e4cb829926f203471b9",
"score": "0.71518815",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.now\n save(validate:false)\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "fc17313560c88fb1f5495dddd735dbef",
"score": "0.714885",
"text": "def send_password_reset\n\t generate_token(:password_reset_token)\n\t self.password_reset_sent_at = Time.zone.now\n\t save!\n\t UserMailer.password_reset(self).deliver\n\tend",
"title": ""
},
{
"docid": "c6bc1ed164315cb9ffa507b5c7a92439",
"score": "0.71411455",
"text": "def password_reset\n ngo = Ngo.first\n ngo.reset_token = Ngo.new_token\n NgoMailer.password_reset(ngo)\n end",
"title": ""
},
{
"docid": "26915c61d3ae90cdb17a4c3f97ae2375",
"score": "0.7135068",
"text": "def forgot_password\n @user = User.find_by_email(params[:email])\n if !@user.nil?\n @user.password_reset_token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(password_reset_token: random_token)\n end\n if @user.save\n UserMailer.delay.forget_password(@user)\n render json: success(true)\n else\n # :nocov:\n error_obj = {\n \t\t code: 520,\n \t message: \"Cannot generate reset password token for this user.\"\n \t\t}\n \t render json: error(error_obj, 'error')\n # :nocov:\n end\n else\n error_obj = {\n \t\tcode: 404,\n \t\tmessage: \"Cannot find accout with your email address\",\n external_message: 'Sorry, cannot find account with ' + params[:email]\n }\n \t render json: error(error_obj, 'error')\n end\n end",
"title": ""
},
{
"docid": "2ecf41f42949cf611217cc89e678854a",
"score": "0.7129658",
"text": "def send_api_v2_reset_password_instructions\n UserMailer.api_v2_reset_password_instructions(self, reset_user_password_to_random).deliver\n end",
"title": ""
},
{
"docid": "9104b724d70154a52e3af2b3cbe662bd",
"score": "0.71251976",
"text": "def create\n email = params[:reset][:email]\n user = User.find_by(email: email)\n\n if user\n @hash = Digest::SHA1.hexdigest(\"#{user.email}-#{DateTime.now.strftime(\"%M%S%L\")}\").to_s\n reset_request = PasswordResetRequest.new\n reset_request.user = user\n reset_request.link = @hash\n puts @hash\n if reset_request.save\n @fulfill_link = \"/password_reset_request/#{@hash}\"\n PasswordResetMailer.link_to_reset_password(@fulfill_link, user).deliver\n redirect_to \"/login\"\n else\n render code: 500, text: \"Unable to create code\"\n end\n else\n render code: 400, text: \"Cannot find user: #{email}\" \n end\n end",
"title": ""
},
{
"docid": "c4bd6175020a1f2317aebbd10cf8d9aa",
"score": "0.71199083",
"text": "def password_reset\n use = Use.first\n use.reset_token = Use.new_token\n UseMailer.password_reset(use)\n end",
"title": ""
},
{
"docid": "598017e69c8a806623fa0edab309cf6f",
"score": "0.7118547",
"text": "def create_reset_digest\n self.reset_token= SecureRandom.urlsafe_base64\n self.reset_sent_at=Time.zone.now\n save!\n end",
"title": ""
},
{
"docid": "5959a115fe4c0326a5713592a29b3485",
"score": "0.7112081",
"text": "def prepare_password_reset\n update(\n password_reset_token: SecureRandom.hex,\n password_reset_expire: 1.day.from_now\n )\n password_reset_token\n end",
"title": ""
},
{
"docid": "3326cad5c86ca1d1ac1a37f161762072",
"score": "0.71115994",
"text": "def forgot_password\n m = Mandrill::API.new 'BCyRB5oNxOdZCcjMqpzpzA'\n user = User.find_by(:email => params[:sessions][:email])\n redirect_to login_path and return if user.nil? \n domain = \"http://localhost:3000\"\n token = Token.generate_random\n Token.create(:user_id => user.id, :token_type => 'password', :key => token)\n \n message = {\n :subject=> \"[QuestBoard] Reset Password\",\n :from_name=> \"QuestBoard\",\n :text => \"Hi,\\r\\n\\r\\nYou requested to reset your password. Click on the link below to receive your new password\\r\\n #{domain}/reset_password?email=#{user.email}&token=#{token}\\r\\n\\r\\nIf it wasn't you, please disregard this email.\\r\\n\\r\\nRegards,\\r\\nThe team\",\n :to=>[\n {\n :email=> \"#{params[:sessions][:email]}\",\n :type=>\"to\",\n :name=> \"#{user.first_name}\" \n }\n ],\n :from_email=>\"team@questboard.com\"\n }\n sending = m.messages.send message\n redirect_to login_path \n\n end",
"title": ""
},
{
"docid": "e681960691ca41415ee1813bb68fa767",
"score": "0.7098738",
"text": "def create_reset_digest\n\t self.reset_token = User.new_token\n\t update_attribute(:reset_digest, User.digest(reset_token))\n\t update_attribute(:reset_sent_at, Time.zone.now)\n\t end",
"title": ""
},
{
"docid": "a3b9a8896a9b842d4f1d9581539a9847",
"score": "0.7097534",
"text": "def send_password_reset\n\t \tgenerate_token(:password_reset_token)\n\t \tself.password_reset_sent_at = Time.zone.now\n\t \tsave!(validate: false)\n\t \tUserMailer.password_reset(self).deliver\n\t end",
"title": ""
},
{
"docid": "0e2e3af8e6c11d2cd6003f48f10505c0",
"score": "0.70963657",
"text": "def create_reset_digest\n self.reset_token = SecureRandom.urlsafe_base64\n update_attribute(:reset_digest, digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n end",
"title": ""
},
{
"docid": "f873dd14ea9882e0ba7b28e41b1bf30d",
"score": "0.7094307",
"text": "def password_reset(user, raw_token, request)\n @user = user\n @user_raw_token = raw_token\n @domain = request.domain || request.remote_ip\n mail :to =>user.email, :subject =>\"Password Reset\"\n end",
"title": ""
},
{
"docid": "239d9d1b6a3d0e7b209cb00a63069689",
"score": "0.7090266",
"text": "def send_password_reset_notification\n generate_password_reset_code\n deliver_password_reset_email(:password_reset, :subject => (MaSPR[:password_reset_subject] || \"Request to change your password\"))\n end",
"title": ""
},
{
"docid": "ef027e1a5e41910de2d0eb9b819cf487",
"score": "0.7089114",
"text": "def get_reset_password_token\n set_reset_password_token\n end",
"title": ""
},
{
"docid": "75d55d4e677249559e14588f941bc57c",
"score": "0.70871204",
"text": "def create_reset_digest\n\t self.reset_token = User.new_token\n\t update_attribute(:reset_digest, User.digest(reset_token))\n\t update_attribute(:reset_sent_at, Time.zone.now)\n\t end",
"title": ""
},
{
"docid": "36d8ee9bbd194522cc8f230330622ed0",
"score": "0.70840055",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n # Although we only update the reset token, the validation will be processed by default\n # in order to save it correctly, we have to ignore validation\n save! :validate => false\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "ca41c1b5bcde969d0d27343bba0d69f0",
"score": "0.7083866",
"text": "def password_reset\n # 12.10 - Working preview method for password reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end",
"title": ""
},
{
"docid": "9e693dae721b4c05501619d68b100bc0",
"score": "0.70768803",
"text": "def send_reset_password_token\n set_reset_password_token\n end",
"title": ""
},
{
"docid": "05122d7a22af267c0b72b9415ebce1ed",
"score": "0.7067934",
"text": "def generate_password_reset_token!\n update_attribute(:password_reset_token, SecureRandom.urlsafe_base64)\n end",
"title": ""
},
{
"docid": "f152da4ceeebb96dd5ec0a200d6653a7",
"score": "0.70544034",
"text": "def deliver_password_reset_instructions! \n reset_perishable_token! \n Emailer.password_reset_instructions(self) \n end",
"title": ""
},
{
"docid": "1a476ba9cfd4da589121960db985bd2e",
"score": "0.70523614",
"text": "def create_reset_digest\n\t\tself.reset_token = User.new_token\n\t\tupdate_attribute(:reset_digest, User.digest(reset_token))\n\t\tupdate_attribute(:reset_send_at,Time.zone.now)\n\tend",
"title": ""
},
{
"docid": "ca15ca485820f006f1502a20d634fdcc",
"score": "0.704737",
"text": "def password_reset\n band = Band.first\n band.reset_token = Band.new_token\n bandMailer.password_reset(band)\n end",
"title": ""
},
{
"docid": "d107aa13b85de7b20d34b8de078dca5a",
"score": "0.7044063",
"text": "def create_reset_digest\n\t\tself.reset_token = User.new_token\n\t\tupdate_attribute(:reset_digest, User.digest(reset_token))\n\t\tupdate_attribute(:reset_send_at, Time.zone.now)\n\tend",
"title": ""
},
{
"docid": "fe78aac9a62123d9ca7238031667b978",
"score": "0.70409596",
"text": "def send_password_reset\n\t\tgenerate_token(:password_reset_token)\n\t\tself.password_sent_at = Time.zone.now\n\t\tsave!\n\t\tUserMailer.password_reset(self).deliver\n\tend",
"title": ""
},
{
"docid": "4914da689630eb638e4aee2cc84e1df4",
"score": "0.70409095",
"text": "def generate_reset_password\n loop do\n token = SecureRandom.hex\n self.reset_password_token = SecureRandom.hex\n self.reset_password_at = Time.now\n if valid?\n save\n break token\n end\n end\n end",
"title": ""
},
{
"docid": "cc0a984e30a057db473e9b3881f06e51",
"score": "0.7040047",
"text": "def send_password_reset(user)\n @user = user\n self.password_reset_sent_at = Time.zone.now\n generate_token(:password_reset_token)\n save!\n UserMailer.reset_pass_email(@user).deliver\n end",
"title": ""
},
{
"docid": "d2b9eb00bbec82a07ea19212d294a849",
"score": "0.7037371",
"text": "def reset_password(id,email_address,password,username,token)\n @subject = \"Plaggs \" \"-\" \" Password Reminder\"\n @body['id'] = id\n @body['password'] = password\n @recipients = email_address\n @body['username'] = username\n @body['token'] = token\n @from = \"support@plaggs.com\"\n @content_type = \"text/html\"\n end",
"title": ""
},
{
"docid": "6038c80030b5d5d19489b6f508be2fee",
"score": "0.7035582",
"text": "def password_reset\nuser = User.first\nuser.reset_token = User.new_token\nUserMailer.password_reset(user)\nend",
"title": ""
},
{
"docid": "c55b2519e994e3cad9cb2b93eaa06065",
"score": "0.70326877",
"text": "def api_v1_reset_password_instructions(user, token)\n @user = user\n @locale = @user.locale.try(:name)\n @reset_password_path = \"#{Config.ui_url}?reset_password_token=#{token}\"\n mail(to: @user.email, subject: 'Password Reset Instructions')\n end",
"title": ""
},
{
"docid": "f43b09d587c2a575d58f75dbd1bdd4b4",
"score": "0.7029258",
"text": "def send_password_reset_code\n reset_perishable_token!\n UserMailer.deliver_password_reset_code(self)\n end",
"title": ""
},
{
"docid": "7fa68f6d0a899de389fa2631ea40e83a",
"score": "0.7027928",
"text": "def send_password_reset_text\n\n end",
"title": ""
},
{
"docid": "2eb1dc26e0ced740cf41af87c68447bc",
"score": "0.702313",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "857398eb7704860fe37b3504ffbb655d",
"score": "0.70164424",
"text": "def send_reset_password_instructions\n if may_login?\n generate_password\n save(validate: false)\n send_sms_with_password\n end\n end",
"title": ""
},
{
"docid": "a34846ad4565c077865674fe675293bd",
"score": "0.70163655",
"text": "def create_reset_digest\n self.reset_token = User.nuovotoken\n update_attribute(:reset_digest, User.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n end",
"title": ""
},
{
"docid": "49028bdfe0dbf4b84e9f571f653a276d",
"score": "0.70154",
"text": "def request_password_reset!( email )\n object = authentications.where( provider: :password, uid: email ).first\n raise NotFoundError.new \"Failed to find password authentication for user with email:'#{email}'\" unless object\n object.password_reset_token = User.generate_confirmation_token\n object.save!\n object\n end",
"title": ""
},
{
"docid": "a0aec62d7a0f55e213800577c2c08f1a",
"score": "0.70125514",
"text": "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n MemberMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "a3041ebfdc81e7f8e3403cca26c36273",
"score": "0.7009877",
"text": "def send_password_reset_email\n UserMailer.password_reset(self, reset_token).deliver_later\n end",
"title": ""
},
{
"docid": "4a11ceb112e2b2ddde8ab20efcb0ac6f",
"score": "0.7008944",
"text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_digest, User.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n end",
"title": ""
},
{
"docid": "3f9f8a7b50e9d9cfcb8bdb4a8da8d77d",
"score": "0.7002302",
"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": "99c38f8291f5d5b34d1d6835259bc24b",
"score": "0.70018953",
"text": "def generate_reset_password_token!\n # Source: https://github.com/plataformatec/devise/blob/master/lib/devise/models/recoverable.rb#L47\n raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)\n self.reset_password_token = enc\n self.reset_password_sent_at = Time.now.utc\n self.save(:validate => false)\n\n send_devise_notification(:reset_password_instructions, raw, {})\n raw\n end",
"title": ""
},
{
"docid": "626c0187e6a7b62de3d48da840aa3999",
"score": "0.70014584",
"text": "def reset_password_instructions(user)\n setup_email(user)\n @subject += \"reset your password.\"\n \n end",
"title": ""
},
{
"docid": "c116fd895d4c41efe83e98789760111c",
"score": "0.69998217",
"text": "def password_reset\n\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset user\n end",
"title": ""
},
{
"docid": "ca4f8571ecb228d8619fbf39ac04ac25",
"score": "0.69990104",
"text": "def send_password_reset\n generate_key(:password_reset_key)\n self.password_reset_sent_at = Time.zone.now\n save!(:validate => false)\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "ca4f8571ecb228d8619fbf39ac04ac25",
"score": "0.69990104",
"text": "def send_password_reset\n generate_key(:password_reset_key)\n self.password_reset_sent_at = Time.zone.now\n save!(:validate => false)\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "ca4f8571ecb228d8619fbf39ac04ac25",
"score": "0.69990104",
"text": "def send_password_reset\n generate_key(:password_reset_key)\n self.password_reset_sent_at = Time.zone.now\n save!(:validate => false)\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "e3f5ac9dc48c2ae6d215f4f44af8006d",
"score": "0.69989705",
"text": "def forgot_password\n decrypt_demographics\n self.password_reset_code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )\n end",
"title": ""
}
] |
6ec5b222d3fdbebb6aed4bcf215572a7 | GET /snaps/1 GET /snaps/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "7c15acf29d1e3ca25686fc82d37dd561",
"score": "0.7661868",
"text": "def show\n @snap = Snap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @snap }\n end\n end",
"title": ""
},
{
"docid": "63cf3040b721ae337310c43a2c3d92c3",
"score": "0.7108346",
"text": "def index\n @snaps = Snap.all\n end",
"title": ""
},
{
"docid": "83bf52dc56d1c55d0decac13a8a532d5",
"score": "0.68116754",
"text": "def show\n @snapshot = Snapshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @snapshot }\n end\n end",
"title": ""
},
{
"docid": "83bf52dc56d1c55d0decac13a8a532d5",
"score": "0.68116754",
"text": "def show\n @snapshot = Snapshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @snapshot }\n end\n end",
"title": ""
},
{
"docid": "46c3e546bee47e6b6a17b6863eaf73b6",
"score": "0.673885",
"text": "def index\n @snaps = Snap.paginate(page: params[:page], per_page: 10)\n end",
"title": ""
},
{
"docid": "eaede01ddc8494edd1b32be279e585a9",
"score": "0.6578038",
"text": "def new\n @snap = Snap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snap }\n end\n end",
"title": ""
},
{
"docid": "e08fc17eb4679cdb761df0c535bd773f",
"score": "0.6488601",
"text": "def snaps\n path = \"/ph/login\"\n params = {\n 'username' => @username,\n 'password' => @password,\n }\n\n response = @client.post(path, params).parsed_response\n @auth_token = response[\"auth_token\"]\n response[\"snaps\"]\n end",
"title": ""
},
{
"docid": "71656453a4563fdd6e596fa9d445c0ac",
"score": "0.6299327",
"text": "def snapshot(options={})\n get('fullPageLoadSnapshot', options)\n end",
"title": ""
},
{
"docid": "b47550f9fd3f3e3cc9b542f66b06085e",
"score": "0.6298123",
"text": "def get_snapshots()\n u = build_uri(\"/snapshots\")\n response = @client.get(u, nil, ACCEPT_RDF)\n return response \n end",
"title": ""
},
{
"docid": "3d611f9c73b02811e42f5a71b946ce0d",
"score": "0.62856114",
"text": "def set_snap\n @snap = Snap.find(params[:id])\n end",
"title": ""
},
{
"docid": "e7e24bb99b66631b44d70e407e94618f",
"score": "0.6223999",
"text": "def get_snapshot(snapshot_id)\n path = api_root + \"/api/repository/v1/snapshots/#{snapshot_id}\"\n process_api_request(:get, path)\n end",
"title": ""
},
{
"docid": "29cbd6e4292ed6885cc7c588ed379648",
"score": "0.61674124",
"text": "def show\n @inventory_snapshot = InventorySnapshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inventory_snapshot }\n end\n end",
"title": ""
},
{
"docid": "7cb06a58af4b39f2b98373e82c9c0530",
"score": "0.61613506",
"text": "def set_snap\n @snap = Snap.find(params[:id])\n end",
"title": ""
},
{
"docid": "7cb06a58af4b39f2b98373e82c9c0530",
"score": "0.61613506",
"text": "def set_snap\n @snap = Snap.find(params[:id])\n end",
"title": ""
},
{
"docid": "0570148e0ad5aa9dcc373ef7a7fedf04",
"score": "0.6129505",
"text": "def returnSnapId(transport, snapShotName)\n $token=Facter.value('token')\n snap = doGET(transport['server'], transport['port'], \"/v1/snapshots?name=\"+snapShotName, {\"X-Auth-Token\" => $token})\n if !snap['data'].nil?\n return snap['data'][0]['id']\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "818d52d5f16a83060c7fbcf9e3013270",
"score": "0.61254656",
"text": "def show\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shot }\n end\n end",
"title": ""
},
{
"docid": "818d52d5f16a83060c7fbcf9e3013270",
"score": "0.61254656",
"text": "def show\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shot }\n end\n end",
"title": ""
},
{
"docid": "d731b1b31090e8008ae70fa4503e4bad",
"score": "0.60779154",
"text": "def index\n @snaps = Snap.all.sort_by(&:created_at).reverse\n end",
"title": ""
},
{
"docid": "c96920225cd11effcd50966d511c7f76",
"score": "0.6075156",
"text": "def test\n connection = Fog::Compute.new(:provider => \"Google\")\n\n puts \"Listing snapshots...\"\n puts \"---------------------------------\"\n snapshots = connection.snapshots.all\n raise \"Could not LIST the snapshots\" unless snapshots\n puts snapshots.inspect\n\n puts \"Fetching a single snapshot...\"\n puts \"---------------------------------\"\n snap = snapshots.first\n unless snap.nil?\n snap = connection.snapshots.get(snap)\n raise \"Could not GET the snapshot\" unless snap\n puts snap.inspect\n end\nend",
"title": ""
},
{
"docid": "2af11d30017b920f66f34d58a81761d8",
"score": "0.6069703",
"text": "def show\r\n @screen_shot = ScreenShot.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @screen_shot }\r\n end\r\n end",
"title": ""
},
{
"docid": "711c4a4a1dcf755756df902d6d9070a3",
"score": "0.60238826",
"text": "def list_snapshots(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:pattern] = '/snapshots'\n\t\targs[:query]['Action'] = 'ListSnapshots'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "799587c5de8df0f27b231b875601a54c",
"score": "0.60139877",
"text": "def create_snap # rubocop:disable Metrics/AbcSize\n attrcheck = {\n 'REST end point' => @options[:rest_endpoint],\n 'Container' => @options[:container]\n }\n @validate.attrvalidate(@options, attrcheck)\n instance = Instance.new(@options[:id_domain], @options[:user_name], @options[:passwd], @options[:rest_endpoint])\n instance.function = '/snapshot/' if @options[:function].downcase == 'inst_snapshot'\n instance.machine_image = @options[:inst] if @options[:inst]\n instancesnap = instance.create_snap\n # error checking response\n @util.response_handler(instancesnap)\n return JSON.pretty_generate(JSON.parse(instancesnap.body))\n end",
"title": ""
},
{
"docid": "254aa3090d7cdd3e942a378b43f2378f",
"score": "0.60079944",
"text": "def snapshots()\n service.local_list_snapshots(id)\n end",
"title": ""
},
{
"docid": "254aa3090d7cdd3e942a378b43f2378f",
"score": "0.60079944",
"text": "def snapshots()\n service.local_list_snapshots(id)\n end",
"title": ""
},
{
"docid": "2f2fc48365f229f24f506e6b7c0baa48",
"score": "0.5997287",
"text": "def create\n @snap = current_user.snaps.create(snap_params)\n\n respond_to do |format|\n if @snap.save\n format.html { redirect_to root_path, notice: 'Your snap is successfully added!!.' }\n format.json { render :show, status: :created, location: @snap }\n else\n format.html { render :new }\n format.json { render json: @snap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1acd51feeb1be1a0f9c460fd74073082",
"score": "0.59879357",
"text": "def index\n @shots = Shot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shots }\n end\n end",
"title": ""
},
{
"docid": "db2ac50454898621f06ad87f9987ba67",
"score": "0.59779817",
"text": "def call_snap_api(method, uri, post_data = nil?)\n request = \"#{method} #{uri} HTTP/1.0\\r\\n\" +\n \"Accept: application/json\\r\\n\" +\n \"Content-Type: application/json\\r\\n\"\n if method == \"POST\"\n request.concat(\"Content-Length: #{post_data.bytesize}\\r\\n\\r\\n#{post_data}\")\n end\n request.concat(\"\\r\\n\")\n # While it is expected to allow clients to connect using HTTPS over a TCP socket,\n # at this point only a UNIX socket is supported. The socket is /run/snapd.socket\n # Note - UNIXSocket is not defined on windows systems\n if defined?(::UNIXSocket)\n UNIXSocket.open(\"/run/snapd.socket\") do |socket|\n # Send request, read the response, split the response and parse the body\n socket.print(request)\n response = socket.read\n headers, body = response.split(\"\\r\\n\\r\\n\", 2)\n JSON.parse(body)\n end\n end\n end",
"title": ""
},
{
"docid": "145c3dbc64b6f2d108ebcf11d0d2c251",
"score": "0.5957261",
"text": "def show\n @screenshot = Screenshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @screenshot }\n end\n end",
"title": ""
},
{
"docid": "5e281d7b11852dff8531ea8e9bcedb6f",
"score": "0.5950442",
"text": "def show\n @snapshot = Snapshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @snapshot }\n end\n end",
"title": ""
},
{
"docid": "988dbe12fdafd753c35ea94334d782bc",
"score": "0.5948597",
"text": "def show\n @snapshot = Snapshot.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @snapshot }\n end\n end",
"title": ""
},
{
"docid": "cd89728ee9efd3ad4004540316fa41b0",
"score": "0.5930397",
"text": "def ReadSnapshots\n @snapshots = []\n snapshot_maps = Convert.convert(\n SCR.Read(path(\".snapper.snapshots\")),\n :from => \"any\",\n :to => \"list <map>\"\n )\n snapshot_maps = [] if snapshot_maps == nil\n i = 0\n Builtins.foreach(snapshot_maps) do |snapshot|\n id = Ops.get_integer(snapshot, \"num\", 0)\n next if id == 0 # ignore the 'current system'\n Ops.set(snapshot, \"name\", Builtins.tostring(id))\n Builtins.y2debug(\"snapshot data: %1\", snapshot)\n @snapshots = Builtins.add(@snapshots, snapshot)\n Ops.set(@id2index, id, i)\n i = Ops.add(i, 1)\n end\n true\n end",
"title": ""
},
{
"docid": "923e3a203e3d76aca8263dc29c84cc91",
"score": "0.5924659",
"text": "def snapshots\n # Strangely, this only lists the first snapshot. If you remove '-o name', it lists them all\n #command = \"zfs list -H -r -t snapshot -o name #{@dataset}/share\"\n command = \"ls -1 #{@roomdir}/share/.zfs/snapshot\"\n logger.debug \"running: #{command}\"\n `#{command}`.chomp.split(/\\n/).map { |x| x.sub(/.*@/, '') }\n end",
"title": ""
},
{
"docid": "2a2227b55839b5789ac0e97651418935",
"score": "0.59237415",
"text": "def show\n snapby = Snapby.find_by(id: params[:id])\n\n if snapby\n if snapby.anonymous\n snapby.username = ANONYMOUS_USERNAME\n end\n render json: { result: { snapby: snapby.response_snapby } }, status: 200\n else\n render json: { errors: { internal: [\"failed to retrieve snapby\"] } }, :status => 500\n end\n end",
"title": ""
},
{
"docid": "2fa294e01b920b82fa87473577f515ac",
"score": "0.5899067",
"text": "def snapshots(opts={})\n raise NotFound, \"no such filesystem\" if !exist?\n\n stdout, stderr = [], []\n cmd = ZFS.zfs_path + %w(list -H -r -oname -tsnapshot)\n cmd << '-d1' unless opts[:recursive]\n cmd << uid\n\n stdout, stderr, status = Open3.capture3(*cmd)\n\n if status.success? and stderr.empty?\n stdout.lines.collect do |snap|\n ZFS(snap.chomp)\n end\n else\n raise Error, \"something went wrong\"\n end\n end",
"title": ""
},
{
"docid": "e4750876842ae4de1c11d62f50b927b7",
"score": "0.58684874",
"text": "def snapshots surl\n bucket_name, path, snapshot = Snapshot.s3url_splice surl\n puts \"from bucket #{bucket_name}, path #{path}\" unless options[:verbose] < 1\n bucket = Snapshot.s3.bucket bucket_name\n raise \"bucket #{bucket_name} does not exist\" unless bucket.exists?\n ap bucket.objects(prefix: \"#{path}/snapshot\").map { |ob|\n ob.key.split('snapshot-').last\n }\n end",
"title": ""
},
{
"docid": "57a9a104efd49785b9c024c0ab4fa0c0",
"score": "0.58507556",
"text": "def get_snapshots_from_server(aws_id, aws_region)\n device_list = get_instance_block_devices(aws_id, aws_region)\n\n #get_snapshots_from_block_array(device_list)\n all_snapshots = get_aws_conn(aws_region).snapshots.with_owner(\"self\")\n\n # will hold the snap\n current_snaps = {}\n\n # need to create an array of the newest snapshots\n all_snapshots.each do |snap|\n #debug(\"From volume: #{snap.volume_id} and snap: #{snap.id} time: #{snap.start_time}\")\n device_list.each do |volume|\n if volume[:ebs][:volume_id] == snap.volume_id\n if defined?(curent_snaps[snap.volume_id][1]).nil?\n current_snaps[snap.volume_id] = [snap.id, snap.start_time, snap]\n elsif Time.parse(current_snaps[snap.volume_id][1]) < Time.parse(snap.start_time)\n current_snaps[snap.volume_id] = [snap.id, snap.start_time, snap]\n end\n end\n end\n end\n\n snapshots = []\n current_snaps.each_key do |volume|\n debug \"Found snap #{current_snaps[volume][0]} with timestamp: #{current_snaps[volume][1]}\"\n snapshots.push(current_snaps[volume][2])\n end\n\n return snapshots\n\nend",
"title": ""
},
{
"docid": "9f06f6bc02ac703e976716b98bbf91fd",
"score": "0.58376175",
"text": "def show\n @comments = Comment.where(snap_id: @snap).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "d36f275be3d04116006b1b958023e455",
"score": "0.58117765",
"text": "def dribbble_get_shot id\n JSON.parse(Net::HTTP.get(URI(\"http://api.dribbble.com/shots/#{id}\")))\n end",
"title": ""
},
{
"docid": "b6758e8dc76d81c5fff3b0a9116d5484",
"score": "0.5794237",
"text": "def call_snap_api(method, uri, post_data = nil?)\n request = \"#{method} #{uri} HTTP/1.0\\r\\n\" +\n \"Accept: application/json\\r\\n\" +\n \"Content-Type: application/json\\r\\n\"\n if method == \"POST\"\n pdata = post_data.to_json.to_s\n request.concat(\"Content-Length: #{pdata.bytesize}\\r\\n\\r\\n#{pdata}\")\n end\n request.concat(\"\\r\\n\")\n\n # while it is expected to allow clients to connect using https over\n # a tcp socket, at this point only a unix socket is supported. the\n # socket is /run/snapd.socket note - UNIXSocket is not defined on\n # windows systems\n if defined?(::UNIXSocket)\n UNIXSocket.open(\"/run/snapd.socket\") do |socket|\n # send request, read the response, split the response and parse\n # the body\n socket.write(request)\n\n # WARNING!!! HERE BE DRAGONs\n #\n # So snapd doesn't return an EOF at the end of its body, so\n # doing a normal read will just hang forever.\n #\n # Well, sort of. if, after it writes everything, you then send\n # yet-another newline, it'll then send its EOF and promptly\n # disconnect closing the pipe and preventing reading. so, you\n # have to read first, and therein lies the EOF problem.\n #\n # So you can do non-blocking reads with selects, but it\n # makes every read take about 5 seconds. If, instead, we\n # read the last line char-by-char, it's about half a second.\n #\n # Reading a character at a time isn't efficient, and since we\n # know that http headers always have a blank line after them,\n # we can read lines until we find a blank line and *then* read\n # a character at a time. snap returns all the json on a single\n # line, so once you pass headers you must read a character a\n # time.\n #\n # - jaymzh\n\n Chef::Log.trace(\n \"snap_package[#{new_resource.package_name}]: reading headers\"\n )\n loop do\n response = socket.readline\n break if response.strip.empty? # finished headers\n end\n Chef::Log.trace(\n \"snap_package[#{new_resource.package_name}]: past headers, \" +\n \"onto the body...\"\n )\n result = nil\n body = \"\"\n socket.each_char do |c|\n body << c\n # we know we're not done if we don't have a char that\n # can end JSON\n next unless [\"}\", \"]\"].include?(c)\n\n begin\n result = JSON.parse(body)\n # if we get here, we were able to parse the json so we\n # are done reading\n break\n rescue JSON::ParserError\n next\n end\n end\n result\n end\n end\n end",
"title": ""
},
{
"docid": "0fa67558728cbee08473cab4a9837a22",
"score": "0.5791908",
"text": "def index\n @snapshots = Snapshot.all\n end",
"title": ""
},
{
"docid": "61d9570ed31a12967fc8aa27f01de718",
"score": "0.5778391",
"text": "def list_snapshots(options)\n args = []\n args.concat('--details') if options[:details]\n args.concat('--machinereadable') if options[:machine_readable]\n\n # TODO: Print this out in a fancy graph somehow. Likely\n # going to always want machine readable and build a decent\n # visual representation.\n execute('snapshot', @uuid, 'list', *args)\n end",
"title": ""
},
{
"docid": "cfcf373e4ff1edabeed12855b3d73bb0",
"score": "0.5760477",
"text": "def show\n @price_snapshot = PriceSnapshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @price_snapshot }\n end\n end",
"title": ""
},
{
"docid": "62c41299f3dd7071176edde163ba7818",
"score": "0.5736206",
"text": "def list_floor_plans \n get(\"/files.json/floorplan/images\")\nend",
"title": ""
},
{
"docid": "b8d2222ebace01877d5f2c22710fff03",
"score": "0.57286793",
"text": "def generate_snap_json(snap_names, action, channel, options, revision = nil)\n request = {\n \"action\" => action,\n \"snaps\" => snap_names,\n }\n if %w{install refresh switch}.include?(action) && channel\n request[\"channel\"] = channel\n end\n\n # No defensive handling of params\n # Snap will throw the proper exception if called improperly\n # And we can provide that exception to the end user\n if options\n request[\"classic\"] = true if options.include?(\"classic\")\n request[\"devmode\"] = true if options.include?(\"devmode\")\n request[\"jailmode\"] = true if options.include?(\"jailmode\")\n request[\"ignore_validation\"] = true if options.include?(\"ignore-validation\")\n end\n request[\"revision\"] = revision unless revision.nil?\n request\n end",
"title": ""
},
{
"docid": "5be13fefcb32fed8ec6f2f547d8a2915",
"score": "0.57258385",
"text": "def list_snapshots(list_id)\n get(\"contactList/#{list_id}/snapshot\")\n end",
"title": ""
},
{
"docid": "e7c0376e44a587c57d5c924e790f7088",
"score": "0.5692223",
"text": "def generate_snap_json(snap_names, action, channel, options, revision = nil)\n request = {\n \"action\" => action,\n \"snaps\" => snap_names,\n }\n if %w{install refresh switch}.include?(action)\n request[\"channel\"] = channel\n end\n\n # No defensive handling of params\n # Snap will throw the proper exception if called improperly\n # And we can provide that exception to the end user\n request[\"classic\"] = true if options[\"classic\"]\n request[\"devmode\"] = true if options[\"devmode\"]\n request[\"jailmode\"] = true if options[\"jailmode\"]\n request[\"revision\"] = revision unless revision.nil?\n request[\"ignore_validation\"] = true if options[\"ignore-validation\"]\n request\n end",
"title": ""
},
{
"docid": "242d672907ec82d41d0f025ebd6907f5",
"score": "0.56860685",
"text": "def index\n @inventory_snapshots = InventorySnapshot.current.order('current_amount desc').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventory_snapshots }\n end\n end",
"title": ""
},
{
"docid": "a4f8fed9898d2889790fa58e88f8552f",
"score": "0.5661887",
"text": "def snapshot(snapshot = nil)\n client.snapshot(name, snapshot)\n end",
"title": ""
},
{
"docid": "e2543abce443ed1ccfcca3ac64418961",
"score": "0.5661776",
"text": "def list_snapshots\n out = runcmd 'aptly snapshot list'\n parse_list out.lines\n end",
"title": ""
},
{
"docid": "c52b30744117f0549aff3aba4b28862e",
"score": "0.56600994",
"text": "def snapshot\n render json:{result:\"success\", data:{auctions: Auction.snapshot, users:User.snapshot}}, response: :success\n rescue StandardError => e\n render json:{result: \"error\", error:e.message}, status: :bad_request\n end",
"title": ""
},
{
"docid": "6ee4dc875dc96722ed8f1f1572120fe0",
"score": "0.565933",
"text": "def create\n @snap = Snap.new(snap_params)\n @snap.snap_user = current_user.email\n\n respond_to do |format|\n if @snap.save\n format.html { redirect_to '/', notice: 'Snap was successfully created.' }\n format.json { render :show, status: :created, location: @snap }\n else\n format.html { render :new }\n format.json { render json: @snap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "825cd4cbf5a567449b455ac1c72cfc1b",
"score": "0.56484216",
"text": "def show\n @shot_result = ShotResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shot_result }\n end\n end",
"title": ""
},
{
"docid": "855bf4692472c8a2a8ede923da3ed333",
"score": "0.56415975",
"text": "def update\n @snap = Snap.find(params[:id])\n\n respond_to do |format|\n if @snap.update_attributes(params[:snap])\n format.html { redirect_to @snap, notice: 'Snap was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @snap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e4af87e6b34f78199e7af35021d15fc",
"score": "0.56362206",
"text": "def new\n @snapshot = Snapshot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snapshot }\n end\n end",
"title": ""
},
{
"docid": "cc7a13042d006d4317d0252dc569a4a4",
"score": "0.5634547",
"text": "def list_snapshots(env, server_id)\n get_all_images(env, params: { server: server_id })\n end",
"title": ""
},
{
"docid": "8066b7ca6616d0d44296212f78ff5a08",
"score": "0.563098",
"text": "def destroy\n @snap = Snap.find(params[:id])\n @snap.destroy\n\n respond_to do |format|\n format.html { redirect_to snaps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f20709eaf26fd8bf11dd33236c8d1ca",
"score": "0.5619769",
"text": "def update\n respond_to do |format|\n if @snap.update(snap_params)\n format.html { redirect_to @snap, notice: 'Snap was successfully updated.' }\n format.json { render :show, status: :ok, location: @snap }\n else\n format.html { render :edit }\n format.json { render json: @snap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f20709eaf26fd8bf11dd33236c8d1ca",
"score": "0.5619769",
"text": "def update\n respond_to do |format|\n if @snap.update(snap_params)\n format.html { redirect_to @snap, notice: 'Snap was successfully updated.' }\n format.json { render :show, status: :ok, location: @snap }\n else\n format.html { render :edit }\n format.json { render json: @snap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86638cfd531c61ec2313675cc9c461a4",
"score": "0.56139606",
"text": "def get_security_snapshots_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SecurityApi.get_security_snapshots ...\"\n end\n # resource path\n local_var_path = \"/securities/snapshots\"\n\n # query parameters\n query_params = {}\n query_params[:'at_datetime'] = opts[:'at_datetime'] if !opts[:'at_datetime'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ApiKeyAuth']\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 => 'SecuritySnapshotsResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SecurityApi#get_security_snapshots\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "46e7d0c92bd24dde5f384f5d7d68ba55",
"score": "0.56102353",
"text": "def get_snapshots\n state_colors = {\n 'SUCCESS' => 'GREEN',\n 'PARTIAL' => 'RED',\n 'IN_PROGRESS' => 'YELLOW',\n }\n repo_response = get_request(\"/_snapshot\").body\n repo_info = JSON.parse(repo_response)\n # Print information about the most recent n snaphots, per repo.\n printf(\"#UNDERLINE%-12s|%-24s|%-13s|%-21s|%-21s|%-17s#NORMAL\\n\", \" REPO \", \" SNAPSHOT NAME \", \" STATE \", \" START \", \" END \", \" DURATION \")\n cluster = ARGV[1]\n bundle = ARGV[2]\n\n repo_info.each_key do |repo_name|\n next if is_es() and repo_name != cluster + \"-\" + bundle\n snapshot_response = get_request(\"/_snapshot/#{repo_name}/_all\").body\n snapshot_info = JSON.parse(snapshot_response)\n\n if snapshot_info['snapshots'].empty?\n printf(\"%-15s|%-32s|%-13s|%-26s|%-26s\\n\", repo_name, \" - \", \" - \", \" - \", \" - \")\n else\n # Temporarily store all snapshot results for later sorting.\n # Snapshot details are keyed by the epoch of their start date.\n all_snapshots = {}\n snapshot_info['snapshots'].each do |snapshot|\n # Snapshot start.\n snapshot_start_datetime = DateTime.iso8601(snapshot['start_time'])\n snapshot_start_epoch = snapshot_start_datetime.to_time.to_i\n snapshot_start_timestamp = snapshot_start_datetime.strftime('%Y-%m-%d %H:%M:%S')\n # Snapshot end.\n if snapshot['end_time'].nil?\n snapshot_end_epoch = 0\n snapshot_end_timestamp = '-'\n else\n snapshot_end_datetime = DateTime.iso8601(snapshot['end_time'])\n snapshot_end_epoch = snapshot_end_datetime.to_time.to_i\n snapshot_end_timestamp = snapshot_end_datetime.strftime('%Y-%m-%d %H:%M:%S')\n end\n if snapshot_end_epoch <= 0\n snapshot_duration = '-'\n else\n # Contrived, but working, method to get time duration.\n snapshot_timediff = snapshot_end_epoch - snapshot_start_epoch\n min, sec = snapshot_timediff.divmod(60)\n hours, min = min.divmod(60)\n days, hours = hours.divmod(24)\n snapshot_duration = sprintf(\"%dd %dh %dm %ds\", days, hours, min, sec)\n end\n all_snapshots[snapshot_start_epoch] = {'state' => snapshot['state'], 'snapshot_name' => snapshot['snapshot'], 'start_time' => snapshot_start_timestamp, 'end_time' => snapshot_end_timestamp, 'duration' => snapshot_duration }\n end\n # Sort (by keys, default) and get first 3 items returned in the AoA.\n most_recent_snaps = all_snapshots.sort.reverse.take(3)\n\n most_recent_snaps.each do |snap| \n snap_start_epoch = snap[0]\n snap_details = snap[1]\n printf(\"%-12s|%-24s|##{state_colors[snap_details['state']]}%-13s#NORMAL|%-21s|%-21s|%-17s\\n\", repo_name, \" #{snap_details['snapshot_name']} \", \" #{snap_details['state']} \", \" #{snap_details['start_time']} \", \" #{snap_details['end_time']} \", \" #{snap_details['duration']} \")\n end\n end\n end\nend",
"title": ""
},
{
"docid": "3507fd326171d6fab9be150ea02d47f7",
"score": "0.5594175",
"text": "def show\n @snapshots = Snapshot.discover(@machine.identifier)\n end",
"title": ""
},
{
"docid": "f5995b66b1610bbeb60bbfb8feab7746",
"score": "0.559391",
"text": "def snapshot_info name\n out = runcmd \"aptly snapshot show #{name.quote}\"\n parse_info out.lines\n end",
"title": ""
},
{
"docid": "67c4574ea7fbbea9925f71b64c51b33c",
"score": "0.55868125",
"text": "def snapshots\n\t\traise NotFound, \"no such filesystem\" if !exist?\n\n\t\tstdout, stderr = [], []\n\t\tcmd = [ZFS.zfs_path].flatten + %w(list -H -d1 -r -oname -tsnapshot) + [name]\n\n\t\tstdout, stderr, status = @session.capture3(*cmd)\n\n\t\tif status.success? and stderr.empty?\n\t\t\tstdout.lines.collect do |snap|\n\t\t\t\tZFS(snap.chomp, @session)\n\t\t\tend\n\t\telse\n\t\t\traise Exception, \"something went wrong\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8db765e9062a74c412a81af7797d2eba",
"score": "0.55698055",
"text": "def index\n @snakes = Snake.all\n render json: @snakes\n end",
"title": ""
},
{
"docid": "daf9763413c9cd35296e8b992312bd81",
"score": "0.5563814",
"text": "def index\n @our_coin_thumbnails = @our_coin.our_coin_thumbnails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @our_coin_thumbnails }\n end\n end",
"title": ""
},
{
"docid": "645a0fa3b904c7cffa82152ecb16b0c1",
"score": "0.5561188",
"text": "def get(index, snap_id)\n # snaps[snap_id][index]\n if current[index].length < snap_id + 1\n return current[index].last\n else\n return current[index][snap_id]\n end\n end",
"title": ""
},
{
"docid": "1e4d837e268f7bbcca782934f0f34bb0",
"score": "0.5559782",
"text": "def show\n @screen_pic = ScreenPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @screen_pic }\n end\n end",
"title": ""
},
{
"docid": "7d7b28c96ae23c7eaf041e965a5fcb77",
"score": "0.55404663",
"text": "def show\n @s3_snapshot = S3Snapshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @s3_snapshot }\n end\n end",
"title": ""
},
{
"docid": "f697062b56294847bc4235e7e0bf7081",
"score": "0.5539585",
"text": "def list_snapshots(options)\n end",
"title": ""
},
{
"docid": "0f7d1407a60ba403e268f49d22ba8573",
"score": "0.55335146",
"text": "def snapshot(name)\n service.local_snapshot(id, name)\n end",
"title": ""
},
{
"docid": "0f7d1407a60ba403e268f49d22ba8573",
"score": "0.55335146",
"text": "def snapshot(name)\n service.local_snapshot(id, name)\n end",
"title": ""
},
{
"docid": "ee8b36deda4ce37bdee8cb57d5939f31",
"score": "0.5533502",
"text": "def show\n @sn = Sn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sn }\n end\n end",
"title": ""
},
{
"docid": "3398061fbfc3a18e03f8c7bb287daa21",
"score": "0.55221725",
"text": "def get_snapshot(snapshot_id)\n self.snapshots.select{|snap| snap.id.to_s == snapshot_id.to_s}.first\n end",
"title": ""
},
{
"docid": "11863c99f011d01a0f78c7462cf43155",
"score": "0.55211747",
"text": "def show\n @screenshot = Screenshot.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @screenshot }\n format.json { render :json => @screenshot }\n end\n end",
"title": ""
},
{
"docid": "48fd608871242a9670d83e73f662c1dc",
"score": "0.55155176",
"text": "def snapshot\n\t\t\tresponse = @connection.get('snapshot.cgi')\n\t\t\tresponse.success? ? ::MiniMagick::Image.read(response.body) : nil\n\t\tend",
"title": ""
},
{
"docid": "226cdc522abc8b97f1a4f23a3699f528",
"score": "0.55140346",
"text": "def snapshots\n raise NotFound, 'no such filesystem' unless exist?\n\n stdout, stderr = [], []\n cmd = [ZFS_PATH].flatten + %w(list -H -d1 -r -oname -tsnapshot) + [name]\n\n stdout, stderr, status = Open3.capture3(*cmd)\n\n if status.success? and stderr.empty?\n stdout.lines.collect do |snap|\n ZFS(snap.chomp)\n end\n else\n raise \"something went wrong: #{stderr}, #{stdout}\"\n end\n end",
"title": ""
},
{
"docid": "da37314357cde59f16d0983970d18856",
"score": "0.5503978",
"text": "def snapshot(snapshot_name)\n rep.snapshot(snapshot_name)\n end",
"title": ""
},
{
"docid": "c6dcfabab38d787365f0c712aa9aa853",
"score": "0.5503342",
"text": "def show\n @snake = Snake.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @snake }\n end\n end",
"title": ""
},
{
"docid": "03b41711cdef66be06c4371a8bc4037a",
"score": "0.5497372",
"text": "def list_snapshots(node_name)\n puts get_snapshots node_name\n end",
"title": ""
},
{
"docid": "a98eebba42888cc4e37536cb33da84c0",
"score": "0.5490611",
"text": "def get_snapshots(volume_id)\n volume = find_volumes(resource_uid: volume_id).first\n @api_client.volume_snapshots.index(filter: [\"parent_volume_href==#{volume.href}\"])\n end",
"title": ""
},
{
"docid": "09531d8aedf57a175925417c1e36a18f",
"score": "0.5483894",
"text": "def index\n @shots = Shot.all\n end",
"title": ""
},
{
"docid": "38246a2496ab23cf4b04876849fff614",
"score": "0.5483276",
"text": "def snap\n option(:snap)\n end",
"title": ""
},
{
"docid": "d130b4fc0bc09f40e51e9847ba0aa40f",
"score": "0.54706115",
"text": "def show\n @shoot = Shoot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shoot }\n end\n end",
"title": ""
},
{
"docid": "6c1e38d768005a21697b0e7d36d1e806",
"score": "0.546317",
"text": "def snap!(url)\r\n say \" !txtblu!Snap!!txtrst! Snapping picture... \"\r\n\r\n f = Screencap::Fetcher.new url\r\n fetch_opts = {}\r\n fetch_opts[:output] = image_path_for(url)\r\n fetch_opts[:width] = @opts.width\r\n fetch_opts[:height] = @opts.height if @opts.height > 0\r\n fetch_opts[:div] = @opts.selector if @opts.selector\r\n # :top => 0, :left => 0, :width => 100, :height => 100 # dimensions for a specific area\r\n\r\n f.fetch fetch_opts \r\n say \"done\"\r\n end",
"title": ""
},
{
"docid": "7d0b431e15d172833df83f34bade2a18",
"score": "0.5454465",
"text": "def index\n @snap_event_lists = SnapEventList.all\n end",
"title": ""
},
{
"docid": "47325d506f24542699d101dbe62af5d3",
"score": "0.5452592",
"text": "def list_all_vm_snaphsots(options)\n if options['vm'] == options['empty']\n options['vm'] = get_client_vm_type(options)\n end\n case options['vm']\n when /vbox/\n list_all_vbox_vm_snapshots(options)\n when /fusion/\n list_all_fusion_vm_snapshots(options)\n end\n return\nend",
"title": ""
},
{
"docid": "1ba59f509ad6d13a9a3f2e001d7128d2",
"score": "0.5451762",
"text": "def show\n @mac_shoot = MacShoot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mac_shoot }\n end\n end",
"title": ""
},
{
"docid": "56e699121c2c439e28f44301489453e0",
"score": "0.5435731",
"text": "def index\n @snapshots = @whiteboard.snapshots\n display @snapshots\n end",
"title": ""
},
{
"docid": "5bce0d70c70f5cc57e0275b1e12b2557",
"score": "0.5433182",
"text": "def show\n @gist = Gist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gist }\n end\n end",
"title": ""
},
{
"docid": "15ebe94fcdb4b4d0020dda5a9515d759",
"score": "0.5405289",
"text": "def show\n @environment = Environment.find(params[:environment_id])\n @melodie_snapshot = @environment.melodie_snapshots.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @melodie_snapshot }\n end\n end",
"title": ""
},
{
"docid": "917d192faf7c44e5e86594439abbfa35",
"score": "0.54047173",
"text": "def show\n res = open(\"http://api.dribbble.com/shots/#{params[:id]}\")\n code, message = res.status # res.status => [\"200\", \"OK\"]\n\n if code == '200'\n result = ActiveSupport::JSON.decode res.read\n @shot = result\n else\n puts \"#{code} #{message}\"\n end\n\n render \"show.xml.js\"\n end",
"title": ""
},
{
"docid": "7b3769488f9f34af18b55fde95c92624",
"score": "0.53972846",
"text": "def get_machine_snapshot(machine, snapshot, opts= {})\n raise ArgumentError unless machine.is_a? String\n raise ArgumentError unless snapshot.is_a? String\n c = @client[\"#{@account}/machines/#{machine}/snapshots/#{snapshot}\"]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_get(c, headers)\n end\n\n end",
"title": ""
},
{
"docid": "67a22960a9fbc0132876ff6157cda73a",
"score": "0.5390682",
"text": "def list_machine_snapshots(machine, opts= {})\n raise ArgumentError unless machine.is_a? String\n c = @client[\"#{@account}/machines/#{machine}/snapshots\"]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_get(c, headers)\n end\n\n end",
"title": ""
},
{
"docid": "01e5ec3c12104e918a989637ec2a3a79",
"score": "0.53886586",
"text": "def snap_version_by_query(doc, opts = {})\n json = collection.find_one doc, opts\n snap_version json unless json.nil?\n end",
"title": ""
},
{
"docid": "2e42744f0bfe4f661737d5aad0bbc2f7",
"score": "0.53870416",
"text": "def index\n @shot_shelfs = []\n (1..5).each do |page|\n res = open(\"http://api.dribbble.com/shots/popular?page=#{page}\")\n code, message = res.status # res.status => [\"200\", \"OK\"]\n\n if code == '200'\n result = ActiveSupport::JSON.decode res.read\n @shot_shelfs << result[\"shots\"]\n else\n puts \"#{code} #{message}\"\n end\n end\n\n render \"index.xml.js\"\n end",
"title": ""
},
{
"docid": "a3b468842ce8bcce68def340d9ade1e8",
"score": "0.53829116",
"text": "def snapshots\n out = host.shell!(\"VBoxManage snapshot \\\"#{name}\\\" list\").out\n out.each_line.map do |line|\n line =~ /Name: ([^(]+) \\(/\n $1\n end\n end",
"title": ""
},
{
"docid": "4efbc45d9f151f3b80a5ab286d1fe5c4",
"score": "0.53802645",
"text": "def show\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shot }\n end\n end",
"title": ""
},
{
"docid": "4efbc45d9f151f3b80a5ab286d1fe5c4",
"score": "0.53802645",
"text": "def show\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shot }\n end\n end",
"title": ""
},
{
"docid": "cfcd3bad061b45e79f7c7e7f20c1434d",
"score": "0.53770417",
"text": "def show\n @shelf_page = @shelf.shelf_pages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shelf_page }\n end\n end",
"title": ""
},
{
"docid": "93d7b36794b96380caa881cc274f58ea",
"score": "0.5374432",
"text": "def show\n render json: MangaBookshelf.find_shelves(params[:id])\n end",
"title": ""
},
{
"docid": "dfed8d6a19256ce986adc17fc85bcabf",
"score": "0.5374368",
"text": "def cloud_volume_snapshots\n connection.snapshots.all\n end",
"title": ""
}
] |
904e40be83526e4fa35ac5043e67386c | ENSURE THAT ON CREATE THE MAP HAS LAYERS | [
{
"docid": "5cff233b8a967434a660e46babdbc8fe",
"score": "0.5831334",
"text": "def validate_on_create\n begin\n map_xml = Nokogiri::XML(open(url)) \n check_layers map_xml\n extract_keywords map_xml # extract keywords from WMS\n extract_layers map_xml # extract layers from the WMS. \n \n rescue EmptyLayerException => e\n errors.add :url, \"Map does not contain any layer information. Please try again.\" \n rescue Exception => e\n errors.add :url, \"Map URL XML did not parse correctly - is it incorrect? #{e.message}\"\n end\n end",
"title": ""
}
] | [
{
"docid": "5e246ecf3c59b69b45b6e69beee3a397",
"score": "0.72521216",
"text": "def check_map_layers\n raise EmptyLaterException, \"No layers present for this map data\" if map_layers.empty?\n end",
"title": ""
},
{
"docid": "492007fd294949c32afb9193f1112d51",
"score": "0.67873657",
"text": "def define_meta_map_layer\n PRC::CoreConfig.define_layer(:name => 'map', :set => true)\n end",
"title": ""
},
{
"docid": "4f18360941537f77baed923f75844fc1",
"score": "0.67612916",
"text": "def setup_layers\n\tend",
"title": ""
},
{
"docid": "1d5f440ea5826bec1ca70ef9fb077b0a",
"score": "0.6556226",
"text": "def create\n @layer = @map.layers.build(params[:layer])\n\n respond_to do |format|\n if @layer.save\n format.html { redirect_to([@layer.map, @layer], :notice => 'Layer was successfully created.') }\n format.json { render :json => @layer, :status => :created, :location => [@layer.map, @layer] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @layer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cf493979cb73bd5431c22907ae32a8a",
"score": "0.6494437",
"text": "def create\n @map = Map.new(params[:map])\n @map.createLayers()\n\n respond_to do |format|\n if @map.save\n @map.save_layers()\n format.html { redirect_to @map, notice: 'Map was successfully created.' }\n format.json { render json: @map, status: :created, location: @map }\n else\n format.html { render action: \"new\" }\n format.json { render json: @map.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a5f8717c480512d63317d510606bc8d",
"score": "0.6485881",
"text": "def check_layers map_xml\n layers = map_xml.search(\"Layer[queryable]\")\n raise EmptyLayerException if layers.empty?\n end",
"title": ""
},
{
"docid": "fe4761e48a88c0dd832691fad0ab1780",
"score": "0.6480829",
"text": "def can_build?\n !@map_enteties.empty? || (center && zoom)\n end",
"title": ""
},
{
"docid": "d6945acbd5cf0e7c0c24b298b755e6bb",
"score": "0.64110583",
"text": "def add_map(map)\n map.layers << self\n end",
"title": ""
},
{
"docid": "3955259c409a60a2a6ddf7bf03fb6fbc",
"score": "0.6325677",
"text": "def layer_finder; end",
"title": ""
},
{
"docid": "6e96d1e7d43af11f37c4e8d7eceb0da1",
"score": "0.62958485",
"text": "def create\n @cabinet_map_layer = MapLayer.new(create_params)\n\n respond_to do |format|\n if @cabinet_map_layer.save\n format.html { redirect_to cabinet_map_layers_path, notice: I18n.t('created') }\n format.json { render :show, status: :created, location: @cabinet_map_layer }\n else\n format.html { render :new }\n format.json { render json: @cabinet_map_layer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58a2e9321847440502eff2ff0b1e133e",
"score": "0.62110054",
"text": "def has_worldmap?; has_item?($data_items[153]); end",
"title": ""
},
{
"docid": "2ecc968c3d0c40c8a49fab1ca183cf9e",
"score": "0.6110233",
"text": "def new\n @layer = @map.layers.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @layer }\n end\n end",
"title": ""
},
{
"docid": "cd5bfa8943ea4beb59b99118879d32c0",
"score": "0.6057568",
"text": "def extract_layers map_xml\n layers = map_xml.search(\"Layer[queryable]\")\n raise EmptyLayerException if layers.empty?\n\n layers.each do |layer|\n name = layer.search(\"Name\").first\n title = layer.search(\"Title\").first\n abstract = layer.search(\"Abstract\").first\n westlong = layer.search(\"westBoundLongitude\").first\n eastlong = layer.search(\"eastBoundLongitude\").first\n southlat = layer.search(\"southBoundLatitude\").first\n northlat = layer.search(\"northBoundLatitude\").first\n ml = MapLayer.new(:name => name.try(:content), \n :title => title.try(:content), \n :abstract => abstract.try(:content), \n :west_bound_longitude => westlong.try(:content), \n :east_bound_longitude => eastlong.try(:content), \n :south_bound_latitude => southlat.try(:content), \n :north_bound_latitude => northlat.try(:content))\n #RIP OUT LAYERS\n layer.search(\"CRS\", \"SRS\").each do |crs|\n ml.map_projections << MapProjection.new(:crs => crs.try(:content)) \n end \n \n #FINALLY ADD MAP LAYERS TO MAP \n map_layers << ml \n \n end \n end",
"title": ""
},
{
"docid": "0c916cb86176ca41f62587e841137976",
"score": "0.6054421",
"text": "def has_layer?\n return !!@layer\n end",
"title": ""
},
{
"docid": "0c916cb86176ca41f62587e841137976",
"score": "0.6054421",
"text": "def has_layer?\n return !!@layer\n end",
"title": ""
},
{
"docid": "03fb048daf31aeeb72afcc7f7beb5d40",
"score": "0.60393214",
"text": "def add_layers\n add_top_layers if pushing_top_3d_boundary?\n add_bottom_layers if pushing_bot_3d_boundary?\n end",
"title": ""
},
{
"docid": "1d3d84475263fa110aa46d58cc411e71",
"score": "0.59870225",
"text": "def set_cabinet_map_layer\n @cabinet_map_layer = MapLayer.find(params[:id])\n end",
"title": ""
},
{
"docid": "a48f1f26b81c7c4f7abbd1b3e60fbe70",
"score": "0.5937119",
"text": "def setup_layers\n x = self.x - 12\n y = self.y - 12\n create_layer(0, \"SAM-storage-background\", 0, x, y, self.openness)\n\tend",
"title": ""
},
{
"docid": "ee07b4688d20ca4d6ac5e09648568712",
"score": "0.5929702",
"text": "def render_map\n show = @step.available.any?(&:minor?) || (@step.respond_to?(:show_map) && @step.show_map)\n return nil unless show\n\n h(Game::Map, game: @game, opacity: 1.0)\n end",
"title": ""
},
{
"docid": "6674861d98561dd391339d545a19c1b7",
"score": "0.5884106",
"text": "def use_hidden_layers?\n @use_hidden_layers\n end",
"title": ""
},
{
"docid": "7f76a94cf52c617957bd49edf075704f",
"score": "0.58643395",
"text": "def create\n @project_layer = ProjectLayer.subclass(params[:project_layer][:type]).new(params[:project_layer])\n @providers_list = @project_layer.class.get_providers\n @operations = @project_layer.class.get_operations\n\n rasters = @project_layer.class.get_providers\n if rasters.any?\n @project_layer.tile_url = rasters.detect { |r| r['id'] == @project_layer.provider_id }['tiles_url_format']\n end\n\n flash[:notice] = 'Project layer was successfully created.' if @project_layer.save\n respond_with(@project, @project_layer, location: (@project_layer.new_record? ? project_project_layers_path(@project) : project_project_layer_url(@project, @project_layer)))\n end",
"title": ""
},
{
"docid": "704f8019772365ae25eca6d5763ec3e7",
"score": "0.585963",
"text": "def index\n @map = Map.find(params[:map_id])\n @layers = @map.layers\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @layers }\n end\n end",
"title": ""
},
{
"docid": "c9b53197607228e71e5ff54ad85b0c92",
"score": "0.5846451",
"text": "def setup_layers\n x = self.x - 24\n y = self.y - 117\n create_layer(0, \"SAM-ingredient-background\", 0, x, y, self.openness)\n\tend",
"title": ""
},
{
"docid": "c9b53197607228e71e5ff54ad85b0c92",
"score": "0.5846451",
"text": "def setup_layers\n x = self.x - 24\n y = self.y - 117\n create_layer(0, \"SAM-ingredient-background\", 0, x, y, self.openness)\n\tend",
"title": ""
},
{
"docid": "294c2804bc7c78ab29199806e69e23e1",
"score": "0.5835141",
"text": "def set_up_map(centre, markers)\n @map = GMap.new(\"map_div\")\n @map.control_init(:large_map => true, :map_type => true, :local_search => true, :anchor => :bottom_right, :offset_width => 10, :offset_height => 10)\n @map.center_zoom_init(centre, 14)\n markers.each do |marker|\n @map.overlay_init(marker)\n end\n end",
"title": ""
},
{
"docid": "9cec81a4a11ae126eea74da3bf48f217",
"score": "0.57824886",
"text": "def collision_map_enabled?\n return !collision_map_name.empty?\n end",
"title": ""
},
{
"docid": "60d0562b76a9a3ed7a375605a15df1ae",
"score": "0.57517856",
"text": "def create_params\n params.require(:map_layer).permit(:title_uk,\n :title_en,\n :active,\n :layer,\n :position,\n :icon,\n :map_layer_group_id,\n map_layer_link_attributes: %i[id link info _destroy])\n end",
"title": ""
},
{
"docid": "7e4bf62ce5cebd4f349055efd3acd8c2",
"score": "0.57463413",
"text": "def show\n @tilesets = Array.new\n @map = Map.find(params[:id])\n @layers = @map.layers\n @layers.each do |layer|\n tileset_id = layer.tileset_id\n unless tileset_id.nil?\n @tilesets.push(Tileset.find(tileset_id))\n end\n end\n @tilesets = @tilesets.uniq\n\n \n @maps_array = Map.all.map { |map| [map.name, map.id] }\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @map }\n end\n end",
"title": ""
},
{
"docid": "ac38f27b95822a6fe084bb1d3de7f4d9",
"score": "0.5724903",
"text": "def map?\n @map\n end",
"title": ""
},
{
"docid": "2d38815fe5f8f35b8bce45affd27f27f",
"score": "0.57128596",
"text": "def create_markers\n @marker_zones = []\n @marker_zones_bitmap = RPG::Cache.interface('worldmap/zones')\n # Custom icons\n @marker_custom_icons = []\n # Roaming pokemon markers\n @marker_roaming_pokemons = []\n end",
"title": ""
},
{
"docid": "212dd1cc40a87b91d7fa385be99cab43",
"score": "0.5703929",
"text": "def drawmap(map,z=0)\r\nend",
"title": ""
},
{
"docid": "74c29d4a01643780c1ec1a1a6d284268",
"score": "0.5697136",
"text": "def layers_data_valid?\n @layers_data.size > 0\n end",
"title": ""
},
{
"docid": "ad75635aef451c35ff49cf667a2dd1b0",
"score": "0.5693929",
"text": "def create_map\n @map_worldmap = Sprite.new(@viewport_map).set_bitmap(\n GameData::WorldMap.worldmap_image_filename(GameData::WorldMap.get(@worldmap_id).image),\n :interface\n )\n end",
"title": ""
},
{
"docid": "378514f3564885b365424248fb036b67",
"score": "0.56771",
"text": "def isLayer\n @RecordType == LAYER\n end",
"title": ""
},
{
"docid": "fcf69376bff2281e24fc96f1438743a0",
"score": "0.56767744",
"text": "def mappable?\n ! geometry.nil?\n end",
"title": ""
},
{
"docid": "99e2f30bbe458bb7e2988706b5ea53d9",
"score": "0.567172",
"text": "def index\n @maps = Map.all\n \n \n #@maps.layers.tiles.joins(:image)\n #@maps.layers\n end",
"title": ""
},
{
"docid": "f4c7899fc8310ab7b375e4cbb664d076",
"score": "0.56622857",
"text": "def index\n @cabinet_map_layers = MapLayer.all.order(position: :asc)\n end",
"title": ""
},
{
"docid": "7d8bf6377576d90828f9cc31e8f4fb0b",
"score": "0.5619075",
"text": "def main()\n\n datasource_file = 'data/trimet_cell_towers.shp'\n label = \"[FULL_NAME]\"\n # datasource_file = 'data/world_merc.shp'\n # label = \"[NAME]\"\n\n map = Mapnik::Map.new do |m|\n\n # Use the Google mercator projection\n m.srs = Mapnik::Tile::DEFAULT_OUTPUT_PROJECTION\n\n # Add a layer to the map\n m.layer 'layer' do |layer|\n\n # Add a style to the layer\n layer.style do |style|\n\n # Add a rule to the style (this one is a default rule)\n style.rule '[mapnik::geometry_type]=polygon' do |rule|\n #fill the shapes with polygon symbolizers\n rule.fill = Mapnik::Color.new('#880000')\n # Style the polygon outline\n rule.line do |stroke|\n stroke.color = Mapnik::Color.new('black')\n stroke.width = 0.5\n end\n end\n\n style.rule '[mapnik::geometry_type]=linestring' do |rule|\n rule.line do |stroke|\n stroke.color = Mapnik::Color.new('black')\n stroke.width = 0.5\n end\n end\n\n style.rule '[mapnik::geometry_type]=point' do |rule|\n\n # puts Mapnik.constants\n # symbol = Mapnik::PointSymbolizer.new('black')\n # symbol = Mapnik::MarkersSymbolizer.new('black')\n # symbol = Mapnik::MarkersSymbolizer.new('ellipse')\n # puts symbol.methods\n\n # puts rule.symbols.methods\n # puts rule.__append_symbol__(symbol)\n\n\n # default.symbols.methods.push(symbol)\n # default.symbols << symbol\n\n # rule.text \"[FULL_NAME]\" do |text|\n rule.text \"[NAME]\" do |text|\n text.label_placement = Mapnik::LABEL_PLACEMENT::POINT_PLACEMENT\n text.fill = Mapnik::Color.new('black')\n text.halo_fill = Mapnik::Color.new(\"#fff\")\n text.halo_radius = 0.85\n text.size = 9\n text.allow_overlap = false\n text.avoid_edges = true\n end\n\n # marker.height = mapnik.Expression(\"3\")\n # marker.width = mapnik.Expression(\"3\")\n # marker.fill = mapnik.Color('black')\n end\n\n if '' != label\n style.rule do |rule|\n rule.text label do |text|\n text.label_placement = Mapnik::LABEL_PLACEMENT::POINT_PLACEMENT\n text.fill = Mapnik::Color.new('black')\n text.halo_fill = Mapnik::Color.new(\"#fff\")\n text.halo_radius = 0.85\n text.size = 9\n text.allow_overlap = false\n text.avoid_edges = true\n end\n end\n end\n\n end\n\n\n # set the srs of the layer\n projection = getProj4FromShapefile(datasource_file)\n layer.srs = projection\n\n #specify the datasource for the layer\n layer.datasource = Mapnik::Datasource.create :type => 'shape', :file => datasource_file\n end\n\n end\n\n map.zoom_to_box(map.layers.first.envelope)\n map.render_to_file('my_map.png')\n print map.to_xml()\nend",
"title": ""
},
{
"docid": "83ffcd6fcc50e4e17d8cdc7201e34ad9",
"score": "0.56060064",
"text": "def load_new_map_data\n\t\t@need_refresh_tiles = true\n\tend",
"title": ""
},
{
"docid": "0d47e2d31f982d6a03eadcdf48f2e09e",
"score": "0.55827993",
"text": "def show\n @sheet = Sheet.find(params[:id])\n\n @tileset = @sheet.layer[:tilejson]\n @tiletype = @sheet.layer[:tileset_type]\n\n # TODO: allow for admin review of progress in all tasks\n if params[:type] == nil # ALWAYS nil FOR NOW\n params[:type] = \"geometry\"\n end\n\n all_polygons = Sheet.progress_for_task(@sheet.id, params[:type])\n\n fix_poly = []\n yes_poly = []\n no_poly = []\n nil_poly = []\n\n all_polygons.each do |p|\n if p[:consensus]==\"fix\"\n fix_poly.push(p.to_geojson)\n elsif p[:consensus]==\"yes\"\n yes_poly.push(p.to_geojson)\n elsif p[:consensus]==\"no\"\n no_poly.push(p.to_geojson)\n else\n nil_poly.push(p.to_geojson)\n end\n end\n\n @map = {}\n @map[:fix_poly] = { :type => \"FeatureCollection\", :features => fix_poly }\n @map[:no_poly] = { :type => \"FeatureCollection\", :features => no_poly }\n @map[:yes_poly] = { :type => \"FeatureCollection\", :features => yes_poly }\n @map[:nil_poly] = { :type => \"FeatureCollection\", :features => nil_poly }\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sheet }\n end\n end",
"title": ""
},
{
"docid": "ad7f5c806a85fe07b380a03284866759",
"score": "0.5576818",
"text": "def create\n @layer = @board.layers.new(params[:layer])\n\n respond_to do |format|\n if @layer.save\n format.html { redirect_to(@board.owner_link, :notice => 'Layer was successfully created.') }\n format.xml { render :xml => @layer, :status => :created, :location => @layer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @layer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27cdf7ad31a969c13c61e3e4ab645446",
"score": "0.5573059",
"text": "def use_new_tilemap?\n return MGC::NEW_TILEMAP_FOR_ALL_MAPS ||\n MGC::NEW_TILEMAP_MAPS_IDS.include?($game_map.map_id)\n end",
"title": ""
},
{
"docid": "3565bac6b39a3f542503a5f04dab2efb",
"score": "0.55708003",
"text": "def restricted_scanned_map?\n @document.local_restricted? && @document['layer_geom_type_s'] == 'Image'\n end",
"title": ""
},
{
"docid": "769df8e0986c75b3a2f76a7e115318c0",
"score": "0.55679625",
"text": "def map_defined?\n level = @config['levels'][@level_index]\n if level\n map_name = level['map']\n path = File.join(\n File.dirname(__FILE__),\n '..',\n 'maps',\n \"#{map_name}.txt\"\n )\n File.exists?(path)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "591590d12397a9245e6f599f4a097315",
"score": "0.5567079",
"text": "def sfmap; end",
"title": ""
},
{
"docid": "1f3d36153e3d4a756a3852ea1ee77011",
"score": "0.55609936",
"text": "def layer\n info.layer || 2\n end",
"title": ""
},
{
"docid": "01e1de668f359ea3e60baafcc6300ec3",
"score": "0.55498976",
"text": "def layer_definitions_from_layer_data(layer_data)\n if layer_data[:options] &&\n layer_data[:options][:layer_definition] &&\n layer_data[:options][:layer_definition][:layers]\n layer_data[:options][:layer_definition][:layers]\n elsif layer_data[:options] &&\n layer_data[:options][:named_map] &&\n layer_data[:options][:named_map][:layers]\n layer_data[:options][:named_map][:layers]\n else\n []\n end\n end",
"title": ""
},
{
"docid": "f114ae965d1a5cfc4e53ff0aeb1ccf2b",
"score": "0.5516598",
"text": "def test_initialize_map\n\t\tassert_equal @p.loc.name, 'Sutter Creek'\n\tend",
"title": ""
},
{
"docid": "2b3b38581975d056acb353371da174cd",
"score": "0.55030215",
"text": "def make_map(type='detail',satellite=false,world=false)\n # Create a new map object, also defining the div (\"map\") \n # where the map will be rendered in the view\n @map_type = type.to_sym\n case @map_type\n when :detail\n @map_conf = {\n :width => 690,\n :height => 400}\n @side_type = :map_search\n when :search\n @map_conf = {\n :width => 690,\n :height => 400}\n @side_type = :map_search\n when :confirm\n @map_conf = {\n :width => 690,\n :height => 400}\n @side_type = :map_search_confirm\n else\n raise 'Unrecognized map type'\n end\n\n if request.format == :iphone\n @map_conf = {\n :width => 320,\n :height => 200\n }\n end\n \n\n @map = {};\n # ym4r/gm plugin api: http://ym4r.rubyforge.org/ym4r_gm-doc/\n\n if satellite\n @map['zoom'] = 4\n else\n @map['zoom'] = 18\n \n end\n @map['zoom'] = 11 if world\n\n \n if !@water_point.blank? && !@water_point.lat.blank? && !@water_point.lng.blank?\n @map['lat'] = @water_point.lat\n @map['lng'] = @water_point.lng\n @map['zoom'] = 18\n \n if (@map_type == :detail) or (@map_type == :search)\n # @map.global_init(@map.enable_google_bar())\n #note = @water_point.note.to_s.mb_chars.length > 160 ? @water_point.note.to_s.mb_chars[0,160].to_s+'...</a>' : @water_point.note;\n note = @water_point.note\n \n if @map_type == :detail\n @map['marker_info'] = \"<b>#{@water_point.title}</b><br/>#{note}\"\n else\n #special case\n photo = @template.photo_for(@water_point, :large)\n @map['marker_info'] = \"<div style='overflow:hidden'><b><a href='/#{@locale}/water_points/#{@water_point.id}'>#{@water_point.title}</a></b><br/>#{photo}<br/>\"+t('thanks_to')+\" <a href='/#{@locale}/users/#{@water_point.posted_by.id}'>#{@water_point.posted_by.login}</a></div>\"\n end\n \n \n @map['marker_title'] = @water_point.title\n ### Bug in GM library? The following line should work, but instead generates an error:\n #@map.icon_global_init(GIcon.new(:image => \"/images/markers/lightblue.png\"), \"detail_icon\")\n ### instead need to specify these other attribs as well, even though gmaps api doesn't require them! \n \n\n \n #@map.icon_global_init(GIcon.new(:image => \"/images/markers/lightblue.png\", :icon_size => GSize.new(16,16),:icon_anchor => GPoint.new(8.0,8.0),:info_window_anchor => GPoint.new(8.0,8.0),:shadow => \"/images/markers/shadow.png\", :shadowSize => GSize.new(25.0,16.0)),\"detail_icon\")\n #detail_icon = Variable.new(\"detail_icon\")\n #marker = GMarker.new([@water_point.lat,@water_point.lng], \n # :title=> @water_point.title,\n # :icon=> detail_icon\n # )\n #@map.declare_init(marker, \"marker\") #THANK YOU to this post: http://blog.odeley.com/?p=40 \n #@map.overlay_init(marker)\n\n ###@map.record_init 'window.alert(\"foo \"+detail_icon.image+\" typeof \"+typeof detail_icon+\" mic \"+marker.getIcon().image);'\n\n # bindInfoWindowHtml() offers max_width option. GMarker constructor doesn't.\n #@map.record_init marker.bind_info_window_html(info, :max_width => 300)\n #@map.record_init marker.open_info_window_html(info, :max_width => 300) #needed here too...\n end\n else\n # Default center location. no auto open marker.\n #@map.center_zoom_init([41.898,12.518],zoom) \n @map['lat'] = 41.898\n @map['lng'] = 12.518\n end\n\n\n #mm = GMarkerManager.new(@map)#,:managed_markers => [managed_markers1,managed_markers2,managed_markers3])\n #@map.record_init \"window.WH_mgr = new MarkerManager(map);\"#,:managed_markers => [managed_markers1,managed_markers2,managed_markers3])\n\n# @map.declare_init(mm,\"mgr\")\n \n @map['skip_id'] = @water_point.blank? ? '' : @water_point.id\n \n #@map.record_init \"WH_LoadMarkerFeed(map,window.WH_mgr,'all'\"+skip_id+\");\"\n \n # Thank you: http://www.daftlogic.com/sandbox-google-maps-centre-crosshairs.htm\n crosshair_js = <<CROSSHAIR_JS_BLOCK\n //var crosshairsSize=19;\n var crosshairsSize=34;//img is really 68...\n google.maps.Map.prototype.addCrosshairs=function()\n {\n var container=$('map'); //this.getContainer();\n if(this.crosshairs)\n this.removeCrosshairs();\n\n var crosshairs=document.createElement(\"img\");\n //crosshairs.src='http://www.daftlogic.com/images/crosshairs.gif';\n crosshairs.src='/images/target_pointer.png';\n crosshairs.style.width=crosshairsSize+'px';\n crosshairs.style.height=crosshairsSize+'px';\n crosshairs.style.border='0';\n crosshairs.style.position='relative';\n crosshairs.style.top=((container.clientHeight-crosshairsSize)/2)+'px';\n crosshairs.style.left=((container.clientWidth-crosshairsSize)/2)+\"px\"; // The map is centered so 0 will do\n crosshairs.style.zIndex='500';\n container.appendChild(crosshairs);\n this.crosshairs=crosshairs;\n return crosshairs;\n };\n\n map.addCrosshairs();\n \n //Extra stuff\n google.maps.event.addListener(map,'bounds_changed',function() {\n var center = map.getCenter();\n $('water_point_lat').value = center.lat();\n $('water_point_lng').value = center.lng();\n });\n \n //move this to server-side...\n //populate w current center val if empty...\n if (!($('water_point_lat').value && $('water_point_lng').value)) {\n var center = map.getCenter();\n $('water_point_lat').value = center.lat();\n $('water_point_lng').value = center.lng();\n }\nCROSSHAIR_JS_BLOCK\n @map['crosshair_js'] = crosshair_js\n end",
"title": ""
},
{
"docid": "caab80e04d964d3f608c00c900180187",
"score": "0.549619",
"text": "def add_layers\n bottom_layer = @grid.first\n top_layer = @grid.last\n add_top_layer if top_layer.flatten.count('#').positive?\n add_bottom_layer if bottom_layer.flatten.count('#').positive?\n end",
"title": ""
},
{
"docid": "56f87e6708ffe215d5579a8fdfcef7a3",
"score": "0.54825944",
"text": "def has_map?\n longitude.present? && latitude.present?\n end",
"title": ""
},
{
"docid": "7617d4d52b971968426cdeeb78186754",
"score": "0.5478847",
"text": "def create\n @layer = Layer.new(layer_params)\n\n respond_to do |format|\n if @layer.save\n format.html { redirect_to @layer, notice: 'Layer was successfully created.' }\n format.json { render json: @layer, status: :created, location: @layer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @layer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e11f6854dcf11ddf781398cb12177d3",
"score": "0.5465505",
"text": "def initialize(map, options = {})\r\n @map = map\r\n @managed_markers = Array(options.delete(:managed_markers)) #[] if nil\r\n @options = options\r\n end",
"title": ""
},
{
"docid": "9283d5d8f816741af515d463e01924d5",
"score": "0.54550594",
"text": "def load_zones\n @no_parking_zone_default = Gmaps4rails.build_markers(NoParkingZone.all) do |plot, marker|\n marker.lat plot.latitude\n marker.lng plot.longitude\n\n @status = rand(1..4)\n @ip = \"192.168.\"+rand(0..255).to_s+\".\"+rand(15..250).to_s\n @connected = rand(50..100)\n\n if plot.reason == \"Police\"\n url_alert = \"/assets/police.png\"\n elsif plot.reason == \"Street Cleaning\"\n url_alert = \"/assets/cleaning.png\"\n elsif plot.reason == \"Festival / Parade\"\n url_alert = \"/assets/party.png\"\n end\n\n marker.picture({\n \"url\" => url_alert,\n \"width\" => 35,\n \"height\" => 30\n })\n\n marker.infowindow render_to_string(:partial => \"/no_parking_zones/info\",\n :locals => {:street => plot.street, :reason => plot.reason, :date => plot.date, :ip => @ip, :connected => @connected })\n end\n end",
"title": ""
},
{
"docid": "7df1794f518a2af1f0632ac9d3a5e8dc",
"score": "0.5451559",
"text": "def on_map?\n @map_id == $game_map.map_id\n end",
"title": ""
},
{
"docid": "d3e5111b200127cc5f68b57176fdc48d",
"score": "0.5424324",
"text": "def new_map\n mapname = \"#{MSG_EMPTY_MAP} \\##{@maps.size+1}\"\n @maps.push( FXMap.new(mapname, @mdiclient, @@default_options.dup,\n\t\t\t @mdiicon, @mdimenu, MDI_NORMAL, 0, 0, 790, 500) )\n map = @maps[-1]\n map.window.connect(SEL_PAINT) {\n map.draw\n }\n map.window.connect(SEL_CLOSE) {\n if map.close_cb\n\t@maps.delete(map)\n end\n if @maps[-1]\n\t@maps[-1].update_roomlist\n else\n\tFXMap::no_maps\n end\n }\n\n # Make it active\n @mdiclient.setActiveChild(map.window)\n map.update_roomlist\n return map\n end",
"title": ""
},
{
"docid": "bbfe7e0c7f5faa930a7452b5909fc64e",
"score": "0.54224014",
"text": "def create\n @geojson_layer = @organization.geojson_layers.build(geojson_layer_params)\n\n respond_to do |format|\n if @geojson_layer.save\n format.html { redirect_to edit_organization_geojson_layer_path(@organization, @geojson_layer), notice: 'Layer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @geojson_layer }\n format.js { render text: \"document.location = '#{edit_organization_geojson_layer_path(@organization, @geojson_layer)}'\"}\n else\n format.html { render action: 'new' }\n format.json { render json: @geojson_layer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "024a65ea9b5e6e0c281d30c2e3dbe21d",
"score": "0.54198885",
"text": "def create\n # TODO: If they have a shareable link, verify that it is acceptable\n @errors = Array.new\n params = map_params\n\n @map = Map.create(map_params)\n @okay = @map.valid?\n if @okay\n redirect_to @map, format: :json\n else\n render json: @map.errors, status: :unprocessable_entity\n end\n\n end",
"title": ""
},
{
"docid": "cd7134bc28349ce90f0e510b3531e5c1",
"score": "0.54171807",
"text": "def configure_layers_data\n # Http/base layers don't appear at viz.json\n layers = @visualization.layers(:cartodb)\n layers_data = Array.new\n layers.each { |layer|\n layer_vizjson = layer.get_presenter(@options, @configuration).to_vizjson_v2\n layers_data.push(data_for_carto_layer(layer_vizjson))\n }\n layers_data\n end",
"title": ""
},
{
"docid": "f11c94e69a7e155ccbcb4b8b39558577",
"score": "0.54153043",
"text": "def test_at_api_example\n layers = Sketchup.active_model.layers\n new_layer = layers.add(\"MyLayer\")\n layer_by_number = layers.at(1)\n layer_by_name = layers.at(\"MyLayer\")\n end",
"title": ""
},
{
"docid": "0c586e277c636f774d993b39f19be38f",
"score": "0.5413802",
"text": "def get_theme_layers\n layer_id_list = []\n base_id_list = []\n self.theme_map_layers.each do |tml|\n layer_id_list << tml.map_layer_id\n if tml.is_base_layer\n base_id_list << tml.map_layer_id\n end\n end\n return layer_id_list, base_id_list\n end",
"title": ""
},
{
"docid": "0c586e277c636f774d993b39f19be38f",
"score": "0.5413802",
"text": "def get_theme_layers\n layer_id_list = []\n base_id_list = []\n self.theme_map_layers.each do |tml|\n layer_id_list << tml.map_layer_id\n if tml.is_base_layer\n base_id_list << tml.map_layer_id\n end\n end\n return layer_id_list, base_id_list\n end",
"title": ""
},
{
"docid": "5906b876a52b656fbc6b98b6eb956094",
"score": "0.5409938",
"text": "def each_layer(service_name,&block)\n service_index(service_name,\"MapServer\")[\"layers\"].each(&block)\n end",
"title": ""
},
{
"docid": "0d3a846dae12452b934c1d48016dc308",
"score": "0.5408704",
"text": "def _initialize_layer(layer)\n newlayer = { :config => layer[:config], :name => layer[:name] }\n newlayer[:set] = layer[:set].boolean? ? layer[:set] : true\n newlayer[:load] = layer[:load].boolean? ? layer[:load] : false\n newlayer[:save] = layer[:save].boolean? ? layer[:save] : false\n newlayer[:file_set] = layer[:file_set].boolean? ? layer[:file_set] : false\n newlayer[:init] = true\n newlayer\n end",
"title": ""
},
{
"docid": "a7a99d9da2b935a846b42a97ece9d5ef",
"score": "0.5402355",
"text": "def create_missing_maps(team)\n number_of_maps_needed = self.max_rounds - team.maps.size\n if number_of_maps_needed > 0\n 1.upto(number_of_maps_needed) { Map.get_random_map(team) }\n end\n end",
"title": ""
},
{
"docid": "b2e988516577566cb0c6895a75ca056e",
"score": "0.5402212",
"text": "def on_map_init\n $pokemon_party.nuri_yuri_dynamic_light ||= [] # Safe init the stack\n light_info_stack = $pokemon_party.nuri_yuri_dynamic_light.clone\n unless light_info_stack.empty?\n @delay = proc do\n start\n light_info_stack.each do |light_info|\n id = add(*light_info[:params], type: light_info[:type])\n switch_off(id) unless light_info[:on]\n end\n end\n Scheduler.add_message(:on_transition, Scene_Map, 'NuriYuri::DynamicLight', 100, self, :update)\n end\n end",
"title": ""
},
{
"docid": "0bf83dcc89ed677d00f43d618ce3f2e8",
"score": "0.5392355",
"text": "def link_content content\n check_map_layers\n content.map.map_layers << map_layers\n content.map.save\n self.reload\n content.reload\n end",
"title": ""
},
{
"docid": "a6b4a03a3f394eafafa6a95edf73337c",
"score": "0.5391509",
"text": "def layer_add(options)\n p_layer_add(options)\n build_section_mapping\n end",
"title": ""
},
{
"docid": "7e11e86f710e37ef8ecf982b78b6cad9",
"score": "0.53864735",
"text": "def show \n Leaflet.tile_layer = \"http://tile.osm.org/{z}/{x}/{y}.png\"\n # You can also use any other tile layer here if you don't want to use Cloudmade - see http://leafletjs.com/reference.html#tilelayer for more\n Leaflet.attribution = \"Cooperativa de Servicios Públicos Limitados Consumo y Vivienda Rawson\" #Detalle del copyright\n Leaflet.max_zoom = 18\n end",
"title": ""
},
{
"docid": "0b69d6dc01844b783385ea078f228e64",
"score": "0.5366051",
"text": "def geo_resource?\n false\n end",
"title": ""
},
{
"docid": "0b69d6dc01844b783385ea078f228e64",
"score": "0.5366051",
"text": "def geo_resource?\n false\n end",
"title": ""
},
{
"docid": "ef5c71bd68a9c6e4ec238a68f0afb44d",
"score": "0.5361473",
"text": "def hidden_layers\n @hidden_layers\n end",
"title": ""
},
{
"docid": "50aea51f1b05927be0e25a12985e2c5f",
"score": "0.5360135",
"text": "def create\n @layer = Layer.new(params[:layer])\n\n respond_to do |format|\n if @layer.save\n format.html { redirect_to @layer, notice: 'Layer was successfully created.' }\n format.json { render json: @layer, status: :created, location: @layer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @layer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50aea51f1b05927be0e25a12985e2c5f",
"score": "0.5360135",
"text": "def create\n @layer = Layer.new(params[:layer])\n\n respond_to do |format|\n if @layer.save\n format.html { redirect_to @layer, notice: 'Layer was successfully created.' }\n format.json { render json: @layer, status: :created, location: @layer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @layer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44e026f69323d39ef96825bf961f7fd1",
"score": "0.535399",
"text": "def show\n @map = Map.find(params[:map_id])\n @layer = @map.layers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.text { render :text => @layer.get_wkt(params) }\n format.json {\n if params[:as_geo_json]\n render :json => @layer.get_geo_json(params)\n else\n render :json => @layer\n end\n }\n end\n end",
"title": ""
},
{
"docid": "b66e824e6834fe6587563af534b1c54c",
"score": "0.5351116",
"text": "def geo_resource?\n true\n end",
"title": ""
},
{
"docid": "d1f39d1779af80773cbffe1f6924e534",
"score": "0.53485185",
"text": "def test_create_map\n\t\tgame = Game.new 1, 1\n\t\tg = Graph.new []\n\t\tgame.create_map(g)\n\t\tassert g.vertices[0].neighbors[1]\n\t\tassert g.vertices[0].neighbors[2]\n\t\tassert g.vertices[1].neighbors[4]\n\t\tassert g.vertices[2].neighbors[3]\n\t\tassert g.vertices[2].neighbors[4]\n\t\tassert g.vertices[4].neighbors[5]\n\t\tassert g.vertices[4].neighbors[6]\n\t\tassert g.vertices[5].neighbors[6]\n\tend",
"title": ""
},
{
"docid": "ccdbae195ead4af79ff0ebfc33d298d2",
"score": "0.5346446",
"text": "def set_geojson_layer\n @geojson_layer = GeojsonLayer.find(params[:id])\n end",
"title": ""
},
{
"docid": "b2662aed23a608e57482da50b01016ca",
"score": "0.53463197",
"text": "def checkMap\n\t\t@sideBar.checkMap\n\tend",
"title": ""
},
{
"docid": "29ae8b5413b156a6dd1fbeba3f5b59dc",
"score": "0.5342321",
"text": "def setup(map_id)\n Yuki::ElapsedTime.start(:map_loading)\n @map_id = map_id\n # We save events to make sure they'll be correctly transfered on the with the MapLinker\n save_events_offset unless @events_info\n # We store the new state of the map linker enable state\n @maplinker_disabled = $game_switches[Yuki::Sw::MapLinkerDisabled]\n # マップをファイルからロードし、@map に設定\n @map = Yuki::MapLinker.load_map(@map_id)\n Yuki::ElapsedTime.show(:map_loading, 'MapLinker.load_map took')\n # 公開インスタンス変数にタイルセットの情報を設定\n load_systemtags\n tileset = $data_tilesets[@map.tileset_id]\n # -- Scheduler.start(:on_getting_tileset_name)\n @tileset_name = Yuki::MapLinker.tileset_name # -- get_tileset_name($game_temp.tileset_name || tileset.tileset_name)\n # -- $game_temp.tileset_name = nil\n @autotile_names = tileset.autotile_names\n @panorama_name = tileset.panorama_name\n @panorama_hue = tileset.panorama_hue\n @fog_name = tileset.fog_name\n @fog_hue = tileset.fog_hue\n @fog_opacity = tileset.fog_opacity\n @fog_blend_type = tileset.fog_blend_type\n @fog_zoom = tileset.fog_zoom\n @fog_sx = tileset.fog_sx\n @fog_sy = tileset.fog_sy\n @battleback_name = tileset.battleback_name\n @passages = tileset.passages\n @priorities = tileset.priorities\n # Force the first tile to be properly configured\n @passages[0] = 0\n @priorities[0] = 5\n @terrain_tags = tileset.terrain_tags\n # 表示座標を初期化\n @display_x = 0\n @display_y = 0\n # リフレッシュ要求フラグをクリア\n @need_refresh = false\n # マップイベントのデータを設定\n env = $env\n @events = {}\n @events_sym_to_id = { player: -1 }\n @map.events.each do |i, event|\n next if env.get_event_delete_state(i)\n\n event.name.force_encoding(Encoding::UTF_8) # £EncodingPatch\n e = @events[i] = Game_Event.new(@map_id, event)\n if e.sym_alias\n log_error(\"Alias #{e.sym_alias} appear multiple time in the map #{@map_id}.\\n\\tPlease use uniq aliases.\") if @events_sym_to_id.key?(e.sym_alias)\n @events_sym_to_id[e.sym_alias] = i\n end\n end\n load_events\n Yuki::ElapsedTime.show(:map_loading, 'Loading events took')\n # コモンイベントのデータを設定\n @common_events = {}\n 1.upto($data_common_events.size - 1) do |i|\n @common_events[i] = Game_CommonEvent.new(i)\n end\n Yuki::ElapsedTime.show(:map_loading, 'Loading common events took')\n # フォグの各情報を初期化\n @fog_ox = 0\n @fog_oy = 0\n @fog_tone = Tone.new(0, 0, 0, 0)\n @fog_tone_target = Tone.new(0, 0, 0, 0)\n @fog_tone_duration = 0\n @fog_opacity_duration = 0\n @fog_opacity_target = 0\n # スクロール情報を初期化\n @scroll_direction = 2\n @scroll_rest = 0\n @scroll_speed = 4\n load_follower if @next_setup_followers\n end",
"title": ""
},
{
"docid": "f993815bb0d2b4202bce152ab14451d3",
"score": "0.53334564",
"text": "def initialize(base_url, layers, options = {})\r\n super(options)\r\n @base_url = base_url.gsub(/\\?$/,\"\") #standardize the url\r\n @layers = layers\r\n @styles = options[:styles] || \"\"\r\n merc_proj = options[:merc_proj] || :mapserver\r\n @merc_proj = if merc_proj == :mapserver\r\n \"54004\"\r\n elsif merc_proj == :geoserver\r\n \"41001\"\r\n else\r\n merc_proj.to_s\r\n end\r\n @use_geographic = options.has_key?(:use_geographic)? options[:use_geographic] : false\r\n puts format\r\n end",
"title": ""
},
{
"docid": "a907306f9ada0624a83de21600919a8d",
"score": "0.53316736",
"text": "def initialize(**options)\n create_background()\n # store the options data for later refrence.\n @map_file = options[:level] || \"\"\n @map_objects = [] # container for map related objects.\n # create the 3D camera viewpoint manager\n @@camera_vantage = Camera3D_Object.new({:x => CAMERASTART[0], :y => CAMERASTART[1], :z => CAMERASTART[2]})\n #---------------------------------------------------------\n # create some new openGL_objects on the screen\n # 2D object, a texture basically...\n @map_objects << Object2D.new(:texture => \"cardboard\", :x => 0.0, :y => 0.0)\n @map_objects.last.set_axis_rotation({:speed => 0.7, :axis => 'YZX', :force => 1.0})\n # 3D object, can apply a texture to a .obj mesh file.\n # ------------------\n # This cube can be the starting of representation of space.\n @map_objects << Object3D.new({ :filename => \"test_cube\", :verbose => false })\n #@map_objects.last.set_axis_rotation({:speed => 0.5, :axis => 'XZ', :force => 1.0})\n # ------------------\n #@map_objects << Object3D.new({ :filename => \"car\", :texture => \"car-hires\", :verbose => false, :debug_draw => false })\n #@map_objects.last.set_axis_rotation({:speed => -0.8, :axis => 'YXZ', :force => 1.5})\n # ------------------\n # Chair provided by: https://free3d.com/3d-model/chair-16205.html\n # Free personal use liciense, can not sell if you include this model. Check link.\n @map_objects << Object3D.new({ :filename => \"chair\",:texture => \"Tests/test_00\", :verbose => true, :debug_draw => false })\n @map_objects.last.set_axis_rotation({:speed => -0.8, :axis => 'YXZ', :force => 1.5})\n # ------------------\n # the bellow object load fails, but reports the issue and cleans up.\n #@map_objects << Object3D.new(:filename => \"abstract\", :texture => \"cardboard\") \n end",
"title": ""
},
{
"docid": "46f773c2ff75e147bcb39e8d1df07539",
"score": "0.5327829",
"text": "def initialize(zone = nil)\n # Type of viewport the spriteset map uses\n viewport_type = :main\n exec_hooks(Spriteset_Map, :viewport_type, binding)\n init_viewports(viewport_type)\n Yuki::ElapsedTime.start(:spriteset_map)\n exec_hooks(Spriteset_Map, :initialize, binding)\n init_tilemap\n init_panorama_fog\n init_characters\n init_player\n init_weather_picture_timer\n finish_init(zone)\n rescue ForceReturn => e\n log_error(\"Hooks tried to return #{e.data} in Spriteset_Map#initialize\")\n end",
"title": ""
},
{
"docid": "556a62e70326d47dd18f2246880289be",
"score": "0.5322492",
"text": "def nlayers\n @nlayers ||= layer_shapes.size\n end",
"title": ""
},
{
"docid": "5d0dd8affbd9b4560e3f895b75ea25b1",
"score": "0.53219247",
"text": "def method_missing(m, *args, &block)\n if layers.respond_to?(m)\n layers.send(m, *args, &block)\n else\n super(m, *args, &block)\n end\n end",
"title": ""
},
{
"docid": "338530a3212c28c3205882662f1c2298",
"score": "0.53188014",
"text": "def esri_webservices\n %w[tiled_map_layer dynamic_map_layer feature_layer image_map_layer].map do |layer_type|\n send(layer_type)\n end.compact\n end",
"title": ""
},
{
"docid": "fa328476763bd6661a6af92289f8f6c9",
"score": "0.53091",
"text": "def post_load_map\n # insert logic here\n end",
"title": ""
},
{
"docid": "482063e960cc93f3a501b9e6438b4bbf",
"score": "0.53074265",
"text": "def open_travel_map\n SceneManager.call(Scene_TinyMap)\n end",
"title": ""
},
{
"docid": "37d446f99b342791c1be00c193b7f623",
"score": "0.53053737",
"text": "def test_map_nodes_added\n map = Map::new\n map.generate_map\n assert_equal map.nodes.size, 7\n end",
"title": ""
},
{
"docid": "8fa12fbb648bffcfe0b484cb61ff73a5",
"score": "0.5291242",
"text": "def data_layers\n layers.select(&:data_layer?)\n end",
"title": ""
},
{
"docid": "15119774b3569c026057c519738453ab",
"score": "0.5286993",
"text": "def valid_map_types\n [\"satellite\", \"terrain\", \"hybrid\"]\n end",
"title": ""
},
{
"docid": "237cf45521daef4b3417ae84d7a75395",
"score": "0.5285444",
"text": "def atlas_visible?\n return quality_checked? && open_access? && geom?\n end",
"title": ""
},
{
"docid": "3079001f0da0d13001a54adb4e727a00",
"score": "0.528155",
"text": "def create\n respond_with @layer = Layer.create( params[:layer] )\n end",
"title": ""
},
{
"docid": "0af6bf7917a54a935b38704064680de1",
"score": "0.52701396",
"text": "def load\n #puts \"In MappingTabView - load\"\n populate_map_cbox\n end",
"title": ""
},
{
"docid": "d8cef7c4731c19de73e7b466ce503da3",
"score": "0.52692825",
"text": "def add_layer(layer)\n requires_geoiq_id\n options = {:source => \"finder:#{layer}\"}\n response = request(:post, \"/maps/#{self.geoiq_id}/layers.json\", {:query => options})\n layer_index = response.headers[\"location\"].match(/(\\d+)\\.json/)[1].to_i\n return layer_index if response[\"status\"].to_i == 201\n end",
"title": ""
},
{
"docid": "41de68dbc1fed3641f5c98795297c863",
"score": "0.5267463",
"text": "def tile_config_json(options)\n layer_name = options[:item_id].to_s\n layer_name = \"map-\"+ layer_name if options[:item_type] == \"map\"\n \n name = self.title if options[:item_type] == \"map\"\n name = self.name if options[:item_type] == \"layer\"\n \n description = self.description\n \n attribution =\"From: <a href='http://digitalcollections.nypl.org/items/#{self.uuid}'>NYPL Digital Collections</a> | <a href='http://maps.nypl.org/warper/#{self.class.to_s.downcase}s/#{self.id}/'>Warper</a> \"\n \n bbox = self.bbox.split(\",\")\n \n tile_bbox = [bbox[0].to_f,bbox[1].to_f,bbox[2].to_f,bbox[3].to_f]\n \n centroid_y = tile_bbox[1] + ((tile_bbox[3] - tile_bbox[1]) / 2)\n centroid_x = tile_bbox[0] + ((tile_bbox[2] - tile_bbox[0]) / 2)\n\n config = {\n \"tilejson\" => \"2.0.0\",\n \"autoscale\" => true,\n \"name\" => \"#{name}\",\n \"description\" => \"#{description}\",\n \"version\" => \"1.5.0\",\n \"attribution\" => \"#{attribution}\",\n \"scheme\" => \"xyz\",\n \"tiles\" => [\"http://maptiles.nypl.org/#{layer_name}/{z}/{x}/{y}.png\"],\n \"minzoom\" => 1,\n \"maxzoom\" => APP_CONFIG['s3_tiles_max_zoom'],\n \"bounds\" => tile_bbox,\n \"center\" => [centroid_x, centroid_y, 18 ]\n }\n \n return JSON.pretty_generate(config)\n\n end",
"title": ""
},
{
"docid": "f3a080acfa0f5f48ea47d362b265e276",
"score": "0.5264794",
"text": "def layer_insignificant?(layer); end",
"title": ""
},
{
"docid": "dbb63b6378d9a63c831c78d58c0c6653",
"score": "0.525988",
"text": "def should_appear_on_map?\n return false if self['Activity'] == 'Inactive'\n return false unless self['Map?'] == true\n return false unless self['Latitude'] && self['Longitude']\n return false unless self['City'] && self['Name']\n true\n end",
"title": ""
},
{
"docid": "75c3a93cc4358bad369e232496c986d3",
"score": "0.52568644",
"text": "def trainable_layers\n layers.select { |layer| layer.is_a?(Layers::TrainableLayer) }\n end",
"title": ""
},
{
"docid": "c23b6af724d1f741d08870cfd5f938d9",
"score": "0.5256365",
"text": "def test_count_layers\n skip('Added in 2021.0') if Sketchup.version.to_f < 21.0\n start_with_empty_model\n layers = Sketchup.active_model.layers\n assert_equal(1, layers.size)\n\n layers.add('Hello')\n layers.add('World')\n layers.add_folder('Folder')\n\n num_layers = layers.count_layers\n assert_kind_of(Integer, num_layers)\n assert_equal(3, num_layers)\n end",
"title": ""
}
] |
947fe355abb9de2d1c43cf2fb027c18d | Converts a time in UTC to the local timezone. utc can either be a DateTime, Time or timestamp (Time.to_i). The returned time has the same type as utc. Any timezone information in utc is ignored (it is treated as a UTC time). | [
{
"docid": "3410abeb86179cb14badff51ff3fbd4b",
"score": "0.72792643",
"text": "def utc_to_local(utc)\n TimeOrDateTime.wrap(utc) {|wrapped|\n period_for_utc(wrapped).to_local(wrapped)\n }\n end",
"title": ""
}
] | [
{
"docid": "9cf4d891e189c62f096aaebf95122a8b",
"score": "0.682305",
"text": "def to_time\n\n @time ||= @zone.utc_to_local(utc)\n end",
"title": ""
},
{
"docid": "9cf4d891e189c62f096aaebf95122a8b",
"score": "0.682305",
"text": "def to_time\n\n @time ||= @zone.utc_to_local(utc)\n end",
"title": ""
},
{
"docid": "a44bbc9d6f6fe220e9e8da4893f3326b",
"score": "0.6771428",
"text": "def utc2user(utc_time)\n self.tz.dup.utc_to_local(utc_time) rescue utc_time # adjust\n end",
"title": ""
},
{
"docid": "7da4eab7206966a0aa7e49ba76ee61b1",
"score": "0.6770402",
"text": "def local_to_utc(time)\n time = sanitize(time)\n\n (time - rule_for_local(time).rules.first[OFFSET_BIT]).utc\n end",
"title": ""
},
{
"docid": "4e961be7619037f47368f6b7305d8b27",
"score": "0.67695254",
"text": "def to_local(utc)\n TimeOrDateTime.wrap(utc) {|wrapped|\n wrapped + @utc_total_offset\n }\n end",
"title": ""
},
{
"docid": "4e961be7619037f47368f6b7305d8b27",
"score": "0.67695254",
"text": "def to_local(utc)\n TimeOrDateTime.wrap(utc) {|wrapped|\n wrapped + @utc_total_offset\n }\n end",
"title": ""
},
{
"docid": "087f0bd1b5a5ff58eb465785dfcc3d00",
"score": "0.67690116",
"text": "def to_local(utc)\r\n TimeOrDateTime.wrap(utc) {|wrapped|\r\n wrapped + @utc_total_offset\r\n }\r\n end",
"title": ""
},
{
"docid": "ee9d0d61e77befee051d161313d626ea",
"score": "0.6698014",
"text": "def utc\n if has_local_timezone?\n @utc ||= timezone.local_to_utc(self)\n else # Already local or a floating time\n self\n end\n end",
"title": ""
},
{
"docid": "3de74f96a5da8214ea519374cefc5127",
"score": "0.6687127",
"text": "def local_to_utc(time)\n time.utc - rule_for_local(time).rules.first[OFFSET_BIT]\n end",
"title": ""
},
{
"docid": "4bcdea0fcf4e8dbc85366969121ff996",
"score": "0.66261756",
"text": "def local_to_utc(time)\n @tzinfo_timezone.local_to_utc(time.to_ri_cal_ruby_value)\n end",
"title": ""
},
{
"docid": "20f9b2d7d585c03559ee0c86346f7aaf",
"score": "0.6586584",
"text": "def to_datetime(utc=true)\n t = utc ? getutc : @time\n DateTime.civil(t.year, t.month, t.day, t.hour, t.min, t.sec, utc ? 0 : time_zone_offset_fraction)\n end",
"title": ""
},
{
"docid": "07f3b9bae593454a5f775fce16771cad",
"score": "0.6585523",
"text": "def utc_to_local(time)\n tzinfo.utc_to_local(time)\n end",
"title": ""
},
{
"docid": "197c561ff0211609b543f1c0e10fea0e",
"score": "0.6561605",
"text": "def as_utc\r\n Time.utc(year, month, day, hour, min, sec)\r\n end",
"title": ""
},
{
"docid": "70ee2c4c6d07a8693392eb5bbda50943",
"score": "0.65479255",
"text": "def utc_time(*args)\n time_with_datetime_fallback(:utc, *args)\n end",
"title": ""
},
{
"docid": "240d54a3f1141c820465e68b0b811b99",
"score": "0.65297693",
"text": "def utc2user(utc_time)\n current_user && current_user.tz ? current_user.tz.dup.utc_to_local(utc_time) : utc_time\n end",
"title": ""
},
{
"docid": "3c111eebbac69f729effd7accf62544b",
"score": "0.6520147",
"text": "def utc_to_local(time)\n time = sanitize(time)\n\n (time + utc_offset(time)).utc\n end",
"title": ""
},
{
"docid": "d2716a148869faebed254b848a8a682a",
"score": "0.6517168",
"text": "def utc_to_local(utc); end",
"title": ""
},
{
"docid": "d0df387fc1c5805c07b12801bae422fa",
"score": "0.64657325",
"text": "def local_to_utc(time) = parse_utc(tzinfo.local_to_utc(time, &:last))",
"title": ""
},
{
"docid": "854fc29172d69200e9f7bd711e41c487",
"score": "0.64518416",
"text": "def utc_time(*args)\n time_with_datetime_fallback(:utc, *args)\n end",
"title": ""
},
{
"docid": "8b9b6b458170a7e3137b1b0d4a7bb6ae",
"score": "0.6405398",
"text": "def local_time(time)\n utc_offset ? (time.utc + utc_offset) : time.localtime\n end",
"title": ""
},
{
"docid": "67c32793c7da38dd17e9269f7c951b29",
"score": "0.637807",
"text": "def utc_to_local( utc, tz_string )\n TZInfo::Timezone.get(tz_string).utc_to_local( utc )\n end",
"title": ""
},
{
"docid": "5d6fdb7a186b192715eb060ab6c6045d",
"score": "0.635773",
"text": "def to_time\n utc.to_time\n end",
"title": ""
},
{
"docid": "3b55aea3e5cdac94ed93ff418f948195",
"score": "0.63435876",
"text": "def utc_to_local(time)\n @tzinfo_timezone.utc_to_local(time.to_ri_cal_ruby_value)\n end",
"title": ""
},
{
"docid": "46c0b550bd9a379cafe554a74413ea98",
"score": "0.6334118",
"text": "def local_to_utc(time)\n time = time.to_ri_cal_date_time_value\n period = period_for_local(time)\n converted = time - period.tzoffsetto_property\n converted.tzid = \"UTC\"\n converted\n end",
"title": ""
},
{
"docid": "53ef938b817fb7c1c33d1cc9e7a360c3",
"score": "0.62979215",
"text": "def to_time\n\n @time ||= begin; u = utc; @zone.period_for_utc(u).to_local(u); end\n end",
"title": ""
},
{
"docid": "53ef938b817fb7c1c33d1cc9e7a360c3",
"score": "0.62979215",
"text": "def to_time\n\n @time ||= begin; u = utc; @zone.period_for_utc(u).to_local(u); end\n end",
"title": ""
},
{
"docid": "d6219c49786dbafba99e0fd2130e1aa3",
"score": "0.6275584",
"text": "def local_time_as_string( utc = nil )\n utc ||= Time.now.utc\n @tz_proxy ||= TZInfo::Timezone.get(self.timezone)\n @tz_proxy.utc_to_local( utc ).strftime('%a, %b %d, %Y @ %I:%M %p')\n end",
"title": ""
},
{
"docid": "4acd426442b02b2d6d93e985d12964ed",
"score": "0.62301266",
"text": "def utc_to_local(time); end",
"title": ""
},
{
"docid": "4acd426442b02b2d6d93e985d12964ed",
"score": "0.62301266",
"text": "def utc_to_local(time); end",
"title": ""
},
{
"docid": "4acd426442b02b2d6d93e985d12964ed",
"score": "0.62301266",
"text": "def utc_to_local(time); end",
"title": ""
},
{
"docid": "61e88edebf0f68804e04f03f0984c536",
"score": "0.62102884",
"text": "def utc_to_local(time)\n time = parse_utc(time)\n time.getlocal(observed_utc_offset(time))\n end",
"title": ""
},
{
"docid": "33bd2ced5fcc7121251ae0214b701d58",
"score": "0.61570364",
"text": "def local_to_utc(time, dst=true)\n tzinfo.local_to_utc(time, dst)\n end",
"title": ""
},
{
"docid": "8a6517b44ec2a2116644bab03d854aba",
"score": "0.61068904",
"text": "def utc\n utc = new_offset(0)\n\n Time.utc(\n utc.year, utc.month, utc.day,\n utc.hour, utc.min, utc.sec + utc.sec_fraction\n )\n end",
"title": ""
},
{
"docid": "763441f44bc232ffda2b4db2f4b50713",
"score": "0.60989326",
"text": "def utc_to_local(time)\n time = time.to_ri_cal_date_time_value\n converted = time + period_for_utc(time).tzoffsetto_property\n converted.tzid = identifier\n converted\n end",
"title": ""
},
{
"docid": "5d08646112ca50fd10c76eaf853217d2",
"score": "0.6077917",
"text": "def to_utc_time\n Time.utc(self.year,self.month,self.day)\n end",
"title": ""
},
{
"docid": "6ed38a5dc10606d0d4ce94e7d9dbbe46",
"score": "0.60747755",
"text": "def localtime(utc_offset = nil)\n utc.respond_to?(:getlocal) ? utc.getlocal(utc_offset) : utc.to_time.getlocal(utc_offset)\n end",
"title": ""
},
{
"docid": "1ff35a137820899ad6f08e7824421e78",
"score": "0.6066018",
"text": "def to_local(utc); end",
"title": ""
},
{
"docid": "1ff35a137820899ad6f08e7824421e78",
"score": "0.6066018",
"text": "def to_local(utc); end",
"title": ""
},
{
"docid": "4e2510d02b4dd6d66d4422f5a34bd632",
"score": "0.6065502",
"text": "def utc\n @utc ||= period.to_utc(@time)\n end",
"title": ""
},
{
"docid": "611d821fb45bd4602df01eb5d37d58a1",
"score": "0.6052982",
"text": "def local_to_utc(time, dst = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "611d821fb45bd4602df01eb5d37d58a1",
"score": "0.6052982",
"text": "def local_to_utc(time, dst = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "611d821fb45bd4602df01eb5d37d58a1",
"score": "0.6052982",
"text": "def local_to_utc(time, dst = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "35e3cc2bc14778101fcecdc6027e5254",
"score": "0.60402775",
"text": "def local(*args)\n time = Time.utc(*args)\n ActiveSupport::TimeWithZone.new(nil, self, time)\n end",
"title": ""
},
{
"docid": "be78291a6e617cd08adcea71d78a165e",
"score": "0.6003393",
"text": "def to_utc(local)\n TimeOrDateTime.wrap(local) {|wrapped|\n wrapped - @utc_total_offset\n }\n end",
"title": ""
},
{
"docid": "be78291a6e617cd08adcea71d78a165e",
"score": "0.6003393",
"text": "def to_utc(local)\n TimeOrDateTime.wrap(local) {|wrapped|\n wrapped - @utc_total_offset\n }\n end",
"title": ""
},
{
"docid": "1da96dfcdd80382073a7450f4e2ee6de",
"score": "0.5986443",
"text": "def utc?(time)\n case time\n when DateTime\n time.zone == \"+00:00\"\n when Time\n time.utc?\n else\n # Calling #to_time will always return a Time in local time. So there's\n # no point in doing `time.to_time.utc?`, as we can't really infer\n # anything useful from that.\n false\n end\n end",
"title": ""
},
{
"docid": "892978974f540b6ca2d9421bb8773857",
"score": "0.59849465",
"text": "def to_utc_time; end",
"title": ""
},
{
"docid": "8c5e6afab34e7c672e2e489cbcd64a7b",
"score": "0.5979647",
"text": "def to_utc(local)\r\n TimeOrDateTime.wrap(local) {|wrapped|\r\n wrapped - @utc_total_offset\r\n }\r\n end",
"title": ""
},
{
"docid": "858e18781ce17736e7b4858dfba6ede0",
"score": "0.59599847",
"text": "def to_date(utc=true)\n t = utc ? getutc : @time\n Date.civil(t.year, t.month, t.day)\n end",
"title": ""
},
{
"docid": "dd8dd36d4055662d23ba660af293c81a",
"score": "0.5954447",
"text": "def local_timestamp(utc_time)\n Time.zone.parse(utc_time).strftime(\"%F %R\")\n end",
"title": ""
},
{
"docid": "ae9e6a64eac9eca28b0039f4e65bc2b3",
"score": "0.5943604",
"text": "def to_time\n time = new_time\n\n if @utc_offset && @utc_offset != :utc\n time.localtime(@utc_offset)\n else\n time.utc\n end\n end",
"title": ""
},
{
"docid": "aaf472ef9616ec2f2f039ea03c011b5d",
"score": "0.59183925",
"text": "def getutc\n @getutc ||= time_zone_period.to_utc(@time)\n end",
"title": ""
},
{
"docid": "12d9897bf29fb51170f565b9a4d542f3",
"score": "0.59044605",
"text": "def utc_to_local_zone(utc_time, zone_identifier)\n lt = utc_to_local(utc_time, zone_identifier)\n ActiveSupport::TimeZone[zone_identifier].parse(lt.asctime)\nend",
"title": ""
},
{
"docid": "3ca1c6784e20f673c8fe7ff0c77982a7",
"score": "0.59012675",
"text": "def convert_utc_time_to_local_time_zone_of_lat_lng(date, utc_time)\n time = utc_time + date.zone.to_i\n\n hour, m = time.to_s.split('.')\n minute = (\".#{m}\".to_f * 60.0)\n second = (\".#{minute.to_s.split('.')[1]}\".to_f * 60.0)\n\n hour = put_in_range(hour.to_i, 0, 23, 24)\n minute = minute.truncate\n second = second.truncate\n\n return DateTime.new(date.year, date.month, date.mday, hour, minute, second, date.zone)\n end",
"title": ""
},
{
"docid": "94ce7d8e982aed3027da962bb486b202",
"score": "0.5868386",
"text": "def convert_local_time_by_timezone(local_time,time_zone)\n tz = TZInfo::Timezone.get(time_zone)\n return tz.utc_to_local(local_time.getutc)\n end",
"title": ""
},
{
"docid": "7782d37173b925a38115cf4cfa51dc57",
"score": "0.5866436",
"text": "def parse_utc(input)\n return input if input.class == Time and input.utc?\n input = input.to_str if input.respond_to? :to_str\n case input\n when nil then input\n when String then Time.parse(\"#{input} UTC\")\n else\n fraction = input.respond_to?(:sec_fraction) ? input.sec_fraction * 1_000_000 : 0\n Time.utc(input.year, input.month, input.day, input.hour, input.min, input.sec, fraction)\n end\n end",
"title": ""
},
{
"docid": "d36d74ec3785370cb1be62ba122e0c71",
"score": "0.5862049",
"text": "def local_timestamp(utc_time)\n\t\tTime.zone.parse(utc_time).strftime(\"%F %R\")\n\tend",
"title": ""
},
{
"docid": "4747d7fed5a5c08663dacf3c62f2496e",
"score": "0.5860623",
"text": "def as_utc\n @time\n end",
"title": ""
},
{
"docid": "b2b0ff6e736576103a281b4a170154f3",
"score": "0.5853077",
"text": "def to_utc(local); end",
"title": ""
},
{
"docid": "b2b0ff6e736576103a281b4a170154f3",
"score": "0.5853077",
"text": "def to_utc(local); end",
"title": ""
},
{
"docid": "8dac342f6861e71d08b094f85b539bf2",
"score": "0.57632774",
"text": "def tz(time_at)\n Time.zone.utc_to_local(time_at.utc)\n end",
"title": ""
},
{
"docid": "0b64c4cdfbc5952558a2aedcfab7f0e0",
"score": "0.5753521",
"text": "def utc\n datetime = @time.toDateTime(org.joda.time.DateTimeZone::UTC)\n self.class.new(datetime)\n end",
"title": ""
},
{
"docid": "eee686ba17157f5b2a826cedebc20576",
"score": "0.57492703",
"text": "def to_local(utc)\n @offset.to_local(utc)\n end",
"title": ""
},
{
"docid": "eee686ba17157f5b2a826cedebc20576",
"score": "0.57492703",
"text": "def to_local(utc)\n @offset.to_local(utc)\n end",
"title": ""
},
{
"docid": "0ff7dffeaa3e040fd9b3bdbedc528c11",
"score": "0.5727772",
"text": "def convert_utc_to_local_time(date, tz)\n raise Common::Exceptions::ParameterMissing, 'date' if date.nil?\n\n if tz.nil?\n 'Unable to convert UTC to local time'\n else\n date.to_time.utc.in_time_zone(tz).to_datetime\n end\n end",
"title": ""
},
{
"docid": "f19b9ec0fb353158f0eaf65b1af26e01",
"score": "0.5715282",
"text": "def to_time\r\n Time.utc(year, month, day)\r\n end",
"title": ""
},
{
"docid": "8855accf5838dd3c87e1633e1b9657e7",
"score": "0.569112",
"text": "def time_with_datetime_fallback(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0, usec=0)\n time = ::Time.send(utc_or_local, year, month, day, hour, min, sec, usec)\n # This check is needed because Time.utc(y) returns a time object in the 2000s for 0 <= y <= 138.\n time.year == year ? time : ::DateTime.civil_from_format(utc_or_local, year, month, day, hour, min, sec)\n rescue\n ::DateTime.civil_from_format(utc_or_local, year, month, day, hour, min, sec)\n end",
"title": ""
},
{
"docid": "20b99a03251f8f58069f7739239710b9",
"score": "0.56569415",
"text": "def utc?\n time_zone.name == 'UTC'\n end",
"title": ""
},
{
"docid": "17ca4d81de01c21fcb0ad80aee0f0f89",
"score": "0.56568575",
"text": "def utc\n json = get_configuration\n DateTime.parse(json['utc'])\n end",
"title": ""
},
{
"docid": "c3ea94f1baf4399385b28b444fce818f",
"score": "0.5650477",
"text": "def time_with_datetime_fallback(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0, usec=0)\n time = ::Time.send(utc_or_local, year, month, day, hour, min, sec, usec)\n\n # This check is needed because Time.utc(y) returns a time object in the 2000s for 0 <= y <= 138.\n if time.year == year\n time\n else\n ::DateTime.civil_from_format(utc_or_local, year, month, day, hour, min, sec)\n end\n rescue\n ::DateTime.civil_from_format(utc_or_local, year, month, day, hour, min, sec)\n end",
"title": ""
},
{
"docid": "a9af0596fa6a35ddfdd834b85b879ddb",
"score": "0.5640652",
"text": "def local(time, utc_offset = LOCAL_TIME_ZONE_OFFSET)\n TimeInZone.parse(time, utc_offset)\nend",
"title": ""
},
{
"docid": "47430c2192e1241f428049914de01c92",
"score": "0.5634546",
"text": "def convert_utc_time_by_timezone(utc_time,time_zone,format)\n tz = TZInfo::Timezone.get(time_zone)\n ftime = Time.strptime(utc_time,\"%Y-%m-%d %H:%M:%S\")\n return tz.utc_to_local(ftime).strftime(format)\n end",
"title": ""
},
{
"docid": "9a1ad69884e2a22088c05bd483af3a1a",
"score": "0.5609382",
"text": "def startTime(utc=true)\n # if there is no startTime return nil\n return nil if @startTime.nil?\n \n # Parse the startTime\n start_time = DateTime.parse(@startTime)\n \n # Decide if we need to return UTC or local time\n utc ? DateTime.parse(self.tz_timezone.local_to_utc(start_time).to_s) : start_time\n end",
"title": ""
},
{
"docid": "6c28d83797926913d58d63fee08ed1b2",
"score": "0.5600992",
"text": "def local(time)\n TZInfo::Timezone.get(\"America/Vancouver\").local_to_utc(Time.parse(time))\nend",
"title": ""
},
{
"docid": "a1b5c3c7393ad173f871db0cf245ba56",
"score": "0.55941826",
"text": "def local_to_utc(local, dst = Timezone.default_dst)\n TimeOrDateTime.wrap(local) {|wrapped|\n if block_given?\n period = period_for_local(wrapped, dst) {|periods| yield periods }\n else\n period = period_for_local(wrapped, dst)\n end\n \n period.to_utc(wrapped)\n }\n end",
"title": ""
},
{
"docid": "9cd4179cfb1db563ee96c29ab9967e47",
"score": "0.5585917",
"text": "def localtime(utc_offset = nil)\n utc = new_offset(0)\n\n Time.utc(\n utc.year, utc.month, utc.day,\n utc.hour, utc.min, utc.sec + utc.sec_fraction\n ).getlocal(utc_offset)\n end",
"title": ""
},
{
"docid": "da88d978e76e3d846d964df577a8da4f",
"score": "0.5582958",
"text": "def parse_utc_time(time_string)\n time = Time.parse(time_string)\n utc_offset = Time.zone_offset(time.to_s.split(' ')[-1])\n\n time.utc + utc_offset\n end",
"title": ""
},
{
"docid": "2506acd5856a33122d478e21c3ed34b2",
"score": "0.5553693",
"text": "def convert_to_time(time)\n raise ArgumentError, 'time is nil' unless time\n if time.is_a? Time\n time.utc\n else\n Time.at(time.to_i).utc\n end\n end",
"title": ""
},
{
"docid": "50000cc107b433665edc114b215d246b",
"score": "0.5517249",
"text": "def time_with_datetime_fallback(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0, usec=0)\n return nil if hour > 23 || min > 59 || sec > 59\n ::Time.send(utc_or_local, year, month, day, hour, min, sec, usec)\n rescue\n offset = utc_or_local == :local ? (::Time.local(2007).utc_offset.to_r/86400) : 0\n ::DateTime.civil(year, month, day, hour, min, sec, offset)\n end",
"title": ""
},
{
"docid": "ad789f45b2b3662fac9cc7a5cf9db0bd",
"score": "0.5512279",
"text": "def set(time)\n utc_time = time.utc\n Time.utc(utc_time.year, utc_time.month, utc_time.day, @hour, @minute, utc_time.sec).in_time_zone\n end",
"title": ""
},
{
"docid": "809e2aed8adfd309f1e65297897cd8ca",
"score": "0.55058396",
"text": "def convert_time_by_timezone_to_utc(time,time_zone)\n tz = TZInfo::Timezone.get(time_zone)\n ftime = Time.strptime(time,\"%Y-%m-%d %H:%M:%S\")\n return tz.local_to_utc(ftime)\n end",
"title": ""
},
{
"docid": "94d91caef6f8c5e176068177106c1eca",
"score": "0.54924387",
"text": "def apply_utc_offset( time )\n return time if utc_offset.nil?\n\n time = time.dup\n if utc_offset == 0\n time.utc\n else\n time.localtime(utc_offset)\n end\n time\n end",
"title": ""
},
{
"docid": "8ee94ceb98e1632d81ba6d963574ccee",
"score": "0.5475107",
"text": "def tz(time_at)\n TzTime.zone.utc_to_local(time_at.utc)\n end",
"title": ""
},
{
"docid": "1362df064e2a542cd4447ad9f7db18f2",
"score": "0.5467061",
"text": "def local_to_utc(time_string, zone:)\n TZInfo::Timezone.get(zone).local_to_utc(Time.parse(time))\nend",
"title": ""
},
{
"docid": "6127c1419b9b10a8be7ebdc2dc504c8e",
"score": "0.54576796",
"text": "def user_utc_time(user, user_time)\n \n # Timezone in which datetime is returned is either the\n # user's timezone or the East Coast time\n if user.andand.time_zone && utc_time\n time_zone = user.time_zone\n else\n time_zone = TimeZone.find_by(name: \"America/New_York\")\n end\n user_time_zone = TZInfo::Timezone.get(time_zone.name)\n utc_time = user_time_zone.local_to_utc(user_time)\n return utc_time\n end",
"title": ""
},
{
"docid": "fa374887b88e88f83882fe3b9f957158",
"score": "0.5432911",
"text": "def user2utc(user_time)\n self.tz.dup.local_to_utc(user_time) rescue user_time # unadjust\n end",
"title": ""
},
{
"docid": "e5fb5c1d5f7cea81732bc97635ca3d56",
"score": "0.5428087",
"text": "def utc?\n tzid == \"UTC\"\n end",
"title": ""
},
{
"docid": "e4489ff0fe58cc5e9d3b2b1799128c4c",
"score": "0.5421504",
"text": "def time_zone\n use_utc? ? \"UTC\" : ::Time.zone\n end",
"title": ""
},
{
"docid": "ae99d8592812810ba5f88c85e5978636",
"score": "0.5415734",
"text": "def local_to_utc(local, dst = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9c70e9c35095ddb74ca51ccb3678e92d",
"score": "0.5406761",
"text": "def to_time\n method = if self.offset == 0 then 'utc' else 'local' end\n ::Time.send(method, year, month, day, hour, min, sec) rescue self\n end",
"title": ""
},
{
"docid": "5e5802d854eb75c079125d7d6d4c5adb",
"score": "0.5390783",
"text": "def local_time(time)\n # apply timezone offset\n time += self.tz_offset\n # apply dst offset\n unless @dst_start_time.nil? or @dst_end_time.nil?\n if Time.now.between?(@dst_start_time, @dst_end_time)\n time += self.dst_offset\n end\n end\n Time.at(time)\n end",
"title": ""
},
{
"docid": "b338bfa63f37fc9e2ce3cb5dd0b7d5cb",
"score": "0.5369403",
"text": "def set_time_in_utc\n Time.zone = lab.time_zone\n self.starts_at = Time.zone.local_to_utc starts_at\n self.ends_at = Time.zone.local_to_utc ends_at\n end",
"title": ""
},
{
"docid": "9c5d99c220916273a268c6e82545f63d",
"score": "0.53220695",
"text": "def to_local(time)\n time.in_time_zone(send(self.class.time_zone_attribute_name))\n end",
"title": ""
},
{
"docid": "94a22314ad32c27a0d5d4f9d8a79f717",
"score": "0.530826",
"text": "def utc?\n return @utc\n end",
"title": ""
},
{
"docid": "17b84ee0ce818fec0b056fa4545d8deb",
"score": "0.5305022",
"text": "def user2utc(user_time)\n current_user && current_user.tz ? current_user.tz.dup.local_to_utc(user_time) : user_time\n end",
"title": ""
},
{
"docid": "daa048146760e4b095d8796e2aa196a9",
"score": "0.52879524",
"text": "def to_utc(local)\n @offset.to_utc(local)\n end",
"title": ""
},
{
"docid": "daa048146760e4b095d8796e2aa196a9",
"score": "0.52879524",
"text": "def to_utc(local)\n @offset.to_utc(local)\n end",
"title": ""
},
{
"docid": "a1c4d006c789eb6b444397815340f055",
"score": "0.5287015",
"text": "def endTime(utc=true)\n # if there is no startTime return nil\n return nil if @endTime.nil?\n \n # Parse the startTime\n end_time = DateTime.parse(@endTime)\n \n # Decide if we need to return UTC or local time\n utc ? DateTime.parse(self.tz_timezone.local_to_utc(end_time).to_s) : end_time \n end",
"title": ""
},
{
"docid": "e849fab877248a385c0180ee170684d3",
"score": "0.52861047",
"text": "def utc\n @utc = true\n return self\n end",
"title": ""
},
{
"docid": "b1858c4fb8ed4f597d41cc8a2ce5a09e",
"score": "0.5279175",
"text": "def utc_to_localtime(timestr)\n t = timestr.scan(/^(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/).first\n Time.utc(t[0], t[1], t[2], t[3], t[4], t[5]).localtime\n end",
"title": ""
}
] |
c2b3759a2522441053d9f5231522bbc3 | Return a quadtree representing the first quarter on clockwise direction | [
{
"docid": "6cfbdab346eb8bc453865119081790cf",
"score": "0.64280015",
"text": "def third_quarter\n return @third_quarter if @third_quarter\n\n @third_quarter = self.class.new(\n Point.new(upper_left.x, upper_left.y - quarter_height - LAMBDA),\n Point.new(upper_left.x + quarter_length, bottom_right.y)\n )\n @third_quarter.areas = @third_quarter.areas_within(areas)\n @third_quarter.points = @third_quarter.points_within(points)\n @third_quarter\n end",
"title": ""
}
] | [
{
"docid": "5aceb2713ddfb86745260fba32406d35",
"score": "0.68577737",
"text": "def fourth_quarter\n return @fourth_quarter if @fourth_quarter\n\n @fourth_quarter = self.class.new(\n Point.new(upper_left.x + quarter_length + LAMBDA, upper_left.y - quarter_height - LAMBDA),\n Point.new(bottom_right.x, bottom_right.y)\n )\n @fourth_quarter.areas = @fourth_quarter.areas_within(areas)\n @fourth_quarter.points = @fourth_quarter.points_within(points)\n @fourth_quarter\n end",
"title": ""
},
{
"docid": "3e11d632733189cac9e0f6ba77749bfa",
"score": "0.67458975",
"text": "def first_quarter\n return @first_quarter if @first_quarter\n\n @first_quarter = self.class.new(\n Point.new(upper_left.x, upper_left.y),\n Point.new(upper_left.x + quarter_length, upper_left.y - quarter_height)\n )\n @first_quarter.areas = @first_quarter.areas_within(areas)\n @first_quarter.points = @first_quarter.points_within(points)\n @first_quarter\n end",
"title": ""
},
{
"docid": "f150b1861243e993605979080ab168f0",
"score": "0.6703552",
"text": "def beginning_of_quarter; end",
"title": ""
},
{
"docid": "f150b1861243e993605979080ab168f0",
"score": "0.6703552",
"text": "def beginning_of_quarter; end",
"title": ""
},
{
"docid": "5f3a5d2d1b42e9e9dc1900a2b7fe91dd",
"score": "0.66084933",
"text": "def quarter\n Quarter.find_easily(deg_earned_qtr, deg_earned_yr)\n end",
"title": ""
},
{
"docid": "029bf27a0668e17174113eb346d48ea1",
"score": "0.6489054",
"text": "def next_quarter; end",
"title": ""
},
{
"docid": "029bf27a0668e17174113eb346d48ea1",
"score": "0.6489054",
"text": "def next_quarter; end",
"title": ""
},
{
"docid": "774d1c8d7062e1620170d5a5c547758e",
"score": "0.64561504",
"text": "def next_quarter(num = 1)\n num = num.floor\n return self if num.zero?\n\n next_month(num * 3)\n end",
"title": ""
},
{
"docid": "ee6b61d6cc29c8d865bd87eb1469ce43",
"score": "0.6395451",
"text": "def quarter_bath\n self.dig_for_integer(\"quarterBath\")\n end",
"title": ""
},
{
"docid": "f5bd209b03b3529e715d75711ca9c6a7",
"score": "0.63205576",
"text": "def at_beginning_of_quarter; end",
"title": ""
},
{
"docid": "f5bd209b03b3529e715d75711ca9c6a7",
"score": "0.63205576",
"text": "def at_beginning_of_quarter; end",
"title": ""
},
{
"docid": "1070e60f1afc8afcbb3c73f34d9ac4c7",
"score": "0.6265422",
"text": "def three_quarter_bath\n self.dig_for_integer(\"threeQuarterBath\")\n end",
"title": ""
},
{
"docid": "8ebf04c042ab5def54b0b0dbc70dee63",
"score": "0.6195604",
"text": "def current_quarter\n\n case self.month\n\n when 1..3 then 1\n when 4..6 then 2\n when 7..9 then 3\n else 4\n end\n\n end",
"title": ""
},
{
"docid": "85ec3f391e14a1fefe95c2d17198754b",
"score": "0.61505896",
"text": "def quarter\n @interval = 'quarter'\n self\n end",
"title": ""
},
{
"docid": "d250087c21e26f6f0b5efcac4c81acfc",
"score": "0.61432767",
"text": "def prior_quarter(num = 1)\n next_quarter(-num)\n end",
"title": ""
},
{
"docid": "43a76acef6d3a072d315f1b0fbd1ba6e",
"score": "0.61264235",
"text": "def prev_quarter; end",
"title": ""
},
{
"docid": "43a76acef6d3a072d315f1b0fbd1ba6e",
"score": "0.61264235",
"text": "def prev_quarter; end",
"title": ""
},
{
"docid": "c2472569c65ae0fb03ef8d9b81e05b15",
"score": "0.6110581",
"text": "def all_quarter; end",
"title": ""
},
{
"docid": "c2472569c65ae0fb03ef8d9b81e05b15",
"score": "0.6110581",
"text": "def all_quarter; end",
"title": ""
},
{
"docid": "437aef3bd256fd70b2805f5df3a89e82",
"score": "0.60749435",
"text": "def quarter_length\n @quarter_length ||= ((bottom_right.x - upper_left.x) / 2).ceil\n end",
"title": ""
},
{
"docid": "1786f2425d53315bede5d62c3d1a2154",
"score": "0.60552436",
"text": "def add_quarter\n end",
"title": ""
},
{
"docid": "ada72c45ed0818adecaa1c6eb1dd8aad",
"score": "0.60470176",
"text": "def last_quarter; end",
"title": ""
},
{
"docid": "ada72c45ed0818adecaa1c6eb1dd8aad",
"score": "0.60470176",
"text": "def last_quarter; end",
"title": ""
},
{
"docid": "8ed90d552249be04e7e442aa2a0946f6",
"score": "0.5972925",
"text": "def quarter\n organization_quarter.quarter unless organization_quarter.nil?\n end",
"title": ""
},
{
"docid": "1cf35d847f1784912f4c27ab6d7917a8",
"score": "0.5971023",
"text": "def quarter\n case month\n when (1..3)\n 1\n when (4..6)\n 2\n when (7..9)\n 3\n when (10..12)\n 4\n end\n end",
"title": ""
},
{
"docid": "bdc65b3b82684047c125a21eaf15869e",
"score": "0.5912405",
"text": "def start_of_quarter(year, quarter)\n fiscal_year_calendar.start_of_quarter(year + 1, quarter)\n end",
"title": ""
},
{
"docid": "f76a4673a39eb9b62f6a5f4b27289469",
"score": "0.59088874",
"text": "def start_of_quarter(year, quarter)\n case quarter\n when 1\n start_of_month(year, 7)\n when 2\n start_of_month(year, 10)\n when 3\n start_of_month(year, 1)\n when 4\n start_of_month(year, 4)\n end\n end",
"title": ""
},
{
"docid": "722e13cfefe280efc9082971149885fe",
"score": "0.589676",
"text": "def second_quarter\n return @second_quarter if @second_quarter\n\n @second_quarter = self.class.new(\n Point.new(upper_left.x + quarter_length + LAMBDA, upper_left.y),\n Point.new(bottom_right.x, upper_left.y - quarter_height)\n )\n @second_quarter.areas = @second_quarter.areas_within(areas)\n @second_quarter.points = @second_quarter.points_within(points)\n @second_quarter\n end",
"title": ""
},
{
"docid": "23f32f75896092e3553d489fdd988165",
"score": "0.58908945",
"text": "def quadrangle\n\n vertexs = [ [-0.5, -0.5, 0], [ 0.5, -0.5, 0], [-0.5, 0.5, 0],\n [ 0.5, 0.5, 0] ]\n\n group(\n triangle( vertexs[2], vertexs[1], vertexs[0], qDefault ),\n triangle( vertexs[1], vertexs[2], vertexs[3], qDefault ) )\n\nend",
"title": ""
},
{
"docid": "5eafb1183f85037c5e619801af280803",
"score": "0.5890533",
"text": "def all_quarter\n beginning_of_quarter..end_of_quarter\n end",
"title": ""
},
{
"docid": "a9cb4ea91d2f92a547dd0b0336adbf24",
"score": "0.5888603",
"text": "def all_quarter\n beginning_of_quarter..end_of_quarter\n end",
"title": ""
},
{
"docid": "cb40add8ea958050543a3eece53170a0",
"score": "0.5883331",
"text": "def find_quarter(time)\n return (time.min / QUARTER_CONST) + 1\n end",
"title": ""
},
{
"docid": "760d4cddf7b7330c70e36c3e1637885b",
"score": "0.5865088",
"text": "def beginning_of_quarter\r\n beginning_of_month.change(:month => [10, 7, 4, 1].detect { |m| m <= self.month })\r\n end",
"title": ""
},
{
"docid": "1762bc9c655d40d3d05d1c8ddb97fcad",
"score": "0.5849716",
"text": "def end_of_quarter; end",
"title": ""
},
{
"docid": "1762bc9c655d40d3d05d1c8ddb97fcad",
"score": "0.5849716",
"text": "def end_of_quarter; end",
"title": ""
},
{
"docid": "e467ccf29eca60b7b58955d57780a548",
"score": "0.5841521",
"text": "def beginning_of_half\n if month > 9\n (beginning_of_quarter - 15).beginning_of_quarter\n elsif month > 6\n beginning_of_quarter\n else\n beginning_of_year\n end\n end",
"title": ""
},
{
"docid": "629d88f35d1f16d03317ae560c0d3268",
"score": "0.58242077",
"text": "def quarterFromDatabase(measurement)\n inches = measurement / 25.4\n quarterInches = (inches * 4).round\n return quarterInches.to_s() << \"/4\"\n end",
"title": ""
},
{
"docid": "a849acff7fc1e5ccbb3fb83767787da7",
"score": "0.58011574",
"text": "def quarter\n @quarter ||= calendar.quarter(merch_month)\n end",
"title": ""
},
{
"docid": "9b91592d0ef7236319e52e62cca2db9a",
"score": "0.5787273",
"text": "def aggregated_quarter(offset = 1)\n last_quarters = quarters.sort.last(4 + offset).take(4)\n last_quarters.inject(data_klass.new) do |acc, (_, quarter)|\n acc << quarter\n end\n end",
"title": ""
},
{
"docid": "ff113cf5a81ff4eadcfde2c858911345",
"score": "0.5755528",
"text": "def start_of_quarter(year, quarter)\n case quarter\n when QUARTER_1\n start_of_month(year, 1)\n when QUARTER_2\n start_of_month(year, 4)\n when QUARTER_3\n start_of_month(year, 7)\n when QUARTER_4\n start_of_month(year, 10)\n else\n raise \"invalid quarter\"\n end\n end",
"title": ""
},
{
"docid": "ff113cf5a81ff4eadcfde2c858911345",
"score": "0.5755528",
"text": "def start_of_quarter(year, quarter)\n case quarter\n when QUARTER_1\n start_of_month(year, 1)\n when QUARTER_2\n start_of_month(year, 4)\n when QUARTER_3\n start_of_month(year, 7)\n when QUARTER_4\n start_of_month(year, 10)\n else\n raise \"invalid quarter\"\n end\n end",
"title": ""
},
{
"docid": "9854d3dfc6a870b254f6df75082a9cb1",
"score": "0.57508236",
"text": "def beginning_of_quarter?\n beginning_of_quarter == self\n end",
"title": ""
},
{
"docid": "940bc87c4077e6f0f67cf46b8c619484",
"score": "0.5736403",
"text": "def construct_quadtree(qt, centre, radius)\n def construct_quadtree_r(qt, x, y, w, centre, radius)\n # Cases: Not overlapping - do nothing\n # Fully overlapping - delete all subtrees, replace with leaf\n # Partial overlap - subdivide and recur\n # Can replace full and partial overlap cases by merging if all\n # children are leaves. Inefficient though as it subdivides to \n # 1 pixel. Don't do this in a real implementation.\n if w == 1\n if in_circle(x, y, centre, radius) and qt.value != 1\n return Quadtree.new(1, nil, nil, nil, nil)\n else\n return qt\n end\n end\n if in_circle(x, y, centre, radius) and in_circle(x, y+w, centre, radius) and in_circle(x+w, y, centre, radius) and in_circle(x+w, y+w, centre, radius)\n #full overlap\n return Quadtree.new(1, nil, nil, nil, nil)\n elsif circle_aabb_overlap?(Circle.new(Point.new(centre[0], centre[1]), radius),\n AABB.new(Point.new(x, y), w))\n #partial overlap\n #subdivide leaf nodes and recur\n if leaf_node(qt)\n oldval = qt.value\n qt = Quadtree.new(nil, Quadtree.new(oldval,nil,nil,nil,nil),\n Quadtree.new(oldval,nil,nil,nil,nil), Quadtree.new(oldval,nil,nil,nil,nil),\n Quadtree.new(oldval,nil,nil,nil,nil))\n end\n tlchild = construct_quadtree_r(qt.topleft,x,y,w/2,centre,radius)\n trchild = construct_quadtree_r(qt.topright,x+w/2,y,w/2,centre,radius)\n blchild = construct_quadtree_r(qt.bottomleft,x,y+w/2,w/2,centre,radius)\n brchild = construct_quadtree_r(qt.bottomright,x+w/2,y+w/2,w/2,centre,radius)\n if leaf_node(tlchild) and leaf_node(trchild) and leaf_node(blchild) and leaf_node(brchild)\n sum = tlchild.value+trchild.value+blchild.value+brchild.value\n if sum == 0 #all black\n return Quadtree.new(0, nil, nil, nil, nil)\n elsif sum == 4 # all white\n return Quadtree.new(1, nil, nil, nil, nil)\n end\n end\n return Quadtree.new(nil, tlchild, trchild, blchild, brchild)\n else\n #no overlap\n return qt\n end\n end\n construct_quadtree_r(qt, 0, 0, 512, centre, radius)\nend",
"title": ""
},
{
"docid": "78fdbeac0e56546aac951a4108a809a4",
"score": "0.5708597",
"text": "def recurisve\n list = []\n (1..4).each do |i|\n e = @quadtree.shift()\n e = recurisve if e == 'x'\n list << e\n end\n return reverse(list)\n end",
"title": ""
},
{
"docid": "ca77b24a03a5c907be041d47c2f1a396",
"score": "0.56944335",
"text": "def quarter\n puts 'Dispensed quarter' # 25\n end",
"title": ""
},
{
"docid": "4651be77a3995bee74c559e15bcaf2f2",
"score": "0.5659017",
"text": "def quarter_of(month)\n case month\n when 1..3\n return 1\n when 4..6\n return 2\n when 7..9\n return 3\n when 10..12\n return 4\n end\nend",
"title": ""
},
{
"docid": "1b2f011d4a6fd8eaa9094bccec27fecc",
"score": "0.5647361",
"text": "def at_end_of_quarter; end",
"title": ""
},
{
"docid": "1b2f011d4a6fd8eaa9094bccec27fecc",
"score": "0.5647361",
"text": "def at_end_of_quarter; end",
"title": ""
},
{
"docid": "d1473d387166f226854c234bf83380b6",
"score": "0.5631745",
"text": "def beginning_of_quarter\n first_quarter_month = [10, 7, 4, 1].detect { |m| m <= month }\n beginning_of_month.change(:month => first_quarter_month)\n end",
"title": ""
},
{
"docid": "ea323b52260ed672251ce197f773dbb9",
"score": "0.5618627",
"text": "def quaternion\n raise(ShapeError, \"Expected square matrix\") if self.shape[0] != self.shape[1]\n raise(ShapeError, \"Expected 3x3 rotation (or 4x4 homogeneous) matrix\") if self.shape[0] > 4 || self.shape[0] < 3\n\n q = NMatrix.new([4], dtype: self.dtype == :float32 ? :float32: :float64)\n rotation_trace = self[0,0] + self[1,1] + self[2,2]\n if rotation_trace >= 0\n self_w = self.shape[0] == 4 ? self[3,3] : 1.0\n root_of_homogeneous_trace = Math.sqrt(rotation_trace + self_w)\n q[0] = root_of_homogeneous_trace * 0.5\n s = 0.5 / root_of_homogeneous_trace\n q[1] = (self[2,1] - self[1,2]) * s\n q[2] = (self[0,2] - self[2,0]) * s\n q[3] = (self[1,0] - self[0,1]) * s\n else\n h = 0\n h = 1 if self[1,1] > self[0,0]\n h = 2 if self[2,2] > self[h,h]\n\n case_macro = Proc.new do |i,j,k,ii,jj,kk|\n qq = NMatrix.new([4], dtype: :float64)\n self_w = self.shape[0] == 4 ? self[3,3] : 1.0\n s = Math.sqrt( (self[ii,ii] - (self[jj,jj] + self[kk,kk])) + self_w)\n qq[i] = s*0.5\n s = 0.5 / s\n qq[j] = (self[ii,jj] + self[jj,ii]) * s\n qq[k] = (self[kk,ii] + self[ii,kk]) * s\n qq[0] = (self[kk,jj] - self[jj,kk]) * s\n qq\n end\n\n case h\n when 0\n q = case_macro.call(1,2,3, 0,1,2)\n when 1\n q = case_macro.call(2,3,1, 1,2,0)\n when 2\n q = case_macro.call(3,1,2, 2,0,1)\n end\n\n self_w = self.shape[0] == 4 ? self[3,3] : 1.0\n if self_w != 1\n s = 1.0 / Math.sqrt(self_w)\n q[0] *= s\n q[1] *= s\n q[2] *= s\n q[3] *= s\n end\n end\n\n q\n end",
"title": ""
},
{
"docid": "246d77b771c1811481ae55544c48ed58",
"score": "0.55956817",
"text": "def quarters\n qrts = eps.select{ |e| (e.quarter > 0) && (e.quarter < 5) }\n qrts.sort_by{ |q| [-q.year, -q.quarter] }\n end",
"title": ""
},
{
"docid": "e8aef2cf1e42d43b991fb7578956568c",
"score": "0.5582637",
"text": "def quarter_of(month)\n case month\n when 1,2,3 then return 1\n when 4,5,6 then return 2\n when 7,8,9 then return 3\n else return 4\n end\nend",
"title": ""
},
{
"docid": "286a68a17e65c29f450f12f90a5e3ce8",
"score": "0.5581095",
"text": "def end_of_quarter; start_of_quarter.months_since(3) - 1 end",
"title": ""
},
{
"docid": "40ce8772e2746035c1ff76e451e17f0c",
"score": "0.55679244",
"text": "def quad_tree (tx, ty, zoom)\n quad_key = ''\n ty = (2**zoom - 1) - ty\n i = zoom\n while i > 0 do\n digit = 0\n mask = 1 << (i-1)\n digit += 1 if (tx & mask) != 0\n digit += 2 if (ty & mask) != 0\n quad_key += digit.to_s\n i -= 1\n end\n quad_key\n end",
"title": ""
},
{
"docid": "bc3a0b8115ff8c37aafc78f432100f95",
"score": "0.55673975",
"text": "def quarter_of(month)\n (month / 3.0).ceil\nend",
"title": ""
},
{
"docid": "67a93ef3f3e5bffcc9c8545675883d87",
"score": "0.5556835",
"text": "def quarter_of(month)\n (4 * month / 12.to_f).ceil\nend",
"title": ""
},
{
"docid": "0706752b37962a34b5e202b381620548",
"score": "0.55033886",
"text": "def quarter_number\n month = self.sale_date.strftime(\"%m\").to_i\n if month <= 3\n 1 # first quarter\n elsif month > 3 and month < 7\n 2 # second quarter\n elsif month >= 7 and month <= 9\n 3 # third quarter\n else\n 4 # forth quarter\n end\n end",
"title": ""
},
{
"docid": "96ce6252d25d776c258246f78b09f15f",
"score": "0.5502058",
"text": "def quarter\n [\n Date.today.strftime('%B'),\n Date.today.next_month.strftime('%B'),\n Date.today.next_month.next_month.strftime('%B')\n ]\n end",
"title": ""
},
{
"docid": "ecf0ba02f48973a6338975238aabde04",
"score": "0.5461735",
"text": "def double_round\n quarter_round( 0, 4, 8,12) # first column\n quarter_round( 1, 5, 9,13) # second column\n quarter_round( 2, 6,10,14) # third column\n quarter_round( 3, 7,11,15) # fourth column\n quarter_round( 0, 5,10,15) # first diagonal\n quarter_round( 1, 6,11,12) # second diagonal\n quarter_round( 2, 7, 8,13) # third diagonal\n quarter_round( 3, 4, 9,14) # fourth diagonal\n end",
"title": ""
},
{
"docid": "5a893aa27c67a8370c908c97b8e511e5",
"score": "0.54248554",
"text": "def quadrant; end",
"title": ""
},
{
"docid": "8338f09e1b2113cc3b4d98ca1f8f7bde",
"score": "0.53992295",
"text": "def quarter(merch_month)\n case merch_month\n when 1,2,3\n return QUARTER_1\n when 4,5,6\n return QUARTER_2\n when 7,8,9\n return QUARTER_3\n when 10,11,12\n return QUARTER_4\n else\n raise \"invalid merch month\"\n end\n end",
"title": ""
},
{
"docid": "8338f09e1b2113cc3b4d98ca1f8f7bde",
"score": "0.53992295",
"text": "def quarter(merch_month)\n case merch_month\n when 1,2,3\n return QUARTER_1\n when 4,5,6\n return QUARTER_2\n when 7,8,9\n return QUARTER_3\n when 10,11,12\n return QUARTER_4\n else\n raise \"invalid merch month\"\n end\n end",
"title": ""
},
{
"docid": "c921a2711461937c80dfc6053782959d",
"score": "0.5397941",
"text": "def quarter_round(a_i, b_i, c_i, d_i)\n # save many calls to #[] and #[]=\n a, b, c, d = @block[a_i], @block[b_i], @block[c_i], @block[d_i]\n\n a = (a+b) & WORD; d = (d^a) & WORD; d = rotate_left(d, 16)\n c = (c+d) & WORD; b = (b^c) & WORD; b = rotate_left(b, 12)\n a = (a+b) & WORD; d = (d^a) & WORD; d = rotate_left(d, 8)\n c = (c+d) & WORD; b = (b^c) & WORD; b = rotate_left(b, 7)\n\n @block[a_i], @block[b_i], @block[c_i], @block[d_i] = a, b, c, d\n end",
"title": ""
},
{
"docid": "090dc393e8e32e21700e2efb14391513",
"score": "0.53563863",
"text": "def trq(build = true)\n @trq ||= QuadTree.new(Vector.new(tl.x + (br.x - tl.x) / 2.0, tl.y), Vector.new(br.x, br.y + (tl.y - br.y) / 2.0), self) if build\n @trq\n end",
"title": ""
},
{
"docid": "afa76742f1d3dbb986499e5ba8bf2d56",
"score": "0.53563774",
"text": "def set_quarter\n Quarter.all.sort.each do |q|\n self.quarter = (q.start_date..q.end_date).include?(date) ? q : nil\n end\n end",
"title": ""
},
{
"docid": "12a19ff6cf5a8b84b0be13f1cc2a844c",
"score": "0.53374034",
"text": "def to_quarter_period\n return self if quarter?\n self.class.quarter(value)\n end",
"title": ""
},
{
"docid": "12a19ff6cf5a8b84b0be13f1cc2a844c",
"score": "0.53374034",
"text": "def to_quarter_period\n return self if quarter?\n self.class.quarter(value)\n end",
"title": ""
},
{
"docid": "9820bff3cf9df24b1ee649ce033f6098",
"score": "0.52984",
"text": "def last_five_quarters\n period.to_quarter_period.value.downto(4)\n end",
"title": ""
},
{
"docid": "11dea9d23a347ffb360ac574d61d6e1b",
"score": "0.5282472",
"text": "def end_of_quarter(year, quarter)\n case quarter\n when 1\n end_of_month(year, 9)\n when 2\n end_of_month(year, 12)\n when 3\n end_of_month(year, 3)\n when 4\n end_of_month(year, 6)\n end\n end",
"title": ""
},
{
"docid": "d0fdc6bd2ae58e89d16db0fa77685c3a",
"score": "0.527468",
"text": "def quarter\n puts 'Dispensed quarter'\n end",
"title": ""
},
{
"docid": "889df4d2e9a7ac73d56e9107b8b1f8ec",
"score": "0.52648777",
"text": "def quarter_height\n @quarter_height ||= ((upper_left.y - bottom_right.y) / 2).ceil\n end",
"title": ""
},
{
"docid": "fb7148574c8d7d46042143e1a9f53e7c",
"score": "0.5259754",
"text": "def next\n next_qtr_code = quarter_code == 4 ? 1 : quarter_code + 1\n next_year = quarter_code == 4 ? year + 1 : year\n Quarter.find(\"#{%w( WIN SPR SUM AUT )[next_qtr_code-1]}#{next_year}\")\n end",
"title": ""
},
{
"docid": "8e2c122471fc9e7066eb755bb8f54fe3",
"score": "0.5228745",
"text": "def quarter_months\n quarters = [[1,2,3], [4,5,6], [7,8,9], [10,11,12]]\n quarters[self.month - 1]\n end",
"title": ""
},
{
"docid": "306eec7c498b3f74d2ee6037ae487bd6",
"score": "0.5214612",
"text": "def quadrant(angle_rad, offset: 0.0)\n k = 4.0\n angle_rad = (angle_rad + offset) % (2*Math::PI)\n ((angle_rad * k/(2*Math::PI)).floor) % k\n end",
"title": ""
},
{
"docid": "9d58b442d3ce97b4b9e622e010376e3b",
"score": "0.5202917",
"text": "def get_term_quarter(term_id)\n term_quarters = { \"2\" => \"Fall\", \"4\" => \"Winter\", \"6\" => \"Spring\", \"8\" => \"Summer\" }\n quarter = \"\"\n term_suffix = term_id[3, 3]\n quarter = term_quarters[term_suffix] if term_quarters.key?(term_suffix)\n quarter\n end",
"title": ""
},
{
"docid": "081e9282009532a54ae0b2cb3f9bf912",
"score": "0.5187784",
"text": "def rotation\n @rotation || -Rotation::Quarter\n end",
"title": ""
},
{
"docid": "2f35bf599659b908fca6e70a6dc580c0",
"score": "0.5150289",
"text": "def quadrant\n # Magical integer arithmetic\n (@col / 3) + ((@row / 3) * 3)\n end",
"title": ""
},
{
"docid": "9c6185544a93f6849af7a814aed8d941",
"score": "0.5149605",
"text": "def quarterToDatabase(measurement)\n quarterInches = measurement[0, measurement.index('/')] \n inches = quarterInches / 4\n return inches * 25.4\n end",
"title": ""
},
{
"docid": "1d63e7cca047a06fd13c2b5619ab7f05",
"score": "0.51168513",
"text": "def quarter_title\n titles = %w( winter spring summer autumn )\n titles[quarter_code-1]\n end",
"title": ""
},
{
"docid": "6c4342ddd33b5fe9b3d4e37877670af2",
"score": "0.5113402",
"text": "def continued_fraction q\n # Base case\n # return the numeration if we are a whole number\n return [q.numer] if q.denom == 1\n \n # Get leading digit\n # the largest integer that fits inside the fraction\n head = q.to_i\n\n # The recursive step is to return the continued fraction\n # representation of the inverse of the remaining fraction\n # after subtracting head\n tail = continued_fraction (q - head).inv\n\n # The result is the head and tail combined\n return [head] + tail\nend",
"title": ""
},
{
"docid": "b64fbdb83ec62783e5b647d02aad03a2",
"score": "0.50991577",
"text": "def to_fiscal_quarters(offset_month=1)\n first_quarter = beginning_of_fiscal_year(offset_month)\n second_quarter = first_quarter+3.months\n third_quarter = second_quarter+3.months\n fourth_quarter = third_quarter+3.months\n \n [first_quarter, second_quarter, third_quarter, fourth_quarter]\n end",
"title": ""
},
{
"docid": "98072d80db7b8bfaa03e4df566212f32",
"score": "0.5086937",
"text": "def tree\r\n low_rational_number = self.rational_number_value\r\n high_rational_number = self.rational_number.parent.child_from_position(self.position+1).number\r\n\r\n base_class.where(:rational_number_value.gt => low_rational_number, :rational_number_value.lt => high_rational_number)\r\n end",
"title": ""
},
{
"docid": "eacb0eaca8346da7e767991929842374",
"score": "0.5058247",
"text": "def end_of_half\n if month < 4\n (end_of_quarter + 15).end_of_quarter\n elsif month < 7\n end_of_quarter\n else\n end_of_year\n end\n end",
"title": ""
},
{
"docid": "2dbb5cdc506053ca87794f311975cd57",
"score": "0.5056664",
"text": "def end_of_quarter(year, quarter)\n fiscal_year_calendar.end_of_quarter(year + 1, quarter)\n end",
"title": ""
},
{
"docid": "0eedb9c7a48a42604d8c2338557b15b9",
"score": "0.50433177",
"text": "def quarter_wind\n fetch('compass.quarter-wind.word')\n end",
"title": ""
},
{
"docid": "11daa030eb2e7499194cac0b8b0b8544",
"score": "0.5039965",
"text": "def round_up_to_nearest_quarter_hour(hours)\n round_up(hours*4)/4\n end",
"title": ""
},
{
"docid": "b913b19e945e9d1c9484bcb8879a9be6",
"score": "0.5030215",
"text": "def process\n if @quadtree.first() == \"w\" or @quadtree.first() == \"b\"\n return @quadtree.flatten.join(\"\")\n else\n @quadtree.shift()\n return recurisve.flatten.join(\"\")\n end\n end",
"title": ""
},
{
"docid": "4c3c52b469247289f30eb7359abaca4e",
"score": "0.5027043",
"text": "def tlq(build = true)\n @tlq ||= QuadTree.new(Vector.new(tl), Vector.new(tl.x + (br.x - tl.x) / 2.0, br.y + (tl.y - br.y) / 2.0), self) if build\n @tlq\n end",
"title": ""
},
{
"docid": "3c85fc2fa33c428acf57c9b4090762ed",
"score": "0.5014462",
"text": "def get_quadrant(row, column)\n\t\tcase row\n\t\twhen 0..2\n\t\t\treturn (column / 3) + 1\n\t\twhen 3..5\n\t\t\treturn (column / 3) + 4\n\t\twhen 6..8\n\t\t\treturn (column / 3) + 7\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1d8ee5a3fb8422e5e4b4a3e1f7992a8a",
"score": "0.50110406",
"text": "def end_of_quarter?\n end_of_quarter == self\n end",
"title": ""
},
{
"docid": "aa785b9f9c1f62c80e9b43e72350b634",
"score": "0.50050414",
"text": "def part_one\n trees_on_slope(3, 1)\n end",
"title": ""
},
{
"docid": "a61422fc22ab6d00afd0a0b565ed0c03",
"score": "0.4997601",
"text": "def getByQ( key, year, quarter )\n month = 1 + (quarter-1)*3;\n date = Date.new( year, month, 1 ); \n getByD( key, date );\n end",
"title": ""
},
{
"docid": "5d9ad8e1ec9e9eefd719e09d16b4145e",
"score": "0.4990442",
"text": "def count_quarters(date)\n (date.year-2010)*4 + date.quarter - 1\n end",
"title": ""
},
{
"docid": "31972da7e27aba03c8caf4e76fd5026e",
"score": "0.49867922",
"text": "def end_of_quarter(year, quarter)\n case quarter\n when QUARTER_1\n end_of_month(year, 3)\n when QUARTER_2\n end_of_month(year, 6)\n when QUARTER_3\n end_of_month(year, 9)\n when QUARTER_4\n end_of_month(year, 12)\n else\n raise \"invalid quarter\"\n end\n end",
"title": ""
},
{
"docid": "31972da7e27aba03c8caf4e76fd5026e",
"score": "0.49867922",
"text": "def end_of_quarter(year, quarter)\n case quarter\n when QUARTER_1\n end_of_month(year, 3)\n when QUARTER_2\n end_of_month(year, 6)\n when QUARTER_3\n end_of_month(year, 9)\n when QUARTER_4\n end_of_month(year, 12)\n else\n raise \"invalid quarter\"\n end\n end",
"title": ""
},
{
"docid": "e5856bf2bd4922932f6f683c886312a1",
"score": "0.49858966",
"text": "def flattenUVQ(uvq)\n\treturn Geom::Point3d.new(uvq.x / uvq.z, uvq.y / uvq.z, 1.0)\n end",
"title": ""
},
{
"docid": "e5856bf2bd4922932f6f683c886312a1",
"score": "0.49858966",
"text": "def flattenUVQ(uvq)\n\treturn Geom::Point3d.new(uvq.x / uvq.z, uvq.y / uvq.z, 1.0)\n end",
"title": ""
},
{
"docid": "e5856bf2bd4922932f6f683c886312a1",
"score": "0.49858966",
"text": "def flattenUVQ(uvq)\n\treturn Geom::Point3d.new(uvq.x / uvq.z, uvq.y / uvq.z, 1.0)\n end",
"title": ""
},
{
"docid": "e5856bf2bd4922932f6f683c886312a1",
"score": "0.49858966",
"text": "def flattenUVQ(uvq)\n\treturn Geom::Point3d.new(uvq.x / uvq.z, uvq.y / uvq.z, 1.0)\n end",
"title": ""
},
{
"docid": "f3260c438dc302c2ff42d654712bd160",
"score": "0.49857816",
"text": "def doubleWithLeftChild(k3)\n k3.left = rotateWithRightChild(k3.left)\n return rotateWithLeftChild(k3)\n end",
"title": ""
}
] |
10ad05447871bba3e940663244142827 | POST /xmt/ad/advertisements POST /xmt/ad/advertisements.json | [
{
"docid": "f905ed4b4d3329ae49fa798bb8da46f2",
"score": "0.6190163",
"text": "def create\n @advertisement = Advertisement.new(advertisement_params)\n\n respond_to do |format|\n if @advertisement.save\n format.html {redirect_to xmt_ad_advertisements_url(site_id: @site.id), notice: '广告添加完成'}\n format.json {render :show, status: :created, location: @advertisement}\n else\n format.html {render :new}\n format.json {render json: @advertisement.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "f505c680fff7941b050a72c018cbc155",
"score": "0.716385",
"text": "def delta_advertisements(params = {}, options = {}, &block)\n default_option(options, :record_class, DeltaAdvertisement)\n perform_request(:post, 'delta/advertisements', options.merge(body: params), &block)\n end",
"title": ""
},
{
"docid": "2244db4ddb5e2d56c48b6dee3c7e6af7",
"score": "0.6648158",
"text": "def create_ad(params={})\n request(:post, '/api/ad-create/', params).data\n end",
"title": ""
},
{
"docid": "2244db4ddb5e2d56c48b6dee3c7e6af7",
"score": "0.6648158",
"text": "def create_ad(params={})\n request(:post, '/api/ad-create/', params).data\n end",
"title": ""
},
{
"docid": "ee140f645fa8e71a8afe4933fc2f2e11",
"score": "0.64920187",
"text": "def advertise_params\n params.require(:advertise).permit(:name, :note, :ad_type_id, :advertiser_id, :campaign_id)\n end",
"title": ""
},
{
"docid": "cd13e2a0cce3d9f0881bf4b2ebe048e2",
"score": "0.63969254",
"text": "def create\n @ad = Advertise.new(advertise_params)\n @ad.campaign_id = @campaign.id\n \n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Advertise was successfully created.' }\n format.json { render :show, status: :created, location: @ad }\n else\n format.html { render :new }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe37191b9b74bb004f28060d520e0d77",
"score": "0.6283883",
"text": "def index\n @advertisements = Advertisement.all\n end",
"title": ""
},
{
"docid": "b4ddd2f9869711d2c558b5ce4e778b9c",
"score": "0.62615895",
"text": "def create\n @advertise = Advertise.new(params[:advertise])\n\n respond_to do |format|\n if @advertise.save\n format.html { redirect_to(@advertise, :notice => 'Advertise was successfully created.') }\n format.xml { render :xml => @advertise, :status => :created, :location => @advertise }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @advertise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f02a6054a5851ac6442c859aa151bef",
"score": "0.622983",
"text": "def create\n @advert = current_admin.adverts.create(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "363583878f2b93b911ea9e87d7a8c132",
"score": "0.6198213",
"text": "def create\n @advertise = Advertise.new(advertise_params)\n\n respond_to do |format|\n if @advertise.save\n format.html { redirect_to @advertise, notice: 'Advertise was successfully created.' }\n format.json { render :show, status: :created, location: @advertise }\n else\n format.html { render :new }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n website = Website.find(@advertise.website_id)\n user = User.find(website.user_id )\n SwiftadsMailer.swiftads_advertise_created(user, website, @advertise).deliver_now\n end\n \n \n \n end",
"title": ""
},
{
"docid": "28eea56ecbd6ce6c7aff8e33914b65e9",
"score": "0.6128665",
"text": "def create\n @advertisement = current_user.advertisements.new(advertisement_params)\n @advertisement.save\n\n @advertisement.transactions.create(user_id: @advertisement.user_id, amount: params[:amount], currency: \"USD\", status: \"pending\")\n # base_url = (Rails.env == \"development\") ? 'http://localhost:3000' : 'http://www.etcty.com'\n\n # @response = EXPRESS_GATEWAY.setup_purchase((params[:amount].to_i*100),\n # return_url: base_url+complete_order_advertisement_path(@advertisement, locale: I18n.locale) ,\n # cancel_return_url: base_url,\n # currency: \"USD\"\n # )\n\n # redirect_to EXPRESS_GATEWAY.redirect_url_for(@response.token)\n redirect_to complete_order_advertisement_path(@advertisement, locale: I18n.locale)\n end",
"title": ""
},
{
"docid": "d692ccfbc3cfd2992dacd4b063f002e8",
"score": "0.61238986",
"text": "def create\n @ad = Ad.new(ad_params)\n\n if @ad.save\n render json: @ad, status: :created, location: @ad\n else\n render json: @ad.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f61f605566a5170313af36976851bb4b",
"score": "0.6120029",
"text": "def advert_params\n params.require(:advert).permit(:title, :content, :picture, :status, :address,\n :locality, :administrative_area_level_1, tag_ids: [])\n end",
"title": ""
},
{
"docid": "38690f230442fadca3a9729beae6d081",
"score": "0.6107721",
"text": "def create\n @advertisement = Advertisement.new(advertisement_params)\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a48394f18e23a3ff5ced4d8175e83763",
"score": "0.6100749",
"text": "def create\n @advert = Advert.new(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a48394f18e23a3ff5ced4d8175e83763",
"score": "0.6100749",
"text": "def create\n @advert = Advert.new(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "699611244e6ead5d8735aa7f6d471788",
"score": "0.6041002",
"text": "def create\n\t\t@advertisement = Advertisement.new(advertisement_params)\n\t\trespond_to do |format|\n\t\t\tif @advertisement.save\n\t\t\t\tformat.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @advertisement }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'new' }\n\t\t\t\tformat.json { render json: @advertisement.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n end",
"title": ""
},
{
"docid": "4826dce9bda2273d92472e2c0dd6e566",
"score": "0.6034924",
"text": "def advertise_params\n params.require(:advertise).permit(:title, :description, :src, :adtype, :priority, :show)\n end",
"title": ""
},
{
"docid": "b584bcc61844830f4a6a52c8a3f61c75",
"score": "0.6034335",
"text": "def create\n @ad = Ad.new(params[:ad])\n\n if @ad.save\n render json: @ad, status: :created, location: @ad\n else\n render json: @ad.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7288911b9d19b78b0075fca6a7205d40",
"score": "0.6025806",
"text": "def create\n @advertising = Advertising.new(params[:advertising])\n\n respond_to do |format|\n if @advertising.save\n format.html { redirect_to @advertising, notice: 'La publicidad se registro exitosamente.' }\n format.json { render json: @advertising, status: :created, location: @advertising }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertising.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2309dea168eba5e8be3f41e7879157a",
"score": "0.6025621",
"text": "def advertisement_params\n params.require(:xmt_ad_advertisement).permit!\n end",
"title": ""
},
{
"docid": "e2ac82994bb9929703b4ce510bae5991",
"score": "0.60200655",
"text": "def index\n advertisement = Advertisement.all \n render json: {advertisement: advertisement}\n end",
"title": ""
},
{
"docid": "5803aa8a565c512b245f9808c8bce9d6",
"score": "0.6012561",
"text": "def create\n # @advertiser = Advertiser.new(params[:advertiser])\n respond_to do |format|\n if @advertiser.save\n format.html { redirect_to @advertiser, notice: 'Advertiser was successfully created.' }\n format.json { render json: @advertiser, status: :created, location: @advertiser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertiser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "676d2f785bc8a7a009927f5d6e9785f0",
"score": "0.59972024",
"text": "def create\n @admin_email_marketing = Advertise.new(params[:advertise])\n @admin_email_marketing.adv_type = 'E'\n\n respond_to do |format|\n if @admin_email_marketing.save\n format.html { redirect_to admin_email_marketing_path(@admin_email_marketing), notice: 'Email marketing was successfully created.' }\n format.json { render json: @admin_email_marketing, status: :created, location: @admin_email_marketing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_email_marketing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0c6961801feb0ff340f1f8d6f66ee1a",
"score": "0.59943694",
"text": "def ad_list(ads)\n request(:get, \"/api/ad-get/\", {:ads=>ads}).data\n end",
"title": ""
},
{
"docid": "c0c6961801feb0ff340f1f8d6f66ee1a",
"score": "0.59943694",
"text": "def ad_list(ads)\n request(:get, \"/api/ad-get/\", {:ads=>ads}).data\n end",
"title": ""
},
{
"docid": "83151dcce7c207cdbcf05c38ccf162d8",
"score": "0.5993944",
"text": "def create\n @advertiser = Advertiser.new(params[:advertiser])\n\n respond_to do |format|\n if @advertiser.save\n format.html { redirect_to @advertiser, notice: 'Advertiser was successfully created.' }\n format.json { render json: @advertiser, status: :created, location: @advertiser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertiser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36086df35aaa3521c977187c4df3abec",
"score": "0.59693944",
"text": "def create\n @advert = current_user.adverts.new(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6aa5bcc4055bd6ec28b97fe2a3d30068",
"score": "0.5963642",
"text": "def index\n advertisements = Advertisement.all\n # render json: AdvertisementSerializer.new(advertisements,options).serialized_json\n # render json: AdvertisementSerializer.new(advertisements)\n render json: advertisements\n end",
"title": ""
},
{
"docid": "7d0f89b2008da946209d907fe080ce67",
"score": "0.595003",
"text": "def advertisement_params\n params.require(:advertisement).permit(:title, :store_id, :product_url, :description, :image_url, :collection_id, :effective_date, :expiration_date, :active)\n end",
"title": ""
},
{
"docid": "fbb7279b48e378bb0271c5aa6c40c139",
"score": "0.5947115",
"text": "def ads(args = {})\n begin\n do_get(AppFigures::API::ADS, args)\n rescue Exception => e\n puts e.message\n puts e.backtrace\n end\n end",
"title": ""
},
{
"docid": "d0f687f91093231c960bf2f23654ad67",
"score": "0.5944495",
"text": "def create\n advertisement = Advertisement.new(advertisement_params)\n\n if advertisement.save\n # render json: AdvertisementSerializer.new(advertisement).serialized_json\n render json: advertisement\n else\n render json: {error: advertisement.error.messages}, status: 422 \n end\n end",
"title": ""
},
{
"docid": "6a4f7607e9b2e7e8e2774d3644e4ff01",
"score": "0.5937096",
"text": "def index\n if is_client_app?\n if params[:external].present?\n @ads = Ad.external.active.limit(params[:limit] || 1).order(\"RAND()\")\n else\n @ads = Ad.announcement.active.limit(3).order(\"RAND()\")\n end\n else\n response.headers['X-Total-Count'] = @ads.count.to_s\n @ads = @ads.page(params[:page]) if params[:page].present?\n @ads = @ads.per(params[:per]) if params[:per].present?\n end\n\n render json: @ads\n end",
"title": ""
},
{
"docid": "c6ff2fec3da97680529f0ce74d22dcea",
"score": "0.59126943",
"text": "def create\n @advertise_strategy = Advertise::Strategy.new(advertise_strategy_params)\n\n respond_to do |format|\n if @advertise_strategy.save\n format.html { redirect_to advertise_strategies_path, notice: 'Strategy was successfully created.' }\n format.json { render :show, status: :created, location: @advertise_strategy }\n else\n format.html { render :new }\n format.json { render json: @advertise_strategy.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cdeaf462e91aa3ed6c3629295e7d38ef",
"score": "0.5894275",
"text": "def create\n @advert = current_user.adverts.build(advert_params)\n\n respond_to do |format|\n if @advert.save\n # format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n # format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4524c859d6fe33062e185a5dc8276b58",
"score": "0.58899397",
"text": "def create\n @advert = current_user.adverts.build(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: \"Advert was successfully created.\" }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47c2f42973bbf93025ee54ae0fa73b1e",
"score": "0.58555365",
"text": "def create\n if current_user.wallet.points >= 125\n @ad = Ad.new(ad_params)\n @ad.user =current_user\n if @ad.save\n current_user.wallet.points -= 125\n render json: {ad: @ad, content: url_for(@ad.content)}, status: :created\n else\n render json: @ad.errors, status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "ba7ce69e9c811771d55adaa20640f897",
"score": "0.58494437",
"text": "def create\n @advertiser = Advertiser.new(advertiser_params)\n\n respond_to do |format|\n if @advertiser.save\n format.html { redirect_to @advertiser, notice: 'Advertiser was successfully created.' }\n format.json { render :show, status: :created, location: @advertiser }\n else\n format.html { render :new }\n format.json { render json: @advertiser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dc4114f7a5664dc925f3339b15199c7",
"score": "0.5830074",
"text": "def create\n @ad = @org.ads.find(params[:ads_campaigns][:ad_id])\n @campaign.ads << @ad\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to [@campaign.org, @campaign], notice: 'Ad was successfully added to campaign.' }\n format.json { render :show, status: :created, location: [@campaign.org, @campaign] }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6b5353b23cf061b186ace805f48b62b",
"score": "0.58296454",
"text": "def create\n @resource_type = params[:resource]\n data = params[:advertise]\n data.delete(:resource)\n @admin_advertise = Advertise.new(data)\n\n respond_to do |format|\n if @admin_advertise.save\n format.html { \n flash[:success] = 'Advertise was successfully created.' \n redirect_to :back, notice: 'Advertise was successfully created.' \n }\n format.json { render json: @admin_advertise, status: :created, location: @admin_advertise }\n else\n format.html { render :action => :new, :locals => { :resource => params[:resource] } }\n format.json { render json: @admin_advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "444849ba08b993e652261a3f78a88724",
"score": "0.581802",
"text": "def create\n @ad = Ad.new(params[:ad])\n #get_all_tags\n respond_with(@ad) do |format|\n if @ad.save\n format.html { redirect_to backend_ad_path(@ad), notice: 'Ad was successfully created.' }\n format.json { render json: @ad, status: :created, location: @ad }\n else\n #flash[:error]= 'eeror'\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60b5ab556282f1e526c7fa484ccc2f2d",
"score": "0.58008856",
"text": "def advertiser_params\n params.require(:advertiser).permit(:uuid, :title, :details, :p_type)\n end",
"title": ""
},
{
"docid": "629d6d280f83be97abc65374bd1e81c1",
"score": "0.57939893",
"text": "def advertise_strategy_params\n params.require(:advertise_strategy).permit(:name, :user_id, :front_ad, :end_ad, :pause_ad, :float_ad, :scroll_ad, :data)\n end",
"title": ""
},
{
"docid": "bd4ae91a51cc57411d811ee8e1881823",
"score": "0.57921165",
"text": "def advert_params\n params.require(:advert).permit(:title, :description, :status, :user_id, :category_ids, :hashtag_ids, images: [])\n end",
"title": ""
},
{
"docid": "aecb10ad3208fc6f934f9ab812ede18b",
"score": "0.5780559",
"text": "def advertisement_params\n params[:advertisement].permit(:name, :advertiser, :state, :side_type, :image_file,\n :begin_date, :end_date, :description, :description_link, :image, :alt, :url, :show_in_header)\n end",
"title": ""
},
{
"docid": "ccbed8fec70172b653e0453bc9339641",
"score": "0.57804596",
"text": "def create\n @ad = Ad.new(ad_params)\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render :show, status: :created, location: @ad }\n else\n format.html { render :new }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "615b2d54660d7113fd44b005f4435b2a",
"score": "0.577024",
"text": "def create\n @advertisement_response = AdvertisementResponse.new(params[:advertisement_response])\n\n respond_to do |format|\n if @advertisement_response.save\n format.html { redirect_to @advertisement_response, :notice => 'Advertisement response was successfully created.' }\n format.json { render :json => @advertisement_response, :status => :created, :location => @advertisement_response }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @advertisement_response.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "967323bca196132ea30cd20d82a38044",
"score": "0.5761865",
"text": "def advertisement_params\n params.require(:advertisement).permit!\n end",
"title": ""
},
{
"docid": "967323bca196132ea30cd20d82a38044",
"score": "0.5761865",
"text": "def advertisement_params\n params.require(:advertisement).permit!\n end",
"title": ""
},
{
"docid": "23c94d5a7a34788d403dd07a909a2f5f",
"score": "0.5735175",
"text": "def advertise_params\n params.require(:advertise).permit(:title, :description, :photo, :on_page)\n end",
"title": ""
},
{
"docid": "64a603265cb0e9ba337d08ee30fb7e42",
"score": "0.57348776",
"text": "def create\n @advertisment = Advertisment.new(params[:advertisment])\n @active_advertisments = Advertisment.active\n @inactive_advertisments = Advertisment.inactive\n respond_to do |format|\n if @advertisment.save\n format.html { redirect_to @advertisment, notice: 'Advertisment was successfully created.' }\n format.json { render json: @advertisment, status: :created, location: @advertisment }\n format.js { render action: \"show\", notice: 'Advertisment was successfully created.'}\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertisment.errors, status: :unprocessable_entity }\n format.js {render action: \"new\"}\n end\n end\n end",
"title": ""
},
{
"docid": "a9b2634fa878046259090a5583022299",
"score": "0.5727765",
"text": "def create\n @advert = Advert.new(advert_params)\n authorize @advert\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: \"Advert was successfully created.\" }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d303dedf267f002c65453e062fa1ebd3",
"score": "0.5714841",
"text": "def advertise_params\n params.require(:advertise).permit(:description, :website_id)\n end",
"title": ""
},
{
"docid": "6572e8484df7ef1a640e8b749097b714",
"score": "0.5713758",
"text": "def create\n #@advertisement.user_id = current_user.id\n \n @advertisement = Advertisement.new(advertisement_params)\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b5d256823cc076a9c59979b9115c3e9",
"score": "0.57129836",
"text": "def create\n @advertisement = Advertisement.new(advertisement_params)\n @advertisement.size = 1\n @advertisement.status = 0\n @advertisement.user_id = current_user.id\n set_category\n update_ad_contact(params)\n respond_to do |format|\n if @advertisement.save\n update_profile(params)\n manage_uploads(@advertisement)\n format.html { redirect_to @advertisement, notice: 'advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4442e94900afaefe67f4e8adef824f1a",
"score": "0.5707249",
"text": "def create\n @ad = Ad.new(ad_params)\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ad }\n else\n format.html { render action: 'new' }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42364131d7f3754ea47c583ea8cf5660",
"score": "0.570638",
"text": "def create\n @ad = Ad.new(params[:ad])\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render json: @ad, status: :created, location: @ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42364131d7f3754ea47c583ea8cf5660",
"score": "0.570638",
"text": "def create\n @ad = Ad.new(params[:ad])\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render json: @ad, status: :created, location: @ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42364131d7f3754ea47c583ea8cf5660",
"score": "0.570638",
"text": "def create\n @ad = Ad.new(params[:ad])\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render json: @ad, status: :created, location: @ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad883331fe704009697937729da1faec",
"score": "0.57033354",
"text": "def advertisement_params\n params.require(:advertisement).permit(:uuid, :title, :body, :published, :location, :category_name, :for, :emoji, :images => [], :contact_methods => {})\n end",
"title": ""
},
{
"docid": "7e4d53691daa5a7da20694d163a45286",
"score": "0.5695281",
"text": "def create\n @store_indices_ad = Store::Indices::Ad.new(params[:store_indices_ad])\n\n respond_to do |format|\n if @store_indices_ad.save\n format.html { redirect_to @store_indices_ad, notice: 'Ad was successfully created.' }\n format.json { render json: @store_indices_ad, status: :created, location: @store_indices_ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store_indices_ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15b554a974c91c35d9fedfcc225f3b44",
"score": "0.5693667",
"text": "def create\n @ad = current_user.ads.new(params[:ad])\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.'}\n format.json { render json: @ad, status: :created, location: @ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd7e17f425bef51ccc4bdfabbb52a3aa",
"score": "0.56739354",
"text": "def create\n \n store_id = advertisement_params[:store_id]\n\n # @advertisements = Advertisement.where(\"store_id = ?\", store_id)\n # count = @advertisements.count\n # @count = search_store(store_id)\n # count = @advertisements.count\n \n respond_to do |format|\n # binding.pry\n # if Advertisement.max_ads_reached?(store_id: store_id)\n # @store_id = advertisement_params[:store_id]\n # @advertisements2 = Advertisement.where(\"store_id = ?\", @store_id)\n # format.html { redirect_to search_store_advertisements_url(store_id: store_id), notice: 'The store has already reached the maximum number of ads.' }\n # format.html { redirect_to billboard_index_url, notice: 'The store has already reached the maximum number of ads'}\n # format.json { head :no_content }\n # return\n # else\n @advertisement = Advertisement.new(advertisement_params)\n if !@advertisement.valid?\n format.html { render 'new'}\n # format.html { redirect_to @advertisement, notice: @advertisement.errors.messages }\n else\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.'}\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n # end\n end\n end",
"title": ""
},
{
"docid": "b9b1081e2add487026db7e72b6d27bdf",
"score": "0.5673577",
"text": "def index\n @ads = Advertise.all\n end",
"title": ""
},
{
"docid": "82e011c90cda24d04b1eb21d4bded395",
"score": "0.5673564",
"text": "def ad_params\n params.require(:ad).permit(:title, :description, :offer, :category_id, :expiration_date)\n end",
"title": ""
},
{
"docid": "2d6d2a73dfe84913c9f2d941e3280e11",
"score": "0.56719553",
"text": "def ad_params\n params.require(:ad).permit(:title, :url, :phone, :price, :status, :district_id, :type)\n end",
"title": ""
},
{
"docid": "b87a406200a862e53edc2eb98560e0b5",
"score": "0.5670122",
"text": "def index\n @advertisements = Advertisement.all\n @advertisementassociate = Advertisement.joins(:advertisementassociate)\n end",
"title": ""
},
{
"docid": "c343aad27ef5a5fc1a9bc734aa986e70",
"score": "0.5669786",
"text": "def ads(params, additional_headers = {})\n perform_request(self, @token, 'ads', 'get', params, additional_headers)\n end",
"title": ""
},
{
"docid": "e7d6266f73ba4f2286688aa1df8f9494",
"score": "0.5667031",
"text": "def create\n @ad_set = AdSet.new(ad_set_params)\n\n respond_to do |format|\n if @ad_set.save\n format.html { redirect_to @ad_set, notice: 'Ad set was successfully created.' }\n format.json { render :show, status: :created, location: @ad_set }\n else\n format.html { render :new }\n format.json { render json: @ad_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f476fcf76da574343980b9926829d389",
"score": "0.5664057",
"text": "def create\n @ad = Ad.new(ad_params)\n @ad.user = current_user\n respond_to do |format|\n if @ad.save\n format.html { redirect_to pendentes_site_ads_path, notice: 'Ad was successfully created.' }\n format.json { render :show, status: :created, location: pendentes_site_ads_path }\n else\n format.html { render :new, notice: @ad.errors }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8808fbb8cf715e8c33dad1c2f9dd77d",
"score": "0.5657081",
"text": "def create\n @advert = Advert.new(advert_params)\n @advert.user = current_user\n\n respond_to do |format|\n if @advert.save\n flash[:success] = \"Advert was successfully created.\"\n format.html { redirect_to @advert}\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "397753e4473df4d73e604f5001dc8ac7",
"score": "0.56487834",
"text": "def index\n render json: @ads = Ad.all\n end",
"title": ""
},
{
"docid": "be5853e6c25723567306e7117546e88f",
"score": "0.56450206",
"text": "def ad_params\n params.require(:ad).permit(\n :description,\n :title,\n :link,\n :text_description,\n :avatar,\n :start_date,\n :end_date,\n :price,\n :active\n )\n end",
"title": ""
},
{
"docid": "1dba4514ececb6068083aab7bb607cfe",
"score": "0.563503",
"text": "def create\n @advertiser = Advertiser.new(params[:advertiser])\n\n respond_to do |format|\n if @advertiser.save\n format.html { redirect_to(@advertiser, :notice => 'Advertiser was successfully created.') }\n format.xml { render :xml => @advertiser, :status => :created, :location => @advertiser }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @advertiser.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0470320065218d920f4ad44c14e1d364",
"score": "0.5632993",
"text": "def advertisement_params\n\t\tparams.require(:advertisement).permit(:title, :notes)\n\tend",
"title": ""
},
{
"docid": "bfb4164d318f20b5c9d19e4c407014f8",
"score": "0.56289864",
"text": "def add_advertiser(join_attrs)\n join_attrs.assert_valid_keys(:advertiser, :separation, :contact)\n self.advertisers.push_with_attributes(join_attrs)\n end",
"title": ""
},
{
"docid": "89b82fb7918955d2b51c2c47b3a8716d",
"score": "0.5625908",
"text": "def create\n @advertisment = Advertisment.new(advertisment_params)\n @advertisment.user_id = current_user.id\n respond_to do |format|\n if @advertisment.save\n format.html { redirect_to @advertisment, notice: 'Advertisment was successfully created.' }\n format.json { render :show, status: :created, location: @advertisment }\n else\n format.html { render :new }\n format.json { render json: @advertisment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c70c2432d391918bd1fb3e6361140434",
"score": "0.56194514",
"text": "def create\n params = advertisement_params\n\n contact_methods = []\n if params[:contact_methods]\n contact_methods = params[:contact_methods].keys.to_json\n end\n\n @advertisement = Advertisement.new(\n user: current_user,\n title: params[:title],\n body: params[:body],\n emoji: params[:emoji],\n published: params[:published],\n category_name: JSON.parse(advertisement_params[:category_name])[0],\n subcategory_name: JSON.parse(advertisement_params[:category_name])[1],\n location: params[:location],\n contact_methods: contact_methods,\n for: params[:for]\n )\n\n @advertisement.images.attach(params[:images])\n # NewAdvertisementJob.perform_now(@advertisement)\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to advertisement_path(@advertisement), notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b396d852af23173099c7dc0f93c360e",
"score": "0.56141037",
"text": "def advertisement_params\n params.require(:advertisement).permit(:title, :content, :agency_id, :uuid, :category_id, :phone_number, :city, :address, :email, :telegram_channel,:instagram_page, :website)\n end",
"title": ""
},
{
"docid": "eecb3bb4bcc7d44869e3a39c53a2e6b9",
"score": "0.56034094",
"text": "def create\n @test_ad = TestAd.new(test_ad_params)\n\n respond_to do |format|\n if @test_ad.save\n format.html { redirect_to @test_ad, notice: 'Test ad was successfully created.' }\n format.json { render :show, status: :created, location: @test_ad }\n else\n format.html { render :new }\n format.json { render json: @test_ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d95f85b59a39959253d8a739f1acc312",
"score": "0.5600603",
"text": "def advertisement_params\n params.require(:advertisement).permit(:link, :img, :publish, :visable)\n end",
"title": ""
},
{
"docid": "8ecd1a8269248e00231346b58ed01cf3",
"score": "0.55890477",
"text": "def advert_params\n params.require(:advert).permit(:name,:list_img, :link)\n end",
"title": ""
},
{
"docid": "ceaf6f9fbb822e09ceb834df5b7bf664",
"score": "0.55726725",
"text": "def create\n @advert = Advert.new(advert_params)\n @advert.user = current_user\n @advert.state = :new\n respond_to do |format|\n if @advert.save\n\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "777b1bda2c3a4b541a421ef04c1513de",
"score": "0.5568567",
"text": "def set_advertise\n @advertise = Advertise.find(params[:id])\n end",
"title": ""
},
{
"docid": "777b1bda2c3a4b541a421ef04c1513de",
"score": "0.5568567",
"text": "def set_advertise\n @advertise = Advertise.find(params[:id])\n end",
"title": ""
},
{
"docid": "777b1bda2c3a4b541a421ef04c1513de",
"score": "0.5568567",
"text": "def set_advertise\n @advertise = Advertise.find(params[:id])\n end",
"title": ""
},
{
"docid": "835247ae4f4c78651c187ae6da04a60e",
"score": "0.5554745",
"text": "def ad_booking_params\n params.require(:ad_booking).permit(:publication_id, :date, :ad_list)\n end",
"title": ""
},
{
"docid": "7221b22b07307c6b817b1117150cf399",
"score": "0.55533886",
"text": "def create\n @advertisement = Advertisement.new(advertisement_params)\n @advertisement.user_id = current_user.id\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e2e1e37834b8ab6f29a0e488500a33c",
"score": "0.5538627",
"text": "def advertisment_params\n params.require(:advertisment).permit(:title, :content)\n end",
"title": ""
},
{
"docid": "6a797e0ae7d3631324267dc317d3cf09",
"score": "0.5536349",
"text": "def assign_ad_to_contest\n @contest = Contest.find(params[:contest_id])\n @contest.ads_points << AdsPoint.find(params[:ads_point_id])\n @contest.save\n \n redirect_to :action => \"index_ads_contests\", :contest_id => @contest.id\n end",
"title": ""
},
{
"docid": "a361424781adb0b4647d51e9e67ea9a4",
"score": "0.55360496",
"text": "def assign_ad_to_event\n @event = Event.find(params[:event_id])\n @event.ads_points << AdsPoint.find(params[:ads_point_id])\n @event.save\n \n redirect_to :action => \"index_ads_events\", :event_id => @event.id\n end",
"title": ""
},
{
"docid": "78eb3bfcbf28c588d16c21718ccc1e56",
"score": "0.55164343",
"text": "def advert_params\n params.require(:advert)\n .permit(:advert_type, :title, :description, :city, :street, :phone,\n :price, :job_type, :advert_type, locations_attributes:\n %i[id address destroy])\n end",
"title": ""
},
{
"docid": "841031b5a612cad2c4f1334fb90f1027",
"score": "0.5510713",
"text": "def create\n @adotante = Adotante.new(adotante_params)\n\n respond_to do |format|\n if @adotante.save\n format.html { redirect_to @adotante, notice: 'Adotante was successfully created.' }\n format.json { render :show, status: :created, location: @adotante }\n else\n format.html { render :new }\n format.json { render json: @adotante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd7100788c7cce4e8c1c4e6b5173224d",
"score": "0.5506687",
"text": "def create\n @ad_item = AdItem.new(ad_item_params)\n\n respond_to do |format|\n if @ad_item.save\n format.html { redirect_to @ad_item, notice: 'Ad item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ad_item }\n else\n format.html { render action: 'new' }\n format.json { render json: @ad_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "639a99f830c1b5ed17b239e08b13fbf9",
"score": "0.5500395",
"text": "def advertiser_params\n params.require(:advertiser).permit(:name, :contact, :email, :status)\n end",
"title": ""
},
{
"docid": "662eefb32e93fd81c0698abc7bb4f9d1",
"score": "0.54895943",
"text": "def create\n @ad = Ad.new(ad_params)\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to campaign_ad_url(params[:campaign_id], @ad.id), notice: 'Ad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ad }\n else\n format.html { render action: 'new' }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df280f3f1efef9ce1b43594c21ee3925",
"score": "0.5489144",
"text": "def my_adverts_as_candidate\n authorize! :my_adverts_as_candidate, JobAdvert.new\n @q = current_user.profile.subscription_job_adverts.ransack(params[:q])\n @job_adverts = @q.result.page( params[:page] ).per(@per_page)\n render json: @job_adverts, each_serializer: JobAdvertSerializer,\n serializer: ActiveModel::Serializer::CollectionSerializer\n end",
"title": ""
},
{
"docid": "6b1b89d04d8d2f35eaa4a3c656c2e59d",
"score": "0.54884416",
"text": "def create\n @store_policies_ad = Store::Policies::Ad.new(params[:store_policies_ad])\n\n respond_to do |format|\n if @store_policies_ad.save\n format.html { redirect_to @store_policies_ad, notice: 'Ad was successfully created.' }\n format.json { render json: @store_policies_ad, status: :created, location: @store_policies_ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store_policies_ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb38c887767d793e7193f52b4653969c",
"score": "0.548795",
"text": "def advertisement_params\n params.require(:advertisement).permit(:title, :image, :category, :content, :user_id, :publish)\n end",
"title": ""
},
{
"docid": "3f9eb563d551fe8a8b9a48a7a1ec75ee",
"score": "0.5487863",
"text": "def advertiser_params\n params.require(:advertiser).permit(:name, :contact_name, :contact_email, :description, :epom_id)\n end",
"title": ""
},
{
"docid": "2357c190878f0e25df04f11e9b36f4eb",
"score": "0.5487213",
"text": "def create\n\tad_owner=User.find_by_email!(params[:ad][:user])\n\n\t@ad = Ad.new(\n\t\ttitle: params[:ad][:title],\n\t\tlink: params[:ad][:link],\n\t\tgoal: params[:ad][:goal],\n\t\tdesc: params[:ad][:desc],\n\t\tuser: ad_owner\n\t)\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render json: @ad, status: :created, location: @ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
7c9a3f435c457f70ebb8526cfb069f08 | GET /auctions/new GET /auctions/new.xml | [
{
"docid": "3b1e442755dfadbb0539bf8d48f0647e",
"score": "0.0",
"text": "def new\n if is_login\n @user = User.find_by_id(session[:user_id])\n if @user.identity\n @auction = Auction.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @auction }\n end\n else\n redirect_to(:controller => \"main\", :action => \"welcome\", :notice => 'Please log in as a seller to create an auction.')\n flash[:notice]=\"#{@user.username}, Please log in as a seller to create an auction.\"\n end\n else\n login\n end\n end",
"title": ""
}
] | [
{
"docid": "00815d6f8fd6a5e028347aef15d28f9c",
"score": "0.7525189",
"text": "def new\n @auction_item = AuctionItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @auction_item }\n end\n end",
"title": ""
},
{
"docid": "eb6a6a1f9a9186c80503fcedaf4da60d",
"score": "0.7416423",
"text": "def new\n @auction = Auction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end",
"title": ""
},
{
"docid": "35c6e10364fde9d64809993d20f55522",
"score": "0.7196286",
"text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bid }\n end\n end",
"title": ""
},
{
"docid": "fe8490b7c1ef9d1b7c1584b95d1dfa5f",
"score": "0.70502436",
"text": "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @borrow }\n end\n end",
"title": ""
},
{
"docid": "2b4ff085017c65eb3c284b045c6cc0d5",
"score": "0.69693714",
"text": "def new\n @bowl = Bowl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bowl }\n end\n end",
"title": ""
},
{
"docid": "cb4367701293151c3e552d5710d2f4f7",
"score": "0.6923009",
"text": "def new\n @bid = @swarm_request.bids.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bid }\n end\n end",
"title": ""
},
{
"docid": "598723c8e078cd26bcc6fcc69373ca42",
"score": "0.6879056",
"text": "def new\n authenticate_user!\n @auction = Auction.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end",
"title": ""
},
{
"docid": "f6a2eba9d586fe30e5480dbdeecc22d6",
"score": "0.6795262",
"text": "def new\n @balance = Balance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @balance }\n end\n end",
"title": ""
},
{
"docid": "a83173640f77272bfb6f58a0a65c7e67",
"score": "0.67350036",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"title": ""
},
{
"docid": "ee3fc71f2173c0a500673d09e42f107f",
"score": "0.67263556",
"text": "def new\n @book = Book.new :copies => 1\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8ea74214e44961b9d0ea299ddf00ae2",
"score": "0.6688512",
"text": "def new\n @pool = Pool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pool }\n end\n end",
"title": ""
},
{
"docid": "e54b3845c1076b793eceab04eb15bc19",
"score": "0.66342646",
"text": "def new\n @bap = Bap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bap }\n end\n end",
"title": ""
},
{
"docid": "9ff5d11b63c36056324e53822cb0320c",
"score": "0.6625215",
"text": "def new\n @bdig = Bdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bdig }\n end\n end",
"title": ""
},
{
"docid": "ffa7e997462330cce187c5295c763304",
"score": "0.6612375",
"text": "def new\n @bouncer = Bouncer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bouncer }\n end\n end",
"title": ""
},
{
"docid": "8b4e44185b3f39b550fa325139fa6e7d",
"score": "0.6591998",
"text": "def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end",
"title": ""
},
{
"docid": "7bd1820ed7195f1ee8a191d09ee72345",
"score": "0.6585996",
"text": "def new\n @rawness = Rawness.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rawness }\n end\n end",
"title": ""
},
{
"docid": "2255faa73974ccdb4f3ff55a494ca0a3",
"score": "0.6577355",
"text": "def new\n @bid = Bid.new \n @bid.request_id = params[:request_id]\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bid }\n end\n end",
"title": ""
},
{
"docid": "9f5a484dda0fcb8112007f9c19a7bbc2",
"score": "0.6573706",
"text": "def new\n @click_to_talk = ClickToTalk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @click_to_talk }\n end\n end",
"title": ""
},
{
"docid": "217ead9507cfe12d8dc86d9843712b43",
"score": "0.654508",
"text": "def new\n @bookfair = Bookfair.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bookfair }\n end\n end",
"title": ""
},
{
"docid": "608e09195eaf7c1a45638fcc212766ec",
"score": "0.654443",
"text": "def new\n @bonus = Bonu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bonus }\n end\n end",
"title": ""
},
{
"docid": "dc5b53685b45be2a58f2f81468ab8784",
"score": "0.65415186",
"text": "def create\n @auction = Auction.new(auction_params)\n\n respond_to do |format|\n if @auction.save\n format.html { redirect_to @auction, notice: 'Запись успешно создана.' }\n format.json { render :show, status: :created, location: @auction }\n else\n format.html { render :new }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8f143c9f07132e778b849f6afda4394",
"score": "0.6535877",
"text": "def new\n @burger = Burger.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @burger }\n end\n end",
"title": ""
},
{
"docid": "42fb83d2214651b2ae5e6e5e2843bf3c",
"score": "0.65268093",
"text": "def new\n @item = Item.factory('local')\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "09659b5e0a0b570d5c8019b81ae00efa",
"score": "0.6522785",
"text": "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"title": ""
},
{
"docid": "c661f6a9c07a169a71386a580978bf57",
"score": "0.6520403",
"text": "def create\n @auction_item = AuctionItem.new(params[:auction_item])\n\n respond_to do |format|\n if @auction_item.save\n format.html { redirect_to(@auction_item, :notice => 'Auction item was successfully created.') }\n format.xml { render :xml => @auction_item, :status => :created, :location => @auction_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @auction_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0abd1d7f5513b478dc0a7b6a213e9ae",
"score": "0.65158975",
"text": "def new\n @betpayee = Betpayee.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @betpayee }\n end\n end",
"title": ""
},
{
"docid": "f607a29fca4bdaba2f3d8a9682e0bd05",
"score": "0.6502816",
"text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "f607a29fca4bdaba2f3d8a9682e0bd05",
"score": "0.6502816",
"text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "63cdb442e873553ed9071eee50ea1f81",
"score": "0.65024805",
"text": "def new\n @brother = Brother.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @brother }\n end\n end",
"title": ""
},
{
"docid": "0e31944992c4ce9a30159e1b02b29ddc",
"score": "0.65024215",
"text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end",
"title": ""
},
{
"docid": "0e31944992c4ce9a30159e1b02b29ddc",
"score": "0.65024215",
"text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end",
"title": ""
},
{
"docid": "9a5024275ed5a3c95b6dc211eacef32f",
"score": "0.64921445",
"text": "def new\n @bout = Bout.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bout }\n end\n end",
"title": ""
},
{
"docid": "18a9109527b028889fbb5957381436ce",
"score": "0.64889866",
"text": "def new\n @holder = Holder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @holder }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6479166",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "05b90463a5f309181be53ae97bed6707",
"score": "0.64781654",
"text": "def new\n @item = BudgetItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "a121c5a9bf593d04ae642680c093ac24",
"score": "0.6477734",
"text": "def new\n @election = Election.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @election }\n end\n end",
"title": ""
},
{
"docid": "504887687c99f6dcedbb704a0e1d6938",
"score": "0.64700603",
"text": "def new\n @counterparty = Counterparty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @counterparty }\n end\n end",
"title": ""
},
{
"docid": "a738aa7e5fc3ac755a80d9f9af7ea1a0",
"score": "0.6463012",
"text": "def new\n @thing_list = ThingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"title": ""
},
{
"docid": "ad672b1f57a45fe4fab322976ecf50d2",
"score": "0.64598125",
"text": "def new\n @url_migration = UrlMigration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_migration }\n end\n end",
"title": ""
},
{
"docid": "a95bf13eafc680bef9b21c47f1d54f2d",
"score": "0.6452151",
"text": "def new\n @volume = Volume.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @volume }\n end\n end",
"title": ""
},
{
"docid": "1edb7e0bafc1c9c8aaa37bd7c6fa5980",
"score": "0.6440175",
"text": "def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"title": ""
},
{
"docid": "1edb7e0bafc1c9c8aaa37bd7c6fa5980",
"score": "0.6440175",
"text": "def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contract }\n end\n end",
"title": ""
},
{
"docid": "44d904f4957f313998ae8b1b92201afe",
"score": "0.6439784",
"text": "def new\n @special = Special.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @special }\n end\n end",
"title": ""
},
{
"docid": "4163cbd1ddbf2a53d1c65fa1d212e264",
"score": "0.64394134",
"text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end",
"title": ""
},
{
"docid": "4163cbd1ddbf2a53d1c65fa1d212e264",
"score": "0.64394134",
"text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end",
"title": ""
},
{
"docid": "4163cbd1ddbf2a53d1c65fa1d212e264",
"score": "0.64394134",
"text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end",
"title": ""
},
{
"docid": "4163cbd1ddbf2a53d1c65fa1d212e264",
"score": "0.64394134",
"text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end",
"title": ""
},
{
"docid": "4c9050809fa686a4a2e92f895efe27a0",
"score": "0.6434575",
"text": "def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"title": ""
},
{
"docid": "3f346973580cc431f9af1230d89b90f6",
"score": "0.6430948",
"text": "def new\n @house = House.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @house }\n end\n end",
"title": ""
},
{
"docid": "6ced98397186953b68d770ef11189e71",
"score": "0.64297265",
"text": "def new\n @price = Price.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @price }\n end\n end",
"title": ""
},
{
"docid": "b65f2f65b72767ff2784d7d39b63c929",
"score": "0.6428588",
"text": "def new\n @drop = Drop.new\n @breadcrumbs = [{\"home\" => drops_url}, {\"new file\" => nil}]\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @drop }\n end\n end",
"title": ""
},
{
"docid": "a0fd1863daf6c14111d8a93e044d1f8b",
"score": "0.6426703",
"text": "def new\n @bands = Band.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venue }\n end\n end",
"title": ""
},
{
"docid": "afa429c920e975a4eb1ec6f76c54ee7c",
"score": "0.6425359",
"text": "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"title": ""
},
{
"docid": "2ff739370d7e5ff8f11dbca6426d4677",
"score": "0.64211893",
"text": "def new\n @lb202556 = Lb202556.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end",
"title": ""
},
{
"docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a",
"score": "0.64199406",
"text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end",
"title": ""
},
{
"docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a",
"score": "0.64199406",
"text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end",
"title": ""
},
{
"docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a",
"score": "0.64199406",
"text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end",
"title": ""
},
{
"docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a",
"score": "0.64199406",
"text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end",
"title": ""
},
{
"docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a",
"score": "0.64199406",
"text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end",
"title": ""
},
{
"docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a",
"score": "0.64199406",
"text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end",
"title": ""
},
{
"docid": "b4293148eeeac376018e3c6c81c8d633",
"score": "0.64181054",
"text": "def new\n @upgrade = Upgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @upgrade }\n end\n end",
"title": ""
},
{
"docid": "854b08050036a06aee57839b00c70e54",
"score": "0.64157134",
"text": "def new\n @bet = Bet.new(:odd_inflation => 10, :bid_amount => 1)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bet }\n end\n end",
"title": ""
},
{
"docid": "7c076309d3c46a3400fcaaa6720da428",
"score": "0.64154434",
"text": "def new\n @bid = Bid.new\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"title": ""
},
{
"docid": "7fefc963cc7f4423565bb043da42fe31",
"score": "0.6413253",
"text": "def new\n @curnit = Curnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @curnit }\n end\n end",
"title": ""
},
{
"docid": "2aee7b4423785691680a305f27f41d78",
"score": "0.64125013",
"text": "def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"title": ""
},
{
"docid": "5d77f90422d936dde954aa3798992443",
"score": "0.64120066",
"text": "def new\n @bingo = Bingo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bingo }\n end\n end",
"title": ""
},
{
"docid": "61ef8a3b2216442126d4818dd2d446c6",
"score": "0.64108074",
"text": "def new\n @noun = Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noun }\n end\n end",
"title": ""
},
{
"docid": "45b2f4b5c9d629109b0d49871a1b0214",
"score": "0.640896",
"text": "def new\n @oil = Oil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oil }\n end\n end",
"title": ""
},
{
"docid": "45b2f4b5c9d629109b0d49871a1b0214",
"score": "0.640896",
"text": "def new\n @oil = Oil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oil }\n end\n end",
"title": ""
},
{
"docid": "1b996ca1520f51d473be189a15f77025",
"score": "0.64043254",
"text": "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lease }\n end\n end",
"title": ""
},
{
"docid": "df71876c603cb1bc2cf913b781a4c407",
"score": "0.64040977",
"text": "def new\n @boss = Boss.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boss }\n end\n end",
"title": ""
},
{
"docid": "1a56cfe6c9a1c393343c1174c05128ac",
"score": "0.63940054",
"text": "def new\n @rink = Rink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rink }\n end\n end",
"title": ""
},
{
"docid": "564a45432a296ceadaba5ec98953a40a",
"score": "0.63939536",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fund_request }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d8cb56df6321b5dca97cda09bb8d5369",
"score": "0.63908935",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "d076958afe76924ff24c4912c715ded8",
"score": "0.63896525",
"text": "def new\n @house_book = HouseBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @house_book }\n end\n end",
"title": ""
},
{
"docid": "fe3f7fee8800b79a8d2c508d15a2723c",
"score": "0.63890326",
"text": "def new\n @book = Book.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "53fe163cecdde7799ecd953e066e07ec",
"score": "0.6388614",
"text": "def new\n @bp_request = BpRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bp_request }\n end\n end",
"title": ""
},
{
"docid": "98b39f6ec8dbe89850665dfa21559a2c",
"score": "0.63799816",
"text": "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @neighborhood }\n end\n end",
"title": ""
},
{
"docid": "0ff6f880e1a2dba0e40d3f65a5704895",
"score": "0.63767296",
"text": "def new\n @asset = Asset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asset }\n end\n end",
"title": ""
},
{
"docid": "0ff6f880e1a2dba0e40d3f65a5704895",
"score": "0.63767296",
"text": "def new\n @asset = Asset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asset }\n end\n end",
"title": ""
},
{
"docid": "70592e72b732e805ee7b25e9a9aa116a",
"score": "0.63747394",
"text": "def new\n @billitem = Billitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @billitem }\n end\n end",
"title": ""
},
{
"docid": "637fd21a0961ebc33373e3b74307f507",
"score": "0.6374553",
"text": "def new\n @a_u = AU.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @a_u }\n end\n end",
"title": ""
},
{
"docid": "5c23a188bdda6f70074fc8085cf79962",
"score": "0.63723165",
"text": "def new\n @book = Book.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @book }\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "e134f66bd11b1a7b2e7482ccc7f4fd75",
"score": "0.63715756",
"text": "def new\n @book = Book.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"title": ""
},
{
"docid": "49d6c09d672d7540279bfd092d7fa16d",
"score": "0.6370895",
"text": "def new\n @transmission = Transmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @transmission }\n end\n end",
"title": ""
},
{
"docid": "e8dd9b6668a72a8332673f57bd8a2999",
"score": "0.6369266",
"text": "def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end",
"title": ""
},
{
"docid": "631020b057a627452be1d99d857398b9",
"score": "0.63643205",
"text": "def new\n @cap = Cap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cap }\n end\n end",
"title": ""
}
] |
5b44fbe0088d0b1bb5b2b2d975fe8071 | this method is called when control returns to this page from the show_AC.erb page | [
{
"docid": "2d32aa1372d29beaa9741232b84282ae",
"score": "0.0",
"text": "def show_search_index \n WebView.navigate(url_for(:action => :search, :controller => :SearchContacts, :query => {:show_results => 'true'}), Constants::TAB_INDEX['Contacts'])\n end",
"title": ""
}
] | [
{
"docid": "55a421fb0445897ef57396ffa99fb90c",
"score": "0.5941553",
"text": "def show\n redirect_to account_details_home_path(id: @account) and return\n end",
"title": ""
},
{
"docid": "4ff8675bb5945e05baf61d1f02b7e36f",
"score": "0.5914853",
"text": "def show\n redirect_to :back#:actina => \"after_log_in_prosess\" :action => \"chouse\"\n end",
"title": ""
},
{
"docid": "cedce4f153fcd50cc257c9a00a16357d",
"score": "0.5828157",
"text": "def showRegistAdvisory\n begin\n @showRegistAdvisory = 1\n self.getData()\n render 'home/index'\n rescue\n redirect_to error_path\n end\n end",
"title": ""
},
{
"docid": "69d210730918bd7d93e5b8d14bd85654",
"score": "0.5827804",
"text": "def show\n\t\t#no need b/c we just show all at once\n\tend",
"title": ""
},
{
"docid": "4ba5e2e599a8c45645b4dd847a04ce38",
"score": "0.5809206",
"text": "def show\t\t\t\t\n\t\t\tend",
"title": ""
},
{
"docid": "83b35f6fd55a65d38b01b11150473907",
"score": "0.5789136",
"text": "def show\n set_accesory\n end",
"title": ""
},
{
"docid": "093f8db6f3086be04d2a569d4e73f3bd",
"score": "0.5759232",
"text": "def show\n\t\t#show now run by find_book and before_action\n\t\t#keeps code dry\n\tend",
"title": ""
},
{
"docid": "b5f520b8de8879cb9522683510b580f3",
"score": "0.5750471",
"text": "def show\r\n checar_super_agencia\r\n end",
"title": ""
},
{
"docid": "9990284430deceb330f67c996e4f9efe",
"score": "0.574851",
"text": "def show \r\n end",
"title": ""
},
{
"docid": "62c3436e0cd4cb0030ba47d0e1f1f31b",
"score": "0.5676146",
"text": "def show\n set_account\n end",
"title": ""
},
{
"docid": "17b39b071e7479fbcbbbbfc836557170",
"score": "0.56498843",
"text": "def show\n\t end",
"title": ""
},
{
"docid": "c64c21f522dbbcd2a29a28507313bea8",
"score": "0.56462276",
"text": "def preview\n @referral = ReferralCategory.order(\"id ASC\")\n @title_page = \"More Info\"\n if order.items.select{|i| i.premium? }.blank?\n redirect_to premium_manage_orders_path\n elsif order.total.to_i < 1\n redirect_to dashboard_path\n end\n\n if current_user && order\n customer_profile = order.orderable ? order.orderable.profile : nil\n if customer_profile\n customer_profile.referal_id = current_user.code \n customer_profile.referal = current_user.referral_category.name if current_user.referral_category\n else\n redirect_to new_customer_manage_orders_path\n end\n end\n end",
"title": ""
},
{
"docid": "a80568ac76438dcb8370289d803264ae",
"score": "0.56384283",
"text": "def index\n @accident_records = AccidentRecord.all\n session[:active_tab] =\"safety\"\n end",
"title": ""
},
{
"docid": "3444721094bf8feecd09a3b7489dfc6a",
"score": "0.5635598",
"text": "def show\n set_recent if params[:toggle].present?\n @date = Date.today # not used but thinking\n set_param_date\n session[:current_acct] = @account.id\n render template:'accounts/ledger/show'\n end",
"title": ""
},
{
"docid": "7506491dc6b78fccbc54fa6e2f0b244a",
"score": "0.5619164",
"text": "def show\n #calculo de presupuesto\n \n end",
"title": ""
},
{
"docid": "875ec1907fef90777d5b624a465089ef",
"score": "0.56098276",
"text": "def status_return\n @capacities_list_window.unselect\n @status_window.activate\n @help_window.clear\n set_controls_help\n end",
"title": ""
},
{
"docid": "fb4d5466ebe6d46c53770b3c2dc6762a",
"score": "0.56096363",
"text": "def show() end",
"title": ""
},
{
"docid": "fb4d5466ebe6d46c53770b3c2dc6762a",
"score": "0.56096363",
"text": "def show() end",
"title": ""
},
{
"docid": "fb4d5466ebe6d46c53770b3c2dc6762a",
"score": "0.56096363",
"text": "def show() end",
"title": ""
},
{
"docid": "cb5c649016991ae820bbb25732486d03",
"score": "0.55957764",
"text": "def show\n\t\t\n\t\t\n\tend",
"title": ""
},
{
"docid": "cae04b1d961f6eb7f99bac9ce6b6844f",
"score": "0.55942535",
"text": "def show\n end",
"title": ""
},
{
"docid": "46ba58fab68fba4ddf8ba3afedf8ae38",
"score": "0.5594011",
"text": "def request_from_catalog\n @details_name = @params[\"details_name\"]\n @has_data = Settings.has_user_data\n @data = Settings.getSavedData\n \n #reset date. otherwise it's being shown all the time, once it's been set \n $choosed['1'] = nil\n \n render :action => :request_from_catalog\n end",
"title": ""
},
{
"docid": "144a72f82fda0cea4c33037ac52eff46",
"score": "0.5593973",
"text": "def show\n @nav_status = 'db'\n end",
"title": ""
},
{
"docid": "ea5a55de8e6dff4e456f253e02861ee6",
"score": "0.55901074",
"text": "def display_the_page\n @page.process(request, response)\n # Add backreference to body for returning to edit page\n @response = response\n \n @response.body += '<p><a href=\"' + url_for(\n :controller => 'admin/' + params[:action], \n :id => instance_variable_get(\"@#{params[:action]}\"),\n :action => 'edit'\n ) + '\">Back</a></p>'\n \n @response = nil\n\n # If this is true, Radiant will not use render more.\n @performed_render = true\n end",
"title": ""
},
{
"docid": "04fca4a78431588b7d5af3b4cec72834",
"score": "0.55744916",
"text": "def show; @showing = false; end",
"title": ""
},
{
"docid": "4238a516048602a0304dc26966de18dd",
"score": "0.5558485",
"text": "def show\n\t\tif @finalphase.finalopinion\n\t\t \tredirect_to @finalphase.session\n\t\tend \n\tend",
"title": ""
},
{
"docid": "d410214fc480f452c2f057ae5f8a5b4f",
"score": "0.55530345",
"text": "def show\n end",
"title": ""
},
{
"docid": "d410214fc480f452c2f057ae5f8a5b4f",
"score": "0.55530345",
"text": "def show\n end",
"title": ""
},
{
"docid": "d410214fc480f452c2f057ae5f8a5b4f",
"score": "0.55530345",
"text": "def show\n end",
"title": ""
},
{
"docid": "4e1cfcb7a7ee50e6c13e5aaf4b33b59b",
"score": "0.55351335",
"text": "def show\n\tredirect_to new_availability_calendar_path\n end",
"title": ""
},
{
"docid": "714d6fe898537743561d423ccfaa9c0d",
"score": "0.55260944",
"text": "def show\n @page_title='Aktuator'\n end",
"title": ""
},
{
"docid": "86001074c3d14dee9df3b529831589d4",
"score": "0.5524329",
"text": "def show\n\n\tend",
"title": ""
},
{
"docid": "86001074c3d14dee9df3b529831589d4",
"score": "0.5524329",
"text": "def show\n\n\tend",
"title": ""
},
{
"docid": "86001074c3d14dee9df3b529831589d4",
"score": "0.5524329",
"text": "def show\n\n\tend",
"title": ""
},
{
"docid": "7d456685d3c1354ce16201bad205e08a",
"score": "0.55150926",
"text": "def show\n\t\t\n\tend",
"title": ""
},
{
"docid": "7d456685d3c1354ce16201bad205e08a",
"score": "0.55150926",
"text": "def show\n\t\t\n\tend",
"title": ""
},
{
"docid": "7d456685d3c1354ce16201bad205e08a",
"score": "0.55150926",
"text": "def show\n\t\t\n\tend",
"title": ""
},
{
"docid": "f8bb2494128427169a09eba3df2d5241",
"score": "0.55145144",
"text": "def displayed?; end",
"title": ""
},
{
"docid": "bc570006d674004742e4ec622220a085",
"score": "0.5512826",
"text": "def show\n if params[:sgid].present? && magic_fetch_student&.student? && magic_fetch_student.id == @current_student.id\n @internship_application.update(magic_link_tracker: 1)\n @internship_application_sgid= @internship_application.to_sgid(expires_in: 20.seconds).to_s\n render 'dashboard/students/internship_applications/_making_decisions' and return\n elsif params[:sgid].present?\n @internship_application.update(magic_link_tracker: 2)\n redirect_to(dashboard_students_internship_application_path(\n student_id: @current_student.id,\n id: @internship_application.id\n )) and return\n else\n authenticate_user!\n end\n authorize! :dashboard_show, @internship_application\n @internship_offer = @internship_application.internship_offer\n end",
"title": ""
},
{
"docid": "e5a67f84e9c46bc4f5ef207889f854ed",
"score": "0.5508982",
"text": "def show\n if current_rule.antragStatus\n \n else\n redirect_to root_path alert: \"Keine Recht\"\n end\n end",
"title": ""
},
{
"docid": "ac766135f7820a9024bed04c8ec28e6c",
"score": "0.5500558",
"text": "def show\n \t\n end",
"title": ""
},
{
"docid": "ac766135f7820a9024bed04c8ec28e6c",
"score": "0.5500558",
"text": "def show\n \t\n end",
"title": ""
},
{
"docid": "4f8e5b2ebe628d812d094aee3167ec83",
"score": "0.5498513",
"text": "def show\n \n \n end",
"title": ""
},
{
"docid": "f01d79ef486577499b505f4a519cb2fa",
"score": "0.54914486",
"text": "def show\nset_campaign\n \n\n\n end",
"title": ""
},
{
"docid": "37e539e59f330ba357d190870c6c4a45",
"score": "0.54869676",
"text": "def display_the_page\n @page.process(request, response)\n # Add backreference to body for returning to edit page\n @response = response\n \n @response.body += '<p><a href=\"' + url_for(\n :controller => 'admin/' + CGI.escapeHTML(params[:action].pluralize), \n :id => params[:id].to_i,\n :action => 'edit'\n ) + '\">Back</a></p>'\n \n @response = nil\n\n # If this is true, Radiant will not use render more.\n @performed_render = true\n end",
"title": ""
},
{
"docid": "c358ae44b8a3971c1b7c25608c9deb4e",
"score": "0.5477796",
"text": "def convention_link_onclick\r\n @dbplatenamearr = @@slib.sql_get_db_plate_name_arr()\r\n render :action => \"convention\"\r\nend",
"title": ""
},
{
"docid": "dd62a00c34914b5805a62047aecc434d",
"score": "0.54699284",
"text": "def show\n current_client == current_user\n unless current_user.admin?\n unless @client == current_user\n redirect_to :back, :alert => \"Access denied.\"\n end\n end\n\n end",
"title": ""
},
{
"docid": "07ebe5382c182f3ad33b8eb8e197fc99",
"score": "0.5469912",
"text": "def show\n end",
"title": ""
},
{
"docid": "07ebe5382c182f3ad33b8eb8e197fc99",
"score": "0.5469912",
"text": "def show\n end",
"title": ""
},
{
"docid": "07ebe5382c182f3ad33b8eb8e197fc99",
"score": "0.5469912",
"text": "def show\n end",
"title": ""
},
{
"docid": "6c453615d733020b9d209e2c7a3f85fe",
"score": "0.5463358",
"text": "def show\n # no se que hace\n end",
"title": ""
},
{
"docid": "4ed448ce5bf2761257e38cebb25dbbad",
"score": "0.5461799",
"text": "def show\n debug_log(\"[d] Users_Ctrl: ac: show\") # log\n @show_option = \"user\"\n @current_reptiles = Reptile.where(user_id: current_user)\n \n # ショップが持つ、新入荷レプタイル情報を取得\n if @current_reptiles\n @created_at_desc = @current_reptiles.all.order(created_at: \"DESC\") # 降順\n debug_log(\"[d] Users_Ctrl: ac: show @created_at_desc.count=#{@created_at_desc.count}\") # log\n \n if @created_at_desc.count <= 5\n @new_arrivals = @created_at_desc.first(@created_at_desc.count)\n else\n @new_arrivals = @created_at_desc.first(5)\n end\n debug_log(\"[d] Users_Ctrl: ac: show @new_arrivals=#{@new_arrivals.inspect}\") # log\n debug_log(\"[d] Users_Ctrl: ac: show @new_arrivals.count=#{@new_arrivals.count}\") # log\n end\n \n # ショップが持つ、タイプ毎のReptile情報を取得\n if params[:current_reptile_type].present?\n @show_option = params[:current_reptile_type]\n @current_reptile_type = @current_reptiles.where(type1: params[:current_reptile_type])\n debug_log(\"[d] Users_Ctrl: ac: show @current_reptile_type=#{@current_reptile_type}\") # log\n unless @current_reptile_type.present?\n flash.now[:warning] = \"「#{params[:current_reptile_type]}」の登録は現在ありません\"\n end\n end\n \n # ショップ内で、選択したレプタイルページへ遷移\n if params[:current_select].present?\n @show_option = params[:current_select]\n @current_select_reptile = @current_reptiles.find(params[:current_select])\n debug_log(\"[d] Users_Ctrl: ac: show @current_select_reptile=#{@current_select_reptile}\") # log\n end\n \n debug_log(\"[d] Users_Ctrl: ac: show @show_option=#{@show_option}\") # log\n end",
"title": ""
},
{
"docid": "206ccbbf4e91a0220951aa7ce784bcb1",
"score": "0.54568374",
"text": "def on_display\n update!\n end",
"title": ""
},
{
"docid": "a7b887ddda30e74f18a80cd52648729c",
"score": "0.545595",
"text": "def show\n \tend",
"title": ""
},
{
"docid": "a7b887ddda30e74f18a80cd52648729c",
"score": "0.545595",
"text": "def show\n \tend",
"title": ""
},
{
"docid": "8e136f9d6763f93bb9caef261ddf43e2",
"score": "0.5454845",
"text": "def show\n\t\t end",
"title": ""
},
{
"docid": "e6d321f827333c13ccd774b53e6e0e1c",
"score": "0.54545087",
"text": "def back; end",
"title": ""
},
{
"docid": "e6d321f827333c13ccd774b53e6e0e1c",
"score": "0.54545087",
"text": "def back; end",
"title": ""
},
{
"docid": "e6d321f827333c13ccd774b53e6e0e1c",
"score": "0.54545087",
"text": "def back; end",
"title": ""
},
{
"docid": "b6ce894116d251a4f9522a2c835d0a0f",
"score": "0.54439634",
"text": "def show\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end",
"title": ""
},
{
"docid": "f7b903042bb580d56658ab233d1f1253",
"score": "0.5440084",
"text": "def kopal_layout_after_page_front\n\n end",
"title": ""
},
{
"docid": "832e75c591284041746cbe1fe6290e79",
"score": "0.5433618",
"text": "def show\n if @application_case.has_user?(current_user)\n\n @notes = @application_case.notes\n @requirements = @application_case.case_requirements\n @status = @application_case.application_statuses\n @statuses = Status.all.sort_by(&:created_at)\n @m_address = @application_case.mortgage_address\n @applicants = @application_case.applicants.as_applicants\n @agent = @application_case.applicants.as_agents.first\n\n @agents ||= []\n @applicants.each do |applicant|\n if !@agents.include?(applicant.user)\n @agents << ClientAgent.agents(applicant.user).first\n end \n end\n\n else \n flash[:notice] = \"You are not authorized to view this\";\n redirect_to(application_cases_path);\n end\n end",
"title": ""
},
{
"docid": "5bb5a0979dc7c882371198a381787a60",
"score": "0.5426748",
"text": "def show\r\n\r\n end",
"title": ""
},
{
"docid": "5bb5a0979dc7c882371198a381787a60",
"score": "0.5426748",
"text": "def show\r\n\r\n end",
"title": ""
},
{
"docid": "5bb5a0979dc7c882371198a381787a60",
"score": "0.5426748",
"text": "def show\r\n\r\n end",
"title": ""
},
{
"docid": "096fbc99252247d9590703376177438d",
"score": "0.5413205",
"text": "def show\n \n \n end",
"title": ""
},
{
"docid": "d28cff8a6a656cc823273480f9f19101",
"score": "0.54126686",
"text": "def show_access\n render partial: \"show_access_tab\"\n end",
"title": ""
},
{
"docid": "e745dd21cca0fa8c2a171fe31ad3043a",
"score": "0.5406984",
"text": "def show\n case @user.action\n when \"CofA\"\n @action = \"Change Of Address\"\n when \"AR\"\n @action = \"Annual Report\"\n end\n end",
"title": ""
},
{
"docid": "94295b1db2fedb68c3cff5773bc36caa",
"score": "0.5405563",
"text": "def show\r\n\tend",
"title": ""
},
{
"docid": "bb20da1b52e9c3362efdbfeca3e98322",
"score": "0.5405398",
"text": "def show\n \n end",
"title": ""
},
{
"docid": "bb20da1b52e9c3362efdbfeca3e98322",
"score": "0.5405398",
"text": "def show\n \n end",
"title": ""
},
{
"docid": "2d4df845baa2774de61824318ffa7021",
"score": "0.54021424",
"text": "def show\n @company = Company.find(params[:id]) if params[:id].present?\n @company_notes = Note.notes_of_company @company if @company.present?\n @active_campaigns = @company.active_campaigns if @company.present?\n session[:page_title] = \"Company Profile\"\n session[:tab_title] = \"Company Overview\"\n end",
"title": ""
},
{
"docid": "530cb6556b0b3c05b6afe464146c2d0b",
"score": "0.5392271",
"text": "def show\n \n \n end",
"title": ""
},
{
"docid": "530cb6556b0b3c05b6afe464146c2d0b",
"score": "0.5392271",
"text": "def show\n \n \n end",
"title": ""
},
{
"docid": "530cb6556b0b3c05b6afe464146c2d0b",
"score": "0.5392271",
"text": "def show\n \n \n end",
"title": ""
},
{
"docid": "530cb6556b0b3c05b6afe464146c2d0b",
"score": "0.5392271",
"text": "def show\n \n \n end",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
},
{
"docid": "f7ccee1c34616b0af582dd0fcc834f69",
"score": "0.5377628",
"text": "def show\n\tend",
"title": ""
}
] |
6f8691834760d8ebe261694acb92cc06 | Fetch the current roles in a Roles object. | [
{
"docid": "faf7f0d8f4c4f77d72dcd68e9825e0db",
"score": "0.71489567",
"text": "def roles\n @access_context.roles\n end",
"title": ""
}
] | [
{
"docid": "e9d19c22abf4521f0dd1ff59b9afb9fe",
"score": "0.82234865",
"text": "def fetch_roles\n @current_user.nil? ? [] : @current_user.roles\n end",
"title": ""
},
{
"docid": "a1d730f58061c1c14d98141a1c22fd8b",
"score": "0.7630712",
"text": "def get_roles\n self.class.get(\"#{@url}/rest/user-management/roles\", basic_auth: @auth)\n end",
"title": ""
},
{
"docid": "980ff6cbd29feb8a9142227486831eed",
"score": "0.7572768",
"text": "def roles\n @roles ||= api_client.get_roles\n end",
"title": ""
},
{
"docid": "dfab255d99499ec4df74592d553f134e",
"score": "0.7558743",
"text": "def get_all_roles\n _get('roles', ApiRole, true)\n end",
"title": ""
},
{
"docid": "be168d7c75df5b88ee256c8e85f7a7f1",
"score": "0.74356914",
"text": "def list\n get('roles')['roles']\n end",
"title": ""
},
{
"docid": "7ba174e6114cfd302fb91d26e742d8cd",
"score": "0.73859745",
"text": "def roles\n client.user_roles(id)\n end",
"title": ""
},
{
"docid": "7ba174e6114cfd302fb91d26e742d8cd",
"score": "0.73859745",
"text": "def roles\n client.user_roles(id)\n end",
"title": ""
},
{
"docid": "b1488076b55bdd6671861bc6a152d4f2",
"score": "0.7304416",
"text": "def get_roles\n @roles = Rol.order(:name)\n end",
"title": ""
},
{
"docid": "17bf84afec0bd03fb4b6f10c582ce263",
"score": "0.72778124",
"text": "def roles\n @roles ||= Roles.new(self)\n end",
"title": ""
},
{
"docid": "49ebb4505dcb866dc768cba9d663758d",
"score": "0.72520226",
"text": "def get_roles\n return @client.raw(\"get\", \"/config/roles\")\n end",
"title": ""
},
{
"docid": "2d78238f9a22b217cbb3bf0d7c2277e0",
"score": "0.7247418",
"text": "def roles\n @roles\n end",
"title": ""
},
{
"docid": "2d78238f9a22b217cbb3bf0d7c2277e0",
"score": "0.7246561",
"text": "def roles\n @roles\n end",
"title": ""
},
{
"docid": "706e274abc37742697f29bc35a3bb1f2",
"score": "0.72110164",
"text": "def get_roles(options = GetRolesOptions.new)\n resp = @backend.role_get_all(options.timeout)\n resp.map do |r|\n RoleAndDescription.new do |role|\n role.name = r[:name]\n role.display_name = r[:display_name]\n role.description = r[:description]\n role.bucket = r[:bucket]\n role.scope = r[:scope]\n role.collection = r[:collection]\n end\n end\n end",
"title": ""
},
{
"docid": "d5e7cb594e669607bedc24918a4bab11",
"score": "0.71961486",
"text": "def roles\n user_account.roles_list\n end",
"title": ""
},
{
"docid": "117ca26473f857a9c16ebe13a0ce2656",
"score": "0.71960986",
"text": "def current_roles\n return [] unless defined? current_user\n return [] if current_user.empty?\n\n current_user.roles\n end",
"title": ""
},
{
"docid": "5955f9f7beeac6e1f885b0ebcea97b7b",
"score": "0.71770895",
"text": "def roles\n return @roles\n end",
"title": ""
},
{
"docid": "4a267da4b1c3f799925022afd2b448c1",
"score": "0.7170207",
"text": "def roles\n return @roles\n end",
"title": ""
},
{
"docid": "4a267da4b1c3f799925022afd2b448c1",
"score": "0.7170207",
"text": "def roles\n return @roles\n end",
"title": ""
},
{
"docid": "4a267da4b1c3f799925022afd2b448c1",
"score": "0.7170207",
"text": "def roles\n return @roles\n end",
"title": ""
},
{
"docid": "4a267da4b1c3f799925022afd2b448c1",
"score": "0.7169619",
"text": "def roles\n return @roles\n end",
"title": ""
},
{
"docid": "338cc6846addfd5aa0e58b623156df9b",
"score": "0.7131427",
"text": "def get_roles\n @client.raw('get', '/config/roles')\n end",
"title": ""
},
{
"docid": "61d88f0d6c494542fbbab7a78b53b025",
"score": "0.6989784",
"text": "def roles\n root.send(:call, \"UserGroup\", \"get_role_collection_from_web\").xpath(\"//spdir:Role\", NS).map do |row|\n attributes = clean_attributes(row.attributes)\n Role.new(root, attributes[\"Name\"])\n end\n end",
"title": ""
},
{
"docid": "a2da1402cfcc093040fc9f74d47b6300",
"score": "0.698677",
"text": "def roles\n self.update_roles\n @roles\n end",
"title": ""
},
{
"docid": "0303da53ab3689336667b417e0b6d365",
"score": "0.6970601",
"text": "def roles(force_reload = false)\n unless force_reload\n return @role_list unless @role_list.nil? \n end\n return nil unless self.id\n \n @role_list = UserRoleList.new({:user_id => self.id})\n return @role_list\n end",
"title": ""
},
{
"docid": "5cc47c5e09510b7c3fb65e9d83f46d2a",
"score": "0.6942038",
"text": "def roles \n self.object.roles.map do |role|\n RoleSerializer.new(role)\n end \n end",
"title": ""
},
{
"docid": "8d77ac1d4c47d5edca715e2b16028fa9",
"score": "0.6906344",
"text": "def roles\n Jak.role_klass.where(id: role_ids)\n end",
"title": ""
},
{
"docid": "a5796d4fd2ac253df991d4a77fb163ac",
"score": "0.68997455",
"text": "def resources_roles\n Role.all(:id => roles)\n end",
"title": ""
},
{
"docid": "df775565f32ac445be6213e0ef5005ff",
"score": "0.68894535",
"text": "def role_select\n @@Roles.list\n end",
"title": ""
},
{
"docid": "df775565f32ac445be6213e0ef5005ff",
"score": "0.68894535",
"text": "def role_select\n @@Roles.list\n end",
"title": ""
},
{
"docid": "a0cc56abd68a51409a1ba4037ad71b42",
"score": "0.6865807",
"text": "def roles\n @@roles ||= []\n end",
"title": ""
},
{
"docid": "35147ced2d67161e1d606e24340f7731",
"score": "0.684101",
"text": "def roles(&block)\n if block_given?\n instance_eval(&block)\n else\n @roles\n end\n end",
"title": ""
},
{
"docid": "44b27efc3e7530c3dbfcf23ae11d2de4",
"score": "0.68369144",
"text": "def user_roles(id = 'my')\n collection_from_response(RoleCollection, Role, :get, \"userRole/#{id}\")\n end",
"title": ""
},
{
"docid": "a06722710bef964f8eeadec5b7f6b3e2",
"score": "0.68264675",
"text": "def roles \n \n # Stash away the db the user is currently connected to ( aka which company )\n connection_spec = self.connection.instance_variable_get \"@config\"\n # Connect to the master db so you can get the user's roles.\n ActiveRecord::Base.establish_connection(ENV[\"RAILS_ENV\"])\n @myroles = User.find(self.id).roles \n # Switch back to original company db\n ActiveRecord::Base.establish_connection( connection_spec )\n\n return @myroles\n end",
"title": ""
},
{
"docid": "fee2a77cf91b5e1806ab155abcf18aea",
"score": "0.6817023",
"text": "def roles\n result = command(\"salt-call grains.get roles\")\n YAML.load(result[:stdout])[\"local\"]\n end",
"title": ""
},
{
"docid": "76a812d5c5ada496067d4cbc139be068",
"score": "0.6794332",
"text": "def roles\n my_roles = Array.new\n self.role_memberships.each do |mem|\n my_roles << mem.role\n end\n return my_roles\n end",
"title": ""
},
{
"docid": "38889e1716f3defabd94c2ab25a07d6a",
"score": "0.67934465",
"text": "def roles\n @roles ||= []\n end",
"title": ""
},
{
"docid": "8d37c92056de26e0fc5a2e8756578117",
"score": "0.6760197",
"text": "def user_roles user\n cache.user_roles user\n end",
"title": ""
},
{
"docid": "314be241d5c8dd7e9176f767cc8b4a1a",
"score": "0.67443645",
"text": "def roles\n roles = Role.find(:all, :conditions => ['person_id =?', self.person_id])\n end",
"title": ""
},
{
"docid": "6cbf89fc084d0beb58fa2488693c8b8d",
"score": "0.6738145",
"text": "def roles_for user\n roles.where(user: user)\n end",
"title": ""
},
{
"docid": "d02e91ce814a2d29ce4fbbfc8b91acc3",
"score": "0.67283463",
"text": "def index\n @ums_roles = Ums::Role.all\n end",
"title": ""
},
{
"docid": "624af8bcde9026f47c3588094de272d0",
"score": "0.67101514",
"text": "def roles\n return proposed_snapshot.roles if proposed? \n return active_snapshot.roles if active?\n []\n end",
"title": ""
},
{
"docid": "fbcf8d3c65bd7ff0773bad8970cca12d",
"score": "0.670646",
"text": "def roles\n CaseInsensitiveCollection.new(self, PATH_ROLES)\n end",
"title": ""
},
{
"docid": "601037c1b846e3d58d6c1326de3fc725",
"score": "0.6691704",
"text": "def index\n @auth_roles = Auth::Role.all\n end",
"title": ""
},
{
"docid": "86c4ecfa4bdd280318d3988c42c234d7",
"score": "0.66886234",
"text": "def user_roles\n role_ids = api_client.get_user_roles(current_user_id)\n\n roles.map do |role|\n role if role_ids.include?(role.id)\n end.compact\n end",
"title": ""
},
{
"docid": "c7b8a632cf8523000927669e6e73bc8c",
"score": "0.66874975",
"text": "def roles\n system_roles | rolez.map{ |role| role.name }\n end",
"title": ""
},
{
"docid": "65fc0b2d849a16e2900887c15267a776",
"score": "0.666909",
"text": "def roles()\n if (!self.authenticated?())\n return ['guest']\n end\n \n #get the roles from the db and return them\n return []\n end",
"title": ""
},
{
"docid": "7177f76e9af7727beb277cdfb8755497",
"score": "0.6667957",
"text": "def auth_roles_list\n @auth_roles_list ||= listify(auth_roles)\n end",
"title": ""
},
{
"docid": "181c29d84ab2cbf8b631a49bdc79d0f2",
"score": "0.66581583",
"text": "def roles\n\t\t\tGuise.roles\n\t\tend",
"title": ""
},
{
"docid": "3414d139da05e58f255501f671f684b2",
"score": "0.66555876",
"text": "def index\n if current_user.is_super_admin?\n @roles = Role.all\n else\n @roles = current_user.organization.roles\n end\n end",
"title": ""
},
{
"docid": "8e41ac6e6d8e8732bebb1e9c548832a6",
"score": "0.6648288",
"text": "def user_roles(id = 'my')\n collection_from_response(Code42::RoleCollection, Code42::Role, :get, \"userRole/#{id}\")\n end",
"title": ""
},
{
"docid": "8e41ac6e6d8e8732bebb1e9c548832a6",
"score": "0.6648288",
"text": "def user_roles(id = 'my')\n collection_from_response(Code42::RoleCollection, Code42::Role, :get, \"userRole/#{id}\")\n end",
"title": ""
},
{
"docid": "bac6cf350ce1f0712afeeb621588f9b6",
"score": "0.6639664",
"text": "def roles\n role_registry.roles.keys\n end",
"title": ""
},
{
"docid": "72c3ebe322e654a9d9b78503eb770a37",
"score": "0.6638259",
"text": "def roles\n @roles ||= Array[auth_roles, admin_roles].flatten\n end",
"title": ""
},
{
"docid": "b3fcb241b388fe4554a39217cb7b057d",
"score": "0.6617733",
"text": "def all_roles(**args)\n params = parameters(args) do\n optional_params :start, :limit\n end\n request(:get, 'roles', params)\n end",
"title": ""
},
{
"docid": "3ecbeac214ff60617551af3e3a4c5f46",
"score": "0.658941",
"text": "def found_roles\n conditions = @selected_role_ids.empty? ? {} : { :id => @selected_role_ids }\n self.all_roles(conditions)\n end",
"title": ""
},
{
"docid": "31ac80964cb0f928b145fde16df5b7a3",
"score": "0.65762097",
"text": "def roles_for(object)\n self.role_objects.select(&role_selecting_lambda(object))\n end",
"title": ""
},
{
"docid": "d2445230e727702dd070610848ada80c",
"score": "0.6553674",
"text": "def index\n @roles = Role.fetch_ordered_by_page(params[\"page\"])\n end",
"title": ""
},
{
"docid": "e5443f2377817bf893033c886ef160b0",
"score": "0.6550806",
"text": "def roles_for_user\n raise \"Stub Error: roles_for_user not implemented. Make sure this returns a list of roles.\"\n end",
"title": ""
},
{
"docid": "3730985bd745c9cb96a847e375de6a82",
"score": "0.65334827",
"text": "def user_roles\n return @user_roles\n end",
"title": ""
},
{
"docid": "c164dab9af95d7bfccb54bcff079f188",
"score": "0.65320325",
"text": "def list_roles(json_payload={})\n conn = @client.get do |req|\n req.url '/api/v2/role/list'\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end",
"title": ""
},
{
"docid": "bd3529d57832f8198d5e3bf207b443da",
"score": "0.65114164",
"text": "def roles(opts = {})\n data, _status_code, _headers = roles_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "7175c2286755eacb5252abd36f494857",
"score": "0.65067106",
"text": "def get_roles(options = GetRolesOptions.new)\n # GET /settings/rbac/roles\n end",
"title": ""
},
{
"docid": "3bf59bc70a1e233eb9df2253e3ef1d0d",
"score": "0.65058756",
"text": "def role_listing\n xml = make_xml('RoleListingRequest')\n r = execute(xml, '1.2')\n roles = []\n if r.success\n r.res.elements.each('RoleListingResponse/RoleSummary') do |summary|\n roles << RoleSummary.parse(summary)\n end\n end\n roles\n end",
"title": ""
},
{
"docid": "34cc7805cc63e71f96be90ced0a609e6",
"score": "0.6484397",
"text": "def all\n Aclatraz.store.roles(suspect)\n end",
"title": ""
},
{
"docid": "99e56bb20886149dd471c444bbf55b98",
"score": "0.64813894",
"text": "def roles_commissioned\n find_related_frbr_objects( :commissions, :which_roles?) \n end",
"title": ""
},
{
"docid": "287a933f1203d2221b42a408cb84f338",
"score": "0.6479792",
"text": "def roles() #:doc:\r\n user_table_user && user_table_user.roles\r\n end",
"title": ""
},
{
"docid": "04c978944349a4432cf2015877063be8",
"score": "0.6475848",
"text": "def roles\n res = []\n\n tmp = GoodData.get @json['user']['links']['roles']\n tmp['associatedRoles']['roles'].each do |role_uri|\n role = GoodData.get role_uri\n res << GoodData::ProjectRole.new(role)\n end\n\n res\n end",
"title": ""
},
{
"docid": "3248b7bbdfd4083e2e100a2153f803e7",
"score": "0.6473229",
"text": "def roles\n return MtCompanyWorkerRole.find( :all, :conditions=>[\"mt_company_id=?\", id], :order=>\"name\" );\n end",
"title": ""
},
{
"docid": "598f3edee64a2471cf22e49a4e3ddd1b",
"score": "0.64691466",
"text": "def api_roles_get(opts = {})\n api_roles_get_with_http_info(opts)\n nil\n end",
"title": ""
},
{
"docid": "50892007fb934db71daac2ddca659285",
"score": "0.6457906",
"text": "def get_all_roles\n # stub method\n puts 'call get_all_roles'\n end",
"title": ""
},
{
"docid": "be276c7749ec8de850dc63f2e47f387e",
"score": "0.64475596",
"text": "def detailed_roles\n return @detailed_roles\n end",
"title": ""
},
{
"docid": "a7638b923e1de6ebeaf5b59af291288b",
"score": "0.6445162",
"text": "def roles() #:doc:\n user_table_user && user_table_user.roles\n end",
"title": ""
},
{
"docid": "88621f84ed738c0d91ca5f33c339ba3b",
"score": "0.64402103",
"text": "def current_roles\n @current_roles ||=\n if ENV['ROLES']\n ENV['ROLES'].split(\",\")\n elsif File.exists?(\"/etc/roles\")\n File.read(\"/etc/roles\").strip.split\n else\n []\n end\n end",
"title": ""
},
{
"docid": "bc20dfdb7e91473d483852c8e89eb604",
"score": "0.64387476",
"text": "def roles() \n # {{{\n if !@roles then\n inherited_roles = Array.new\n parent_groups.each { |g|\n inherited_roles += g.immediate_roles\n } \n own = immediate_roles()\n if own then\n @roles = own + inherited_roles\n else \n @roles = inherited_roles\n end\n end\n @roles\n end",
"title": ""
},
{
"docid": "2943001e3b7f19a2f00807bd89ac7a34",
"score": "0.64357466",
"text": "def index\n\t\t@roles = Role.all\n\tend",
"title": ""
},
{
"docid": "57d579c67033f91a75e25a33abf16317",
"score": "0.64346904",
"text": "def role_list\n self.role_ids\n end",
"title": ""
},
{
"docid": "007d2f0cd9201a66d0dfed9ffe7d9642",
"score": "0.6432468",
"text": "def roles(cm, api_base_url, user, password)\n @services.dig(cm, :cl).pmap do |cl, cl_props|\n cl_props[:services].pmap do |service, service_props|\n url = \"#{api_base_url}/clusters/#{cl}/services/#{service}/roles\"\n roles = API.get_req(url: url, user: user, password: password,\n props: :items, sym_name: true)\n roles.map { |role| build_role_data(cm, service_props, role) }\n end\n end\n rescue StandardError => e\n raise CMAPIError, \"#{cm}: #{e.message}\", e.backtrace\n end",
"title": ""
},
{
"docid": "53b0daa53628e814a000602de8bea30a",
"score": "0.6425429",
"text": "def all_roles\n roles + deal_entity.roles\n end",
"title": ""
},
{
"docid": "cb5e06f6c5f65f1b4e3054185aadda81",
"score": "0.6390953",
"text": "def show\n @roles = UserRole.all\n end",
"title": ""
},
{
"docid": "70f4c80063aae5f81c04f75fe56b1b90",
"score": "0.6386658",
"text": "def available_roles\n roles = Role.all.map!{|r| r.name}\n roles.delete self.role.name\n\n roles\n end",
"title": ""
},
{
"docid": "436022a8942186c10b3eae1ab936b49f",
"score": "0.63847685",
"text": "def roles\n (properties[:roles] || []).map { |r| r.is_a?(Link) ? r : Link.new(r, nil, client) }\n end",
"title": ""
},
{
"docid": "71228dbe070bbee69af0be8f2377d0c2",
"score": "0.6382404",
"text": "def index\n @roles = Xmt::Rbac::Role.all.page(params[:page])\n end",
"title": ""
},
{
"docid": "5ea832aa264630f75968829f945577c7",
"score": "0.6380649",
"text": "def roles_service\n @roles_service ||= RolesService.new(self, 'roles')\n end",
"title": ""
},
{
"docid": "e0175f9ce6724b274bc029e713e8ef11",
"score": "0.63783836",
"text": "def expanded_roles\n Role.self_and_descendants(*self.roles)\n end",
"title": ""
},
{
"docid": "4e97a686f90b84df64c974ad2cad2b14",
"score": "0.63781756",
"text": "def init_aws_roles\n roles = AwsUtil.list_paged_results do |marker|\n response = @iam.list_roles(marker: marker)\n [response.roles, response.is_truncated, response.marker]\n end\n roles.map do |role|\n Aws::IAM::Role.new(role.role_name, { :client => @iam })\n end\n end",
"title": ""
},
{
"docid": "2238275879d8eb273b1715a34ac18ab4",
"score": "0.63704",
"text": "def display_roles\n I18n.t(get_roles, scope: [:activerecord, :attributes, :roles]).join(Utils::SEPARATOR)\n end",
"title": ""
},
{
"docid": "aba15a15db19bed67d81aff36eea71c6",
"score": "0.63667196",
"text": "def index\n @roles = Role.all\n end",
"title": ""
},
{
"docid": "2ac9298465a5486ed654f7a554fa13ef",
"score": "0.636516",
"text": "def roles\n roles_link = GoodData::Helpers.get_path(@json, %w(user links roles))\n return unless roles_link\n tmp = client.get roles_link\n tmp['associatedRoles']['roles'].pmap do |role_uri|\n role = client.get role_uri\n client.factory.create(GoodData::ProjectRole, role)\n end\n end",
"title": ""
},
{
"docid": "d3da320e18b1b5410026db934a0ea1d0",
"score": "0.6357455",
"text": "def index\n @origin_roles = Origin::Role.all\n end",
"title": ""
},
{
"docid": "0683c14b175e373efa95e69d73cff855",
"score": "0.6357252",
"text": "def index\n @mod_objects_roles = ModObjectsRole.all\n end",
"title": ""
},
{
"docid": "cde2f8e925e31e038e00e9378c9854c3",
"score": "0.63478696",
"text": "def get_roles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuthRolesApi.get_roles ...\"\n end\n # resource path\n local_var_path = \"/auth/roles\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_name'] = opts[:'filter_name'] if !opts[:'filter_name'].nil?\n query_params[:'filter_role'] = opts[:'filter_role'] if !opts[:'filter_role'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceRoleResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthRolesApi#get_roles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
},
{
"docid": "4d019074f59fd88ba70083aef1dc21bc",
"score": "0.63473296",
"text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end",
"title": ""
}
] |
907883afefaf6d57b63d1b87c64fa96a | query para obtener los detalle de una estacion, se le pasa el nombre de la estacion y la fecha actual mapa /info_polens/estacion mapa /info_polens/estacion.json | [
{
"docid": "7ecb5316b36d3b9be1c28fa45764be6f",
"score": "0.706229",
"text": "def estaciones\n\n param_estacion = params[:estacion]\n param_fecha = params[:fecha].to_i\n @info_polens = InfoPolen.where({\"ESTACIONES\" => param_estacion, \"FECHA\" => param_fecha}).order_by(:TIPOS_POLINICOS.asc)\n\n respond_to do |format|\n format.html #{ redirect_to info_polens_url }\n format.json { render json: @info_polens }\n end\n end",
"title": ""
}
] | [
{
"docid": "989a82ed61341ab7f853a7ef3867a375",
"score": "0.6152503",
"text": "def infosSauvegardes\n\t\n return requete(\"SELECT nompartie, nomgrille, taillegrille, jokersRestants, grillejouee.datemaj FROM grillejouee INNER JOIN grilleediter ON grillejouee.idGrille=grilleediter.id WHERE joueur = #{@profil.getStats[\"id\"]}\")\n\tend",
"title": ""
},
{
"docid": "320b44d07673088a1446e21e43446584",
"score": "0.61355513",
"text": "def index\n @estaciones = Estacion.all(:order => \"posicion ASC\", :joins => :linea, :conditions => [\"lineas.nombre = ?\", \"Linea 8: Garibaldi - Constitución de 1917\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @estaciones }\n end\n end",
"title": ""
},
{
"docid": "7c47516807bde4bf516c5418e4d45c9f",
"score": "0.59923774",
"text": "def get_statistics\n @estadisticas = {}\n #Extraer el nombre e id de todas las estadisticas existentes para buscar el total de todas las especies\n Estadistica.all.each do |estadistica|\n # Saltar estadísticas que ya no se usan\n next if Estadistica::ESTADISTICAS_QUE_NO.index(estadistica.id)\n @estadisticas[estadistica.id] = {\n 'nombre_estadistica': estadistica.descripcion_estadistica,\n 'conteo': EspecieEstadistica.all.where(\"estadistica_id = #{estadistica.id} AND conteo > 0\").size\n }\n end\n @totales_estadisticas = build_json_to_statics(@estadisticas)\n @estadisticas\n end",
"title": ""
},
{
"docid": "0ffb98675bb3b7e8574568cf8aae5844",
"score": "0.5957184",
"text": "def show\n #@departamento = Ubigeo.find_by_sql(\"where idDepartamento=\"+@estacionamiento.departamento.to_s)\n @serv_adicinales = ServAdicinale.all\n @departamento = Ubigeo.where(:idDepartamento => @estacionamiento.departamento).first\n @provincia = Ubigeo.where(:idProvincia => @estacionamiento.provincia).first\n @distrito = Ubigeo.where(:idDistrito => @estacionamiento.distrito).first\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n \n end",
"title": ""
},
{
"docid": "8a4455d59028b6034f02276e14bf5918",
"score": "0.5847689",
"text": "def planes_estudiados plan_consultado_id = nil\n data = {}\n\n # \"AlumnoPlanEstudio\"\n links_carreras = alumno_plan_estudio :fields => [:id, :alumno_id, :institucion_sede_plan_id]\n # \"PlanEstudio\" \n carreras = PlanEstudio.all(\n :fields => [:id, :nombre],\n :institucion_sede_plan => links_carreras.institucion_sede_plan\n )\n\n data[:planes_estudiados] = []\n links_carreras.each do |item|\n # \"PlanEstudio\"\n carrera = carreras.select{ |carrera| carrera.id == item.institucion_sede_plan.plan_estudio_id }.first\n\n data[:planes_estudiados] << {\n :alumno_plan_estudio_id => item.id,\n :alumno_plan_estudio => item,\n :plan_estudio => carrera\n }\n end\n\n data[:planes_estudiados] = data[:planes_estudiados].sort_by{|e| e[:created_at]}.reverse\n\n # Los datos del plan seleccionado\n if not plan_consultado_id.nil?\n plan_consultado = AlumnoPlanEstudio.get plan_consultado_id\n else\n plan_consultado = AlumnoPlanEstudio.get data[:planes_estudiados][0][:alumno_plan_estudio_id]\n end\n\n data[:plan_consultado] = {}\n data[:plan_consultado][:inscripcion] = plan_consultado\n data[:plan_consultado][:institucion_sede] = plan_consultado.institucion_sede\n data[:plan_consultado][:institucion_sede_plan] = plan_consultado.institucion_sede_plan\n\n data[:plan_consultado][:nombre] = data[:planes_estudiados].select{ |plan| plan[:alumno_plan_estudio_id] == plan_consultado.id }.first[:plan_estudio].nombre\n data[:plan_consultado][:id] = data[:planes_estudiados].select{ |plan| plan[:alumno_plan_estudio_id] == plan_consultado.id }.first[:plan_estudio].id\n return data\n end",
"title": ""
},
{
"docid": "422d918b2c8aedd6578a0dc9d5650d9e",
"score": "0.5844927",
"text": "def estados\n\t\tdevuelto = Array.new\n\t\t@renglones_reporte.each do |renglon|\n\t\t\tdevuelto << renglon.estado\n\t\tend\n\t\tdevuelto\n\tend",
"title": ""
},
{
"docid": "f1ff72554fef655c7a1c3a2f55e04ea0",
"score": "0.5786065",
"text": "def mapa\n @info_polens = InfoPolen.collection.aggregate(\n { \"$project\" => { \"estaciones_old\" => \"$ESTACIONES\", \"coordenadas_old\" => \"$COORD\", \"fecha_old\" => \"$FECHA\" } },\n { \"$sort\" => {\"fecha_old\" => 1} },\n { \"$group\" => { \"_id\" => \"$estaciones_old\" , \"coordenadas\" => { \"$last\" => \"$coordenadas_old\" }, \"fecha\" => { \"$last\" => \"$fecha_old\" } } },\n { \"$sort\" => {\"_id\" => 1} }\n )\n\n respond_to do |format|\n format.html #{ redirect_to info_polens_url }\n format.json { render json: @info_polens }\n end\n end",
"title": ""
},
{
"docid": "f04c24dc1ff5d0542470ee2799d5b50f",
"score": "0.57006127",
"text": "def detallepolen\n\n param_polen = params[:polen]\n\n @info_polens = InfoPolen.collection.aggregate(\n { \"$match\" => { \"TIPOS_POLINICOS\" => param_polen} },\n { \"$project\" => { \"estaciones_old\" => \"$ESTACIONES\", \"tipos_polinicos_old\" => \"$TIPOS_POLINICOS\", \"fecha_old\" => \"$FECHA\", \"precedentes_old\" => \"$PRECEDENTES\", \"prevision_old\" => \"$PREVISION\" } },\n { \"$sort\" => {\"fecha_old\" => 1} },\n { \"$group\" => { \"_id\" => \"$estaciones_old\", \"fecha\" => { \"$last\" => \"$fecha_old\" }, \"precedentes\" => { \"$last\" => \"$precedentes_old\" }, \"prevision\" => { \"$last\" => \"$prevision_old\" } } },\n { \"$sort\" => {\"_id\" => 1} }\n )\n\n respond_to do |format|\n format.html #{ redirect_to info_polens_url }\n format.json { render json: @info_polens }\n end\n end",
"title": ""
},
{
"docid": "a145a8bc005b102117167df5bb6c9019",
"score": "0.5644522",
"text": "def show \n est = @establecimiento\n respond_to do |format|\n format.html\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n render :json => {:nombre => @establecimiento.nombre, direccion: @establecimiento.direccion, :latitud => @establecimiento.latitud,\n :longitud => @establecimiento.longitud, :descripcion => @establecimiento.descripcion, :imagen => @establecimiento.foto.url(:small),\n :comentarios => @establecimiento.EstComentarios.map { |comentario| { :descripcion => comentario.descripcion, :usuario => comentario.usuario.nombre } } } \n\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n }\n end\n #No tiene restricciones, queda abierto para el API\n end",
"title": ""
},
{
"docid": "f6e8a14db83e4a274ebe6947df05ba80",
"score": "0.5617603",
"text": "def estudiantes\n\t\t@seccion = \"Estudiantes\"\n @titulo = \"Estudiantes\"\n\t\tif params[:orden]\n\t\t\t@orden = params[:orden]\n\t\telse\n\t\t\t@orden = \"Cédula\"\n\t\tend\n\n #Guardo todos los estudiantes\n if Estudiante.all().size > 0\n case @orden\n \twhen \"Cédula\"\n \t\t@usuarios = Usuario.order('cedula').where(:id => Estudiante.all)\n \twhen \"Nombre\"\n \t\t@usuarios = Usuario.order('nombre').where(:id => Estudiante.all)\n \twhen \"Apellido\"\n \t\t@usuarios = Usuario.order('apellido').where(:id => Estudiante.all)\n \twhen \"Correo\"\n \t\t@usuarios = Usuario.order('correo').where(:id => Estudiante.all)\n \tend\n end\n\n\t\t@categorias = ['Cédula', 'Nombre', 'Apellido', 'Correo'] #Este es el orden que se mostrará en el select de la vista\n\n\t\t@estudiante_datos = [] #En este arreglo se guardan los pares \"Cedula - Nombre Apellido\" de cada usuario para mostrar en el campo de busqueda\n\t\tUsuario.order('nombre').where(:id => Estudiante.all).each do |usuario|\n\t\t\t#En este foro se agregan uno a uno los valores de cada estudiante al arreglo de la manera indicada arriba\n\t\t\t@estudiante_datos << usuario.cedula.to_s + \" - \" + usuario.nombre_y_apellido.to_s\n\t\tend\n\tend",
"title": ""
},
{
"docid": "77f22cb5d0ff1d3d6d5a701ee0b87cfa",
"score": "0.55915415",
"text": "def show\n update_datetime_of_query\n @date_in_question = datetime_of_query.to_date\n\n beginning = datetime_of_query.beginning_of_day\n\n @station = Station.find(params[:id])\n @clockwise_travels = @station.departures.includes(:train).\n where(:depart_at => beginning...beginning+1).\n where('trains.clockwise' => true).order('depart_at')\n\n @counterclockwise_travels = @station.departures.includes(:train).\n where(:depart_at => beginning...beginning+1).\n where('trains.clockwise' => false).order('depart_at')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @station }\n end\n end",
"title": ""
},
{
"docid": "0de35831f7d677c5b200daa818ca23f9",
"score": "0.55672574",
"text": "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"title": ""
},
{
"docid": "7be8ed99753ad53b02620e852f15f483",
"score": "0.55650777",
"text": "def byGeoPosition()\n \n days = Array.new\n \n url = \"http://servicos.cptec.inpe.br/XML/cidade/7dias/#{@lat}/#{@long}/previsaoLatLon.xml\"\n \n loadDays(url,days,7)\n \n days\n \n end",
"title": ""
},
{
"docid": "4eddaae06eb3ea49cdb139c0ac288aff",
"score": "0.5557277",
"text": "def index\n @plan_quirurgicos = PlanQuirurgico.where(:estatus => \"En Proceso\")\n \n end",
"title": ""
},
{
"docid": "a09300874cf345295548b3e7ce79c16c",
"score": "0.5507801",
"text": "def lista_estoque()\n @client.get(Route.new([ROTA_DID_ESTOQUE]))\n end",
"title": ""
},
{
"docid": "e79b4b88bba0e7805b64353647ca922f",
"score": "0.548253",
"text": "def show\n @local_deportivo = LocalDeportivo.find(params[:id], :conditions=> \"estado = 'C' OR estado is NULL\")\n \n @espacio_deportivos = @local_deportivo.espacio_deportivos.find(:all)\n \n \n respond_to do |format|\n format.html \n format.json { render json: {:espacio_deportivos =>@espacio_deportivos, :local_deportivo => @local_deportivo }}\n end\n \n end",
"title": ""
},
{
"docid": "a098c9bba07889773ba1fc012b8be99e",
"score": "0.544745",
"text": "def index\n if params['query'].present?\n if params['query'].start_with?('ASIGNADA')\n @ordenes_servicios = OrdenesServicio.where(\"OS_ESTADO LIKE ?\",\"ASIGNADA%\")\n else\n @ordenes_servicios = OrdenesServicio.where(OS_ESTADO:params['query'])\n end\n else\n @ordenes_servicios = OrdenesServicio.where(\"OS_ESTADO = ? OR OS_ESTADO = ? OR OS_ESTADO LIKE ?\",\"ASIGNACION PENDIENTE\",\"TRASLADO\",\"ASIGNADA%\")\n end\n # Grua.find(ordenes_servicio.PKGRUA) rescue nil).nil?\n @list_hash = []\n if @ordenes_servicios.present?\n @ordenes_servicios.select(:PKGRUA,:OS_ESTADO).distinct.each do |ordenes_servicio|\n if ordenes_servicio.OS_ESTADO != \"CANCELADA\" and ordenes_servicio.OS_ESTADO != \"PROGRAMADA\"\n @data_hash = {}\n @data_hash['grua'] = ordenes_servicio.PKGRUA\n @data_hash['status'] = ordenes_servicio.OS_ESTADO\n count = @ordenes_servicios.where(OS_ESTADO:ordenes_servicio.OS_ESTADO,PKGRUA:ordenes_servicio.PKGRUA).count\n if count==0\n @data_hash['orden'] = 'N/A'\n else\n @data_hash['orden'] = count\n end\n @list_hash.append(@data_hash)\n end\n end\n\n end\n @ordenes_servicios1 = (map_data_for_order_origin(@ordenes_servicios).merge(map_data_for_order_destination(@ordenes_servicios)).merge(order_truck_location(@ordenes_servicios))).to_json\n\n end",
"title": ""
},
{
"docid": "a8ef86f6a6dbd63e7900458052193460",
"score": "0.54339325",
"text": "def show\n @analisis = Am.where(paciente_id: @paciente.id).order('fecha DESC')\n end",
"title": ""
},
{
"docid": "e2844a30a547a7dfa2c3eba708f1cdb1",
"score": "0.54060096",
"text": "def get_around_estates\n\n\t\t# center_x = 121.7155930000\n\t\t# center_y = 25.1215410000\n\t\t# delta_x = 0.00772495\n\t\t# delta_y = 0.01102129\n\n\t\tcenter_x = params[:center_x].to_f\n \tcenter_y = params[:center_y].to_f\n \tdelta_x = params[:delta_x].to_f\n \tdelta_y = params[:delta_y].to_f\n\n\n \tcritera = \"x_long IS NOT NULL and y_lat IS NOT NULL\"\n \tborder = \"and x_long > #{center_x - delta_x} and x_long < #{center_x + delta_x} and y_lat > #{center_y - delta_y} and y_lat < #{center_y + delta_y}\" \n\n \titems = Realestate.select(\"id, estate_group, x_long, y_lat\").where(\"#{critera} #{border}\").paginate(:page => 1, :per_page => 10)\n\n \trender :json => items\n\n\tend",
"title": ""
},
{
"docid": "39690df3342c14e5fa9dcf2d87653ab1",
"score": "0.5402161",
"text": "def index\n @estadia = Estadia.all.order(updated_at: :desc)\n end",
"title": ""
},
{
"docid": "327165cd7a55ae02dd65f76a1f070571",
"score": "0.53908175",
"text": "def index\n @datos_estudiantes = DatosEstudiante.all\n end",
"title": ""
},
{
"docid": "caefe52a6acd1c877b3901d7049bedc8",
"score": "0.5388403",
"text": "def estado_mas(id)\n ActiveRecord::Base.connection.select_all(\"(select jd.id,\n ie.name as \\\"old_state\\\",\n iee.name as \\\"new_state\\\",\n j.created_on as \\\"state_date_changed\\\",\n j.journalized_id as \\\"issue_id\\\",\n jd.journal_id as \\\"jdID\\\",\n jd.prop_key as \\\"prop_key\\\",\n (select name from projects where id=(select project_id from issues where id=#{id})) as \\\"nombre_proyecto\\\",\n(select u.firstname || ' ' || u.lastname from users u where cast(id as char(4))=(select value from journal_details where journal_id=(select max(journal_id) from journal_details where journal_id<jd.journal_id and prop_key='assigned_to_id' and journal_id in(select id from journals where journalized_id=#{id}) order by 1) and prop_key='assigned_to_id')) as \\\"asignado\\\",\n (select created_on from journals where id=(select max(journal_id) from journal_details where journal_id in(select id from journals where journalized_id=#{id}) and (prop_key='status_id' or prop_key='assigned_to_id') and journal_id<jd.journal_id)) as \\\"fecha_inicio\\\"\nfrom journal_details jd,\n issue_statuses ie,\n issue_statuses iee,\n journals j\nwhere jd.prop_key='status_id' and\n jd.old_value = CAST(ie.id AS CHAR(4)) and\n jd.value = CAST(iee.id AS CHAR(4)) and\n jd.journal_id=j.id and\n jd.journal_id in (select journal_id from journal_details where journal_id in (select id from journals where journalized_id=#{id}) and prop_key='status_id' and journal_id not in (select journal_id from journal_details where journal_id in (select id from journals where journalized_id=#{id}) and prop_key='assigned_to_id' ))\norder by 1)\")\n end",
"title": ""
},
{
"docid": "4c84b156f9649a303cb6509168922c8d",
"score": "0.5382024",
"text": "def index\n @establecimientos = Establecimiento.all\n respond_to do |format|\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n\n ests = @establecimientos.map { |establecimiento| { :nombre_establecimiento => establecimiento.nombre, :id => establecimiento.id, \n :descripcion => establecimiento.descripcion, :longitud => establecimiento.longitud,\n :latitud => establecimiento.latitud, :direccion => establecimiento.direccion, :imagen => establecimiento.foto.url(:small),\n :eventos => establecimiento.eventos.map { |evento| { :nombre => evento.nombre } } } } \n render json: ests\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n\n }\n format.html { redirect_to :controller=>'login', :action=>'login' } #solo el app movil puede revisar toda la lista de establecimientos.\n end\n end",
"title": ""
},
{
"docid": "79be13fcd5b23ac0cd517bff403c296e",
"score": "0.5369909",
"text": "def InfoPlanPaciente\n \tid = params[:id]\n @plan_paciente = TipoPlan.find_by_sql(\"select descripcion FROM tipo_plans where plan_paciente_id = #{id} and tipo = 'Paciente'\")\n render json: @plan_paciente\n end",
"title": ""
},
{
"docid": "01942cb005404554c06354388982679a",
"score": "0.53379583",
"text": "def query(fecha = \"> \" + (Time.now - 30.days).to_date.to_s)\n case self.indicador.idindicadores\n when 1..2\n minimizar_servicios_basicos(fecha)\n when 3..4\n minimizar_deuda_inmuebles_morosos(fecha)\n when 5..6\n maximizar_ingresos_alquiler_areas_comunes(fecha)\n when 7..8\n supervisar_saldo_fondo_trabajo\n when 9..10\n maximizar_multas_adjudicadas_inmuebles(fecha)\n when 11..12\n disminuir_numero_reclamos_y_sugerencias\n when 13..14\n supervision_fondo_reserva\n when 15\n minimizar_gastos_servicios_basicos_comunes(fecha)\n when 16\n disminuir_gastos_extraordinarios(fecha)\n when 17\n minimizar_cuota_condominio(fecha)\n when 18\n maximizar_condominios_asociados\n end\n end",
"title": ""
},
{
"docid": "e578e4cc9844fd1e57a8d1b0995e75da",
"score": "0.5316412",
"text": "def show\n @objetivos = Objetivo.select(\"id\", \"nombre\",\"descripcion\").where(:mision_id => params[:id])\n @estrellas = Estrella.select(\"idobjetivo_id\", \"idusuario_id\", \"est1\", \"est2\", \"est3\").where(idusuario_id: current_usuario.id)\n #Para optimizar se deberá agregar un campo de idmision y requerirlo en la misma consulta de la línea anterior, para disminuir el tamaño del array\n end",
"title": ""
},
{
"docid": "fa4b6185eeb695d468051244baca6199",
"score": "0.53021014",
"text": "def show_name_state\n @estados = Estado.order(:sigla)\n end",
"title": ""
},
{
"docid": "a471f3a72166a3a25cdc22d52ae09997",
"score": "0.5298344",
"text": "def index\n @estacionamientos = Estacionamiento.all\n end",
"title": ""
},
{
"docid": "418dff8aa780b48a5af92c2bec0ccb16",
"score": "0.5296336",
"text": "def show\n\n @evento = Evento.find(params[:id])\n @comentarios = Comentario.where(:comentavel_id => @evento.id, :comentavel_type => \"Evento\").order('created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evento }\n end\n end",
"title": ""
},
{
"docid": "e80c74f0a74a346229329d43ff83d530",
"score": "0.5294571",
"text": "def display\n @reservas = Reserva.order(fecha_inicio_estadia: :desc)\n render json: @reservas, include: [:cliente, :habitacion]\n end",
"title": ""
},
{
"docid": "d964f4fa18aa5363d56106d38e611f8a",
"score": "0.52785397",
"text": "def index\r\n# @asistencias = Asistencia.all\r\n seccion = params[:seccion_id]\r\n if params[:seccion_id].nil?\r\n fecha = Date.current\r\n else\r\n fecha = params[:fecha].to_date\r\n end\r\n \r\n @asistencias = Asistencia.por_seccion_fecha(anio_escolar.id, seccion, fecha).salida\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @asistencias }\r\n end\r\n end",
"title": ""
},
{
"docid": "ef8eab9b9ae0d77934927b19bc1bed76",
"score": "0.5273607",
"text": "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end",
"title": ""
},
{
"docid": "f48a4b584355050a99f074b727e89b4f",
"score": "0.525798",
"text": "def get_details\n theSelection = \"sel=Number\" \n @MAP.each do |k, v|\n theSelection << \",\" << v\n end \n \n uri=\"#{$V1HOST['base_uri']}/rest-1.v1/Data/Defect?#{theSelection}&where=Number\"\n details = self.class.get(\"#{uri}=\\'#{@story}\\'\", :verify => false)\n return details\n end",
"title": ""
},
{
"docid": "2941ce3143245da59efa1e7227831a7d",
"score": "0.525464",
"text": "def index\n @estacionamientos = Estacionamiento.all\n\n @json = Estacionamiento.all.to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @estacionamientos }\n end\n end",
"title": ""
},
{
"docid": "382be6c7d78604b9a9923418e2865757",
"score": "0.5249986",
"text": "def geoportal\n if p = @especie.proveedor\n if p.snib_id.present? && p.snib_reino.present?\n # Catch the response\n begin\n response = RestClient.get \"#{CONFIG.geoportal_url}&rd=#{p.snib_reino}&id=#{p.snib_id}\", :timeout => 10, :open_timeout => 10\n render json: [] unless response.present?\n rescue => e\n render json: []\n end\n\n render json: response\n\n else\n render json: []\n end\n else\n render json: []\n end\n\n end",
"title": ""
},
{
"docid": "0a4a26a6dbfe1fc4082884ce97ea7881",
"score": "0.52361554",
"text": "def especies\n especies_por_region\n return unless resp[:estatus]\n especies_filtros\n especies_por_pagina\n asocia_informacion_taxon\n\n self.resp[:taxones] = taxones\n self.resp[:totales] = totales\n self.resp[:num_ejemplares] = num_ejemplares\n self.resp[:resultados] = nil\n\n # Para desplegar las flechas de siguiente o anterior\n if totales > 0\n if totales > ESPECIES_POR_PAGINA*params[:pagina].to_i\n self.resp['carga-siguientes-especies'] = true\n end \n if params[:pagina].to_i > 1\n self.resp['carga-anteriores-especies'] = true\n end \n end\n end",
"title": ""
},
{
"docid": "621caf129221b38ef15d451fc1da01ed",
"score": "0.5235985",
"text": "def resolve\n @query = Alerte.where(statu_id: 1).order(created_at: :desc)\n render layout: 'fylo'\n end",
"title": ""
},
{
"docid": "c25c65825fe0cad82dc268d21b4f2529",
"score": "0.52192795",
"text": "def create\n @estacionamiento = Estacionamiento.new(estacionamiento_params)\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n @serv_adicinales = ServAdicinale.all\n\n respond_to do |format|\n if @estacionamiento.save\n format.html { redirect_to @estacionamiento, notice: 'Estacionamiento was successfully created.' }\n format.json { render :show, status: :created, location: @estacionamiento }\n else\n format.html { render :new }\n format.json { render json: @estacionamiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61b9cda98d7d3df7536660afc7a25f19",
"score": "0.5205093",
"text": "def municipios_por_estado\n resp = {}\n resp[:estatus] = false\n\n if params[:region_id].present?\n resp[:estatus] = true\n parent_id = Estado::CORRESPONDENCIA[params[:region_id].to_i]\n municipios = Municipio.campos_min.where(cve_ent: parent_id)\n resp[:resultados] = municipios.map{|m| {region_id: m.region_id, nombre_region: m.nombre_region}}\n resp[:parent_id] = parent_id\n else\n resp[:msg] = 'El argumento region_id está vacio'\n end\n\n render json: resp\n end",
"title": ""
},
{
"docid": "5da8ee1f16db06e8ffb2b0fb04cf375f",
"score": "0.52037144",
"text": "def query_depts\n { 'respDepartment' => Newspilot.configuration.departments }\n end",
"title": ""
},
{
"docid": "31fa5b9f44f8a083d3d7b4d85cfc48f6",
"score": "0.52022254",
"text": "def data\n @locais.values\n end",
"title": ""
},
{
"docid": "9b43bad7dad2bf3c551092e054cff0fe",
"score": "0.5195661",
"text": "def lastest_promos\n last_time_milliseconds = params[:last_promos_retrieval].to_f\n if (last_time_milliseconds != 0)\n last_time = Time.at(last_time_milliseconds/1000)\n @promos = Promo.where(\"validez >= ? AND updated_at >= ?\", Time.zone.now, last_time).order(\"validez ASC\")\n else\n @promos = Promo.where(\"validez >= ? AND version >= 0\", Time.zone.now).order(\"validez ASC\")\n end\n #Rails.logger.info request.env['PATH_INFO']\n render json: @promos\n end",
"title": ""
},
{
"docid": "ac94d68a833edfbb7e6607aa1d2cb4f5",
"score": "0.5195204",
"text": "def browse_by_space\n #unless params.nil?\n if params[:date].nil?\n @search_by_date = DateTime.now\n else\n if @search_by_date.nil?\n begin\n @search_by_date = DateTime.parse(params[:date][:year] + '-' + params[:date][:month] + '-' + params[:date][:day] + ' ' + params[:date][:hour] + ':' + params[:date][:minute])\n rescue => e\n @search_by_date = DateTime.now\n end\n end\n end\n\n @events = []\n @free_spaces = Espacio.all\n # get_calendar obtiene un calendario para un dia dado. El parametro all hace que no discrimine por materias\n @calendar = get_calendar :date => @search_by_date.to_date, :all => true\n if not params[:espacio].nil?\n @espacio_selected = params[:espacio][:espacio_id]\n end\n @calendar.events.each do |event|\n temp = SimpEvent.new\n temp.starts_at = event.dtstart\n temp.ends_at = event.dtend\n temp.name = event.description # + ' - ' + Espacio.find(:first, :conditions => {:id => event.location.to_i}).codigo\n temp.original_id = event.comment[0].to_i\n temp.location = event.location.to_i\n if not params[:espacio].nil? and params[:espacio][:espacio_id] != 'all'\n @events.push temp if temp.location == params[:espacio][:espacio_id].to_i\n else\n @events.push temp\n end\n @free_spaces.delete(Espacio.find_by_id event.location.to_i) if @search_by_date.strftime('%H%M').to_i.between? event.dtstart.strftime('%H%M').to_i, event.dtend.strftime('%H%M').to_i\n end\n # end\n end",
"title": ""
},
{
"docid": "d4b6f9b0247c193b362877217979d077",
"score": "0.51924753",
"text": "def show\n @servidor = Servidor.find(params[:id])\n @q = @servidor.pontos.ransack(params[:q])\n @q.sorts = 'nome'\n @pontos = @q.result.page params[:page]\n @autenticacoes = @servidor.autenticacoes.order(authdate: :desc).page params[:page]\n end",
"title": ""
},
{
"docid": "bf490a4a99ebb9a5a78a7bd93592f79e",
"score": "0.51921594",
"text": "def query\n opinions = Decidim::Opinions::Opinion.where(component: @components)\n opinions = opinions.where(\"created_at >= ?\", @start_at) if @start_at.present?\n opinions = opinions.where(\"created_at <= ?\", @end_at) if @end_at.present?\n opinions\n end",
"title": ""
},
{
"docid": "02bc99a28537e632eda22c882ac6c681",
"score": "0.5176582",
"text": "def show\n @coleccion = {}\n @coleccion['publicaciones'] = @objeto.publicaciones.page(params[:page]) #.where(estado: @estado)\n end",
"title": ""
},
{
"docid": "02bc99a28537e632eda22c882ac6c681",
"score": "0.5176582",
"text": "def show\n @coleccion = {}\n @coleccion['publicaciones'] = @objeto.publicaciones.page(params[:page]) #.where(estado: @estado)\n end",
"title": ""
},
{
"docid": "b51b3c83e4d279bb900c416223815422",
"score": "0.5173594",
"text": "def index\n @from = \"#{params['from']}\".to_date rescue nil\n @to = \"#{params['to']}\".to_date rescue nil\n @estado = \"#{params['estado']}\"\n\n p \"filtering by from: #{@from} & to: #{@to} & estado: #{@estado}\"\n \n @pedidos = Pedido.all\n @pedidos = @pedidos.where(\"fecha_entrega >= (?)\", @from) if @from\n @pedidos = @pedidos.where(\"fecha_entrega <= (?)\", @to) if @to\n @pedidos = @pedidos.where(\"estado ilike ? \", \"%#{@estado}%\") if @estado\n @pedidos = @pedidos.order(fecha: :desc, id: :desc)\n\n @estados = Pedido.select('distinct lower(estado) estado').map(&:estado)\n @estados = @estados.select{|e| !e.include?('pagado paypal')}\n @estados.push('pagado paypal')\n \n end",
"title": ""
},
{
"docid": "6ac395b7052fbd6f4254edd164930da5",
"score": "0.5170845",
"text": "def vreme\n mesto = request[:mesto]\n \n if mesto.nil? == true|| mesto == \"\"\n return\n end\n #pridobi koordinate in ime\n response = HTTParty.get(\"https://api.openweathermap.org/data/2.5/weather?q=#{mesto}&appid=53887813d2159184f1784360b47a8b39\")\n if response.code != 200\n return\n end\n res = OpenStruct.new(response)\n @name = res.name\n coords = OpenStruct.new(res.coord)\n lat = coords.lat\n lon = coords.lon\n main = OpenStruct.new(res.main)\n @curTemp = tempToCelsius( main.temp)\n \n #Pridobi dnevno napoved iz OpenWeatherAPI iz koordinat\n response = HTTParty.get(\"https://api.openweathermap.org/data/2.5/onecall?lat=#{lat}&lon=#{lon}&appid=53887813d2159184f1784360b47a8b39\")\n res = OpenStruct.new(response)\n current = OpenStruct.new(res.current)\n daily = res.daily\n temp = tempToCelsius(current.temp)\n \n #Seznam Temperatur in za keteri dan \n @tempList = []\n for day in daily do\n d = OpenStruct.new(day)\n tempD = OpenStruct.new(d.temp)\n max = tempD.max\n dt = d.dt\n obj = OpenStruct.new\n obj.day = getDaySlo(dt)\n obj.temperatura = tempToCelsius(max)\n @tempList.push(obj)\n end\n \n \n return \"\"\n end",
"title": ""
},
{
"docid": "4098e0cfdffbb93a1aba4c34a35a01fa",
"score": "0.5156724",
"text": "def index\n all=Sale.where(active:true)\n ventas= resumen all \n\n render json:ventas\n end",
"title": ""
},
{
"docid": "4ad0393caa1103c272a980d4aa5d92fb",
"score": "0.5146201",
"text": "def index\n @calls = Call.where(\"closed = ?\", false).order('created_at DESC').includes(:service)\n @dptos = ActiveRecord::Base.connection.exec_query(\"SELECT * FROM dados_ats.dpto\")\n @servants = ActiveRecord::Base.connection.exec_query(\"SELECT * FROM dados_ats.servant\")\n end",
"title": ""
},
{
"docid": "3c546a6ae59f3091e27531a78e43c879",
"score": "0.5136895",
"text": "def show\n @curso = Curso.find(params[:id])\n @cursos = Curso.all_active\n @sesiones = @curso.sesions.where(:active => true).order(:fecha)\n @formulario_curso = FormularioCurso.new\n @formularios = @curso.formularios\n @alumnos = @curso.alumnos\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curso }\n end\n end",
"title": ""
},
{
"docid": "f0a02fa865c20e66b3a6081dbd065364",
"score": "0.51345855",
"text": "def evaluando_resultados\n screen_name(\"#{@task.class.to_s}/evaluando_resultados\")\n\n @am_result = AmResult.where(\"ot_id = #{@ot.id}\").order(\"run_date DESC\").first\n\n respond_to do |format|\n format.html { render action: \"evaluando_resultados\" }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "281666d2e252be5c3edee593ed59b9ac",
"score": "0.5122909",
"text": "def legacies(vet)\n LegacyAppeal.fetch_appeals_by_file_number(vet.file_number).tap do |las|\n las.map do |l|\n { nod: l.nod_date, soc: l.soc_date, ssoc: l.ssoc_dates,\n vacols_id: l.vacols_id, disposition: l.disposition }\n end\n end\nend",
"title": ""
},
{
"docid": "42a3bf0593e23dbdb4e1f6d01fb1c93a",
"score": "0.5119453",
"text": "def index\n @coordenador_estagios = CoordenadorEstagio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenador_estagios }\n end\n end",
"title": ""
},
{
"docid": "e1690150e5ad20334f0d7e49756dbb60",
"score": "0.51184064",
"text": "def index\n @estacionamientos = Estacionamiento.all\n @serv_adicinales = ServAdicinale.all\n end",
"title": ""
},
{
"docid": "2fed0c86aa26428fa4d5b75d090bb3f6",
"score": "0.51174194",
"text": "def index\n \n lat = params[:latitude].to_f\n long = params[:longitude].to_f\n delta_lat = params[:delta_latitude].to_f + DIST_LAT\n delta_long = params[:delta_longitude].to_f + DIST_LONG\n \n if !lat.zero? || !long.zero?\n @eventos = Evento.where({:ativo => true, :latitude => (lat - delta_lat)..(lat + delta_lat), :longitude => (long - delta_long)..(long + delta_long)}) \n else\n @eventos = Evento.all\n end\n \n @eventos.each do |evento|\n trocar_foto_por_url evento\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @eventos }\n format.json { render :json => @eventos, :except => [:data_hora, :created_at, :updated_at, :dispositivo_id, :ativo] }\n end\n end",
"title": ""
},
{
"docid": "6a376268d69c9726499918a97d5e0d4e",
"score": "0.5102153",
"text": "def index\n at = params[:atual]\n if session[:usuario_tipo] == \"Diretor\"\n @lancamentos = Lancamento.where(\"created_at >= ?\" , '2017-01-01').includes(:conta).includes(:fornecedor).includes(:item_de_despesa).includes(:item_de_receita).includes(:tipo_de_compra).includes(:transferencia).order(\"id desc\")\n elsif at == \"Sim\"\n @lancamentos = Lancamento.where(\"year(created_at) = ?\", Date.today.year).includes(:conta).includes(:fornecedor).includes(:item_de_despesa).includes(:item_de_receita).includes(:tipo_de_compra).includes(:transferencia).order(\"id desc\")\n else\n @lancamentos = Lancamento.includes(:conta).includes(:fornecedor).includes(:item_de_despesa).includes(:item_de_receita).includes(:tipo_de_compra).includes(:transferencia).order(\"id desc\")\n end\n end",
"title": ""
},
{
"docid": "b3e79962b3570b11990b324f3893cc98",
"score": "0.5093001",
"text": "def index\n @venta = Venta.order(fecha_hora: :desc).where('date(fecha_hora) = ?', Time.now.strftime(\"%Y-%m-%d\"))\n end",
"title": ""
},
{
"docid": "c50c7efd4036f965fe4aa93c3d1a8b04",
"score": "0.5091436",
"text": "def index\n residencial = current_user.apartamento.residencial\n #@eventos = Evento.joins(:user => [{:apartamento => :residencial}])\n #.where(:residenciais => {:id => residencial.id})\n #.order(\"created_at DESC\")\n\n @eventos = Evento\n .where(:residencial_id => residencial.id)\n .order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eventos }\n end\n end",
"title": ""
},
{
"docid": "4967054373e5f1f611c07618a00269ad",
"score": "0.50909925",
"text": "def observations(stations, lang = 'is', time = '1h', anytime = '0')\n Apis.client.get(\"/weather/forecasts/#{lang}\" \\\n \"/?stations=#{stations.join(',')}&time=#{time}&anytime=#{anytime}\")\n end",
"title": ""
},
{
"docid": "b4c935c8452a01c8d1a575d11e10a589",
"score": "0.50797176",
"text": "def index\n @estadopros = Estadopro.all\n end",
"title": ""
},
{
"docid": "29887137733b145a2c1d4427e9d2ddee",
"score": "0.50784576",
"text": "def tipospolen\n\n @info_polens = InfoPolen.collection.aggregate(\n { \"$group\" => { \"_id\" => \"$TIPOS_POLINICOS\" } },\n { \"$sort\" => {\"_id\" => 1} }\n )\n\n respond_to do |format|\n format.html #{ redirect_to info_polens_url }\n format.json { render json: @info_polens }\n end\n end",
"title": ""
},
{
"docid": "e734e5c40c99694a41208f06a32feada",
"score": "0.50750583",
"text": "def index\n duration_hash = {}\n \n sub_sub_category = OneclickRefernet::SubSubCategory.find_by(code: params[:sub_sub_category])\n sub_sub_category_services = sub_sub_category.try(:services) || []\n\n # Base service queries on a collection of UNIQUE services\n services = OneclickRefernet::Service.confirmed.where(id: sub_sub_category_services.pluck(:id).uniq)\n \n lat, lng = params[:lat], params[:lng]\n meters = params[:meters].to_f\n limit = params[:limit] || 10\n \n if lat && lng\n meters = meters > 0.0 ? meters : (30 * 1609.34) # Default to 30 miles\n \n services = services.closest(lat, lng)\n .within_x_meters(lat, lng, meters)\n .limit(limit) \n duration_hash = build_duration_hash(params, services)\n else\n services = services.limit(limit)\n end\n \n render json: services.map { |svc| service_hash(svc, duration_hash) }\n\n end",
"title": ""
},
{
"docid": "f5f83b5b620f8610ad2eaeabe5222c57",
"score": "0.50735515",
"text": "def query(cal_url, conditions = nil)\r\n logger.info(\"-- query st --\") if logger\r\n auth unless @auth\r\n uri = URI.parse(cal_url)\r\n uri.query = conditions.map do |key, val|\r\n \"#{key}=#{URI.escape(val.kind_of?(Time) ? val.getutc.iso8601 : val.to_s)}\"\r\n end.join(\"&\") unless conditions.nil?\r\n res = do_get(uri, {})\r\n logger.info(\"-- query en (#{res.message}) --\") if logger\r\n res\r\n end",
"title": ""
},
{
"docid": "3ff6cc6b7cc4c80a8a1eb94644d9d88d",
"score": "0.50691724",
"text": "def index\n @estados = Basico::Estado.search(params[:page], params[:search], params[:sort])\n\n end",
"title": ""
},
{
"docid": "f835a1b24d3cdf24bead7c61840afbc7",
"score": "0.5066131",
"text": "def index\n @nav=true\n @etat_depenses = EtatDepense.all.order('date DESC')\n @etat_depenses_solideo = EtatDepense.where(\"beneficiaire =?\", \"solideo\")\n @etat_depenses_cojo = EtatDepense.where(\"beneficiaire =?\", \"cojo\")\n @etat_depenses_heritage = EtatDepense.where(\"beneficiaire =?\", \"heritage\")\n @etat_depenses_hauteperformance = EtatDepense.where(\"beneficiaire =?\", \"hauteperformance\")\n \n end",
"title": ""
},
{
"docid": "65395f1e3357f36b5cac2a1e1357b6a2",
"score": "0.5065952",
"text": "def index\n # Si se filtró, lo que pidieron, si no lo que está\n # en la sesión, y si no el primer estado no finalizado\n unless params[:estado_id].nil?\n session[:filtro_estado_id] = params[:estado_id]\n else\n session[:filtro_estado_id] ||= Estado.where(\"nombre <> 'Finalizado'\").first.id\n end\n \n @estado_id = session[:filtro_estado_id]\n \n\t\tif @estado_id.nil? or @estado_id == \"\"\n\t\t\t@requerimientos = Requerimiento.joined.order(sort_column + ' ' + sort_direction)\n\t\telsif params['texto_buscado'].nil?\n\t\t\t@requerimientos = Requerimiento.joined.order(sort_column + ' ' + sort_direction).where(:estado_id => @estado_id)\n\t\telse\n\t\t\twhere = \"estado_id = :estado_id and (descripcion like '%#{params['texto_buscado']}%')\"\n\t\t\t@requerimientos = Requerimiento.joined.order(sort_column + ' ' + sort_direction).where(where, estado_id: @estado_id, texto_buscado: params['texto_buscado'])\n end\n \n @estados = [Estado.new] \n @estados.concat Estado.order(:nombre)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requerimientos }\n end\n end",
"title": ""
},
{
"docid": "b4ca649925b0bfb35a4d1971e343095d",
"score": "0.5060914",
"text": "def getFilterEmpresa\n empresa = Enterprise.find(params[:idEmp].to_i)\n content = []\n # ES: El primer registro valida si la empresa tiene logo o no:\n # EN: The first record validates if the enterprise has logo or not:\n if empresa.logo.blank?\n content[0] = 'NO_LOGO'\n else\n content[0] = 'SI_LOGO'\n end\n\n\n # ES: Mapas de decision:\n # EN: Decision Maps:\n mapasFormateados = view_context.mapasListDecisionMaps(empresa.id)\n # ES: Agrega los mapas formateados:\n # EN: Add the formated maps\n content.concat(mapasFormateados)\n\n # ES: Escenarios de Evaluacion de Riesgos:\n # EN: Risk Assessment Scenarios:\n riesgosFormateados = view_context.escenariosListRiskEscenarios(empresa.id)\n # ES: Agrega los escenarios formateados:\n # EN: Add the formated scenarios:\n content.concat(riesgosFormateados)\n\n # ES: Escenarios de Evaluacion de Objetivos:\n # EN: Goal Assessment Scenarios:\n goalsFormateados = view_context.escenariosListGoalEscenarios(empresa.id)\n # ES: Agrega los escenarios formateados:\n # EN: Add the formated scenarios:\n content.concat(goalsFormateados)\n\n # ES: Escenarios de Priorizacion:\n # EN: Prioritization Scenarios:\n priorsFormateados = view_context.escenariosListPriorEscenarios(empresa.id)\n # ES: Agrega los escenarios formateados:\n # EN: Add the formated scenarios:\n content.concat(priorsFormateados)\n\n respond_to do |format|\n format.json {render json: content}\n end\n \n end",
"title": ""
},
{
"docid": "5a1bf8005fc60da3c192de043228a2da",
"score": "0.5055941",
"text": "def index\n @details = Detail.all(:order => 'sector_id, sector_analysis_title, DATE(updated_at)')\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @details }\n end\n end",
"title": ""
},
{
"docid": "48bc322d909a453d0666f16e187a9f82",
"score": "0.5054483",
"text": "def index\n @estadoprocesos = Estadoproceso.all\n end",
"title": ""
},
{
"docid": "cc9e82559bebc955c5af8abd56761c87",
"score": "0.505377",
"text": "def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend",
"title": ""
},
{
"docid": "cb36a6014613e3a9111268384703f00b",
"score": "0.50508636",
"text": "def ind_estud\n #@periodos = Periodo.find(:all)\n end",
"title": ""
},
{
"docid": "9ad287e88f031e4e5ff06ca1a0689836",
"score": "0.5047061",
"text": "def get\n @cine = Cine.find(params[:cine_id], :select => [\"nombre\",\"id\",\"direccion\",\"localidad\"])\n render :json => [ @cine, :peliculas => @cine.peliculas.select('titulo,horas,pelicula_id') ]\n end",
"title": ""
},
{
"docid": "3b85e5d6f5fb51fd50ae8b01085482fe",
"score": "0.5046963",
"text": "def index\n @ordens = Orden.where(:estado => \"Pendiente por Recolectar\").order(\"created_at DESC\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ordens }\n end\n end",
"title": ""
},
{
"docid": "98e8d59b4946802dbe103b81a14dbd62",
"score": "0.50452137",
"text": "def query_airport\n res = {\n :success => false,\n :msg => '',\n :data => []\n }\n q = params[\"query\"]\n select = \"#{Airport.table_name}.id AS id, #{Airport.table_name}.iso AS iso, #{City.table_name}.name AS cityname\"\n conditions = \"#{Airport.table_name}.iso ~* '^#{q}'\"\n \n res[:data] = Airport.find(\n :all,\n :select => select,\n :conditions => conditions,\n :order => \"#{Airport.table_name}.iso\" \n ).collect {\n |a| [a.id, a.iso]\n }\n res[:success] = true\n render :json => res.to_json, :layout => false\n\n end",
"title": ""
},
{
"docid": "9c164897cf71698fb98e835dd5ed7e10",
"score": "0.50423414",
"text": "def show\n @requerimiento ||= Requerimiento.where(:numero => params[:id]).first\n @areas = Area.where(\" nombre like '%DIT%' \")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @requerimiento }\n end\n end",
"title": ""
},
{
"docid": "359e0762732d8d57b6fa1ae4558d2c0d",
"score": "0.5038994",
"text": "def data geog_code, geog, stat='.toTable()'\n @json_stats ||={}\n @json_stats[geog_code + geog] ||= OnsOpenApi::request(\"dataset/#{id}\",\n context: context_name,\n geog: geog,\n \"dm/#{geog}\" => geog_code,\n totals: 'false',\n jsontype: 'json-stat')\n\n raw_json_stat = @json_stats[geog_code + geog].gsub(\"\\n\", ' ').gsub(\"'\", \"\").squeeze(' ')\n\n if raw_json_stat.include?('ns1faultstring')\n raise \"ONS Exception: #{raw_json_stat.gsub(/(<.?ns1XMLFault>)|(<.?ns1faultstring>)/,'')}\"\n elsif raw_json_stat.include?('errorMessage')\n raise \"ONS Error: #{raw_json_stat}\"\n end\n\n begin\n table = js_context.eval( %Q| JSONstat( JSON.parse(' #{raw_json_stat} ') ).Dataset(0)#{stat} | )\n rescue Encoding::UndefinedConversionError => e\n if e.to_s[/ASCII-8BIT to UTF-8/]\n raw_json_stat = raw_json_stat.force_encoding('ASCII-8BIT').encode('UTF-8', :invalid => :replace, :undef => :replace, :replace => '?')\n table = js_context.eval( %Q| JSONstat( JSON.parse(' #{raw_json_stat} ') ).Dataset(0)#{stat} | )\n else\n raise \"#{e.to_s}: #{raw_json_stat}\"\n end\n rescue ExecJS::RuntimeError, ExecJS::ProgramError => e\n raise \"#{e.to_s}: #{raw_json_stat}\"\n end\n\n if table.is_a?(Array) && (index = table[1].index('Segment_1'))\n table.each {|row| row.delete_at(index)}\n end\n table\n end",
"title": ""
},
{
"docid": "50f004abe06fe9590f83172afdecbe07",
"score": "0.5038232",
"text": "def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end",
"title": ""
},
{
"docid": "718a481985f9f76b96daaad30f5a7b72",
"score": "0.5036562",
"text": "def InfoProducto\n \tid = params[:id]\n @productos = Producto.find_by_sql(\"select distinct productos.nombre as nombreProducto, productos.id as idProducto, productos.oferta, productos.compra, laboratorios.nombre as nombreLaboratorio, presentacions.descripcion, plan_pacientes.id, \n\t\tplan_pacientes.nombre as nombrePlanPaciente, plan_pacientes.id as idPlanPaciente,\n\t\tsustancia.descripcion as descripcionSustancia\n\t\t from productos, presentacions, plan_pacientes, laboratorios, sustancia where \n\t\tproductos.presentacion_id = presentacions.id and\n\t\tproductos.laboratorio_id = laboratorios.id and\n\t\tproductos.sustancium_id = sustancia.id and\n\t\tproductos.id = #{id} LIMIT 1\")\n render json: @productos\n end",
"title": ""
},
{
"docid": "c384e014f257a65267868ab50e6fe4fa",
"score": "0.5032665",
"text": "def resultados_basica\n paginado_y_offset\n estatus\n solo_publicos\n solo_categoria\n\n return unless por_id_o_nombre\n\n conteo_por_categoria_taxonomica\n dame_totales\n resultados\n\n resultados_fuzzy_match if totales == 0 && pagina == 1 && params[:solo_categoria].blank?\n end",
"title": ""
},
{
"docid": "d0cc51f6dc77461e4eee5d7e44f9faa3",
"score": "0.50253314",
"text": "def reporte entrena, inicio, final\n entrenador = User.find(entrena)\n equipos = entrenador.equipos\n\n @events = []\n equipos.each do |equipo|\n\n equipo.eventos.each do |event|\n\n if (event.fecha >= inicio) && (event.fecha <= final)\n @events << event\n end\n\n end\n end\n return @events\n end",
"title": ""
},
{
"docid": "f10080948710d7c7571a9d25bcc70922",
"score": "0.502412",
"text": "def load_all_local_sensors_by_date(start_date, end_date)\n s_date = start_date.to_time.utc\n e_date = end_date.to_time.utc \n names = Sensor.find(:all, \n :conditions=>[\"created_at between ? and ?\", s_date, e_date], \n :group=>\"name\");\n @resultset = {}\n names.each do |s|\n @resultset[s.name] = Sensor.find(:all, \n :conditions=>[\"created_at between ? and ? AND name=?\", s_date, e_date, s.name], \n :order=>\"created_at\");\n end\n end",
"title": ""
},
{
"docid": "1329412e3b006dee05c918b334830ae1",
"score": "0.5023975",
"text": "def index\n @educacao = Educacao.new\n @educacaos = Educacao.all\n @modal = true\n\n factory = RGeo::GeoJSON::EntityFactory.instance\n features = []\n @educacaos.each do |edu|\n feature = factory.feature(edu.the_geom, nil, {id: edu.id, nome: edu.nome, email: edu.email, contato: edu.contato})\n features << feature\n end\n\n json_edu = RGeo::GeoJSON.encode factory.feature_collection(features)\n\n respond_to do |format|\n format.html\n format.json { render :json => json_edu }\n format.xml { render :xml => @educacaos }\n end\n end",
"title": ""
},
{
"docid": "e524f73e751ff9f466a6d20abd6f61eb",
"score": "0.5023651",
"text": "def list_observations # :nologin:\n query = create_query(:Observation, :all, by: :date)\n show_selected_observations(query)\n end",
"title": ""
},
{
"docid": "15b8eaa57cb11c4894f567ccb81c32d5",
"score": "0.50185466",
"text": "def index\n @estado_notificacions = EstadoNotificacion.all\n end",
"title": ""
},
{
"docid": "31b9294c342ba1e422debd8ec4c38785",
"score": "0.5017878",
"text": "def get_data(doc)\n snapshots = doc.xpath(\"//Cube[@time]\")\n snapshots.each do |snapshot|\n date_str = snapshot.attr(\"time\")\n date = Date.parse(date_str)\n last_date_processed(date)\n if (date <= @last_date_processed) || @last_date_processed.nil?\n output = {}\n snapshot.children.each do |rate|\n currency = rate.attr('currency')\n rate = rate.attr('rate')\n output[currency] = rate.to_f\n @context.options[:store][date] = output\n end\n end\n end\n end",
"title": ""
},
{
"docid": "88a3a972997668e6a4cd2d6a05818a19",
"score": "0.5017021",
"text": "def show\n @calls = Call.where(\"technical_id = ? and closed = ?\", @technical.id, true)\n @dptos = ActiveRecord::Base.connection.exec_query(\"SELECT * FROM dados_ats.dpto\")\n end",
"title": ""
},
{
"docid": "c44733c205ad41d5466003afcf53a7fd",
"score": "0.5014929",
"text": "def FarmaciasCercanas\n @farmacias = Farmacium.find_by_sql(\"SELECT id, nombre,latitud, longitud FROM farmacia where correo <> 'ADMIN'\")\n render json: @farmacias\n end",
"title": ""
},
{
"docid": "96bf1b8fe91dc9aaa7e0cad459fec922",
"score": "0.5013432",
"text": "def index\n #@internos = Interno.all\n @internos = Interno.order(\"apellido1\",\"nombre\")\n @todos_interno=@internos\n if(params[\"palabra\"]!=nil && params[\"palabra\"]!='')\n @internos= Interno.where(\"(nombre || ' ' || apellido1 || ' ' || apellido2) =?\", params[:palabra]) \n end\n\n if params[:estado] && params[:estado]!=''\n @internos = Interno.where(\"state=?\", params[:estado])\n end\n end",
"title": ""
},
{
"docid": "9ed4c2467761766a6c472b8a4b8befa2",
"score": "0.5012165",
"text": "def dates\n render json: @standings\n end",
"title": ""
},
{
"docid": "efee641c7aa070ebae6c765f8632f1f9",
"score": "0.50100064",
"text": "def index\n \n @real_estates = RealEstate.all\n filtering_params(params).each do |key, value|\n @real_estates = @real_estates.public_send(key, value) if value.present?\n end\n @real_estates = @real_estates.page(params[:page])\n end",
"title": ""
},
{
"docid": "cbb35ae4fa82ab9bc8b1e972a16d9acf",
"score": "0.5007031",
"text": "def index\n @samples = Sample.all\n # selecionar data de recepcao\n if params[:query].present?\n if params[:query][:start_time_recepcao].present?\n date = params[:query][:start_time_recepcao].to_date\n @samples = @samples.where(\"data_recepcao >= ?\", date)\n end\n if params[:query][:end_time_recepcao].present?\n date = params[:query][:end_time_recepcao].to_date\n @samples = @samples.where(\"data_recepcao <= ?\", date)\n end\n\n # selecionar data de liberacao\n if params[:query][:start_time_liberacao].present?\n date = params[:query][:start_time_liberacao].to_date\n @samples = @samples.where(\"data_liberacao >= ?\", date)\n end\n if params[:query][:end_time_liberacao].present?\n date = params[:query][:end_time_liberacao].to_date\n @samples = @samples.where(\"data_liberacao <= ?\", date)\n end\n\n # Será utilizado para verificar quais tabelas serão mostradas ao usuário parametros tabela samples\n search_fields = {\n status: 'samples',\n programa: 'samples',\n matriz: 'samples',\n area_analitica: 'samples',\n rg: 'rg',\n name: 'client',\n city: 'client',\n state: 'client',\n codigo_rejeicao: 'rejection_reasons'\n }\n search_fields.each do |key, value|\n if value == 'client'\n item = \"client_#{key.to_s}\".to_sym\n else\n item = key\n end\n if params[:query][:end_time_liberacao].present?\n date = params[:query][:end_time_liberacao].to_date\n @samples = @samples.where(\"data_liberacao <= ?\", date)\n end\n end\n\n # Será utilizado para verificar quais tabelas serão mostradas ao usuário parametros tabela samples\n search_fields = {\n status: 'samples',\n programa: 'samples',\n matriz: 'samples',\n area_analitica: 'samples',\n rg: 'rg',\n name: 'client',\n city: 'client',\n state: 'client',\n codigo_rejeicao: 'rejection_reasons'\n }\n search_fields.each do |key, value|\n if value == 'client'\n item = \"client_#{key.to_s}\".to_sym\n else\n item = key\n end\n if params[:query][item].present?\n case value\n when 'rg'\n @samples = @samples.where('rg ILIKE ?', \"%#{params[:query][:rg]}%\")\n when 'samples'\n @samples = @samples.where(key => params[:query][item])\n when 'client'\n @samples = @samples.includes(:client).where(\"clients.#{key.to_s}\".to_sym => params[:query][item])\n when 'rejection_reasons'\n @samples = @samples.includes(:rejection_reasons).where(\"rejection_reasons.codigo\".to_sym => params[:query][:codigo_rejeicao]).references(:rejection_reasons)\n end\n end\n end\n end\n @quantidade = @samples.count\n @samples_export = @samples\n export(@samples_export)\n @samples = @samples.page(params[:page])\n end",
"title": ""
},
{
"docid": "65c1e6bdb9af081f523c9d106f594152",
"score": "0.50066674",
"text": "def query\t\n\t\t if !org.nil?\t\n\t\t\t criteria = Event.includes(host: :org).where(orgs: {id: org.id})\n\t\t\t criteria = criteria.where(hosts: {id: host.id}) if !host.nil?\n\t\t\t events = criteria.order(occurred_at: :desc).take(SHOW_TOP) \n\n\t\t\t render json: events, status: 200\n\t\t else\n\t\t render_error \"Not Authrized to see all events. Required param not found. You sent #{params[:orgname]} and #{params[:hostname]}\", 422\t \n\t\t end\n\t\tend",
"title": ""
},
{
"docid": "b1d153184761d834a845173f0344734a",
"score": "0.5004981",
"text": "def get_festivals() \n #Start from 3 days ago since can be in the middle of a festival\n threeDaysAgo = (Time.now - (3*24*60*60)).strftime('%Y-%m-%d')\n #Find relevant events\n events = Event.where(festival: 1).where('date >= ?', threeDaysAgo).order(:date)\n\n #Make hash of hashes that include all necessary info\n festivalDatesArr = {}\n events.each do |event|\n #Need to account for same name different locations\n name = \"#{event.title} #{event.location}\"\n if festivalDatesArr.has_key?(name)\n festivalDatesArr[name]['dates'].push(event.date) \n else\n festName = \"#{event.title} #{event.location}\"\n festivalDatesArr[festName] = {\n 'dates' => [event.date],\n 'id' => event.id,\n 'title' => event.title,\n 'location' => event.location,\n 'ages' => event.ages,\n 'link' => event.ticketLink,\n 'address' => event.address\n }\n end\n end\n return festivalDatesArr\n end",
"title": ""
},
{
"docid": "85665b261062fa1590acac7805380b7b",
"score": "0.50023574",
"text": "def proximity\r\n \tcurentDate = Time.now\r\n\r\n \t#recherche de tous les calendrier\r\n \tcaldav = Calendrier.where(\"date >= '#{curentDate}'\")\r\n\r\n \t#creation d'un tableau vide\r\n \tmarche = Array.new \r\n \tcaldav.each do |f|\r\n \t\tmarche.push(Calendrier.find(f.id).markets.all)\r\n \tend\r\n \trender json: marche\r\n end",
"title": ""
},
{
"docid": "d0e66ddf65781892eb532a0404982c96",
"score": "0.5000909",
"text": "def index\n @anteproyecto_estudiantes = AnteproyectoEstudiante.all\n end",
"title": ""
},
{
"docid": "f1014b2ff6f62d3f5b8aa842a9d80ecb",
"score": "0.49996307",
"text": "def periode\n @debut = params[:debut]\n @fin = params[:fin]\n @query = Alerte.where(created_at: params[:debut]..params[:fin]).order(created_at: :desc)\n render layout: 'fylo'\n end",
"title": ""
},
{
"docid": "9bbbb2f5a66950af945b5d8ecd7e290d",
"score": "0.49978545",
"text": "def index\n @estates = Estate.all\n @json = @estates.to_gmaps4rails\n respond_with(@estates)\n \n end",
"title": ""
},
{
"docid": "9c41d126cad30950bcc2713887e3cd62",
"score": "0.49935105",
"text": "def index\n if params.include?(:sans_vol) and params[:sans_vol] == \"1\"\n @resas = Resa.no_flight_assigned\n else\n @resas = Resa.all\n end\n\n if params.include?(:resa_date)\n @date_debut = Date.strptime(params[:resa_date], \"%d/%m/%y\")\n @jour = @date_debut\n @date_fin = @date_debut\n @resas = @resas.all_for_those_dates(@date_debut,@date_debut)\n elsif params.include?(:date_debut) or params.include?(:date_fin) \n @date_debut = Date.strptime(params[:date_debut], \"%d/%m/%y\") unless params[:date_debut].nil? or params[:date_debut] == \"\"\n @date_fin = Date.strptime(params[:date_fin], \"%d/%m/%y\") unless params[:date_fin].nil? or params[:date_fin] == \"\"\n @resas = @resas.all_for_those_dates(@date_debut,@date_fin)\n end\n\n end",
"title": ""
}
] |
e548f01733b90906772dd18e2e6d2c61 | Set the filename or file object to operate on. If the object has all methods in FILE_OBJ_METHODS, it is treated as a file, otherwise, it is treated as a filename. If the filename is invalid, Errno::ENOENT or Errno::EINVAL will probably be raised when calling methods. Optional argument check_id3 checks for ID3 tags. If check_id3 is not specified and filename is a file object, the ApeTag default is used. If check_id3 is not specified and filename is a filename, it checks for ID3 tags only if the filename ends with ".mp3". If files have APE tags but no ID3 tags, ID3 tags will never be added. If files have neither tag, check_id3 will decide whether to add an ID3 tag. If files have both tags, make sure check_id3 is true or it will miss both tags. | [
{
"docid": "86fa9aa6d6fba1d6c7b06d7641590274",
"score": "0.684418",
"text": "def initialize(filename, check_id3 = nil)\n if FILE_OBJ_METHODS.each{|method| break unless filename.respond_to?(method)}\n @file = filename\n @check_id3 = check_id3.nil? ? @@check_id3 : check_id3 \n else\n @filename = filename.to_s\n @check_id3 = check_id3.nil? ? (MP3_RE.match(@filename) ? true : nil) : check_id3 \n end\n end",
"title": ""
}
] | [
{
"docid": "0c3688f1dd00253b87f1ad6c7df06a26",
"score": "0.5617483",
"text": "def set_file_object\n @file_object = FileObject.find(params[:id])\n end",
"title": ""
},
{
"docid": "d8656f13353535868d58baa133869b5f",
"score": "0.5534284",
"text": "def load(filename, **kwargs)\n @filename = filename\n\n begin\n @tags = IFFID3.new filename, **kwargs\n rescue Mutagen::ID3::ID3Error\n @tags = nil\n end\n\n File.open(filename, 'rb') do |fileobj|\n @info = AIFFInfo.new fileobj\n end\n end",
"title": ""
},
{
"docid": "efe975e46ad27f3f310a678230519b2b",
"score": "0.53732675",
"text": "def update_ID3(attributes)\n begin\n musicFile = TagLib::File.new(self.filePath())\n musicFile.title = attributes[:id3Title]\n musicFile.artist = attributes[:id3Artist]\n musicFile.save()\n rescue TagLib::BadFile => exc\n logger.error(\"Failed to id track: \\n #{exc}\")\n end \n end",
"title": ""
},
{
"docid": "87a21943460d09031b4b3a91363f526b",
"score": "0.5160875",
"text": "def initialize (mp3File, nameFile)\n if File.exists?(mp3File)\n @mp3 = mp3File\n else\n puts \"File #{mp3File} does not exist!\"\n end\n \n if File.exists?(nameFile)\n if File.readable?(nameFile)\n @file = File.open(nameFile)\n @filename = nameFile\n else \n puts \"File is not readable! Are the permissions correct? :(\"\n end\n \n else\n puts \"File #{nameFile} does not exist!\"\n end\n end",
"title": ""
},
{
"docid": "1d985f2607abc86f883393e903df7910",
"score": "0.51455235",
"text": "def set_filename\n @filename = Filename.find(params[:id])\n end",
"title": ""
},
{
"docid": "1d985f2607abc86f883393e903df7910",
"score": "0.51455235",
"text": "def set_filename\n @filename = Filename.find(params[:id])\n end",
"title": ""
},
{
"docid": "35d9847bc158d1f50e82acda5da5925e",
"score": "0.5131584",
"text": "def set_file\n if have_file?\n begin\n set_file_for_remote_storage\n rescue Errno::ENOENT\n set_file_for_local_storage\n rescue NoMethodError\n raise \"Original resource has no File\"\n end\n else\n raise \"Original resource has no File\"\n end\n end",
"title": ""
},
{
"docid": "bb7d0bd0a5b8a273f8d3ddb332f7e59e",
"score": "0.5125817",
"text": "def replace_file(original_file_object=nil, \n replacement_file_path='', \n retain_original_filename_in_oa=false, \n generate_objects=false) \n\n file_object = (original_file_object.is_a?(Array)) ? original_file_object.first : original_file_object\n uri = URI.parse(@uri + \"/Files\")\n id = file_object.id.to_s\n original_filename = nil\n\n # raise an Error if something other than an file object is passed in. Check the class\n unless file_object.is_a?(Files) \n msg = \"Argument Error: First argument => Invalid object type! Expected File object\" +\n \" and got #{file_obj.class} object instead. Aborting update.\"\n logger.error(msg.red)\n return\n end\n \n if File.directory?(replacement_file_path)\n msg = \"Argument Error: Second argument => Expected a file! \" +\n \"#{replacement_file_path} is a directory! Aborting update.\"\n logger.error(msg.red)\n return\n end\n\n\n #check if the replacement file exists\n unless File.exists?(replacement_file_path) && File.file?(replacement_file_path)\n msg = \"The file #{replacement_file_path} does not exist. Aborting update.\"\n logger.error(msg.red)\n return\n end\n\n #verify that both files have the same file extentions otherwise you will\n #get a 400 Bad Request Error\n if File.extname(file_object.original_filename) != File.extname(replacement_file_path)\n msg = \"File extensions must match! Aborting update\\n \" + \n \"Original file extension => #{File.extname(file_object.original_filename)}\\n \" +\n \"Replacement file extension => #{File.extname(replacement_file_path)}\"\n logger.error(msg.red)\n return\n end\n\n #verify that the original file id is provided\n unless id.to_s != \"0\"\n msg = \"Invalid target file id! Aborting update.\"\n logger.error(msg.red)\n return\n end\n\n #change in format\n if retain_original_filename_in_oa == true\n unless file_object.original_filename == nil || file_object.original_filename == ''\n \n original_filename = File.basename(file_object.original_filename)\n else\n msg = \"No original filename detected in Files object. Aborting update.\"\n logger.error(msg.red)\n return\n end\n else\n original_filename = File.basename(replacement_file_path)\n end \n\n body = Array.new\n\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|\n request = Net::HTTP::Put.new(uri.request_uri)\n request[\"content-type\"] = 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'\n if @session\n request.add_field('X-SessionKey',@session)\n else\n @session = @authenticator.get_session\n request.add_field('X-SessionKey',@session)\n end\n request[\"cache-control\"] = 'no-cache'\n body << \"------WebKitFormBoundary7MA4YWxkTrZu0gW\\r\\nContent-Disposition: form-data; name=\\\"_jsonBody\\\"\" \n body << \"\\r\\n\\r\\n[{\\\"id\\\":\\\"#{id}\\\",\\\"original_filename\\\":\\\"#{original_filename}\\\"}]\\r\\n\"\n body << \"------WebKitFormBoundary7MA4YWxkTrZu0gW\\r\\nContent-Disposition: form-data; name=\\\"file\\\";\" \n body << \"filename=\\\"#{original_filename}\\\"\\r\\nContent-Type: #{MIME::Types.type_for(original_filename)}\\r\\n\\r\\n\"\n body << IO.binread(replacement_file_path)\n body << \"\\r\\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\"\n request.body = body.join\n http.request(request)\n end\n Validator::process_http_response(response,@verbose,'Files', 'PUT')\n\n if generate_objects\n \n generate_objects_from_json_response_body(response,'Files')\n\n else\n # JSON Object\n response\n end\n \n end",
"title": ""
},
{
"docid": "4d100018951d2266256d04680657ee35",
"score": "0.5059063",
"text": "def set_file\n if have_file?\n case original_resource_mounter.send(:storage).class.name\n when 'CarrierWave::Storage::File'\n set_file_for_local_storage\n when 'CarrierWave::Storage::Fog', 'CarrierWave::Storage::AWS'\n set_file_for_remote_storage\n else\n raise UnknowStorage\n end\n else\n raise NoFileForOriginalResource\n end\n end",
"title": ""
},
{
"docid": "1ad1761c018038519091f419aed55265",
"score": "0.50337577",
"text": "def initialize(fileobj, offset=nil)\n size = begin \n File.size fileobj.path\n rescue ERRNO::ENOENT, IOError\n fileobj.seek(0, IO::SEEK_END)\n fileobj.tell\n end\n\n # If we don't get an offset, try to skip an ID3v2 tag.\n if offset.nil?\n fileobj.rewind\n idata = fileobj.read 10\n if (val = idata.unpack('a3xxxa4')).include? nil\n id3, insize = '', 0\n else\n id3, insize = val\n end\n\n insize = Mutagen::ID3::BitPaddedInteger.new insize\n\n if id3 == 'ID3' and insize > 0\n offset = insize + 10\n else\n offset = 0\n end\n end\n\n # Try to find two valid headers (meaning, very likely, MPEG data)\n # at the given offset, 30% through the file, 60% through the file,\n # and 90% through the file.\n flag = false\n [offset, 0.3*size, 0.6*size, 0.9*size].each do |i|\n begin \n try(fileobj, Integer(i), size - offset)\n rescue Mutagen::MP3::ERROR\n pass\n else \n flag = true\n break\n end\n end\n # If we can't find any two consecutive frames, try to find just\n # one frame back at the original offset given.\n unless flag\n try(fileobj, offset, size - offset, false)\n @sketchy = true\n end\n end",
"title": ""
},
{
"docid": "1ecffc86f5f3f411ad42a6c8b8ac805e",
"score": "0.49925396",
"text": "def allowFileOperations _obj, _args\n \"_obj allowFileOperations _args;\" \n end",
"title": ""
},
{
"docid": "6c626c510aecaa811c84de3f09dc5eb0",
"score": "0.49679446",
"text": "def update_from_filename filename\n self.original_filename = filename\n self.valid?\n end",
"title": ""
},
{
"docid": "05ab217ed3d92c76fee6a5ffaec14007",
"score": "0.49662656",
"text": "def file=(a)\n @file = a\n @real_fname = a\n end",
"title": ""
},
{
"docid": "eb437cfe92127b06a51fedbceed5556d",
"score": "0.49467432",
"text": "def update_file(settings)\n file_path = self.full_path(settings)\n TagLib::MPEG::File.open(file_path) do |file|\n file.tag.artist = self.artist.name\n file.tag.album = self.album.name\n file.tag.year = self.album.year ? self.album.year : 0\n file.tag.genre = self.genre\n file.tag.title = self.name\n file.save\n end\n end",
"title": ""
},
{
"docid": "26c14d7711297f5ab5f5103a7110616f",
"score": "0.49317852",
"text": "def file_field(object_name, method, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "05f8164b93ad91c57f88971071422de4",
"score": "0.48979214",
"text": "def set_check_file(opts)\n opts = check_params(opts,[:file_info])\n super(opts)\n end",
"title": ""
},
{
"docid": "492ef5eba2a075f50e914cc7cc804cfa",
"score": "0.48922724",
"text": "def update!(**args)\n @file_id = args[:file_id] if args.key?(:file_id)\n @file_name = args[:file_name] if args.key?(:file_name)\n @mime_type = args[:mime_type] if args.key?(:mime_type)\n end",
"title": ""
},
{
"docid": "36041e6b7dfe256ff2172aad3d8b858d",
"score": "0.4886599",
"text": "def upload_file\n \n # remember the filename\n tempfile = params[\"file_to_upload\"]\n \n # wenn ich keinen string bekommen habe und auch ueberhaupt was ankam (kein tag_edit)\n unless tempfile.nil?\n \n # if just a string arrived\n if tempfile.instance_of?(String)\n flash[:notice] = \"please select a valid file\"\n redirect_to :action => \"index\"\n \n # when a file arrived\n elsif tempfile.instance_of?(Tempfile)\n \n # delete file if too big\n if File.size?(tempfile) > MAX_FILESIZE\n File.delete(tempfile.local_path)\n flash[:notice] = \"File too large (maximal 10 MB allowed)\"\n redirect_to :action => \"index\"\n\n # if it is a valid mp3\n else\n # save variable for view\n @original_name = tempfile.original_filename\n # read id3 information\n @tag = ID3Lib::Tag.new(tempfile.local_path)\n # copy the file to the upload directory\n FileUtils.copy(params[:file_to_upload].local_path, tmp_filename)\n logger.info(\"new file from #{current_user.login} copied to : #{tmp_filename}\")\n\n flash[:notice] = \"File Uploaded\"\n end\n end\n else\n \n # hier komme ich hin, wenn nichts hochgeladen wurde, sondern der tag editiert\n \n if params[\"original_name\"].nil?\n flash[:notice] = \"No File selected (depp)\"\n redirect_to :action => \"index\"\n else \n @original_name = params[\"original_name\"]\n @tag = ID3Lib::Tag.new(tmp_filename)\n end\n end\n end",
"title": ""
},
{
"docid": "ffeb4303d37559e7e5cbdcb7727bf056",
"score": "0.48690873",
"text": "def save(upload)\n uploadFile = upload['datafile']\n originalName = uploadFile.original_filename\n self.fileType = File.extname(originalName)\n\n create_or_update()\n\n # write the file\n File.open(self.filePath, \"wb\") { |f| f.write(uploadFile.read) }\n \n # write ID3 metadata to database, to avoid the expense of fetching\n # from the file every time - quite costly as more files are displayed at a time\n begin\n musicFile = TagLib::File.new(self.filePath())\n self.id3Title = musicFile.title\n self.id3Artist = musicFile.artist\n self.id3Length = musicFile.length\n rescue TagLib::BadFile => exc\n logger.error(\"Failed to id track: \\n #{exc}\")\n end\n\n if(self.fileType == '.mp3')\n convertToOGG();\n end\n create_or_update()\n\n end",
"title": ""
},
{
"docid": "917e03be7ccf13531f4bc8e1873d507f",
"score": "0.4864668",
"text": "def add(file_or_filename)\n if file_or_filename.respond_to?(:to_io)\n add_file file_or_filename.to_io\n elsif file_or_filename.respond_to?(:to_str)\n add_filename file_or_filename\n end\n end",
"title": ""
},
{
"docid": "7d0a0512c23e2d1e01ac8ce6e81e1117",
"score": "0.48557365",
"text": "def set_info_from_mp3\n Mp3Info.open(path) do |mp3|\n TagFields.each do |field|\n send(\"#{field}=\", mp3.tag.send(field))\n end\n end\n rescue\n end",
"title": ""
},
{
"docid": "8581f93f2103f4b3ce0dfa92c28a41a6",
"score": "0.4848159",
"text": "def set_new_filename\n update_attribute(:filename, \"#{filename}.#{id}.flv\")\n update_attribute(:content_type, \"video/x-flv\")\n end",
"title": ""
},
{
"docid": "547ce878bf2bcef6bbf169c5a86ec2ce",
"score": "0.483664",
"text": "def set_tags(file, tags)\n ret = {file => false}\n TagLib::MPEG::File.open(file) do |fh|\n if File.mtime(file).to_s == tags['timestamp']#only write if file has not been modified\n tag = fh.id3v2_tag\n tags.each do |id, value|\n if tags[id] != nil && ['title', 'artist', 'year', 'track', 'album', 'genre', 'comment'].include?(id)\n if tags[id].strip.empty?\n tags[id] = nil\n end\n end\n end\n\n tag.title = tags['title']\n tag.artist = tags['artist']\n tag.album = tags['album']\n tag.year = tags['year'].to_i #taglib doesnt allow set year to nil\n tag.track = tags['track'].to_i #taglib doesnt allow set track to nil\n tag.genre = tags['genre']\n tag.comment= tags['comment']\n\n tags.delete_if{|k,v| k != 'file'} #to return only the filename and save status\n ret[file] = fh.save(TagLib::MPEG::File::ID3v2) #only save v2, v1 will be stripped\n end\n end\n return ret\n end",
"title": ""
},
{
"docid": "b61aad85068c5fc84a9f31aa6d0c24fb",
"score": "0.48292047",
"text": "def set_metadata\n s3_obj.metadata[\"filename\"] = file_name\n s3_obj.metadata[\"bindery-pid\"] = persistent_id\n end",
"title": ""
},
{
"docid": "bfa62cd79231eb5cf606d4eafaf8ee70",
"score": "0.481529",
"text": "def upload_file( id_object, file_to_upload, folder_on_s3 )\n \n file_name = id_object.to_s + \"-\" + file_to_upload.original_filename.to_s\n path_uploaded_files = Rails.root.join('public','uploaded-files')\n uploaded_file = path_uploaded_files.to_s + \"/\" + file_name\n\n unless Dir.exist?(path_uploaded_files)\n FileUtils.mkdir_p(path_uploaded_files)\n end\n\n File.open(uploaded_file, 'wb') do |file|\n file.write(file_to_upload.read)\n end \n\n file_on_s3 = folder_on_s3 + \"/\" + file_name\n upload_file_to_aws_s3(uploaded_file, file_on_s3)\n\n FileUtils.rm(uploaded_file.to_s)\n\n end",
"title": ""
},
{
"docid": "ee1e29f27d6a568321dd1e62f54d703e",
"score": "0.48027474",
"text": "def neofiles_attrs_or_id(obj_or_id, klass = ::Neofiles::File)\n if obj_or_id.present?\n obj, id = if obj_or_id.is_a? klass\n [obj_or_id, nil]\n elsif obj_or_id.is_a?(::String) || obj_or_id.is_a?(::BSON::ObjectId)\n [::Neofiles::File.where(id: obj_or_id).first, obj_or_id.to_s]\n end\n\n obj.try { |x| neofiles_attrs(x) } || id\n end\n end",
"title": ""
},
{
"docid": "63703ec8b128e16c55ce53a00ba94b5e",
"score": "0.47593302",
"text": "def initialize(*args)\n @options = {\n :access_level => 'public-read',\n :file_mapping => nil,\n :object => nil\n }\n @options.update(args.extract_options!)\n @options.stringify_keys!\n\n @raw_file = args.first\n @config = configuration\n @connection = Uv::Storage::Connection.new(self.config)\n @object = @options['object']\n\n debug \"Initializing new Uv::Storage::File\"\n debug \"Args First is a: #{args.first.class.to_s}\"\n debug \"Config loaded: #{config.present?}\"\n debug \"Connection loaded: #{connection.present?}\"\n debug \"Object given: #{object.present?}\"\n debug \"Raw File given: #{@raw_file.present?}\"\n debug \"Options given: #{options.present?}\"\n debug \"Identifier given: #{options['identifier'].present?}\"\n\n validate_object(@object) if @object.present?\n end",
"title": ""
},
{
"docid": "2cf2e43d3126d409b7c19549b2768b70",
"score": "0.47366697",
"text": "def set_new_filename\n if @video\n update_attribute(:filename, \"#{filename}.#{id}.flv\")\n update_attribute(:content_type, \"application/x-flash-video\")\n else\n update_attribute(:filename, \"#{filename}.#{id}.mp3\")\n update_attribute(:content_type, \"application/x-flash-audio\")\n end \n end",
"title": ""
},
{
"docid": "52bfaf27319d1d647490b862389b7693",
"score": "0.4735574",
"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": "5587a5f24a961f5057fbeab0ff511dc4",
"score": "0.47275966",
"text": "def initialize(filename)\n # read in ID3v2 tag, MPEG info, and ID3 tag (if present) in a single pass\n @filename = filename\n file = File.new(@filename, \"rb\")\n \n total_bytes = file.stat.size\n\n while file.pos < total_bytes do\n # try to read tags first, then read MPEG data\n case file.read(3)\n when 'TAG' # ID3 tag at the beginning of the file (unusual)\n file.seek(-3, IO::SEEK_CUR)\n $stderr.puts(\"Mp3Info.initialize TAG found at %#010x\" % file.pos) if $DEBUG\n @id3v1_tag = ID3.from_io(file)\n $stderr.puts(\"Mp3Info.initialize ID3 tag is #{@id3v1_tag.inspect}\") if $DEBUG\n when 'ID3' # ID3v2 tag\n file.seek(-3, IO::SEEK_CUR)\n $stderr.puts(\"Mp3Info.initialize ID3 found at %#010x\" % file.pos) if $DEBUG\n if has_id3v2_tag?\n @id3v2_tag.merge(ID3V2.from_io(file))\n else\n @id3v2_tag = ID3V2.from_io(file)\n end\n else\n file.seek(-3, IO::SEEK_CUR)\n $stderr.puts(\"Mp3Info.initialize scanning for MPEG data at %#010x\" % file.pos) if $DEBUG\n cur_pos = file.pos\n begin\n $stderr.puts(\"Mp3Info.initialize about to call find_next_frame at %#010x\" % file.pos) if $DEBUG\n header_pos, header_data = find_next_frame(file, cur_pos)\n mpeg_candidate = MPEGHeader.new(header_data)\n @mpeg_header = mpeg_candidate if mpeg_candidate.valid?\n \n if mpeg_candidate.valid?\n $stderr.puts(\"mpeg header %#010x found at position %#010x (%s)\" % [header_data.to_binary_decimal, header_pos, mpeg_candidate.to_s]) if $DEBUG\n file.seek(header_pos)\n cur_frame = read_next_frame(file, mpeg_candidate.frame_size)\n $stderr.puts(\"Current frame is %#06x bytes (requested %#06x)\" % [cur_frame.size, mpeg_candidate.frame_size]) if $DEBUG\n \n xing_candidate = XingHeader.new(cur_frame)\n @xing_header = xing_candidate if xing_candidate.valid?\n $stderr.puts(\"Xing header found, is [#{@xing_header.to_s}]\") if $DEBUG && has_xing_header?\n \n lame_candidate = LAMEHeader.new(cur_frame)\n @lame_header = lame_candidate if lame_candidate.valid?\n $stderr.puts(\"LAME header found, is [#{@lame_header.inspect}]\") if $DEBUG && has_lame_header?\n break # we're done trying to read candidates\n end\n rescue MPEGFile::MPEGFileError\n $stderr.puts(\"Mp3Info.initialize guesses there's no MPEG frames in this file.\") if $DEBUG\n file.seek(cur_pos)\n break\n end\n end\n $stderr.puts(\"File position is #{\"%#010x\" % file.pos}\") if $DEBUG\n end\n \n #\n # calculate the CBR bitrate, streamsize, length\n #\n if has_mpeg_header? && !has_xing_header?\n # for cbr, calculate duration with the given bitrate\n @streamsize = file.stat.size - (has_id3v1_tag? ? ID3::TAGSIZE : 0) - ((has_id3v2_tag? ? (@id3v2_tag.tag_length + 10) : 0))\n @length = ((@streamsize << 3) / 1000.0) / bitrate\n if has_id3v2_tag? && @id3v2_tag['TLEN']\n # but if another duration is given and it isn't close (within 5%)\n # assume the mp3 is vbr and go with the given duration\n tlen = (@id3v2_tag['TLEN'].is_a?(Array) ? @id3v2_tag['TLEN'].last : @id3v2_tag['TLEN']).value.to_i / 1000\n if tlen > 0\n percent_diff = ((@length.to_i - tlen) / tlen.to_f)\n if percent_diff.abs > 0.05\n @vbr = true\n @bitrate = (@streamsize / tlen) / 1024\n end\n end\n end\n end\n \n #\n # check for an ID3 tag at the end\n #\n if (total_bytes >= ID3::TAGSIZE)\n file.seek(-ID3::TAGSIZE, IO::SEEK_END)\n if file.read(3) == 'TAG'\n file.seek(-3, IO::SEEK_CUR)\n if has_id3v1_tag?\n @id3v1_tag.update(ID3.from_io(file))\n else\n @id3v1_tag = ID3.from_io(file)\n end\n end\n end\n \n file.close\n \n load_universal_tag!\n \n if !(has_id3v1_tag? || has_id3v2_tag? || has_mpeg_header? || has_xing_header?)\n raise(Mp3InfoError, \"There was no useful metadata in #{@filename}, are you sure it's an MP3?\")\n end\n \n # there should always be tags available for convenience\n @id3v1_tag = ID3.new if nil == defined? @id3v1_tag\n @id3v2_tag = ID3V2.new if nil == defined? @id3v2_tag\n end",
"title": ""
},
{
"docid": "9ff99eb0c93755034ca6a8eb595e54fd",
"score": "0.4704167",
"text": "def write(*filename)\n backups = false\n \n if filename.size == 0 # this is an Array!!\n filename = @filename\n backups = true # keep backups if we write to a specific filename\n else\n filename = filename[0]\n backups = false\n end\n \n tf = Tempfile.new( @basename )\n tmpname = tf.path\n \n # write ID3v2 tag:\n \n if @tagID3v2\n tf.write( @tagID3v2.dump )\n end\n \n # write Audio Data:\n \n tf.write( audio ) # reads audio from file if nil\n \n # write ID3v1 tag:\n \n if @tagID3v1\n tf.write( @tagID3v1.dump )\n end\n \n tf.close\n \n # now some logic about moving the tempfile and replacing the original\n\n bakname = filename + '.bak'\n move(filename, bakname) if backups && FileTest.exists?(filename) && ! FileTest.exists?(bakname)\n\n move(tmpname, filename)\n tf.close(true)\n \n # write md5sum sha1sum files:\n writeMD5sum if @audioMD5sum\n writeSHA1sum if @audioSHA1sum\n end",
"title": ""
},
{
"docid": "e1ebf9c3d7d5e7aa25698e33c75d7d7b",
"score": "0.46794534",
"text": "def parse_file(attrs)\n return attrs unless attrs[:asset]\n attrs[:asset_attrs] = {}\n if attrs[:asset].kind_of?(::File) or attrs[:asset].kind_of?(::Tempfile) then\n attrs[:asset_attrs][:name] = attrs[:asset].respond_to?(:original_filename) ? attrs[:asset].original_filename : ::File.basename(attrs[:asset].path)\n attrs[:asset_attrs][:local_path] = attrs[:asset].path\n elsif attrs[:asset].kind_of?(String) then\n attrs[:asset_attrs][:local_path] = attrs[:asset]\n attrs[:asset] = ::File.new(attrs[:file])\n attrs[:asset_attrs][:name] = ::File.basename(attrs[:asset_attrs][:local_path])\n elsif attrs[:asset].kind_of?(StringIO) then\n raise(ArgumentError, \"Must specify the :as option when uploading from StringIO\") unless attrs[:as]\n attrs[:asset_attrs][:local_path] = attrs[:as]\n\n # hack for bug in UploadIO\n class << file\n attr_accessor :path\n end\n file.path = attrs[:asset]\n else\n raise ArgumentError, \"local_file must be a File, StringIO, or file path\"\n end\n\n attrs[:asset_attrs][:name] = ::File.basename(attrs.delete(:as)) if attrs[:as]\n\n attrs\n end",
"title": ""
},
{
"docid": "c2186cf668a2b9a9d89878fa0b0b2a19",
"score": "0.46615744",
"text": "def set_fotosprofile\n @fotosprofile = Fotosprofile.find(params[:id])\n end",
"title": ""
},
{
"docid": "01cb5eec59f5b7107601bb35fa890b9d",
"score": "0.46593475",
"text": "def set_arquivo\n @arquivo = Arquivo.find(params[:id])\n end",
"title": ""
},
{
"docid": "098b67807fecbc2d58098729b2269a15",
"score": "0.4646648",
"text": "def mp3=(file_data)\n @file_data = file_data\n end",
"title": ""
},
{
"docid": "b529c87b11f3c9185395d8bfe2c5d87c",
"score": "0.464546",
"text": "def initialize(filename_or_io, content_type, filename = nil, opts = {})\n io = filename_or_io\n local_path = \"\"\n if io.respond_to? :read\n # in Ruby 1.9.2, StringIOs no longer respond to path\n # (since they respond to :length, so we don't need their local path, see parts.rb:41)\n local_path = filename_or_io.respond_to?(:path) ? filename_or_io.path : \"local.path\"\n else\n io = File.open(filename_or_io)\n local_path = filename_or_io\n end\n filename ||= local_path\n\n @content_type = content_type\n @original_filename = File.basename(filename)\n @local_path = local_path\n @io = io\n @opts = opts\n end",
"title": ""
},
{
"docid": "17d942c0f6207b1e800d98920534d890",
"score": "0.4616166",
"text": "def add_xml_attribute(obj, attrib, val, store_unresolved = true, external_vip_id = nil, external_datetime = nil)\n\t\t#don't store unnecessary white space\n\t\tval.strip!\n\n\t\tif (attrib.eql?(\"id\"))\n\t\t\tputs attrib if Debug > 4\n\t\t\tinnerattrib = \"file_internal_id\"\n\t\telse\n\t\t\tinnerattrib = attrib\n\t\tend\n\n\t\t# if it's an object_id, it's probably a custom_note\n\t\t# don't try to resolve it until the end of the document\n\t\tif innerattrib.eql?(\"object_id\") then\n\n\t\t\tputs \"object_id\" if Debug > 4\n\n\t\t\tif store_arbitrary_object_reference(obj,val,store_unresolved)\n\t\t\t\treturn true\n\t\t\tend\n\n\t\t# store object if it exists\n\t\t#TODO: size-3 or size-4?\n\t\telsif obj.respond_to?(innerattrib) or \n\t\t obj.respond_to?(innerattrib[0,innerattrib.size-3].pluralize) then\n\n\t\t\tif (innerattrib[-3,3] == '_id' && !IdExceptions.include?(innerattrib))\n\n\t\t\t\t#this is an ID in the file we need to map\n\t\t\t\t#to the database's internal ID\n\t\t\t\treferenced_obj = get_object_by_file_internal_id(obj, attrib, val, \n\t\t\t\t external_vip_id, external_datetime)\n\t\t\t\tputs referenced_obj.inspect if Debug > 9\n\n\t\t\t\tif !referenced_obj.nil? then\n\t\t\t\t\t# store object id\n\t\t\t\t\tif obj.has_attribute?(innerattrib) #!HABTM?\n\t\t\t\t\t\t#not HABTM\n\t\t\t\t\t\tputs \"Adding singular object \" + innerattrib if Debug > 4\n\t\t\t\t\t\tobj.[]=(innerattrib,referenced_obj.id)\n\t\t\t\t\telse\n\t\t\t\t\t\t#HABTM\n\t\t\t\t\t\tputs \"Adding plural object \" + innerattrib if Debug > 4\n\t\t\t\t\t\t#TODO: size-3 or size-4?\n\t\t \t\t\t\tplural_attrib = innerattrib[0,innerattrib.size-3].pluralize\n\t\t\t\t\t\t\n\t\t\t\t\t\teval('obj.'+plural_attrib).push referenced_obj\n\t\t\t\t\tend\n\n\t\t\t\t\tputs 'Set '+innerattrib+' to valid object. Success.' if Debug > 3\n\t\t\t\t\treturn true\n\n\t\t\t\telse #referenced object is nil\n\t\t\t\t\t# we haven't found the referenced ID in the stack yet.\n\t\t\t\t\tif store_unresolved\n\t\t\t\t\t\tsave_unresolved(obj,attrib,val)\n\t\t\t\t\tend\n\n\t\t\t\t\t# save file_internal_id in place of object id, unless it's HABTM\n\t\t\t\t\tobj.[]=(innerattrib,val) if obj.has_attribute?(innerattrib)\n\n\t\t\t\t\treturn false\n\n\t\t\t\tend #if referenced_obj.nil?\n\t\t\t\t\t\n\t\t\telse #just a normal attribute, not an object reference\n\n\t\t\t\tobj.[]=(innerattrib,val)\n\n\t\t\t\tputs 'Set '+innerattrib+' to '+val.to_s if Debug > 5\n\n\t\t\t\treturn true\n\n\t\t\tend #id check\n\t\telse #attribute doesn't apply here\n\t\t\tputs \"Ignored \"+attrib+\" in \" +obj.class.name if Debug > 0\n\t\tend #attribute existence check\n\n\tend",
"title": ""
},
{
"docid": "f5b0400b31957c4c80f60fa4ec31746c",
"score": "0.46139497",
"text": "def file_field(object_name, method, options = {})\n InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_input_field_tag(\"file\", options)\n end",
"title": ""
},
{
"docid": "ff47d9503c2191e410d8b06bcc44ad97",
"score": "0.4611624",
"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": "59fbc959cbeba624b6c6e1b9d91b6f3e",
"score": "0.45999527",
"text": "def update_file_on_s3(file, objects)\n file_path = s3_file_path(file)\n conn = RedmineS3::Connection.conn\n object = objects[file_path]\n\n # get the file modified time, which will stay nil if the file doesn't exist yet\n # we could check if the file exists, but this saves a head request\n s3_mtime = object.last_modified rescue nil \n\n # put it on s3 if the file has been updated or it doesn't exist on s3 yet\n if s3_mtime.nil? || s3_mtime < File.mtime(file)\n fileObj = File.open(file, 'r')\n RedmineS3::Connection.put(file_path, fileObj.read)\n fileObj.close\n\n puts \"Put file \" + File.basename(file)\n else\n puts File.basename(file) + ' is up-to-date on S3'\n end\n end",
"title": ""
},
{
"docid": "e3b3ca90007f7f8b7d11814f8572eae0",
"score": "0.4592369",
"text": "def set_file_format\n @file_format = FileFormat.find(params[:id])\n end",
"title": ""
},
{
"docid": "cb728fc42119949a9b0a885daa9429e4",
"score": "0.45916697",
"text": "def initialize(object, file)\n super(object, file)\n @name = object.name\n end",
"title": ""
},
{
"docid": "cb728fc42119949a9b0a885daa9429e4",
"score": "0.45916697",
"text": "def initialize(object, file)\n super(object, file)\n @name = object.name\n end",
"title": ""
},
{
"docid": "a58637fb224bf9716ffb8e8bc5e10bb0",
"score": "0.45891592",
"text": "def set_file_operation\n @file_operation = FileOperation.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4dac1cc2c6d62c8aa1aee78c6eec743",
"score": "0.45692593",
"text": "def put_object_from_file(bucket_name, key, file_name, options={})\n mime = MimeMagic.by_path(file_name)\n options[CONTENT_TYPE] = mime.type if options[CONTENT_TYPE].nil? && !mime.nil?\n buf_size = @config.recv_buf_size\n if options[CONTENT_LENGTH].nil?\n data = File.open(file_name, \"rb\")\n data_md5 = Utils.get_md5_from_file(file_name, data.size, buf_size)\n put_object(bucket_name, key, data, data_md5, data.size, options)\n else\n left_size = options[CONTENT_LENGTH]\n data_md5 = Utils.get_md5_from_file(file_name, left_size, buf_size)\n put_object(bucket_name, key, \"\", data_md5, left_size, options) do |buf_writer|\n File.open(file_name, \"rb\") do |part_fp|\n bytes_to_read = left_size > buf_size ? buf_size : left_size\n until left_size <= 0\n buf_writer << part_fp.read(bytes_to_read)\n left_size -= bytes_to_read\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "06f780af7a17129f8211a4c3b4f41cce",
"score": "0.45596302",
"text": "def set_metadata( file_list, tag_hash)\n file_list = [*file_list] # make sure file_list is an array\n file_list.each do |file_name|\n if File.exist?(file_name) \n ok = TagLib::FileRef.open(file_name) do |f|\n tag = f.tag\n tag_hash.each do |tag_name, value|\n\n # make sure that the tag_nam (hash key) is a string and then add = to it\n if tag_name.class != String\n tag_name = tag_name.to_s\n end\n tag_name += \"=\"\n\n if tag.respond_to?(tag_name)\n tag.send(tag_name, value)\n else\n puts \"can't modify tag #{tag_name}\"\n end\n end\n f.save\n end\n if ok == false then\n puts \"uh-oh. There was a problem saving/opening #{f}, it's tags were not modified.\"\n end\n else\n puts \"file #{file_name} does not exist, so its tags were not updated.\"\n end\n end\n end",
"title": ""
},
{
"docid": "dff42bae07f3d9b4c69d5935802857fc",
"score": "0.45538968",
"text": "def upload(objectname, filepath)\n prefix = @config['s3']['prefix']\n unless prefix.nil?\n objectname = File.join(prefix, objectname)\n end\n\n filepath = dir(filepath)\n\n # Generate hash of file\n hash = filehash filepath\n @s3touchedobjects << objectname\n # Get hash of version already uploaded, if available.\n begin\n object = AWS::S3::S3Object.find objectname, @bucketname\n oldhash = object.metadata['hash']\n rescue AWS::S3::NoSuchKey\n # File not uploaded yet\n oldhash = nil\n end\n unless hash == oldhash\n # Don't reupload if file hasn't changed\n puts \"#{objectname}: Uploading\"\n AWS::S3::S3Object.store(objectname, open(filepath), @bucketname, access: :public_read, 'x-amz-meta-hash' => hash)\n else\n puts \"#{objectname}: Not uploading, hasn't changed since last time.\"\n end\n end",
"title": ""
},
{
"docid": "150722e475f282b33ed0191bec22386d",
"score": "0.454964",
"text": "def set_file_name\n @file_name = FileName.find(params[:id])\n end",
"title": ""
},
{
"docid": "1ac47b17470d9bd740437fae1c5f45c1",
"score": "0.45438123",
"text": "def set_file_user\n @file_user = FileUser.find(params[:id])\n end",
"title": ""
},
{
"docid": "28d34060b71b15ced9e614e6e259c702",
"score": "0.45411384",
"text": "def initialize(id, file_name, file_data, file_type)\n @id = id\n @file_name = file_name\n @file_data = file_data\n @file_type = file_type\n end",
"title": ""
},
{
"docid": "925f85083251befb4e58164d7bb32392",
"score": "0.45389247",
"text": "def file=(file)\n self.name = filename(file)\n self.attachment = Attachment.find_or_initialize_by(file: file)\n end",
"title": ""
},
{
"docid": "10ffa53b92c881108d1a4226c863c1a9",
"score": "0.45366627",
"text": "def set_uploaded_file\n @uploaded_file = UploadedFile.find(params[:id])\n end",
"title": ""
},
{
"docid": "8cafd95941a4e8b044d662f25b681f9f",
"score": "0.45238996",
"text": "def init_fog_file(filename, body, options={})\n # If the \"filename\" or the \"body\" are empty then return nil\n return nil if filename.nil? || body.nil?\n # Set file's access control list (ACL).\n\n aws_acl = (self.config.aws_acl?)? self.config.aws_access_control_list.to_s : nil\n # expiry is the number of seconds the file will available publicly\n expiry = options.has_key?(:expiry)? options[:expiry] : ((self.config.expiry?)? self.config.expiry.to_i : nil)\n ext = File.extname(filename)[1..-1] # The file extension\n mime = MultiMime.lookup(ext) # Look up the content type based off the file extension\n prefix = options.has_key?(:prefix)? options[:prefix] : self.config.prefix\n full_filename = (self.config.local? || !self.config.enabled?)? filename : \"#{prefix}#{filename}\"\n disposition_attachment = options.has_key?(:attachment)? options[:attachment] : false\n\n # file Hash to be used to create a Fog for upload\n file = {\n :key => \"#{full_filename}\",\n :body => body,\n :content_type => mime\n }\n file.merge!({:content_disposition => \"attachment\"}) if disposition_attachment\n\n file.merge!({:public => true}) if self.config.public?\n\n if self.config.aws?\n if self.config.public? && self.config.expiry?\n file.merge!({:cache_control => \"public, max-age=#{expiry}\"})\n end\n # valid acls: private, public-read, public-read-write, authenticated-read, bucket-owner-read, bucket-owner-full-control\n file.merge!({:acl=>self.config.aws_access_control_list.to_s}) if self.config.aws_acl?\n file.merge!({:expires => Time.now.utc.to_i + expiry}) if !self.config.public? && self.config.expiry?\n file.merge!({:storage_class => 'REDUCED_REDUNDANCY'}) if self.config.aws_rrs?\n end\n\n return file\n end",
"title": ""
},
{
"docid": "04c3d9a59388759bf393a3a4991244d7",
"score": "0.45178643",
"text": "def set_file_record\n @file_record = FileRecord.find(params[:id])\n end",
"title": ""
},
{
"docid": "04c3d9a59388759bf393a3a4991244d7",
"score": "0.45178643",
"text": "def set_file_record\n @file_record = FileRecord.find(params[:id])\n end",
"title": ""
},
{
"docid": "ca7a56648677bc6b93e4017967caf5cc",
"score": "0.45176503",
"text": "def put_file(to_path, file_obj, overwrite=false, parent_rev=nil)\n path = \"/files_put/#{@root}#{format_path(to_path)}\"\n\n params = {\n 'overwrite' => overwrite.to_s\n }\n\n params['parent_rev'] = parent_rev unless parent_rev.nil?\n\n response = @session.do_put(build_url(path, params, content_server=true),\n {\"Content-Type\" => \"application/octet-stream\"},\n file_obj)\n\n parse_response(response)\n end",
"title": ""
},
{
"docid": "028bda6c13c1bda317e9ef2e922d9d70",
"score": "0.45160115",
"text": "def call\n validate\n upload_to_s3\n renamed_filename\n end",
"title": ""
},
{
"docid": "44dd8225d7e27b81c3949f115add0a87",
"score": "0.4514816",
"text": "def set_userfile\n @userfile = Userfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "44dd8225d7e27b81c3949f115add0a87",
"score": "0.4514816",
"text": "def set_userfile\n @userfile = Userfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "02d991a2e6f734c1418688e0ee1cd252",
"score": "0.45128372",
"text": "def update!(**args)\n @file_id = args[:file_id] if args.key?(:file_id)\n @justification = args[:justification] if args.key?(:justification)\n @last_modified_time = args[:last_modified_time] if args.key?(:last_modified_time)\n @mime_type = args[:mime_type] if args.key?(:mime_type)\n @title = args[:title] if args.key?(:title)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "111d52af764d2dcacca03128fe1cd2c3",
"score": "0.44991598",
"text": "def set_file_example\n @file_example = FileExample.find(params[:id])\n end",
"title": ""
},
{
"docid": "19946751d5bdc89a38acee4bea16be0e",
"score": "0.44948754",
"text": "def s3_updatefile(filename, filedata)\n s3_deletefile filename\n #AWS::S3::S3Object.store filename, filedata, QBUCKET.to_s, :access => :public_read\n AWS::S3::S3Object.store filename, filedata, IMAGES_BUCKET.to_s, :access => :public_read\n end",
"title": ""
},
{
"docid": "908235e91da708dbabac19b46ce75bc5",
"score": "0.44922516",
"text": "def update\n uploaded_io = mp3_params[:mp3][:title]\n @mp3temp[:title] = uploaded_io.original_filename\n\n respond_to do |format|\n if @mp3.update(@mp3temp)\n format.html { redirect_to @mp3, notice: 'Mp3 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mp3.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd34465ac08de09e0de7f5a206f6f7dd",
"score": "0.44820312",
"text": "def set_uploaded_file\n @uploaded_file = UploadedFile.find(params[:id])\n end",
"title": ""
},
{
"docid": "8ce2e13ef9ba94c82f31f95a446ec2b4",
"score": "0.44803828",
"text": "def set_data(file_name,obj)\n self.file_name = file_name\n dd= self.document_data.nil? ? DocumentData.new : self.document_data\n dd.data = obj\n dd.document_version=self\n if dd.save\n return true, self\n else\n return false, dd\n end\n \n end",
"title": ""
},
{
"docid": "1b0570ce63c1c2585350d9f140530ae8",
"score": "0.44770387",
"text": "def set_other_file\n @other_file = OtherFile.find(params[:id])\n end",
"title": ""
},
{
"docid": "7184941750e3bf87926aede05719d578",
"score": "0.4475142",
"text": "def filename=(filename)\n valid_extension?(filename)\n @filename = filename \n end",
"title": ""
},
{
"docid": "1819a8a73cc43fb641ac714c93939e10",
"score": "0.44621927",
"text": "def set(file)\n self.file = file\n end",
"title": ""
},
{
"docid": "1495408644ecd8a9ab0d6e66b1ace3cc",
"score": "0.44604167",
"text": "def change_file_metadata(song)\n Mp3Info.open(song[:path]) do |mp3|\n #song.dance=params['genre']\n mp3.tag2.TCON=song.dance\n #song.title=params['title']\n mp3.tag.title=song.title\n #song.artist=params['artist']\n mp3.tag.artist=song.artist\n #song.rating=params['rating'].to_i\n mp3.tag2.POPM=song.rating\n #song.save\n end\nend",
"title": ""
},
{
"docid": "0146ae977443159ce28e72f595d3ee67",
"score": "0.4459958",
"text": "def object_uploaded_with_metadata?(\r\n s3_client,\r\n bucket_name,\r\n object_key,\r\n metadata\r\n)\r\n response = s3_client.put_object(\r\n bucket: bucket_name,\r\n body: \"c:\\\\my-file.txt\",\r\n key: object_key,\r\n metadata: metadata\r\n )\r\n if response.etag\r\n return true\r\n else\r\n return false\r\n end\r\nrescue StandardError => e\r\n puts \"Error uploading object: #{e.message}\"\r\n return false\r\nend",
"title": ""
},
{
"docid": "38a772671797caa6468c6f76a8d2a8d2",
"score": "0.44551376",
"text": "def upload_simple(filename, overwrite:, target_name:)\n target_file = get(target_name)\n exist = target_file.file?\n return if exist && !overwrite\n path = nil\n if exist\n path = \"#{target_file.api_path}/content\"\n else\n path = \"#{api_path}:/#{target_name}:/content\"\n end\n\n query = {\n path: File.join('v1.0/me/', path),\n headers: {\n 'Authorization': \"Bearer #{@od.access_token.token}\",\n 'Content-Type': 'application/octet-stream'\n },\n body: File.read(filename)\n }\n result = @od.conn.put(query)\n result = JSON.parse(result.body)\n file = OneDriveFile.new(@od, result)\n file.set_mtime(File.mtime(filename))\n end",
"title": ""
},
{
"docid": "e5f5bffdf16af4b7b43e662c6a091d3d",
"score": "0.44550794",
"text": "def filename=(filename)\r\n members.each {|m| m.filename = filename}\r\n @filename = filename\r\n end",
"title": ""
},
{
"docid": "78968ea09ba7b1e18879483b74ea31f2",
"score": "0.44497418",
"text": "def assign(file, identifier = Identifier.generate)\n self.file = file\n\n if file\n extension ||= file.extension if file.respond_to? :extension\n extension ||= File.extname(file.original_filename) if file.respond_to? :original_filename\n extension ||= File.extname(file.path) if file.respond_to? :path\n size ||= file.size if file.respond_to? :size\n size ||= File.size(file.path) if file.respond_to? :path\n end\n\n @purge = [self.path, *self.styles.map { |style, options| self.path(style) }] if attached?\n\n self.size = file ? size : nil\n self.extension = file ? extension : nil\n self.identifier = file ? identifier : nil\n\n process if file\n end",
"title": ""
},
{
"docid": "0f1046198911f61e2e7a3521750fa3f8",
"score": "0.4446662",
"text": "def store_file(*args)\n data, content_type, filename = args.reverse\n if filename\n http.put(204, luwak, escape(filename), data, {\"Content-Type\" => content_type})\n filename\n else\n response = http.post(201, luwak, data, {\"Content-Type\" => content_type})\n response[:headers][\"location\"].first.split(\"/\").last\n end\n end",
"title": ""
},
{
"docid": "13f2a6c3ebc9dfa09ac3d760ff477c0d",
"score": "0.4442453",
"text": "def replace_with_file(blob, attributes = {})\n File.binwrite(self.file_path, blob)\n\n pdf = CombinePDF.parse blob\n self.update(num_pages: pdf.pages.length, filename: attributes[:new_filename])\n self.save_cover\n end",
"title": ""
},
{
"docid": "0b7372dd7eed0e42eb8b4d1f6aebe978",
"score": "0.4440801",
"text": "def create_file(uid, info = {})\n tus_info = Tus::Info.new(info)\n\n options = upload_options.dup\n options[:content_type] = tus_info.metadata[\"content_type\"]\n\n if filename = tus_info.metadata[\"filename\"]\n # Aws-sdk-s3 doesn't sign non-ASCII characters correctly, and browsers\n # will automatically URI-decode filenames.\n filename = CGI.escape(filename).gsub(\"+\", \" \")\n\n options[:content_disposition] ||= \"inline\"\n options[:content_disposition] += \"; filename=\\\"#{filename}\\\"\"\n end\n\n multipart_upload = object(uid).initiate_multipart_upload(options)\n\n info[\"multipart_id\"] = multipart_upload.id\n info[\"multipart_parts\"] = []\n\n multipart_upload\n end",
"title": ""
},
{
"docid": "584c2aaa41aeb3dac7391c09b04fad09",
"score": "0.44350168",
"text": "def do( argv )\n\t\tid3v2 = process_options argv\n\n\t\t# Add all taggable files to the queue.\n\t\t# TODO: Will throw exceptions in the future. (3/29/04: why?)\n\t\tid3v2.do( argv )\n\tend",
"title": ""
},
{
"docid": "f4f7d8026c69a5790fef7ee4c2e1be56",
"score": "0.44241285",
"text": "def set_from_file(model_image_attr, full_path)\n model_image_attr.store!(File.open(full_path))\n send(\"write_#{model_image_attr.mounted_as}_identifier\")\n model_image_attr\n end",
"title": ""
},
{
"docid": "5330ac48566c213a80eee939c21fa23d",
"score": "0.44239697",
"text": "def set_foto\n @foto = Foto.find(params[:id])\n end",
"title": ""
},
{
"docid": "e088df82e87cf072033dc718e712d5db",
"score": "0.44142148",
"text": "def update!(**args)\n @filename = args[:filename] if args.key?(:filename)\n end",
"title": ""
},
{
"docid": "e088df82e87cf072033dc718e712d5db",
"score": "0.44142148",
"text": "def update!(**args)\n @filename = args[:filename] if args.key?(:filename)\n end",
"title": ""
},
{
"docid": "d3993949cf3cbf3a327daea11dfda80a",
"score": "0.44094113",
"text": "def filename=( f )\n @filename = f\n end",
"title": ""
},
{
"docid": "763d0d99c8f0db53b40b6c2a16b0d70a",
"score": "0.44062573",
"text": "def file=(file)\n self.data = file\n dis_set :content_type, file.content_type\n dis_set :filename, file.original_filename\n end",
"title": ""
},
{
"docid": "cebbf9b591a0cc708666707333d46d2f",
"score": "0.44052467",
"text": "def filename=(filename)\n members.each {|m| m.filename = filename if m.is_a?(SimpleSequence)}\n filename\n end",
"title": ""
},
{
"docid": "c8237955da2ab42b970a26d23feff1bc",
"score": "0.440382",
"text": "def fast_asset=(file)\n if file && file.respond_to?('[]')\n self.tmp_upload_dir = \"#{file['filepath']}_1\"\n tmp_file_path = \"#{self.tmp_upload_dir}/#{file['original_name']}\"\n FileUtils.mkdir_p(self.tmp_upload_dir)\n FileUtils.mv(file['filepath'], tmp_file_path)\n self.asset = File.new(tmp_file_path)\n end\n end",
"title": ""
},
{
"docid": "fd84d429455928fad100c03bc1f7e501",
"score": "0.4398303",
"text": "def internal_file_attributes=(_arg0); end",
"title": ""
},
{
"docid": "22215e1adf3e163be6e16341e1cb3bdb",
"score": "0.4388068",
"text": "def set_object_attachment\n @object_attachment = ObjectAttachment.find(params[:id])\n end",
"title": ""
},
{
"docid": "1e086a7ba13d9cb30189806246aa8e37",
"score": "0.43848607",
"text": "def set_path\n @file_path = @s3_local_object.body.path\n end",
"title": ""
},
{
"docid": "117cd7e7d34dafe32c30f27cd6678cb9",
"score": "0.4383423",
"text": "def set_user_file\n @user_file = @folder.files.find(params[:id])\n end",
"title": ""
},
{
"docid": "f05e9e8f026b068d81340c95da99d43e",
"score": "0.43829465",
"text": "def update!(**args)\n @file_type = args[:file_type] if args.key?(:file_type)\n end",
"title": ""
},
{
"docid": "622d7cd3e3256aaf9b9928f5fa4157f4",
"score": "0.43820122",
"text": "def setup_file_path\n @sanitized_name = sanitize_filename(params[:filename])\n @file_path = \"#{@resource.s3_dir_name(type: 'data')}/#{@sanitized_name}\"\n end",
"title": ""
},
{
"docid": "450b6c81089a8de359715bfe5d60355d",
"score": "0.4380052",
"text": "def update(params = {})\n file = params.delete(:file)\n if file\n self.filename = sanitize_filename(file.original_filename)\n self.content_type = file.content_type\n self.file_contents = file.read\n end\n super\n end",
"title": ""
},
{
"docid": "b2ddc1daabe21114a5ab0bd9f2da74e3",
"score": "0.43776685",
"text": "def attach(file)\n existing_file = self.file\n\n file.owner = self\n file.display_filename = existing_file.display_filename if existing_file\n if file.save and existing_file then\n existing_file.owner_type = nil\n existing_file.owner_id = nil\n existing_file.save\n end\n end",
"title": ""
},
{
"docid": "c74f24054f8399ab678ad7f29cb54a1b",
"score": "0.4375942",
"text": "def initialize(filename_or_handle)\n if filename_or_handle.is_a?(File)\n @file = filename_or_handle\n elsif filename_or_handle.is_a?(String)\n if File.exists? filename_or_handle\n @file = open(filename_or_handle)\n else\n raise \"File does not exist: #{filename_or_handle}\"\n end\n else\n raise \"You need to pass a filename or a File object\"\n end\n \n parseHeader\n end",
"title": ""
},
{
"docid": "5bdbc682a075ac86fc0254c66bd23e61",
"score": "0.4372615",
"text": "def set_file\n @file = DataSet.find(params[:id])\n end",
"title": ""
},
{
"docid": "4c2035b6c45480c7f2acc2efac36d0e8",
"score": "0.4366706",
"text": "def set_filename(filename)\n if filename.nil?\n raise ArgumentError, 'Provide a filename for your post.'\n else\n @filename = filename\n end\n end",
"title": ""
},
{
"docid": "16a46215488dfca07598f9c932066cd5",
"score": "0.43487293",
"text": "def filename(*args, &block)\n args = [{ :using => Filename, :kind => String }, *args ]\n da = option(*args, &block)\n da.instance_eval do\n if da.existing\n must \"exist\" do |s|\n File.exist?(s)\n end\n end\n if da.expand\n from String do |s|\n File.expand_path(s)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ec62d1704ad4c7f9d83d45f97b0c993e",
"score": "0.43481037",
"text": "def set_filename_from_parent\n components = parent.filename.split('.')\n if components.size > 1\n ext = components.last\n name = components[0, components.size - 1].join('.')\n else\n ext = 'mp3'\n name = parent.filename\n end\n name = Digest::SHA1.hexdigest(\"KroogiFileDownload-#{id}-#{name}\")\n \n self.filename = \"#{name}.#{ext}\"\n end",
"title": ""
},
{
"docid": "9c7468b196e15dff2a95c366766816ef",
"score": "0.43465412",
"text": "def update_attachment(args={})\n raise ArgumentError unless args[:file] && args[:name]\n return unless has_attachment?(args[:name])\n delete_attachment(args[:name])\n set_attachment_attr(args)\n rescue ArgumentError => e\n raise ArgumentError, 'You must specify :file and :name'\n end",
"title": ""
},
{
"docid": "caed4ab8138956e7cf662a7e43f5f346",
"score": "0.43436998",
"text": "def set_public\n file = session[:user].x_files.get(params[:id])\n # first check if it exist and if it synchronized then => error\n raise RequestError.new(:bad_param, \"Can not set a synchronized file as public\") if file && file.user != session[:user]\n # second if it not exist take a look into the shared_to_me files\n file = session[:user].x_files_shared_to_me.get(params[:id]) unless file\n # thrid if it still does not exist => error\n raise RequestError.new(:file_not_found, \"File not found\") unless file\n # fourth check for root folder OR not uploaded\n raise RequestError.new(:bad_param, \"File not uploaded\") if !file.folder && !file.uploaded\n raise RequestError.new(:bad_param, \"Can not set the root folder as public\") if file.id == session[:user].root_folder.id\n\n file.public = true if params[:public] == \"true\"\n file.public = false if params[:public] == \"false\"\n file.save\n @result = { file: file.description(session[:user]), success: true }\n end",
"title": ""
}
] |
f2a0e0c9a395d9e1ef2b246f51f7f41b | Returns the complete array of Wheres | [
{
"docid": "73e58d06d5acfdae34784e1095abd29a",
"score": "0.0",
"text": "def all\n @@wheres\n end",
"title": ""
}
] | [
{
"docid": "5f4be965abb002691c8765ef1fa4a93c",
"score": "0.61530423",
"text": "def to_a; [w, x, y, z] end",
"title": ""
},
{
"docid": "b190e9716f2125c653f64e6c0ca60b5d",
"score": "0.60736454",
"text": "def wells\n @wells ||= []\n end",
"title": ""
},
{
"docid": "56fc6768bce310a9cdba4fe35da0140e",
"score": "0.59590805",
"text": "def weights_as_array() weighins.pluck(:created_at, :weight).map {|d,w| {\"created_at\" => d, \"weight\" => w}} end",
"title": ""
},
{
"docid": "345c215c0bf1d4dd3613aa3e47531c52",
"score": "0.5910624",
"text": "def all_howl\n @wolves.each { |wolf| wolf.howl }\n end",
"title": ""
},
{
"docid": "6f1ba4af2fde02c4342efd1e38e79fa0",
"score": "0.58707345",
"text": "def to_a\n @legs\n end",
"title": ""
},
{
"docid": "bcb1114fadb251f88245c52f9432c5da",
"score": "0.5799792",
"text": "def wells\n plates.collect(&:wells).flatten\n end",
"title": ""
},
{
"docid": "7406542226371ffd38eeda4e278fc0bd",
"score": "0.5726086",
"text": "def get_world_array\n world_array = Array.new(@total_length){ [] }\n\n @all_strawberries.each do |strawberry|\n world_array[Matrix.two_to_one(strawberry.get_x_location, strawberry.get_y_location, @x_size)].push(strawberry)\n end\n @all_mushrooms.each do |mushroom|\n world_array[Matrix.two_to_one(mushroom.get_x_location, mushroom.get_y_location, @x_size)].push(mushroom)\n end\n @all_persons.each do |person|\n world_array[Matrix.two_to_one(person.get_x_location, person.get_y_location, @x_size)].push(person)\n end\n @all_monsters.each do |monster|\n world_array[Matrix.two_to_one(monster.get_x_location, monster.get_y_location, @x_size)].push(monster)\n end\n world_array\n end",
"title": ""
},
{
"docid": "93580b2698a48986f0963decda2c9639",
"score": "0.57045275",
"text": "def all_bathing_waters(options = {})\n if bws_by_uri.empty?\n api_options = { _pageSize: 600 }.merge(options)\n\n bws = api_get_resources(BathingWater.endpoint_all, ALL_PAGES, BathingWater, api_options)\n bws.each do |bw|\n bws_by_uri[bw.uri] = bw\n bws_by_id[bw.id] = bw\n end\n end\n\n bws_by_uri.values\n end",
"title": ""
},
{
"docid": "0e076005766691cc58ad305b2956da5e",
"score": "0.569919",
"text": "def index\n @wises = Wise.all\n end",
"title": ""
},
{
"docid": "0206a5208db774570b326f9828b20bb5",
"score": "0.5692076",
"text": "def wardrobe_items\n wardrobe = []\n orders.where(order_status: 4).each do |order|\n order.items.each do |item|\n wardrobe << item\n end\n end\n return wardrobe\n end",
"title": ""
},
{
"docid": "6cac234d7ce5b4481da72057ad702a34",
"score": "0.5668184",
"text": "def sightings\n evaluate! if @sightings.nil?\n\n return JSON.dump(@sightings)\n end",
"title": ""
},
{
"docid": "e68ceff200b129c396a880c7227ec8f9",
"score": "0.5658669",
"text": "def monies\n products.map(&:price)\n end",
"title": ""
},
{
"docid": "4370c51d714c605bbe56c0a8f5f47b62",
"score": "0.5651075",
"text": "def monsters\n\twp = Config.wavepoints_at_start + Config.wavepoints_increase * (number - 1)\n\t\n\tallmons = Monster.get_all.delete_if { |i| i.new.min_wave > number or i.new.wavecost > wp }\n\tsending = []\n\t\n\twhile allmons.size > 0\n\t m = allmons.sample\n\t sending << m\n\t wp -= m.new.wavecost\n\t allmons.delete_if { |i| i.new.wavecost > wp }\n\tend\n\n\tsending\n end",
"title": ""
},
{
"docid": "1ec2ef9aed5d36df31826fc8bf806919",
"score": "0.5642639",
"text": "def index\n @wiggles = Wiggle.all\n end",
"title": ""
},
{
"docid": "96478aa3fe09695f5073ec158da8efd0",
"score": "0.56236565",
"text": "def plays\n return @array_of_words\n end",
"title": ""
},
{
"docid": "0aa51638b7ca4f4f8280134b9b6a571b",
"score": "0.5617681",
"text": "def lifts_array\n array2 = []\n self.lifts.each do |lift|\n array2 << lift.chart_info_for_lift\n end\n array2\n end",
"title": ""
},
{
"docid": "048153d33e9c3f6c3e4cc0365ef21ead",
"score": "0.56061685",
"text": "def index\n @wepons = Wepon.all\n end",
"title": ""
},
{
"docid": "e7e7389e43d6a11adf84935cbab4bf41",
"score": "0.5601631",
"text": "def index\n @my_wineries = MyWinery.all\n end",
"title": ""
},
{
"docid": "148e34a28fbb7f19c2985e150d391af1",
"score": "0.56001866",
"text": "def ways \n return [] \n end",
"title": ""
},
{
"docid": "abb889a07a743d39406c8e7b341e2505",
"score": "0.5588786",
"text": "def get_strawberries\n @all_strawberries\n end",
"title": ""
},
{
"docid": "16874b48de6e0314ffe46515dce4df20",
"score": "0.55816144",
"text": "def get_all_wielded\n [\"left\", \"right\", \"dual\"].collect do |w|\n get_wielded(w)\n end.compact\n end",
"title": ""
},
{
"docid": "0a06b1f953af7da42bc189960de5bf74",
"score": "0.5575223",
"text": "def all\n @bands\n end",
"title": ""
},
{
"docid": "2c1348b398b21f6ceaa38b0b0b080f7f",
"score": "0.55713266",
"text": "def index\n @wbs = Wb.all\n end",
"title": ""
},
{
"docid": "1a50977ae8bd08f3e54dfc29a4eccce5",
"score": "0.5558715",
"text": "def getPositiveWordsArray\n return @positiveWordsArray\n end",
"title": ""
},
{
"docid": "4238a6b46f5b9d4bc32bf78b0a7360cb",
"score": "0.5556712",
"text": "def initialize\n @wolves = []\n end",
"title": ""
},
{
"docid": "55c7d88cc1738c53f4faac51a380d6a5",
"score": "0.5532782",
"text": "def index\n @whiches = Which.all\n end",
"title": ""
},
{
"docid": "7ef4be445d108d5c61b5f2e10cf90dbe",
"score": "0.55274975",
"text": "def array\n\t\treturn @hand_contents\n\tend",
"title": ""
},
{
"docid": "7c20079157a60b667c026cd898314f79",
"score": "0.55062234",
"text": "def otrzymane_wiadomosci\n\twiadomosci=[]\n\twhile(!@kolejka_wiadomosci.empty?)\n\t\twiadomosc=@kolejka_wiadomosci.pop(true) rescue nil\n\t\tbreak if wiadomosc.nil?\n\t\twiadomosci << wiadomosc\n\t\tyield wiadomosc if block_given?\n\tend\n\twiadomosci\n end",
"title": ""
},
{
"docid": "2e089acb9977d7e67153ea69fa74382f",
"score": "0.5504636",
"text": "def water_types\n self.waters.map{|water| water.water_type.category}.uniq.sort\n end",
"title": ""
},
{
"docid": "00895f08352610e88d95ba4049bdbf37",
"score": "0.55036205",
"text": "def get_shelves\n shelves = [@shelf_ag, @shelf_hp, @shelf_qz]\n return shelves\n end",
"title": ""
},
{
"docid": "75fbe79816d97ff794e580d8c9f5b22d",
"score": "0.54957616",
"text": "def species\n self.waters.map{|water| water.species.map{|s| s.name } }.flatten.uniq.sort\n end",
"title": ""
},
{
"docid": "1989e03cac45a2bd78d53e310aac54d5",
"score": "0.5485672",
"text": "def wheels\n return @wheels\n end",
"title": ""
},
{
"docid": "40981ccf19b9559c89988132cf1c0518",
"score": "0.54777473",
"text": "def index\n @wods = Wod.all\n end",
"title": ""
},
{
"docid": "87b48537f9222284f8c0819ba09527ba",
"score": "0.5458438",
"text": "def index\n @wombats = Wombat.all\n end",
"title": ""
},
{
"docid": "ab57721164cf7ca845c1af4250c2f444",
"score": "0.5458409",
"text": "def week_split\n days_array.each_slice(7).to_a\n end",
"title": ""
},
{
"docid": "58d346262f10d307308ee7fe0786efb0",
"score": "0.54569",
"text": "def whites\n matrix.select { |piece| piece && piece.color == :w }\n end",
"title": ""
},
{
"docid": "d0db5f13a15c382e11a637d27ccc3f45",
"score": "0.54495174",
"text": "def index\n @werks = Werk.all\n end",
"title": ""
},
{
"docid": "f83eb7a27da4f1d908962e372d534755",
"score": "0.5442166",
"text": "def wavelets # :nodoc:\n @wavelet_ids.map { |id| @context.wavelets[id] }\n end",
"title": ""
},
{
"docid": "21bcd270cec1baf2b5b69210ff3c07ab",
"score": "0.54417425",
"text": "def index\n @witnesses = Witness.all\n end",
"title": ""
},
{
"docid": "a285082a29d1d08ae6cbaa71aeeeba66",
"score": "0.5436167",
"text": "def edge_array\n\t\t\t to_return = @responses.collect { |item| item.sollutions }\n\t\t\t return to_return\n\t\tend",
"title": ""
},
{
"docid": "7c981859bfd4ed0fab1df2db36b17b8a",
"score": "0.5421051",
"text": "def wines\n client = Square::Client.new(\n access_token: Figaro.env.square_api_key,\n environment: 'production'\n )\n\n result = client.catalog.list_catalog(\n types: \"ITEM\"\n )\n \n if result.success?\n wines = result.data[0].filter {|item| item[:item_data][:name].start_with?(\"20\")}\n wine_data = wines.map do |wine|\n price = wine[:item_data][:variations][0][:item_variation_data][:price_money][:amount]\n {\n \"name\": wine[:item_data][:name],\n \"price\": price\n }\n end\n render json: wine_data.to_json\n elsif result.error?\n warn result.errors\n end\n end",
"title": ""
},
{
"docid": "8fe4fd22715a1e6091a3b04d4cf101a4",
"score": "0.542061",
"text": "def weights\n return @weights if @weights\n return @weights = [] if array.empty?\n\n lo = edges.first\n step = edges[1] - edges[0]\n\n max_index = ((@max - lo) / step).floor\n @weights = Array.new(max_index + 1, 0)\n\n array.each do |x|\n index = ((x - lo) / step).floor\n @weights[index] += 1\n end\n\n return @weights\n end",
"title": ""
},
{
"docid": "88f01987f24fcd313628d6d5bfb0dc75",
"score": "0.54145175",
"text": "def residents\n u = []\n @buildings.each { |building| u << building.workers }\n (-1..1).each do |xx|\n (-1..1).each do |yy|\n next if xx == 0 and yy == 0\n u << @game[@x+xx,@y+yy].worker\n end\n end\n return u.flatten.compact\n end",
"title": ""
},
{
"docid": "55b2dd7af0f93ff2d197e6460c122dde",
"score": "0.5407495",
"text": "def get_my_words\n # Words associated with online harassment\n trigger_words = [\"rape\",\"murder\",\"nigger\",\"slut\",\"whore\",\"bitch\",\"cunt\",\"kill\",\"die\",\"testword\"]\n my_words = Word.where(user_id: self.id)\n my_words.each do |word|\n trigger_words << word.word\n end\n return trigger_words\n end",
"title": ""
},
{
"docid": "13d5db42c4876d12af30626626b28cf2",
"score": "0.5398604",
"text": "def index\n @wits = Wit.all\n end",
"title": ""
},
{
"docid": "eb294e612aad5b3ce2dcd87bd0883b9f",
"score": "0.5394747",
"text": "def rebuild_weight_array\n end",
"title": ""
},
{
"docid": "943592a310ba446c414bf1382f8a7a4e",
"score": "0.5394469",
"text": "def word_values\n return @words.values\n end",
"title": ""
},
{
"docid": "e9b5b64cd9135a0ee8c8f025242e69d6",
"score": "0.53930867",
"text": "def index\n @unique_whitelines = UniqueWhiteline.all\n end",
"title": ""
},
{
"docid": "9f0f056ca064daa6043750bec1cc85df",
"score": "0.5390749",
"text": "def words\n []\n end",
"title": ""
},
{
"docid": "aa3790b8009d4931535c59abf3652e18",
"score": "0.538833",
"text": "def index\n @wfeats = Wfeat.all\n end",
"title": ""
},
{
"docid": "175973726765ba1c383098101ac3c5bd",
"score": "0.53846604",
"text": "def index\n @wine_varieties = WineVariety.all\n end",
"title": ""
},
{
"docid": "79269d773c58a5728c2ca11f5c1bff1c",
"score": "0.5378551",
"text": "def words\n @words\n end",
"title": ""
},
{
"docid": "3fdaa7645acf1b1bc5d8ece516863b80",
"score": "0.53720725",
"text": "def words\n @words\n end",
"title": ""
},
{
"docid": "5b8c08ba2833c4ae5e3e9e2546c4306a",
"score": "0.5370786",
"text": "def index\n @body_of_waters = BodyOfWater.all\n end",
"title": ""
},
{
"docid": "e281f56bd1d973ed37133035879abf2e",
"score": "0.53652215",
"text": "def all_winter_holiday_supplies(holiday_supplies)\n holiday_supplies[:winter].values.flatten\nend",
"title": ""
},
{
"docid": "aeb25691cb6d850c66e17f87e5de50f1",
"score": "0.53625035",
"text": "def element_set\n weapon = $data_weapons[@weapon_id]\n return weapon != nil ? weapon.element_set : []\n end",
"title": ""
},
{
"docid": "e822c21999eec02cd92a0bba886bbeec",
"score": "0.53578156",
"text": "def wine_type_by_food\n wine_array = self.wines\n wine_types = wine_array.map do |wine|\n wine.varietal\n end\n wine_types.uniq!\n end",
"title": ""
},
{
"docid": "f400cfe904f9f1d08b2e9a956687cb3b",
"score": "0.53561074",
"text": "def airports_normal\n return Array.new\n end",
"title": ""
},
{
"docid": "81deb29bcc824777511f4cf31df87bb2",
"score": "0.5355454",
"text": "def return_difficulties_array(doc)\n difficulties = doc.css(\".search-content .teaser-item__info-item--skill-level\")\n recipe_difficulties = []\n difficulties.each do |element|\n recipe_difficulties << element.text.strip\n end\n return recipe_difficulties\n end",
"title": ""
},
{
"docid": "bf8c7cadbb128c7898d8c0552f44fe2f",
"score": "0.53483903",
"text": "def index\n @walikelas = Walikela.all\n end",
"title": ""
},
{
"docid": "966dd54de0cc8141feeb6119915cc960",
"score": "0.5341428",
"text": "def wake_words\n\t\t[\"light\", \"lights\", \"scene\", \"seen\"]\n\tend",
"title": ""
},
{
"docid": "2c9189bbc9b314b5d06a6c67bfbc379b",
"score": "0.5340567",
"text": "def wheels\n @wheels\n end",
"title": ""
},
{
"docid": "29b8db21619de9f25e6b2ea12e1bdf45",
"score": "0.53403544",
"text": "def create_sample_array\n sample_array = []\n\n\n # add songs to sample-array in correct ratios\n @spins_per_week.each do |k,v|\n v.times { sample_array.push(PL::db.get_song(k)) }\n end\n\n sample_array\n end",
"title": ""
},
{
"docid": "17c57e8dee004972d1be47875b453813",
"score": "0.5336702",
"text": "def query_all_weight\n d = 0 \n eqs = query_all_wearings\n p \"=>wearing=#{eqs.inspect}\"\n eqs.each {|k,v|\n d+= v.weight if v\n }\n return d\n end",
"title": ""
},
{
"docid": "289821b14788b248b08a82bd37c72017",
"score": "0.5334049",
"text": "def wake_words\n [\"light\", \"lights\", \"scene\", \"seen\"]\n end",
"title": ""
},
{
"docid": "ba9d212afa6a3ece9e1d8ef285d59b29",
"score": "0.5332495",
"text": "def weeks\n\t\tk = offset( first_day.cwday )\n\n [ first_week( k ) ] + middle_weeks( DPW - k )\n end",
"title": ""
},
{
"docid": "52d21b73c38746fc8a7254c9b99fe2ce",
"score": "0.5331798",
"text": "def index\n @wts = Wts.all\n end",
"title": ""
},
{
"docid": "bf21f47a5448e985d8aeb5474fa1cb50",
"score": "0.53308886",
"text": "def get_drawable_objects()\n @ary = []\n @ary += @monsters\n @ary += @towers.values\n @ary += @bullets\n @ary << @placed_tower if @placed_tower\n @ary\n end",
"title": ""
},
{
"docid": "92a192199ebd82a3975b90c5e99788f4",
"score": "0.53265685",
"text": "def straights\n @analysis[:straights]\n end",
"title": ""
},
{
"docid": "e4ee818bfd0cee06fc34132723d79863",
"score": "0.5325246",
"text": "def index\n @user_wines = UserWine.all\n end",
"title": ""
},
{
"docid": "460f2f913d78edc0077adf2b59d6f8f7",
"score": "0.5324804",
"text": "def index\n @wines = Wine.all\n end",
"title": ""
},
{
"docid": "b447364317a0ae47d7ddef6aebc20063",
"score": "0.5312592",
"text": "def index\n @wows = Wow.all\n end",
"title": ""
},
{
"docid": "9223a0025d68d01c8fcf165dbc0cac19",
"score": "0.5303614",
"text": "def get_list(html_page)\n wines = []\n # Creation of hash for each wine, filled with each wine's basic infos\n html_page.search('.wine-container').each do |element|\n wine_basic_info = {}\n wine_basic_info[:wine] = element.search('.wine-infos > h3 > a').text.strip\n wine_basic_info[:region] = element.search('.wine-region').text.strip\n wine_basic_info[:color] = element.search('.wine-type').text.strip\n wine_basic_info[:link] = element.search('.wine-see-sheet > a').attribute('href').value\n\n wines << wine_basic_info\n end\n\n return wines # => array of hashes containing each wine's basic infos\nend",
"title": ""
},
{
"docid": "d2348890c4aa366770bdf406f4cee71d",
"score": "0.53017724",
"text": "def wear_locations\n @equip_slot_info.wear_locations\n end",
"title": ""
},
{
"docid": "1373c39b6b816808f85ffed37a67570f",
"score": "0.53000164",
"text": "def make_array\n [@name, @author, @deviation_url, @views, @favs, @comments]\n end",
"title": ""
},
{
"docid": "63fb75218e4be1775b2f4e1c3f9524b3",
"score": "0.529576",
"text": "def create_all_town_hall_array()\n page_all_town_hall_url = 'http://annuaire-des-mairies.com/val-d-oise.html'\n page_all_town_hall = Nokogiri::HTML(open(page_all_town_hall_url))\n all_town_hall_css = page_all_town_hall.css(\"a.lientxt\")\n all_town_hall = []\n\n all_town_hall_css.each do |name|\n all_town_hall << name.text\n end\n return all_town_hall\nend",
"title": ""
},
{
"docid": "165d00dada1b55b7b0fd0eaaf985aa0b",
"score": "0.5295193",
"text": "def index\n @brite_td_aswaxman_rt_waxmen = BriteTdAswaxmanRtWaxman.all\n end",
"title": ""
},
{
"docid": "655055fb33ccf31371a96bdfe1e43274",
"score": "0.5282468",
"text": "def complex_super_heroe\n heroes = [\"iron man\", \"hulk\", \"black widow\", \"thor\", \"captain marvel\"]\nend",
"title": ""
},
{
"docid": "9f08c0ce0d690b9e174acf536e4a7711",
"score": "0.52814084",
"text": "def index\n @brite_rt_waxmen = BriteRtWaxman.all\n end",
"title": ""
},
{
"docid": "2d22831c6464c0bd43bbe73f6b54daf8",
"score": "0.527885",
"text": "def get_wins_results_array_frequency_for_each_nominee\n winning_count = winning_results_frequency_for_each_nominee\n winning_arr = []\n\n winning_count.each do |key, value|\n winning_arr << key\n end \n\n return winning_arr\n end",
"title": ""
},
{
"docid": "69ed1fa9fa3726b8cef4bd10fd867753",
"score": "0.5276036",
"text": "def getNegativeWordsArray\n return @negativeWordsArray\n end",
"title": ""
},
{
"docid": "c5bbad9757075e8d488bb34a0acbedbe",
"score": "0.52723294",
"text": "def array\n @array\n end",
"title": ""
},
{
"docid": "81e918d3ed4240de7b5867cced1debea",
"score": "0.52718985",
"text": "def pick_whiskies\n countries\n end",
"title": ""
},
{
"docid": "621c2fd819ce11e970d8982028f401c9",
"score": "0.52701515",
"text": "def one_wolf\n return nil if @wolves.empty?\n @wolves.sample.name\n end",
"title": ""
},
{
"docid": "e5e82efc8e207e657d38f57950df70b1",
"score": "0.52669716",
"text": "def index\n @wynthoughts = Wynthought.all\n end",
"title": ""
},
{
"docid": "f07e7aaa70ae1f83f1d91e48b4c05507",
"score": "0.5261744",
"text": "def array\n @@array\n end",
"title": ""
},
{
"docid": "a0ca0786d9526199e0b403ee92b53c8a",
"score": "0.52531385",
"text": "def load_worker_array\n @worker_array = Worker.where(active: true).order(last_name: :asc).map { |worker_array| [worker_array.full_name, worker_array.badge_nbr]}\nend",
"title": ""
},
{
"docid": "a853a325fd0d0b2e458d6c0ffe54120b",
"score": "0.5249552",
"text": "def index\n @wines = Wine.all\n @scores = Score.all\n end",
"title": ""
},
{
"docid": "050bea5ca1589e87b5597c3bf130ba26",
"score": "0.52463263",
"text": "def elements; end",
"title": ""
},
{
"docid": "050bea5ca1589e87b5597c3bf130ba26",
"score": "0.52463263",
"text": "def elements; end",
"title": ""
},
{
"docid": "050bea5ca1589e87b5597c3bf130ba26",
"score": "0.52463263",
"text": "def elements; end",
"title": ""
},
{
"docid": "27c02bbdb70deb80b2b60eb95b2d707a",
"score": "0.5245473",
"text": "def index\n @wine_makers = WineMaker.all\n end",
"title": ""
},
{
"docid": "30c0a5fc771b4ca87a1e98f7ffdd7f07",
"score": "0.52196974",
"text": "def all_gyms\n lifter_membership.map {|lifter| lifter.gym}\n end",
"title": ""
},
{
"docid": "84b10e48e5b5402c51a541325aebe600",
"score": "0.52187026",
"text": "def build_sample\n sample = Array.new(8) {Array.new(8)}\n sample[0][0] = King.new(0, 0, 0)\n sample[7][7] = King.new(7, 7, 1)\n sample[0][4] = Rook.new(0, 4, 1)\n sample[4][0] = Rook.new(4, 0, 1)\n sample[4][4] = Bishop.new(4, 4, 1)\n sample\nend",
"title": ""
},
{
"docid": "72831fd308a83187ae9d77969ce105b1",
"score": "0.52183247",
"text": "def all\n return @recipearray\n end",
"title": ""
},
{
"docid": "ec4915dc036e275a22d54abe30eca950",
"score": "0.52137434",
"text": "def array\n\t\t#create an array of\n\t\tarray = [0, 1, 2, 3, 4, 5, 6, 7, 8]\n\tend",
"title": ""
},
{
"docid": "762c5881e2e8dc66ed34d4916d759440",
"score": "0.52129054",
"text": "def index\n @wizyta = Wizytum.all\n end",
"title": ""
},
{
"docid": "eade24f1eafd8c4684dfec0a8e594470",
"score": "0.52100295",
"text": "def spicy_foods \n [\n { name: 'Green Curry', cuisine: 'Thai', heat_level: 9 },\n { name: 'Buffalo Wings', cuisine: 'American', heat_level: 3 },\n { name: 'Mapo Tofu', cuisine: 'Sichuan', heat_level: 6 }\n ]\nend",
"title": ""
},
{
"docid": "65cfcafeee5f76ef2bb7a71cb8429a68",
"score": "0.52089024",
"text": "def index\n @wrecks = Wreck.all\n end",
"title": ""
},
{
"docid": "e6fc30548a616d771701c1122588dcd2",
"score": "0.52071476",
"text": "def all_weeks\n @all_weeks ||=\n data_points.each_with_object(Hash.new(0)) { |feed, all_weeks|\n all_weeks[feed.occurred_on.beginning_of_week(week_start_day)] += feed.send(field)\n }\n end",
"title": ""
},
{
"docid": "8cbe46186674ce4e6db25f264c9148b7",
"score": "0.5206208",
"text": "def index\n @whips = Whip.all\n end",
"title": ""
}
] |
2f43b97339ed23f4d2acd1213ef4587a | send an error notification email | [
{
"docid": "5f48a55f05d6211e91dfd2e0b9d519ba",
"score": "0.8297272",
"text": "def send_error_email(error)\n @error = error\n mail( :to => 'cave.survey.project+error@gmail.com',\n :subject => 'Error reported' )\n end",
"title": ""
}
] | [
{
"docid": "3fd63789960499807d98dcb5b1e5a18e",
"score": "0.8297547",
"text": "def notify_error(error)\n @error = error\n\n mail to: 'alessandro.asac@gmail.com', subject: 'Application Error Notification'\n end",
"title": ""
},
{
"docid": "e83449ff39861952dd5683deb1642b91",
"score": "0.82113343",
"text": "def error_occured(error)\n @error = error\n\n mail to: 'maren.heltsche@gmail.com', subject: 'An Error has occured'\n end",
"title": ""
},
{
"docid": "8d8f590b78c8b78b2d0dd7d9def77e44",
"score": "0.8129233",
"text": "def error_occured(error)\n @error = error\n\n mail to: \"navpreet.singh.k@gmail.com\", :subject => \"Error incident\"\n end",
"title": ""
},
{
"docid": "d36eea44bceed716ce84206ce0229a6e",
"score": "0.8115834",
"text": "def failed(error)\n @error = error\n\n mail to: ENV[\"ADMIN_EMAIL\"]\n end",
"title": ""
},
{
"docid": "6a7d1518bd1870dffb794ab2aca3371c",
"score": "0.8058255",
"text": "def error\n NotificationMailer.error\n end",
"title": ""
},
{
"docid": "d43616fd0a40de5e2804eb60fa05b5d3",
"score": "0.8056244",
"text": "def report_error(error)\n @error = error\n mail \n end",
"title": ""
},
{
"docid": "49c87f605456a6263e5acaa0ff4c6005",
"score": "0.80304307",
"text": "def error(exception)\n @recipients = \"Blavel Administrator <blavel@blavel.com>\"\n @subject = \"Error notification!\"\n @from = \"Blavel! <blavel@blavel.com>\"\n @sent_on = Time.now\n @body[:exception] = exception\n end",
"title": ""
},
{
"docid": "28dd81d0d645fc39c6952e50a9612373",
"score": "0.8008582",
"text": "def error_occurred(error)\n @error = error\n mail to: \"seivadmas@gmail.com\", subject: \"Danger, Will Robinson\"\n end",
"title": ""
},
{
"docid": "b3eab4e60b7a1d3b6671957028460a4a",
"score": "0.79637337",
"text": "def application_failure(error)\n @error = error\n\n mail to: \"elan.dubrofsky@gmail.com\", subject: \"Application failure in Depot\"\n end",
"title": ""
},
{
"docid": "2f6adbea3da045a6defa5263b66ccf57",
"score": "0.7962997",
"text": "def error_occured(error)\n @error = error\n\n mail to: \"andy@example.com\", :subject => 'Depot Mail Error Encountered'\n end",
"title": ""
},
{
"docid": "419bf687832ad6fae160e41a914ce051",
"score": "0.7955878",
"text": "def send_error_email(exception)\n send_to_email = \"dev@pebblecode.com\"\n send_from_email = settings.send_from_email\n subject = \"[#{settings.environment}] Vistazo: an error occurred\"\n\n @url = APP_CONFIG[\"base_url\"]\n @backtrace = \"\"\n exception.backtrace.each { |e| @backtrace += \"#{e}\\n\" }\n @exception = \"#{exception.class}: #{exception.message}\"\n\n send_google_email(send_from_email, send_to_email, subject, erb(:error_email, :layout => false))\nend",
"title": ""
},
{
"docid": "7fc1e28600f06670710fd0e1093d85b8",
"score": "0.78967804",
"text": "def mail_error(e)\n x = MailGem::Mail.new\n x.from = \"<email-address>\"\n x.to = \"<email-address>\"\n x.subject = \"Server Loading Error\"\n x.body = e.message\n x.send\nend",
"title": ""
},
{
"docid": "4b66e4436e39f8907c0fde47cc627204",
"score": "0.7884413",
"text": "def notification_error(options = {})\n Rails.logger.error(\"!! NOTIFICATIONS FAILED.\")\n subject = \"Notifications not sent due to error\"\n user_id = EolConfig.find_by_parameter('notification_error_user_id').value\n to = user_id ? User.find(user_id) : User.first\n @user = options[:user] || 'unknown'\n @note_ids = options[:note_ids] || ['unknown']\n @error = options[:error] || 'unknown'\n @frequency = options[:fqz].to_s || 'unknown'\n @backtrace = options[:backtrace].to_s || 'unknown'\n set_locale(to)\n mail(\n to: to.email\n )\n end",
"title": ""
},
{
"docid": "7e13260f53a5dd2c79ba0aa84303a91a",
"score": "0.7882218",
"text": "def error(error_message)\n @error = error_message\n mail to: \"to@example.com\", subject: 'Depot App Error Incident'\n end",
"title": ""
},
{
"docid": "fb9489ab0dba035c9e9c7bdfb63aea5a",
"score": "0.7818977",
"text": "def error(exception)\n @exception = exception\n mail to: \"nettiks@live.com\", subject: \"Rescue error occurred: #{exception}\"\n end",
"title": ""
},
{
"docid": "7aab4c97cea246e85f404a16d38e6325",
"score": "0.7807496",
"text": "def exception_notification(error, params=nil)\n params.delete(:password) if params\n @params = params\n @error = error\n mail({\n :subject => \"DocumentCloud exception (#{Rails.env}:#{`hostname`.chomp}): #{error.class.name}\",\n :from => NO_REPLY,\n :to => EXCEPTIONS\n })\n end",
"title": ""
},
{
"docid": "68be477472d7e73d9634def4fda1910c",
"score": "0.7779169",
"text": "def error_notifier\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "bc1335f1abf08a8ef65f7600b0e08928",
"score": "0.77637005",
"text": "def project_errors_email(errors)\n @errors = errors\n mail to: \"beat.me.down@gmail.com\", subject: \"Errors! Fix Before Listing Sendout\"\n end",
"title": ""
},
{
"docid": "7d6537b617adb86e2c58ad9cbbf458a2",
"score": "0.77548736",
"text": "def notify_error(exception)\n @exception = exception\n\n mail to: \"admin@rails6bookstore.com\", subject: \"Rails 6 Bookstore Error!!\"\n end",
"title": ""
},
{
"docid": "736885236b5fd086c1ec28151f664fce",
"score": "0.7754347",
"text": "def notify_devs(error)\n ApplicationMailer.notify(\n body: {error: error, input_params: @params},\n data: {},\n subject: \"Error in SignUp Job\"\n ).deliver\n end",
"title": ""
},
{
"docid": "6c890ff21d5b1fd3a65f0b4a31f2242e",
"score": "0.77519774",
"text": "def error_mailer (error)\n @error = error\n mail :to => mail[:from].value, :subject => 'Depot App Error Reporting' \n end",
"title": ""
},
{
"docid": "14094631db7a7475dfa06eed33387807",
"score": "0.7740478",
"text": "def occured(error)\n @error = error\n mail to: \"emmanuel_cousin@hotmail.fr\", subject: \"Error Incident Notification\"\n end",
"title": ""
},
{
"docid": "08c4a94f00355d359da3220e6bfd7751",
"score": "0.7683147",
"text": "def email_error(user, build=nil)\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "f618a09938bbdc59b41349658f855fc5",
"score": "0.7671302",
"text": "def bad_cart(error)\n @error = error\n\n mail to: \"robin.e.jayaswal.18@dartmouth.edu\", subject: \"Error Notification\"\n end",
"title": ""
},
{
"docid": "70b55877353363aee6f50f57c2736948",
"score": "0.7646778",
"text": "def error_email(error, source)\n @error = error\n @source = source\n mail subject: \"[#{ENV['INSTALLATION_TYPE']}][Statistic Upload Error]\", to: 'alert@whiteboxteam.com'\n end",
"title": ""
},
{
"docid": "123eff6777ea7c620e934f8cf0651cd0",
"score": "0.7636023",
"text": "def send_failure_email\n Notifier.order_support_request( self, \" Had an ERROR and needs attention\").deliver\n end",
"title": ""
},
{
"docid": "ff8d49ef6c2a8ba5cd4e93dc54d3e9ce",
"score": "0.7531883",
"text": "def exception(user_project, error)\n @error = error\n @project = user_project.project\n mail to: user_project.user.email, subject: \"BatBugger (#{@project.name} : #{error.title})\"\n end",
"title": ""
},
{
"docid": "f6c110d3f129489b13e257a9a5e7bcee",
"score": "0.7527234",
"text": "def send_error_report\n ReportMailer.send_error_report(self).deliver_later\n end",
"title": ""
},
{
"docid": "f6c110d3f129489b13e257a9a5e7bcee",
"score": "0.752656",
"text": "def send_error_report\n ReportMailer.send_error_report(self).deliver_later\n end",
"title": ""
},
{
"docid": "86f94f74fbd4d1da6b8e657c6cc90820",
"score": "0.74897295",
"text": "def emailErrorMessage(msg)\n obj = EmailHelper.new()\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"Error in starting GERALD analysis for \" + @fcName + \"-\" + @laneBarcode.to_s\n emailText = msg\n\n obj.sendEmail(emailFrom, emailTo, emailSubject, emailText)\n end",
"title": ""
},
{
"docid": "44a634075981f30551f1239b2ba72e8b",
"score": "0.74661034",
"text": "def error(cart)\n @cart = cart\n\n mail to: \"brunoraphael89@gmail.com\", subject: 'A error occurred'\n end",
"title": ""
},
{
"docid": "36e1d07c3eebfbc2d5bcfe2d7481b435",
"score": "0.7437951",
"text": "def failure email\n @email = email\n @url = 'http://dormbook.danopia.net'\n\n mail :to => @email.from, :subject => 'There was a problem reading your rooming email'\n end",
"title": ""
},
{
"docid": "2f3c36ca6277151a63cab9d2b78f9e80",
"score": "0.74090147",
"text": "def error(user)\n @user = user # Instance variable => available in view\n\n mail(to: @user.email, subject: 'An error occoured')\n end",
"title": ""
},
{
"docid": "681750d1e31e1157bdeecd0ddf5a0af2",
"score": "0.7383415",
"text": "def emailErrorMessage(msg)\n obj = EmailHelper.new()\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"Error in demultiplexing flowcell \" + @fcName.to_s\n emailText = msg\n\n obj.sendEmail(emailFrom, emailTo, emailSubject, emailText)\n end",
"title": ""
},
{
"docid": "681750d1e31e1157bdeecd0ddf5a0af2",
"score": "0.7383415",
"text": "def emailErrorMessage(msg)\n obj = EmailHelper.new()\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"Error in demultiplexing flowcell \" + @fcName.to_s\n emailText = msg\n\n obj.sendEmail(emailFrom, emailTo, emailSubject, emailText)\n end",
"title": ""
},
{
"docid": "4e07895593426b36d8640a2c2bf9ed32",
"score": "0.73668617",
"text": "def send_failure_mail(_e)\n # body = e.json_body\n # err = body[:error]\n # DeveloperMailer.failure_notice(err[:type], err[:message]).deliver_later\n end",
"title": ""
},
{
"docid": "7836cdd3289117fd48ffb51437746bfb",
"score": "0.7354021",
"text": "def sent_notifications\n # sent email to admin if error\n end",
"title": ""
},
{
"docid": "6859ff644203fbfbe8581db6c1cb744d",
"score": "0.7353274",
"text": "def bhn_error_email(emailmessage)\n\t \n\t @emailmessage = emailmessage\n\n\t mail(to: 'vipul30@gmail.com', subject: 'BHN API Error').deliver()\n\tend",
"title": ""
},
{
"docid": "23d30d556d1203116a2afcf05efd90a9",
"score": "0.73530537",
"text": "def error(message)\n @message = message\n\n mail subject: 'Pragmatic Store Error'\n end",
"title": ""
},
{
"docid": "69c459d57550aa63d2972b83a4b7b2cc",
"score": "0.7337284",
"text": "def send_failed_mail(response)\n ApplicationMailer.notify(\n to: GlobalConstant::Email.default_to,\n body: \"Call to Acuris Api failed\",\n data: {shard_identifier: @shard_identifier, aml_search_id: @aml_search_obj.id, response: response.inspect},\n subject: \"Something went wrong with Acuris Api.\"\n ).deliver\n end",
"title": ""
},
{
"docid": "7fe682f1763cf297ddd01483e67a3427",
"score": "0.73338956",
"text": "def notify_error(photo, error, params)\n \t@photo = photo\n @error = error\n @params = params\n to = [\"lienptb@elarion.com\", \"adrian@appiphany.com.au\"]\n\n mail :to => email_to(to), :subject => \"[Pocket Prints] Error when uploading Photo\"\n end",
"title": ""
},
{
"docid": "c2207bae6fa9576cfc1d90d9a240eb5b",
"score": "0.732917",
"text": "def error(msg, bt)\n @msg = msg\n @bt = bt\n\n mail to: BANK_ADMIN\n end",
"title": ""
},
{
"docid": "e4707d1cf023ff66dbb30f28c6a1a2ec",
"score": "0.7327512",
"text": "def error(exception, session = nil, params = nil, env = nil, user = nil)\n @exception = exception\n @session = session\n @params = params\n @env = env\n @user = user\n path = (env && env['REQUEST_URI']) ? (\": \" + env['REQUEST_URI']) : \"\"\n exception_name = @exception ? \": #{@exception.class} #{@exception.message}\" : \"\"\n mail(:to => configatron.webmaster_emails, :subject => \"Error#{path}#{exception_name}\")\n end",
"title": ""
},
{
"docid": "62fe4bd7e4be1f7357a63e50493bdf71",
"score": "0.7326615",
"text": "def emailErrorMessage(msg)\n obj = EmailHelper.new()\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"Archive Script : Error encountered in appending directory paths for date : \" + \n @dateOfInterest.to_s\n emailText = msg\n\n obj.sendEmail(emailFrom, emailTo, emailSubject, emailText)\n end",
"title": ""
},
{
"docid": "bc1bd5f2e157970064d95a83de3bc9e3",
"score": "0.72837615",
"text": "def email_error\n #not yet implemented\n end",
"title": ""
},
{
"docid": "ccf21ecb2779a42a247040905c29c414",
"score": "0.7256364",
"text": "def error(error_recipients, job, execution_message, error_message)\n @application = Ubiquo::Settings.get(:app_name)\n @job = job\n @error_message = error_message\n @execution_message = execution_message\n\n subject = \"[#{app_name} #{Rails.env} CRON JOB ERROR] for job: #{job}\"\n mail(:to => error_recipients,\n :subject => subject)\n end",
"title": ""
},
{
"docid": "b3d0e7bb52de015f52e1e06c962b6ad8",
"score": "0.7252224",
"text": "def email_failed_message\n Notifier.deliver_survey_stalled_notification(self)\n end",
"title": ""
},
{
"docid": "0afc63e1cbd40c7fc9136c2cb1d8104d",
"score": "0.7223265",
"text": "def handleError(msg)\n errorMessage = \"Error while uploading sequence results to LIMS. Working Dir : \" +\n Dir.pwd + \" Message : \" + msg.to_s\n\n obj = EmailHelper.new()\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"Error while uploading sequence results to LIMS\" \n\n obj.sendEmail(emailFrom, emailTo, emailSubject, errorMessage)\n puts errorMessage.to_s\n exit -1\n end",
"title": ""
},
{
"docid": "1fb14acedbf737a45ae3359c1a1f8932",
"score": "0.71865016",
"text": "def notify_devs(error_data, subject='Error while WhitelistManagement::ProcessAndRecordEvent')\n ApplicationMailer.notify(\n body: {},\n data: {error_data: error_data},\n subject: subject\n ).deliver\n end",
"title": ""
},
{
"docid": "7f6e5535534b796dd3b4bf52da7e51a2",
"score": "0.71862054",
"text": "def email_on_failure(reason, e)\n # `echo \"#{reason}\\n\\nException trace:\\n#{e.inspect}\" | mail #{TO_EMAIL} -F #{FROM_EMAIL} -s \"Passenger Management Exception\"`\n puts \"Passenger Management Exception\"\n puts reason\n puts \"Exception Trace:\\n#{e.inspect}\"\nend",
"title": ""
},
{
"docid": "708adc1c49bc784c86f2c5ab997a996d",
"score": "0.71599007",
"text": "def NewsletterSignupFailed\n mail(to: \"quannnl92@gmail.com\", subject: \"A failed newsletter signup\")\n end",
"title": ""
},
{
"docid": "bfff6142003c7193bb0f9c4b24509057",
"score": "0.7144487",
"text": "def error\n ProductMailer.error\n end",
"title": ""
},
{
"docid": "19d94662c64a84fdcdd7accccac2e4bf",
"score": "0.7125178",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: {client_token_id: @client_token_id},\n subject: 'Exception in PlanEconomyJob'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "52f50247a2bb97b6017332685b74fb78",
"score": "0.7112221",
"text": "def report(exception)\n @exception = exception\n\n mail subject: 'Depot Error Report'\n end",
"title": ""
},
{
"docid": "2dfd61e476b236551cb24284de2e78a0",
"score": "0.70975465",
"text": "def handleError(errorMsg)\n errorMessage = \"Error while obtaining information from LIMS for flowcell : \" +\n @fcName + \" Error message : \" + errorMsg.to_s\n obj = EmailHelper.new\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"LIMS error while getting info for flowcell : \" + @fcName.to_s\n obj.sendEmail(emailFrom, emailTo, emailSubject, errorMessage)\n puts errorMessage.to_s\n exit -1\n end",
"title": ""
},
{
"docid": "cd780bab97a13999f67b7a4fcd9dd4da",
"score": "0.70897746",
"text": "def email_notification\n return true unless should_email?\n Mailer.err_notification(self).deliver_now\n rescue => e\n # Don't send a notice if we fail to send a notice\n # that we've failed to send a notice.\n # i.e. Don't make this an infinite loop.\n return if app.name == \"Self.Errbit\" &&\n backtrace.includes?(\"app/models/notice.rb#email_notification\")\n HoptoadNotifier.notify(e)\n end",
"title": ""
},
{
"docid": "5c80da81847ea3fefe0f19e41869edc7",
"score": "0.70892715",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: {manager_id: @manager_id},\n subject: 'Exception in SignUpJob'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "1da2db3b12a09b207c10a74108a569dc",
"score": "0.707365",
"text": "def send_error_order\n order = Order.where(status: \"error\").first\n OrderMailer.send_order(\n order: order,\n status: \"error\",\n email: order.user.email, # send to brand/landing (currently just sending to Landing)\n subject: \"Landing International: Order Error/Dispute\"\n )\n end",
"title": ""
},
{
"docid": "cdc4a19bcd39b546f1f93f1c9c2733aa",
"score": "0.7049271",
"text": "def ContactSubmitFailed\n mail(to: \"quannnl92@gmail.com\", subject: \"A failed contact submit\")\n end",
"title": ""
},
{
"docid": "b2ad07c1f6f883aea52555810abc07ea",
"score": "0.7041189",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: { manager_id: @manager_id },\n subject: 'Exception in Post signup sandbox tasks job'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "a9217bae0902f4bce5eb15249fb04d34",
"score": "0.7036003",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: {manager_id: @manager_id},\n subject: 'Exception in SignUpJob'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "a0381d4e1985af1faaad2acabeee23a1",
"score": "0.702575",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: {email_address: @email_address,\n company_name: @company_name},\n subject: 'Exception in FormIntegrationJob'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "086b73766acc99a16f1c2f70e1f01dd2",
"score": "0.7009816",
"text": "def notify_error(exception, options = {})\n if Rails.env == \"production\"\n begin\n AdminMailer.error(exception, session.to_hash, params, request.env, current_user).deliver\n rescue\n logger.error(\"ERROR SENDING ERROR NOTIFICATION: #{$!.to_s}: #{$!.message}\\n#{$!.backtrace.to_a.join(\"\\n\")}\")\n end\n end\n # still show error page unless requested not to\n raise exception unless options[:dont_re_raise]\n end",
"title": ""
},
{
"docid": "1d8e045b31c8300087415c43637d3722",
"score": "0.6983999",
"text": "def notify_error(exception, options = {})\n if Rails.env == \"production\"\n begin\n AdminMailer.error(exception, session.to_hash, params, request.env, current_user).deliver\n rescue\n logger.error(\"ERROR SENDING ERROR NOTIFICATION: #{$!.to_s}: #{$!.message}\\n#{$!.backtrace.to_a.join(\"\\n\")}\")\n end\n end\n # still show error page unless requested not to\n raise exception unless options[:dont_re_raise]\n end",
"title": ""
},
{
"docid": "ed83f9d02869296de08ae935aa60b97f",
"score": "0.69808877",
"text": "def twitter_error(user, build=nil)\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "dc71be1c2678e5eefd8f698a47ec1bc4",
"score": "0.6963735",
"text": "def log_error(ex) \n super(ex)\n\n begin\n unless (recipient = ENV['CONTENTER_ERROR_EMAIL_TO']).blank?\n subject = ENV['CONTENTER_ERROR_EMAIL_SUBJECT'] + \" \" + ex.message\n body = get_error_info(ex, ENV['CONTENTER_ERROR_EMAIL_BODY'] )\n quick_mail(subject, recipient, body)\n end\n rescue => e\n logger.error(e)\n end\n end",
"title": ""
},
{
"docid": "a28f9cf56a65b0dc0b9b6c78f06a3a34",
"score": "0.6956692",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: {manager_id: @manager_id},\n subject: 'Exception in InviteJob'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "95a80503dd0cdb76e7d592c684e974fb",
"score": "0.69398725",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: {client_id: @client_id},\n subject: 'Exception in associate address'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "c3b35f192e088f1ec3708aac2303f69f",
"score": "0.6931281",
"text": "def capture_payment_error_notification(order, error)\n @order = order\n @error = error\n subject = \"Payment Capture Failed - #{order.number}\"\n mail(:to => \"nflanagan@reservebar.com, jgroves@reservebar.com\", :subject => subject)\n end",
"title": ""
},
{
"docid": "7e5933510d087eae9574e884eac9f1a7",
"score": "0.69299734",
"text": "def bulk_observation_error(user, observation_file, error_details)\n setup_email(user)\n @subject << \"We're sorry but your bulk import of #{observation_file} has failed.\"\n\n @message = error_details[:reason]\n @errors = error_details[:errors]\n @field_options = error_details[:field_options]\n\n mail(:to => \"#{user.name} <#{user.email}>\", :subject => @subject, :from => @from)\n end",
"title": ""
},
{
"docid": "2e9e7dd09ca83107e7ae51a14bf227d0",
"score": "0.69066185",
"text": "def failure\n puts \"Email failed: \" + params[:event].to_s + \" \" + params[:recipient].to_s + \" \" + params[:reason].to_s +\n \" \" + Time.at(params[:timestamp].to_i).to_datetime.to_time.to_s\n render text: 'Failure Acknowledged'\n\n end",
"title": ""
},
{
"docid": "5918e58311b8863e22adc4f495468101",
"score": "0.68996066",
"text": "def send_email(error_list)\n\n\tMail.deliver do\n\t to @to_email\n\t from @from_email\n\t subject \"Raid Errors/Warnings Found On Server \\\"#{@hostname}\\\"\"\n\t body \"The following alerts were found in the last 24 hours:\\n\\n#{error_list}\"\n end\n\nend",
"title": ""
},
{
"docid": "eadc822148d3c545aef4f9e5fc4b3e42",
"score": "0.689938",
"text": "def notify_failure!(exception)\n mail[:subject] = \"[Backup::Failed] #{model.label} (#{model.trigger})\"\n mail[:body] = read_template('notify_failure', Binder.bind(:model => @model, :exception => exception))\n mail.deliver!\n end",
"title": ""
},
{
"docid": "f487c8c608a0085b5076b2304c73fc90",
"score": "0.68797153",
"text": "def email_error (msg, dns_response)\n puts msg\n puts dns_response\n puts \"=================\"\nend",
"title": ""
},
{
"docid": "eef12fa5ef8d3bfcd59921ba4d72c4c4",
"score": "0.6875478",
"text": "def admin_password_sms_notifier_failed_email(registration)\n @registration = registration\n mail(to: mail_to, subject: 'Уведомление о неудачной отправке смс с паролем')\n end",
"title": ""
},
{
"docid": "9bae02c6b11cfc063c84af4e9543a1ff",
"score": "0.68741655",
"text": "def notify_devs\n ApplicationMailer.notify(\n data: @failed_logs,\n body: {},\n subject: 'Exception in client mile stone hook creation'\n ).deliver if @failed_logs.present?\n end",
"title": ""
},
{
"docid": "24a1c8983f0cc5445e9380a1b43ad00f",
"score": "0.6863812",
"text": "def message_error(email,hl7,error)\n @subject = \"Wedgetail Got Wedgied\"\n @recipients = ['Ian Haywood <ihaywood@iinet.net.au>']\n @from = Pref.email\n part :content_type => \"text/plain\",:body=>error\n if hl7\n attachment :content_type => \"text/plain\",\n :body=> hl7.to_s,\n :filename=> \"hl7.txt\"\n else\n attachment :content_type => \"message/rfc822\",\n :body => email.encoded,\n :filename =>\"email\"\n end\n end",
"title": ""
},
{
"docid": "cf24711afed58f62c1e14590340f4d6d",
"score": "0.6863274",
"text": "def failure_message(message)\n sender = \"Database Team <db@engineyard.com\"\n recipients = \"db@engineyard.com\"\n hostname = `hostname`.chomp\n subject = \"An error has occurred while purging binary logs on #{hostname}\"\n mailtext = <<EOF\nFrom: #{sender}\nTo: #{recipients}\nSubject: #{subject}\n#{message}\nEOF\n\t\n begin Net::SMTP.start('mail') do |smtp|\n smtp.sendmail(mailtext, 'root@' + hostname, recipients)\n end\n rescue Exception => e\n log_error \"Exception occurred: \" + e\n end\n \n exit(1)\nend",
"title": ""
},
{
"docid": "96fc5c7207ba66e06d7b9c9e07e844b7",
"score": "0.68510735",
"text": "def handleError(commandName)\n errorMessage = \"Error while processing command : \" + commandName.to_s +\n \" for flowcell : \" + @fcBarcode.to_s + \" Working Dir : \" +\n Dir.pwd.to_s + \" Hostname : \" + @envInfo.getHostName() \n # For now keep like this\n emailSubject = \"Error while mapping : \" + @fcBarcode.to_s\n\n obj = EmailHelper.new()\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"Error during mapping on host \" + @envInfo.getHostName() \n\n obj.sendEmail(emailFrom, emailTo, emailSubject, errorMessage)\n\n puts errorMessage.to_s\n exit -1\n end",
"title": ""
},
{
"docid": "eff5eb5c775713b5620f2620ba96721f",
"score": "0.68459004",
"text": "def fatal_error_on_video(user)\n @user = user\n \n mail( :to => @user.email,\n :subject => \"There was an error processing your video\")\n end",
"title": ""
},
{
"docid": "a3d23c466ce65a9d3ca6b1a9ebb7d785",
"score": "0.68457276",
"text": "def notify_admin_parse_launch_fail(study, study_file, corresponding_user, ingest_action, error)\n dev_email_config = AdminConfiguration.find_by(config_type: 'QA Dev Email')\n # if QA Dev email is configured, use that over individual admin emails\n if dev_email_config.present?\n emails = [dev_email_config.value]\n else\n emails = User.where(admin: true).map(&:email)\n end\n @user = corresponding_user\n @study = study\n @study_file = study_file\n @error = error\n @action = ingest_action\n title = 'Ingest Pipeline Launch Failure'\n mail(to: emails, subject: '[Single Cell Portal Admin Notification] ' + title)\n end",
"title": ""
},
{
"docid": "a8cbbb27221b936e4dd388eb504817ae",
"score": "0.6842464",
"text": "def notify_error message, time=3\n _notify(message, time, 'error')\n end",
"title": ""
},
{
"docid": "863621af7102684cdfe36c831bb76120",
"score": "0.6836266",
"text": "def failure_message(message)\n sender = \"Database Team <db@engineyard.com\"\n recipients = \"db@engineyard.com\"\n hostname = `hostname`.chomp\n subject = \"An error has occurred while purging binary logs on #{hostname}\"\n mailtext = <<EOF\nFrom: #{sender}\nTo: #{recipients}\nSubject: #{subject}\n#{message}\nEOF\n\n begin Net::SMTP.start('mail') do |smtp|\n smtp.sendmail(mailtext, 'root@' + hostname, recipients)\n end\n rescue Exception => e\n log_error \"Exception occurred: \" + e\n end\n \n exit(1)\nend",
"title": ""
},
{
"docid": "6600f947c0feea102e9cc4d784600daf",
"score": "0.6829435",
"text": "def failure_notification(message = \"\")\n @message = message\n mail :subject => \"Whiteboard failure notification\"\n end",
"title": ""
},
{
"docid": "7a8d9f016e91631cd9715d15bdd6b0e9",
"score": "0.68274224",
"text": "def error!(error, atts={})\n Effective::OrdersMailer.order_error(\n order: qb_request.try(:order),\n error: error,\n to: EffectiveQbSync.error_email,\n subject: \"Quickbooks failed to synchronize order ##{qb_request.try(:order).try(:to_param) || 'unknown'}\",\n template: 'qb_sync_error'\n ).deliver_now\n\n update!(atts.reverse_merge(last_error: error))\n end",
"title": ""
},
{
"docid": "05db3170829e0e06b9e5e2c5b3cf7263",
"score": "0.68002355",
"text": "def send_error message\n send_data \"ERROR: \" + message\n end",
"title": ""
},
{
"docid": "d2ce8580f22737feb45fc22dd568adbd",
"score": "0.6799933",
"text": "def send_email\n emails = @all_notices\n emails = emails.concat(@error_notices).uniq unless @errors.empty?\n\n LoaderMailer.output_email(title, emails, output).deliver_now\n log_warning(SENT_EMAIL, \"to #{emails.join(', ')} on #{Time.now.strftime('%c')}\")\n end",
"title": ""
},
{
"docid": "3120b5f6d09657939dd95fc280c4caa6",
"score": "0.6792824",
"text": "def send_email\n self.sending_email!\n begin\n Notifier.deliver_ticket(self)\n rescue Exception => e\n # TODO catch specific exception?\n self.update_attribute :report, \"Could not send email: #{e.class.name}, #{e.message}\"\n self.failed_to_send_email!\n else\n self.sent_email!\n end\n end",
"title": ""
},
{
"docid": "f467f2e15fee2424d6b924b6f4e6d090",
"score": "0.67855525",
"text": "def order_failed_email\n AdminMailer.order_failed_email\n end",
"title": ""
},
{
"docid": "f5e47c019c0adb77ce96091e0d94debd",
"score": "0.6773884",
"text": "def notify_devs(error_data, err_message)\n ApplicationMailer.notify(\n body: {err_message: err_message},\n data: {\n error_data: error_data\n },\n subject: 'Error while ConfirmKycWhitelist'\n ).deliver\n end",
"title": ""
},
{
"docid": "42a625d720483f1f938ded94f728f5fa",
"score": "0.67729354",
"text": "def deliver_exception(exception,current_user=nil)\n @env = Rails.env\n @exception = exception\n @current_user = current_user\n mail(:to => [\"benedikt@startwork.in\",\"miro@startwork.in\", \"robert@startwork.in\"], :subject => \"Error auf StartWork.in\") \n end",
"title": ""
},
{
"docid": "ce09fde1d2ba85f7afd427cb8517c6a1",
"score": "0.67567",
"text": "def failed_update(event)\n error \"Update failed: #{event.payload[:update]}\"\n\n Mailer.exception(\n event.payload[:exception],\n event.payload[:update],\n event.payload[:database_queries]\n ).deliver_now\n end",
"title": ""
},
{
"docid": "a84851452ab7ffa1a3b8befda0ec08e3",
"score": "0.6694422",
"text": "def notify_devs\n ApplicationMailer.notify(\n body: {\n to_be_retried: @failed_hook_to_be_retried\n },\n data: {\n process_failed: @process_failed\n },\n subject: 'Errors in EmailServiceApiCall Hook Processor'\n ).deliver if @failed_hook_to_be_retried.present?\n end",
"title": ""
},
{
"docid": "2dee8c3ab793a462067450f2ede9842d",
"score": "0.66928744",
"text": "def order_failed_email(user)\n @user = user\n\n mail subject: 'Не удалось купить кота'\n end",
"title": ""
},
{
"docid": "0d710372704996118e5adedc9c0b7596",
"score": "0.66793376",
"text": "def failure(recipient)\n @user = recipient\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "7dc9bc3c5bd790bb02f9125fbdeeeb18",
"score": "0.667017",
"text": "def handle_resend_errored(error)\n Airbrake.notify error, registration: registration.reg_identifier\n Rails.logger.error \"Error resending renewal email for registration #{registration.reg_identifier}\"\n\n message = I18n.t(\"resend_renewal_email.messages.error.heading\", email: registration.contact_email)\n description = I18n.t(\"resend_renewal_email.messages.error.details\")\n\n flash_error(message, description)\n end",
"title": ""
},
{
"docid": "ebdf2bbe3c6c39cbd24899fff09bbd1a",
"score": "0.6667718",
"text": "def exception_mail(user, error_description, error_backtrace)\n @admin_names = GogglesCore::AppConstants::WEB_ADMIN_EMAILS\n @user_name = user.name if user.respond_to?(:name)\n @description = error_description\n @backtrace = error_backtrace\n @host = GogglesCore::AppConstants::WEB_MAIN_DOMAIN_NAME\n\n mail(\n subject: \"[#{GogglesCore::AppConstants::WEB_APP_NAME}@#{@host}] AgexMailer EXCEPTION: '#{error_description}'.\",\n to: GogglesCore::AppConstants::WEB_ADMIN_EMAILS,\n date: Time.zone.now\n )\n end",
"title": ""
},
{
"docid": "7930cbc99f075a687e06d07a71f461d9",
"score": "0.6667213",
"text": "def send_studio_email\n @message = params[:message]\n @messagebody = params[:message][:body] + \"<br/><font color='#FF0080'>\" + params[:signature].to_s+\"</font>\"\n all_the_recipient = params[:message][:email].split(',')\n someusersfailed = true\n all_the_recipient.each do |rec|\n begin\n EmailSystem::deliver_email_notification(rec,params[:message][:subject],@messagebody)\n rescue => exc\n p \"this is exception i got\"\n p exc\n someusersfailed = false\n end\n end\n if someusersfailed\n flash[:notice] = \"Please Try Again\"\n redirect_to \"/admin/show_studio_mail\"\n else\n flash[:notice] = \"Message sent.\"\n redirect_to :back \n end\n end",
"title": ""
},
{
"docid": "6424654b12aeb4188fac25820bfeeb6d",
"score": "0.66618645",
"text": "def error_500(exception)\n exception_log = ExceptionLog.new(exception_attributes(exception))\n exception_log.user = current_user if current_user.present?\n exception_log.save\n ExceptionMailer.notify_exception(exception_log , exception).deliver\n render :template => 'errors/error_500', :layout => 'error'\n true\n end",
"title": ""
},
{
"docid": "b2620b33587c1c6ea095202346f6bd43",
"score": "0.6658586",
"text": "def failure(job)\n SyncFailureMailer.failure(job.id).deliver\n end",
"title": ""
}
] |
8a03054d049b6d6db56e89e85bd88374 | DELETE /order_items/1 DELETE /order_items/1.json | [
{
"docid": "44e9bb363b0b2595a31430240c31aec6",
"score": "0.7259253",
"text": "def destroy\n @order_item.destroy\n respond_to do |format|\n format.html { redirect_to order_items_url, notice: 'Order item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "a2ee841c093b6873595230ab15402c26",
"score": "0.7660662",
"text": "def destroy\n @item_order = ItemOrder.find(params[:id])\n @order = Order.where(:id => @item_order.item_id)\n @item_order.destroy\n\n respond_to do |format|\n format.html { redirect_to order_url(@order) }\n format.json { head :no_content }\n\n end\n end",
"title": ""
},
{
"docid": "eeed82e0c48af35f2fa5e0ae45b40fc9",
"score": "0.7625405",
"text": "def destroy\n # CSH nunca pode apagar, apenas pode mudar o estado para anulado\n # os items têm de ser libertados\n LineItem.where(\"order_id = ?\", @order.id).destroy_all\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c162232f39db0abbdf726fd8ae57ac51",
"score": "0.76143897",
"text": "def destroy\n @scrap_order_item = @scrap_order.items.find(params[:id])\n @scrap_order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to scrap_order_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c408beb419c62cd7d0e2744b00331a9",
"score": "0.7613709",
"text": "def destroy\n @item = Item.find(params[:id])\n @order = @item.order\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to @order }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a60e627c6780bfe7eb72889bd9d54065",
"score": "0.76079386",
"text": "def destroy\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to order_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c616b6ba2a71aeb2075bc28367439481",
"score": "0.755375",
"text": "def destroy\n @order = @order_item.order\n @order_item.destroy\n respond_to do |format|\n format.html { redirect_to @order, notice: 'Item was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9325f2b5b04b02cb943bdbaefcf88592",
"score": "0.75301814",
"text": "def destroy\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to order_url(session[:order_id]) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9434df3966d4520fb3e8c77c5afac4a7",
"score": "0.7502811",
"text": "def destroy\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to order_items_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "46772a61f50d7b3caaf265b3d0849bb3",
"score": "0.7456995",
"text": "def destroy\n item = LineItem.find(params['id'])\n order = Order.find(item.order_id)\n item.destroy\n if (LineItem.where(order_id: order.id).blank?)\n order.destroy\n end\n \trespond_to do |format|\n format.html { redirect_to orders_url, notice: 'Item was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a94f921ac42e87867329bb9b05c7d8d3",
"score": "0.7439563",
"text": "def destroy\n @order_item.destroy\n respond_to do |format|\n format.html { redirect_to order_items_url, notice: \"Removed #{@order_item.item.name}.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "49c504cecb3256e6439ae1c9396dc417",
"score": "0.7385784",
"text": "def destroy\n @order = current_order\n @order_item = @order.order_items.find(params[:id])\n @order_item.destroy\n @order_items = @order.order_items\n end",
"title": ""
},
{
"docid": "49c504cecb3256e6439ae1c9396dc417",
"score": "0.7385784",
"text": "def destroy\n @order = current_order\n @order_item = @order.order_items.find(params[:id])\n @order_item.destroy\n @order_items = @order.order_items\n end",
"title": ""
},
{
"docid": "390c38e442dab4ffc9db88f9ac0b86b2",
"score": "0.73453957",
"text": "def destroy\n @ordered_item.destroy\n respond_to do |format|\n format.html { redirect_to ordered_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2067da48de79efbb7e33ea5145627f7b",
"score": "0.73431",
"text": "def destroy\n # set order for the update_total callback:\n @order = @item.order\n @item.destroy\n respond_to do |format|\n flash[:success] = \"Item was successfully removed.\"\n format.html { redirect_to order_path(@item.order) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "36a9fda454431345763689d0f0b99eb0",
"score": "0.72944057",
"text": "def destroy\n @order = current_order\n @order_item = @order.order_items.find(params[:id])\n @order_item.destroy\n render 'destroy'\n end",
"title": ""
},
{
"docid": "f8f797c34814e8a58d01ac374334912c",
"score": "0.72861636",
"text": "def destroy\n @order_item_detail = OrderItemDetail.find(params[:id])\n @order_item_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to order_item_details_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba3ffc3f842560fa1fbcad79adc92a0",
"score": "0.728545",
"text": "def delete_item\n @item.destroy!\n render json: { }\n end",
"title": ""
},
{
"docid": "44b6aa0949c8cbefdcc8a3cfe0d05039",
"score": "0.7278204",
"text": "def destroy\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(order_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4ea83f1f5861de16e12d9ba943c25190",
"score": "0.7278049",
"text": "def destroy\n\n @order.order_items.each do |item|\n item.food_items.each do |food_item|\n food_item.destroy\n end\n item.destroy\n end\n\n @order.destroy\n respond_to do |format|\n format.html { redirect_to admin_orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "24012183276fbac7818029e66dafa046",
"score": "0.72671396",
"text": "def destroy\n puts 'in destroy method'\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to order_items_url }\n format.json { head :no_content }\n format.js { render :layout=>false }\n end\n end",
"title": ""
},
{
"docid": "a589172c4d9760766a209d6faf7bdfe5",
"score": "0.7266446",
"text": "def destroy\n @order_item.destroy\n respond_to do |format|\n format.html { redirect_to new_order_path, notice: 'order_item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2628f80eabbe79b6483edf4445648857",
"score": "0.726101",
"text": "def destroy\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(paper_order_order_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "274bbf99de29444e72687223d44c9f08",
"score": "0.72253656",
"text": "def destroy\n @item_order = ItemOrder.find(params[:id])\n @item_order.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_orders_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "31881066269613aac557e971d3638ea0",
"score": "0.72175044",
"text": "def destroy\n @order_request_item.destroy\n respond_to do |format|\n format.html { redirect_to order_request_items_url, notice: 'Order request item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a2bed32248c6d9a2b57d40e6fc0e5864",
"score": "0.720893",
"text": "def destroy\n @orderitem.destroy\n respond_to do |format|\n format.html { redirect_to orderitems_url, notice: 'Orderitem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa237579d18d39182ec3de99de186d4f",
"score": "0.7190637",
"text": "def destroy\n @line_item = @order.line_items.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to group_order_path(@order.group, @order), notice: 'Line item was successfully created.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "829284326178aa8fcd52c87132655803",
"score": "0.71796286",
"text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4a92dcc869fff10497c41668c1c0b14a",
"score": "0.71679",
"text": "def destroy\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(order_items_path) }\n end\n end",
"title": ""
},
{
"docid": "467c907a24ae2950b477eec758717796",
"score": "0.71649617",
"text": "def destroy\n @itemorder = Itemorder.find(params[:id])\n @itemorder.destroy\n\n respond_to do |format|\n format.html { redirect_to :back } #itemorders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e48d4ce5a48875f18bae79e696fe31f7",
"score": "0.715641",
"text": "def destroy\n @order = current_client.orders.where.not(state: :disabled)\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n respond_to do |format|\n format.html { redirect_to cart_path, notice: 'Order item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f508292e91ac71c3aca251bc321c9983",
"score": "0.7146885",
"text": "def destroy\n Api.delete(\"#{BASE_PATH}/#{order_id}\")\n true\n end",
"title": ""
},
{
"docid": "1fa36008b965316e4b6b1aa7c121c2af",
"score": "0.71460724",
"text": "def destroy\n @order_item = OrderItem.find(params[:id])\n @order_item.destroy\n redirect_to orders_path(@current_order)\n end",
"title": ""
},
{
"docid": "d95245ee8d8e63ffab2dfbac802158ee",
"score": "0.7139052",
"text": "def destroy\n delete(\"/orders/#{id}/delete\")\n end",
"title": ""
},
{
"docid": "0156fc0461bbb45c145a344eceac666a",
"score": "0.713792",
"text": "def destroy\n @orders_item.destroy\n respond_to do |format|\n format.html { redirect_to orders_items_url, notice: 'Orders item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82568052417b8447f9f6938356c075e9",
"score": "0.71320695",
"text": "def destroy\n @order_item.destroy\n respond_to do |format|\n format.html { redirect_to purchase_orders_url, notice: 'Item was successfully removed from basket.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2bebaf7b462b0e5ee86f911c3a16175d",
"score": "0.7108354",
"text": "def destroy\n @v1_product = V1::Product.find(params[:id])\n puts \"ORDER\"\n puts @v1_product.item_line.inspect\n if @v1_product.try(:item_line).try(:order).nil?\n @v1_product.destroy\n head :no_content\n else\n render json: {message: 'Someone has ordered this product'}, status: 401\n end\n end",
"title": ""
},
{
"docid": "8e531349d930fb6fede4efc401d68904",
"score": "0.70892584",
"text": "def destroy\n @order.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end",
"title": ""
},
{
"docid": "e6033d53a6cef526d0c87c41c4922563",
"score": "0.7087714",
"text": "def destroy\n @items_ordered = ItemsOrdered.find(params[:id])\n @items_ordered.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_ordereds_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "51191803aacf4dda438c96de60d073cc",
"score": "0.7070592",
"text": "def destroy\n @order_to_item.destroy\n respond_to do |format|\n format.html { redirect_to order_to_items_url, notice: 'Order to item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ca86f0d4726b272035f71cf9ba1f0081",
"score": "0.70696074",
"text": "def destroy\n @purchaseorder_item = PurchaseorderItem.find(params[:id])\n @purchaseorder_item.destroy\n\n respond_to do |format|\n format.html { redirect_to purchaseorder_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "045d637d57ef73d144cab34aa71a6ec0",
"score": "0.7067606",
"text": "def delete(item)\n end",
"title": ""
},
{
"docid": "85de423f1f24305391029737d0265f61",
"score": "0.7064772",
"text": "def destroy\n item = Item.find(params[:id])\n item.destroy\n render :json => item\n end",
"title": ""
},
{
"docid": "17b5a2fd60a4ce3c217619533076969e",
"score": "0.7057946",
"text": "def destroy\n @order_item.destroy\n\n render :nothing => true\n end",
"title": ""
},
{
"docid": "b032bd0c4abbb714a83b587da4d59e78",
"score": "0.7045744",
"text": "def destroy\n @order_item_status = OrderItemStatus.find(params[:id])\n @order_item_status.destroy\n\n respond_to do |format|\n format.html { redirect_to order_item_statuses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d95d21e1cd45adbcc0ae79d5113369a",
"score": "0.70278686",
"text": "def destroy\n @shop_order_item = ShopOrderItem.find(params[:id])\n @shop_order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: '删除成功' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "36781c0442f0e85ce84b8c52a4077d03",
"score": "0.7025987",
"text": "def destroy\n @line_item = LineItem.find(params[:id])\n @order = Order.find(params[:order_id])\n @line_item.destroy if @line_item.present?\n render 'update'\n end",
"title": ""
},
{
"docid": "b8aaac9e45cfdd2ec43e3edeaeb4cd07",
"score": "0.70108163",
"text": "def destroy\n @order = @client.orders.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to client_orders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b120afb4372b9b9448d7da6f29c8b0aa",
"score": "0.6993734",
"text": "def destroy\n @order_item_request.destroy\n respond_to do |format|\n format.html { redirect_to order_item_requests_url, notice: 'Order item request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9088ed093d60e9e30495360a74fd2301",
"score": "0.69928664",
"text": "def delete\n @order_item.destroy #is this method right?\n redirect_to order_path(current_order)\n end",
"title": ""
},
{
"docid": "c5233942dcd9cabe5b19b61a899f9f41",
"score": "0.69871026",
"text": "def destroy\n @line_items = LineItem.find(params[:id])\n @line_item.destroy\n if @line_item.destroy\n render json: {status: :successfully}\n else\n render json: { status: error}\n end\n end",
"title": ""
},
{
"docid": "7deca0e16ba14d33ba6694620a215aec",
"score": "0.6982857",
"text": "def destroy\n @amazon_order_item.destroy\n respond_to do |format|\n format.html { redirect_to amazon_order_items_url, notice: 'Amazon order item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc096a4f3b5b3e8fe574ddaa82305d8d",
"score": "0.6979755",
"text": "def destroy\r\n @order_item = OrderItem.find(params[:id])\r\n @order_item.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(exam_order_items_url(@exam)) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "c5aa57c943de7fad00d8adf263856cb9",
"score": "0.6971715",
"text": "def delete_item(id)\n delete_request configure_payload(\"/items/#{id}\")\n end",
"title": ""
},
{
"docid": "87c4821c12562291ef4f11c214f95cd6",
"score": "0.6966299",
"text": "def destroy\n @order.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "53aa9ab41f039d2409ada8b647442d3c",
"score": "0.6931421",
"text": "def destroy\n @order_item.destroy\n redirect_to root_path \nend",
"title": ""
},
{
"docid": "3c5e4156b8a5b4e2ffe1f2fc6e4b18f0",
"score": "0.69229674",
"text": "def destroy\n @add_order_id_to_line_item = AddOrderIdToLineItem.find(params[:id])\n @add_order_id_to_line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to add_order_id_to_line_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d496e8714709f1e014ad13f7504c98c9",
"score": "0.68983865",
"text": "def delete(item); end",
"title": ""
},
{
"docid": "d496e8714709f1e014ad13f7504c98c9",
"score": "0.68983865",
"text": "def delete(item); end",
"title": ""
},
{
"docid": "2fd45f17ef45c0e6c24d1660b88fe67a",
"score": "0.68979514",
"text": "def destroy\n load_order\n load_order_item\n @order_item.destroy\n @order_items = @order.order_items\n end",
"title": ""
},
{
"docid": "c75fb30b1f562cff188625c565731c01",
"score": "0.6888014",
"text": "def destroy\n @line1_item.destroy\n respond_to do |format|\n format.html { redirect_to line1_items_url, notice: 'Line1 item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a82ffe6e0bea3bb1cc29c2685cc0f5ee",
"score": "0.68804705",
"text": "def destroy\n @item.destroy\n render json: { status: 'success' }\n end",
"title": ""
},
{
"docid": "843a80eb7a01621c89af1e3f1743b40e",
"score": "0.68799436",
"text": "def destroy\n @item.destroy\n render json: nil\n end",
"title": ""
},
{
"docid": "d7894fe8f8289be6ddf4d659bbd69209",
"score": "0.68756783",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n \n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fb52c313024ee17d401aad7c6f81aba7",
"score": "0.6868364",
"text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "100f13f46611b594734af96aedf6f59e",
"score": "0.68674654",
"text": "def destroy\n @order_item_hi.destroy\n respond_to do |format|\n format.html { redirect_to order_item_his_url, notice: 'Order item hi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5db28defc5db9e0ab954ab9fd61aa51e",
"score": "0.68592054",
"text": "def destroy_rest\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "10100ff29bcf12ac5c0d529130f6c11f",
"score": "0.68579173",
"text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b2988b0163b129d1253fed92301651f7",
"score": "0.68491876",
"text": "def destroy\n item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cd15ca6a1f74a2eaaa680ca2473a329",
"score": "0.68476045",
"text": "def remove_from_basket\n @basket.order_items.find_by(item_id: @item.id).destroy\n respond_to do |format|\n format.html { redirect_to purchase_orders_url, notice: 'Item was successfully removed from basket.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a9d32836a462e67d9411902889da1a6c",
"score": "0.6846527",
"text": "def destroy\n @order = Order.find(session[:order_id])\n @order_item.destroy\n if @order.order_items.count > 0 \n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Order item was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n else \n redirect_to root_path \n end \n @order_items = @order.order_items\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.68453705",
"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": "c2b06c8934a1264699cd5a0e366f4cd9",
"score": "0.6843049",
"text": "def destroy\n # :id here represents the name so we don't have to change the routes\n @item = Item.find_by_name(params[:id])\n p params\n logger.debug @item.inspect\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "74879a2f46e98d328013aceecd2e5d67",
"score": "0.6840665",
"text": "def destroy\n @depot_item = DepotItem.find(params[:id])\n @depot_item.destroy\n\n respond_to do |format|\n format.html { redirect_to depot_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e9e19db496b349d825598b651379be6c",
"score": "0.6839407",
"text": "def destroy\n @inventory_order_item = InventoryOrderItem.find(params[:id])\n @inventory_order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventory_order_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "195efbe55200134a83c546bedfee5e59",
"score": "0.68347466",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "359b5793c9d5db9d21f25b36d5a6877a",
"score": "0.6830163",
"text": "def destroy\n @purchase_order_item.destroy\n respond_to do |format|\n format.html { redirect_to purchase_order_items_url, notice: 'Purchase order item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "12eb6568a3f6151ea70f030dfa8de5d4",
"score": "0.68288285",
"text": "def destroy\n generic_item = @specific_item.generic_item\n @specific_item.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, :notice => t('notice.successfully_deleted')}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b0ab37e33b164e381e72c8f92acc7a3",
"score": "0.6827544",
"text": "def destroy\n Api.delete(\"#{BASE_PATH}/#{line_item_id}\")\n true\n end",
"title": ""
},
{
"docid": "78e4ca862d5bd16170226a61df8edb6e",
"score": "0.6826698",
"text": "def destroy\n @v1_item_line = V1::ItemLine.find(params[:id])\n @v1_item_line.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "266e0a6c2874c52aaf49f75becf68c13",
"score": "0.68223643",
"text": "def destroy\n begin\n @api_v1_order.destroy!\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.68202347",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.68202347",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.68202347",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.68202347",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.68202347",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.68202347",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.68202347",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815663",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6815172",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
cf9aa94584b08a0564e235f7dd152bb0 | this is using two select statements, then we need to fix... | [
{
"docid": "aed22a379237f8c303a76fa1c392a303",
"score": "0.0",
"text": "def friends\n first_set = self.initiated_friendships\n second_set = self.received_friendships\n return first_set + second_set\n end",
"title": ""
}
] | [
{
"docid": "435ec51293e0f5fc7b9e081e4382879f",
"score": "0.60772616",
"text": "def select; end",
"title": ""
},
{
"docid": "435ec51293e0f5fc7b9e081e4382879f",
"score": "0.60772616",
"text": "def select; end",
"title": ""
},
{
"docid": "142ce909655865f67dbfb137b1bd4f24",
"score": "0.6072584",
"text": "def select(*) end",
"title": ""
},
{
"docid": "fcdae5144815cd7ee5d1bfd29cc334bc",
"score": "0.5990393",
"text": "def select!\n # Ensure we can never be destructive by nilifying :update.\n Mao.sql(with_options(:update => nil).sql) do |pg_result|\n if @options[:join]\n other = Mao.query(@options[:join][0])\n pg_result.map {|result|\n Mao.normalize_join_result(result, self, other)\n }\n else\n pg_result.map {|result| Mao.normalize_result(result, @col_types)}\n end\n end\n end",
"title": ""
},
{
"docid": "bd81d393af5b6df19f277e55b50fa694",
"score": "0.5888209",
"text": "def select_sql\n return super unless o = @opts[:offset]\n l = @opts[:limit]\n order = @opts[:order]\n dsa1 = dataset_alias(1)\n dsa2 = dataset_alias(2)\n rn = row_number_column\n irn = Sequel::SQL::Identifier.new(rn).qualify(dsa2)\n subselect_sql(unlimited.\n from_self(:alias=>dsa1).\n select_more(Sequel::SQL::QualifiedIdentifier.new(dsa1, WILDCARD),\n Sequel::SQL::WindowFunction.new(SQL::Function.new(:ROW_NUMBER), Sequel::SQL::Window.new(:order=>order)).as(rn)).\n from_self(:alias=>dsa2).\n select(Sequel::SQL::QualifiedIdentifier.new(dsa2, WILDCARD)).\n where(l ? ((irn > o) & (irn <= l + o)) : (irn > o))) # Leave off limit in case of limit(nil, offset)\n end",
"title": ""
},
{
"docid": "d9f2c8a550282de73c6cdb7485ce81c7",
"score": "0.576802",
"text": "def get_select_on_records(mc, iter)\n if iter[0] == SELECT_ARTISTS\n if mc.view_compile?\n sql = %Q{SELECT DISTINCT(artists.rartist), artists.sname FROM artists\n INNER JOIN records ON records.rartist = artists.rartist }\n else\n sql = %Q{SELECT DISTINCT(artists.rartist), artists.sname FROM artists\n INNER JOIN segments ON segments.rartist = artists.rartist\n INNER JOIN records ON records.rrecord = segments.rrecord }\n end\n else\n sql = %Q{SELECT DISTINCT(records.stitle), artists.rartist, artists.sname, records.rrecord FROM records\n INNER JOIN artists ON records.rartist = artists.rartist }\n end\n end",
"title": ""
},
{
"docid": "fbea0498ffd95c323a660fd83e8c6aef",
"score": "0.5740073",
"text": "def select_sql\n return super unless l = @opts[:limit]\n o = @opts[:offset] || 0\n order = @opts[:order]\n dsa1 = dataset_alias(1)\n dsa2 = dataset_alias(2)\n rn = row_number_column\n irn = Sequel::SQL::Identifier.new(rn).qualify(dsa2)\n subselect_sql(unlimited.\n from_self(:alias=>dsa1).\n select_more(Sequel::SQL::QualifiedIdentifier.new(dsa1, WILDCARD),\n Sequel::SQL::WindowFunction.new(SQL::Function.new(:ROW_NUMBER), Sequel::SQL::Window.new(:order=>order)).as(rn)).\n from_self(:alias=>dsa2).\n select(Sequel::SQL::QualifiedIdentifier.new(dsa2, WILDCARD)).\n where((irn > o) & (irn <= l + o)))\n end",
"title": ""
},
{
"docid": "e3c5d8293d8fbbd20ea00c2d36aa5903",
"score": "0.56899625",
"text": "def select_name_and_series_subgenres_of_authors\n \"SELECT authors.name, subgenres.name FROM authors INNER JOIN series ON authors.id=series.author_id INNER JOIN subgenres ON series.subgenre_id = subgenres.id; \"\nend",
"title": ""
},
{
"docid": "b1fe3e607d9801df3b536d6bea4b2243",
"score": "0.56323326",
"text": "def select(db); end",
"title": ""
},
{
"docid": "b1fe3e607d9801df3b536d6bea4b2243",
"score": "0.56323326",
"text": "def select(db); end",
"title": ""
},
{
"docid": "367745099f7cffbb0000c994dda4b293",
"score": "0.55625004",
"text": "def select_name_and_series_subgenres_of_authors\n \"SELECT authors.name, subgenres.name\n FROM series\n INNER JOIN authors\n ON series.author_id = authors.id\n INNER JOIN subgenres\n ON series.subgenre_id = subgenres.id\"\nend",
"title": ""
},
{
"docid": "a7968b9e66a6ec02e8a9667c4168982f",
"score": "0.55594754",
"text": "def select_by(how, what); end",
"title": ""
},
{
"docid": "990b76edd0ae32224ef2d6e904a38d63",
"score": "0.5547638",
"text": "def dbselect2(find, table)\n if find.kind_of?(Array) == false\n variables = find\n else\n variables = \"\"\n i = 0\n while i < find.length\n variables += find[i].to_s\n i += 1\n if i < find.length\n variables += \", \"\n end\n end\n end\n return db.execute(\"SELECT #{variables} FROM #{table}\")\nend",
"title": ""
},
{
"docid": "0fc2c9acea96f70d28caa5a8e5d60894",
"score": "0.5505644",
"text": "def select_one(sql, name = nil) end",
"title": ""
},
{
"docid": "172a3857f0aa5a6232781074f1083910",
"score": "0.5498439",
"text": "def _select_map_multiple(ret_cols)\n rows = []\n clone(:_sequel_pg_type=>:array).fetch_rows(sql){|s| rows << s}\n rows\n end",
"title": ""
},
{
"docid": "47a1efacc7cfa7b3157325bbfed60763",
"score": "0.54909045",
"text": "def build_subselect(key, o)\n stmt = Nodes::SelectStatement.new\n core = stmt.cores.first\n core.froms = o.relation\n core.wheres = o.wheres\n core.projections = [key]\n stmt.limit = o.limit\n stmt.offset = o.offset\n stmt.orders = []\n stmt\n end",
"title": ""
},
{
"docid": "df02f86cbefa3b3eb9c048f4b13ec7cb",
"score": "0.5436594",
"text": "def _select_map_single\n rows = []\n clone(:_sequel_pg_type=>:first).fetch_rows(sql){|s| rows << s}\n rows\n end",
"title": ""
},
{
"docid": "6a831e20034287785d2ff94394a3aa4b",
"score": "0.54124975",
"text": "def test_002\n target_sql = \"select shipments.number as shipment_number,\nvariants.sku as sku,\nvariants.price as price,\nvariants.weight as weight,\nvariants.height as height,\nvariants.width as width,\nvariants.depth as length,\nproducts.description as product_description,\norders.number as order_number\nfrom orders\njoin shipments on (shipments.order_id = orders.id)\njoin line_items on (line_items.order_id = orders.id)\njoin variants on (line_items.variant_id = variants.id)\njoin products on (variants.product_id = products.id)\njoin state_events on (state_events.stateful_id = orders.id and state_events.name = 'payment' and state_events.stateful_type = 'Order' and state_events.next_state in ('paid','credit_owed'))\nwhere orders.state = 'complete' and orders.shipment_state = 'ready' and state_events.created_at >= '2012-10-01' and state_events.created_at <= '2015-03-08' and shipments.warehouse_id = 28\"\n \n @sql.select do\n shipments number: 'shipment_number'\n variants :sku, :price, :weight, :height, :width, depth: 'length'\n products description: 'product_description'\n orders number: 'order_number'\n end\n \n @sql.from :orders do\n join :shipments, on: 'shipments.order_id = orders.id'\n join :line_items, on: 'line_items.order_id = orders.id'\n join :variants, on: 'line_items.variant_id = variants.id'\n join :products, on: 'variants.product_id = products.id'\n join :state_events do\n state_events stateful_id: :'orders.id',\n name: 'payment',\n stateful_type: 'Order',\n next_state: %w(paid credit_owed)\n end\n end\n\n begin_date = '2012-10-01'\n end_date = '2015-03-08'\n warehouse_id = 28\n \n @sql.where do\n orders state: 'complete', shipment_state: 'ready'\n \n con '>=' do\n state_events created_at: begin_date\n end\n con '<=' do\n state_events created_at: end_date\n end\n \n shipments warehouse_id: warehouse_id\n end\n\n assert_equal @sql.to_s, target_sql\n end",
"title": ""
},
{
"docid": "3d91f01b2f5106847268898fb4669073",
"score": "0.5411812",
"text": "def select_all(sql, name = nil) end",
"title": ""
},
{
"docid": "d8ff0f11e09e5c7df34c29e4ff2e02ef",
"score": "0.53838885",
"text": "def fat_record_select\n select = 'semantic_relations.id AS id, semantic_relations.created_at AS created_at, '\n select << 'semantic_relations.updated_at AS updated_at, '\n select << 'object_id, object_type, subject_id, predicate_uri, '\n select << 'obj_props.created_at AS property_created_at, '\n select << 'obj_props.updated_at AS property_updated_at, '\n select << 'obj_props.value AS property_value, '\n select << 'obj_sources.created_at AS object_created_at, '\n select << 'obj_sources.updated_at AS object_updated_at, obj_sources.type AS object_realtype, '\n select << 'obj_sources.uri AS object_uri, '\n select << 'subject_sources.uri AS subject_uri'\n select\n end",
"title": ""
},
{
"docid": "1b2fe3e4db90a2124db6d80606f37751",
"score": "0.5378073",
"text": "def Find_MultipleUserDetails(emp_username, course_name)\n \"select first_name from epms_user where username='#{emp_username}' ORDER BY id desc LIMIT 1 \\\\G; \\n\n select id as course_id from mdl_course where fullname='#{course_name}' ORDER BY id desc\"\nend",
"title": ""
},
{
"docid": "390a6c86f8ebb8fd51b139f8456d762a",
"score": "0.5363726",
"text": "def select_data(date1, date2)\n\tbegin\n\t\tdb = Mysql.real_connect('localhost', 'ashish', 'ashish', 'content')\n#\t puts \"Server version: \" + db.get_server_info\n \tres1 = db.query(\"select * from data where date >= day(#{date1})\" )\n\t\twhile rowx = res1.fetch_hash do\n\t\t\tid=rowx[\"id\"]\n\t\t\tlink = rowx[\"link\"]\t\n\t\t\tif (is_photo_link(link))\n\t\t\t\tputs \"id #{id} and #{link} is selected for processing... \"\n#\t\t\t\tfetch_n_update_image(id)\n\t\t\tend\n\t\t\n\t\tend\n\trescue Mysql::Error => e\n\t puts \"Error code: #{e.errno}\"\n\t puts \"Error message: #{e.error}\"\n\t puts \"Error SQLSTATE: #{e.sqlstate}\" if e.respond_to?(\"sqlstate\")\n\tend\t\nend",
"title": ""
},
{
"docid": "09bdd6ad9698d27d3ff6601a51cfd750",
"score": "0.53601754",
"text": "def contact_query(select)\n \"SELECT DISTINCT #{select} \n FROM \n people, kassi_event_participations\n WHERE\n people.id = person_id AND\n person_id <> '#{id}' AND \n kassi_event_id IN (\n SELECT kassi_event_id FROM kassi_event_participations WHERE person_id = '#{id}'\n )\"\n end",
"title": ""
},
{
"docid": "19796c29e990abff6d1f78098a0a8de0",
"score": "0.5352452",
"text": "def build_subselect key, o\n stmt = Nodes::SelectStatement.new\n core = stmt.cores.first\n core.froms = o.relation\n core.wheres = o.wheres\n core.projections = [key]\n stmt.limit = o.limit\n stmt.orders = o.orders\n stmt\n end",
"title": ""
},
{
"docid": "7029979e7e5c5b494e14b46f7336ad02",
"score": "0.5343622",
"text": "def otro(id)\n ActiveRecord::Base.connection.select_all(\"(select u.firstname || ' ' || u.lastname as \\\"new_state\\\"\n from journal_details jd,\n users u,\n users ue,\n journals j\nwhere jd.prop_key='assigned_to_id' and\njd.old_value = CAST(u.id AS CHAR(4)) and\n jd.value = CAST(ue.id AS CHAR(4)) and\n jd.journal_id=j.id and\n jd.journal_id=(select min(journal_id) from journal_details where prop_key='assigned_to_id' and journal_id in (select id from journals where journalized_id=#{id}))\norder by 1)\")\n end",
"title": ""
},
{
"docid": "0086b88b33b2e5ab9cdd14cb65408451",
"score": "0.53338486",
"text": "def select_books_titles_and_years_in_first_series_order_by_year\n \"SELECT title, year FROM books WHERE series_id = 1;\"\nend",
"title": ""
},
{
"docid": "86b3c54b93aa9aff7bb57478af397966",
"score": "0.5329092",
"text": "def select_sql\n return super unless o = @opts[:offset]\n raise(Error, 'MSSQL requires an order be provided if using an offset') unless order = @opts[:order]\n dsa1 = dataset_alias(1)\n dsa2 = dataset_alias(2)\n rn = row_number_column\n unlimited.\n unordered.\n from_self(:alias=>dsa2).\n select{[WILDCARD, ROW_NUMBER(:over, :order=>order){}.as(rn)]}.\n from_self(:alias=>dsa1).\n limit(@opts[:limit]).\n where(rn > o).\n select_sql\n end",
"title": ""
},
{
"docid": "72dfd4b47a3e40b213f48c53824dda18",
"score": "0.5317395",
"text": "def getDBValue(connection, query, id1, *id2)\r\n dbi_query = connection.prepare(query)\r\n dbi_query.execute(id1, *id2)\r\n #fetch the result\r\n return dbi_query.fetch\r\nend",
"title": ""
},
{
"docid": "1fa1e72de1b7234a76c71a0740c73305",
"score": "0.5315905",
"text": "def _exec_select\n result = []\n csv = CSV.parse(File.read(@table_name), headers: true)\n if @join_flag != 1\n _parse_when_not_join(result, csv)\n else\n _parse_when_join(result, csv)\n end\n if @order_flag == 1\n result = _parse_order(result)\n end\n p result\n end",
"title": ""
},
{
"docid": "9e3b02f87da87639c4e67c120a6c69bf",
"score": "0.5313891",
"text": "def select(*args); dataset.select(*args); end",
"title": ""
},
{
"docid": "2a7d9e4b5d8f8b4c0011f39fbf995c42",
"score": "0.5306435",
"text": "def encuestas_pendientes\n ActiveRecord::Base.connection.select_all(\"select i.id as \\\"caso\\\",p.name as \\\"proyecto\\\",(select firstname ||' '|| lastname from users where id=i.author_id) as \\\"autor\\\", i.closed_on as \\\"fechaCierre\\\", 'http://servicedesk.cobiscorp.com/redmine/polls?issue_id='||i.id||'&project_id='||p.identifier as \\\"link\\\" from issues i join projects p on i.project_id=p.id where (i.project_id in (select id from projects where parent_id=10) and i.tracker_id=1) \nand i.closed_on > '2016-02-29 00:00:00' \nand i.status_id=18 \nand i.project_id in (\nselect id from projects where identifier in (select distinct(project_id) from polls) order by 1) \nand i.id not in (select distinct(issue_id) from poll_answers)\nand i.is_private='f'\nunion\nselect i.id as \\\"caso\\\",p.name as \\\"proyecto\\\",(select firstname ||' '|| lastname from users where id=i.author_id) as \\\"autor\\\", i.closed_on as \\\"fechaCierre\\\", 'http://servicedesk.cobiscorp.com/redmine/polls?issue_id='||i.id||'&project_id='||p.identifier as \\\"link\\\" from issues i join projects p on i.project_id=p.id where (i.project_id in (304,95,79,159,117) and i.tracker_id=6) \nand i.closed_on > '2016-02-29 00:00:00' \nand i.status_id=18\nand i.project_id in (\nselect id from projects where identifier in (select distinct(project_id) from polls) order by 1) \nand i.id not in (select distinct(issue_id) from poll_answers)\nand i.is_private='f'\nand i.id in (select customized_id from custom_values where custom_field_id=64 and value='Mejora')\nand i.author_id=27\nunion\nselect i.id as \\\"caso\\\",p.name as \\\"proyecto\\\",(select firstname ||' '|| lastname from users where id=i.author_id) as \\\"autor\\\", i.closed_on as \\\"fechaCierre\\\", 'http://servicedesk.cobiscorp.com/redmine/polls?issue_id='||i.id||'&project_id='||p.identifier as \\\"link\\\" from issues i join projects p on i.project_id=p.id where (i.project_id in (select id from projects where parent_id=105) and i.tracker_id=6) \nand i.closed_on > '2016-02-29 00:00:00' \nand i.status_id=18\nand i.project_id in (\nselect id from projects where identifier in (select distinct(project_id) from polls) order by 1) \nand i.id not in (select distinct(issue_id) from poll_answers)\nand i.is_private='f'\")\n end",
"title": ""
},
{
"docid": "c13c34f67e038846a676c69bae4962e8",
"score": "0.5305004",
"text": "def stars_working_with_ben_affleck\n MovieDatabase.execute(<<-SQL)\n SELECT\n movies.title, actors.name\n FROM\n movies\n JOIN actors ON castings.actor_id = actors.id\n JOIN castings ON castings.movie_id = movies.id\n WHERE\n castings.ord = 1\n AND \n movies.title IN\n (SELECT\n movies.title\n FROM\n movies\n JOIN actors ON castings.actor_id = actors.id\n JOIN castings ON castings.movie_id = movies.id\n WHERE\n actors.name = 'Ben Affleck'\n AND\n castings.ord != 1) \nSQL\nend",
"title": ""
},
{
"docid": "fc37a65712eccd147e0b0c7fa93f11cc",
"score": "0.5296035",
"text": "def db_fetch\n \"SELECT *\" + from_table_where + sql_match_conditions\n end",
"title": ""
},
{
"docid": "567c5af4f8980e96328df7edecaad356",
"score": "0.52885604",
"text": "def select_with_sql_cte(sql, cte)\n super\n select_with_sql_cte_search_cycle(sql, cte)\n end",
"title": ""
},
{
"docid": "4db97aa17b0c0e1603edbe4b2efed109",
"score": "0.52754843",
"text": "def grab_rows(field, src_table_name = TABLE_NAME, num_rows = ROWS_PER_TRANSACTION)\n LOGGER.info \"Creating select statement based on field `#{field[:name]}` (#{field[:type]})\"\n \n if !(field[:type] =~ /int/).nil?\n LOGGER.info \"Using integer type for select.\"\n sql = \"SELECT * FROM `%s` WHERE `%s` >= '%s' AND `%s` < '%s' ORDER BY `%s` LIMIT %s;\" % [ Mysql::escape_string(src_table_name), \n Mysql::escape_string(field[:name]), \n Mysql::escape_string(field[:min].to_i.to_s), \n Mysql::escape_string(field[:name]), \n Mysql::escape_string(field[:max].to_i.to_s), \n Mysql::escape_string(field[:name]), \n num_rows]\n elsif !(field[:type] =~ /datetime/).nil?\n LOGGER.info \"Using datetime type for select.\" \n sql = \"SELECT * FROM `%s` WHERE `%s` >= '%s' AND `%s` < '%s' ORDER BY `%s` LIMIT %s;\" % [ Mysql::escape_string(src_table_name), \n Mysql::escape_string(field[:name]), \n Mysql::escape_string(field[:min].strftime(MYSQL_DATETIME_FORMAT)), \n Mysql::escape_string(field[:name]), \n Mysql::escape_string(field[:max].strftime(MYSQL_DATETIME_FORMAT)), \n Mysql::escape_string(field[:name]), \n num_rows]\n else\n LOGGER.info \"Using default type for select, this isn't expected.\"\n sql = \"SELECT * FROM `%s` WHERE `%s` >= '%s' AND `%s` < '%s' ORDER BY `%s` LIMIT %s;\" % [ Mysql::escape_string(src_table_name), \n Mysql::escape_string(field[:name]), \n Mysql::escape_string(field[:min]), \n Mysql::escape_string(field[:name]), \n Mysql::escape_string(field[:max]), \n Mysql::escape_string(field[:name]), \n num_rows] \n end\n \n LOGGER.debug \"SQL: #{sql}\"\n dbres = do_sql_command(sql)\n dbres\nend",
"title": ""
},
{
"docid": "6e7135f643d275b1d5e6388f50956b42",
"score": "0.5267626",
"text": "def subselect_sql_append(sql, ds)\n ds.clone(:append_sql=>sql, :prepared_args=>prepared_args, :bind_vars=>@opts[:bind_vars]).\n send(:to_prepared_statement, :select, nil, :extend=>prepared_statement_modules).\n prepared_sql\n end",
"title": ""
},
{
"docid": "81b1231ac6614b948a0cb11f44d339aa",
"score": "0.52457863",
"text": "def query_overbooking_conflicts\n\n query = <<-QUERY\n select b1.id as booking_id_1, b1.date_from as date_from_1, b1.time_from as time_from_1, b1.date_to as date_to_1, b1.time_to as time_to_1, r1.id as resource_id_1, r1.booking_item_reference as booking_item_reference_1,\n b2.id as booking_id_2, b2.date_from as date_from_2, b2.time_from as time_from_2, b2.date_to as date_to_2, b2.time_to as time_to_2, r2.id as resource_id_2, r2.booking_item_reference as booking_item_reference_2\n from (\n select distinct least(r1.resource_id, r2.resource_id) as resource_id1, greatest(r1.resource_id, r2.resource_id) as resource_id2\n from (\n select b.id as booking_id, b.date_from, b.time_from, b.date_to, b.time_to, r.id as resource_id, r.booking_item_reference\n from bookds_bookings_lines_resources r\n join bookds_bookings_lines l on l.id = r.booking_line_id\n join bookds_bookings b on b.id = l.booking_id\n where (b.date_from >= ? or b.date_to >= ?) and r.booking_item_reference is not null and b.status not in (1,5)\n ) as r1\n inner join (\n select b.id as booking_id, b.date_from, b.time_from, b.date_to, b.time_to, r.id as resource_id, r.booking_item_reference\n from bookds_bookings_lines_resources r\n join bookds_bookings_lines l on l.id = r.booking_line_id\n join bookds_bookings b on b.id = l.booking_id\n where (b.date_from >= ? or b.date_to >= ?) and r.booking_item_reference is not null and b.status not in (1,5)\n ) as r2 on r2.booking_item_reference = r1.booking_item_reference and r2.resource_id != r1.resource_id\n group by r1.resource_id, r2.resource_id \n ) as x\n join bookds_bookings_lines_resources r1 on r1.id = resource_id1\n join bookds_bookings_lines l1 on l1.id = r1.booking_line_id\n join bookds_bookings b1 on b1.id = l1.booking_id\n join bookds_bookings_lines_resources r2 on r2.id = resource_id2\n join bookds_bookings_lines l2 on l2.id = r2.booking_line_id\n join bookds_bookings b2 on b2.id = l2.booking_id\n join bookds_items on r1.booking_item_reference = bookds_items.reference and bookds_items.assignable \n where ((b1.date_from <= b2.date_from and b1.date_to >= b2.date_from) or (b1.date_from >= b2.date_from and b1.date_to <= b2.date_to) or (b1.date_from >= b2.date_from and b1.date_from <= b2.date_to))\n order by least(b1.date_from,b2.date_from)\n QUERY\n\n end",
"title": ""
},
{
"docid": "abb1c93f8b51249be0acc0b18e240ffe",
"score": "0.5238597",
"text": "def xbunch_query\n Instance.where(\"instance.cited_by_id in (#{comma_separated_ids}) or instance.cites_id in (#{comma_separated_ids})\")\n .joins(:instance_type)\n .joins(name: :name_status)\n .joins(:reference)\n .left_outer_joins(:cited_reference)\n .select(select_list)\n .order('reference.year, instance_type.misapplied, name.sort_name')\n end",
"title": ""
},
{
"docid": "a28166ad8601b099067752335152920f",
"score": "0.5235727",
"text": "def select_for_count\n visited_values = select_visit(select_values.uniq)\n if visited_values.size == 1\n select = visited_values.first\n\n str_select = case select\n when String\n select\n when Symbol\n select.to_s\n else\n select.to_sql if select.respond_to?(:to_sql)\n end\n\n str_select if str_select && str_select !~ /[,*]/\n else\n :all\n end\n end",
"title": ""
},
{
"docid": "ac4d6c37a0eb72e7c3c0d0b07d139594",
"score": "0.5232694",
"text": "def finding_with_ambiguous_select?(select_clause)\n !select_clause && columns.size != 2\n end",
"title": ""
},
{
"docid": "de98dc1b56cef2397088333be41ae757",
"score": "0.5223607",
"text": "def combine_multi_statements(total_sql)\n total_sql\n end",
"title": ""
},
{
"docid": "b57ee24323ccb9a0d7a7c7f591abab9c",
"score": "0.5209046",
"text": "def exercise2\n @content = ActiveRecord::Base.connection.execute(\"\n SELECT\n gr.name as group_name,\n u.name as user_name,\n sum(m.mapviews) as groups_count\n FROM (((users as u\n INNER JOIN groups_users as gu ON u.id=gu.user_id)\n INNER JOIN groups as gr ON gr.id = gu.group_id)\n INNER JOIN maps as m ON m.user_id = u.id)\n GROUP BY (gr.name, u.name)\n ORDER BY gr.name, groups_count DESC;\");\n\n @results2 = []\n\n index = 0\n @content.each do |r|\n @results2[index] = Result2.new r\n index = index + 1;\n end\n\n return @results2\n end",
"title": ""
},
{
"docid": "e5231ba006d27ea36beb2239fb73e14d",
"score": "0.5197573",
"text": "def scrooged_sql(seen_columns, sql)\n sql.gsub(@select_regexp, \"SELECT #{scrooge_select_sql(seen_columns)} FROM\")\n end",
"title": ""
},
{
"docid": "63f3fc7312a3163325c10b7af4466c88",
"score": "0.5193374",
"text": "def build_subselect(key, o)\n subselect = super\n\n # Materialize subquery by adding distinct\n # to work with MySQL 5.7.6 which sets optimizer_switch='derived_merge=on'\n unless has_limit_or_offset_or_orders?(subselect)\n core = subselect.cores.last\n core.set_quantifier = Arel::Nodes::Distinct.new\n end\n\n Nodes::SelectStatement.new.tap do |stmt|\n core = stmt.cores.last\n core.froms = Nodes::Grouping.new(subselect).as(\"__active_record_temp\")\n core.projections = [Arel.sql(quote_column_name(key.name))]\n end\n end",
"title": ""
},
{
"docid": "f51f452cc0d7cf882d290c8a6c43b5d9",
"score": "0.518359",
"text": "def selects_all_bears_names_and_ages_that_are_alive_and_order_youngest_to_oldest\n 'SELECT bears.name, bears.age\n FROM bears WHERE alive = 1\n ORDER BY age'\nend",
"title": ""
},
{
"docid": "5d14267de52171f91e685a3bec4104c4",
"score": "0.51761585",
"text": "def resultset; end",
"title": ""
},
{
"docid": "b1ace904c44545d48383fc199ed7ca7a",
"score": "0.51669186",
"text": "def test_003\n\n target_sql = \"select d.id as id,\nd.taxnumber as taxnumber,\nd.social_security_type as social_security_type,\nd.taxnumber_exemption as taxnumber_exemption\nfrom distributors d\nleft join distributor_addons da on (d.id = da.distributor_id)\nwhere d.id = (11,12,13,14,15,16)\norder by d.id\"\n \n @sql.select do\n d :id, :taxnumber, :social_security_type, :taxnumber_exemption\n end\n\n @sql.from(distributors: 'd') do\n left_join distributor_addons: 'da', on: 'd.id = da.distributor_id'\n end\n\n dist_ids = [11,12,13,14,15,16]\n \n @sql.where do\n d id: dist_ids\n end\n\n @sql.order('d.id')\n\n assert_equal @sql.to_s, target_sql\n end",
"title": ""
},
{
"docid": "ebb5637823342ffa7f972658653b9454",
"score": "0.5164769",
"text": "def old_films_and_their_star\n MovieDatabase.execute(<<-SQL)\n SELECT\n movies.title, actors.name AS star\n FROM\n movies\n JOIN actors ON castings.actor_id = actors.id\n JOIN castings ON castings.movie_id = movies.id\n WHERE\n movies.yr >= 1906\n AND\n movies.yr <= 1908\n AND\n castings.ord = 1 \n ORDER BY\n movies.title \nSQL\nend",
"title": ""
},
{
"docid": "e96d7be5fceab2a41b9567e2713665fc",
"score": "0.5158656",
"text": "def build_select(arel)\n if select_values.any?\n arel.project(*arel_columns(select_values.uniq))\n else\n arel.project(\"\\\"#{klass.table_name}\\\".\\\"tableoid\\\"::regclass as \\\"type\\\"\") if @klass.using_multi_table_inheritance?\n arel.project(@klass.arel_table[Arel.star])\n end\n end",
"title": ""
},
{
"docid": "e2f99c45caa71bb69cbbf26ea255aaf2",
"score": "0.5147643",
"text": "def select_books_titles_and_years_in_first_series_order_by_year\n \"select books.title, books.year from books join series on books.series_id = series.id where series_id = 1 order by books.year\"\nend",
"title": ""
},
{
"docid": "b1b9da25f8df178fc2c09640b9b20548",
"score": "0.5134139",
"text": "def select_statement(query)\n model = query.model\n fields = query.fields\n conditions = query.conditions\n limit = query.limit\n offset = query.offset\n order = query.order\n group_by = nil\n\n # FIXME: using a boolean for qualify does not work in some cases,\n # such as when you have a self-referrential many to many association.\n # if you don't qualfiy the columns with a unique alias, then the\n # SQL query will fail. This may mean though, that it might not\n # be enough to pass in a Property, but we may need to know the\n # table and the alias we should use for the column.\n\n qualify = query.links.any?\n\n if qualify || query.unique?\n group_by = fields.select { |property| property.kind_of?(Property) }\n end\n\n unless (limit && limit > 1) || offset > 0 || qualify\n # TODO: move this method to Query, so that it walks the conditions\n # and finds an OR operator\n\n # TODO: handle cases where two or more properties need to be\n # used together to be unique\n\n # if a unique property is used, and there is no OR operator, then an ORDER\n # and LIMIT are unecessary because it should only return a single row\n if conditions.kind_of?(Query::Conditions::AndOperation) &&\n conditions.any? { |operand| operand.kind_of?(Query::Conditions::EqualToComparison) && operand.subject.respond_to?(:unique?) && operand.subject.unique? } &&\n !conditions.any? { |operand| operand.kind_of?(Query::Conditions::OrOperation) }\n order = nil\n limit = nil\n end\n end\n\n conditions_statement, bind_values = conditions_statement(conditions, qualify)\n\n statement = \"SELECT #{columns_statement(fields, qualify)}\"\n statement << \" FROM #{quote_name(model.storage_name(name))}\"\n statement << join_statement(query, qualify) if qualify\n statement << \" WHERE #{conditions_statement}\" unless conditions_statement.blank?\n statement << \" GROUP BY #{columns_statement(group_by, qualify)}\" unless group_by.blank?\n statement << \" ORDER BY #{order_statement(order, qualify)}\" unless order.blank?\n\n if limit\n statement << ' LIMIT ?'\n bind_values << limit\n end\n\n if limit && offset > 0\n statement << ' OFFSET ?'\n bind_values << offset\n end\n\n return statement, bind_values\n end",
"title": ""
},
{
"docid": "447a4f5220099030ef3e845a8c71db02",
"score": "0.5132503",
"text": "def select_statement(query)\n model = query.model\n fields = query.fields\n conditions = query.conditions\n limit = query.limit\n offset = query.offset\n order = query.order\n group_by = nil\n\n # FIXME: using a boolean for qualify does not work in some cases,\n # such as when you have a self-referrential many to many association.\n # if you don't qualfiy the columns with a unique alias, then the\n # SQL query will fail. This may mean though, that it might not\n # be enough to pass in a Property, but we may need to know the\n # table and the alias we should use for the column.\n\n qualify = query.links.any?\n\n if query.unique?\n group_by = fields.select { |p| p.kind_of?(Property) }\n end\n\n # create subquery to find all valid keys and then use these keys to retrive all other columns\n use_subquery = qualify\n\n # when we can include ROWNUM condition in main WHERE clause\n use_simple_rownum_limit = limit && (offset||0 == 0) && group_by.blank? && order.blank?\n\n unless (limit && limit > 1) || offset > 0 || qualify\n # TODO: move this method to Query, so that it walks the conditions\n # and finds an OR operator\n\n # TODO: handle cases where two or more properties need to be\n # used together to be unique\n\n # if a unique property is used, and there is no OR operator, then an ORDER\n # and LIMIT are unecessary because it should only return a single row\n if conditions.kind_of?(Query::Conditions::AndOperation) &&\n conditions.any? { |operand| operand.kind_of?(Query::Conditions::EqualToComparison) && operand.subject.respond_to?(:unique?) && operand.subject.unique? } &&\n !conditions.any? { |operand| operand.kind_of?(Query::Conditions::OrOperation) }\n order = nil\n limit = nil\n end\n end\n\n conditions_statement, bind_values = conditions_statement(conditions, qualify)\n\n statement = \"SELECT #{columns_statement(fields, qualify)}\"\n if use_subquery\n statement << \" FROM #{quote_name(model.storage_name(name))}\"\n statement << \" WHERE (#{columns_statement(model.key, qualify)}) IN\"\n statement << \" (SELECT DISTINCT #{columns_statement(model.key, qualify)}\"\n end\n statement << \" FROM #{quote_name(model.storage_name(name))}\"\n statement << join_statement(query, qualify) if qualify\n statement << \" WHERE (#{conditions_statement})\" unless conditions_statement.blank?\n if use_subquery\n statement << \")\"\n end\n if use_simple_rownum_limit\n statement << \" AND rownum <= ?\"\n bind_values << limit\n end\n statement << \" GROUP BY #{columns_statement(group_by, qualify)}\" unless group_by.blank?\n statement << \" ORDER BY #{order_statement(order, qualify)}\" unless order.blank?\n\n add_limit_offset!(statement, limit, offset, bind_values) unless use_simple_rownum_limit\n\n return statement, bind_values\n end",
"title": ""
},
{
"docid": "80843146526268360224343986dc1894",
"score": "0.5128167",
"text": "def custom_sql\n # \"SELECT employees.first_name, stores.name FROM employees, stores WHERE employees.store_id = stores.id;\"\n\n \"SELECT employees,first_name, stores.name FROM employees JOIN stores ON stores.id = employees.store_id;\"\nend",
"title": ""
},
{
"docid": "478195f1847204a399e839fee7b681eb",
"score": "0.5125433",
"text": "def select_items\n text = input\n case text\n\n when \"Plate.where(color:\\\"white\\\")\", \"Plate.where()\",\n \"Plate.where(:id=>1)\",\"Plate.where(:id=>1)[0]\",\n \"Plate.where({color:\\\"white\\\"})\", \"Plate.where({:id=>1})\", \"Plate.all\"\n\n res = true\n selections.each do |s|\n s.update(selected: true)\n end\n p \"he\"\n\n when \"Plate.where(id:1).first\", \"Plate.where(id:1)[0]\",\n \"Plate.where(:id=>1).first\",\"Plate.where(:id=>1)[0]\",\n \"Plate.where({:id=>1})[0]\", \"Plate.where({:id=>1}).first\",\n \"Plate.find_by(id:1)\", \"Plate.find_by(:id=>1)\", \"Plate.find(1)\"\n\n res = true\n selections.first.update(selected: true)\n when \"Plate.where(id:2).first\", \"Plate.where(id:2)[0]\",\n \"Plate.where(:id=>2).first\",\"Plate.where(:id=>2)[0]\",\n \"Plate.where({:id=>2})[0]\", \"Plate.where({:id=>2}).first\",\n \"Plate.find_by(id:2)\", \"Plate.find_by(:id=>2)\", \"Plate.find(2)\"\n\n res = true\n selections.second.update(selected: true)\n\n when \"Plate.where({:id=>2})\", \"Plate.where(id:2)\", \"Plate.where({:id=>2})\",\n \"Plate.where(id:2)\", \"Plate.where(:id=>2)\"\n\n collection_returned = true\n res = false\n else\n res = false\n end\n\n end",
"title": ""
},
{
"docid": "17edf18ebb103d6bc9187a680432ac57",
"score": "0.512219",
"text": "def employee_first_names_and_store_names\n ActiveRecord::Base.connection.exec_query(custom_sql).collect &:values\nend",
"title": ""
},
{
"docid": "ff5e5448ccbb4a7bc42c694a9811fe80",
"score": "0.510601",
"text": "def combine_multi_statements(total_sql)\n total_sql\n end",
"title": ""
},
{
"docid": "11d71056c8b42507f8268122e1879d15",
"score": "0.510267",
"text": "def get_sql_profiles(sql_row)\n sql_select_all [\"SELECT * FROM DBA_SQL_Profiles WHERE Signature = TO_NUMBER(?) OR Signature = TO_NUMBER(?) #{'OR Name = ?' if sql_row.sql_profile}\n \",\n sql_row.exact_signature.to_s, sql_row.force_signature.to_s].concat(sql_row.sql_profile ? [sql_row.sql_profile] : []) if sql_row\n end",
"title": ""
},
{
"docid": "c27ae94a812930d7c690df4ef32c727e",
"score": "0.5098249",
"text": "def late_materialization(db)\n part_result_1 = []\n part_result_2 = []\n db[\"country\"][\"dic\"].each_with_index do |v, i|\n if v == \"GER\" \n db[\"country\"][\"av\"].each.with_index do |val, ind|\n if val == i then part_result_1.push(ind) end\n end\n break\n end\n end\n db[\"gender\"][\"dic\"].each_with_index do |v, i|\n if v == \"M\" \n db[\"gender\"][\"av\"].each.with_index do |val, ind|\n if val == i then part_result_2.push(ind) end\n end\n break\n end\n end \n # with this returned array we can materialize the\n # row the length of the array is the aggregation\n # in this case the materialiation is not neccessarry\n (part_result_1 & part_result_2)\nend",
"title": ""
},
{
"docid": "a8697d8e9d878a18a82eacd5a3f4c4ac",
"score": "0.50981206",
"text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount) FROM pledges INNER JOIN projects ON projects.id=pledges.project_id GROUP BY projects.title;\"\n## FROM - where are they talking to each other - where is the scotch tape\nend",
"title": ""
},
{
"docid": "b1ba7e5335b903b22f8e0dc1035392a4",
"score": "0.50792474",
"text": "def getDBArray(connection, query, id1, *id2)\r\n dbi_query = connection.prepare(query)\r\n dbi_query.execute(id1, *id2)\r\n #fetch the result\r\n return dbi_query.fetch_all\r\nend",
"title": ""
},
{
"docid": "f2542226fc185692b29aa39a3dc4819a",
"score": "0.5079231",
"text": "def select(*rest) end",
"title": ""
},
{
"docid": "f2542226fc185692b29aa39a3dc4819a",
"score": "0.5079231",
"text": "def select(*rest) end",
"title": ""
},
{
"docid": "f9cc128d14348b4382fc72d2ed54199d",
"score": "0.5078253",
"text": "def get_sql_outlines(sql_row)\n sql_select_all [\"SELECT * FROM DBA_Outlines WHERE Signature = sys.UTL_RAW.Cast_From_Number(TO_NUMBER(?)) OR Signature = sys.UTL_RAW.Cast_From_Number(TO_NUMBER(?))\",\n sql_row.exact_signature.to_s, sql_row.force_signature.to_s] if sql_row\n end",
"title": ""
},
{
"docid": "ba88e804cf1611fd41f9ac6007e88840",
"score": "0.50773895",
"text": "def select_books_titles_and_years_in_first_series_order_by_year\n \"SELECT books.title, books.year\n FROM books\n JOIN series\n ON books.series_id = series.id\n WHERE books.series_id = 1\n ORDER BY books.year;\"\nend",
"title": ""
},
{
"docid": "78dbd998171435cb7d77dd2169736e73",
"score": "0.50701785",
"text": "def to_lead_or_not_to_lead\n # Find the id and ord of the casting where the movie_id is `612`\n # and the actor_id is `703`\n Casting\n .select(:id, :ord)\n .where(\"movie_id = 612\")\n .where(\"actor_id = 703\")\nend",
"title": ""
},
{
"docid": "26bcd1fdf7feed55921c10b580e6ea60",
"score": "0.50695777",
"text": "def select_from_sql(sql)\n sql << \" FROM #{source_list(@opts[:from] || ['DUAL'])}\"\n end",
"title": ""
},
{
"docid": "b9fb684223f383a4098157ad4cf99dde",
"score": "0.5066989",
"text": "def select_statement\n \"select \" + selected_field_names.map { |field_name| zuora_field_name(field_name) }.join(', ')\n end",
"title": ""
},
{
"docid": "a098bbbe92da8ca787cfb21ca29c64e9",
"score": "0.50648636",
"text": "def user_comments\n multi = {:query1 => \"SELECT target_id FROM connection WHERE source_id='#{@user.id}'\",\n :query2 => \"SELECT post_id FROM stream WHERE source_id IN (SELECT target_id FROM #query1)\",\n :query3 => \"SELECT post_id FROM comment WHERE post_id IN (SELECT post_id FROM #query2)\", # AND (fromid = '#{@user.id}')\",\n :query4 => \"SELECT post_id, message FROM stream WHERE post_id IN (SELECT post_id FROM #query3)\"\n }\n # query = \"SELECT post_id, message FROM stream WHERE post_id IN\n # (SELECT post_id FROM comment WHERE post_id IN \n # (SELECT post_id FROM stream WHERE source_id IN\n # (SELECT target_id FROM connection WHERE source_id='#{@user.id}')) AND \n # (fromid = '#{@user.id}'))\"\n pp @session.fql_multiquery(multi)\nend",
"title": ""
},
{
"docid": "af346c64c7cde0db202637bbd1ed8942",
"score": "0.5056454",
"text": "def select\n execute_only(:select)\n end",
"title": ""
},
{
"docid": "c56aa3f83883458be5b19f58b8240ec5",
"score": "0.5054201",
"text": "def leading_star_for_1962_films\n MovieDatabase.execute(<<-SQL)\n SELECT\n m.title, a.name\n FROM\n movie m\n JOIN \n casting c ON m.id = c.movieid\n JOIN\n actor a ON a.id = c.actorid\n WHERE\n m.yr = 1962 AND c.ord = 1\n ORDER BY\n m.title;\nSQL\nend",
"title": ""
},
{
"docid": "ab397571f1448af6c9815254f77baf3c",
"score": "0.5046865",
"text": "def bookings_with_suite_numbers\n ActiveRecord::Base.connection.exec_query(custom_sql).collect &:values\nend",
"title": ""
},
{
"docid": "45a4f971a092d5cea48738025376fd86",
"score": "0.5046098",
"text": "def apply_single\n validate_schema\n\n # Prepare some lists of columns.\n key_cols = @db1.primary_key(@table1)\n data_cols = @db1.except_primary_key(@table1)\n all_cols = @db1.column_names(@table1)\n\n # Let our public know we are beginning.\n @patch.begin_diff\n\n # Advertise column names.\n @rc_columns = DiffColumns.new\n @rc_columns.title_row = all_cols\n @rc_columns.update(0)\n cells = all_cols.map{|v| { :txt => v, :value => v, :cell_mode => \"\" }}\n rc = RowChange.new(\"@@\",cells)\n @patch.apply_row(rc)\n\n # If requested, we will be providing context rows around changed rows.\n # This is not a natural thing to do with SQL, so we do it only on request.\n # When requested, we need to buffer row changes.\n @pending_rcs = []\n\n # Prepare some useful SQL fragments to assemble later.\n sql_table1 = @db1.quote_table(@table1)\n sql_table2 = @db1.quote_table(@table2)\n sql_key_cols = key_cols.map{|c| @db1.quote_column(c)}.join(\",\")\n sql_all_cols = all_cols.map{|c| @db1.quote_column(c)}.join(\",\")\n sql_key_match = key_cols.map{|c| @db1.quote_column(c)}.map{|c| \"#{sql_table1}.#{c} IS #{sql_table2}.#{c}\"}.join(\" AND \")\n sql_data_mismatch = data_cols.map{|c| @db1.quote_column(c)}.map{|c| \"#{sql_table1}.#{c} IS NOT #{sql_table2}.#{c}\"}.join(\" OR \")\n\n # For one query we will need to interleave columns from two tables. For\n # portability we need to give these columns distinct names.\n weave = all_cols.map{|c| [[sql_table1,@db1.quote_column(c)],\n [sql_table2,@db2.quote_column(c)]]}.flatten(1)\n dbl_cols = weave.map{|c| \"#{c[0]}.#{c[1]}\"}\n sql_dbl_cols = weave.map{|c| \"#{c[0]}.#{c[1]} AS #{c[0].gsub(/[^a-zA-Z0-9]/,'_')}_#{c[1].gsub(/[^a-zA-Z0-9]/,'_')}\"}.join(\",\")\n\n # Prepare a map of primary key offsets.\n keys_in_all_cols = key_cols.each.map{|c| all_cols.index(c)}\n keys_in_dbl_cols = keys_in_all_cols.map{|x| 2*x}\n\n # Find rows in table2 that are not in table1.\n sql = \"SELECT #{sql_all_cols} FROM #{sql_table2} WHERE NOT EXISTS (SELECT 1 FROM #{sql_table1} WHERE #{sql_key_match})\"\n apply_inserts(sql,all_cols,keys_in_all_cols)\n\n # Find rows in table1 and table2 that differ while having the same primary\n # key.\n sql = \"SELECT #{sql_dbl_cols} FROM #{sql_table1} INNER JOIN #{sql_table2} ON #{sql_key_match} WHERE #{sql_data_mismatch}\"\n apply_updates(sql,dbl_cols,keys_in_dbl_cols)\n\n # Find rows that are in table1 but not table2\n sql = \"SELECT #{sql_all_cols} FROM #{sql_table1} WHERE NOT EXISTS (SELECT 1 FROM #{sql_table2} WHERE #{sql_key_match})\"\n apply_deletes(sql,all_cols,keys_in_all_cols)\n\n # If we are supposed to provide context, we need to deal with row order.\n if @patch.want_context\n sql = \"SELECT #{sql_all_cols}, 0 AS __coopy_tag__ FROM #{sql_table1} UNION SELECT #{sql_all_cols}, 1 AS __coopy_tag__ FROM #{sql_table2} ORDER BY #{sql_key_cols}, __coopy_tag__\"\n apply_with_context(sql,all_cols,keys_in_all_cols)\n end\n\n # Done!\n @patch.end_diff\n end",
"title": ""
},
{
"docid": "45a4f971a092d5cea48738025376fd86",
"score": "0.5046098",
"text": "def apply_single\n validate_schema\n\n # Prepare some lists of columns.\n key_cols = @db1.primary_key(@table1)\n data_cols = @db1.except_primary_key(@table1)\n all_cols = @db1.column_names(@table1)\n\n # Let our public know we are beginning.\n @patch.begin_diff\n\n # Advertise column names.\n @rc_columns = DiffColumns.new\n @rc_columns.title_row = all_cols\n @rc_columns.update(0)\n cells = all_cols.map{|v| { :txt => v, :value => v, :cell_mode => \"\" }}\n rc = RowChange.new(\"@@\",cells)\n @patch.apply_row(rc)\n\n # If requested, we will be providing context rows around changed rows.\n # This is not a natural thing to do with SQL, so we do it only on request.\n # When requested, we need to buffer row changes.\n @pending_rcs = []\n\n # Prepare some useful SQL fragments to assemble later.\n sql_table1 = @db1.quote_table(@table1)\n sql_table2 = @db1.quote_table(@table2)\n sql_key_cols = key_cols.map{|c| @db1.quote_column(c)}.join(\",\")\n sql_all_cols = all_cols.map{|c| @db1.quote_column(c)}.join(\",\")\n sql_key_match = key_cols.map{|c| @db1.quote_column(c)}.map{|c| \"#{sql_table1}.#{c} IS #{sql_table2}.#{c}\"}.join(\" AND \")\n sql_data_mismatch = data_cols.map{|c| @db1.quote_column(c)}.map{|c| \"#{sql_table1}.#{c} IS NOT #{sql_table2}.#{c}\"}.join(\" OR \")\n\n # For one query we will need to interleave columns from two tables. For\n # portability we need to give these columns distinct names.\n weave = all_cols.map{|c| [[sql_table1,@db1.quote_column(c)],\n [sql_table2,@db2.quote_column(c)]]}.flatten(1)\n dbl_cols = weave.map{|c| \"#{c[0]}.#{c[1]}\"}\n sql_dbl_cols = weave.map{|c| \"#{c[0]}.#{c[1]} AS #{c[0].gsub(/[^a-zA-Z0-9]/,'_')}_#{c[1].gsub(/[^a-zA-Z0-9]/,'_')}\"}.join(\",\")\n\n # Prepare a map of primary key offsets.\n keys_in_all_cols = key_cols.each.map{|c| all_cols.index(c)}\n keys_in_dbl_cols = keys_in_all_cols.map{|x| 2*x}\n\n # Find rows in table2 that are not in table1.\n sql = \"SELECT #{sql_all_cols} FROM #{sql_table2} WHERE NOT EXISTS (SELECT 1 FROM #{sql_table1} WHERE #{sql_key_match})\"\n apply_inserts(sql,all_cols,keys_in_all_cols)\n\n # Find rows in table1 and table2 that differ while having the same primary\n # key.\n sql = \"SELECT #{sql_dbl_cols} FROM #{sql_table1} INNER JOIN #{sql_table2} ON #{sql_key_match} WHERE #{sql_data_mismatch}\"\n apply_updates(sql,dbl_cols,keys_in_dbl_cols)\n\n # Find rows that are in table1 but not table2\n sql = \"SELECT #{sql_all_cols} FROM #{sql_table1} WHERE NOT EXISTS (SELECT 1 FROM #{sql_table2} WHERE #{sql_key_match})\"\n apply_deletes(sql,all_cols,keys_in_all_cols)\n\n # If we are supposed to provide context, we need to deal with row order.\n if @patch.want_context\n sql = \"SELECT #{sql_all_cols}, 0 AS __coopy_tag__ FROM #{sql_table1} UNION SELECT #{sql_all_cols}, 1 AS __coopy_tag__ FROM #{sql_table2} ORDER BY #{sql_key_cols}, __coopy_tag__\"\n apply_with_context(sql,all_cols,keys_in_all_cols)\n end\n\n # Done!\n @patch.end_diff\n end",
"title": ""
},
{
"docid": "45a4f971a092d5cea48738025376fd86",
"score": "0.5046098",
"text": "def apply_single\n validate_schema\n\n # Prepare some lists of columns.\n key_cols = @db1.primary_key(@table1)\n data_cols = @db1.except_primary_key(@table1)\n all_cols = @db1.column_names(@table1)\n\n # Let our public know we are beginning.\n @patch.begin_diff\n\n # Advertise column names.\n @rc_columns = DiffColumns.new\n @rc_columns.title_row = all_cols\n @rc_columns.update(0)\n cells = all_cols.map{|v| { :txt => v, :value => v, :cell_mode => \"\" }}\n rc = RowChange.new(\"@@\",cells)\n @patch.apply_row(rc)\n\n # If requested, we will be providing context rows around changed rows.\n # This is not a natural thing to do with SQL, so we do it only on request.\n # When requested, we need to buffer row changes.\n @pending_rcs = []\n\n # Prepare some useful SQL fragments to assemble later.\n sql_table1 = @db1.quote_table(@table1)\n sql_table2 = @db1.quote_table(@table2)\n sql_key_cols = key_cols.map{|c| @db1.quote_column(c)}.join(\",\")\n sql_all_cols = all_cols.map{|c| @db1.quote_column(c)}.join(\",\")\n sql_key_match = key_cols.map{|c| @db1.quote_column(c)}.map{|c| \"#{sql_table1}.#{c} IS #{sql_table2}.#{c}\"}.join(\" AND \")\n sql_data_mismatch = data_cols.map{|c| @db1.quote_column(c)}.map{|c| \"#{sql_table1}.#{c} IS NOT #{sql_table2}.#{c}\"}.join(\" OR \")\n\n # For one query we will need to interleave columns from two tables. For\n # portability we need to give these columns distinct names.\n weave = all_cols.map{|c| [[sql_table1,@db1.quote_column(c)],\n [sql_table2,@db2.quote_column(c)]]}.flatten(1)\n dbl_cols = weave.map{|c| \"#{c[0]}.#{c[1]}\"}\n sql_dbl_cols = weave.map{|c| \"#{c[0]}.#{c[1]} AS #{c[0].gsub(/[^a-zA-Z0-9]/,'_')}_#{c[1].gsub(/[^a-zA-Z0-9]/,'_')}\"}.join(\",\")\n\n # Prepare a map of primary key offsets.\n keys_in_all_cols = key_cols.each.map{|c| all_cols.index(c)}\n keys_in_dbl_cols = keys_in_all_cols.map{|x| 2*x}\n\n # Find rows in table2 that are not in table1.\n sql = \"SELECT #{sql_all_cols} FROM #{sql_table2} WHERE NOT EXISTS (SELECT 1 FROM #{sql_table1} WHERE #{sql_key_match})\"\n apply_inserts(sql,all_cols,keys_in_all_cols)\n\n # Find rows in table1 and table2 that differ while having the same primary\n # key.\n sql = \"SELECT #{sql_dbl_cols} FROM #{sql_table1} INNER JOIN #{sql_table2} ON #{sql_key_match} WHERE #{sql_data_mismatch}\"\n apply_updates(sql,dbl_cols,keys_in_dbl_cols)\n\n # Find rows that are in table1 but not table2\n sql = \"SELECT #{sql_all_cols} FROM #{sql_table1} WHERE NOT EXISTS (SELECT 1 FROM #{sql_table2} WHERE #{sql_key_match})\"\n apply_deletes(sql,all_cols,keys_in_all_cols)\n\n # If we are supposed to provide context, we need to deal with row order.\n if @patch.want_context\n sql = \"SELECT #{sql_all_cols}, 0 AS __coopy_tag__ FROM #{sql_table1} UNION SELECT #{sql_all_cols}, 1 AS __coopy_tag__ FROM #{sql_table2} ORDER BY #{sql_key_cols}, __coopy_tag__\"\n apply_with_context(sql,all_cols,keys_in_all_cols)\n end\n\n # Done!\n @patch.end_diff\n end",
"title": ""
},
{
"docid": "634fa649eed250628cfa93f376cce9fd",
"score": "0.50423074",
"text": "def select_all; end",
"title": ""
},
{
"docid": "2e718ed070e1ea0d73926f97ae67179a",
"score": "0.5039258",
"text": "def GetTable(vHsh) # Get values from Oracle Tables, return value or unknown in vHsh[\"tPpqId\"] , value of ctl_file_id in vHsh[\"tFileId\"] or leave alone, value of ctl_status in vHsh[\"tStatus\"] or leave alone.\n x = vHsh[\"fFileName\"] \n dir01 = vHsh[\"dirXml\"]\n d1 = dir01 + \"/\" + x\n lineCount = 0\n dgs = 0\n sDGS = ' ' \n tDgsCount = 0\n tPPQ = ' '\n tCtlFileId = 0\n tDistinct = vHsh[\"fileRecordCount\"] \n vHsh[\"tDgs\"] = vHsh[\"fDgs\"] # assume correct\n vHsh[\"tPpqId\"] = vHsh[\"fPpqId\"] \n \n if tDistinct == 1 # will find from query of table using file dgs\n \n query = \"SELECT f.ctl_file_id, T.PPQ_ID, f.ctl_status_id,P.CTL_PROJECT_ID\n FROM ctl_file f ,ctl_project p, ctl_traveler t\n WHERE f.digital_gs_number = '#{vHsh[\"tDgs\"]}'\n AND f.CTL_PROJECT_ID = p.ctl_project_id\n AND P.CTL_TRAVELER_ID = T.CTL_TRAVELER_ID\" \n \n $LOG.debug(\"GetTable query1 #{query}\") \n stmt = @db.prepare(query)\n stmt.execute\n row = stmt.fetch \n vHsh[\"tFileId\"] = row[0].to_i\n vHsh[\"tPpqId\"] = row[1]\n vHsh[\"tStatus\"] = row[2]\n vHsh[\"tProjId\"] = row[3].to_i\n stmt.finish\n vHsh[\"fPpqId\"] = vHsh[\"tPpqId\"] # We found it\n \n elsif vHsh[\"fPpqId\"] != 'unknown' and vHsh[\"fDgs\"] != 'unknown' # info came in with file\n vHsh[\"tPpqId\"] = vHsh[\"fPpqId\"] # assume correct\n \n query = \"SELECT f.ctl_file_id, T.PPQ_ID, f.ctl_status_id,P.CTL_PROJECT_ID\n FROM ctl_file f ,ctl_project p, ctl_traveler t\n WHERE f.digital_gs_number = '#{vHsh[\"tDgs\"]}'\n AND f.CTL_PROJECT_ID = p.ctl_project_id\n AND P.CTL_TRAVELER_ID = T.CTL_TRAVELER_ID\n AND T.PPQ_ID = '#{vHsh[\"tPpqId\"]}'\" \n # puts query \n $LOG.debug(\"GetTable query2 #{query}\")\n stmt = @db.prepare(query)\n stmt.execute\n row = stmt.fetch \n vHsh[\"tFileId\"] = row[0].to_i\n vHsh[\"tStatus\"] = row[2]\n vHsh[\"tProjId\"] = row[3].to_i\n stmt.finish\n else\n puts 'indeterminate'\n end \n ShowHash(vHsh)\n rescue => err\n puts \"Exception11: #{err}\"\n $LOG.error(\"Exception11: #{err}\") \n raise\n end",
"title": ""
},
{
"docid": "3d73e4448a4f2e3d267bf120f3138eec",
"score": "0.50358754",
"text": "def price_like_shiny_mouse_sub\n # There are multiple 'Shiny Mouse' toys that all have different prices.\n # Your goal is to list all names and prices of the toys with the same prices \n # as the different 'Shiny Mouse' toys. \n\n # Exclude the 'Shiny Mouse' toy from your results.\n # Order your alphabetically by toy name.\n\n # USE A SUBQUERY\n execute(<<-SQL) \n SELECT DISTINCT toys.name, toys.price\n FROM cattoys\n JOIN cats ON cat_id = cats.id\n JOIN toys ON toy_id = toys.id\n WHERE toys.price IN (\n SELECT price\n FROM toys\n WHERE toys.name = 'Shiny Mouse')\n AND toys.name != 'Shiny Mouse'\n ORDER BY toys.name ASC\n SQL\nend",
"title": ""
},
{
"docid": "5fb610c6399f56eb73a8a4995e13e7e1",
"score": "0.5033858",
"text": "def get_sqlite_choices\n query = 'SELECT external_account, sub_account ' +\n 'FROM choices ' +\n 'LEFT JOIN sub_accounts ON ' +\n 'sub_accounts.sid = choices.sid ' +\n 'LEFT JOIN external_accounts ON ' +\n 'external_accounts.eid = sub_accounts.eid ' +\n 'WHERE signature = ?' \n rows = sqlitedb.execute(query, signature.inspect)\n #pp \"RRRRROOO\", rows\n if rows.size == 1\n return {\n external_account: eval(rows[0][0]),\n sub_account: eval(rows[0][1]),\n }\n elsif rows.size > 1\n puts query, signature.inspect\n raise \"Duplicate signatures in sqlitedb\"\n else\n return {}\n end\n end",
"title": ""
},
{
"docid": "459f5bc6e2e4a528875a821ab73d7856",
"score": "0.5021172",
"text": "def test_multi_results\n rows = @connection.select_rows(\"CALL ten();\")\n assert_equal 10, rows[0][0].to_i, \"ten() did not return 10 as expected: #{rows.inspect}\"\n\n assert @connection.active?, \"Bad connection use by '#{@connection.class}.select_rows'\"\n end",
"title": ""
},
{
"docid": "f72bc808bc55900ab3aa294e4aeddb01",
"score": "0.5019783",
"text": "def chris_is_missed\n MovieDatabase.execute(<<-SQL)\n\n select movie.title, actor.name\n from movie\n join casting on movie.id = casting.movieid\n join actor on casting.actorid = actor.id\n where ord = 1 and movie.title in\n (\n select movie.title\n from movie\n join casting on movie.id = casting.movieid\n join actor on casting.actorid = actor.id\n where actor.name = 'Chris Farley'\n )\n SQL\nend",
"title": ""
},
{
"docid": "3367743a8ee107756046a3d7080ccaa4",
"score": "0.5011375",
"text": "def build_compound_select_string(data, table, *columns)\n qry = []\n placeholder_args = []\n qry_string = build_qrystring(table, columns) \n (1...MAX_SQLITE_STATEMENTS).each do |index|\n qry_string << \" UNION SELECT ?\" << \",?\" * (columns.size-1)\n end #index\n (0..data.size).step(MAX_SQLITE_STATEMENTS) do |index|\n if ((data.size - index) < MAX_SQLITE_STATEMENTS)\n qry_string = build_qrystring(table, columns)\n (1...data.size - index).each do |newstr|\n qry_string << \" UNION SELECT ?\" << \",?\" * (columns.size-1)\n end #end newstr\n qry.insert(-1, qry_string)\n holder_args = data.slice(index, data.size-index)\n placeholder_args.insert(-1, holder_args) if holder_args[0].class == String\n placeholder_args.insert(-1, holder_args.flatten) if holder_args[0].class == Array\n else \n qry.insert(-1, qry_string)\n holder_args = data.slice(index, MAX_SQLITE_STATEMENTS)\n placeholder_args.insert(-1, holder_args) if holder_args[0].class == String\n placeholder_args.insert(-1, holder_args.flatten) if holder_args[0].class == Array\n #placeholder_args.insert(-1, data.slice(index, MAX_SQLITE_STATEMENTS))\n end # endif\n end #end index\n \n return qry, placeholder_args\n end",
"title": ""
},
{
"docid": "a6a8c158f36f7468cacc14aab3afc0d5",
"score": "0.50019526",
"text": "def selects_all_female_bears_return_name_and_age\n 'SELECT bears.name, bears.age FROM bears WHERE gender = \"F\"'\nend",
"title": ""
},
{
"docid": "316cc333e496537ba1e240c39868b0c6",
"score": "0.49992403",
"text": "def get_sighting_records(db)\r\n\r\n sighting_records = db.query(\"select * from sighting_details order by id\")\r\n\r\n return sighting_records.to_a\r\n\r\nend",
"title": ""
},
{
"docid": "f72ee8c1f3ba14b06903721c25469846",
"score": "0.4992296",
"text": "def no_apples_for_blair_sub\n # Blair has was too many apple toys! Find the name of all the cats that\n # own toys named `Apple` that aren't `Blair`. \n # Order by cat name alphabetically.\n\n # USE A SUBQUERY\n execute(<<-SQL)\n SELECT cats.name\n FROM cattoys\n JOIN cats ON cat_id = cats.id\n JOIN toys ON toy_id = toys.id\n WHERE toys.name LIKE 'Apple'\n ORDER BY cats.name ASC\n ;\n SQL\nend",
"title": ""
},
{
"docid": "2381f42107ad5430f15a40192d29c97b",
"score": "0.49919313",
"text": "def selects_oldest_bear_and_returns_name_and_age\n 'SELECT bears.name, bears.age FROM bears ORDER BY age DESC LIMIT 1'\nend",
"title": ""
},
{
"docid": "2178b37880669bfe47daf230e8991a88",
"score": "0.49856028",
"text": "def subquery_columns\n explicit_columns_in_subquery? ? explicit_columns : super\n end",
"title": ""
},
{
"docid": "40e6de1f84a46306240cd1c4d4e08087",
"score": "0.49835205",
"text": "def prepare_explicit_statement(ds, type, vals=OPTS)\n f = ds.opts[:from]\n meth = type == :insert_select ? :returning : :select\n s = ds.opts[meth]\n if f && f.length == 1 && !ds.opts[:join] && (!s || s.empty?)\n ds = ds.send(meth, *columns.map{|c| Sequel.identifier(c)})\n end \n \n prepare_statement(ds, type, vals)\n end",
"title": ""
},
{
"docid": "e13cd831109268ff6bdcb61b471bb929",
"score": "0.4979735",
"text": "def differences(dbh1, dbh2, name1, name2, masks, block) # :nodoc:\n idc = []\n mask_insert = []\n mask_delete = []\n mask = 0 # mask of previous table\n count = 0\n inserts = 0\n updates = 0\n deletes = 0\n (masks.size-1).downto(0) do |level|\n next_idc = []\n $stderr.print(\"investigating #{idc.inspect}, level=#{level}\\n\") if @verbose > 1\n raise \"giving up at level #{level}: #{idc.size} differences exceeeds max_report (#{@max_report})\" if (@max_report > 0 && idc.size > @max_report)\n\n # select statement handlers\n s1 = selidc(dbh1, \"#{name1}#{level}\", mask, level == 0, idc)\n s2 = selidc(dbh1, \"#{name2}#{level}\", mask, level == 0, idc)\n r1 = nil\n r2 = nil\n s1_active = true\n s2_active = true\n \n # content of one row from the above select result\n # let us merge the two ordered select\n while (true) do\n # update current lists if necessary\n if !r1 && s1_active\n r1 = s1.fetch\n s1_active = false unless r1\n end\n if !r2 && s2_active\n r2 = s2.fetch\n s2_active = false unless r2\n end\n break unless (r1 || r2)\n \n # else both lists are defined\n if (r1 && r2 && r1[0] == r2[0]) # matching idc\n if (r1[1] != r2[1]) # non matching checksums\n if (level != 0)\n next_idc.push(r1[0]) # to be investigated...\n else\n # the level-0 table keeps the actual key\n count += 1\n updates += 1\n block.call(:update, r1[2]) unless block.nil? # final result\n end\n end\n # both tuples are consummed\n r1 = nil\n r2 = nil\n \n # if they do not match, one is missing or less than the other\n elsif (!r2 || (r1 && r1[0] < r2[0])) # more idc in table 1\n if (level != 0)\n mask_insert.push([ r1[0], masks[masks.size-1] ]) # later\n else\n count += 1\n inserts += 1\n block.call(:insert, r1[2]) unless block.nil? # final result\n end\n # left tuple is consummed\n r1 = nil\n \n # this could be a else\n elsif (!r1 || (r2 && r1[0] > r2[0])) # more idc in table 2\n if (level != 0)\n mask_delete.push([ r2[0], masks[masks.size-1] ]) # later\n else\n count += 1\n deletes += 1\n block.call(:delete, r1[2]) unless block.nil? # final result\n end\n # right tuple is consummed\n r2 = nil\n else\n raise 'this state should never happen'\n end\n end\n s1.finish\n s2.finish\n level -= 1 # next table! 0 is the initial checksum table\n mask = masks.pop() # next mask\n idc = next_idc # idcs to be investigated on next round\n break if idc.empty?\n end\n {\n :count => count,\n :inserts => inserts,\n :updates => updates,\n :deletes => deletes,\n :mask_insert => mask_insert,\n :mask_delete => mask_delete\n }\n end",
"title": ""
},
{
"docid": "b47735e6b153edcf0b86c4a314aaca33",
"score": "0.49790257",
"text": "def select_rows(sql, name = nil)\n select_raw(sql, name).last\n end",
"title": ""
},
{
"docid": "c118a8413e5ceb445c4969289348a344",
"score": "0.49773788",
"text": "def resource_reservations(date_from, date_to, stock_plate_or_reference)\n\n BookingDataSystem::Booking.by_sql { |b| \n [select_resource_reservations(b), stock_plate_or_reference, stock_plate_or_reference,\n date_from, date_from, \n date_to, date_to,\n date_from, date_to,\n date_from, date_to ] }.all(order: :date_from) \n\n end",
"title": ""
},
{
"docid": "b47735e6b153edcf0b86c4a314aaca33",
"score": "0.49766666",
"text": "def select_rows(sql, name = nil)\n select_raw(sql, name).last\n end",
"title": ""
},
{
"docid": "962045fa4d98acaee4c35bc0d04feab1",
"score": "0.497652",
"text": "def db_query_transform__subquery query, tmp_table=\"resultset_table\"\n \"(#{query}) as #{tmp_table}\"\n end",
"title": ""
},
{
"docid": "ce7c4f727356362ea77cd6edca4f4535",
"score": "0.49757186",
"text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"\nSELECT projects.title, SUM(pledges.amount)\nFROM projects LEFT OUTER JOIN pledges\nON projects.id = pledges.project_id\nGROUP BY projects.title\nORDER BY projects.title\n\"\nend",
"title": ""
},
{
"docid": "5a3fa1e42f87a28b2ece494eda6ca5d0",
"score": "0.49664772",
"text": "def prepare_hgt_com_trsf_prkgrs_old()\n \n @conn.execute \\\n \"truncate table hgt_com_trsf_prkgrs\"\n \n puts \"hgt_com_trsf_prkgrs table truncated...\"\n \n #\n sql = \"select id,\n gene_id,\n TXSRC_ID,\n TXDST_ID,\n WEIGHT_TR_TX\n from HGT_COM_TRSF_TAXONS\"\n \n #puts \"sql: #{sql}\"\n \n \n tr_taxons = HgtComTrsfTaxon.find_by_sql(sql)\n \n tr_taxons.each {|tr|\n \n\n #debugging\n #next unless tr.gene_id == 111 and tr.txsrc_id == 768679 and tr.txdst_id == 374847\n \n #puts \"tr: #{tr.inspect}\"\n #puts \"tr.id: #{tr.id}, #{tr.gene_id}\"\n \n #for each chiteria\n (0..1).each {|crit|\n \n #for each criteria and\n #for each source and destination prok groups\n sql = \"select tg.PROK_GROUP_ID,\n tg.WEIGHT_PG\n from TAXON_GROUPS tg \n join PROK_GROUPS pg on pg.id = tg.PROK_GROUP_ID\n where tg.TAXON_ID = #{tr.txsrc_id} and\n pg.GROUP_CRITER_ID = #{crit}\"\n #puts \"sql: \\n #{sql}\"\n \n pg_src = TaxonGroup.find_by_sql(sql)\n \n \n sql = \"select tg.PROK_GROUP_ID,\n tg.WEIGHT_PG\n from TAXON_GROUPS tg \n join PROK_GROUPS pg on pg.id = tg.PROK_GROUP_ID\n where tg.TAXON_ID = #{tr.txdst_id} and\n pg.GROUP_CRITER_ID = #{crit}\"\n #puts \"sql: \\n #{sql}\"\n \n pg_dst = TaxonGroup.find_by_sql(sql)\n \n pg_src.each {|src|\n pg_dst.each {|dst|\n \n #puts \"src: #{src.inspect}\"\n #puts \"dst: #{dst.inspect}\"\n \n #insert alternative\n prkg = HgtComTrsfPrkgr.new \n prkg.gene_id = tr.gene_id\n prkg.hgt_com_trsf_taxon_id = tr.id\n prkg.pgsrc_id = src.prok_group_id\n prkg.pgdst_id = dst.prok_group_id\n prkg.weight_tr_pg = tr.weight_tr_tx * src.weight_pg * dst.weight_pg\n prkg.save\n \n #prkg.gene_id = tr.gene_id \n #prkg.save\n \n \n }\n }\n \n \n \n \n \n } \n }\n \n \n end",
"title": ""
},
{
"docid": "f94801c4e98667b377fe2aff11d2b6c0",
"score": "0.49658445",
"text": "def build_select(arel)\n if select_values.any?\n cols = arel_columns(select_values.uniq).map do |col|\n # if it is a virtual attribute, then add aliases to those columns\n if col.kind_of?(Arel::Nodes::Grouping) && col.name\n col.as(connection.quote_column_name(col.name))\n else\n col\n end\n end\n arel.project(*cols)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "f4acfad4b34108953da25242fc068977",
"score": "0.495103",
"text": "def debug_select(hash)\n $stderr.puts '--- DEBUG ---'\n $stderr.puts \"SELECT(#{hash[:select].join(', ')})\"\n $stderr.puts \" FROM(#{hash[:from]})\"\n $stderr.puts \" WHERE('#{hash[:where]}')\" if hash[:where]\n into_list = hash[:into].dup\n into_list.push \"'#{into_list.pop}'\" if into_list.length > 1\n $stderr.puts \" INTO(#{into_list.join(' ')})\"\n $stderr.puts \"\"\n end",
"title": ""
},
{
"docid": "67a4dca60d448dbe18786c4c061b19e6",
"score": "0.49484465",
"text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"SELECT title, (select sum(amount) from pledges where project_id = projects.id) FROM projects Order by projects.title\"\nend",
"title": ""
},
{
"docid": "541ca4633c4a18556a32bb16d39924e6",
"score": "0.4947924",
"text": "def custom_sql\n \"SELECT bookings.full_name, suites.number FROM bookings LEFT OUTER JOIN suites ON bookings.suite_id = suites.id;\"\nend",
"title": ""
},
{
"docid": "654f81775d71f55e8a17e81fb4507cd5",
"score": "0.49438822",
"text": "def merge_resultsets(result1, result2); end",
"title": ""
},
{
"docid": "654f81775d71f55e8a17e81fb4507cd5",
"score": "0.49431553",
"text": "def merge_resultsets(result1, result2); end",
"title": ""
},
{
"docid": "898c2dafcfe12105930b5555bc4e64db",
"score": "0.49419245",
"text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title, SUM(amount)\nFROM projects\nINNER JOIN pledges\nON projects.id = pledges.project_id\nGROUP BY title\nORDER BY title\"\n\n# FROM owners\n# INNER JOIN cats_owners\n# ON owners.id = cats_owners.owner_id\n# JOIN cats ON cats_owners.cat_id = cats.id\n# WHERE cats_owners.owner_id = 2;\n\nend",
"title": ""
}
] |
3ae0a27d3a7e52eecf068ab4ab111087 | def cards [] end def self.cards | [
{
"docid": "f7c7c75d08d6faa2e00b182e5c87f8c9",
"score": "0.66844356",
"text": "def choose_card \n\n @cards.shift\n end",
"title": ""
}
] | [
{
"docid": "c92edf0a2f0c7f6e8399b6e095101aba",
"score": "0.8476114",
"text": "def cards\n @cards\n end",
"title": ""
},
{
"docid": "5357f5dc8289842c1be9a15a45b5d640",
"score": "0.83319545",
"text": "def initialize\n @cards = []\n end",
"title": ""
},
{
"docid": "062072a2e8f86510cb38b668eb319cb5",
"score": "0.82006955",
"text": "def initialize()\n @cards = []\n end",
"title": ""
},
{
"docid": "a952758cc07f15d1631859ff1282a921",
"score": "0.81048065",
"text": "def cards\n\t\t@cards.each do |card|\n\t\t\tputs card.card\n\t\tend\n\tend",
"title": ""
},
{
"docid": "76250a2963bd5bcc8600648e717e65c1",
"score": "0.8045072",
"text": "def getCardArray()\n\t\treturn @cards\n\tend",
"title": ""
},
{
"docid": "581993f0d3725c8c515548274e16ec24",
"score": "0.79053485",
"text": "def cards\n @cards ||= Hand.new\n end",
"title": ""
},
{
"docid": "429db542671896a3753d141f74f183b3",
"score": "0.77821785",
"text": "def return_cards\n @hand = []\n end",
"title": ""
},
{
"docid": "cf41482b4a158a330e3f26ea4fd14532",
"score": "0.77090144",
"text": "def get_cards(deck)\n\n end",
"title": ""
},
{
"docid": "2c84c43e5e155471dbe6ac6345a59ba5",
"score": "0.7622042",
"text": "def initialize(cards)\n @cards = cards\n end",
"title": ""
},
{
"docid": "2c84c43e5e155471dbe6ac6345a59ba5",
"score": "0.7622042",
"text": "def initialize(cards)\n @cards = cards\n end",
"title": ""
},
{
"docid": "2c84c43e5e155471dbe6ac6345a59ba5",
"score": "0.7622042",
"text": "def initialize(cards)\n @cards = cards\n end",
"title": ""
},
{
"docid": "4ec296124b8805afe1af6f54cd8e2905",
"score": "0.7592547",
"text": "def deal_cards\n\t\t\tend",
"title": ""
},
{
"docid": "6b7c5f966107fb572b612eca1c4d42ca",
"score": "0.75563633",
"text": "def get_card\n end",
"title": ""
},
{
"docid": "777688b623882a41eb7248eff91f1ca5",
"score": "0.75114095",
"text": "def cards\n @cards ||= EbanqApi::Cards.new(self)\n end",
"title": ""
},
{
"docid": "8f325e3b6fbc6a6c45c80f3e07b2eeb7",
"score": "0.74931216",
"text": "def initialize(cards) #argument\n @cards = cards\n end",
"title": ""
},
{
"docid": "ee206e81d90c4d374cc7c88866b60846",
"score": "0.73559445",
"text": "def initialize\n @cards = []\n @values = [0]\n end",
"title": ""
},
{
"docid": "2336aaebd246465073b2658809ca08d2",
"score": "0.7344",
"text": "def return(cards)\n @deck += cards\n end",
"title": ""
},
{
"docid": "5b20519866eba65e9d99b3dbfa263908",
"score": "0.73291343",
"text": "def initialize\n\t\t@cards = (1..52).to_a\n\tend",
"title": ""
},
{
"docid": "7abb37079e91154dd13f84b4ba6065f1",
"score": "0.7279586",
"text": "def initialize(cards = Deck.all_cards)\n @cards = cards\n end",
"title": ""
},
{
"docid": "990294fe7018f8830251c1edb7717338",
"score": "0.72502077",
"text": "def each\n @card_list.each\n end",
"title": ""
},
{
"docid": "1af7bddeeedbddb0753f016c45844a29",
"score": "0.72473854",
"text": "def initialize(cards = Deck.all_cards)\n end",
"title": ""
},
{
"docid": "58a8c9db3db885b1ff6bfc4422937f0b",
"score": "0.72430867",
"text": "def [] i\n @cards[i]\n end",
"title": ""
},
{
"docid": "d1e6bf20a6281a24cc9c85c91dea8fb1",
"score": "0.72299594",
"text": "def initialize\n @cards = []\n suits = [:hearts, :diamonds, :spades, :clubs]\n suits.each do |suit|\n (2..10).each do |value|\n @cards << Card.new(suit, value)\n end\n [\"J\", \"Q\", \"K\", \"A\"].each do |facecard|\n @cards << Card.new(suit, facecard)\n end\n end\n\n def shuffle!\n cards.shuffle!\n end\n\n def empty?\n self.cards.empty?\n end\n\n\nend",
"title": ""
},
{
"docid": "759acbf97fe45b86901f23c508f32dfa",
"score": "0.7215237",
"text": "def printCardArray()\n\t\tprint @cards\n\tend",
"title": ""
},
{
"docid": "57c27b39b34108e7d39dd4d5d7131bd0",
"score": "0.7191021",
"text": "def my_cards\n index = 0\n @my_cards = []\n @suits.each do |suit|\n (1..13).each do |value|\n card = Card.new(value, suit)\n @my_cards.push(card)\n end\n end\n return @my_cards\n end",
"title": ""
},
{
"docid": "38a01af11968fc657f1890612bcad5c9",
"score": "0.7184501",
"text": "def desk_cards\n desk = []\n self.public_deal.each do |i|\n desk.push(i)\n end\n self.hand_deal.each do |i|\n desk.push(i)\n end\n desk\n end",
"title": ""
},
{
"docid": "db3e7fdd38f02846bd3ba7b4d987f4f1",
"score": "0.71707153",
"text": "def return(cards)\n @cards.concat(cards)\n end",
"title": ""
},
{
"docid": "bf4653df2e92f769e360e1c796b68e9b",
"score": "0.71681833",
"text": "def initialize(cards)\n @cards = cards\n end",
"title": ""
},
{
"docid": "a64463d78d08fa3e639d2137d3ddceea",
"score": "0.7159836",
"text": "def each\r\n @card_list.each\r\n end",
"title": ""
},
{
"docid": "4a27248d6570fc8bdf41d48e17131036",
"score": "0.7151574",
"text": "def display_deck\n @deck_array.each do |x|\n x.display_card\n end\n end",
"title": ""
},
{
"docid": "53d28e512d9d396e3c324bc973251823",
"score": "0.71363354",
"text": "def deal(cards)\n @cards = cards\n end",
"title": ""
},
{
"docid": "2c948449897df15d56f126a35ff6e6a0",
"score": "0.71228945",
"text": "def remaining_cards\r\n @deck_of_cards.each do |card|\r\n card.output_card\r\n end\r\n end",
"title": ""
},
{
"docid": "38b237f5564c9ca97f051c9f894f7646",
"score": "0.70990217",
"text": "def card_deck\n CardDeck.new(card: @subject)\n end",
"title": ""
},
{
"docid": "580406f8efd6fa218c7e998028b05777",
"score": "0.709634",
"text": "def deal_card!(cards)\n\nend",
"title": ""
},
{
"docid": "b53a2b3a0a0d39511e8ccb9415fdefbb",
"score": "0.7079542",
"text": "def initialize(card_array) # creates an array of cards\n @cards = card_array\n end",
"title": ""
},
{
"docid": "f3c0971d43ca62ef571fd099c7e3ad00",
"score": "0.7072727",
"text": "def deal_card\n @cards.pop\n end",
"title": ""
},
{
"docid": "4e03d17687f8837d53a8500bb3cf2d26",
"score": "0.7068335",
"text": "def return(cards)\n @deck.concat(cards)\n end",
"title": ""
},
{
"docid": "b6905971f67ca0ca5c4e381acd451820",
"score": "0.7054275",
"text": "def deal_card\r\n\t\tcards.pop\r\n\tend",
"title": ""
},
{
"docid": "e3001fc37511dc24abec7a1297f5f138",
"score": "0.7016256",
"text": "def draw_card\n #suit = Card::SUITS.sample\n #rank = Card::RANKS.sample\n #Card.new(suit: suit, rank: rank)\n @cards.pop\n end",
"title": ""
},
{
"docid": "a732d86b3b46c3e37849ed3a48c72ae0",
"score": "0.70140755",
"text": "def index\n @cards = @deck.cards\n end",
"title": ""
},
{
"docid": "a6cbeb60bda502218936bc677efa49b0",
"score": "0.6994985",
"text": "def add_cards(cs)\n\t\tcards.concat cs\n\tend",
"title": ""
},
{
"docid": "40330e0fa9ed0691575bfb6e11b835e4",
"score": "0.69814706",
"text": "def draw_card\n self.cards.pop\n end",
"title": ""
},
{
"docid": "a0c8778c6f14fec206e7668bd248ceb7",
"score": "0.69769335",
"text": "def draw\n return @cards.pop\n end",
"title": ""
},
{
"docid": "b0abed639557850609fd827ad9e3aa1b",
"score": "0.69767815",
"text": "def empty\n @cards.shift(@cards.size)\n end",
"title": ""
},
{
"docid": "6ccf5ab591b292072a23b8b1c83b6731",
"score": "0.6956074",
"text": "def index\n #@cards = Card.all\n end",
"title": ""
},
{
"docid": "b11087e29ec67946853261f6b174a61d",
"score": "0.694924",
"text": "def get_card\n @deck.pop\n end",
"title": ""
},
{
"docid": "54327e4737926ef0a23596e8c2f971a3",
"score": "0.69341385",
"text": "def get_rounds_cards\n # get all the cards from this round's deck\n @cards = self.deck.cards\n end",
"title": ""
},
{
"docid": "2d31a55862d603a4b7bcbd8c4082ca46",
"score": "0.6927568",
"text": "def deal\r\n @cards.shift\r\n end",
"title": ""
},
{
"docid": "53c9e73b335bcba66d72f5a384f0b121",
"score": "0.69040316",
"text": "def [] i\n @card_list[i]\n end",
"title": ""
},
{
"docid": "1b72af5882efa9c58e50740fd9e591b3",
"score": "0.69015443",
"text": "def deal_one\n cards.pop\n end",
"title": ""
},
{
"docid": "a2f5c45ea0ead9b41c14c8163ed00f02",
"score": "0.68770605",
"text": "def cards\n @cards ||= @client.resource['creditCards']\n end",
"title": ""
},
{
"docid": "8c4eac3bc885d7a18a705ace975d1036",
"score": "0.6858175",
"text": "def initialize \r\n @cards = []\r\n\r\n\r\n\r\n # Idiomatic ruby loop\r\n SUITS.each do |suit|\r\n RANKS.each do |rank|\r\n @cards.push(Card.new(rank,suit))\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "8bd644bb52f390c49c9a7e679e8829b0",
"score": "0.6828456",
"text": "def initialize\n self.cards = []\n (0..51).each { |i| cards << Card.new(i) }\n self.cards.shuffle! \n end",
"title": ""
},
{
"docid": "7c662bf73ac6b49d9c70160c874f3bd3",
"score": "0.68246996",
"text": "def take_card(card)\n @cards << card\n end",
"title": ""
},
{
"docid": "a4a9c442bec56e503b3286249f1f83fc",
"score": "0.6823922",
"text": "def index\n @cards = @deck.cards.all\n end",
"title": ""
},
{
"docid": "751f28d26547b290fea948c751f74ab8",
"score": "0.6800668",
"text": "def get_card()\n @shoe.get_card()\n end",
"title": ""
},
{
"docid": "4777f6d10087073cb77e56cc8bf97905",
"score": "0.67999357",
"text": "def getCards(aDeck)\n\t\treturn 13.times{self << aDeck.next}\t\n\tend",
"title": ""
},
{
"docid": "cbf2b476de432a6006a4e472e9e313d2",
"score": "0.67964566",
"text": "def initialize\n @cards = []\n\n @two, @three, @four, @five = nil, nil, nil, nil\n end",
"title": ""
},
{
"docid": "b40a8b113556da59a186f6ba5303876d",
"score": "0.67963946",
"text": "def draw\n @cards.pop\n end",
"title": ""
},
{
"docid": "1dcb90491a7b79307b1f870ecfb71b19",
"score": "0.67927045",
"text": "def initialize\r\n\t\t@cards =[]\r\n\t\t%w[Spades Hearts Diamonds Clubs].each do |suit|\r\n\t\t\t%w[2 3 4 5 6 7 8 9 10 J Q K A].each do |face_value|\r\n\t\t\t\t@cards << Card.new(suit, face_value)\r\n\t\t\tend\r\n\t\tend\r\n\t\tshuffle!\r\n\tend",
"title": ""
},
{
"docid": "e496a1b62e90d00f680560c2b397d4a8",
"score": "0.6775501",
"text": "def index\n @cards = Card.all\n end",
"title": ""
},
{
"docid": "e496a1b62e90d00f680560c2b397d4a8",
"score": "0.6775501",
"text": "def index\n @cards = Card.all\n end",
"title": ""
},
{
"docid": "e496a1b62e90d00f680560c2b397d4a8",
"score": "0.6775501",
"text": "def index\n @cards = Card.all\n end",
"title": ""
},
{
"docid": "e496a1b62e90d00f680560c2b397d4a8",
"score": "0.6775501",
"text": "def index\n @cards = Card.all\n end",
"title": ""
},
{
"docid": "6837dd06055c8ced0fab9d46be47643f",
"score": "0.6762299",
"text": "def return(cards)\n @stockpile += cards\n end",
"title": ""
},
{
"docid": "1349f4cde4c5ee9bb460715e57767d79",
"score": "0.6761245",
"text": "def [] i\r\n @card_list[i]\r\n end",
"title": ""
},
{
"docid": "05fdd93a2dfacdd3dcc6f901c54b12f9",
"score": "0.6753829",
"text": "def Deck *cards\n Deck[*cards]\nend",
"title": ""
},
{
"docid": "026812c0abce10e784c5acdf5b6239ac",
"score": "0.6748874",
"text": "def add_card(card)\n \t@cards << card\n end",
"title": ""
},
{
"docid": "2a769ed2df8988a8d8e9f6dc9cf5540f",
"score": "0.6739705",
"text": "def get_hand\n return @cards_in_hand\n end",
"title": ""
},
{
"docid": "303f5bec66ce0de78e7eb82a4c625d0a",
"score": "0.6731105",
"text": "def initialize(name)\n @name = name\n @cards = []\n end",
"title": ""
},
{
"docid": "534be7afbf7c10485c65c1190647d1a3",
"score": "0.6729988",
"text": "def index\n @deck_of_cards = DeckOfCard.all\n end",
"title": ""
},
{
"docid": "995e42956cd51b72f4de398f571800e2",
"score": "0.6725633",
"text": "def draw\n @cards.shift\n end",
"title": ""
},
{
"docid": "d371cb2850d8c519f2b52d6fc45b31e7",
"score": "0.67238426",
"text": "def make_stock_card_deck\n self.stock_cards = StockCard.all\n end",
"title": ""
},
{
"docid": "25a4130d4a34670f78de2054bd24a4b0",
"score": "0.6720375",
"text": "def return(new_cards)\n\n new_cards.each do |card|\n self.deck.push(card)\n end\n\n end",
"title": ""
},
{
"docid": "d45f8ebcf37dbdfb81e29554db6a2935",
"score": "0.6716092",
"text": "def reset!\n @cards = load_cards\n end",
"title": ""
},
{
"docid": "1b8623388a7e68d6b98b23aa1ca64d0e",
"score": "0.67046267",
"text": "def initialize_cards\n cards = []\n 4.times { cards += (2..14).to_a }\n cards.sample(52)\n end",
"title": ""
},
{
"docid": "7e0eb8475e1fddae674c101b7b70f4ec",
"score": "0.6700708",
"text": "def hit!\n\t\t@cards << @deck.take!\n\tend",
"title": ""
},
{
"docid": "5cc67f351426dfd9984b687bbab1e9e4",
"score": "0.6697832",
"text": "def deal_card\n @deck.pop\n end",
"title": ""
},
{
"docid": "9f7b754620a6fd15388009dee45076ea",
"score": "0.66776",
"text": "def initialize(deck = nil)\n deck ? @cards = deck.deal(5) : @cards = []\n end",
"title": ""
},
{
"docid": "60145ce30428e60c12dfb19305d010de",
"score": "0.66743153",
"text": "def top\n cards.first\n end",
"title": ""
},
{
"docid": "32a0e429701f5195a858afb11426875f",
"score": "0.6672162",
"text": "def deal_hand no_of_cards\r\n @card_list.deal_hand no_of_cards\r\n end",
"title": ""
},
{
"docid": "4118a27aa8a70df11b9f45adfbe6ee49",
"score": "0.66628945",
"text": "def size\n return @cards.length\n end",
"title": ""
},
{
"docid": "fd714f559b129c4b22e8b50bcbf56790",
"score": "0.66604054",
"text": "def gen_cards\n # done in a verbose manner so that code is easy to understand\n %w[H D S C].each do |suit|\n @cards.push(Card.new('Ace', suit, 1))\n @cards.push(Card.new('Two', suit, 2))\n @cards.push(Card.new('Three', suit, 3))\n @cards.push(Card.new('Four', suit, 4))\n @cards.push(Card.new('Five', suit, 5))\n @cards.push(Card.new('Six', suit, 6))\n @cards.push(Card.new('Seven', suit, 7))\n @cards.push(Card.new('Eight', suit, 8))\n @cards.push(Card.new('Nine', suit, 9))\n @cards.push(Card.new('Ten', suit, 10))\n @cards.push(Card.new('Jack', suit, 10))\n @cards.push(Card.new('Queen', suit, 10))\n @cards.push(Card.new('King', suit, 10))\n end\n end",
"title": ""
},
{
"docid": "946900d04ccb671e2c6f494bf67c3f0b",
"score": "0.66596884",
"text": "def face_cards\n @face_cards ||= self.class.face_cards\n end",
"title": ""
},
{
"docid": "b2b436b28fd0600f7371cdd659f1efc6",
"score": "0.6657985",
"text": "def cards(options = { :filter => :open })\n return @cards if @cards\n @cards = Client.get(\"/boards/#{id}/cards\").json_into(Card)\n end",
"title": ""
},
{
"docid": "167dd8b5426f6ef3d860f3097641267d",
"score": "0.6656932",
"text": "def initialize()\n # Cards table, containing cards hashes\n setAllCards()\n end",
"title": ""
},
{
"docid": "239d5069466a2d15e277703694f9515d",
"score": "0.66519684",
"text": "def draw\n raise \"not enough cards\" if @cards.empty?\n @cards.shift\n end",
"title": ""
},
{
"docid": "5ad47f29436c1201a0402f4e9d0b47d6",
"score": "0.6642515",
"text": "def initialize()\n\t\tcards = []\n\t\t@board = cards\n\t\t@deck = Deck.new\n\t\tSTARTINGCARDS.times { @board << @deck.draw }\n\tend",
"title": ""
},
{
"docid": "602523c6aac8107a7dc82d2fed44eb4c",
"score": "0.6642109",
"text": "def drawcard\n @deck.pop\n end",
"title": ""
},
{
"docid": "25365c17865ba8703a4d4fa1c7c8ccce",
"score": "0.6642099",
"text": "def initialize\n @cards = full_deck.shuffle\n @used = []\n @inhand = []\n @hands = []\n end",
"title": ""
},
{
"docid": "cbf21f2ddd080017e05aa77145577755",
"score": "0.6640808",
"text": "def deal_hand no_of_cards\n @card_list.deal_hand no_of_cards\n end",
"title": ""
},
{
"docid": "76a9a038006aae288ddaf983f8bf052c",
"score": "0.66324013",
"text": "def add card\n @cards.push card\n end",
"title": ""
},
{
"docid": "3763ae6afd5a2278de8503243f2b3e87",
"score": "0.6632151",
"text": "def card\n\t @dance_card\n\tend",
"title": ""
},
{
"docid": "f5688364b22d795ffd27c96d4db35d74",
"score": "0.6626962",
"text": "def [] index\n @cards[index]\n end",
"title": ""
},
{
"docid": "f2de87ae8f1ca3d37a36ee9e02892908",
"score": "0.6622898",
"text": "def count\n return cards.length \n end",
"title": ""
},
{
"docid": "1c18b59c55f449a2e3adc598484a98d5",
"score": "0.66222",
"text": "def each\n @cards.each{|card| yield card}\n end",
"title": ""
},
{
"docid": "c7ab5c93602658e31310e586db5c77f7",
"score": "0.6622106",
"text": "def sort\n @cards.sort\n end",
"title": ""
},
{
"docid": "8be1e7eebe8fec5f534a54a9c7229597",
"score": "0.6621653",
"text": "def get_card(card)\n @hand.append(card)\n end",
"title": ""
},
{
"docid": "9dbd7612d04e4bf94c2f6e5461b8d481",
"score": "0.6617962",
"text": "def initialize\n @card_classes = ['Hearts','Spades','Diamonds','Clubs']\n @card_types = ['Two of','Three of','Four of','Five of','Six of','Seven of','Eight of','Nine of','Ten of','Jack of','Queen of' ,'King of','Ace of']\n @deck = []\n @card_types.each do |c_types|\n @card_classes.each do |c_class|\n @deck.push(c_types + \" \" + c_class)\n end\n end\n end",
"title": ""
},
{
"docid": "4ea9dd6fe31e39a63729547a770d9112",
"score": "0.66150844",
"text": "def remove_card\n cards.shift\n return cards\n end",
"title": ""
}
] |
386b04a4b18a28fd8625de141eaa727f | like encode, but only calls as_json, without encoding to string. | [
{
"docid": "c92e2c5522ef4c96e71e70322d416d26",
"score": "0.0",
"text": "def as_json(value, use_options = true)\n check_for_circular_references(value) do\n use_options ? value.as_json(options_for(value)) : value.as_json\n end\n end",
"title": ""
}
] | [
{
"docid": "06fa7195b090da619c2ba202f9d2db24",
"score": "0.74802446",
"text": "def json_encoder; end",
"title": ""
},
{
"docid": "06fa7195b090da619c2ba202f9d2db24",
"score": "0.74802446",
"text": "def json_encoder; end",
"title": ""
},
{
"docid": "06fa7195b090da619c2ba202f9d2db24",
"score": "0.74802446",
"text": "def json_encoder; end",
"title": ""
},
{
"docid": "737265ff32ecc6bc702bbc2063f37333",
"score": "0.72875184",
"text": "def to_json(...)\n as_json.to_json(...)\n end",
"title": ""
},
{
"docid": "431d30ffa08cdef545170726af8d99d0",
"score": "0.72865546",
"text": "def json_encoded\n encoded\n end",
"title": ""
},
{
"docid": "95a10bfb99b3326d71614f111ddb540d",
"score": "0.7265731",
"text": "def encode(value)\n unless options.empty?\n value = value.as_json(options.dup)\n end\n json = stringify(jsonify(value))\n\n # Rails does more escaping than the JSON gem natively does (we\n # escape \\u2028 and \\u2029 and optionally >, <, & to work around\n # certain browser problems).\n if Encoding.escape_html_entities_in_json\n json.gsub!(\">\", '\\u003e')\n json.gsub!(\"<\", '\\u003c')\n json.gsub!(\"&\", '\\u0026')\n end\n json.gsub!(\"\\u2028\", '\\u2028')\n json.gsub!(\"\\u2029\", '\\u2029')\n json\n end",
"title": ""
},
{
"docid": "75747f9fedfbd5750859b3e2569e7dc0",
"score": "0.72020066",
"text": "def as_json(*)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "aaa93d303fa8d20637be85642a33ba8b",
"score": "0.7156874",
"text": "def json_encoder=(_arg0); end",
"title": ""
},
{
"docid": "aaa93d303fa8d20637be85642a33ba8b",
"score": "0.7156874",
"text": "def json_encoder=(_arg0); end",
"title": ""
},
{
"docid": "aaa93d303fa8d20637be85642a33ba8b",
"score": "0.7156874",
"text": "def json_encoder=(_arg0); end",
"title": ""
},
{
"docid": "98c0820beff221888295f01373fc7d36",
"score": "0.714697",
"text": "def json_encode(obj)\n obj.to_json\n end",
"title": ""
},
{
"docid": "0302dee34622e922269389f8b3b1a7c9",
"score": "0.71455497",
"text": "def encode(value)\n stringify jsonify value.as_json(options.dup)\n end",
"title": ""
},
{
"docid": "0302dee34622e922269389f8b3b1a7c9",
"score": "0.71455497",
"text": "def encode(value)\n stringify jsonify value.as_json(options.dup)\n end",
"title": ""
},
{
"docid": "0302dee34622e922269389f8b3b1a7c9",
"score": "0.71455497",
"text": "def encode(value)\n stringify jsonify value.as_json(options.dup)\n end",
"title": ""
},
{
"docid": "b55304c454583ca15062adfeb226daf8",
"score": "0.71309346",
"text": "def json_encoded\n self.to_hash.to_json\n end",
"title": ""
},
{
"docid": "49509b277324abfd9bc32c665d495052",
"score": "0.71040833",
"text": "def to_json(*)\n as_json.to_json\n end",
"title": ""
},
{
"docid": "d4402a5ac0db88d34754c42552d125cc",
"score": "0.6983967",
"text": "def as_json(*_)\n to_s\n end",
"title": ""
},
{
"docid": "3ba25ff89a5bd3c1396d9e0f20bf0a21",
"score": "0.6962877",
"text": "def force_convert_to_json\n MultiJson.encode(self)\n end",
"title": ""
},
{
"docid": "1e289d54af7049cf8ff7092122f0f58c",
"score": "0.69597507",
"text": "def as_json(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1e289d54af7049cf8ff7092122f0f58c",
"score": "0.69597507",
"text": "def as_json(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1e289d54af7049cf8ff7092122f0f58c",
"score": "0.69597507",
"text": "def as_json(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1e289d54af7049cf8ff7092122f0f58c",
"score": "0.69597507",
"text": "def as_json(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1e289d54af7049cf8ff7092122f0f58c",
"score": "0.69597507",
"text": "def as_json(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1e289d54af7049cf8ff7092122f0f58c",
"score": "0.69597507",
"text": "def as_json(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1e289d54af7049cf8ff7092122f0f58c",
"score": "0.69597507",
"text": "def as_json(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0582ba1ff779232300b1672a8c1f3331",
"score": "0.6943085",
"text": "def decode_encode(obj)\n # Encode\n return obj.to_json if obj.class != String\n # Encode\n return Hashie::Mash.new(MultiJson.decode(obj))\n end",
"title": ""
},
{
"docid": "af5d9b3ad9ec90f4d3c3c5932a8c6aaa",
"score": "0.69188833",
"text": "def to_json\n ActiveSupport::JSON.encode(as_json)\n end",
"title": ""
},
{
"docid": "3d3a2739771c11943a1c7717023b11f3",
"score": "0.6917975",
"text": "def as_json(*)\n to_s\n end",
"title": ""
},
{
"docid": "412d116cfdd6219b8144d394d1f070ce",
"score": "0.6899927",
"text": "def to_json(*args)\n as_json.to_json\n end",
"title": ""
},
{
"docid": "4e1b63a35f1100d1ecf9764e205bc625",
"score": "0.68807214",
"text": "def encode(obj)\n JSON.generate(obj)\n end",
"title": ""
},
{
"docid": "49b520cb3f544be287b4b96d7fb89209",
"score": "0.68654",
"text": "def encoded\n self.to_hash.to_json\n end",
"title": ""
},
{
"docid": "1d736abdabd9452bed3371f72193d1b9",
"score": "0.686416",
"text": "def to_json\n deserialize_if_necessary!\n\n json_hash = to_json_hash\n as_string = JSON.generate(json_hash, :allow_nan => true)\n as_string = as_string.encode(Encoding::UTF_8) if as_string.respond_to?(:encode)\n\n as_string\n end",
"title": ""
},
{
"docid": "03162d29f1e241de4a7baaa407f2e62f",
"score": "0.6850742",
"text": "def as_json(_options = nil)\n original_as_json\n end",
"title": ""
},
{
"docid": "9517533a678e1a0c5db2021b8082a72f",
"score": "0.68412817",
"text": "def as_json(*args)\n as_extended_json\n end",
"title": ""
},
{
"docid": "b4aaf93424c80740d04d44b7656b6930",
"score": "0.68373626",
"text": "def encode\n Base64.encode64(to_json)\n end",
"title": ""
},
{
"docid": "3d8760122bdb291f2bd9cea0a89447b2",
"score": "0.6835586",
"text": "def encode(value)\n raise_on_circular_reference(value) do\n value.send(:to_json)\n end\n end",
"title": ""
},
{
"docid": "287b8b268a8c84e0edfd1d6cb44ce318",
"score": "0.6824316",
"text": "def as_json(*args); end",
"title": ""
},
{
"docid": "ca97cef13b7e1633c683c93ce8903959",
"score": "0.6812695",
"text": "def as_json; end",
"title": ""
},
{
"docid": "ca97cef13b7e1633c683c93ce8903959",
"score": "0.6812695",
"text": "def as_json; end",
"title": ""
},
{
"docid": "ca97cef13b7e1633c683c93ce8903959",
"score": "0.6812695",
"text": "def as_json; end",
"title": ""
},
{
"docid": "41240dc8192b363b76396819d87ff80a",
"score": "0.67935514",
"text": "def as_json\n @json ||= as_hash.to_json\n end",
"title": ""
},
{
"docid": "6801b9a7b00580cbfe95df758154f929",
"score": "0.67789507",
"text": "def as_json(*args)\n to_s\n end",
"title": ""
},
{
"docid": "1e4526f67bb88f7635bbec0fe41002e1",
"score": "0.67640716",
"text": "def to_json(*args)\n raw.to_json(*args)\n end",
"title": ""
},
{
"docid": "fb67e6849c8d3424dadf26f04e171193",
"score": "0.6758687",
"text": "def to_json_raw(*args)\n to_json_raw_object.to_json(*args)\n end",
"title": ""
},
{
"docid": "fb67e6849c8d3424dadf26f04e171193",
"score": "0.6758687",
"text": "def to_json_raw(*args)\n to_json_raw_object.to_json(*args)\n end",
"title": ""
},
{
"docid": "fb67e6849c8d3424dadf26f04e171193",
"score": "0.6758687",
"text": "def to_json_raw(*args)\n to_json_raw_object.to_json(*args)\n end",
"title": ""
},
{
"docid": "fb67e6849c8d3424dadf26f04e171193",
"score": "0.6758687",
"text": "def to_json_raw(*args)\n to_json_raw_object.to_json(*args)\n end",
"title": ""
},
{
"docid": "739309a5ce667dc34a8eec593c0f0b3b",
"score": "0.6758235",
"text": "def to_json(state = nil, *args)\n state = State.from_state(state)\n if state.ascii_only?\n '\"' << JSON.utf8_to_json_ascii(self) << '\"'\n else\n '\"' << JSON.utf8_to_json(self) << '\"'\n end\n end",
"title": ""
},
{
"docid": "739309a5ce667dc34a8eec593c0f0b3b",
"score": "0.6758235",
"text": "def to_json(state = nil, *args)\n state = State.from_state(state)\n if state.ascii_only?\n '\"' << JSON.utf8_to_json_ascii(self) << '\"'\n else\n '\"' << JSON.utf8_to_json(self) << '\"'\n end\n end",
"title": ""
},
{
"docid": "739309a5ce667dc34a8eec593c0f0b3b",
"score": "0.6758235",
"text": "def to_json(state = nil, *args)\n state = State.from_state(state)\n if state.ascii_only?\n '\"' << JSON.utf8_to_json_ascii(self) << '\"'\n else\n '\"' << JSON.utf8_to_json(self) << '\"'\n end\n end",
"title": ""
},
{
"docid": "a70eb86c0dc8da24b627c075de7f7ef7",
"score": "0.6757453",
"text": "def as_json(*args)\n nil\n end",
"title": ""
},
{
"docid": "d31d88b1fd49f920b653ccfd0b7b6870",
"score": "0.67463154",
"text": "def to_json_raw(*args)\n to_json_raw_object.to_json(*args)\n end",
"title": ""
},
{
"docid": "915fbeef5b28ccd0784b39cd83df4030",
"score": "0.6741587",
"text": "def as_json(*args)\n {}.as_json\n end",
"title": ""
},
{
"docid": "f44d3afdb7e14741dcd4aef835f93b38",
"score": "0.6730414",
"text": "def json_encode(string)\n string.to_json\n end",
"title": ""
},
{
"docid": "cf0dab7ed0f4c42a8d972f9ac1c46a53",
"score": "0.6726385",
"text": "def as_json(*)\n as_extended_json(mode: :legacy)\n end",
"title": ""
},
{
"docid": "9204646843f88f138d8e26557139e6f0",
"score": "0.6726014",
"text": "def to_json\n as_json.to_json\n end",
"title": ""
},
{
"docid": "9204646843f88f138d8e26557139e6f0",
"score": "0.6726014",
"text": "def to_json\n as_json.to_json\n end",
"title": ""
},
{
"docid": "43da2fac97061080717592e462138d77",
"score": "0.67157185",
"text": "def to_json\n to_raw.to_json\n end",
"title": ""
},
{
"docid": "6f9fd5bb13c9e25b27257c39d7710dac",
"score": "0.6712311",
"text": "def stringify(jsonified); end",
"title": ""
},
{
"docid": "6f9fd5bb13c9e25b27257c39d7710dac",
"score": "0.6712311",
"text": "def stringify(jsonified); end",
"title": ""
},
{
"docid": "6f9fd5bb13c9e25b27257c39d7710dac",
"score": "0.6712311",
"text": "def stringify(jsonified); end",
"title": ""
},
{
"docid": "04fcafa8adb625d532a1a428db69ab7f",
"score": "0.66878396",
"text": "def as_json(*)\n to_hash\n end",
"title": ""
},
{
"docid": "a64794fbbd07d3d7617c6af8f2dd0aae",
"score": "0.6661218",
"text": "def as_json(*_args)\n as_extended_json\n end",
"title": ""
},
{
"docid": "a64794fbbd07d3d7617c6af8f2dd0aae",
"score": "0.6661218",
"text": "def as_json(*_args)\n as_extended_json\n end",
"title": ""
},
{
"docid": "a64794fbbd07d3d7617c6af8f2dd0aae",
"score": "0.6659685",
"text": "def as_json(*_args)\n as_extended_json\n end",
"title": ""
},
{
"docid": "5fc801364a521d60c41cd6fa8d02dc74",
"score": "0.66419166",
"text": "def to_json_wrapped\n { self.class.try(:json_wrapper) => to_json_unwrapped }\n end",
"title": ""
},
{
"docid": "6204e2086407155991fb0a61305d9042",
"score": "0.6620274",
"text": "def json_encode(object)\n if config.json_engine.respond_to?(:encode)\n config.json_engine.encode(object)\n else\n config.json_engine.dump(object)\n end\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "e104feef1ea459610c1d37d3bd022d38",
"score": "0.6604183",
"text": "def to_json(*args)\n as_json.to_json(*args)\n end",
"title": ""
},
{
"docid": "b97e2df8a8c826bf6e381e15f032a7d0",
"score": "0.65789485",
"text": "def jsonify thing\n Yajl::Encoder.encode thing\n end",
"title": ""
},
{
"docid": "7a4cab586b38d6787df00e6a0cc513df",
"score": "0.65771705",
"text": "def test_mimic_to_json\n {'a' => 1}.to_json()\n Object.new().to_json()\n end",
"title": ""
},
{
"docid": "2b03e02a57701aaa700ee525b6dc3fce",
"score": "0.6570766",
"text": "def to_json(*)\n to_s\n end",
"title": ""
},
{
"docid": "dde90743be769cffe60303814c85f3b5",
"score": "0.6566418",
"text": "def to_json(*)\n JSON.generate as_json\n end",
"title": ""
},
{
"docid": "dde90743be769cffe60303814c85f3b5",
"score": "0.6566418",
"text": "def to_json(*)\n JSON.generate as_json\n end",
"title": ""
},
{
"docid": "dde90743be769cffe60303814c85f3b5",
"score": "0.6566418",
"text": "def to_json(*)\n JSON.generate as_json\n end",
"title": ""
},
{
"docid": "e362e502b0b1807714a62ad12e658b06",
"score": "0.6559389",
"text": "def to_json\n Bencview.hash_walk(@input) do |str|\n begin\n str.to_json\n rescue\n next Base64.strict_encode64 str\n end\n str\n end.to_json\n end",
"title": ""
},
{
"docid": "20200e0d2ed454563c3266a4045619e1",
"score": "0.6559282",
"text": "def as_json\n super.merge(type_json).except(*except_json).compact\n end",
"title": ""
},
{
"docid": "87a484932146806b97d7b75d9bc65d3f",
"score": "0.6553727",
"text": "def as_json(options={})\n hash = super(except)\n hash\n end",
"title": ""
},
{
"docid": "8c77ee31a184f5bba680c57d0fbf1181",
"score": "0.65445524",
"text": "def apply_json_trait(value)\n Base64.strict_encode64(value)\n end",
"title": ""
},
{
"docid": "5e13a62a50e9d3425bee60332a7d9725",
"score": "0.6534968",
"text": "def to_nifty_json\n self.jsonify.to_json\n end",
"title": ""
},
{
"docid": "5e13a62a50e9d3425bee60332a7d9725",
"score": "0.6534968",
"text": "def to_nifty_json\n self.jsonify.to_json\n end",
"title": ""
},
{
"docid": "614af09b970c84f250d56786598ae6dc",
"score": "0.6529258",
"text": "def jsonify(value); end",
"title": ""
},
{
"docid": "614af09b970c84f250d56786598ae6dc",
"score": "0.6529258",
"text": "def jsonify(value); end",
"title": ""
},
{
"docid": "614af09b970c84f250d56786598ae6dc",
"score": "0.6529258",
"text": "def jsonify(value); end",
"title": ""
},
{
"docid": "3adc83df083347ba1dfa423befb089ae",
"score": "0.6528055",
"text": "def to_json(*a); end",
"title": ""
},
{
"docid": "3adc83df083347ba1dfa423befb089ae",
"score": "0.6528055",
"text": "def to_json(*a); end",
"title": ""
},
{
"docid": "82eae545afbb57630398f90c8be0d44b",
"score": "0.6508449",
"text": "def jsonify(obj)\n return obj.as_json if obj.respond_to?(:as_json) # ActiveSupport shortcut\n\n case obj\n when nil, false, true, Numeric # directly representable as JSON\n obj\n when Hash\n obj.each_with_object({}) { |(k, v), h| h[jsonify(k)] = jsonify(v) }\n when Enumerable\n obj.map { |v| jsonify(v) }\n else\n if obj.instance_variables.any?\n obj.instance_variables.each_with_object({}) do |iv, h|\n h[iv.to_s[1..-1].to_sym] = jsonify(obj.instance_variable_get(iv))\n end\n else\n obj.to_s # lowest common denominator serialisation\n end\n end\n end",
"title": ""
},
{
"docid": "5d90f6933e68c64ba0d15e147a9cb0aa",
"score": "0.6497249",
"text": "def to_json(*args) to_hash.to_json(*args) ; end",
"title": ""
},
{
"docid": "8a5253d1ccacda4bbff7908d644f83b7",
"score": "0.64905196",
"text": "def safe_json(str)\n self.class.safe_json(str)\n end",
"title": ""
},
{
"docid": "c7b48994a66649500f0198b50f47b090",
"score": "0.64850676",
"text": "def to_json\n raw.to_json\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "7a0d14b4375a07f9ec4d5e82e0a283fe",
"score": "0.0",
"text": "def set_expense\n @expense = Expense.find(params[:id])\n\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60328794",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6017492",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59215194",
"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.5914111",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5914111",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.5899049",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.58896494",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58892167",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58892167",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58892167",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.5877696",
"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.58623844",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58087915",
"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.57389474",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.5730983",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5715401",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.57057375",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.5693375",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56700915",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.56519705",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.56497645",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56386065",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5626162",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56089616",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.55999124",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598728",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.55892825",
"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.5561578",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5561578",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5507942",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504877",
"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.54678446",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465615",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5447922",
"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.5445043",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54408455",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54166174",
"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.54101455",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54101455",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5400783",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53951085",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53951085",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.53928316",
"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.53882515",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5378493",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53563684",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.53487724",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53475606",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.5346719",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.53449047",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341026",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53280306",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.5304286",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5285627",
"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.5280701",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52592444",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.5259056",
"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.524796",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52446073",
"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.52396107",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5232248",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.5227526",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.52237874",
"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.52221715",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52199185",
"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.52144027",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213464",
"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.5209238",
"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.52063036",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52041465",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.52032995",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203285",
"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.52010477",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944184",
"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.51944184",
"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.5193428",
"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.5179032",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5177801",
"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.5173085",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173085",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173085",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5163755",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.51540434",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.51432824",
"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.514179",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.5139888",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5138596",
"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.5133951",
"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.5115057",
"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.5113431",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51112926",
"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.5109581",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109581",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109581",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5106878",
"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.510421",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.5098929",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.5095888",
"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.5095568",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
35b26ab0ddb7132d55ab5099f73d5e56 | for the 1.0.0 specification. | [
{
"docid": "1469e8bf12d88d3a86e80b6e5041d7fe",
"score": "0.0",
"text": "def format_1_0_0(json_object)\n\n investor = Investor.new\n investor.investor = json_object[\"investor\"]\n investor.url = json_object[\"url\"] if json_object[\"url\"]\n\n companies = json_object[\"investments\"].reject { |item| !item.include?(\"company\") }\n\n companies.map { |data|\n company = investor.companies.new(:name => data[\"company\"], :url => data[\"url\"])\n data[\"rounds\"].map { |round| company.rounds.new(:name => round[\"series\"], :date => Date.strptime(round[\"date\"], \"%m/%Y\")) } if data[\"rounds\"]\n data[\"events\"].map { |event| company.events.new(:name => event[\"event\"], :date => Date.strptime(event[\"date\"], \"%m/%Y\")) } if data[\"events\"]\n }\n\n investor\n\n end",
"title": ""
}
] | [
{
"docid": "5a848e1a78e814f4addafb82445f2b93",
"score": "0.73142505",
"text": "def version; 1; end",
"title": ""
},
{
"docid": "5a848e1a78e814f4addafb82445f2b93",
"score": "0.73142505",
"text": "def version; 1; end",
"title": ""
},
{
"docid": "5a848e1a78e814f4addafb82445f2b93",
"score": "0.73142505",
"text": "def version; 1; end",
"title": ""
},
{
"docid": "5a848e1a78e814f4addafb82445f2b93",
"score": "0.73142505",
"text": "def version; 1; end",
"title": ""
},
{
"docid": "5a848e1a78e814f4addafb82445f2b93",
"score": "0.73142505",
"text": "def version; 1; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.6825791",
"text": "def version; end",
"title": ""
},
{
"docid": "bb051e7236766c4c83c230e2590713b4",
"score": "0.6754559",
"text": "def version_supplied; end",
"title": ""
},
{
"docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a",
"score": "0.6700855",
"text": "def version=(_arg0); end",
"title": ""
},
{
"docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a",
"score": "0.6700855",
"text": "def version=(_arg0); end",
"title": ""
},
{
"docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a",
"score": "0.6700855",
"text": "def version=(_arg0); end",
"title": ""
},
{
"docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a",
"score": "0.6700855",
"text": "def version=(_arg0); end",
"title": ""
},
{
"docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a",
"score": "0.6700855",
"text": "def version=(_arg0); end",
"title": ""
},
{
"docid": "7a6afd7e29131d8ce08124ba4af541c1",
"score": "0.6608218",
"text": "def version=(_); end",
"title": ""
},
{
"docid": "7a6afd7e29131d8ce08124ba4af541c1",
"score": "0.6608218",
"text": "def version=(_); end",
"title": ""
},
{
"docid": "32f5ffda4fe1cf3fe62b387ee8e206e8",
"score": "0.65526557",
"text": "def version\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "f06231eff99feb445a02f26cbffc7992",
"score": "0.651634",
"text": "def version()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f6f77b626225adcb9af798ec7d6d4abc",
"score": "0.64942396",
"text": "def version(*) end",
"title": ""
},
{
"docid": "f6f77b626225adcb9af798ec7d6d4abc",
"score": "0.64942396",
"text": "def version(*) end",
"title": ""
},
{
"docid": "f6f77b626225adcb9af798ec7d6d4abc",
"score": "0.64942396",
"text": "def version(*) end",
"title": ""
},
{
"docid": "9a91419c2905bd39501df1e3d673e9f8",
"score": "0.6474566",
"text": "def protocol_version; end",
"title": ""
},
{
"docid": "feb51464e074644cba82a0f4d8e156f9",
"score": "0.64184576",
"text": "def version_support; end",
"title": ""
},
{
"docid": "3391b6b1333910021eda362133bf640f",
"score": "0.64179575",
"text": "def version()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3391b6b1333910021eda362133bf640f",
"score": "0.64179575",
"text": "def version()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "afb57566ec1524aefe79cbd4ede1d33e",
"score": "0.637325",
"text": "def required_version; end",
"title": ""
},
{
"docid": "afb57566ec1524aefe79cbd4ede1d33e",
"score": "0.637325",
"text": "def required_version; end",
"title": ""
},
{
"docid": "4d686c1d150177c2516de78ca6a67586",
"score": "0.6372826",
"text": "def data_version; end",
"title": ""
},
{
"docid": "6ebe10beed9a52ebd9b4224c0b542daa",
"score": "0.6330018",
"text": "def version\n not_implemented\n end",
"title": ""
},
{
"docid": "6ebe10beed9a52ebd9b4224c0b542daa",
"score": "0.6330018",
"text": "def version\n not_implemented\n end",
"title": ""
},
{
"docid": "6ebe10beed9a52ebd9b4224c0b542daa",
"score": "0.6330018",
"text": "def version\n not_implemented\n end",
"title": ""
},
{
"docid": "e810b5d51ce652ddba97f0cb8366d5a7",
"score": "0.6325711",
"text": "def include_version; end",
"title": ""
},
{
"docid": "e810b5d51ce652ddba97f0cb8366d5a7",
"score": "0.6325711",
"text": "def include_version; end",
"title": ""
},
{
"docid": "e810b5d51ce652ddba97f0cb8366d5a7",
"score": "0.6325711",
"text": "def include_version; end",
"title": ""
},
{
"docid": "74d5e214c25898558d9e7bb56fdf2725",
"score": "0.6280879",
"text": "def version() VERSION; end",
"title": ""
},
{
"docid": "df8ed08bcb56b7ee80548e191630afb0",
"score": "0.6278289",
"text": "def required_version=(_arg0); end",
"title": ""
},
{
"docid": "df8ed08bcb56b7ee80548e191630afb0",
"score": "0.6278289",
"text": "def required_version=(_arg0); end",
"title": ""
},
{
"docid": "4770486850dc081685ebd6fd0bead696",
"score": "0.625275",
"text": "def api_ver=(_arg0); end",
"title": ""
},
{
"docid": "0770258543f6923d2e5195988948373d",
"score": "0.6251178",
"text": "def not_documented_1\n end",
"title": ""
},
{
"docid": "066be921ec228d17c51f101728564a5d",
"score": "0.62397975",
"text": "def private\n head :ok\n end",
"title": ""
},
{
"docid": "e027f1a081099237a1734fd8f7c46681",
"score": "0.62325966",
"text": "def version() VERSION; end",
"title": ""
},
{
"docid": "331af8a97752cd35474725225b436c5b",
"score": "0.6231686",
"text": "def version\n 1\n end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6226211",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6226211",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6226211",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6226211",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6226211",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6226211",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9545a9e5609b47fdf69198fecbd41d19",
"score": "0.62178683",
"text": "def api_ver; end",
"title": ""
},
{
"docid": "ecce1d8c1bb650c62a3ad81ae4708432",
"score": "0.6206711",
"text": "def xml_version()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "ecce1d8c1bb650c62a3ad81ae4708432",
"score": "0.6206711",
"text": "def xml_version()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "ce3da8fa08511a1f0c918a2e4b7a2b46",
"score": "0.6203967",
"text": "def set_version; end",
"title": ""
},
{
"docid": "7b622e7360310599cfa3e439e3475e14",
"score": "0.62009966",
"text": "def api_version=(_arg0); end",
"title": ""
},
{
"docid": "7b622e7360310599cfa3e439e3475e14",
"score": "0.62009966",
"text": "def api_version=(_arg0); end",
"title": ""
},
{
"docid": "00a0e700ff1d2669a870ad3fc1c66041",
"score": "0.6198992",
"text": "def version=(p0) end",
"title": ""
},
{
"docid": "00a0e700ff1d2669a870ad3fc1c66041",
"score": "0.6198992",
"text": "def version=(p0) end",
"title": ""
},
{
"docid": "00a0e700ff1d2669a870ad3fc1c66041",
"score": "0.6198992",
"text": "def version=(p0) end",
"title": ""
}
] |
60c02a33b0154557dc34282e63ceb138 | Fires whenever a PR is opened to check for autoblacklist and post stats | [
{
"docid": "98d00a3868226ac4c78ab7cabdf5ea52",
"score": "0.5741055",
"text": "def pull_request_hook\n # Check signature from GitHub\n\n signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), AppConfig['github']['secret_token'], request.raw_post)\n puts \"calculated signature: #{signature} | #{request.env['HTTP_X_HUB_SIGNATURE']}\"\n\n render text: \"You're not GitHub!\", status: 403 and return unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE'])\n\n unless request.request_parameters[:action] == \"opened\"\n render text: \"Not a newly-opened PR. Uninterested.\" and return\n end\n\n pull_request = params[:pull_request]\n\n unless pull_request[:user][:login] == \"SmokeDetector\"\n render text: \"Not from SmokeDetector. Uninterested.\" and return\n end\n\n text = pull_request[:body]\n \n response_text = \"\"\n \n # Identify blacklist type and use appropriate search\n\n domains = text.scan(/<!-- METASMOKE-BLACKLIST-WEBSITE (.*?) -->/)[0][0]\n \n domains.each do |domain|\n num_tps = Post.where(\"body LIKE '%#{domain}%'\").where(:is_tp => true).count\n num_fps = Post.where(\"body LIKE '%#{domain}%'\").where(:is_fp => true).count\n num_naa = Post.where(\"body LIKE '%#{domain}%'\").where(:is_naa => true).count\n\n response_text += \"#{domain} has been seen in #{num_tps} true #{'positive'.pluralize(num_tps)}, #{num_fps} false #{'positive'.pluralize(num_fps)}, and #{num_naa} #{'NAA'.pluralize(num_naa)}.\\n\\n\"\n end\n \n keywords = text.scan(/<!-- METASMOKE-BLACKLIST-KEYWORD (.*?) -->/)[0][0]\n \n keywords.each do |keyword|\n num_tps = Post.where(\"body LIKE '%#{keyword}%'\").where(:is_tp => true).count\n num_fps = Post.where(\"body LIKE '%#{keyword}%'\").where(:is_fp => true).count\n num_naa = Post.where(\"body LIKE '%#{keyword}%'\").where(:is_naa => true).count\n\n response_text += \"#{keyword} has been seen in #{num_tps} true #{'positive'.pluralize(num_tps)}, #{num_fps} false #{'positive'.pluralize(num_fps)}, and #{num_naa} #{'NAA'.pluralize(num_naa)}.\\n\\n\"\n end\n \n usernames = text.scan(/<!-- METASMOKE-BLACKLIST-USERNAME (.*?) -->/)[0][0]\n \n usernames.each do |username|\n num_tps = Post.where(\"body LIKE '%#{username}%'\").where(:is_tp => true).count\n num_fps = Post.where(\"body LIKE '%#{username}%'\").where(:is_fp => true).count\n num_naa = Post.where(\"body LIKE '%#{username}%'\").where(:is_naa => true).count\n\n response_text += \"#{username} has been seen in #{num_tps} true #{'positive'.pluralize(num_tps)}, #{num_fps} false #{'positive'.pluralize(num_fps)}, and #{num_naa} #{'NAA'.pluralize(num_naa)}.\\n\\n\"\n end\n\n Octokit.add_comment \"Charcoal-SE/SmokeDetector\", pull_request[:number], response_text\n\n render text: response_text, status: 200\n end",
"title": ""
}
] | [
{
"docid": "f320d38e214c2e46f1d9d56f2bb31f98",
"score": "0.6706018",
"text": "def on_synchronize\n number = @payload[\"number\"]\n\n if PullRequest.exists?(number: number)\n pr = PullRequest.find_by(number: number)\n\n status = \"pending\"\n description = \"Not all reviewers have approved. Comment \\\"LGTM\\\" to give approval.\"\n\n if pr.status == \"approved\"\n status = \"success\"\n description = \"Code review complete\"\n end\n\n pr_sha = @payload[\"pull_request\"][\"head\"][\"sha\"]\n\n github = Octokit::Client.new(access_token: ENV[\"CODY_GITHUB_ACCESS_TOKEN\"])\n github.create_status(\n @payload[\"repository\"][\"full_name\"],\n pr_sha,\n status,\n context: \"code-review/cody\",\n description: description,\n target_url: ENV[\"CODY_GITHUB_STATUS_TARGET_URL\"]\n )\n end\n end",
"title": ""
},
{
"docid": "eccdbb085989210f9e955c92d350c77f",
"score": "0.6506173",
"text": "def on_synchronize\n number = @payload[\"number\"]\n repository = @payload['repository']['full_name']\n\n if pr = PullRequest.find_by(number: number, repository: repository)\n\n status = \"pending\"\n description = \"Not all reviewers have approved. Comment \\\"LGTM\\\" to give approval.\"\n\n if pr.status == \"approved\"\n status = \"success\"\n description = \"Code review complete\"\n end\n\n pr_sha = @payload[\"pull_request\"][\"head\"][\"sha\"]\n\n github = Octokit::Client.new(access_token: Rails.application.secrets.github_access_token)\n github.create_status(\n @payload[\"repository\"][\"full_name\"],\n pr_sha,\n status,\n context: \"code-review/cody\",\n description: description,\n target_url: Setting.lookup(\"status_target_url\")\n )\n else\n CreateOrUpdatePullRequest.new.perform(@payload[\"pull_request\"])\n end\n end",
"title": ""
},
{
"docid": "2232ecf1095b8482d89e60e9886f8736",
"score": "0.6421874",
"text": "def ci_hook\n case request.headers['HTTP_X_GITHUB_EVENT']\n when 'pull_request'\n data = JSON.parse(request.raw_post)\n pull_request = data['pull_request']\n case data['action']\n when 'opened', 'synchronize'\n commits = JSON.parse(Net::HTTP.get_response(URI.parse(pull_request['commits_url'])).body)\n commits.each do |commit|\n APIHelper.authorized_post(\n \"https://api.github.com/repos/Charcoal-SE/SmokeDetector/statuses/#{commit['sha']}\",\n state: 'pending',\n description: 'An Approve review is required before pull requests can be merged.',\n context: 'metasmoke/ci'\n )\n end\n render plain: \"#{commits.length} commits set to pending.\"\n else\n render(plain: 'Not a newly-opened or updated PR; not interested.') && return\n end\n when 'pull_request_review'\n data = JSON.parse(request.raw_post)\n pull_request = data['pull_request']\n review = data['review']\n if data['action'] == 'submitted' && review['state'] == 'approved'\n commits = JSON.parse(Net::HTTP.get_response(URI.parse(pull_request['commits_url'])).body)\n commits.each do |commit|\n APIHelper.authorized_post(\n \"https://api.github.com/repos/Charcoal-SE/SmokeDetector/statuses/#{commit['sha']}\",\n state: 'success',\n description: 'PR approved :)',\n context: 'metasmoke/ci'\n )\n end\n\n render plain: \"#{commits.length} commits approved.\"\n else\n render(plain: 'Not a submitted Approve review; not interested.') && return\n end\n else\n render(plain: \"Pretty sure we don't subscribe to that event.\") && return\n end\n end",
"title": ""
},
{
"docid": "cc35b88d2a5bb34481acf5ed01623d79",
"score": "0.6354377",
"text": "def fetch_closed_issues_and_pr; end",
"title": ""
},
{
"docid": "d9ac4bca76578deeb312738fbc4c100f",
"score": "0.61916995",
"text": "def fetch_events_for_issues_and_pr; end",
"title": ""
},
{
"docid": "7b399f7839fdfd6624754453ac712dc3",
"score": "0.6187153",
"text": "def pull_request_hook\n unless request.request_parameters[:action] == 'opened'\n render(text: 'Not a newly-opened PR. Uninterested.') && return\n end\n\n pull_request = params[:pull_request]\n\n unless pull_request[:user][:login] == 'SmokeDetector'\n render(text: 'Not from SmokeDetector. Uninterested.') && return\n end\n\n text = pull_request[:body]\n\n response_text = ''\n\n # Identify blacklist type and use appropriate search\n\n domains = text.scan(/<!-- METASMOKE-BLACKLIST-WEBSITE (.*?) -->/)\n\n domains.each do |domain|\n domain = domain[0]\n\n num_tps = Post.where('body LIKE ?', \"%#{domain}%\").where(is_tp: true).count\n num_fps = Post.where('body LIKE ?', \"%#{domain}%\").where(is_fp: true).count\n num_naa = Post.where('body LIKE ?', \"%#{domain}%\").where(is_naa: true).count\n\n response_text += get_line domain, num_tps, num_fps, num_naa\n end\n\n keywords = text.scan(/<!-- METASMOKE-BLACKLIST-KEYWORD (.*?) -->/)\n\n keywords.each do |keyword|\n keyword = keyword[0]\n\n num_tps = Post.where('body LIKE ?', \"%#{keyword}%\").where(is_tp: true).count\n num_fps = Post.where('body LIKE ?', \"%#{keyword}%\").where(is_fp: true).count\n num_naa = Post.where('body LIKE ?', \"%#{keyword}%\").where(is_naa: true).count\n\n response_text += get_line keyword, num_tps, num_fps, num_naa\n end\n\n usernames = text.scan(/<!-- METASMOKE-BLACKLIST-USERNAME (.*?) -->/)\n\n usernames.each do |username|\n username = username[0]\n\n num_tps = Post.where('username LIKE ?', \"%#{username}%\").where(is_tp: true).count\n num_fps = Post.where('username LIKE ?', \"%#{username}%\").where(is_fp: true).count\n num_naa = Post.where('username LIKE ?', \"%#{username}%\").where(is_naa: true).count\n\n response_text += get_line username, num_tps, num_fps, num_naa\n end\n\n watches = text.scan(/<!-- METASMOKE-BLACKLIST-WATCH_KEYWORD (.*?) -->/)\n\n watches.each do |watch|\n watch = watch[0]\n\n num_tps = Post.where('body LIKE ?', \"%#{watch}%\").where(is_tp: true).count\n num_fps = Post.where('body LIKE ?', \"%#{watch}%\").where(is_fp: true).count\n num_naa = Post.where('body LIKE ?', \"%#{watch}%\").where(is_naa: true).count\n\n response_text += get_line watch, num_tps, num_fps, num_naa\n end\n\n Octokit.add_comment 'Charcoal-SE/SmokeDetector', pull_request[:number], response_text\n\n render text: response_text, status: 200\n end",
"title": ""
},
{
"docid": "c537b636e5dacf874f8712c91ef724ac",
"score": "0.6051764",
"text": "def handle_pr\n puts \"\\nOpening a window with links to the pull request\"\n open_pr\n needs_yes('Is a PR link available (y/n)? ', 'Cannot proceed unless there is a PR')\n\n puts 'Click on the link to go to the github PR request'\n $stdout.print 'Which repo is being modified? '\n @repo = $stdin.gets.chomp\n Breadcrumbs.drop \"repo set to '#{@repo}'\"\n @service = SERVICES[@repo.downcase.to_sym]\n\n verify_deploy_permission\n\n needs_yes('Have all check passed (y/n)? ', 'Cannot continue until all checks pass, contact the developer')\n needs_yes('Is the PR approved (y/n)? ', 'Cannot continue until merge is approved, contact the developer')\n needs_yes('Is the branch up to date (y/n)? ', 'Cannot continue until the branch is up to date, contact the developer')\n $stdout.print 'Merge the changes then press enter '\n $stdin.gets\n\n puts \"\\nLet's return to the JIRA\"\n open_jira\n $stdout.print 'Click \"Start Progress\" on the JIRA ticket then press enter '\n $stdin.gets\n puts\n end",
"title": ""
},
{
"docid": "f8db7eecb446b282ef690f63c4f82823",
"score": "0.60046273",
"text": "def fetch_events_for_issues_and_pr\n print \"Fetching events for issues and PR: 0/#{@issues.count + @pull_requests.count}\\r\" if options[:verbose]\n\n # Async fetching events:\n @fetcher.fetch_events_async(@issues)\n @fetcher.fetch_events_async(@pull_requests)\n end",
"title": ""
},
{
"docid": "a609f095bd7ab25788bb949869ad63b2",
"score": "0.59831923",
"text": "def triggered_by_pr_number?\n return false if @pr_number.nil?\n\n # Note that the test will only run if it pass the checks on unreviewed_new_pr\n pr_on_number = @client.pull_request(@repo, @pr_number)\n puts \"Got triggered by PR_NUMBER OPTION, PR: #{@pr_number}\"\n comm_st = @client.status(@repo, pr_on_number.head.sha)\n unreviewed_new_pr?(pr_on_number, comm_st)\n end",
"title": ""
},
{
"docid": "36b53d5224f6560033dd5c2efe870476",
"score": "0.59529227",
"text": "def report_success\n set_status(\"success\", pull_request? ? \"PR Preview\" : \"Branch Preview\")\nend",
"title": ""
},
{
"docid": "bf814ca6a99b4925d2a836e131bddaff",
"score": "0.589453",
"text": "def worked_pull_requests!\n update_or_create_stats!('pull_requests_worked')\n end",
"title": ""
},
{
"docid": "801255328a22c80c32999609f0fcc7d2",
"score": "0.58336484",
"text": "def admin_pull_requests_stats; end",
"title": ""
},
{
"docid": "f68f1ca703ccd82afbcff4ab17800dcf",
"score": "0.58304036",
"text": "def required_prs\n return open_newer_prs if @options[:pr_number].nil?\n\n [@client.pull_request(@repo, @options[:pr_number])]\n end",
"title": ""
},
{
"docid": "a407cc92a1472fd7ef6a9c32d47289d8",
"score": "0.5816905",
"text": "def fetch_closed_pull_requests; end",
"title": ""
},
{
"docid": "e85bcff8f5470564d4a85f353eac8fce",
"score": "0.5786382",
"text": "def print_pr_resume(prs)\n if prs.any?\n puts \"[PRS=#{prs.any?}] PRs opened. Analyzing them...\"\n return\n end\n if @options[:changed_since] >= 0\n puts \"[PRS=#{prs.any?}] No Pull Requests opened or with changes \" \\\n \"newer than #{options[:changed_since]} seconds\"\n else\n puts \"[PRS=#{prs.any?}] No Pull Requests opened\"\n end\n end",
"title": ""
},
{
"docid": "07bcff53adf27ac042dbba8f391e5602",
"score": "0.57685643",
"text": "def pull_requests_worked\n search_criteria_present!\n\n query = \"q=type:pr+org:#{org}+author:#{username}+updated:>=#{datetime}\"\n url = \"#{SEARCH_ENDPOINT}?#{results_size}&#{query}\"\n response = HTTParty.get url, options\n\n handle! response\n end",
"title": ""
},
{
"docid": "7edcf161d81812e7af2b9b6ae349d3b4",
"score": "0.576267",
"text": "def open_newer_prs\n prs = @client.pull_requests(@repo, state: 'open').select do |pr|\n pr_last_update_less_than(pr, @options[:changed_since])\n end\n print_pr_resume(prs)\n prs\n end",
"title": ""
},
{
"docid": "4207f1027b695b4a35a2323efde6e220",
"score": "0.5753145",
"text": "def ci_hook\n signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), AppConfig['github']['secret_token'], request.raw_post)\n puts \"calculated signature: #{signature} | #{request.env['HTTP_X_HUB_SIGNATURE']}\"\n render plain: \"You're not GitHub!\", status: 403 and return unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE'])\n\n case request.headers['HTTP_X_GITHUB_EVENT']\n when 'pull_request'\n data = JSON.parse(request.raw_post)\n pull_request = data['pull_request']\n case data['action']\n when 'opened'\n commits = JSON.parse(Net::HTTP.get_response(URI.parse(pull_request['commits_url'])).body)\n commits.each do |commit|\n authorized_post(\"https://api.github.com/repos/Charcoal-SE/SmokeDetector/statuses/#{commit['sha']}\", {\n :state => \"pending\",\n :description => \"An Approve review is required before pull requests can be merged.\",\n :context => \"metasmoke/ci\"\n })\n end\n\n render plain: \"#{commits.length} commits set to pending.\"\n when 'synchronize'\n commits = JSON.parse(Net::HTTP.get_response(URI.parse(pull_request['commits_url'])).body)\n commits.each do |commit|\n authorized_post(\"https://api.github.com/repos/Charcoal-SE/SmokeDetector/statuses/#{commit['sha']}\", {\n :state => \"pending\",\n :description => \"An Approve review is required before pull requests can be merged.\",\n :context => \"metasmoke/ci\"\n })\n end\n\n render plain: \"#{commits.length} commits set to pending.\"\n else\n render plain: \"Not a newly-opened or updated PR; not interested.\" and return\n end\n when 'pull_request_review'\n data = JSON.parse(request.raw_post)\n pull_request = data['pull_request']\n review = data['review']\n if data['action'] == 'submitted' && review['state'] == 'approved'\n commits = JSON.parse(Net::HTTP.get_response(URI.parse(pull_request['commits_url'])).body)\n commits.each do |commit|\n authorized_post(\"https://api.github.com/repos/Charcoal-SE/SmokeDetector/statuses/#{commit['sha']}\", {\n :state => \"success\",\n :description => \"PR approved :)\",\n :context => \"metasmoke/ci\"\n })\n end\n\n render plain: \"#{commits.length} commits approved.\"\n else\n render plain: \"Not a submitted Approve review; not interested.\" and return\n end\n else\n render plain: \"Pretty sure we don't subscribe to that event.\" and return\n end\n end",
"title": ""
},
{
"docid": "97e516606f50cca16113772df14d7f3d",
"score": "0.5730083",
"text": "def handle_issue_opened_event(payload)\n repo = payload['repository']['full_name']\n issue_number = payload['issue']['number']\n @bot_client.add_labels_to_an_issue(repo, issue_number, ['needs-response'])\n end",
"title": ""
},
{
"docid": "f1fdb1921f3bfea19c911d38811c629e",
"score": "0.56447494",
"text": "def status_hook\n # We're not interested in PR statuses or branches other than deploy\n unless params[:branches].index { |b| b[:name] == \"deploy\" }\n render text: \"Not a commit on deploy. Uninterested.\" and return\n end\n\n # Check signature from GitHub\n\n signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), AppConfig['github']['secret_token'], request.raw_post)\n puts \"calculated signature: #{signature} | #{request.env['HTTP_X_HUB_SIGNATURE']}\"\n\n render text: \"You're not GitHub!\", status: 403 and return unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE'])\n\n # If the signature is good, create a\n # new CommitStatus\n\n if CommitStatus.find_by_commit_sha(params[:sha])\n render text: \"Already recorded status for commit\", status: 200\n return\n end\n\n if params[:state] == \"pending\"\n render text: \"We don't record pending statuses\", status: 200\n return\n end\n\n commit_sha = params[:sha]\n status = params[:state]\n commit_message = params[:commit][:commit][:message]\n ci_url = params[:target_url]\n\n ActionCable.server.broadcast \"smokedetector_messages\", { commit_status: { status: status, ci_url: ci_url, commit_sha: commit_sha, commit_message: commit_message } }\n CommitStatus.create(:commit_sha => commit_sha, :status => status)\n\n render text: \"OK\", status: 200\n end",
"title": ""
},
{
"docid": "c58945d8cc6ea8d8c1a94465bc4d28a3",
"score": "0.56185323",
"text": "def publish_opening\n # Duplicating the profile and issue title because the issue record\n # can be deleted.\n return if sensitive?\n FeedItem.publish author, 'open_issue', self, [author, repository,\n repository.profile, self], { :profile_name => repository.profile.name,\n :repo_name => repository.name,\n :author_name => author.name,\n :issue_title => title }\n end",
"title": ""
},
{
"docid": "9bf841d63a7402084fba89b6d12c7055",
"score": "0.55668014",
"text": "def launch_test_and_setup_status(repo, pr)\n # pending\n @client.create_status(repo, pr.head.sha, 'pending',\n context: @context, description: @description,\n target_url: @target_url)\n # do tests\n pr_test(pr.base.ref, pr.head.sha, repo, pr.head.ref, pr)\n # set status\n @client.create_status(repo, pr.head.sha, @j_status,\n context: @context, description: @description,\n target_url: @target_url)\n end",
"title": ""
},
{
"docid": "d71bacc33927d836ad3e4c47637610e9",
"score": "0.5556638",
"text": "def create\n @issue = Issue.new(params[:issue])\n @issue.to_fellow_student\n @issue.user_id = session[:user_id]\n\n new_gist = params[:issue][\"relevant_gist\"]\n unless new_gist == \"\" || new_gist.nil?\n @issue.send_to_github(new_gist, @current_user)\n end\n\n if Issue.assignable.size == 0\n if @issue.save\n User.notify_on_call_admins\n end\n end\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to issues_path, notice: 'Issue was successfully created.' }\n format.json { render json: @issue, status: :created, location: @issue }\n \n IssueStat.create(:issue_id => @issue.id, :status =>IssueStat::STATUS_MAP[:assignable], :wait_time => 0) \n\n else\n format.html { render action: \"new\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "74035d160c9c020e250893898c769458",
"score": "0.55534357",
"text": "def verified_tickets\n tickets = request_handler('issues?labels=Staging::Verified&state=opened')\n tickets\nend",
"title": ""
},
{
"docid": "92eebf8666e78d3b8f283b261119000c",
"score": "0.55526215",
"text": "def admin_issues_stats; end",
"title": ""
},
{
"docid": "4dc67dd716ad7eb601b6263380e672ee",
"score": "0.5530287",
"text": "def poll_test_submissions\n end",
"title": ""
},
{
"docid": "353d1df00f4bfece7948cb866c59e4a6",
"score": "0.5484446",
"text": "def parse_pr_payload(payload, client)\n if %w(opened edited reopened synchronize).include? payload['action']\n pull_request = payload['pull_request']\n if pull_request['state'] == 'open'\n process_pull_request(pull_request, client)\n end\n end\n end",
"title": ""
},
{
"docid": "0e50d31ae656ebe2a8f0100ced138058",
"score": "0.54820865",
"text": "def status_hook\n # We're not interested in PR statuses or branches other than deploy\n unless params[:branches].index { |b| b[:name] == 'deploy' }\n render(text: 'Not a commit on deploy. Uninterested.') && return\n end\n\n # Create a new CommitStatus\n\n if CommitStatus.find_by(commit_sha: params[:sha])\n render text: 'Already recorded status for commit', status: 200\n return\n end\n\n if params[:state] == 'pending'\n render text: \"We don't record pending statuses\", status: 200\n return\n end\n\n commit_sha = params[:sha]\n status = params[:state]\n commit_message = params[:commit][:commit][:message]\n ci_url = params[:target_url]\n\n ActionCable.server.broadcast 'smokedetector_messages', commit_status: {\n status: status,\n ci_url: ci_url,\n commit_sha: commit_sha,\n commit_message: commit_message\n }\n CommitStatus.create(commit_sha: commit_sha, status: status)\n\n render text: 'OK', status: 200\n end",
"title": ""
},
{
"docid": "732dfe2464598925c93dabd9bb699960",
"score": "0.5480022",
"text": "def open\n commit_changes\n\n if Config[:whyrun]\n Log.info \" Would create pull request in repo: #{@repo.name} using branch #{@repo.cookstyle_branch_name} if not in whyrun mode\"\n else\n pr = @gh_conn.create_pull_request(@repo.name, @repo.default_branch, @repo.cookstyle_branch_name, commit_title, commit_description)\n @number = pr[:number]\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "9e4d6a98398b044b7d5c8dfff91bcf81",
"score": "0.54740113",
"text": "def pull_count_by_status(opts)\n opts = OpenStruct.new(opts) unless opts.kind_of? OpenStruct\n events = GithubDashing::EventCollection.new\n self.get_repos(opts).each do |repo|\n begin\n pulls = request('pulls', [repo, {:state => 'all', :since => opts.since}])\n pulls.select! { |pull| pull.created_at.to_datetime > opts.since.to_datetime }\n pulls.select! { |pull| pull.state == 'open' }\n pulls.each do |pull|\n events << GithubDashing::Event.new({\n title: pull.title,\n datetime: pull.created_at.to_datetime,\n key: (pull.assignee.login rescue \"unasigned\"),\n value: 1\n })\n end\n rescue Octokit::Error => exception\n Raven.capture_exception(exception)\n end\n end\n return events\n end",
"title": ""
},
{
"docid": "d3681ee972b2d7b529a77defea474a5f",
"score": "0.5441788",
"text": "def fetch_opened_pull_requests\n opened_pull_requests = []\n @client.pull_requests(@repository).each do |pr|\n opened_pull_requests.push(pr[:number])\n end\n opened_pull_requests\n end",
"title": ""
},
{
"docid": "b09371fb886afb30f03c3dd5f40ac772",
"score": "0.54382616",
"text": "def open_pull_requests\n OctocatHerder::PullRequest.find_open_for_repository(owner_login, name, connection)\n end",
"title": ""
},
{
"docid": "4833ba49d265a2226dddd26f51f4aee1",
"score": "0.5433252",
"text": "def hendl_pr(original)\n puts \"#{original.number} is a pull request\"\n if original.state != \"open\"\n puts \"#{original.number} is already closed - nothing to do here\"\n return\n end\n\n body = [\"Hello @#{original.user.login},\"]\n body << reason\n body << \"Sorry for the troubles, we'd appreciate if you could re-submit your Pull Request with these changes to the new repository\"\n\n client.add_comment(source, original.number, body.join(\"\\n\\n\"))\n smart_sleep\n client.close_pull_request(source, original.number)\n end",
"title": ""
},
{
"docid": "5519c2e19f7c594c5201e031f70fc3e4",
"score": "0.54255855",
"text": "def check_work_in_progess_pr(level = :warn)\n report(level, 'Do not merge, PR is a work in progess [WIP]!') if github.pr_title.include?('[WIP]')\n end",
"title": ""
},
{
"docid": "31778bc0caf78d8ec082895612ce2e46",
"score": "0.54180264",
"text": "def submit\n \tinput = params[:client][:content]\n \tgist = input.split(\"com/\").last\n \turi = URI.parse(\"https://api.github.com/repos/\" + gist + \"\")\n #current Time ,Time befor 1_day_ago,Time befor 7_day_ago\n time = Time.now\n \tyest = (time - 1.day).to_time.iso8601\n \tweek = (time - 7.day).to_time.iso8601\n \t\n #Count of All open issues from now \n \ttotal_issues = issues(uri, \"\")\n \t@total = total_issues\n \t\n #Number of open issues that were opened in the last 24 hours\n \tissues_day1 = issues(uri, yest)\n \t@last_24 = issues_day1\n\n#Number of open issues that were opened more than 24 hours ago but less than 7 days ago\n \tissues_7days_ago= issues(uri,week)\n \t@bw7and1=issues_7days_ago-issues_day1\n#Number of open issues that were opened more than 7 days ago \n \t@before_7days=total_issues-issues_7days_ago\n end",
"title": ""
},
{
"docid": "ca77cce84ef60a5b3454e6e45abfc089",
"score": "0.54175174",
"text": "def announce\n cli.say \"Preparing an issue for #{config.github_repo}.\"\n end",
"title": ""
},
{
"docid": "54f5061b0f4255a744db041f5dd38114",
"score": "0.5414817",
"text": "def title\n \"Hubtrics: Closed Pull Requests for #{Date.today}\"\n end",
"title": ""
},
{
"docid": "929defd971c733d9a90b5ffb0ac7888a",
"score": "0.5398494",
"text": "def announce\n cli.say \"Preparing a pull request for #{config.github_repo}/#{git.current_branch} to #{config.github_repo}/#{destination_branch}.\"\n end",
"title": ""
},
{
"docid": "38b7b9a417fcaeff8185e7428a214d5e",
"score": "0.5398355",
"text": "def query_pull_requests\n pull_requests = github_query(@client) { @client.pull_requests(@repository, :state=>\"open\") }\n\n @pull_request_details = []\n\n\n pull_requests.each { |p| \n\n issue = github_query(@client) { @client.issue(@repository, p.number) }\n\n $logger.debug(\"Issue loaded: #{issue}\")\n\n\n notification_users = Set.new()\n\n if issue.assignee\n notification_users << issue.assignee.login\n end\n\n if p.user.login\n notification_users << p.user.login\n end\n\n aging_pull_requests_notification = true\n aging_pull_requests_numdays = 7\n\n begin\n pb = PotentialBuild.new(@client, @token, p.head.repo.full_name, nil, p.head.sha, p.head.ref, p.head.user.login, nil, nil, p.number, p.base.repo.full_name, p.base.ref)\n configed_notifications = pb.configuration.notification_recipients\n if !configed_notifications.nil?\n $logger.debug(\"Merging notifications user: #{configed_notifications}\")\n notification_users.merge(configed_notifications)\n end\n\n aging_pull_requests_notification = pb.configuration.aging_pull_requests_notification\n aging_pull_requests_numdays = pb.configuration.aging_pull_requests_numdays\n\n if p.head.repo.full_name == p.base.repo.full_name\n $logger.info(\"Skipping pullrequest originating from head repo\")\n else\n @potential_builds << pb\n end\n rescue => e\n $logger.info(\"Skipping potential build: #{e} #{e.backtrace} #{p}\")\n end\n\n @pull_request_details << { :id => p.number, :creator => p.user.login, :owner => (issue.assignee ? issue.assignee.login : nil), :last_updated => issue.updated_at, :repo => @repository, :notification_users => notification_users, :aging_pull_requests_notification => aging_pull_requests_notification, :aging_pull_requests_numdays => aging_pull_requests_numdays }\n }\n end",
"title": ""
},
{
"docid": "aba0725565e3701529c2cebd9fe5cf40",
"score": "0.539714",
"text": "def test04_pre_open_blog_PopGNPublish_TC_24299\n\t\t\tlogin $user_1_email, $master_password\n\t\t\t$browser.goto($patch_note)\n\t\t\tsleep 2\n\t\t\t\n\t\t\tassert $post_pick_group.exists?\n \t\t\trepostGroupPop\n\t\t\t$post_compose_note.set(\"Note field populated by automated test.\")\n\t\t\tpostPublishLater\n\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\tsleep 4\n\t\t\t\n\t\t\tassert $post_scheduled_post.exists?\n\t\tend",
"title": ""
},
{
"docid": "8fac70331f82820aeff15852219a8301",
"score": "0.53868794",
"text": "def open_submission_status\n 'Open for Applications'\n end",
"title": ""
},
{
"docid": "f677b7b416a6c6289462a01bdc7ac77d",
"score": "0.5384554",
"text": "def pr_before_merged(pr)\n q = <<-QUERY\n select pr.id, pr.pullreq_id, prh.pull_request_id as num_pull_reqs\n from reduced_pull_request_history prh, reduced_pull_requests pr\n where prh.action = 'opened'\n and prh.created_at < ?\n and prh.pull_request_id = pr.id\n and pr.base_repo_id = ?\n QUERY\n pull_reqs = db.fetch(q, pr[:created_at], pr[:project_id]).all\n pull_reqs.reduce([]) do |acc, pull_req|\n if not close_reason[pull_req[:pullreq_id]].nil? and close_reason[pull_req[:pullreq_id]][1] != :unknown # this means that the commits in pr are merged\n acc << pull_req[:id]\n end\n acc\n end\n end",
"title": ""
},
{
"docid": "f9ad8c51c8198552d70cddec0710d169",
"score": "0.5364553",
"text": "def pr_before_closed(pr)\n q = <<-QUERY\n select pr.id, prh.action, prh.created_at\n from reduced_pull_requests pr, reduced_pull_request_history prh\n where pr.id = prh.pull_request_id\n and prh.created_at < ?\n and ( prh.action = 'closed' or prh.action = 'reopened' )\n and pr.base_repo_id = ?\n QUERY\n db.fetch(q, pr[:created_at], pr[:project_id]).all.reduce({}) do |acc, x|\n if !acc.key?(x[:id]) or acc[x[:id]][:created_at] < x[:created_at]\n acc.update(x[:id] => {:created_at => x[:created_at], :action => x[:action]})\n else\n acc\n end\n end.reduce([]) do |acc, (id, v)|\n if v[:action] == \"closed\"\n acc << id\n else\n acc\n end\n end\n end",
"title": ""
},
{
"docid": "6d58e89321be40da3bdb4a83e3f00acc",
"score": "0.5346454",
"text": "def pending_notifications; end",
"title": ""
},
{
"docid": "0931e955afdc229a83412d0c0046b124",
"score": "0.534359",
"text": "def on_reviewing_entry(state, event, *event_args)\n super\n\n if !simulating || !submission.auto_review\n __debug_sim('[auto_review: false]') if simulating\n __debug_sim('Waiting for reviewer evaluation.')\n __debug_sim('REVIEWER must `approve!` or `reject!` to advance...')\n\n elsif submission.auto_approve # TODO: remove\n __debug_sim('[auto_review: true]')\n __debug_sim('[auto_approve: true]')\n __debug_sim('SYSTEM review approves the submission.')\n\n approve! # NOTE: => :approved\n\n elsif submission.auto_reject # TODO: remove\n __debug_sim('[auto_review: true]')\n __debug_sim('[auto_reject: true]')\n __debug_sim('SYSTEM review rejects the submission.')\n\n reject! # NOTE: => :rejected\n\n else # TODO: remove\n __debug_sim('[auto_review: true]')\n __debug_sim('[auto_approve: false]')\n __debug_sim('[auto_reject: false]')\n __debug_sim('SYSTEM must `approve!` or `reject!` to advance...')\n\n end\n\n self\n end",
"title": ""
},
{
"docid": "9ffb005fb8c64106f5fd6102ca1d7901",
"score": "0.53410107",
"text": "def pr_before(pr)\n q = <<-QUERY\n select pr.id\n from reduced_pull_requests pr, reduced_pull_request_history prs\n where pr.id = prs.pull_request_id\n and base_repo_id = ?\n and prs.action = 'opened'\n and prs.created_at < ?\n QUERY\n db.fetch(q, pr[:project_id], pr[:created_at]).all.map {|x| x[:id]}\n end",
"title": ""
},
{
"docid": "ced21a0200d94dc2277288b4789d2ddc",
"score": "0.5332964",
"text": "def show_reminder\n repo = PluginsHelper::PLUGINS_JSON_REPO\n UI.notice \"Don't forget to create a Pull Request on #{repo}\\n\" \\\n ' to add your plugin to the plugins.json file once it is released!'\n end",
"title": ""
},
{
"docid": "60f225158264e0c1cafd9dbc4ed80af0",
"score": "0.5329543",
"text": "def present(pull_request, index)\n index += 1\n pr = pull_request\n thumbs_up = ''\n thumbs_up = \" | #{pr[\"thumbs_up\"].to_i} :+1:\" if pr[\"thumbs_up\"].to_i > 0\n if pr[\"on_hold\"]\n on_hold = \" :no_entry: \"\n changes_requested = \"\"\n else\n on_hold = \"\"\n changes_requested = pr[\"requested_reviewers\"].empty? ? \" :change: \" : \" :mag: \" \n end\n <<-EOF.gsub(/^\\s+/, '')\n >#{index}\\) _#{pr[\"repo\"]}_ | #{changes_requested}#{on_hold}#{format_author(pr)}\n >#{labels(pr)} <#{pr[\"link\"]}|#{pr[\"title\"]}>\n EOF\n end",
"title": ""
},
{
"docid": "a02416425199fca96b8823c41b4f0709",
"score": "0.5325004",
"text": "def initial_pull\n pull_reddit\n pull_stack_overflow\n pull_hacker_news\n pull_product_hunt\n end",
"title": ""
},
{
"docid": "247f4927423ef205c685eb04631fb975",
"score": "0.5315654",
"text": "def event_handler_pull_request(payload)\n action = payload[:action]\n\n if payload[:action] != \"opened\" && payload[:action] != \"edited\"\n render json: {\n :message => \"action not supported\",\n :action => payload[:action]\n }, status: 200\n return\n end\n\n pr_number = payload[:number]\n\n #If pull request is not against master then comment and close the pull request\n if payload[:pull_request][:base][:ref] != \"master\"\n begin\n # Add comment\n message = \"[\" + DateTime.now.strftime(\"%d/%m/%Y %H:%M\") + \"] **Bot** PR not against master, closing\"\n @octokit_client.add_comment(MONOREPO, pr_number, message)\n\n # Close the PR\n @octokit_client.close_pull_request(MONOREPO, pr_number)\n rescue => e\n puts e.inspect\n render json: {\n :message => \"something went wrong at closing PR\"\n }, status: 200\n return\n end\n\n render json: {\n :message => \"success close pull request, not master\"\n }, status: 200\n return\n end\n\n\n # else analyze the pull request\n begin\n # get service information\n services = extract_service_information(payload[:pull_request][:body])\n labels = []\n services.each do |service| \n labels.push(\"service:\"+service)\n end\n\n if labels.length > 0\n #add comment\n message = \"[\" + DateTime.now.strftime(\"%d/%m/%Y %H:%M\") + \"] **Bot** try to apply service labels\"\n @octokit_client.add_comment(MONOREPO, pr_number, message)\n\n #add label\n @octokit_client.add_labels_to_an_issue(MONOREPO, pr_number, labels)\n end\n\n\n rescue => e\n puts e.inspect\n render json: {\n :message => \"something went wrong at applying label\"\n }, status: 200\n return\n end\n\n render json: {\n :message => \"success\"\n }, status: 200\n return\n end",
"title": ""
},
{
"docid": "63ceede8896753dee6697a56d06728d9",
"score": "0.53150463",
"text": "def pre_submission_date_status\n 'New announcement'\n end",
"title": ""
},
{
"docid": "f9c50ef8dbfb9b8e0ff7b95b91c28ba9",
"score": "0.5314891",
"text": "def send_notification\r\n unless $request.headers[\"Auth-key\"].present? && validate_auth_key($request)\r\n if self.issue.bulk_update == false && self.issue.imported == false || (notify? && (Setting.notified_events.include?('issue_updated') ||\r\n (Setting.notified_events.include?('issue_note_added') && notes.present?) ||\r\n (Setting.notified_events.include?('issue_status_updated') && new_status.present?) ||\r\n (Setting.notified_events.include?('issue_assigned_to_updated') && detail_for_attribute('assigned_to_id').present?) ||\r\n (Setting.notified_events.include?('issue_priority_updated') && new_value_for('priority_id').present?)\r\n ))\r\n Mailer.deliver_issue_edit(self)\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "b074bd6e2bcc994b08db3294de540b61",
"score": "0.5307052",
"text": "def test02_pre_open_blog_EmptyNPublish_TC_24299\n\t\t\tlogin $user_1_email, $master_password\n\t\t\t$browser.goto($patch_note)\n\t\t\tsleep 2\n\t\t\t\n\t\t\tassert $post_pick_group.exists?\n \t\t\trepostGroupPop\n\t\t\tpostPublishLater\n\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\t\n\t\t\tassert $post_now.exists?\n\t\tend",
"title": ""
},
{
"docid": "afef5d9fc1401b95c14e1d74b4987dc0",
"score": "0.53028435",
"text": "def created_issues!\n update_or_create_stats!('issues_created')\n end",
"title": ""
},
{
"docid": "23d5d261faa60d5533c68a4d859b81c7",
"score": "0.52999234",
"text": "def send_comment_to_assigned_to_for_status(post,user,issue)\n setup_email(user)\n @post = post\n @user = user\n @issue = issue\n @subject += \"BUGZ: Issue status has been updated\"\n @from = \"team@lionsher.com\"\n# @body[:url] = \"http://bugz.kernlearning.com/issues/show/#{@issue.id}\" # on staging\n @body[:url] = \"http://#{SITE_URL}/issues/show/#{@issue.id}\"\n content_type \"text/html\"\n end",
"title": ""
},
{
"docid": "496d2a910f1ccfa62528561f7ca1ff8b",
"score": "0.52956295",
"text": "def send_notification_for_update\n if Setting.notified_events.include?('issue_updated')\n Mailer.deliver_issue_add(self)\n end\n end",
"title": ""
},
{
"docid": "e6ce5c59505cd6fe6b4e4e934852b47f",
"score": "0.5278142",
"text": "def opening_status_change\n end",
"title": ""
},
{
"docid": "42e2eabbfa3d8b8d7b74ec3246fb401f",
"score": "0.5272018",
"text": "def pull_count_by_status(opts)\n\t\topts = OpenStruct.new(opts) unless opts.kind_of? OpenStruct\n\t\tevents = GithubDashing::EventCollection.new\n\t\tself.get_repos(opts).each do |repo|\n\t\t\tbegin\n\t\t\t\tpulls = request('pulls', [repo, {:state => 'all', :since => opts.since}])\n\t\t\t\tpulls.select! {|pull|pull.created_at.to_datetime > opts.since.to_datetime}\n\t\t\t\tpulls.each do |pull|\n\t\t\t\t\tstate_desc = (pull.state == 'open') ? 'opened' : 'closed'\n\t\t\t\t\tevents << GithubDashing::Event.new({\n\t\t\t\t\t\ttype: \"pull_count_#{state_desc}\",\n\t\t\t\t\t\tdatetime: pull.created_at.to_datetime,\n\t\t\t\t\t\tkey: pull.state.dup,\n\t\t\t\t\t\tvalue: 1\n\t\t\t\t\t})\n\t\t\t\tend\n\t\t\trescue Octokit::Error => exception\n\t\t\t\tRaven.capture_exception(exception)\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn events\n\tend",
"title": ""
},
{
"docid": "66cab1e3173037cee1f024903aa16078",
"score": "0.5266049",
"text": "def update_bulletin_stats\n self.bulletin.increment!( status == 'R' ? :sent_count : :fail_count )\n end",
"title": ""
},
{
"docid": "7f2ae1807e05745965174808b6d044ee",
"score": "0.5230464",
"text": "def launch_test_and_setup_status(repo, pr_head_sha, pr_head_ref, pr_base_ref)\n # pending\n @client.create_status(repo, pr_head_sha, 'pending',\n context: @context, description: @description,\n target_url: @target_url)\n # do tests\n pr_test(pr_base_ref, pr_head_sha, repo, pr_head_ref)\n # set status\n @client.create_status(repo, pr_head_sha, @j_status,\n context: @context, description: @description,\n target_url: @target_url)\nend",
"title": ""
},
{
"docid": "cdaec441d562a66639a97ed7b3b14838",
"score": "0.52272266",
"text": "def user_has_opened_issue_or_pr_in_repo?\n issues_and_prs = @client.list_issues @nwo,\n :creator => @user[:login], :state => \"all\"\n issues_and_prs.any?\n end",
"title": ""
},
{
"docid": "fe7735032bffbf2115c15ccdd9760292",
"score": "0.52223235",
"text": "def grant_profile_approval_and_publish\n raise Exceptions::UnresolvedIssues if profile.issues.unresolved.present?\n ProfileMailer.delay.publish_notice_to_user(profile) unless profile.fixing_issue_published?\n profile.status = Profile::STATUS_PUBLISHED\n profile.flagged = false\n profile.save\n end",
"title": ""
},
{
"docid": "c97bd9d5226b71d67be3cf5e670693d2",
"score": "0.5222104",
"text": "def on_approved_entry(state, event, *event_args)\n super\n\n __debug_sim('SYSTEM notifies user of approval.')\n\n advance! # NOTE: => :staging\n self\n end",
"title": ""
},
{
"docid": "25de17c4168d5099f7610385005b18a4",
"score": "0.5220788",
"text": "def on_assigned_entry(state, event, *event_args)\n super\n\n # Determine whether the system should perform an automated review.\n auto_review = false # TODO: auto-review?\n\n # Determine whether the system should perform an automated review.\n if simulating\n __debug_sim(\"[auto_review: #{submission.auto_review}]\")\n auto_review = submission.auto_review # TODO: remove\n end\n\n # Determine whether the system should perform an automated review.\n unless simulating\n auto_review = record.auto_reviewable? if record\n end\n\n # TODO: simulation - remove\n if auto_review\n __debug_sim('SYSTEM is performing an automated review.')\n else\n __debug_sim('Waiting for reviewer to begin review.')\n __debug_sim('REVIEWER must `review!` to advance...')\n end\n\n # If the submission is to be reviewed by a human then it remains in this\n # state until a review claims it (i.e. starts a review).\n review! if auto_review # NOTE: => :reviewing\n\n self\n end",
"title": ""
},
{
"docid": "64f56185c8875dcd5b124e94446a4ad1",
"score": "0.52199847",
"text": "def open\n @project = Project.find params[:id]\n @pull = PullRequest.find params[:pull_id]\n @pull.status = 'open'\n @pull.save\n redirect_to url_for @project\n end",
"title": ""
},
{
"docid": "f76aa0357d6d172a25c8a5a7bd3dade7",
"score": "0.5219204",
"text": "def index\n @answer = Answer.find(params[:answer_id])\n\n if @answer.assignment.course.students.exists?(current_user.id).nil?\n redirect_to assignment_path(@answer.assignment), alert: \"Reviews in this class are only open to enrolled students, so first create a draft of your own submission (you don't need to submit.)\" and return\n end\n\n\n @trigger = TriggerAction.pending_action(\"review_required\", current_user, @answer.assignment)\n\n if @trigger.nil? and @answer.reviews_first_seen_at.nil?\n @answer.reviews_first_seen_at = Time.now\n @answer.save!\n end\n end",
"title": ""
},
{
"docid": "1c67f737c92133706c49d3ff26a22d8b",
"score": "0.52161366",
"text": "def test05_pre_open_blog_EmptyGNPublish_TC_24299\n\t\t\tlogin $user_1_email, $master_password\n\t\t\t$browser.goto($patch_article)\n\t\t\tsleep 2\n\t\t\t\n\t\t\tassert $post_now.exists?\n\t\t\tpostPublishLater\n\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\t\n\t\t\tassert $post_now.exists?\n\t\tend",
"title": ""
},
{
"docid": "47682b50da6c1a297c0cb14bb3d5e943",
"score": "0.5214272",
"text": "def show\n Notification.check_notifications(current_user.id, NotificationType.new_work_request, @shoot.id)\n Notification.check_notifications(current_user.id, NotificationType.request_assigned, @shoot.id)\n Notification.check_notifications(current_user.id, NotificationType.request_accepted, @shoot.id)\n Notification.check_notifications(current_user.id, NotificationType.request_declined, @shoot.id)\n @shot_list_items = @shoot.shot_list_items\n\n end",
"title": ""
},
{
"docid": "a3142258207b76a54d2ce805be6d686b",
"score": "0.52135277",
"text": "def create\n pl = params[\"cla_bot\"]\n if pl[\"action\"] == \"opened\" || pl[\"action\"] == \"reopened\"#an opened or reopened pull request\n sender = pl[\"sender\"][\"login\"]\n \n feed = client.get('https://spreadsheets.google.com/feeds/list/#{spreadsheet_id}/od7/private/values').to_xml\n \n signed = false\n feed.elements.each('entry') do |entry|\n if entry.elements[username_column].text.eql?(sender) && entry.elements[agree_column].text.eql?(\"I AGREE\")\n signed = true\n break\n end\n end\n \n if signed\n body = {\"body\" => \"You've signed the CLA, #{sender}. Thank you! This pull request is ready for review.\"}\n else\n body = {\"body\" => \"Thanks for contributing this pull request! Could you please sign our CLA so we can review it?\"}\n end\n #gh_client.post(\"/repos/#{directory_repo}/statuses/#{pl[\"pull_request\"][\"head\"][\"sha\"]}\", body)\n gh_client.post(\"/repos/#{directory_repo}/issues/#{pl[\"pull_request\"][\"number\"]}/comments\", body)\n \n begin\n pull_request_url = \"http://github.com/#{git_directory}/pull/#{pl['number']}\"\n message = \"<a href=\\\"#{pull_request_url}\\\">Pull request number #{pl['number']}</a> was submitted\"\n if signed\n message << \". The CLA was signed.\"\n else\n message << \", but the CLA was NOT signed.\"\n end\n end\n render nothing: true\n end\n \n private\n \n def client\n @client ||= begin\n c = GData::Client::Spreadsheets.new\n c.clientlogin(SiteSettings[@@gdocs_username], SiteSettings[@@gdocs_pass])\n c\n end\n end\n \n def gh_client\n @gh_client ||= Octokit::Client.new(login: SiteSettings[git_username], password: SiteSettings[git_pass])\n end\n end",
"title": ""
},
{
"docid": "06cbbca46e3d295e13427500bf372525",
"score": "0.51961035",
"text": "def too_many_open_pull_requests?\n pull_requests_to_review.size == GH_API_PER_PAGE && client.last_response.rels[:next].present?\n end",
"title": ""
},
{
"docid": "4433862067287e243664f283ff41a176",
"score": "0.51957035",
"text": "def create_webhook\n @client.create_hook(\"#{repo.user.github_username}/#{repo.name}\",\n 'web',\n {url: \"#{ENV['ISSUE_TRACKR_APP_URL']}/webhooks/receive\", content_type: 'json'},\n {events: ['issues'], active: true})\n end",
"title": ""
},
{
"docid": "09d6b9eb1b06bcb2cbcff79f53cbeb65",
"score": "0.5192932",
"text": "def new(owner, repo, title, content, assignee)\n\t\t\tPullRequets.post(\"/repos/#{owner}/#{repo}/issues\",\n\t\t\t\t:headers => @auth,\n\t\t\t\t:body => {\"title\" => title, \"body\" => content, \"assignee\" => assignee}.to_json)\n\n#comment on an existing issue\n\t\tdef comment(owner, repo, issue_num, comment)\n\t\t\tPullRequests.patch(\"/repos/#{owner}/#{repo}/issues/#{issue_num}\", \n\t\t\t\t:headers => @auth, \n\t\t\t\t:body => { \"body\" => comment }.to_json)\n\t\tend\n\n#list issues in the owner's repo\n\t\tdef list_issues(owner, repo)\n\t\t\tPullRequests.get(\"/repos/#{owner}/#{repo}/issues\", :headers => @auth)\n\t\tend\n\n\n#close an already opened issue in the owner's repo MUST KNOW ISSUE NUMBER\n\t\tdef close_issue(owner, repo, issue_num)\n\t\t\tPullRequests.patch(\"/repos/#{owner}/#{repo}/issues/#{issue_num}\", \n\t\t\t\t:headers => @auth, \n\t\t\t\t:body => {\"state\" => \"closed\"}.to_json)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "738909b875e9211596836d7c32859975",
"score": "0.5188324",
"text": "def after_approve(approval); end",
"title": ""
},
{
"docid": "ceff7ca755238c180d3de6634aa7cc85",
"score": "0.51819646",
"text": "def perform\n if should_notify_pagerduty?\n @occurrence.bug.environment.project.pagerduty.trigger description,\n @occurrence.bug.pagerduty_incident_key,\n details\n end\n end",
"title": ""
},
{
"docid": "b6674937ad5b3ec3abf249bddd20c53b",
"score": "0.5174832",
"text": "def p1_announcement(client)\n p1s = issue_handler.p1_issues\n case client\n when 'hipchat'\n html = \"There are currently <b>#{p1s.count}</b> #{ENV['P1_LABEL']} bugs open.<br>\"\n html += issue_handler.hipchat_issues_info(p1s)\n when 'slack'\n html = \"There are currently *#{p1s.count}* #{ENV['P1_LABEL']} bugs open.\\n\"\n html += issue_handler.slack_issues_info(p1s)\n end\n html\n end",
"title": ""
},
{
"docid": "bdd4bd7b20204456aef535cd086079fb",
"score": "0.51690656",
"text": "def process_pull_requests\n raise RuntimeError,\n \"Github client is not available\" if @github_client.nil?\n\n raise RuntimeError, \n \"Github client is not ready\" unless @github_client.ready\n\n pulls_requiring_build = []\n\n start_time = Time.now.to_f\n $stderr.puts(\"Starting Github inspection...\") if @debug\n pulls_json = @github_client.pull_requests\n\n # Parse the JSON into JSON Objects\n pulls = JenkinsPullover::Github::Model.parse_github_json(pulls_json)\n\n if pulls.kind_of?(Hash) && pulls.has_key?(:message)\n raise RuntimeError,\n \"Github responded with error: #{pulls[:message]}\"\n end\n\n pulls.select {|pull| pull[:state] == \"open\"}.each do |pull|\n # Check the base branch matches\n next unless check_pull_base_branch(pull)\n\n # Examine the comments to detect whether build required\n if build_required(pull)\n $stderr\n .puts(\" => Build required on pull #{pull[:number]}\") if @debug\n \n pulls_requiring_build << pull\n end\n end\n\n epoc = (Time.now.to_f - start_time).round\n $stderr.puts(\"Completed Github inspection in #{epoc}s\") if @debug\n\n pulls_requiring_build\n end",
"title": ""
},
{
"docid": "38ca00a78474373bf284f0142719ffcd",
"score": "0.51680684",
"text": "def issues_before_closed(pr)\n q = <<-QUERY\n select i.id, ie.action, ie.created_at\n from reduced_issue_events ie, reduced_issues i\n where ie.issue_id = i.id\n and (ie.action = 'closed' or ie.action = 'reopened')\n and i.repo_id = ?\n and ie.created_at < ?\n and i.pull_request = 0\n QUERY\n db.fetch(q, pr[:project_id], pr[:created_at]).all.reduce({}) do |acc, x|\n if !acc.key?(x[:id]) or acc[x[:id]][:created_at] < x[:created_at]\n acc.update(x[:id] => {:created_at => x[:created_at], :action => x[:action]})\n else\n acc\n end\n end.reduce([]) do |acc, (id, v)|\n if v[:action] == \"closed\"\n acc << id\n else\n acc\n end\n end\n end",
"title": ""
},
{
"docid": "c6586389dac8ab7b0d4c5e95afeaa2fc",
"score": "0.51662517",
"text": "def post_process_notify url\n print '.' if @verbose\n puts \"checked!\" if @chatty\n end",
"title": ""
},
{
"docid": "10a123726ef5b30ec336bbf536c093cc",
"score": "0.5157696",
"text": "def issue_count_by_status\n events = GithubDashing::EventCollection.new\n\n repos.each do |repo|\n begin\n issues = Octokit.issues(repo, since: start_date, state: 'all')\n\n next if issues.empty?\n\n issues.each do |issue|\n issue_type = issue.respond_to?(:pull_request) ? 'pull_request' : 'issue'\n events << GithubDashing::Event.new(type: issue_type,\n datetime: datetime_for_issue(issue),\n key: issue.state,\n value: 1)\n end\n rescue Octokit::Error => exception\n logger.debug(\"Octokit exception: #{exception}\")\n end\n end\n\n events\n end",
"title": ""
},
{
"docid": "f8bc05755ff7fa6efe649fb130d0dd0f",
"score": "0.5156417",
"text": "def website_viewer_methods_check_upon_login\n\t\tself.update_website_viewer_runs_to_current_day\n self.check_for_recent_obligations\n\tend",
"title": ""
},
{
"docid": "6085167fd763b471b2ac96dcae3acc50",
"score": "0.5154903",
"text": "def changelog_active(pr)\n return unless changelog_test\n changelog_changed(@repo, pr)\n true\n end",
"title": ""
},
{
"docid": "8ba0bf01eab30c8a81917faa5de326a9",
"score": "0.51481557",
"text": "def est02_pre_open_news_repostArticle_TC_24313_243414\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article)\n\n\t\trepost \"Repost text #{random}\" \n\t\tsleep 6\n\t\tif $environment == 'nixon'\n\t\t assert !($repost_button.exists?)\n\t\telse\n\t\t assert !($repost_button.visible?)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6edbd9627af7d4a9466727f3c3e41e55",
"score": "0.5143111",
"text": "def fetch_closed_pull_requests\n pull_requests = []\n options = { state: \"merged\", scope: :all }\n\n @client.merge_requests(@project_id, options).auto_paginate do |new_pr|\n new_pr = stringify_keys_deep(new_pr.to_hash)\n # align with Github naming\n new_pr[\"number\"] = new_pr[\"iid\"]\n new_pr[\"html_url\"] = new_pr[\"web_url\"]\n new_pr[\"merged_at\"] = new_pr[\"updated_at\"]\n new_pr[\"pull_request\"] = true\n new_pr[\"user\"] = { login: new_pr[\"author\"][\"username\"], html_url: new_pr[\"author\"][\"web_url\"] }\n # to make it work with older gitlab version or repos that lived across versions\n new_pr[\"merge_commit_sha\"] = new_pr[\"merge_commit_sha\"].nil? ? new_pr[\"sha\"] : new_pr[\"merge_commit_sha\"]\n pull_requests << new_pr\n end\n\n print_empty_line\n\n GitHubChangelogGenerator::Helper.log.info \"Pull Request count: #{pull_requests.count}\"\n pull_requests.map { |pull_request| stringify_keys_deep(pull_request.to_hash) }\n end",
"title": ""
},
{
"docid": "5c53e88105431580bc14060d152d3c3f",
"score": "0.51339215",
"text": "def show\n @team = Hubstats::Team.where(id: params[:id]).first\n @pull_requests = Hubstats::PullRequest.belonging_to_team(@team.id).merged_in_date_range(@start_date, @end_date).order(\"updated_at DESC\").limit(50)\n @pull_count = Hubstats::PullRequest.belonging_to_team(@team.id).merged_in_date_range(@start_date, @end_date).count(:all)\n @users = @team.users.where.not(login: Hubstats.config.github_config[\"ignore_users_list\"] || []).order(\"login ASC\").distinct\n @active_user_count = @users.length\n @comment_count = Hubstats::Comment.belonging_to_team(@users.pluck(:id)).created_in_date_range(@start_date, @end_date).count(:all)\n repos_pr = @pull_requests.pluck(:repo_id)\n repos_comment = Hubstats::Comment.belonging_to_team(@users.pluck(:id)).created_in_date_range(@start_date, @end_date).pluck(:repo_id)\n @repo_count = repos_pr.concat(repos_comment).uniq.count\n @net_additions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_team(@team.id).sum(:additions).to_i -\n Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_team(@team.id).sum(:deletions).to_i\n @additions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_team(@team.id).average(:additions)\n @deletions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_team(@team.id).average(:deletions)\n\n stats\n end",
"title": ""
},
{
"docid": "9f77ee179a52e5ce08eef937d3632f96",
"score": "0.51298857",
"text": "def open_issues_count\n load_issue_counts\n @open_issues_count\n end",
"title": ""
},
{
"docid": "9f77ee179a52e5ce08eef937d3632f96",
"score": "0.51298857",
"text": "def open_issues_count\n load_issue_counts\n @open_issues_count\n end",
"title": ""
},
{
"docid": "d771c9389f248ce4fe70958df1cd98bf",
"score": "0.5118899",
"text": "def pr_comments(pr)\n q = <<-QUERY\n select body, created_at\n from reduced_pull_request_comments\n where pull_request_id = ?\n and created_at <= ?\n order by created_at asc\n QUERY\n db.fetch(q, pr[:id], pr[:closed_at]).all\n end",
"title": ""
},
{
"docid": "3309d0c98dbe4676c803e6c9e8159e4a",
"score": "0.51160496",
"text": "def initial_jira_questions\n puts 'I will now open a browser with the ticket. Please refer to that page'\n puts 'to answer the following questions.'\n\n $stdout.print 'What is the value of the field \"Make Available To:\"? '\n open_jira\n # Retail, Partner(s), All Partners, or Platform (both)\n @affected_distributions = $stdin.gets.rstrip\n Breadcrumbs.drop \"affected_distributions set to '#{@affected_distributions}'\"\n\n # Eventually, we might allow other types here\n needs_yes('Is type \"Hotfix\"? (y/n) ',\n 'This tool is only for Hot or Warm fixes')\n\n needs_yes('Is the status \"accepted\"? (y/n) ',\n 'Cannot proceed until the status is accepted')\n\n needs_yes('Is a pull request present? (y/n) ',\n 'Cannot proceed until the pull request is present')\n\n needs_yes('Are there three approvals: manager, director, and QE/release manager? (y/n) ',\n 'Cannot proceed until the there are three approvals')\n\n $stdout.print 'Assign the ticket to yourself, and press enter here when complete '\n $stdin.gets\n end",
"title": ""
},
{
"docid": "34b210e14f0150388eae5c9463cc6999",
"score": "0.5111879",
"text": "def check_status\n if status_was && status_was != status\n if status_was == 'pending' && status == 'active'\n feed_post_create\n end\n end\n end",
"title": ""
},
{
"docid": "d4982538352c95b91ef56500597c21ed",
"score": "0.51108366",
"text": "def check_for_new_pull_requests\n setup_worker_data\n pull_requests_with_new_commits = filter_pull_requests_with_commit_shas_in_builds\n\n if pull_requests_with_new_commits.empty?\n logger.debug(\"No new commits found for #{project.project_name} (#{repo_full_name})\")\n return\n end\n\n pr_details = pull_requests_with_new_commits.map { |pr| \"#{pr.repo_full_name}:#{pr.branch}:#{pr.current_sha}\" }\n logger.debug(\"Creating build task(s) for #{project.project_name} (#{repo_full_name}): #{pr_details}\")\n\n enqueue_new_builds(pull_requests_with_new_commits)\n end",
"title": ""
},
{
"docid": "3b6700b5b767e4283af0702972fad871",
"score": "0.5108972",
"text": "def add_report_url\n raise(\"Not a pull request, skipped!\") unless pr?\n return add_comment if comment?\n\n update_pr_description\n end",
"title": ""
},
{
"docid": "65055b16cc5bf2d044bd297489fcb910",
"score": "0.5103695",
"text": "def open_issues\n @log.debug \"Listing issues ..\"\n issues_and_prs = client.issues(\n @repo,\n direction: 'desc',\n sort: 'created',\n state: 'open'\n )\n @log.debug format(\"%d open issues and PRs\", issues_and_prs.length)\n issues = issues_and_prs.reject { |i| i.key?(:pull_request) }\n @log.debug format(\"%d open issues (max %d)\", issues.length, MAX_ISSUES)\n issues.to_a.take(MAX_ISSUES).map { |resource| # Sawyer::Resource\n Issues::Factory.new.build(resource.to_h)\n }\n end",
"title": ""
},
{
"docid": "35c67d5cc3d62ae0a5451ec4b407f79a",
"score": "0.50935704",
"text": "def pull_request\n get\n end",
"title": ""
},
{
"docid": "ab94a916a7fe30316a7e697ae346e4fc",
"score": "0.50820744",
"text": "def on_new_investigation; end",
"title": ""
},
{
"docid": "ab94a916a7fe30316a7e697ae346e4fc",
"score": "0.50820744",
"text": "def on_new_investigation; end",
"title": ""
},
{
"docid": "ab94a916a7fe30316a7e697ae346e4fc",
"score": "0.50820744",
"text": "def on_new_investigation; end",
"title": ""
},
{
"docid": "ab94a916a7fe30316a7e697ae346e4fc",
"score": "0.50820744",
"text": "def on_new_investigation; end",
"title": ""
},
{
"docid": "ab94a916a7fe30316a7e697ae346e4fc",
"score": "0.50820744",
"text": "def on_new_investigation; end",
"title": ""
},
{
"docid": "e04f909d6bea893487eb6dbd967ec16c",
"score": "0.5082",
"text": "def open_date\n pull_request.created_at\n end",
"title": ""
},
{
"docid": "872b7a42991f3174d453eb2921a9e3fc",
"score": "0.5081013",
"text": "def process_pull_request(pr, lang)\n\n # Statistics across pull request commits\n stats = pr_stats(pr)\n stats_open = pr_stats(pr, true)\n merged = !pr[:merged_at].nil?\n git_merged, merge_reason, merge_person = @close_reason[pr[:github_id]]\n\n # Count number of src/comment lines\n src = src_lines(pr[:base_commit])\n\n if src == 0 then raise StandardError.new(\"Bad src lines: 0, pr: #{pr[:github_id]}, id: #{pr[:id]}\") end\n\n months_back = 3\n commits_incl_prs = commits_last_x_months(pr, false, months_back)\n commits_incl_prs = 1 if commits_incl_prs == 0 # To avoid divsions by zero below\n\n prev_pull_reqs = prev_pull_requests(pr,'opened')\n\n # Create line for a pull request\n {\n # Generall stuff\n :pull_req_id => pr[:id],\n :project_name => \"#{pr[:login]}/#{pr[:project_name]}\",\n :lang => lang,\n :github_id => pr[:github_id],\n\n # PR characteristics\n :created_at => Time.at(pr[:created_at]).to_i,\n :merged_at => merge_time(pr, merged, git_merged),\n :closed_at => Time.at(pr[:closed_at]).to_i,\n :lifetime_minutes => pr[:lifetime_minutes],\n :mergetime_minutes => merge_time_minutes(pr, merged, git_merged),\n :merged_using => merge_reason.to_s,\n :conflict => conflict?(pr),\n :forward_links => forward_links?(pr),\n :intra_branch => if intra_branch?(pr) == 1 then true else false end,\n :description_length => description_length(pr),\n :num_commits => num_commits(pr),\n :num_commits_open => num_commits_at_open(pr),\n :num_pr_comments => num_pr_comments(pr),\n :num_issue_comments => num_issue_comments(pr),\n :num_commit_comments => num_commit_comments(pr),\n :num_comments => num_pr_comments(pr) + num_issue_comments(pr) + num_commit_comments(pr),\n :num_commit_comments_open => num_commit_comments(pr, true),\n :num_participants => num_participants(pr),\n :files_added_open => stats_open[:files_added],\n :files_deleted_open => stats_open[:files_removed],\n :files_modified_open => stats_open[:files_modified],\n :files_changed_open => stats_open[:files_added] + stats[:files_modified] + stats[:files_removed],\n :src_files_open => stats_open[:src_files],\n :doc_files_open => stats_open[:doc_files],\n :other_files_open => stats_open[:other_files],\n :files_added => stats[:files_added],\n :files_deleted => stats[:files_removed],\n :files_modified => stats[:files_modified],\n :files_changed => stats[:files_added] + stats[:files_modified] + stats[:files_removed],\n :src_files => stats[:src_files],\n :doc_files => stats[:doc_files],\n :other_files => stats[:other_files],\n :src_churn_open => stats_open[:lines_added] + stats_open[:lines_deleted],\n :test_churn_open => stats_open[:test_lines_added] + stats_open[:test_lines_deleted],\n :src_churn => stats[:lines_added] + stats[:lines_deleted],\n :test_churn => stats[:test_lines_added] + stats[:test_lines_deleted],\n :new_entropy => new_entropy(pr),\n :entropy_diff => (new_entropy(pr) / project_entropy(pr)) * 100,\n :commits_on_files_touched => commits_on_files_touched(pr, months_back),\n :commits_to_hottest_file => commits_to_hottest_file(pr, months_back),\n :hotness => hotness(pr, months_back),\n :at_mentions_description => at_mentions_description(pr),\n :at_mentions_comments => at_mentions_comments(pr),\n\n # Project characteristics\n :perc_external_contribs => commits_last_x_months(pr, true, months_back).to_f / commits_incl_prs.to_f,\n :sloc => src,\n :test_lines_per_kloc => (test_lines(pr[:base_commit]).to_f / src.to_f) * 1000,\n :test_cases_per_kloc => (num_test_cases(pr[:base_commit]).to_f / src.to_f) * 1000,\n :asserts_per_kloc => (num_assertions(pr[:base_commit]).to_f / src.to_f) * 1000,\n :stars => stars(pr),\n :team_size => team_size(pr, months_back),\n :workload => workload(pr),\n :ci => ci(pr),\n\n # Contributor characteristics\n :requester => requester(pr),\n :closer => closer(pr),\n :merger => merge_person,\n :prev_pullreqs => prev_pull_reqs,\n :requester_succ_rate => if prev_pull_reqs > 0 then prev_pull_requests(pr, 'merged').to_f / prev_pull_reqs.to_f else 0 end,\n :followers => followers(pr),\n :main_team_member => main_team_member?(pr, months_back),\n :social_connection => social_connection?(pr),\n\n # Project/contributor interaction characteristics\n :prior_interaction_issue_events => prior_interaction_issue_events(pr, months_back),\n :prior_interaction_issue_comments => prior_interaction_issue_comments(pr, months_back),\n :prior_interaction_pr_events => prior_interaction_pr_events(pr, months_back),\n :prior_interaction_pr_comments => prior_interaction_pr_comments(pr, months_back),\n :prior_interaction_commits => prior_interaction_commits(pr, months_back),\n :prior_interaction_commit_comments => prior_interaction_commit_comments(pr, months_back),\n :first_response => first_response(pr)\n }\n end",
"title": ""
}
] |
ab5b0ff2e67d281b5e62dc3dfc5058fc | PUT /trends/1 PUT /trends/1.json | [
{
"docid": "64930493efb8852a6d312896e4d3af05",
"score": "0.70530486",
"text": "def update\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n if @trend.update_attributes(params[:trend])\n format.html { redirect_to @trend, notice: 'Trend was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trend.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "df6dd7b3c3097645fc63940f913efd20",
"score": "0.7115279",
"text": "def update\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n if @trend.update_attributes(params[:trend])\n format.html { redirect_to @trend, :notice => 'Trend was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @trend.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2341ffb1c84a89b97439b61e4bd5ae6",
"score": "0.6358489",
"text": "def update\n respond_to do |format|\n if @trending.update(trending_params)\n format.html { redirect_to @trending, notice: 'Trending was successfully updated.' }\n format.json { render :show, status: :ok, location: @trending }\n else\n format.html { render :edit }\n format.json { render json: @trending.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fdc6164a5e510b8864716384d3d88f4",
"score": "0.60356",
"text": "def closest_trends\n get(\"/trends/closest.json\")\n end",
"title": ""
},
{
"docid": "680d5b27477b5cfc915761b76c4fe3b5",
"score": "0.5999022",
"text": "def set_trend\n $twiGetId = Array.new\n @trend = Trend.find(params[:id])\n end",
"title": ""
},
{
"docid": "844efdcd169732c8dffb97f7e3addcbd",
"score": "0.5948721",
"text": "def create\n @trend = Trend.new(params[:trend])\n\n respond_to do |format|\n if @trend.save\n format.html { redirect_to @trend, :notice => 'Trend was successfully created.' }\n format.json { render :json => @trend, :status => :created, :location => @trend }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trend.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71d53091e6f10499ffeddaced86d7045",
"score": "0.59001344",
"text": "def create\n @trend = Trend.new(params[:trend])\n\n respond_to do |format|\n if @trend.save\n format.html { redirect_to @trend, notice: 'Trend was successfully created.' }\n format.json { render json: @trend, status: :created, location: @trend }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trend.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ce01bdd47cf285e1fd470d4a2ab7f04",
"score": "0.58943313",
"text": "def set_trending\n @trending = Trending.find(params[:id])\n end",
"title": ""
},
{
"docid": "67d38193f58b3a8894a0bf2e6f9231f3",
"score": "0.5877498",
"text": "def destroy\n @trend = Trend.find(params[:id])\n @trend.destroy\n\n respond_to do |format|\n format.html { redirect_to trends_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f586754d59cc6abd630d880c8c3af2d6",
"score": "0.58382314",
"text": "def destroy\n @trend = Trend.find(params[:id])\n @trend.destroy\n\n respond_to do |format|\n format.html { redirect_to trends_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e79715618b69000e5a50841503f8b2b",
"score": "0.5826662",
"text": "def update\n @trending_topic = TrendingTopic.find(params[:id])\n\n respond_to do |format|\n if @trending_topic.update_attributes(params[:trending_topic])\n format.html { redirect_to @trending_topic, notice: 'Trending topic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trending_topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "616b24112573590ca0d958e58d8216dc",
"score": "0.57208705",
"text": "def available_trends\n get(\"/trends/available.json\")\n end",
"title": ""
},
{
"docid": "bc37730b6c9943de7d7d793ce8411e0e",
"score": "0.56966853",
"text": "def index\n \n @trends = Trend.order(\"as_of DESC\").limit(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trends }\n end\n\n end",
"title": ""
},
{
"docid": "061024a183358a8f9815ff4ddfc7bc17",
"score": "0.5541391",
"text": "def update(tweet)\n client.update tweet\n end",
"title": ""
},
{
"docid": "e52904d62c04890027502bd36dc4873d",
"score": "0.5538751",
"text": "def update\n @tweet.update(tweet_params)\n respond_with(@tweet)\n end",
"title": ""
},
{
"docid": "7cbcb2cda6e100042f124dacd474f3be",
"score": "0.54880863",
"text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "e945e1278abbd2e75b9a1613f87e6e0d",
"score": "0.5463817",
"text": "def show\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trend }\n end\n end",
"title": ""
},
{
"docid": "036a9f156bc01a21805bbdf434096688",
"score": "0.5431997",
"text": "def update\n begin\n Twitter.user_timeline(params[:foodtruck][:handle])\n foodtruck = Foodtruck.find(params[:id])\n foodtruck.update_attributes(params[:foodtruck])\n redirect_to '/foodtrucks'\n rescue\n redirect_to \"/foodtrucks/#{params[:id]}\"\n end\n end",
"title": ""
},
{
"docid": "aadd13b882c276f038392716ad6847f5",
"score": "0.53855526",
"text": "def update\n @daily_statistic = DailyStatistic.find(params[:id])\n\n if @daily_statistic.update(params[:daily_statistic])\n head :no_content\n else\n render json: @daily_statistic.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.5335112",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "eb33a665474a7f07462c380ce4e86e4a",
"score": "0.5331938",
"text": "def index\n $twiGetId = Array.new\n @trends = Trend.all\n end",
"title": ""
},
{
"docid": "04c7df9b24f7caa2617bbdd2420647b6",
"score": "0.52742153",
"text": "def recommendation_trends_with_http_info(symbol, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.recommendation_trends ...'\n end\n # verify the required parameter 'symbol' is set\n if @api_client.config.client_side_validation && symbol.nil?\n fail ArgumentError, \"Missing the required parameter 'symbol' when calling DefaultApi.recommendation_trends\"\n end\n # resource path\n local_var_path = '/stock/recommendation'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'symbol'] = symbol\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<RecommendationTrend>' \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: DefaultApi#recommendation_trends\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "db3a5644abacaddcb945edd853c4e942",
"score": "0.5263708",
"text": "def update\n respond_to do |format|\n if @tw_stat.update(tw_stat_params)\n format.html { redirect_to @tw_stat, notice: 'Tw stat was successfully updated.' }\n format.json { render :show, status: :ok, location: @tw_stat }\n else\n format.html { render :edit }\n format.json { render json: @tw_stat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ebca84fe4e973e44bea95dd2dc48a85",
"score": "0.5259465",
"text": "def trends_for_location(woeid)\n get(\"/trends/woeid.json\")\n end",
"title": ""
},
{
"docid": "f5cc48f0cf0efc9388b4ba32ae7a2abf",
"score": "0.5239764",
"text": "def trends_available\n get(\"/trends/available.json\")\n end",
"title": ""
},
{
"docid": "30d55ad9ad053c17333b72452dd9e85b",
"score": "0.52254725",
"text": "def get_trends_with_http_info(vin, car_type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MarketApi.get_trends ...'\n end\n # verify the required parameter 'vin' is set\n if @api_client.config.client_side_validation && vin.nil?\n fail ArgumentError, \"Missing the required parameter 'vin' when calling MarketApi.get_trends\"\n end\n # verify the required parameter 'car_type' is set\n if @api_client.config.client_side_validation && car_type.nil?\n fail ArgumentError, \"Missing the required parameter 'car_type' when calling MarketApi.get_trends\"\n end\n # resource path\n local_var_path = '/trends'\n\n # query parameters\n query_params = {}\n query_params[:'vin'] = vin\n query_params[:'car_type'] = car_type\n query_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil?\n query_params[:'year'] = opts[:'year'] if !opts[:'year'].nil?\n query_params[:'make'] = opts[:'make'] if !opts[:'make'].nil?\n query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?\n query_params[:'trim'] = opts[:'trim'] if !opts[:'trim'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<TrendPoint>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MarketApi#get_trends\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9b9b4c0e7a0f3b22cab1ded9449c728d",
"score": "0.5215684",
"text": "def create\n @trending = Trending.new(trending_params)\n\n respond_to do |format|\n if @trending.save\n format.html { redirect_to @trending, notice: 'Trending was successfully created.' }\n format.json { render :show, status: :created, location: @trending }\n else\n format.html { render :new }\n format.json { render json: @trending.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bba0e1137508e91bcd958855ddab6c83",
"score": "0.5197128",
"text": "def set_long_trend\n @long_trend = LongTrend.find(params[:id])\n end",
"title": ""
},
{
"docid": "54f95a361000b6219275e377b8bf4555",
"score": "0.5196844",
"text": "def update options={}\n client.put(\"/#{id}\", options)\n end",
"title": ""
},
{
"docid": "08d5c031a3a27e4832818417a5d3b9ae",
"score": "0.5188756",
"text": "def update\n respond_to do |format|\n if @tracer.update(tracer_params)\n format.html { redirect_to @tracer, notice: \"Tracer was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tracer }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tracer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a610bf2255b3ec2c6b80f27d1fb5782",
"score": "0.5182305",
"text": "def show\n @trend_search = params[:id].to_s\n @trends = Trend.search :conditions => {:name => params[:id] }\n if @trends.blank?\n @trends = Trend.where(:name => params[:id])\n end\n\n @trend_hops = trend_hops(@trends)\n @posts = get_trend_posts(@trends)\n @blogs = get_trend_blogs(@trend_search)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @trend }\n end\n end",
"title": ""
},
{
"docid": "b6d14193dac9e8810c7b36ea1aa70c4b",
"score": "0.5181725",
"text": "def new\n @trend = Trend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trend }\n end\n end",
"title": ""
},
{
"docid": "84f9893e06ed778e7c4e89752dfca5ba",
"score": "0.5160861",
"text": "def trends\n data = generate_data(data_factory)\n respond_with data\n end",
"title": ""
},
{
"docid": "a91d673c532d1c2716487162793c8293",
"score": "0.51536214",
"text": "def update\n @tip.update(tips_params)\n json_response(@tip)\n end",
"title": ""
},
{
"docid": "5b6d1d52f418929fdab2976558a78250",
"score": "0.5150013",
"text": "def update\n @territory = current_company.territories.find(params[:id])\n\n # hack to determine new and deleted regions\n adjust_region_ids\n adjust_zipcode_ids\n\n if @territory.update_attributes(params[:territory])\n respond_with(@territory)\n else\n respond_with(@territory, :status => :unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "29423b06bdd49148ea30165539c482eb",
"score": "0.51490366",
"text": "def update\n @trek = Trek.find(params[:id])\n\n respond_to do |format|\n if @trek.update_attributes(params[:trek])\n format.html { redirect_to @trek, notice: 'Trek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bcd6551092e158c788c75cc23f3a0c6",
"score": "0.51460075",
"text": "def new\n @trend = Trend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @trend }\n end\n end",
"title": ""
},
{
"docid": "7245d9188c2e1f0ad6cd86fe4a52211b",
"score": "0.5145991",
"text": "def postTweet(status)\n\t\t\t@client.update(status)\n\t\tend",
"title": ""
},
{
"docid": "23e1d2adf6d463b61e154194151fe869",
"score": "0.5140007",
"text": "def update\n @errors = []\n term_opts = flat_term_data_to_term_opts(term_params)\n\n begin\n @term = UriService.client.update_term(@term['uri'], term_opts)\n rescue UriService::NonExistentUriError, UriService::InvalidAdditionalFieldKeyError, UriService::CannotChangeTemporaryTerm => e\n @errors << e.message\n end\n\n respond_to do |format|\n if @errors.blank?\n format.html { redirect_to term_path(@term['internal_id']), notice: 'Term was successfully updated.' }\n format.json do\n render json: @term\n end\n else\n format.html { render action: 'new' }\n format.json do\n render json: { errors: @errors }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7849eb000da495c284e1d6de00beac3b",
"score": "0.5132576",
"text": "def update\n quote = Quote.find(params[:id])\n response = Unirest.post \"https://twinword-sentiment-analysis.p.rapidapi.com/analyze/\",\n headers:{\n \"X-RapidAPI-Host\" => \"twinword-sentiment-analysis.p.rapidapi.com\",\n \"X-RapidAPI-Key\" => \"f8988f3300msh1bf9aec476d3e6fp11f826jsn5bb5ceaa92d7\",\n \"Content-Type\" => \"application/x-www-form-urlencoded\"\n },\n parameters:{\n \"text\" => quote.text\n }\n # puts response.body[\"type\"]\n\n @quote.update(\n saved: params[:saved],\n sentiment: response.body[\"type\"]\n )\n @quote.save\n end",
"title": ""
},
{
"docid": "396ae53060e7cd479b0a020520d58ea7",
"score": "0.5127748",
"text": "def update\n if @troop.update(troop_params)\n render :show, status: :ok, location: @troop\n else\n render json: @troop.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b7bfa44df530bada2cd44ef78c42e01a",
"score": "0.51161593",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047449e243f3c610d656dd97775705d",
"score": "0.51138616",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047449e243f3c610d656dd97775705d",
"score": "0.51138616",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047449e243f3c610d656dd97775705d",
"score": "0.51138616",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d46c7869013d3100b0344461a44764e6",
"score": "0.5109115",
"text": "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "0da246670aac6789b9716f32ec1c35b3",
"score": "0.5103786",
"text": "def update\n update_resource @ride, ride_params\n end",
"title": ""
},
{
"docid": "963bd1945e226c05d54a8d8f3627eb68",
"score": "0.50971097",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cab42d23684d9701d6e81cd7d85002fc",
"score": "0.50893784",
"text": "def update\n # Add in this #MDM\n @tweet = Tweet.find(params[:id]) \n \n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a646cfc3c6e897f23aa2d42c7906de56",
"score": "0.5085437",
"text": "def update\n respond_to do |format|\n if @tracing.update(tracing_params)\n format.html { redirect_to @tracing }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tracing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db6ce2ca058eae6828914a62ec4faf1b",
"score": "0.5073449",
"text": "def index\n @trend_filter = params[:filter]\n\n @trends = case params[:filter]\n when \"recent\" then Trend.order(\"created_at DESC\")\n when \"popular\" then Trend.order(\"trend_count DESC\")\n when \"today\" then Trend.set_range(\"day\")\n when \"past_week\" then Trend.set_range(\"week\")\n when \"past_month\" then Trend.set_range(\"month\")\n when \"men\" then Trend.set_men\n when \"women\" then Trend.set_women\n else Trend.order(\"created_at DESC\")\n end\n # raise @trends.inspect\n\n @posts = Post.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @trends }\n end\n end",
"title": ""
},
{
"docid": "48f71f071cc5e81a4dac3a0fbe73c9ff",
"score": "0.5070556",
"text": "def update\n @travel_chart = Travel::Chart.find(params[:id])\n\n respond_to do |format|\n if @travel_chart.update_attributes(params[:travel_chart])\n format.html { redirect_to @travel_chart, notice: 'Travel chart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @travel_chart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c6059272baabee2212510e015eb7d8d",
"score": "0.50676405",
"text": "def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"title": ""
},
{
"docid": "0c1f89d3a7fcc73b3c73078ff4605790",
"score": "0.50138843",
"text": "def fetch_local_trends(user)\n @woeid = user.woeid.to_i\n local_trends = $redis.get(\"local_trends_#{@woeid}\")\n if local_trends.nil?\n response = twitter.trends(id = @woeid)\n local_trends = JSON.generate(response.attrs[:trends])\n $redis.set(\"local_trends_#{@woeid}\", local_trends)\n $redis.expire(\"local_trends_#{@woeid}\", 15.minutes.to_i)\n end\n @local_trends = JSON.load(local_trends)\n end",
"title": ""
},
{
"docid": "ef9e64655915a948f0d8b549ac8fce71",
"score": "0.501343",
"text": "def update\n json_response(@restaurant.update!(restaurant_params))\n end",
"title": ""
},
{
"docid": "3b44cd839cc531e55c8c7cc7dc7d14c6",
"score": "0.50122887",
"text": "def update\n respond_to do |format|\n if @tweett.update(tweett_params)\n format.html { redirect_to @tweett, notice: 'Tweett was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweett }\n else\n format.html { render :edit }\n format.json { render json: @tweett.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a6164a53469395dea14873540683f9c",
"score": "0.5012148",
"text": "def update\n respond_to do |format|\n if tweet.save\n format.html { redirect_to tweets_path, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: tweet }\n else\n format.html { render :edit }\n format.json { render json: tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2b9b19af3f8358a8b3c60aa237b3d33",
"score": "0.5008162",
"text": "def update\n @track_dress = TrackDress.find(params[:id])\n\n respond_to do |format|\n if @track_dress.update_attributes(params[:track_dress])\n format.html { redirect_to @track_dress, notice: 'Track dress was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @track_dress.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23fe3e661ff5dd7618fc1b9cb8b7e235",
"score": "0.5007119",
"text": "def update_twitter_query(project_id, query_id, opts = {})\n put \"projects/#{project_id}/twitterqueries/#{query_id}\", opts\n end",
"title": ""
},
{
"docid": "a1a9dc05b250a75bb84fc30a35547ecc",
"score": "0.5005044",
"text": "def update\n respond_to do |format|\n if @variety.update(variety_params)\n format.html { redirect_to @variety, notice: 'Variety was successfully updated.' }\n format.json { render :show, status: :ok, location: @variety }\n else\n format.html { render :edit }\n format.json { render json: @variety.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a11e5228ccf2b071e267a7896ad22688",
"score": "0.49964195",
"text": "def update!(**args)\n @territories = args[:territories] if args.key?(:territories)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "e4603f15d74ffd073358bc8513448b35",
"score": "0.4989605",
"text": "def update\n if @term.update(term_params)\n render :show, status: :ok, location: api_v1_term_url(@term)\n else\n render json: @term.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8e7eeb7a7bda0a5f37c762869af4f59a",
"score": "0.49891502",
"text": "def update\r\n respond_to do |format|\r\n if @tweet.update(tweet_params)\r\n format.html { redirect_to @tweet}\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "60954401091ab98245fc1da4f4fc3089",
"score": "0.4985234",
"text": "def update\n @tenure = Tenure.find(params[:id])\n\n if @tenure.update(tenure_params)\n audit(@tenure, current_user)\n head :no_content\n else\n render json: @tenure.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f7b4a808749a2b9f90d2305a65949386",
"score": "0.4980936",
"text": "def update\n respond_to do |format|\n if @timeline.update(timeline_params)\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { render :show, status: :ok, location: @timeline }\n else\n format.html { render :edit }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7b4a808749a2b9f90d2305a65949386",
"score": "0.4980936",
"text": "def update\n respond_to do |format|\n if @timeline.update(timeline_params)\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { render :show, status: :ok, location: @timeline }\n else\n format.html { render :edit }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7e988cec85833e47917ad361d7286f2",
"score": "0.4980208",
"text": "def update\n @frequent_set = FrequentSet.find(params[:id])\n\n respond_to do |format|\n if @frequent_set.update_attributes(params[:frequent_set])\n format.html { redirect_to @frequent_set, notice: 'Frequent set was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @frequent_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68809bb5989bf825151c6afdd9318ec9",
"score": "0.49776235",
"text": "def update\n @tardy = Tardy.find(params[:id])\n\n respond_to do |format|\n if @tardy.update_attributes(params[:tardy])\n format.html { redirect_to @tardy, notice: 'Tardy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tardy.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77d754b9e7e338142e72b534f5a99333",
"score": "0.49743554",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77d754b9e7e338142e72b534f5a99333",
"score": "0.49743554",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77d754b9e7e338142e72b534f5a99333",
"score": "0.49743554",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b672095ef5b779d995eca60b1cf057ec",
"score": "0.49713498",
"text": "def update\n respond_to do |format|\n if @trac.update(trac_params)\n format.html { redirect_to @trac, notice: 'Trac was successfully updated.' }\n format.json { render :show, status: :ok, location: @trac }\n else\n format.html { render :edit }\n format.json { render json: @trac.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76deb2d9d5e728afc5dab916a05384df",
"score": "0.49695677",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76deb2d9d5e728afc5dab916a05384df",
"score": "0.49695677",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76deb2d9d5e728afc5dab916a05384df",
"score": "0.49695677",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76deb2d9d5e728afc5dab916a05384df",
"score": "0.49695677",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "377f6e266f28b08e46c22975cf3f4d34",
"score": "0.49590936",
"text": "def update\n update_restaurant\n end",
"title": ""
},
{
"docid": "1efc08110217769a644c517e8f5f81ef",
"score": "0.49578768",
"text": "def update\n respond_to do |format|\n if @new_tweet.update(new_tweet_params)\n format.html { redirect_to @new_tweet, notice: 'New tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @new_tweet }\n else\n format.html { render :edit }\n format.json { render json: @new_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f180352fc73ab912b82a6046e0a6948e",
"score": "0.49554443",
"text": "def update\n respond_to do |format|\n if @teather.update(teather_params)\n format.html { redirect_to @teather, notice: 'Teather was successfully updated.' }\n format.json { render :show, status: :ok, location: @teather }\n else\n format.html { render :edit }\n format.json { render json: @teather.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "316c0e88d6e5340774143620bae44dcb",
"score": "0.49511054",
"text": "def recommendation_trends(symbol, opts = {})\n data, _status_code, _headers = recommendation_trends_with_http_info(symbol, opts)\n data\n end",
"title": ""
},
{
"docid": "550bcc19d6d2d1e2df4436be32742a2e",
"score": "0.4943666",
"text": "def update\n respond_to do |format|\n if @tottle.update(tottle_params)\n format.html { redirect_to @tottle, notice: 'Tottle was successfully updated.' }\n format.json { render :show, status: :ok, location: @tottle }\n else\n format.html { render :edit }\n format.json { render json: @tottle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f29851028f8f60006e932b96b8ae112b",
"score": "0.49393296",
"text": "def update\n @timeline = Timeline.find(params[:id])\n\n respond_to do |format|\n if @timeline.update_attributes(params[:timeline])\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f29851028f8f60006e932b96b8ae112b",
"score": "0.49393296",
"text": "def update\n @timeline = Timeline.find(params[:id])\n\n respond_to do |format|\n if @timeline.update_attributes(params[:timeline])\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2acccfc798e95f993693d8e9bf64150d",
"score": "0.49363288",
"text": "def update\n respond_to do |format|\n if @twittter.update(twittter_params)\n format.html { redirect_to @twittter, notice: 'Twittter was successfully updated.' }\n format.json { render :show, status: :ok, location: @twittter }\n else\n format.html { render :edit }\n format.json { render json: @twittter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5432e46b7f37b20d51cff09c965e1f76",
"score": "0.49355456",
"text": "def set_tw_stat\n @tw_stat = TwStat.find(params[:id])\n end",
"title": ""
},
{
"docid": "cf7b756ba9bb33bdc9e442a926694b1b",
"score": "0.49343973",
"text": "def update\r\n respond_to do |format|\r\n if @tweet.update(tweet_params)\r\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\r\n format.json { render :show, status: :ok, location: @tweet }\r\n else\r\n format.html { render :edit, status: :unprocessable_entity }\r\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "6c358080e41401b706bbb21f5755aa48",
"score": "0.4930829",
"text": "def update_score\n question_params = params.require(:question).permit(:id, :score)\n\n render json: Question.update_score(question_params)\n end",
"title": ""
},
{
"docid": "8bec9a4bc7368e6ba1ff33ece9266465",
"score": "0.49281567",
"text": "def update\n @trek.trek_mountains.clear\n respond_to do |format|\n if @trek.update(trek_params)\n format.html { redirect_to @trek, notice: 'Trek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90a4a576885007f24d1498f17d633227",
"score": "0.49277532",
"text": "def destroy\n @trending.destroy\n respond_to do |format|\n format.html { redirect_to trendings_url, notice: 'Trending was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d99a958f620c4f692428782c43588aa",
"score": "0.49230027",
"text": "def update\n @teach = Teach.find(params[:id])\n\n respond_to do |format|\n if @teach.update_attributes(params[:teach])\n format.html { redirect_to @teach, notice: 'Teach was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @teach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa9bf33d06667514515e5956e7ca4a27",
"score": "0.49121824",
"text": "def update\n @department = Department.find(params[:department_id])\n @town = @department.towns.find(params[:id]) \n respond_to do |format|\n if @town.update(town_params)\n format.json { render json: @town, status: :ok }\n else\n format.json { render json: @town.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d9fb5579f56bfc30b52013e4a3f16c4",
"score": "0.49093828",
"text": "def update\n @tune = Tune.find(params[:id])\n\n respond_to do |format|\n if @tune.update_attributes(params[:tune])\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a433682022c83771e6a5ce48f3b7d8b",
"score": "0.49086723",
"text": "def update_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by(id: params[:id])\n suggested_pathway.name = params[:name]\n suggested_pathway.year = params[:year]\n suggested_pathway.course_id = params[:course_id]\n suggested_pathway.data = params[:data]\n suggested_pathway.save\n render json: suggested_pathway\n end",
"title": ""
},
{
"docid": "fe895fd60016dfa27df34785062bfccd",
"score": "0.49080396",
"text": "def update\n @teach = Teach.find(params[:id])\n\n respond_to do |format|\n if @teach.update_attributes(params[:teach])\n format.html { redirect_to @teach, notice: 'Teach was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @teach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3460fb056942facc2b54a974b67200c5",
"score": "0.4907666",
"text": "def update\n respond_to do |format|\n if @timeline.update(timeline_params)\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3ae92b21a8c64ef3e14f66c3d552793",
"score": "0.48996642",
"text": "def update\n @timechart = Timechart.find(params[:id])\n\n respond_to do |format|\n if @timechart.update_attributes(params[:timechart])\n format.html { redirect_to @timechart, notice: 'Timechart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timechart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "248f92126b63c5e7330e49ae33674524",
"score": "0.4899579",
"text": "def update\n @daily_horoscope = DailyHoroscope.find(params[:id])\n\n respond_to do |format|\n if @daily_horoscope.update_attributes(params[:daily_horoscope])\n format.html { redirect_to @daily_horoscope, notice: 'Daily horoscope was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @daily_horoscope.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e98c6464a14458199c1ec3a77da991db",
"score": "0.4890555",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n @tweet.user_vote = 0\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfa4e65534963ca589acd5a2d88f2b4c",
"score": "0.48895392",
"text": "def update\n\t \t#byebug\n\t \tif @race\n\t \t\t@race.update(race_params)\n\t \t\trender json: @race, status: :ok\n\t \telse\n\t\t\trender plain: \"woops: cannot find race[#{params[:id]}]\", status: :not_found\n\t\tend\n\t end",
"title": ""
},
{
"docid": "496c2796ef049221622ff21443bd82d3",
"score": "0.4887043",
"text": "def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2629e23ca1832b55d6de867427e6cd82",
"score": "0.48863214",
"text": "def set_tweett\n @tweett = Tweett.find(params[:id])\n end",
"title": ""
}
] |
59d699a74b425bb0b5b8bbc05ae7666a | Returns an index to the XF record in the workbook. Note: this is a function, not a method. | [
{
"docid": "e653fd217e9e2af95c3ab43d78f43fa5",
"score": "0.7368421",
"text": "def xf_record_index(row, col, xf=nil) #:nodoc:\n if xf.respond_to?(:xf_index)\n xf.xf_index\n elsif @row_formats.has_key?(row)\n @row_formats[row].xf_index\n elsif @col_formats.has_key?(col)\n @col_formats[col].xf_index\n else\n 0x0F\n end\n end",
"title": ""
}
] | [
{
"docid": "8adf0fc6dc60fa7c8b95c8d6995d6c95",
"score": "0.7839115",
"text": "def find_xf(workbook, xf)\n workbook.cell_xfs.each_with_index { |xfs, index| return index if xfs == xf }\n return nil\n end",
"title": ""
},
{
"docid": "0bf9ba92fd9b607f9826c1c20aaa1b15",
"score": "0.7584053",
"text": "def find_xf(workbook, xf)\n workbook.cell_xfs[:xf].each_with_index {|xfs, index|\n if xfs[:attributes][:borderId] == xf[:borderId] &&\n xfs[:attributes][:xfId] == xf[:xfId] &&\n xfs[:attributes][:fillId] == xf[:fillId] &&\n xfs[:attributes][:numFmtId] == xf[:numFmtId] &&\n xfs[:attributes][:fontId] == xf[:fontId]\n return index\n end\n }\n return nil\n end",
"title": ""
},
{
"docid": "7be01695f97c7d6ac46c8ec52614a7fa",
"score": "0.7545697",
"text": "def xf_index # :nodoc:\n @xf_index\n end",
"title": ""
},
{
"docid": "89d13f7b28d0fa696994250c04df224a",
"score": "0.74327266",
"text": "def XF(row, col, xf=nil)\r\n if xf.kind_of?(Format)\r\n return xf.xf_index\r\n elsif @row_formats.has_key?(row) \r\n return @row_formats[row].xf_index\r\n elsif @column_formats.has_key?(col)\r\n return @column_formats[col].xf_index\r\n else\r\n return 0x0F\r\n end\r\n end",
"title": ""
},
{
"docid": "dfceba2172bc1efb8d1462c300ae0c5d",
"score": "0.7128926",
"text": "def get_xf_index\n if @xf_index\n @xf_index\n elsif @formats.xf_index_by_key(get_format_key)\n @formats.xf_index_by_key(get_format_key)\n else\n @xf_index = @formats.set_xf_index_by_key(get_format_key)\n end\n end",
"title": ""
},
{
"docid": "dfceba2172bc1efb8d1462c300ae0c5d",
"score": "0.7128926",
"text": "def get_xf_index\n if @xf_index\n @xf_index\n elsif @formats.xf_index_by_key(get_format_key)\n @formats.xf_index_by_key(get_format_key)\n else\n @xf_index = @formats.set_xf_index_by_key(get_format_key)\n end\n end",
"title": ""
},
{
"docid": "86b285b6b11743eeac8740996fa9d33f",
"score": "0.6481636",
"text": "def r_xf\n @serial = true\n\n ifnt, ifmt, attrs = @bytes.read(6).unpack('v3')\n attrs = Unxls::BitOps.new(attrs)\n result = {\n ifnt: ifnt, # ifnt (2 bytes): A FontIndex (2.5.129) structure that specifies a Font record.\n ifmt: ifmt, # ifmt (2 bytes): An IFmt (2.5.165) structure that specifies a number format identifier.\n fLocked: attrs.set_at?(0), # A - fLocked (1 bit): A bit that specifies whether the locked protection property is set to true.\n fHidden: attrs.set_at?(1), # B - fHidden (1 bit): A bit that specifies whether the hidden protection property is set to true.\n fStyle: attrs.set_at?(2), # C - fStyle (1 bit): A bit that specifies whether this record specifies a cell XF or a cell style XF. If the value is 1, this record specifies a cell style XF.\n f123Prefix: attrs.set_at?(3), # D - f123Prefix (1 bit): A bit that specifies whether prefix characters are present in the cell.\n ixfParent: attrs.value_at(4..15), # ixfParent (12 bits): An unsigned integer that specifies the zero-based index of a cell style XF record in the collection of XF records in the Globals Substream that this cell format inherits properties from. Cell style XF records are the subset of XF records with an fStyle field equal to 1. See XFIndex (2.5.282) for more information about the organization of XF records in the file. If fStyle equals 1, this field SHOULD equal 0xFFF, indicating there is no inheritance from a cell style XF.\n }\n\n specifies = Unxls::Biff8::Structure._builtin_xf_description(collection_index) # See 2.5.282 XFIndex\n result[:_description] = specifies if specifies\n\n result[:_type] = result[:fStyle] ? :stylexf : :cellxf\n\n result.merge(Unxls::Biff8::Structure.send(result[:_type], @bytes))\n end",
"title": ""
},
{
"docid": "74709b175469cfaffb9ad730dae3c1a4",
"score": "0.64178276",
"text": "def modify_xf(workbook, xf)\n existing_xf_id = find_xf(workbook, xf)\n if !existing_xf_id.nil?\n xf_id = existing_xf_id\n else\n xf.apply_font = true\n xf_id = workbook.cell_xfs.size - 1\n end\n return xf_id\n end",
"title": ""
},
{
"docid": "5548118c317d9576e99fdf19a5f006c1",
"score": "0.62368065",
"text": "def modify_xf(workbook, xf)\n existing_xf_id = find_xf(workbook, xf)\n if !existing_xf_id.nil?\n xf_id = existing_xf_id\n else\n if workbook.cell_xfs[:xf].is_a?Array\n workbook.cell_xfs[:xf] << {:attributes=>xf}\n else\n workbook.cell_xfs[:xf] = [workbook.cell_xfs[:xf], {:attributes=>xf}]\n end\n xf[:applyFont] = '1'\n workbook.cell_xfs[:attributes][:count] += 1\n xf_id = workbook.cell_xfs[:xf].size - 1\n end\n return xf_id\n end",
"title": ""
},
{
"docid": "38252b8e3650141ac6d82082ae37e7da",
"score": "0.6043259",
"text": "def sheet_index(sheet)\n if sheet.is_a?(Fixnum)\n sheet\n else\n sheets.index(sheet)\n end\n end",
"title": ""
},
{
"docid": "294526e10596a397360080c1c02cf48f",
"score": "0.5953232",
"text": "def get_sheet_index()\n @sh_index\n end",
"title": ""
},
{
"docid": "4a9b489fadc1bea7339c985704590b63",
"score": "0.59188247",
"text": "def currentIndexFile\n return @indexFileStack[@indexFileStack.length - 1]\n end",
"title": ""
},
{
"docid": "4ebe46a03277eb82dff1b3bc131bcb6c",
"score": "0.5867724",
"text": "def numberRecord(row, col, xf_index, number)\n get_biff_data(0x0203, [ row, col, xf_index, number].pack('v3E'))\n end",
"title": ""
},
{
"docid": "234a84b75ed8d0491de4e338d12d7172",
"score": "0.5859061",
"text": "def get_index(sheet)\n @worksheets.index(sheet)\n end",
"title": ""
},
{
"docid": "a314cc4723e291ed67be366c55793348",
"score": "0.5827026",
"text": "def row_index; end",
"title": ""
},
{
"docid": "14cad33d7a49f3f97e8d18499d725b84",
"score": "0.58214426",
"text": "def idx\n @ob.get_idx\n end",
"title": ""
},
{
"docid": "32af2636ce2c3a4a26255f0d163229db",
"score": "0.58107483",
"text": "def get_sheet_index()\n @sh_index\nend",
"title": ""
},
{
"docid": "106410724170c3cf8687d100e2eada15",
"score": "0.5804293",
"text": "def row_tell\n @index\n end",
"title": ""
},
{
"docid": "7aeff0ee45b961760b1feafe6ca8bd81",
"score": "0.5800303",
"text": "def first_non_book_index\n @first_non_book_index ||= @data[80, 4].unpack('N*')[0]\n end",
"title": ""
},
{
"docid": "26fe9c32691e39c287695be5d9044b6b",
"score": "0.5772724",
"text": "def get_dxf_index\n if @dxf_index\n @dxf_index\n elsif @formats.dxf_index_by_key(get_format_key)\n @formats.dxf_index_by_key(get_format_key)\n else\n @dxf_index = @formats.set_dxf_index_by_key(get_format_key)\n end\n end",
"title": ""
},
{
"docid": "26fe9c32691e39c287695be5d9044b6b",
"score": "0.5772724",
"text": "def get_dxf_index\n if @dxf_index\n @dxf_index\n elsif @formats.dxf_index_by_key(get_format_key)\n @formats.dxf_index_by_key(get_format_key)\n else\n @dxf_index = @formats.set_dxf_index_by_key(get_format_key)\n end\n end",
"title": ""
},
{
"docid": "3f855a1f1ba77863dd8d1bc3f21e1689",
"score": "0.57648253",
"text": "def cell_index\n wbs.last\n end",
"title": ""
},
{
"docid": "4646d205d0f7a4f8f87f83cc74e81ca0",
"score": "0.57596546",
"text": "def first_image_index_record_number\n @first_image_index_record_number ||= @data[108, 4].unpack('N*')[0]\n end",
"title": ""
},
{
"docid": "2dcc4e40809e1e36e6163cfcda9be7ac",
"score": "0.57134473",
"text": "def offset_for_index(idx)\n @fp.seek(offset_table_offset + 4 * idx, IO::SEEK_SET)\n offset = @fp.read(4).unpack(\"N\").first\n if offset & 0x80000000 != 0\n @fp.seek(big_offset_table_offset + 8 * (offset & 0x7fffffff))\n offset = Support::EncodingUtils.network_to_host_64(@fp.read(8).unpack(\"Q\").first)\n end\n offset\n end",
"title": ""
},
{
"docid": "830f143ca7b399e424b574f91d3244ba",
"score": "0.5703009",
"text": "def fixed_index\n return nil if virtual?\n return nil unless @position\n if @position.is_a?(Fixnum)\n @position - 1\n elsif @position.is_a?(String)\n Column.pos_to_index(@position)\n end\n end",
"title": ""
},
{
"docid": "b2e332c2d0a9bdc19c669cfaaf56ed75",
"score": "0.56949747",
"text": "def index\n @raw_data[:FlightLegIndex].to_i\n end",
"title": ""
},
{
"docid": "b8ec3ccbaf1d65680e62260b0ebf2945",
"score": "0.5692696",
"text": "def first_savefile_index\n return 0\n end",
"title": ""
},
{
"docid": "82da286dc3db79ca903986b2f4d4923e",
"score": "0.567326",
"text": "def x_offset\n\t\t@data[4]\n\tend",
"title": ""
},
{
"docid": "c4d3eaddc0e2aa59172d049eeab507c6",
"score": "0.5652548",
"text": "def row_index\n return @row_index\n end",
"title": ""
},
{
"docid": "53d39e026ef1e7d9eb8a3b00de789f22",
"score": "0.561359",
"text": "def fbe_offset\n @_offset\n end",
"title": ""
},
{
"docid": "b2ead650fb701b2cfeb6968b96c7fe77",
"score": "0.5558852",
"text": "def at (ix) \n items = @all.filter { |item| item.index == ix.to_i }\n items[0]\n end",
"title": ""
},
{
"docid": "69e74f4ddc96a743317d148559a6692b",
"score": "0.55353",
"text": "def file_index_to\n \"file_idx_to_#{@hpk}\"\n end",
"title": ""
},
{
"docid": "08fed09ec9123631f71dc65548af016d",
"score": "0.55211115",
"text": "def bt_index; end",
"title": ""
},
{
"docid": "08fed09ec9123631f71dc65548af016d",
"score": "0.55211115",
"text": "def bt_index; end",
"title": ""
},
{
"docid": "5a3cd327895e9d3c4dfade0cd86bd792",
"score": "0.55160445",
"text": "def seach_column_index(field)\n i = 0\n while i < @sheet.column_size\n break if @sheet[0, i].value == field\n i += 1\n end\n i\n end",
"title": ""
},
{
"docid": "fe187459ff325333553a4f4c5879e484",
"score": "0.5491486",
"text": "def get_sheet_index(sheet_name)\n ruby_19 { sheet_name = convert_to_ascii_if_ascii(sheet_name) }\n\n # Handle utf8 sheetnames\n if is_utf8?(sheet_name)\n ruby_18 { sheet_name = utf8_to_16be(sheet_name) } ||\n ruby_19 { sheet_name = sheet_name.encode('UTF-16BE') }\n end\n\n if @ext_sheets[sheet_name].nil?\n raise \"Unknown sheet name '#{sheet_name}' in formula\\n\"\n else\n return @ext_sheets[sheet_name]\n end\n end",
"title": ""
},
{
"docid": "fb3bfe3deb5ae9decb23c72028731754",
"score": "0.5471955",
"text": "def r_xfext\n @serial = true\n\n result = { frtHeader: Unxls::Biff8::Structure.frtheader(@bytes.read(12)) }\n result.merge(Unxls::Biff8::Structure._xfext(@bytes))\n end",
"title": ""
},
{
"docid": "76f85a2164f0fa13aea4722e29d99046",
"score": "0.5448481",
"text": "def find_value(sheet, tag)\n row_index = 0\n sheet.each { |row| return row_index if row[0].include?(tag); row_index+=1 }\nend",
"title": ""
},
{
"docid": "824f090d48a2c2c665f82b734632e389",
"score": "0.5440483",
"text": "def get_file index\n return @files[index]\n end",
"title": ""
},
{
"docid": "efbf593c701627cc22d6563f11ceb5bf",
"score": "0.5431274",
"text": "def find_index_of_file\n match_to_this = @attachment_name\n\n @task.attachments.each do |a|\n index = @task.attachments.index(a)\n file_name = a.url.split('/').last\n\n @task.attachments.each do |f|\n @file_index = index if file_name == match_to_this\n end\n end\n end",
"title": ""
},
{
"docid": "aef9e997d5271237902524cb60864fcf",
"score": "0.54232264",
"text": "def sheet_index\n {tissue: 0,\n biofluids: 1,\n cell: 2}\n end",
"title": ""
},
{
"docid": "8dd9d8ba37cc93ab517a7d46137fccda",
"score": "0.54178023",
"text": "def get_index(arg_ix)\n ix = @ARGV[arg_ix]\n if ix and is_int?(ix) and @items.at(ix.to_i)\n return ix.to_i\n else \n puts \"Invalid item index: #{ix}\"\n return 0\n end\n end",
"title": ""
},
{
"docid": "a34f158e1d1c36988b0545dda2c9df5f",
"score": "0.5416115",
"text": "def xfId; end",
"title": ""
},
{
"docid": "a34f158e1d1c36988b0545dda2c9df5f",
"score": "0.5416115",
"text": "def xfId; end",
"title": ""
},
{
"docid": "c95414b8803531814929842ef01b07ad",
"score": "0.5408159",
"text": "def extract_sheet_at_index(tmpdir, idx)\n Roo::ZipFile.open(@filename) do |zip|\n Roo::ZipFile.open(@filename) do |zf|\n zf.entries.each do |entry|\n next unless entry.to_s.downcase =~ /sheet([#{idx+1}]+).xml$/\n file_name = \"roo_sheet#{idx}\"\n open(tmpdir+'/'+file_name,'wb') {|f| f << zip.read(entry) }\n return File.join(tmpdir, file_name)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6990d9ec4a71c54519a15f11afe99589",
"score": "0.5402551",
"text": "def row_index\n @row_index ||= \n RowIndex.new(:filename => filename_row_index)\n end",
"title": ""
},
{
"docid": "ee71c477c50adbbfec32be173d798aaf",
"score": "0.5402233",
"text": "def entry_num(x)\n if x < 1\n raise \"Invalid entry number!\"\n end\n if x > @list_of_positions.length()\n raise \"There are only #{@list_of_positions.length} entries\"\n end\n # 1-based\n x -= 1\n @current_iteration = x\n self.next()\n # we needed to handle the setting of current_iteration\n # Also next() takes care of setting the position, seeking and calling make_entry\n # Programming principle called \"Don't Repeat Yourself\" (DRY), leads to less bugs.\n # @filehandler.seek(@list_of_positions[x], IO::SEEK_SET)\n # make_entry()\n end",
"title": ""
},
{
"docid": "82c8d921c503d6d34a852b71ed6b9127",
"score": "0.53990734",
"text": "def ifindex\n sysfs(\"ifindex\").to_i\n end",
"title": ""
},
{
"docid": "d46a0d607383f49c36d1536dc76b0a0c",
"score": "0.53986824",
"text": "def cursor_index\n @cursor_index\n end",
"title": ""
},
{
"docid": "f5653a1e30a1b5b849e398000216a21b",
"score": "0.5385786",
"text": "def workitem_index(workitem)\n\n Ruote.extract_child_id(workitem['fei'])\n end",
"title": ""
},
{
"docid": "48084c77991d33be0210c3fbd1033dd5",
"score": "0.5378354",
"text": "def pos()\n @index\n end",
"title": ""
},
{
"docid": "48084c77991d33be0210c3fbd1033dd5",
"score": "0.5378354",
"text": "def pos()\n @index\n end",
"title": ""
},
{
"docid": "4dd63fca5f1586d49936fb00911be097",
"score": "0.53734004",
"text": "def x_offset\n data[:x_offset]\n end",
"title": ""
},
{
"docid": "7281176ce0a01e11aaecfbe5e89dbe7b",
"score": "0.53706646",
"text": "def excel_col_index\n str = split('').map(&:upcase).join('')\n offset = 'A'.ord - 1\n str.chars.inject(0) { |x, c| x * 26 + c.ord - offset }\n end",
"title": ""
},
{
"docid": "d8ccf2738f862d4626ced137cef97dd0",
"score": "0.5368921",
"text": "def index\n @ordinal\n end",
"title": ""
},
{
"docid": "3a107d9aa919053cf2a45320e91c0430",
"score": "0.53683525",
"text": "def find_index(column, row)\n\n base = nil\n case column\n when 3\n base = 0\n when 2\n base = 6\n when 1\n base = 12\n else\n return nil\n end\n\n index = nil\n case row\n when 2..4\n index = base + row - 2\n when 6..8\n index = base + row - 3\n else\n return nil\n end\n\n return index\n\n end",
"title": ""
},
{
"docid": "672270d15598a8b3b0fb59a32b327707",
"score": "0.53662705",
"text": "def row_seek(n)\n ret = @index\n @index = n\n ret\n end",
"title": ""
},
{
"docid": "672270d15598a8b3b0fb59a32b327707",
"score": "0.53662705",
"text": "def row_seek(n)\n ret = @index\n @index = n\n ret\n end",
"title": ""
},
{
"docid": "a35d06b1066d03183b9225a6c661d290",
"score": "0.5365382",
"text": "def findTableHeaderRow(worksheet)\n worksheet.each_with_index {|row, index|\n begin\n if row[$indexHeaderMap[\"Lfd\"]].value.to_s.include? \"Lfd.\"\n return index\n end\n rescue NoMethodError\n end\n }\n puts \"ERROR: excelReader(Code: 0x02): no row with 'Lfd' at 16-th Cell\"\n return -1\n end",
"title": ""
},
{
"docid": "c5ff842b6aa50ca07dfc29d7e278a24c",
"score": "0.5340922",
"text": "def index\n @raw_data[:AirLegIndex].to_i\n end",
"title": ""
},
{
"docid": "e4b3dd6715f00c9c1f58323a73be3337",
"score": "0.53307843",
"text": "def index\n @worksheet.workbook.drawings.index(self)\n end",
"title": ""
},
{
"docid": "9bd46ce29704c70c4722414f92c21167",
"score": "0.5326552",
"text": "def get_sheet_index(sheetname) #:nodoc:\n sheet_count = @sheetnames.size\n sheet_index = nil\n\n sheetname.sub!(/^'/, '')\n sheetname.sub!(/'$/, '')\n\n ( 0 .. sheet_count - 1 ).each do |i|\n sheet_index = i if sheetname == @sheetnames[i]\n end\n\n sheet_index\n end",
"title": ""
},
{
"docid": "e4ab4484afc73c59c6ef8b1cac6a8927",
"score": "0.53236043",
"text": "def message_file_index\n find_index_for_flags(\"-F\", \"--file\")\nend",
"title": ""
},
{
"docid": "63864d9b0db94ddd02a3ff1e4c3679ea",
"score": "0.5314794",
"text": "def fileNum\n @Fd.to_i\n end",
"title": ""
},
{
"docid": "53070204598bbbd4cdf320959f7cebad",
"score": "0.5314615",
"text": "def field_tell\n @field_index\n end",
"title": ""
},
{
"docid": "e739b421332fffbe72afcb132ee1e0e2",
"score": "0.5309552",
"text": "def index\n @data[:index]\n end",
"title": ""
},
{
"docid": "0c7b626be45a50d19f5a42a777d4a7c4",
"score": "0.5309224",
"text": "def focussed_index\n @current_index # 2009-01-07 14:35 \n end",
"title": ""
},
{
"docid": "31f1ac8ac1f16ee2d6708519df93e6a5",
"score": "0.5304281",
"text": "def get_num_ffs\n @ff_no\n end",
"title": ""
},
{
"docid": "1fd87ba0ebe586540c3b8954d48ca3c9",
"score": "0.53037024",
"text": "def field_seek(n)\n ret = @field_index\n @field_index = n\n ret\n end",
"title": ""
},
{
"docid": "3582fb5a6c0ea4ea3525b50bff8d3d33",
"score": "0.53020793",
"text": "def get_file_by_index(path, i)\n Dir.entries(path)[2+i]\n end",
"title": ""
},
{
"docid": "7c4818b46d1a737e17960c4d3754a7ae",
"score": "0.52929896",
"text": "def index(value)\n # -1 means 'not found' in WxWidgets\n if value.kind_of?(String) && ( i = find_string(value, true) ) && i > -1\n return i\n end\n indices = (0 ... get_count).to_a\n return indices.find { | i | get_item_data(i) == value } \n end",
"title": ""
},
{
"docid": "37bddf46332db39b4df88dd24351513b",
"score": "0.52869695",
"text": "def xfRecord(xf, xftype='cell')\n\n font_xf_idx, fmt_str_xf_idx, alignment, borders, pattern, protection = xf\n prt = xftype == 'cell' ?\n (((protection.cell_locked & 0x01) << 0) |\n ((protection.formula_hidden & 0x01) << 1)) : 0xFFF5\n aln =\n ((alignment.horz & 0x07) << 0) |\n ((alignment.wrap & 0x01) << 3) |\n ((alignment.vert & 0x07) << 4)\n rot = alignment.rota\n txt =\n ((alignment.inde & 0x0F) << 0) |\n ((alignment.shri & 0x01) << 4) |\n ((alignment.merg & 0x01) << 5) |\n ((alignment.dire & 0x03) << 6)\n used_attr = xftype == 'cell' ? 0xF8 : 0xF4\n\n borders.left_colour = 0x00 if borders.left == Excel::Borders::NO_LINE\n borders.right_colour = 0x00 if borders.right == Excel::Borders::NO_LINE\n borders.top_colour = 0x00 if borders.top == Excel::Borders::NO_LINE\n borders.bottom_colour = 0x00 if borders.bottom == Excel::Borders::NO_LINE\n borders.diag_colour = 0x00 if borders.diag == Excel::Borders::NO_LINE\n \n brd1 =\n ((borders.left & 0x0F) << 0 ) |\n ((borders.right & 0x0F) << 4 ) |\n ((borders.top & 0x0F) << 8 ) |\n ((borders.bottom & 0x0F) << 12) |\n ((borders.left_colour & 0x7F) << 16) |\n ((borders.right_colour & 0x7F) << 23) |\n ((borders.need_diag1 & 0x01) << 30) |\n ((borders.need_diag2 & 0x01) << 31)\n brd2 = \n ((borders.top_colour & 0x7F) << 0 ) |\n ((borders.bottom_colour & 0x7F) << 7 ) |\n ((borders.diag_colour & 0x7F) << 14) |\n ((borders.diag & 0x0F) << 21) |\n ((pattern.pattern & 0x0F) << 26)\n pat =\n ((pattern.pattern_fore_colour & 0x7F) << 0 ) |\n ((pattern.pattern_back_colour & 0x7F) << 7 )\n get_biff_data( 0x00E0, [font_xf_idx, fmt_str_xf_idx, \n prt, aln, rot, txt, used_attr,\n brd1, brd2, pat].pack('vvvCCCCVVv') )\n end",
"title": ""
},
{
"docid": "e5b21f7db1c8279288c3dde3cd0e7aba",
"score": "0.528626",
"text": "def find_column(index_number)\n REVERSE_ROW_INDEX.each do |key,value|\n if index_number > value\n return (index_number-value)\n end\n end\n end",
"title": ""
},
{
"docid": "15eb449b430ae523bfeb8d3ea5ea188a",
"score": "0.5279889",
"text": "def get_nth_record(gff3_file, n)\n record = nil\n counter = 1\n gff3_file.records.each do |rec|\n if counter == n\n record = rec\n break\n end\n counter += 1\n end\n record\nend",
"title": ""
},
{
"docid": "280ea76d4fe4c37bf9d26917ab75f162",
"score": "0.5276071",
"text": "def focussed_index\n @current_index # 2009-01-07 14:35 \n end",
"title": ""
},
{
"docid": "4d6d0917e9dfe968bd62e6dfe4945054",
"score": "0.527432",
"text": "def to_i\n @index\n end",
"title": ""
},
{
"docid": "88ac98f5507dedbbf9f91eca18613f84",
"score": "0.52698886",
"text": "def nth_for(key, i)\n hsh, bin, file = location_for(key)\n offset, last_offset, count = @index[bin]\n\n i = (self.length_for(key) + i) if i < 1\n @files[file].nth_from(offset, i, hsh, key)\n end",
"title": ""
},
{
"docid": "c548905e7856aa19c24f633e46faf0f6",
"score": "0.52629995",
"text": "def first_index\n\t\t\t\toffset + 1\n\t\t\tend",
"title": ""
},
{
"docid": "15287a4e624d53273cd68f6d3cdf5244",
"score": "0.5260562",
"text": "def get_figure_index\n\t\t#get index of the figure\n\t\tif (@figure[0] >= 0 && @figure[0] <= 7) &&\n\t\t\t(@figure[1] >= 0 && @figure[1] <= 7)\n\t\t\tcase @figure[0]\n\t\t\t\twhen 0\n\t\t\t\t\t@figure_index = @figure[1]\n\t\t\t\twhen 1\n\t\t\t\t\t@figure_index = 8 + @figure[1]\n\t\t\t\twhen 2\n\t\t\t\t\t@figure_index = 16 + @figure[1]\n\t\t\t\twhen 3\n\t\t\t\t\t@figure_index = 24 + @figure[1]\n\t\t\t\twhen 4\n\t\t\t\t\t@figure_index = 32 + @figure[1]\n\t\t\t\twhen 5\n\t\t\t\t\t@figure_index = 40 + @figure[1]\n\t\t\t\twhen 6\n\t\t\t\t\t@figure_index = 48 + @figure[1]\n\t\t\t\twhen 7\n\t\t\t\t\t@figure_index = 56 + @figure[1]\n\t\t\tend\n\t\telse\n\t\t\treturn \"Wrong figure\"\n\t\tend\n\t\treturn @figure_index\n\tend",
"title": ""
},
{
"docid": "c15dfe6233649a295f9c226f5f56bd4f",
"score": "0.5260018",
"text": "def lttfindex\n end",
"title": ""
},
{
"docid": "36a207c2a23cfa44a955076ba3065712",
"score": "0.5259773",
"text": "def index_from(xml)\n key_index = xml.css('coreid')&.first\n return xml.attributes['index']&.value&.to_i unless key_index\n key_index.attributes['index'].value.to_i\n end",
"title": ""
},
{
"docid": "0250af7325cd870109c5565ee776b7ed",
"score": "0.5259343",
"text": "def get_first_row(wb)\r\n # Rows start at 0 in API, at 1 in Excel, so substract 1\r\n first_row = Integer(wb.getName('first_row').getRefersToFormula()) - 1\r\n first_row\r\n end",
"title": ""
},
{
"docid": "2f2be90ffb3ef7f3cef6a00ba1b386bd",
"score": "0.52558964",
"text": "def excel_column_letter\n Cell.excel_column_letter row.cells.index(self)\n end",
"title": ""
},
{
"docid": "2f2be90ffb3ef7f3cef6a00ba1b386bd",
"score": "0.52558964",
"text": "def excel_column_letter\n Cell.excel_column_letter row.cells.index(self)\n end",
"title": ""
},
{
"docid": "494798fbc465b40e005804e19d0cf485",
"score": "0.5252997",
"text": "def find_cell_offset(header_row, column_name)\n index = -1\n header_row.find do |cell|\n index += 1\n cell.value == column_name\n end\n index\nend",
"title": ""
},
{
"docid": "6d347bb40f9b1f595d8ba03fe278b6de",
"score": "0.5246983",
"text": "def column_number()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f42b1d1ffc6558ea264c9d6d68ffa963",
"score": "0.52444315",
"text": "def find_value(sheet, tag)\n row_index = 0\n sheet.each { |row| return row_index if row[0].include?(tag); row_index+=1 }\n end",
"title": ""
},
{
"docid": "58f626144b2d6d29c7a3f9d6a906a54d",
"score": "0.5243356",
"text": "def find_nth_file(basename, index = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "e22bc3a3cf99f46b22d57b0007bf3350",
"score": "0.5232189",
"text": "def field_at(index)\n end",
"title": ""
},
{
"docid": "61a8389f471aff22d02a0c231959c768",
"score": "0.52220654",
"text": "def first_item_number\n 1 + @offset\n end",
"title": ""
},
{
"docid": "61a8389f471aff22d02a0c231959c768",
"score": "0.52220654",
"text": "def first_item_number\n 1 + @offset\n end",
"title": ""
},
{
"docid": "61a8389f471aff22d02a0c231959c768",
"score": "0.52220654",
"text": "def first_item_number\n 1 + @offset\n end",
"title": ""
},
{
"docid": "f363d95f32f2f1e5d24695efa46111b5",
"score": "0.5221962",
"text": "def get_save_index\n @save_file\n end",
"title": ""
},
{
"docid": "6c5d1671666f411f44af06e8c43fffc1",
"score": "0.52151996",
"text": "def document_number(key)\n docnum = ferret_index.doc_number(key)\n # hits = ferret_index.search query_for_record(key)\n # return hits.hits.first.doc if hits.total_hits == 1\n raise \"cannot determine document number for record #{key}\" if docnum.nil?\n docnum\n end",
"title": ""
},
{
"docid": "aad83d3a316ef6f8d9c131f6cba66816",
"score": "0.52135617",
"text": "def index(test_entry)\r\n\t\t\t\ti = 0\r\n\t\t\t\tself.each do |doc|\r\n\t\t\t\t\tif entry == entry\r\n\t\t\t\t\t\tentry.recycle\r\n\t\t\t\t\t\treturn i + 1\r\n\t\t\t\t\tend\r\n\t\t\t\t\ti += 1\r\n\t\t\t\tend\r\n\t\t\t\tnil\r\n\t\t\tend",
"title": ""
},
{
"docid": "c9d5c3f084e2882cb5d77e1b8dc93197",
"score": "0.5208076",
"text": "def column_index identifier\n @columns.each_with_index {|c, i| return i if c.identifier == identifier }\n return nil\n end",
"title": ""
},
{
"docid": "4ce80608034bb36f278cccad86d6be46",
"score": "0.51970756",
"text": "def fax_number\n self.dig_for_string(\"officeSummary\", \"faxNumber\")\n end",
"title": ""
},
{
"docid": "0d09298889748ed335727b4a93d824b8",
"score": "0.5191883",
"text": "def line_number()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "b03c74e8cbfd36af8b74b600638995be",
"score": "0.5189094",
"text": "def field_index(field)\n fieldIndex(field.to_s)\n end",
"title": ""
},
{
"docid": "fd50c1be19bf044c0af48edd4a6bbd92",
"score": "0.5189047",
"text": "def mftRecToBytePos(recno)\n # Return start of mft if rec 0 (no point in the rest of this).\n return mftLoc if recno == 0\n\n # Find which fragment contains the target mft record.\n start = fragTable[0]; last_clusters = 0; target_cluster = recno * @bytesPerFileRec / @bytesPerCluster\n if (recno > @bytesPerCluster / @bytesPerFileRec) && (fragTable.size > 2)\n total_clusters = 0\n fragTable.each_slice(2) do |vcn, len|\n start = vcn # These are now absolute clusters, not offsets.\n total_clusters += len\n break if total_clusters > target_cluster\n last_clusters += len\n end\n # Toss if we haven't found the fragment.\n raise \"MIQ(NTFS::BootSect.mftRecToBytePos) Can't find MFT record #{recno} in data run.\\ntarget = #{target_cluster}\\ntbl = #{fragTable.inspect}\" if total_clusters < target_cluster\n end\n\n # Calculate offset in target cluster & final byte position.\n offset = (recno - (last_clusters * @bytesPerCluster / @bytesPerFileRec)) * @bytesPerFileRec\n start * @bytesPerCluster + offset\n end",
"title": ""
}
] |
96306e72225d53120f546d8f2fbe116b | Get the class of the join on arel | [
{
"docid": "f3a1359fa814d856f6ffaa0cd8672893",
"score": "0.7375827",
"text": "def arel_join\n case @join_type\n when :inner then ::Arel::Nodes::InnerJoin\n when :left then ::Arel::Nodes::OuterJoin\n when :right then ::Arel::Nodes::RightOuterJoin\n when :full then ::Arel::Nodes::FullOuterJoin\n else\n raise ArgumentError, <<-MSG.strip\n The '#{@join_type}' is not implemented as a join type.\n MSG\n end\n end",
"title": ""
}
] | [
{
"docid": "52301c52e689eaf89cfb13dd518c137d",
"score": "0.7909284",
"text": "def join_table\n assigned_to_klass.arel_table\n end",
"title": ""
},
{
"docid": "adabef8331687e2b2d733bae8838ebaa",
"score": "0.7568922",
"text": "def join_type; end",
"title": ""
},
{
"docid": "601d216f303785b16ab08f23dfb9ac7d",
"score": "0.74333435",
"text": "def join_class\n\t\tKlass.where( :kassociation_id => self.id).first\n\tend",
"title": ""
},
{
"docid": "9cf4958193a3bd7d007680a29c8a68ba",
"score": "0.7357483",
"text": "def arel_join\n case @join_type\n when :inner then ::Arel::Nodes::InnerJoin\n when :left then ::Arel::Nodes::OuterJoin\n when :right then ::Arel::Nodes::RightOuterJoin\n when :full then ::Arel::Nodes::FullOuterJoin\n else\n raise ArgumentError, <<-MSG.squish\n The '#{@join_type}' is not implemented as a join type.\n MSG\n end\n end",
"title": ""
},
{
"docid": "c39d9aa8ac6cc9d3ad0777ad6d59d6c2",
"score": "0.7049153",
"text": "def join_table\n if type == :has_and_belongs_to_many\n ar_association.join_table\n end\n end",
"title": ""
},
{
"docid": "2d42d516771824ece9d6cd715b0f6379",
"score": "0.6964675",
"text": "def join_type\n \"LEFT OUTER JOIN\"\n end",
"title": ""
},
{
"docid": "2d42d516771824ece9d6cd715b0f6379",
"score": "0.6964675",
"text": "def join_type\n \"LEFT OUTER JOIN\"\n end",
"title": ""
},
{
"docid": "2d42d516771824ece9d6cd715b0f6379",
"score": "0.6964675",
"text": "def join_type\n \"LEFT OUTER JOIN\"\n end",
"title": ""
},
{
"docid": "eeea86a2e801490632e4a58f0944d877",
"score": "0.68441385",
"text": "def of_class(klass)\n Join.new(self.symbol, InnerJoin, klass)\n end",
"title": ""
},
{
"docid": "0da07b82ccaf2eb639a24e98d6667124",
"score": "0.68363833",
"text": "def join_name\n\t\tself.name.tableize\n\tend",
"title": ""
},
{
"docid": "14fab2b179e73596a4a7130753695e00",
"score": "0.66199875",
"text": "def azure_ad_join_type\n return @azure_ad_join_type\n end",
"title": ""
},
{
"docid": "52b3b4cbb6a78c49b0ecbaf64bc9dae4",
"score": "0.6583437",
"text": "def join?\n [SQLTree::Token::JOIN, SQLTree::Token::LEFT, SQLTree::Token::RIGHT,\n SQLTree::Token::INNER, SQLTree::Token::OUTER, SQLTree::Token::NATURAL,\n SQLTree::Token::FULL].include?(self.class)\n end",
"title": ""
},
{
"docid": "fcd21f807f41968367d9e9ff6527cb3e",
"score": "0.65171176",
"text": "def create_join_class\n\t\tj_class = self.app.klasses.create( :name => join_class_name, :kassociation => self )\n\n\t\t[ self.source.name.downcase, self.target.name.downcase ].each { |n|\n\t\t\tjoin_class.kattributes.create( :name => n, :typus => \"references\" )\n\t\t}\n\n\t\tj_class\n\tend",
"title": ""
},
{
"docid": "9b236e26af75df8380e1061d8d5a2f07",
"score": "0.6465517",
"text": "def to_code_join\n\t\t[\n\t\t\t\"class #{join_class_name} < ActiveRecord::Base\",\n\t\t\t[\n\t\t\t\t\"belongs_to :\" + self.source.name.downcase,\n\t\t\t\t\"belongs_to :\" + self.target.name.downcase\n\t\t\t],\n\t\t\t\"end\"\n\t\t]\n\tend",
"title": ""
},
{
"docid": "4406945da26cfde473783fb2655b70e2",
"score": "0.6382077",
"text": "def arel(*path)\n klass = self\n path.inject(arel_table) do |relation, segment|\n reflection = klass.reflect_on_association(segment.to_sym)\n raise Filterkit::UnknownProperty, \"#{klass.name} has no association named #{segment}.\" unless reflection\n if reflection.through_reflection\n reflections = [reflection.source_reflection]\n while reflection = reflection.through_reflection\n reflections.unshift(reflection)\n end\n else\n reflections = [reflection]\n end\n reflections.inject(relation) do |relation, reflection|\n type_constraint = nil\n case reflection.macro\n when :belongs_to\n raise 'cannot join polymorphic belongs_to associations' if reflection.options[:polymorphic]\n local_key = klass.arel_table[reflection.primary_key_name]\n other_key = reflection.klass.arel_table[reflection.options[:primary_key] || reflection.klass.primary_key]\n when :has_and_belongs_to_many\n join_table = Arel::Table.new(reflection.options[:join_table], :engine => arel_engine)\n relation = relation.outer_join(join_table).on(\n klass.arel_table[klass.primary_key].eq(join_table[reflection.primary_key_name]))\n local_key = join_table[reflection.association_foreign_key]\n other_key = reflection.klass.arel_table[reflection.klass.primary_key]\n else\n local_key = klass.arel_table[reflection.options[:primary_key] || klass.primary_key]\n if poly_prefix = reflection.options[:as]\n other_key = reflection.klass.arel_table[\"#{poly_prefix}_id\"]\n type_constraint = reflection.klass.arel_table[\"#{poly_prefix}_type\"].eq(klass.base_class.name)\n else\n other_key = reflection.klass.arel_table[reflection.primary_key_name]\n end\n end\n klass = reflection.klass\n join_condition = local_key.eq(other_key)\n join_condition = join_condition.and(type_constraint) if type_constraint\n relation.outer_join(reflection.klass.arel_table).on(join_condition)\n end\n end\n end",
"title": ""
},
{
"docid": "0480d4380bd0d687e4d912b09de87913",
"score": "0.6363488",
"text": "def sequel_associated_class(relation)\n begin\n relation.associated_class\n rescue NameError => error\n if Object.const_defined?(relation[:class_name].to_s.classify)\n relation[:class_name].to_s.classify.constantize\n else\n nil\n end\n end\n end",
"title": ""
},
{
"docid": "1d6e296e8af0aec742e7d486a6136512",
"score": "0.6362233",
"text": "def get_join_sql_mariadb\n case through_relation.join_type\n when ::Schema::Mapping::Relation::JOIN_TYPE::LEFT\n return \"LEFT JOIN\"\n when ::Schema::Mapping::Relation::JOIN_TYPE::FULL\n return \"JOIN\"\n else\n raise StandardError.new(\"Unknown join type in relation #{through_relation.join_type}\")\n end\n end",
"title": ""
},
{
"docid": "421588e0b02dc570e22c719bcefc597f",
"score": "0.63201267",
"text": "def relationship_type\n @_java_rel.getType.name.to_sym\n end",
"title": ""
},
{
"docid": "23b0c3ddd6eb5baf94479904818e32c8",
"score": "0.62501395",
"text": "def klass_to_include(relation_name)\n \"#{self}/#{relation_name}\".classify.constantize\n end",
"title": ""
},
{
"docid": "1d486fab03389b9e26ee3f36a4e34ec3",
"score": "0.6236935",
"text": "def klass_to_include(relation_name)\n \"#{self}/#{relation_name}\".classify.constantize\n end",
"title": ""
},
{
"docid": "a7ceebbf4e1ba534af1f4bad46b60a3f",
"score": "0.61421",
"text": "def _arel(associations = [])\n if _on\n _join.new(_table, Arel::Nodes::On.new(_on))\n elsif associations.any?(&:needs_polyamorous?)\n Join.new(associations)\n elsif associations.any?\n associations.reverse.inject({}) do |names, assoc|\n { assoc._reflection.name => names }\n end\n end\n end",
"title": ""
},
{
"docid": "ac814699bf57f0765101888beadeae21",
"score": "0.6131414",
"text": "def target_name\n @arel.table_name\n end",
"title": ""
},
{
"docid": "d6a2e0ffe37aade98627cc63c9946341",
"score": "0.61284995",
"text": "def join_table\n @join_table ||= common_query.join_table\n end",
"title": ""
},
{
"docid": "313ecffb03be2591258068fae65fb1a4",
"score": "0.6099876",
"text": "def join_type_sql(join_type)\n \"#{join_type.to_s.gsub('_', ' ').upcase} JOIN\"\n end",
"title": ""
},
{
"docid": "313ecffb03be2591258068fae65fb1a4",
"score": "0.6099876",
"text": "def join_type_sql(join_type)\n \"#{join_type.to_s.gsub('_', ' ').upcase} JOIN\"\n end",
"title": ""
},
{
"docid": "ee395eaadfe87b28a2044421a1684d85",
"score": "0.6085419",
"text": "def _addJoin ( type, *tables )\n @string = nil\n join = _getBasicClass BasicJoin, type, *tables\n @attr_joins ||= [ ]\n @attr_joins.push join\n return join\n end",
"title": ""
},
{
"docid": "cc60f5e859c619c87f3d2e2189155b88",
"score": "0.6065818",
"text": "def join_to_with_custom(relation)\n case reflection.source_macro\n when :has_one_custom, :has_many_custom\n Array.wrap(reflection.options[:joins]).each do |join|\n\t next if join.blank? or ! join.is_a?(String)\n\t if join !~ /^\\s*(?:(?:LEFT|RIGHT|INNER|OUTER|STRAIGHT)\\s+)+JOIN\\s+/ism\n\t join = \"#{join_type==Arel::OuterJoin ? 'LEFT OUTER' : 'INNER'} JOIN #{join}\"\n\t elsif join_type==Arel::OuterJoin\n\t join = join.sub(/^\\s*(?:LEFT\\s+)?INNER\\b/,'LEFT OUTER')\n\t end\n\t relation.join(Arel.sql(join))\n end\n end\n\t join_to_without_custom(relation)\n end",
"title": ""
},
{
"docid": "dfc5821b2314993a0238e39d906796ce",
"score": "0.6036788",
"text": "def joinable_by_class (klass=nil)\n return events if klass == Event\n return groups if klass == Group\n return projects if klass == Project\n return nil\n end",
"title": ""
},
{
"docid": "3b8da2861dd5807cc3c64b922dec87ce",
"score": "0.60338396",
"text": "def type(return_id = false)\n query, levels = self.class.cti_outer_join_sql(id)\n result = self.class.connection.execute(query).first\n # replace returned ids with the levels corresponding to their classes\n result_levels = result.inject({}) do |hash, (k,v)|\n hash[k] = levels[k] unless v.nil?\n hash\n end\n # find class with maximum level value\n foreign_key = result_levels.max_by { |k,v| v }.first\n class_name = DBViewCTI::Names.table_to_class_name(foreign_key[0..-4])\n if return_id\n id_ = result[foreign_key].to_i\n [class_name, id_]\n else\n class_name\n end\n end",
"title": ""
},
{
"docid": "5efa5cbbf5d51e175932bb00fcaa6702",
"score": "0.60334754",
"text": "def join_type_sql(join_type)\n case join_type\n when :straight\n 'STRAIGHT_JOIN'\n when :natural_inner\n Sequel::Deprecation.deprecate(\":natural_inner join type being converted to NATURAL LEFT JOIN on MySQL\", \"Use :natural_left join type for NATURAL LEFT JOIN, or :natural join type for NATURAL JOIN\")\n 'NATURAL LEFT JOIN'\n else\n super\n end\n end",
"title": ""
},
{
"docid": "024e63d91f777d5d7369e692c45de0e2",
"score": "0.60098976",
"text": "def join_clause_sql(jc)\n table = jc.table\n table_alias = jc.table_alias\n table_alias = nil if table == table_alias\n tref = table_ref(table)\n \" #{join_type_sql(jc.join_type)} #{table_alias ? as_sql(tref, table_alias) : tref}\"\n end",
"title": ""
},
{
"docid": "ac7bcd76f080be52bcdd4c7493e27fb2",
"score": "0.59191644",
"text": "def klass\n association.klass\n end",
"title": ""
},
{
"docid": "ac7bcd76f080be52bcdd4c7493e27fb2",
"score": "0.59191644",
"text": "def klass\n association.klass\n end",
"title": ""
},
{
"docid": "41e5e621178e279d9b00b85e19e001e5",
"score": "0.59069395",
"text": "def class_for assoc_name\n @model_class.association_reflection(assoc_name.to_sym)[:class_name].constantize\n end",
"title": ""
},
{
"docid": "c5185edd2a54e17eadf1d75bddbf1a73",
"score": "0.5891451",
"text": "def polymorphic_join_class(offset, index)\n _polymorphic_join_element_class(offset, index, @handler)\n end",
"title": ""
},
{
"docid": "566acc10b64b16e6a9f5bb96ceb92ea7",
"score": "0.5880355",
"text": "def associated_class\n innermost(context).to_s.singularize.classify.constantize\n end",
"title": ""
},
{
"docid": "d4a60bf5aa368f79c2bf0dcb03f138ea",
"score": "0.5868356",
"text": "def join_assoc\n if join_relation.associations.key?(through.assoc_name)\n join_relation.associations[through.assoc_name]\n else\n join_relation.associations[through.target]\n end\n end",
"title": ""
},
{
"docid": "15e82c2b415a799b1b308b0e6100e4f4",
"score": "0.58527756",
"text": "def class_for assoc_name\n @model_class.reflect_on_association(assoc_name.to_sym).klass\n end",
"title": ""
},
{
"docid": "76851e75d3e1064b485e76db908ef0e7",
"score": "0.58457834",
"text": "def relation_klass(relation)\n relation_reflect(relation).klass\n end",
"title": ""
},
{
"docid": "04fa9ca4334eaa5f7271c556367429ae",
"score": "0.58420134",
"text": "def klass\n class_name = @attributes[:class_name]\n association_name = @attributes[:association_name]\n class_name ? class_name.constantize : association_name.to_s.classify.constantize\n end",
"title": ""
},
{
"docid": "dba6e2becd2f4ba4f172f44f8741dca2",
"score": "0.5835397",
"text": "def relationship_type\n @internal_r.get_type.name.to_sym\n end",
"title": ""
},
{
"docid": "d6d913a04b50e12455de6bd331cfe8e1",
"score": "0.5833988",
"text": "def __join__(type, other, join_cond = EMPTY_HASH, opts = EMPTY_HASH, &block)\n if other.is_a?(Symbol) || other.is_a?(ROM::Relation::Name)\n if join_cond.equal?(EMPTY_HASH) && !block\n assoc = associations[other]\n assoc.join(type, self)\n elsif block\n __join__(type, other, JoinDSL.new(schema).(&block), opts)\n else\n new(dataset.__send__(type, other.to_sym, join_cond, opts, &block))\n end\n elsif other.is_a?(Sequel::SQL::AliasedExpression)\n new(dataset.__send__(type, other, join_cond, opts, &block))\n elsif other.respond_to?(:name) && other.name.is_a?(Relation::Name)\n if block\n join_cond = JoinDSL.new(schema).(&block)\n\n if other.name.aliaz\n join_opts = {table_alias: other.name.aliaz}\n else\n join_opts = EMPTY_HASH\n end\n\n new(dataset.__send__(type, other.name.dataset.to_sym, join_cond, join_opts))\n else\n associations[other.name.key].join(type, self, other)\n end\n else\n raise ArgumentError, \"+other+ must be either a symbol or a relation, #{other.class} given\"\n end\n end",
"title": ""
},
{
"docid": "32ca0e85ef09509a07fa517d59045fb4",
"score": "0.58208084",
"text": "def set_join_table(reflection, join_table_option = nil)\n reflection.options[:join_table] = !join_table_option.nil? ? join_table_option : \n join_table_name(model.send(:undecorated_table_name, model.to_s),\n model.send(:undecorated_table_name, reflection.class_name),\n model.send(:undecorated_table_name, reflection.qualifier_class_name))\n end",
"title": ""
},
{
"docid": "52a3e0781102c9e0d42705f9807915bd",
"score": "0.5819559",
"text": "def class\n to_model.class\n end",
"title": ""
},
{
"docid": "11ee7e9011a8b1b8f577a37d2f0ca10b",
"score": "0.5802948",
"text": "def derive_relationship_model(input)\n input.match(/(Class)?\\/([a-z\\-\\/\\_]+)$/)[-1].split('/').map{|i| ExtLib::Inflection.classify(i) }.join(\"::\")\n end",
"title": ""
},
{
"docid": "cc09a462686fe00a202bbc2b9178afb1",
"score": "0.57948387",
"text": "def klass\n _association&.klass\n end",
"title": ""
},
{
"docid": "32f51ebed3fd0c984660cfa847c2c490",
"score": "0.5788133",
"text": "def class_name\n klass = self.table.model\n if through = @options[:through]\n through = [through] unless through.is_a? Array\n for ref in through\n klass = klass.reflections[ref].class_name.constantize\n end\n end\n return klass.name\n end",
"title": ""
},
{
"docid": "71bc47065781423edb61f9eaf0607c88",
"score": "0.5785776",
"text": "def associated_model_class(assoc)\n framework.model_class(associated_class(assoc))\n end",
"title": ""
},
{
"docid": "384c184618804368751ac4c6532a64a2",
"score": "0.5780565",
"text": "def from_to_class\n\t\t[\n\t\t\t\"class #{from.name} < ActiveRecord::Base\",\n\t\t\t\"\\thas_many :\" + join_name,\n\t\t\t\"\\thas_many :\" + to.name.downcase.pluralize + \" :through => \" + join_name,\n\t\t\t\"end\"\n\t\t].reduce( \"\") { |sum,v| sum + \"\\n\" + v }\n\tend",
"title": ""
},
{
"docid": "0ef3266d35f08b3f3cc26589de6951b1",
"score": "0.5775886",
"text": "def cti_inner_join_sql(id, target_class)\n if @cti_inner_join_query && @cti_inner_join_query[target_class]\n return @cti_inner_join_query[target_class] + \"#{id if id}\"\n end\n return nil if !@cti_ascendants.include?(target_class)\n query = \"SELECT #{DBViewCTI::Names.table_name(target_class)}.id AS #{DBViewCTI::Names.foreign_key(target_class)}\" +\n \"\\nFROM #{DBViewCTI::Names.table_name(self)}\"\n base_class = self\n @cti_ascendants ||= []\n @cti_ascendants.reverse.each do |ascendant|\n query += \"\\nINNER JOIN #{DBViewCTI::Names.table_name(ascendant)} \" +\n \"ON #{DBViewCTI::Names.table_name(base_class)}.#{DBViewCTI::Names.foreign_key(ascendant)} = \" +\n \"#{DBViewCTI::Names.table_name(ascendant)}.id\"\n break if ascendant == target_class\n base_class = ascendant\n end\n query += \"\\nWHERE #{DBViewCTI::Names.table_name(self)}.id = \"\n @cti_inner_join_query ||= {}\n @cti_inner_join_query[target_class] = query\n query + \"#{id if id}\"\n end",
"title": ""
},
{
"docid": "623fa29cb275aafb2af984620ff89f58",
"score": "0.57570124",
"text": "def join_rule\n get_state('m.room.join_rules')[:join_rule]&.to_sym\n end",
"title": ""
},
{
"docid": "80ba0f1daab22e67c21efc3e5a386790",
"score": "0.57516867",
"text": "def link_class\n self.class.link_class\n end",
"title": ""
},
{
"docid": "38dd9d6a15cb0f2466231e5e8f1d027b",
"score": "0.57372123",
"text": "def belongs_to_class\n has_belongs_to? && fields[table_hash_key]['target_class']\n end",
"title": ""
},
{
"docid": "d5d977df2ec667471d501ab67cefe527",
"score": "0.57196504",
"text": "def relation_type\n\t\treturn if not @from_show_table\n\t\tsingularized_controller_name = controller_name.singularize.to_sym\n\t\tif r = show_class.new.rails_relation(singularized_controller_name)\n\t\t\treturn r\n\t\telse\n\t\t\tshow_class.new.rails_relation(controller_name)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "531409acc1d1bdd2006f9786efaae5b4",
"score": "0.5705931",
"text": "def default_join_table_name(opts)\n ([opts[:class_name].demodulize, name.demodulize]. \\\n map{|i| i.pluralize.underscore}.sort.join('_')).to_sym\n end",
"title": ""
},
{
"docid": "531409acc1d1bdd2006f9786efaae5b4",
"score": "0.5705931",
"text": "def default_join_table_name(opts)\n ([opts[:class_name].demodulize, name.demodulize]. \\\n map{|i| i.pluralize.underscore}.sort.join('_')).to_sym\n end",
"title": ""
},
{
"docid": "137ec8a6aa375256dadf85ffc50dccd9",
"score": "0.57029057",
"text": "def determine_operator_class\n\n if operator_for(:has_many) || operator_for(:belongs_to) || operator_for(:has_one)\n\n result = klass.reflect_on_association(operator)\n\n return result.klass if result\n\n result = MapperUtils.class_from_string(operator.classify)\n\n if result.nil?\n begin\n\n first = klass.to_s.split('::').first\n logger.debug \"Trying to find operator class with Parent Namespace #{first}\"\n\n result = MapperUtils.const_get_from_string(\"#{first}::#{operator.classify}\")\n rescue => e\n logger.error(\"Failed to derive Class for #{operator} (#{@operator_type} - #{e.inspect}\")\n end\n end\n\n result\n\n elsif @col_type\n begin\n Kernel.const_get(@col_type.type.to_s.classify)\n rescue\n nil\n end\n end\n end",
"title": ""
},
{
"docid": "0b004cc2ac1d91482c296c813f4897ea",
"score": "0.57025266",
"text": "def arel_attribute\n target && target.arel_table[:id, arel_table]\n end",
"title": ""
},
{
"docid": "ca88abb52725eda0246e695b4ac04669",
"score": "0.5701254",
"text": "def join(table, type: nil)\n @sql += \" #{type.upcase}\" unless type.nil?\n @sql += \" JOIN #{table}\"\n\n self\n end",
"title": ""
},
{
"docid": "9515e32e17c7d9b86e7097ce997fdbf4",
"score": "0.57001615",
"text": "def class_for(other)\n case other\n when ActiveRecord::Base\n other.class\n when ActiveRecord::Relation\n other.klass\n else\n other\n end\n end",
"title": ""
},
{
"docid": "6c52671f0aecd83ae3dc59df46eda32b",
"score": "0.5696853",
"text": "def class_for assoc_name\n @model_class.send(assoc_name).model\n end",
"title": ""
},
{
"docid": "a44fe5405e9aa99aae5fa869e2624252",
"score": "0.5694003",
"text": "def join_type_sql(join_type)\n case join_type\n when :cross_apply\n 'CROSS APPLY'\n when :outer_apply\n 'OUTER APPLY'\n else\n super\n end\n end",
"title": ""
},
{
"docid": "37c41ead8e32491f88f0f8cefffed687",
"score": "0.56784695",
"text": "def linked_class\n self['linkedClass']\n end",
"title": ""
},
{
"docid": "afa108d8265160c437a53e44c0608832",
"score": "0.5675613",
"text": "def primary_arel_table\n primary.arel_table\n end",
"title": ""
},
{
"docid": "de069bf00dd95b85b7deb88e0ceef6f9",
"score": "0.5655753",
"text": "def association_key_name\n reflection.join_primary_key(klass)\n end",
"title": ""
},
{
"docid": "81fb992f67873cd0b2d6e86d468186c0",
"score": "0.5650744",
"text": "def join(what, **options)\n what = what.to_s\n if what.plural?\n raise NameError, \"`joins` takes a singular association name (not '#{what}')\"\n end\n add_association(\n type: __method__,\n collection: options.fetch(:collection, what).to_s.pluralize,\n foreign_key: options.fetch(:foreign_key, :_id),\n local_key: options.fetch(:local_key, :\"#{what}_id\"),\n local_attr: what.to_sym,\n owner: false\n )\n end",
"title": ""
},
{
"docid": "c452683b053fa00fda92c8186ed327e5",
"score": "0.56491387",
"text": "def klass\n dbi.reflect_on_association(name).klass\n end",
"title": ""
},
{
"docid": "fda2463627efe549145e70759401c1cc",
"score": "0.56488454",
"text": "def orm_class; end",
"title": ""
},
{
"docid": "1fc15c2f802ded1f4a45fd7cd00c2da8",
"score": "0.5636527",
"text": "def active_fedora_model\n self.class.to_s\n end",
"title": ""
},
{
"docid": "1fc15c2f802ded1f4a45fd7cd00c2da8",
"score": "0.5636527",
"text": "def active_fedora_model\n self.class.to_s\n end",
"title": ""
},
{
"docid": "f2c054a5f728f0a04e01156066975da8",
"score": "0.5632584",
"text": "def active_record_class\n record_type.constantize\n end",
"title": ""
},
{
"docid": "f2c054a5f728f0a04e01156066975da8",
"score": "0.5632584",
"text": "def active_record_class\n record_type.constantize\n end",
"title": ""
},
{
"docid": "a509679210a9af1f33a56d6fb19e0c1f",
"score": "0.5630067",
"text": "def to_to_class\n\t\t[\n\t\t\t\"class #{to.name} < ActiveRecord::Base\",\n\t\t\t\"\\thas_many :\" + join_name,\n\t\t\t\"\\thas_many :\" + from.name.downcase.pluralize + \" :through => \" + join_name,\n\t\t\t\"end\"\n\t\t].reduce( \"\") { |sum,v| sum + \"\\n\" + v }\n\tend",
"title": ""
},
{
"docid": "eca972588dba98f35c32ef967d9bf0bd",
"score": "0.5627881",
"text": "def get_join_condition_sql\n join_sql = through_relation.join_condition\n join_sql = ::Rbt::Util::Template.replace_table_name_with_id(join_sql, @from_node.model.table_name, @from_node.id)\n join_sql = ::Rbt::Util::Template.replace_table_name_with_id(join_sql, @to_node.model.table_name, @to_node.id)\n return join_sql\n end",
"title": ""
},
{
"docid": "1d16b6444143671a30701a82cab3b279",
"score": "0.5627111",
"text": "def relationship_type\n get_type.name.to_sym\n end",
"title": ""
},
{
"docid": "5d62c6b88a05ba7ad93ada89e74ffaf1",
"score": "0.56268686",
"text": "def assigned_to_klass\n @assigned_to_klass ||= common_query.assigned_to_klass\n end",
"title": ""
},
{
"docid": "4b49c0d8b31e3f34e6d3ea38f3f0ac6f",
"score": "0.56257236",
"text": "def resolve_target\n # Use the link_field name first\n klass = @link_field.singularize.camelize\n return \"SugarCRM::#{klass}\".constantize if SugarCRM.const_defined? klass\n\n # Use the link_field attribute \"module\"\n if @attributes[\"module\"].length > 0\n module_name = SugarCRM::Module.find(@attributes[\"module\"])\n return \"SugarCRM::#{module_name.klass}\".constantize if SugarCRM.const_defined? module_name.klass\n end\n # Use the link_field attribute \"relationship\"\n if @attributes[\"relationship\"].length > 0\n klass = humanized_link_name(@attributes[\"relationship\"]).singularize.camelize\n return \"SugarCRM::#{klass}\".constantize if SugarCRM.const_defined? klass\n end\n false\n end",
"title": ""
},
{
"docid": "8ccaf3c0bc1215cb3daf13fec3c3e0c9",
"score": "0.5620147",
"text": "def associated_klass_name\n @associated_klass_name ||=\n associated_abstract_model.to_s\n end",
"title": ""
},
{
"docid": "5d5bdb4b961bdad341240a738044a116",
"score": "0.56178087",
"text": "def active_fedora_model\n self.class.to_s\n end",
"title": ""
},
{
"docid": "19c1d9c4d6daf25f420b98bc4da48c3e",
"score": "0.56117165",
"text": "def azure_ad_join_type=(value)\n @azure_ad_join_type = value\n end",
"title": ""
},
{
"docid": "1706a278e45b53906aa46b23ddd28c02",
"score": "0.56058365",
"text": "def clase_llave_foranea(atr)\n r = asociacion_llave_foranea(atr)\n if r\n return r.class_name.constantize\n end\n return nil\n end",
"title": ""
},
{
"docid": "c20226f3a3f7d8e51e98e70344351485",
"score": "0.56022555",
"text": "def find_class\n if condition_attribute.klass != resource_class && condition_attribute.klass.primary_key == name.to_s\n condition_attribute.klass\n else\n assoc = condition_attribute.klass.reflect_on_all_associations.detect { |r| r.foreign_key.to_s == name.to_s }\n assoc.class_name.constantize if assoc\n end\n end",
"title": ""
},
{
"docid": "b5ba07da918e3d86853cc63fbed3a83d",
"score": "0.5598828",
"text": "def klass\n if relation\n definition.klass.reflections[relation].klass\n else\n definition.klass\n end\n end",
"title": ""
},
{
"docid": "b6c0f39082a3484a682cf2d93449625f",
"score": "0.5596937",
"text": "def find_class\n if condition_attribute.klass != resource_class && condition_attribute.klass.primary_key == name.to_s\n condition_attribute.klass\n elsif predicate_association\n predicate_association.klass\n end\n end",
"title": ""
},
{
"docid": "40b409be248d98c1cf0c7455eea018a1",
"score": "0.55929357",
"text": "def joins_for_collection\n [:collection]\n end",
"title": ""
},
{
"docid": "ff1c7abcae9a467f89831bd4637b5687",
"score": "0.55898345",
"text": "def get_to_class_name\n if (@active_record_association_reflection.class_name.respond_to? 'underscore')\n @active_record_association_reflection.class_name.pluralize.singularize.camelize\n else\n @active_record_association_reflection.class_name\n end\n end",
"title": ""
},
{
"docid": "e376fe3c3f61a914501d34499f2f58ac",
"score": "0.55785745",
"text": "def joins_for_collection; end",
"title": ""
},
{
"docid": "421c49d5bc86b3a24700df8682d198a1",
"score": "0.55770135",
"text": "def model_class\n\t\t\t self.klass.classify.constantize\n\t\t end",
"title": ""
},
{
"docid": "0f5461d7901a8086c3336e73e24c4351",
"score": "0.5569695",
"text": "def [](key)\n case key\n when Class\n klass = key\n heading = key.get_heading\n table = key.connection.arel_table(heading)\n @joins[heading.name] ||= Join.new(make_join_id, @klass, @heading, @table, klass, heading, table)\n else\n if @simple_associations.include?(key)\n heading = @klass.get_heading(key)\n table = @connection.arel_table(heading)\n @joins[heading.name] ||= Join.new(make_join_id, @klass, @heading, @table, key, heading, table)\n else\n @table[key]\n end\n end\n end",
"title": ""
},
{
"docid": "0f5461d7901a8086c3336e73e24c4351",
"score": "0.5569695",
"text": "def [](key)\n case key\n when Class\n klass = key\n heading = key.get_heading\n table = key.connection.arel_table(heading)\n @joins[heading.name] ||= Join.new(make_join_id, @klass, @heading, @table, klass, heading, table)\n else\n if @simple_associations.include?(key)\n heading = @klass.get_heading(key)\n table = @connection.arel_table(heading)\n @joins[heading.name] ||= Join.new(make_join_id, @klass, @heading, @table, key, heading, table)\n else\n @table[key]\n end\n end\n end",
"title": ""
},
{
"docid": "9d4d59daa7d474215daa98ad0710656c",
"score": "0.5560447",
"text": "def class_relation(relation)\n nil\n end",
"title": ""
},
{
"docid": "2571bae30ff7784641cdc338b330c6e7",
"score": "0.5555861",
"text": "def source_relation\n self.class.resource_class\n end",
"title": ""
},
{
"docid": "019a1653bc08ea1fb2761f9acab0699d",
"score": "0.55494636",
"text": "def operator_class_name\n @operator_class_name ||=\n if operator_for(:has_many) || operator_for(:belongs_to) || operator_for(:has_one)\n\n determine_operator_class.name\n\n elsif @col_type\n @col_type.type.to_s.classify\n else\n ''\n end\n\n @operator_class_name\n end",
"title": ""
},
{
"docid": "6a66b0d7cc092bd0711b88fbeec13eb8",
"score": "0.55470973",
"text": "def className\r\n self.class.to_s\r\n end",
"title": ""
},
{
"docid": "304821e4436ad84c70e41f42ec61f86c",
"score": "0.55467105",
"text": "def associated_class; end",
"title": ""
},
{
"docid": "51ad934fad6174eb1a217dec667b8146",
"score": "0.55453426",
"text": "def join_columns\n join_attributes + @join.map do |left, right|\n if right.is_a?(Symbol)\n project(left, base_table).eq(project(right))\n else\n project(left).eq(right)\n end\n end\n end",
"title": ""
},
{
"docid": "0783a535935498246f199aa81a1fcb5e",
"score": "0.55451864",
"text": "def association_klass\n model_instance = entity.model_klass.new\n association_name = name.remove('_id')\n\n model_instance.public_send(\"build_#{association_name}\").class\n end",
"title": ""
},
{
"docid": "755acc40b82103e4910e26370a273a60",
"score": "0.553885",
"text": "def show_class\n\t\t@from_show_table.classify.constantize if @from_show_table\n\tend",
"title": ""
},
{
"docid": "ce9599a5db1cdd69abc8cdf82aae147a",
"score": "0.55334985",
"text": "def resolve_target\n # Use the link_field name first\n klass = @link_field.singularize.camelize\n namespace = @owner.class.session.namespace_const\n return namespace.const_get(klass) if namespace.const_defined? klass\n # Use the link_field attribute \"module\"\n if @attributes[\"module\"].length > 0\n module_name = SugarCRM::Module.find(@attributes[\"module\"], @owner.class.session)\n return namespace.const_get(module_name.klass) if module_name && namespace.const_defined?(module_name.klass)\n end\n # Use the \"relationship\" target\n if @attributes[\"relationship\"].length > 0\n klass = @relationship[:target][:name].singularize.camelize\n return namespace.const_get(klass) if namespace.const_defined? klass\n end\n false\n end",
"title": ""
},
{
"docid": "27a6b7bab13ee221b70cd14433c94cfc",
"score": "0.55329573",
"text": "def associated_class\n if options[:class_name]\n options[:class_name].constantize\n else\n klass.relative_const_get(attribute.to_s.singularize.camelize)\n end\n end",
"title": ""
}
] |
86bc07ff29bdf8240d9a3d14f7e2da58 | generate edit link with icon | [
{
"docid": "7d39dfdfe5f0ef0328661278cf5c310c",
"score": "0.8052878",
"text": "def link_to_edit(path)\n link_to image_tag('icons/001_45.png',\n :size => ICON_SIZE,\n :alt => 'Edit'), path\n end",
"title": ""
}
] | [
{
"docid": "1ee0772850e03f5b79bce08d8cbcae2f",
"score": "0.7980728",
"text": "def edit_button\n 'Edit <i class=\"icon-edit icon-white\"></i>'.html_safe\n end",
"title": ""
},
{
"docid": "b364b151f4f973debb000d5c8cfa04b1",
"score": "0.7898001",
"text": "def link_to_edit(path)\n link_to icon('edit'), path, title: 'Edit this record'\n end",
"title": ""
},
{
"docid": "72903269501623e986052fbc04c19e1c",
"score": "0.7432371",
"text": "def link_to_edit(objeto)\n link_to image_tag(\"icons/pencil.png\", :alt => \"editar objeto\"), \n edit_polymorphic_path(objeto), :title => \"Modificar objeto\"\n end",
"title": ""
},
{
"docid": "0186b407d5b7b1a12ba25208ab579fd5",
"score": "0.7254181",
"text": "def link_to_edit_with_text(resource, options = {})\n name = ('<i class=\"icon-pencil\"></i> '+t(:'gaku_helpers.edit')).html_safe\n attributes = {:class => \"span12 btn edit-link\"}.merge(options)\n link_to name, resource, attributes\n end",
"title": ""
},
{
"docid": "931a44f0099ec6620cce06998a6dc6c1",
"score": "0.7230003",
"text": "def edit_link(path)\n\t\tif user_signed_in? && current_user.editor?\n\t\t\tlink_to(\"<span class='glyphicon glyphicon-pencil'> Editar\".html_safe, path)\n\t\telse\t\n\t\t\t'<a data-toggle=\"modal\" data-target=\"#can-not-edit-modal\"> <span class=\"glyphicon glyphicon-pencil\"> Editar</a>'.html_safe\n\t\tend\n\tend",
"title": ""
},
{
"docid": "37525df2022e7def2857ce19bb1304ad",
"score": "0.7198492",
"text": "def lcr_edit\n @page_title = _('LCR_edit')\n @page_icon = \"edit.png\"\n end",
"title": ""
},
{
"docid": "8dfa7562c2e7cf1eeec94b0b64dc14d9",
"score": "0.70943916",
"text": "def link_to_edit(resource, options = {})\n name = (\"<i class='icon-white icon-edit'></i>\").html_safe\n attributes = {\n :class => \"mr-xs btn btn-mini btn-inverse edit-link\",\n }.merge(options)\n link_to name, resource, attributes\n end",
"title": ""
},
{
"docid": "4e40a696c3bec204025535a3f89906fa",
"score": "0.7064998",
"text": "def link_to_edit(path, *options)\n link_to path,\n class: \"btn btn-warning btn-sm\",\n title: \"Alterar\",\n style: \"color: #FFF; \" do\n content_tag :span, class: \"fa fa-pencil\" do\n options.first[:label] if options.present? && options.first[:label]\n end\n\n end\n end",
"title": ""
},
{
"docid": "897a659ac1cd5920dbdd4761cbec0bfb",
"score": "0.7064929",
"text": "def display_edit_link(entry)\n if entry.user == current_user\n link_to (image_tag 'edit.png'), edit_entry_path(entry)\n end\n end",
"title": ""
},
{
"docid": "897a659ac1cd5920dbdd4761cbec0bfb",
"score": "0.7064929",
"text": "def display_edit_link(entry)\n if entry.user == current_user\n link_to (image_tag 'edit.png'), edit_entry_path(entry)\n end\n end",
"title": ""
},
{
"docid": "4e842a979867cd2ba28cf3d6d60f19e6",
"score": "0.7028447",
"text": "def edit_control(**opt)\n icon_control(:edit, **opt)\n end",
"title": ""
},
{
"docid": "470724166eebee34025ae9c7d6a44d3d",
"score": "0.692438",
"text": "def link_action_edit(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.edit\"), 'pencil', path.is_a?(String) ? path : edit_polymorphic_path(path)\n end",
"title": ""
},
{
"docid": "470724166eebee34025ae9c7d6a44d3d",
"score": "0.692438",
"text": "def link_action_edit(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.edit\"), 'pencil', path.is_a?(String) ? path : edit_polymorphic_path(path)\n end",
"title": ""
},
{
"docid": "930f765381de831f6df5d8fd749c7fc3",
"score": "0.69192755",
"text": "def edit_link(obj, options = {})\n if policy(obj).edit?\n url = polymorphic_url([:edit] + Array(obj))\n action_link('Edit', url, 'pencil', options)\n end\n end",
"title": ""
},
{
"docid": "f3bf1368b3e3c5c9fbe1b8d0eb517612",
"score": "0.6876856",
"text": "def build_link(master_u)\n icon_edit = '<span class=\"glyphicon glyphicon-edit\"></span>'\n icon_show = '<span class=\"glyphicon glyphicon-info-sign\"></span>'\n link = link_to(raw(icon_show), master_u)\n link += link_to(raw(icon_edit), edit_master_unit_path(master_u))\n raw('<div class=\"datatable-actions\">'+link+'</div>')\n end",
"title": ""
},
{
"docid": "f2387890804cf65803e1b0acae121304",
"score": "0.6818644",
"text": "def edit_button\n if object.owner?(h.current_user.id)\n \"<span class=\\\"glyphicon glyphicon-pencil pull-right\\\"></span>\".html_safe\n end\n end",
"title": ""
},
{
"docid": "3a90db8f97d5e7373cc244fa0a9ba7ce",
"score": "0.67835265",
"text": "def edit_button(article)\n return \"\" if cannot?(:edit, article)\n html = <<-HTML\n <a class=\"btn\" href=\"#{edit_article_path(article)}\"><i class=\"icon-pencil\"></i></a>\n HTML\n html.html_safe\n end",
"title": ""
},
{
"docid": "8a5f492505825a526ae8157d43d152d4",
"score": "0.6772802",
"text": "def edit_button(target:, name: :EDIT.t, **args)\n # necessary if nil/empty string passed\n name = :EDIT.t if name.blank?\n path, identifier, icon, content = button_atts(:edit, target, args, name)\n\n html_options = {\n class: class_names(identifier, args[:class]), # usually also btn\n title: name, data: { toggle: \"tooltip\", placement: \"top\", title: name }\n }.merge(args.except(:class, :back))\n\n link_to(path, html_options) do\n [content, icon].safe_join\n end\n end",
"title": ""
},
{
"docid": "df0ace808bc9739eb88b241e78006af0",
"score": "0.66857934",
"text": "def content_edit_action_link(text, object)\n content_edit_action_item(link_to_remote_facebox(text, member_url([@tier, object], :edit), {:rel => \"nofollow\"}))\n end",
"title": ""
},
{
"docid": "96c1d98b14fc875e79fcfd77ada7f7e6",
"score": "0.6683028",
"text": "def edit_button_to(path, text = t('edit'))\n link_to path, class: 'button small warning' do\n concat text\n end\n end",
"title": ""
},
{
"docid": "b32649f328b539099c03100150ee63a5",
"score": "0.6677425",
"text": "def link_4edit #:nodoc:\n html = ''\n return html unless @opts[:edit_mode] > 1\n \n @opts[:editparams].merge!( { table: 'dc_big_menu', controller: 'cmsedit', action: 'edit' } )\n title = \"#{t('drgcms.edit')}: \"\n @opts[:editparams].merge!( { id: @menu.id, title: \"#{title}#{@menu.name}\" } ) if @menu\n title << t('helpers.label.dc_big_menu.tabletitle')\n @opts[:editparams].merge!( { action: 'index', title: title }) if @menu.nil?\n html << dc_link_for_edit( @opts[:editparams] )\nend",
"title": ""
},
{
"docid": "3d2db0b0842ba4f72905a44bd9c3dacd",
"score": "0.6607662",
"text": "def helper_app_btn_icon_edit_row\n \"btn glyphicon glyphicon-edit\"\n end",
"title": ""
},
{
"docid": "90828f818d7d244f610373b9ba44c1ae",
"score": "0.6536667",
"text": "def avatar_edit_link(user, options={})\n if Setting.gravatar_enabled?\n url = Redmine::Configuration['avatar_server_url']\n link_to avatar(user, {:title => l(:button_edit)}.merge(options)), url, :target => '_blank'\n end\n end",
"title": ""
},
{
"docid": "07896bf235f1b035f4dff275afd6d0bb",
"score": "0.6515269",
"text": "def help_icon(path)\n link_to('#help-modal', class: 'display-modal') do\n concat content_tag(:i, nil, class: 'eui-icon eui-fa-info-circle', data: { 'help-path': path, 'override-help': override_help })\n concat content_tag(:span, \"Help modal for #{title}\", class: 'is-invisible')\n end\n end",
"title": ""
},
{
"docid": "cdc03b565ff437894393872ef03f3fe2",
"score": "0.6508701",
"text": "def link_to_edit(path)\n link_to 'Edit', path, class: 'btn btn-default btn-xs'\n end",
"title": ""
},
{
"docid": "88356d2d5fb60859e228085040b1dc41",
"score": "0.6506355",
"text": "def crud_link_icon(action, options)\n action_str = action.to_s.downcase\n\n case true\n when %w(new create).include?(action_str) then bootstrap_icon = 'icon-plus'\n when %w(update edit).include?(action_str) then bootstrap_icon = 'icon-pencil'\n when %w(show view).include?(action_str) then bootstrap_icon = 'icon-eye-open'\n when %w(delete destroy).include?(action_str) then bootstrap_icon = 'icon-trash'\n when %w(back).include?(action_str) then bootstrap_icon = 'icon-chevron-left'\n else bootstrap_icon = ''\n end\n\n bootstrap_icon\n end",
"title": ""
},
{
"docid": "7aaffa080e14a3a9c8173a596110f11a",
"score": "0.6490384",
"text": "def edit\n resource.prepare_links\n\n super\n end",
"title": ""
},
{
"docid": "3f1604df17e676e9da05e9f6b44c7c12",
"score": "0.6487951",
"text": "def url_edit\n cname = self.class.classname.to_s.downcase\n return \"?show=#{cname}_edit&#{cname}_id=#{self.id}\"\n end",
"title": ""
},
{
"docid": "6448786d9ba4dff221faca820083a3d3",
"score": "0.6485223",
"text": "def view_edit_link(user, attraction)\n if user.admin\n content_tag(:p, link_to(\"Edit Attraction\", edit_attraction_path(attraction)))\n end\n end",
"title": ""
},
{
"docid": "3a9e3bb7d329d7bc895b2e2dbd0437b9",
"score": "0.64452124",
"text": "def github_edit_link\n source_file_path = current_page.file_descriptor.relative_path\n repo_slug = config[:site][:github][:repo_slug]\n branch = config[:site][:github][:branch]\n\n [GITHUB_URL, repo_slug, 'edit', branch, config[:source], source_file_path].join('/')\n end",
"title": ""
},
{
"docid": "40d9d43536c962c8082c27a7613b890e",
"score": "0.6436225",
"text": "def icon_link text, icon\n \"#{content_tag(:i, '', :class => \"#{icon}\")} #{text}\".html_safe\n end",
"title": ""
},
{
"docid": "a26d076e31b20cd5b7fa26e307e83c3c",
"score": "0.64139974",
"text": "def content_edit_action_item(text=nil, &block)\n icon = content_tag(:div, '', :class => 'iconEditSmall')\n content_action_item(text, icon, &block)\n end",
"title": ""
},
{
"docid": "e93ddb4cb1a203bf508319b3c50c95d1",
"score": "0.64039814",
"text": "def pencil\n h.octicon('pencil').html_safe\n end",
"title": ""
},
{
"docid": "750ba7284eb8b2676769931f9e8974c1",
"score": "0.63773495",
"text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end",
"title": ""
},
{
"docid": "750ba7284eb8b2676769931f9e8974c1",
"score": "0.63773495",
"text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end",
"title": ""
},
{
"docid": "adbd69d091ce044cdb365a3e6fdee439",
"score": "0.63620603",
"text": "def product_action_links(product)\n return %Q{\n #{link_to(image_tag('/images/livia_portal/icon_edit.gif',{:alt =>\"Edit\", :title=>\"Edit\", :border => 0, :hspace => \"0\"}), edit_product_path(:id=>product.id))}\n }\n end",
"title": ""
},
{
"docid": "42807a9289ed20ce8edd8990b0ca9a31",
"score": "0.6350966",
"text": "def build_edit_helper(resource)\n helper_name = \"edit_#{resource.name_prefix}#{resource.singular}#{@@link_helpers_suffix}\"\n return if already_defined?(helper_name)\n @module.module_eval <<-end_eval\n def #{helper_name}(*args)\n opts = args.extract_options!\n label = opts.delete(:label) || 'Edit'\n opts[:class] = ResourcefulViews.resourceful_classnames('#{resource.singular}', 'edit', *(opts.delete(:class) || '').split)\n opts[:sending] = opts.delete(:parameters) and ResourcefulViews.deprecation_warning('Please use :sending instead of :parameters') if opts[:parameters]\n args << opts.delete(:sending) if opts[:sending]\n link_to(label, edit_#{resource.name_prefix}#{resource.singular}_path(*args), opts)\n end\n end_eval\n end",
"title": ""
},
{
"docid": "07d63cfb6470c13bee5b4723ff729761",
"score": "0.6343867",
"text": "def edit_button(destination_path)\n # Consider using:\n # ActionDispatch::Routing::PolymorphicRoutes::edit_polymorphic_path(@object)\n @template.link_to I18n.t('form.edit'), destination_path,\n class: \"btn btn-primary\"\n end",
"title": ""
},
{
"docid": "a7efaa94be43935f1361c650b1c9dd2d",
"score": "0.6327509",
"text": "def icon_control(type, css: '.icon', **opt)\n opt[:path] ||= send(\"#{type}_path\")\n opt[:label] ||= symbol_icon(type)\n opt[:'aria-label'] ||= type.to_s.capitalize # TODO: I18n\n button_link(css: css, **opt)\n end",
"title": ""
},
{
"docid": "24b3a7616f8aefe5c12243618599d33d",
"score": "0.62654215",
"text": "def edit_post_link(obj)\n if logged_in? && (obj.creator == current_user || current_user.admin?)\n link_to edit_post_path(obj), title: 'Edit Post', :'data-toggle' => 'tooltip' do\n content_tag :small do\n content_tag :span, '', class: 'glyphicon glyphicon-pencil', :'aria-hidden' => true\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5a769bcbe3d4366b9cf9081ec223ba8b",
"score": "0.6175068",
"text": "def html(args = nil)\n if args and args[:edit]\n url = self.url_edit\n else\n url = self.url\n end\n\n return \"<a href=\\\"#{Knj::Web.ahref_parse(url)}\\\">#{self.name_html}</a>\"\n end",
"title": ""
},
{
"docid": "fed4d691431807771df391f60dd0b151",
"score": "0.617505",
"text": "def edit_link(resource, *args)\n link = ''.html_safe\n\n resource_name = normalized_resource_name(resource)\n object = determine_proper_resource(resource)\n options = args.first || {}\n\n # CSS classes for this crud link\n crud_link_css(options, 'edit')\n # text to be displayed\n link_text = crud_link_text(options, 'edit')\n\n # (optional) add a tooltip to the link\n if options.keys.include?(:tooltip)\n add_tooltip(options)\n end\n\n options[:id] = 'edit-' + link_id(object)\n options[:title] = 'Edit this ' + resource_name\n\n case true\n when defined? CanCan\n if resource.is_a?(Array)\n # check if we can access directly via a shallow route\n begin\n if url_for([:edit, object])\n link += link_to link_text, url_for([:edit, object]), options if can?(:edit, object)\n else\n link += link_to link_text, url_for(resource.unshift(:edit)), options if can?(:edit, object)\n end\n rescue Exception => e\n link += link_to link_text, url_for(resource.unshift(:edit)), options if can?(:edit, object)\n end\n else\n link += link_to link_text, url_for([:edit, resource]), options if can?(:edit, object)\n end\n else\n if resource.is_a?(Array)\n # check if we can access directly via a shallow route\n begin\n if url_for([:edit, object])\n link += link_to link_text, url_for([:edit, object]), options\n else\n link += link_to link_text, url_for(resource.unshift(:edit)), options\n end\n rescue Exception => e\n link += link_to link_text, url_for(resource.unshift(:edit)), options\n end\n else\n link += link_to link_text, url_for([:edit, resource]), options\n end\n end\n\n link\n end",
"title": ""
},
{
"docid": "9d0c3ae31da3d2621eab89f81298d2aa",
"score": "0.61572784",
"text": "def mokio_preview_link_in_edit_page\n self.path\n end",
"title": ""
},
{
"docid": "ccc94fff1c1e38a47b46eababd176d11",
"score": "0.61543226",
"text": "def link_to_edit_entry_template(page)\n url = admin_page_path page, entries: 1\n link_to 'Edit Entry Template', url, class: 'button'\n end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.6149889",
"text": "def edit; end",
"title": ""
},
{
"docid": "44b688a421b95afa91c2fea17631e592",
"score": "0.6127181",
"text": "def display_edit_link(blog)\n# is_blog_admin? ? \"|<a href='/manage/blogs/#{blog.id}/edit'>编辑</a>\" : ''\n end",
"title": ""
},
{
"docid": "066f964edfa75c43a3e2635b7bac15da",
"score": "0.6113359",
"text": "def render_plus_minus_icon(expanded, update, url)\n if expanded\n image = \"minus.gif\"\n alt = \"Collapse\"\n else\n image = \"plus.gif\"\n alt = \"Expand\"\n end\n link_to_remote(image_tag(image), :update => update, :url => url)\n end",
"title": ""
},
{
"docid": "58429599bf089b73bd26b22993ba20bc",
"score": "0.60797024",
"text": "def admin_icon(icon)\n icon = \"#{icon}.png\" unless icon.to_s.include?('.')\n tag(:img, nil, { :src => \"/images/admin_icons/#{icon}\", :class => 'icon' })\n end",
"title": ""
},
{
"docid": "a1d9a7102b371a513699cd2550660e12",
"score": "0.6069862",
"text": "def obfuscated_link_to(path, image, label, args={})\n _html = %{<form action=\"#{path}\" method=\"get\" class=\"obfuscated_link\">}\n _html << %{ <fieldset><input alt=\"#{label}\" src=\"#{image}\" type=\"image\" /></fieldset>}\n args.each{ |k,v| _html << %{ <div><input id=\"#{k.to_s}\" name=\"#{k}\" type=\"hidden\" value=\"#{v}\" /></div>} }\n _html << %{</form>}\n _html\n end",
"title": ""
},
{
"docid": "f0fe9ab73c2ac56e0c2b1f5a508203bf",
"score": "0.6065478",
"text": "def link_to_edit_index_template(page)\n url = admin_page_path page\n link_to 'Edit Index Tempate', url, class: 'button'\n end",
"title": ""
},
{
"docid": "ff444d9c886be8b46d267af13c95298f",
"score": "0.60513633",
"text": "def get_edit_user_link(user, link)\n link_to link do\n html = []\n if not user.google_avatar_url.blank?\n html << image_tag(\"#{user.google_avatar_url}?sz=30\", class: 'user-avatar')\n elsif user.email.present?\n html << image_tag(\"#{(request.ssl? ? 'https://secure' : 'http://www')}.gravatar.com/avatar/#{Digest::MD5.hexdigest user.email}?s=30\", alt: '', class: 'user-avatar')\n end\n\n if user.full_name.blank?\n html << content_tag(:span, user.email, class: 'user-name')\n else\n html << content_tag(:span, user.full_name, class: 'user-name')\n end\n html.join.html_safe\n end\n end",
"title": ""
},
{
"docid": "6cbba3439f95a37bd4aae838434af6de",
"score": "0.6039089",
"text": "def edit_address_button\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.button.className(create_ats_regex_string(\"ats-editbtn\")), format_method(__method__))\n end",
"title": ""
},
{
"docid": "c7e066a7f6f7d4b9c8169faca09cdc67",
"score": "0.60376894",
"text": "def iconify_auto_link(text, show_link = true)\n # this block is only executed when a link is inserted;\n # if we pass text containing no links, it just returns text.\n auto_link(html_escape(text)) do |value|\n \"<i class='glyphicon glyphicon-new-window'></i>#{(' ' + value) if show_link}<br />\"\n end\n end",
"title": ""
},
{
"docid": "fb990e051f9af10c46cc43cc0c8cba10",
"score": "0.60371023",
"text": "def edit_feedback_button(article, feedback)\n return \"\" if cannot?(:edit, feedback)\n html = <<-HTML\n <a class=\"btn\" href=\"#{edit_article_feedback_path(article.id, feedback.id)}\"><i class=\"icon-pencil\"></i></a>\n HTML\n html.html_safe\n end",
"title": ""
},
{
"docid": "4b21e037387fffa9bf63ec8f09d1acdf",
"score": "0.60292643",
"text": "def link_to_form(purpose, options = {}, html_options = nil)\n icon = case purpose\n when :new then 'add'\n when :edit then 'pencil'\n when :delete then 'cross' # TODO: delete should be a button, not a link\n when :cancel then 'arrow_undo'\n end\n if options.kind_of? String\n url = options\n else\n url = options.delete :url\n label = options.delete :label\n end\n label ||= purpose.to_s.capitalize\n legend = ( icon.nil? ?\n '' :\n \"<img src='/images/icons/#{icon}.png' alt=''></img> \" ) + label\n \n '<div class=\"buttons\">' +\n link_to(legend, (url || options), html_options) +\n '</div>'\n end",
"title": ""
},
{
"docid": "0c02a10154a39f9b10d831398345aa86",
"score": "0.6024157",
"text": "def action_col_edit(table, &block)\n action_col(table) do |e|\n path = action_path(e, &block)\n link_table_action('pencil', path.is_a?(String) ? path : edit_polymorphic_path(path))\n end\n end",
"title": ""
},
{
"docid": "0c02a10154a39f9b10d831398345aa86",
"score": "0.6024157",
"text": "def action_col_edit(table, &block)\n action_col(table) do |e|\n path = action_path(e, &block)\n link_table_action('pencil', path.is_a?(String) ? path : edit_polymorphic_path(path))\n end\n end",
"title": ""
},
{
"docid": "2d20bd74069eb6e2a0f8d829f88bc5ac",
"score": "0.60220146",
"text": "def parcel_content_type_icon(type)\n link_to image_tag(\"/images/content-type/\"+type+\".png\", :class => 'parcel-icon'), \"/files/type/\"+type\n end",
"title": ""
},
{
"docid": "d672d81281542f082fbb095bc15dc146",
"score": "0.60103387",
"text": "def link\n h.content_tag :li do\n h.link_to h.content_tag(:i, '' , class: object.icon ) , object.url , target: \"_blank\" , title: object.name\n end\n end",
"title": ""
},
{
"docid": "6960035b80756650c1e6d21d37e7900a",
"score": "0.60091615",
"text": "def icon=(val)\n @icon = \"http://www.google.com#{val}\"\n end",
"title": ""
},
{
"docid": "c3b85bbccf15c4dedf4e544db544c3b4",
"score": "0.6008604",
"text": "def link_to_edit(text, path, options={})\n unless path.is_a? String\n path = options.delete(:url) || edit_polymorphic_path(path)\n end\n link_to_action(text, path, options.reverse_merge(:action => :edit))\n end",
"title": ""
},
{
"docid": "777bd0eae2871f6c5e621288a67c9e33",
"score": "0.6002396",
"text": "def render_icon(icon)\n icon_map = {create: 'fas fa-add', update: 'fas fa-save', list: 'fas fa-list', show: 'fas fa-eye',\n hide: 'fas fa-eye-slash', delete: 'fas fa-trash', remove: 'fas fa-times', add: 'fas fa-add'}\n icon = icon.is_a?(String) ? icon : icon_map[icon]\n icon.nil? ? '' : '<span class=\"' + icon + '\"></span>'\n end",
"title": ""
},
{
"docid": "f48e51dd12e0bd6f97a7a48c8c72cd5c",
"score": "0.5981877",
"text": "def icon_button text, path, icon, params={}\n button = button_tag params do\n icon_link text, icon\n end\n end",
"title": ""
},
{
"docid": "f7dbbac9885dc956600c637aaa001dd5",
"score": "0.59543806",
"text": "def icon_url(icon)\n icon_set_url % icon\n end",
"title": ""
},
{
"docid": "27733aefe1728417f1937314344873df",
"score": "0.5950815",
"text": "def edit_button_table(model, link_args = {})\n link_args[:class] = 'btn-warning btn-xs' + (link_args[:class] || '')\n link_args[:additional_I18n] = 'short'\n action_button :edit, model, link_args\n end",
"title": ""
},
{
"docid": "f39ab1604e69cdf4200b1c988d1c5740",
"score": "0.5944731",
"text": "def link_markup(descr = nil)\n descr = \"View resource.\" if descr == nil\n\n link = @reference_action_def.doi\n link = @reference_action_def.link if link.empty?\n return \"<a href=\\\"#{link}\\\" target=\\\"_blank\\\">#{descr}</a>\"\n end",
"title": ""
},
{
"docid": "5cc2f8c53bd6f55ff95e9659f180d26a",
"score": "0.59444284",
"text": "def favouritable_icon(item, size=100)\n #the image_tag_for_key:\n html = avatar(item, size, true)\n\n html = link_to_draggable(html, show_resource_path(item), :id=>model_to_drag_id(item), :class=> \"asset\", :title=>tooltip_title_attrib(get_object_title(item)))\n html = \"<div class='favouritable_icon'>#{html}</div>\"\n return html\n end",
"title": ""
},
{
"docid": "93cc896280c3ee12deabf38785bef111",
"score": "0.59380364",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "c0a50c03da27d669e70613f0d249b68b",
"score": "0.5937177",
"text": "def edit_link(obj)\n \tcase obj.class.to_s\n \t when \"Tenant\"\n \t edit_tenant_path(obj)\n \t when \"Semester\"\n \t edit_semester_path(obj)\n \t when \"Department\"\n \t edit_department_path(obj)\n \t when \"Subject\"\n \t edit_subject_path(obj) \t \n \t when \"Faculty\"\n \t edit_faculty_path(obj)\n \t when \"Exam\"\n \t edit_exam_path(obj)\n \t when \"Batch\"\n \t edit_batch_path(obj) \t \t \t \n \t when \"SchoolType\"\n \t edit_school_type_path(obj) \t \n \t when \"Student\"\n \t edit_student_path(obj) \t \t\n \t when \"Section\"\n \t edit_section_path(obj)\n \t when \"BloodGroup\"\n \t edit_blood_group_path(obj)\n \t when \"Resource\"\n \t edit_resource_path(obj)\n \t when \"Role\"\n \t edit_role_path(obj) \t \t \t\n \t when \"UserProfile\"\n \t edit_user_profile_path(obj) \n \t when \"Grade\"\n \t edit_grade_path(obj) \t \t \t \t \t \t \n \t when nil\n \t nil\n end\n end",
"title": ""
},
{
"docid": "7b727a20ec6ffd9c00e80b9df9937c29",
"score": "0.59335124",
"text": "def link_with_icon(title, link, icon, type, link_options={})\n @icon = icon\n @type = type\n link_to(content_tag(:span, %{#{content_tag(:i, nil, :class => @icon)} #{title}}.html_safe, :class => @type), link, link_options)\n end",
"title": ""
},
{
"docid": "940f07133a037cb1e7fc57cb56d10c23",
"score": "0.59155226",
"text": "def render_help(title, id=nil, options = {})\n link_to(image_tag('buttons/help.gif', :size => '22x22'), '#', {:class => \"tooltip question-mark\", :title => title, :id => \"icon-#{id}\"}.merge(options))\n end",
"title": ""
},
{
"docid": "8bbc4549fabdbfa24074482c0165c826",
"score": "0.591228",
"text": "def render_link\n content_tag(:a, **integrated_slat_action_html_options) do\n if icon\n NfgUi::Components::Foundations::Icon.new({ traits: [icon], text: (block_given? ? yield : body), theme: theme }, view_context).render\n else\n (block_given? ? yield : body)\n end\n end\n end",
"title": ""
},
{
"docid": "bb91d8140a2ba382617fc8c01d4acc1a",
"score": "0.5908449",
"text": "def edit_personal_info_link\n # unit_test_no_generate: edit_personal_info_link, a.className(create_ats_regex_string(\"ats-editpersonalinfolnk\"))\n $tracer.trace(__method__)\n return ToolTag.new(a.className(create_ats_regex_string(\"ats-editpersonalinfolnk\")), __method__)\n end",
"title": ""
},
{
"docid": "dd34a2a2bb4e0e1ea832ed7c02d89267",
"score": "0.59022725",
"text": "def help_link(help_id)\n link_to(image_tag(\"iconic/lightbulb_20x32.png\", size: \"8x13\"), admin_help_path(help_id),{remote: true, title: \"Open help for this page.\"})\n end",
"title": ""
},
{
"docid": "cf536072c66440edaed6bc867e097023",
"score": "0.5899997",
"text": "def crud_link_text(options, action)\n action_str = action.to_s.downcase\n\n # match the action to an icon\n bootstrap_icon = crud_link_icon(action, options)\n\n if bootstrap_icon.present?\n icon = \"<i class='#{bootstrap_icon}'></i>\"\n else\n icon = ''\n end\n\n # default link text for common CRUD actions/aliases\n case true\n when %w(new create).include?(action_str) then default_link_text = 'Add'\n when %w(update edit).include?(action_str) then default_link_text = 'Edit'\n when %w(show view).include?(action_str) then default_link_text = 'View'\n when %w(delete destroy).include?(action_str) then default_link_text = 'Delete'\n when %w(back).include?(action_str) then default_link_text = 'Back'\n end\n\n # Use the options link_text value if it exists;\n # otherwise use our link_text determined by the action name\n if options.keys.include?(:link_text)\n link_text = \"#{icon} #{options[:link_text]}\".html_safe\n else\n link_text = \"#{icon} #{default_link_text}\".html_safe\n end\n\n link_text\n end",
"title": ""
},
{
"docid": "95d4ebfca53af8f8c308f105719ba653",
"score": "0.58978224",
"text": "def collectible_editpic_button decorator, size=nil, styling={}\n entity = decorator.object\n if policy(entity).update? \n if size.is_a? Hash\n size, options = nil, size\n end\n button = button_to_submit styling.delete(:label),\n polymorphic_path( [:editpic, decorator.as_base_class], styling: styling),\n 'glyph-upload',\n size,\n styling.merge(mode: :modal, title: 'Get Picture')\n # content_tag :div, button, class: 'upload-button glyph-button'\n end\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.5897707",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.5897707",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.5897707",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.5897707",
"text": "def edit\n end",
"title": ""
}
] |
e6c6c11c1bcd2c545681062fb31d8eaf | If either parameter julianyear or julianday was set, update the yield date using these parameter values. | [
{
"docid": "dc359611aa820768548d3eebc0021ade",
"score": "0.6676588",
"text": "def maybe_set_from_julian_date(params)\n\n # They can also enter the date in julian format, so if they do, overwrite\n # the other date field:\n if !(params[:julianyear].blank? and params[:julianday].blank?)\n params[:julianyear] = \"9999\" if params[:julianyear].blank? # year default\n params[:julianday] = \"1\" if params[:julianday].blank? # day default\n\n begin\n @yield.date = Date.ordinal(params[:julianyear].to_f, params[:julianday].to_f)\n rescue\n flash[:error] = \"Invalid values in Julian date fields were ignored\"\n end\n end\n\n end",
"title": ""
}
] | [
{
"docid": "b32551fa5af0e71c0ee01d0f976ba68b",
"score": "0.5764879",
"text": "def update\n @yield = Yield.all_limited(current_user).find(params[:id])\n\n set_default_date_fields(params)\n\n @yield.update_attributes(params[:yield])\n\n maybe_set_from_julian_date(params)\n\n if params['assign_creator']\n @yield.user_id = current_user.id\n end\n\n respond_to do |format|\n # This save is a no-op unless Julian date was set:\n if @yield.save\n flash[:notice] = 'Yield was successfully updated.'\n format.html { redirect_to(@yield) }\n format.xml { head :ok }\n format.csv { head :ok }\n else\n citation = @yield.citation\n @treatments = citation.treatments\n @sites = citation.sites\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @yield.errors, :status => :unprocessable_entity }\n format.csv { render :csv => @yield.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebf8af4376261b4c118feb4bbab794a7",
"score": "0.567713",
"text": "def set_default_date_fields(params)\n # If at least on of the date fields is non-blank, assign defaults to the others if they are blank:\n if !(params[:yield]['date(1i)'].blank? and params[:yield]['date(2i)'].blank? and params[:yield]['date(3i)'].blank?)\n\n # Default the empty fields. In Rails 3.2, it seems we must do this explicitly.\n params[:yield]['date(1i)'] = \"9999\" if params[:yield]['date(1i)'].blank? # year default\n params[:yield]['date(2i)'] = \"1\"if params[:yield]['date(2i)'].blank? # month default\n params[:yield]['date(3i)'] = \"1\"if params[:yield]['date(3i)'].blank? # day default\n\n end\n end",
"title": ""
},
{
"docid": "b049ada61a8e23d17738e89107ccf2e8",
"score": "0.5596425",
"text": "def reform_jd = @reform_jd ||= ::Date::GREGORIAN",
"title": ""
},
{
"docid": "e74e2ac8177d929496db4b902826ac33",
"score": "0.55652183",
"text": "def update_selector\n @date = Date.parse(params[:date]).next_day\n yield\n @date = Date.parse(params[:date]).strftime('%d-%^b-%Y') #=> '19-NOV-2007'\n @updated_after = true\n end",
"title": ""
},
{
"docid": "fc3cc752a02e02fe24a23d49b6ab28c2",
"score": "0.5438913",
"text": "def set_IntroducedDate(value)\n set_input(\"IntroducedDate\", value)\n end",
"title": ""
},
{
"docid": "2c8cd12a15513ff3436cc6556e8b7b9c",
"score": "0.53531843",
"text": "def set_date(params)\n begin\n if @driver.find_element(:class, 'business-date').displayed?\n date_text = @driver.find_element(:class, 'business-date').text\n date = Date.parse(date_text)\n end\n begin\n if params[0] == '+'\n if params.include? \"ignore-weekends\"\n date = add_business_days(date, params[1].to_i)\n else\n date += params[1].to_i\n end\n elsif params[0] == '-'\n if params.include? \"ignore-weekends\"\n date = subtract_business_days(date, params[1].to_i)\n else\n date -= params[1].to_i\n end\n end\n @date = date.strftime('%d/%m/%y')\n rescue => ex\n $results.fail(\"date #{params.join(' ')}\", ex)\n end\n rescue => ex\n $results.fail(\"date #{params.join(' ')}\", ex)\n end\n end",
"title": ""
},
{
"docid": "d9d0c68fb2d426cdaed0bea7156a6a38",
"score": "0.53515834",
"text": "def update_date\n end",
"title": ""
},
{
"docid": "301b76e5a9419df40f3b87393643f219",
"score": "0.51682943",
"text": "def update_date; end",
"title": ""
},
{
"docid": "b8162262c6b06b1c7f06f74c3ee12f6d",
"score": "0.51651716",
"text": "def date=(_arg0); end",
"title": ""
},
{
"docid": "4b5706274a0d06fc2953e07ccadc2162",
"score": "0.51605356",
"text": "def day=(value); end",
"title": ""
},
{
"docid": "97cf1a8f02edb4ec32b5a6d9311c9d31",
"score": "0.51577306",
"text": "def release_date=(rd = Time.now.utc)\n update_values([:release_date] => rd.utc.xmlschema)\n end",
"title": ""
},
{
"docid": "7eadb45599eea04d2abb230df5ac1f4d",
"score": "0.51573527",
"text": "def year=(value); end",
"title": ""
},
{
"docid": "4fba1c80ebd6ac0762d585bf34272c0f",
"score": "0.51563483",
"text": "def twenty_pct_release_date=(rd = Time.now.utc)\n update_values([:twenty_pct_release_date] => rd.beginning_of_day.utc.xmlschema)\n end",
"title": ""
},
{
"docid": "b9e12dca8c5521c262a405c56a025608",
"score": "0.5147883",
"text": "def set_DateUpdated(value)\n set_input(\"DateUpdated\", value)\n end",
"title": ""
},
{
"docid": "11755a64160ca148798f0a4003bc2bc3",
"score": "0.5140105",
"text": "def set_RequestedToDate(value)\n set_input(\"RequestedToDate\", value)\n end",
"title": ""
},
{
"docid": "11755a64160ca148798f0a4003bc2bc3",
"score": "0.51399595",
"text": "def set_RequestedToDate(value)\n set_input(\"RequestedToDate\", value)\n end",
"title": ""
},
{
"docid": "e42df82c6ffaccfd42cfaa60d5b940ae",
"score": "0.51324826",
"text": "def set_date\r\n @date = Date.today # an object that show today date for inserting values in json file\r\n end",
"title": ""
},
{
"docid": "1d1e73a597cc7f0a0bce2fcd29d87ea4",
"score": "0.512465",
"text": "def set_date(date)\n @date = date\n end",
"title": ""
},
{
"docid": "45a8bc0b01c28d61d1603645a847138f",
"score": "0.5096247",
"text": "def update_date\n entry = JournalEntry.find(params[:journal_entry][:id])\n entry.follow_up = params[:journal_entry][:follow_up]\n date_param = params[:journal_entry][:created]\n\n if date_param.blank?\n entry.save\n flash[:notice] = \"Opfølgning er rettet\"\n redirect_to journal_path(entry.journal)\n end\n\n sep = date_param.include?(\"/\") && \"/\" || date_param.include?(\"-\") && \"-\"\n d = date_param.split(sep).map {|p| p.to_i }\n date = [d[2],d[1],d[0]]\n answered = Date.new(*date)\n puts \"year: #{answered.year} #{date.inspect}, #{answered.inspect}\"\n if answered.year < 2000 || answered.year > 2150\n flash[:error] = \"Dato er ugyldig\"\n redirect_to edit_date_survey_answers_url(entry.id) and return\n end\n entry.update_date(answered)\n \n flash[:notice] = \"Besvarelsesdato og opfølgning er rettet\"\n redirect_to journal_path(entry.journal)\n end",
"title": ""
},
{
"docid": "6f75475278661db32fb8028ab4b82ac0",
"score": "0.5090728",
"text": "def update_due_date(year, month, day)\n @year = year\n @month = month\n @day = day\n @due_date = Date.new(@year, @month, @day)\n end",
"title": ""
},
{
"docid": "3bfbde6f4531d50923930c2663bfbebb",
"score": "0.50824076",
"text": "def setEndDate(year, month, day)\n selectByID(\"meeting_end_date_1i\", year)\n selectByID(\"meeting_end_date_2i\", month)\n selectByID(\"meeting_end_date_3i\", day)\n end",
"title": ""
},
{
"docid": "9bfe3bc5af73239ae1e55ace0efc6042",
"score": "0.5074548",
"text": "def set_advance_dates\n if pub_date_changed?\n earliest_book = self.work.books.order('pub_date ASC').first\n if self == earliest_book\n self.work.contract.advances.where(:trigger => \"On publication\").each do |advance|\n advance.update_column(:due_date, pub_date)\n end\n self.work.contract.advances.where(:trigger => \"1st January of the year of publication\").each do |advance|\n advance.update_column(:due_date, pub_date.beginning_of_year)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d6fd53592cdfaef38bbdaecf14cfb7dc",
"score": "0.5066337",
"text": "def set_TaggerDate(value)\n set_input(\"TaggerDate\", value)\n end",
"title": ""
},
{
"docid": "0dc610733130b5a957dd25f75271bcae",
"score": "0.50579315",
"text": "def setStartDate(year, month, day)\n selectByID(\"meeting_start_date_1i\", year)\n selectByID(\"meeting_start_date_2i\", month)\n selectByID(\"meeting_start_date_3i\", day)\n end",
"title": ""
},
{
"docid": "59a5a7ec373f04ca75d453dfb41ce6dd",
"score": "0.50572836",
"text": "def set_date(date = Time.now)\n\t\tdata = command(:write_special)\n\t\tdata << 0x3b.chr\n\t\tdata << date.strftime('%m%d%y')\n\t\tsend_command data\n\tend",
"title": ""
},
{
"docid": "90cae8f25b2d034aab62550e72a69770",
"score": "0.5057127",
"text": "def with_date\n param(:date => 1)\n end",
"title": ""
},
{
"docid": "d6b34200a44964007a368c51498bbc17",
"score": "0.50386673",
"text": "def date=(date)\n date = actual_date_for_release(date)\n write_attribute(:date, date)\n end",
"title": ""
},
{
"docid": "60933f55deb9b0917c2eee7cc582176f",
"score": "0.5033782",
"text": "def date_done=(updated_date_done)\r\n @date_done = updated_date_done\r\n end",
"title": ""
},
{
"docid": "919293216fe15c06b170c1aee468d8f8",
"score": "0.50123376",
"text": "def set_default_year_built\n self.yearBuilt = 1965 if self.yearBuilt.blank?\n end",
"title": ""
},
{
"docid": "da4e8c8ce860f0ebc89cc2fd60fd5def",
"score": "0.5007552",
"text": "def set_due_date (site)\n pages = site.config['morea_experience_pages'] + site.config['morea_reading_pages'] + site.config['morea_assessment_pages']\n pages.each do |page|\n if page.data['morea_start_date']\n if page.data['morea_labels'] == nil\n page.data['morea_labels'] = []\n end\n page.data['morea_labels'] << \"#{(Time.parse(page.data['morea_start_date'])).strftime(\"%d %b %I:%M %p\")}\"\n end\n end\n end",
"title": ""
},
{
"docid": "46dacd9ace0df5080d8ad9b0d7297b96",
"score": "0.50000775",
"text": "def set_date(date) \n @date = set_any_date(date)\n post_initialize\n end",
"title": ""
},
{
"docid": "be7015ac927b0b14881dc936264b4585",
"score": "0.4987653",
"text": "def force_year_description\n yd = getYearDescription\n yd.setDayofWeekforStartDay('Thursday')\n end",
"title": ""
},
{
"docid": "153ba208326d23b2f430306b62313429",
"score": "0.4984409",
"text": "def set_date\n unless self.date.present?\n self.date = Time.now.strftime('%Y %m')\n end\n end",
"title": ""
},
{
"docid": "191a461f89974fdb46ad67f06f11fd59",
"score": "0.49783492",
"text": "def set_pricing_date(date)\n\t@browser.frame(:name, \"content\").text_field(:id, 'txtDate').set date\nend",
"title": ""
},
{
"docid": "e0d16379f08606a59ba00cfeccd7ed33",
"score": "0.4972324",
"text": "def julian() new_start(self.class::JULIAN) end",
"title": ""
},
{
"docid": "00fc57ecf2e9c707317953b3acc29d1c",
"score": "0.4970632",
"text": "def set_dates(page)\n if @start_date.nil?\n @start_date=page.start_date(@full_name).value\n else\n page.start_date(@full_name).set @start_date\n end\n if @end_date.nil?\n @end_date=page.end_date(@full_name).value\n else\n page.end_date(@full_name).set @end_date\n end\n end",
"title": ""
},
{
"docid": "5a6aea3856f1231048a7efea29df8c8d",
"score": "0.4963403",
"text": "def hire_date=(value)\n @hire_date = value\n end",
"title": ""
},
{
"docid": "0180498965aa3895ae5450b17a224a28",
"score": "0.4954534",
"text": "def set_go_live_date(listing_time)\n [\n { id: 'jid_listing_time[ym]', symbol: :year_month },\n { id: 'jid_listing_time[d]', symbol: :day },\n { id: 'jid_listing_time[h]', symbol: :hour },\n { id: 'jid_listing_time[m]', symbol: :minute }\n ].each do | entry |\n @browser.select_list(:id, entry[:id]).select_value(listing_time[entry[:symbol]])\n end\n end",
"title": ""
},
{
"docid": "c34f9b0ffabfd87732bd33619fe94cc6",
"score": "0.49526912",
"text": "def init_indigit(now)\n year = now.strftime(\"%Y\")\n month = now.strftime(\"%m\").to_i \n if month.between? 1,5\n @indigit = year + SPRING_START_MONTH\n elsif month.between? 6,7\n @indigit = year + SUMMER_START_MONTH\n else\n @indigit = year + FALL_START_MONTH\n end\n end",
"title": ""
},
{
"docid": "106528cc742352a410e6531a62f66229",
"score": "0.49526668",
"text": "def nextDate \n\n end",
"title": ""
},
{
"docid": "5cde3717f00ee2094cf3c50fc3c801ff",
"score": "0.49490157",
"text": "def set_date\n unless params[:year].nil?\n date_string = \"#{params[:year]}-#{params[:month]}-#{params[:day]}\"\n @date = Time.parse(date_string)\n end\n end",
"title": ""
},
{
"docid": "b6c7d5cc189efae65292adf85ebe90e1",
"score": "0.49341604",
"text": "def set_current_year\n @current_year = Date.today.year\n end",
"title": ""
},
{
"docid": "8dc43417ce60963e06168bc4aab7e5e5",
"score": "0.49263355",
"text": "def spent_on=(date)\n super\n self.tyear = spent_on ? spent_on.year : nil\n self.tmonth = spent_on ? spent_on.month : nil\n self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil\n end",
"title": ""
},
{
"docid": "8dc43417ce60963e06168bc4aab7e5e5",
"score": "0.49263355",
"text": "def spent_on=(date)\n super\n self.tyear = spent_on ? spent_on.year : nil\n self.tmonth = spent_on ? spent_on.month : nil\n self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil\n end",
"title": ""
},
{
"docid": "1ef270eec4f7f8a56f702b5b11ad6b11",
"score": "0.4925953",
"text": "def set_date(date)\n time = @datetime_list[0].text.split(/[:\\+]/).first(3).map(&:to_i)\n @datetime = DateTime.new(date.year, date.month, date.day, *time) rescue DateTime.now\n @datetime += 1 if @datetime_list[0].operation == 'yesterday'\n end",
"title": ""
},
{
"docid": "e5b3fff9f0a85b6e48ac6620d1fb8a16",
"score": "0.49257353",
"text": "def update_year\n @year = @year.to_i if (@year.length == 4 && (@year.to_i >= 1900 && DateTime.new(@year.to_i, DateTime.now.month, DateTime.now.day, 24) <= DateTime.now.next_year.next_year))\n end",
"title": ""
},
{
"docid": "58fd50fc4a11f3b24718bf8e0a80c586",
"score": "0.4919012",
"text": "def user_date=(date)\n d,m,y = date.split(\"/\")\n if (d.nil? || m.nil? || y.nil?)\n self.date = DateTime.now()+1\n else\n self.date = DateTime.civil(y.to_i, m.to_i, d.to_i)\n end\n end",
"title": ""
},
{
"docid": "95cdee6f96415b8ec4d6a53803bd73b4",
"score": "0.49171528",
"text": "def set_due_date(month,day,year)\n @due_date = Date.new(year, month, day)\n end",
"title": ""
},
{
"docid": "637c85be368c8a114142613944a13d1f",
"score": "0.4913063",
"text": "def set_SetModifiedDate(value)\n set_input(\"SetModifiedDate\", value)\n end",
"title": ""
},
{
"docid": "102d415a4844f4c81c7b4f4cec1206c9",
"score": "0.48926663",
"text": "def update!(**args)\n @year = args[:year] if args.key?(:year)\n @month = args[:month] if args.key?(:month)\n @day = args[:day] if args.key?(:day)\n end",
"title": ""
},
{
"docid": "102d415a4844f4c81c7b4f4cec1206c9",
"score": "0.48926663",
"text": "def update!(**args)\n @year = args[:year] if args.key?(:year)\n @month = args[:month] if args.key?(:month)\n @day = args[:day] if args.key?(:day)\n end",
"title": ""
},
{
"docid": "4636bf1058c658b1807c8c4effcaeeab",
"score": "0.4889233",
"text": "def dateIteratorByStep(date,step)\r\n \r\n case step\r\n when \"Days\"\r\n date = date + 1.days\r\n when \"Weeks\"\r\n date = date + 1.weeks\r\n when \"Months\"\r\n date = date + 1.months\r\n when \"Years\"\r\n date = date + 1.years\r\n else\r\n date = date + 10.years #break all possible infinite loops\r\n end\r\n date\r\n end",
"title": ""
},
{
"docid": "b5172e02eb9b090d5b7299772faa069e",
"score": "0.48864305",
"text": "def update!(**args)\n @day = args[:day] if args.key?(:day)\n end",
"title": ""
},
{
"docid": "ca676a824649c31bad5afa375585eae6",
"score": "0.48812687",
"text": "def start_date=(date)\n parsed_date = get_parsed_date(date)\n write_attribute(:start_date, parsed_date)\n end",
"title": ""
},
{
"docid": "310b0f5d9c0879b07b2fa55057629f00",
"score": "0.48778382",
"text": "def set_date(year, month, date)\n # precond should be 1->12 anyways, but just in case...\n return \"Illegal value for year: #{year}\" if year < 0\n return \"Illegal value for month: #{month}\" if month > 12 || month < 0\n return \"Illegal value for date: #{date}\" if date < 0\n\n # make sure date is a valid date for the given month.\n # If not, set to last day of month\n last_day = last_day_of_month(month)\n date = last_day if date > last_day\n\n @year = year\n @month = month\n @date = date\n\n\t\t# init the Hebrew date\n @abs_date = _date_to_abs_date(@year, @month, @date)\n _abs_date_to_hebrew_date!\n end",
"title": ""
},
{
"docid": "77afc9cf4864b6167f9a010641878f8c",
"score": "0.48670906",
"text": "def default_year\n self.year = Date.today.year if year.nil?\n end",
"title": ""
},
{
"docid": "98cd0a5832e34744b2feea46853c4580",
"score": "0.48650375",
"text": "def links_up_to_date=(v); end",
"title": ""
},
{
"docid": "4e51b18ce30bfbe8a33833d275e13e17",
"score": "0.48636654",
"text": "def year=(year)\n if year < 100\n @year = year + 2000\n end\n end",
"title": ""
},
{
"docid": "39450577dc2b6fb9eb3e31ae08daec4d",
"score": "0.48567834",
"text": "def end_of_year\r\n self.acts_like?(:time) ? change(:month => 12,:day => 31,:hour => 23, :min => 59, :sec => 59) : change(:month => 12, :day => 31)\r\n end",
"title": ""
},
{
"docid": "f59824a4560c905f9365b240758228df",
"score": "0.4834788",
"text": "def date=(value)\n @date = value\n end",
"title": ""
},
{
"docid": "17c59da466053dede41b3033985c2976",
"score": "0.48338053",
"text": "def set_psc_ideal_date\n self.psc_ideal_date = self.event_start_date if self.psc_ideal_date.blank?\n end",
"title": ""
},
{
"docid": "aea8c6928adb84c9f620970d468fb313",
"score": "0.48289484",
"text": "def start\n date = Date.parse(ScraperWiki.get_var('date', '2011-06-01'))\n if date == Date.today\n date = Date.new(2011, 6, 1)\n ScraperWiki.save_var('date', date.to_s)\n end\n date\nend",
"title": ""
},
{
"docid": "aea8c6928adb84c9f620970d468fb313",
"score": "0.48289484",
"text": "def start\n date = Date.parse(ScraperWiki.get_var('date', '2011-06-01'))\n if date == Date.today\n date = Date.new(2011, 6, 1)\n ScraperWiki.save_var('date', date.to_s)\n end\n date\nend",
"title": ""
},
{
"docid": "32d60cbda37999a90c0ba6b2e789d50b",
"score": "0.48260856",
"text": "def update_date_fields(field_name,new_value)\n case field_name.to_sym\n when :pub_year_isim # if the user has updated a multivalued year field, we need to blank out the full date, since its no longer valid, and set the single year field if we have only one year\n immediate_remove('pub_date_ssi')\n if new_value.class == Array && new_value.size == 1\n immediate_update('pub_year_single_isi',new_value.first)\n else\n immediate_remove('pub_year_single_isi')\n end\n when :pub_year_single_isi # if the user has updated a year field, we need to blank out the full date, since its no longer valid, and set the years field\n immediate_remove('pub_date_ssi')\n immediate_update('pub_year_isim',new_value)\n when :pub_date_ssi # if the user has updated a date field, we need to set the years appropriately but NOT send the year fields to editstore (since we only need the date field there)\n new_value=new_value.first if new_value.class == Array\n full_date=get_full_date(new_value)\n if full_date # if it's a valid full date, extract the year into the single and multi-valued year fields\n immediate_update('pub_year_single_isi',full_date.year.to_s,:ignore_editstore=>true)\n immediate_update('pub_year_isim',full_date.year.to_s,:ignore_editstore=>true) # but never send the year to editstore since the actual date is enough for the MODs\n else # if it's not a valid date, clear the year fields\n immediate_remove('pub_year_isim')\n immediate_remove('pub_year_single_isi')\n end\n end\n end",
"title": ""
},
{
"docid": "58af87165988e3dd981db4d12191b166",
"score": "0.48236665",
"text": "def next!\n self.date += 1\n end",
"title": ""
},
{
"docid": "395160fe5f39ddfc839e3a99ade91042",
"score": "0.48192728",
"text": "def generate_populate_date(date:)\n yester_month = date.month.strftime('%m')\n yester_day = date.month.strftime('%d')\n \"#{date.year}#{yester_month}#{yester_day}\"\n end",
"title": ""
},
{
"docid": "3fdb00e8d42bfb32d8526649e8610ea4",
"score": "0.4818394",
"text": "def set_due_date year, month, day\n # creates a variable for the due date and sets the date using the Ruby Date class\n @due_date = Date.new year, month, day\n # converts the due date to a string format that is easier to read\n @due_date = @due_date.strftime('%F')\n end",
"title": ""
},
{
"docid": "3a35946af4b787f82734ddb9acde889e",
"score": "0.48179805",
"text": "def update_matter_peoples_start_date\n date = self.matter_date || self.created_at.to_date\n self.matter_peoples.lawteam_members.each do|e|\n e.update_start_date(date) if e.start_date < date\n end\n lead_lawyer = self.matter_peoples.find_by_employee_user_id(self.employee_user_id)\n if lead_lawyer.present? && lead_lawyer.start_date < date\n lead_lawyer.start_date = date\n lead_lawyer.end_date = nil\n lead_lawyer.send(:update_without_callbacks)\n end\n end",
"title": ""
},
{
"docid": "8cc11d21e67ecf1c356d45b38735a73f",
"score": "0.48148322",
"text": "def updated_date=(value)\n @children['updated-date'][:value] = value\n end",
"title": ""
},
{
"docid": "ef07c676eba4ceaf335e4021edcfdcca",
"score": "0.48143235",
"text": "def fill_in_date(legend, with: date)\n parts = case with\n when Date\n [with.year, with.month, with.day]\n when String\n with.split(\"-\")\n end\n\n fieldset = page.find(\"legend\", text: legend).ancestor(\"fieldset.govuk-fieldset\")\n\n within(fieldset) do\n Hash[%w[Year Month Day].zip(parts)].each do |label, value|\n fill_in label, with: value\n end\n end\n end",
"title": ""
},
{
"docid": "d50ec2fe2e58f9a519f379ed30c7e1c2",
"score": "0.48126906",
"text": "def set_AiringEndTime(value)\n set_input(\"AiringEndTime\", value)\n end",
"title": ""
},
{
"docid": "d50ec2fe2e58f9a519f379ed30c7e1c2",
"score": "0.48126906",
"text": "def set_AiringEndTime(value)\n set_input(\"AiringEndTime\", value)\n end",
"title": ""
},
{
"docid": "a629304cc90137cfef03aaa4c3e18510",
"score": "0.48087746",
"text": "def set_PublicationDate(value)\n set_input(\"PublicationDate\", value)\n end",
"title": ""
},
{
"docid": "a629304cc90137cfef03aaa4c3e18510",
"score": "0.48087746",
"text": "def set_PublicationDate(value)\n set_input(\"PublicationDate\", value)\n end",
"title": ""
},
{
"docid": "2d1d27e1e6a2861cbc56b699011a7ae6",
"score": "0.4806438",
"text": "def update_date_fields(field_name,new_value)\n case field_name.to_sym\n when :pub_year_isim # if the user has updated a multivalued year field, we need to blank out the full date, since its no longer valid, and set the single year field if we have only one year\n immediate_remove('pub_date_ssi')\n if new_value.class == Array && new_value.size == 1\n immediate_update('pub_year_single_isi',new_value.first)\n else\n immediate_remove('pub_year_single_isi')\n end\n when :pub_year_single_isi # if the user has updated a year field, we need to blank out the full date, since its no longer valid, and set the years field\n immediate_remove('pub_date_ssi')\n immediate_update('pub_year_isim',new_value)\n when :pub_date_ssi # if the user has updated a date field, we need to set the years appropriately but NOT send the year fields to editstore (since we only need the date field there)\n new_value=new_value.first if new_value.class == Array\n full_date=get_full_date(new_value)\n if full_date # if it's a valid full date, extract the year into the single and multi-valued year fields\n immediate_update('pub_year_single_isi',full_date.year.to_s,:ignore_editstore=>true)\n immediate_update('pub_year_isim',full_date.year.to_s,:ignore_editstore=>true) # but never send the year to editstore since the actual date is enough for the MODs\n else # if it's not a valid date, clear the year fields\n immediate_remove('pub_year_isim')\n immediate_remove('pub_year_single_isi') \n end\n end \n end",
"title": ""
},
{
"docid": "c3aaaedac710656ba04e427fc48dbf61",
"score": "0.4806385",
"text": "def set_UpdateViewDate(value)\n set_input(\"UpdateViewDate\", value)\n end",
"title": ""
},
{
"docid": "0a7e3874270fdc508f32cc74450e2c1f",
"score": "0.4800301",
"text": "def set_year\n if params[:commit] = \"set\"\n session[:current_year] = params[:date][:year]\n redirect_to leaves_url\n end\n end",
"title": ""
},
{
"docid": "62b5d4a5c133467ca716fb251a453e2a",
"score": "0.47986633",
"text": "def end_of_year\n change(:month => 12, :day => 31, :hour => 23, :min => 59, :sec => 59)\n end",
"title": ""
},
{
"docid": "662f55fe9d4b1623e376d992a74545fe",
"score": "0.47983924",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "662f55fe9d4b1623e376d992a74545fe",
"score": "0.47983924",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "662f55fe9d4b1623e376d992a74545fe",
"score": "0.47983924",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "662f55fe9d4b1623e376d992a74545fe",
"score": "0.47983924",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "662f55fe9d4b1623e376d992a74545fe",
"score": "0.47983924",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "662f55fe9d4b1623e376d992a74545fe",
"score": "0.47983924",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8bdf753a37f7777662ea2cfc616462e5",
"score": "0.47978917",
"text": "def today(value)\n if block_given?\n kinbon = yield value\n end\n return kinbon\nend",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47971272",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47971272",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47971272",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
},
{
"docid": "8b8a7c0eac9a172f02c3c1186badb723",
"score": "0.47967976",
"text": "def set_Date(value)\n set_input(\"Date\", value)\n end",
"title": ""
}
] |
49053847e606fd6fece974b82781d08f | Returns an Array containing the names of all libraries defined in the Ivy dependency file(s) for this subtree. The Array elements are simple file names and do not include any paths. | [
{
"docid": "85cb24f45ab1da1488021dbd9f383c0f",
"score": "0.7104577",
"text": "def ivy_dependencies(type)\n result = Array.new\n\n dependencies_file = ivy_file_name.canonicalize.to_s\n if File.exists?(dependencies_file)\n xml = DOM4J::SAXReader.new.read(FileReader.new(dependencies_file))\n xml.selectNodes(\"/ivy-module/dependencies/dependency\").each do |node|\n name = node.attribute('name').value\n rev = node.attribute('rev').value\n result << \"#{name}-#{rev}.jar\"\n end\n end\n\n result\n end",
"title": ""
}
] | [
{
"docid": "959e51949ffed71d093445efecf542a0",
"score": "0.7305336",
"text": "def get_dep_libs_list\n\t\tdep_libs_list = Array.new\n\t\t@dep_libs.each do |dep_lib|\n\t\t\tdep_libs_list.push(dep_lib)\n\t\tend\n\t\treturn dep_libs_list\n\tend",
"title": ""
},
{
"docid": "7fd7c46005b1eed558d13d2d65e72745",
"score": "0.7098359",
"text": "def libs\n # return link libraries resulting from indirect dependencies\n llibs = ::Set.new\n dependencies.each do |idep|\n llibs.merge(idep.libs)\n end\n llibs\n end",
"title": ""
},
{
"docid": "dabdfb607f1732f3b544e3f39488920e",
"score": "0.70100844",
"text": "def dependencies\n return [] if libraries_group.nil?\n\n dependency_paths.map do |path|\n # Map each path to a Pathname, expanding $(SRCROOT) or ${SRCROOT}\n # SRCROOT = location of the app project: ./ios\n Pathname.new path.gsub(/\\$(\\(SRCROOT\\)|{SRCROOT})/, 'ios')\n end.select do |pathname|\n # Valid if any path component named node_modules\n pathname.each_filename do |path_component|\n break true if path_component == 'node_modules'\n\n false\n end\n end.map do |pathname|\n # Map each selected Pathname to the root immediately under node_modules\n node_modules_found = false\n pathname.each_filename do |path_component|\n break path_component if node_modules_found\n\n node_modules_found = path_component == 'node_modules'\n '' # In case node_modules is the last component\n # TODO: Then what? Shouldn't happen, of course....\n end\n end\n end",
"title": ""
},
{
"docid": "debedba7a44517618792558b0e67e3ed",
"score": "0.6977794",
"text": "def lib_paths\n # return all library search paths resulting from indirect dependencies\n libpaths = ::Set.new\n dependencies.each do |idep|\n libpaths.merge(idep.lib_paths)\n end\n libpaths\n end",
"title": ""
},
{
"docid": "eabe10cc13fccfb2e48e631b1aed0a6a",
"score": "0.6917842",
"text": "def all_libraries\n Boson.repos.map {|e| e.all_libraries }.flatten.uniq\n end",
"title": ""
},
{
"docid": "b20166c51ef9604e61af48f18eed9622",
"score": "0.6838143",
"text": "def names\n libs.map {|l| l.name }\n end",
"title": ""
},
{
"docid": "182c05c5bb25c1890e674244854171e9",
"score": "0.6772799",
"text": "def get_libraries_recursive_list\n\t\tlibraries = get_libraries_recursive_string.split\n\t\treturn libraries\n\tend",
"title": ""
},
{
"docid": "057c83a70d5b62bc6f273fb9dc379848",
"score": "0.67461276",
"text": "def dependencies\n dependencies_with_paths.keys\n end",
"title": ""
},
{
"docid": "cf71702936c0455341eea7904c6c1ce8",
"score": "0.67245376",
"text": "def libs\n libs_changes = Array.new\n @raw.each do |change|\n if lib?(change)\n libs_changes << module_name(change)\n end\n end\n return libs_changes.sort.uniq\n end",
"title": ""
},
{
"docid": "141c15321c9c56f033d241ad08fd48af",
"score": "0.6708267",
"text": "def lib_paths\n # start with library search paths resulting from direct dependencies\n lib_paths = ::Set.new(recipes.inject([]) { |list, rcp| list.concat(rcp.mpc_file[project_type].lib_paths) })\n # now add library search paths resulting from indirect dependencies\n dependencies.each do |idep|\n lib_paths.merge(idep.lib_paths)\n end\n lib_paths\n end",
"title": ""
},
{
"docid": "76db9ba3374fc7640a1097a377ff9f39",
"score": "0.6704018",
"text": "def dependencies_path\n path = []\n @installed_packages.each do |p|\n path.push(p.folder)\n end\n return path\n end",
"title": ""
},
{
"docid": "54d393ad348f6c54a8cfebab1b90d8df",
"score": "0.6695293",
"text": "def libs\n all_enabled = @setup.enabled\n if all_enabled.empty?\n return []\n else\n en = all_enabled.join(\",\")\n return FileList[@path / \"{#{en}}\" / \"**\" / \"*.a\"]\n end\n end",
"title": ""
},
{
"docid": "980d9d479731cabf12850a4da34dd620",
"score": "0.6658787",
"text": "def dependency_paths\n return [] if libraries_group.nil?\n\n paths = libraries_group.children.reject { |c| DEFAULT_DEPENDENCIES.include?(c.name.sub(/\\.xcodeproj$/, '')) }.map(&:path)\n paths.map { |p| File.expand_path p, File.join(Dir.pwd, 'ios') }\n end",
"title": ""
},
{
"docid": "d659766c314b6bd663bbd47fa39b40f6",
"score": "0.66533476",
"text": "def library_names\n @libraries.keys\n end",
"title": ""
},
{
"docid": "c4e3e798cb15b35ea72c6984fb166ab0",
"score": "0.662923",
"text": "def dependent_gems\n out = []\n Gem.source_index.each do |name,gem|\n gem.dependencies.each do |dep|\n if self.satisfies_requirement?(dep) then\n sats = []\n find_all_satisfiers(dep) do |sat|\n sats << sat\n end\n out << [gem, dep, sats]\n end\n end\n end\n out\n end",
"title": ""
},
{
"docid": "7f4fe6c4a404c75b3f2927a5aa0eb084",
"score": "0.66079193",
"text": "def expanded_library_names\n library_names.map do |libname|\n pathname = File.expand_path(File.join(Libyajl2.opt_path, libname))\n pathname if File.file?(pathname)\n end.compact\n end",
"title": ""
},
{
"docid": "041a95eaf8f1cb58a14d88d007a59320",
"score": "0.6598526",
"text": "def get_dependencies\n []\n end",
"title": ""
},
{
"docid": "291348c4997efa542244ecda4379a778",
"score": "0.65828186",
"text": "def available_gems\n return [] unless gemfile_path\n dsl = Bundler::Dsl.evaluate(gemfile_path, nil, true)\n return dsl.dependencies.map(&:name)\n end",
"title": ""
},
{
"docid": "649dad02f69ce7a91a63708935e5180d",
"score": "0.65653694",
"text": "def libraries\n modules = YARD::Registry.all(:module)\n modules.select { |lib| !lib.parent.root? && lib.file =~ /#{@name}/ }\n end",
"title": ""
},
{
"docid": "5407842f8a93d491bdb6537553a3d8fb",
"score": "0.65364623",
"text": "def sysdeps\n res = []\n @build.each do |x|\n x.sysdep.each { |k,v| res.concat v }\n end\n res.sort.uniq\n end",
"title": ""
},
{
"docid": "2f035f4b4fad34873f11711b4cc914ba",
"score": "0.6511482",
"text": "def dependencies\n Gem.loaded_specs.values.map { |spec| \"#{spec.name} #{spec.version}\\n\" }\n .uniq.sort.join(\",\").split(\",\")\n end",
"title": ""
},
{
"docid": "511206bcfcca83456e12c545a8e37dfe",
"score": "0.6511319",
"text": "def libraries\n @libraries ||= []\n end",
"title": ""
},
{
"docid": "10979d6b862a947a3928602237d769ee",
"score": "0.64488983",
"text": "def lib_files\n libs = files_to_build.select { |f| /^lib\\// =~ f }\n libs\n end",
"title": ""
},
{
"docid": "11950bff7e3e276fca82bafdb1f14e97",
"score": "0.6430114",
"text": "def get_dependencies(file)\n dep_file = file.ext(\".d\")\n return [MRUBY_CONFIG] unless object_ext?(file) && File.exist?(dep_file)\n\n deps = File.read(dep_file).gsub(\"\\\\\\n \", \"\").split(\"\\n\").map do |dep_line|\n # dep_line:\n # - \"/build/host/src/array.o: /src/array.c /include/mruby/common.h ...\"\n # - \"\"\n # - \"/include/mruby/common.h:\"\n dep_line.scan(/^\\S+:\\s+(.+)$/).flatten.map { |s| s.split(' ') }.flatten\n # => [\"/src/array.c\", \"/include/mruby/common.h\" , ...]\n # []\n # []\n end.flatten.uniq\n deps << MRUBY_CONFIG\n end",
"title": ""
},
{
"docid": "0c2ef6e08f4e2eb5560ec649e5463281",
"score": "0.64173543",
"text": "def detected_libraries\n Boson.repos.map {|e| e.detected_libraries }.flatten.uniq\n end",
"title": ""
},
{
"docid": "3aa622ac1144997f9937f9f86b8e13c6",
"score": "0.6414122",
"text": "def get_dependencies(dir)\n\n # Temporarily disable this function.\n return \"\"\n\n i = `grep \"#include\" #{dir}/*.[ch]pp 2>/dev/null`\n\n return \"\" if (i.strip == \"\")\n\n includes = []\n i.each do |incfile|\n incfile = incfile.strip.split[1][1..-2]\n\n # Get source files in the directory we might need a library from.\n sources = get_files(File.dirname(incfile), \"^[-a-zA-Z0-9_]+\\\\.cpp$\")\n\n # Only consider our own includes (those in syneight/), not iostream etc.\n # Only add the .la files if there actually *is* a library in that subdir.\n # TODO: Remove library in our directory.\n if (incfile =~ /^syneight\\// and sources != \"\")\n includes << \"$(top_srcdir)/\" \\\n + File.dirname(incfile) + \"/lib\" \\\n + File.basename(File.dirname(incfile)) + \".la\"\n end\n end\n\n # Remove duplicates.\n includes.uniq!\n\n # Return a string with a list of space-separated library names.\n return includes.join(\" \").strip\nend",
"title": ""
},
{
"docid": "1036943d6c24b4f86473edb6859055c9",
"score": "0.6376353",
"text": "def dependencies\n return @dependencies ||= []\n end",
"title": ""
},
{
"docid": "bc37bf77e50c3f489bedc20b058d72ff",
"score": "0.63628244",
"text": "def all_package_names\n each_autobuild_package.map(&:name)\n end",
"title": ""
},
{
"docid": "5543dce434a59d93e4e7e12d8ceb1d98",
"score": "0.63523215",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "f93b184e43f67a6ac4cab151aef1f42b",
"score": "0.63518417",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "ec887368a52af5fff65bc870ebe6d21a",
"score": "0.6342251",
"text": "def dependencies options = {}\n return [] unless exist?\n deps = Array.new\n if options.has_key?(:subprojects) and (not options[:subprojects])\n reload_project_info unless @info_file and @info_file.exist?\n info_files = [@info_file]\n else\n info_files = Dir[\"#{local_path}/**/*.info\"]\n end\n info_files.each do |info|\n f = File.open(info, \"r\").read\n f.each_line do |l|\n matchdata = l.match(/^\\s*dependencies\\s*\\[\\s*\\]\\s*=\\s*[\"']?([^\\s(\"']+)/)\n if nil != matchdata\n deps << matchdata[1].strip\n end\n matchdata = l.match(/^\\s*base +theme\\s*=\\s*(.+)$/)\n if nil != matchdata\n d = matchdata[1].strip\n deps << d.gsub(/\\A[\"']|[\"']\\Z/, '') # Strip leading and trailing quotes\n end\n end\n end\n # Remove duplicates and self-dependency\n deps.uniq!\n deps.delete(name)\n return deps\n end",
"title": ""
},
{
"docid": "34f33758963b77f26491afbbcd36f373",
"score": "0.6335643",
"text": "def packages\n modules.map(&:package).uniq!\n end",
"title": ""
},
{
"docid": "9122224e67c9f51dd151e50dc8380e97",
"score": "0.63224554",
"text": "def dependencies\r\n @dependencies ||= []\r\n result = @dependencies.collect do |project_name|\r\n if(@dir)\r\n config = \"#{File.dirname(dir)}/#{project_name}/project.yaml\"\n if(File.exist?(config))\r\n Project.load(config)\n else\n nil\n end\r\n else\r\n # Used in testing, when it's often too cumbersome to set up a dir\r\n Project.new(project_name)\r\n end\r\n end\n result.delete_if {|x| x.nil? } \r\n result.freeze\r\n result\r\n end",
"title": ""
},
{
"docid": "a93380355ab5e965d399fa1ce4a96430",
"score": "0.6314868",
"text": "def packages\n return [] if yarn_package_tree.nil?\n all_dependencies = {}\n recursive_dependencies(yarn_package_tree).each do |name, results|\n results.uniq! { |package| package[\"version\"] }\n if results.size == 1\n # if there is only one package for a name, reference it by name\n all_dependencies[name] = results[0]\n else\n # if there is more than one package for a name, reference each by\n # \"<name>-<version>\"\n results.each do |package|\n all_dependencies[\"#{name}-#{package[\"version\"]}\"] = package\n end\n end\n end\n\n all_dependencies\n end",
"title": ""
},
{
"docid": "2a033622876a589c56021c27779fd90c",
"score": "0.6314521",
"text": "def dependencies\n document_root = Pathname.new(File.join(Dir.pwd, @options[:document_root]))\n absolute_dependencies.map do |full_path|\n relative_path = Pathname.new(full_path).relative_path_from(document_root).to_s\n File.join(\"/\", relative_path)\n end\n end",
"title": ""
},
{
"docid": "c96f1d1c89f7e0a71a65ae0795914e97",
"score": "0.6295378",
"text": "def dependencies\n @dependencies.values\n end",
"title": ""
},
{
"docid": "c96f1d1c89f7e0a71a65ae0795914e97",
"score": "0.6295378",
"text": "def dependencies\n @dependencies.values\n end",
"title": ""
},
{
"docid": "a05be07ad22a9c754fcb92a6466c7bdd",
"score": "0.62837243",
"text": "def dll_dependencies(dll_path = \"\")\n return [] unless ['.dll', '.so'].include? File.extname dll_path\n \n raw_dependencies(dll_path).map {|dep| dep.downcase}.uniq\n end",
"title": ""
},
{
"docid": "18b6239e3b3d54dd23e84e4a94678202",
"score": "0.62804437",
"text": "def packages\n package_ids = Set.new\n cabal_file_dependencies.each do |target|\n name = target.split(/\\s/)[0]\n package_id = cabal_package_id(name)\n if package_id.nil?\n package_ids << target\n else\n recursive_dependencies([package_id], package_ids)\n end\n end\n\n Parallel.map(package_ids) { |id| package_info(id) }\n end",
"title": ""
},
{
"docid": "71a76ec39aa60f0c80124105c5d7b5d1",
"score": "0.62750775",
"text": "def load_dependencies\n dir = Pathname.pwd.join('lib', 'system', 'dependencies')\n result = ResourceRegistry::Stores::Operations::ListPath.new.call(dir)\n result.value!.each{|path| load path}\n end",
"title": ""
},
{
"docid": "7b33a29ac7c3765db973075f3bc1a921",
"score": "0.62579155",
"text": "def included_lib_dirs\n []\n end",
"title": ""
},
{
"docid": "65c3cb47fb0400ffed10e8280608ba0d",
"score": "0.62497395",
"text": "def depends\n depends = @packages.map(&:depends).inject(:merge)\n @packages.map(&:name).each do | n |\n depends.delete(n)\n end\n return depends\n end",
"title": ""
},
{
"docid": "0d6eca13eeaa5da101a1d76da7ae3901",
"score": "0.6238836",
"text": "def core_dependants_of(name)\n dependencies = {}\n Dir['src/tikzlibrarykodi.*.code.tex'].each do |filename|\n code = File.read filename\n sublibrary_name = filename[/kodi\\.(.*)\\.code/, 1]\n usetikzlibrary = /\\\\usetikzlibrary[\\[{]kodi\\.(\\w+)[\\]}]/\n dependencies[sublibrary_name] = code.scan(usetikzlibrary).map(&:first)\n end\n dependants = []\n upper_level = [name]\n until upper_level.empty?\n dependants.concat upper_level\n upper_level = []\n dependants.each do |d|\n upper_level.concat dependencies.select { |_, ds| ds.include? d }.keys\n end\n upper_level.reject! { |x| dependants.include? x }\n end\n dependants\nend",
"title": ""
},
{
"docid": "f3366c400ae18a4dbb285b851d06b477",
"score": "0.6232085",
"text": "def gem_array\n Gem.loaded_specs.values\n end",
"title": ""
},
{
"docid": "d7f5bb1a35c884c01a31b9c7810e5282",
"score": "0.622802",
"text": "def get_dependencies_file_list\n files = ArrayList.new\n # handle token vocabulary loads\n vocab_name = @grammar.get_option(\"tokenVocab\")\n if (!(vocab_name).nil?)\n vocab_file = @tool.get_imported_vocab_file(vocab_name)\n output_dir = vocab_file.get_parent_file\n file_name = groom_qualified_file_name(output_dir.get_name, vocab_file.get_name)\n files.add(file_name)\n end\n # handle imported grammars\n imports = @grammar.attr_composite.get_delegates(@grammar.attr_composite.get_root_grammar)\n imports.each do |g|\n libdir = @tool.get_library_directory\n file_name = groom_qualified_file_name(libdir, g.attr_file_name)\n files.add(file_name)\n end\n if ((files.size).equal?(0))\n return nil\n end\n return files\n end",
"title": ""
},
{
"docid": "85a1333652e9de7861d0051d7aff5365",
"score": "0.6219627",
"text": "def external_dependencies\n (@directives[:slinky_depends_external] || []).map{|ed|\n Dir.glob(File.join(@manifest.dir, ed))\n }.flatten\n end",
"title": ""
},
{
"docid": "8c486bf8aa77088e84201750aa377587",
"score": "0.62155193",
"text": "def all_dependencies\n (self.dependencies.to_a + self.dependencies.map(&:all_dependencies)).flatten.uniq\n end",
"title": ""
},
{
"docid": "6f624b8a6e6d0e5e788387ca30d0695e",
"score": "0.6204939",
"text": "def dependencies\n Naether::Java.convert_to_ruby_array( @resolver.currentDependencies() )\n end",
"title": ""
},
{
"docid": "aebbc13f579b2cbd71aa0c6c5e2e0ad3",
"score": "0.62044287",
"text": "def get_dependents(pkgs)\n dependents = []\n to_check = pkgs.map { |pkg| pkg[:metadata][:filename] }\n dependency = get_dependency_mapping\n while pkgfile = to_check.pop\n pkgs = dependency[pkgfile.to_s]\n next if pkgs.nil?\n dependents |= pkgs\n to_check |= pkgs.map { |pkg| pkg[:metadata][:filename] }\n end\n return dependents\n end",
"title": ""
},
{
"docid": "b828caff9247bb645fe89fa7c2650a58",
"score": "0.620355",
"text": "def remaining_dependencies\n dependencies = []\n @current_packages.each do |_, package|\n package.spec.dependencies.each do |dep|\n next if satisfy? dep\n dependencies << dep\n end\n end\n dependencies\n end",
"title": ""
},
{
"docid": "3d02a44928e22577ddcf1a992f0cf587",
"score": "0.6200805",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "7940fdb9963fb0efeec44b5d8183a2ab",
"score": "0.61820096",
"text": "def subtree_only_libraries(type)\n out = dependencies_libraries(type)\n roots = subtree_only_library_roots(type)\n roots.each { |root| out << JarDirectory.new(root).to_classpath }\n out\n end",
"title": ""
},
{
"docid": "5dd7b0eb328eee15ea92561eb930d58e",
"score": "0.6180964",
"text": "def libraries\n @libraries ||= Array.new\n end",
"title": ""
},
{
"docid": "5dd7b0eb328eee15ea92561eb930d58e",
"score": "0.6180964",
"text": "def libraries\n @libraries ||= Array.new\n end",
"title": ""
},
{
"docid": "339a90c0cf6f6a84267720f031ca008d",
"score": "0.6178511",
"text": "def dependencies\n @dependencies.map {|name| self.class.find(name) }\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.617472",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.6174076",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "adb79a4e7a6fa002f7edecf48c052ee0",
"score": "0.6167803",
"text": "def dependencies\n deps = configuration.dependencies.map { |dep| program_dependency(dep) }\n end",
"title": ""
},
{
"docid": "7ae18bf029b45853fc458d37bd52db49",
"score": "0.6167752",
"text": "def dependencies\n bundler_dependencies.select { |e| e.name.start_with?('piktur') }\n end",
"title": ""
},
{
"docid": "3f94541bfc6690b63989b935cf10f68a",
"score": "0.61580133",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "ae3678611121514c9acf0ae37d232c14",
"score": "0.61577326",
"text": "def dependency_files\n @dependency_files = (\n walker.inject([]) do |files, entry|\n files << convert_entry(entry) if is_entry_supported?(entry)\n files\n end\n )\n end",
"title": ""
},
{
"docid": "7a15c44fba253e0fe2f22cc02095f7a0",
"score": "0.6157683",
"text": "def dependencies\n service&.dig(:pkg, :deps) || []\n end",
"title": ""
},
{
"docid": "959463b49cbcaf4dd6fb9a0a04309ff9",
"score": "0.6155744",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "7373f6399c5aec0474f0c47b56bc88cb",
"score": "0.61400104",
"text": "def dependencies!\n []\n end",
"title": ""
},
{
"docid": "e6f77a038a6e1865f432bec8712319e6",
"score": "0.61375463",
"text": "def dependency_list\n packages = [\n 'kernel-devel-`uname -r`',\n 'kernel-headers-`uname -r`',\n 'gcc',\n 'binutils',\n 'make',\n 'perl',\n 'bzip2'\n ]\n end",
"title": ""
},
{
"docid": "22381661da133587d08476965c8ad285",
"score": "0.61323035",
"text": "def get_libraries_recursive_string\n\t\tlibraries = \"\"\n\t\t@subdirs.each do |subdir|\n\t\t\tif subdir.has_library then\n\t\t\t\tlibraries += \"#{subdir.name}/lib#{subdir.name}.la \"\n\t\t\tend\n\t\t\tsubdir_libraries = subdir.get_libraries_recursive_string.split\n\t\t\tsubdir_libraries.each do |subdirlib|\n\t\t\t\tlibraries += \"#{subdir.name}/#{subdirlib} \"\n\t\t\tend\n\t\tend\n\t\treturn libraries.strip\n\tend",
"title": ""
},
{
"docid": "9ed3965977bdec55e27b8db04024c71d",
"score": "0.61314195",
"text": "def dependent_assemblies\n [self.assemblies, self.assemblies.map(&:all_parents)].flatten.compact\n end",
"title": ""
},
{
"docid": "8c62f4badf23ffed3d019c73a9bb041e",
"score": "0.6104197",
"text": "def interproject_dependencies\n @interproject_dependencies ||= []\n end",
"title": ""
},
{
"docid": "6aa1430201bb8853d14f06fc50672510",
"score": "0.61030823",
"text": "def dependency_paths\n @dependency_paths ||= build_dependencies_paths_and_assets[0]\n end",
"title": ""
},
{
"docid": "84c6ac1a9eeec202be3c25ff318fcb33",
"score": "0.60950756",
"text": "def lib_paths\n metadata.lib_paths\n end",
"title": ""
},
{
"docid": "951d53f6a4c70541db0010a6d6698e63",
"score": "0.60830563",
"text": "def dependents\n infrastructure_components.map{|x| x.transam_asset}\n end",
"title": ""
},
{
"docid": "951d53f6a4c70541db0010a6d6698e63",
"score": "0.60830563",
"text": "def dependents\n infrastructure_components.map{|x| x.transam_asset}\n end",
"title": ""
},
{
"docid": "7df33cd649eaca6a388f125afbb9052f",
"score": "0.6068293",
"text": "def DEPLOYMENT()\n dep_xml = File.join(project.homedir, 'WEB-INF', 'jboss-deployment-structure.xml')\n jars = []\n if File.exists?(dep_xml)\n xmldoc = REXML::Document.new(File.new(dep_xml))\n xmldoc.elements.each('jboss-deployment-structure/deployment/dependencies/module') { | el |\n if el.attributes['export'] == 'true'\n name = el.attributes['name']\n name = name.gsub('.', '/')\n root = File.join(_addon_module_root, '**', name, 'main', '*.jar')\n FileArtifact.dir(root) { | jar |\n JOIN(jar)\n }\n end\n }\n end\n\n return jars\n end",
"title": ""
},
{
"docid": "b0c74be403be10028e2a18484746ac15",
"score": "0.6067573",
"text": "def depends_on\n if self.depends\n self.depends.split(', ').sort.inject([]) do |res, name|\n if p = self.search_class_name.where(name: name.split(/ /)[0]).first\n res << p\n else\n logger.info(\"No package #{name.split(/ /)[0]} for #{self.depends} in #{self.inspect}\")\n end\n res\n end\n else\n []\n end\n end",
"title": ""
},
{
"docid": "6e45613ea6a6fca11c0069cad9d6e251",
"score": "0.6066801",
"text": "def dependencies\n if @dependencies.nil?\n @dependencies = package_manager.package_dependencies(self)\n end\n\n @dependencies\n end",
"title": ""
},
{
"docid": "4cac5a8aa8aa50b94a338b6f2a9b1dbe",
"score": "0.60480374",
"text": "def cabal_packages\n cabal_files.map do |f|\n name_match = File.read(f).match(/^name:\\s*(.*)$/)\n name_match[1] if name_match\n end.compact\n end",
"title": ""
},
{
"docid": "11a8a170960e098fbe0e3150ae2195dc",
"score": "0.6045841",
"text": "def local_deps(search_path=nil)\n search_path ||= File.join(root_path, \"packages\")\n\n dependencies.inject([]) do |list, (name, version)|\n package = Package.new(File.join(search_path, name))\n requirement = LibGems::Requirement.new(version)\n if package.has_json?\n package.load_json\n else\n raise \"Can't find package #{name} required in #{self.name}\"\n end\n unless requirement.satisfied_by?(LibGems::Version.new(package.version))\n raise \"#{name} (#{package.version}) doesn't match #{version} required in #{self.name}\"\n end\n (package.local_deps(search_path) << package).each do |dep|\n list << dep unless list.any?{|d| d.name == dep.name }\n end\n list\n end\n end",
"title": ""
},
{
"docid": "1c8057a43e18fef25a9847d24edf3950",
"score": "0.6042883",
"text": "def deps(moduledir = Dir.pwd)\n name = File.basename( moduledir )\n error \"The module #{name} does not exist\" unless File.directory?( moduledir )\n\n result = []\n result2 = []\n resulttmp = []\n\n result << name\n\n while result != result2\n resulttmp = result.dup\n (result - result2).each do |_x|\n Dir[\"#{moduledir}/**/*.pp\"].each do |ppfile|\n File.read(ppfile).scan(/^\\s*(include|require|class\\s*{)\\s*[\"']?(::)?([0-9a-zA-Z:{$}\\-]*)[\"']?/) do |_m|\n next if Regexp.last_match(3).nil?\n entry = Regexp.last_match(3).split('::').first\n result << entry unless entry.nil? || entry.empty?\n end\n end\n end\n result.uniq!\n result2 = resulttmp.dup\n end\n result.delete name.to_s\n result\n end",
"title": ""
},
{
"docid": "022f2f84226180445d43d468665f58c0",
"score": "0.6028813",
"text": "def dependencies(filename)\n Set.new(probable_dependencies(filename).find_all {|d| d.any? }.map {|d| d.first }).to_a\n end",
"title": ""
},
{
"docid": "38d882835440b90b620faf1adc8f47a0",
"score": "0.6026888",
"text": "def list_build_dependencies\n @project.components.map(&:build_requires).flatten.uniq - @project.components.map(&:name)\n end",
"title": ""
},
{
"docid": "87aa49d0d8a200675479cfdf47bd72b0",
"score": "0.6026826",
"text": "def get_dep_libs_string\n\t\tdep_libs_string = \"\"\n\t\t@dep_libs.reverse_each do |dep_lib|\n\t\t\tdep_libs_string += \"#{dep_lib} \"\n\t\tend\n\t\treturn dep_libs_string.strip\n\tend",
"title": ""
},
{
"docid": "774b156c7bd6c08b501b01103fbaa4d0",
"score": "0.60245407",
"text": "def libraries\r\n if @files.empty?\r\n @reprime ? [$0] + $\" : $\"\r\n else\r\n @files\r\n end\r\n end",
"title": ""
},
{
"docid": "bec7477b11c62e0f91b3faf1dd3db953",
"score": "0.602005",
"text": "def get_dependent_module_refs_array\n # This returns an array of ModuleRef objects\n DependentModule.get_dependent_module_refs_array(self)\n end",
"title": ""
},
{
"docid": "10a969e8a9f44ec6ea309c67b6cad6aa",
"score": "0.60183203",
"text": "def dependencies\n @tracks.map(&:dependencies).flatten.sort.uniq\n end",
"title": ""
},
{
"docid": "c47731dcda1f8478fd9659dabd0300b1",
"score": "0.6010549",
"text": "def gems\n return [] unless parser\n\n # `Bundler::LockfileParser` returns `Bundler::LazySpecification` objects\n # which are not resolved, so extract the dependencies from them\n parser.dependencies.values.concat(parser.specs.flat_map(&:dependencies))\n end",
"title": ""
},
{
"docid": "3e5c7cbd3aa239dc78e80f3dc7e20afc",
"score": "0.6002989",
"text": "def all_load_paths\n result = []\n Gem.path.each do |gemdir|\n each_load_path(all_partials(gemdir)) do |load_path|\n result << load_path\n end\n end\n result\n end",
"title": ""
},
{
"docid": "a1e5f904120d171e43e2b83717ac5612",
"score": "0.60020876",
"text": "def dependencies\n return @config.fetch(\"deps\", Rake::FileList.new)\n end",
"title": ""
},
{
"docid": "a258b1aa8dcb6f91ee4c94c2ae0eef0d",
"score": "0.6002087",
"text": "def dependencies\n synchronize\n dependencies = @dependencies.map do |dependency| \n build_path(@cache, dependency)\n end\n return dependencies\n end",
"title": ""
},
{
"docid": "89678c2b310cdeb54e45d2e8d6f85bed",
"score": "0.59979856",
"text": "def gem_list\n fetch(:dependencies, {})[:remote][:gem] rescue {}\nend",
"title": ""
},
{
"docid": "9a48ca35df7715b4e4672ebb6a46c7c1",
"score": "0.59921956",
"text": "def libraries\n unless @libraries\n @libraries = {}\n paths = Processor.expand_paths($LOAD_PATH, @options[:gem_libraries])\n paths.each do |path|\n lib = Processor.library_name(path)\n if @libraries[lib]\n @logger.warn \"Multiple libraries for <#{lib}>, using #{ Processor.pretty_path @libraries[lib] } (other is #{ Processor.pretty_path path })\" \n end\n @libraries[lib] ||= path\n end\n end\n \n @libraries\n end",
"title": ""
},
{
"docid": "810706a4363f771557a29a7de338da83",
"score": "0.59647214",
"text": "def podfile_dependencies\n Set.new(podfile.target_definitions.values.map { |t| t.dependencies.map { |d| d.name } }.flatten)\n end",
"title": ""
},
{
"docid": "f02c94b0e27b9f879ff65f4bf0514d2a",
"score": "0.5963133",
"text": "def deps\n # Get all dependencies\n deps = Shell.call(%(go list -f '{{join .Deps \"\\\\n\"}}' #{@targets.join(' ')})).strip.split\n # Remove standard library\n Shell.call(\"go list std\").strip.split.each do |pkg|\n deps.delete(pkg)\n end\n\n deps\n end",
"title": ""
},
{
"docid": "1180fb337d7649e0b0cf19798f2e5338",
"score": "0.5951222",
"text": "def latest_load_paths\n result = []\n Gem.path.each do |gemdir|\n each_load_path(latest_partials(gemdir)) do |load_path|\n result << load_path\n end\n end\n result\n end",
"title": ""
},
{
"docid": "7b5935ab0c4fa73ba6424c258f7f5f78",
"score": "0.59487236",
"text": "def dependencies\n if !@dependencies\n @dependencies = @pkginfoask.send(:dependencies,@pkg)\n end\n @dependencies\n end",
"title": ""
},
{
"docid": "c59fe0e139db89ed238d663dff06e282",
"score": "0.59366846",
"text": "def dependencies\n @dependencies ||= loader.dependencies\n end",
"title": ""
},
{
"docid": "56264f41ad605f58d7c21a5542fc759c",
"score": "0.59354234",
"text": "def recursive_deps\n Formula.expand_deps(self).flatten.uniq\n end",
"title": ""
},
{
"docid": "ada12a114de4e205d5930feaf8a8c856",
"score": "0.59295213",
"text": "def package_ids\n deps = cabal_packages.flat_map { |n| package_dependencies(n, false) }\n recursive_dependencies(deps)\n end",
"title": ""
},
{
"docid": "47699ed85ab2bfedd4f45f1078949f0c",
"score": "0.5926959",
"text": "def bin_paths\n path.children.reject{ |child| child.basename.to_s =~ /^lib/ }\n end",
"title": ""
},
{
"docid": "e463dce8ddfaf7374fc46dfc48a05ec0",
"score": "0.5926228",
"text": "def gemfile_deps(gemfile)\n if File.exist?(gemfile)\n parse_gemfile(gemfile).dependencies\n else\n []\n end\n end",
"title": ""
},
{
"docid": "6a20f1ad53ba77fd4b4e43018add4bfd",
"score": "0.59259915",
"text": "def get_library_paths\n @library_paths.collect {|i| File.expand_path(i.gsub('$(PROJECT_DIR)', @project_folder))}\n end",
"title": ""
}
] |
f3cd6335643afc42d38159b1ec2e7341 | use this format to change status: | [
{
"docid": "949547e90116b98e648ffbb0a6fa5335",
"score": "0.0",
"text": "def method_missing(key, *args)\n if s=STATUSES.detect {|e| e == key.to_s.gsub(/(\\?|!)$/, '').titleize}\n if key.to_s[-1] == \"!\"\n self.status = s\n elsif key.to_s[-1] == \"?\"\n self.status == s\n end\n else\n raise NoMethodError, \"undefined method `#{key}` for #{self}\"\n end\n end",
"title": ""
}
] | [
{
"docid": "601a1b360e99ce50182b8c89e9184e5b",
"score": "0.7474982",
"text": "def status=(v)\n @status = alma_string v\n end",
"title": ""
},
{
"docid": "0a34039c0761e788cd397bad0988f7b7",
"score": "0.74647725",
"text": "def status=(new_status)\n super new_status.to_s\n end",
"title": ""
},
{
"docid": "0a34039c0761e788cd397bad0988f7b7",
"score": "0.74647725",
"text": "def status=(new_status)\n super new_status.to_s\n end",
"title": ""
},
{
"docid": "f692e389cb3314469e0110b5d9b23784",
"score": "0.7424085",
"text": "def set_status(status)\n \tif status == 0\n \t\treturn \"Uncompleted\"\n \telsif status == 1\n \t\treturn \"In Progress\"\n \telse \n \t\treturn \"Completed\"\n \tend\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376747",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7376466",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7375894",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7375894",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7375894",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.7375894",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "95abbf82b6367ee48fd28473a1605787",
"score": "0.73755",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "fe575c5c8ba32a734f0412421fd13327",
"score": "0.73569745",
"text": "def status=(status); end",
"title": ""
},
{
"docid": "fe575c5c8ba32a734f0412421fd13327",
"score": "0.73569745",
"text": "def status=(status); end",
"title": ""
},
{
"docid": "a4638dec77f94aeea8fba71d1e1e8aff",
"score": "0.73400116",
"text": "def status=(value)\n title,body,icon = value\n time = Time.now.strftime(\"%H:%M:%S\")\n new_body = body.tr(\"\\n\",\" \")\n @status_list << [\"#{time}\",\"<b>#{title}</b> #{new_body}\"]\n @status = value\n end",
"title": ""
},
{
"docid": "d88aac5211dc89425cd72745957a5d6e",
"score": "0.73299414",
"text": "def status=(s)\n raise \"Unknown status #{s}\" unless STATUSES.include? s.to_s\n\n @status = s.to_s\n end",
"title": ""
},
{
"docid": "0b8818f0892d272cff952bd78d7e8003",
"score": "0.73101807",
"text": "def convert_status\n case status\n when 0\n return \"New\"\n when 1\n return \"Outstanding\"\n when 2\n return \"Completed\"\n end\n end",
"title": ""
},
{
"docid": "bd3f230245b4bdec3d4a600e9d0831c8",
"score": "0.7284703",
"text": "def update_status!\n s = case\n when !submitted? then :in_progress\n when requires_approval? && submitted? && !approved? then :pending\n when submitted? && approved? && !checked_out? && !checked_in? then :approved\n when checked_out? && late? then :late\n when checked_out? then :checked_out\n when checked_in? && late? then :returned_late\n when checked_in? && !checkin_ok? then :returned_damaged\n when checked_in? then :returned\n else :unknown\n end\n self.status = s.to_s\n end",
"title": ""
},
{
"docid": "266f05efde4be9f6df853ad5665bbce6",
"score": "0.7261545",
"text": "def status= (value)\n write_attribute(:status, value.to_s)\n end",
"title": ""
},
{
"docid": "6e72864b9fd91f5e19b3591792cbec6d",
"score": "0.7259781",
"text": "def status=(status)\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.72547513",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "bec20d77e8b776b03dae2e185fa8fb75",
"score": "0.7253944",
"text": "def status=(value)\n @status = value\n end",
"title": ""
},
{
"docid": "5fcd06044df20979195dcfafabf3d9d2",
"score": "0.7245567",
"text": "def status=(value)\n case value.to_s\n when 'success'\n @status = :success\n when 'failed'\n @status = :failed\n else\n @status = :failed\n end\n\n @status\n end",
"title": ""
},
{
"docid": "5681b087d104b45487c7933f2fb0eeae",
"score": "0.72349316",
"text": "def set_status(s)\n self.status = s\n save\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.7223948",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.72226894",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.72226894",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "4dd3c4437d6a7a610dfa3623ec21c0e2",
"score": "0.72226894",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "9e3cd55fd1cdbd9ec8e6ea9947a8aaf8",
"score": "0.72151256",
"text": "def change_status(status)\n @status = status\n end",
"title": ""
},
{
"docid": "6b61ba9d9fd5307815dd24e2aa739806",
"score": "0.72012097",
"text": "def status(new_status, message = '')\n @status = new_status\n log \"#{@status.to_s.capitalize} #{message}\"\n end",
"title": ""
},
{
"docid": "1838d3c479da4f68ab811541d898949b",
"score": "0.7137412",
"text": "def status=(status)\n @status = status.to_sym\n end",
"title": ""
},
{
"docid": "a6d237f14dea993f09740297a65dfc3b",
"score": "0.7127524",
"text": "def convert_status(status)\n case status\n when 'pending' then 'В ожидании'\n when 'shipped' then 'Отправлен'\n when 'completed' then 'Завершен'\n when 'cancelled' then 'Отменен'\n end\n end",
"title": ""
},
{
"docid": "131ba5a9fdebf5266841951f063065fe",
"score": "0.7116177",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "131ba5a9fdebf5266841951f063065fe",
"score": "0.7116177",
"text": "def set_Status(value)\n set_input(\"Status\", value)\n end",
"title": ""
},
{
"docid": "044fb855b1874c584c27a33bdab693c1",
"score": "0.7093006",
"text": "def status=(status)\n @status = status.to_i\n end",
"title": ""
},
{
"docid": "881490fbb74aa2d5c6fad7b0f5555fee",
"score": "0.7082567",
"text": "def set_status(status_level)\n # status level 0 - unconfirmed\n # status level 1 - more info\n # status level 2 - confirmed\n \n \n if status_level.to_i <= 2 && status_level.to_i >= 0\n self.status = status_level.to_i\n end\n \n end",
"title": ""
},
{
"docid": "0115bec9e3a6fdd429664990da572f7f",
"score": "0.70775217",
"text": "def status=(s)\n write_attribute(:status, STATUS[s])\n end",
"title": ""
},
{
"docid": "61cddcec5ded9507666899d2ee59bfdf",
"score": "0.70562065",
"text": "def status\n\t\t@status.to_s\n\tend",
"title": ""
},
{
"docid": "b9767f60203f0d372d54afbfaa55089b",
"score": "0.7025643",
"text": "def update_status\n if self.status.nil?\n self.status = \"Ordered\"\n end\n end",
"title": ""
},
{
"docid": "156eb9725d90a99db8ff240435777604",
"score": "0.7023794",
"text": "def status(status, args = nil)\n\t\t\t\targs ||= {}\n\n\t\t\t\tif status.is_a?(Hash) then\n\t\t\t\t\targs.merge!(status)\n\t\t\t\telse\n\t\t\t\t\targs[:status] = status\n\t\t\t\tend\n\n\t\t\t\tstatus = status.is_a?(Hash) ? status[:status] : status\n\t\t\t\targs[:end] = @@statuses[status] || @@statuses[:ok]\n\t\t\t\targs[:dots] = false\n\t\t\t\targs[:up] = true if args[:up] == nil\n\t\t\t\tself.write(args)\n\t\t\tend",
"title": ""
}
] |
1102c3cbf8fe2da31afc3e5d5f59eb5e | PUT /picoposts/1 PUT /picoposts/1.xml | [
{
"docid": "3af84929729159094f0dc951e3678ea0",
"score": "0.64539707",
"text": "def update\n @picopost = Picopost.find(params[:id])\n\n respond_to do |format|\n if @picopost.update_attributes(params[:picopost])\n format.html { redirect_to(@picopost, :notice => 'Picopost was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @picopost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.6335881",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.5843228",
"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": "2db8510634a8588feaf130b0ace4c384",
"score": "0.5818631",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.5783734",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.5768207",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.56661576",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "25d4aadb716ffcef2d82b0c74fdd8d8c",
"score": "0.5664383",
"text": "def create\n @picopost = Picopost.new(params[:picopost])\n\n respond_to do |format|\n if @picopost.save\n format.html { redirect_to(@picopost, :notice => 'Picopost was successfully created.') }\n format.xml { render :xml => @picopost, :status => :created, :location => @picopost }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @picopost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84b4074cc772dfb573c94309d8fa9745",
"score": "0.5655041",
"text": "def picasa_update!\n resp, data = client.update_photo picasa_id, description, file\n \n if resp.code != \"200\" or resp.message != \"OK\"\n raise Picasa::Exception, \"Error updating photo: #{resp.message}.\"\n end\n \n populate_attributes_from_xml data\n end",
"title": ""
},
{
"docid": "5d083b185c82e90d46ed167c547b71a2",
"score": "0.5629802",
"text": "def update\n @sinapost = Sinapost.find(params[:id])\n\n respond_to do |format|\n if @sinapost.update_attributes(params[:sinapost])\n format.html { redirect_to(@sinapost, :notice => 'Sinapost was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sinapost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a0ca3aa42545e4a44a6fda208abe599",
"score": "0.5575852",
"text": "def update\n @pic = Pic.find(params[:id])\n\n respond_to do |format|\n if @pic.update_attributes(params[:pic])\n flash[:notice] = 'Pic was successfully updated.'\n format.html { redirect_to(@pic) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10ff7ce777a573481648bfcb5ae48a64",
"score": "0.5564745",
"text": "def update\n @scrap_photo = ScrapPhoto.find(params[:id])\n\n respond_to do |format|\n if @scrap_photo.update_attributes(params[:scrap_photo])\n flash[:notice] = 'ScrapPhoto was successfully updated.'\n format.html { redirect_to(@scrap_photo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @scrap_photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e54e35da561b25cc0c79906a896da87",
"score": "0.55540645",
"text": "def update\n @post = Post.find(params[:id])\n unless params[:photo_ids].empty?\n Photo.destroy_pics(params[:id], params[:photo_ids])\n end\n \n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(@post) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.55481106",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "d0fba1bf3c5e1dc0008c27994e1dabe4",
"score": "0.5547139",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "2a40d0e4f982ee4cc151c0086f84f85d",
"score": "0.5527069",
"text": "def update\n @ppost = Ppost.find(params[:id])\n\n respond_to do |format|\n if @ppost.update_attributes(params[:ppost])\n flash[:notice] = 'Ppost was successfully updated.'\n format.html { redirect_to(@ppost) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ppost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efb1dfd2f25df0d846795a21656da38f",
"score": "0.5519535",
"text": "def update\n @pic = Pic.find(params[:id])\n\n respond_to do |format|\n if @pic.update_attributes(params[:pic])\n format.html { redirect_to(@pic, :notice => 'Pic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01d220d909b7ef76866d0942457b40e9",
"score": "0.55122274",
"text": "def destroy\n @picopost = Picopost.find(params[:id])\n @picopost.destroy\n\n respond_to do |format|\n format.html { redirect_to(picoposts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "361b67b69ef3a2a29a3dc14b8de58f6f",
"score": "0.55076104",
"text": "def update\n @pic_tag = PicTag.find(params[:id])\n\n respond_to do |format|\n if @pic_tag.update_attributes(params[:pic_tag])\n flash[:notice] = 'PicTag was successfully updated.'\n format.html { redirect_to(@pic_tag) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pic_tag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "429908b278cc6ac86e69875ec808d68c",
"score": "0.5484665",
"text": "def show\n @picopost = Picopost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @picopost }\n end\n end",
"title": ""
},
{
"docid": "c713d8b4c23b0477e8766eceb58a27b2",
"score": "0.54612476",
"text": "def update\n respond_to do |format|\n if @post.update_attributes(post_params)\n if params[:images]\n # The magic is here ;)\n params[:images].each.with_index { |image, index|\n @post.photos.create(image: image, position: index)\n }\n end\n format.html { redirect_to posts_path, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", notice: \"Update failed. Please check the form.\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.54591066",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "1cd84609f1986e88bfc90fdaaef22778",
"score": "0.54575115",
"text": "def update\n @yahoopost = Yahoopost.find(params[:id])\n\n respond_to do |format|\n if @yahoopost.update_attributes(params[:yahoopost])\n format.html { redirect_to(@yahoopost, :notice => 'Yahoopost was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @yahoopost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d855d0ac39ff9b3c921b7b76f148603d",
"score": "0.5457241",
"text": "def update\n @miceopost = Miceopost.find(params[:id])\n\n respond_to do |format|\n if @miceopost.update_attributes(params[:miceopost])\n format.html { redirect_to @miceopost, notice: 'Miceopost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @miceopost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08928a8dcb9d3bc993fd21219d4e79a0",
"score": "0.5446117",
"text": "def update\n respond_to do |format|\n # spot = HTTParty.get(\"http://localhost:3000/spots/#{params[:id]}\" )\n if @spot.update(spot_params)\n HTTParty.patch(\"http://localhost:3000/spots/#{params[:id]}?name=#{spot_params[:name]}&lat=#{spot_params[:lat]}&lon=#{spot_params[:lon]}&description=#{spot_params[:description]}&features=#{spot_params[:features]}&spot_type=#{spot_params[:spot_type]}&img=#{spot_params[:img]}\")\n @spot.spot_photos.attach(params[:spot][:spot_photos])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9339a4ad093c8ca1f5d44d675f9ac44e",
"score": "0.5413583",
"text": "def update\n @pic = Pic.find(params[:id])\n\n respond_to do |format|\n if @pic.update_attributes(params[:pic])\n format.html { redirect_to(@pic, :notice => 'Se ha actualizado la imagen correctamente') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9910d2b11c70ca94dc6c10b92cbd5d89",
"score": "0.53991145",
"text": "def update\n pid = params[:pid]\n @existing_record = ExistingRecord.find_by_pid(pid)\n \tdoc = Nokogiri::XML.parse( request.body.read )\n # do we have to remove the display if it's there?\n\n if doc.children.first.keys.include?('prefix')\n doc.children.first.delete('prefix')\n end\n\n\n #also, some of the records in fedora datastream don't seem to be in xml.\n #what then? fail? convert it? might not be valid record!!\n @existing_record.xml = doc\n if @existing_record.valid_vra?\n\n \t resp = dil_api_update_image( pid, doc.children )\n if resp.include?(\"Error\")\n render action: 'edit', :pid => pid, :status => 400\n else\n @existing_record.save\n render json: {:localName => \"#{root_url}\"}\n end\n else\n errors = @existing_record.validate_vra\n flash[:error] = errors\n render action: 'edit', :pid => pid, :status => 400\n end\n end",
"title": ""
},
{
"docid": "09f2f662a23ffed2f4db5eb82212b02b",
"score": "0.53837866",
"text": "def picasa_save!\n if self.picasa_id and self.picasa_id.length > 0\n return picasa_update!\n end\n \n resp, data = client.post_photo description, file\n \n if resp.code != \"201\" or resp.message != \"Created\"\n raise Picasa::Exception, \"Error posting photo: #{resp.message}.\"\n end\n \n populate_attributes_from_xml data\n end",
"title": ""
},
{
"docid": "d9a94623afb2f843dddfeaef530230b7",
"score": "0.5379515",
"text": "def edit_post\n id = params[:id] # retrieve movie ID from URI route\n edit_file(Xfile.find(id), params[:property], params[:value])\n\n params[:group_id].each do |group_id|\n group = Group.find(group_id)\n group.xfiles.each do |xfile|\n edit_file(xfile, params[:property], params[:value])\n end\n end\n\n redirect_to xfiles_path\n end",
"title": ""
},
{
"docid": "e232dd40e85425203436803f46d3ed9d",
"score": "0.5368071",
"text": "def update\n\n # Get specified post, making sure it exists\n post = Post.find(params[:post_id])\n\n params[:picture].each do |id, data|\n\n # Set any empty location_ids in the picture data to NULL\n if data['location'] == nil || data['location'] == ''\n data['location'] = 'NULL'\n end\n\n # Escape single quotes in titles and descriptions\n data['title'] = data['title'].gsub(/'/, \"'\")\n data['description'] = data['description'].gsub(/'/, \"'\")\n\n # Update picture\n Picture.connection.update(\"UPDATE pictures\n SET title = '#{data['title']}',\n description = '#{data['description']}',\n location_id = #{data['location']},\n sequence = #{data['sequence']}\n WHERE id = #{id} LIMIT 1\")\n end\n\n # Update facebook profile, as sequence changes may have changed the leading\n # thumbnail on the post summary\n post.update_facebook_profile\n\n # Redirect back to edit pictures action\n flash[:notice] = 'Your pictures were updated.'\n redirect_to edit_pictures_url(:post_id => params[:post_id])\n end",
"title": ""
},
{
"docid": "29941d420d154d3ea377e2c6b966ed82",
"score": "0.53496224",
"text": "def update\n @image = @post.images.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to(@image, :notice => 'Image was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @image.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79121d7adfeb2d07385a70660e2cb796",
"score": "0.53445613",
"text": "def update\n respond_to do |format|\n if @topfoto.update(topfoto_params)\n format.html { redirect_to @topfoto, notice: 'Post atualizado' }\n format.json { render :show, status: :ok, location: @topfoto }\n else\n format.html { render :edit }\n format.json { render json: @topfoto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1180b85a98a5e652f2c5f2f1e253ca7",
"score": "0.5337755",
"text": "def put\n end",
"title": ""
},
{
"docid": "7aeb0c9531cc054ff42117a2db63b08a",
"score": "0.53199875",
"text": "def update\n @pig = Pig.find(params[:id])\n\n respond_to do |format|\n if @pig.update_attributes(params[:pig])\n format.html { redirect_to(@pig, :notice => 'Pig was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pig.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b808be11956dc858d803a992f44ecfc",
"score": "0.5310971",
"text": "def update\n @post = Post.get!(params[:id])\n type = @post.couchdb_type.name.downcase\n if (@file = params[type].delete(:file)) && !@file.empty?\n @post.add_attachment(@file['tempfile'], { :content_type => @file['content_type'], :name => @post.attachment_name })\n params[type][:name] = @file['filename']\n end\n\n if @post.update_attributes(params[type]) || !@post.dirty?\n redirect url(:post, @post.id), :message => { :notice => 'Post updated' }\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "b0e786cf6b2c3c3b24dff5871880e1d7",
"score": "0.5303731",
"text": "def update\n @pist = Pist.find(params[:id])\n\n respond_to do |format|\n if @pist.update_attributes(params[:pist])\n flash[:notice] = 'Pist was successfully updated.'\n format.html { redirect_to(@pist) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3461cf6405819171e2d72ec349744577",
"score": "0.52934515",
"text": "def update\n respond_to do |format|\n\n if @spot.update(spot_params)\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n if params[:spot][:photos]\n @spot.photos.attach(params[:spot][:photos])\n end\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3fae9e18774682384f964f9fc7aab12",
"score": "0.5292525",
"text": "def update\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n if @shot.update_attributes(params[:shot])\n flash[:notice] = 'Shot was successfully updated.'\n format.html { redirect_to(@shot) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f29b1f83d4b1eb9b7f7c57161bf57eb",
"score": "0.52848554",
"text": "def update\n @scrap_xml = ScrapXml.find(params[:id])\n\n respond_to do |format|\n if @scrap_xml.update_attributes(params[:scrap_xml])\n flash[:notice] = 'ScrapXml was successfully updated.'\n format.html { redirect_to(@scrap_xml) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @scrap_xml.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa4afad4159acb5227851a58530e8926",
"score": "0.52789253",
"text": "def edit\n\n # Make sure the specified post exists and pass it through\n @post = Post.find(params[:post_id])\n\n # Pass through all pictures attached to the specified post, in sequence\n # order\n @pictures = Picture.find_all_by_post_id(params[:post_id], :order => 'sequence')\n end",
"title": ""
},
{
"docid": "dbe737a9b526c6ce839721cccca37a38",
"score": "0.52777827",
"text": "def test_should_update_picture\n put :update, :id => 1, :picture => { }\n assert_response :redirect\n end",
"title": ""
},
{
"docid": "affedafd13211272eb91d7c57f3041ea",
"score": "0.5247723",
"text": "def update\n @micoropost = Micoropost.find(params[:id])\n\n respond_to do |format|\n if @micoropost.update_attributes(params[:micoropost])\n format.html { redirect_to @micoropost, notice: 'Micoropost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @micoropost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "238fd956be713471aa406c76bf19254a",
"score": "0.52389175",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "1308e2aec2b24f8d3f1fbc1a120db8f6",
"score": "0.523433",
"text": "def update\n respond_to do |format|\n if @tag.update_attributes(params[:post])\n format.xml { head :ok }\n else\n format.xml { render :xml => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45b6be76a814e2583211cce1d089736c",
"score": "0.5231683",
"text": "def update\n \n @picture = Picture.find(params[:id])\n\n\n respond_to do |format|\n if @picture.update_attributes(params[:picture])\n\n flash[:notice] = I18n.t('pictures.controller.Successfully_updated')\n format.html { redirect_to(url_for_even_polymorphic(@picture)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @picture.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65a7aa68d93c0a595d366a2108cb185d",
"score": "0.5227151",
"text": "def update\n @post_image = PostImage.find(params[:id])\n\n respond_to do |format|\n if @post_image.update_attributes(params[:post_image])\n flash[:notice] = 'PostImage was successfully updated.'\n format.html { redirect_to(@post_image) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post_image.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "820175830fe525471ba146f908135cee",
"score": "0.5225361",
"text": "def new\n @picopost = Picopost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picopost }\n end\n end",
"title": ""
},
{
"docid": "7a313af1436c6a2262f13bdeef97d358",
"score": "0.52239275",
"text": "def update\n @photo = Photo.find(params[:id])\n @photo.attributes = params[:photo]\n @photo.thumb_x = params[:x1] if params[:x1]\n @photo.thumb_y = params[:y1] if params[:y1]\n @photo.thumb_l = (@photo.thumb_vertical) ? params[:height] : params[:width] if params[:height] and params[:width]\n \n @photo.alter_photo_sets(params[:photo_sets]) if params.has_key?(:photo_sets)\n \n respond_to do |format| \n if @photo.save\n flash[:notice] = \"Photo successfully updated\"\n format.html { redirect_to formatted_photo_url(@photo, :html) }\n format.xml { head :ok } \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "efc1c60e722eea964bbf108697d1a2b6",
"score": "0.5222121",
"text": "def update\n @gympost = Gympost.find(params[:id])\n\n respond_to do |format|\n if @gympost.update_attributes(params[:gympost])\n format.html { redirect_to(@gympost, :notice => 'Gympost was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gympost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6e8fd4e616bc20eba5d992db3102906",
"score": "0.5220298",
"text": "def update\n respond_to do |format|\n if @microopost.update(microopost_params)\n format.html { redirect_to @microopost, notice: 'Microopost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @microopost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97c424d873111c1c8d3ced40db82bb63",
"score": "0.52195406",
"text": "def update\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n if @shot.update_attributes(params[:shot])\n format.html { redirect_to(@shot, :notice => 'Shot was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.5212025",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "b893d32bae90c49640f499b215f6a6b3",
"score": "0.5207969",
"text": "def update\n respond_to do |format|\n if @post.update_attributes(params[:post])\n\n if files = params[:file]\n files.keys.each do |file_num|\n fls = {}\n fls[:uploaded_data] = files[file_num]\n @post.attachments << Attachment.new(fls)\n end\n end\n\n flash[:notice] = t('general.notice_msg_updated')\n format.html { redirect_to(@post) }\n format.xml { head :ok }\n else\n \n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f46c9121719bab09e7bfd0fda57bd9b9",
"score": "0.5196661",
"text": "def update\n @poet = Poet.find(params[:id])\n\n respond_to do |format|\n if @poet.update_attributes(params[:poet])\n flash[:notice] = 'Poet was successfully updated.'\n format.html { redirect_to(@poet) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @poet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "922d2a543d4c61397fd8c68ca4729c64",
"score": "0.5178431",
"text": "def update\n respond_to do |format|\n if @micoropost.update(micoropost_params)\n format.html { redirect_to @micoropost, notice: 'Micoropost was successfully updated.' }\n format.json { render :show, status: :ok, location: @micoropost }\n else\n format.html { render :edit }\n format.json { render json: @micoropost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5cc6c0da3274cd1ef2957240240750be",
"score": "0.51676834",
"text": "def update\n @photo = Photo.find(params[:id])\n @tags = params[:photo][:tagslist].split(',')\n @tags.each{|tagName|\n @tag = Tag.find_by_name(tagName);\n if @tag == nil\n @tag = Tag.new\n @tag.name = tagName\n @tag.save\n end\n @photo.tags << @tag\n }\n @beforeUpdatePublished= @photo.isPublished?\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n if (@photo.isPublished? && !@beforeUpdatePublished) \n postToTwitter(\"New picture on #doyoueatcupcakes ! : \"+ request.url)\n end\n format.html { redirect_to(@photo, :notice => 'Photo was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n format.json { render :json => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1c6c0248da3df587af944d405918a54",
"score": "0.51674765",
"text": "def update\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n if @picture.update_attributes(params[:picture])\n flash[:notice] = 'Picture was successfully updated.'\n format.html { redirect_to(@picture) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @picture.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.5162762",
"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": "862867be06a9d8a127430c595cd2a9c4",
"score": "0.515145",
"text": "def update\n @place = Place.find(params[:id])\n @pictures = @place.pictures\n @place.lastchange_by = current_user\n\n @service = PlaceService.new(@place, @pictures)\n\n respond_to do |format|\n if @service.update_attributes(params[:place], [params[:img_file]])\n# , params[:img_file1]\n# , params[:img_file2]])\n flash[:notice] = 'Place was successfully updated.'\n format.html { redirect_to(@place) }\n format.xml { head :ok }\n else\n flash[:error] = 'Place update failed.'\n @pictures = @service.pictures\n format.html { render :action => :edit }\n format.xml { render :xml => @place.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "862867be06a9d8a127430c595cd2a9c4",
"score": "0.515145",
"text": "def update\n @place = Place.find(params[:id])\n @pictures = @place.pictures\n @place.lastchange_by = current_user\n\n @service = PlaceService.new(@place, @pictures)\n\n respond_to do |format|\n if @service.update_attributes(params[:place], [params[:img_file]])\n# , params[:img_file1]\n# , params[:img_file2]])\n flash[:notice] = 'Place was successfully updated.'\n format.html { redirect_to(@place) }\n format.xml { head :ok }\n else\n flash[:error] = 'Place update failed.'\n @pictures = @service.pictures\n format.html { render :action => :edit }\n format.xml { render :xml => @place.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.5145611",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "30d08ec0a629efc033036e65a30ddf33",
"score": "0.5144733",
"text": "def update\n @post152 = Post152.find(params[:id])\n\n respond_to do |format|\n if @post152.update_attributes(params[:post152])\n format.html { redirect_to(@post152, :notice => 'Post152 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post152.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae122de3e0a1784ac8efe5d28bf398f6",
"score": "0.5144229",
"text": "def update\n respond_to do |format|\n if @micopost.update(micopost_params)\n format.html { redirect_to @micopost, notice: 'Micopost was successfully updated.' }\n format.json { render :show, status: :ok, location: @micopost }\n else\n format.html { render :edit }\n format.json { render json: @micopost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "807f10d0e61c5be72e0f3ef90453dc58",
"score": "0.5139779",
"text": "def update\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n if @picture.update_attributes(params[:picture])\n format.html { redirect_to(@picture, :notice => 'Picture was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @picture.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8412ae6b6cb28b7a0ebf6ff3e3dd661e",
"score": "0.51354194",
"text": "def update\n @photos = params[:photos]\n #@photo = Photo.find(params[:id])\n #@photo.user_id = params[:id]\n @photos.each do |key, value|\n @photo = Photo.find(key)\n #raise @photo.inspect\n @photo.title = value[:title]\n @photo.description = value[:description]\n unless @photo.save!\n render :action => \"edit\"\n end\n\n #raise key.inspect\n #Photo.update(key, {:title => value[:title], :description => value[:description]})\n end\n respond_to do |format|\n #if @photo.update_attributes(params[:photo])\n format.html { redirect_to(:action => 'index')}\n #format.xml { head :ok }\n #else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n #end\n end\n end",
"title": ""
},
{
"docid": "1cbe94cf5ae463ae62968a48de83c69e",
"score": "0.5133145",
"text": "def update\n @ptag = Ptag.find(params[:id])\n\n respond_to do |format|\n if @ptag.update_attributes(params[:ptag])\n flash[:notice] = 'Ptag was successfully updated.'\n format.html { redirect_to(@ptag) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ptag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47e1a52dda6cec4b210afc9e8358890c",
"score": "0.51325285",
"text": "def update\n @thing = Thing.find(params[:id])\n\n params[:thing].delete :photo if params[:thing][:photo].nil?\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n flash[:notice] = \"#{@thing.name} was updated.\"\n format.html { redirect_to(@thing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "032f720d633fcd84430d6572774571d9",
"score": "0.5130881",
"text": "def update\n @newspost = Newspost.find(params[:id])\n\n respond_to do |format|\n if @newspost.update_attributes(params[:newspost])\n format.html { redirect_to(@newspost, :notice => 'Newspost was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @newspost.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7be9614c6b8cfab74768c8d81429b46",
"score": "0.51299506",
"text": "def update\n @minipost = Minipost.find(params[:id])\n\n respond_to do |format|\n if @minipost.update_attributes(params[:minipost])\n format.html { redirect_to @minipost, notice: 'Minipost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @minipost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f9e50df3e301df2edd990d0aefd546e",
"score": "0.51216626",
"text": "def update\n @topping = Topping.find(params[:id])\n\n respond_to do |format|\n if @topping.update_attributes(params[:topping])\n flash[:notice] = 'Topping was successfully updated.'\n format.html { redirect_to(@topping) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topping.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37a623bda704bf639389126b39033203",
"score": "0.51212543",
"text": "def update\n @poi = Poi.find(params[:id])\n\n respond_to do |format|\n if @poi.update_attributes(params[:poi])\n format.html { redirect_to(@poi, :notice => 'Poi was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @poi.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1f436273e6967f9a7e6d83e8e7d3731",
"score": "0.5120607",
"text": "def update\n @flickr_photo = FlickrPhoto.find(params[:id])\n\n respond_to do |format|\n if @flickr_photo.update_attributes(params[:flickr_photo])\n format.html { redirect_to(@flickr_photo, :notice => 'FlickrPhoto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @flickr_photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fc9d0ddafd412e0e52b11325fc941b6",
"score": "0.5119092",
"text": "def publish\n @post = Post.find(params[:id])\n @doc = @post.document\n \n respond_to do |format|\n if @post.update_attributes(:status => \"To Be Published\") \n flash[:notice] = \"#{@action_success_message}\"\n format.html { redirect_to session[:return_to] }\n # format.html { redirect_to page_document_url(@doc.page,@doc) }\n format.xml { head :ok }\n else\n flash[:notice] = \"#{@action_failure_message}\"\n format.html { render :action => \"show\"}\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83ef4accee73b1bc8c02b343ac841054",
"score": "0.51058155",
"text": "def update\n @microspost = Microspost.find(params[:id])\n\n respond_to do |format|\n if @microspost.update_attributes(params[:microspost])\n format.html { redirect_to @microspost, notice: 'Microspost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microspost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed46275f8f6f9727cd9c5632ce04964c",
"score": "0.51052374",
"text": "def update\n # Given the ID and Trend_Name and Comment Text, update\n uuid = params[:uuid]\n topic = params[:topic]\n comment = params[:comment]\n location_id = params[:location_id]\n\n # # to change later\n # uuid = \"91de7ee4-1cde-4aa8-9d0e-e16f46236d2f\"\n # comment = \"this is awesome111111!\"\n # topic = \"soytanrudo\"\n\n url= \"http://localhost:8080\"\n get_str = \"exist/atom/content/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\"%uuid\n r = RestClient::Resource.new url\n res = r[get_str].get\n #puts res\n\n atom_string = res\n user_comment = comment\n\n atom_xml = Nokogiri::XML(atom_string)\n\n comment_ns = \"http://my.superdupertren.ds\"\n\n # assume the item exists and that there's only one of them\n topic_node = atom_xml.xpath(\"//tw:trend[@topic='\"+topic+\"']\", {\"tw\" => \"http://api.twitter.com\"})[0]\n\n puts \"Topic\"\n puts topic\n puts \"Comment\"\n puts user_comment\n\n comment_nodes = topic_node.xpath(\"//tw:trend[@topic='\"+topic+\"']/cm:user_comment\", {\"tw\" => \"http://api.twitter.com\", \"cm\" => comment_ns})\n if (comment_nodes.first)\n # Find user_comment node first and edit it\n comment_nodes.first.content = user_comment\n puts \"we found the comment nodes!!!!\"\n else\n # Create new node and add\n new_node = Nokogiri::XML::Node.new(\"user_comment\", atom_xml)\n new_node.add_namespace(nil, comment_ns)\n new_node.content = user_comment\n topic_node.add_child(new_node)\n end\n\n #update entry\n #puts atom_xml.to_xml\n\n url= \"http://localhost:8080\"\n r = RestClient::Resource.new url\n post_str = \"exist/atom/edit/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\" % uuid\n res = r[post_str].put atom_xml.to_xml, :content_type => \"application/atom+xml\"\n\n #puts res\n render :xml => res\n\n end",
"title": ""
},
{
"docid": "1be44c3e0ba097e5e9e3383b5907538c",
"score": "0.5098698",
"text": "def update(id, member=\"Default member\", rating=\"9\", venue_Name=\"Default Venue_Name\", address=\"Default Address\", city=\"Default City\", phone=\"9999999999\" , date=\"\" , comment= \"Default Comment\")\r\n\t\txml_req =\r\n\t\t\"<?xml version='1.0' encoding='UTF-8'?>\r\n\t\t\t<review>\r\n\t\t\t\t<Member>#{member}</Member>\r\n\t\t\t\t<Rating>#{rating}</Rating>\r\n\t\t\t\t<Venue-Name>#{venue_Name}</Venue-Name>\r\n\t\t\t\t<Address>#{address}</Address>\r\n\t\t\t\t<City>#{city}</City>\r\n\t\t\t\t<Phone>#{phone}</Phone>\r\n\t\t\t\t<Date-of-Visit>date</Date-of-Visit>\r\n\t\t\t\t<Comment>#{comment}</Comment>\t\t\t\t\t\r\n\t\t\t</review>\"\r\n\r\n\t\trequest = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n\t\trequest.add_field \"Content-Type\", \"application/xml\"\r\n\t\trequest.body = xml_req\r\n\r\n\t\thttp = Net::HTTP.new(@uri.host, @uri.port)\r\n\t\tresponse = http.request(request)\r\n\r\n\t\t# no response body will be returned\r\n\t\tcase response\r\n\t\twhen Net::HTTPSuccess\r\n\t\t\treturn \"#{response.code} OK\"\r\n\t\telse\r\n\t\t\treturn \"#{response.code} ERROR\"\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "517ae64c469250516ef12cdc8e51a6a4",
"score": "0.50973946",
"text": "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update(post_params)\n if params[:images]\n params[:images].each { |image|\n @post.pictures.create(image: image)\n }\n end\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a1714e982770d446a53cd0c423f88b3",
"score": "0.509718",
"text": "def update\n @spot = Spot.find(params[:id])\n @tags = @spot.items\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to(spots_url, :notice => 'Spot was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e16b6252a3f804255529ec67e41c9728",
"score": "0.5094255",
"text": "def update\n @photoset_photo = PhotosetPhoto.find(params[:id])\n\n respond_to do |format|\n if @photoset_photo.update_attributes(params[:photoset_photo])\n format.html { redirect_to(@photoset_photo, :notice => 'Photoset photo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photoset_photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a48b3229e830876ae619b936301400b2",
"score": "0.509315",
"text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end",
"title": ""
},
{
"docid": "e7f157e1805c52a57255d9cdd1397587",
"score": "0.50923026",
"text": "def set_micopost\n @micopost = Micopost.find(params[:id])\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.5091666",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "09cc83c227a0506084d4f43985349b79",
"score": "0.50915813",
"text": "def update\n #expire_index_page\n @photo = Photo.find(params[:id])\n if (params[:photo][:publish_at] == \"do_not_change\")\n params[:photo][:publish_at] = @photo.publish_at\n end\n # needs to be here, do not works after update_attributes\n @photo.seconds_to_add = 0\n \n \n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n # change of photo - we need to delete old thumbnail and photo and create\n # new\n unless params[:photo][:image_file].nil?\n params[:photo][:image_file].each do |image|\n @photo.image_file = image\n @photo.write_file\n end\n end\n #params[\"photo\"].delete(\"image_file\")\n\n flash[:notice] = t(:photo_succ_updated)\n format.html { redirect_to([:admin, @photo]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7adff61c5774374c29aa84b0aee56aeb",
"score": "0.50894386",
"text": "def update\n @publish = Publish.find(params[:id])\n\n respond_to do |format|\n if @publish.update_attributes(params[:publish])\n flash[:notice] = 'Publish was successfully updated.'\n format.html { redirect_to(@publish) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @publish.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "028483648fdc152fbee98b231051a8f9",
"score": "0.5086622",
"text": "def update\n @moto_post = MotoPost.find(params[:id])\n\n respond_to do |format|\n if @moto_post.update_attributes(params[:moto_post])\n format.html { redirect_to(@moto_post, :notice => 'Moto post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @moto_post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10130552c0a0032a0bf94ea80a196229",
"score": "0.50760096",
"text": "def update\n @topogra = Topogra.find(params[:id])\n\n respond_to do |format|\n if @topogra.update_attributes(params[:topogra])\n flash[:notice] = 'Topogra was successfully updated.'\n format.html { redirect_to(@topogra) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topogra.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cce33f4024c7a68f7911919e5510d2f8",
"score": "0.5075096",
"text": "def put(options)\n post(options)\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.50740916",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "a9054fe41f5f09324d7556fb23b50ba4",
"score": "0.5065782",
"text": "def update\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n flash[:notice] = 'Photo was successfully updated.'\n format.html { redirect_to(@photo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9054fe41f5f09324d7556fb23b50ba4",
"score": "0.5065782",
"text": "def update\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n flash[:notice] = 'Photo was successfully updated.'\n format.html { redirect_to(@photo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9054fe41f5f09324d7556fb23b50ba4",
"score": "0.5065782",
"text": "def update\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n flash[:notice] = 'Photo was successfully updated.'\n format.html { redirect_to(@photo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9054fe41f5f09324d7556fb23b50ba4",
"score": "0.5065782",
"text": "def update\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n flash[:notice] = 'Photo was successfully updated.'\n format.html { redirect_to(@photo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "358d775246ac7c71eeafc53ee93f688b",
"score": "0.5063874",
"text": "def update\n @post83 = Post83.find(params[:id])\n\n respond_to do |format|\n if @post83.update_attributes(params[:post83])\n format.html { redirect_to(@post83, :notice => 'Post83 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post83.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "346a75349bbaa2253f04de6993f73e52",
"score": "0.5061612",
"text": "def update\n @spot = Spot.find(params[:id])\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n flash[:notice] = 'Spot updated successfully'\n format.html { redirect_to spot_path(@spot_path) }\n format.xml { head :ok }\n else\n flash[:error] = 'There were problems updating the spot'\n format.html { render :action => 'edit' }\n format.xml { render :xml => @spot.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "7b4e613a17076311f0bff93883002310",
"score": "0.5059537",
"text": "def update\n @take = Take.find(params[:id])\n @take.address = Address.find_by_address(params[:take][:address_id])\n if params[:pictures][:image]\n @pic=Picture.new(params[:pictures])\n @take.pictures<<@pic\n end\n\n respond_to do |format|\n if @take.update_attributes(params[:take])\n format.html { redirect_to @take, :notice => 'Take was successfully updated.' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @take.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7828b1a0968eae0f638ec951023716e",
"score": "0.5058846",
"text": "def update\n @picturecomment = Picturecomment.find(params[:id])\n\n respond_to do |format|\n if @picturecomment.update_attributes(params[:picturecomment])\n flash[:notice] = 'Picturecomment was successfully updated.'\n format.html { redirect_to(@picturecomment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @picturecomment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52fbf052e39a2736ded1d732156f9f76",
"score": "0.505811",
"text": "def update\n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n # flash[:notice] = 'Photo was successfully updated.'\n format.html { redirect_to(@photo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75d3d5f3ac2a57a51483481181d40a7d",
"score": "0.5056509",
"text": "def update\n @spoke = Spoke.find(params[:id])\n\n respond_to do |format|\n if @spoke.update_attributes(params[:spoke])\n format.html { redirect_to @spoke, notice: 'Spoke was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spoke.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "063ba15d080369ead75e30f61337c420",
"score": "0.5054091",
"text": "def update\n @photospace = Photospace.find(params[:id])\n\n respond_to do |format|\n if @photospace.update_attributes(params[:photospace])\n flash[:notice] = 'Photospace was successfully updated.'\n format.html { redirect_to(@photospace) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photospace.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb993352852071365e5fd4a5884850ae",
"score": "0.5050255",
"text": "def update\n respond_to do |format|\n if @p_ost.update(p_ost_params)\n format.html { redirect_to @p_ost, notice: \"P ost was successfully updated.\" }\n format.json { render :show, status: :ok, location: @p_ost }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @p_ost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a64ea2151b8360cea0fe97ce1705b3a4",
"score": "0.50482994",
"text": "def picasa_update_attributes! params\n resp, data = client.update_album self.picasa_id, params\n\n if resp.code != \"200\" or resp.message != \"OK\"\n raise Picasa::Exception, \"Error updating album.\"\n end\n \n populate_attributes_from_xml data\n end",
"title": ""
}
] |
025928a321723e9941a5a655264b85ac | Method for checking parameters from "select_params" | [
{
"docid": "44a8173c6164ce8c5b6446b66275149a",
"score": "0.5847647",
"text": "def check_params2(params, action='list')\r\n # check first for #nr genes > 400 which can cause browser errors\r\n nr_genes = params[:genes].split.size if params[:genes]\r\n if nr_genes && nr_genes > 400\r\n params[:genes] = '' #reset params[:genes] to avoid browser errors\r\n flash[:notice] = \"Too many genes (#{nr_genes}) in list - please limit to 400 genes\"\r\n rc = 'e2'\r\n\r\n elsif !params[:genes].blank?\r\n rc = 'g'\r\n\r\n else\r\n # error - genes are blank\r\n flash[:notice] = 'Please select one or more gene(s) for this query'\r\n rc = 'e1'\r\n end\r\n return rc\r\n end",
"title": ""
}
] | [
{
"docid": "2122b8e308d79b43550b07ac5b626455",
"score": "0.68996936",
"text": "def valid_select(result, arr, request)\n if validate_select_query(result)\n val_result = validate_select_query_params(arr, request)\n if val_result == true\n request.run\n else\n p val_result\n end \n else\n p \"Invalid Order\" \n end\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.68310654",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.68310654",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "8a8814eb8051f78604b7c16a9e120ccf",
"score": "0.6752274",
"text": "def params_ok?(*) end",
"title": ""
},
{
"docid": "e05fcfeefde45d542fd9222eaebff0d3",
"score": "0.67218816",
"text": "def select_non_empty_parameters params\n select_parameters params, :nil => false, :empty_string => false\n end",
"title": ""
},
{
"docid": "d05b15b8604eedad6b48c9862f6986ef",
"score": "0.6668531",
"text": "def chosen?\n if !parameter.is_a?(Array) || parameter.reject(&:empty?).blank?\n @message = I18n.t('caz_selection_form.la_missing')\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "3975591026297f19af154d16b576cb0a",
"score": "0.65977836",
"text": "def select_parameters\n data[:select_parameters]\n end",
"title": ""
},
{
"docid": "82bc64938486f39bb220d16cd1d03355",
"score": "0.64930487",
"text": "def valid_params\n params.select{ |x| x.valid? }\n end",
"title": ""
},
{
"docid": "66af4519a555a89eabeaed5717dd5d5b",
"score": "0.6461322",
"text": "def check_point_params\n params.select{|key,value| key.in?(CheckPoint.column_names())}\n end",
"title": ""
},
{
"docid": "34317a1e6a02f6e99bea6e6b49ce6ee4",
"score": "0.64544964",
"text": "def selects?(field_name, selected_type: T.unsafe(nil), arguments: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ba0704d4182a1a6fb0a743f6eb9cd25e",
"score": "0.642406",
"text": "def check_params\n\t\t\t return []\t\t\t \n\tend",
"title": ""
},
{
"docid": "78da07c25b86c35619b77c4d1f079be6",
"score": "0.6371434",
"text": "def check_params(params, param_type)\n if param_type == 'proj_gene'\n if params[:oligo_design] && params[:oligo_design][:gene_code]\n # if gene_list[0].blank? then \"all genes\" was selected from drop-down\n # set rc=p if \"all genes\", => retrieve all genes for the selected project\n # set rc=g otherwise, => retrieve just the genes selected\n gene_list = params[:oligo_design][:gene_code]\n rc = (gene_list[0].blank? ? 'p' : 'gl')\n \n elsif params[:project] \n #only project entered, so will retrieve all genes for that project\n rc = 'p'\n else\n # error - neither project or gene were selected\n flash[:notice] = 'Please select project and/or gene(s)'\n rc = 'e2'\n end\n \n else #param_type == 'gene_id'\n nr_genes = params[:genes].split.size if params[:genes]\n if nr_genes && nr_genes > 400\n params[:genes] = '' #reset params[:genes] to avoid browser errors\n flash[:notice] = \"Too many genes (#{nr_genes}) in list - please limit to 400 genes\"\n rc = 'e3'\n \n # oligo ids if entered, take priority over genes, so check for ids first\n elsif !params[:oligo_ids].blank?\n rc = 'id'\n \n elsif !params[:genes].blank?\n rc = 'gt'\n \n else\n # error - both genes and oligo ids are blank\n flash[:notice] = 'Please select gene(s) or id(s)'\n rc = 'e4'\n end\n end\n \n return rc\n end",
"title": ""
},
{
"docid": "e8b2d0704a4f6459ef221d17ae4f726c",
"score": "0.6364495",
"text": "def check_params *param\n raise RequestError.new(:missing_params, \"Missing parameters, need all of #{param}\") unless param.all? { |p| has_param? p }\n end",
"title": ""
},
{
"docid": "f32b53d1145f72e78cb283682e0ff701",
"score": "0.6356013",
"text": "def select_params\n params.fetch(:select, {})\n end",
"title": ""
},
{
"docid": "ddcd7d1dc5c1cb004c18edd97a1729ea",
"score": "0.63469875",
"text": "def record_select_conditions_from_controller; end",
"title": ""
},
{
"docid": "ddcd7d1dc5c1cb004c18edd97a1729ea",
"score": "0.63469875",
"text": "def record_select_conditions_from_controller; end",
"title": ""
},
{
"docid": "893719d64b9934e19bb7dfc0b72b0964",
"score": "0.63012075",
"text": "def validate!\n each do |param, value|\n raise StandardError, \"Query parameter '#{param}' is not supported.\" unless @@params_descriptions.key? param\n description = @@params_descriptions[param]\n case description\n when Array;\n raise StandardError, \"Param '#{param}' has to be one of '#{description}'\" unless description.include?(value)\n when Class;\n raise StandardError, \"Param '#{param}' has to be instance of class '#{description}'\" unless value.is_a? description\n when :boolean;\n raise StandardError, \"Param '#{param}' should be true or false.\" unless [true, false].include?(value)\n when :date_or_time;\n raise StandardError, \"Param '#{param}' should be Date, Time or DateTime.\" unless [Date,Time,DateTime].include?(value.class)\n end\n end\n end",
"title": ""
},
{
"docid": "171a6b00696d2795a3b5a3bbc3691bf2",
"score": "0.6299748",
"text": "def has_select?(locator = T.unsafe(nil), **options, &optional_filter_block); end",
"title": ""
},
{
"docid": "8e519fbf8b7f524a91ac5c7f842a6121",
"score": "0.6229082",
"text": "def validate_params_present!; end",
"title": ""
},
{
"docid": "f1ac77475a9971e1ae9762c61158fe4d",
"score": "0.62250865",
"text": "def check_params(params)\n\t\tif !params.instance_of?(Hash)\n\t\t\tfail(UserError, \"Die Parameter sind keine Hash-Struktur!\")\n\t\telsif params.empty?\n\t\t\tfail(UserError, \"Die Parameter sind leer!\")\n\t\telsif !params.has_key?(:lang)\n\t\t\tfail(UserError, \"Der Parameter \\'lang\\' hat keinen Wert!\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7d0c272b77cd7386a65438de15240508",
"score": "0.62230647",
"text": "def incorrect_params\n params.select{ |x| x.incorrect? }\n end",
"title": ""
},
{
"docid": "bb56a7ad36bc393b432d4d14646e887d",
"score": "0.6191417",
"text": "def no_options_passed?\n @params.empty?\n end",
"title": ""
},
{
"docid": "47b77c3146f01c63ec2a3246c6867ba7",
"score": "0.61866504",
"text": "def match_params\n end",
"title": ""
},
{
"docid": "c8be151000010811968c55fadd1f1562",
"score": "0.61463577",
"text": "def check_parameter(*parameter)\n parameter.each do |p|\n halt 400, \"query parameter #{p} is required\" unless params[p]\n end\n end",
"title": ""
},
{
"docid": "060a6849a8c430bb49daeaff0f1c020f",
"score": "0.6139088",
"text": "def select_params\n @select_params ||=\n params.require(:select).permit(\n :concrete_field_id, \n :count_id,\n :value,\n :input_method,\n :lookup_type,\n :page,\n :first_filter,\n :fuzzy_filter,\n :position,\n :from,\n :to, \n :blanks,\n :exclude,\n :user_file_id,\n lookup_params: [:centroid]\n )\n @select_params[:value] = nil if @select_params[:value] == ''\n @select_params\n end",
"title": ""
},
{
"docid": "70add3d6dd243760370b9f487a7275ad",
"score": "0.61271864",
"text": "def record_select_conditions_from_params\n conditions = nil\n params.each do |field, value|\n next unless column = record_select_config.model.columns_hash[field]\n conditions = merge_conditions(\n conditions,\n record_select_condition_for_column(column, value)\n )\n end\n conditions\n end",
"title": ""
},
{
"docid": "dc3849c39baf2dc7e5dea3740ea62977",
"score": "0.6123787",
"text": "def check_unknown_options!; end",
"title": ""
},
{
"docid": "898202fbfb0700af3094e12f6efe532a",
"score": "0.61225826",
"text": "def record_select_conditions_from_params\n conditions = []\n ignored_columns = %w[controller action page search update]\n params.each do |field, value|\n next if field.in? ignored_columns\n column = record_select_config.model.columns_hash[field]\n conditions << record_select_condition_for_column(column, value) if column\n end\n conditions\n end",
"title": ""
},
{
"docid": "bdddffa2f4b45c4d84530d6c36dcaf45",
"score": "0.60806775",
"text": "def valid_option_by? option_by\n %w(text value index).include? option_by\nend",
"title": ""
},
{
"docid": "c7c7cf0a6ccb4051f4c7d0829b73e676",
"score": "0.60780597",
"text": "def invalid_params\n params.select{ |x| x.invalid? }\n end",
"title": ""
},
{
"docid": "0102c7d15a488412f677bb4d687fb901",
"score": "0.60747576",
"text": "def check_params(options,params)\n # In this case we are being called passing a hash (or something like that), in this case \n # we use the normal check when callong\n if options.respond_to?(:keys)\n return options\n else\n # now we are using the one parameter form, so there is no need to use a hash (we build it)\n if params.size == 1 \n return {params.first => options}\n else\n raise NotEnoughParams\n end\n end\n end",
"title": ""
},
{
"docid": "dfea9425d767ad8336a1d64fe6d35e99",
"score": "0.6073363",
"text": "def validate_query_param_existences\n query_params = [\"url\", \"width\", \"height\"]\n\n missing_params=[]\n message = \"\"\n query_params.each do |param|\n begin\n params.require(param)\n rescue ActionController::ParameterMissing\n missing_params.push param\n end\n end\n\n if missing_params.size > 0\n message = \"Missing params #{missing_params}\"\n end\n return message\n end",
"title": ""
},
{
"docid": "4f481e24c39a631f103ef927cbd1a998",
"score": "0.60650796",
"text": "def chk_parm(l, nr)\n\t\tif not l[nr]\n\t\t\tsv_send 461, @nick, l[0], ':Not enough parameters'\n\t\t\treturn true\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b12ca617712e288758c25df1003fc309",
"score": "0.6064133",
"text": "def correct_params\n params.select{ |x| x.correct? }\n end",
"title": ""
},
{
"docid": "7b181ce28a448a65392c9817f14ab3eb",
"score": "0.60544014",
"text": "def validate(params)\n params.keys.all? do |param|\n PARAMETERS.member? param\n end\n end",
"title": ""
},
{
"docid": "9405e808a46e9fe2ee60debd1729b233",
"score": "0.6023751",
"text": "def check_any_params *param\n raise RequestError.new(:missing_params, \"Missing parameters, need any of #{param}\") unless param.any? { |p| has_param? p }\n end",
"title": ""
},
{
"docid": "9eadf3f574c3689307ac041c31517863",
"score": "0.6017081",
"text": "def select_options=(_arg0); end",
"title": ""
},
{
"docid": "56e1a96155936483e4d73c22e518c805",
"score": "0.60127366",
"text": "def parsed_select\n params[:select].split(',').map do |field|\n field if @records.column_names.include?(field)\n end\n rescue NoMethodError\n []\n end",
"title": ""
},
{
"docid": "bf853d7772a722698bae9929b3dacc0d",
"score": "0.6007991",
"text": "def set_select_params_with_permit(permitted_fields)\n fields_text = params[:select] || \"\"\n permitted_fields ||= []\n fields = fields_text.split(\",\")\n .map{ |field_text| field_text.strip.to_sym }\n .select{ |field| permitted_fields.include?(field) }\n if fields.empty?\n @select = permitted_fields\n else\n @select = fields\n end\n return @select\n end",
"title": ""
},
{
"docid": "9c38bb10486792f26eef78d49508b2c5",
"score": "0.59868836",
"text": "def validate()\n if !@select.to_s.strip.empty? and @from.to_s.strip.empty?\n raise 'FROM clause is required with SELECT'\n end\n if !@from.to_s.strip.empty? and @select.to_s.strip.empty?\n raise 'SELECT clause is required with FROM'\n end\n if !@offset.nil? and @limit.nil?\n raise 'LIMIT clause is required with OFFSET'\n end\n unless @limit.is_a? Integer or @limit.nil?\n raise 'LIMIT must be an integer'\n end\n unless @offset.is_a? Integer or @offset.nil?\n raise 'OFFSET must be an integer'\n end\n end",
"title": ""
},
{
"docid": "f6960504d3462869f0ac643ff7a828b9",
"score": "0.5971073",
"text": "def par_selected?\n if self.query.eql?(\"PAR\")\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "e6f1090b46e800c23297a9a778bfb7ee",
"score": "0.59486103",
"text": "def is_valid_parameter?(options)\n platforms = get_platforms\n if options[:param_name] == \"os\"\n if platforms.has_key?(options[:param_value])\n true\n else\n false\n end\n elsif options[:param_name] == \"version\"\n if platforms[\"#{options[:os_value]}\"].include?(options[:param_value])\n true\n else\n false\n end\n elsif options[:param_name] == \"arch\"\n if options[:param_value] == \"x86_64\" || options[:param_value] == \"i386\"\n true\n else\n false\n end\n end\nend",
"title": ""
},
{
"docid": "7cfca81de5db0f6ef9243628daaef850",
"score": "0.59114456",
"text": "def define_conditions(params, ptype, version_id)\n condition_array = []\n condition_array[0] = 'blank'\n select_conditions = []\n \n case ptype\n when 'id' #list of ids entered\n id_list = create_array_from_text_area(params[:oligo_ids], 'integer')\n select_conditions.push('id IN (?)')\n condition_array.push(id_list)\n \n when 'gl' #gene list entered (as array from drop-down)\n gene_list = params[:oligo_design][:gene_code]\n select_conditions.push('gene_code IN (?)')\n condition_array.push(gene_list)\n \n when 'gt' #gene list entered (as text)\n gene_list = create_array_from_text_area(params[:genes])\n select_conditions.push('gene_code IN (?)')\n condition_array.push(gene_list)\n \n when 'p' #project entered, without entering specific genes, so get all genes for project\n gene_list = ProjectGene.genelist(params[:project], nil)\n select_conditions.push('gene_code IN (?)')\n condition_array.push(gene_list)\n end\n \n if params[:enzyme] && !param_blank?(params[:enzyme][:enzyme_code])\n select_conditions.push('enzyme_code IN (?)')\n condition_array.push(enzyme_add_gapfill(params[:enzyme][:enzyme_code]))\n end\n \n select_conditions.push('version_id = ?')\n condition_array.push(version_id)\n condition_array[0] = select_conditions.join(' AND ')\n return condition_array \n end",
"title": ""
},
{
"docid": "ebcba59c24f97162a40d964f0d00533e",
"score": "0.59073734",
"text": "def list_selected\n param_type = params[:param_type] ||= 'proj_gene'\n @version_id = Version::version_id_or_default(params[:version][:id])\n \n error_found = false \n # check for correct number of parameters entered\n # must have project/gene(s), or id(s)\n @rc = check_params(params, param_type)\n \n if @rc =~ /e\\d/ # error code ('e' followed by digit)\n error_found = true \n else\n @condition_array = define_conditions(params, @rc, @version_id)\n excl_flagged = (params[:excl_flagged] == 'true' ? 'yes' : 'no')\n @oligo_designs = OligoDesign.find_oligos_with_conditions(@condition_array, @version_id,\n {:excl_flagged => excl_flagged})\n # return error if no oligos found\n error_found = check_if_blank(@oligo_designs, 'oligos', @rc) \n end\n \n if error_found\n redirect_to :action => 'select_params', :project => params[:project]\n else\n render :action => 'list_selected'\n end\n end",
"title": ""
},
{
"docid": "914fc0b55a3fb3319fad9bb1ed4194b8",
"score": "0.58997345",
"text": "def has_reserved_param?\n reserved_params.any?\n end",
"title": ""
},
{
"docid": "6b9d3a33b08d096c0224937619b45a3b",
"score": "0.5891916",
"text": "def ensure_params(necessary_params)\n necessary_params.all?(&method(:ensure_param))\n end",
"title": ""
},
{
"docid": "b881569dcea54138187e98d0ec66e6e2",
"score": "0.58910537",
"text": "def select_valid_options(operation_name, options)\n introspect = ::Vips::Introspect.get(operation_name)\n operation_options = introspect.optional_input.keys.map(&:to_sym)\n\n options.select { |name, value| operation_options.include?(name) }\n end",
"title": ""
},
{
"docid": "4f258c1dcae7c7ab406be8ea66344ded",
"score": "0.5883174",
"text": "def check_params(item, params)\n if params.empty?\n true\n else\n bools=params.map do |k,v| \n#puts \"|#{item[k.to_s]}=?#{v}|\"\n item[k.to_s].nil? ? false: item[k.to_s].downcase == v.downcase\n end\n bools.inject{|a,b| a && b}\n end\n end",
"title": ""
},
{
"docid": "3217ef718f946c65833d5a4b4702081c",
"score": "0.58770627",
"text": "def __validate_selection_with_raise(argument, valid_params)\n raise ArgumentError, \"URL parameter '#{argument}' is not supported\" unless valid_params.include?(argument)\n argument\n end",
"title": ""
},
{
"docid": "4b6a5eec84b0181310fc42fe3356383f",
"score": "0.58765507",
"text": "def simple_select_all?\n o = @opts.reject{|k,v| v.nil? || NON_SQL_OPTIONS.include?(k)}\n o.length == 1 && (f = o[:from]) && f.length == 1 && f.first.is_a?(Symbol)\n end",
"title": ""
},
{
"docid": "60146269d51a1a5156b99c9156db72da",
"score": "0.5875931",
"text": "def pattern_params_in_select\n <<-EOT\n DynamicString<\n array = [\n any*,\n ToString<\n value = SendWithArguments<\n name = :[],\n receiver = Send<name = :params>\n >\n >,\n any*\n ],\n string ^= \"SELECT\"\n >\n EOT\n end",
"title": ""
},
{
"docid": "60146269d51a1a5156b99c9156db72da",
"score": "0.5875931",
"text": "def pattern_params_in_select\n <<-EOT\n DynamicString<\n array = [\n any*,\n ToString<\n value = SendWithArguments<\n name = :[],\n receiver = Send<name = :params>\n >\n >,\n any*\n ],\n string ^= \"SELECT\"\n >\n EOT\n end",
"title": ""
},
{
"docid": "7ce319299b0024a77363b48c5b859861",
"score": "0.5857146",
"text": "def validate_option_fields!(fields)\n fields.uniq!\n #check to make sure all fields exist\n #TODO Write check code for multi-table... ignoring this for now\n missing_fields = []\n fields.each do |f|\n missing_fields << f.to_s unless column_names().include?(f.to_s) or f.to_s.include?(\".\")\n end\n raise ArgumentError, \"Missing fields: #{missing_fields.sort.join(\",\")} in acts_as_tsearch definition for \n table #{table_name}\" if missing_fields.size > 0\n end",
"title": ""
},
{
"docid": "f5eb31d6aa63f05e3cf92548c0c18059",
"score": "0.5856736",
"text": "def validate_input\n is_valid_option = false\n $valid_options.each { |option|\n if !@params[:option] || @params[:option] == option\n is_valid_option = true\n end\n }\n is_valid_filter = true\n if @params[:option] == 'newest' || @params[:option] == \"vote\"\n is_valid_filter = false\n $valid_filters.each { |filter|\n if !@params[:filter].nil? && @params[:filter] == filter\n is_valid_filter = true\n end\n }\n end\n is_valid_filter & is_valid_option\n end",
"title": ""
},
{
"docid": "2cab742af9fdc99d27be3fd6d499c28f",
"score": "0.5849116",
"text": "def check_params!(params)\n params.each do |key, param|\n raise ArgumentError.new(\"missing keyword: #{key}\") if param.nil? || param.empty?\n end\n end",
"title": ""
},
{
"docid": "97d2dd414aaead4ac10dd3c699ffd709",
"score": "0.58458996",
"text": "def validate_parameter_names()\n @parameter_names.each do |parameter_name|\n if !VALID_PARAMETER_NAMES.include?(property_name)\n #errors.add :parameter_names, \"Value %{value} not supported. Supported GetDomain ParameterName values are: #{@@VALID_PARAMETER_NAMES}\"\n end\n end\n end",
"title": ""
},
{
"docid": "b33516b3ddafaf4caddd8c6447eb0cf1",
"score": "0.5842074",
"text": "def complex_select_options?(node)\n node[1].message.to_s == 'options_for_select' && node.arguments.all.first.sexp_type == :array &&\n node.arguments.all.first.array_size > @array_count\n end",
"title": ""
},
{
"docid": "660d8dc9dfccc79613624beb6c3c516c",
"score": "0.5838698",
"text": "def validate_params?\n true # TODO: add validation\n end",
"title": ""
},
{
"docid": "3c6f9247909cb2fb4f85ce828bdb572a",
"score": "0.58379954",
"text": "def valid_params?(table, params) \n table = table.capitalize.constantize\n table_properties = []\n table.properties.each do |property|\n table_properties << property.name.to_s\n end\n unless params.nil? || params.empty? \n check = params.map do |k, v|\n table_properties.include?(k)\n end\n !check.include?(false)\n else\n true\n end\n end",
"title": ""
},
{
"docid": "4873d10fb0ca6c800a8b6c740d2dc056",
"score": "0.58365774",
"text": "def validate_values\n @days_format = OrderRefill.get_select_values\n @search_by_values = OrderRefill.get_search_values\n #checking whether search for(textbox) value is empty string and search by(select box) value is other than \"all\"\n if params[:search_for_refill].blank? && params[:search_by_refill] != \"all\"\n flash.now[:alert] = I18n.translate(\"error\",:scope => \"open_orders.validate_values\")\n render :index\n end\n #End of checking whether search for(textbox) value is empty string and search by(select box) value is other than \"all\"\n end",
"title": ""
},
{
"docid": "bed00ecaa768535b9a8020ad3d1e4a3b",
"score": "0.5830699",
"text": "def valid_find_options?\n return false if search_by.blank?\n return false if search_value.blank?\n SEARCH_BY_OPTIONS.include?(search_by.try(:to_sym)) ? true : false\n end",
"title": ""
},
{
"docid": "9258dd7a84f3025a125a5b12a6e428c7",
"score": "0.5814448",
"text": "def check_pool_params(pool_params)\n # FIXME\n pool_params\n end",
"title": ""
},
{
"docid": "2a9e2f3d18c7a903816e697c5cc2eec3",
"score": "0.5809078",
"text": "def verify_params(supplied_params)\n missing_params = ''\n return missing_params if self.required_params.to_s.empty?\n params_to_verify = self.required_params.gsub(' ', '').split(',')\n params_to_verify.each do |param|\n missing_params << \"#{param} \" if !param.in?(supplied_params)\n end\n return missing_params\n end",
"title": ""
},
{
"docid": "26a6a119389129a425ea212e96d443da",
"score": "0.58066905",
"text": "def selects?(name, key, val, tags_in) ; true end",
"title": ""
},
{
"docid": "6feda7be5bbd66f7ebe8209ec27c1ce8",
"score": "0.5803805",
"text": "def validate_query_params\n if index?\n super(BranchConstants::INDEX_QUERY_PARAMS) \n end\n if show?\n super(BranchConstants::SHOW_QUERY_PARAMS)\n end\n end",
"title": ""
},
{
"docid": "554fe1ae603b85b00890265c14af7707",
"score": "0.57954115",
"text": "def check_params\n\t\t\tbegin\n\t\t\t\tyield\n\t\t\trescue ActionController::ParameterMissing => e\n\t\t\t\trender json: {msg: \"Faltan datos.\", type: :danger}, status: :bad_request\n\t\t\trescue StandardError => e\n\t\t\t\tputs \"Around ERROR:\"\n\t\t\t\tputs e\n\t\t\t\tputs \"Around ERROR backtrace:\"\n\t\t\t\tputs e.backtrace\n\t\t\t\traise e\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "ffd6091a1e4c5fa31e6a53d5bc0f2446",
"score": "0.5794397",
"text": "def params_fail?\n params[:origin_a].blank? || params[:origin_b].blank? || params[:date_there].blank? || params[:date_back].blank?\n end",
"title": ""
},
{
"docid": "3c29b3d304e9743d7d58730510d8eb69",
"score": "0.57826567",
"text": "def validate_parameters(data)\n true\n end",
"title": ""
},
{
"docid": "83e9bc7ec67c5fa69a55b0e603bf84d3",
"score": "0.57781774",
"text": "def select_field_params\n params.fetch(:select_field, {})\n end",
"title": ""
},
{
"docid": "4441e8b67b414784096ea676e14fcbac",
"score": "0.57727075",
"text": "def match_option?(params)\n checks = {}\n Augeas::open do |aug|\n # Build the regex i.e. /files/etc/fstab/*[vfstype=~ regexp('^(ext3|ext2)$')\n regex = \"^(#{params[:values].join('|')})$\"\n matches = aug.match(\"/files/etc/fstab/*[#{params[:key]}=~ regexp('#{regex}')]\")\n unless matches.empty?\n matches.each do |match|\n aug.context = match\n # Skip over any excluded files from our parms\n if params[:excluded]\n next if params[:excluded].include? aug.get('file')\n end\n\n # Check for single option args (defaults) or multi i.e. (gid=5)\n options = aug.match('opt[*]|opt')\n\n # Loop through the options looking for the correct value\n options.each do |option|\n params[:required].each do |required|\n if aug.get(option) == required\n checks[\"#{option}:#{required}\"] = 'Passed'\n else\n checks[\"#{option}:#{required}\"] = 'Failed'\n end\n end\n end\n end\n end\n end\n # If we have been given a default then return that otherwise true\n result = params[:default] || true\n\n # Return false if any of the checks were failed\n if checks.detect {|k,v| v == 'Failed'}\n result = false\n end\n result\nend",
"title": ""
},
{
"docid": "782c05f91cf3e0d4e86d53a984071a41",
"score": "0.5757406",
"text": "def get_selected_columns_from_params(params, selected_columns)\n\t\tcolumns = []\n\t\t\n\t\tparams[selected_columns].each do |key, value|\n\t\t\tcolumns << key if value == \"1\" # Form value for checked\n\t\tend\n\n\t\tcolumns\n\tend",
"title": ""
},
{
"docid": "a5e13343bbaa6996f24ebf1363331f7e",
"score": "0.5747881",
"text": "def valid_parameter?(name)\n @attributes.include?(name) || METAPARAMSET.include?(name)\n end",
"title": ""
},
{
"docid": "1c305425e5cfc6ef9d6878e206bb3646",
"score": "0.5747778",
"text": "def params_check(*args)\n if !args.include?(nil)\n yield\n else\n render(json: { status: \"bad\", message: \"There was a problem processing your request, please check your parameters.\" }.to_json, status: :bad_request ) and return\n end\n end",
"title": ""
},
{
"docid": "1b03720ce75e8993fd6eb9a897620d61",
"score": "0.5746164",
"text": "def select_options; end",
"title": ""
},
{
"docid": "ce984afdc1659423be47866b7c9dacf7",
"score": "0.57418066",
"text": "def check_parameters\n errors = \"\"\n @url.scan(/:(\\w*)/).flatten.map(&:to_sym).each do |arg|\n errors += \"<li><p>parameter '#{arg.to_s}' is required</p></li>\" unless @attributes.has_key?(arg)\n end\n errors.empty? ? \"\" : \"<ul>#{errors}</ul>\"\n end",
"title": ""
},
{
"docid": "56b6aac7ab6acb7f2b7e9870c6c75d3d",
"score": "0.5735539",
"text": "def has_not_mandatory_params?\n !params[:station_id].present? || !params[:code].present?\n end",
"title": ""
},
{
"docid": "49987896bfa7c14215e4332fadb83190",
"score": "0.5735295",
"text": "def configured?; check_params; end",
"title": ""
},
{
"docid": "7053bcf03a44b8f1596fa4c5b9e02306",
"score": "0.57313293",
"text": "def validate_params(params)\n if params.size < 2\n raise OptionValidationError.new(\"CHEFVAL002\", self)\n end\n\n if params.size == 2\n # Trying to specify a recipe to run remotely, no properties\n cb = params[1]\n if File.exist?(cb)\n # This is a path specification, and we know it is valid\n elsif cb =~ /^#{CB_MATCHER}$/ || cb =~ /^#{CB_MATCHER}::#{CB_MATCHER}$/\n # They are specifying a cookbook as 'cb_name' or 'cb_name::recipe'\n else\n raise OptionValidationError.new(\"CHEFVAL004\", self, cb)\n end\n elsif params.size >= 3\n properties = params[3..-1]\n properties.each do |property|\n unless property =~ PROPERTY_MATCHER\n raise OptionValidationError.new(\"CHEFVAL003\", self, property)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d88d969bb19bd5aecbb327915933edea",
"score": "0.57257116",
"text": "def validate_params(params)\n if params && params.any?\n params.each do |param, value|\n unless value.kind_of? @params[param]\n raise TheMealDbApiClient::Error::ValidationError.new, \"Invalid param #{param} value.\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "bc1db82059e8c43fb48b4c3eb9eee0e2",
"score": "0.5722136",
"text": "def has_not_mandatory_params?\n !params[:view_human].present? || !params[:value].present?\n end",
"title": ""
},
{
"docid": "71f97bda880101aa36b21017c0787f98",
"score": "0.5720443",
"text": "def validate_params\n invalid_parameter = @params.find { |key, value| !ConsolidatedScreeningList::PARAMETERS.key?(key) }\n raise ArgumentError, \"Invalid parameter: #{@params}\" if invalid_parameter\n end",
"title": ""
},
{
"docid": "09f78547c2c7101a2ce78ef965126bbd",
"score": "0.57193065",
"text": "def check_search_param\n params[:speciality].blank? && params[:therapist_type].blank? && params[:state].blank? && params[:zipcode].blank? && params[:name].blank? && params[:payment_type].blank? ? true : false\n end",
"title": ""
},
{
"docid": "def45f48c52c826b7c08bb78cb772704",
"score": "0.5715298",
"text": "def check_parameter_value(*parameter)\n parameter.each do |p|\n v = params[p]\n if v.is_a? String and v.strip.empty?\n halt 400, \"query parameter #{p} should not be empty\"\n end\n end\n end",
"title": ""
},
{
"docid": "1eb0634c62329cd1240ada7b5938c2f4",
"score": "0.5714817",
"text": "def validate \n # first check whether combo fields have been selected\n\t is_valid = true\n\t \n end",
"title": ""
},
{
"docid": "846415fab285c220c6bcd3059d41527c",
"score": "0.571268",
"text": "def validate_parameter(*param)\n param.each do |a|\n return false unless a && (a.to_s =~ /^\\{.*\\}$/) == nil && a != '' && a != {}\n end\n end",
"title": ""
},
{
"docid": "846415fab285c220c6bcd3059d41527c",
"score": "0.571268",
"text": "def validate_parameter(*param)\n param.each do |a|\n return false unless a && (a.to_s =~ /^\\{.*\\}$/) == nil && a != '' && a != {}\n end\n end",
"title": ""
},
{
"docid": "0e5d054843e623956a586a86cf20270a",
"score": "0.57086986",
"text": "def list_selected\r\n error_found = false\r\n @rc = check_params2(params)\r\n\r\n case @rc\r\n when /e\\d/ # error code ('e' followed by digit)\r\n error_found = true\r\n \r\n when 'g' #gene list entered\r\n gene_list = create_array_from_text_area(params[:genes])\r\n @oligo_designs = OligoDesign.find_selectors_with_conditions(['gene_code IN (?)', gene_list])\r\n error_found = check_if_blank(@oligo_designs, 'oligos', 'gene(s)')\r\n end\r\n\r\n if error_found\r\n redirect_to :action => 'select_params', :genes => params[:genes]\r\n else\r\n render 'list_selected'\r\n end\r\n end",
"title": ""
},
{
"docid": "02e6b46c0b8427aa0176239667143bd1",
"score": "0.57077074",
"text": "def check_params params\n unless params[:db].is_a?Sequel::Database\n raise 'Database connection is supposed to be Sequel::Database. %s given'%params[:database_connection].class.name\n end\n unless params[:dot_template_path].nil? || params[:dot_template_path].is_a?(String) || File.exist?(params[:dot_template_path])\n raise 'Template path is supposed to be string with an existing file. %s given'%params[:dot_template_path].inspect\n end\n unless params[:logger].nil? || params[:logger].is_a?(Logger)\n raise 'Logger is supposed to be... Logger, know. %s given'%params[:logger].inspect\n end\n unless params[:colored_associations].nil? || !!params[:colored_associations] == params[:colored_associations]\n raise 'Colored association is supposed to be boolean. %s given'%params[:colored_associations].inspect\n end\n end",
"title": ""
},
{
"docid": "31bbc9a273d90992935d53b5503832d6",
"score": "0.5702307",
"text": "def check_parametertype( parametertype ) #:nodoc:\n if !(parametertype == :parameter or parametertype == :length )\n Kernel::raise(\"Invalid parametertype value #{parametertype}\")\n end\n end",
"title": ""
},
{
"docid": "adcbb0f739539c54fa9ffec9d326e0ca",
"score": "0.56985503",
"text": "def set_params\n params.select{ |x| x.set? }\n end",
"title": ""
},
{
"docid": "d713bd3837816adabe16ffd578c890b1",
"score": "0.56964576",
"text": "def get_selected_columns_from_params(params, selected_columns)\n columns = []\n\n params[selected_columns].each do |key, value|\n columns << key if value == \"1\" # Form value for checked\n end\n\n columns\n end",
"title": ""
},
{
"docid": "56a8d67e3107c148ff7031f481ea5be2",
"score": "0.5691278",
"text": "def parameters?\n parameters.values.all?\n end",
"title": ""
},
{
"docid": "56a8d67e3107c148ff7031f481ea5be2",
"score": "0.5691278",
"text": "def parameters?\n parameters.values.all?\n end",
"title": ""
},
{
"docid": "424320ae38fe38042ee0ecf1dbe3d2ca",
"score": "0.56753284",
"text": "def query_has_constraints?(localized_params = params)\n #y = !(localized_params[:q].blank? and localized_params[:f].blank?)\n y = !(localized_params[:q].blank? and localized_params[:f].blank? and localized_params[:click_to_search].blank?) || (!localized_params[:search_field].blank? and (localized_params[:search_field] != 'all_fields'))\n y\n end",
"title": ""
},
{
"docid": "34773e6ef2065d9864a9959c2ed54ff6",
"score": "0.56722975",
"text": "def valid_params_request?\n true\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.56708264",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "ea65ff76c743f68de7412bb4a6c990e4",
"score": "0.5670075",
"text": "def select_arguments arguments\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "7892ef6c04442bcbbddb0a35fab4a298",
"score": "0.5649641",
"text": "def validate_find_options(options)\n options.assert_valid_keys([:conditions, :include, :joins, :limit, :offset,\n :order, :select, :readonly, :group, :from, :lock, :having, :scope])\n end",
"title": ""
},
{
"docid": "d06e995383b54b9e79b9ea4b0052e66f",
"score": "0.56455857",
"text": "def has_not_mandatory_params?\n !params[:id].present? || !params[:name].present?\n end",
"title": ""
},
{
"docid": "d5d6cbba0128adce70dbabc4d6f255ae",
"score": "0.5642584",
"text": "def check_options\n raise NotImplementedError\n end",
"title": ""
}
] |
d10033e6defc369bf156748c64469c2b | The cell class constant for +cell_name+. | [
{
"docid": "cf983aef2ace22e2d8d11ccd78405d32",
"score": "0.8519415",
"text": "def class_from_cell_name(cell_name)\n \"#{cell_name}_cell\".classify.constantize\n end",
"title": ""
}
] | [
{
"docid": "ad8df932eeeca25754644586f23f0db4",
"score": "0.8108774",
"text": "def cell_name(name)\n self.cell_class = \"#{name}_cell\".camelize.constantize\n end",
"title": ""
},
{
"docid": "541e1a5c705e274de36094505590a98f",
"score": "0.74067056",
"text": "def cell_name\n # XXX Why is this needed? Can there be cells which have a different\n # @cell_name from their class's name?\n @cell_name || self.class.cell_name\n end",
"title": ""
},
{
"docid": "e965b09d72f20d1ae1935725ec956f48",
"score": "0.7122457",
"text": "def cell_name\n name.underscore.sub(/_cell$/, '')\n end",
"title": ""
},
{
"docid": "3b84bdb5c643454ccfc492b45fe50e53",
"score": "0.7088286",
"text": "def cell_type\n CLASS_CELLTYPE_MAPPING[value.class.to_s]\n end",
"title": ""
},
{
"docid": "618df0753754d7fabec34af987f6e60c",
"score": "0.7049549",
"text": "def cell_name\n name.underscore.sub(/_cell$/, '')\n end",
"title": ""
},
{
"docid": "4291c83a2ad7a8b633065f5786ee8e6d",
"score": "0.64996934",
"text": "def cell_key\n \"#{self.name} Cells\"\n end",
"title": ""
},
{
"docid": "00889e54f548a3f740d1ba9c1f126799",
"score": "0.62271714",
"text": "def custom_class(cell)\n [].tap do |klass|\n klass << 'left_border' if cell['left-border']\n klass << \"align_#{cell['halign']}\" if cell['halign']\n klass << 'right_border' if cell['right-border']\n klass << 'top-border' if cell['top-border']\n end.join(' ')\n end",
"title": ""
},
{
"docid": "2eff790fb97e52f94b4ff895d18a2f38",
"score": "0.6127506",
"text": "def get_cell_class(res_date, time_slot_id, court_nr)\n class_name = \"available\"\n r = Reservation.where(res_date: res_date, time_slot: time_slot_id, court_nr: court_nr).first\n \n if r\n case r.reservation_status_id\n when 1\n class_name = \"requested\"\n when 2\n class_name = \"occupied\"\n end\n end\n\n return class_name\n end",
"title": ""
},
{
"docid": "fa98d7844fd37d7e5dea517e37857999",
"score": "0.6051668",
"text": "def css_class\n CLASS_NAMES[name]\n end",
"title": ""
},
{
"docid": "393ce8cbf7212b235a5c13944ed7828f",
"score": "0.59494346",
"text": "def name_to_cell(name); end",
"title": ""
},
{
"docid": "a5f4815c60f1f558a2b61b3f54ca78a5",
"score": "0.5913436",
"text": "def clname\n\t\t\t@className\n\t\tend",
"title": ""
},
{
"docid": "28031a7dc548b5e7bb4c17dc4a470a46",
"score": "0.5859441",
"text": "def class_name\n @class_name ||= (self[:class_name] || classify).sub(/^::/,\"\")\n end",
"title": ""
},
{
"docid": "3b1ba415eb3c524593fd44ad8ded0183",
"score": "0.5842312",
"text": "def cellKey()\n\t\t\t@@cellkey\n\t\tend",
"title": ""
},
{
"docid": "421970d3615a40aad1b2388ac6cc70f3",
"score": "0.58314884",
"text": "def grid_cell_classes(*classes, **opt)\n row = positive(opt[:row])\n col = positive(opt[:col])\n classes += Array.wrap(opt[:class])\n classes << \"row-#{row}\" if row\n classes << \"col-#{col}\" if col\n classes << 'row-first' if row == 1\n classes << 'col-first' if col == 1\n classes << 'row-last' if row == opt[:row_max].to_i\n classes << 'col-last' if col == opt[:col_max].to_i\n classes << 'sr-only' if opt[:sr_only]\n css_class_array(*classes)\n end",
"title": ""
},
{
"docid": "841502d4f483417526efa2e8b1981a14",
"score": "0.58301103",
"text": "def class_name\n return @class_name unless @class_name.nil?\n @class_name = _root.type_ids[class_idx].type_name\n @class_name\n end",
"title": ""
},
{
"docid": "841502d4f483417526efa2e8b1981a14",
"score": "0.58301103",
"text": "def class_name\n return @class_name unless @class_name.nil?\n @class_name = _root.type_ids[class_idx].type_name\n @class_name\n end",
"title": ""
},
{
"docid": "0d5ab0f08a93c0b900a015c6e73c3000",
"score": "0.5827591",
"text": "def cell_number\n cn = nil\n if self.confluency\n cn = _cell_number confluency\n else\n if self.volume and self.cell_density\n cn = self.volume * self.cell_density\n end\n end\n self.associate NUM_CELLS, to_scinote(cn) if cn\n cn\n end",
"title": ""
},
{
"docid": "95926c6969e7a0f29cf1ee441d72b5c2",
"score": "0.5804524",
"text": "def celltype(row, col, sheet = default_sheet)\n read_cells(sheet)\n row, col = normalize(row, col)\n begin\n if @formula[sheet] && @formula[sheet][[row, col]]\n :formula\n elsif @cell_type[sheet]\n @cell_type[sheet][[row, col]]\n end\n rescue\n puts \"Error in sheet #{sheet}, row #{row}, col #{col}\"\n raise\n end\n end",
"title": ""
},
{
"docid": "efe8babd4f89d506bac673f41904df57",
"score": "0.57810205",
"text": "def celltype(row,col,sheet=nil)\n sheet ||= @default_sheet\n read_cells(sheet)\n row,col = normalize(row,col)\n if @formula[sheet][[row,col]]\n return :formula\n else\n @cell_type[sheet][[row,col]]\n end\n end",
"title": ""
},
{
"docid": "6ba1225466cd9b29614ac2bbb72afd7d",
"score": "0.5776074",
"text": "def class_name\n return $data_classes[@class_id].name\n end",
"title": ""
},
{
"docid": "e57cf1238f3797a6010e1630f0982b7b",
"score": "0.5767975",
"text": "def celltype(row,col,sheet=nil)\r\n sheet ||= @default_sheet\r\n read_cells(sheet)\r\n row,col = normalize(row,col)\r\n if @formula[sheet][[row,col]]\r\n return :formula\r\n else\r\n @cell_type[sheet][[row,col]]\r\n end\r\n end",
"title": ""
},
{
"docid": "101c31dd60fdeb940624bdbbdc35e297",
"score": "0.5762339",
"text": "def class_name\n name.classify\n end",
"title": ""
},
{
"docid": "645359286378e6748adf94578c0368ef",
"score": "0.57240903",
"text": "def class_name\n if :class == node_type\n self[1]\n end\n end",
"title": ""
},
{
"docid": "6c88b50bcf98fea8632f8a491f40ac17",
"score": "0.5706375",
"text": "def celltype(row, col, sheet = nil)\n sheet ||= @default_sheet\n read_cells(sheet)\n row, col = normalize(row, col)\n if @formula[sheet][[row, col]]\n return :formula\n else\n @cell_type[sheet][[row, col]]\n end\n end",
"title": ""
},
{
"docid": "d966a8ce21cdabeddbc81bfe9d28cc5b",
"score": "0.56890905",
"text": "def celltype(row, col, sheet=nil)\r\n sheet ||= @default_sheet\r\n read_cells(sheet)\r\n row,col = normalize(row,col)\r\n if @formula.size > 0 && @formula[sheet][\"#{row},#{col}\"]\r\n :formula\r\n else\r\n @cell_type[sheet][\"#{row},#{col}\"]\r\n end\r\n end",
"title": ""
},
{
"docid": "261f626c4a497cdb98a7035b5ee78dbf",
"score": "0.5684233",
"text": "def celltype(row,col,sheet=nil)\n sheet = @default_sheet unless sheet\n read_cells(sheet) unless @cells_read[sheet]\n row,col = normalize(row,col)\n begin\n if @formula[sheet][[row,col]]\n return :formula\n else\n @cell_type[sheet][[row,col]]\n end\n rescue\n puts \"Error in sheet #{sheet}, row #{row}, col #{col}\"\n raise\n end\n end",
"title": ""
},
{
"docid": "a9976152ea09b588333ae59dd5fd9331",
"score": "0.5667431",
"text": "def this_class\r\n # This is a ConstantClass entry in the constant pool.\r\n @jvmname ||= @constant_pool.class_item(@this_class_idx).class_name \r\n end",
"title": ""
},
{
"docid": "ed7656ab88ee26a54936dfa7aa65a762",
"score": "0.566587",
"text": "def celltype(row, col, sheet=nil)\n sheet = @default_sheet unless sheet\n read_cells(sheet) unless @cells_read[sheet]\n row,col = normalize(row,col)\n if @formula[sheet][\"#{row},#{col}\"]\n return :formula\n else\n @cell_type[sheet][\"#{row},#{col}\"]\n end\n end",
"title": ""
},
{
"docid": "c591668e20be0d54da1fa0a094581e22",
"score": "0.5663551",
"text": "def css_class\n if is_leaf? && @css_class.nil?\n @css_class = []\n @css_class << self.record_table_name\n @css_class << self.name\n @css_class << \"fg-orderable\" if self.searchable\n @css_class = @css_class.join(\" \")\n end\n @css_class\n end",
"title": ""
},
{
"docid": "19abb34bd889e9b5d090428bd2b09268",
"score": "0.5651811",
"text": "def excel_type\n Cell.excel_type calculated_type\n end",
"title": ""
},
{
"docid": "19f8971cc75556b4a350aa92d2378d5e",
"score": "0.5615531",
"text": "def get_default_cell_renderer_for_class cname\n @crh || prepare_renderers\n @crh[cname] || @crh['String']\n end",
"title": ""
},
{
"docid": "c918471148031be1f42a882ec106b193",
"score": "0.5613778",
"text": "def class_name(table_name) # :nodoc:\n # remove any prefix and/or suffix from the table name\n class_name = table_name[table_name_prefix.length..-(table_name_suffix.length + 1)]\n\n class_name = class_name.capitalize.gsub(/_(.)/) { |s| $1.capitalize }\n\n if pluralize_table_names\n if class_name[-3,3] == \"ies\"\n class_name = class_name[0..-4] + \"y\"\n elsif class_name[-1,1] == \"s\"\n class_name = class_name[0..-2]\n end\n end\n\n class_name\n end",
"title": ""
},
{
"docid": "7c93edf58058fb4eb25175f38958a6f0",
"score": "0.5599811",
"text": "def grid_classes\n GRID_CLASSES.reject { |key,val| key != 'ET' }\n end",
"title": ""
},
{
"docid": "5ffb25bb6de398db660b368b95ed323b",
"score": "0.5594208",
"text": "def class_name\n @class_name ||= derive_class_name\n end",
"title": ""
},
{
"docid": "81d90a0b45000946c61df830025ddef5",
"score": "0.55832934",
"text": "def class_name(name)\n dimension_name = name.to_s\n dimension_name = \"#{dimension_name}_dimension\" unless dimension_name =~ /_dimension$/\n dimension_name.classify\n end",
"title": ""
},
{
"docid": "c76db2643ddbaf05a85fbd3a91f388a1",
"score": "0.5575393",
"text": "def cim_class_name\n if defined?(@cim_class_name)\n return @cim_class_name\n end\n to_s\n end",
"title": ""
},
{
"docid": "fba6a9a25d704590bd5a30e628f9f434",
"score": "0.55660564",
"text": "def getClass() return TABLE.select{|x| x[:type] == 'class'}[0] end",
"title": ""
},
{
"docid": "7523dcc5628df91b5286cdc0fa7714e2",
"score": "0.5565907",
"text": "def create_cell_for(controller, name, opts={})\n #class_from_cell_name(name).new(controller, opts)\n class_from_cell_name(name).new(controller, opts)\n end",
"title": ""
},
{
"docid": "08a1728806e66843d8185df4ea36aa5e",
"score": "0.55595607",
"text": "def class_for_name(name) \n name_with_mapping = entry_class_for_name(name)\n \n begin\n if StorageRoom.is_constant_defined?(name_with_mapping)\n return \"StorageRoom::#{name_with_mapping}\".constantize\n end\n rescue NameError # could contain spaces etc.\n end\n \n begin\n return name_with_mapping.constantize\n rescue NameError\n raise ClassNotFoundError.new(\"Unknown class: #{name}\")\n end\n end",
"title": ""
},
{
"docid": "c25045f5aaca3199f456f1cc4bb07bdf",
"score": "0.5551704",
"text": "def class_table\n self[@cclass]\n end",
"title": ""
},
{
"docid": "54d861539fb3fd8f638cd5976996a0ec",
"score": "0.5549627",
"text": "def class_name\n @class_name\n end",
"title": ""
},
{
"docid": "6950f2ee2e22da032c5cfcae4ee755ea",
"score": "0.55450255",
"text": "def className\n\t\t\t@className\n\t\tend",
"title": ""
},
{
"docid": "6198c77481b06bc05bce075dd38942fa",
"score": "0.5536834",
"text": "def class_from_name(name)\n name.to_s.split(/::/).inject(Kernel) { |acc, t| acc.const_get(t) }\n end",
"title": ""
},
{
"docid": "efe8086da06b0ca1cba0dc402f151554",
"score": "0.5530787",
"text": "def class_name\n case (defs_type = node.children[0].type)\n when :self\n class_name_from_enclosing_type\n when :const\n class_name_from_declaration\n else\n raise \"Unrecognized 'defs' method type : #{defs_type.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "22f12159a0eb41089ed09a70cc3878f1",
"score": "0.552481",
"text": "def class_name\n @class_name ||= type.underscore.classify\n end",
"title": ""
},
{
"docid": "07a6c445acdf8ebd839e5c38a4ce072f",
"score": "0.5522458",
"text": "def class_name\n attribute 'class'\n end",
"title": ""
},
{
"docid": "778b2ca68be4d75b059679e9e6984076",
"score": "0.5512597",
"text": "def css_class\n Zone::CLASS_NAMES[name]\n end",
"title": ""
},
{
"docid": "fa18892e25599ce233cd073fc6c9d2ec",
"score": "0.55113274",
"text": "def class_name\n @class_name ||= self.class.name\n end",
"title": ""
},
{
"docid": "bd5181907110f8cb9539bb961ab17d11",
"score": "0.55111295",
"text": "def name_to_cell(name)\n col_index, row_index = *Axlsx::name_to_indices(name)\n r = rows[row_index]\n r.cells[col_index] if r\n end",
"title": ""
},
{
"docid": "b14f532c906de39287a4a13b575e09aa",
"score": "0.5510957",
"text": "def name_to_cell(name)\n col_index, row_index = *Axlsx.name_to_indices(name)\n\n r = rows[row_index]\n\n if r\n r[col_index]\n end\n end",
"title": ""
},
{
"docid": "ddae1a3f4efd7fa62c93f05a8cff1765",
"score": "0.5507575",
"text": "def celltype(row, col, sheet = nil)\n key = normalize(row, col)\n safe_send(sheet_for(sheet).cells[key], :type)\n end",
"title": ""
},
{
"docid": "c9cacc568f9b1e6d81794b4240edce0a",
"score": "0.5500726",
"text": "def column_class(col, val = false)\n html_classes = []\n html_classes << @column_types[col] if @column_types[col]\n html_classes << \"null\" if val.nil?\n\n %Q[ class=\"#{html_classes.join(\" \")}\"] if !html_classes.empty?\n end",
"title": ""
},
{
"docid": "f26ef39c9544c374f1199b16d144f03e",
"score": "0.54986703",
"text": "def className\n getAttribute('class').to_s\n end",
"title": ""
},
{
"docid": "a67a142d2cc44f9ce66979bc0d814dfe",
"score": "0.5482683",
"text": "def grid_system_class(col = nil, grid_system = nil)\n \"col-#{(grid_system || default_grid_system).to_s}-#{col}\" if col\n end",
"title": ""
},
{
"docid": "8612fd9ed8c15d0ae35dbcc467e95ed1",
"score": "0.54697675",
"text": "def new_cell( xm, ym, celltype_name, ct_namespace_path, tecsgen_cell = nil )\n\n ct_nsp = NamespacePath.analyze( ct_namespace_path )\n ct_nsp.append! celltype_name.to_sym\n ct = Namespace.find ct_nsp\n if ct == nil\n TECSCDE.error( \"TM9999 celltype #{ct_nsp.to_s}: not found for cell #{@name}\")\n return\n end\n\n if tecsgen_cell\n region = get_region_from_tecsgen_region( tecsgen_cell.get_region )\n else\n region = get_region_by_location( xm, ym )\n end\n return new_cell2( xm, ym, ct, region, tecsgen_cell )\n end",
"title": ""
},
{
"docid": "9883216399e5c8d754836d4445a363ed",
"score": "0.5460317",
"text": "def klass_name\n ebnf.klass_name\n end",
"title": ""
},
{
"docid": "ca3a04d65fc947c61fb3193a2852cae5",
"score": "0.5456533",
"text": "def css_class name\n attr \".#{name}\"\n end",
"title": ""
},
{
"docid": "257ab48ffc7699b0e7f472e7f52146eb",
"score": "0.5449928",
"text": "def klass_name_constant\n klass_name.classify.constantize\n end",
"title": ""
},
{
"docid": "f40417988f59c6dbecaeb6b49bb7ac5a",
"score": "0.5437838",
"text": "def create_cell_for(controller, name, opts={})\n class_from_cell_name(name).new(controller, opts)\n end",
"title": ""
},
{
"docid": "019a1653bc08ea1fb2761f9acab0699d",
"score": "0.54347277",
"text": "def operator_class_name\n @operator_class_name ||=\n if operator_for(:has_many) || operator_for(:belongs_to) || operator_for(:has_one)\n\n determine_operator_class.name\n\n elsif @col_type\n @col_type.type.to_s.classify\n else\n ''\n end\n\n @operator_class_name\n end",
"title": ""
},
{
"docid": "a88b2976c8441221c6c296bef966098a",
"score": "0.542254",
"text": "def create_cell_for(controller, name, *args)\n build_class_for(controller, class_from_cell_name(name), *args).\n new(controller, *args)\n end",
"title": ""
},
{
"docid": "45ba49a9257539948421bb050da2fc5c",
"score": "0.54167014",
"text": "def klass\n @klass ||= compute_class(class_name)\n end",
"title": ""
},
{
"docid": "45ba49a9257539948421bb050da2fc5c",
"score": "0.54167014",
"text": "def klass\n @klass ||= compute_class(class_name)\n end",
"title": ""
},
{
"docid": "45ba49a9257539948421bb050da2fc5c",
"score": "0.54167014",
"text": "def klass\n @klass ||= compute_class(class_name)\n end",
"title": ""
},
{
"docid": "45ba49a9257539948421bb050da2fc5c",
"score": "0.54167014",
"text": "def klass\n @klass ||= compute_class(class_name)\n end",
"title": ""
},
{
"docid": "94cd9fe5e2a8e3ef4ac5968e00365e41",
"score": "0.54082507",
"text": "def new_cell\n print 'Cell class name: '\n cell_name = STDIN.gets.chomp\n cell_viewmodel_name = \"#{cell_name}ViewModel\"\n\n dir_cells = get_or_create_cells_folder\n group_cells = get_or_create_xcode_cells_group\n\n create_base_if_needed\n\n cell_properties = @view_generator.get_properties\n cell_snippets = create_cell_snippets cell_properties\n\n cell_fileref = @view_generator.write_template\"#{TEMPLATE_PATH}CellTemplate.swift\",\n \"#{cell_name}.swift\",\n dir_cells,\n group_cells,\n {'___CELLNAME___' => cell_name},\n cell_snippets\n\n cell_viewmodel_snippets = create_viewmodel_snippets cell_properties\n cell_r_fileref = @view_generator.write_template\"#{TEMPLATE_PATH}CellViewModelTemplate.swift\",\n \"#{cell_name}ViewModel.swift\",\n dir_cells,\n group_cells,\n {'___CELLNAME___' => cell_viewmodel_name},\n cell_viewmodel_snippets\n\n @target.add_file_references([cell_fileref, cell_r_fileref])\n end",
"title": ""
},
{
"docid": "510242dac5bdf8eb8e46996174ef5dc4",
"score": "0.54051435",
"text": "def get_as_class_name class_name #:nodoc:\n @ruby_mappings[class_name.to_s]\n end",
"title": ""
},
{
"docid": "190a44e979185c773d33bebec98e2a80",
"score": "0.5401556",
"text": "def row_dimension_class\n @row_dimension_class ||= fact_class.dimension_class(self.row_dimension_name)\n end",
"title": ""
},
{
"docid": "fd68ee2161d14625285ca9d8ebe5d3f2",
"score": "0.54009134",
"text": "def html_class\n \"grid\"\n end",
"title": ""
},
{
"docid": "c59043dfada1a287ac787c22c917e157",
"score": "0.53771776",
"text": "def get_class(name)\n if id = intern_classname(name)\n load_class(id) or\n raise \"must not happen: #{name.inspect}, #{id.inspect}\"\n else\n id = classname2id(name)\n @classmap[id] ||= ClassEntry.new(self, id)\n end\n end",
"title": ""
},
{
"docid": "20312cf697316827a41a897060a75d39",
"score": "0.5374907",
"text": "def klass_name_symbol\n klass_name.to_sym\n end",
"title": ""
},
{
"docid": "6579b8bdd2c82bea39fe0346768f608e",
"score": "0.5365583",
"text": "def expression_class(exp_name)\n\n @map[exp_name]\n end",
"title": ""
},
{
"docid": "9f953154334287a1204e342b7417e864",
"score": "0.53586805",
"text": "def class_name\n @class_name ||= self.name.split(/::/).last.downcase\n end",
"title": ""
},
{
"docid": "47180ebb3fce082fd476ba43efc53b6f",
"score": "0.535306",
"text": "def klass_by_name (name)\n klass_cache[name]\n end",
"title": ""
},
{
"docid": "cd5f0d23b62be5262c2e5252793c1ce9",
"score": "0.5344045",
"text": "def expression_class (exp_name)\n\n @map[exp_name]\n end",
"title": ""
},
{
"docid": "c158257eb2a9cab0e9f77e93d3ae5286",
"score": "0.5336562",
"text": "def get_as_class_name class_name #:nodoc:\n @ruby_mappings[class_name.to_s]\n end",
"title": ""
},
{
"docid": "e765a2e6ccbc24f9e9e3bf8bc1e38024",
"score": "0.53326935",
"text": "def class_name(name)\n fact_name = name.to_s\n fact_name = \"#{fact_name}_facts\" unless fact_name =~ /_fact[s?]$/\n fact_name.classify\n end",
"title": ""
},
{
"docid": "a3bc606e21f99470a2ba1f91967c7fed",
"score": "0.5329665",
"text": "def get_cell_name(i, j)\n return cells[i - 1][j - 1]\n end",
"title": ""
},
{
"docid": "d948b7838abbb059eac68d10b3e2a679",
"score": "0.53286326",
"text": "def cell; end",
"title": ""
},
{
"docid": "d948b7838abbb059eac68d10b3e2a679",
"score": "0.53286326",
"text": "def cell; end",
"title": ""
},
{
"docid": "d948b7838abbb059eac68d10b3e2a679",
"score": "0.53286326",
"text": "def cell; end",
"title": ""
},
{
"docid": "c97f08de0d29deab3279a252b57c3ac8",
"score": "0.5318715",
"text": "def active_cell_id; end",
"title": ""
},
{
"docid": "ea255bf3e9b3e9ccf5ca289af373eb83",
"score": "0.53113663",
"text": "def class_name(name)\n @class_name = name\n end",
"title": ""
},
{
"docid": "723c9e4c3671a4d9cf018e6f9a5ff939",
"score": "0.5310234",
"text": "def class_name=(name)\n @class_name = name.to_s.to_sym\n end",
"title": ""
},
{
"docid": "ef921c02ab511e6e01c6a0cf5be9919c",
"score": "0.53101856",
"text": "def cell_element(identifier)\n platform.cell_for(identifier.clone)\n end",
"title": ""
},
{
"docid": "6fa1d074d099ed5c4d6971a5f9e006f4",
"score": "0.53070956",
"text": "def [](cell_def)\n return rows[cell_def - 1] if cell_def.is_a? Integer\n parts = cell_def.split(':')\n first = name_to_cell parts[0]\n\n if parts.size == 1\n first\n else\n cells = []\n last = name_to_cell(parts[1])\n rows[(first.row.index..last.row.index)].each do |r|\n r.cells[(first.index..last.index)].each do |c|\n cells << c\n end\n end\n cells\n end\n end",
"title": ""
},
{
"docid": "233af219f71e5766deff0f0b9b139b91",
"score": "0.5300394",
"text": "def cellKey\n\t\t\t@@bkey\n\t\tend",
"title": ""
},
{
"docid": "93318b6f277a27a00670061551eca038",
"score": "0.5292794",
"text": "def classname\n @name\n end",
"title": ""
},
{
"docid": "93318b6f277a27a00670061551eca038",
"score": "0.5292794",
"text": "def classname\n @name\n end",
"title": ""
},
{
"docid": "0447a45bed910814d7c5642c4a7550e1",
"score": "0.52812296",
"text": "def importance_of_class value\n CLASS_CELLTYPE_MAPPING.keys.index value.class.to_s\n end",
"title": ""
},
{
"docid": "c6c8e3703a752f6f0e1c721954dc0824",
"score": "0.5281085",
"text": "def classname\n name.split(\"::\")[1..-1].join(\"::\")\n end",
"title": ""
},
{
"docid": "d69f062e5a01602cd8e4b94478c04207",
"score": "0.5279718",
"text": "def [](cell_def); end",
"title": ""
},
{
"docid": "96834cfe17ef696feeb6d4bfdce6755b",
"score": "0.52762526",
"text": "def klass\n class_name = @attributes[:class_name]\n class_name ? class_name.constantize : name.to_s.classify.constantize\n end",
"title": ""
},
{
"docid": "9923b452bedf12ba9dc9bf6b2ad01eb3",
"score": "0.52743554",
"text": "def get_class_by_name( name )\n raise \"get_class_by_name #{name}.#{name.class}\" unless name.is_a?(Symbol)\n c = self.classes[name]\n #puts \"MISS, no class #{name} #{name.class}\" unless c # \" #{self.classes}\"\n #puts \"CLAZZ, #{name} #{c.get_type.get_length}\" if c\n c\n end",
"title": ""
},
{
"docid": "8a4945ed4ad9adf73652aaa0d7fb04bd",
"score": "0.52535707",
"text": "def default_class_name\n default[:class_name]\n end",
"title": ""
},
{
"docid": "8c6ae2aeb30a1e791dd88c655760478d",
"score": "0.52447146",
"text": "def class_name\n assert_exists\n return @o.invoke(\"className\")\n end",
"title": ""
},
{
"docid": "a0d5160b99a616932634f214baba9350",
"score": "0.5243602",
"text": "def get_class_name\n\t\treturn self.class.name\n\tend",
"title": ""
},
{
"docid": "441415a58917c7607bdaaad1ac457160",
"score": "0.5239702",
"text": "def class_name\n @class_name ||= -(options[:class_name] || derive_class_name).to_s\n end",
"title": ""
}
] |
ea8f0f99e9ea0fbb5b04ca7591912994 | Includes the specified module only if it has not already been included! | [
{
"docid": "c25f0d872d9665d10921ebf8026607a5",
"score": "0.8352683",
"text": "def include_if_missing(mod)\n include(mod) unless included_modules.index(mod)\n end",
"title": ""
}
] | [
{
"docid": "02f38785d0f452851677a4c900a58cb3",
"score": "0.74831426",
"text": "def module_include(base, mod); end",
"title": ""
},
{
"docid": "02f38785d0f452851677a4c900a58cb3",
"score": "0.74831426",
"text": "def module_include(base, mod); end",
"title": ""
},
{
"docid": "a89391301c1ad10c1762dcc2a68b1ad8",
"score": "0.70616025",
"text": "def include(*mod)\n (@included_modules ||= []).push(*mod)\n end",
"title": ""
},
{
"docid": "0c173795977c867082c6b1b5ddc84405",
"score": "0.69777095",
"text": "def supports_module_prepend?; end",
"title": ""
},
{
"docid": "99b4aea26c55dc3b1e9e543f79537bca",
"score": "0.69028735",
"text": "def safely_include_module(*modules)\n [modules].flatten.each do |mod|\n mod.include_safely_into(self)\n end\n end",
"title": ""
},
{
"docid": "0e9a40b8d94b1686779cdeb629cf3c02",
"score": "0.68189377",
"text": "def add_module(module_)\n module_names << module_.name unless module_names.include?(module_.name)\n end",
"title": ""
},
{
"docid": "dbc44273d607b373ca6f56311412f861",
"score": "0.6785175",
"text": "def include_modules!\n ## Include modules from configuration\n Alfred.configuration.includes.each do |mod|\n Request.send(:include, mod)\n end\n end",
"title": ""
},
{
"docid": "1b40ef3e55d08379e2e1e1781638d335",
"score": "0.67441136",
"text": "def watch_for_module_include\n Module.module_eval(\"\n def include_with_watcher(*args)\n include_without_watcher(*args)\n if \\\"#{mod}\\\" == self.to_s\n CallPatcher.new(\\\"#{target}\\\").patch\n end\n end\n alias_method :include_without_watcher, :include\n alias_method :include, :include_with_watcher\n \")\n end",
"title": ""
},
{
"docid": "e6e94c66b01bf52f8c74f1521a145a09",
"score": "0.66636086",
"text": "def include?(mod)\n cur_tool = DSL::Internal.current_tool(self, false)\n return if cur_tool.nil?\n super(DSL::Internal.resolve_mixin(mod, cur_tool, @__loader))\n end",
"title": ""
},
{
"docid": "1d62d4dd8bb8652cd9497e3bc4c94a2e",
"score": "0.6647827",
"text": "def being_included?\n @being_included || false\n end",
"title": ""
},
{
"docid": "50e9cc48e7cb6a3b0ffdcdfd13069fe3",
"score": "0.6530041",
"text": "def include(*mods)\n mods.each do |mod|\n __include_single_module(mod)\n end\n end",
"title": ""
},
{
"docid": "8267eca95aac3b3ec5fcbd6e2eea11ea",
"score": "0.6490543",
"text": "def include(*mods)\n mods.each do |mod|\n included_modules << mod\n mod.send :included, self\n end\n end",
"title": ""
},
{
"docid": "0569e2d45300e44419f6bea23a9f1855",
"score": "0.64730525",
"text": "def include(*modules)\n `for(var i=0,l=modules.length;i<l;++i){var mod=modules[i];mod.m$appendFeatures(this);mod.m$included(this);mod.__includers__[this.__name__]=true;}`\n return self\n end",
"title": ""
},
{
"docid": "37a92b30908ceae346bbc1f6fe1789c2",
"score": "0.6441275",
"text": "def include(*args)\n @eval_module.include(*args)\n end",
"title": ""
},
{
"docid": "e76a5ac7581ec219a350349ad5d305f1",
"score": "0.638064",
"text": "def include?\n end",
"title": ""
},
{
"docid": "c128974d6f477de7c718662574351ac2",
"score": "0.6367151",
"text": "def include; end",
"title": ""
},
{
"docid": "ff451ce961eb3081b19cf6a8d56f89b2",
"score": "0.6332676",
"text": "def execute_include_modules( hooked_instance, *modules )\n \n modules.delete_if do |this_module|\n already_included = false\n if @already_included[ this_module ]\n already_included = true\n else # mark for next frame\n @already_included[ this_module ] = true\n end\n already_included\n end\n \n hooked_instance.module_eval { include( *modules ) } unless modules.empty?\n\n return self\n \n end",
"title": ""
},
{
"docid": "c6720dda32497f4d2d381c62c1073fb2",
"score": "0.63275737",
"text": "def temp_include_safe(mod, options={}, &block)\n safe_code = proc do\n Remix.wrap_with_hooks(options[:before], options[:after]) do\n begin\n include(mod)\n yield\n ensure\n uninclude(mod, true)\n end\n end\n end\n \n if !Thread.current[:__exclusive__]\n value = nil\n \n Thread.exclusive do\n Thread.current[:__exclusive__] = true\n value = safe_code.call \n Thread.current[:__exclusive__] = false\n end\n \n value\n else\n safe_code.call\n end\n end",
"title": ""
},
{
"docid": "491bdba7db187ba96139cefed12f7b58",
"score": "0.63072056",
"text": "def extend(module1, *smth)\n IncludeWithRespect.extend_with_respect(self, module1, *smth)\n end",
"title": ""
},
{
"docid": "12d14b435c383bd220966b816691070e",
"score": "0.62785566",
"text": "def include(arg)\n Object.module_eval \"include #{arg}\"\n end",
"title": ""
},
{
"docid": "a12b513468837304f3081f472dfc073d",
"score": "0.6264561",
"text": "def include(mod)\n default_context.send(:include, mod)\n end",
"title": ""
},
{
"docid": "5c56d7d0e28bb9eb5f6bda8c302d087d",
"score": "0.62293583",
"text": "def include?(app); end",
"title": ""
},
{
"docid": "5c56d7d0e28bb9eb5f6bda8c302d087d",
"score": "0.62293583",
"text": "def include?(app); end",
"title": ""
},
{
"docid": "5c56d7d0e28bb9eb5f6bda8c302d087d",
"score": "0.62293583",
"text": "def include?(app); end",
"title": ""
},
{
"docid": "9f9006e18e17ccfe089ec83476c25e1b",
"score": "0.62190974",
"text": "def include(*mods)\n mods.each { |mod| includes << mod }\n end",
"title": ""
},
{
"docid": "8def9687b19763d472ae0fb6dde80f6f",
"score": "0.6207926",
"text": "def load_module\n @dashboard = Dashboard.find(params[:id])\n case @dashboard.module_name\n when \"alpha\"\n include Alpha\n when \"beta\"\n include Beta\n when \"gamma\"\n include Gamma \n else\n # hmm, what DO we do when an unspecified module is called?\n end\n \n end",
"title": ""
},
{
"docid": "8db749f051588b2e493ab6d5e491110e",
"score": "0.6187806",
"text": "def uses_modular_headers?(only_if_defines_modules = true)\n return false if only_if_defines_modules && !defines_module?\n return @uses_modular_headers if defined? @uses_modular_headers\n @uses_modular_headers = spec_consumers.none?(&:header_mappings_dir) && spec_consumers.none?(&:header_dir)\n end",
"title": ""
},
{
"docid": "ade1f77fb1ed12c2badd4f64e2534b41",
"score": "0.6179606",
"text": "def test_module_include_still_works\n @soggy_bacon.persist\n assert Bacon.include? @soggy_bacon\n # When passed a module, Bacon.include? checks if \n # the module is in its ancestry\n assert Bacon.include? Persistable\n end",
"title": ""
},
{
"docid": "2d2062d0aa1348ccf09dc792dff6d049",
"score": "0.61686355",
"text": "def include(modules)\n modules = Array(modules)\n\n modules.each { |m| self.class.include m }\n end",
"title": ""
},
{
"docid": "2d2062d0aa1348ccf09dc792dff6d049",
"score": "0.61686355",
"text": "def include(modules)\n modules = Array(modules)\n\n modules.each { |m| self.class.include m }\n end",
"title": ""
},
{
"docid": "969c990f2b9cb50f9d46c4ec4fc3595b",
"score": "0.61534154",
"text": "def auto_include(target, identity_module, include_module)\n watch_reload[target] ||= {}\n watch_reload[target][identity_module] ||= []\n unless watch_reload[target][identity_module].include? include_module\n watch_reload[target][identity_module] << include_module\n end\n end",
"title": ""
},
{
"docid": "9b74231438087b0a445cf14a71dafbdb",
"score": "0.61449075",
"text": "def included(base); end",
"title": ""
},
{
"docid": "9b74231438087b0a445cf14a71dafbdb",
"score": "0.61449075",
"text": "def included(base); end",
"title": ""
},
{
"docid": "54a989c893e0930ea79c65c2cd6dadd1",
"score": "0.61404276",
"text": "def included (base)\n\t# self is the included module; base is the including module\n\tExtended_Include.includes_for(self).each do |mod|\n\t mod.included base if mod.respond_to?(:included) &&\n\t (!base.respond_to?(:superclass) ||\n\t !base.superclass.include?(mod))\n\tend\n\n\tsources = Extended_Include.class_methods_for self\n\tbase.class_exec { sources.each { |mod| extend mod } } unless\n\t sources.empty?\n\n\tsuper base rescue nil\t# chain any other #included methods\n end",
"title": ""
},
{
"docid": "48833f2bbcd564c2cc3c2e8c541387ff",
"score": "0.6113601",
"text": "def parse_include\n pos = position\n keyword(:include) or return\n ws\n n = parse_name or expected(\"name of module to include\")\n ws\n return E[pos, :include, n]\n end",
"title": ""
},
{
"docid": "4dca219a82e0e308fb6d529587840ef2",
"score": "0.61131525",
"text": "def include(*args)\n args << {} unless Hash === args.last\n modules, options = args_and_options(*args)\n required_behaviour_type = options[:behaviour_type]\n if required_behaviour_type.nil? || required_behaviour_type.to_sym == behaviour_type.to_sym\n @eval_module.include(*modules)\n end\n end",
"title": ""
},
{
"docid": "bc6cdf99b06c7f2a500e0deb32d1e164",
"score": "0.60994685",
"text": "def included; end",
"title": ""
},
{
"docid": "bc6cdf99b06c7f2a500e0deb32d1e164",
"score": "0.60994685",
"text": "def included; end",
"title": ""
},
{
"docid": "8f3ce05f17fa8eb5fb85e7f2327e4176",
"score": "0.6091293",
"text": "def include_component_module_for(component, choice=nil)\n choice = fetch_component_choice(component) unless choice\n return false if choice.to_s == 'none'\n apply_component_for(choice, component)\n end",
"title": ""
},
{
"docid": "234e811886fd3fafbd97b5643441d526",
"score": "0.6083046",
"text": "def include?(name)\n ((@include.empty? && !@forced_need)|| @include.any? { |pattern| File.fnmatch(pattern, name) }) &&\n !@exclude.any? { |pattern| File.fnmatch(pattern, name) }\n end",
"title": ""
},
{
"docid": "9b841b4ed8307fd46a8439c82b2322e2",
"score": "0.6081098",
"text": "def include_module(type)\n if Module.const_defined?(type)\n self.singleton_class.send(:include, Module.const_get(type))\n end\n end",
"title": ""
},
{
"docid": "e7232abd9cae7102146a2427464f6b33",
"score": "0.60757244",
"text": "def included( mod )\n\t\tsuper\n\t\tself.log.debug \"Including %d components in %p\" % [ self.components.length, mod ]\n\t\tself.components.each do |component_type, args|\n\t\t\tself.log.debug \"Adding %p to %p from %p\" % [ component_type, mod, self ]\n\t\t\tmod.add( component_type, *args )\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6c6cad58b7b8eaf384a6039aabf0a346",
"score": "0.6029749",
"text": "def include_required_submodules!\n self.class_eval do\n @sorcery_config.submodules = ::Sorcery::Controller::Config.submodules\n @sorcery_config.submodules.each do |mod|\n begin\n include Submodules.const_get(mod.to_s.split(\"_\").map {|p| p.capitalize}.join(\"\"))\n rescue NameError\n # don't stop on a missing submodule. Needed because some submodules are only defined\n # in the controller side.\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a203b9234c075226a94a6b997ea8b302",
"score": "0.6025419",
"text": "def enable_module!(name)\n enabled_modules << EnabledModule.new(:name => name.to_s) unless module_enabled?(name)\n end",
"title": ""
},
{
"docid": "f22b1566cb47fae1ba0aa4a77c0a8ba9",
"score": "0.60145575",
"text": "def extend_above(mod1, mod2)\n singleton_class.include_above(mod1, mod2)\n self\n end",
"title": ""
},
{
"docid": "6772d527c6730280ad9ed11227f63d8e",
"score": "0.6013115",
"text": "def included\n nil\n end",
"title": ""
},
{
"docid": "ae59c349d3936488744de6b379f1288b",
"score": "0.59901446",
"text": "def _extended?(_module)\n _extended.include?(_module)\n end",
"title": ""
},
{
"docid": "73f402082518dd866096754928cfd216",
"score": "0.59692395",
"text": "def included(mod)\n mod.extend ClassMethods\n end",
"title": ""
},
{
"docid": "d9189b78ad0fc325c12cfca562accb50",
"score": "0.59632576",
"text": "def included?\n self.class.included?\n end",
"title": ""
},
{
"docid": "c27d78f728d92298321e79fc83e9cf98",
"score": "0.59390306",
"text": "def include_lib(mod)\n # attach items according to @info_file\n attach_items(@info_file, mod, '')\n end",
"title": ""
},
{
"docid": "a861f000f19713ed313872c367b798af",
"score": "0.5912187",
"text": "def rinter_before_include_class(base)\n end",
"title": ""
},
{
"docid": "d01a9b2549520675f884b80a0b436dc9",
"score": "0.5901533",
"text": "def include?(oth)\n includes(oth)\n end",
"title": ""
},
{
"docid": "7640fca8b3c41f3f1079e797f301d2c3",
"score": "0.5897659",
"text": "def include_into(target, mod)\n runtime.logger.trace(\"Including '#{mod}' into '#{target}'...\")\n target.send(:include, mod)\n end",
"title": ""
},
{
"docid": "ed8ff600ea32c39dc2062ae5f565c4cc",
"score": "0.5863693",
"text": "def include?(name)\n includes?(name)\n end",
"title": ""
},
{
"docid": "5d8da8be2e9e0dd88b0ab1f471998eec",
"score": "0.5860635",
"text": "def include_header(*args)\n @available.include_header(*args)\n end",
"title": ""
},
{
"docid": "a1c83f8c17d5a71cf70b7513bd9b1d90",
"score": "0.5860154",
"text": "def _blockenspiel_custom_include(*modules_) # :nodoc:\n _blockenspiel_default_include(*modules_)\n modules_.reverse_each do |mod_|\n mod_.public_instance_methods.each do |method_|\n _blockenspiel_auto_dsl_method(method_)\n end\n end\n end",
"title": ""
},
{
"docid": "238c89508632976986a85baea2b1e749",
"score": "0.5853055",
"text": "def mixin(mod)\n include mod\n end",
"title": ""
},
{
"docid": "f7f957876ffd3c15b36c682b1af4d8be",
"score": "0.5840998",
"text": "def rindex_with_module( module_instance, include_or_extend = nil )\n\n return rindex do |this_frame|\n this_frame.modules and \n this_frame.modules.include?( module_instance ) and\n include_or_extend.nil? || match_include_extend?( include_or_extend, this_frame.include_or_extend )\n end\n\n end",
"title": ""
},
{
"docid": "ec65600979945090c0950426e5b85012",
"score": "0.58137935",
"text": "def includes_mixin? mod\n (class << __context__; self end).include? mod\n end",
"title": ""
},
{
"docid": "aad237ee40b4eb218b5a783a3bc5190d",
"score": "0.58010256",
"text": "def included(other)\n IncludesTracker.reset!\n __orig_included(other)\n end",
"title": ""
},
{
"docid": "64227f4f482db05002b3316110d0faec",
"score": "0.5784473",
"text": "def included_in_modules\n modules = []\n ObjectSpace.each_object(Module) { |k| modules << k if k.included_modules.include?(self) }\n\n modules.reverse.inject([]) do |unique_modules, klass|\n unique_modules << klass unless unique_modules.collect { |k| k.to_s }.include?(klass.to_s)\n unique_modules\n end\n end",
"title": ""
},
{
"docid": "707fb0a91bb19a962bba8b913459e195",
"score": "0.5782706",
"text": "def included(submodule)\n super\n Mixin.send(:init_heir, submodule, @__mtrack__)\n end",
"title": ""
},
{
"docid": "522627c8b6b8bf8cc55d4a9d4227fe56",
"score": "0.5754982",
"text": "def include?(arg0)\n end",
"title": ""
},
{
"docid": "522627c8b6b8bf8cc55d4a9d4227fe56",
"score": "0.5754982",
"text": "def include?(arg0)\n end",
"title": ""
},
{
"docid": "522627c8b6b8bf8cc55d4a9d4227fe56",
"score": "0.5754982",
"text": "def include?(arg0)\n end",
"title": ""
},
{
"docid": "522627c8b6b8bf8cc55d4a9d4227fe56",
"score": "0.5754982",
"text": "def include?(arg0)\n end",
"title": ""
},
{
"docid": "dd6931d2b898c0fdfe19f365331538ed",
"score": "0.5754523",
"text": "def included(submodule)\n super\n submodule.instance_eval { extend Extension }\n submodule\n end",
"title": ""
},
{
"docid": "8af448a267ac461267b90b3f8064491f",
"score": "0.57528305",
"text": "def type_include?(host, mod)\n store.get_includes(host).include?(mod)\n end",
"title": ""
},
{
"docid": "d7ce1f179bb4fe0dafb04e622d4237c4",
"score": "0.57502764",
"text": "def include_module_ability(*args)\n options = args.extract_options!\n collect_for_module(ability_key, options)\n end",
"title": ""
},
{
"docid": "5dd84d87f2227e43ad6a9cc92197d4f6",
"score": "0.57376975",
"text": "def component_module_names_in_include_statements?\n # @input_hash is in normalized form\n @input_hash.values.flat_map { |v| (v['component_include_module'] || {}).keys }.uniq\n end",
"title": ""
},
{
"docid": "3a967c6e527899e0f54008e5c347bb85",
"score": "0.5737256",
"text": "def add_included_library( lib )\n @included_libraries ||= {}\n\n if lib\n @included_libraries[lib.name] ||= []\n @included_libraries[lib.name] << lib.version\n\n # If the library contains a core dependency, make sure that is included as well\n add_included_library( lib.core ) if lib.respond_to? :core\n else\n logger.warn(\"WARNING: A view has attempted to include a nil library!\")\n end\n end",
"title": ""
},
{
"docid": "deba93aaf85066d18e19a41b24518dd1",
"score": "0.5720784",
"text": "def auto_include!\n mixins = @@class_mixins[name]\n send(:include, *mixins) if mixins\n end",
"title": ""
},
{
"docid": "deba93aaf85066d18e19a41b24518dd1",
"score": "0.5720784",
"text": "def auto_include!\n mixins = @@class_mixins[name]\n send(:include, *mixins) if mixins\n end",
"title": ""
},
{
"docid": "20a2dfd7af07afa4649f8f72837cbea1",
"score": "0.5687854",
"text": "def require_module(clazz)\n raise \"Api::Type did not include required #{clazz} module\" \\\n unless Api::ApiMultiInvoke.included_modules.include?(clazz)\n raise \"#{self.class} did not include required #{clazz} module\" \\\n unless self.class.included_modules.include?(clazz)\n end",
"title": ""
},
{
"docid": "6cb6702f950510e4cc8c6144a6a71068",
"score": "0.5684855",
"text": "def included?(name)\n full_name = Pathname.new(name).expand_path.to_s\n @included_files.include?(full_name)\n end",
"title": ""
},
{
"docid": "cbef87b0ac6ab7b6719ab1d67358bd40",
"score": "0.5681382",
"text": "def included?\n if self.included.nil?\n (parent.nil? ? false : parent.included?)\n else\n self.included\n end\n end",
"title": ""
},
{
"docid": "926f66f2b4993c9529ba91e74eeb704a",
"score": "0.5674482",
"text": "def included(klass); end",
"title": ""
},
{
"docid": "926f66f2b4993c9529ba91e74eeb704a",
"score": "0.5674482",
"text": "def included(klass); end",
"title": ""
},
{
"docid": "105700007510e89e5da6cacf5666cfc3",
"score": "0.56669605",
"text": "def include?(item)\n @root.nil? ? false : includeHelper(@root, item)\n end",
"title": ""
},
{
"docid": "262963acfe346a8edac7c2087c64c3e0",
"score": "0.5666679",
"text": "def included\n @included ||= []\n end",
"title": ""
},
{
"docid": "a073ed2c58eb60783597f3e8545c0981",
"score": "0.5662358",
"text": "def xinclude()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "b814a2ddd86ec2094b8986f626a56ade",
"score": "0.56565624",
"text": "def use(module_name)\n Lolita.send(:include,module_name)\n end",
"title": ""
},
{
"docid": "1b3117bcda2f1ef184108eb222566b3a",
"score": "0.56516135",
"text": "def include?(object, arguments, context); end",
"title": ""
},
{
"docid": "6feeec6f92458ce653577446a9e1d5ee",
"score": "0.56416357",
"text": "def include(mod)\n if ClassMethods === mod\n # setup as an include module (can be overriden)\n Declarations.setup(self, mod.declarations_setup_args) unless ClassMethods === self\n super\n Declarations.setup_inheritance(self, mod.declarations_setup_args)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "140e95fc1ce77f502cd61447d1056091",
"score": "0.5635882",
"text": "def extend_below(mod1, mod2)\n singleton_class.include_below(mod1, mod2)\n self\n end",
"title": ""
},
{
"docid": "e88d65650d238a78c061b8d391a76746",
"score": "0.56333995",
"text": "def if_module(mod, &block)\n blockify('if_module'.apachify, \"#{mod}_module\".to_sym, &block)\n end",
"title": ""
},
{
"docid": "07b8f2d73242a98b1801c937e151acb8",
"score": "0.56244856",
"text": "def included(base = nil, &block)\n if base.nil?\n @_included_block = block\n else\n super\n end\n end",
"title": ""
},
{
"docid": "c4607e89116e98f5b9d9872f78d098df",
"score": "0.5609438",
"text": "def include_module_items(include_module, current_module, item_dict, section, subsection, template)\n # fill item_dict with items from curren_module in the first run\n if item_dict.size == 0\n current_module.elements.each(\"#{section}/#{subsection}\") do |current_item|\n next if !valid_element_name?(current_item)\n\n default_access = nil\n if !current_item.parent.nil?\n default_access = current_item.parent.attribute('access')\n end\n\n item_name = compound_name(current_item, default_access)\n item_dict[item_name] = {:item => current_item, :index => item_dict.size, :current => true}\n end\n end\n\n include_module.elements.each(\"#{section}/#{subsection}\") do |include_item|\n next if !valid_element_name?(include_item)\n\n default_access = nil\n if !include_item.parent.nil?\n default_access = include_item.parent.attribute('access')\n end\n\n include_item.add_attribute(TEMPLATE_NAME, template)\n include_item_name = compound_name(include_item, default_access)\n\n if !item_dict.has_key?(include_item_name)\n item_dict[include_item_name] = {:item => include_item, :index => item_dict.size, :current => false}\n end\n end\n end",
"title": ""
},
{
"docid": "b4350f597c69e69f89cfd8f571617aed",
"score": "0.5604046",
"text": "def has_before_include_stack?\n\n return @before_include_stack ? true : false\n\n end",
"title": ""
},
{
"docid": "f382a7cfbe34a306a1f1f36234710703",
"score": "0.5596716",
"text": "def each_module_filter(opts, name, mod)\n return false\n end",
"title": ""
},
{
"docid": "15ce1c7ebf8ccf80d528d893d0bb535d",
"score": "0.5596572",
"text": "def test_Module_InstanceMethods_includeModules\n\t\tassert_equal([], Mixin14.included_modules)\n\t\tassert_equal([Mixin14], Outer15.included_modules)\n\tend",
"title": ""
},
{
"docid": "b72cc87865961201124d5dcabeeb8053",
"score": "0.55932385",
"text": "def include?(logical_name)\n !@zombified.include?(logical_name) && INCLUDES =~ logical_name\n end",
"title": ""
},
{
"docid": "c88cd01ba6d5564d1e9f4264e66d52c3",
"score": "0.55880487",
"text": "def module?\n false\n end",
"title": ""
},
{
"docid": "d33c02fa578c0e0cdd9371147214263e",
"score": "0.5587988",
"text": "def include(header_name)\n add_code(\"#include #{header_name}\")\n end",
"title": ""
},
{
"docid": "4ba87b5fa25de2e9dad8f4b019419192",
"score": "0.55844927",
"text": "def including(*args, &block); end",
"title": ""
},
{
"docid": "8f265a146407bcb25cf86ed15c70799f",
"score": "0.55812806",
"text": "def exists?(module_name)\n slice_names.include?(module_name.to_s) && Object.const_defined?(module_name.to_s)\n end",
"title": ""
},
{
"docid": "d96db7215fa5cd0e27db10e7a1f9ccd8",
"score": "0.55693895",
"text": "def include app_config\n self.includes.unshift app_config.name\n end",
"title": ""
},
{
"docid": "8989c81736660f07e4f7e649365c9a57",
"score": "0.55662495",
"text": "def add(module_)\n @mixins << module_\n @classes.each{ |k_| k_.class_eval{ include(module_) } }\n _radd(module_)\n end",
"title": ""
},
{
"docid": "89b0d69c2e5ee279a21d3dfa5405d965",
"score": "0.5564525",
"text": "def include_declaration; end",
"title": ""
},
{
"docid": "3f91ce824b82717c1a1dcf0ada20edc2",
"score": "0.55639553",
"text": "def module_include(base, mod)\n MODULE_INCLUDE_MUTEX.synchronize do\n old_methods = {}\n\n mod.instance_methods.each do |sym|\n old_methods[sym] = base.instance_method(sym) if base.method_defined?(sym)\n end\n\n mod.instance_methods.each do |sym|\n method = mod.instance_method(sym)\n if base.method_defined?(sym)\n base.send(:alias_method, sym, sym)\n end\n base.send(:define_method, sym, method)\n end\n\n yield\n ensure\n mod.instance_methods.each do |sym|\n base.send(:undef_method, sym) if base.method_defined?(sym)\n end\n old_methods.each do |sym, method|\n base.send(:define_method, sym, method)\n end\n end\n end",
"title": ""
}
] |
2508efca3628cd6f6f14bf09c937114a | GET /notifications/new GET /notifications/new.xml | [
{
"docid": "71ae54e4c3b5f5a1527ca0b1bd1f2ee0",
"score": "0.7780601",
"text": "def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification }\n end\n end",
"title": ""
}
] | [
{
"docid": "f5c2ef295b91f19943b2db19c418b695",
"score": "0.8215699",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifications }\n end\n end",
"title": ""
},
{
"docid": "c107f7544c2b63f11cab23e13bb728d8",
"score": "0.7739678",
"text": "def new\n @notification = APN::Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification }\n end\n end",
"title": ""
},
{
"docid": "3d480cfd56bade275d01ac1ea443aa5d",
"score": "0.7686922",
"text": "def new\r\n @notification = Notification.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @notification }\r\n end\r\n end",
"title": ""
},
{
"docid": "793615608884be16ca5107aedbff601f",
"score": "0.746997",
"text": "def new\n @notification_template = NotificationTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification_template }\n end\n end",
"title": ""
},
{
"docid": "9d2a83bd1d1b8949b9d75ee7b180cbd7",
"score": "0.73713005",
"text": "def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html { render :partial => 'notifications/notification', :layout => false if request.xml_http_request? } # new.html.erb\n format.xml { render :xml => @notification }\n end\n end",
"title": ""
},
{
"docid": "b467c21867d910e22eb108506faad477",
"score": "0.7344949",
"text": "def new\n @notification_listener = NotificationListener.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification_listener }\n end\n end",
"title": ""
},
{
"docid": "75af476b098fa9789f35fa06302da348",
"score": "0.72721726",
"text": "def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification }\n end\n end",
"title": ""
},
{
"docid": "75af476b098fa9789f35fa06302da348",
"score": "0.72721726",
"text": "def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification }\n end\n end",
"title": ""
},
{
"docid": "aa23cc4f5aa487dad78632f5b6edbcd7",
"score": "0.7238787",
"text": "def new\n\n @notification = Notification.new\n respond_to do |format|\n format.html # new.html.erbb\n format.json { render json: @notification }\n end\n end",
"title": ""
},
{
"docid": "cc824cf6063f9c88ee01c4b579fc26d4",
"score": "0.7238764",
"text": "def new\n @notify = Notify.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @notify }\n end\n end",
"title": ""
},
{
"docid": "9853151f234657de7c2ef8a3353e198d",
"score": "0.71685874",
"text": "def new\n\t\t@notification = Notification.new(:user => current_user)\n\t\t@users=User.all.to_a\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @notification }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "503d6b7712afc0a2f48f6b1b85e5ac87",
"score": "0.70858806",
"text": "def create\n @notifications = Notification.new(params[:notifications])\n\n respond_to do |format|\n if @notifications.save\n flash[:notice] = 'Notification was successfully created.'\n format.html { redirect_to notifications_path }\n format.xml { render :xml => @notifications, :status => :created, :location => @notifications }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @notifications.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5722e9f9cd5d345587da8a53cf4be1ce",
"score": "0.70501554",
"text": "def new\n @breadcrumb = 'create'\n @notification = Notification.new\n @tables = ActiveRecord::Base.connection.tables\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification }\n end\n end",
"title": ""
},
{
"docid": "eb767493f9ff1fb90bd7972f13b4f0b0",
"score": "0.70450157",
"text": "def new\n @notification = Notification.new\n\n respond_with(@notification)\n end",
"title": ""
},
{
"docid": "d235507f3236ebd391c174fc9b350ee0",
"score": "0.70078576",
"text": "def new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @getnotificationmessage }\n end\n end",
"title": ""
},
{
"docid": "f1ed27e612d4c8b872a719c586a45b78",
"score": "0.6964263",
"text": "def new\n @notification_template = NotificationTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification_template }\n end\n end",
"title": ""
},
{
"docid": "96dad183f9965f431f750f88eca07bad",
"score": "0.694899",
"text": "def new\n @notify_template = NotifyTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notify_template }\n end\n end",
"title": ""
},
{
"docid": "c08237a8b5b99f93116148a952ffeba1",
"score": "0.6939103",
"text": "def new\n @notifier = Notifier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notifier }\n end\n end",
"title": ""
},
{
"docid": "d8e18d7c8a065350185853ecef0fa48d",
"score": "0.6897909",
"text": "def create\r\n @notification = Notification.new(params[:notification])\r\n\r\n respond_to do |format|\r\n if @notification.save\r\n format.html { redirect_to(@notification, :notice => I18n.t(\"notifications.notifications.create_success\")) }\r\n format.xml { render :xml => @notification, :status => :created, :location => @notification }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @notification.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "3d5e0496b0f506bee53682aedc3d8732",
"score": "0.68542236",
"text": "def new\n @payment_notification = PaymentNotification.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payment_notification }\n end\n end",
"title": ""
},
{
"docid": "665b124cad89cb49b4f2017a69ba3615",
"score": "0.68014324",
"text": "def new\n @push = Push.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @push }\n end\n end",
"title": ""
},
{
"docid": "9b270c0348f1df5bd7f4ac0e84c94142",
"score": "0.67792696",
"text": "def new\n @org_notification = OrgNotification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @org_notification }\n end\n end",
"title": ""
},
{
"docid": "7de9ead381c918ac1fd5d62313541538",
"score": "0.6733315",
"text": "def new\r\n @evernote_notification = EvernoteNotification.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @evernote_notification }\r\n end\r\n end",
"title": ""
},
{
"docid": "f346b62e00738f8c7cfc18f7a00255d6",
"score": "0.6730123",
"text": "def new\n @notice = Notice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notice }\n end\n end",
"title": ""
},
{
"docid": "f346b62e00738f8c7cfc18f7a00255d6",
"score": "0.6730123",
"text": "def new\n @notice = Notice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notice }\n end\n end",
"title": ""
},
{
"docid": "0f6678159a42242608ce5bdef8433671",
"score": "0.67293036",
"text": "def new\n @notification_preference = NotificationPreference.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification_preference }\n end\n end",
"title": ""
},
{
"docid": "e2aff98cdfeeffe634d25ccd77f66f95",
"score": "0.67210156",
"text": "def new\n @notification_receiver = NotificationReceiver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification_receiver }\n end\n end",
"title": ""
},
{
"docid": "296efece3f3d69d81df3246e43652dc4",
"score": "0.6676329",
"text": "def new\n # TODO support multiple receivers\n @notification = Notification.new(patient_id: params[:to])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification }\n end\n end",
"title": ""
},
{
"docid": "6e014d37b973d9e95c17cf3d951c9d0d",
"score": "0.6627478",
"text": "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end",
"title": ""
},
{
"docid": "6e014d37b973d9e95c17cf3d951c9d0d",
"score": "0.6627478",
"text": "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end",
"title": ""
},
{
"docid": "eca445ca13b4d1a857962ffdcfed40b2",
"score": "0.6621144",
"text": "def new \n @notification = Notification.new \n end",
"title": ""
},
{
"docid": "baf2d7002f22bdf804aba546e73365db",
"score": "0.6614221",
"text": "def new\n @notify_event = NotifyEvent.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @notify_event }\n end\n end",
"title": ""
},
{
"docid": "212a5ca573d541052a5817e32561db12",
"score": "0.660806",
"text": "def new\n @email_history = EmailHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email_history }\n end\n end",
"title": ""
},
{
"docid": "d99f5a7e176c886d789875c9e1cf6ed0",
"score": "0.6581715",
"text": "def new\n @notificacion = Notificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notificacion }\n end\n end",
"title": ""
},
{
"docid": "d29d43c33ca8f16dd0b82866409b64cc",
"score": "0.65684843",
"text": "def new\n @recipient = Recipient.new\n @recipient.notifications.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipient }\n end\n end",
"title": ""
},
{
"docid": "41433d74e36719684775ad2d50c3eabe",
"score": "0.65581423",
"text": "def new\n @new = New.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new }\n end\n end",
"title": ""
},
{
"docid": "28147dcaef4907fc13fb0aa79d9c496d",
"score": "0.6524152",
"text": "def new\n @push = Push.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @push }\n end\n end",
"title": ""
},
{
"docid": "4c55f0bb9643e226379d0c7fa693e23f",
"score": "0.6502097",
"text": "def new\n @event_notify_email = EventNotifyEmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_notify_email }\n end\n end",
"title": ""
},
{
"docid": "bc597db81f8548dba66e73e43a756902",
"score": "0.6474903",
"text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "3aee9013416603b06e5726901d02dbf3",
"score": "0.64717364",
"text": "def create\n @notification = current_app.notifications.create(params)\n render json: @notification\n end",
"title": ""
},
{
"docid": "f734a71f1436daa5043b9c0c0fb138da",
"score": "0.6468055",
"text": "def new\n @roommate_notification = RoommateNotification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @roommate_notification }\n end\n end",
"title": ""
},
{
"docid": "79bc85c9efa2c7a061207d6cbf276ec3",
"score": "0.6466224",
"text": "def new\n @reminder = Reminder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reminder }\n end\n end",
"title": ""
},
{
"docid": "79bc85c9efa2c7a061207d6cbf276ec3",
"score": "0.6466224",
"text": "def new\n @reminder = Reminder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reminder }\n end\n end",
"title": ""
},
{
"docid": "67b4b655659af9bf545c2808cd8d708f",
"score": "0.646096",
"text": "def create\n set_custom_properties \n @notification = APN::Notification.new(params[:notification])\n respond_to do |format|\n if @notification.save\n format.html { redirect_to(notification_url(@notification), :notice => 'Notification was successfully created.') }\n format.xml { render :xml => @notification, :status => :created, :location => notification_path(@notification) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @notification.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c719e7e07e1c8857318cad22caa50f1",
"score": "0.6459942",
"text": "def create\n @notification = current_user.notifications.new(params[:notification])\n\n respond_to do |format|\n if @notification.save\n flash[:notice] = 'You will be notified via email when this book or its chapters have been updated.'\n format.html { redirect_to(@notification.book) }\n format.xml { render :xml => @notification, :status => :created, :location => @notification }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @notification.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "194d57d24612e4055795550fab24b69f",
"score": "0.6455472",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"title": ""
},
{
"docid": "584bf39e144240b99719ba9a59a016ee",
"score": "0.64536303",
"text": "def create_notifications(model) path = \"/api/v2/notifications\"\n post(path, model, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "675a4c1f60893fc478f938f4a705f245",
"score": "0.6450245",
"text": "def new\n @recipient = Recipient.new\n # @recipient.notifications.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipient }\n end\n end",
"title": ""
},
{
"docid": "8390bcb280f48a1e728735cc95d9c44e",
"score": "0.6446953",
"text": "def new\n @mail = Mail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mail }\n end\n end",
"title": ""
},
{
"docid": "d935ce5a903c36109d57d610ce5c6539",
"score": "0.6446214",
"text": "def new\n @notification_report = NotificationReport.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification_report }\n end\n end",
"title": ""
},
{
"docid": "fcc715418c53308e75bd7dab571bfcf5",
"score": "0.6443922",
"text": "def new\n @notacredito = Notacredito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notacredito }\n end\n end",
"title": ""
},
{
"docid": "7e337f017f6f028aa87c766b833b503e",
"score": "0.64432186",
"text": "def new\n @announce = Announce.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @announce }\n end\n end",
"title": ""
},
{
"docid": "87730b58e4d0ebc4ed7fdb1aa878d41a",
"score": "0.6437188",
"text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"title": ""
},
{
"docid": "87730b58e4d0ebc4ed7fdb1aa878d41a",
"score": "0.6437188",
"text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"title": ""
},
{
"docid": "87730b58e4d0ebc4ed7fdb1aa878d41a",
"score": "0.6437188",
"text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"title": ""
},
{
"docid": "0e4b9cac0f221c1412095d6b082bae20",
"score": "0.64197356",
"text": "def new\n @messaging = Messaging.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @messaging }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "cff1b39be027e2c779238731fd29302d",
"score": "0.64197165",
"text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "c44f321acd5ba34c7e638b94edebad72",
"score": "0.6406597",
"text": "def create\n @notification = Notification.new(notification_params)\n\n respond_to do |format|\n if @notification.save\n format.html { redirect_to root_path, notice: I18n.t(\"notifications.create_success\") }\n format.json { render :show, status: :created, location: @notification }\n else\n format.html { render :new }\n format.json { render json: @notification.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4f2f64643cd93a9f528609442fa0397",
"score": "0.64003694",
"text": "def new\n if current_user.access == 2\n redirect_to \"/users/indexU\"\n end\n @notification = Notification.new\n end",
"title": ""
},
{
"docid": "d3535d6b1d44d803ca93293739467c0d",
"score": "0.6390915",
"text": "def new\n @status_message = StatusMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status_message }\n end\n end",
"title": ""
},
{
"docid": "9ec31f78b967512c2a1822a280594a78",
"score": "0.63870513",
"text": "def new\n @nota = @solicitud.notas.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end",
"title": ""
},
{
"docid": "c3e7bb9b491a1d6c6ff998aa88e89c85",
"score": "0.6383187",
"text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status.to_xml }\n format.json { render :json => @status.to_json }\n end\n end",
"title": ""
},
{
"docid": "1a6851582ea9dbaf58d271a51828f9c4",
"score": "0.63762575",
"text": "def new\n @newtask = Newtask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newtask }\n end\n end",
"title": ""
},
{
"docid": "4b67759841f593ce84a1d78d0827d700",
"score": "0.63714284",
"text": "def new\n @reminder_message = ReminderMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reminder_message }\n end\n end",
"title": ""
},
{
"docid": "a9dfa9f51dc78311fd85fa8e71760fb4",
"score": "0.63710845",
"text": "def new\n @toast = Toast.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @toast }\n end\n end",
"title": ""
},
{
"docid": "6efcc92832c9d1391b0b1d24c6b0197d",
"score": "0.63703537",
"text": "def new\n @status_update = StatusUpdate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status_update }\n end\n end",
"title": ""
},
{
"docid": "6a41f44c5248d9a414e6ed5959b5c96e",
"score": "0.6362445",
"text": "def api_notifications_new_post(opts = {})\n api_notifications_new_post_with_http_info(opts)\n nil\n end",
"title": ""
},
{
"docid": "de1c6c8e8630bc4d9563aac6fc162cb1",
"score": "0.6360385",
"text": "def new\n @email_receive = EmailReceive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email_receive }\n end\n end",
"title": ""
},
{
"docid": "01fc2ff2fc98ea8ee6293706d67df63c",
"score": "0.6349451",
"text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email }\n end\n end",
"title": ""
},
{
"docid": "655ba8ee4417f23043ff941abdcef1eb",
"score": "0.63402706",
"text": "def new\n @nagios_service = NagiosService.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nagios_service }\n end\n end",
"title": ""
},
{
"docid": "2af227b06f4df419472c77ae619ae3b4",
"score": "0.6338139",
"text": "def create\n @breadcrumb = 'create'\n @notification = Notification.new(params[:notification])\n @notification.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @notification.save\n format.html { redirect_to @notification, notice: crud_notice('created', @notification) }\n format.json { render json: @notification, status: :created, location: @notification }\n else\n format.html { render action: \"new\" }\n format.json { render json: @notification.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f853b30c16a611ab829a41db136b275d",
"score": "0.63364923",
"text": "def new\n @push_notification_detail = PushNotificationDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @push_notification_detail }\n end\n end",
"title": ""
},
{
"docid": "a913f9b4b134a24091c688f96b10afae",
"score": "0.63362664",
"text": "def create\n @users = User.find(:all)\n @users.each { |user| user.notifications << Notification.new(params[:notification]) }\n\n respond_to do |format|\n flash[:notice] = 'Notifications were successfully sent.'\n format.html { redirect_to( :action => 'new' ) }\n format.xml { render :xml => @notifications, :status => :created, :location => @notifications }\n end\n end",
"title": ""
},
{
"docid": "57a7b914339a49bb37c3ebd12c29c2a5",
"score": "0.63321745",
"text": "def new\n @newsletter = Newsletter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newsletter }\n end\n end",
"title": ""
},
{
"docid": "d3b07987eb2c4ba2ab7f8bf783194be7",
"score": "0.6330775",
"text": "def new\n @observacao_nota = ObservacaoNota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @observacao_nota }\n end\n end",
"title": ""
},
{
"docid": "9e5c2a149db703fa145401548c136dee",
"score": "0.6323204",
"text": "def new\n @menu = \"Notes\"\n @page_name = \"Create New Note \"\n @users = @company.users\n @note = Note.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @note }\n end\n end",
"title": ""
},
{
"docid": "c0b04c2caa079aca6a688862e248e7b2",
"score": "0.63188756",
"text": "def new\n @emails_person = EmailsPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @emails_person }\n end\n end",
"title": ""
},
{
"docid": "8d3e47a4872d1eeed8e8bf2ec2fa848e",
"score": "0.63183",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @news }\n end\n end",
"title": ""
},
{
"docid": "c2f76f69162cd581b81891f55a21f000",
"score": "0.6314114",
"text": "def new\n @newsletter = Newsletter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newsletter }\n end\n end",
"title": ""
},
{
"docid": "c2f76f69162cd581b81891f55a21f000",
"score": "0.6314114",
"text": "def new\n @newsletter = Newsletter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newsletter }\n end\n end",
"title": ""
},
{
"docid": "4cc5f5ae07fc9e8c21d31bdde6ae9d36",
"score": "0.6312102",
"text": "def new\n @mailing = Mailing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailing }\n end\n end",
"title": ""
},
{
"docid": "4cc5f5ae07fc9e8c21d31bdde6ae9d36",
"score": "0.6312102",
"text": "def new\n @mailing = Mailing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailing }\n end\n end",
"title": ""
},
{
"docid": "8b11e90fcae099b99530b9e52bb1bc19",
"score": "0.6309385",
"text": "def new\n @change = Change.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @change }\n end\n end",
"title": ""
},
{
"docid": "242fdec0b65ec3a6a9cbdca8e9bbf6c7",
"score": "0.6304765",
"text": "def new\n @newsletter = Newsletter.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newsletter }\n end\n end",
"title": ""
},
{
"docid": "edd7ba9766c5a97dc99627879c5a83c9",
"score": "0.6301189",
"text": "def getNews\n request \"/Notification/getNews.json\"\n end",
"title": ""
},
{
"docid": "fdd33f65dc1c7d87163208ce3260e156",
"score": "0.62999505",
"text": "def create\n @notification = Notification.new(params[:notification])\n\n respond_to do |format|\n if @notification.save\n format.html { redirect_to @notification, notice: 'Notification was successfully created.' }\n format.json { render json: @notification, status: :created, location: @notification }\n else\n format.html { render action: \"new\" }\n format.json { render json: @notification.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fdd33f65dc1c7d87163208ce3260e156",
"score": "0.62999505",
"text": "def create\n @notification = Notification.new(params[:notification])\n\n respond_to do |format|\n if @notification.save\n format.html { redirect_to @notification, notice: 'Notification was successfully created.' }\n format.json { render json: @notification, status: :created, location: @notification }\n else\n format.html { render action: \"new\" }\n format.json { render json: @notification.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
d70e95f55bea2c9234599ead45f2319b | Indicates whether its possible to capture the payment | [
{
"docid": "1ca995deac6b4de643135bf2e8128f1e",
"score": "0.840692",
"text": "def can_capture?(payment)\n ['pending'].include?(payment.state)\n end",
"title": ""
}
] | [
{
"docid": "93b3fbad3a3f58dc38c0b85ac77c2645",
"score": "0.8574391",
"text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end",
"title": ""
},
{
"docid": "93b3fbad3a3f58dc38c0b85ac77c2645",
"score": "0.8574391",
"text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end",
"title": ""
},
{
"docid": "93b3fbad3a3f58dc38c0b85ac77c2645",
"score": "0.8574391",
"text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end",
"title": ""
},
{
"docid": "93b3fbad3a3f58dc38c0b85ac77c2645",
"score": "0.8574391",
"text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end",
"title": ""
},
{
"docid": "93b3fbad3a3f58dc38c0b85ac77c2645",
"score": "0.8574391",
"text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end",
"title": ""
},
{
"docid": "4fb9ff43ec51120c3b53c900cf688c91",
"score": "0.8421634",
"text": "def can_capture?(payment)\n payment.state == 'pending' || payment.state == 'checkout'\n end",
"title": ""
},
{
"docid": "321445fb2254b3bf1ac60aaaa242492d",
"score": "0.83986884",
"text": "def can_capture?(payment)\n ['pending'].include?(payment.state)\n end",
"title": ""
},
{
"docid": "f4e2c4851f68e9aae27636e74146f25f",
"score": "0.8374448",
"text": "def can_capture?(payment)\n payment.checkout?\n end",
"title": ""
},
{
"docid": "f317b6c68484548d0185765c2eca8035",
"score": "0.83426374",
"text": "def can_capture?(payment)\n (payment.pending? || payment.checkout?) && !payment.response_code.blank?\n end",
"title": ""
},
{
"docid": "f317b6c68484548d0185765c2eca8035",
"score": "0.83426374",
"text": "def can_capture?(payment)\n (payment.pending? || payment.checkout?) && !payment.response_code.blank?\n end",
"title": ""
},
{
"docid": "25d42d3f32165a885b382abe358002d7",
"score": "0.83002377",
"text": "def can_capture?(payment)\n ['checkout', 'pending'].include?(payment.state)\n end",
"title": ""
},
{
"docid": "25d42d3f32165a885b382abe358002d7",
"score": "0.83002377",
"text": "def can_capture?(payment)\n ['checkout', 'pending'].include?(payment.state)\n end",
"title": ""
},
{
"docid": "8f339d56c7184b5c27a853578188176b",
"score": "0.8285566",
"text": "def can_capture?(payment)\n logger.debug \"\\n----------- #{self.invoice_number} -----------\\n\"\n ['checkout', 'pending', 'processing'].include?(payment.state) && !self.invoice_number.blank?\n end",
"title": ""
},
{
"docid": "0406a1df335df786008a22f763c676ce",
"score": "0.82840663",
"text": "def can_capture?(payment)\n ['checkout', 'pending'].include?(payment.state)\n end",
"title": ""
},
{
"docid": "a369144b3318e90773ff803da036805f",
"score": "0.8245142",
"text": "def can_capture?(payment)\n ['checkout', 'pending', 'processing'].include?(payment.state)\n end",
"title": ""
},
{
"docid": "047bb37376995a279a5c44eadf0572d5",
"score": "0.76958513",
"text": "def collect_payment?\n true\n end",
"title": ""
},
{
"docid": "f1d61ccdd0235b066453dc16b15ac737",
"score": "0.72335327",
"text": "def can_supply?\n payment_received? || payment_on_account?\n end",
"title": ""
},
{
"docid": "977dfc7f571cfd66578e049e28dca3be",
"score": "0.71325046",
"text": "def can_credit?(payment)\n payment.completed? && payment.credit_allowed > 0\n end",
"title": ""
},
{
"docid": "977dfc7f571cfd66578e049e28dca3be",
"score": "0.71325046",
"text": "def can_credit?(payment)\n payment.completed? && payment.credit_allowed > 0\n end",
"title": ""
},
{
"docid": "87d17cc8edbb11764955c3e1ff6b3a58",
"score": "0.71179265",
"text": "def can_activate?\n self.authorize_payment\n end",
"title": ""
},
{
"docid": "cd0164346ee6e10dd1404273091d006f",
"score": "0.7106526",
"text": "def can_void?(payment)\n !payment.failed? && !payment.void?\n end",
"title": ""
},
{
"docid": "cd0164346ee6e10dd1404273091d006f",
"score": "0.7106526",
"text": "def can_void?(payment)\n !payment.failed? && !payment.void?\n end",
"title": ""
},
{
"docid": "79615de54416d88ff0469611d18f3418",
"score": "0.7004219",
"text": "def can_void?(payment)\n !payment.void?\n end",
"title": ""
},
{
"docid": "79615de54416d88ff0469611d18f3418",
"score": "0.7004219",
"text": "def can_void?(payment)\n !payment.void?\n end",
"title": ""
},
{
"docid": "d0b8ce83bffed589dd273690729eddd8",
"score": "0.69761574",
"text": "def can_finish?\n self.payment_status == PTE::PaymentStatus.processing\n end",
"title": ""
},
{
"docid": "c2343a425fb974d8bb6257a09599c788",
"score": "0.69729304",
"text": "def payment_success?\n @fields['decision'] == 'ACCEPT'\n end",
"title": ""
},
{
"docid": "983bc1ad3817961ed39085272fdb2221",
"score": "0.6920117",
"text": "def in_payment?\n @in_payment\n end",
"title": ""
},
{
"docid": "51546bda95a62bc2ddd2eddc6c6097ea",
"score": "0.6905132",
"text": "def is_manual?\n payment_kind == 'manual'\n end",
"title": ""
},
{
"docid": "6ac5635c6a937bec5a53f596cfe004fa",
"score": "0.68792975",
"text": "def can_credit?(payment)\n return false unless payment.state == 'completed'\n return false unless payment.order.payment_state == 'credit_owed'\n payment.credit_allowed > 0\n end",
"title": ""
},
{
"docid": "bfe08b6b9cfa74b78a85b9547d5ae2ce",
"score": "0.6878423",
"text": "def capture_pending_payments\n success = true\n order.payments.pending.each do |payment|\n unless payment.capture!\n copy_errors(payment)\n success = false\n end\n end\n success\n end",
"title": ""
},
{
"docid": "adb02a6d82d6548411c76e2bda3316a1",
"score": "0.6878125",
"text": "def guard_process_payment_from_created; true; end",
"title": ""
},
{
"docid": "adb02a6d82d6548411c76e2bda3316a1",
"score": "0.6878125",
"text": "def guard_process_payment_from_created; true; end",
"title": ""
},
{
"docid": "54c059f7f5ac4948997b679aed955856",
"score": "0.68705887",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "54c059f7f5ac4948997b679aed955856",
"score": "0.68705887",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "c944f4a93adaae71a29eaff727505f7b",
"score": "0.6854525",
"text": "def can_credit?(payment)\n return false unless payment.completed?\n return false unless payment.order.payment_state == 'credit_owed'\n payment.credit_allowed > 0\n end",
"title": ""
},
{
"docid": "c944f4a93adaae71a29eaff727505f7b",
"score": "0.6854525",
"text": "def can_credit?(payment)\n return false unless payment.completed?\n return false unless payment.order.payment_state == 'credit_owed'\n payment.credit_allowed > 0\n end",
"title": ""
},
{
"docid": "1c44609c59ce3c0c6053853244061118",
"score": "0.6840233",
"text": "def can_void?(payment)\n !%w(void failure invalid).include?(payment.state)\n end",
"title": ""
},
{
"docid": "5f645189b34ae1eb28b7491f2cddff01",
"score": "0.68260354",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "5f645189b34ae1eb28b7491f2cddff01",
"score": "0.68260354",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "5f645189b34ae1eb28b7491f2cddff01",
"score": "0.68260354",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "5f645189b34ae1eb28b7491f2cddff01",
"score": "0.68260354",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "5f645189b34ae1eb28b7491f2cddff01",
"score": "0.68260354",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "5f645189b34ae1eb28b7491f2cddff01",
"score": "0.68260354",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "5f645189b34ae1eb28b7491f2cddff01",
"score": "0.68260354",
"text": "def can_void?(payment)\n payment.state != 'void'\n end",
"title": ""
},
{
"docid": "8e2ac3884caa6c130e13986cd0f37268",
"score": "0.6804581",
"text": "def can_void?(payment)\n !payment.state.in?(['void', 'invalid', 'failed'])\n end",
"title": ""
},
{
"docid": "a6b88dd789d3bcd7ca5de43502e3c8c9",
"score": "0.67943954",
"text": "def can_void?(payment)\n !payment.void? && payment.pending? && !payment.response_code.blank?\n end",
"title": ""
},
{
"docid": "a6b88dd789d3bcd7ca5de43502e3c8c9",
"score": "0.67943954",
"text": "def can_void?(payment)\n !payment.void? && payment.pending? && !payment.response_code.blank?\n end",
"title": ""
},
{
"docid": "78d7be36a4a4f49f4e9d19ad0554987e",
"score": "0.6789482",
"text": "def can_cash?\n self.capture_and_cash\n end",
"title": ""
},
{
"docid": "4a408289dcfa7d8c587c324740e51ad5",
"score": "0.6763707",
"text": "def payment_cadence_allowed?\n begin\n config_payment_cadence = SystemConfiguration::Variable.get_value('booking.payment_cadence').to_i\n _date_from_str = \"#{self.date_from.strftime('%Y-%m-%d')}T#{self.time_from}:00#{self.date_from.strftime(\"%:z\")}\"\n _date_from = DateTime.strptime(_date_from_str,'%Y-%m-%dT%H:%M:%S%:z')\n diff_in_hours = ((_date_from.to_time - self.creation_date.to_time).to_f * 24).to_i\n allowed = diff_in_hours > 0 && (diff_in_hours >= config_payment_cadence)\n allowed || force_allow_payment\n rescue => error\n p \"Error #{id} #{date_from} #{time_from} #{date_to} #{time_to} #{driver_date_of_birth} #{driver_driving_license_date}\"\n return false\n end\n end",
"title": ""
},
{
"docid": "432ef672ea39d2426b71b33ee58946b0",
"score": "0.6741932",
"text": "def should_request_capture?(response, requires_approval)\n !capture_requested?(response) && requires_approval != false\n end",
"title": ""
},
{
"docid": "3879f760547e741e92f552493ff5f161",
"score": "0.6704732",
"text": "def store_credit_card?\n paid?\n end",
"title": ""
},
{
"docid": "d423b85a35249a8354c9a224e026d896",
"score": "0.66913325",
"text": "def payment_api_return?\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "86bf4eac1cf0e18479a67968fef91490",
"score": "0.66803646",
"text": "def payment_received?\n payment_state == PAYMENT_RECEIVED\n end",
"title": ""
},
{
"docid": "b5fd84941c3a4f4ad89a87dc34083a3a",
"score": "0.6655936",
"text": "def payed?\n !payment_entry.nil?\n end",
"title": ""
},
{
"docid": "27f07e7b3d7a698f38e4b5cd29f91a19",
"score": "0.66481507",
"text": "def credit_card_needed?\n credit_card_required?\n end",
"title": ""
},
{
"docid": "bf3c1687bd98330f149f0cbaafd63b84",
"score": "0.66368896",
"text": "def paid_with_card?\n payment_type == \"card\"\n end",
"title": ""
},
{
"docid": "e7924e51d3bfb088d411aa0967271141",
"score": "0.659922",
"text": "def authorize_payment\n if !self.pending_purchase_order && self.payment_object\n order, payment = self.purchase_and_authorize\n if payment && payment.success?\n# self.payment_object = nil # remove payment object so we can re-validate\n self.purchase_orders.reload\n return payment.success?\n end\n end\n false\n end",
"title": ""
},
{
"docid": "0d0fa04b161ece360c812a47f58943c2",
"score": "0.659313",
"text": "def credit?\n (payment_method == CREDIT)\n end",
"title": ""
},
{
"docid": "78cb9d42f4052c3e8c2ce15c9f827b7d",
"score": "0.6559455",
"text": "def capture_payment(options = {})\n # transaction do\n capture = OrderTransaction.capture(amount, authorization_reference, options)\n self.save!\n self.order_transactions << capture\n\n if capture.success?\n self.payment_captured!\n else\n self.transaction_declined!\n end\n\n capture\n # end\n end",
"title": ""
},
{
"docid": "8e1b14601c02796fbaf941625e669d6e",
"score": "0.6553428",
"text": "def succeeded?\n authorized? || paid?\n end",
"title": ""
},
{
"docid": "c9b00232dfa6ba727f2acd903fa2d58a",
"score": "0.6528682",
"text": "def authorize_and_capture\n \n resp = StdClass.new \n if self.financial_status == Invoice::FINANCIAL_STATUS_CAPTURED\n resp.error = \"Funds for this invoice have already been captured.\"\n else\n \n sc = self.site.store_config \n case sc.pp_name \n when StoreConfig::PAYMENT_PROCESSOR_STRIPE\n \n Stripe.api_key = sc.stripe_secret_key.strip\n bt = nil\n begin\n c = Stripe::Charge.create(\n :amount => (self.total * 100).to_i,\n :currency => 'usd',\n :customer => self.customer.stripe_customer_id,\n :capture => true,\n :metadata => { :invoice_id => self.id },\n :statement_descriptor => \"#{self.site.description.truncate(22)}\"\n ) \n rescue Exception => ex\n resp.error = \"Error during capture process\\n#{ex.message}\" \n end \n if resp.error.nil?\n InvoiceTransaction.create(\n :invoice_id => self.id,\n :transaction_id => c.id,\n :transaction_type => InvoiceTransaction::TYPE_AUTHCAP,\n :payment_processor => sc.pp_name,\n :amount => c.amount / 100.0,\n :captured => true,\n :date_processed => DateTime.now.utc,\n :success => c.status == 'succeeded'\n )\n if c.status == 'succeeded'\n self.financial_status = Invoice::FINANCIAL_STATUS_CAPTURED\n self.save\n resp.success = true\n else\n resp.error = \"Error capturing funds.\"\n end\n end\n \n end \n end \n return resp\n end",
"title": ""
},
{
"docid": "152aba48403f89fe2f746ba73334175a",
"score": "0.6496032",
"text": "def authorizable_cc_payment?\n adyen_cc_payment? && amount != 0\n end",
"title": ""
},
{
"docid": "c6c61cf762c597764726bbfacbae41b0",
"score": "0.64757854",
"text": "def payment_pending?\n payment_state == PAYMENT_PENDING\n end",
"title": ""
},
{
"docid": "172e6c38db4b77f86cdda14987cbe9d2",
"score": "0.646828",
"text": "def payment_in_progress?\n\t\t\t\t\treturn !self.payment_id.nil?\n\t\t\t\tend",
"title": ""
},
{
"docid": "575b83cc30b476ba86b47f3a6cfa8442",
"score": "0.64674497",
"text": "def paid_with_card?\n order.payment_method == 'credit_card'\n end",
"title": ""
},
{
"docid": "ce6528277110f270c210a02beab0b6c0",
"score": "0.6459903",
"text": "def capture!\n if hpp_payment? || adyen_cc_payment?\n amount = money.money.cents\n process do\n payment_method.send(\n :capture, amount, response_code, gateway_options)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "217990ed0e85613bcb0e11c9efec915b",
"score": "0.64376986",
"text": "def payment_confirmation_required?\n true\n end",
"title": ""
},
{
"docid": "450718690354ddab68f8a7c6737a0bab",
"score": "0.6432658",
"text": "def payment_authorized?(payment_id)\n check_payment = get_payment_intent_info(payment_id)\n status = check_payment['status']\n puts \"Current Payment Status: #{status}\"\n case status\n when 'Authorized', 'Card Verified'\n puts 'Payment has been authorized'\n return true\n # when 'Declined'\n # puts \"Reason for Decline: #{check_payment['response_summary']}\"\n # abort 'Payment has been declined so exiting this program'\n end\n puts \"3DS Flow hasn't been completed\"\n false\n end",
"title": ""
},
{
"docid": "c24cc142e85529485ce235bc4a76cde9",
"score": "0.6422796",
"text": "def payment_profiles_supported?\n false\n end",
"title": ""
},
{
"docid": "b868bbdaea3fa210e9298975c93000de",
"score": "0.64100313",
"text": "def payments_in_use?\n payment_gateway.present? && payment_gateway.configured?\n end",
"title": ""
},
{
"docid": "44596a54dabb7acf2c8fa4bbc4f1af07",
"score": "0.6405559",
"text": "def purchase!\n if ratepay?\n capture!\n elsif adyen_cc_payment?\n authorize!\n capture!\n else\n super\n end\n end",
"title": ""
},
{
"docid": "e1ce5bcaa44a2522b3c05271cb9844fc",
"score": "0.63914835",
"text": "def requires_manual_payment?\n Paykido::Application.config.always_pay_manually or\n !self.payer.registered?\n end",
"title": ""
},
{
"docid": "7f4746a4d144318839903bfb70fa3efd",
"score": "0.6388284",
"text": "def charge_is_allowed?\n\t\tif not customer_has_authorized_payment?\n\t\t\terrors.add :base, I18n.t('views.customer_file.new_charge.you_are_not_authorized')\n\t\t\tfalse\n\t\telsif valid? and charge_amount.present? and authorized_amount and charge_amount.to_i <= authorized_amount\n\t\t\ttrue\n\t\telse\n\t\t\terrors.add :charge_amount, I18n.t('views.customer_file.new_charge.invalid', amount: charge_amount_usd) if errors.empty?\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "893bda624438482d1fbe31d7b5e8dad0",
"score": "0.6388221",
"text": "def check(payment)\n retval\n end",
"title": ""
},
{
"docid": "3fbb2501d013d2b3f2dfe08646170563",
"score": "0.6387437",
"text": "def payment_received?\n status == Enums::PaymentStatus::PAYMENT_RECEIVED\n end",
"title": ""
},
{
"docid": "f13460699a8ad130a96d376022c13888",
"score": "0.63678837",
"text": "def claim_amount_required?\n @full_repayment_of_ads != 'Y'\n end",
"title": ""
},
{
"docid": "d3cb77177e7afd892bc87c313b70dbf0",
"score": "0.636496",
"text": "def capture!(capture_amount = nil)\n if hpp_payment? || adyen_cc_payment? || ratepay?\n amount = money.money.cents\n process do\n payment_method.send(\n :capture, amount, response_code, gateway_options)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "c3e2220374251e41bf53e6429a0f491d",
"score": "0.6363913",
"text": "def payment_failed?\n cancel_reason == PAYMENT_FAILED\n end",
"title": ""
},
{
"docid": "71049f6dcd56ca508458c34c1beb050e",
"score": "0.6352809",
"text": "def require_one_click_payment?(source, shopper)\n false\n end",
"title": ""
},
{
"docid": "036be561894edbddef66b43347000dd4",
"score": "0.63392484",
"text": "def settled_payment?\n SUCCESSFUL_PAYMENT.include?(response['payment_state'])\n end",
"title": ""
},
{
"docid": "16a75d1fda38c88f63639537258c26ed",
"score": "0.63217205",
"text": "def credit_card?\n (payment_method == CREDIT_CARD)\n end",
"title": ""
},
{
"docid": "8d3c9dad2dd28653af0c6699690d39d0",
"score": "0.6303929",
"text": "def cc_pay?\n plan&.direct_pay && id != 3744\n end",
"title": ""
},
{
"docid": "3ae8d9db5b377cb0c24601deac94a811",
"score": "0.62953824",
"text": "def capture\n begin \n Order.transaction do\n # lock order\n Order.find_by_id(self.id, :lock => true)\n # go through all order_payments\n order_payments = self.order_payments\n if order_payments.size == 0\n p \"No order_payments to process.\"\n raise PaymentError, \"No order_payments to process.\"\n end\n for order_payment in order_payments\n order_payment.capture!\n end\n self.upgrade_coupons!\n # update order\n self.update_attributes!(:state => Order::PAID, :paid_at => Time.zone.now)\n end\n # send confirmation email\n user = User.find_by_id(self.user_id)\n if user and user.send_confirmation(self.deal_id)\n return true\n else\n logger.error \"Order.capture: Confirmation email failed to send: #{self.inspect}\"\n return false\n end\n rescue PaymentError => pe\n p \"Order.capture: Failed for Order #{self.inspect} #{pe}\"\n logger.error \"Order.capture: Failed for Order #{self.inspect} #{pe}\"\n rescue ActiveRecord::RecordInvalid => invalid\n p \"Order.capture: Failed for Order #{self.inspect} #{invalid}\"\n logger.error \"Order.capture: Failed for Order #{self.inspect} #{invalid}\"\n end\n return false\n end",
"title": ""
},
{
"docid": "b1ce81523be5cc0044b085950a986f08",
"score": "0.62766343",
"text": "def payment_possible_for?(listing)\n listing.price && listing.price > 0 && stripe_in_use?\n end",
"title": ""
},
{
"docid": "b75444417117742158de5246f7c32387",
"score": "0.6271231",
"text": "def success?\n @result[:payment] === true\n end",
"title": ""
},
{
"docid": "42ca712c8b14abeb3bf993684c9447f8",
"score": "0.6267796",
"text": "def verify!\n raise \"Payment details not active anymore\" if active == false\n end",
"title": ""
},
{
"docid": "61ff11357890394e8784758f367334f8",
"score": "0.62561107",
"text": "def payments_in_use?\n active_payment_types.present?\n end",
"title": ""
},
{
"docid": "3fa12979acba629f0b78b714232d09b5",
"score": "0.62546706",
"text": "def valid?\n p = build_payment\n p.valid?\n end",
"title": ""
},
{
"docid": "33d7127a2d942668a4d575c452c6c157",
"score": "0.62528485",
"text": "def process_with_active_merchant\n options = populate_options\n auth = authorize_payment(options)\n save!\n if APP_CONFIG['pre_and_post_authorization'] == true\n if auth.success == true\n capture_payment(options)\n save!\n end\n end\n end",
"title": ""
},
{
"docid": "164cd7c4315afceb7af6bbbef066666f",
"score": "0.62410927",
"text": "def customer_has_authorized_payment?\n\t\tauthorized and authorized_amount.try(:>, 0) and has_customer_account?\n\tend",
"title": ""
},
{
"docid": "5ffe41fa606b094cc68f82ed454eb7d2",
"score": "0.6227802",
"text": "def charge?\n false\n end",
"title": ""
},
{
"docid": "23a7bc04710f8c971b6a25574bf0125d",
"score": "0.6182079",
"text": "def recording_consent_required?\n @settings.get_value(\"Require Recording Consent\") == \"true\"\n end",
"title": ""
},
{
"docid": "217fc3c3db8a1ce8bef7f235ac7a1a03",
"score": "0.6174833",
"text": "def can_request_purchase?\n true # TODO: Should this be !virginia_borrower? ?\n end",
"title": ""
},
{
"docid": "cc914f8dbefa6ad4ebc40a1134707077",
"score": "0.61711377",
"text": "def trial?\n price_is_zero = price_amount_micros == 0\n price_is_zero && payment_received?\n end",
"title": ""
},
{
"docid": "c06309985efe7dccae70e257d0dd8492",
"score": "0.6171051",
"text": "def payment_possible_for?(listing)\n listing.price && listing.price > 0 && payments_in_use?\n end",
"title": ""
},
{
"docid": "a88e525fcf7868244175e42215a61758",
"score": "0.6159654",
"text": "def pending?\n payment_status == 'Pending'\n end",
"title": ""
},
{
"docid": "3654c530e3cf76965406850e7e15f804",
"score": "0.61500674",
"text": "def paid_in_full?\n !payment_outstanding?\n end",
"title": ""
},
{
"docid": "e06ed8db6918732457352c9e71cc51c2",
"score": "0.61407906",
"text": "def allow_paypal_payments?\n paypal_credentials.present? || paypal_email.present?\n end",
"title": ""
},
{
"docid": "37f25135039235d916232bb5e034264c",
"score": "0.61360097",
"text": "def can_pay?\n\n can_pay_deposit? or can_pay_pending? or can_pay_total?\n\n end",
"title": ""
},
{
"docid": "b38cfdb6fbff1ae08db00d4e11edfefa",
"score": "0.61227816",
"text": "def accounts_receivable?\n type == 'ACCRECCREDIT'\n end",
"title": ""
}
] |
a88d58e93a918c0129ac562f0976afdc | POST /finalidad_cultivos POST /finalidad_cultivos.json | [
{
"docid": "e440ed99009dea6dfc5110efceee87eb",
"score": "0.7054997",
"text": "def create\n @finalidad_cultivo = FinalidadCultivo.new(params[:finalidad_cultivo])\n\n respond_to do |format|\n if @finalidad_cultivo.save\n format.html { redirect_to @finalidad_cultivo, notice: 'Finalidad cultivo was successfully created.' }\n format.json { render json: @finalidad_cultivo, status: :created, location: @finalidad_cultivo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @finalidad_cultivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "9373ff8f319f75697d6dab0616151a62",
"score": "0.6512548",
"text": "def new\n @finalidad_cultivo = FinalidadCultivo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finalidad_cultivo }\n end\n end",
"title": ""
},
{
"docid": "7fe4ec2b29b9ad9e4276bd5a9bfb9118",
"score": "0.6181151",
"text": "def index\n @finalidad_cultivos = FinalidadCultivo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finalidad_cultivos }\n end\n end",
"title": ""
},
{
"docid": "33de74a96207770f57c843c46076f806",
"score": "0.61465704",
"text": "def nuevo\n if !params[:caso_id].nil?\n @fprensa = CasoFuenteprensa.new\n @fprensa.id_caso = params[:caso_id]\n @fprensa.fuenteprensa_id = 0\n mdate = Sivel2Gen::CasoFuenteprensa.where(\n id_caso: params[:caso_id]).maximum(:fecha)\n if mdate\n mdate = mdate + 1\n else\n mdate = Sivel2Gen::Caso.where(id: params[:caso_id]).count > 0 ?\n Sivel2Gen::Caso.find(params[:caso_id]).fecha + 2 : Date.today\n end\n @fprensa.fecha = mdate\n if @fprensa.save\n respond_to do |format|\n format.js { render text: @fprensa.id.to_s }\n format.json { render json: @fprensa.id.to_s, \n status: :created }\n format.html { render inline: @fprensa.id.to_s }\n end\n else\n respond_to do |format|\n format.html { \n render inline: \"No pudo guardar fuente frecuente: '#{@fprensa.errors.messages.to_s}'\" }\n format.json { render json: @fprensa.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { render inline: 'Falta identificacion del caso' }\n end\n end\n end",
"title": ""
},
{
"docid": "a31a69733840bea166f5393957ad1156",
"score": "0.6145019",
"text": "def create\n @finalidade = Finalidade.new(finalidade_params)\n\n respond_to do |format|\n if @finalidade.save\n format.html { redirect_to @finalidade, notice: 'Finalidade criada com sucesso.' }\n format.json { render :show, status: :created, location: @finalidade }\n else\n format.html { render :new }\n format.json { render json: @finalidade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13fe4d8fd16f088be5200e2d12090d78",
"score": "0.60237336",
"text": "def create\n @matriculacion = Matriculacion.new(matriculacion_params)\n\n respond_to do |format|\n if @matriculacion.save\n @cta_cte = CtaCte.new\n @cta_cte.matriculacion_id = @matriculacion.id\n @cta_cte.nro_cta_cte = @matriculacion.id\n @cta_cte.save\n #@curso = Curso.find(@matriculacion.curso_id)\n #@detalle_cursos = DetalleCurso.all\n @detalle_cursos = DetalleCurso.where(curso_id: @matriculacion.curso_id)\n @suma = 0\n #CREA LA CUENTA CORRIENTE PARA EL ALUMNO\n @movimiento = Movimiento.new\n @detalle_cursos.each do |detalle|\n (1..detalle.cantidad).each do |i|\n @movimiento = Movimiento.create(cta_cte_id: @cta_cte.id, nro_mov: i, descripcion: detalle.descripcion , importe: detalle.importe , estado: false)\n @cta_ct = CtaCte.find(@cta_cte.id)\n @suma += detalle.importe\n @cta_ct.update(montoimporte: @suma)\n end\n end\n format.html { redirect_to @matriculacion, notice: 'Se creo correctamente' }\n format.json { render :show, status: :created, location: @matriculacion }\n else\n format.html { render :new }\n format.json { render json: @matriculacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d11acb6c4e38865637cd92cc2c4532bd",
"score": "0.6009186",
"text": "def create\n #Parámetros permitidos.\n lectura_params\n\n #Asignación de variables.\n numero = params[:lectura][:numero].upcase\n actual = params[:lectura][:actual].to_i\n medidor = Medidor.find_by(numero: numero)\n periodo = Periodo.last\n consumominimo = Servicio.find_by(id: 1)\n\n #Cálculos.\n consumototal = actual - medidor.medicion\n consumototal = actual - medidor.medicion\n if consumototal > consumominimo.m3 then\n consumoexceso = consumototal - consumominimo.m3\n else\n consumoexceso = 0\n end\n\n #Editar lectura.\n @lectura = Lectura.new\n @lectura.cliente_id = medidor.cliente_id\n @lectura.periodo_id = periodo.id\n @lectura.fecha = Date.today\n @lectura.numero = numero\n @lectura.actual = actual\n @lectura.consumo = consumototal\n @lectura.exceso = consumoexceso\n\n #Guardar lectura.\n respond_to do |format|\n if @lectura.save\n medidor.medicion = actual\n medidor.save\n puts'Lectura guardada'\n format.json { render :show, status: :created, location: @lectura }\n #format.html { redirect_to @lectura, notice: 'La lectura fue creada.' }\n #format.js { }\n else\n puts'Lectura no guardada'\n format.json { render json: @lectura.errors, status: :unprocessable_entity }\n #format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "a6ddfb641b23c7b46a9b9f578b01f085",
"score": "0.59938",
"text": "def create\n @pagos_servicio = PagosServicio.new(pagos_servicio_params)\n respond_to do |format|\n if @pagos_servicio.save\n @caja = Caja.where(estado: 0).last\n @mov_caja = MovCaja.create!(caja_id: @caja.id, concepto: @pagos_servicio.servicio, ingreso: 0, egreso: @pagos_servicio.monto, saldo: @caja.cierre.to_i - @pagos_servicio.monto.to_i)\n @caja.update(cierre: @caja.cierre.to_i - @pagos_servicio.monto.to_i, salida: @caja.salida.to_i + @pagos_servicio.monto.to_i)\n format.html { redirect_to @pagos_servicio, notice: 'Se ha registrado el pago correctamente.' }\n format.json { render :show, status: :created, location: @pagos_servicio }\n else\n format.html { render :new }\n format.json { render json: @pagos_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67e6cb08d173b17cb492b4eebc6596ae",
"score": "0.5893723",
"text": "def crear_cuotas\n case params[:adquisicion][:tipo_pago].to_s\n when TIPOS_PAGO[:unico].to_s\n @adquisicion.cuotas.destroy_all\n cuotas = params[:cant_cuotas]\n monto_cuota = @adquisicion.precio / cuotas.to_d\n cuotas.to_i.times do |i|\n @adquisicion.cuotas.create(monto: monto_cuota, concepto: \"Cuota #{i}\")\n end\n when TIPOS_PAGO[:recurrente].to_s\n @adquisicion.cuotas.destroy_all\n meses = params[:cant_meses]\n hoy = Time.zone.today\n dia = params[:dia_del_mes]\n mes = Time.zone.today.month\n ano = Time.zone.today.year\n fecha = Date.new(ano, mes, dia.to_i)\n hoy > fecha ? fecha += 1.month : nil\n meses.to_i.times do |i|\n @adquisicion.cuotas.create(concepto: \"Cuota #{i + 1}\", fecha_vencimiento: fecha, monto: params[:adquisicion][:precio])\n fecha += 1.month\n # mes += 1\n end\n end\n # params[:adquisicion].delete(:cuotas_attributes)\n end",
"title": ""
},
{
"docid": "b783a4b952907d46644e7deec89443a8",
"score": "0.5880052",
"text": "def nuevo\n if params[:fechaacred].blank?\n else\n params[:fechaacred] = Date.civil params[:fechaacred][\"year\"].to_i, params[:fechaacred][\"month\"].to_i, params[:fechaacred][\"day\"].to_i\n end\n if params[:dcau_nroboletadeposito].blank?\n params[:dcau_nroboletadeposito] = '000'\n end\n if params[:chequetercero_ids].blank?\n else\n \t params[:chequetercero_ids].each { |item_id|\n @depositocaucion = Depositocaucion.new\n @depositocaucion.dcau_fechadeposito = params[:fechaacred].to_s.to_date\n @depositocaucion.conceptocaucion_id = params[:conceptocaucion].to_s\n @depositocaucion.dcau_nroboletadeposito = params[:dcau_nroboletadeposito].to_s\n @depositocaucion.chequetercero_id = item_id.to_i\n @depositocaucion.sucursal_id = 11\n @depositocaucion.dcau_ultmod = DateTime.now\n @depositocaucion.dcau_usuario = session[:user].usur_nombre\n @depositocaucion.save!\n \t\n if params[:conceptocaucion].to_s == \"2\" \n @cheterc = Chequetercero.find_by_id_and_sucursal_id(item_id, '11')\n @estadocheq = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n #grabar devueltocaucions\n @devueltocaucion = Devueltocaucion.new\n @devueltocaucion.chequetercero_id = item_id\n @devueltocaucion.sucursal_id = 11\n @devueltocaucion.devc_tipo = \"R\"\n @devueltocaucion.devc_fecha = params[:fechaacred].to_s.to_date\n @devueltocaucion.devc_detalle = 'Devolucion(REINGRESO A CARTERA) Ch/Nº '+@cheterc.cter_nrocheque.to_s+' listado('+@cheterc.listadocaucion_id.to_s+')'\n @devueltocaucion.devc_importe = @cheterc.cter_importe\n @devueltocaucion.devc_cabsalidacarteraant = @estadocheq.cabsalidacartera_id\n @devueltocaucion.devc_usuario = session[:user].usur_nombre\n @devueltocaucion.devc_ultmod = DateTime.now\n @devueltocaucion.save\n\n #hacer asiento\n @cabasiento = Cabasiento.new\n @cabasiento.sucursal_id = 11\n @cabasiento.cabcaja_id = 0\n\t\t@cabasiento.casi_fecha = params[:fechaacred].to_s.to_date\n @cabasiento.casi_cerrado = \"No\"\n \t@cabasiento.casi_borrado = \"No\"\n\t\t@cabasiento.casi_importado = \"No\"\n @cabasiento.casi_descripcion = \"Reingreso de Caucion\"\n @cabasiento.casi_usuario = session[:user].usur_nombre\n @cabasiento.casi_ultmod = DateTime.now\n @cabasiento.save\n \n #renglones del asiento\n nrocabasiento = Cabasiento.maximum(:id)\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 21\n @renasiento.rasi_importe = @cheterc.cter_importe\n @renasiento.save\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 132\n @renasiento.rasi_importe = -@cheterc.cter_importe\n @renasiento.save\n \n # pone a cero los estadocheter\n @estadocheter = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n @estadocheter.update_attribute(:cabsalidacartera_id, '0')\n @estadocheter.update_attribute(:destinocheter_id, '0')\n @estadocheter.update_attribute(:echt_usuario, session[:user].usur_nombre)\n @estadocheter.update_attribute(:echt_ultmod, DateTime.now)\n end\n if params[:conceptocaucion].to_s == \"3\" \n @cheterc = Chequetercero.find_by_id_and_sucursal_id(item_id, '11')\n @estadocheq = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n #grabar devueltocaucion Gesv- Manual\n @devueltocaucion = Devueltocaucion.new\n @devueltocaucion.chequetercero_id = item_id\n @devueltocaucion.sucursal_id = 11\n @devueltocaucion.devc_tipo = \"R\"\n @devueltocaucion.devc_fecha = params[:fechaacred].to_s.to_date\n @devueltocaucion.devc_detalle = 'Devolucion (GESVAL - DEP.MANUAL) Ch/Nº '+@cheterc.cter_nrocheque.to_s+' listado('+@cheterc.listadocaucion_id.to_s+')'\n @devueltocaucion.devc_importe = @cheterc.cter_importe\n @devueltocaucion.devc_cabsalidacarteraant = @estadocheq.cabsalidacartera_id\n @devueltocaucion.devc_usuario = session[:user].usur_nombre\n @devueltocaucion.devc_ultmod = DateTime.now\n @devueltocaucion.save\n\n #hacer asiento\n @cabasiento = Cabasiento.new\n @cabasiento.sucursal_id = 11\n @cabasiento.cabcaja_id = 0\n\t\t @cabasiento.casi_fecha = params[:fechaacred].to_s.to_date\n @cabasiento.casi_cerrado = \"No\"\n \t @cabasiento.casi_borrado = \"No\"\n\t\t @cabasiento.casi_importado = \"No\"\n @cabasiento.casi_descripcion = \"GESVAL - DEP.MANUAL\"\n @cabasiento.casi_usuario = session[:user].usur_nombre\n @cabasiento.casi_ultmod = DateTime.now\n @cabasiento.save\n \n #renglones del asiento\n nrocabasiento = Cabasiento.maximum(:id)\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 7\n @renasiento.rasi_importe = @cheterc.cter_importe\n @renasiento.save\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 132\n @renasiento.rasi_importe = -@cheterc.cter_importe\n @renasiento.save\n \n # pone a cero los estadocheter\n @estadocheter = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n @estadocheter.update_attribute(:cabsalidacartera_id, '0')\n @estadocheter.update_attribute(:destinocheter_id, '0')\n @estadocheter.update_attribute(:echt_usuario, session[:user].usur_nombre)\n @estadocheter.update_attribute(:echt_ultmod, DateTime.now)\n \n end\n }\n end\n # para actualizar las busquedas\n fechas()\n @depositocaucionpendis = Depositocaucion.busqueda(params[:fechadesde], params[:fechahasta], params[:nrocheq])\n @depositocaucions = Depositocaucion.busquedatodo(params[:fechadesde], params[:fechahasta], params[:nrocheq])\n #para sacar los subtotales\n agrup = []\n @depositocaucions.each do |v|\n agrup << v.dcau_nroboletadeposito.to_i\n end\n @agrups = agrup.uniq\n @totalvens = Depositocaucion.totalven(params[:fechadesde], params[:fechahasta])\n @acreditados = Depositocaucion.acreditado(params[:fechadesde], params[:fechahasta])\n render :partial => \"nuevo\", :layout => \"application\"\n\n #redirect_to :action => 'index'\n #render(:update) { |page| page.call 'location.reload' }\n #respond_to do |format| format.js {render(:update) { |page| page.call 'location.reload' }} end \n #render :update do |page| page.form.reset 'uploadPhotoForm' end\n end",
"title": ""
},
{
"docid": "2068f8301903652d9415f14847dbffec",
"score": "0.5874216",
"text": "def nuevo\n authorize! :new, Cor1440Gen::Actividad\n if !params[:actividad_id].nil?\n @detfinanciero = Detallefinanciero.new\n @detfinanciero.actividad_id = params[:actividad_id]\n if @detfinanciero.save(validate: false)\n respond_to do |format|\n format.js { render text: @detfinanciero.id.to_s }\n format.json { render json: @detfinanciero.id.to_s, \n status: :created }\n format.html { render inline: @detfinanciero.id.to_s }\n end\n else\n respond_to do |format|\n format.html { \n render inline: \"No pudo crear fuente frecuente: \" +\n \"'#{@detfinanciero.errors.message.to_s}'\" \n }\n format.json { \n render json: @detfinanciero.errors, \n status: :unprocessable_entity \n }\n end\n end\n else\n respond_to do |format|\n format.html { render inline: 'Falta identificacion de la actividad' }\n end\n end\n end",
"title": ""
},
{
"docid": "7825fad85c2079dd2a1506aa16042f24",
"score": "0.58447486",
"text": "def create\n @tecnica_de_impresion = TecnicaDeImpresion.new(tecnica_de_impresion_params)\n\n respond_to do |format|\n if @tecnica_de_impresion.save\n format.html { redirect_to @tecnica_de_impresion, notice: 'Tecnica de impresion was successfully created.' }\n format.json { render :show, status: :created, location: @tecnica_de_impresion }\n else\n format.html { render :new }\n format.json { render json: @tecnica_de_impresion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e615eb4aa7a6e60424afafbe0bfaefe",
"score": "0.5825093",
"text": "def nuevo\n if !params[:caso_id].nil?\n @presponsable = CasoPresponsable.new\n @presponsable.id_caso = params[:caso_id]\n @presponsable.id_presponsable = 35\n @presponsable.tipo = 0\n if @presponsable.save\n respond_to do |format|\n format.js { render text: @presponsable.id.to_s }\n format.json { render json: @presponsable.id.to_s, status: :created }\n format.html { render inline: @presponsable.id.to_s }\n end\n else\n respond_to do |format|\n format.html { render action: \"error\" }\n format.json { render json: @presponsable.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { render inline: 'Falta identificacion del caso' }\n end\n end\n end",
"title": ""
},
{
"docid": "823f14d8564bd4b7ce25d0d83d7dce1f",
"score": "0.58201087",
"text": "def encerrar\n @comanda.dataEncerramento = Time.now.strftime(\"%Y-%m-%d %H:%M:%S\")\n @comanda.valorFinal = params[:comanda][:valorFinal]\n @comanda.save\n respond_to do |format|\n format.html { redirect_to comandas_url, notice: 'Comanda encerrada com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "39cb7d603702528f18f85def62d8fcfd",
"score": "0.5818003",
"text": "def create\n @contrato = Contrato.new(contrato_params)\n\n respond_to do |format|\n if @contrato.save\n @contrato.anadir_conceptosdepago(@contrato.fecha_inicio, @contrato.fecha_fin)\n format.html { redirect_to @contrato, notice: 'Contrato fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @contrato }\n else\n format.html { render :new }\n format.json { render json: @contrato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dae552130d42b09016bdf6ca74fd069f",
"score": "0.57711005",
"text": "def nuevo\n if params[:caso_id].nil?\n respond_to do |format|\n format.html { render inline: 'Falta identificacion del caso' }\n end\n else\n @evento = Evento.new\n cid = params[:caso_id].to_i\n @evento.caso_id = cid\n @caso = @evento.caso\n @caso.current_usuario = current_usuario\n if @evento.save\n h=@evento.as_json\n h['evento'] = @evento.id\n respond_to do |format|\n format.js { render text: h }\n format.json { render json: h, status: :created }\n format.html { render inline: h.to_s }\n end\n else\n respond_to do |format|\n format.html { render action: \"error\" }\n format.json { \n render json: @evento.errors, \n status: :unprocessable_entity\n }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b6019c927c11613a175bce848096dc6a",
"score": "0.57323533",
"text": "def create\n #Parámetros permitidos.\n pago_params\n\n #Asignación de variables.\n fact = params[:pago][:factura_id]\n fecha = params[:pago][:fechapago]\n factura = Factura.find_by(id: fact)\n\n #Editar pago.\n @pago = Pago.new\n @pago.factura_id = fact\n @pago.fechapago = fecha\n @pago.monto = factura.total\n\n respond_to do |format|\n if @pago.save\n #Inserción en la cuenta corriente cliente por el haber.\n ctactecli = Ctactecli.find_by(cliente_id: factura.cliente_id)\n detallectactecli = Detallectactecli.new\n detallectactecli.ctactecli_id = factura.cliente_id\n detallectactecli.fechadetalle = Date.today\n detallectactecli.tipodetalle = 'Crédito por factura'\n detallectactecli.haber = factura.total\n detallectactecli.save\n ctactecli.saldo = ctactecli.saldo - factura.total\n ctactecli.save\n\n format.json { render :show, status: :created, location: @pago }\n puts'Pago guardado'\n #format.html { redirect_to @pago, notice: 'Pago was successfully created.' }\n else\n format.json { render json: @pago.errors, status: :unprocessable_entity }\n puts'Pago no guardado'\n #format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "2a670e6f4b0acc935fdc0fd4b53994fe",
"score": "0.57205456",
"text": "def crear_cuotas\n @servicio.cuotas.destroy_all\n hoy = Time.zone.today\n dia = params[:dia_del_mes]\n mes = Time.zone.today.month\n ano = Time.zone.today.year\n fecha = Date.new(ano, mes, dia.to_i)\n hoy > fecha ? fecha += 1.month : nil\n @servicio.fin = @servicio.inicio + 1.year if @servicio.fin.blank?\n i = 0\n while fecha < @servicio.fin\n i += 1\n @servicio.cuotas.create(concepto: \"Cuota #{i + 1}\", fecha_vencimiento: fecha, monto: params[:servicio][:precio])\n fecha += 1.month\n # params[:servicio].delete(:cuotas_attributes)\n end\n end",
"title": ""
},
{
"docid": "554e6d227eafefb737fd60da1755a907",
"score": "0.57152337",
"text": "def create\n obtener_datos()\n @ventum = current_user.ventum.new(cliente:@cliente, clave:@clave, fecha:@fecha, iva:@iva, subtotal:@preciofinal ,total:@totalcosto, descuentogeneral: @descglobal, distribuidor: @distribuidor, status: \"En proceso\")\n respond_to do |format|\n if(@ventum.save)\n salvar()\n format.html { redirect_to @ventum, notice: 'Venta almacenada exitosamente!.' }\n else\n format.html { redirect_to eventos_path, notice: 'Fallo el almacenamiento de la venta.' }\n end\n \n end\n end",
"title": ""
},
{
"docid": "be7b2ea65d927f64335cde4766d1e97d",
"score": "0.57092017",
"text": "def create\n @mascotum = Mascotum.new(mascotum_params)\n @mascotum.entrada = \"\"+ params[:entrada][:day] +'/' +params[:entrada][:month] +'/' +params[:entrada][:year]\n @mascotum.salida = \"\"+ params[:salida][:day] +'/' +params[:salida][:month] +'/' +params[:salida][:year]\n respond_to do |format|\n if @mascotum.save\n format.html { redirect_to @mascotum, notice: 'Mascota creada exitosamente' }\n format.json { render :show, status: :created, location: @mascotum }\n else\n format.html { render :new }\n format.json { render json: @mascotum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2694327bb28ba6eb02b3449187dfce32",
"score": "0.5702123",
"text": "def create\n @prueba = Prueba.new(prueba_params)\n\n cantidadAlmacenada = @prueba.cantidad_almacenada\n cantidadDesechada = @prueba.cantidad_desechada\n\n @prueba.cantidad = cantidadAlmacenada + cantidadDesechada \n\n respond_to do |format|\n if @prueba.save\n\n @etiqueta = Etiqueta.new\n\n etiquetaAnalisis = @prueba.etiqueta.etiqueta\n idAnalisis = @prueba.id\n idAnalisisString = idAnalisis.to_s\n\n @etiqueta.etiqueta = etiquetaAnalisis + idAnalisisString + \"-\"\n @etiqueta.formato_id = 2\n @etiqueta.save\n\n format.html { redirect_to etiqueta_mostrar_path(@etiqueta.id), notice: 'Prueba was successfully created.' }\n format.json { render :show, status: :created, location: @prueba }\n else\n format.html { render :new }\n format.json { render json: @prueba.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c25c65825fe0cad82dc268d21b4f2529",
"score": "0.5689115",
"text": "def create\n @estacionamiento = Estacionamiento.new(estacionamiento_params)\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n @serv_adicinales = ServAdicinale.all\n\n respond_to do |format|\n if @estacionamiento.save\n format.html { redirect_to @estacionamiento, notice: 'Estacionamiento was successfully created.' }\n format.json { render :show, status: :created, location: @estacionamiento }\n else\n format.html { render :new }\n format.json { render json: @estacionamiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3ff475e1f70079e6d260559fe08b57d",
"score": "0.5685705",
"text": "def finalidade_params\n params.require(:finalidade).permit(:descr, :vlrgate, :vlrcomissmark, :vlrmarketing, :vlrembalagem, :vlrencargos)\n end",
"title": ""
},
{
"docid": "3ce487174c3d835d2d55839f282ae52e",
"score": "0.5682298",
"text": "def create\n @curso = Curso.new(curso_params)\n @curso.universidade_id = session[:universidade_id]\n @curso.media_alunos = 0\n respond_to do |format|\n if @curso.save\n format.html { redirect_to cursos_path, notice: 'Curso criado com sucesso!' }\n format.json { render :show, status: :created, location: @curso }\n else\n format.html { render :new }\n format.json { render json: @curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52f32e5f7995ab153232169f5b42c390",
"score": "0.5671554",
"text": "def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2748022f80eb8252a39254da55a19f75",
"score": "0.5659079",
"text": "def create\n\n respond_to do |format|\n if @especialidad.save\n format.html { redirect_to @especialidad, notice: 'Servicio creado exitosamente.' }\n format.json { render :show, status: :created, location: @especialidad }\n else\n format.html { render :new }\n format.json { render json: @especialidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3ee2aa44553bdf97de0c31361c8e77b",
"score": "0.56513566",
"text": "def create\n @ativo_outro = AtivoOutro.new(params[:ativo_outro])\n\n respond_to do |format|\n if @ativo_outro.save\n format.html { redirect_to @ativo_outro, notice: 'Ativo foi salvo com sucesso.' }\n format.json { render json: @ativo_outro, status: :created, location: @ativo_outro }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ativo_outro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b25f07369be30ef37bb53f5a1ebf23c5",
"score": "0.563649",
"text": "def create\n @principal_establec = PrincipalEstablec.new(params[:principal_establec])\n\n respond_to do |format|\n if @principal_establec.save\n format.html { redirect_to @principal_establec, notice: 'Registro creado satisfactoriamente.' }\n format.json { render json: @principal_establec, status: :created, location: @principal_establec }\n else\n format.html { render action: \"new\" }\n format.json { render json: @principal_establec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74a25ecbbf105955fb2014b97be35575",
"score": "0.5633764",
"text": "def troca\n @remetente = Sobrevivente.where(id: params[:de]).first\n @destinatario = Sobrevivente.where(id: params[:para]).first\n\n enviar = {agua: 1, comida: 2, medicamento: 3, municao: 4}\n receber = {agua: 0, comida: 2, medicamento: 3, municao: 8}\n\n trocou = @remetente.troca(@destinatario, enviar, receber)\n\n render json: { status: trocou }\n end",
"title": ""
},
{
"docid": "bf5c87b1428131acf5e550c2a7a1b332",
"score": "0.56304765",
"text": "def new\n @escala = Escala.new\n\n if params[:escala].nil? == false\n\t\t dia = params[:escala][\"data_execucao(3i)\"].to_i\n\n \tmes = params[:escala][\"data_execucao(2i)\"].to_i\n \tano = params[:escala][\"data_execucao(1i)\"].to_i\n \thi = params[:escala][\"horario_inicio_execucao(4i)\"].to_i\n \tmi = params[:escala][\"horario_inicio_execucao(5i)\"].to_i\n \thf = params[:escala][\"horario_fim_execucao(4i)\"].to_i\n \tmf = params[:escala][\"horario_fim_execucao(5i)\"].to_i\n \thora_inicio = Time.zone.local(ano,mes,dia,hi,mi,0)\n \thora_fim = Time.zone.local(ano,mes,dia,hf,mf, 0)\n\n $array_escalas.push(params[:escala])\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @escala }\n end\n end\n end",
"title": ""
},
{
"docid": "da961725f106edbe9c9bfaa4edc2ed72",
"score": "0.5622731",
"text": "def create\n @lancamento = Lancamento.new(lancamento_params)\n\n @data = @lancamento.data\n @parcela = (@lancamento.parcela - 1)\n @n = 1\n\n\n respond_to do |format|\n\n if @lancamento.save\n\n if @parcela > 1\n for i in 1..@parcela\n lancamento = @lancamento.dup\n lancamento.data = (@data += 1.month)\n lancamento.parcela = (@n += 1)\n lancamento.save!\n end\n end\n\n\n format.html { redirect_to @lancamento, notice: 'Lancamento was successfully created.' }\n format.json { render :show, status: :created, location: @lancamento }\n format.js\n else\n format.html { render :new }\n format.json { render json: @lancamento.errors, status: :unprocessable_entity }\n format.js\n end\n end\n \n end",
"title": ""
},
{
"docid": "99e15e5f1add0e5e9f89238c147b359c",
"score": "0.5619764",
"text": "def create\n @caja_sucursal = CajaSucursal.new(caja_sucursal_params)\n user = Perfil.find(params[:perfil_id]).user\n @caja_sucursal.user_id = user.id\n respond_to do |format|\n if @caja_sucursal.save\n\n #format.html { redirect_to @caja_sucursal, notice: 'Se creo una caja para esta sucursal.' }\n #format.json { render :show, status: :created, location: @caja_sucursal }\n current_user.sucursal.caja_sucursals << @caja_sucursal\n current_user.negocio.caja_sucursals << @caja_sucursal\n format.json { head :no_content}\n format.js\n else\n format.json {render json: @caja_sucursal.errors.full_messages, status: :unprocessable_entity}\n format.js {render :new}\n #format.html { render :new }\n #format.json { render json: @caja_sucursal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a78178c34f52dcada55d1b884e7dbe42",
"score": "0.5606772",
"text": "def create\n\n\n calcular_horas params[:tiempo_cita], params[:fecha_inicio],params[:hora_inicio], params[:minutos_inicio], params[:am_pm_inicio], params[:hora_final], params[:minutos_final], params[:am_pm_final], params[:se_repite], params[:dias], params[:fecha_final], params[:odontologo_id]\n #obj_horas_disponibles = {\n # 'hora' => params[:hora],\n # 'mes' => params[:mes],\n # 'ano' => params[:ano],\n # 'odontologo_id' => params[:odontologo_id]\n #}\n\n\n #@horas_disponible = HorasDisponible.new(obj_horas_disponibles)\n\n respond_to do |format|\n if 4 == 4\n format.html { redirect_to horas_disponibles_path, notice: 'Horas disponible was successfully created.' }\n format.json { render json: @horas_disponible, status: :created, location: @horas_disponible }\n else\n format.html { render action: \"new\" }\n format.json { render json: @horas_disponible.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64edce206961f1e7021afa5436a63c70",
"score": "0.55716115",
"text": "def create\n @solicitudlabexa = Solicitudlabexa.new(params[:solicitudlabexa])\n @solicitudlabexa.usuario_id = @usuario_actual.id\n @solicitudlabexa.asignatura_id = params[:asignatura][:id].to_i unless params[:asignatura].nil?\n @solicitudlabexa.fechasol=Date.today\n @solicitudlabexa.npuestos=params[:npuestos]\n @solicitudlabexa.curso=params[:nivel].to_s == \"0\" ? \"optativa\" : params[:nivel].to_s\n @solicitudlabexa.comentarios=Iconv.conv('ascii//translit//ignore', 'utf-8', params[:comentarios].to_s)\n @solicitudlabexa.horaini=params[:horaini][:comienzo]\n @solicitudlabexa.horafin=params[:horafin][:fin]\n @solicitudlabexa.asignado=false\n \n if params[:fecha]=~ /[0-3]?[0-9]\\-[0-1]?[0-9]\\-[0-9]{4}/\n nfecha=formato_europeo(params[:fecha])\n #nfechaini=params[:fechaini].to_s.split('-')\n #nfechaini=fecha[2]+\"-\"+fecha[1]+\"-\"+fecha[0]\n @solicitudlabexa.fecha=nfecha.to_date\n else\n @solicitudlabexa.fecha=nil\n end\n\n pref=\"\"\n @especiales=Laboratorio.where('especial=?',\"t\").to_a\n for especial in @especiales do\n nombre=especial.ssoo.to_s\n if params[:\"#{nombre}\"].to_s!='in'\n pref+=especial.nombre_lab.to_s+'-'+nombre+'-'+params[:\"#{nombre}\"]+\";\"\n end\n end\n @solicitudlabexa.preferencias=pref\n @solicitudlabexa.tipo=\"P\"\n \n respond_to do |format|\n\n if @solicitudlabexa.save \n CorreoTecnicos::emitesolicitudexamen(@solicitudlabexa,params[:fecha],\"\",\"Nueva \").deliver_later \n @solicitudlabexas = Solicitudlabexa.where(\"usuario_id = ? \",@usuario_actual.id).to_a\n format.html { redirect_to :action => \"index\" }\n format.xml { render :xml => @solicitudlabexas, :status => :created, :location => @solicitudlabexas }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @solicitudlabexas.errors, :status => :unprocessable_entity }\n end\n \n end\n \n end",
"title": ""
},
{
"docid": "3b3d3bd4af6d1584f2a07d30fd86e2ff",
"score": "0.5569962",
"text": "def update\n @finalidad_cultivo = FinalidadCultivo.find(params[:id])\n\n respond_to do |format|\n if @finalidad_cultivo.update_attributes(params[:finalidad_cultivo])\n format.html { redirect_to @finalidad_cultivo, notice: 'Finalidad cultivo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @finalidad_cultivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f7094198250528d00572ee5c7cc180c",
"score": "0.55689853",
"text": "def create\n \n @categorias_tipo = CatTipo.new(params[:cat_tipo])\n\n\t\trespond_to do |format|\n\t\t\tif @categorias_tipo.save\n \t\t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n\t\t\t\t\n\t\t\t\n\n format.html { redirect_to cat_tipos_path, notice: 'OK' }\n format.json { render json: @categorias_tipo, status: :created, location: @categorias_tipo }\n\t\t\telse\n format.html { render action: \"new\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n \tend\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cfca103cb882c020385d18753b2f69d6",
"score": "0.5568938",
"text": "def create\n \n respond_to do |format|\n \n if @citum.save\n format.html { redirect_to @citum, notice: 'Cita creada exitosamente.' }\n format.json { render :show, status: :created, location: @citum }\n else\n format.html { render :new }\n format.json { render json: @citum.errors, status: :unprocessable_entity }\n end \n \n end\n end",
"title": ""
},
{
"docid": "f1e68f77a6d26d57c200bc005382f65b",
"score": "0.5567657",
"text": "def create\n @ordenes_consumos_detalle = OrdenesConsumosDetalle.new(ordenes_consumos_detalle_params)\n\n respond_to do |format|\n if @ordenes_consumos_detalle.save\n format.html { redirect_to @ordenes_consumos_detalle, notice: 'Ordenes consumos detalle was successfully created.' }\n format.json { render :show, status: :created, location: @ordenes_consumos_detalle }\n else\n format.html { render :new }\n format.json { render json: @ordenes_consumos_detalle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffdef241656ae88e3a04dea58503fd05",
"score": "0.5565694",
"text": "def create \n @lancamentorapido = Lancamentorapido.new(params[:lancamentorapido])\n \n #Validações padrão\n @lancamentorapido.tipo = :receita if @lancamentorapido.tipo.blank?\n @lancamentorapido.valor = 0 if @lancamentorapido.valor.blank? \n \n respond_to do |format|\n if @lancamentorapido.save\n format.html { redirect_to lancamentorapidos_path, notice: 'Lancamento was successfully created.' } \n# format.html { redirect_to '/lancamentorapidos'}\n format.json { render json: lancamentorapidos_path, status: :created, location: @lancamentorapido }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lancamentorapido.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e7dec6af305e7749db65bac87ea5d7d",
"score": "0.5556434",
"text": "def new\r\n# @asistencia = Asistencia.new\r\n\r\n if current_user.nil?\r\n redirect_to(log_in_path) and return\r\n end\r\n\r\n if params[:codigo_alumno].nil?\r\n codigo = 0\r\n else\r\n codigo = params[:codigo_alumno].to_i\r\n end\r\n \r\n @asistencias = Asistencia.por_alumno_fecha(anio_escolar.id, codigo, Date.current)\r\n @personasvinculadas = PersonaVinculada.vinculadas_a(0)\r\n @nuevo = 1\r\n \r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @asistencia }\r\n end\r\n end",
"title": ""
},
{
"docid": "8e65b37c4110da1b8c72c6cc9463463b",
"score": "0.5555351",
"text": "def create\n @tarifas_servicio = TarifasServicio.new(tarifas_servicio_params)\n\n respond_to do |format|\n if @tarifas_servicio.save\n format.html { redirect_to tarifas_servicios_url, notice: 'Tarifas servicio Se creó correctamente.' }\n format.json { render :show, status: :created, location: @tarifas_servicio }\n else\n format.html { render :new }\n format.json { render json: @tarifas_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c689b160735b6e41a78c851580860cf",
"score": "0.5544617",
"text": "def create\n @ruta = Ruta.new(ruta_params)\n respond_to do |format|\n if params[:parada_inicial] != \"\"\n @inicio = Parada.find(params[:parada_inicial])\n @ruta.parada.push(@inicio)\n @ruta_parada = @ruta.ruta_parada.find_by(parada_id: @inicio.id)\n @ruta_parada.tipo = 1\n @ruta_parada.save\n end\n if params[:parada_final] != \"\"\n @final = Parada.find(params[:parada_final])\n @ruta.parada.push(@final)\n @ruta_parada = @ruta.ruta_parada.find_by(parada_id: @final.id)\n @ruta_parada.tipo = -1\n @ruta_parada.save\n end\n if params[:grupo_paradas] != \"\"\n @paradas = Parada.where(:id => params[:grupo_paradas])\n @ruta.parada << @paradas\n end\n if @ruta.save\n format.html { redirect_to @ruta, notice: 'Ruta was successfully created.' }\n format.json { render :show, status: :created, location: @ruta }\n else\n format.html { render :new }\n format.json { render json: @ruta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43bbdccc4fd06a6e792b7d7578e2acf9",
"score": "0.5541574",
"text": "def create\n @analisisregistro = Analisisregistro.new(analisisregistro_params)\n cantidadAlmacenada = @analisisregistro.cantidad_almacenada\n cantidadDesechada = @analisisregistro.cantidad_desechada\n\n @analisisregistro.cantidad = cantidadAlmacenada + cantidadDesechada \n\n @almacenado = Almacenado.new\n @almacenado.cantidad = cantidadAlmacenada\n @almacenado.save\n @desechado = Desechado.new\n @desechado.cantidad = cantidadDesechada \n @desechado.save \n\n respond_to do |format|\n\n if @analisisregistro.save\n \n\n @etiqueta = Etiqueta.new\n\n etiquetaAnalisis = @analisisregistro.etiqueta.etiqueta\n idAnalisis = @analisisregistro.id\n idAnalisisString = idAnalisis.to_s\n\n @etiqueta.etiqueta = etiquetaAnalisis + idAnalisisString + \"-\"\n @etiqueta.formato_id = 2\n @etiqueta.save\n\n format.html { redirect_to etiqueta_mostrar_path(@etiqueta.id), notice: 'Análisis registrado exitosamente.' }\n format.json { render :show, status: :created, location: @analisisregistro }\n else\n format.html { render :new }\n format.json { render json: @analisisregistro.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "60205e751d107503a51c9bf6fb9087d4",
"score": "0.5527948",
"text": "def create\n @asiento_de_servicio = AsientoDeServicio.new(asiento_de_servicio_params)\n\n respond_to do |format|\n if @asiento_de_servicio.save\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully created.' }\n format.json { render :show, status: :created, location: @asiento_de_servicio }\n else\n format.html { render :new }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "971e8d2a139640b8eb7fd05696a71d24",
"score": "0.5526363",
"text": "def create\n @educacao = Educacao.new(educacao_params)\n\n respond_to do |format|\n if @educacao.save\n format.html { redirect_to educacaos_url, notice: 'Educacao was successfully created.' }\n format.json { render :json => @educacao }\n else\n #format.html { render action: 'new' }\n format.json { render json: @educacao.errors, status: :unprocessable_entity }\n format.js { render json: @educacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16703a9c48999f41d0369266b53a13dd",
"score": "0.55249274",
"text": "def create\n @objeto = Carpeta.new(carpeta_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Carpeta was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9757bd33de2ff750597f792d44691066",
"score": "0.5522598",
"text": "def create\n @objeto = DetallePedido.new(detalle_pedido_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Detalle pedido was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84e3c37cbb63cdec5f8a6ad542c68ae0",
"score": "0.5522569",
"text": "def create\n #return render json: params[:recursos]\n @area = Area.new(area_params)\n @count = 0\n save_multiples_recursos if params[:recursos][:status] == '1'\n respond_to do |format|\n if @area.save\n format.html { redirect_to areas_path, notice: 'El Área fue creada éxitosamente.' }\n format.json { render :show, status: :created, location: @area }\n else\n format.html { render :new }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4d3c7929c9edd023fc989c7c45e3b42",
"score": "0.5521304",
"text": "def create\n @categorialivro = Categorialivro.new(params[:categorialivro])\n\n respond_to do |format|\n if @categorialivro.save\n format.html { redirect_to @categorialivro, :notice => 'Categorialivro was successfully created.' }\n format.json { render :json => @categorialivro, :status => :created, :location => @categorialivro }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @categorialivro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48a571a0690ce602ba4ebbc6481b2ea4",
"score": "0.551888",
"text": "def create\n @coleccion_imagene = ColeccionImagene.new(coleccion_imagene_params)\n\n respond_to do |format|\n if @coleccion_imagene.save\n format.html { redirect_to @coleccion_imagene, notice: 'Coleccion imagene was successfully created.' }\n format.json { render :show, status: :created, location: @coleccion_imagene }\n else\n format.html { render :new }\n format.json { render json: @coleccion_imagene.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70727c4897bd8f6976f9a65832dd7257",
"score": "0.5518367",
"text": "def create\n @solicitudrecurso = Solicitudrecurso.new\n @solicitudrecurso.tipo=params[:tipo]\n @solicitudrecurso.fechasol=Date.today\n @solicitudrecurso.horaini=params[:horai]\n @solicitudrecurso.horafin=params[:horaf]\n @solicitudrecurso.fechareserva=session[:fechares]\n @solicitudrecurso.usuario_id=session[:user_id]\n @solicitudrecurso.motivos=params[:motivos]\n nombrecomp = params[:usuario].to_s.split(', ')\n @solicitudrecurso.usuario_id = Usuario.where(\"nombre = :nombre and apellidos = :apellidos\", {:nombre => nombrecomp[1], :apellidos => nombrecomp[0]}).first.id\n \n \n if @solicitudrecurso.save\n familia=Recurso.find_by_identificador(@solicitudrecurso.tipo).descripcion\n @recs=Recurso.where( 'descripcion = ? and disponible = ?',familia,\"t\").to_a\n @ids=@recs.map {|r| r.identificador}\n #session[:fechares]=params[:fecha]\n dia=formato_europeo(session[:fechares])\n #alreves=session[:fechares].to_s.split('-')\n #dia=alreves[2]+\"-\"+alreves[1]+\"-\"+alreves[0]\n @reservas = Solicitudrecurso.where('tipo in (?) and fechareserva = ?', @ids,dia).to_a\n\n respond_to do |format|\n format.js\n end\n \n end\n \n\n end",
"title": ""
},
{
"docid": "4ec1a0a49f6e3936d85d1903796c799e",
"score": "0.55172735",
"text": "def create\n @compra = Compra.new(compra_params)\n @compra.remaining = @compra.cantidad\n @compra.code = Item.find(compra_params[:producto]).identificador\n respond_to do |format|\n if @compra.save\n format.html { redirect_to compras_path, notice: 'Compra was successfully created.' }\n format.json { render :show, status: :created, location: @compra }\n else\n format.html { render :new }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "beba1862fd6fc0322cc396e99f528c8e",
"score": "0.55170876",
"text": "def destroy\n @finalidade.destroy\n respond_to do |format|\n format.html { redirect_to finalidades_url, notice: 'Finalidade excluida com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ad3c17e49f0128e1053447fdd5e6f78b",
"score": "0.551459",
"text": "def create\n @instituicao_responsavel = InstituicaoResponsavel.new(instituicao_responsavel_params)\n\n respond_to do |format|\n if @instituicao_responsavel.save\n format.html { redirect_to @instituicao_responsavel, notice: 'Instituicao responsavel was successfully created.' }\n format.json { render :show, status: :created, location: @instituicao_responsavel }\n else\n format.html { render :new }\n format.json { render json: @instituicao_responsavel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34ec30c92b89de37e6511f49d8212e1c",
"score": "0.5514105",
"text": "def create\n @ejercicio = Ejercicio.new(params[:ejercicio])\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio was successfully created.' }\n format.json { render json: @ejercicio, status: :created, location: @ejercicio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "11a8eeb4bcbe6069e9e7ca387150ed3d",
"score": "0.5499427",
"text": "def create\n @laboratorio = Laboratorio.new(laboratorio_params)\n get_responsavel\n puts \"O responsavel é: #{@laboratorio.responsavel_id}\"\n if (@responsavel != \"sem_responsavel\")\n @laboratorio.docentes << Docente.find(@laboratorio.responsavel_id)\n puts \"Add relação entre #{@laboratorio.nome} e #{Docente.find(@laboratorio.responsavel_id).user.nome}\"\n end\n respond_to do |format|\n if @laboratorio.save\n format.html { redirect_to @laboratorio, notice: 'Laboratorio was successfully created.' }\n format.json { render :show, status: :created, location: @laboratorio }\n else\n format.html { render :new }\n format.json { render json: @laboratorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ceb4b849aa549c9374543582ec4445a",
"score": "0.54971784",
"text": "def crear\n # byebug\n ruta = Ruta.new\n ruta.nombre = params[:ruta][:nombre]\n ruta.descripcion = params[:ruta][:descripcion]\n ruta.subruta = params[:ruta][:subruta]\n ruta.save\n redirect_to action: \"index\"\n\n # respond_to do |format|\n # if @ruta.save\n # format.html { redirect_to @ruta, notice: \"Rutum was successfully created.\" }\n # format.json { render :show, status: :created, location: @ruta }\n # else\n # format.html { render :new }\n # format.json { render json: @ruta.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "6fc12b03c1de87006f37f07e572a51c9",
"score": "0.54966974",
"text": "def new\n \n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n respond_to do |format|\n unless @selecciones.empty?\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n @orden = Orden.new(:direccion_entrega=>usuario_actual.direccion)\n t = Time.now\n fecha = t.strftime(\"%Y-%m-%d\")\n client = Savon::Client.new(\"http://192.168.1.121/DistribuidorFIF/webservices/servicio.php?wsdl\")\n preorden = \"<solicitud_pedido>\n <num_orden>001</num_orden>\n <nombre_comercio>Tukiosquito</nombre_comercio>\n <fecha_solicitud>\"+fecha.to_s+\"</fecha_solicitud>\n <nombre_cliente>\"+usuario_actual.nombre+\" \"+usuario_actual.apellido+\"</nombre_cliente>\n <direccion_comercio>\n <avenida>Sucre</avenida>\n <calle>-</calle>\n <edificio_casa>CC Millenium</edificio_casa>\n <local_apt>C1-15</local_apt>\n <parroquia>Leoncio Martinez</parroquia>\n <municipio>Sucre</municipio>\n <ciudad>Caracas</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_comercio>\n <direccion_destino>\n <avenida>Santa Rosa</avenida>\n <calle>Tierras Rojas</calle>\n <edificio_casa>Villa Magica</edificio_casa>\n <local_apt>69</local_apt>\n <parroquia> </parroquia>\n <municipio>Zamora</municipio>\n <ciudad>Cua</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_destino>\"\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n preorden = preorden+\"\n <articulo>\n <id>\"+p.id.to_s+\"</id>\n <descripcion>\"+p.descripcion+\"</descripcion>\n <peso>\"+p.peso.to_s+\"</peso>\n <cantidad>\"+seleccion.cantidad.to_s+\"</cantidad>\n <precio>\"+p.precio.to_s+\"</precio>\n </articulo>\"\n end\n preorden = preorden+\"</solicitud_pedido>\"\n response = client.request :ejemplo, body: { \"value\" => preorden } \n if response.success? \n respuesta = response.to_hash[:ejemplo_response][:return]\n datos = XmlSimple.xml_in(respuesta)\n end\n\n @precio_envio = datos[\"num_orden\"][0]\n #@arreglo = XmlSimple.xml_in('')\n #@xml = XmlSimple.xml_out(@arreglo, { 'RootName' => 'solicitud_pedido' })\n #url = 'http://192.168.1.101/Antonio/tukyosquito/proyecto/servicio/servicio.php'\n #cotizacion = SOAP::RPC::Driver.new(url)\n #cotizacion.add_method('obtener','asd')\n #tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n #@respuesta = cotizacion.obtener('123')\n format.html # new.html.erb\n else\n format.html { redirect_to carrito_path, notice: 'No tiene productos agregados al carro de compras para generar una orden.' }\n end\n end\n end",
"title": ""
},
{
"docid": "73c2ac564602ecc07befd0cf5f5be46b",
"score": "0.54954064",
"text": "def create\n @etatcivil = Etatcivil.new(etatcivil_params)\n\n respond_to do |format|\n if @etatcivil.save\n format.html { redirect_to @etatcivil, notice: 'Etatcivil was successfully created.' }\n format.json { render :show, status: :created, location: @etatcivil }\n else\n format.html { render :new }\n format.json { render json: @etatcivil.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36343d17e1d1886f3a13f57b29fbf2d9",
"score": "0.549389",
"text": "def create\n @daw_curso_comunicado = DawCursoComunicado.new(daw_curso_comunicado_params)\n\n respond_to do |format|\n if @daw_curso_comunicado.save\n format.html { redirect_to @daw_curso_comunicado, notice: 'Daw curso comunicado was successfully created.' }\n format.json { render :show, status: :created, location: @daw_curso_comunicado }\n else\n format.html { render :new }\n format.json { render json: @daw_curso_comunicado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1eecd64b605fbb2d0a28a83a36528dd",
"score": "0.54916275",
"text": "def create\n @ejercicio = Ejercicio.new(ejercicio_params)\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio creado con exito..' }\n format.json { render :show, status: :created, location: @ejercicio }\n else\n format.html { render :new }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "409ee88b7c0167c1eed482e1230eac8c",
"score": "0.5488149",
"text": "def create\n @detalle_factura = DetalleFactura.new(detalle_factura_params)\n\n respond_to do |format|\n if @detalle_factura.save\n format.html { redirect_to @detalle_factura, notice: 'Detalle factura was successfully created.' }\n format.json { render :show, status: :created, location: @detalle_factura }\n else\n format.html { render :new }\n format.json { render json: @detalle_factura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18f3342320d31448c825c144215bc123",
"score": "0.54863846",
"text": "def create\n\t flash[:scale_alert] = nil;\n @ind = 0\n for i in 0..($array_escalas.size-1)\n @escala = Escala.new($array_escalas[@ind])\n @escala.numero_sequencia = 1\n #@escala.profissional_responsavel_id = $responsavel\n @escala.tipo_acao_id = TipoAcao.where(\"descricao = ?\",\"Inclusão\").first.id\n if @escala.save\n \t#Cria entradas da tabela agendamento para cada escala\n \tminutos = @escala.horario_fim_execucao - @escala.horario_inicio_execucao #em segundos\n \tminutos = minutos / 60\n \tintervalo = minutos / @escala.numero_atendimentos\n \tfor j in 0..(@escala.numero_atendimentos-1)\n \t\t@agendamento = Agendamento.new\n \t\t@agendamento.orgao_id = @escala.orgao_id\n \t\t@agendamento.escala_id = @escala.id\n @agendamento.tipo_situacao_id = TipoSituacao.where(\"descricao = ?\", \"Vago\").first.id\n\n \t\t@agendamento.horario_inicio_consulta = @escala.horario_inicio_execucao + (j*intervalo*60)\n \t\tfim_consulta = j + 1\n \t\t@agendamento.horario_fim_consulta = @escala.horario_inicio_execucao + (fim_consulta*intervalo*60)\n \t\t@agendamento.save\n \tend\n $array_escalas.delete_at(@ind)\n\t\telse\n\t\t\t@ind = @ind + 1\n\t\tend\n\tend\n\t\tif $array_escalas.size == 0\n\t\t\t\trespond_to do |format|\n\t\t\t\t\tformat.html { redirect_to escalas_url, notice: \"Escala(s) criada(s) com sucesso\" }\n\t\t\t\t\tformat.json { render json: @escala, status: :created, location: @escala}\n\t\t\t\t\tend\n \telse\n flash[:scale_alert] = \"Uma ou mais escala(s) possuem conflito de horário com uma escala já criada.\"\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { redirect_to new_escala_path}\n\t\t\t\tformat.json { render json: @escala.errors, status: unprocessable_entity }\n\t\t\tend\n \tend\n end",
"title": ""
},
{
"docid": "9a194f67bce812e28ee1ca0be5817239",
"score": "0.5482942",
"text": "def create\n @especie_id = params[:especie_id]\n\n if @especie_id.present? && @especie_id != '0'\n begin\n @especie = Especie.find(@especie_id)\n end\n else\n @especie = 0\n end\n\n @comentario = Comentario.new(comentario_params.merge(especie_id: @especie_id))\n tipo_proveedor = params[:tipo_proveedor]\n proveedor_id = params[:proveedor_id]\n params = comentario_params\n\n respond_to do |format|\n if params[:con_verificacion].present? && params[:con_verificacion] == '1'\n if (verify_recaptcha(:model => @comentario, :message => t('recaptcha.errors.missing_confirm')) && @comentario.save) || (!Rails.env.production? && @comentario.save)\n\n if params[:es_respuesta].present? && params[:es_respuesta] == '1'\n comentario_root = @comentario.root\n @comentario.completa_info(comentario_root.usuario_id)\n\n # Enviar a los responsables de contenido si es que el usuario siguio la charla\n EnviaCorreo.avisar_responsable_contenido(@comentario, dame_usuarios_envio).deliver\n\n format.json {render json: {estatus: 1, created_at: @comentario.created_at.strftime('%d/%m/%y-%H:%M'),\n nombre: @comentario.nombre}.to_json}\n else\n # Para guardar en la tabla comentarios proveedores\n if proveedor_id.present? && CategoriasContenido::REGISTROS_GEODATA.include?(tipo_proveedor)\n comentario_proveedor = ComentarioProveedor.new\n comentario_proveedor.comentario_id = @comentario.id\n comentario_proveedor.proveedor_id = proveedor_id\n comentario_proveedor.save\n end\n\n EnviaCorreo.confirmacion_comentario(@comentario).deliver\n\n # No SÓLO aquí es donde hay q poner el envio a los responsables de contenido (también allá arriba cuando un usuario responde)\n EnviaCorreo.avisar_responsable_contenido(@comentario, dame_usuarios_envio).deliver if dame_usuarios_envio.present?\n \n format.html { redirect_to especie_path(@especie_id), notice: '¡Gracias! Tu comentario fue enviado satisfactoriamente y lo podrás ver en la ficha una vez que pase la moderación pertinente.' }\n end\n\n else\n # Hubo un error al enviar el formulario\n if params[:es_respuesta].present? && params[:es_respuesta] == '1'\n format.json {render json: {estatus: 0}.to_json}\n else\n format.html { render action: 'new' }\n end\n\n end\n\n # Para evitar el google captcha a los usuarios administradores, la respuesta siempre es en json\n else\n if params[:es_admin].present? && params[:es_admin] == '1' && @comentario.save\n if @comentario.root.general # Si es comentario general\n envia_correo(@comentario)\n else # Si fue un comentario en la plataforma de administración de comentarios (IMPORTANTE!!)\n EnviaCorreo.respuesta_comentario(@comentario).deliver\n end\n if usuario=@comentario.usuario\n nombre = usuario.nombre + usuario.apellido\n end\n created_at = @comentario.created_at.strftime('%d/%m/%y-%H:%M')\n format.json {render json: {estatus: 1, ancestry: \"#{@comentario.ancestry}/#{@comentario.id}\", nombre: nombre, created_at: created_at ||= '' }.to_json}\n else\n format.json {render json: {estatus: 0}.to_json}\n end\n\n end # end con_verificacion\n end # end tipo response\n end",
"title": ""
},
{
"docid": "fd797b2a60a4b55272c03dade8c7dcee",
"score": "0.5481204",
"text": "def create\n @unidad = current_user.empresa.unidades.new(unidad_params)\n\n respond_to do |format|\n if @unidad.save\n format.html { redirect_to @unidad, notice: 'Unidad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unidad }\n else\n format.html { render action: 'new' }\n format.json { render json: @unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6de8afcfea5961ce43ad2203e86b1b5a",
"score": "0.54802006",
"text": "def create\n @categoriafinaceiro = Categoriafinaceiro.new(categoriafinaceiro_params)\n\n respond_to do |format|\n if @categoriafinaceiro.save\n format.html { redirect_to @categoriafinaceiro, notice: 'Categoria cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @categoriafinaceiro }\n else\n format.html { render :new }\n format.json { render json: @categoriafinaceiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1307b0670c341c202cf6baae5acde204",
"score": "0.54792565",
"text": "def create\n @establecimiento = Establecimiento.new(establecimiento_params)\n\n respond_to do |format|\n if @establecimiento.save\n format.html { redirect_to @establecimiento, notice: 'Establecimiento was successfully created.' }\n format.json { render :show, status: :created, location: @establecimiento }\n else\n format.html { render :new }\n format.json { render json: @establecimiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29f1b8bf36f09137cdfd8b8a8cabd3d8",
"score": "0.547912",
"text": "def create\n @comentario_egresado = ComentarioEgresado.new(comentario_egresado_params)\n\n respond_to do |format|\n if @comentario_egresado.save\n format.html { redirect_to @comentario_egresado, notice: 'Comentario egresado was successfully created.' }\n format.json { render :show, status: :created, location: @comentario_egresado }\n else\n format.html { render :new }\n format.json { render json: @comentario_egresado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4ae122996e3ad2d92974870443cc588",
"score": "0.54784906",
"text": "def create\n @asiento = Asiento.new(params[:asiento])\n\n respond_to do |format|\n if @asiento.save\n format.html { redirect_to @asiento, :notice => 'El apunte fue creado.' }\n format.json { render :json => @asiento, :status => :created, :location => @asiento }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "841dad482b86cf5d0fe34682edef4d9a",
"score": "0.5478237",
"text": "def create\n @anteproyecto_observacion = AnteproyectoObservacion.new(anteproyecto_observacion_params)\n\n respond_to do |format|\n if @anteproyecto_observacion.save\n format.html { redirect_to @anteproyecto_observacion, notice: 'Anteproyecto observacion was successfully created.' }\n format.json { render :show, status: :created, location: @anteproyecto_observacion }\n else\n format.html { render :new }\n format.json { render json: @anteproyecto_observacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c23772f319d40f1d75266f14e6eb7877",
"score": "0.5467205",
"text": "def create #inicio\n $filtro = nil\n $id_do_usuario = current_usuario.id\n @disciplinas = params[:disciplinas]\n @cursos_antigo = Curso.find(:all, :conditions => {:aluno_id => current_usuario.id})\n @cursos_novo = params[:cursos]\n @periodo = Periodo.find(:last)\n \n if @cursos_novo.blank?\n #ao menos um curso deve ser informado\n flash[:erro] = t(:erro_curso)\n redirect_to :back\n return\n \n else\n \n @cursos_novo.each do |curso| \n @curso = Curso.new :aluno_id => current_usuario.id, :nome_do_curso => curso\n @curso.save\n \n end\n\n \n end\n \n @cursos_antigo.each do |curso_antigo|\n #apaga o curso, caso o aluno desmarque a caixa\n encontrou_curso = false\n \n for i in @cursos_novo\n if i == curso_antigo.nome_do_curso\n encontrou_curso = true\n break\n \n end\n \n end\n \n unless encontrou_curso\n #apaga o curso se ele não foi encontrado no vetor\n curso_antigo.destroy\n end\n end\n \n \n \n if @disciplinas.blank?\n #apaga todas as matrículas, para o caso do aluno ter desmarcado\n @matriculas = Matricula.find(:all, :conditions => {:aluno_id => current_usuario.id, :periodo_id => @periodo.id})\n @matriculas.each do |matricula|\n matricula.destroy\n end\n respond_to do |format|\n format.html { redirect_to :root, notice: 'Matriculas realizadas com sucesso.' }\n format.json { render json: @matricula, status: :created, location: @matricula }\n end\n return\n \n end\n \n \n $matriculas_atuais = Matricula.find(:all, :conditions => {:aluno_id => $id_do_usuario, :periodo_id => @periodo.id})\n #procura todas as matrículas do aluno no período atual\n \n erro_matricula = false\n @disciplinas.each do |disciplina|\n \n #verifica se o aluno ja se matriculou na disciplina\n @aux = Matricula.find(:first, :conditions => {:disciplina_id => disciplina, :periodo_id => @periodo.id, :aluno_id => current_usuario.id})\n \n\n \n if @aux.blank? \n @disciplina_aux = Disciplina.find(disciplina)\n @matricula = @disciplina_aux.matriculas.create(:aluno_id => current_usuario.id, :periodo_id => @periodo.id, :status => 0, :parecer => \"Aguardando analise da secretaria\")\n unless @matricula.save\n erro_matricula = true\n break\n end \n end\n end \n @matriculas_atuais = Matricula.find(:all, :conditions => {:aluno_id => $id_do_usuario, :periodo_id => @periodo.id})\n \n #verifica se existe alguma matrícula fora as que o aluno solicitou agora\n # - para o caso de ter desistido de uma disciplina\n \n unless erro_matricula\n #apenas entra se não houve nenhum erro na matricula\n @matriculas_atuais.each do |matricula|\n \n desistiu_matricula = false\n for i in @disciplinas \n if i.to_i == matricula.disciplina_id\n desistiu_matricula = true\n break\n end\n end\n \n unless desistiu_matricula\n #apaga a matrícula se o aluno desistiu dela\n matricula.destroy\n end\n \n end \n\n end\n unless erro_matricula\n respond_to do |format|\n format.html { redirect_to :root, notice: 'Matriculas realizadas com sucesso.' }\n format.json { render json: @matricula, status: :created, location: @matricula }\n end\n else\n flash[:erro] = t(:erro_matricula) #Uma ou mais disciplinas não puderam ser salvas devido à conflito de horários\n redirect_to :back\n\n end\n end",
"title": ""
},
{
"docid": "e58d7ec2d8162f9b2fb94c432111ada0",
"score": "0.54657006",
"text": "def create\n pedidos_compra = params[:pedidos_compra_ids]\n pedidos_cotizaciones_count = 0\n pedidos_compra.each do |pedido_id|\n @pedido_compra = PedidoCompra.find(pedido_id)\n categorias = @pedido_compra.get_componente_categorias\n proveedores = ComponenteCategoria.get_proveedores(categorias)\n\n # Se genera un pedido de cotizacion para cada proveedor\n proveedores.each do |p|\n proveedor = Proveedor.find(p)\n pedido_cotizacion = PedidoCotizacion.new( proveedor_id: p,\n pedido_compra_id: @pedido_compra.id,\n fecha_generado: DateTime.now,\n estado: PedidosEstados::PENDIENTE,\n user_id: current_user.id)\n\n @pedido_compra.pedido_compra_detalles.each do |d|\n pedido_cotizacion.pedido_cotizacion_detalles.build(componente_id: d.componente_id, cantidad_requerida: d.cantidad, pedido_compra_detalle_id: d.id) if proveedor.componente_categorias.exists?(d.componente.componente_categoria_id)\n end\n\n pedido_cotizacion.save\n pedidos_cotizaciones_count +=1\n end\n\n @pedido_compra.update(estado: PedidosEstados::PROCESADO, fecha_procesado: DateTime.now) if @pedido_compra.estado != PedidosEstados::PROCESADO\n\n end\n flash.notice = \"Se ha generado #{pedidos_cotizaciones_count} pedidos de cotizaciones.\"\n end",
"title": ""
},
{
"docid": "760cb31489175391b41a9d8769b29bf8",
"score": "0.54589385",
"text": "def create\n @pasteurizacion = Pasteurizacion.new(pasteurizacion_params)\n\n cantidadAlmacenada = @pasteurizacion.cantidad_almacenada\n cantidadDesechada = @pasteurizacion.cantidad_desechada\n\n @pasteurizacion.cantidad = cantidadAlmacenada + cantidadDesechada\n\n @almacenado = Almacenado.new\n @almacenado.cantidad = cantidadAlmacenada\n @almacenado.save\n @desechado = Desechado.new\n @desechado.cantidad = cantidadDesechada \n @desechado.save \n\n respond_to do |format|\n if @pasteurizacion.save\n\n @etiqueta = Etiqueta.new\n\n etiquetaPasteurizacion = @pasteurizacion.etiqueta.etiqueta\n idPasteurizacion = @pasteurizacion.id\n idPasteurizacionString = idPasteurizacion.to_s\n\n @etiqueta.etiqueta = etiquetaPasteurizacion + idPasteurizacionString + \"-\"\n @etiqueta.formato_id = 3\n @etiqueta.save\n\n format.html { redirect_to etiqueta_mostrar_path(@etiqueta.id), notice: 'Pasteurización registrada exitosamente.' }\n end\n end\n end",
"title": ""
},
{
"docid": "a1b8ea993cdce276e26e77de3514cd84",
"score": "0.54588926",
"text": "def create\n @cooperativa = Cooperativa.new(params[:cooperativa])\n\n respond_to do |format|\n if @cooperativa.save\n format.html { redirect_to [:admin, @cooperativa], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @cooperativa, :status => :created, :location => @cooperativa }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @cooperativa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "072caa273d04fd4bdf7462a62f68398d",
"score": "0.54570806",
"text": "def create\n @ordem_servico = OrdemServico.new(ordem_servico_params)\n set_funcionario\n @ordem_servico.valor_total = @ordem_servico.get_valor_ordem_servico\n\n respond_to do |format|\n if @ordem_servico.save\n format.html { redirect_to @ordem_servico, notice: t('messages.cadastro_salvo')}\n format.json { render :show, status: :created, location: @ordem_servico }\n else\n @ordem_servico.servico_items.build unless @ordem_servico.servico_items.size > 0\n @ordem_servico.produto_items.build unless @ordem_servico.produto_items.size > 0\n format.html { render :new }\n format.json { render json: @ordem_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "760efa60b3e03e3f95e242086899b1a0",
"score": "0.545342",
"text": "def create\n @vacuna = Vacuna.new(vacuna_params)\n @vacuna.mascota_id = @mascota.id\n respond_to do |format|\n if @vacuna.save\n format.html { redirect_to @vacuna, notice: 'Vacuna Agregada exitosamente' }\n format.json { render :show, status: :created, location: @vacuna }\n else\n format.html { render :new }\n format.json { render json: @vacuna.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4ea8c7839503622ddff00543c94bd92",
"score": "0.5453096",
"text": "def create\n @detalle_documento_de_compra = DetalleDocumentoDeCompra.new(detalle_documento_de_compra_params)\n\n respond_to do |format|\n if @detalle_documento_de_compra.save\n format.html { redirect_to @detalle_documento_de_compra, notice: 'Detalle documento de compra was successfully created.' }\n format.json { render :show, status: :created, location: @detalle_documento_de_compra }\n else\n format.html { render :new }\n format.json { render json: @detalle_documento_de_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "201939fc674bf2035943a83f2d1f24bd",
"score": "0.5451096",
"text": "def create_ofertas\n\n\n\n arr_ofertas = []\n params.select { |par, val| par.starts_with?('oferta') && val.present? }.each do |puja|\n mid = puja.first.delete('oferta_')\n eliminar = params[\"delflag#{mid}\"] == '1'\n oferta = Oferta.new :mercado_id => mid, :seleccion_id => current_user.current_seleccion(session).id, :valor => puja.last.to_f, :estado => Oferta::PENDIENTE\n oferta.estado = Oferta::CANCELADA if eliminar\n\n oferta = oferta.save_if_valid\n arr_ofertas << I18n.t('mercado.oferta.oferta_creada', {:jugador => oferta.mercado.jugador.nombre, :valor => oferta.valor})\n end\n\n flash.now[:notice] = arr_ofertas.join '<br/>'\n\n # actualizamos los datos\n datos_ofertas\n\n respond_to do |format|\n format.js\n end\n\n end",
"title": ""
},
{
"docid": "5c099a828d1b89904c77f79cbd537130",
"score": "0.54493576",
"text": "def create\n @comentario = @comentavel.comentarios.create(comentario_params)\n @comentario.usuario = current_user\n respond_to do |format|\n if @comentario.save\n response_successfully(format, produto, 'Comentario was successfully created.', :show, :created)\n else\n response_unsuccessfully(format, :new, @comentario, :unprocessable_entity)\n end\n end\n end",
"title": ""
},
{
"docid": "3300483a255bab0bdbc85ed5aac41b2c",
"score": "0.54492867",
"text": "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "587cb9302b0743bed407f6284a8ed9ac",
"score": "0.54451674",
"text": "def create\n @seguimiento = Seguimiento.new(seguimiento_params)\n\n respond_to do |format|\n if @seguimiento.save\n format.html { redirect_to @seguimiento.caso, notice: \"Seguimiento creado.\" }\n format.json { render :show, status: :created, location: @seguimiento }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @seguimiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8edf7f2ce80637eb480357329d85443",
"score": "0.54361194",
"text": "def create\n @objetivo = Objetivo.new(objetivo_params)\n @objetivo.mision= @mision\n\n respond_to do |format|\n if @objetivo.save\n format.html { redirect_to [@mision, @objetivo], notice: 'Objetivo was successfully created.' }\n format.json { render :show, status: :created, location: [@mision, @objetivo] }\n else\n format.html { render :new }\n format.json { render json: [@mision, @objetivo].errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "55f23b34bb217e5227da066a60afe66a",
"score": "0.54271805",
"text": "def create\n @factura = Factura.find(params[:factura_id])\n @renglon_factura = @factura.renglon_facturas.build(params[:renglon_factura])\n #@factura.renglon_facturas << @renglon_factura\n\n respond_to do |format|\n if @renglon_factura.save\n format.html { redirect_to @factura, :notice => 'Renglon factura was successfully created.' }\n format.json { render json: @renglon_factura }\n else\n format.html { render :action => \"new\" }\n format.json { render json: @renglon_factura.errors }\n #@renglon_factura.delete()\n end\n end\n end",
"title": ""
},
{
"docid": "a67f4006c8bd0a8a4dc4de20e5efe304",
"score": "0.542631",
"text": "def create\n @apoio_educacioanl = ApoioEducacioanl.new(apoio_educacioanl_params)\n\n respond_to do |format|\n if @apoio_educacioanl.save\n format.html { redirect_to @apoio_educacioanl, notice: 'Apoio educacioanal foi cadastrado com Sucesso !' }\n format.json { render :show, status: :created, location: @apoio_educacioanl }\n else\n format.html { render :new }\n format.json { render json: @apoio_educacioanl.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25c20467bfa032f7eeb0ded219b9efb4",
"score": "0.5422231",
"text": "def destroy\n @tecnica_de_impresion.destroy\n respond_to do |format|\n format.html { redirect_to tecnicas_de_impresion_url, notice: 'Tecnica de impresion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "35710273cdbf1b3913bda86ad246fbe3",
"score": "0.5412002",
"text": "def comprar_producto\n response = ApiB2b.comprarProducto(params[:sku], params[:cantidad])\n render json: response\n end",
"title": ""
},
{
"docid": "a4ac94fd8b549700e32320f32946bdb4",
"score": "0.54065716",
"text": "def create\n cliente_id = params[:venda][:cliente_id]\n desconto = params[:venda][:desconto].to_f\n opcao_pgt = params[:opcaoPgt]\n @venda = Venda.new\n\n cont = 0\n erros = false\n if !params[:venda][:produto_id].nil?\n for produto in params[:venda][:produto_id]\n produto_existente = Produto.find(produto)\n preco_unitario = produto_existente.precoUnitario\n qtd = params[:venda][:quantidade][cont].to_i\n valor_venda = qtd * preco_unitario\n valor_venda *= (1 - (desconto/100))\n valor_venda = valor_venda.round(2)\n\n if opcao_pgt != \"Dinheiro\"\n num_cartao = params[:venda][:num_cartao]\n validade_cartao = params[:venda][:valid_cartao]\n codigo_cartao = params[:venda][:cvv_cartao]\n venda = Venda.new(cliente_id: cliente_id, produto_id: produto, quantidade: qtd, valorVenda: valor_venda, tipo_pgt: opcao_pgt,\n desconto: desconto, num_cartao: num_cartao, validade_cartao: validade_cartao, codigo_cartao: codigo_cartao)\n else\n venda = Venda.new(cliente_id: cliente_id, produto_id: produto, quantidade: qtd, valorVenda: valor_venda,\n tipo_pgt: opcao_pgt, desconto: desconto)\n end\n\n if !venda.save\n erros = true\n for msg in venda.errors.full_messages\n @venda.errors.add(:base, msg)\n end\n else\n produto_existente.qtd_estoque -= qtd\n produto_existente.save\n end\n cont+= 1\n end\n\n respond_to do |format|\n if erros\n format.html { render :new }\n else\n format.html { redirect_to lojas_url, notice: 'Venda realizada com sucesso!' }\n end\n end\n else\n respond_to do |format|\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "fd04a4562573aae3104797c15f7bad37",
"score": "0.540592",
"text": "def create\n @conta = Conta.new(conta_params)\n\n # @conta.correntista = Correntista.find(params[:id])\n respond_to do |format|\n if @conta.save\n format.html { redirect_to correntista_conta_index_path, notice: 'Conta was successfully created.' }\n format.json { render :show, status: :created, location: @conta }\n else\n format.html { render :new }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49e7d591032803885bf998018ffe6e43",
"score": "0.54051846",
"text": "def create\n @valores_de_pago = ValoresDePago.new(valores_de_pago_params)\n\n respond_to do |format|\n if @valores_de_pago.save\n format.html { redirect_to @valores_de_pago, notice: 'Valores de pago was successfully created.' }\n format.json { render :show, status: :created, location: @valores_de_pago }\n else\n format.html { render :new }\n format.json { render json: @valores_de_pago.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61f40dc7b83891e05cd94e785df96f66",
"score": "0.5403987",
"text": "def create\n @servico_pacote = Servico::Pacote.new(servico_pacote_params)\n\n respond_to do |format|\n if @servico_pacote.save\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully created.' }\n format.json { render action: 'show', status: :created, location: @servico_pacote }\n else\n format.html { render action: 'new' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "970494429dd5d85e4ba7a46af37c123b",
"score": "0.5399556",
"text": "def tecnicos_postulados\n coleccion = []\n self.request.each do |request|\n info = {}\n info[:id] = request.id\n info[:article] = request.article\n info[:servicio] = request.service.description\n info[:tecnicos] = request.proposal\n coleccion.append(info)\n end\n coleccion\n end",
"title": ""
},
{
"docid": "adf46ae6249affa0356aa5b23d3c8a1e",
"score": "0.53992033",
"text": "def create\n @anteproyecto_estudiante = AnteproyectoEstudiante.new(anteproyecto_estudiante_params)\n\n respond_to do |format|\n if @anteproyecto_estudiante.save\n format.html { redirect_to @anteproyecto_estudiante, notice: 'Anteproyecto estudiante was successfully created.' }\n format.json { render :show, status: :created, location: @anteproyecto_estudiante }\n else\n format.html { render :new }\n format.json { render json: @anteproyecto_estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "160215b9c53a702a36c36cd16a0c45f8",
"score": "0.5398395",
"text": "def asignaturas\n @seccion = \"Asignaturas\"\n @titulo = \"Asignaturas\"\n if params[:orden]\n case params[:orden]\n when \"Código\"\n @orden = \"codigo\"\n when \"Nombre\"\n @orden = \"nombre\"\n when \"Créditos\"\n @orden = \"unidades_credito\"\n when \"Tipo\"\n @orden = \"tipo\"\n else\n @orden = \"codigo\"\n end\n else\n @orden = \"codigo\"\n end\n \n @carreras = [\"Biología\", \"Computación\", \"Geoquímica\", \"Física\", \"Matemática\", \"Química\", \"Complementaria\"]\n @categorias = ['Código', 'Nombre', 'Créditos','Tipo'] #Este es el orden que se mostrará en el select de la vista\n @categoria_seleccionada = params[:orden]\n\n @asignatura_datos = [] #En este arreglo se guardan los pares \"Codigo - Nombre\" de cada asignatura para mostrar en el campo de busqueda\n Asignatura.order('nombre').all.each do |asignatura|\n #En este foro se agregan uno a uno los valores de cada asignatura al arreglo de la manera indicada arriba\n @asignatura_datos << asignatura.codigo.to_s + \" - \" + asignatura.nombre.to_s\n end\n end",
"title": ""
},
{
"docid": "0df32a9da0f1fba499e131eed7f18060",
"score": "0.5398387",
"text": "def create\n @historico_converca = HistoricoConverca.new(historico_converca_params) \n\n @historico_converca.user_id = current_user.id\n respond_to do |format|\n if @historico_converca.save\n @historico_converca = HistoricoConverca.new\n @historicos = Venda.where(cliente_id: params[:id], orcamento: true)\n format.js { render :create, notice: 'Venda atualiza!', location: @historicos }\n else\n format.html { render 'vendas/new' } \n end\n end\n end",
"title": ""
},
{
"docid": "e0eb40a39525d5681d972546a030e89a",
"score": "0.53964496",
"text": "def create\n @espacio_deportivo = EspacioDeportivo.new(params[:espacio_deportivo])\n\n respond_to do |format|\n if @espacio_deportivo.save\n format.html { redirect_to root_url, :notice => \"Se hizo correctamente la creacion del espacio deportivo\" }\n format.json { render json: @espacio_deportivo, status: :created, location: @espacio_deportivo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @espacio_deportivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "815af1fe8bb27bab5673bf45de0d9b08",
"score": "0.5396198",
"text": "def create\n @numero = params[:numero]\n @cvv = params[:cvv]\n @fecha_vencimiento = params[:fecha_vencimiento]\n @viaje_id=params[:viaje_id]\n\n @compra_exitosa = false\n\n if !(@numero.nil? || @cvv.nil? || @fecha_vencimiento.nil?)\n\n if @numero.length == 12\n\n if @cvv.length== 3\n\n if DateTime.parse(@fecha_vencimiento) > Date.today\n\n\n arr=params[:adicionales]\n viaje=Viaje.find_by_id(params[:viaje_id])\n\n #POR AHORA HAGO QUE SE RESERVE AUTOMATICAMENTE\n pasaje= Pasaje.new\n if(arr != nil)\n arr.each do |a|\n pasaje.adicionales=pasaje.adicionales.append(Adicional.find_by_id(a))\n end\n end\n pasaje.viaje_id=params[:viaje_id]\n pasaje.user_id=current_user.id\n if (viaje.asientos_restantes !=nil and viaje.asientos_restantes>0)\n viaje.asientos_restantes=viaje.asientos_restantes-1\n viaje.save\n elsif viaje.asientos_restantes<=0\n flash[:danger] = \"Viaje con asientos ocupados\"\n end\n\n pasaje.save\n @compra_exitosa=true\n\n\n else\n flash[:alert]=\"Debe ingresar una fecha posterior a hoy\"\n end\n else\n flash[:alert]=\"Debe ingresar un código de tarjeta válido de tres dígitos\"\n end\n else\n flash[:alert]=\"Debe ingresar una tarjeta válida de doce dígitos\"\n end\n else\n flash[:notice]=\"Debe ingresar una tarjeta válida\"\n end\n\n end",
"title": ""
},
{
"docid": "e128d7fe49fd3ed5a348008e2826fe1b",
"score": "0.5395797",
"text": "def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1070bd905463c84a46b723b6c2433268",
"score": "0.5393094",
"text": "def create\n @compra_detalle = CompraDetalle.new(params[:compra_detalle])\n\n respond_to do |format|\n if @compra_detalle.save\n format.html { redirect_to @compra_detalle, notice: 'Compra detalle was successfully created.' }\n format.json { render json: @compra_detalle, status: :created, location: @compra_detalle }\n else\n format.html { render action: \"new\" }\n format.json { render json: @compra_detalle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f92769a5513945eed6227b78c06fbf0",
"score": "0.5392295",
"text": "def create\n @motivo = Motivo.new(motivo_params)\n\n respond_to do |format|\n if @motivo.save\n format.html { redirect_to @motivo, notice: 'Motivo was successfully created.' }\n format.json { render :show, status: :created, location: @motivo }\n else\n format.html { render :new }\n format.json { render json: @motivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "753f4fb08e50cef93edf16828e096468",
"score": "0.53907233",
"text": "def create\n @sumario = Sumario.new(sumario_params)\n\n respond_to do |format|\n if @sumario.save\n format.html { redirect_to @sumario, notice: 'Sumario was successfully created.' }\n format.json { render :show, status: :created, location: @sumario }\n else\n format.html { render :new }\n format.json { render json: @sumario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd2f944855c9a864df23919f6f7481fd",
"score": "0.5386055",
"text": "def create\n @produto = Produto.new(params[:produto])\n @produto.empresa = session[:usuario].empresa\n \n params[:produto][:preco_compra] = converte_valor_banco params[:produto][:preco_compra]\n params[:produto][:preco_venda] = converte_valor_banco params[:produto][:preco_venda]\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render json: @produto, status: :created, location: @produto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
8676056fb4d525687007bc54cd69455d | validate if which one required other should be blank | [
{
"docid": "3c14a047156ae1fadcb49687c26cd4b1",
"score": "0.0",
"text": "def validate_respiratory_rate\n if data[\"respiratory_rate\"].nil? || !data[\"respiratory_rate\"].empty?\n respiratory_rate = data[\"respiratory_rate\"].to_i\n errors.add(:respiratory_rate, \"must be a whole number between 0 and #{MAX_RESPETORY_RATE}\") if !respiratory_rate.between?(0, MAX_RESPETORY_RATE) or !respiratory_rate.is_a? Integer\n else\n errors.add(:respiratory_rate, 'not present')\n end\n end",
"title": ""
}
] | [
{
"docid": "65f1d11c80ff0aecf436f05c74e2d4e2",
"score": "0.70993745",
"text": "def must_have_type_and_value\n return if blank?\n\n errors.add(:type, \"cannot be blank\") if @type.blank?\n errors.add(:value, \"cannot be blank\") if @value.blank?\n end",
"title": ""
},
{
"docid": "68d1ccc3ff7638c3d18fb54dac222bad",
"score": "0.6963324",
"text": "def validate_at_least_one_address_field\n if street_name.blank? && zip_code.blank? && city.blank? && state.blank? && country.blank?\n errors.add_on_blank(:street_name)\n end\n end",
"title": ""
},
{
"docid": "75cd1b56522cbb616d9486acd75bf10f",
"score": "0.69511074",
"text": "def validate\n skip if skip_on_empty? || skip_on_blank? || skip_on_nil?\n super\n end",
"title": ""
},
{
"docid": "d54e443a793d873a5c38fd7acfc679ea",
"score": "0.69328564",
"text": "def allowBlank; end",
"title": ""
},
{
"docid": "cbbb92fc61763e9c4ab57ac74fe4d83d",
"score": "0.6901312",
"text": "def validates_presence_of_one_of(*attrs)\n overrides = attrs.pop if attrs.last.is_a?(Hash)\n configuration = {\n :message => \"#{attrs.map {|attr| attr.to_s.humanize }.to_sentence(:connector => 'or')} must be specified\", \n :on => :save }\n configuration.update(overrides) if overrides\n \n validates_all(attrs, configuration) do |record, attributes, values|\n record.errors.add_to_base(configuration[:message]) if values.all?(&:blank?)\n end\n end",
"title": ""
},
{
"docid": "3472f9ea78c33af43a52ba0c83e1ef24",
"score": "0.68906695",
"text": "def validate\n skip if skip_on_blank? || skip_on_nil?\n super\n end",
"title": ""
},
{
"docid": "475fab59657e23a23220383b9e71d384",
"score": "0.68709326",
"text": "def any_present?\n if name.blank? and phone.blank? and license_plate.blank?\n errors.add :base, \"You must fill in at least one field\"\n end\n end",
"title": ""
},
{
"docid": "fa78fe96fbe6c97176ba2d9f65c3ed2a",
"score": "0.684799",
"text": "def must_be_punishment_or_reward\n \tif (punishment.nil? or punishment.to_s.strip == \"\") and\n \t\t(reward.nil? or reward.to_s.strip == \"\")\n \t\t\terrors.add(:base, \"Challenge must have punishment and/or reward\")\n \tend \n end",
"title": ""
},
{
"docid": "b909c22e0e0541f0ac48ee852150a2c9",
"score": "0.68377495",
"text": "def required msg = nil\n val = clean_data[name]\n is_empty = !val || (val.kind_of?(String) && val.strip.empty?) || (val.respond_to?(:empty?) && val.empty?)\n raise e(msg || \"#{english_name} is required.\" ) if is_empty\n\n self\n end",
"title": ""
},
{
"docid": "8cc7a36bd4e655032889209c7ed4157e",
"score": "0.6749811",
"text": "def exactly_one_of(*attrs)\n validates(attrs, exactly_one_of: { value: true, message: extract_message_option(attrs) })\n end",
"title": ""
},
{
"docid": "4d0351890d2ff604efaf15c7c08bafc4",
"score": "0.6745355",
"text": "def required_but_empty?\n required_and_relevant? && empty?\n end",
"title": ""
},
{
"docid": "ed599866453169dab3172b68ac761140",
"score": "0.6718438",
"text": "def at_least_one_of(*attrs)\n validates(attrs, at_least_one_of: { value: true, message: extract_message_option(attrs) })\n end",
"title": ""
},
{
"docid": "c776dbc7f2e6573613b579293d3715bc",
"score": "0.6716182",
"text": "def validate_required?(args)\n validate_required(args).empty?\n end",
"title": ""
},
{
"docid": "3ea58e17495ea3d937a6e5ad9217286f",
"score": "0.67143005",
"text": "def validate_mandatory\n errors.add('Source Field', 'can\\'t be blank') unless Fields::Accumulation.source_field_id(self[:value]) > 0\n end",
"title": ""
},
{
"docid": "6ffeb07a67212c3e2be972cb4722974f",
"score": "0.66599613",
"text": "def required msg = nil\n val = data[name]\n is_empty = !val || (val.kind_of?(String) && val.strip.empty?) || (val.respond_to?(:empty?) && val.empty?)\n raise invalid_new(msg || \"#{english_name} is required.\" ) if is_empty\n\n self\n end",
"title": ""
},
{
"docid": "c8b165e02b55311603a72415b17bb201",
"score": "0.6645581",
"text": "def ensure_not_used_by_others\n if orders.empty? and sales_orders.empty? and contacts.empty? and opportunities.empty? and prices.empty? then\n \t\treturn true\n \telse\n errors.add(:base, 'orders,sales_orders,contacts,opportunities or prices exist')\n \t\treturn false\n \tend\n end",
"title": ""
},
{
"docid": "f5164aacfaa3b3ef3e7dcf532d37487a",
"score": "0.6644389",
"text": "def validate\n errors.add_to_base \"You must specify a certifier if your farm is organic.\" if organic and organic_certifier.blank?\n # errors.add_to_base \"You must not specify a certifier if your farm is not organic.\" if organic.blank? and organic_certifier\n end",
"title": ""
},
{
"docid": "1359b9107650ad153ab3a7fe688f2653",
"score": "0.66422737",
"text": "def validate_mandatory\n\n end",
"title": ""
},
{
"docid": "7d5a54f3e5c0b1bb1ba87b6e2f7d86df",
"score": "0.66298145",
"text": "def validation\n if params[:id] ==\" || params[:firstname] == \" ||\n params[:lastname] ==\" || params[:address] == \" ||\n params[:birthday] ==\" || params[:scuid] == \" \n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "1d63799887b874843326c7d767ed0472",
"score": "0.66108876",
"text": "def price_and_percent_are_mutually_exclusive\n if price_cents.present? && percent.present?\n add_mutually_exclusive_error\n elsif price_cents.nil? && percent.nil?\n errors.add(:percent, 'must be present if \"price\" is blank')\n end\n end",
"title": ""
},
{
"docid": "fd1daac203d54fd532c906190ffdd63e",
"score": "0.660394",
"text": "def validate_presence(args)\n args.each do |attr|\n value = send(attr).to_s\n next unless value.empty?\n\n initialize_key_error(attr)\n @errors.details[attr] += [{ error: :blank }]\n end\n end",
"title": ""
},
{
"docid": "7bdbdaf30749c57a0b2be5e02e64ed4a",
"score": "0.6601649",
"text": "def validate_person_name\n errors.add(:first_name, \"and last name cannot both be blank\") if first_name.blank? && last_name.blank?\n end",
"title": ""
},
{
"docid": "ab9b87f06f47741056e465e33e789305",
"score": "0.65709394",
"text": "def validate_requireds!\n missing = []\n params_with(:required).each do |param, is_required|\n missing << param if self[param].nil? && is_required\n end\n return if missing.empty?\n raise \"Missing values for: #{missing.map{|pn| d = definition_of(pn, :description) ; (d ? \"#{pn} (#{d})\" : pn.to_s) }.sort.join(\", \")}\"\n end",
"title": ""
},
{
"docid": "319fff3935e0242e9167ae2f6fc1bf77",
"score": "0.6554026",
"text": "def presence_of_mandatory_fields\n if promo_amount.blank? and info.blank?\n errors[:base] << 'Au moins un des champs doivent être remplis'\n end\n end",
"title": ""
},
{
"docid": "7303724539ef4f51d16b82ef6f5539f1",
"score": "0.6547571",
"text": "def not_empty?\n if !self.title.blank? or !self.description.blank? or !self.budget.blank?\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "8ed2a8b585dd25f109ffeb843956e1a9",
"score": "0.65438336",
"text": "def validate\n errors.add(:expression_start, \"must be provided if a finish time exists\") if expression_start.blank? and !expression_finish.blank?\n \n if !expression_start.blank? and !expression_finish.blank?\n #both are non blank if we get this far \n if expression_finish < expression_start\n errors.add(:expression_finish, \"must be after start date\") \n end\n end\n end",
"title": ""
},
{
"docid": "7907abedf1f6d14b6167ffe7907af01c",
"score": "0.65405875",
"text": "def check_required_parameters()\n params_good = true\n @required_parameters.each do |req_par|\n passed_reqpar = get_arg_value(req_par)\n if passed_reqpar.nil? || passed_reqpar == \"\"\n params_good = false\n end\n end\n\n has_atleast_one = true\n if @requires_atleast_one.size > 0\n has_atleast_one = false\n @requires_atleast_one.each do |least_one|\n luno = get_arg_value(least_one)\n if ! luno.nil? && luno != \"\"\n has_atleast_one = true\n end\n end\n end\n\n if !params_good || ! has_atleast_one\n puts \"Missing parameters: #{@required} #{params_good} && #{has_atleast_one}\"\n exit(1)\n end\n\n end",
"title": ""
},
{
"docid": "94ed6bde3341b27d3956911b4c9ff7f4",
"score": "0.65360945",
"text": "def validate_person_name\n if first_name.blank? && last_name.blank?\n errors.add(:first_name, \"and last name cannot both be blank\")\n end\n end",
"title": ""
},
{
"docid": "ccfc8a5cd42bb91b4de2a6ed7c4f1ac5",
"score": "0.65339583",
"text": "def valida_parrafo\n errors.add_to_base 'avisoparrafo' if textoes.blank? and textofr.blank? \nend",
"title": ""
},
{
"docid": "b583cdb301efe1a7852782fea1c810b1",
"score": "0.6502419",
"text": "def validate\r\n if self.description.nil? || self.description.blank?\r\n \"Please enter the description\"\r\n elsif self.image_url.nil? || self.image_url.blank?\r\n \"Please enter the image_url\"\r\n elsif self.name.nil? || self.name.blank?\r\n \"Please enter the name\"\r\n elsif self.manufacturer.nil? || self.manufacturer.blank?\r\n \"Please enter the manufacturer\"\r\n elsif self.price.nil? || self.price.blank? || self.price.to_f <= 0\r\n \"Please enter the correct price\"\r\n else\r\n nil\r\n end\r\n end",
"title": ""
},
{
"docid": "efe48c0fe6c90efa2c00d54f1a75f4a2",
"score": "0.6467736",
"text": "def has_to_be_rejected?\n self.amount.blank? and self.promo_amount.blank?\n end",
"title": ""
},
{
"docid": "efe48c0fe6c90efa2c00d54f1a75f4a2",
"score": "0.6467736",
"text": "def has_to_be_rejected?\n self.amount.blank? and self.promo_amount.blank?\n end",
"title": ""
},
{
"docid": "82c2a6a08863154ba992eac9cd65bc3e",
"score": "0.644957",
"text": "def blank?\n name.blank? && email.blank? && home_phone.blank?\n end",
"title": ""
},
{
"docid": "7dbc99f6e23aa51188b6383d3393a2d3",
"score": "0.64486235",
"text": "def is_valid\n valid_name = !(@name.nil? || @name.empty?)\n valid_value = !(@value.nil? || @value.empty?)\n\n valid_name && valid_value\n end",
"title": ""
},
{
"docid": "9312c6f14acf1ad511b6f2fc2fb827b1",
"score": "0.6444136",
"text": "def amount_has_to_be_filled_if_promo_amount\n if promo_amount.present? and amount.blank?\n self.errors.add :amount, :blank\n end\n end",
"title": ""
},
{
"docid": "9312c6f14acf1ad511b6f2fc2fb827b1",
"score": "0.6444136",
"text": "def amount_has_to_be_filled_if_promo_amount\n if promo_amount.present? and amount.blank?\n self.errors.add :amount, :blank\n end\n end",
"title": ""
},
{
"docid": "d573b28f1fce667ebb7fd5bedadfedcd",
"score": "0.6440233",
"text": "def first_or_last \n if first_name.nil? && last_name.nil? \n errors.add(:first_name, \"Specify a first or a last.\") \n end \nend",
"title": ""
},
{
"docid": "23848af130cb4dc412fcda8b244f33ba",
"score": "0.64386725",
"text": "def validate_must_have_one_and_only_one_of_attributes!\n self.class::MUST_HAVE_ONE_AND_ONLY_ONE_OF_ATTRIBUTES.each do |attrib_set|\n unless attrib_set.is_a? Array\n raise AttributeDefinitionError, \"Elements of #{self.class}::MUST_HAVE_ONE_AND_ONLY_ONE_OF_ATTRIBUTES must be of type Array.\"\n end\n\n count_of_mandatory_set = 0\n attrib_set.each do |attrib|\n if self.has_key?(attrib)\n count_of_mandatory_set += 1\n end\n end\n\n if count_of_mandatory_set == 0\n raise ValidationError, \"A member of the mandatory attribute set `#{attrib_set}` is missing from the supplied input_hash paramater to #{self.class}.\"\n elsif count_of_mandatory_set > 1\n raise ValidationError, \"More than one member of the exclusive and mandatory attribute set `#{attrib_set}` was provided to #{self.class}.\"\n end\n end\n end",
"title": ""
},
{
"docid": "4ed284c9b24a76f973effbc48dcd51ea",
"score": "0.6432788",
"text": "def validate_requireds!\n missing = []\n required_params.each do |param|\n missing << param if self[param].nil?\n end\n raise \"Missing values for #{missing.map{|s| s.to_s }.sort.join(\", \")}\" if (! missing.empty?)\n end",
"title": ""
},
{
"docid": "3087c3ba8955c6d0016913504dc9a946",
"score": "0.64278775",
"text": "def validate_presence(atr)\n raise 'Empty Attribute' if atr.nil?\n end",
"title": ""
},
{
"docid": "3639974bccc7f8b3287221664863ae8a",
"score": "0.64226127",
"text": "def web_text_required_if_not_from_aleph; errors.add(:web_text, \"can't be blank\") if (!from_aleph and web_text.blank?); end",
"title": ""
},
{
"docid": "3639974bccc7f8b3287221664863ae8a",
"score": "0.64226127",
"text": "def web_text_required_if_not_from_aleph; errors.add(:web_text, \"can't be blank\") if (!from_aleph and web_text.blank?); end",
"title": ""
},
{
"docid": "03fc51c745d98c4d73f9f5df1e0626e1",
"score": "0.6416178",
"text": "def validate_common_params\n validate(\n stand_alone: [:optional, :_validate_boolean]\n )\n end",
"title": ""
},
{
"docid": "398ab19c627a89630d7c281a76311399",
"score": "0.6413525",
"text": "def ensure_at_least_one_name_present\n if self.first_name.nil? and self.middle_name.nil? and self.last_name.nil?\n errors.add(:base, 'Persona is missing a name')\n return false\n end\n end",
"title": ""
},
{
"docid": "824aa52651dd0a1236dfc12c6c1511db",
"score": "0.6398027",
"text": "def validate_inputs()\n\t\tif first_name.blank?\n\t\t\terrors.add(:first_name, \"cannot be blank.\")\n\t\tend\n\t\tif last_name.blank?\n\t\t\terrors.add(:last_name, \"cannot be blank.\")\n\t\tend\n\t\tif email.blank?\n\t\t\terrors.add(:email, \"cannot be blank.\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "25801f56b254623dde9be5cb1288eec5",
"score": "0.6395607",
"text": "def validate_name\n if first_name.blank? or last_name.blank?\n errors.add('name', \"Please enter First and Last Name\")\n end\n end",
"title": ""
},
{
"docid": "1f8240b88daecf123f2d322977840d75",
"score": "0.63916487",
"text": "def validate_presence_of(obj)\n return if obj.respond_to?(:empty?) ? !obj.empty? : !obj.nil?\n raise EmptyArgument, \"#{obj} must not be blank\"\n end",
"title": ""
},
{
"docid": "bef0d783eb2456fd7c2609131d4755f4",
"score": "0.6387646",
"text": "def has_company_or_firstname_lastname\n has_name = !!self.firstname && !!self.lastname\n has_company = !!self.company\n\n result = has_name || has_company\n if result != true\n errors.add(:name_or_company_validation, \"Must have Company or Firstname & Lastname\")\n end\n end",
"title": ""
},
{
"docid": "a4026fd6fd09da27c33e252e24422902",
"score": "0.63684773",
"text": "def validate(data, attr_required)\n result = true\n # Merge input fields into array\n\t\tarr_att = Hash.new\n\t\tdata['generalData'].each do |key, value|\n \t\tarr_att[key] = value \n\t\tend\n\n\t\tdata['operationData'].each do |key, value|\n \t\tarr_att[key] = value \n\t\tend\n\t\t \n\t\t# Now I notice if required fields are all positions\n\t\tattr_required.each do |key|\n\t\t\tif ( arr_att[key].nil? )\n\t\t\t\t@attr_error[key] = 'Este campo es requerido '\n\t\t\t\tresult = false\n\t\t\tend\n\t\tend\t\n\n\t\treturn result \n\tend",
"title": ""
},
{
"docid": "d1feabc5aef25b09fd74bc3df84080f1",
"score": "0.6365189",
"text": "def validate\n is_valid = true\n preceded_by = self.preceded_by\n if preceded_by == nil || preceded_by == \"\"\n errors.add_to_base(\"preceded_by can not be blank\")\n end\n\n\n if preceded_by != nil\n valid_preceded_values\n validate_preceded_first_value\n validate_status_code\n end\n\nend",
"title": ""
},
{
"docid": "c51fd007ef5b4513cd35ba70673644f0",
"score": "0.6362964",
"text": "def validate_presence(record, requirement)\n return true unless requirement\n\n if requirement.is_a?(Hash)\n if requirement['allow_blank'] && !record.value.nil? ||\n requirement['allow_nil'] && record.value.nil? ||\n record.value.present?\n true\n else\n add_error record, :blank\n false\n end\n else\n add_error_if record.value.nil? || record.value == '', record, :blank\n end\n end",
"title": ""
},
{
"docid": "9bdb87e4d380433c682d55db35db0efa",
"score": "0.6355408",
"text": "def validate\n # optional\n end",
"title": ""
},
{
"docid": "fcc620ab4832aabc09691ec65a92c136",
"score": "0.63540465",
"text": "def check_required_with\n check :required_with, type: ::Array, default: [], item_type: ::String\n\n return if @required_with.empty?\n end",
"title": ""
},
{
"docid": "16e672f1c1dcd5e1d148ca4229505886",
"score": "0.63522726",
"text": "def validate_fields\n self.class.required_fields.each do |field|\n value = public_send(field)\n if value.nil? || value.respond_to?(:empty?) && value.empty?\n raise Outbox::MissingRequiredFieldError, \"Missing required field: #{field}\"\n end\n end\n end",
"title": ""
},
{
"docid": "cad68264fd29d678dfa2819174bbcc52",
"score": "0.6352095",
"text": "def check_vol_or_unit\n if volume.blank? and unit_count.blank?\n #one at least must be filled in\n errors.add(:base, ': You must enter ingredient volume or unit count') if volume.blank? and unit_count.blank?\n return false\n \n else\n return true\n end\n end",
"title": ""
},
{
"docid": "8ef20c1967282399f2009deec7ba9716",
"score": "0.635133",
"text": "def ignore_validation_for_empty_second_signatory?(record)\n record.name.blank? &&\n record.email_address.blank? &&\n record.phone_number.blank? &&\n record == organisation.legal_signatories.second\n end",
"title": ""
},
{
"docid": "24d8fad23494e1b9796868a39f77276f",
"score": "0.6350931",
"text": "def validate_racer_name\n if first_name.blank? && last_name.blank?\n errors.add(:first_name, \"and last name cannot both be blank\")\n end\n end",
"title": ""
},
{
"docid": "dc3790e57cb233f7cba331c232b9b52b",
"score": "0.63481873",
"text": "def valid?\n !self.name.nil? && !(self.number.nil? && self.box_number.nil?)\n end",
"title": ""
},
{
"docid": "cd5f9cb1beeb515c3a690d75ddffacc8",
"score": "0.6341708",
"text": "def web_text_required_if_not_from_aleph\n errors.add(:web_text, \"can't be blank\") if (!from_aleph and web_text.blank?)\n end",
"title": ""
},
{
"docid": "de584df14b2f559fd99fcd5ab5153a77",
"score": "0.6341678",
"text": "def unit_or_role_must_be_defined\n if unit_id.blank? && role_id.blank?\n errors.add_to_base \"Either the unit or the role must be defined; you can't leave both blank.\"\n end\n end",
"title": ""
},
{
"docid": "5de760d29a6cc532c3e9d3909bb7141b",
"score": "0.6334541",
"text": "def has_not_occurred\n errors.add(\"address_line_1\", \": no P.O. Box addresses please\") if pobox?\n errors.add(\"Please pick a proper Business category\") if businessCategory?\n errors.add(\"state\",\"is not a valid state\") if validState?\n \n end",
"title": ""
},
{
"docid": "283364927d8243413cf2b2895c793065",
"score": "0.6329566",
"text": "def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\n end",
"title": ""
},
{
"docid": "8d96c7e4573bada0437245896bccbc27",
"score": "0.6327604",
"text": "def validate\n \n if person == nil and organisation== nil\n errors.add \"At least one of person and organisation must be associated with a role\"\n end\n #errors.add_to_base 'Must have at least one contactinfo' if role_contactinfos.blank?\n end",
"title": ""
},
{
"docid": "dfc1c45c91fbba6f8ead648d3a33315a",
"score": "0.6320854",
"text": "def validate\n validate_value(self.value)\n validate_mandatory\n validate_unique\n\n errors.empty?\n end",
"title": ""
},
{
"docid": "2ef71d89d45f52618704ce3437b0ed29",
"score": "0.6320733",
"text": "def validate_at_least_one_phone_number\n if work_phone_number.blank? && home_phone_number.blank?\n errors.add(:phone_numbers, \"must provide at least one phone number\")\n end\n end",
"title": ""
},
{
"docid": "9076252c7246dbbac70b7ce131fa7d6c",
"score": "0.6315907",
"text": "def validate_required data, fieldname\n return !data[fieldname].nil?\n end",
"title": ""
},
{
"docid": "fd5f84c066a39d4e479fcd0cc3e4b15a",
"score": "0.6315804",
"text": "def check_has_field\n valid = false\n TW_REQUIRED_FIELDS.each do |i|\n if !self[i].blank?\n valid = true\n break\n end\n end\n errors.add(:base, 'no core data provided') if !valid\n end",
"title": ""
},
{
"docid": "90bb2034c182f3f2e4171dc4aeaba8df",
"score": "0.63125443",
"text": "def validate_must_have_one_of_attributes!\n self.class::MUST_HAVE_ONE_OF_ATTRIBUTES.each do |attrib_set|\n unless attrib_set.is_a? Array\n raise AttributeDefinitionError, \"Elements of #{self.class}::MUST_HAVE_ONE_OF_ATTRIBUTES must be of type Array.\"\n end\n\n has_one_of_mandatory_set = false\n attrib_set.each do |attrib|\n if self.has_key?(attrib) && !self[attrib].nil?\n has_one_of_mandatory_set = true\n break\n end\n end\n\n unless has_one_of_mandatory_set\n raise ValidationError, \"A member of the mandatory attribute set `#{attrib_set}` is missing from the supplied input_hash paramater to #{self.class}.\"\n end\n end\n end",
"title": ""
},
{
"docid": "3bab6890be4793dfa723fc773f44a9c9",
"score": "0.6310328",
"text": "def validate_has_one_rank\n errors.add(:base, \"must have either a Ki rank or an Aikido rank\") unless self.ki_rank || self.aikido_rank\n errors.add(:base, \"must have only a Ki rank or an Aikido rank, not both\") if self.ki_rank && self.aikido_rank\n end",
"title": ""
},
{
"docid": "cba637b16b46516962f39d138881c416",
"score": "0.63003266",
"text": "def valid?\n\t\t\t!(@name == nil || @name.empty? || @value == nil || @value.empty?)\n\t\tend",
"title": ""
},
{
"docid": "2b2bbc8a496117ff6b794233a54d2477",
"score": "0.6287329",
"text": "def it_should_validate_required_for(*required)\n required.each do |field|\n it \"should not be valid without #{field}\" do\n elem = model_class.new(valid_attributes)\n elem.send(\"#{field}=\", nil)\n elem.should_not be_valid\n end\n end\n it \"should be valid with all fields\" do\n elem = model_class.new(valid_attributes)\n elem.should be_valid\n end\n end",
"title": ""
},
{
"docid": "a763118ca2ee43fe170df2208d99d59c",
"score": "0.6274956",
"text": "def valid_email?\n not email_1.blank? or not email_2.blank? or not email_3.blank?\n end",
"title": ""
},
{
"docid": "7eb9974c058a45a706b5308e5ffa1daa",
"score": "0.6272723",
"text": "def check_names\n if formal_name.blank? and informal_name.blank?\n errors.add( :base, I18n.t( 'people.msg.one_name_at_least' ))\n end\n end",
"title": ""
},
{
"docid": "d8d66e37df0ef8394b65c3a87f11f9a5",
"score": "0.6268872",
"text": "def validate\n super\n validates_presence :question_type, :message => 'Question must be in specific question type'\n validates_presence :survey, :message => 'Question must belong to 1 survey'\n end",
"title": ""
},
{
"docid": "e6e8f9931acb0e1644b7fb39dce74b02",
"score": "0.6259326",
"text": "def only_allow_debit_or_credit\n self.debit = nil if !debit.blank? && !credit.blank?\n true\n end",
"title": ""
},
{
"docid": "928a8094e4125645d3386d7fbf2790f0",
"score": "0.62556773",
"text": "def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\nend",
"title": ""
},
{
"docid": "7a0a78da21ff25149c54a12929c1cbf0",
"score": "0.6255161",
"text": "def valid?\n required_params.all? do |param|\n !param.nil? && (param != '') && (param != 0)\n end\n end",
"title": ""
},
{
"docid": "1e505de20a47ec59c79439acabdcd415",
"score": "0.62545866",
"text": "def validate\n \tsuper\n \t\terrors.add(:name, 'cannot be empty') if !name || name.empty?\n \t\terrors.add(:type, 'cannot be empty') if !type || type.empty?\n \t\tvalidates_unique :name\n \tend",
"title": ""
},
{
"docid": "2d42f4b7c1da064e5803923b11d554b0",
"score": "0.62505966",
"text": "def ensure_required!\n errors = []\n all_required_params.each do |required|\n errors << \"#{required} is a required parameter\" unless options.key?(required)\n errors << \"#{required} must have a value\" if options[required].blank?\n end\n raise ArgumentError.new(errors.to_sentence) unless errors.blank?\n end",
"title": ""
},
{
"docid": "4db8cb07e54861b8288d2d90edecb780",
"score": "0.6249701",
"text": "def valid?\n !option.nil? && !term.nil? && !value.nil?\n end",
"title": ""
},
{
"docid": "9b1ec15b48c9788676d6c79fc5f5717f",
"score": "0.6243224",
"text": "def fields_to_validate\n required_fields = to_hash opts[:required]\n optional_fields = to_hash opts[:optional]\n required_fields.keys.each { |key| required_fields[key][:required] = true }\n optional_fields.merge(required_fields)\n end",
"title": ""
},
{
"docid": "701be96f0f9a56f0f8783154a12a16da",
"score": "0.6241465",
"text": "def valida_comentario\n \t\terrors.add_to_base 'avisocomentario' if textoes.blank? and textofr.blank? || tituloes.blank? and titulofr.blank?\n\tend",
"title": ""
},
{
"docid": "adb5c1dd87c29789d38859da8d399a2d",
"score": "0.62408346",
"text": "def has_required_fields?\n not [@source, @method, @compare].include? nil\n end",
"title": ""
},
{
"docid": "a9991d159b13abde05761d2ead33e5bd",
"score": "0.6237",
"text": "def validate\n return false if @id.nil? or @id < 0\n return false if @name.nil? or @name.strip.length <= 0\n return false if @description.nil? or @description.strip.length <= 0\n return false if @capacity.nil? or @capacity <= 0\n return true\n end",
"title": ""
},
{
"docid": "b44be97bbe7f9bb4a96653e15085c7f1",
"score": "0.6236351",
"text": "def first_name_required?\n last_name.blank?\n end",
"title": ""
},
{
"docid": "b44be97bbe7f9bb4a96653e15085c7f1",
"score": "0.6236351",
"text": "def first_name_required?\n last_name.blank?\n end",
"title": ""
},
{
"docid": "6e1b9874e9fdb7d068ccf8f14e715d4f",
"score": "0.6233814",
"text": "def has_to_be_rejected?\n self.promo_amount.blank? and self.info.blank?\n end",
"title": ""
},
{
"docid": "65ab5e3d1bb8b8073c425cd061d98f42",
"score": "0.6231963",
"text": "def check_required_fields(fields)\n missing_fields = []\n fields.each do |required_field|\n missing_fields.push(required_field) if\n params[required_field].nil? || params[required_field].empty?\n end\n missing_required_field_death(missing_fields) unless missing_fields.empty?\n missing_fields.empty?\n end",
"title": ""
},
{
"docid": "5086102374efc41e415200e72c18f4c6",
"score": "0.6227185",
"text": "def filled_in?\n\t\t!self.first_name.blank? && !self.last_name.blank?\n\tend",
"title": ""
},
{
"docid": "83bc9db9b9838681d164a443d662911a",
"score": "0.6227107",
"text": "def valid?\n !uom_code.nil? && !inventory.nil? && !upc.nil?\n end",
"title": ""
},
{
"docid": "de3906d3e2f90427f97f5ed8ad540afc",
"score": "0.6225288",
"text": "def required?; false end",
"title": ""
},
{
"docid": "8161139ad545e6c7e121b03de315784c",
"score": "0.62235475",
"text": "def must_belong_to_either_cart_or_order\n if cart.present? && order.present?\n errors.add(:cart, \"and order both cannot own item at the same time\")\n elsif !(cart.present? || order.present?)\n errors.add(:cart, \"or order must be not nil\")\n end\n end",
"title": ""
},
{
"docid": "011dfb373d7f5b8ccecb2f098c8ad13e",
"score": "0.62231755",
"text": "def has_required?\n false\n end",
"title": ""
},
{
"docid": "f3f7f090675a0072e9fd7424fa1cc9ec",
"score": "0.622087",
"text": "def required(params, *lst)\n blanks = lst - lst.reject {|x| params[x] == \"\" or params[x].nil? }\n if blanks.empty?\n parameters = lst.map {|x| params[x] }\n parameters.count == 1 ? parameters.first : parameters\n else\n raise \"Fields cannot be empty #{blanks}\"\n end\n end",
"title": ""
},
{
"docid": "97ab5676aeb7f3b1d4576ba3aabe80d9",
"score": "0.6215511",
"text": "def the_event_must_have_at_least_one_description\n if des_es.empty? && des_eu.empty? && des_en.empty? && des_fr.empty?\n errors.add(:des_es, \"Please fill in the desciption at least in one language\")\n end\n if title_es.empty? && title_eu.empty? && title_en.empty? && title_fr.empty?\n errors.add(:des_es, \"Please fill in the title at least in one language\")\n end\n end",
"title": ""
},
{
"docid": "22d583e5f82ef458a201729c1b948700",
"score": "0.62105423",
"text": "def verify_required_fields\n errors = []\n REQUIRED_FIELDS.each do |reqfield|\n if to_hash[reqfield].nil?\n errors << \"Required field #{reqfield} not found\"\n elsif to_hash[reqfield].to_s.empty?\n errors << \"Required field #{reqfield} is empty\"\n end\n end\n errors\n end",
"title": ""
},
{
"docid": "416ea18aaad585815a87a22d36cc71f2",
"score": "0.620127",
"text": "def validate\n required_attributes = [\n :name,\n :md5,\n :description,\n :type\n ]\n\n required_attributes.map do |ra|\n self.send(ra)\n end.include? nil\n\n end",
"title": ""
},
{
"docid": "ae58238fa8a4dc9fe8fd7b6657755102",
"score": "0.6190697",
"text": "def nothing_assigned?\n # we just check the absolute mandatory attributes to decide a blank or filled record\n # some of these attributes have conditional validations\n # at least one of them should have some value to call this record filled\n # so, if all these attributes are blank, we consider nothing is assigned\n _options = [:first_name, :last_name, :address, :city, :state, :zipcode, :time_zone, :home_phone,\n :cell_phone, :carrier_id, :emergency_number_id, :account_number,\n :hospital_number, :doctor_phone].collect {|e| self.send(e).blank? }.compact.uniq\n (_options.length == 1) && !_options.include?( false)\n end",
"title": ""
},
{
"docid": "ff7bf2ef6bb4a7e8bb0a486b0ec3a73b",
"score": "0.61891097",
"text": "def basic_validation\n validate = []\n validate << \"Command\" if new_resource.command.nil? || new_resource.command.empty?\n validate << \"Task Name\" if new_resource.task_name.nil? || new_resource.task_name.empty?\n return true if validate.empty?\n\n raise Chef::Exceptions::ValidationFailed.new \"Value for '#{validate.join(\", \")}' option cannot be empty\"\n end",
"title": ""
},
{
"docid": "ff7bf2ef6bb4a7e8bb0a486b0ec3a73b",
"score": "0.61891097",
"text": "def basic_validation\n validate = []\n validate << \"Command\" if new_resource.command.nil? || new_resource.command.empty?\n validate << \"Task Name\" if new_resource.task_name.nil? || new_resource.task_name.empty?\n return true if validate.empty?\n\n raise Chef::Exceptions::ValidationFailed.new \"Value for '#{validate.join(\", \")}' option cannot be empty\"\n end",
"title": ""
},
{
"docid": "dc54112e3a2526b9fa7042bc75ad0702",
"score": "0.6185004",
"text": "def validate_mandatory_fields\n\t\tmandatory_fields.each do |field|\t\t\t\n\t\t\terrors.add(field, \"can't be blank.\") if self[field] == \"\"\n\t\t\terrors.add(field, \"should be less than 25 characters.\") if self[field].length > 25\t\t\t\n\t\tend\n\tend",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "201b7293a5a876c47ee411b902d248c6",
"score": "0.0",
"text": "def tichet_params\n params.require(:tichet).permit(:name, :seat_id, :address, :price_paid)\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": ""
}
] |
7310476bbb2899063b47747445b312c8 | return the string "Arithmetic" if the sequence follows an arithmetic pattern or return "Geometric" if it follows a geometric pattern. If the sequence doesn't follow either pattern return 1. An arithmetic sequence is one where the difference between each of the numbers is consistent, where as in a geometric sequence, each term after the first is multiplied by some constant or common ratio. Arithmetic example: [2, 4, 6, 8] and Geometric example: [2, 6, 18, 54]. Negative numbers may be entered as parameters, 0 will not be entered, and no array will contain all the same elements. | [
{
"docid": "ed26f636e88e89d34a3e9b9eaf32da43",
"score": "0.6365783",
"text": "def ArithGeo(arr)\n difference = arr[1] - arr[0]\n ratio = arr[1] / arr[0]\n arith = true\n geo = true\n i = 2\n while i < arr.length\n if arr[i-1] + difference != arr[i]\n arith = false\n end\n if arr[i-1] * ratio != arr[i]\n geo = false\n end\n i += 1\n end\n\n if arith\n return \"Arithmetic\"\n elsif geo\n return \"Geometric\"\n else\n return \"-1\"\n end \nend",
"title": ""
}
] | [
{
"docid": "ab92f519c43624e351f40e68c87cae87",
"score": "0.7226374",
"text": "def ArithGeo(arr)\n return \"Arithmetic\" if (1..arr.length - 1).map {|i| arr[i] - arr[i - 1]}.uniq.size == 1\n return \"Geometric\" if (1..arr.length - 1).map {|i| arr[i] / arr[i - 1]}.uniq.size == 1\n -1\nend",
"title": ""
},
{
"docid": "2f63708be65a0e36087ae2ea843d997c",
"score": "0.7025289",
"text": "def arithGeo(arr)\n\tbaseNumArith = arr[1] - arr[0]\n\tbaseNumGeo = arr[1] / arr[0]\n\tif(arr.last - arr[arr.size - 2] == baseNumArith)\n\t\treturn \"Arithmetic\"\n\telsif(arr.last / arr[arr.size - 2] == baseNumGeo && baseNumGeo != arr[1])\n\t\t#for this problem - arr.last / arr[arr.size - 2] == baseNumGeo this algorithm works for almos all the tests\n\t\t#but if the array starts with 1 increments and ends with a geomtric sequence it will pass as truth. when in fact it is not: \n\t\t# EG. 1 - 2 - 3.....10 - 20 while the last two numbers make the stament truth: array[n - 1] / array[n - 2] = baseNum\n\t\t#the sequence at the beginning is not geometric. \n\t\treturn \"Geometric\"\n\telse\n\t\treturn -1\n\tend\nend",
"title": ""
},
{
"docid": "c273fbcf6a53d913e8e367dd09593904",
"score": "0.6519869",
"text": "def arith_geo_ii(arr)\n differences = []\n ratios = []\n arr.each_with_index do |num, idx|\n next if idx == arr.size - 1\n differences << arr[idx + 1] - num\n ratios << arr[idx + 1] / num\n end\n if differences.uniq.size == 1 then 'Arithmetic'\n elsif ratios.uniq.size == 1 then 'Geometric'\n else -1\n end\nend",
"title": ""
},
{
"docid": "c434f14b2cc6250c78b63a68bea7137c",
"score": "0.6457595",
"text": "def ArithGeo(arr)\n\n isGeo, isArith = true, true\n arith_diff, geo_diff=arr[1]-arr[0], arr[1].div(arr[0])\n \n arr.each_with_index{|x,index|\n break if index==arr.length-1\n isArith=false if arr[index] + arith_diff!=arr[index+1]\n isGeo=false if arr[index] * geo_diff!=arr[index+1]\n }\n \n \n return \"Arithmetic\" if isArith\n return \"Geometric\" if isGeo\n return -1\n \nend",
"title": ""
},
{
"docid": "c92a5fc125c1e45152a0966bfa5258b3",
"score": "0.64518875",
"text": "def arith_geo(arr)\n\n arith, geo = [], []\n diff = arr[1] - arr[0]\n ratio = arr[1] / arr[0]\n i = arr[0]; arr.size.times { arith.push(i); i = i + diff }\n j = arr[0]; arr.size.times { geo.push(j); j = j * ratio }\n\n if arr == arith\n 'Arithmetic'\n elsif arr == geo\n 'Geometric'\n else\n -1\n end\nend",
"title": ""
},
{
"docid": "ebbe03debc811acd7dade12259c95a53",
"score": "0.6391148",
"text": "def ArithGeo(arr)\n return \"Arithmetic\" if is_arith?(arr)\n return \"Geometric\" if is_geom?(arr)\n -1\nend",
"title": ""
},
{
"docid": "b447e4542d2335bfaf413f8ecca44961",
"score": "0.63822347",
"text": "def ArithGeo(arr)\n i = 0\n while i < arr.length\n first = arr[i].abs\n second = arr[i+1].abs\n third = arr[i+2].abs\n if second - first == third - second\n return \"Arithmetic\"\n elsif \n second / first == third / second\n return \"Geometric\"\n else\n return -1\n end\n i += 1\n end\nend",
"title": ""
},
{
"docid": "f7758ffa0c746391bfe61880c5bf05c9",
"score": "0.63728094",
"text": "def arith_geo(arr)\r\n if arr.each_with_index.all? {|x, i| !arr[i+2].nil? && arr[i] - arr[i+1] == arr[i+1] - arr[i+2]}\r\n 'Arithmetic'\r\n elsif arr.each_with_index.all? {|x, i| !arr[i+2].nil? && arr[i] / arr[i+1] == arr[i+1] / arr[i+2]}\r\n 'Geometric'\r\n else\r\n -1\r\n end\r\nend",
"title": ""
},
{
"docid": "aa36a1bc21ddff4b818cc674fad9c955",
"score": "0.6227755",
"text": "def ArithGeo(arr)\n arith_result, geo_result = true, true\n arith_pattern = arr[1] - arr[0]\n geo_pattern = arr[1] / arr[0]\n \n arr.each_cons(2) do |num1, num2|\n arith_result = false if num2 - num1 != arith_pattern\n geo_result = false if num2 / num1 != geo_pattern\n end\n \n return 'Arithmetic' if arith_result\n return 'Geometric' if geo_result\n -1\nend",
"title": ""
},
{
"docid": "086464b0b4cfdddf1bb7bf20cb2a7f12",
"score": "0.60577637",
"text": "def arith_geo(arr)\n common_differences = Hash.new(0)\n common_ratios = Hash.new(0)\n arr.each_with_index do |num, i|\n if !(arr[i + 1].nil?)\n common_differences[arr[i + 1] - arr[i]] += 1\n common_ratios[arr[i + 1] / arr[i]] += 1\n end\n end\n\n return \"Arithmetic\" if common_differences.keys.count == 1\n return \"Geometric\" if common_ratios.keys.count == 1\n return -1\nend",
"title": ""
},
{
"docid": "e76dc1ee80cdaec6c13ad7dccc71bb2e",
"score": "0.5767844",
"text": "def get_display_expression(sequence)\n sequence.inject('') do |string, summand|\n if summand.to_s.start_with?('1')\n summand.to_s\n elsif summand > 0\n string + ' + ' + summand.to_s\n else\n string + ' - ' + summand.abs.to_s\n end\n end\nend",
"title": ""
},
{
"docid": "123a3038cddeb3aedc3adee111ff3f4c",
"score": "0.5503019",
"text": "def cal_sol(str)\n par1=0\n par2=0\n array = str.split('')\n return str if array.none?(%r{[/*/+-/(/)]})\n while array.any?('(')\n i=1\n while i<array.length\n if array[i]=='(' || array[i]==')'\n par1=par2\n par2=i\n end\n if array[par1]=='(' && array[par2]==')'\n array = (par1!=0 ? array[0..par1-1] : []).concat([cal_sol(array[par1+1..par2-1].join(''))]).concat(array[par2+1..array.length])\n i=par1\n par2=par1-1\n par1=par1-1\n end\n i+=1\n end\n end\n new_string = array.join('')\n numbers= new_string.split(%r{[/*/+-]})\n signs= new_string.split(%r{[^/*/+-]}).join('').split('')\n elements = []\n (numbers.length+signs.length).times do |i|\n if i%2==0\n elements.push(numbers[0])\n numbers.delete_at(0)\n else \n elements.push(signs[0])\n signs.delete_at(0)\n end\n end\n operations = ['/','*','-','+']\n operations.each do |ops|\n i=1\n while i<elements.length-1\n if elements[i]==ops\n new_value= [elements[i-1].to_f, elements[i+1].to_f].inject(ops.to_sym)\n puts new_value\n elements = (i>=2 ? elements[0..i-2] : []).concat([new_value]).concat(elements[i+2..elements.length])\n i-=1\n end\n i+=1\n end\n end\n elements[0].to_s\nend",
"title": ""
},
{
"docid": "f0c3e707b583731e7f5c37b00d4f06c9",
"score": "0.5496131",
"text": "def mathphrase(integer)\n phrase = [NUMBERS.sample]\n integer.times do |num|\n phrase << OPERATORS.sample << NUMBERS.sample\n end\n phrase.map! do |word| \n if word == 'divided'\n 'divided by'\n else\n word\n end\n end\n phrase.join(\" \")\nend",
"title": ""
},
{
"docid": "5fc2bf41a691496d7a89dc3d31737e43",
"score": "0.54754263",
"text": "def operation_to_message(string)\n answer = case string\n when '1'\n 'ADDING'\n when '2'\n 'SUBTRACTING'\n when '3'\n 'MULTIPLYING'\n when '4'\n 'DIVIDING'\n end\n answer\nend",
"title": ""
},
{
"docid": "4e224da6f7542b6ace974a9d0b56fd7e",
"score": "0.5456803",
"text": "def is_sequence_arithmetic?(arr)\n differences = []\n arr.each_with_index do |val, idx|\n if idx != 0\n differences << val - arr[idx - 1]\n end\n end\n differences.each do |num|\n if num != 1\n return false \n end\n end\n return true\nend",
"title": ""
},
{
"docid": "27642489b728f4d1034fbd38d2ee3dde",
"score": "0.54143965",
"text": "def solution(a)\n number = a.to_s.chars\n first_arrays = []\n (number.length/2).times do\n first_arrays << number.shift\n first_arrays << number.rotate(number.length-1).shift\n number.pop\n end\n ( first_arrays + number ).join(\"\").to_i\nend",
"title": ""
},
{
"docid": "aea4c7b0b8c7a84504c6ffb43197d379",
"score": "0.53932804",
"text": "def arithmetic(a, b, operator)\n if operator == \"add\"\n a + b\n elsif operator == \"subtract\"\n a - b\n elsif operator == \"multiply\"\n a * b\n elsif operator == \"divide\"\n a/b\n else\n print \"hahaa\"\n end\nend",
"title": ""
},
{
"docid": "354e831c7d1c8e737e077fb88584e5c8",
"score": "0.5367107",
"text": "def eval_math(string)\n number_stack = []\n operator_stack = []\n tokens = string.split(\" \")\n tokens.each_with_index do |n, i|\n if n == \"*\" \n number_stack << number_stack.pop.to_i * tokens[i+1].to_i\n tokens.delete_at(i+1)\n elsif n == \"/\" \n number_stack << number_stack.pop.to_i / tokens[i+1].to_i\n tokens.delete_at(i+1)\n elsif ['+','-'].include? n\n operator_stack << n\n else\n number_stack << n\n end\n puts \"evaling n: #{n}, number_stack #{number_stack} operator_stack #{operator_stack}\"\n end\n result = 0\n operator_stack.each do |o|\n if o == '+'\n number_stack[0] = number_stack.first.to_i + number_stack.delete_at(1).to_i\n end\n if o == '-'\n number_stack[0] = number_stack.first.to_i - number_stack.delete_at(1).to_i\n end\n end\n\n return number_stack[0]\n\nend",
"title": ""
},
{
"docid": "0f5ad49ea0dcd556536b517b12a5de9e",
"score": "0.5352777",
"text": "def calculate_str(st)\n first_num = ''\n operator = ''\n second_num = ''\n \n characters = st.chars\n \n characters.each do |char|\n if char.match?(/[0-9]/) or char.eql?('.')\n if operator == ''\n first_num << char\n else\n second_num << char\n end\n elsif char.match?(/(\\+|-|\\*|\\/)/)\n operator << char \n else\n next\n end\n end\n result = eval first_num + operator + second_num\n result.round.to_i.to_s\nend",
"title": ""
},
{
"docid": "dc166e7169de94882ffdb390be86403b",
"score": "0.534888",
"text": "def english_number original_number\r\n current_number = original_number\r\n exploded_number = []\r\n # Convert number into an array of multiples of base units\r\n CONVERSIONS.each do |base_pair|\r\n if current_number >= base_pair[:number] * 2\r\n # Enter the multiple and the base unit as elements if necessary\r\n exploded_number << current_number / base_pair[:number]\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n elsif current_number >= base_pair[:number]\r\n # Enter just the base unit if there's no integer multiple\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n end\r\n # Otherwise enter nothing\r\n end\r\n # Eg array [{1000000}, 507, {1000}, 5, 100, 30, 7]\r\n # Reduce array to an English translation\r\n english_result = exploded_number.reduce([\"\",:start]) { |text_string, base_pair|\r\n # Add a space unless it's the start of the string\r\n text_string[0] += ' ' unless text_string[1] == :start\r\n # Convert current number to English if it's a multiple\r\n if base_pair.class == Integer\r\n text_string[0] += english_number(base_pair)\r\n text_string[1] = :multiple\r\n elsif base_pair[:number] >= ONE_PREFIX_BOUNDARY\r\n # Otherwise, if it's >= 100 and preceding unit is not a multiple add 'one'\r\n text_string[0] += 'one ' unless text_string[1] == :multiple\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :above_boundary\r\n else\r\n # Otherwise, if it's <100 and transitioning from >=100, add 'and'\r\n text_string[0] += 'and ' if text_string[1] == :above_boundary\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :below_boundary\r\n end\r\n text_string\r\n }[0]\r\n return english_result\r\nend",
"title": ""
},
{
"docid": "734912d62b0316ca47e21976a17bd463",
"score": "0.53117186",
"text": "def calc(num1, mathop, num2)\n if mathop == \"+\"\n return num1 + num2\n elsif mathop == \"-\"\n return num1 - num2\n elsif mathop == \"*\"\n return num1 * num2\n elsif mathop == \"/\"\n return num1 / num2\n else\n return \"I did not recognize your input, please try again.\"\n end\nend",
"title": ""
},
{
"docid": "a13d1208717c336869f0e11883f54dd1",
"score": "0.5276323",
"text": "def convert_operator_to_text(op)\n case op\n when '1'\n 'add'\n when '2'\n 'subtract'\n when '3'\n 'multiply'\n when '4'\n 'divide'\n end\nend",
"title": ""
},
{
"docid": "94bddb76648a90b8428abc72b3a69b4c",
"score": "0.522355",
"text": "def max_rotation(num)\n arr = num.to_s.split(\"\")\n first_rotation = arr[1..-1] + [arr[0]]\n result = first_rotation\n if arr.size == 1\n return num\n elsif arr.size == 2\n return first_rotation.join.to_i\n else\n rotation_times = first_rotation.size - 2\n\n 1.upto(rotation_times) do |i|\n rotating_digit = result.delete_at(i)\n result.push(rotating_digit)\n end\n end\n return result.join.to_i\nend",
"title": ""
},
{
"docid": "b67403822a98f1f7b9512c6f07deb553",
"score": "0.52210784",
"text": "def numeral_to_string numeral\n raise ArgumentError, \"Invalid characters in numeral '#{numeral}'\" unless numeral =~ /^[IVXLCDM]+$/i\n numbers = numeral.upcase.chars.map do |char|\n case char\n when \"I\"\n 1\n when \"V\"\n 5\n when \"X\"\n 10\n when \"L\"\n 50\n when \"V\"\n 50\n when \"C\"\n 100\n when \"D\"\n 500\n when \"M\"\n 1000\n end\n end\n sum = 0\n numbers.each_with_index do |n, i|\n # check for negative values (subtraction) before summing\n n = n * -1 if !numbers[i+1].nil? && numbers[i+1] > n\n sum += n\n end\n sum\nend",
"title": ""
},
{
"docid": "dd808114ac190b85c53cec4d6f4c69a5",
"score": "0.52155423",
"text": "def string\n if denominator.to_i == 0\n puts \"ERROR\"\n else\n puts numerator.to_s + \"/\" + denominator.to_s\n end\n end",
"title": ""
},
{
"docid": "4840b44d3de3666f9ddf3823dc4ceca9",
"score": "0.52127475",
"text": "def minilang(string)\n register = 0\n stack = []\n\n operation_array = string.downcase.split\n\n operation_array.map!{ |x| x.to_i == 0 ? x : x.to_i }\n\n string.split.size.times do\n register = operation_array.shift if operation_array.first.to_i != 0\n\n case operation_array[0]\n when \"print\"\n p register\n operation_array.shift\n when \"push\"\n stack << register\n operation_array.shift\n when \"mult\"\n register *= stack.pop\n operation_array.shift\n when \"add\"\n register += stack.pop\n operation_array.shift\n when \"pop\"\n register = stack.pop\n operation_array.shift\n when \"div\"\n register /= stack.pop\n operation_array.shift\n when \"mod\"\n register %= stack.pop\n operation_array.shift\n when \"sub\"\n register -= stack.pop\n operation_array.shift\n end\n end\nend",
"title": ""
},
{
"docid": "37696d11a6f019ec29fca2f95489cf30",
"score": "0.5190413",
"text": "def increment_string(input)\n return input + '1' if !(input[-1] =~ /[0-9]/)\n split = input.scan(/\\d+|\\D+/)\n no_num = true\n res = ''\n split.each do |item|\n if (item.scan(/\\D/).empty?)\n item = item.next\n no_num = false\n end\n res += item\n end\n return res + '1' if (no_num)\n res\n\nend",
"title": ""
},
{
"docid": "017fac9e4db5d2e65c2b94351ecd9b0f",
"score": "0.51318395",
"text": "def operation_to_message(op)\n case op\n when '1'\n \"Adding\"\n when '2'\n \"Subtracting\"\n when '3'\n \"Multiplying\"\n when '4'\n \"Dividing\"\n end\nend",
"title": ""
},
{
"docid": "6971b8d72ff6808d9507087304c7de9d",
"score": "0.5126964",
"text": "def operation_of(a, b, op)\n if op == \"add\"\n return a + b\n elsif op == \"subtract\"\n return a - b \n elsif op == \"multiply\"\n return a * b \n elsif op == \"divide\"\n if b == 0\n return \"undefined\"\n else\n return a / b\n end\n end\nend",
"title": ""
},
{
"docid": "d797030c81774757a2e286978e58e39c",
"score": "0.5107805",
"text": "def to_number\n acc = ''\n mult = 1\n gnumber.split.each do |gdigit| # each gnumber is splitted into tokens (a single digit )\n val = @@galactic_digit[gdigit] # get the corrispondent Roman digit\n if val.nil?\n mult *= @@galactic_coin[gdigit]\n else # the digit has an equivalent roman digit\n acc << val # so it is accumulated in a string to produce a roman number\n end\n end\n mult * RomanNumber.new(acc).to_i\n end",
"title": ""
},
{
"docid": "6c5bdc8a96c74e89028591dbd22c3407",
"score": "0.510733",
"text": "def math(operator, first_num, second_num)\n if operator ==\"*\"\n first_num*second_num\n elsif operator == \"/\"\n first_num/second_num\n elsif operator == \"+\"\n first_num+second_num\n else\n first_num-second_num\n end\nend",
"title": ""
},
{
"docid": "9edb23fdd1a8d4a6d36786a26419fb3e",
"score": "0.5067572",
"text": "def math_eval(str)\n # iterate over string values\n # perhaps utilize a queue till you hit a symbol?\n # left operand and right operand (do we care about order of operations?)\n copy = str\n total = 0\n tokens = []\n\n copy.chars.each_with_index do |ch, idx|\n if ch == '*' || ch == '/' || ch == '+' || ch == '-'\n divided = str.split(ch)\n tokens << divided.shift.to_i\n tokens << ch\n copy = divided\n end\n if idx == copy.length - 1\n tokens << copy\n end\n # break if ch.match(/()+\\-*/) && operator != ''\n # operator = ch.match(/()+\\-*/)\n # left_operand = ch if ch.match(/0-9/) && operator == ''\n # right_operand += ch if ch.match(/0-9/) && operator != ''\n end\n return tokens\n\n p \"operator: #{operator}, left_operand: #{left_operand}, right_operand: #{right_operand}\"\n return left_operand.to_i if operator == ''\n return left_operand.to_i + right_operand.to_i if operator == '+'\n return left_operand.to_i - right_operand.to_i if operator == '-'\n return left_operand.to_i / right_operand.to_i if operator == '/'\n return left_operand.to_i * right_operand.to_i if operator == '*'\nend",
"title": ""
},
{
"docid": "a4dc3ab730304c378136297a335b4ed9",
"score": "0.5065619",
"text": "def mathphrase(num)\n ops = %w[ plus minus times divide ]\n numbers = %w[ zero one two three four five six seven eight nine ]\n phrase = []\n \n num.times do\n phrase << numbers.sample\n phrase << ops.sample\n end\n \n phrase << numbers.sample\n puts phrase.join(' ')\nend",
"title": ""
},
{
"docid": "9ceeb63d75d6dcb0c4525485834d112f",
"score": "0.5062488",
"text": "def generate_an_operator\n\n number = rand(1..4)\n\n case\n when number == 1\n operator = \"plus\"\n when number == 2\n operator = \"minus\"\n when number == 3\n operator = \"times\"\n when number == 4\n operator = \"divide by\"\n else\n puts 'Error in generate_an_operator() method. Invalid operator'\n end\n\n operator\nend",
"title": ""
},
{
"docid": "a0451ab9f24de1e2d9abcc83c1405b95",
"score": "0.50620866",
"text": "def calculate(integer, operator, integer1)\n\tif operator == \"+\"\n\t\tp integer + integer1\n\telsif operator == \"-\"\n\t\tp integer - integer1\n\telsif operator == \"*\"\n\t\tp integer * integer1\n\telsif operator == \"/\"\n\t\tp integer / integer1\n\telse\n\t\tp \"I'm sorry that's not a valid equation!\"\n\t\t\n\tend\nend",
"title": ""
},
{
"docid": "a85be1a637126b4334286de44a7990d4",
"score": "0.5060048",
"text": "def aliquot_sequence(num)\n return [0] if num == 0\n return [1, 0] if num == 1\n [num] + aliquot_sequence(aliquot(num))\nend",
"title": ""
},
{
"docid": "3d2e77dbd3585ffc64bfcfa8483315a2",
"score": "0.50414175",
"text": "def operation_to_message(op)\n case op\n when '1'\n 'Adding'\n when '2'\n 'Subtracting'\n when '3'\n 'Multiplying'\n when '4'\n 'Dividing'\n end\nend",
"title": ""
},
{
"docid": "3d2e77dbd3585ffc64bfcfa8483315a2",
"score": "0.50414175",
"text": "def operation_to_message(op)\n case op\n when '1'\n 'Adding'\n when '2'\n 'Subtracting'\n when '3'\n 'Multiplying'\n when '4'\n 'Dividing'\n end\nend",
"title": ""
},
{
"docid": "f3281114e95a673dee2cd8da28389b85",
"score": "0.5038352",
"text": "def compute(*values)\n if values.size == 0\n return ''\n end\n if values.size == 1\n return values[0].to_s\n end\n return [values[0], values[1..].join('')].join('.')\nend",
"title": ""
},
{
"docid": "e5e6732e487dc8b7c7f8c4b1b7e00851",
"score": "0.5031204",
"text": "def operation_to_message(op)\n case op\n when \"1\"\n \"Adding\"\n when \"2\"\n \"Subtracting\"\n when \"3\"\n \"Multiplying\"\n when \"4\"\n \"Dividing\"\n end\nend",
"title": ""
},
{
"docid": "f06a80452528f6415a0748deb548f0bf",
"score": "0.50252897",
"text": "def calculate(s)\n stack = []\n num = 0\n res = 0 # For the on-going result\n sign = 1 # 1 means positive, -1 means negative\n\n s.each_char do |char|\n if char =~ /\\d/\n num = num * 10 + char.to_i\n elsif [\"+\", \"-\"].include?(char)\n res += sign * num\n num = 0\n sign = char == \"+\" ? 1 : -1\n elsif char == \"(\"\n stack << res\n stack << sign\n sign = 1\n res = 0\n elsif char == \")\"\n res += num * sign\n res *= stack.pop\n res += stack.pop\n num = 0\n end\n end\n\n res + num * sign\nend",
"title": ""
},
{
"docid": "8eb4f5e16c5c55c4a16b9a38e9b529ec",
"score": "0.5003972",
"text": "def operation_of(a, b, op)\n if op == \"add\"\n return a + b\n elsif op == \"subtract\"\n return a - b\n elsif op == \"multiply\"\n return a * b\n elsif op == \"divide\"\n if b == 0\n return \"undefined\"\n else\n return a / b\n end\n end\nend",
"title": ""
},
{
"docid": "a4480aa794b6ae6c9e14aaf7f1398eba",
"score": "0.49952963",
"text": "def calculate(program)\n operator = ''\n a = 0\n b = 0\n thearray = program.split(\",\").map { |s| s.to_i }\n thearray.each_with_index do | val, key |\n case key.divmod(4)[1]\n when 0\n case val\n when 1\n operator = 'add'\n when 2\n operator = 'multiply'\n when 99\n break\n else\n @result = \"program input invalid\"\n break\n end\n when 1\n a = thearray.at(val)\n #puts \"A is #{a}\"\n when 2\n b = thearray.at(val)\n #puts \"B is #{b}\"\n else\n case operator\n when 'add'\n thearray[val] = a + b\n else\n thearray[val] = a * b\n end\n end\n end\n @result = thearray.join(\",\")\n end",
"title": ""
},
{
"docid": "dd18a7b5637dac010467c882b4e9feca",
"score": "0.4990422",
"text": "def calculate(operation, n1, n2)\n if operation == \"add\" || operation == \"+\"\n return \"#{n1} + #{n2} = #{n1+n2}\"\n elsif operation == \"subtract\" || operation == \"-\"\n return \"#{n1} - #{n2} = #{n1-n2}\"\n elsif operation == \"multiply\" || operation == \"*\"\n return \"#{n1} * #{n2} = #{n1*n2}\"\n elsif operation == \"divide\" || operation == \"/\"\n if n2 == 0\n return \"undefined\"\n else\n return \"#{n1} / #{n2} = #{n1/n2}\"\n end\n elsif operation == \"exponent\" || operation == \"^\"\n return \"#{n1} ^ #{n2} = #{n1**n2}\"\n elsif operation == \"modulo\" || operation == \"%\"\n return \"#{n1} % #{n2} = #{n1%n2}\"\n end\nend",
"title": ""
},
{
"docid": "f81069687437e44e88bad87414c9a24d",
"score": "0.498919",
"text": "def operation_to_message(op)\n word = case op\n when '1'\n 'Adding'\n when '2'\n 'Subtracting'\n when '3'\n 'Multiplying'\n when '4'\n 'Dividing'\n end\n word\nend",
"title": ""
},
{
"docid": "550045f57df951bc5fbeb44c39101443",
"score": "0.4982464",
"text": "def calculate(starting_value, operations)\n for i in 0...operations.length\n # just in case an unexpected operator is given:\n if '*/+-'.include?(operations[i][0]) == false\n puts 'unexpected operator!'\n break\n end\n \n if operations[i][0] == \"*\"\n starting_value *= operations[i][1]\n elsif operations[i][0] == \"+\"\n starting_value += operations[i][1]\n elsif operations[i][0] == \"-\"\n starting_value -= operations[i][1]\n else\n starting_value /= operations[i][1]\n end\n end\n starting_value\nend",
"title": ""
},
{
"docid": "a1bb6462776ccd90f38a18e57744ab06",
"score": "0.4977108",
"text": "def convertArithmetic(op)\n case op\n\n #basic arithmetic operations\n when \"add\"\n cmds = \"//add\"+\"\\n\" + arithmeticBinary(\"+\")\n\n when \"sub\"\n cmds = \"//subtract\"+\"\\n\" +arithmeticBinary(\"-\")\n\n when \"neg\"\n cmds = \"//negate\" +\"\\n\"+arithmeticUnary(\"-\")\n\n #basic bitwise operations\n when \"and\"\n cmds = \"//and\" +\"\\n\"+arithmeticBinary(\"&\")\n\n when \"or\"\n cmds = \"//or\" +\"\\n\"+arithmeticBinary(\"|\")\n\n when \"not\"\n cmds = \"//not\" +\"\\n\"+arithmeticUnary(\"!\")\n else\n cmds = \"//not a legal command\"\n end\n\n return cmds\nend",
"title": ""
},
{
"docid": "6aba26be069d2dcdc08365a1886574c8",
"score": "0.4976235",
"text": "def operation_to_message(op)\n word = case op\n when '1'\n 'Adding'\n when '2'\n 'Subtracting'\n when '3'\n 'Multiplying'\n when '4'\n 'Dividing'\n end\n word\nend",
"title": ""
},
{
"docid": "41475219c5a452bfe799c799e4e9bbe2",
"score": "0.49570587",
"text": "def calculator(number1, number2, operation)\n case operation\n when \"A\"\n number1 + number2\n when \"S\"\n number1 - number2\n when \"M\"\n number1 * number2\n when \"D\"\n divide_integers(number1, number2)\n else\n \"Unknown operation. Giving up.\"\n end\nend",
"title": ""
},
{
"docid": "db8efa6d752d4dbd05414359ffa936f3",
"score": "0.49542746",
"text": "def operation_to_message(op)\n case op\n when '1'\n '+'\n when '2'\n '-'\n when '3'\n '/'\n when '4'\n '*'\n end\nend",
"title": ""
},
{
"docid": "785c638602b3ead2cc9316731f9a412e",
"score": "0.49513683",
"text": "def fraction_calculator fraction_one, fraction_two, operator\n num_one = Rational(fraction_one)\n num_two = Rational(fraction_two)\n \n final_result = case operator\n when '/' then num_one / num_two\n when '*' then num_one * num_two\n when '+' then num_one + num_two\n when '-' then num_one - num_two\n end\n\n String(final_result)\n\n print String(final_result)\n\nend",
"title": ""
},
{
"docid": "8906c8ff782fca779c21ca2b5c83e8f6",
"score": "0.49424812",
"text": "def minilang(str)\n stack = []\n reg = 0\n\n # puts str\n cmds = str.split\n cmds.each do |cmd|\n # puts \"cmd == #{cmd}\"\n case cmd\n when 'PUSH' then stack << reg\n when 'ADD' then reg += stack.pop\n when 'SUB' then reg -= stack.pop\n when 'MULT' then reg *= stack.pop\n when 'DIV' then reg /= stack.pop\n when 'MOD' then reg %= stack.pop\n when 'POP' then reg = stack.pop\n when 'PRINT' then puts reg\n else reg = cmd.to_i # integer\n end\n end\n puts\nend",
"title": ""
},
{
"docid": "89f341b7016bfd8a49dd1e43e103357d",
"score": "0.4938513",
"text": "def operations\n puts \"(a) - addition (+)\"\n puts \"(s) - subtraction (-)\"\n puts \"(m) - multiplication (*)\"\n puts \"(d) - division (/)\"\nend",
"title": ""
},
{
"docid": "08b85326b6825f1f09c3f9142bf2dc8c",
"score": "0.49299994",
"text": "def operator_to_message(op)\n msg = case op\n when '1'\n 'Adding'\n when '2'\n 'Subtracting'\n when '3'\n 'Multiplying'\n when '4'\n 'Dividing'\n end\n msg\nend",
"title": ""
},
{
"docid": "83ad5a8308c329c8dd723940d55d58c4",
"score": "0.49297106",
"text": "def minilang(str)\n register = 0\n stack = []\n\n str.split.each do |el|\n case \n when el == 'ADD' then register += stack.pop\n when el == 'SUB' then register -= stack.pop\n when el == 'MULT' then register *= stack.pop\n when el == 'DIV' then register /= stack.pop \n when el == 'MOD' then register %= stack.pop \n when el == 'PUSH' then stack.push(register)\n when el == 'POP' then register = stack.pop \n when el == 'PRINT' then puts register \n else register = el.to_i\n end\n end\nend",
"title": ""
},
{
"docid": "9a31b1966035d8b35348ea27ce9e2164",
"score": "0.4914875",
"text": "def arithmetic(a, b, operator)\n $oper = operator\n case $oper\n when 'add'\n return a + b\n\n when 'subtract'\n return a - b\n\n when 'multiply'\n return a * b\n\n when 'divide'\n return a / b\n \n end\nend",
"title": ""
},
{
"docid": "480331ca99e3015e4c9737d76b319502",
"score": "0.49132082",
"text": "def request_calculation_type\n puts \"Type 1 to add, 2 to subtract, 3 to multiply, 4 to divide, 5 to power to, or 6 for modulus calculation : \"\n operation_selection = gets.to_i\n\n if operation_selection == 1\n \"add\"\n elsif operation_selection == 2\n \"subtract\"\n elsif operation_selection == 3\n \"multiply\"\n elsif operation_selection == 4\n \"divide\"\n elsif operation_selection == 5\n \"exponent\"\n elsif operation_selection == 6\n \"modulus\"\n else\n \"error\"\n end\nend",
"title": ""
},
{
"docid": "2b4a76e4f755937c7466d782e454a588",
"score": "0.49112457",
"text": "def getOperator(line)\n #ignore left and right parentheses\n char = 1\n length = line.length - 1\n bracket = 0\n while char < length\n if line[char] == \"(\"\n bracket += 1\n elsif line[char] == \")\"\n bracket -= 1\n end\n if bracket == 0\n return char + 1\n end\n char += 1\n end\n return -1\n end",
"title": ""
},
{
"docid": "889ac6e309ae00912e4c4c3731acfc4c",
"score": "0.4911112",
"text": "def combine(str)\n int, frac = str.gsub(/[\\(\\)]/, '').split(' + ')\n n, d = frac.count('/') == 1 ?\n frac.split('/') :\n frac.split('/')[1,2].reverse\n \"#{n.to_i + int.to_i*d.to_i}/#{d}\"\nend",
"title": ""
},
{
"docid": "32820e4f04f9665184c51e1056eef362",
"score": "0.49070114",
"text": "def operation_to_message(op)\n case op\n when '1'\n \"adding\"\n when '2'\n 'subtracting'\n when '3'\n 'multiplying'\n when '4'\n 'dividing'\n end\n end",
"title": ""
},
{
"docid": "29894b4eaf0718c0413ef644790695c4",
"score": "0.48982465",
"text": "def has_paranthesis(str, type)\n if ((str.include? \"(\") && (str.include? \")\"))\n sub_calc = str.split(\" \")\n front = sub_calc[0].split(\"\")\n front.shift\n sub_calc[0] = front.join(\"\")\n back = sub_calc[2].split(\"\")\n back.delete_at(-1)\n sub_calc[2] = back.join(\"\")\n result = calculate(sub_calc[0], sub_calc[2], sub_calc[1], type).to_i.to_s\n else\n result = str\n end\n\n return result\nend",
"title": ""
},
{
"docid": "caee83c10f50c96bd815dfebb0bd9624",
"score": "0.48954275",
"text": "def calc(op, arr)\n return op.to_i if arr.empty?\n\n right = calc(arr[0], arr[1..-1])\n return nil unless right\n\n case op.to_s\n when /\\A-?\\d+\\z/\n (op.to_i + right).abs\n when 'x2'\n right * 2\n when '/2'\n right.even? ? right / 2 : nil\n else\n raise \"unexpected op #{op.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "330445f19c2790867d5d82d90278f639",
"score": "0.4895004",
"text": "def find_missing_number(sequence)\n if sequence == \"\"\n return 0\n end\n # remove whitespaces and convert to array\n sequence = sequence.gsub(/\\s+/, \",\").split(\",\")\n\n # string to array\n # sequence = sequence.split(\",\")\n\n # sort by integer value\n sequence = sequence.sort_by(&:to_i)\n # sort string\n # sequence = sequence.chars.sort.join\n puts sequence \n\n \n if sequence[0].to_i != 1\n return 1\n elsif\n sequence[0].to_i == 1 && sequence.length == 1\n return 1\n elsif\n sequence.count(\"a-zA-Z\") > 0\n return 1\n elsif\n sequence == \"\"\n return 0\n elsif\n sequence[0].to_i == 2\n return 1\n else\n \n for i in 1..sequence.length - 1\n\n check = sequence[i].to_i - sequence[i - 1].to_i\n\n if check > 1\n missNum = sequence[i - 1].to_i + 1\n return missNum\n end\n\n end\n if check == 1\n return 0\n end\n end\nend",
"title": ""
},
{
"docid": "bf97f2f393df26ddbf9fbf866ae32094",
"score": "0.48892447",
"text": "def multiple_brackets(str)\n return '1' unless str =~ /\\(|\\)|\\[|\\]/\n bracket_count = 0\n if str =~ /\\(|\\)/\n counter = 0\n str.each_char do |char|\n if char == '('\n counter += 1\n bracket_count += 1\n elsif char == ')'\n counter -= 1\n end\n return '0' if counter.negative?\n end\n return '0' unless counter == 0\n end\n if str =~ /\\[|\\]/\n counter = 0\n str.each_char do |char|\n if char == '['\n counter += 1\n bracket_count += 1\n elsif char == ']'\n counter -= 1\n end\n return '0' if counter.negative?\n end\n return '0' unless counter == 0\n end\n \"1 #{bracket_count}\"\nend",
"title": ""
},
{
"docid": "4ce8eb5594262a916d8facdd802b213a",
"score": "0.48889667",
"text": "def writeArithmetic(cmd,ln)\n\tcase cmd[:c]\n\twhen 'add','sub','and','or' then l = arith(cmd[:s])\n\twhen 'neg','not' then l = neginv(cmd[:s])\n\twhen 'gt','lt','eq' then l = glte(cmd[:s],ln)\n\telse return -1 end \n\treturn l\nend",
"title": ""
},
{
"docid": "2f4d400c90c451019ed14dfc11b602dc",
"score": "0.4873947",
"text": "def check_op (oper)\n if oper == 'add' || oper == '+'\n puts \"+ + Let's add 'em up! + +\"\n return operator = '+'\n elsif oper == 'subtract' || oper == '-'\n puts \"- - Let's subtract! - -\"\n return operator = '-'\n elsif oper == 'multiply' || oper == '*'\n puts \"* * It's time to multiply! * *\"\n return operator = '*'\n elsif oper == 'divide' || oper == '/'\n puts \"/ / Let's divide 'em up! / /\"\n return operator = '/'\n elsif oper == 'exponent' || oper == '**'\n puts \"^ ^ Let's power 'em up! ^ ^\"\n return operator = '**'\n elsif oper == 'remainder' || oper == '%'\n puts \"% % Let's find the remainder! % %\"\n return operator = '%'\n end\nend",
"title": ""
},
{
"docid": "f95fe3ddbc9ea75871f3251a91f4d940",
"score": "0.486417",
"text": "def basic_type\n \tputs \"Type 1 to add, 2 to subtract, 3 to multiply, 4 to divide, 5 to square two numbers, 6 to find the squareroot and 7 for your bmi: \"\n\toperator = gets.to_f\n\n\tif operator == 1 \n\t\t\"add\"\n\telsif operator == 2\n \t\"subtract\"\n\telsif operator == 3\n \t\"multiply\"\n\telsif operator == 4\n \t\"divide\"\n\telsif operator == 5\n \t\t\"square\"\n\telsif operator == 6\n \t\t\"sqrt\"\n\telsif operator == 7\n \t\t\"bmi\"\n\telse\n \t\"error\"\n \tend\nend",
"title": ""
},
{
"docid": "ca98d9eff1c1d7f66c7589b65c4e0970",
"score": "0.48610663",
"text": "def numeral(number)\n\tnumerals = {:I => 1, :V => 5, :X => 10, :L => 50, \n\t\t:C => 100, :D => 500, :M => 1000}\n\torder = [:M,:D,:C,:L,:X,:V,:I]\n\toutput = \"\"\n\torder.each do |n|\n\t\tif numerals[n] <= number\n\t\t\ttimes = number / numerals[n]\n\t\t\tremainder = number % numerals[n]\n\t\t\toutput += n.to_s * times\n\t\t\tnumber = remainder\n\t\tend\n\tend\n\toutput\nend",
"title": ""
},
{
"docid": "d2835b9f40222aaa17e8c99b430c3c0c",
"score": "0.48596692",
"text": "def build_callnumber(a, b, c, g, alternate_stem)\n if a == nil && b == nil\n ab = alternate_stem\n else\n ab = [a, b].compact.join(\" \")\n end\n if g == \"1\" || g == \"0\"\n g = nil\n end\n if g != nil\n g = \"c.#{g}\"\n end\n [ab, c, g].compact.join(\" \").strip\nend",
"title": ""
},
{
"docid": "d533d5c0cad2195c350004f972e9c7b6",
"score": "0.48527342",
"text": "def calculator(op, num1, num2)\n if op == \"add\" || op == \"+\" || op == \"addition\"\n return num1 + \" + \" + num2 + \" = #{add(num1.to_i, num2.to_i)}\"\n elsif op == \"subtract\" || op == \"-\" || op == \"subtraction\"\n return num1 + \" - \" + num2 + \" = #{sub(num1.to_i, num2.to_i)}\"\n elsif op == \"multiply\" || op == \"*\" || op == \"multiplication\"\n return num1 + \" * \" + num2 + \" = #{mult(num1.to_i, num2.to_i)}\"\n elsif op == \"divide\" || op == \"/\" || op == \"division\"\n return num1 + \" / \" + num2 + \" = #{div(num1.to_i, num2.to_i)}\"\n elsif op == \"modulo\" || op == \"remainder\" || op == \"%\"\n return num1 + \" % \" + num2 + \" = #{mod(num1.to_i, num2.to_i)}\"\n else op == \"exponent\" || op == \"^\"\n return num1 + \"^\" + num2 + \" = #{exponent(num1.to_i, num2.to_i)}\"\n end\nend",
"title": ""
},
{
"docid": "778f5d35b38d8593c4b10e6ac7f7e915",
"score": "0.48483163",
"text": "def operation_to_message(operation)\n word = case operation\n when '1'\n 'Adding'\n when '2'\n 'Subtracting'\n when '3'\n 'Multiplying'\n when '4'\n 'Dividing'\n end\n\n x = \"A random line of code\"\n\n word\nend",
"title": ""
},
{
"docid": "579a5fc99b8fcd772595782f47dddb63",
"score": "0.4844582",
"text": "def evaluate(exp)\n\twhile x = exp =~ /[\\*\\/]/\n\t\tres = 0\n\t\tcase exp[x]\n\t\twhen '*'\n\t\t\tk, p = x-1, \"\"\n\t\t\tnum1, num2 = 0, 0\n\t\t\twhile k >= 0\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk -= 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum1 = p.reverse.to_i\n\t\t\tk, p = x+1, \"\"\n\t\t\twhile k < exp.length\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk += 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum2 = p.to_i\n\t\t\tres = num1 * num2\n\t\t\tres = res.to_s\n\t\t\texp = exp.sub(/\\d*\\*\\d*/, res)\n\t\twhen '/'\n\t\t\tk, p = x-1, \"\"\n\t\t\tnum1, num2 = 0, 0\n\t\t\twhile k >= 0\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk -= 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum1 = p.reverse.to_i\n\t\t\tk, p = x+1, \"\"\n\t\t\twhile k < exp.length\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk += 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum2 = p.to_i\n\t\t\tres = num1 / num2\n\t\t\tres = res.to_s\n\t\t\texp = exp.sub(/\\d*\\/\\d*/, res)\n\t\tend\n\tend\n\twhile x = exp =~ /[\\+\\-]/\n\t\tres = 0\n\t\tcase exp[x]\n\t\twhen '+'\n\t\t\tk, p = x-1, \"\"\n\t\t\tnum1, num2 = 0, 0\n\t\t\twhile k >= 0\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk -= 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum1 = p.reverse.to_i\n\t\t\tk, p = x+1, \"\"\n\t\t\twhile k < exp.length\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk += 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum2 = p.to_i\n\t\t\tres = num1 + num2\n\t\t\tres = res.to_s\n\t\t\texp = exp.sub(/\\d*\\+\\d*/, res)\n\t\twhen '-'\n\t\t\tk, p = x-1, \"\"\n\t\t\tnum1, num2 = 0, 0\n\t\t\twhile k >= 0\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk -= 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum1 = p.reverse.to_i\n\t\t\tk, p = x+1, \"\"\n\t\t\twhile k < exp.length\n\t\t\t\tif exp[k] != '*' && exp[k] != '/' && exp[k] != '+' && exp[k] != '-'\n\t\t\t\t\tp += exp[k]\n\t\t\t\t\tk += 1\n\t\t\t\telse\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\t\tnum2 = p.to_i\n\t\t\tres = num1 - num2\n\t\t\tres = res.to_s\n\t\t\texp = exp.sub(/\\d*\\-\\d*/, res)\n\t\tend\n\tend\n\texp\nend",
"title": ""
},
{
"docid": "8db6aea9085ec8298da3e85d4eb37b46",
"score": "0.48364308",
"text": "def get_grade(array)\n\tsum = 0\n\tx = array.inject{|sum,x| sum + x } \n \ty = x/array.length\n\tif y >= 90\n\t\treturn \"A\"\n\telsif y >= 80\n\t\treturn \"B\"\n\telsif y >= 70; \n\t\treturn \"C\"\n\telsif y >= 60\n\t\treturn \"D\"\n\telse \n\t\treturn \"F\"\n\tend\nend",
"title": ""
},
{
"docid": "1ae2e4dca9c25c48ca884b53d4f300b4",
"score": "0.4831352",
"text": "def max_rotation int\n final_string = ''\n string_digits = int.to_s.chars\n loop do\n string_digits = rotate_arr(string_digits)\n final_string << string_digits.shift\n break if string_digits.size < 1\n end\n final_string.to_i\nend",
"title": ""
},
{
"docid": "9b59f1e62dada1c1ec779f867182e77d",
"score": "0.48305848",
"text": "def bc(string)\n # initialize the operators and integers array\n operators = []\n integers = []\n\n # separate integers and operators into different arrays\n integers = string.split(/\\+|\\-|\\*|\\//).map(&:to_i)\n string.each_char do |c|\n if c.match /\\+|\\-|\\*|\\//\n operators << c\n end\n end\n\n # we want to handle * and / first\n count = 0\n operators.each_with_index do |o, i|\n if o.match /\\*|\\//\n r = integers[i-count].send(o, integers[i+1-count])\n integers.delete_at i+1-count\n integers.delete_at i-count\n integers.insert(i, r)\n count += 1\n end\n end\n\n # remove all * and / operators\n operators = operators.select do |o|\n !o.match /\\*|\\//\n end\n\n # we want to handle + and -\n integers.compact!\n count = 0\n operators.each_with_index do |o, i|\n if o.match /\\+|\\-/\n r = integers[i-count].send(o, integers[i+1-count])\n integers.delete_at i+1-count\n integers.delete_at i-count\n integers.insert(i, r)\n count += 1\n end\n end\n\n integers.compact\nend",
"title": ""
},
{
"docid": "9fba5b50f6f31b6f059e42c05fb87138",
"score": "0.4818452",
"text": "def calculate_roman_numeral\n remaining_value = value\n roman_string = ''\n while (remaining_value > 0)\n value = biggest_number_that_fits_into(remaining_value)\n roman_string += numbers_to_numerals[value]\n remaining_value -= value\n end\n roman_string\n end",
"title": ""
},
{
"docid": "1cd9121bb49f9bb977c598654bcc4e63",
"score": "0.4798619",
"text": "def calculator(a , b, operation = \"add\")\n if operation == \"add\"\n add(a, b)\n elsif operation == \"subtract\"\n subtract(a, b)\n elsif operation == \"multiply\"\n multiply(a, b)\n else\n \"That's not a math operation, genius!\"\n end\nend",
"title": ""
},
{
"docid": "b9a74a56603347f025b17c51685c54ea",
"score": "0.4795189",
"text": "def calculator num1, operator, num2\n # Our 'if' statement checks to see if we have found the string of plus or minus and uses the according operator.\n if operator == \"plus\"\n return num1 + num2\n else\n return num1 - num2\n end\n end",
"title": ""
},
{
"docid": "8e29121b4b1545e0b4478cf98c416f6b",
"score": "0.47942942",
"text": "def ochiai(array1, array2)\n m11, m10, m01, m00 = binary_compare(array1, array2)\n n = array1.size\n begin\n s = m11 / Math.sqrt( (m11 + m10) * (m11 + m01) ).to_f \n rescue ZeroDivisionError\n return :ochiai, 0.000\n end\n return :ochiai, 0.000 if s.nan?\n return :ochiai, s.round(3)\nend",
"title": ""
},
{
"docid": "9f745e2a87a011ae3b180b9524b5e633",
"score": "0.47907275",
"text": "def increment_string(input)\n return '1' if input.empty?\n \n arr = input.rpartition(/\\D/)\n\n if arr[-1].empty?\n arr[-1] = '1'\n else\n arr[-1] = arr[-1].succ\n end\n\n return arr.join\nend",
"title": ""
},
{
"docid": "857379903bd22432a1870af9b1918443",
"score": "0.47891796",
"text": "def solve_math(math)\n first_number, rest = math.scan(/^(#{NUMBER_RX})((?:#{SIGN_RX}#{NUMBER_RX})+)$/).flatten\n parts = ([first_number] + rest.scan(/(#{SIGN_RX})(#{NUMBER_RX})/)).flatten\n # at this point, `parts` consists of math signs and numbers in string format\n\n until parts.all?{|p| p.to_s[/^#{SIGN_RX}$/] or p.is_a?(Float)}\n parts.collect! do |part|\n do_math(part)\n end\n end\n # at this point, `parts consists of math signs and numbers in float format\n\n # reduces the math expression one process at a time until we have a number\n until parts.length == 1\n i = 0\n proc_positions = parts.inject({}) do |hash, part|\n if part.to_s[/^#{SIGN_RX}$/]\n hash[part] ||= i\n end\n i += 1\n\n hash\n end\n\n next_proc = nil\n next_position = nil\n MATH_ORDER.each do |symbols|\n unless (symbols & proc_positions.keys).empty? or next_proc\n next_proc = (symbols & proc_positions.keys).min_by do |p|\n proc_positions[p]\n end\n next_position = proc_positions[next_proc]\n end\n end\n\n if parts[next_position][/^#{SIGN_RX}$/]\n result = MATH_PROCS[parts[next_position]].call((parts[next_position-1] || 0), parts[next_position+1])\n parts[next_position-1] = parts[next_position+1] = nil\n parts[next_position] = result\n parts.compact!\n else\n raise 'Invalid math expression'\n end\n end\n\n return parts.first\n end",
"title": ""
},
{
"docid": "82241573554155f58818b6bf555539c1",
"score": "0.47869235",
"text": "def high_and_low(intArr)\r\n integerArr = intArr.split(' ')\r\n if integerArr.length >= 1\r\n highest_number = (integerArr.sort!).last\r\n lowest_number = (integerArr.sort!).first\r\n \"#{highest_number} #{lowest_number}\".to_s\r\n else\r\n \"There will always be at least one number in the input string\"\r\n end\r\nend",
"title": ""
},
{
"docid": "ca4c78b6f5a1ebe8bd91907e59ebe872",
"score": "0.47867063",
"text": "def one(str)\n arr = str.split('')\n total = 0\n arr.size.times do\n total += arr[0].to_i if arr[0] == arr[1]\n arr.rotate!\n end\n total\nend",
"title": ""
},
{
"docid": "e1f811c6e0d9115061b31db2d7a882a5",
"score": "0.47808087",
"text": "def follow_instructions(instructions)\n floor = 0\n saw_basement = nil\n\n instructions.split(//).each_with_index do |ch, index|\n floor += (ch == '(' ? 1 : -1)\n # print \"#{floor}..\"\n saw_basement = index + 1 if !saw_basement && floor < 0\n end\n\n [saw_basement, floor]\nend",
"title": ""
},
{
"docid": "df1533c47ca8ac7ec5fcb8ffeeec3366",
"score": "0.4769531",
"text": "def perform(array)\n case array[2]\n when \"1\", \"add\", \"addition\"\n puts \"The result is: #{(array[0] + array[1]).round(4)}\"\n when \"2\", \"subtract\", \"subtraction\"\n puts \"The result is: #{(array[0] - array[1]).round(4)}\"\n when \"3\", \"multiply\", \"multiplication\"\n puts \"The result is: #{(array[0] * array[1]).round(4)}\"\n when \"4\", \"divide\", \"division\"\n puts \"Remainder or decimal?\"\n case gets.chomp.downcase\n when \"remainder\"\n puts \"The result is: #{(array[0].to_i / array[1].to_i).floor} Remainder: #{(array[0].to_i % array[1].to_i)}\"\n when \"decimal\"\n puts \"The result is: #{(array[0] / array[1]).round(4)}\"\n else\n puts \"Did not understand. Restarting...\"\n end\n when \"5\", \"exponent\", \"exponential\"\n puts \"The result is: #{(array[0] ** array[1]).round(4)}\"\n else\n puts \"Did not understand. Restarting...\"\n end\nend",
"title": ""
},
{
"docid": "7cb56f8258b078a26f21c9679a891acd",
"score": "0.47693607",
"text": "def mixed_fraction(s)\n f = s\n fraction = f.split(\"/\").map { |x| x = x.to_i }\n p initial = Rational(fraction[0],fraction[1])\n p initial_split = initial.to_s.split(\"/\").map { |x| x = x.to_i }\n \n if initial_split[0] < 1\n initial_split[0] = initial_split[0] * -1\n initial_split[0]\n initial_split[2] = \"-\"\n initial_split[2]\n end\n if initial_split[1] == initial_split[0]\n final_answer = Array.new\n final_answer[0] = initial_split[2]\n final_answer[1] = initial_split[0]\n final_answer = final_answer.join\n elsif initial_split[0] == 0\n final_answer = \"0\"\n elsif (initial_split[0] / initial_split[1]) < 1\n final_answer = initial.to_s\n elsif (initial_split[0] / initial_split[1]) > 1\n if initial_split[0] % initial_split[1] == 0\n final_answer = \"#{initial_split[2]}#{initial_split[0]/initial_split[1]}\"\n elsif \n final_answer = Array.new\n final_answer[0] = initial_split[2]\n final_answer[1] = \"#{(initial_split[0]/initial_split[1])}\"\n final_answer[2] = \" #{initial_split[0] % initial_split[1]}/#{initial_split[1]}\"\n final_answer = final_answer.join\n end\n else \n final_answer = Array.new\n final_answer[0] = initial_split[2]\n final_answer[1] = \"#{(initial_split[0]/initial_split[1])}\"\n final_answer[2] = \" #{initial_split[0] % initial_split[1]}/#{initial_split[1]}\"\n final_answer = final_answer.join\n end\n p final_answer\nend",
"title": ""
},
{
"docid": "b5df9836f24f5efd8089902d4e80ca81",
"score": "0.47688884",
"text": "def up_array(arr)\n return nil if arr.length < 1\n condition = true\n arr.each { |i| condition = false if ( (i < 0) || (i > 9) || (i.class == Float) ) }\n return (arr.join.to_i + 1).to_s.chars.map {|i| i.to_i} if condition == true\nend",
"title": ""
},
{
"docid": "aefdb9828d29910ec846164731da1771",
"score": "0.47631282",
"text": "def command_type\n if arithmetic?\n \"C_ARITHMETIC\"\n else\n \"C_#{arg_0.upcase}\"\n end\n end",
"title": ""
},
{
"docid": "3a45c6f2c91b9a368dbe1824bb443c0e",
"score": "0.47598165",
"text": "def roman_numeral roman\n\tnumerals_hash = {\n\t\t\"i\" => 1, \n\t\t\"iv\"=> 4,\n\t\t\"v\" => 5, \n\t\t\"ix\"=> 9,\n\t\t\"x\" => 10, \n\t\t\"xl\" => 40,\n\t\t\"l\" => 50, \n\t\t\"xc\" => 90,\n\t\t\"c\" => 100, \n\t\t\"cd\" => 400,\n\t\t\"d\" => 500, \n\t\t\"cm\" => 900,\n\t\t\"m\" => 1000,\n\t\t}\n\tnumber_array = []\n\n\troman = roman.downcase\n\tinteger =0\n\n\tif roman == \"iv\"\n\t\tinteger = 4\n\telsif\troman.include? \"iv\" \n\t\tinteger += 4\n\t\troman = roman[0..roman.length-3]\n\t\troman_array = roman.downcase.split(//)\n\t\tstop_at = roman_array.length-2\n\t\t\n\t\troman_array.each do |numeral|\n\t\teach_num = numerals_hash[numeral]\n\t\tnumber_array.push each_num\n\t\tend\n\n\t\tstop_at = number_array.length-1\n\n\t\t(0..stop_at).each do |number|\n\t\tinteger += number_array[number]\n\t\tend\n\telsif roman == \"ix\"\n\t\tinteger = 9\n\telsif roman.include? \"ix\"\n\t\tinteger+=9\n\t\troman = roman[0..roman.length-3]\n\t\troman_array = roman.downcase.split(//)\n\t\tstop_at = roman_array.length-2\n\t\t\n\t\troman_array.each do |numeral|\n\t\teach_num = numerals_hash[numeral]\n\t\tnumber_array.push each_num\n\t\tend\n\n\t\tstop_at = number_array.length-1\n\n\t\t(0..stop_at).each do |number|\n\t\tinteger += number_array[number]\n\t\tend\n\telsif roman == \"xl\"\n\t\tinteger = 40\n\telsif roman.include? \"xl\"\n\t\tinteger+=40\n\t\troman = roman[0..roman.length-3]\n\t\troman_array = roman.downcase.split(//)\n\t\tstop_at = roman_array.length-2\n\t\t\n\t\troman_array.each do |numeral|\n\t\teach_num = numerals_hash[numeral]\n\t\tnumber_array.push each_num\n\t\tend\n\n\t\tstop_at = number_array.length-1\n\n\t\t(0..stop_at).each do |number|\n\t\tinteger += number_array[number]\n\t\tend\n\telsif roman == \"xc\"\n\t\tinteger = 90\n\telsif roman.include? \"xc\"\n\t\tinteger+=90\n\t\troman = roman[0..roman.length-3]\n\t\troman_array = roman.downcase.split(//)\n\t\tstop_at = roman_array.length-2\n\t\t\n\t\troman_array.each do |numeral|\n\t\teach_num = numerals_hash[numeral]\n\t\tnumber_array.push each_num\n\t\tend\n\n\t\tstop_at = number_array.length-1\n\n\t\t(0..stop_at).each do |number|\n\t\tinteger += number_array[number]\n\t\tend\n\telsif roman == \"cd\"\n\t\tinteger = 400\n\telsif roman.include? \"cd\"\n\t\tinteger+=400\n\t\troman = roman[0..roman.length-3]\n\t\troman_array = roman.downcase.split(//)\n\t\tstop_at = roman_array.length-2\n\t\t\n\t\troman_array.each do |numeral|\n\t\teach_num = numerals_hash[numeral]\n\t\tnumber_array.push each_num\n\t\tend\n\n\t\tstop_at = number_array.length-1\n\n\t\t(0..stop_at).each do |number|\n\t\tinteger += number_array[number]\n\t\tend\n\telsif roman == \"cm\"\n\t\tinteger = 900\n\telsif roman.include? \"cm\"\n\t\tinteger+=900\n\t\troman = roman[0..roman.length-3]\n\t\troman_array = roman.downcase.split(//)\n\t\tstop_at = roman_array.length-2\n\t\t\n\t\troman_array.each do |numeral|\n\t\teach_num = numerals_hash[numeral]\n\t\tnumber_array.push each_num\n\t\tend\n\n\t\tstop_at = number_array.length-1\n\n\t\t(0..stop_at).each do |number|\n\t\tinteger += number_array[number]\n\t\tend\n\telse\n\t\troman_array = roman.split(//)\n\t\tstop_at = roman_array.length-2\n\t\t\n\t\troman_array.each do |numeral|\n\t\teach_num = numerals_hash[numeral]\n\t\tnumber_array.push each_num\n\t\tend\n\n\t\tstop_at = number_array.length-1\n\n\t\t(0..stop_at).each do |number|\n\t\tinteger += number_array[number]\n\t\tend\n\tend\n\n\tinteger\n\n\t\n# # Replaces the numeral letters in our array with integers via our hash\n# roman_array.each do |numeral|\n# each_num = numerals_hash[numeral]\n# number_array.push each_num\n# end\n\n# # Creates a new 2d array, filled with smaller arrays representing each pair of \"letters\"\n# \tresult = []\n\n# \t(0..stop_at).each do |i|\n# \t\tresult.push number_array[i..i+1]\n# \tend\n\n=begin\n\t\n our code stops working here. We were trying to compare\n each pair of values in the original array to determine\n if the value should be added or subtracted from a running\n integer total that would total up the value of the \n numeral. \n\t\n\n \t\n \tstop_at_2 = result.length-1\n \tinteger = 0\n \t\n\n \t(0..stop_at_2).each do |i|\n \t\tif result[i][i] >= result[i][i+1]\n \t \t\tinteger += result[i][i]\n \t \telse\n \t \t\tinteger += (result[i][i+1]-result[i][i])\n \t \tend\n \tend\n \t\n integer\nend\n\n\nOur tests don't make much sense at this point. We were\nbuilding smaller problems and small tests to fix them, \nbuilding up to bigger problems with our original method of\ncomparing pairs of numbers against each other.\n\nclass TestNumerals < Minitest::Test\n\t def test_x\n\t \tassert_equal roman_numeral(\"x\"), 10\n\t end\t\n\n\t def test_array_split\n\t \tassert_equal roman_numeral(\"XI\"),[\"X\",\"I\"]\n\t end\n\n\t def test_array2\n\t \tassert_equal roman_numeral(\"XIVXIL\"), [10,1,5,10,1,50]\n\t end\n\n\t def test_integer1\n\t \tassert_equal 60, roman_numeral(\"LX\")\n\t end\n\n\t def test_pair_up\n\t\tassert_equal roman_numeral(\"LXXIV\"), [[50,10],[10,10],[10,1],[1,5]]\n\t end\nend\n=end\nend",
"title": ""
},
{
"docid": "dc9400ef7b15e6a644f2d3f720e2bba0",
"score": "0.4759549",
"text": "def arithmetic_series(number)\n number*(number+1)/2\n end",
"title": ""
},
{
"docid": "2fc78c0cd35899973bb7db7a16e59c5e",
"score": "0.47577757",
"text": "def do_math(num1, num2, operation)\n case operation\n when '+'\n num1.to_i + num2.to_i\n when '-'\n num1.to_i - num2.to_i\n when '*'\n num1.to_i * num2.to_i\n when '/'\n num1.to_f / num2.to_f\n end\nend",
"title": ""
},
{
"docid": "3b1f7fc0dd69df7fb9126eeb6fb26dfd",
"score": "0.47532418",
"text": "def part1(i)\n floor = 0\n i.each_char do |char|\n case char\n when '(' then floor += 1\n when ')' then floor -= 1\n end\n end\n floor\nend",
"title": ""
},
{
"docid": "3ac11325c8ac408ebdaa03a561aed784",
"score": "0.4743969",
"text": "def computer(english)\n operation = english.split(\" \")\n result = NUM_VALUES[operation[0]]\n n = 0\n\n operation.size.times do \n case operation[n]\n when \"plus\"\n result += NUM_VALUES[operation[n + 1]]\n when \"minus\"\n result -= NUM_VALUES[operation[n + 1]]\n end\n n += 1\n end\n\n result\nend",
"title": ""
},
{
"docid": "27f5acdd100485eb62094458e92dae9a",
"score": "0.47377688",
"text": "def display_result(num1, num2, operator)\n # say \"num1: #{num1}, num2: #{num2}, operator #{operator}\"\n case operator\n when '1'\n result = num1.to_i + num2.to_i\n say \"#{num1} + #{num2} = #{result}\"\n when '2'\n result = num1.to_i - num2.to_i\n say \"#{num1} - #{num2} = #{result}\"\n when '3'\n begin\n result = num1.to_f / num2.to_f\n say \"#{num1} / #{num2} = #{result}\"\n rescue\n say(\"Div by 0\")\n end\n else\n result = num1.to_i * num2.to_i\n say \"#{num1} * #{num2} = #{result}\"\n end\n result.to_s\nend",
"title": ""
},
{
"docid": "bc3beef6d41cc56dd0de4c2fde363e32",
"score": "0.4736951",
"text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n operation = gets.chomp.downcase\n print \"first number: \"\n a = gets.to_f\n print \"second number: \"\n b = gets.to_f\n \n case operation\n when 'a'\n puts \"#{a + b}\"\n when 's'\n puts \"#{a - b}\"\n when 'm'\n puts \"#{a * b}\"\n when 'd'\n puts \"#{a / b}\"\n else\n puts \"WRONG!!!!!\"\n basic_calc\n end\n\n gets\nend",
"title": ""
},
{
"docid": "60396d976360a20a80b14f177c291c57",
"score": "0.4731693",
"text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n g = s.length + 1\n a = (s.length + 1)**3\n c = (s.length + 1)**2\n tmp = []\n res = []\n tmp.push 0\n o = 0\n s.split('').each do |i|\n o += if i == 'T'\n 1\n elsif i == 'G'\n g\n elsif i == 'C'\n c\n else\n a\nend\n tmp.push o\n end\n (0...p.length).each do |k|\n o = tmp[q[k] + 1] - tmp[p[k]]\n if o >= a\n res.push 1\n elsif o >= c\n res.push 2\n elsif o >= g\n res.push 3\n else\n res.push 4\n end\n end\n res\nend",
"title": ""
},
{
"docid": "b69ac1abd7f535e1e2fa2a4aac0af272",
"score": "0.47239608",
"text": "def to_s\n\t\tif @b == 1 #Si el denominador es 1, solo se imprimer el numerador\n\t\t\t\"#{@a}\"\n\t\telsif @b == -1 #En el caso de que b=-1 y a>0 ó a=-1\n\t\t\tif @a>0 || @a==-1\n\t\t\t\t\"#{-@a}\"\n\t\t\telse #Si b=-1 y a es menor que cero, imprime el valor de a\n\t\t\t\t\"#{@a}\"\n\t\t\tend\n\t\telsif (@a>0 && @b>0 && @b!=1) #Caso nomal, a y b son mayores que cero, imprime a/b\n\t\t\t\"#{@a}/#{@b}\"\n\t\telsif (@a>0 && @b<0 && @b!=-1) # b es menor que cero, se le cambia el signo a todo para que se imprima: -a/b\n\t\t\t\"#{-@a}/#{-@b}\"\n\t\telsif (@a<0 && @b<0 && @b!=-1) # a y b son menor que cero, se le cambia el signo a todo para que imprima a/b\n\t\t\t\"#{-@a}/#{-@b}\"\n\t\telsif (@a<0 && @b>0 && @b!=1) # a es menor que cero, se imprime igual: -a/b\n\t\t\t\"#{@a}/#{@b}\"\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "5dd1e770766837791b1e65171f0e0d68",
"score": "0.4718442",
"text": "def get_gpa(text_array)\n resume_as_array = resume_to_array(text_array)\n gpa = nil\n resume_as_array.each_with_index do |t, i|\n if gpa == nil\n if t.include?('gpa') || t.include?('grade') || t.include?('g.p.a')\n gpa = t.match(/[0-4][.][0-9][0-9]/)\n if gpa == nil\n gpa = t.match(/[0-4][.][0-9]/)\n if gpa == nil\n gpa = resume_as_array[i + 1].match(/[0-4][.][0-9][0-9]/)\n if gpa == nil\n gpa = resume_as_array[i + 1].match(/[0-4][.][0-9]/)\n if gpa == nil\n gpa = resume_as_array[i - 1].match(/[0-4][.][0-9][0-9]/)\n if gpa == nil\n gpa = resume_as_array[i - 1].match(/[0-4][.][0-9]/)\n end\n end\n end\n end\n end\n end\n end\n end\n if gpa != nil\n gpa = gpa[0].to_f\n end\n return gpa\nend",
"title": ""
},
{
"docid": "cb4d7d86c53b4ea2adc95109125b3903",
"score": "0.47168007",
"text": "def increment_string(input)\nn = input.size\n i = n - 1\n numbers = '0'..'9'\n while i >= 0\n if !numbers.include?(input[i])\n break\n end\n i -= 1\n end\n numbers_size = input[i + 1..-1].size\n last_numbers = input[i + 1..-1].to_i + 1\n string = i == -1 ? '' : input[0..i]\n [string, \"%.#{numbers_size}d\" % last_numbers].join\nend",
"title": ""
},
{
"docid": "23e5e4870628350132ced56f672c48d5",
"score": "0.47161862",
"text": "def calculation(operant)\n\tnum1 = rand(10)\n\tnum2 = rand(10)\n\t if operant == '*'\n\t prob = \"#{num1} * #{num2}\"\n\t ans = num1 * num2\n\t correct_chk(ans,prob)\n\t elsif operant == '-'\n\t prob = \"#{num1} - #{num2}\"\n\t ans = num1 - num2\n\t correct_chk(ans,prob)\n\t else operant == '+'\n\t prob = \"#{num1} + #{num2}\"\n\t ans = num1 + num2\n\t correct_chk(ans,prob)\n\t end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "4af0a799abb402c5542ff68928a427f0",
"score": "0.0",
"text": "def pseudo_params\n params.require(:pseudo).permit(:fake_name, :real_name, :votes)\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": ""
}
] |
88a1fe55aff9801e09e8b98415f5433c | this is called once the todo is done ( called at the end of todo ) | [
{
"docid": "43ddaca2b52cf13b4c53cab41cab6cbc",
"score": "0.7033086",
"text": "def end_todo\n @todo = false\n puts ''\n puts 'finished downloading todo pages'.magenta\n puts ''\n end",
"title": ""
}
] | [
{
"docid": "cf9cede7c60aa7db180369051afe2ac1",
"score": "0.738961",
"text": "def complete(todo)\n todo.complete\n save_todos\n end",
"title": ""
},
{
"docid": "a9c4a44a58b857c852a802378f81a36a",
"score": "0.7279324",
"text": "def done!\n @todos.each_index do |idx|\n mark_done_at(idx)\n end\n end",
"title": ""
},
{
"docid": "c0b8dc0298fd59ba1ef277e3116c4480",
"score": "0.6983223",
"text": "def done\n super\n end",
"title": ""
},
{
"docid": "8ee25b38c7ed452d57f282d0c16085a9",
"score": "0.69473857",
"text": "def done\n return unless doings_to_dones\n todos_to_doings\n end",
"title": ""
},
{
"docid": "8ee25b38c7ed452d57f282d0c16085a9",
"score": "0.69473857",
"text": "def done\n return unless doings_to_dones\n todos_to_doings\n end",
"title": ""
},
{
"docid": "fe5cd210c0cb4b659fc6dc583e0351bd",
"score": "0.6814407",
"text": "def mark_as_done(todo)\n todo.mark_as_done!\n edit(todo)\n end",
"title": ""
},
{
"docid": "b2688561e94384bc136ef92f72f11b77",
"score": "0.67316407",
"text": "def done(_)\n end",
"title": ""
},
{
"docid": "5d97b009febf1af3e898bfadb32c0b34",
"score": "0.66708",
"text": "def completed_todo(host, todo, log)\n\t\tself.todos.create(:host => host, :todo => todo, :log => log, :done => true)\n\tend",
"title": ""
},
{
"docid": "041b673090c0ca2c9f1d6655059c289f",
"score": "0.66689837",
"text": "def update_todo_list_items\n todo_list.update_completed if completed && completed_changed?\n end",
"title": ""
},
{
"docid": "ad500b9dc1ba1431cdb5bb6a278f7c13",
"score": "0.66354746",
"text": "def done\n @todo =current_user.todos.find(params[:id])\n\n if @todo.destroy\n # update completed/missed items number for user and save changes to dB\n if @todo.expired?\n current_user.missed += 1\n else\n current_user.completed += 1\n end\n current_user.save\n\n flash[:notice] = \"Yay! Your item was completed!\"\n redirect_to todos_path\n else\n flash[:error] = \"Could not clear item. Please try again.\"\n redirect_to todos_path\n end\n end",
"title": ""
},
{
"docid": "65c7aa17d702074ffd343e11cb6bcb5d",
"score": "0.66334015",
"text": "def mark_done\n # TODO: This should display the todos on the current list in a menu\n # similarly to pick_todo_list. Once they select a todo, the menu choice block\n # should update the todo to be completed.\n choose do |menu|\n menu.prompt = \"Yay! You completed a task!\"\n Toodoo::Item.where(:list_id => @todos.id, :completed => false).each do |i|\n menu.choice(i.name, \"Pick the #{i.name} item.\") {i.update(:completed => true)}\n i.save\n end\n menu.choice(:back)\n end\n end",
"title": ""
},
{
"docid": "e70dd8e9d6173c6ce9aa08e3680c1c7b",
"score": "0.65934193",
"text": "def todo\n return @todo\n end",
"title": ""
},
{
"docid": "cc26c26635f108e18d193d5b17d04372",
"score": "0.6584449",
"text": "def mark_done\n # This should display the todos on the current list in a menu\n # similarly to pick_todo_list. Once they select a todo, the menu choice block\n # should update the todo to be completed.\n choose do |menu|\n menu.prompt = \"Please choose a task to mark as complete: \"\n Toodoo::TodoItem.where(:item_id => @todos.id, :finished => false).find_each do |i|\n menu.choice(i.name, \"Mark the task under the name #{i.name}.\") { \n i.finished = true\n say(\"The task under: #{i.name} is now marked as complete.\")\n i.save\n }\n end\n menu.choice(:back, \"Just kidding, back to the main menu!\") do\n say \"You got it!\"\n end\n end\n end",
"title": ""
},
{
"docid": "80fe3bafe7a3a0cb3d1f2f37a68959e0",
"score": "0.65748626",
"text": "def prepare_todo\n @todo = true\n unless @introduced\n introduce_manga\n end\n puts ''\n puts 'downloading todo pages'.magenta\n end",
"title": ""
},
{
"docid": "74c60d8c3e7b4a564b0d3aa5919fa027",
"score": "0.6548426",
"text": "def backlog\n @mutex.synchronize { @todo.length }\n end",
"title": ""
},
{
"docid": "4be9bcd22c76323c668e8e4457f37bf9",
"score": "0.65353024",
"text": "def done\n end",
"title": ""
},
{
"docid": "e08cdd579708ec19fba517dc3431cbad",
"score": "0.6510029",
"text": "def done!\n @done = true\n end",
"title": ""
},
{
"docid": "887e3627b7e57a780ff62225547ab758",
"score": "0.6486163",
"text": "def done\n @done = true\n end",
"title": ""
},
{
"docid": "4e583c7275cabb6c543149c863c7c233",
"score": "0.643851",
"text": "def done\n\n end",
"title": ""
},
{
"docid": "326898979b51c8b97e195679f89d095f",
"score": "0.6415086",
"text": "def completed_todos\n return @completed_todos if @completed_todos\n completed_todos!\n end",
"title": ""
},
{
"docid": "5e2e0ab4f934e6c19a09a32dca6d2072",
"score": "0.6409148",
"text": "def done!\n @done = true\n end",
"title": ""
},
{
"docid": "fc85eba8146eda3503685b1e8ed4594b",
"score": "0.6403025",
"text": "def backlog\n\t\t@mutex.synchronize {\n\t\t\t@todo.length\n\t\t}\n\tend",
"title": ""
},
{
"docid": "9c06d0477325cbaff62fd3b5cb22e618",
"score": "0.6372052",
"text": "def clean!\n @todos = self.list(:incomplete)\n save_todos\n end",
"title": ""
},
{
"docid": "7c15585072dd155ba41482218023dc14",
"score": "0.63695395",
"text": "def mark_all_done!\n self.each { |todo| todo.done! }\n end",
"title": ""
},
{
"docid": "6a854b4f4616ffd9874e41c6fce3c45e",
"score": "0.632852",
"text": "def complete\n @todo.update(completed:true) \n redirect_to index_path\n end",
"title": ""
},
{
"docid": "6996f8e60228bd7289c73699e2dc060e",
"score": "0.63219225",
"text": "def todo=(value)\n @todo = value\n end",
"title": ""
},
{
"docid": "a1306482e55b50a3488131a0839f252d",
"score": "0.63023007",
"text": "def done!\n # Default: do nothing ...\n end",
"title": ""
},
{
"docid": "d321e247132c752d5c0b918a75405bad",
"score": "0.6298457",
"text": "def Done\n @done\n end",
"title": ""
},
{
"docid": "4c406fa4fcad45891e0e15c784b4fbae",
"score": "0.6285639",
"text": "def todo_done\n @todo3.done!\n assert_equal(false, @todo1.done)\n assert_equal(true, @todo3.done)\n end",
"title": ""
},
{
"docid": "50937d6b37bc2e4c509108ea05ddcb41",
"score": "0.6264608",
"text": "def todos\n\t\tself.dispatch_todos\n\tend",
"title": ""
},
{
"docid": "72d34d8926b3ffb0ea4a83434ff3d7fe",
"score": "0.6245854",
"text": "def done\n @done = Time.now\n end",
"title": ""
},
{
"docid": "877fa1b62bdaf25b331c5009af24418c",
"score": "0.624521",
"text": "def backlog\n @mutex.synchronize {\n @todo.length\n }\n end",
"title": ""
},
{
"docid": "7c314550b42f14365f9ceb00c93e2a30",
"score": "0.6239797",
"text": "def done\n Tasks.done\n end",
"title": ""
},
{
"docid": "73231243c428c78f3790d428eb69785b",
"score": "0.62301797",
"text": "def done!\n # Do nothing\n end",
"title": ""
},
{
"docid": "5290fed6abb3d1aa4a92144f54fe399a",
"score": "0.6229028",
"text": "def finished\n end",
"title": ""
},
{
"docid": "ecbf4297959ff73a695ace31f9b87c69",
"score": "0.6227989",
"text": "def backlog\n with_mutex { @todo.size }\n end",
"title": ""
},
{
"docid": "860055ee7cf4d363908d0d02f28b58ef",
"score": "0.6205618",
"text": "def todo(todo=nil)\n if todo\n @todo = todo\n else\n @todo\n end\n end",
"title": ""
},
{
"docid": "40541ff6f23ae54742ce99c8ddac4161",
"score": "0.62010455",
"text": "def all_done\n completed_todos = TodoList.new(\"Completed Todo's\")\n each { |todo| completed_todos.add(todo) if todo.done? }\n completed_todos\n end",
"title": ""
},
{
"docid": "03f8104ba0c49210dec3f82c623e9f25",
"score": "0.6197638",
"text": "def done\n @done = true\n end",
"title": ""
},
{
"docid": "7128fed91fb2ebf9fb4e9e0a5ddc8529",
"score": "0.61889136",
"text": "def show_tasks_and_mark_done\n task = choose do |menu|\n menu.prompt = \"Tasks for #{@user.name}'s **#{@list.name}** ToDo List:\\nChoose Task to mark **Completed**:\"\n @list.tasks.where(done: false).find_each do |t|\n menu.choice(t.name, \"XXXXXX\") {@task = t}\n end\n menu.choice(:back, \"Just kidding, back to main menu!\") do\n say \"You got it!\"\n @task = nil\n break\n end\n end\n say(\"**#{@task.name}*** marked Done!\")\n @task.done = true\n task.save\n @task = nil\n end",
"title": ""
},
{
"docid": "b6417c09d059a072f8b0aa7f38e94849",
"score": "0.61761403",
"text": "def mark_all_done\n each {|todo| todo.done!}\n end",
"title": ""
},
{
"docid": "30553df7c28da14ad66fc5909605d76c",
"score": "0.61690295",
"text": "def completed\n end",
"title": ""
},
{
"docid": "30553df7c28da14ad66fc5909605d76c",
"score": "0.61690295",
"text": "def completed\n end",
"title": ""
},
{
"docid": "6ba03978ec041f2d9094bc729aba9f35",
"score": "0.615957",
"text": "def completed\n\n end",
"title": ""
},
{
"docid": "07b4d74dbd8e58530adc7c29006ddf84",
"score": "0.6146267",
"text": "def todo_task_completes\n todo.tasks.each do |task|\n TodoTaskComplete.create(todo_complete_id: id, todo_task_id: task.id, submitter_id: submitter_id)\n end\n end",
"title": ""
},
{
"docid": "1df65d045e0d65f9bf9b98c8cdd94356",
"score": "0.6141765",
"text": "def finish()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "e806f684239aab65146c38b186a51e5e",
"score": "0.6066131",
"text": "def finish\n #\n end",
"title": ""
},
{
"docid": "bf0480775ca65a89ddf32ded3a805611",
"score": "0.606283",
"text": "def mark_done\n \tself.done = true\n end",
"title": ""
},
{
"docid": "8303066461d431d88048c81ecfde1e54",
"score": "0.6051572",
"text": "def done!\n self.is_done = true\n self.save!\n end",
"title": ""
},
{
"docid": "d93ea344472704ae159dcad872082d64",
"score": "0.6050843",
"text": "def complete\n end",
"title": ""
},
{
"docid": "1d001d18ce0bbe28bcda733525fdfd14",
"score": "0.60448575",
"text": "def completed\n @done = true\n end",
"title": ""
},
{
"docid": "cc815534bf8c4363cc8497035a318cb8",
"score": "0.6042061",
"text": "def done!\n @done = true\n end",
"title": ""
},
{
"docid": "d557db54e52a71749409a130c88eadaa",
"score": "0.6041624",
"text": "def metodo\n #corpo do metodo\n puts 'corpo do metodo'\n end",
"title": ""
},
{
"docid": "e40f997f9fb2360a461254c1094c4303",
"score": "0.60364896",
"text": "def enter_completed; end",
"title": ""
},
{
"docid": "56d073f76701ab0cf8112b0f71a9a50d",
"score": "0.60352844",
"text": "def todos\n remaining_todos + completed_todos\n end",
"title": ""
},
{
"docid": "42f22e79a2693be8cca8cc8f6d41e141",
"score": "0.6030811",
"text": "def complete\n @todo = Todo.find(params[:todo_id])\n\n if current_user_owns_todo? @todo\n @todo.completed = true\n @todo.save\n redirect_to(:back, :notice => \"Set to complete\")\n else\n redirect_to(todos_path, :alert => \"Not a valid action!\")\n end\n end",
"title": ""
},
{
"docid": "4b6f70c918cfe2d959e5cecbca9e20b9",
"score": "0.60134387",
"text": "def test_update_todo_item_done\n @todo_list.update_done(\"Get cat food\")\n assert_equal(true, @todo_list.get_item(\"Get cat food\").done?)\n end",
"title": ""
},
{
"docid": "92be843780d9d6cafb83200962c7d052",
"score": "0.6011751",
"text": "def done!\n\t\tself.done = true\n\t\tself.save\n\tend",
"title": ""
},
{
"docid": "c648c27942d5a261f08e89b2b7974581",
"score": "0.6010525",
"text": "def done?\n @todo.empty? and @waiting == @spawned\n end",
"title": ""
},
{
"docid": "4936e008fa342cfc2282f7d71f087b51",
"score": "0.6000234",
"text": "def done?\n\t\t@todo.empty? and @waiting == @spawned\n\tend",
"title": ""
},
{
"docid": "f8210ffe0d779c80ab45a49c755551fa",
"score": "0.6000083",
"text": "def toggle_complete(todo, completed)\n todo.is_completed = completed;\n todo.save\n\n system \"clear\"\n puts \"#{todo.content} was set to #{todo.is_completed}\"\n edit_menu\nend",
"title": ""
},
{
"docid": "552950d9a2c7b24b09c0813bc66f431b",
"score": "0.5982024",
"text": "def complete\n end",
"title": ""
},
{
"docid": "552950d9a2c7b24b09c0813bc66f431b",
"score": "0.5982024",
"text": "def complete\n end",
"title": ""
},
{
"docid": "c904a365f56663d617a5b9d96e501bdf",
"score": "0.59816754",
"text": "def set_todo_item \n @todo_list.todo_items.find(:id)\n end",
"title": ""
},
{
"docid": "78a51ca1561d785c91749801173264c9",
"score": "0.5979121",
"text": "def completed?; end",
"title": ""
},
{
"docid": "78a51ca1561d785c91749801173264c9",
"score": "0.5979121",
"text": "def completed?; end",
"title": ""
},
{
"docid": "44dcca3df0ea8a445a65c971b6df3338",
"score": "0.5977128",
"text": "def complete\n @todo_list.toggle_completion\n redirect_to @note\n end",
"title": ""
},
{
"docid": "028e3ac31ae3c55d0bcf56bd8aeaf5d8",
"score": "0.597339",
"text": "def mark_as_done\n # 1. Display the tasks\n # tasks = @repository.all\n # @view.display(tasks)\n # OR\n list\n # 2. Ask the user for the index to mark as done\n index = @view.ask_for_index\n # 3. use the task method to mark as done\n # 3.1 Find our task in the repo\n # task = tasks[index]\n # OR\n task = @repository.find(index)\n # 3.2 mark it as done\n task.mark_as_done!\n end",
"title": ""
},
{
"docid": "a797f7ad496bd5fe087c9ec48f7f5f51",
"score": "0.5971745",
"text": "def index\n self.new_todo_label = ''\n end",
"title": ""
},
{
"docid": "0e8fc5beb32eb1a3a3998246c77c3b2c",
"score": "0.59663266",
"text": "def delete_completed\n todo_item_list = item_type_list(\"todo\")\n todo_item_list.each_with_index { |item, item_no| delete_index(item_no) if item.status == true}\n end",
"title": ""
},
{
"docid": "8f8a81f63cde7ededad68693ed0c1943",
"score": "0.5963269",
"text": "def done\n @completed_status = true\n end",
"title": ""
},
{
"docid": "631a47f576d54ec31dd02a322df33c4e",
"score": "0.59627086",
"text": "def revert(task_name)\n return if when_done_no_todos?\n if nil_or_empty? task_name\n puts \"please input task name in done list.\"\n return\n end\n task = find_tasks(task_name)\n return if when_choose_no_task?(task, task_name)\n return unless when_choose_type_is_done?(task, task_name)\n remove task_name\n File.open(TUDU_TODOS_FILE_PATH, 'w:UTF-8') { |f|f.puts task_name }\n puts \"complete revert '#{task_name} to todos'\"\n end",
"title": ""
},
{
"docid": "f165c76a2fb7720fc64cdb633a2cb321",
"score": "0.5946487",
"text": "def printDone\n doneList = \"\"\n @toDoListArray.each do |e|\n if e.status\n doneList = doneList + e.printItem + \" \"\n end\n end\n doneList.rstrip\n end",
"title": ""
},
{
"docid": "0e671a218f35b719641f231b78ab4939",
"score": "0.5944016",
"text": "def show_done\n\t\t\t@list.display_done\n\t\tend",
"title": ""
},
{
"docid": "ea331f17281e3c9a926949246faba12a",
"score": "0.59426075",
"text": "def mark_complete(name)\n if index = find_index(name)\n item = todo_items[index]\n item.mark_complete!\n puts \"Marking #{item.name} as complete...\"\n else\n puts \"Could not find #{name} task.\"\n end\n end",
"title": ""
},
{
"docid": "e0cba64ba5b532b10d0a9be545bf31d0",
"score": "0.58967865",
"text": "def mark_as_done_at_remote(project)\n @client.project_tasks(project.permalink).each do |task|\n things_todo = Things::Todo.find(task.name)\n \n #TODO: clean it up\n if !things_todo.nil? && things_todo.completed? && is_task_open?(task.status) &&\n !Things::App.lists.trash.reference.todos.name.get.include?(things_todo.name)\n # API isn't great right now, so we update task as resolved \n # and add the new comment to it\n @client.update_project_task(project.permalink, task.id, {:status => 3})\n @client.create_project_task_comment(project.permalink, task.id,\n {:status => 3,\n :body => \"Sent from my Things.app\"})\n log \"#{task.name} at remote set as done\"\n end\n end\n end",
"title": ""
},
{
"docid": "4cb772abb3ed948d58dc12ad6d3fad4c",
"score": "0.5892056",
"text": "def task_done\n self.update(:is_done => true, :done_date => Time.zone.now)\n end",
"title": ""
},
{
"docid": "10be6e4f6362cf36b08fd7527eb6b437",
"score": "0.5886013",
"text": "def complete\n @completed = true\n end",
"title": ""
},
{
"docid": "df74a9b8d064d503b4a55452f43327cd",
"score": "0.5880471",
"text": "def mark_all_done\n all_not_done.each { |todo| todo.done! } # should just iterate with each else new list is returned\n end",
"title": ""
},
{
"docid": "28706313ec0c07ff6f540cd837e0ada4",
"score": "0.58793485",
"text": "def display_done\n\t\tputs \"welldone my boss, here is the items completed:\".colorize(:blue) \n\t\t@items.each do |item|\n\t\t\tif item.done?\n\t\t\t\tputs \"- [X] #{item.name}\".colorize(:green) \n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b2960a2c28fb31f570ad09e14fc564d5",
"score": "0.5875596",
"text": "def done!\n self.done = true\n end",
"title": ""
},
{
"docid": "cacde804f321523cb7452ead5caf27a6",
"score": "0.5870926",
"text": "def todo\n flunk \"test not written\"\n end",
"title": ""
},
{
"docid": "ac86b19b4fb3e7f2d43148d73dd7a5d6",
"score": "0.5858087",
"text": "def done(note=\"\")\n @done_date = Time.now.strftime(\"%Y-%m-%d - %H:%M:%S\")\n if note\n options[:note] = \"#{@done_date}\\n#{note}\\n#{@options[:note]}\"\n end\n Syctask::log_task(\"done\", self)\n end",
"title": ""
},
{
"docid": "a4fd8c99a3fdec3b5f891eb5ed3c4de7",
"score": "0.5853538",
"text": "def complete\n @todo_item = @todo_list.todo_items.find(params[:todo_item_id])\n @todo_item.update_attributes(:is_completed => true)\n if @todo_item.save\n flash[:success] = \"Todo list item completed.\"\n else\n flash[:error] = \"Todo list item could not be marked complete.\"\n end\n redirect_to @todo_list\n end",
"title": ""
},
{
"docid": "4c7e87ee470bef2f9b31184482c61681",
"score": "0.58511907",
"text": "def mark_done\n choose do |menu|\n menu.prompt = \"Please select a choice:\"\n Toodoo::Task.where(:todo_id => todo.id, :finished => false) do |y|\n menu.choice(y.task, \"Task Completed\") {y.update(:finished => true)}\n x.save\n end\n menu.choice(:back)\n end\n end",
"title": ""
},
{
"docid": "81e0b8a849fb65de420f751b80ed7ce1",
"score": "0.5846987",
"text": "def done\n @items.keep_if {|item| item.status == true}\n end",
"title": ""
},
{
"docid": "72ad2056ca5f04d3c95a4b2956280d05",
"score": "0.58456814",
"text": "def mark_complete\n\n end",
"title": ""
},
{
"docid": "b104e3451d9613af1e553dfcc6d146c6",
"score": "0.5845249",
"text": "def complete\n self.class.complete(self) unless complete?\n @task_details['in_history'] = 1\n end",
"title": ""
},
{
"docid": "6bffcca3ed99f407c3cd43b2f990ad94",
"score": "0.58329463",
"text": "def display_todos\n return if todos.empty?\n\n log \"\\n+---------+\", :message\n log \"| 📝 TODO |\", :message\n log \"+---------+\\n\", :message\n puts \"\\nWe did most of the work for you, but there are still some things left for you to do.\"\n todos.each_with_index do |todo, i|\n title = \"\\n#{i + 1}. #{todo[0]}\"\n log title, :message\n puts \"=\" * title.length\n puts \"\"\n log todo[1], :message\n end\n puts \"\"\n puts \"============================================================\"\n puts \"= ✨ Please take a minute and read the notes from above ✨ =\"\n puts \"============================================================\"\n puts \"\"\n end",
"title": ""
},
{
"docid": "93c4fbfe3448f05b104e2e327d20c8ea",
"score": "0.5827597",
"text": "def destroy\n @todo.destroy\n end",
"title": ""
},
{
"docid": "696690b83b9573c9d3c9249c426c908a",
"score": "0.5826058",
"text": "def reset_completed\n end",
"title": ""
},
{
"docid": "5c11eb696bca4f9805640eb690d3a6c6",
"score": "0.5823441",
"text": "def done\nend",
"title": ""
},
{
"docid": "09c85d2833ff6170be618d0a8bf06c1e",
"score": "0.58227867",
"text": "def completed_task task_no \n @complete = Task.new(\" \")\n @complete.description = (@all_tasks[task_no].description + \" --Complete!\")\n @complete.description.sub!(\"\\n\", \" \")\n @all_tasks.replace_with(@all_tasks[task_no], task_no, @complete) \nend",
"title": ""
},
{
"docid": "4c3e142bd7ca78635eda8413f9fc37d7",
"score": "0.5822087",
"text": "def done\n FilterableList.new(tasks.clone.keep_if do |t|\n t.done == true\n end)\n end",
"title": ""
},
{
"docid": "c55e02f1c61e311e4734927f86781f03",
"score": "0.5821691",
"text": "def todo(test, exception)\n end",
"title": ""
},
{
"docid": "cc946830a48735903e524370e6289ba0",
"score": "0.58134127",
"text": "def todo\n @todo = response[\"todo\"]\n @todo[\"groups\"].each {|group| group[\"items\"].map!{|item| Foursquared::Response::User.new(client, item)}} if @todo and @todo[\"groups\"]\n end",
"title": ""
},
{
"docid": "61e594e9a61f84d90eff76e49f3e6eb2",
"score": "0.5807149",
"text": "def finished\n\tend",
"title": ""
},
{
"docid": "8899e3b2b8a49d99a8926922cfdea821",
"score": "0.57996845",
"text": "def complete\n @completed = true\n \"Item #{@id} marked completed (#{@text})\"\n end",
"title": ""
},
{
"docid": "41e4f23134b291fb9ad67fa5da38a62a",
"score": "0.57835495",
"text": "def set_todo\n @to_do = ToDo.find(params[:id])\n end",
"title": ""
},
{
"docid": "de921623b48ce7d5a1763397b86dba59",
"score": "0.57721114",
"text": "def done?\n \t @done\n\t end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "7b4ac461112075df84416413d0ea8acb",
"score": "0.0",
"text": "def set_brokerage\n @brokerage = Brokerage.find_by!(slug: 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": ""
}
] |
0210a5c85e3b72db5ab626523897629d | => [0, 1, 2, 3, 4, 5] Write a method even_nums(max) that takes in a number max and returns an array containing all even numbers from 0 to max | [
{
"docid": "80d344be954999e93cdc54eedf9aa809",
"score": "0.90669405",
"text": "def even_nums(max)\n result = []\n\tfor i in 0..max\n \tif i % 2 == 0 \n result << i\n end\n end\n return result\nend",
"title": ""
}
] | [
{
"docid": "49d66a9a271a8c04cb377999b1819423",
"score": "0.898293",
"text": "def even_nums(max)\n\tnums = []\n \n\ti = 0\n\twhile i <= max\n\t\tif i % 2 == 0\n\t\t\tnums << i\n\t\tend\n\t\ti += 1\n end\n \n\treturn nums\nend",
"title": ""
},
{
"docid": "bd18d3b5508990a6759bad678119f8fd",
"score": "0.8922356",
"text": "def even_nums(max)\n newArr = []\n i = 0\n while i <= max\n if i % 2 == 0\n newArr << i\n end\n i+=1\n end\n return newArr\n end",
"title": ""
},
{
"docid": "7aa1e68b4acda23feb679240a8a19645",
"score": "0.8877437",
"text": "def even_nums(max)\n i = 0\n evens = []\n while i <= max\n\tif i % 2 == 0\n evens << i\n end\n i += 1\n end\n return evens\nend",
"title": ""
},
{
"docid": "dc2eef1bc6590ccaf66b071714412abb",
"score": "0.8869091",
"text": "def even_nums(max)\n even_array = []\n \n i = 0\n while i <= max\n if i % 2 == 0\n even_array << i\n end\n \n i +=1\n end\n \n return even_array\nend",
"title": ""
},
{
"docid": "8d103ee698866a9a0f99c3e1e076ba3b",
"score": "0.8843788",
"text": "def even_nums(max)\n even_arr = []\n i = 0\n\n while i <= max\n if i % 2 == 0\n even_arr << i\n end\n i += 1\n end\n return even_arr\nend",
"title": ""
},
{
"docid": "f6a1f6b0926e4bb3c4c4149c613cd555",
"score": "0.87982416",
"text": "def even_nums(max)\n evens = []\n \n i = 0\n while i <= max\n if i % 2 == 0\n evens << i\n end\n \n i += 1\n end\n \n return evens\nend",
"title": ""
},
{
"docid": "633f0e95059a6b1d9d98d910c7fd6113",
"score": "0.8775659",
"text": "def even_nums(max)\n \n i = 0\n \n even = []\n \n while i <= max\n \n if i % 2 == 0\n even << i\n end\n \n i += 1\n \n end\n \n return even\n\nend",
"title": ""
},
{
"docid": "bd84d76d28dbdb9331937a63f993f2ff",
"score": "0.8520126",
"text": "def even_nums(max)\n\tnew_arry = []\n \tcount = 0\n while count <= max\n new_arry << count\n count += 2\n\n end\n return new_arry\nend",
"title": ""
},
{
"docid": "48c8ddfc057459a92abb52c5e34a8ef8",
"score": "0.8483905",
"text": "def even_nums(max) # max is some int\n new_arr = [] # initialize new array\n i = 0 # indice counter @ 0\n\n while i <= max # while i is less than or equal to the given int\n if i % 2 == 0 # if i is not divisible by 0\n new_arr << i # add the number into the new array\n end\n\n i += 1\n end\n return new_arr\nend",
"title": ""
},
{
"docid": "dc41c1fa629e92dcc2f57bc8c11333e1",
"score": "0.8481901",
"text": "def even_nums(max)\n print (0..max).step(2).to_a\nend",
"title": ""
},
{
"docid": "5e80ad3371c4de7b5f9a06fffcc43e8a",
"score": "0.82940036",
"text": "def even_nums(max)\n new_arr = []\n i = 0\n while i <= max\n #if the number is even, then add to the array\n if i % 2 == 0\n new_arr << i\n end\n i += 1\n end\n print new_arr\nend",
"title": ""
},
{
"docid": "674da7eeab99c413afe4689ace182edb",
"score": "0.7843022",
"text": "def even_numbers_less_than num\n even_array = []\n for number in 0...num\n if number % 2 == 0\n even_array.push(number)\n end\n end\n return even_array\nend",
"title": ""
},
{
"docid": "285588999678fd9907b0a183b921f19b",
"score": "0.7834552",
"text": "def even_numbers_less_than num\n # i = 0\n # even_numbers = []\n # while i < num\n # even_numbers.push i\n # i += 2\n # end\n # return even_numbers\n\n array = []\n (0...num).each do |i|\n if i%2 == 0\n array.push i\n end\n end\n return array\nend",
"title": ""
},
{
"docid": "d1f44b9c2903aa754f6b3f8ccd8416bc",
"score": "0.7819242",
"text": "def even_numbers_less_than num\n array_for_even_numbers = []\n for i in 0...num\n if i % 2 == 0\n array_for_even_numbers.push(i)\n end\n end\n return array_for_even_numbers\n\nend",
"title": ""
},
{
"docid": "d523f12fc331fb3a7a61ef5765e94eef",
"score": "0.77006257",
"text": "def even_numbers_less_than num\n # set up empty array to place all even numbers\n array = []\n for i in 0...num\n # if even add that value to the array\n if(i % 2 == 0)\n array.push(i)\n end\n end\n return array\nend",
"title": ""
},
{
"docid": "87997193523ea0bfaebde60a87e59f43",
"score": "0.76632875",
"text": "def get_even_numbers_from_array(numbers)\n even_numbers = []\n\n for number in numbers\n\n if number.even? == true\n even_numbers << number\n end\n \n end\n\n return even_numbers\nend",
"title": ""
},
{
"docid": "8f5f9c8dd58c138fcca949d7e5c39baf",
"score": "0.7618263",
"text": "def even_numbers_less_than num\n array = []\n for i in 0...num\n if i % 2 == 0\n array.push(i)\n end\n end\n array\nend",
"title": ""
},
{
"docid": "64b54c9a22d841396f1b52a579d1c8f4",
"score": "0.7555351",
"text": "def even_numbers_less_than num\n even_numbers_array = []\n i=0\nwhile i<num do\n even_numbers_array.push(i)\n i+=2\nend\n return even_numbers_array\nend",
"title": ""
},
{
"docid": "a2b61e4e489ff6c66ff43f68f819f3f0",
"score": "0.74703306",
"text": "def evil_even_numbers(array_of_numbers)\n result = []\n for number in array_of_numbers\n result.push(number) if(number % 2 == 0)\n end\n \n return result \nend",
"title": ""
},
{
"docid": "f534c1dcff8310af9ec2588130ec66e4",
"score": "0.7427411",
"text": "def odd_range(min, max)\n new_arr = []\n i = min\n while i <= max\n if i % 2 != 0\n new_arr << i\n end\n i += 1\n end\n return new_arr\nend",
"title": ""
},
{
"docid": "7cff59ef2342932088e92f4a09898ec2",
"score": "0.7410777",
"text": "def odd_range(min, max)\n\tarr = []\n \tfor i in min..max\n if i % 2 != 0 \n arr << i\n end\n end\n return arr\n \nend",
"title": ""
},
{
"docid": "a17ee0ca47b9a42f0deb97577433edad",
"score": "0.73855895",
"text": "def get_evens(arr)\n even_array = []\n arr.each{|int| even_array.push(int) if int % 2 == 0}\n even_array\nend",
"title": ""
},
{
"docid": "2ec97f463df29fbca96ad8f6907d9f51",
"score": "0.73774487",
"text": "def odd_range(min, max)\n new_array = []\n i = min\n\n while i <= max\n if i % 2 != 0\n new_array << i\n end\n i += 1\n end\n\n return new_array\nend",
"title": ""
},
{
"docid": "bc4fe358292869b29e6e3f1637e44092",
"score": "0.7366754",
"text": "def even_numbers(lottery_n)\n even_nums = []\n for num in lottery_n\n even_nums.push(num) if num%2 == 0\n end\n return even_nums\nend",
"title": ""
},
{
"docid": "76fa476d9ea21857664e6d0da300b3ab",
"score": "0.73259187",
"text": "def odd_range(min, max)\n\tarry = []\n \ti = min\n while i <= max\n if i % 2 == 0\n else\n arry << i\n end\n i += 1\n end\n return arry\nend",
"title": ""
},
{
"docid": "68193ce0488dd867e762d5b72a47fbb7",
"score": "0.73111564",
"text": "def even_numbers(array)\n array.select{ |num| num.even? }\n\n # TODO: Return the even numbers from a list of integers.\n # You should use Enumerable#select\nend",
"title": ""
},
{
"docid": "9f48b57c93bff697e3271169e59b3985",
"score": "0.7310165",
"text": "def odd_range(min, max)\n odd_array = []\n\n i = min\n while i <= max\n if !(i % 2 == 0)\n odd_array << i\n end\n i += 1\n end\n return odd_array\nend",
"title": ""
},
{
"docid": "3add79ca0370b6e72440d5750b7b9de4",
"score": "0.72824043",
"text": "def even_numbers(num_array)\n\tnum_array.select! { |num| num.even? }\nend",
"title": ""
},
{
"docid": "4f748db49274f85abb81459309c0bb8e",
"score": "0.7263633",
"text": "def even_numbers(num_array)\n\n\tnum_array.select! do |num|\n\t\tnum % 2 == 0\n\tend\n\n\tnum_array\n\nend",
"title": ""
},
{
"docid": "f7fb1665ef414629873556670c822ffc",
"score": "0.7256595",
"text": "def odd_range(min, max)\n newArr = []\n i = min\n while i <= max\n if i % 2 != 0\n newArr << i\n end\n i += 1\n end\n return newArr\n end",
"title": ""
},
{
"docid": "c489aed1dbf222c82c6559f9a0f8c74d",
"score": "0.7239332",
"text": "def even_numbers_less_than(num)\n array = (0...num).to_a\n array.select { |x| x if x.even? }\nend",
"title": ""
},
{
"docid": "ff8e4afa8f052f26fbe6ff494e56fc7d",
"score": "0.7225448",
"text": "def even_numbers_less_than num\n\tnumber_array = []\n\t(0...num).each do |number|\n\t\tnumber.even?\n\tend\nend",
"title": ""
},
{
"docid": "f5da4e0ba069d70d6c70046def030066",
"score": "0.7221792",
"text": "def odd_range(min, max) # Define method with 2 params\n \n i = min # since we are being to ask to start with first param we set i to start at min; the first param\n new_array = [] # Create an empty array to shovel values into\n \n while i <= max # Sets condition\n \n if i % 2 != 0 # If statement that uses an expression to determine if number is NOT an even number, odd numbers will always equal 1, but you can also put not equal to 0. Logical expression\n new_array << i # Shovel not even number value screened by above condition into array\n end # End of if loop\n \n i += 1 # Increments each iteration by one\n end # End of method\n return new_array # Returns array values after end of method\n\nend",
"title": ""
},
{
"docid": "f2af040e41b1795ad1d2d5fa0041f4ce",
"score": "0.72098583",
"text": "def evenNumbers(n)\n arr = Array.new\n i = 1\n\n while arr.length < n\n i = i + 1\n if i % 2 == 0\n arr << i\n end\n end\n\n puts \"#{arr.length} and #{arr}\"\nend",
"title": ""
},
{
"docid": "55b8725cc181e4a19b2a97fb92579587",
"score": "0.71994585",
"text": "def odd_range(min, max)\n odd_numbers = []\n \n i = min\n while i <= max\n if i % 2 == 1\n odd_numbers << i\n end\n \n i += 1\n end\n \n return odd_numbers\nend",
"title": ""
},
{
"docid": "a378806b1f9931e1ced629b496929fc4",
"score": "0.7197361",
"text": "def even_index_nums(array)\n counter = 0\n even_index_array = []\n \n loop do\n break if counter == array.length\n \n current_element = array[counter]\n \n if counter % 2 == 0\n even_index_array << current_element\n end\n \n counter += 1\n end \n even_index_array\nend",
"title": ""
},
{
"docid": "617bd6f86052d69c1f4a7c67ecc3399f",
"score": "0.7190887",
"text": "def even_int(integers)\n\teven_num = []\n\tfor i in 0..integers.length()-1\n\t\tif integers[i].even?\n\t\t\teven_num << integers[i]\n\t\telse \n\t\t\tnext\n\t\tend\n\tend\n\treturn even_num\nend",
"title": ""
},
{
"docid": "ce70612f368b0b8a29ccaf73aed6ecd5",
"score": "0.712852",
"text": "def get_even_fib(max_num)\n\tnum1 = 1\n\tnum2 = 2\n\tcurrent_num = num2\n\teven_fib = []\n\twhile(num2 < max_num)\n\t\tif (num2 % 2 == 0)\n\t\t\teven_fib.push num2\n\t\tend\n\t\tcurrent_num = num2\n\t\tnum2 = num1 + num2\n\t\tnum1 = current_num\n\tend\n\teven_fib\nend",
"title": ""
},
{
"docid": "83d341c297b704612618569cac29eabb",
"score": "0.71116674",
"text": "def odd_range(min, max)\n\trange = []\n \n\ti = min\n\twhile i <= max\n\t\tif i % 2 != 0\n\t\t\trange << i\n\t\tend\n \ti += 1\n end\n\n\treturn range\nend",
"title": ""
},
{
"docid": "02d28118228a406cb378a83b7b9ffe01",
"score": "0.7093173",
"text": "def even_numbers_less_than num\n array=[]\n i = 0\n begin\n if (i % 2 == 0)\n array.push (i)\n end\n i+=1\n end while ( i < num)\n array\nend",
"title": ""
},
{
"docid": "4bd20b8322ae45d031fe9bfb99dc6b65",
"score": "0.7082959",
"text": "def even_numbers_less_than num\n\t# array_of_nums = []\n\t# i = 0\n\t# while i < num\n\t# \tarray_of_nums.push(i)\n\t# \t# array_of_nums.delete_if &:odd?\n\t# \ti += 2\n\t# end\n\t# array_of_nums\n\t(0...num).select { |numbers| numbers.even? }\nend",
"title": ""
},
{
"docid": "60ddf30091a85e8c037a1bceeb53fb05",
"score": "0.7063528",
"text": "def odd_range(min, max)\n newArr = []\n\n while min <= max\n newArr << min if min % 2 == 1\n min += 1\n end\n return newArr\nend",
"title": ""
},
{
"docid": "f40691a8f868415def18841ce7237ff1",
"score": "0.7029057",
"text": "def odd_range(min, max)\n\trange = []\n \ti = min \n \t\n \twhile i <= max\n if i % 2 != 0\n range << i\n end\n \n i += 1 \n end\n\treturn range\nend",
"title": ""
},
{
"docid": "887f4396a45b65cfb6cf9a507e4025fb",
"score": "0.7002909",
"text": "def odd_range(min, max)\n odds = []\n index = min \n \n while index <= max\n if index % 2 == 1 \n odds << index \n end \n index += 1 \n end \n \n return odds \n \nend",
"title": ""
},
{
"docid": "f41085610e14724005f43452f1efcbbc",
"score": "0.69608706",
"text": "def primes(max)\n array = []\n i = 2\n while i < max.abs\n if is_prime?(i)\n array << i\n end\n i += 1\n end\n array\nend",
"title": ""
},
{
"docid": "b49c2015ac7fe77c56f4cffec237693e",
"score": "0.6921234",
"text": "def even_index_nums(array)\n even_index_array = []\n \n array.each_with_index do |element, index|\n if index.even?\n even_index_array << element\n end\n end\n even_index_array\nend",
"title": ""
},
{
"docid": "5a0319d3d9d0e86d7780fa7b9051e565",
"score": "0.68933946",
"text": "def crazy_nums(max)\n nums = [] # store result\n i = 0\n count = 0\n \n while i < max\n if(i % 3 == 0) && (i % 5 == 0)\n \n elsif (i % 3 == 0) || (i % 5 == 0)\n nums[count] = i\n count = count + 1\n end\n i = i + 1\n end\n return nums \nend",
"title": ""
},
{
"docid": "200991c4b492a9e456822f2f5a15600c",
"score": "0.6892037",
"text": "def even_numbers_less_than num\n\na =\t[]\n# for i in 0..num do \n# \t\tif i % 2 == 0 then\n# \t\t\treturn a.insert(i)\n# \t\tend \n# \tend \n# \treturn a;\n\nfor i in 0...num do \n\tif i.even?\n\t\ta.push(i)\n\tend\n\tend \n\treturn a\nend",
"title": ""
},
{
"docid": "b18635ef1aa4cbe84a4b59588929f68f",
"score": "0.68754524",
"text": "def odd_array(numbers)\n odd_value = []\n \n numbers.each_with_index do |value, idx|\n odd_value << value if idx.even?\n end\n odd_value\nend",
"title": ""
},
{
"docid": "1ce5b7ca36330c94db2b7d1311f040c0",
"score": "0.68636084",
"text": "def odd_range(min, max)\n odds = []\n i = min\n while i <= max\n if i % 2 == 1\n odds << i\n end\n i += 1\n end\n return odds\n end",
"title": ""
},
{
"docid": "e94d69c8c74c42fe29eeb723b63af3de",
"score": "0.68565315",
"text": "def evenities1(array)\n index = 1\n even_array = []\n while index < array.length\n even_array << array[index]\n index += 2\n end\n even_array\nend",
"title": ""
},
{
"docid": "8182ce912f2781e3e2a3aff1d9fa2056",
"score": "0.6841486",
"text": "def find_evens(numbers)\n even = []\n numbers.each do |number|\n even.push number if number.even?\n end\n even\nend",
"title": ""
},
{
"docid": "b0cc4e281fb3ab41cd65f04ca236e488",
"score": "0.6806445",
"text": "def even_numbers_less_than num\n\t(0...num).reduce [] do |evens, number|\n\n\t\tif number%2 == 0\n\t\t\tevens.push number\n\t\tend\n\n\t\tevens\n\tend\nend",
"title": ""
},
{
"docid": "d4283517f808b54c7dc9d3fdb9b7babf",
"score": "0.68013096",
"text": "def even_valued_number(x)\n fib_array = [0,1]\n x.times do\n fib_array << fib_array[-1] + fib_array[-2]\n end\n fib_array.find_all{ |number| number % 2 == 0}.reduce(:+)\nend",
"title": ""
},
{
"docid": "34f109e5e283363edfd6f5cd9bdd7d2d",
"score": "0.67856294",
"text": "def evens(arr)\n even_indices = []\n index = 1\n\n while index < arr.length\n even_indices << arr[index]\n index += 2\n end\n even_indices\nend",
"title": ""
},
{
"docid": "f62e18f4c590b1cb716fc27dbde8a937",
"score": "0.6691282",
"text": "def evens(array)\n index = 1\n even_array = []\n while index < array.size\n even_array << array[index]\n index += 2\n end\n p even_array\nend",
"title": ""
},
{
"docid": "7a22e0ac6363b95390720d013331c5c2",
"score": "0.6671783",
"text": "def select_even_nums(arr)\n arr.select(&:even?)\nend",
"title": ""
},
{
"docid": "e9faf62543b8dce3893390e485f80225",
"score": "0.664277",
"text": "def even_numbers_less_than num\n\t(0...num).select do |number|\n\t\tnumber.even?\n\tend\nend",
"title": ""
},
{
"docid": "7dc1b3b97effd386ad8ce312c1e2a2b6",
"score": "0.6631526",
"text": "def evenlists(array)\n even = []\n j = 0\n while array.count >= j \n even << array[j]\n j +=2\n end \n p even\nend",
"title": ""
},
{
"docid": "e624f2a0d9c9b9316bd00acf72437351",
"score": "0.66271555",
"text": "def evens_below(integer)\n integer = integer - 1\n array = []\n integer.downto(0) do |i|\n if i % 2 == 0\n array << i\n end\n end \n p array\nend",
"title": ""
},
{
"docid": "55f20f3fcdd4735738527dd271d6e0e4",
"score": "0.6595807",
"text": "def odd_numbers(array)\n end",
"title": ""
},
{
"docid": "7c939e2a0b030997944f18766d72caf3",
"score": "0.6593396",
"text": "def select_evens(array)\n output_array = []\n\n array.each do |number|\n if number % 2 == 0\n output_array << number\n end\n end\n\n return output_array\nend",
"title": ""
},
{
"docid": "42ed90353cb0778fb348c09de215e8d1",
"score": "0.6586382",
"text": "def even_fibonacci_array\n @even_array = []\n @fibon_array.each do |i|\n if i % 2 == 0\n @even_array.push i\n else\n end\n end\n @even_array\n end",
"title": ""
},
{
"docid": "7d70e4aeccacb0dc04deaa87d0031375",
"score": "0.65796554",
"text": "def even_num_array(numbers)\n puts \"The original array is #{numbers}\"\n\tnumbers = numbers.select {|n| n.even? } \n\tputs \"The modified array is #{numbers}\"\nend",
"title": ""
},
{
"docid": "d2dcdc7625ba976e3950f1e539033cb9",
"score": "0.65685594",
"text": "def select_every_even arr\n ans = []\n arr.each_with_index do |item, i|\n if i%2 == 0 \n ans.push item\n end\n end\n ans\nend",
"title": ""
},
{
"docid": "e902f28aa4e3cc717119fae05082fe6e",
"score": "0.65595347",
"text": "def odd_num\n y = []\n [*1..255].map do |i| \n if i % 2 != 0\n y << i\n end\n end\n y\nend",
"title": ""
},
{
"docid": "c19238dae2c486a6eee1b6f6f4eb2f41",
"score": "0.6555121",
"text": "def only_even(arr)\n\tnumsOnly = arr.select { |num| num.is_a? Integer } \n\toddOnly = numsOnly.select { |num| num % 2 != 0 }\n\treturn oddOnly.sort()\nend",
"title": ""
},
{
"docid": "cfc01e6b96c877d9892140b6e98a4697",
"score": "0.65545285",
"text": "def odd_integers(array)\nend",
"title": ""
},
{
"docid": "7d7d4fe94bdde24eb79cf290984c8d27",
"score": "0.6525263",
"text": "def odd_range(min, max)\n (min..max).select{|num| !(num.even?) }\nend",
"title": ""
},
{
"docid": "bb7fbc0274b2f7240dad1e171a58c649",
"score": "0.6525183",
"text": "def find_even(array)\nend",
"title": ""
},
{
"docid": "b2129572bc9e749be0c7fcdcba2e1a72",
"score": "0.6513398",
"text": "def first_even(array_of_numbers)\n even_number_array = []\n array_of_numbers.each do |num| \n if num % 2 == 0\n even_number_array << num\n end\n end\n even_number_array[0]\nend",
"title": ""
},
{
"docid": "724fe4e6298d0bd7a614be3b2be88d92",
"score": "0.65112805",
"text": "def oddities(arr)\n counter = 0\n return_array = []\n loop do\n return_array << arr[counter]\n counter += 2\n break if counter >= arr.size\n end\n return_array.compact\nend",
"title": ""
},
{
"docid": "771e70a5ff4bce4e76254f861019f98a",
"score": "0.6509176",
"text": "def select_even_numbers(array)\n array.select{|x| x % 2 == 0}\nend",
"title": ""
},
{
"docid": "01ea520a18c740842ec2ee7b0b7d4fe8",
"score": "0.650258",
"text": "def oddities2(arr)\n index = 0\n result = []\n loop do\n break if index >= arr.size\n result << arr[index]\n index += 2\n end\n result\nend",
"title": ""
},
{
"docid": "248a4fcbf99972717c1a1976acf8df37",
"score": "0.6502194",
"text": "def loopy_range(max, step)\n numbers =[]\n for nums in (0..max)\n numbers.push(nums)\n end\n puts \"The end array is #{numbers}\"\nend",
"title": ""
},
{
"docid": "d2e78652b2c2b73c0cd97c9275f2de15",
"score": "0.6501492",
"text": "def oddities(int_array)\n index = 0\n odds = []\n\n while index < int_array.size\n odds.push(int_array[index])\n index += 2\n end\n odds\nend",
"title": ""
},
{
"docid": "a8574c98aa746c0d00b5b25669f417ce",
"score": "0.64835674",
"text": "def evens(arr)\n counter = 1\n even_places = []\n while counter < arr.size\n even_places << arr[counter]\n counter += 2\n end\n even_places\nend",
"title": ""
},
{
"docid": "457b4916622bbf8051c7b9fbb80619a3",
"score": "0.64721406",
"text": "def oddArray\n\tarr=[]\n\tarr.push((1..255).find_all{|x| x % 2 != 0})\n\tputs arr\nend",
"title": ""
},
{
"docid": "4f188ae59094064fc866c8771a2ccf1e",
"score": "0.64669824",
"text": "def square_nums(max)\n idx = max / 2\n while idx * idx > max\n idx -= 1\n end\n return idx\nend",
"title": ""
},
{
"docid": "91c8f124e5ac02ce714f9333ffce9d33",
"score": "0.64619315",
"text": "def sum(max)\n new_term = 0\n sequence = [1, 2]\n while new_term < max\n new_term = sequence[-1] + sequence[-2]\n sequence << new_term\n end\n sequence.pop\n p sequence\n p sequence.select(&:even?).sum\nend",
"title": ""
},
{
"docid": "c95129ce7885b60a9456076302da30f4",
"score": "0.6453043",
"text": "def get_evens(array)\n\t\n\tevens = array.select { |num| num.even? }\n\t\nend",
"title": ""
},
{
"docid": "c90c0d71f8ab253372416d0fde670276",
"score": "0.64520466",
"text": "def get_squares(first_number, last_number)\n n = (first_number..last_number).to_a\n squares = []\n n.each do |i|\n if i % 2 == 0\n squares << i\n end\n end\n return squares\nend",
"title": ""
},
{
"docid": "80314a18d6d5b1520ae168b236879c8a",
"score": "0.6390702",
"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": "0bb7178140c43d12d6f3885d5e29180f",
"score": "0.6382332",
"text": "def even_numbers(array)\n\n unless array.is_a?(Array)\n # would be raise Argument error exception anyway, just for illustrate\n raise ArgumentError\n end\n\n if array.length == 0\n raise StandardError.new(\"Too few elements\")\n end\n\n array.find_all { |el| el.to_i % 2 == 0 }\n\nend",
"title": ""
},
{
"docid": "10df6ba949202b95b8cfbf3f1521f744",
"score": "0.6376138",
"text": "def eveness(array)\n new_array = []\n index = 1\n while index < array.size\n new_array << array[index]\n index += 2\n end\n new_array\nend",
"title": ""
},
{
"docid": "505700fa5b87361c0e1791d523344b11",
"score": "0.63755876",
"text": "def primes_below(n)\n a = 2\n output_array = []\n while a < n\n if is_prime?(a)\n output_array.push(a)\n end\n a = a + 1\n end\n return output_array\nend",
"title": ""
},
{
"docid": "afb443fb3e2bc0ffceb5ea76fd52ee8d",
"score": "0.6370414",
"text": "def sum_evens max_number\n fibonacci_array.each do |value|\n even_number_array << value if value.even?\n end\n even_number_array.sum\n end",
"title": ""
},
{
"docid": "1aebb9f9d76d96663394168dfb8bd5ec",
"score": "0.63635635",
"text": "def get_evens(arr)\n arr.select { |x| x.even? }\nend",
"title": ""
},
{
"docid": "f517de79d8230ec72819b39f84b24352",
"score": "0.6360718",
"text": "def oddities(array)\n\n result = [] # empty array to push each item in the array to.\n index = 0 # creates a counter called index\n\n while index < array.size\n result << array[index] # array index is the number in the array.\n index += 2 # += 2 iterates over and returns even items.\n end\n result # again with loops put the result outside of the loop.\nend",
"title": ""
},
{
"docid": "5f4504228f576e417e7e55748a933ed3",
"score": "0.6352273",
"text": "def oddities(array)\n new_array = []\n array.each_with_index { |num, idx| new_array << num if idx.even? }\n new_array\nend",
"title": ""
},
{
"docid": "5ad47324fd6787acbcc7dea22d213fe3",
"score": "0.63512844",
"text": "def arr_even_square()\n [1, 3, 4, 5, 12, 23].each {|num|\n if num % 2 === 0\n puts num\n end\n }\nend",
"title": ""
},
{
"docid": "9d49d792813a809f3a19848ae9735ae0",
"score": "0.63504606",
"text": "def fizzBuzz(max)\n\tarr = []\n\n\t(1...max).each do |num|\n\t\tif num % 3 == 0 && num % 5 != 0\n\t\t\tarr << num\n\t\tend\n\t\tif num % 3 != 0 && num % 5 == 0\n\t\t\tarr << num\n\t\tend\n\tend\n\n\treturn arr\nend",
"title": ""
},
{
"docid": "be6aab13588b1d5afedc95568a8a26c1",
"score": "0.6339657",
"text": "def range(min, max)\n nums = []\n \n i = min\n while i <= max\n nums << i\n \n i += 1\n end\n \n return nums\nend",
"title": ""
},
{
"docid": "c9d7ce9f3f6250ce4ad43a510fca3b19",
"score": "0.6337376",
"text": "def evensum(num)\n array = [1, 2]\n first = 1\n second = 2\n\n until array.last > num\n array << (first + second)\n first = second\n second = array.last\n end\n array.pop\n array.select {|x| x.even?}.reduce(:+)\nend",
"title": ""
},
{
"docid": "4cb76d3247b7cdbed28616863f488ebf",
"score": "0.6334907",
"text": "def range(min, max)\n nums = []\n\n i = min\n while i <= max\n nums << i\n\n i += 1\n end\n\n return nums\nend",
"title": ""
},
{
"docid": "47bc57f3bf6f2be14721899f8ab98958",
"score": "0.6333215",
"text": "def crazy_nums(max)\n res = []\n idx = 3\n while idx < max\n if (idx % 3 == 0 || idx % 5 == 0) && idx % 15 != 0\n res.push(idx)\n end\n idx += 1\n end\n return res\nend",
"title": ""
},
{
"docid": "441bb1f67a7ba1d831cf8cecefa86d39",
"score": "0.63284546",
"text": "def num(num1, num2)\n (num1..num2).each do |i|\n puts i if i.even?\n end\nend",
"title": ""
},
{
"docid": "c6751969b3b411cc43a91100a9b950eb",
"score": "0.6327957",
"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.6327957",
"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": "cb0a8fc7c7d850bb0b530300bec09162",
"score": "0.6325058",
"text": "def oddities(array)\n return_array =[]\n array.each_with_index do |element, index|\n return_array << element if index.even?\n end\n return_array\nend",
"title": ""
}
] |
2ce4568844ddd2c9f4338055f099b016 | provides access to the :g2o configuration key in the current warden scope | [
{
"docid": "d8eb557619ec28e0b45b49154e425274",
"score": "0.75744057",
"text": "def config\n env[\"warden\"].config[:scope_defaults][scope][:g2o]\n end",
"title": ""
}
] | [
{
"docid": "e798bfad2f7aa5aefb6e36ccb776ee60",
"score": "0.6376144",
"text": "def config_key\n\t\treturn 'gameworld'\n\tend",
"title": ""
},
{
"docid": "9d64bbda4c0bb1503cd70f7c9c32daec",
"score": "0.6340745",
"text": "def key\n @config[\"key\"]\n end",
"title": ""
},
{
"docid": "b046fabec4cb33b2eb774404d95a8950",
"score": "0.6318703",
"text": "def config\n env[\"warden\"].config[:scope_defaults][:user][:config]\n end",
"title": ""
},
{
"docid": "822a4b2b4d9070431e9cc67443aa64bd",
"score": "0.62872666",
"text": "def key\n \"rails:orgs:#{name}\"\n end",
"title": ""
},
{
"docid": "8b57cd0c17e6fa6b865b67c22a3a1e41",
"score": "0.62048787",
"text": "def config key\n @config.get key\n end",
"title": ""
},
{
"docid": "d0ee96aacc5902ed602c903b0fd3187c",
"score": "0.61844045",
"text": "def config_for(key)\n global_config.get(key)\n end",
"title": ""
},
{
"docid": "66a583bb8aeabc78bb6d723411429345",
"score": "0.61637914",
"text": "def provider_key\n self.dig_for_string(\"providerKey\")\n end",
"title": ""
},
{
"docid": "e80e939ea7b0ad110838b003c3dc5279",
"score": "0.61553556",
"text": "def access_key()\n @config[:access_key]\n end",
"title": ""
},
{
"docid": "68903eb4469834f7d9bff641b1d38d7b",
"score": "0.61439353",
"text": "def devise_key_for_store_location\n Devise.mappings.keys[0]\n end",
"title": ""
},
{
"docid": "1987df20845ced06f8ccc1eb97ba86ab",
"score": "0.6120291",
"text": "def config(key, global_key)\n block = @options[key]\n unless block\n global_conf = Grape::Jwt::Authentication.configuration\n return global_conf.send(global_key)\n end\n block\n end",
"title": ""
},
{
"docid": "4112a85012957f1f06369ea5f8bfb4f5",
"score": "0.6118154",
"text": "def key_name\n @config.key_name\n end",
"title": ""
},
{
"docid": "82b19eda0a481b4d119c8fc8248b50f6",
"score": "0.6010468",
"text": "def config_key\n self.to_s.underscore.to_sym\n end",
"title": ""
},
{
"docid": "071fd6bded79f9581ebb4b2210d40fc1",
"score": "0.5995846",
"text": "def authentication_key\n YAML::load(File.open(\"config/seo_fuel_settings.yml\"))['SEO_FUEL_SETTINGS']['key']\n end",
"title": ""
},
{
"docid": "f0ba9c223d86d0d1986aabec5a136408",
"score": "0.59948754",
"text": "def get key\n @api.read([:config,key,nil],0)[2] rescue nil\n end",
"title": ""
},
{
"docid": "8d1863e4f2868cc1d7147cca6e9bcbc1",
"score": "0.5921447",
"text": "def scoped_config(application, key, default = nil)\n app_key = \"web.#{application}.view.#{key}\"\n default_key = \"web.view.#{key}\"\n @config_manager.has_property?(app_key) ? @config_manager[app_key] : @config_manager[default_key, default: default]\n end",
"title": ""
},
{
"docid": "821e2b1164a9fa25e2076471936814f2",
"score": "0.58845073",
"text": "def get_config(key)\r\n CONFIG[key]\r\n end",
"title": ""
},
{
"docid": "10850478631cb6cbdac7eb97ccae75ca",
"score": "0.5869583",
"text": "def tenant_key\n @config[:tenant_key]\n end",
"title": ""
},
{
"docid": "37ea91bbe3e67be7a9a8249cffaa836a",
"score": "0.5844989",
"text": "def env_key; end",
"title": ""
},
{
"docid": "37ea91bbe3e67be7a9a8249cffaa836a",
"score": "0.5844989",
"text": "def env_key; end",
"title": ""
},
{
"docid": "4854924bd40be6a94443dc4ba5f39927",
"score": "0.582575",
"text": "def sso_settings\n active_sso_provider_configurations.first&.sso_provider_configurationable\n end",
"title": ""
},
{
"docid": "2b8b9bf5db6ae2fbd80da164cec3b3cd",
"score": "0.5814998",
"text": "def configuration(config_key)\n\n @context[config_key]\n end",
"title": ""
},
{
"docid": "c419e4d9e391f1899835b77c2e1f2d4b",
"score": "0.5813231",
"text": "def get_conf(key);@conf[key.to_sym];end",
"title": ""
},
{
"docid": "929eb8e5a6fd9babba7c2c6465c923d5",
"score": "0.5796681",
"text": "def key_file_path\n config[:rgc_key_file]\n end",
"title": ""
},
{
"docid": "95add2498402e8af5b346d0a63de303c",
"score": "0.57943726",
"text": "def config(key)\n @config[key]\n end",
"title": ""
},
{
"docid": "54d44d0f6a35a9e559348c2817230bfa",
"score": "0.5787648",
"text": "def get_admin_key\n (repository(ADMIN_REPO).get \"RW+\").first\n end",
"title": ""
},
{
"docid": "57f30f537dd24d4f207c7de81f2a590b",
"score": "0.5774299",
"text": "def config_key( sym=nil )\n\t\tself.config_key = sym unless sym.nil?\n\t\t@config_key ||= Configurability.make_key_from_object( self )\n\t\t@config_key\n\tend",
"title": ""
},
{
"docid": "61e886b678245f376290bb954a531cc0",
"score": "0.5758071",
"text": "def default_developerKey\n \t{:DeveloperKey=>\"WDHQ4VK5ZGXFY0PDH094\"}\nend",
"title": ""
},
{
"docid": "705b00fb011030e2f3e7c1835b388376",
"score": "0.5749534",
"text": "def get_server_key\n @server_key\n end",
"title": ""
},
{
"docid": "115ed403936c35b40c5892e49503ae49",
"score": "0.5741247",
"text": "def get_admin_key \n \treturn (repository(ADMIN_REPO).get \"RW+\").first\n end",
"title": ""
},
{
"docid": "d1b5b9a47f16253a608718f6d0d0d604",
"score": "0.5739557",
"text": "def key\n File.expand_path(Config[:community][:key], Config.__path__)\n end",
"title": ""
},
{
"docid": "53b94e3308beba8fd5dc6e82b372c4a9",
"score": "0.573932",
"text": "def secret\n @options[:credential2]\n end",
"title": ""
},
{
"docid": "53b94e3308beba8fd5dc6e82b372c4a9",
"score": "0.573932",
"text": "def secret\n @options[:credential2]\n end",
"title": ""
},
{
"docid": "f98e8fd44d98054e7f4ec0b31bad8400",
"score": "0.5688141",
"text": "def linode_secret_key\n @attributes[:linode_secret_key]\n end",
"title": ""
},
{
"docid": "b5daa06ee8b79f0986c06637b98b0913",
"score": "0.56784797",
"text": "def g2_key(strict=false)\n guardian_key(g1_key, strict)\n end",
"title": ""
},
{
"docid": "a91c3858137241e99e8c9073fdf30616",
"score": "0.5650509",
"text": "def api_key\n configuration[:api_key]\n end",
"title": ""
},
{
"docid": "43697125811849084298ab09237a5cf0",
"score": "0.5641564",
"text": "def ldap_host_2\n @attributes[:ldap_host_2]\n end",
"title": ""
},
{
"docid": "43697125811849084298ab09237a5cf0",
"score": "0.5641564",
"text": "def ldap_host_2\n @attributes[:ldap_host_2]\n end",
"title": ""
},
{
"docid": "eec1059c4d8af145730891af2d69cb3d",
"score": "0.56392777",
"text": "def key\n Rails.application.secrets.secret_key_base\n end",
"title": ""
},
{
"docid": "b821bc5d38a8a6bdabff3bad57f6d123",
"score": "0.5625065",
"text": "def key\n @key ||= `#{CONFIG_KEY_CMD}`.chomp\n end",
"title": ""
},
{
"docid": "0be8dfba5c3667bd22933681ff328cc0",
"score": "0.56221426",
"text": "def _get_config(key)\n data = @client.session.get_device_config @device.id, key\n JSON.parse(base64.b64decode(data).decode('utf8'))\n end",
"title": ""
},
{
"docid": "30b352d0616bc6942321cdb3c262da5d",
"score": "0.5609386",
"text": "def get_server_key\n return @server_key\n end",
"title": ""
},
{
"docid": "e9cb28510da203dec04a6207c24ea1b4",
"score": "0.55968106",
"text": "def googlemap_key\n TaliaCore::CONFIG['googlemap_key']\n end",
"title": ""
},
{
"docid": "32cb4b4ee58be07ab47d32cf936fd331",
"score": "0.5591491",
"text": "def conf_key\n Juli::Util::underscore(self.class.to_s)\n end",
"title": ""
},
{
"docid": "e979de55456447e791dfb5822178e470",
"score": "0.55864966",
"text": "def owner_key_name; end",
"title": ""
},
{
"docid": "8fcf64d893110d689ec50479ed412e5e",
"score": "0.5575629",
"text": "def me\n config[ME]\n end",
"title": ""
},
{
"docid": "5788d4cbdc393741965b6a260d7ef508",
"score": "0.5573988",
"text": "def api_user\n configuration[:api_user]\n end",
"title": ""
},
{
"docid": "3efe619bd78927f277093cb520ca74e3",
"score": "0.5570868",
"text": "def api_key\n @config.fetch(:api_key)\n end",
"title": ""
},
{
"docid": "a06a06bc39635002d072328be7aaa86c",
"score": "0.5562602",
"text": "def registry_key; end",
"title": ""
},
{
"docid": "aee684bd01bbafd1f834d6d2f221cb01",
"score": "0.5562331",
"text": "def global\n @config['global']\n end",
"title": ""
},
{
"docid": "3ca1815f29bd75555c935338cdc5c127",
"score": "0.5560312",
"text": "def vimo_conf\n self.class.vimo_conf\n end",
"title": ""
},
{
"docid": "48749a925af5bfab02c51124cbb7e55f",
"score": "0.55545545",
"text": "def config_key=( sym )\n\t\tConfigurability.configurable_objects |= [ self ]\n\t\t@config_key = Configurability.normalize_config_key( sym )\n\tend",
"title": ""
},
{
"docid": "f315231a1aeae285d00523bd70be5b20",
"score": "0.55509055",
"text": "def apikey\n @user = User.find(session[:user_id])\n @site = SiteSetting.find(:first)\n end",
"title": ""
},
{
"docid": "34c69b6eb32157e6c5c826a3bf920bbc",
"score": "0.5546877",
"text": "def owneable_gid\n owneable.try :to_global_id\n end",
"title": ""
},
{
"docid": "9e1fe21ac525d62aebb0e81f542338e8",
"score": "0.554148",
"text": "def acme_private_key_path\n if resource[:acme_private_key_path].nil? || resource[:acme_private_key_path].empty?\n Puppet[:hostprivkey]\n else\n resource[:acme_private_key_path]\n end\n end",
"title": ""
},
{
"docid": "3a24faca218266374d327aa6c7a1b87c",
"score": "0.55413145",
"text": "def config(k=nil)\n cfg = YAML::load(open('config.yml'))\n\n env = 'ven'\n #env = ENV['COMPUTER']\n k.nil? ? cfg[env] : cfg[env][k]\nend",
"title": ""
},
{
"docid": "0680d1fc13af689840f962f2893c0eec",
"score": "0.55321676",
"text": "def get(key)\n @config[key.to_sym] \n end",
"title": ""
},
{
"docid": "698f3faef48a7a5793aad2a571e3a7e8",
"score": "0.55285233",
"text": "def key_path; end",
"title": ""
},
{
"docid": "41df7e1d56ff1ec277922ac3d86427ae",
"score": "0.5522155",
"text": "def config\n @config ||= extension.settings.detect{ |setting| setting[:key] == key.try(:to_sym) } if extension\n end",
"title": ""
},
{
"docid": "8c9fe78104a62c7c47ceeb727f68f7d1",
"score": "0.5518799",
"text": "def resource_key_for_auth_configuration\n\t\tself.class.name.to_s.underscore.capitalize\n\tend",
"title": ""
},
{
"docid": "e7f4cf549473046f192aaf8c9274c375",
"score": "0.55175954",
"text": "def backblaze_b2_application_key\n @attributes[:backblaze_b2_application_key]\n end",
"title": ""
},
{
"docid": "e7f4cf549473046f192aaf8c9274c375",
"score": "0.55175954",
"text": "def backblaze_b2_application_key\n @attributes[:backblaze_b2_application_key]\n end",
"title": ""
},
{
"docid": "9ebc53ba45b18570dbca30e348975a9c",
"score": "0.55128646",
"text": "def query_key_name\n if defined? GloboDns::Config::ENABLE_VIEW and GloboDns::Config::ENABLE_VIEW\n (self.view || View.first).try(:key_name)\n end\n end",
"title": ""
},
{
"docid": "5c88a831d8c9afe0276638febfea25eb",
"score": "0.55122966",
"text": "def cloudflare_secret_key\n @attributes[:cloudflare_secret_key]\n end",
"title": ""
},
{
"docid": "6a5c6f4984212a016cc58f14945a23d3",
"score": "0.55111295",
"text": "def key_ring_url\n return '' if !defined?(name) || name.nil?\n name\n end",
"title": ""
},
{
"docid": "cffb31ad61cb54bfc654ce3bd9a802e7",
"score": "0.55087954",
"text": "def organization()\n @conf.key?(\"organization\") ? @conf[\"organization\"] : Environment::ORGANIZATION\n end",
"title": ""
},
{
"docid": "6594b33ec3f55233c3d8b00a1a773469",
"score": "0.550605",
"text": "def key\n \"#{user}:#{realm}\"\n end",
"title": ""
},
{
"docid": "bb1b1a37b2eaf6084dec0a7096fe23c7",
"score": "0.5505846",
"text": "def project_setting(key)\n data.config[config[:environment]][key]\n end",
"title": ""
},
{
"docid": "98ad34bf0c9091426aa2d47660b1b5d1",
"score": "0.5503773",
"text": "def recovery_provider_config\n this_recovery_provider&.to_h\n end",
"title": ""
},
{
"docid": "cfd8f06dba30eec93d47def1b070d83d",
"score": "0.55022633",
"text": "def conf_name\r\n name\r\n end",
"title": ""
},
{
"docid": "c95c53e41027b5a70f6fc2a802e51e41",
"score": "0.5500488",
"text": "def get_config\n # TODO\n end",
"title": ""
},
{
"docid": "cc1de301f4a995d96c786143aa11c2d5",
"score": "0.5494579",
"text": "def get_keydir\n \"#{admin_directory}keydir\"\n end",
"title": ""
},
{
"docid": "9f92166574d13c0c98afa8e6cc5e1da2",
"score": "0.5489537",
"text": "def backend_configs\n Rails.application.secrets.backend\n end",
"title": ""
},
{
"docid": "9f92166574d13c0c98afa8e6cc5e1da2",
"score": "0.5489537",
"text": "def backend_configs\n Rails.application.secrets.backend\n end",
"title": ""
},
{
"docid": "dad95e00ed52d22967b358425f5f652f",
"score": "0.54872996",
"text": "def [](key)\n NewRelic::Agent.config[key.to_sym]\n end",
"title": ""
},
{
"docid": "e340477978fd2f09110e9933515621ec",
"score": "0.54872215",
"text": "def common_settings\n require 'etc'\n\n scope = closure_scope\n\n {\n 'keydir' => File.join(Puppet.settings[:vardir], 'simp', 'environments',\n scope.lookupvar('::environment'), 'simp_autofiles', 'gen_passwd'),\n 'user' => Etc.getpwuid(Process.uid).name,\n 'group' => Etc.getgrgid(Process.gid).name,\n 'dir_mode' => 0750,\n 'file_mode' => 0640\n }\n end",
"title": ""
},
{
"docid": "940f9b8903c652e47ff970d1cdd605c5",
"score": "0.54827935",
"text": "def global_access\n @attributes[:global_access]\n end",
"title": ""
},
{
"docid": "f1d43a66da008654cdc03fc850f51d7d",
"score": "0.5481201",
"text": "def vpn_key\n @vpn_key\n end",
"title": ""
},
{
"docid": "4005dfc7f7c2d93af201c7269700c077",
"score": "0.5478587",
"text": "def owner(key)\n @capabilities.key?(key) ? @wurfl_id : fallback.owner(key)\n end",
"title": ""
},
{
"docid": "bd1692f6d5aebe871c3682f3f95e47bf",
"score": "0.5478074",
"text": "def g_conf\n true\nend",
"title": ""
},
{
"docid": "1567c7765ffa6107d619d3a1b5592d10",
"score": "0.5471735",
"text": "def global\n @global_config\n end",
"title": ""
},
{
"docid": "8866d4e008f63f6e555105bc75f0830d",
"score": "0.54631996",
"text": "def api_key\n network_options[:api_key]\n end",
"title": ""
},
{
"docid": "ec7a043e3c5a5096337437174fd235f7",
"score": "0.5461882",
"text": "def recovery_provider_config\n this_recovery_provider.to_h\n end",
"title": ""
},
{
"docid": "b720c73a122900b7875badc5ec154f73",
"score": "0.5460042",
"text": "def storage_access_key; end",
"title": ""
},
{
"docid": "b720c73a122900b7875badc5ec154f73",
"score": "0.5460042",
"text": "def storage_access_key; end",
"title": ""
},
{
"docid": "a22c399d39c66cc06ea8baab7c50a31f",
"score": "0.5445786",
"text": "def user_key\n\t authentication.user_key\n\t end",
"title": ""
},
{
"docid": "418e6f2bbe7b29898d55eccaf6929205",
"score": "0.5444627",
"text": "def secret\n guarded_config_env_value('prod_secret', 'P_SECRET')\n end",
"title": ""
},
{
"docid": "08c4172bfb07b1b8eaa99faa7f674946",
"score": "0.5444254",
"text": "def setting(key)\n @config[key]\n end",
"title": ""
},
{
"docid": "08c4172bfb07b1b8eaa99faa7f674946",
"score": "0.5444254",
"text": "def setting(key)\n @config[key]\n end",
"title": ""
},
{
"docid": "34859eae9052240a70dea92cb44d112e",
"score": "0.5442797",
"text": "def otp_enc_key\n (Devise.secret_key || Rails.application.secrets[:secret_key_base]) + \"-#{name}\"\n end",
"title": ""
},
{
"docid": "0a0a4ff1fdd518c7f672773f4b06067b",
"score": "0.54417145",
"text": "def get_config parameter\n # Get default value from application.yml or common.yml\n #Figaro.env.send(parameter)\n ENV[parameter.to_s]\n end",
"title": ""
},
{
"docid": "179c5dd02ae5e7a542de8c541a57c991",
"score": "0.54382306",
"text": "def key\n 'usrgrpid'\n end",
"title": ""
},
{
"docid": "fef4cbe8765b9698efd4067d61ceef3f",
"score": "0.5437246",
"text": "def account_provider_config\n this_account_provider&.to_h\n end",
"title": ""
},
{
"docid": "f9b4608209024da56c86483830fead5e",
"score": "0.54230285",
"text": "def configuration\n JSON.parse @gapi.configuration.to_json\n end",
"title": ""
},
{
"docid": "26c0b48ae81726b4106cbf195c667b69",
"score": "0.54193753",
"text": "def rackspace_api_key\n @attributes[:rackspace_api_key]\n end",
"title": ""
},
{
"docid": "6c9cab05798d32a19aaebf3de593ffc3",
"score": "0.54187286",
"text": "def server_private_key\n raise(\"No plugin.aes.server_private configuration option specified\") unless @config.pluginconf.include?(\"aes.server_private\")\n @config.pluginconf[\"aes.server_private\"]\n end",
"title": ""
},
{
"docid": "5fa0d1adb919d4da0e2de2131cf393d7",
"score": "0.5416392",
"text": "def ovpn_path\n default = '/etc/openvpn/client'\n yml = Config['general']\n return yml ? yml['ovpn_path'] || default : default\n end",
"title": ""
},
{
"docid": "108c2d6467be105d23d83ef2d88e2bb8",
"score": "0.54090035",
"text": "def host_config_key\n \"#{key_prefix}:host_configs\"\n end",
"title": ""
},
{
"docid": "a3e546d8281f795db968f89bb81a49b3",
"score": "0.54044855",
"text": "def configElementNamePerObject\n configElementName\n end",
"title": ""
},
{
"docid": "2b4047dc835b80f384a37a0b7f6d2386",
"score": "0.5402309",
"text": "def get_current_gsetting_value(user, schema, option)\n output = `sudo -u #{user} dbus-launch gsettings get #{schema} #{option}`\n return output.strip()\nend",
"title": ""
},
{
"docid": "8aaaa8513aa1abe58b8f7ede54ec3881",
"score": "0.53979105",
"text": "def config(key)\n @config[key.to_sym] || @config[key.to_s]\n end",
"title": ""
}
] |
5f5fbc03ddecfc680489014003978a7e | Convert libraries configuration form YAML configuration into a string that can be given to the compiler. | [
{
"docid": "c9867b2ae65fd3b1160e59e2f590e803",
"score": "0.0",
"text": "def convert_libraries_to_arguments()\n args = ((@configurator.project_config_hash[:libraries_test] || []) + ((defined? LIBRARIES_SYSTEM) ? LIBRARIES_SYSTEM : [])).flatten\n if (defined? LIBRARIES_FLAG)\n args.map! {|v| LIBRARIES_FLAG.gsub(/\\$\\{1\\}/, v) }\n end\n return args\n end",
"title": ""
}
] | [
{
"docid": "c2c2dc90303be5b6a6a6cb053a46b9ba",
"score": "0.59459513",
"text": "def to_config\n str = %{The configuration file for #{Puppet[:name]}. Note that this file\nis likely to have unused configuration parameters in it; any parameter that's\nvalid anywhere in Puppet can be in any config file, even if it's not used.\n\nEvery section can specify three special parameters: owner, group, and mode.\nThese parameters affect the required permissions of any files specified after\ntheir specification. Puppet will sometimes use these parameters to check its\nown configured state, so they can be used to make Puppet a bit more self-managing.\n\nGenerated on #{Time.now}.\n\n}.gsub(/^/, \"# \")\n\n# Add a section heading that matches our name.\nif @config.include?(:run_mode)\n str += \"[#{self[:run_mode]}]\\n\"\n end\n eachsection do |section|\n persection(section) do |obj|\n str += obj.to_config + \"\\n\" unless ReadOnly.include? obj.name or obj.name == :genconfig\n end\n end\n\n return str\n end",
"title": ""
},
{
"docid": "5caa313a6b0765cf531bbf31fdcde902",
"score": "0.5755",
"text": "def to_s!\n elems = @validators.keys.map do |k|\n v = @values[k]\n vstr = Config.config?(v) ? v.to_s! : v.inspect\n \" #{k}=#{vstr}\"\n end\n \"<Config:#{elems.join}>\"\n end",
"title": ""
},
{
"docid": "2842358e1079eea0517d6bda85399544",
"score": "0.57520306",
"text": "def configuration_yaml\n configuration.to_yaml\n end",
"title": ""
},
{
"docid": "64b7643699889e572ef725658704c5b5",
"score": "0.568985",
"text": "def to_s!\n elems = @fields.map do |k, v|\n vstr =\n if v.is_a? Config\n v.to_s!\n else\n v.value.inspect\n end\n \" #{k}=#{vstr}\"\n end\n \"<Config#{elems.join}>\"\n end",
"title": ""
},
{
"docid": "b962e5e9b740ae8fc3a931d2a91882b1",
"score": "0.56839764",
"text": "def to_s\n conf = \"\"\n @config.each do |k,v|\n conf += \"#{k} = #{v}\\n\" unless v.nil?\n end\n conf\n end",
"title": ""
},
{
"docid": "4a48752156d8aec0e7bce33371e23587",
"score": "0.5656562",
"text": "def yml_to_ruby\n Psych.load object\n end",
"title": ""
},
{
"docid": "cc3a6f9c17ab0be72116351bf1ee10d8",
"score": "0.56323457",
"text": "def to_s\n str = \"\"\n @configurations.each_pair {|key, value| str << \"#{key}: #{value}\\n\" }\n str\n end",
"title": ""
},
{
"docid": "32362ebfffc719edcaa2cede54c6edee",
"score": "0.5612966",
"text": "def to_s\n str = ''\n @conf.each_key() do |section|\n str << '[' << section.to_s() << \"]\\n\"\n @conf[section].each() do |option, value|\n val = value.to_s()\n # If the value is only whitespaces or begin like a comment, quote it.\n val = '\"' + val + '\"' if val.strip.empty? || val =~ /^(;|#)/\n str << option.to_s() << @delimiter << val << \"\\n\"\n end\n end\n return str\n end",
"title": ""
},
{
"docid": "235f8eb5d267a0ac04e8d95f0ee1f20e",
"score": "0.56027097",
"text": "def to_config(options)\n config = Config.for(@options.language, Dir.pwd).codebase\n config.included_files = options.paths unless options.paths.empty?\n unless options.excluded.empty?\n config.excluded_files = options.excluded\n end\n config.read_dump_file = options.read_dump_file\n config\n end",
"title": ""
},
{
"docid": "8bc459864ac2d654d26abd963cfb1f61",
"score": "0.55929327",
"text": "def load_yaml\n if !File.exists?(CONFIG_FILE)\n puts \"No Packfile in current directory\"\n exit\n end\n config = YAML::load(File.open(CONFIG_FILE))\n @options = {\n :package => config['package'] || 'assets.zip',\n :app_stylesheet => config['stylesheet'] || 'application.css',\n :app_javascript => config['javascript'] || 'application.js',\n :stylesheets => config['stylesheets'] || [ ],\n :javascripts => config['javascripts'] || [ ],\n :extras => config['extras'] || [ ],\n }\n\n @options[:stylesheets] = @options[:stylesheets].join(\" \")\n @options[:javascripts] = @options[:javascripts].join(\" \")\n @options[:extras] = @options[:extras].join(\" \")\n end",
"title": ""
},
{
"docid": "a8f5e9e274702560b6f3148e19537c56",
"score": "0.5586882",
"text": "def to_s\n txt = []\n @configs.each do |c|\n txt << c.to_s #if c.text\n end\n txt.join(\"\\n\\n\")\n end",
"title": ""
},
{
"docid": "aea90ce75ae78222a912a7cfd5a5cf71",
"score": "0.5503757",
"text": "def to_config_file_str\n config = {\n 'dataDir' => data_dir,\n 'skipACL' => skip_acl,\n 'tickTime' => tick_time,\n 'initLimit' => init_limit,\n 'syncLimit' => sync_limit,\n 'forceSync' => force_sync,\n 'snapCount' => snap_count,\n 'clientPort' => client_port,\n 'dataLogDir' => data_log_dir,\n 'preAllocSize' => pre_alloc_size,\n 'leaderServes' => leader_serves,\n 'maxClientCnxns' => max_client_cnxns,\n 'clientPortAddress' => client_port_address,\n 'minSessionTimeout' => min_session_timeout,\n 'maxSessionTimeout' => max_session_timeout,\n 'globalOutstandingLimit' => global_outstanding_limit,\n }\n \n config = config.merge(zoo_cfg_hash)\n\n config.delete_if { |k,v| v.nil? }\n\n %w[leaderServes skipACL forceSync].each do |yorn_key|\n if config.has_key?(yorn_key)\n config[yorn_key] = config[yorn_key] ? 'yes' : 'no'\n end\n end\n\n config.sort.map {|kv| kv.join(\"=\") }.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "bad7a6aebde4b014f95b049a2fd36d19",
"score": "0.5484894",
"text": "def config_to_yaml(target = nil)\n file = \"#{self.ref}.yaml\"\n target = target.nil? ? File.join(Pkg::Util::File.mktemp, \"#{self.ref}.yaml\") : File.join(target, file)\n Pkg::Util::File.file_writable?(File.dirname(target), :required => true)\n File.open(target, 'w') do |f|\n f.puts self.config_to_hash.to_yaml\n end\n puts target\n target\n end",
"title": ""
},
{
"docid": "91317962a8c23fd70af214dc31ac0e8f",
"score": "0.54760176",
"text": "def yaml\n @config.to_yaml\n end",
"title": ""
},
{
"docid": "9ac2fdb38a680273285a88775b238776",
"score": "0.54564524",
"text": "def gc_config_to_yml\n YAML.load(gc_config)\n end",
"title": ""
},
{
"docid": "330c8def907fb5ce856cf65f30510c7f",
"score": "0.5434976",
"text": "def config_template\n file = LIBDIR + '/templates/config.yml'\n IO.read(file)\n end",
"title": ""
},
{
"docid": "3fb44bc64598c6ca4b82b269ca6d244d",
"score": "0.5419729",
"text": "def to_link_yaml\n keys_hint = [\n 'PODS',\n 'DEPENDENCIES',\n 'EXTERNAL SOURCES',\n 'CHECKOUT OPTIONS',\n 'SPEC CHECKSUMS',\n 'COCOAPODS',\n ]\n YAMLHelper.convert_hash(to_link_hash, keys_hint, \"\\n\\n\")\n end",
"title": ""
},
{
"docid": "3d6d079a121a6b6d86b411a2a5084f66",
"score": "0.5397003",
"text": "def configure\n @yaml = ApplicationHelper.get_config_yaml\n end",
"title": ""
},
{
"docid": "8d25d69e1314e1b2d800706d40d1684f",
"score": "0.5389466",
"text": "def config_to_options(config)\r\n case config\r\n when nil\r\n ''\r\n when String\r\n config\r\n when Array\r\n config.map { |c| config_to_options(c) }.join(' ')\r\n when Hash\r\n config.map { |k, v| Array(v).map { |c| \"--#{k}=#{Shellwords.escape(c)}\" }.join(' ') }.join(' ')\r\n end\r\n end",
"title": ""
},
{
"docid": "288ba9da4e05e61a971fad7feb58228a",
"score": "0.53689814",
"text": "def to_s\n @config.inspect\n end",
"title": ""
},
{
"docid": "188e8936c000110782ca1cf572561e44",
"score": "0.5366994",
"text": "def to_s\n data = \"Configs list ordered:\\n\"\n @config_layers.each do |layer|\n data += format(\"---- Config : %s ----\\noptions: \", layer[:name])\n\n data += 'predefined, ' if layer[:init].is_a?(TrueClass)\n if layer[:set]\n data += 'data RW '\n else\n data += 'data RO '\n end\n data += format(\", %s\\n\", to_s_file_opts(layer))\n\n data += format(\"%s\\n\", layer[:config].to_s)\n end\n data\n end",
"title": ""
},
{
"docid": "a81e8d3157f434bf8096b86cdd452589",
"score": "0.5363259",
"text": "def config_to_options(config)\n case config\n when nil\n ''\n when String\n config\n when Array\n config.map {|c| config_to_options(c) }.join(' ')\n when Hash\n config.map {|k, v| Array(v).map {|c| \"--#{k}=#{Shellwords.escape(c)}\" }.join(' ') }.join(' ')\n end\n end",
"title": ""
},
{
"docid": "cf578c4e971c7382f14599a48b5465fe",
"score": "0.5352075",
"text": "def _to_conf_string(section = nil)\n inner = self.map do |key, value|\n \" #{key} = #{value}\"\n end.join(\"\\n\")\n section ? \"#{section} {\\n#{inner}\\n}\\n\" : inner\n end",
"title": ""
},
{
"docid": "69ee8cd186e3b9fdc27e1c5d8f48fcf7",
"score": "0.5347739",
"text": "def convert_config\n original_config = File.read(File.join(FileUtils.pwd, \".grit/config.yml\"))\n new_config = YAML.safe_load(original_config.gsub(\":repositories:\", \"repositories:\")\n .gsub(\":root:\", \"root:\")\n .gsub(\":ignore_root:\", \"ignore_root:\")\n .gsub(\":name:\", \"name:\")\n .gsub(\":path:\", \"path:\"))\n new_config.to_yaml\n write_config(new_config)\n end",
"title": ""
},
{
"docid": "a6300c1f2aa9903d2daf6e8f693cc473",
"score": "0.5345014",
"text": "def yaml\n @config.to_yaml\n end",
"title": ""
},
{
"docid": "a6300c1f2aa9903d2daf6e8f693cc473",
"score": "0.5345014",
"text": "def yaml\n @config.to_yaml\n end",
"title": ""
},
{
"docid": "3d5e173a188586429557f3fb7650a686",
"score": "0.5336469",
"text": "def from_bundled_template\n file(File.join(Utility.lib_dir, 'templates', 'config.yml'))\n end",
"title": ""
},
{
"docid": "c0025dbcfbbb56918d9f1cdf157fa593",
"score": "0.5328923",
"text": "def to_s\n config.map {|k,v| \"#{k}: #{v}\" }.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "22381661da133587d08476965c8ad285",
"score": "0.5318558",
"text": "def get_libraries_recursive_string\n\t\tlibraries = \"\"\n\t\t@subdirs.each do |subdir|\n\t\t\tif subdir.has_library then\n\t\t\t\tlibraries += \"#{subdir.name}/lib#{subdir.name}.la \"\n\t\t\tend\n\t\t\tsubdir_libraries = subdir.get_libraries_recursive_string.split\n\t\t\tsubdir_libraries.each do |subdirlib|\n\t\t\t\tlibraries += \"#{subdir.name}/#{subdirlib} \"\n\t\t\tend\n\t\tend\n\t\treturn libraries.strip\n\tend",
"title": ""
},
{
"docid": "0af5f253ef57208073184666cd1c13be",
"score": "0.53160244",
"text": "def conf\n # We can't use to_yaml here because it emits yaml 1.2 but the docs build\n # only supports 1.0.....\n conf = standard_conf\n conf += \"respect_edit_url_overrides: true\\n\" if @respect_edit_url_overrides\n conf += <<~YAML\n sources:\n #{sources_conf}\n YAML\n indent conf, ' '\n end",
"title": ""
},
{
"docid": "d2c9963f73daab8ec0c0de2d3c603c90",
"score": "0.530953",
"text": "def config\n configs[\"_config.yml\"]\n end",
"title": ""
},
{
"docid": "25807598bda011a8861162aa26f45400",
"score": "0.5304474",
"text": "def render\n config = @dex_config.deep_transform_keys!(&:to_s)\n config.to_yaml\n end",
"title": ""
},
{
"docid": "fbcb4d0e21a9f9b1a88991b754bd3219",
"score": "0.5291334",
"text": "def to_yaml\n require \"yaml\"\n @configuration.to_yaml\n end",
"title": ""
},
{
"docid": "f8d3dd826de4fc40a63ea6de7ecda028",
"score": "0.5289779",
"text": "def get_configs\n my_configs = []\n my_configs << @pagination_text if @pagination_text\n my_configs << @initial_sort_text if @initial_sort_text\n my_configs += @configs.map do |k,v|\n val = case v\n when true\n v.to_s\n when false\n v.to_s\n when Numeric\n v.to_s\n else\n \"\\\"#{v}\\\"\"\n end\n \"#{k}: #{val}\"\n end\n return \"var myConfigs = {\\n\" + my_configs.join(\",\\n\") + \" };\\n\"\n end",
"title": ""
},
{
"docid": "5c71d7a72f6678f6782f0fdacb83933b",
"score": "0.52811205",
"text": "def config_data_string\n config_string = \"\"\n\n @config_data.each do |section, keys|\n config_string += \"[#{section}]\\n\"\n keys.each do |key, val|\n config_string += \"#{key} : #{val}\\n\"\n end\n config_string += \"\\n\"\n end\n config_string\n end",
"title": ""
},
{
"docid": "d7f163b9b24f72a4cc831cfdcfdf8977",
"score": "0.52655804",
"text": "def string_configs\n {\n :module_file_dir => nil,\n :user_settings_file => '.ood',\n :facl_domain => nil,\n :auto_groups_filter => nil,\n :bc_clean_old_dirs_days => '30',\n :google_analytics_tag_id => nil,\n :project_template_dir => \"#{config_root}/projects\"\n }.freeze\n end",
"title": ""
},
{
"docid": "bcc37e913966953289da2e8e87f5dffc",
"score": "0.52599937",
"text": "def get_config\n resp = %x[#{BIN_DIR}/yaml -j config]\n JSON.parse(resp)\n end",
"title": ""
},
{
"docid": "4e9dcd6e2a86dc6cfd55431f422d801a",
"score": "0.5248132",
"text": "def dump_configuration\n puts <<-EOT\n----------- FILES -----------\n#{@project.files.map(&:path)}\n----------- BUILD CONFIGURATIONS -----------\n#{@project.build_configurations.map(&:pretty_print)}\n----------- TARGET CONFIGURATIONS -----------\n#{@project.targets.map { |target| {target.name =>\ntarget.build_configuration_list\n.build_configurations.map(&:build_settings)}}}\n----------- FRAMEWORKS -----------\n#{@project.targets.map { |target| {target.name =>\ntarget.frameworks_build_phase.files_references.map(&:pretty_print)}}}\n----------- RESOURCES -----------\n#{@project.targets.map { |target| {target.name =>\ntarget.resources_build_phase.files_references.map(&:pretty_print)}}}\nEOT\n end",
"title": ""
},
{
"docid": "2a09ea554a05d6fb7ec0102f866e16e3",
"score": "0.517481",
"text": "def to_s()\n return @conf_lines.join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "2a09ea554a05d6fb7ec0102f866e16e3",
"score": "0.517481",
"text": "def to_s()\n return @conf_lines.join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "67d050de1fed7bcd78624aa2a5fa7dfa",
"score": "0.51734173",
"text": "def format_config(config)\n if config.is_a?(String) && config.end_with?('.yml')\n env = defined?(Rails.env) ? Rails.env : nil\n config = load_config_file(config, env)\n end\n if config.is_a?(String)\n cs = config\n config = HashWithIndifferentAccess.new()\n elsif config[:ooor_url]\n cs = config[:ooor_url]\n elsif ENV['OOOR_URL']\n cs = ENV['OOOR_URL'].dup()\n end\n config.merge!(parse_connection_string(cs)) if cs\n defaults = HashWithIndifferentAccess.new({\n url: 'http://localhost:8069',\n username: 'admin'\n })\n defaults[:password] = ENV['OOOR_PASSWORD'] if ENV['OOOR_PASSWORD']\n defaults[:username] = ENV['OOOR_USERNAME'] if ENV['OOOR_USERNAME']\n defaults[:database] = ENV['OOOR_DATABASE'] if ENV['OOOR_DATABASE']\n defaults.merge(config)\n end",
"title": ""
},
{
"docid": "87aa49d0d8a200675479cfdf47bd72b0",
"score": "0.51590395",
"text": "def get_dep_libs_string\n\t\tdep_libs_string = \"\"\n\t\t@dep_libs.reverse_each do |dep_lib|\n\t\t\tdep_libs_string += \"#{dep_lib} \"\n\t\tend\n\t\treturn dep_libs_string.strip\n\tend",
"title": ""
},
{
"docid": "98ede8430e92ae8e56e3aadad6c74b2b",
"score": "0.5153957",
"text": "def library_compile_string\n if RUBY_PLATFORM =~ /mswin/\n @loaded_libs.join(' ')\n else\n @loaded_libs.collect {|l| l =~ %r!/! ? \" #{l}\" : \"-l#{l}\"}.join(' ')\n end\n end",
"title": ""
},
{
"docid": "ecd335ac75f60cb76681ef356edb3336",
"score": "0.5150798",
"text": "def to_yaml(opts={})\n configuration.to_yaml(opts)\n end",
"title": ""
},
{
"docid": "0abeb0f96bb5eb83a42873d275b09b26",
"score": "0.5148011",
"text": "def to_s\n \"Config(\\n\" + each_pair.map do |(key, value)|\n # Omit certian gigantic and not-terribly-useful keys.\n if [:option_parser, :cache].include?(key)\n next nil\n end\n\n \" #{key.inspect} => #{value.inspect}\"\n end.compact.join(\"\\n\") + \"\\n)\"\n end",
"title": ""
},
{
"docid": "40e9f72611a0e59e84243a46febaeb2d",
"score": "0.51445645",
"text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.FlexApi.V1.ConfigurationContext #{context}>\"\n end",
"title": ""
},
{
"docid": "d254fb7e5d18624743e01e464b12fa51",
"score": "0.51429075",
"text": "def get_config_yaml\n\n begin\n config = YAML::load_file(config_file)\n rescue\n save_config_yaml\n config = YAML::load_file(config_file)\n end\n\n @tweet_template = config['json2csv']['tweet_template']\n @inbox = check_directory(config['json2csv']['inbox'])\n @outbox = check_directory(config['json2csv']['outbox'])\n @save_json = config['json2csv']['save_json']\n @processed_box = check_directory(config['json2csv']['processed_box'])\n @compress_csv = config['json2csv']['compress_csv']\n \n temp = config['json2csv']['arrays_to_collapse']\n if !temp.nil? then\n @arrays_to_collapse = temp\n end\n temp = config['json2csv']['header_overrides']\n if !temp.nil? then\n @header_overrides = temp\n end\n\n #Header mappings\n temp = config['header_mappings']\n if temp.length > 0 then\n @header_mappings = temp\n end\n end",
"title": ""
},
{
"docid": "690e9c6a992560809c01339c10d779a1",
"score": "0.514118",
"text": "def to_config\n str = @desc.gsub(/^/, \"# \") + \"\\n\"\n\n # Add in a statement about the default.\n str += \"# The default value is '#{@default}'.\\n\" if @default\n\n # If the value has not been overridden, then print it out commented\n # and unconverted, so it's clear that that's the default and how it\n # works.\n value = @settings.value(self.name)\n\n if value != @default\n line = \"#{@name} = #{value}\"\n else\n line = \"# #{@name} = #{@default}\"\n end\n\n str += line + \"\\n\"\n\n str.gsub(/^/, \" \")\n end",
"title": ""
},
{
"docid": "3fc79f9c3be58eb3424a57177dd25aaf",
"score": "0.5140246",
"text": "def cloud_config_data\n return \"#cloud-config\\n#{self.cloud_config.to_yaml}\"\n end",
"title": ""
},
{
"docid": "e504370a7d47b8475366e4812eb9a6bc",
"score": "0.5130896",
"text": "def arclight_config_path\n pathname = Rails.root.join(\"lib\", \"pulfalight\", \"traject\", \"ead2_config.rb\")\n pathname.to_s\n end",
"title": ""
},
{
"docid": "e504370a7d47b8475366e4812eb9a6bc",
"score": "0.5130896",
"text": "def arclight_config_path\n pathname = Rails.root.join(\"lib\", \"pulfalight\", \"traject\", \"ead2_config.rb\")\n pathname.to_s\n end",
"title": ""
},
{
"docid": "e504370a7d47b8475366e4812eb9a6bc",
"score": "0.5130896",
"text": "def arclight_config_path\n pathname = Rails.root.join(\"lib\", \"pulfalight\", \"traject\", \"ead2_config.rb\")\n pathname.to_s\n end",
"title": ""
},
{
"docid": "e504370a7d47b8475366e4812eb9a6bc",
"score": "0.5130896",
"text": "def arclight_config_path\n pathname = Rails.root.join(\"lib\", \"pulfalight\", \"traject\", \"ead2_config.rb\")\n pathname.to_s\n end",
"title": ""
},
{
"docid": "e2a5d8ced74f436b943b871a4c2cc525",
"score": "0.51302403",
"text": "def config_build config_file\n @logger.debug \"Using config file #{config_file}.\"\n validate_file_input(config_file, \"config\")\n begin\n config = YAML.load_file(config_file)\n rescue\n unless File.exists?(config_file)\n @logger.error \"Config file not found.\"\n else\n @logger.error \"Problem loading config file. Exiting.\"\n end\n raise \"Could not load #{config_file}\"\n end\n validate_config_structure(config)\n if config['compile']\n for src in config['compile']\n data = src['data']\n for cfgn in src['builds']\n template = @base_dir + cfgn['template']\n unless cfgn['output'].downcase == \"stdout\"\n output = @base_dir + cfgn['output']\n else\n output = \"stdout\"\n end\n liquify(data, template, output)\n end\n end\n end\n if config['publish']\n begin\n for pub in config['publish']\n for bld in pub['builds']\n if bld['publish']\n publish(pub, bld)\n else\n @logger.warn \"Publish build for '#{index}' backend '#{backend}' disabled.\"\n end\n end\n end\n rescue Exception => ex\n @logger.error \"Error during publish action. #{ex}\"\n end\n end\nend",
"title": ""
},
{
"docid": "468f8493af0e74ec59314797e30ad134",
"score": "0.51294076",
"text": "def conf_string(obj)\n case obj\n when Hash\n obj.map { |k, v| \"\\\"#{k}=#{v}\\\"\" }.join(' ')\n when Array\n obj.join(' ')\n when TrueClass, FalseClass\n obj ? 'yes' : 'no'\n else\n obj.to_s\n end\n end",
"title": ""
},
{
"docid": "522122bfb9a0f56481fa4d1f42c0d768",
"score": "0.51276404",
"text": "def save_options\n self.config_text = config_hash_to_yaml\n end",
"title": ""
},
{
"docid": "e36eae69bfef86fb979e5da8f2197ec7",
"score": "0.51142883",
"text": "def build_config(cfg,manifest=MANIFEST)\n cfg[:releases].each_pair {|type, rels|\n to_add = {}\n rels.each_pair { |name, rel_config|\n # if no config is found, create a default config\n if rel_config.nil?\n rel_config = to_add[name] = {}\n end\n\n # inject name and type into config\n str_name = name.to_s\n rel_config[:name] = str_name\n\n # duplicate config replacing : with _ if we are trying\n # to look for it that way\n if str_name.include?(':')\n to_add[str_name.sub(':', '_').to_sym] = rel_config\n end\n\n typename = type.to_s\n if (typename =~ /^theme_/)\n rel_config[:type] = \"theme\"\n rel_config[:control] = typename.sub(\"theme_\", \"\")\n else\n rel_config[:type] = typename\n end\n\n # inject the default license\n rel_config[:licenses] = (rel_config[:licenses] || []) | cfg[:licenses]\n\n # inject the current version as the version, using the \n # config version as the overriding determinant\n version = manifest.get_current_version(type, name)\n rel_config[:version] ||= version.to_s\n\n # inject the output file path\n output_file = File.join(STAGE_DIR, \"#{type.to_s}-#{name.to_s}-#{rel_config[:version]}.zip\")\n rel_config[:output_filename] = output_file \n }\n\n rels.merge!(to_add)\n }\nend",
"title": ""
},
{
"docid": "0bd47586d7918b4cecb33f9ca4afdc93",
"score": "0.5113871",
"text": "def to_s\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.FlexApi.V1.ConfigurationContext #{context}>\"\n end",
"title": ""
},
{
"docid": "e5bcdc42e9ed1274557771d7de4af05a",
"score": "0.5076878",
"text": "def build_config\n props = device_properties.with_config.map(&:device_property_type)\n (device_type&.config || '') + \"\\n\" + props.map(&:config).join(\"\\n\")\n end",
"title": ""
},
{
"docid": "2cf091bfd464b9e9c36654341f11f867",
"score": "0.5074277",
"text": "def config_yml\n template = File.read(find_config_yml_file)\n ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "668eaf097c5a29611764cd28dad128af",
"score": "0.5061728",
"text": "def library\n @library.to_s\n end",
"title": ""
},
{
"docid": "22c368d117e060b3d9bb2cf75924f503",
"score": "0.5058764",
"text": "def config_generation(options)\n config_contents = {}\n\n config_options = options.keys.map(&:to_sym).sort.uniq\n config_options.delete(:password)\n config_options.each do |config_option|\n config_contents.store(config_option.to_sym, options[config_option])\n end\n\n config_contents.store(:default_organization, options[:username])\n\n config_contents.to_yaml\n end",
"title": ""
},
{
"docid": "830c4925afb5199ab35e89aeea843c03",
"score": "0.5058753",
"text": "def toYAML()\r\n\t\t@buffer = \"{source: {lang: '#{@sourceLang}', content:'#{@sourceText}'}, target: {lang: '#{@targetLang}', content: '#{@targetText}'}},\\n\"\r\n\t\treturn @buffer\r\n\tend",
"title": ""
},
{
"docid": "4979815877a15b7516043ae8f8ca3c1c",
"score": "0.5056807",
"text": "def pack(hash)\n yml_out = Psych.dump(hash) #.strip!\n end",
"title": ""
},
{
"docid": "26f716f66e04da0d06d2a8c97fb30397",
"score": "0.5055013",
"text": "def to_s\n\t\t\tstring = <<-EOS.gsub(/^\\t+/, '')\n\t\t\t### Apache config file -- auto-generated on #{Time.now.ctime}\n\t\t\tEOS\n\n\t\t\t@values.each do |pair|\n\t\t\t\tstring << self.makeConfigPairString( *pair )\n\t\t\tend\n\n\t\t\treturn string\n\t\tend",
"title": ""
},
{
"docid": "8875b63b5b1966dec8355f0c8203e334",
"score": "0.50476694",
"text": "def to_s\n lines = @config.map { |section, data| render_section(section, data) }\n lines.join(\"\\n\").concat(\"\\n\")\n end",
"title": ""
},
{
"docid": "373c112a5e24f152b1f99abb167896b0",
"score": "0.50401473",
"text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.FlexApi.V1.ConfigurationInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "63613210766f39a1c21e9f64f5aa62d3",
"score": "0.50400853",
"text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.FlexApi.V1.ConfigurationInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "2d3e543e901a3a9948029920a3607c52",
"score": "0.50287354",
"text": "def release\n setup_language_pack_environment\n\n {\n \"addons\" => default_addons,\n \"config_vars\" => default_config_vars,\n \"default_process_types\" => default_process_types\n }.to_yaml\n end",
"title": ""
},
{
"docid": "2d3e543e901a3a9948029920a3607c52",
"score": "0.50287354",
"text": "def release\n setup_language_pack_environment\n\n {\n \"addons\" => default_addons,\n \"config_vars\" => default_config_vars,\n \"default_process_types\" => default_process_types\n }.to_yaml\n end",
"title": ""
},
{
"docid": "e23f0922caddd2538892baf2860d35dc",
"score": "0.50263625",
"text": "def server_options_to_yaml\n auction_opts_hash = {}\n SERVER_OPTIONS.each do |so|\n auction_opts_hash[so] = opt(so)\n end\n yaml_options = auction_opts_hash.to_yaml\n target_file = File.join(RAILS_ROOT,'config','server_options.yml')\n File.open(target_file, \"w\") do |f|\n f.write(yaml_options)\n end\nend",
"title": ""
},
{
"docid": "f95757fe66872bc761d67fe63b12868c",
"score": "0.50243175",
"text": "def to_yaml\n @configuration.to_yaml \n end",
"title": ""
},
{
"docid": "32d0a38137d1e725141ad44643918529",
"score": "0.50193655",
"text": "def library component,system_config\n ext_obj,ext_lib,ext_exe = *system_config.extensions(component.platform)\n File.join(system_config.out,component.platform,component.name,\"#{component.name}#{ext_lib}\")\n end",
"title": ""
},
{
"docid": "b3310556ed0cac6727e0666c02bae684",
"score": "0.50037277",
"text": "def write_config(stream = $stdout)\n write_file_header(stream, \"\")\n stream.puts %Q|\n#define PACKAGE\t\t\t\"#{template(:app_name)}\"\n#define VERSION\t\t\t\"#{@version[0]}.#{@version[1]}.#{@version[2]}\"\n\n/* Provide compatibility with autoconf-generated config.h */\n#define PACKAGE_NAME\t\tPACKAGE\n#define PACKAGE_TAR_NAME\tPACKAGE\n#define PACKAGE_VERSION\t\tVERSION\n#define PACKAGE_STRING PACKAGE_NAME \" \" PACKAGE_VERSION\n\n|\n end",
"title": ""
},
{
"docid": "a7b76c6d82d5aa8f1f9c6859c77c8486",
"score": "0.5001077",
"text": "def external_name\n \"#{Lynr.root}/config/#{@type}.#{@environment}.yaml\"\n end",
"title": ""
},
{
"docid": "9e653818992c6d730ace1ea68a78fe89",
"score": "0.4996504",
"text": "def to_s(depth=0)\n result = ''\n @properties.each_pair do |key, value|\n indent = ' ' * (depth*4)\n if value.is_a?(VyOSConfig)\n if value.properties.nil?\n result += indent + \"#{key}\\n\"\n else\n result += indent + \"#{key} {\\n\"\n result += value.to_s(depth + 1)\n result += indent + \"}\\n\"\n end\n elsif value.is_a?(Array)\n escape_values(value).each do |v|\n result += indent + \"#{key} #{v}\\n\"\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "0bd68b9f724300a1d349f3dbcc040e10",
"score": "0.49924177",
"text": "def build_pod_yml\n\t\t\tputs \"==> Generating yaml configuration for #{@template[\"name\"]}-pod\"\n\t\t\timage = \"#{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]}_#{@template[\"name\"]}\"\n\t\t\tpod_hash = {\n\t\t\t\t\"apiVersion\"=> @template[\"kubernetes\"][\"api\"],\n\t\t\t\t\"kind\" => @template[\"kubernetes\"][\"kind\"][\"pod\"],\n\t\t\t\t\"metadata\" => {\n\t\t\t\t\t\"name\" => @template[\"name\"],\n\t\t\t\t\t\"labels\" => {\n\t\t\t\t\t\t\"role\" => @template[\"name\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"spec\" => {\n\t\t\t\t\t\"containers\" => [{\n\t\t\t\t\t\t\"name\" => @template[\"name\"],\n\t\t\t\t\t\t\"image\" => image,\n\t\t\t\t\t\t\"ports\" => [{\n\t\t\t\t\t\t\t\"name\" => @template[\"name\"],\n\t\t\t\t\t\t\t\"containerPort\" => @template[\"port\"].to_i\n\t\t\t\t\t\t}],\n\t\t\t\t\t\t\"securityContext\" => {\n\t\t\t\t\t\t\t\"privileged\" => true\n\t\t\t\t\t\t}\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t\tputs \"#{pod_hash.to_yaml}\"\n\t\t\treturn pod_hash.to_yaml\n\t\tend",
"title": ""
},
{
"docid": "68f7214fed3b43f49c5d769eb4ddd7af",
"score": "0.4984937",
"text": "def bacula_config\n return unless host\n host.baculize_config.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "175eda5f272b861a5e4045f54cf44bcc",
"score": "0.49805984",
"text": "def yaml_dir\n 'config/'\n end",
"title": ""
},
{
"docid": "b8ed4cf73c438b7ee5712d16fa783752",
"score": "0.49790996",
"text": "def config_yaml\n @config_yaml ||= YAML::load(File.open(\"#{Rails.root}/db/sms_carriers.yml\"))\n end",
"title": ""
},
{
"docid": "30c5554aad8cedb67a2ce62436beb237",
"score": "0.49770904",
"text": "def define\n lib('lib', '{*,.*}', '{package.rb,.,..}')\n conf('conf', \"#{@name}.yaml\")\n\n super\n end",
"title": ""
},
{
"docid": "81049dce966dda8264fa914fb3c2ab16",
"score": "0.497628",
"text": "def store_component_config(destination, opts = {})\n components = @_components || options\n create_file(destination, opts) do\n self.class.component_types.inject({}) { |result, comp|\n result[comp] = components[comp].to_s; result\n }.to_yaml\n end\n end",
"title": ""
},
{
"docid": "b84f5e3c1ee13e3efba11c04f6806326",
"score": "0.4969897",
"text": "def render_config(comments=true)\n r = ''\n @config.each do |section_key, section|\n section_key_parts = section_key.to_s.split('.')\n if section_key_parts.count > 1\n r << \"\\n[#{section_key_parts.shift} \\\"#{section_key_parts.join(' ')}\\\"]\\n\\n\"\n else\n r << \"\\n[#{section_key}]\\n\\n\"\n end\n section.each do |key, values|\n values = [*values]\n comments_before, comments_after = '', ''\n if comments && @comments.include?(section_key) && @comments[section_key].include?(key)\n comments_before = @comments[section_key][key][:before].inject(''){ |s,v| s << \"; #{v}\\n\" }\n comments_after = \" ; #{@comments[section_key][key][:after]}\" if @comments[section_key][key][:after]\n end\n r << comments_before\n r << values.map{ |value| \"#{key} = #{value}\" }.join(\"\\n\")\n r << comments_after << \"\\n\\n\"\n end\n end\n r.lstrip.rstrip\n end",
"title": ""
},
{
"docid": "b699a89c82b229f6ff7c0c9b9fe81cae",
"score": "0.4966638",
"text": "def to_s\n \"AutoScaling LaunchConfiguration: #{@config_name}\"\n end",
"title": ""
},
{
"docid": "d355c4add41aad9d18b925169358b0bc",
"score": "0.49646023",
"text": "def config_file\n \"#{path}/config.yml\"\n end",
"title": ""
},
{
"docid": "65b3ac434e87434734409bc887d58a77",
"score": "0.49635166",
"text": "def load_config_yaml filename\n YAML.load(ERB.new(File.read(filename)).result)\nend",
"title": ""
},
{
"docid": "1ffdbd19b254e79cf5b45abe2b56cf2d",
"score": "0.4952747",
"text": "def store_component_config(destination)\r\n create_file(destination) do\r\n self.class.component_types.inject({}) { |result, component|\r\n result[component] = options[component].to_s; result\r\n }.to_yaml\r\n end\r\n end",
"title": ""
},
{
"docid": "1c89c1d39cabd32e90ef96138a4f76aa",
"score": "0.49480766",
"text": "def config(args = { :target => nil, :format => :hash })\n case args[:format]\n when :hash\n self.config_to_hash\n when :yaml\n self.config_to_yaml(args[:target])\n end\n end",
"title": ""
},
{
"docid": "6c94e049de802da24210095284d04cd1",
"score": "0.49472982",
"text": "def get_config(player_options)\n result = player_options.collect { |key,value| \"#{key.to_s} : '#{value.to_s}'\" }.join(', ')\n \"{#{result}}\"\n end",
"title": ""
},
{
"docid": "3b38102f48141de136b7117b6542eed5",
"score": "0.49421492",
"text": "def to_s\n description('Docker Build from')\n end",
"title": ""
},
{
"docid": "a28a01ea6d8acef77ef071126858ad17",
"score": "0.49375513",
"text": "def to_rbs\n *namespace, class_name = name.split(\"::\")\n\n buf = []\n indent = 0\n interface_name = \"_Config\"\n\n if namespace.empty?\n interface_name = \"_#{class_name}\"\n else\n buf << \"module #{namespace.join(\"::\")}\"\n indent += 1\n end\n\n # Using interface emulates a module we include to provide getters and setters\n # (thus making `super` possible)\n buf << \"#{\" \" * indent}interface #{interface_name}\"\n indent += 1\n\n # Generating setters and getters for config attributes\n config_attributes.each do |param|\n type = coercion_mapping[param] || defaults[param.to_s]\n\n type =\n case type\n in NilClass\n \"untyped\"\n in Symbol\n TYPE_TO_CLASS.fetch(type) { defaults[param] ? \"Symbol\" : \"untyped\" }\n in Array\n \"Array[untyped]\"\n in array: _, type:, **nil\n \"Array[#{TYPE_TO_CLASS.fetch(type, \"untyped\")}]\"\n in Hash\n \"Hash[string,untyped]\"\n in TrueClass | FalseClass\n \"bool\"\n else\n type.class.to_s\n end\n\n getter_type = type\n getter_type = \"#{type}?\" unless required_attributes.include?(param)\n\n buf << \"#{\" \" * indent}def #{param}: () -> #{getter_type}\"\n buf << \"#{\" \" * indent}def #{param}=: (#{type}) -> void\"\n\n if type == \"bool\" || type == \"bool?\"\n buf << \"#{\" \" * indent}def #{param}?: () -> #{getter_type}\"\n end\n end\n\n indent -= 1\n buf << \"#{\" \" * indent}end\"\n\n buf << \"\"\n\n buf << \"#{\" \" * indent}class #{class_name} < #{superclass.name}\"\n indent += 1\n\n buf << \"#{\" \" * indent}include #{interface_name}\"\n\n indent -= 1\n buf << \"#{\" \" * indent}end\"\n\n unless namespace.empty?\n buf << \"end\"\n end\n\n buf << \"\"\n\n buf.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "fe02da8ab61d0da759448127820cb902",
"score": "0.49278855",
"text": "def config\n @config ||= Psych.load(ERB.new(File.read(config_file_path)).result)\n end",
"title": ""
},
{
"docid": "67c74f0752ff17105e31342944962464",
"score": "0.49257573",
"text": "def coerce_mongos_config(config)\n default = {\n 'systemLog' => {\n 'destination' => 'file',\n 'logAppend' => true,\n 'path' => \"/var/log/mongodb/#{instance_name}.log\"\n },\n 'net' => {\n 'port' => 27017,\n 'bindIp' => '127.0.0.1'\n }\n }\n\n JSON.parse(Chef::Mixin::DeepMerge.deep_merge(config, default).to_json)\n end",
"title": ""
},
{
"docid": "67852c2059a9bb0e9f94747fa4a752d4",
"score": "0.4920261",
"text": "def load_config\n $config = YAML::load_file('client_config.yaml')\n $config['connect']['full_url'] = $config['connect']['hostname'] + $config['connect']['provision_endpoint']\n $config['connect']['serial_number'] = ARGV[0] || SecureRandom.urlsafe_base64(6)\n $config['connect']['full_working_path'] = File.join($config['connect']['directory'], $config['connect']['serial_number'])\n FileUtils.mkdir_p($config['connect']['full_working_path'])\n Dir.chdir($config['connect']['full_working_path'])\n pp $config\n # pp Dir.pwd\nend",
"title": ""
},
{
"docid": "48c34b351f43ff158c15997bae706063",
"score": "0.4919203",
"text": "def config\n config_file = @options.delete(:config) || raise(OptionRequired, :config)\n\n # Stringify keys\n @options.keys.each { |o| @options[o.to_s] = @options.delete(o) }\n\n File.open(config_file, 'w') { |f| f << @options.to_yaml }\n log \">> Wrote configuration to #{config_file}\"\n end",
"title": ""
},
{
"docid": "c9c5e7efafefa8a842286595f04f0295",
"score": "0.49189734",
"text": "def format_config_file(data)\n data.each.map { |attr, value|\n [attr, (value.is_a?(Array) ? value.to_s : %{\"#{value}\"})].join(\" \")\n }.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "8df9a01c422b783a95f8450ddaa5cd37",
"score": "0.4914281",
"text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Messaging.V1.DomainConfigContext #{context}>\"\n end",
"title": ""
},
{
"docid": "6a6c3085336010344c49588c25a4dc8b",
"score": "0.49056894",
"text": "def resource_hash_to_string(resource_hash, filename)\n ruby_contents = []\n ruby_contents << \"# Autoconverted recipe from #{filename}\\n\"\n\n resource_hash.each do |r|\n type = r.delete(\"type\")\n name = r.delete(\"name\")\n\n ruby_contents << \"#{type} \\\"#{name}\\\" do\"\n r.each do |k, v|\n ruby_contents << \" #{k} #{v.inspect}\"\n end\n ruby_contents << \"end\\n\"\n end\n\n ruby_contents.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "f3b3ad93c5c8fa9897e733e93b5fce8b",
"score": "0.4901412",
"text": "def build_yaml_rails3\r\n\r\n\t\tcode = Rex::Text.encode_base64(payload.encoded)\r\n\t\tyaml =\r\n\t\t\t\"--- !ruby/hash:ActionDispatch::Routing::RouteSet::NamedRouteCollection\\n\" +\r\n\t\t\t\"'#{Rex::Text.rand_text_alpha(rand(8)+1)};eval(%[#{code}].unpack(%[m0])[0]);' \" +\r\n\t\t\t\": !ruby/object:OpenStruct\\n table:\\n :defaults: {}\\n\"\r\n\t\tyaml.gsub(':', '\\u003a')\r\n\tend",
"title": ""
},
{
"docid": "cdc976abe6baecbc9903869d4a0c3c0a",
"score": "0.49001062",
"text": "def config_file\n @config_file ||= targetize('config.rb')\n end",
"title": ""
},
{
"docid": "9bf1687224b7e0f25746bc0721dc78a2",
"score": "0.48986703",
"text": "def to_config(language, path)\n config = ::Inch::Config.for(language, path).codebase\n\n if language == :ruby\n helper = YardOptsWrapper.new(path)\n config.included_files = helper.paths unless helper.paths.empty?\n unless helper.excluded.empty?\n config.excluded_files = helper.excluded\n end\n end\n\n config\n end",
"title": ""
}
] |
f863688e446adad5e6600b9864e24355 | Return the JobOrder object for the specified JobOrder id | [
{
"docid": "e3741850d78f75baeb146a6cec02e86d",
"score": "0.80221355",
"text": "def find_job_order_by_id(id)\n message = { session: @session, entity_name: 'JobOrder', id: id, \n attributes!: { id: { 'xsi:type' => \"xsd:int\" } } }\n soap_response = @client.call(:find, message: message)\n response = soap_response.body[:find_response][:return]\n Bullhorn::JobOrder.from_soap_message(response[:dto])\n end",
"title": ""
}
] | [
{
"docid": "771fc642680cd4a95782aef59e7f53ba",
"score": "0.7184416",
"text": "def set_job_order\n @job_order = JobOrder.find(params[:id])\n end",
"title": ""
},
{
"docid": "771fc642680cd4a95782aef59e7f53ba",
"score": "0.7184416",
"text": "def set_job_order\n @job_order = JobOrder.find(params[:id])\n end",
"title": ""
},
{
"docid": "771fc642680cd4a95782aef59e7f53ba",
"score": "0.7184416",
"text": "def set_job_order\n @job_order = JobOrder.find(params[:id])\n end",
"title": ""
},
{
"docid": "a37c8ee036fc468ffeb2b25af70f4a16",
"score": "0.6898081",
"text": "def find(id)\n Job.find(id)\n end",
"title": ""
},
{
"docid": "c8f7cc0b14cc4ca0decc14ca86f69f5d",
"score": "0.6866308",
"text": "def get_job(id)\n get(\"1/jobs/#{id}\")\n end",
"title": ""
},
{
"docid": "15a288ea8b575c625088fb3c3dde8356",
"score": "0.6820752",
"text": "def set_job_order\n @job_order = JobOrder.find(params[:job_order_id])\n end",
"title": ""
},
{
"docid": "8b40c18adcfaa9617e892353b412961c",
"score": "0.6778296",
"text": "def find_job(id)\n @jobs.select { |j| j.id == id.to_i }.first\n end",
"title": ""
},
{
"docid": "be96120cdf81e681f0d22b654c49a22b",
"score": "0.6681917",
"text": "def find_order(id)\n orders.find_by_order_id(id)\n end",
"title": ""
},
{
"docid": "11bf1deecd96df13f92baa785fa4bc64",
"score": "0.6662445",
"text": "def get_job (job_id)\n\n entry = @cron_entries[job_id]\n return entry if entry\n\n @pending_jobs.each do |entry|\n return entry if entry.eid == job_id\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "24a86a2415365cd3660e43dcb64cfa9a",
"score": "0.66001254",
"text": "def order id\n get_request \"orders/#{id}\"\n end",
"title": ""
},
{
"docid": "415ebd4c4f5712925f2e2266343e9a65",
"score": "0.6558826",
"text": "def get_order_by_id(id)\n if id.nil?\n raise LinkemperorCustomerException.new('id should not be empty')\n end\n exec_get(\"#{@base_path}/api/v2/customers/orders/#{id}.json?api_key=#{@api_key}\")\n end",
"title": ""
},
{
"docid": "107e4d9a13720d3232cb50ca9521f42f",
"score": "0.6544674",
"text": "def get_job(job_id)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5e567f1a52552278efaf08a46ce18866",
"score": "0.6496241",
"text": "def find( job_id )\n @jobs[job_id]\n end",
"title": ""
},
{
"docid": "8c708c808214967b37647d00dc0ec8f6",
"score": "0.64703166",
"text": "def find_job_by_id(id)\n plan.find_tasks(Job).with_arguments(job_id: id).to_a.first\n end",
"title": ""
},
{
"docid": "a095fa37082fc71afade944549001b81",
"score": "0.63909554",
"text": "def getOrder(orderId)\n DataStore.instance.getOrder(orderId)\n end",
"title": ""
},
{
"docid": "ef7e26477d28ce6db52ad8dff9e832f2",
"score": "0.6363619",
"text": "def get_order\n @order = Order.find(params[:id])\n end",
"title": ""
},
{
"docid": "0b2faaeed744dd248f2ffde71cc0691e",
"score": "0.6359986",
"text": "def job job_id\n ensure_service!\n gapi = service.get_job job_id\n Job.from_gapi gapi, service\n rescue Google::Cloud::NotFoundError\n nil\n end",
"title": ""
},
{
"docid": "ea187beaed9b2c7c29b29673dd19f284",
"score": "0.63443387",
"text": "def job job_id\n ensure_connection!\n resp = connection.get_job job_id\n if resp.success?\n Job.from_gapi resp.data, connection\n else\n return nil if resp.status == 404\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "ab6fe306c494f0ea1f7e2f3f860c54a0",
"score": "0.633795",
"text": "def job(project_id, job_id)\n get(\"/projects/#{url_encode project_id}/jobs/#{job_id}\")\n end",
"title": ""
},
{
"docid": "4d56bd46e9bf4445e4004789eede73ed",
"score": "0.6331091",
"text": "def get_order(id, params = nil, headers = nil)\n get(\"/api/v1/orders/#{id}\", params, headers)\n end",
"title": ""
},
{
"docid": "25a3cd4d1d6f43e42b213cbbcdb237fb",
"score": "0.63061213",
"text": "def find(order_id)\n response = client.get_with_retry(\"sites/#{client.site_id}/store/orders/#{order_id}\", 3)\n if response.success?\n Order.new(response.body, client: client)\n end\n end",
"title": ""
},
{
"docid": "50c657cffc21ab01bd08f0dfa343b50f",
"score": "0.62660265",
"text": "def get_order(id)\n conn = @client.get do |req|\n req.url \"/api/v2/order/#{id}\"\n req.headers[\"Authorization\"] = @token\n end\n conn.body\n end",
"title": ""
},
{
"docid": "e56f678dfb0db6aa6c19ef6add6f515d",
"score": "0.626551",
"text": "def find(id)\n jobs.select {|job| job.id == id}.first\n end",
"title": ""
},
{
"docid": "6d8a8e8fd3b99e282ca29aa69d9c9456",
"score": "0.6243455",
"text": "def fetch(job_or_job_id)\n\n if job_or_job_id.respond_to?(:job_id)\n [ job_or_job_id, job_or_job_id.job_id ]\n else\n [ job(job_or_job_id), job_or_job_id ]\n end\n end",
"title": ""
},
{
"docid": "d268a5a7aa1a7a3cf436f5ab612e257b",
"score": "0.6238394",
"text": "def job job_id, location: nil\n ensure_service!\n gapi = service.get_job job_id, location: location\n Job.from_gapi gapi, service\n rescue Google::Cloud::NotFoundError\n nil\n end",
"title": ""
},
{
"docid": "eae41e00276d09ea9b71840f3d559641",
"score": "0.62188154",
"text": "def get_job(job_id)\n fail Auth0::InvalidParameter, 'Must specify a job id' if job_id.to_s.empty?\n path = \"#{jobs_path}/#{job_id}\"\n get(path)\n end",
"title": ""
},
{
"docid": "ba44de5a704652c22d8b0151263e3e35",
"score": "0.62165016",
"text": "def order(id)\n client.get \"orders/#{id}\"\n end",
"title": ""
},
{
"docid": "2fac9a6d9a07865851f0d49649da8aba",
"score": "0.62064576",
"text": "def fetch_job(job_id)\n begin\n job = fetch_job!(job_id)\n rescue Beaneater::NotFoundError\n job = nil\n end\n return job\n end",
"title": ""
},
{
"docid": "42b02f4b76bf2fdad2edd719f2758516",
"score": "0.6204368",
"text": "def get_order(id)\n full_path = full_resource_path(\"/find\")\n query_params = MaropostApi.set_query_params({\"where[id]\" => id})\n\n MaropostApi.get_result(full_path, query_params)\n end",
"title": ""
},
{
"docid": "c8c462abc9aba65c25f577a79c1888af",
"score": "0.6190239",
"text": "def get_order(store, shopify_order_id)\n\n init_session(store)\n\n order = ShopifyAPI::Order.find(shopify_order_id)\n\n end_session\n\n return map_source_order(order)\n end",
"title": ""
},
{
"docid": "3054d767ba880be8904d3cd4f8e65eff",
"score": "0.61783075",
"text": "def retrieve_order(order_id)\n\n end",
"title": ""
},
{
"docid": "e576a0230fa1b0e389a4d95acc07b694",
"score": "0.61727136",
"text": "def spawn_order(order_id)\n order = CorpOrder.find(:first, :conditions => ['order_id = ? AND issued >= ?', order_id, Time.now.ago(90.days)])\n\n order ||= CorpOrder.new()\n end",
"title": ""
},
{
"docid": "3e8208772d66dd8338333827851c44e9",
"score": "0.6152956",
"text": "def get_order(reference_order_id)\r\n begin\r\n @logger.info(\"get_order called.\")\r\n\r\n # validate required parameters\r\n @logger.info(\"Validating required parameters for get_order.\")\r\n validate_parameters({\r\n 'reference_order_id' => reference_order_id\r\n })\r\n\r\n # prepare query url\r\n @logger.info(\"Preparing query URL for get_order.\")\r\n _query_builder = Configuration.get_base_uri().clone\r\n _query_builder << '/orders/{referenceOrderID}'\r\n _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {\r\n 'referenceOrderID' => reference_order_id\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n @logger.info(\"Preparing headers for get_order.\")\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n @logger.info('Preparing and executing HttpRequest for get_order.')\r\n _request = @http_client.get _query_url, headers: _headers\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request, name: 'get_order')\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n @logger.info(\"Returning response for get_order.\")\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n return OrderModel.from_hash(decoded)\r\n\r\n rescue Exception => e\r\n @logger.error(e)\r\n raise e\r\n end\r\n end",
"title": ""
},
{
"docid": "db1f21b0fbaacea80a9afb41bda72bb6",
"score": "0.6142555",
"text": "def order\n @order = Order.find(order_id)\n end",
"title": ""
},
{
"docid": "68e6307c76c6c50f7202cfee66591e67",
"score": "0.61327296",
"text": "def job(job_id)\n handle(@queue.get(\"jobs/#{job_id}\")) { |result| job_handler(result) }\n end",
"title": ""
},
{
"docid": "1f3a4964f14265c4f6767492dfd88601",
"score": "0.6131834",
"text": "def get_order(company, order_id, options = {})\n res = self.class.get(\"/#{company}/OE/OEOrders(#{order_id})\", {query: options})\n Sage300Kit::Object.new(res)\n end",
"title": ""
},
{
"docid": "5e41d3a1fb0a893b2eb0796cfa0d44f1",
"score": "0.61276084",
"text": "def fetch(job_or_job_id)\n\n if job_or_job_id.respond_to?(:job_id)\n [ job_or_job_id, job_or_job_id.job_id ]\n else\n [ job(job_or_job_id), job_or_job_id ]\n end\n end",
"title": ""
},
{
"docid": "8b922f2ab5b2fa06c91bfc2c424136b8",
"score": "0.60578936",
"text": "def get_order_for_original_order_id(original_order_id)\n full_path = full_resource_path(\"/#{original_order_id}\")\n query_params = MaropostApi.set_query_params\n\n MaropostApi.get_result(full_path, query_params)\n end",
"title": ""
},
{
"docid": "6c4d763a91d2d0a39776af1b34070d65",
"score": "0.6053787",
"text": "def job_service(id)\n JobService.new(self, id)\n end",
"title": ""
},
{
"docid": "1311c1a0f893e88f6233fe402dd434a8",
"score": "0.6050779",
"text": "def get_order_by_id(order_id, opts = {})\n data, _status_code, _headers = get_order_by_id_with_http_info(order_id, opts)\n data\n end",
"title": ""
},
{
"docid": "95b3c2405a7c0cae304728459f0ff36b",
"score": "0.6041925",
"text": "def get_order\n \n if @current_customer\n params[:model][:table_id] = @current_customer.table.id # security measure for js manipulation\n end\n \n if params[:id]\n # get a specific order\n order = get_model(params[:id], Order)\n elsif params[:model] and params[:model][:table_id]\n # Reuse the order on table if possible. happens when 2 devices are taking a new order at the same time, and both haven't ID set.\n order = @current_vendor.orders.existing.where(:finished => false, :table_id => params[:model][:table_id]).last\n end\n \n if order and order.finished == true\n # do not update or create the order, simply return it\n return order\n elsif order\n order.update_from_params(params, @current_user, @current_customer)\n else\n order = Order.create_from_params(params, @current_vendor, @current_user, @current_customer)\n end\n return order\n end",
"title": ""
},
{
"docid": "e4baa48f4eff1952da156247c8b70328",
"score": "0.6037902",
"text": "def find_by_id(id)\n get_order_line_item_by_id(id)\n end",
"title": ""
},
{
"docid": "8cfb297a8f36b67946cf74f4376e5d22",
"score": "0.60356677",
"text": "def get_order_by_id(order_id, opts = {})\n data, _status_code, _headers = get_order_by_id_with_http_info(order_id, opts)\n data\n end",
"title": ""
},
{
"docid": "de3710d41c486d44fe0996ae704c16fd",
"score": "0.6026524",
"text": "def save_job_order(job_order)\n message = job_order.to_soap_message(@session)\n soap_response = @client.call(:save, message: message)\n response = soap_response.body[:save_response][:return]\n Bullhorn::JobOrder.from_soap_message(response[:dto])\n end",
"title": ""
},
{
"docid": "525ed89a3dc63419979630781be2d73a",
"score": "0.60206604",
"text": "def find_job\n\t\t\t@job = Job.find(params[:id])\n\t\tend",
"title": ""
},
{
"docid": "e6c641469a388b0bb36186f915e5979d",
"score": "0.60163033",
"text": "def order(id)\n get(\"#{ROBINHOOD_ORDERS_ROUTE}#{id}/\", return_as_json: true)\n end",
"title": ""
},
{
"docid": "589bd9286a463892de16a1938b747c3b",
"score": "0.599421",
"text": "def find_by_id(client, id, options: {})\n\n self.new(parse(client.get(\"/jobs/#{id}\", options: options)).first, client: client)\n end",
"title": ""
},
{
"docid": "f81ee0219837b84c0ba268aadb2c4316",
"score": "0.598283",
"text": "def enqueue_order_job\n type = Job.type_from_sym('order')\n @job = Job.new(count: @order.count, order: @order, type: type, user: current_user)\n @job.enqueue\n end",
"title": ""
},
{
"docid": "8e2778c9934cf13b163bd0911b151585",
"score": "0.5980528",
"text": "def existing_order\n @order = Order.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "ad10bee5ae06cf9540cb27a7987129e2",
"score": "0.5941739",
"text": "def find(order_id)\n response, status = BeyondApi::Request.get(@session, \"/orders/#{order_id}\")\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "4395ccc244950d8d7b1d7d946e4d3d76",
"score": "0.59324056",
"text": "def find_by_id(id)\n get_order_by_id(id)\n end",
"title": ""
},
{
"docid": "8a9e03eea70c84f54f891dc9617b0428",
"score": "0.5932247",
"text": "def get_job job_id\n execute(\n api_method: @bigquery.jobs.get,\n parameters: { projectId: @project, jobId: job_id }\n )\n end",
"title": ""
},
{
"docid": "6c51dd8ea580903f3e22005524b84643",
"score": "0.5930503",
"text": "def find_job\n\t\t@job = Job.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "dbbd76e5a9ba8227cf098a459fa55424",
"score": "0.5928017",
"text": "def order(team_id, order_id)\n c_r Lokalise::Resources::Order, :find, [team_id, order_id]\n end",
"title": ""
},
{
"docid": "97d8b38aed7084e97581155494b34dfa",
"score": "0.58775544",
"text": "def get_job(id, opts = {})\n data, _status_code, _headers = get_job_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "4141192cbbe39e23e9afe881356f803b",
"score": "0.58695215",
"text": "def find(order_id)\n path = \"/orders/#{order_id}\"\n\n response, status = BeyondApi::Request.get(@session,\n path)\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "2a9d36eb9b8451a17406ce1ed52cc5dc",
"score": "0.58651626",
"text": "def set_job(id)\n @job = Job.find(id)\n end",
"title": ""
},
{
"docid": "9a8789f307b1b8358ce8b1ddc77d7b87",
"score": "0.5860716",
"text": "def get(job_id)\n properties = get_json('jobs/get', { job_id: job_id })\n new_resource(:job, properties.merge(properties.delete('settings')))\n end",
"title": ""
},
{
"docid": "1cdd92297f959e767df146f1b89ca877",
"score": "0.58516896",
"text": "def retrieve_order(orderId=nil)\n if orderId.class == Fixnum && block_given?\n @j_del.java_method(:retrieveOrder, [Java::JavaLang::Long.java_class,Java::IoVertxCore::Handler.java_class]).call(orderId,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling retrieve_order(orderId)\"\n end",
"title": ""
},
{
"docid": "f30e048f17c99a807de200528d45f0c5",
"score": "0.5848592",
"text": "def fetch(job_id)\n job_or_raise send_request('fetch', {job_id: job_id})\n end",
"title": ""
},
{
"docid": "2d479b8f5d4420ba5b9f0c60d81ab802",
"score": "0.5845799",
"text": "def get_my_order_by_id(project_key, id, opts = {})\n data, _status_code, _headers = get_my_order_by_id_with_http_info(project_key, id, opts)\n data\n end",
"title": ""
},
{
"docid": "3be5301131dd357959fbaf30e0f3b0c8",
"score": "0.58241904",
"text": "def job_id\n return @job_id\n end",
"title": ""
},
{
"docid": "ca1aa056a4e93350de1fd50b7624b9f5",
"score": "0.5795237",
"text": "def order(team_id, order_id)\n params = { query: [team_id, order_id] }\n\n response = endpoint(name: 'Orders', params: params).do_get\n\n # We must patch content because the API does not return team_id and it's mandatory to build resource URL\n response.patch_content_with 'team_id', team_id\n\n resource 'Order', response\n end",
"title": ""
},
{
"docid": "84d3370e38387e73a3bc20b1a5fdbe3a",
"score": "0.57586604",
"text": "def get_order_detail(login, order_id)\n return call_api(:get, ['u', login.email, 'orders', Normalize.normalize(order_id, :alphanum)], login)\n end",
"title": ""
},
{
"docid": "a9511eea4b537de11d16fb872eb212e2",
"score": "0.5732519",
"text": "def create\n \n if params[:order_id]\n @order = Order.find(params[:order_id])\n @company = @order.company\n # @employee = Employee.create(employee_params)\n @job = @order.jobs.new(job_params)\n # authorize @job\n # @job.order = @order\n # @employee = @job.create_employee(employee_params)\n else\n # @employee = Employee.create(employee_params)\n @job = Job.new(job_params)\n # authorize @job\n end\n \n respond_to do |format|\n if @job.save\n format.html { redirect_to job_path(@job, anchor: \"job_#{@job.id}\"), notice: 'Job was successfully created.' }\n format.json { render :show, status: :created, location: @job }\n else\n format.html { render :new }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3050185bb1fd9ef4f2d8498ad07d3954",
"score": "0.5726795",
"text": "def show\n @order = Order.find_by_md5(params[:id])\n \n if @order.nil?\n \tif logged_in?\n\t \t@order = Order.find_by_id_and_user_id(params[:id], current_user.id)\n \telse\n \t\tstore_location\n \t\tauthenticate_user!\n \t\tend\n \tend\n \t\n \t@job = Job.find(@order.order_items[0].job_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "552e4d49b36bfbc98313e8328c598014",
"score": "0.5715638",
"text": "def id\n order_number\n end",
"title": ""
},
{
"docid": "a2b9292c22087be75a34f7301b0171fb",
"score": "0.57128173",
"text": "def getTranslationOrderJobs(params = {})\n self.get_from_gengo('translate/order/:order_id'.gsub(':order_id', params.delete(:order_id).to_s), params)\n end",
"title": ""
},
{
"docid": "39583a66b8ff015b88b6b24452e510d7",
"score": "0.57105756",
"text": "def set_order_order\n @order_order = Order::Order.find(params[:id])\n end",
"title": ""
},
{
"docid": "1d85cb5ebd759fb7f590c8ebce4bf44b",
"score": "0.5708256",
"text": "def get_job(id=nil)\n if id.class == Fixnum && block_given?\n @j_del.java_method(:getJob, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(id,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling get_job(id)\"\n end",
"title": ""
},
{
"docid": "1d85cb5ebd759fb7f590c8ebce4bf44b",
"score": "0.5708256",
"text": "def get_job(id=nil)\n if id.class == Fixnum && block_given?\n @j_del.java_method(:getJob, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(id,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling get_job(id)\"\n end",
"title": ""
},
{
"docid": "fa9c961553329cb186a0c879a423a82d",
"score": "0.57030576",
"text": "def order\n @order ||= Order.find_by_uid(params[:order_id]) || Order.find_by_id(params[:order_id])\n end",
"title": ""
},
{
"docid": "74a4dd68bddcf35a0d67363db16600a4",
"score": "0.57011676",
"text": "def retrieve_order_id(reference_id)\n return false if reference_id.blank?\n\n existing_orders = query({reference_id: reference_id}).params\n\n if existing_orders['Orders'].present?\n existing_orders = existing_orders['Orders'].sort_by { |order| order['Times']['Created'] }.reverse\n order_id = existing_orders.first['OrderId']\n end\n\n order_id\n end",
"title": ""
},
{
"docid": "a730a91ae50fbe5b6c121fa1e0416924",
"score": "0.5685525",
"text": "def id_order\n find('#order-id')\n end",
"title": ""
},
{
"docid": "63939a5bf749171a9ffd9dc6758dec13",
"score": "0.5668993",
"text": "def getJobID()\n return @jobID\n end",
"title": ""
},
{
"docid": "9e4ea02c4299d07966e7441369757664",
"score": "0.5667953",
"text": "def retrieve(id)\n @client.make_request(:get, \"orders/#{id}\", MODEL_CLASS)\n end",
"title": ""
},
{
"docid": "414421c913e07ef58f5d73d97a147aa6",
"score": "0.56644326",
"text": "def job(project_id, job_id, opts = {})\n data, _status_code, _headers = job_with_http_info(project_id, job_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "c92409ff926e9cf59efd1077020e7080",
"score": "0.56617385",
"text": "def set_job_quote\n @job_quote = JobQuote.find(params[:id])\n end",
"title": ""
},
{
"docid": "d9bdc265a58ee2c8a84cc87c26897fd9",
"score": "0.5648421",
"text": "def set_job\n @job ||= Job.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7f6edc4b1055dfbc266fd36e521cada",
"score": "0.56459826",
"text": "def order(orderID: nil, clOrdID: nil)\n raise ArgumentError, 'either orderID or clOrdID is required' if orderID.nil? && clOrdID.nil?\n\n Bitmex::Order.new rest, websocket, orderID, clOrdID\n end",
"title": ""
},
{
"docid": "901a9f2fb8bc9b1608d4acfa7c52da5a",
"score": "0.5644258",
"text": "def fetch_and_cache_job(job_id)\n job = fetch_job(job_id)\n self.cached_jobs[job_id] = job unless job.nil?\n @min_climbed_job_id = job_id if job_id < @min_climbed_job_id\n @max_climbed_job_id = job_id if job_id > @max_climbed_job_id\n return job\n end",
"title": ""
},
{
"docid": "d7ccb78b867664bd18e7d708bc04b0e4",
"score": "0.56440914",
"text": "def job(job_id)\n raise NSOne::MissingParameter, \"job_id cannot be blank\" if blank?(job_id)\n perform_request(HTTP_GET, \"/monitoring/jobs/#{job_id}\")\n end",
"title": ""
},
{
"docid": "52a8814ff130bc1eab60dd3e8332e45c",
"score": "0.5642817",
"text": "def find_order\n Order.find(params[:id])\nend",
"title": ""
},
{
"docid": "66bba58df9843ae2712f6f09e68a3df9",
"score": "0.5641742",
"text": "def order(order, options = {})\n id = epages_id(order)\n perform_get_with_object(\"/orders/#{id}\", options, Epages::Order)\n end",
"title": ""
},
{
"docid": "a29b05442a5f217ac13f778ffe83ad73",
"score": "0.56209236",
"text": "def get_order_by_id(project_key, id, opts = {})\n data, _status_code, _headers = get_order_by_id_with_http_info(project_key, id, opts)\n data\n end",
"title": ""
},
{
"docid": "dba2a531a896d80a6e5fa067c128fd5a",
"score": "0.56206846",
"text": "def get_order_detail(order_id)\n try_get(\"https://checkout.google.com/sell/multiOrder?order=#{order_id}&ordersTable=1\")\n\n body_string\n end",
"title": ""
},
{
"docid": "d72123f799d5fb19c35f4306e83c1174",
"score": "0.5619111",
"text": "def set_order\n if !params[:id].blank?\n @order = Order.find(params[:id])\n else\n @order = Order.find(params[:order_id])\n end\n end",
"title": ""
},
{
"docid": "e552666e872fcaa4634b0a4a5a6a3752",
"score": "0.5612474",
"text": "def retrieve_order(id, opts = {})\n data, _status_code, _headers = retrieve_order_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "b6576d5e6ebd33b39c1e63b2047cf28c",
"score": "0.5598925",
"text": "def get_order_edit_by_id(project_key, id, opts = {})\n data, _status_code, _headers = get_order_edit_by_id_with_http_info(project_key, id, opts)\n data\n end",
"title": ""
},
{
"docid": "90719e6863c53f536fdb4a7eb8ea44b4",
"score": "0.55918455",
"text": "def get_import_job(id)\n self.class.get(\"#{@url}/rest/import-job/#{id}\", basic_auth: @auth)\n end",
"title": ""
},
{
"docid": "66762d0cc3f3347f2212569857c59e0c",
"score": "0.55910254",
"text": "def find!( job_id )\n find( job_id ) || raise( \"Cannot find a job with id=#{job_id.inspect}. #{@job_ids_removed.include?(job_id) ? 'Removed.' : ''}\" )\n end",
"title": ""
},
{
"docid": "8a57c5014b6bf9f6f7a0ccd2a564f281",
"score": "0.55595773",
"text": "def find_maker_order(order_id)\n Robot.maker.bid_by_id(order_id)\n end",
"title": ""
},
{
"docid": "69e0ea021c7b78cdeac9a77d66d9a127",
"score": "0.55558753",
"text": "def set_job\n @job = Job.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "bf72ad636a022cbde9b631ac21a4d682",
"score": "0.5538579",
"text": "def retrieveById\n @id = params[:id]\n @order = Order.find_by(id: @id)\n \n if @order.nil?\n head 404 \n else\n render json: @order, status:200\n end\n end",
"title": ""
},
{
"docid": "85ecf75a69ea2d9a050ea2f87c769873",
"score": "0.5535267",
"text": "def set_job\n @job = @biz.jobs.find(params[:id])\n end",
"title": ""
},
{
"docid": "61df46b5da6f546ddf6b612c8c6f6286",
"score": "0.55329615",
"text": "def getByUid uid:\n Order.find(uid)\n end",
"title": ""
},
{
"docid": "a96c43d9ce326306fdc2ce9895ab86bf",
"score": "0.5529507",
"text": "def build_job\n @build_job ||= BuildJob.find_by(id: build_job_id)\n\n unless @build_job\n @build_job = BuildJob.new\n self.build_job_id = @build_job.id\n @build_job.save\n end\n\n @build_job\n end",
"title": ""
},
{
"docid": "1743d74a0d26a7b569b21ef033a63517",
"score": "0.55288714",
"text": "def show\n id = params[:id]\n @job = Job.get_jobs[id.to_i]\n end",
"title": ""
},
{
"docid": "8af54573238430cef13f176674c744da",
"score": "0.5527448",
"text": "def get_class(id)\n @job_classes[id]\n end",
"title": ""
},
{
"docid": "d1dcdd8b453123fe6bc3a7dc32163d93",
"score": "0.5524469",
"text": "def get_or_create_order(params)\n \n if params[:orderId] == nil\n # Generate Order for the current cart\n # and add order.id to params\n order = create_order(@cart.id)\n params.merge!(:orderId => order.id)\n else\n # Retrive existing Order\n order = Order.find(params[:orderId])\n end\n \n order\n \n end",
"title": ""
}
] |
c33d5cafbe1e3bb0bf760e2da36dea05 | Serializes the relation objects Array. | [
{
"docid": "bd8c405645e1d9bcd135e7dca871a146",
"score": "0.0",
"text": "def encode_with(coder)\n coder.represent_seq(nil, records)\n end",
"title": ""
}
] | [
{
"docid": "c20d19c83268f03046be642f4eff8453",
"score": "0.69740826",
"text": "def serialize\n to_a.map(&:serialize)\n end",
"title": ""
},
{
"docid": "5394d897ab444ac9cd72196c4c3b32ac",
"score": "0.6771968",
"text": "def relations\n each_relation.to_a\n end",
"title": ""
},
{
"docid": "7ed32cf80eee6d0cc0090cff58734268",
"score": "0.6467988",
"text": "def to_s\n # return empty Relation when Relation's size equal 0\n return 'Relation{}' if size == 0\n\n # map elements from Relation to an array\n relation_s = \"Relation{#{self.map { |x| x.to_s }}}\"\n\n # remove square brackets and double quotes\n relation_s.delete('[]\"')\n end",
"title": ""
},
{
"docid": "a9d80402ef0b19d4ee544341ba6d4ed6",
"score": "0.64140487",
"text": "def associations_array\n resource.reflect_on_all_associations.map { |association| association.name.to_s }\n end",
"title": ""
},
{
"docid": "9add9641310fbe77f8ccf7bed970aaa4",
"score": "0.63856626",
"text": "def object_relationships_as_json\n relationships = object_relationships\n json = []\n relationships.each do |relationship_type, list_of_objects|\n key = relationship_type.gsub(/\\s+/, '') # no spaces in json keys\n solr_docs = list_of_objects.flatten.select { |v| v.kind_of? SolrDocument }\n solr_docs.each do |doc|\n url = Rails.application.routes.url_helpers.url_for({controller: 'catalog', action: 'show', id: doc.id})\n json << {\n relation: key,\n # if doi exists serialize it, otherwise return nil\n doi: DRI::Formatters::Json.dois(doc),\n url: url\n }\n end\n end\n json\n end",
"title": ""
},
{
"docid": "ce78325d82f08c65bac49309c2fd00c2",
"score": "0.62511194",
"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": "8471e9f9bd5aa37ac3a03a10fc1635a4",
"score": "0.62010276",
"text": "def all\n relation.to_a\n end",
"title": ""
},
{
"docid": "71b6d595e6c664649268db9b57b29912",
"score": "0.61691797",
"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": "a197304937930e781079161f5f037ab6",
"score": "0.6128727",
"text": "def serialize\n if @doc.is_a? Enumerable\n @doc.map { |d| do_serialize(d) }.join\n else\n do_serialize(@doc)\n end\n end",
"title": ""
},
{
"docid": "a197304937930e781079161f5f037ab6",
"score": "0.6128727",
"text": "def serialize\n if @doc.is_a? Enumerable\n @doc.map { |d| do_serialize(d) }.join\n else\n do_serialize(@doc)\n end\n end",
"title": ""
},
{
"docid": "a197304937930e781079161f5f037ab6",
"score": "0.6128727",
"text": "def serialize\n if @doc.is_a? Enumerable\n @doc.map { |d| do_serialize(d) }.join\n else\n do_serialize(@doc)\n end\n end",
"title": ""
},
{
"docid": "e7649726ccffd4803e71e566ab7b3ae2",
"score": "0.6106209",
"text": "def to_json\n\t\t\t{modle: @Model, associations: @assosiations, schema: @schema.sort}\n\t\tend",
"title": ""
},
{
"docid": "19702d6af7d177785957bb33b7c85093",
"score": "0.6098802",
"text": "def arr_questions\n arr_relationship_export(questions, ExportCsv::ExportFormat::ATTRIBUTES_QUESTION)\n end",
"title": ""
},
{
"docid": "6256873f889187c2b53fb9441184bcfd",
"score": "0.6087843",
"text": "def relations\n return @relations\n end",
"title": ""
},
{
"docid": "6256873f889187c2b53fb9441184bcfd",
"score": "0.6087843",
"text": "def relations\n return @relations\n end",
"title": ""
},
{
"docid": "c8a894daf84f1758471c9b0ca8984e07",
"score": "0.6083419",
"text": "def serialize\n nodes.map(&:serialize)\n end",
"title": ""
},
{
"docid": "067e9c304a2721c48f3103ab290ec44a",
"score": "0.603502",
"text": "def to_json; \"[#{self.collect { |doc| doc.to_json }.join(',')}]\"; end",
"title": ""
},
{
"docid": "c4c90136e1663f602246fd91a5edd8c7",
"score": "0.6020917",
"text": "def to_ary\n [ self ]\n end",
"title": ""
},
{
"docid": "b3b1e1f3a41678ebb2789fa245195203",
"score": "0.5999487",
"text": "def writeArray\r\n @@persist.writeOut\r\n end",
"title": ""
},
{
"docid": "877cef31ed8f499d207819e05fdd3432",
"score": "0.5978168",
"text": "def to_ary\n return [ self ]\n end",
"title": ""
},
{
"docid": "beb0e6ea56bac47e6694bface8ae81d3",
"score": "0.59306324",
"text": "def serialize_vertices\n vertices.map(&:to_s).join(',')\n end",
"title": ""
},
{
"docid": "a82528d3db15777e8fe55e1aee85a710",
"score": "0.5921985",
"text": "def serialize\n if @doc.is_a? Enumerable\n @doc.map { |d| MARCRecord.new(d).serialize.to_hash }.to_json\n else\n MARCRecord.new(@doc).serialize.to_hash.to_json\n end\n end",
"title": ""
},
{
"docid": "a7bc57fd1925e7b48fe886d8657d668a",
"score": "0.5920669",
"text": "def serialize_people(data)\n data.map do |d|\n person_hash = d.attributes\n person_hash.each { |k, v| person_hash[k] = v.is_a?(ActiveTriples::Relation) ? v.first : v }\n person_hash.to_s\n end\n end",
"title": ""
},
{
"docid": "ccc9d56490532ee10d22bb7f323ebdde",
"score": "0.59093577",
"text": "def to_a\n return [] if current_page > MAX_PAGE\n\n relation = if Gitlab::Database.join_lateral_supported?\n relation_with_join_lateral\n else\n relation_without_join_lateral\n end\n\n relation.with_associations.to_a\n end",
"title": ""
},
{
"docid": "2168d4cc9e9a63f0cf9b39e70699257e",
"score": "0.59073865",
"text": "def relations\n @relations ||= _map_relations\n end",
"title": ""
},
{
"docid": "95950ade670b0690a1af513dbd16992f",
"score": "0.59068817",
"text": "def get_relations\n return @payload.get_path(\"relation\"){[]}\n end",
"title": ""
},
{
"docid": "bf378075a11fb0380d39752d2f246e1d",
"score": "0.5893557",
"text": "def to_ary\n self.to_a\n end",
"title": ""
},
{
"docid": "bf378075a11fb0380d39752d2f246e1d",
"score": "0.5892937",
"text": "def to_ary\n self.to_a\n end",
"title": ""
},
{
"docid": "89e96b9693d6b5165e91601d3487ee91",
"score": "0.5834673",
"text": "def to_json\n to_a.to_json\n end",
"title": ""
},
{
"docid": "2ee57e9467a938fc11249b000492e668",
"score": "0.5831658",
"text": "def relations\n self.class.relations\n end",
"title": ""
},
{
"docid": "2ee57e9467a938fc11249b000492e668",
"score": "0.5831658",
"text": "def relations\n self.class.relations\n end",
"title": ""
},
{
"docid": "2b3c9f7a67de5a3d4aa5ee7089ad03fa",
"score": "0.5814342",
"text": "def relations\n mapped_hash('relation')\n end",
"title": ""
},
{
"docid": "bdc39ae76175af5727bd870e5b6563f9",
"score": "0.5811961",
"text": "def marshal_dump()\n\t\treturn [@users, @chapters]\n\tend",
"title": ""
},
{
"docid": "f2e11fbd0c86ea3046c4db2b69a4351b",
"score": "0.58088106",
"text": "def toArray\n\t\t\t@collection.map{ |entity| entity.data }\n\t\tend",
"title": ""
},
{
"docid": "f3ce6b158c59600260601c245f8ed62d",
"score": "0.5808435",
"text": "def to_ary\n self.to_a\n end",
"title": ""
},
{
"docid": "f3ce6b158c59600260601c245f8ed62d",
"score": "0.5808435",
"text": "def to_ary\n self.to_a\n end",
"title": ""
},
{
"docid": "f3ce6b158c59600260601c245f8ed62d",
"score": "0.5808435",
"text": "def to_ary\n self.to_a\n end",
"title": ""
},
{
"docid": "d271048a44ed8f7b1cf51b468c78323e",
"score": "0.580367",
"text": "def relations=(value)\n @relations = value\n end",
"title": ""
},
{
"docid": "d271048a44ed8f7b1cf51b468c78323e",
"score": "0.580367",
"text": "def relations=(value)\n @relations = value\n end",
"title": ""
},
{
"docid": "678b2bc4ea1a61c5d8ce942085bd8e04",
"score": "0.57773685",
"text": "def relationships\n []\n end",
"title": ""
},
{
"docid": "bc8628c480d1af2fb97d99398b404205",
"score": "0.5774953",
"text": "def to_php\n \"array(#{children.join(', ')})\"\n end",
"title": ""
},
{
"docid": "0afac28565fcf900d1291012039c0d78",
"score": "0.5774329",
"text": "def relations\n [defined_on_object,associations].flatten\n end",
"title": ""
},
{
"docid": "66bf7d59a6e73ab0157208fc03cdfcee",
"score": "0.57726747",
"text": "def to_ary\n return self.attributes\n end",
"title": ""
},
{
"docid": "79c3b97c04d3da3c82701435101be6fe",
"score": "0.5770279",
"text": "def relationship_serializer(name)\n nil\n end",
"title": ""
},
{
"docid": "bf93e7bd9e5c1b676c8fe46fa47030f5",
"score": "0.5760607",
"text": "def to_ary\n\t\t\t[o1,o2,o3,o4]\n\t\tend",
"title": ""
},
{
"docid": "be789fc439a7c4e3e0acc0e7a59410f2",
"score": "0.57535106",
"text": "def to_a\n [ self ]\n end",
"title": ""
},
{
"docid": "c819a62e2f2cc685f238e903145155da",
"score": "0.5752724",
"text": "def relations\n self.class.relations\n end",
"title": ""
},
{
"docid": "74b0cb077bb2f20777e1a34a9944e5fe",
"score": "0.5752675",
"text": "def to_ary\n end",
"title": ""
},
{
"docid": "888179f7cd8005bd3e35a34e2e416ac8",
"score": "0.57274896",
"text": "def encode_array_as; end",
"title": ""
},
{
"docid": "00b7be954631423e18c7469a31fdfed8",
"score": "0.5710858",
"text": "def _arrayify\n [ self ]\n end",
"title": ""
},
{
"docid": "acfbc6bc13725684858a813951c09a4c",
"score": "0.56927365",
"text": "def to_ary\n self\n end",
"title": ""
},
{
"docid": "c90f8e1c991fb40cc386a2311b5b7c59",
"score": "0.5691754",
"text": "def associations\n relations\n end",
"title": ""
},
{
"docid": "8229fa84781654a15161685427175edf",
"score": "0.5686653",
"text": "def relations; end",
"title": ""
},
{
"docid": "8e05e2b76c316efe052ed8161c15f358",
"score": "0.5681735",
"text": "def representation\n representation = attributes\n relationships.each { |relationship| representation.merge! relationship }\n representation.merge! :links => links\n end",
"title": ""
},
{
"docid": "cc756157d265c7ac9fa6bea998ff0a67",
"score": "0.5679462",
"text": "def to_ary\n [self]\n end",
"title": ""
},
{
"docid": "15c70a43c81a3c0ef604d4fe8cb5aa88",
"score": "0.567873",
"text": "def relations\n @relations ||= {}\n end",
"title": ""
},
{
"docid": "ccb71908d273b220ed8510d9f8527be3",
"score": "0.56725085",
"text": "def json_serialization_list\n ret = []\n edges.each do |e|\n a = e.to_a\n ret << [a[0].to_json, a[1].to_json]\n end\n ret\n end",
"title": ""
},
{
"docid": "ab647a8d08ef8c27009e55704e4abb6d",
"score": "0.566877",
"text": "def serialized_associated_objects\n associated_objects.map do |klass, set|\n if configuration.embed_associated_objects.include?(klass)\n [klass, set.map{ |ident| serialization_for_identifier(ident, nested: true) }]\n else\n [klass, set.to_a]\n end\n end.to_h\n end",
"title": ""
},
{
"docid": "415de8132600ad86679c24788d5e568f",
"score": "0.56605846",
"text": "def relations\n relations = Invitee.all.map(&:relation).uniq\n relations_h = []\n relations.each do |relation|\n relations_h.push({ item: relation, text: relation })\n end\n render json: { items: relations_h }\n end",
"title": ""
},
{
"docid": "00e59f561bdf6fb9beb1c463fcf8e804",
"score": "0.56516683",
"text": "def collection_as_json\n collection.to_json(collection_serialization_options)\n end",
"title": ""
},
{
"docid": "b8ce94d5d22bc9ebce56a05b7db843c1",
"score": "0.5648341",
"text": "def to_a\n [ self ]\n end",
"title": ""
},
{
"docid": "b8ce94d5d22bc9ebce56a05b7db843c1",
"score": "0.5648341",
"text": "def to_a\n [ self ]\n end",
"title": ""
},
{
"docid": "35b30f946f5f75de00777a3cababc6fb",
"score": "0.5635954",
"text": "def to_array\n [@id, @delivered, @meal.id, @customer.id, employee.id]\n end",
"title": ""
},
{
"docid": "9b8f0e2f980553341113db10e746e6e5",
"score": "0.5635256",
"text": "def relations\n @model_relations ||= RademadeAdmin::Model::Info::Relations.new(_data_adapter)\n end",
"title": ""
},
{
"docid": "1e6e3b90f97d315dd5aa494cccb8a025",
"score": "0.5635173",
"text": "def to_ary\n self.to_a\n end",
"title": ""
},
{
"docid": "6c73ba299c57544c89f10dfb7fde15ec",
"score": "0.56235605",
"text": "def to_json\n\t\treturn self.graph.to_json\n\tend",
"title": ""
},
{
"docid": "bdb53d9a651fe1bbce7b39eda7b4eab5",
"score": "0.5622973",
"text": "def serialized_collection\n collection.map { |item| serializer(item) }\n end",
"title": ""
},
{
"docid": "f7bf49644ae52ac2734633a99318a08b",
"score": "0.5616436",
"text": "def to_s\n \"#{@array.inspect}\"\n end",
"title": ""
},
{
"docid": "cbb12e4734ad99f404c63602b7d31912",
"score": "0.56161577",
"text": "def associations\n self.relations\n end",
"title": ""
},
{
"docid": "7cca199536c22f5aaeddd7288543d817",
"score": "0.5616",
"text": "def links_serialize\n return [] if current_user.blank?\n linked_uids = ::Common::CardsLink.ws_links_by_uid(obj.uid, current_user.provider_id).map{|link| link.link_to(obj.uid)}\n documents = linked_uids.compact.uniq.map{|uid| ::Common::Card.find(uid, current_user.provider_id)}.compact\n return if documents.blank?\n documents.map do |document|\n {\n uid: document.uid,\n head: head_for_link(document),\n rows: rows_for_link(document),\n actuality: actuality(document)\n }\n end\n end",
"title": ""
},
{
"docid": "4062dcf132c9166f1b42a1cbe947ef9d",
"score": "0.5607296",
"text": "def toArray\n groups = self.group_ids\n badges = self.badge_ids\n pairs = self.friend_ids\n received = self.receivedBadge_ids\n friends = Array.new\n i = 0\n pairs.each do |pair|\n friends[i] = pair.second\n i = i + 1\n end\n \n {\n :id => self.id, \n :username => self.username, \n :email => self.email,\n :group_ids => groups,\n :owned_groups => self.ownedGroup_ids,\n :badge_ids => badges,\n :trophy_case => received,\n :friend_ids => friends\n }\n end",
"title": ""
},
{
"docid": "ce8f0df34729e777ef692511a4eb5015",
"score": "0.55992043",
"text": "def to_json\n serialize.to_json\n end",
"title": ""
},
{
"docid": "963a7c22ce56890d41acb37fa8854617",
"score": "0.55953526",
"text": "def to_array\n get_object_vars(self)\n end",
"title": ""
},
{
"docid": "1c24072ff3324ac3348f87b1c3c00da6",
"score": "0.55900526",
"text": "def to_json\n @attrs.to_json\n end",
"title": ""
},
{
"docid": "c1348b084e92247816237b82b356e93f",
"score": "0.5587383",
"text": "def serialize(object)\n object ? constraint.convert(object) : []\n end",
"title": ""
},
{
"docid": "a98bc304bddd9ceb1ef4495be82db4c6",
"score": "0.5581125",
"text": "def document_relations\n self.relations.keys\n .reject { |relation_name| self.relations[relation_name].embedded? }\n .map(&:to_sym)\n end",
"title": ""
},
{
"docid": "ba832a13167ea4e9a1fd672d52e5ed57",
"score": "0.55802727",
"text": "def to_ary\n\t\treturn [ self.post ]\n\tend",
"title": ""
},
{
"docid": "55469345b75131616669e25f128281ff",
"score": "0.5574952",
"text": "def to_ary\n [ to_s ]\n end",
"title": ""
},
{
"docid": "9ffd1fd5a4a66b0eecec4241214d9c31",
"score": "0.55710715",
"text": "def to_a\n [self]\n end",
"title": ""
},
{
"docid": "b5fb3f0bf920f4ed5f18f75c7ee6b097",
"score": "0.55698675",
"text": "def to_a\n make_tuples(@relation_hash)[0]\n end",
"title": ""
},
{
"docid": "511c8d427e90c6a16a734d9fd8728ac9",
"score": "0.55695117",
"text": "def relations\n @relations || load_and_return(:@relations)\n end",
"title": ""
},
{
"docid": "424567fb11233ccbdb4a3682641f3078",
"score": "0.5568543",
"text": "def serialize_attrs\n @serialize_attrs ||= []\n end",
"title": ""
},
{
"docid": "b0c6a7d9513c7648b036504e2fa6062d",
"score": "0.55595195",
"text": "def to_ordered_json\n to_serialized_attributes.to_json\n end",
"title": ""
},
{
"docid": "116bc48a2ab5ffc41583d853ae5fc6a3",
"score": "0.55586815",
"text": "def serialized_attributes\n Serializer.new(self).serialize\n end",
"title": ""
},
{
"docid": "8490f078f49eeb91b181809bc26af978",
"score": "0.55581146",
"text": "def serialized(_data, _serializer)\n ActiveModel::ArraySerializer.new(_data, each_serializer: _serializer, root: false)\n end",
"title": ""
},
{
"docid": "aa6ca79647415fc1d739feae2b5c47c9",
"score": "0.55485827",
"text": "def to_a\n\t\t\t[self]\n\t\tend",
"title": ""
},
{
"docid": "c91f5139f2fe553079e079f4261df71b",
"score": "0.55398",
"text": "def associations\n serializer._associations.keys.map(&:to_s).map(&:pluralize)\n end",
"title": ""
},
{
"docid": "2bff0c4c653791baf3446bc02a5c6987",
"score": "0.5538756",
"text": "def _arrayify\n Array(self)\n end",
"title": ""
},
{
"docid": "124188170ff769466a61317b150ab099",
"score": "0.55341697",
"text": "def to_a\n parsed_body['results'].map do |data|\n Result.new('Relation', renderer.result(data), self).finalize!\n end\n end",
"title": ""
},
{
"docid": "76e5b02e8428dd5f2acd1b11a87c28af",
"score": "0.55276227",
"text": "def to_a\n [ self ]\n end",
"title": ""
},
{
"docid": "798ebc397a0dca18f2d0c839ad7d05e6",
"score": "0.5515302",
"text": "def __array__\n [ self ]\n end",
"title": ""
},
{
"docid": "9fe95815b961943ff24367f990483ced",
"score": "0.55111194",
"text": "def to_json(options = nil)\n map(&:attributes).to_json(options)\n end",
"title": ""
},
{
"docid": "988b3651cefdde652e9790be0c54bcbb",
"score": "0.5509853",
"text": "def link_array_rels\n link_configs.collect { |cfg| cfg.first[:array] ? cfg.first[:rel] : nil }.compact\n end",
"title": ""
},
{
"docid": "68fbf1e8035e9f59c3a3acb55adc82de",
"score": "0.5508453",
"text": "def to_s\n out = []\n out << %Q((#{source_label})-[:#{relation}]->(#{destination_label})) if direction.include?('->')\n out << %Q((#{source_label})<-[:#{relation}]-(#{destination_label})) if direction.include?('<-')\n out.join(',')\n end",
"title": ""
},
{
"docid": "8d8bedfef61131db6d77a30540938958",
"score": "0.5508383",
"text": "def inspect\n to_ary.inspect\n end",
"title": ""
},
{
"docid": "7e02573ca79d0d4ab25ac26b04345068",
"score": "0.5500353",
"text": "def to_json; \"[#{self.collect { |entry| entry.to_json }.join(',')}]\"; end",
"title": ""
},
{
"docid": "437992fe399ca8aa88a0bd2134e8151d",
"score": "0.54992783",
"text": "def to_a\n\n\t\tself.flatten\n\tend",
"title": ""
},
{
"docid": "bb8f578235367753d13278c7b873f587",
"score": "0.5497181",
"text": "def json_serialization\n JSON.generate(self.serialize)\n end",
"title": ""
},
{
"docid": "14820e8d0e069eb89e3f8b2d6793b092",
"score": "0.54970336",
"text": "def serialize\n\t\tsItems, sConnections, connections = [], [], getItems(UONConnection)\n items = []; self.find( \"all\").each { |i|\n items << i unless ((i.class == TkcText) || (i.class == UONConnection))\n }\n\n # passivate items\n items.each { |i| sItems << i.to_serialize }\n\n\t\t# convert addresses of connected items into indices into the items array\n\t\tconnections.each do |c|\n\t\t\t# assert: forall c: items.index() != nil\n\t\t\tsConnections.push [ # serialized version of connection. issue: fill color of line\n\t\t\t\tc.class, c.getText, items.index( c.srcItem), items.index( c.destItem), c.fill\n\t\t\t]\n\t\tend\n\n\t\t[ sItems, sConnections] # return serialized model\n\tend",
"title": ""
},
{
"docid": "63835a9028e1abbed6215180bf9c16c5",
"score": "0.54962206",
"text": "def write\n __serialize @object\n __context.references.dump\n end",
"title": ""
},
{
"docid": "07c88c136599accce89b9bcc716f5c85",
"score": "0.5479632",
"text": "def contact_relations\n []\n end",
"title": ""
}
] |
6a9fa639023e9980e8ccd99017ef07f7 | Creates an externally hosted asset in MediaSilo An external asset means that all files associated with the asset (source, thumbnails, etc) are stored externally and must be valid and provided to this call. All file URL's must contain the filename and an extension, but can also contain URL variables if needed. All URL's should be URL encoded and use the HTTP or HTTPS protocol. Different inputs are required for different asset types, but a project or folder is required for all: for VIDEO assets the following is required: source,proxy,thumbnaillarge,thumbnailsmall,height,width,durationseconds for IMAGE assets the following is required: source,proxy,thumbnailsmall for AUDIO assets the following is required: source,proxy for DOCUMENT assets the following is required: source | [
{
"docid": "7ace70ebd5090123c34f94fe841ad0c5",
"score": "0.7991512",
"text": "def asset_create_external(source_url, args = { })\n params = {\n :source => source_url\n }\n add_params = [ :projectid, :folderid, :proxy, :thumbnailsmall, :thumbnaillarge, :height, :width, :durationseconds ]\n\n params = merge_additional_parameters(params, add_params, args)\n call_method('Asset.CreateExternal', params)\n end",
"title": ""
}
] | [
{
"docid": "c9aedbb1167c8762b0d77fe6a7db7cd1",
"score": "0.7534844",
"text": "def asset_create_using_path(args = {})\n\n file_url = args[:url] || args[:file_url] || args[:source_url]\n raise ArgumentError ':url is a required parameter.' unless file_url\n\n file_path = args[:mediasilo_path] || args[:file_path]\n raise ArgumentError ':mediasilo_path is a required parameter.' unless file_path\n\n ms_metadata = args[:metadata]\n\n asset_title = args[:title]\n asset_description = args[:description]\n additional_asset_create_params = {}\n additional_asset_create_params['title'] = asset_title if asset_title\n additional_asset_create_params['description'] = asset_description if asset_description\n\n overwrite_existing_asset = args.fetch(:overwrite_existing_asset, false)\n asset_search_field_name = args[:asset_search_field_name] || :filename\n\n #logger.info { \"Creating Asset on MediaSilo Using File Path: '#{file_path}'. File URL: #{file_url}\" }\n\n #ms_uuid = ms.asset_create(file_url, { }, ms_project)\n path_create_options = {\n :overwrite_existing_asset => overwrite_existing_asset,\n :additional_asset_create_params => additional_asset_create_params,\n :asset_search_field_name => asset_search_field_name\n }\n begin\n result = path_create(file_path, true, file_url, ms_metadata, path_create_options)\n # rescue => e\n # raise e, \"Exception Creating Asset Using File Path. #{e.message}\", e.backtrace\n end\n\n output_values = {}\n output_values[:result] = result\n\n return false unless result and result.has_key?(:asset)\n #return publish_error('Error creating asset.') unless result and result.has_key?(:asset)\n\n result_asset = result[:asset]\n if result_asset == false\n ms_asset_id = false\n elsif result[:asset_missing] == false\n ms_asset_id = result[:existing][:asset]['id'] # if not result[:existing][:asset]['uuid'].nil?\n elsif result_asset.is_a?(Array)\n\n #Metadata creation failed but asset was created Array(false, \"uuid\")\n #TODO: HANDLE CASE WHERE METADATA IS NOT CREATED BUT THE ASSET IS\n ms_asset_id = result_asset[1]\n\n else\n ms_asset_id = result_asset['id']\n ms_asset_id ||= result_asset\n end\n #Setting metadata during asset_create doesn't work so we set it here\n #response = ms.metadata_create(ms_uuid, ms_metadata) unless ms_metadata.nil?\n\n if ms_asset_id\n output_values[:asset_id] = ms_asset_id\n return output_values\n else\n #return publish_error(\"Error creating asset.\\nResponse: #{response}\\nMS UUID: #{ms_uuid}\\nMS Creating Missing Path Result: #{result}\")\n return false\n end\n end",
"title": ""
},
{
"docid": "b2e5656d17045cd3e3db8df021773dd5",
"score": "0.7231043",
"text": "def asset_create_using_path(args = { })\n\n file_url = args[:url] || args[:file_url]\n raise ArgumentError ':url is a required parameter.' unless file_url\n\n file_path = args[:mediasilo_path] || args[:file_path]\n raise ArgumentError ':mediasilo_path is a required parameter.' unless file_path\n\n ms_metadata = args[:metadata]\n\n asset_title = args[:title]\n asset_description = args[:description]\n additional_asset_create_params = { }\n additional_asset_create_params['title'] = asset_title if asset_title\n additional_asset_create_params['description'] = asset_description if asset_description\n\n overwrite_existing_asset = args.fetch(:overwrite_existing_asset, false)\n\n #logger.info { \"Creating Asset on MediaSilo Using File Path: '#{file_path}'. File URL: #{file_url}\" }\n\n #ms_uuid = ms.asset_create(file_url, { }, ms_project)\n\n begin\n result = path_create(file_path, true, file_url, ms_metadata, overwrite_existing_asset, additional_asset_create_params)\n # rescue => e\n # raise e, \"Exception Creating Asset Using File Path. #{e.message}\", e.backtrace\n end\n\n output_values = { }\n output_values[:result] = result\n\n return false unless result and result.has_key?(:asset)\n #return publish_error('Error creating asset.') unless result and result.has_key?(:asset)\n\n result_asset = result[:asset]\n if result_asset == false\n ms_uuid = false\n elsif result[:asset_missing] == false\n ms_uuid = result[:existing][:asset]['uuid'] # if not result[:existing][:asset]['uuid'].nil?\n elsif result_asset.is_a?(Array)\n\n #Metadata creation failed but asset was created Array(false, \"uuid\")\n #TODO: HANDLE CASE WHERE METADATA IS NOT CREATED BUT THE ASSET IS\n ms_uuid = result_asset[1]\n\n else\n ms_uuid = result_asset['uuid']\n ms_uuid ||= result_asset\n end\n #Setting metadata during asset_create doesn't work so we set it here\n #response = ms.metadata_create(ms_uuid, ms_metadata) unless ms_metadata.nil?\n\n if ms_uuid\n output_values[:uuid] = ms_uuid\n return output_values\n else\n #return publish_error(\"Error creating asset.\\nResponse: #{response}\\nMS UUID: #{ms_uuid}\\nMS Creating Missing Path Result: #{result}\")\n return false\n end\n end",
"title": ""
},
{
"docid": "655757881eaa1dc0804bf152d6844556",
"score": "0.6763735",
"text": "def asset_create(url, args = { })\n url.gsub!('+', '%2B') # A fix for an issue where pluses in the url cause issues when creating an asset\n params = {\n :url => url\n }\n add_params = [ :projectid, :folderid, :project, :folder ]\n\n params = merge_additional_parameters(params, add_params, args)\n folder_id = params['folderid']\n if folder_id and ( folder_id.to_s != '0')\n params.delete('projectid')\n else\n params.delete('folderid') { }\n end\n call_method('Asset.Create', params)\n end",
"title": ""
},
{
"docid": "3ab972147bf72383a1224c34ce984afb",
"score": "0.6562154",
"text": "def create_from_url(url, options = {})\n opts = { upload_file: url, user_id: 1, aws_acl: EffectiveAssets.aws_acl }.merge(options)\n\n attempts = 3 # Try to upload this string file 3 times\n begin\n asset = Asset.new(opts)\n\n if asset.save\n asset\n else\n puts asset.errors.inspect\n Rails.logger.info asset.errors.inspect\n false\n end\n rescue => e\n (attempts -= 1) >= 0 ? (sleep 2; retry) : false\n end\n end",
"title": ""
},
{
"docid": "1584481b6695ec61ae2bb4fcac8ee96b",
"score": "0.6537309",
"text": "def as_asset\n if !params[:url]\n render :text => \"Must provide an asset URL\", :status => :bad_request\n end\n \n # see if we have a loader for this URL\n if asset = AssetHostCore.as_asset(params[:url])\n if params[:note] && param[:note] != ''\n asset.notes += \"\\n#{params[:note]}\"\n asset.save()\n end\n \n # set hidden flag if desired\n if params[:hidden] && params[:hidden] != \"\"\n asset.is_hidden = true\n asset.save()\n end\n \n render :json => { \n :id => asset.id, \n :title => asset.title, \n :caption => asset.caption, \n :owner => asset.owner,\n :tags => asset.image.tags,\n :size => [asset.image_width,asset.image_height].join('x')\n }\n else\n render :json => { :error => \"Unable to find or load an asset at the URL #{params[:url]}\" }, :status => :not_found\n end\n end",
"title": ""
},
{
"docid": "56cee7e0553ea25d881d0e5bb8e52bab",
"score": "0.64608735",
"text": "def create_from_url(url, options = {})\n opts = {:upload_file => url, :user_id => 1}.merge(options)\n\n if (asset = Asset.create(opts))\n Effective::DelayedJob.new.process_asset(asset)\n asset\n else\n false\n end\n end",
"title": ""
},
{
"docid": "02c5f50ddf2549b6588a14c9fcbcad73",
"score": "0.6460797",
"text": "def asset_create(args = { }, options = { })\n _request = Requests::BaseRequest.new(\n args,\n {\n :http_path => 'assets/v1/assets/',\n :http_method => :post,\n :http_success_code => '201',\n :body => args,\n :parameters => [\n ]\n }.merge(options)\n )\n process_request(_request, options)\n end",
"title": ""
},
{
"docid": "20c988d7382d9e54e196780a044b4d20",
"score": "0.6362192",
"text": "def add_asset src\n if src && !src.empty?\n e = {}.merge(src).delete_if {|k, v| v == nil || v.empty? }\n id = Digest::MD5.hexdigest(src[:url])\n if src[:type] == \"asset\"\n @yml[:assets][id] = e\n else\n @yml[:external_links][id] = e\n end\n end\n end",
"title": ""
},
{
"docid": "5f711b40109b7bfc5e6cb5b9fe734eb6",
"score": "0.62833256",
"text": "def create_url_file\n name = params[:bruse_file][:data].gsub(/(https?|s?ftp):\\/\\//, \"\").gsub(/(\\/.*)*/, \"\")\n @file = BruseFile.new(\n name: name,\n foreign_ref: params[:bruse_file][:data],\n filetype: params[:bruse_file][:type],\n identity: @identity\n )\n end",
"title": ""
},
{
"docid": "4ae622a7eb4df3e33a97d7d5916879fb",
"score": "0.624897",
"text": "def item_create_with_proxy_using_file_uri(args = { }, options = { })\n original_file_uri = args[:original_file_uri] || args[:original]\n file_type = args[:file_type] || 'video'\n\n import_tag = args[:import_tag] || 'lowres'\n\n placeholder_args = args[:placeholder_args] ||= { :container => 1, :video => 1 }\n\n storage_id = args[:storage_id]\n\n # /API/import/placeholder/?container=1&video=1\n placeholder = import_placeholder(placeholder_args)\n placeholder_item_id = placeholder['id']\n\n # /API/import/placeholder/VX-99/video/?uri=file%3A%2F%2F%2Fsrv%2Fmedia1%2Ftest_orginal2.mp4&tag=lowres\n item = import_placeholder_item(:item_id => placeholder_item_id, :type => file_type, :uri => original_file_uri, :tag => import_tag)\n item_id = item['file'].first['id']\n\n # /API/item/VX-99/shape?tag=lowres&fileId=VX-136\n #item_shape_import(:item_id => item_id, :tag => nil, :file_id => nil)\n\n # /API/storage/VX-2/file/?path=storages/test/test_orginal2.mp4\n #storage_file_get(:storage_id => storage_id)\n end",
"title": ""
},
{
"docid": "692ffd9389cf697093009890a37b1e85",
"score": "0.622928",
"text": "def create_and_link_image_asset(client, customer_id, url, field_type, asset_name)\n operations = []\n temp_id = next_temp_id\n\n # Create the Image Asset.\n operations << client.operation.mutate do |m|\n m.asset_operation = client.operation.create_resource.asset do |a|\n a.resource_name = client.path.asset(customer_id, temp_id)\n a.type = :IMAGE\n # Provide a unique friendly name to identify your asset.\n # When there is an existing image asset with the same content but a different\n # name, the new name will be dropped silently.\n a.name = asset_name\n a.image_asset = client.resource.image_asset do |image_asset|\n image_asset.data = get_image_bytes(url)\n end\n end\n end\n\n # Create an AssetGroupAsset to link the Asset to the AssetGroup.\n operations << client.operation.mutate do |m|\n m.asset_group_asset_operation = client.operation.create_resource\n .asset_group_asset do |aga|\n aga.field_type = field_type\n aga.asset_group = client.path.asset_group(\n customer_id,\n ASSET_GROUP_TEMPORARY_ID)\n aga.asset = client.path.asset(customer_id, temp_id)\n end\n end\n\n operations\nend",
"title": ""
},
{
"docid": "5d8acabc5da56c76d43b7f5bda587c13",
"score": "0.6216499",
"text": "def convert!\n \n # Download the file\n begin\n \n # Do the download\n response = Net::HTTP.get_response( URI.parse(url) )\n unless response.is_a? Net::HTTPSuccess\n errors.add( :url, \"could not be found. Please check and try again.\" )\n return false\n end\n \n # Get the name of the file to use\n filename = URI.split(url)[5].to_s.split(\"/\").last\n \n # Save the body into a temp file\n dir = Dir.mktmpdir\n file = File.new( File.join(dir, filename), \"w\" )\n file << response.body\n file.flush\n file.close\n \n rescue\n errors.add( :url, \"could not be loaded. Please check and try again.\" )\n return false\n end\n \n # Get a handle on the downloaded file\n asset_file = File.new( file.path )\n \n # Create asset\n asset = Asset.new( \n :title => self.title, :caption => self.caption, :credit => self.credit,\n :user_id => self.user_id, :asset_folder_id => self.asset_folder_id\n )\n asset.asset = asset_file\n asset.asset_content_type = asset_file.content_type\n asset.asset_file_name = filename\n asset.asset_file_size = asset_file.size\n \n # Try to save the asset\n unless asset.save\n errors.add( :url, \"did not contain a valid asset file.\" )\n return false \n else\n @asset = asset\n return true\n end\n \n end",
"title": ""
},
{
"docid": "c15abd123dec45aa591e1db6b8cbe1a3",
"score": "0.615165",
"text": "def video_add_external(args = { }, options = { })\n video_create(args, options)\n end",
"title": ""
},
{
"docid": "874ba6086b061aff3bd14170644fda86",
"score": "0.6074249",
"text": "def asset_url(path, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "874ba6086b061aff3bd14170644fda86",
"score": "0.6074249",
"text": "def asset_url(path, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "cb9c41cec8f5630b10fc03031907c13f",
"score": "0.607051",
"text": "def asset_create_extended(url, args = { }, options = { })\n return asset_create( url, args, options.merge( :return_extended_response => true ) )\n # logger.debug \"Asset Create\\n\\turl: #{url}\\n\\t\\n\\targs: #{args}\"\n #\n # utility_params = [ :title, :description, :metadata ]\n # utility_args = process_additional_parameters(utility_params, args)\n #\n # # We can't set title or description when creating the asset, so if those parameters are set then save them\n # # and then do an asset edit after asset create\n # asset_modify_params = { }\n # asset_modify_params['title'] = utility_args.delete('title') if utility_args['title']\n # asset_modify_params['description'] = utility_args.delete('description') if utility_args['description']\n #\n # metadata ||= utility_args.delete('metadata') if utility_args['metadata']\n #\n # _response = { }\n # _response[:success] = false\n #\n # asset_create(url, args)\n # _response[:asset_create_response] = response.body_parsed\n # _response[:asset_create_success] = success?\n # unless success?\n # # We received an error code from MediaSilo during the Asset.Create call so return false\n # _response[:error_message] = \"Error Creating Asset. #{error_message}\"\n # return _response\n # end\n #\n # assets = response.body_parsed['ASSETS']\n # first_asset = assets.first\n # _response[:asset] = first_asset\n #\n # uuid = first_asset['uuid']\n # _response[:uuid] = uuid\n # unless uuid\n # _response[:error_message] = \"Error Getting Asset UUID from Response. #{response.body}\"\n # return _response\n # end\n #\n # if not asset_modify_params.empty?\n # response = asset_edit(uuid, asset_modify_params)\n # _response[:asset_edit_response] = response.body_parsed\n # _response[:asset_edit_success] = response.success?\n # unless success?\n # _response[:error_message] = \"Error Editing Asset. #{error_message}\"\n # return _response\n # end\n # end\n #\n # # Since we can't set the metadata during asset_create we do it here\n # if not metadata.nil? and not metadata.empty?\n # response = metadata_create(uuid, :metadata => metadata)\n # _response[:metadata_create_response] = response.body_parsed\n # _response[:metadata_create_success] = success?\n # unless success?\n # _response[:error_message] = \"Error Creating Metadata. #{error_message}\"\n # return _response\n # end\n # end\n #\n # _response[:success] = true\n # _response\n end",
"title": ""
},
{
"docid": "9919dc6b0c29392b91976bb1e7b16ddf",
"score": "0.6050499",
"text": "def asset_edit_external(asset_uuid, args = { })\n params = {\n :uuid => asset_uuid\n }\n add_params = [ :proxy, :thumbnailsmall, :thumbnaillarge, :height, :width, :durationseconds, :streamer ]\n\n params = merge_additional_parameters(params, add_params, args)\n call_method('Asset.EditExternal', params)\n end",
"title": ""
},
{
"docid": "93f23858e8e67361b10ac5705cae6569",
"score": "0.6032145",
"text": "def upload_asset(release_url, path_or_file, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "4fc6c353130bb4cd6362ee25195684b3",
"score": "0.598303",
"text": "def tag_public_assets\n data = @asset_path.read\n data = data.gsub(/url\\(([^\\)]+)\\)/) do\n if $1.include?('data:') || $1.include?('#') || $1.include?('?') || $1.include?('::')\n 'url(%s)' % $1\n else\n path = $1.gsub(/^['\"]|['\"]$/, '')\n path = path[0,1] == '/' ? Pathname.new('./public%s' % path) : Pathname.new('./public/assets').join(path)\n\n if path.exist?\n 'url(\"%s?%s\")' % [path.to_s.sub('./public', ''), Digest::SHA1.hexdigest(path.read)[0, 6]]\n else\n LuxAssets::Cli.warn 'Resource \"%s\" referenced in \"%s/%s\" but not found' % [path, @ext, @name]\n 'url(\"%s\")' % path\n end\n end\n end\n\n @asset_path.write data\n end",
"title": ""
},
{
"docid": "9e2cfb5ab089ad1c3231997f604a8354",
"score": "0.59493494",
"text": "def external_file_params\n params.require(:external_file).permit(:url)\n end",
"title": ""
},
{
"docid": "94908d3882faba4c9c6ba541ed92567d",
"score": "0.5935149",
"text": "def asset_upload(options = {})\n source_url = options.delete(:source_url)\n owner = options.delete(:owner)\n timeout = options.delete(:timeout) || DEFAULT_TIMEOUT_SECONDS\n path = '/v2/assets?action=registerUpload'\n\n body = {\n \"registerUploadRequest\": {\n \"recipes\": [\n \"urn:li:digitalmediaRecipe:feedshare-image\"\n ],\n \"owner\": owner,\n \"serviceRelationships\": [\n {\n \"relationshipType\": \"OWNER\",\n \"identifier\": \"urn:li:userGeneratedContent\"\n }\n ]\n }\n }\n\n response = @connection.post(path, MultiJson.dump(body), 'Content-Type' => 'application/json')\n parsed = Mash.from_json(response.body)\n upload_url = parsed.value.uploadMechanism.first[1].uploadUrl\n asset = parsed.value.asset\n\n media = open(source_url, 'rb')\n\n response =\n @connection.post(upload_url) do |req|\n req.headers['Accept'] = '*/*'\n req.headers['Content-Length'] = media.size.to_s\n req.headers['Content-Type'] = 'application/octet-stream'\n req.headers['x-li-format'] = nil\n req.options.timeout = timeout\n req.options.open_timeout = timeout\n req.body = media\n end\n\n return asset\n end",
"title": ""
},
{
"docid": "797ecc4d4e7c40d66cacef36d3e8f347",
"score": "0.5924591",
"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": "f8be96d122f2614b462704209a30eca5",
"score": "0.5899235",
"text": "def create_url_file(url)\n # name from domain name+tld\n name = url.gsub(/(https?|s?ftp):\\/\\//, \"\").gsub(/(\\/.*)*/, \"\")\n BruseFile.new(name: name,\n foreign_ref: url,\n filetype: \"bruse/url\")\n end",
"title": ""
},
{
"docid": "e9ac11f8f5f7126fe1bebfcf32b9a284",
"score": "0.58772683",
"text": "def create_file_from_url(url, file_name)\n generic_file = ::GenericFile.new(import_url: url, label: file_name).tap do |gf|\n actor = Sufia::GenericFile::Actor.new(gf, current_user)\n actor.create_metadata(params[:batch_id])\n gf.save!\n Sufia.queue.push(ImportUrlJob.new(gf.id))\n end\n end",
"title": ""
},
{
"docid": "2f0046d5e5b32b72cf37300bc0168e22",
"score": "0.58422244",
"text": "def create\n # Here we initialize an empty placeholder Asset, so we can reserve the ID\n @asset = Effective::Asset.new(user_id: ((current_user.try(:id) || 1) rescue 1), upload_file: 'placeholder')\n @asset.extra = params[:extra] if params[:extra].kind_of?(Hash)\n\n EffectiveAssets.authorized?(self, :create, @asset)\n\n begin\n @asset.save!\n render(body: {:id => @asset.id, :s3_key => asset_s3_key(@asset)}.to_json, :status => 200)\n rescue => e\n render(:body => e.message, :status => 500)\n end\n end",
"title": ""
},
{
"docid": "7badcac403389e7c5e4dd75749e9806e",
"score": "0.58221406",
"text": "def asset_url(asset, geometry = nil)\n geometry = \"#{geometry}.\" if geometry\n\n \"#{url(:asset, asset)}/#{geometry}#{asset.filename}\"\n end",
"title": ""
},
{
"docid": "970d95053a9b4f6d3191d7ae337f82b3",
"score": "0.5820615",
"text": "def create_and_save_video_asset_from_params\n if params.has_key?(:video_url)\n video_asset = create_asset_from_video_url(params[:video_url])\n video_asset.save\n return video_asset\n else\n render :text => \"400 Bad Request\", :status => 400\n end\n end",
"title": ""
},
{
"docid": "d4a33b4041f6220e90c350eeec129b25",
"score": "0.5818153",
"text": "def createAsset(site, relative_dir, file_name, langcode, process = true)\n # Don't process underscore files.\n if relative_dir =~ /^_/\n return nil\n end\n\n # Copy across other assets.\n asset = LanguageAsset.new(site, relative_dir, file_name, langcode)\n site.static_files << asset\n\n return nil\n end",
"title": ""
},
{
"docid": "17501289f5bb06e8bc3c69387db0c361",
"score": "0.58121634",
"text": "def load_asset(*args)\n Handle::Asset.create(super(*args), self)\n end",
"title": ""
},
{
"docid": "be9d710e5e5be5f8b5964211091be207",
"score": "0.58117026",
"text": "def create_asset(alias_name:, definition: {}, root_xpubs: [], quorum: 1, issuance_program: nil)\n params = {\n alias: alias_name,\n definition: definition,\n }\n params.merge!(issuance_program: issuance_program) if issuance_program\n params.merge!(root_xpubs: root_xpubs, quorum: quorum) if not root_xpubs.empty?\n client.make_request('/create-asset', 'post', params: params)\n end",
"title": ""
},
{
"docid": "d7dc90274e056b963388a741f21d6b2a",
"score": "0.58016634",
"text": "def add_file_from_url(url)\n Resource.client.add_file_from_url(self,url)\n end",
"title": ""
},
{
"docid": "b1470aea23df8dc918c391801e97fde8",
"score": "0.5752268",
"text": "def create_file_from_url(url, batch_id=nil)\n @generic_file = ::GenericFile.new\n @generic_file.import_url = url\n @generic_file.label = File.basename(url)\n create_metadata(@generic_file)\n Sufia.queue.push(ImportUrlJob.new(@generic_file.pid))\n return @generic_file\n end",
"title": ""
},
{
"docid": "e09be9856e0a983eff5323712b86858c",
"score": "0.5731006",
"text": "def asset_proxy_url(url); end",
"title": ""
},
{
"docid": "ac4eb247e905701c7454709f208743e2",
"score": "0.5707856",
"text": "def add_asset(asset)\n obj = HostOrIP.convert(asset)\n @assets << obj\n end",
"title": ""
},
{
"docid": "a08de6c304e0887517a443af5f31cc92",
"score": "0.5704211",
"text": "def create\n @external_file = ExternalFile.new(external_file_params)\n\n respond_to do |format|\n if @external_file.save\n format.html { redirect_to @external_file, notice: 'External file was successfully created.' }\n format.json { render :show, status: :created, location: @external_file }\n else\n format.html { render :new }\n format.json { render json: @external_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "742391468ec0032fabb606ac1046df28",
"score": "0.56844574",
"text": "def create_asset(params={name:random_string})\n\t\tnew_asset = assets[:new]\n\t\tnew_asset[:params].merge!(params)\n\t\tpost(new_asset)\n\tend",
"title": ""
},
{
"docid": "0443af55a88848e883ffa0726b538998",
"score": "0.56782734",
"text": "def build_asset_uri(path, params = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0443af55a88848e883ffa0726b538998",
"score": "0.56782734",
"text": "def build_asset_uri(path, params = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ac2c3a40957fd12018dcbb7f0a7acbc1",
"score": "0.56695485",
"text": "def create\n @asset = RemoteAsset.new(params[:remote_asset])\n\n respond_to do |format|\n if @asset.save\n format.html { redirect_to(@asset, :notice => 'Asset was successfully created.') }\n format.xml { render :xml => @asset, :status => :created, :location => @asset }\n format.json { render :json => {:result => 1, :id => @asset.id}.to_json }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n format.json { render :json => {:result => 0, :errors => @asset.errors}.to_json }\n end\n end\n end",
"title": ""
},
{
"docid": "63abd873e9979fae9d29c3cf8e55fbd2",
"score": "0.56601495",
"text": "def picture_from_url(url)\n self.assets.build( :asset => URI.parse(url), :product_id => self.id ).save\n end",
"title": ""
},
{
"docid": "dc8b983a4bba6c11b38e122a620cbc5f",
"score": "0.56584555",
"text": "def create_file_from_url(url, file_name)\n ::FileSet.new(import_url: url, label: file_name) do |fs|\n actor = Hyrax::Actors::FileSetActor.new(fs, user)\n actor.create_metadata(visibility: curation_concern.visibility)\n actor.attach_file_to_work(curation_concern)\n apply_saved_metadata(fs, curation_concern)\n fs.save!\n uri = URI.parse(URI.encode(url))\n if uri.scheme == 'file'\n IngestLocalFileJob.perform_later(fs, URI.decode(uri.path), user)\n else\n ImportUrlJob.perform_later(fs, operation_for(user: user))\n end\n end\n end",
"title": ""
},
{
"docid": "f85890823a71d81e212885ab94747926",
"score": "0.56507856",
"text": "def create_image(file_name, types, position, label)\n asset = Asset.new\n asset.product = self.product\n asset.store = store\n asset.position = position\n asset.label = label\n asset.set_file(File.open(file_name))\n\n types.each do |type|\n asset.asset_types << type\n end\n\n asset.sync_needed = false\n asset.save\n\n asset.sync_needed = true\n\n unless asset.save\n self.process_errors << \"Row #{current_row}: #{asset.errors[:base]}\"\n end\n end",
"title": ""
},
{
"docid": "2a7201f3ca82bdaf5c188945527b2af6",
"score": "0.56428",
"text": "def create_and_link_image_asset_operations(\n client,\n customer_id,\n url,\n field_type,\n asset_name\n)\n operations = []\n temp_id = next_temp_id\n\n # Create the Image Asset.\n operations << client.operation.mutate do |m|\n m.asset_operation =\n client.operation.create_resource.asset do |a|\n a.resource_name = client.path.asset(customer_id, temp_id)\n # Provide a unique friendly name to identify your asset.\n # When there is an existing image asset with the same content but a different\n # name, the new name will be dropped silently.\n a.name = asset_name\n a.type = :IMAGE\n a.image_asset =\n client.resource.image_asset do |image_asset|\n image_asset.data = get_image_bytes(url)\n end\n end\n end\n\n # Create an AssetGroupAsset to link the Asset to the AssetGroup.\n operations << client.operation.mutate do |m|\n m.asset_group_asset_operation =\n client.operation.create_resource.asset_group_asset do |aga|\n aga.field_type = field_type\n aga.asset_group =\n client.path.asset_group(customer_id, ASSET_GROUP_TEMPORARY_ID)\n aga.asset = client.path.asset(customer_id, temp_id)\n end\n end\n\n operations\nend",
"title": ""
},
{
"docid": "a39725765934ccb577a4fb592766b500",
"score": "0.563269",
"text": "def add_asset_include_in_library(asset)\n click_add_new_asset asset\n if asset.type == 'File'\n enter_file_path_for_upload asset.file_name\n enter_file_metadata(asset)\n check_add_file_to_library_cbx\n click_add_files_button\n else\n enter_url_metadata asset\n check_add_link_to_library_cbx\n click_add_url_button\n end\n end",
"title": ""
},
{
"docid": "f21e554cb13bf3dfd10d3c2b08f4c7ed",
"score": "0.5607831",
"text": "def create_link(drop, url, title = nil, description = nil)\n token = get_default_token(drop)\n uri = URI::HTTP.build({:path => asset_path(drop)})\n form = create_form( { :token => token, :url => url, :title => title, :description => description })\n req = Net::HTTP::Post.new(uri.request_uri, DEFAULT_HEADER)\n req.set_form_data(form)\n asset = nil\n complete_request(req) { |body| asset = Mapper.map_assets(drop, body) }\n asset\n end",
"title": ""
},
{
"docid": "6048488d4dfb389a7847d984d939a9ae",
"score": "0.55985934",
"text": "def asset_host=(_arg0); end",
"title": ""
},
{
"docid": "c8e3f23bc51c238d74c7c022f3178baa",
"score": "0.5587267",
"text": "def create_image_asset(client, customer_id, image_url, image_name)\n # Creates an asset operation.\n operation = client.operation.create_resource.asset do |a|\n a.name = image_name\n a.type = :IMAGE\n a.image_asset = client.resource.image_asset do |ia|\n ia.data = open(image_url) { |f| f.read }\n end\n end\n\n # Issues a mutate request to add the asset.\n response = client.service.asset.mutate_assets(\n customer_id: customer_id,\n operations: [operation],\n )\n\n # Prints out information about the newly added asset.\n asset_resource_name = response.results.first.resource_name\n puts \"A new image asset has been added with resource name: \" \\\n \"'#{asset_resource_name}'.\"\n\n asset_resource_name\nend",
"title": ""
},
{
"docid": "9b4de994e417cc415ae9139d176c2853",
"score": "0.557196",
"text": "def uhook_create_asset visibility\n asset = visibility.new(params[:asset])\n asset.locale = current_locale\n if params[:from] && asset.resource_file_name.blank?\n asset.resource = visibility.find(params[:from]).resource\n end\n asset\n end",
"title": ""
},
{
"docid": "fbe91388f83d6eba9b93e2efd678c411",
"score": "0.557089",
"text": "def wrap(url, person, options = {})\n # url will never be nil b/c of guarantee in AbstractSourceWrapper\n result = url_helper.image_path(url)\n raise \"could not generate protocol and host for #{url}. Have you set ActionController::Base.asset_host?\" unless result =~ /^http[s]?\\:\\/\\//\n result\n end",
"title": ""
},
{
"docid": "19dc92ff4c69461f4b24adf7a4f15b6b",
"score": "0.5566964",
"text": "def create_and_link_text_asset(client, customer_id, text, field_type)\n operations = []\n temp_id = next_temp_id\n\n # Create the Text Asset.\n operations << client.operation.mutate do |m|\n m.asset_operation = client.operation.create_resource.asset do |a|\n a.resource_name = client.path.asset(customer_id, temp_id)\n a.text_asset = client.resource.text_asset do |text_asset|\n text_asset.text = text\n end\n end\n end\n\n # Create an AssetGroupAsset to link the Asset to the AssetGroup.\n operations << client.operation.mutate do |m|\n m.asset_group_asset_operation = client.operation.create_resource\n .asset_group_asset do |aga|\n aga.field_type = field_type\n aga.asset_group = client.path.asset_group(\n customer_id,\n ASSET_GROUP_TEMPORARY_ID)\n aga.asset = client.path.asset(customer_id, temp_id)\n end\n end\n\n operations\nend",
"title": ""
},
{
"docid": "2b21fabc37eb2540a9054eb1cf90100b",
"score": "0.554571",
"text": "def add_file_from_url(url, description = nil, convert_to = nil, pingback_url = nil)\n Dropio::Resource.client.add_file_from_url(self,url,description, convert_to, pingback_url)\n end",
"title": ""
},
{
"docid": "fc48683cff16ab027c9e31fcd5d75aff",
"score": "0.55428153",
"text": "def generate_url\n Resource.client.generate_asset_url(self)\n end",
"title": ""
},
{
"docid": "a31f1cb5da9e9f085d608533402658d1",
"score": "0.55388904",
"text": "def create\n @physical_asset = PhysicalAsset.new(params[:physical_asset])\n\n respond_to do |format|\n if @physical_asset.save\n format.html { redirect_to @physical_asset, notice: 'Physical asset was successfully created.' }\n format.json { render json: @physical_asset, status: :created, location: @physical_asset }\n else\n format.html { render action: \"new\" }\n format.json { render json: @physical_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b2ec43a21a6b9d5bf7e3ac56f32cbf3",
"score": "0.55368364",
"text": "def map_file_to_url(file, path=nil, extension=nil, count=1)\n return BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind(file, path, extension, count)\n end",
"title": ""
},
{
"docid": "03f7c227929c906efc81180620ac0727",
"score": "0.5536752",
"text": "def asset_params\n params.require(:asset).permit(:name, :type_is_crypto, :source)\n end",
"title": ""
},
{
"docid": "5902e273980df7a2c091f4cace42abb5",
"score": "0.5531924",
"text": "def assets\n site = Jekylls3::Site.new\n if options[:file]\n site.upload_asset_file(options[:file])\n else\n site.upload_asset_directory(nil)\n end\n end",
"title": ""
},
{
"docid": "a4adf01bfbb02424b98e03c37f908856",
"score": "0.5527225",
"text": "def upload_asset(client, customer_id, image_url, image_name)\n # Creates an asset operation.\n operation = client.operation.create_resource.asset do |a|\n a.name = image_name\n a.type = :IMAGE\n a.image_asset = client.resource.image_asset do |image|\n image.data = open(image_url) { |f| f.read }\n end\n end\n\n # Issues a mutate request to add the asset.\n response = client.service.asset.mutate_assets(\n customer_id: customer_id,\n operations: [operation]\n )\n\n # Prints out information about the newly added asset.\n resource_name = response.results.first.resource_name\n puts \"Created image asset: #{resource_name}\"\n\n resource_name\nend",
"title": ""
},
{
"docid": "91c37d01c48d829d1a6b318ffa8b10ec",
"score": "0.55272055",
"text": "def asset_host; end",
"title": ""
},
{
"docid": "9db3c940611625fdad1a431087f4d1a1",
"score": "0.5522181",
"text": "def uhook_new_asset\n ::AssetPublic.new\n end",
"title": ""
},
{
"docid": "8439f9c8c0035e79b2a6f631805f1923",
"score": "0.5520335",
"text": "def generate_url\n Dropio::Resource.client.generate_asset_url(self)\n end",
"title": ""
},
{
"docid": "3e3b13813aa8d77ab716df1eb556390d",
"score": "0.55168396",
"text": "def create\n \n @asset = Asset.new(params[:asset])\n\n respond_to do |format|\n if @asset.save\n format.html { redirect_to @asset, notice: 'Asset was successfully created.' }\n format.json { render json: @asset, status: :created, location: @asset }\n else\n format.html { render action: \"new\" }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3c3762483ac58aa7b52fc24bc3ca393",
"score": "0.5510741",
"text": "def addResource (params)\r\n\t#Resource(id: integer, type: string, sourceURL: string, filepath: string, mimetype: string, tags: string, description: string, date: datetime, title: string)\r\n\t\tr = Resource.new do |r|\r\n\t\t r.kind = params[:type] unless params[:type].nil?\r\n\t\t r.mimetype = params[:mime] unless params[:mime].nil?\r\n\t\t r.sourceURL = params[:url] unless params[:url].nil?\r\n\t\t #if RUBY_PLATFORM.match(/win/) and !params[:path].nil?\r\n\t\t #\tic = Iconv.new('UTF-8','WINDOWS-1251')\r\n\t\t #\tr.filepath = ic.iconv(params[:path])\r\n\t\t #end\r\n\t\t r.filepath = params[:path] unless params[:path].nil?\r\n\t\t \r\n\t\t r.title = params[:title] unless params[:title].nil?\r\n\t\t r.tags = params[:tags] unless params[:tags].nil?\r\n\t\t r.date = DateTime::now()\r\n\t\tend\r\n\t\tr.save\r\n\t\treturn r.id\r\n\tend",
"title": ""
},
{
"docid": "704be3fd6a8958dda4ddca834186f95e",
"score": "0.5509747",
"text": "def asset_url_for(asset, options={})\n source = options.delete(:source)\n return source unless source.to_s.empty?\n if asset.file?\n source = url_for( :action => 'asset', :id => asset.id, :only_path => false)\n end\n if asset.url?\n source = asset.url\n end\n source\n end",
"title": ""
},
{
"docid": "cd32986ac8257d032e3d9a9bc13e0514",
"score": "0.5504514",
"text": "def edit_release_asset(asset_url, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "2f72a61f6f0ad69bb0e07759ebe4c3aa",
"score": "0.5489072",
"text": "def create\n @external_link = ExternalLink.new(external_link_params)\n\n err = false\n\n\n begin\n\n object = LinkThumbnailer.generate(external_link_params[:url])\n\n @external_link.title = object.title\n\n if (@external_link.description.blank?)\n @external_link.description = object.description\n end\n @external_link.favicon = object.favicon\n rescue => err\n error = true\n end\n\n respond_to do |format|\n if !error && @external_link.save\n format.html { redirect_to root_path, notice: \"External link was successfully created.\" }\n format.json { render :show, status: :created, location: @external_link }\n else\n format.html { render :new, status: :unprocessable_entity, notice: \"Please enter a complete link\" }\n format.json { render json: @external_link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf41e67b52fe1fa8c99134850047ee38",
"score": "0.5480999",
"text": "def link_asset(path); end",
"title": ""
},
{
"docid": "cf41e67b52fe1fa8c99134850047ee38",
"score": "0.5480999",
"text": "def link_asset(path); end",
"title": ""
},
{
"docid": "96becb23c8f7a0caf5cb6ccaa967a00c",
"score": "0.5472787",
"text": "def asset file, opts={}\n opts = { dev_file: opts } unless opts.class == Hash\n\n # return internet links\n return asset_include file if file.starts_with?('/') || file.starts_with?('http')\n\n if Lux.config(:compile_assets)\n # return second link if it is defined and we are in dev mode\n return asset_include opts[:dev_file] if opts[:dev_file]\n\n # try to create list of incuded files and show every one of them\n files = LuxAssets.files(file) || []\n data = files.inject([]) do |total, asset|\n if asset.is_a?(Proc)\n tag_name = file.include?('css') ? :style : :script\n total.push({}.tag tag_name, asset.call)\n else\n total.push asset_include '/compiled_asset/' + asset\n end\n end\n\n data.map{ |it| it.sub(/^\\s\\s/,'') }.join(\"\\n\")\n else\n # return asset link in production or fail unless able\n manifest = Lux.ram_cache('asset-manifest') { JSON.load Lux.root.join('public/manifest.json').read }\n mfile = manifest['files'][file]\n\n if mfile.empty?\n unless opts[:raise].is_a?(FalseClass)\n raise 'Compiled asset link for \"%s\" not found in manifest.json' % file\n end\n\n nil\n else\n opts[:integrity] = manifest.dig('integrity', file)\n return asset_include(Lux.config.assets_root.to_s + mfile, opts)\n end\n end\n end",
"title": ""
},
{
"docid": "457cd857b38a64582e1e672c2a4f78d8",
"score": "0.5472102",
"text": "def create\n @asset = Asset.new(params[:asset])\n\n respond_to do |format|\n if @asset.save\n flash[:notice] = 'Asset was successfully created.'\n format.html { redirect_to(admin_asset_path(@asset)) }\n format.xml { render :xml => @asset, :status => :created, :location => @asset }\n else\n assign_lovs\n format.html { render :action => \"new\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc95d7d59b1afa07c1a518127c9ae059",
"score": "0.5470513",
"text": "def asset_params\n params.require(:asset).permit(:uri)\n end",
"title": ""
},
{
"docid": "96c61555836ea626e28344c5a3ddfd42",
"score": "0.5469169",
"text": "def create\n @asset = Asset.new(asset_params)\n\n respond_to do |format|\n if @asset.save\n format.html { redirect_to @asset, notice: 'Asset was successfully created.' }\n format.json { render :show, status: :created, location: @asset }\n else\n format.html { render :new }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "572eecafa9a54f3f0d94062bab7238e2",
"score": "0.5468438",
"text": "def load_video_asset( asset_url )\n unless File.exists? asset_url.fileSystemRepresentation\n lp \"Video asset '#{asset_url.fileSystemRepresentation}' is missing.\",\n force_color: :cyan\n #TODO: FIXEN bringt einen Bug\n lp Dir.resource('placeholder/file_warning.m4v')\n asset_url = Dir.resource('placeholder/file_warning.m4v').to_file_url\n end\n\n AVURLAsset.URLAssetWithURL(asset_url, options: nil)\n end",
"title": ""
},
{
"docid": "67fdc5d233be18f67185fc0fd0880f2a",
"score": "0.5458639",
"text": "def asset_make_public(asset_uuid)\n params = {\n :uuid => asset_uuid #.is_a?(Array) ? asset_uuid.join(',') : asset_uuid\n }\n call_method('Asset.MakePublic', params)\n end",
"title": ""
},
{
"docid": "b22926857d9bb5c96902f4fe432431aa",
"score": "0.54558194",
"text": "def create_asset_type\n IndexedRepresentation::ContentType.new({\n name: 'Asset',\n content_type: 'Asset',\n fields: {\n 'title' => { name: 'title', type: :String },\n 'description' => { name: 'description', type: :String },\n 'file' => { name: 'file', type: :Json }\n }\n })\n end",
"title": ""
},
{
"docid": "1037da98e94250257a8106addda71542",
"score": "0.5445144",
"text": "def create\n @asset = assets.build(params[:asset])\n\n respond_to do |format|\n if @asset.save\n flash[:notice] = 'Asset was successfully created.'\n format.html { redirect_to user_user_asset_url(:user_id => @user, :id => @asset) }\n format.xml { head :created, :location => user_user_asset_url(:user_id => @user, :id => @asset) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @asset.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "9d000c76427981d8dcc0ded040e08fdb",
"score": "0.54385626",
"text": "def asset_url(source, options = {})\n path_to_asset(source, options.merge(:protocol => :request))\n end",
"title": ""
},
{
"docid": "1a27fbe356d9454c1424826f178a52cd",
"score": "0.5432795",
"text": "def add_from_url\n url = escape_s3_url(params[:path], params[:filename])\n\n if !url.present?\n logger.info(\"No image URL provided\", :no_image_url_provided, params)\n render json: {:errors => \"No image URL provided\"}, status: 400, content_type: 'text/plain'\n end\n\n add_image(params[:listing_id], {}, url)\n end",
"title": ""
},
{
"docid": "a5efdb43e1fb21dc9d3d11e744c533bf",
"score": "0.5429862",
"text": "def create_from_string(str, options = {})\n filename = options.delete(:filename) || \"file-#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.txt\"\n\n opts = {:upload_file => \"#{Asset.string_base_path}#{filename}\", :user_id => 1}.merge(options)\n\n asset = Asset.new(opts)\n asset.data = AssetStringIO.new(filename, str)\n\n if asset.save\n Effective::DelayedJob.new.process_asset(asset)\n asset\n end\n end",
"title": ""
},
{
"docid": "14a5c4238e6243432ff8687e01438ff3",
"score": "0.5421605",
"text": "def asset_url(source, options = {})\n path_to_asset(source, options.merge(protocol: :request))\n end",
"title": ""
},
{
"docid": "23b78b20ca7149f72e8073dfb908c234",
"score": "0.5409788",
"text": "def create_asset\n @assets ||= Asset.all\n @asset = Asset.new(asset_params)\n @asset.save\n flash[:notice] = t('asset_create')\n end",
"title": ""
},
{
"docid": "b7134a45c1bb58d62af0a26e423d002a",
"score": "0.54096895",
"text": "def asset_url(*args)\n \"#{request.protocol}#{request.host_with_port}#{asset_path(*args)}\"\n end",
"title": ""
},
{
"docid": "091ba948a9b7ebe7a6beb54cb3e68db4",
"score": "0.54082245",
"text": "def import_asset(source)\n @assets[source] = File.join('/assets', source.split(\":\")[1])\n end",
"title": ""
},
{
"docid": "091ba948a9b7ebe7a6beb54cb3e68db4",
"score": "0.54082245",
"text": "def import_asset(source)\n @assets[source] = File.join('/assets', source.split(\":\")[1])\n end",
"title": ""
},
{
"docid": "3b8226ec8df41be5db62ef3d3ae47305",
"score": "0.5394562",
"text": "def create_assets\n self.hero_image.styles.each do |key,style|\n width = (/(\\d+)x/.match(style.geometry))[1]\n type = (/\\.(jpg|png|gif)/.match(style.attachment.to_s))[1]\n public_hero = File.join(Rails.root, 'public', 'assets', \"hero_#{width}.#{type}\")\n source_image = File.join(Rails.root,'public',self.hero_image(key).gsub(/\\?.*$/,''))\n %x( cp #{source_image} #{public_hero} )\n end\n end",
"title": ""
},
{
"docid": "847be1b28f5b83207eda63b6af5473e8",
"score": "0.539439",
"text": "def create\n assets = []\n\n asset_params[:file].each do |file|\n asset = Asset.new(file: file, app_id: @app.id)\n assets << asset\n end\n\n assets.each do |asset|\n next if asset.save\n @asset.errors.add(:base, :unprocessable_entity)\n respond_modal_with [@app, @asset], location: :new\n return\n end\n\n respond_modal_with [@app, @asset], location: app_assets_url\n end",
"title": ""
},
{
"docid": "8e5f8809263bb43f93557a67698d5486",
"score": "0.538946",
"text": "def create\n @asset = Asset.create(asset_params)\n end",
"title": ""
},
{
"docid": "d52eaf841d7d4e43551635e2c074a5de",
"score": "0.53859013",
"text": "def asset_host\n if model.new_record?\n # this model hasn't been persisted yet. The url will be local so we can use a relative\n # url instead. Carrierwave/fog will by default use the asset_host from the configuration\n # which would point to an invalid /uploads/tmp location on our cloud drive.\n \"\"\n else\n super\n end\n end",
"title": ""
},
{
"docid": "fe65cc93fa506049e280a7255f29f417",
"score": "0.5379561",
"text": "def upload_asset(release_url, path_or_file, options = {})\n file = path_or_file.respond_to?(:read) ? path_or_file : File.new(path_or_file, \"rb\")\n options[:content_type] ||= content_type_from_file(file)\n raise Octokit::MissingContentType.new if options[:content_type].nil?\n unless name = options[:name]\n name = File.basename(file.path)\n end\n upload_url = release(release_url).rels[:upload].href_template.expand(:name => name)\n\n request :post, upload_url, file.read, parse_query_and_convenience_headers(options)\n ensure\n file.close if file\n end",
"title": ""
},
{
"docid": "ea9b7a4cdb60b2670abadb7437d9015e",
"score": "0.5377576",
"text": "def fileupload_create(params, _request = nil)\n self[Uploader.guid_column] = params[:guid]\n fileupload_set_assetable(params)\n save\n end",
"title": ""
},
{
"docid": "5767441da2875f9880114ee2c4a9e89c",
"score": "0.5374637",
"text": "def create\n @link = current_user.links.new({\n :name => params[:link_name],\n :price => params[:link_price]\n })\n\n if params[:link_local_file].present? || params[:link_remote_file].present?\n @link.upload_tmp = params[:link_local_file]\n end\n\n respond_to do |format|\n if @link.save\n #MC -- TODO we need to handle this differently if a remote file.\n @link.save_upload(:upload_tmp => @link.upload_tmp)\n format.html { redirect_to edit_link_path(@link), notice: ['Link was successfully created.'] }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { redirect_to links_path, :notice => @link.errors.values.flatten}\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5d4beecf63ddc50dab40a91a76e3c95",
"score": "0.53738296",
"text": "def asset_params\n params.require(:asset).permit(:file, :description)\n end",
"title": ""
},
{
"docid": "f20ab3be145428e522079be89b41fc3a",
"score": "0.5370807",
"text": "def upload(options = {})\n source_url = options.delete(:source_url)\n registration_endpoint = '/assets?action=registerUpload'\n\n registration_body = {\n \"registerUploadRequest\": {\n \"owner\": options[:owner],\n \"recipes\": [\n \"urn:li:digitalmediaRecipe:feedshare-image\"\n ],\n \"serviceRelationships\": [\n {\n \"identifier\": \"urn:li:userGeneratedContent\",\n \"relationshipType\": \"OWNER\"\n }\n ]\n }\n }\n\n registration_response = post(registration_endpoint, MultiJson.dump(registration_body), \"Content-Type\" => \"application/json\")\n mash_registration_response = Mash.from_json(registration_response.body)['value']\n upload_url = mash_registration_response['uploadMechanism']['com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest']['uploadUrl']\n asset = mash_registration_response['asset']\n fileData = file(source_url, options)\n\n response =\n @connection.put(upload_url, fileData) do |req|\n req.headers['Content-Length'] = req.body.length.to_s\n req.headers['Content-Type'] = fileData.content_type\n end\n\n asset\n end",
"title": ""
},
{
"docid": "7266e6d17e6ba5f37740357d5ef51154",
"score": "0.5368614",
"text": "def create\n if !has_right?(:create)\n redirect_to :unauthorized\n return\n end\n @asset = Asset.new(params[:asset])\n\n respond_to do |format|\n if @asset.save\n flash[:notice] = 'Asset was successfully created.'\n format.html { redirect_to asset_url(@asset) }\n format.xml { head :created, :location => asset_url(@asset) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @asset.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "20eb4602d5d8f8d3953182b62eb628ab",
"score": "0.5365921",
"text": "def create_file_from_url(env, uri, file_info, auth_header = {})\n ::FileSet.new(import_url: uri.to_s, label: file_info[:file_name]) do |fs|\n actor = Hyrax::Actors::FileSetActor.new(fs, env.user)\n# TODO: add more metadata\n# TODO: reconsider visibility\n actor.create_metadata(visibility: env.curation_concern.visibility)\n fs.save!\n # TODO: add option for batch vs single assignment?\n @file_sets << fs\n structure_to_repo_map[file_info[:id]] = fs.id\n if uri.scheme == 'file'\n # Turn any %20 into spaces.\n file_path = CGI.unescape(uri.path)\n IngestLocalFileJob.perform_later(fs, file_path, env.user)\n else\n ImportUrlJob.perform_later(fs, operation_for(user: actor.user), auth_header)\n end\n end\n end",
"title": ""
},
{
"docid": "5581676ad4a03adec2da9ee8d2ceb5b9",
"score": "0.53627026",
"text": "def create_layout_asset(data)\n if data && data.key?(:file)\n data = data.dup\n data[:file] = Faraday::UploadIO.new(data[:file], data[:content_type])\n options = {multipart: true}\n end\n\n post 'layout_assets', data, (options || {})\n end",
"title": ""
},
{
"docid": "4bc96a859bae22b05c8ea25f767d3efb",
"score": "0.5356793",
"text": "def create\n @external_resource = ExternalResource.new(external_resource_params)\n\n respond_to do |format|\n if @external_resource.save\n format.html { redirect_to @external_resource, notice: 'External resource was successfully created.' }\n format.json { render :show, status: :created, location: @external_resource }\n else\n format.html { render :new }\n format.json { render json: @external_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b6235b12d1ad9bc3fad9952f9616023",
"score": "0.53567004",
"text": "def create_youtube_video_asset(\n client,\n customer_id,\n youtube_video_id,\n youtube_video_name\n)\n # Creates an asset operation.\n operation = client.operation.create_resource.asset do |a|\n a.name = youtube_video_name\n a.type = :YOUTUBE_VIDEO\n a.youtube_video_asset = client.resource.youtube_video_asset do |yva|\n yva.youtube_video_id = youtube_video_id\n end\n end\n\n # Issues a mutate request to add the asset.\n response = client.service.asset.mutate_assets(\n customer_id: customer_id,\n operations: [operation],\n )\n\n # Prints out information about the newly added asset.\n asset_resource_name = response.results.first.resource_name\n puts \"A new YouTube video asset has been added with resource name: \" \\\n \"'#{asset_resource_name}'.\"\n\n asset_resource_name\nend",
"title": ""
},
{
"docid": "9e8a09c1b72caf737877fe2b89f4e559",
"score": "0.53512424",
"text": "def add_photo_file_asset(xml, photo_file_asset, resource_type)\n ds_name = photo_file_asset.datastreams.keys.select {|k| k !~ /(DC|RELS\\-EXT|descMetadata)/}.first\n ds = photo_file_asset.datastreams[ds_name]\n xml.resource(\"id\" => ds.label, \"type\" => resource_type, \"objectId\" => photo_file_asset.pid){\n xml.file(\"id\" => ds.label, \"format\" => \"JPG\", \"mimetype\" => ds.mime_type, \n \"size\" => File.size(ds.blob), \"preserve\" => \"yes\", \"publish\" => \"yes\", \"shelve\" => \"yes\" ) {\n xml.location(\"type\" => \"datastreamID\") {\n xml.text ds.dsid\n }\n xml.checksum(\"type\" => \"md5\") {\n xml.text Digest::MD5.hexdigest(ds.blob.read)\n }\n xml.checksum(\"type\" => \"sha1\") {\n xml.text Digest::SHA1.hexdigest(ds.blob.read)\n }\n }\n }\n end",
"title": ""
},
{
"docid": "87a4f7f971064728a6e470905a6ff50b",
"score": "0.5347761",
"text": "def create\n @asset = Asset.new(asset_params)\n\n if @asset.save\n render :show, status: :created, location: @asset\n else\n render json: @asset.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2e4acbc2a9251a5f01ad4d91bfd4e8fc",
"score": "0.5347325",
"text": "def asset_path(kind, source)\n path = asset_path_proc.call source\n return path if self.class.development?\n\n host = asset_host_proc.\n call(path, request).\n sub('https:', '')\n\n File.join(host, path)\n end",
"title": ""
}
] |
f9b6126f4e2879709c0d91ea4db406bd | Is this really even used anymore? | [
{
"docid": "1e17deb9d61f93e7fe162aab04547f6d",
"score": "0.0",
"text": "def comma_color\n @breadcrumb_comma_color ||= params[:private] ? \"#DCDCDC\" : \"#FFF\"\n end",
"title": ""
}
] | [
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.7544944",
"text": "def used?; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.75039256",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.75039256",
"text": "def used; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.73891234",
"text": "def in_use; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.73891234",
"text": "def in_use; end",
"title": ""
},
{
"docid": "5928f8efe9c6c2d408ea21a4cdce83ad",
"score": "0.7241111",
"text": "def preliminary?; end",
"title": ""
},
{
"docid": "d75c7529a52027a3fe78dfdb73b1e57c",
"score": "0.7142827",
"text": "def in_use?; end",
"title": ""
},
{
"docid": "382be520aee275d1a9f0b188eb46020f",
"score": "0.7002898",
"text": "def used?\n end",
"title": ""
},
{
"docid": "6e6891d187cd127b8bc7e632ec0b2d50",
"score": "0.69695026",
"text": "def unitary?; end",
"title": ""
},
{
"docid": "950bef128403f02279cc1bb4ef43a028",
"score": "0.6887523",
"text": "def realized?; end",
"title": ""
},
{
"docid": "950bef128403f02279cc1bb4ef43a028",
"score": "0.6887523",
"text": "def realized?; end",
"title": ""
},
{
"docid": "500e78c25ff0aa5489e4cf3a2b9da556",
"score": "0.6809359",
"text": "def worthless?\n false\n end",
"title": ""
},
{
"docid": "4ea6f5c11a3bc16e2394d273e748b292",
"score": "0.67903924",
"text": "def internal?; end",
"title": ""
},
{
"docid": "7e082a39938aeae2f38a9ca3823e4d1b",
"score": "0.6767386",
"text": "def used=(_); end",
"title": ""
},
{
"docid": "176e9ecb6057b075f2fa11a074eeb868",
"score": "0.67249084",
"text": "def old_enough?\n end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6686965",
"text": "def desired; end",
"title": ""
},
{
"docid": "0212351345358772373f549b97821c62",
"score": "0.66711473",
"text": "def regular?; end",
"title": ""
},
{
"docid": "334240d22c3d5bd0b2bbbcd882626810",
"score": "0.6660968",
"text": "def needed?; end",
"title": ""
},
{
"docid": "5f313c8c149caf5a63439e1b9cf79a18",
"score": "0.6628331",
"text": "def delicious?\n return true\n end",
"title": ""
},
{
"docid": "5f313c8c149caf5a63439e1b9cf79a18",
"score": "0.6628331",
"text": "def delicious?\n return true\n end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.6569457",
"text": "def apop?; end",
"title": ""
},
{
"docid": "d95befff0537c0b7b2e53bcaf47fe645",
"score": "0.65197384",
"text": "def real?; end",
"title": ""
},
{
"docid": "2f3da174f7730c09e6d6b5b9ec18c1c1",
"score": "0.64945096",
"text": "def delicious?\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "2f3da174f7730c09e6d6b5b9ec18c1c1",
"score": "0.64945096",
"text": "def delicious?\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "8ef86a1189509bccd2cb3f913a5cbe81",
"score": "0.647293",
"text": "def well_formed?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "cd0ca5b657e618278f0cb7cb242e3075",
"score": "0.64649385",
"text": "def value_used?; end",
"title": ""
},
{
"docid": "cd0ca5b657e618278f0cb7cb242e3075",
"score": "0.64649385",
"text": "def value_used?; end",
"title": ""
},
{
"docid": "48aa6ae56116baa2a62ba9233aa5fbd0",
"score": "0.6456031",
"text": "def threadsafe?; end",
"title": ""
},
{
"docid": "a483fff897fc279ba108326d122b0560",
"score": "0.6386012",
"text": "def pseudo?; false end",
"title": ""
},
{
"docid": "d882f3a248ba33088a4284a47c263d0d",
"score": "0.6368905",
"text": "def missing?; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.6337315",
"text": "def internal; end",
"title": ""
},
{
"docid": "6501ed7cce7b2830a74ffc2284f55c65",
"score": "0.63252217",
"text": "def old?\r\n end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63206947",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63206947",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63206947",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63206947",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63206947",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63206947",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "954c5828178f6e4a659c40ef92736547",
"score": "0.6317666",
"text": "def helpful!\n\n\t\tend",
"title": ""
},
{
"docid": "c4809ad1cf5326012cb398f72e362cd7",
"score": "0.62888926",
"text": "def use() @used = true end",
"title": ""
},
{
"docid": "77f9438b791d71c563a4f3dc16bb5610",
"score": "0.62783223",
"text": "def worthy?\n true\n end",
"title": ""
},
{
"docid": "f6d4a510b1064cdde36cfabb37bc801a",
"score": "0.6251164",
"text": "def threadsafe; end",
"title": ""
},
{
"docid": "b7567a2a68cade31f2360723a4c42dc7",
"score": "0.6245744",
"text": "def used_by; end",
"title": ""
},
{
"docid": "351d6b035a75ce301f020861a1907560",
"score": "0.62217295",
"text": "def check; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6221648",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6221648",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6221648",
"text": "def available; end",
"title": ""
},
{
"docid": "907e9765259f083a71b0ebf61956f3a0",
"score": "0.6221648",
"text": "def available; end",
"title": ""
},
{
"docid": "7db0727baf89eb76beac27c515d7fe32",
"score": "0.62210524",
"text": "def support; end",
"title": ""
},
{
"docid": "a8fd910ed93bc90f94f6a74a6d40c8d1",
"score": "0.62139904",
"text": "def semact?; true; end",
"title": ""
},
{
"docid": "6e37c1e308f058381c565a17b02678f5",
"score": "0.6211316",
"text": "def hermitian?; end",
"title": ""
},
{
"docid": "e3c8bb34b834a21ccdec6eb123ef79c4",
"score": "0.62095875",
"text": "def ordinary?\n end",
"title": ""
},
{
"docid": "73068497a6ac43af09c4f919b5de0290",
"score": "0.62035507",
"text": "def obsolete?; end",
"title": ""
},
{
"docid": "b7cfdec5315b5d3c26b002081b1dbae3",
"score": "0.6199018",
"text": "def coming_soon; end",
"title": ""
},
{
"docid": "5a503f9c796939b32682606735cbeb50",
"score": "0.61973494",
"text": "def works? \n # Not implemented\n end",
"title": ""
},
{
"docid": "e44ae2cef169d29f78b2b6306add59da",
"score": "0.6193557",
"text": "def huddlingly()\n end",
"title": ""
},
{
"docid": "8b608597e4f8cb342968a26900959e68",
"score": "0.6181311",
"text": "def extended?; end",
"title": ""
},
{
"docid": "922ad13267ad637c9292ec039c11884f",
"score": "0.61709917",
"text": "def obscured?; end",
"title": ""
},
{
"docid": "36b960699a465eead42eac6e263957de",
"score": "0.61702454",
"text": "def sharded?; false; end",
"title": ""
},
{
"docid": "36b960699a465eead42eac6e263957de",
"score": "0.61702454",
"text": "def sharded?; false; end",
"title": ""
},
{
"docid": "9253ae7544a284fb139e1844130a4216",
"score": "0.61641127",
"text": "def standalone?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "8a91bfaa4b92b136c5d230a732b0d6e6",
"score": "0.6148325",
"text": "def eod?; end",
"title": ""
},
{
"docid": "01aa8a279f8410fe445f4355072d70e1",
"score": "0.6137959",
"text": "def local?; end",
"title": ""
},
{
"docid": "1194b7abce3f20cf44ec735db13bde78",
"score": "0.6133835",
"text": "def used_yadis=(_arg0); end",
"title": ""
},
{
"docid": "7d73ca93aed82d814ee3609681895be5",
"score": "0.6132176",
"text": "def missed?; end",
"title": ""
},
{
"docid": "7d73ca93aed82d814ee3609681895be5",
"score": "0.6132176",
"text": "def missed?; end",
"title": ""
},
{
"docid": "abf4063ba21175349965f6ecddefc7d2",
"score": "0.6120839",
"text": "def isolated?; end",
"title": ""
},
{
"docid": "bb2cf20999efd9fcacf7668301ebe565",
"score": "0.61206615",
"text": "def missing; end",
"title": ""
},
{
"docid": "bb2cf20999efd9fcacf7668301ebe565",
"score": "0.61206615",
"text": "def missing; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.61195314",
"text": "def isolated; end",
"title": ""
},
{
"docid": "1e7443a943ee7a44cb8ee2e385ff0add",
"score": "0.6117183",
"text": "def on_potential_false_positives; end",
"title": ""
},
{
"docid": "4af44ca7d0e2e7bacc0145d22162a747",
"score": "0.61122924",
"text": "def deprecated?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "7b052f96c2626d0ef4532828697c9b05",
"score": "0.61109984",
"text": "def used_yadis; end",
"title": ""
},
{
"docid": "19be6f67838ebf28cae9c0ba115e47d3",
"score": "0.6106442",
"text": "def local?; true end",
"title": ""
},
{
"docid": "19be6f67838ebf28cae9c0ba115e47d3",
"score": "0.6106442",
"text": "def local?; true end",
"title": ""
},
{
"docid": "19be6f67838ebf28cae9c0ba115e47d3",
"score": "0.6106442",
"text": "def local?; true end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.60947096",
"text": "def wedding; end",
"title": ""
},
{
"docid": "3ad49753f81ba3dea865dad3446438a5",
"score": "0.6087059",
"text": "def standalone?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "1acb0e2012761a8bf78cc4d86bc736e7",
"score": "0.60870504",
"text": "def subscopable?; end",
"title": ""
},
{
"docid": "fdc70bf5f3450f65c8fa1386ccf579ea",
"score": "0.6085449",
"text": "def fresh?; end",
"title": ""
},
{
"docid": "fdc70bf5f3450f65c8fa1386ccf579ea",
"score": "0.6085449",
"text": "def fresh?; end",
"title": ""
},
{
"docid": "5ab4a7d9a5351323aa8072b0801e0ead",
"score": "0.60759306",
"text": "def utilized?\n\n end",
"title": ""
},
{
"docid": "08161b9f4ab9fe46a373d1b56916f316",
"score": "0.60709107",
"text": "def defined?; end",
"title": ""
},
{
"docid": "08161b9f4ab9fe46a373d1b56916f316",
"score": "0.60709107",
"text": "def defined?; end",
"title": ""
},
{
"docid": "d092a19d247a67d7bbde5d6b0bc29b76",
"score": "0.60656893",
"text": "def needed?\n true\n end",
"title": ""
},
{
"docid": "77d6274fb54695f0fe26ab41866beeea",
"score": "0.6065652",
"text": "def global?; end",
"title": ""
},
{
"docid": "709318613e603554beaffea15c90b6a8",
"score": "0.6056918",
"text": "def stable?; end",
"title": ""
},
{
"docid": "709318613e603554beaffea15c90b6a8",
"score": "0.6056918",
"text": "def stable?; end",
"title": ""
},
{
"docid": "e66c3e6966b775d1799a6b8fed500121",
"score": "0.60485405",
"text": "def check()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.6047796",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "16146438a17eec506c5ef8672118f2e8",
"score": "0.6041211",
"text": "def rhetorical?\n false\n end",
"title": ""
},
{
"docid": "d7b33403f81af34a4098744291754a70",
"score": "0.60342425",
"text": "def specific? ; false ; end",
"title": ""
},
{
"docid": "c397ab609993a92b1d6433f8449ca4a0",
"score": "0.5999649",
"text": "def alive?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2f4dbceb02deebff04d4e60011ccbc0e",
"score": "0.5997099",
"text": "def warn_about_potential_false_positives?; end",
"title": ""
},
{
"docid": "d0991d39b3c49cefeda109aed5d76565",
"score": "0.5988462",
"text": "def missed; end",
"title": ""
},
{
"docid": "28d26066562fac58a6f79613a3e4753e",
"score": "0.59852076",
"text": "def internal?\n false\n end",
"title": ""
},
{
"docid": "15b6bed0805ad08653e3133a6abdc30f",
"score": "0.5978024",
"text": "def soy_edificable\n return true\n end",
"title": ""
},
{
"docid": "e45b19e7e2a694f299cd358e62916534",
"score": "0.59686476",
"text": "def unused?\n\t\t@unused\n\tend",
"title": ""
},
{
"docid": "80c1c6948e399ed2180e58a775616e79",
"score": "0.59539056",
"text": "def vxace?() true end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5928832",
"text": "def anchored; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.592839",
"text": "def preparable; end",
"title": ""
}
] |
a7983d564fdd4edc0155a32c922ae96a | GET /gradelists/1 GET /gradelists/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "8d1bfd0891246be79dd37f000591516c",
"score": "0.7406524",
"text": "def index\n @gradelists = Gradelist.all\n end",
"title": ""
},
{
"docid": "378b8c3cc64d183cb277a10cc1b2a913",
"score": "0.7131221",
"text": "def index\n @grades = Grade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grades }\n end\n end",
"title": ""
},
{
"docid": "d17fdb8fd762b60c7396fe1ac1737c37",
"score": "0.7022931",
"text": "def set_gradelist\n @gradelist = Gradelist.find(params[:id])\n end",
"title": ""
},
{
"docid": "06b159235c5f874e775c29a7108180ce",
"score": "0.6672424",
"text": "def grades \n students = Student.order(grade: :desc)\n render json: students\n end",
"title": ""
},
{
"docid": "c2c6c7fb0c49180e9474b8eff2409fd5",
"score": "0.6639823",
"text": "def lists\n\tget('/lists.json')\nend",
"title": ""
},
{
"docid": "aab1eeeeb5a9fc79bb3f153a5823c444",
"score": "0.6542384",
"text": "def show\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "aab1eeeeb5a9fc79bb3f153a5823c444",
"score": "0.6542384",
"text": "def show\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "aab1eeeeb5a9fc79bb3f153a5823c444",
"score": "0.6542384",
"text": "def show\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "aab1eeeeb5a9fc79bb3f153a5823c444",
"score": "0.6542384",
"text": "def show\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "f95c3037b3ef2aa6de06265825c80e65",
"score": "0.6488949",
"text": "def create\n @gradelist = Gradelist.new(gradelist_params)\n\n respond_to do |format|\n if @gradelist.save\n format.html { redirect_to @gradelist, notice: 'Gradelist was successfully created.' }\n format.json { render :show, status: :created, location: @gradelist }\n else\n format.html { render :new }\n format.json { render json: @gradelist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1db58b15b230b8bbcc7da5ecfd026dfe",
"score": "0.6407944",
"text": "def update\n respond_to do |format|\n if @gradelist.update(gradelist_params)\n format.html { redirect_to @gradelist, notice: 'Gradelist was successfully updated.' }\n format.json { render :show, status: :ok, location: @gradelist }\n else\n format.html { render :edit }\n format.json { render json: @gradelist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5924fef7d3e93b8ce691d58b453205ff",
"score": "0.63977087",
"text": "def index\n grades = SisGrade.by_newest\n\n grades = scope_grades(grades)\n sis_grades = {}\n\n if params[:page].present?\n grades = grades.paginate(page: @page, per_page: @per_page)\n sis_grades[:total_pages] = grades.total_pages\n end\n\n sis_grades[:grades] = grades\n\n render json: sis_grades\n end",
"title": ""
},
{
"docid": "59813ea4dd499cda70cfc065ef32b772",
"score": "0.6347661",
"text": "def index\n @gear_lists = GearList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gear_lists }\n end\n end",
"title": ""
},
{
"docid": "737b70ebcbd012ef1684c983de0fe8c6",
"score": "0.63419914",
"text": "def get_grade_items\n render json: ::Rubrics::Item::Base.find(params.require(:base_id)).create_grade_items\n end",
"title": ""
},
{
"docid": "c59b4837f21b1f92a62193c00d702782",
"score": "0.63116336",
"text": "def index\n #@projects = Project.cached_all_projects\n @projects = params[:grade_id] ? Project.where(grade_id: params[:grade_id]) : Project\n @projects = @projects.includes(:grade, :user).order(\"grade_id ASC, status DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "1b0007652c333f94556a7e9f26965193",
"score": "0.6299159",
"text": "def show\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @grade }\n end\n\n end",
"title": ""
},
{
"docid": "ed3b161b7d25674219b178756dda6d36",
"score": "0.6289632",
"text": "def index\n @grades = Grade.all\n end",
"title": ""
},
{
"docid": "ed3b161b7d25674219b178756dda6d36",
"score": "0.6289632",
"text": "def index\n @grades = Grade.all\n end",
"title": ""
},
{
"docid": "ed3b161b7d25674219b178756dda6d36",
"score": "0.6289632",
"text": "def index\n @grades = Grade.all\n end",
"title": ""
},
{
"docid": "ed3b161b7d25674219b178756dda6d36",
"score": "0.6289632",
"text": "def index\n @grades = Grade.all\n end",
"title": ""
},
{
"docid": "48eb32f779f8eb7ad1a630e198ee533c",
"score": "0.62717897",
"text": "def index\n @user = current_user\n @grades = @user.grades.all\n\n respond_to do |format|\n format.html \n end\n end",
"title": ""
},
{
"docid": "476d33235b4b3ebcdecdea7960e3e9e1",
"score": "0.6242414",
"text": "def get_org_unit_grades(org_unit_id)\n path = \"/d2l/api/le/#{$le_ver}/#{org_unit_id}/grades/\"\n _get(path)\n # RETURN: This action returns a JSON array of GradeObject blocks.\nend",
"title": ""
},
{
"docid": "52353c0bdd9ff97b202eb7f3bd49bad7",
"score": "0.6239467",
"text": "def show\n @degreelist = Degreelist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @degreelist }\n end\n end",
"title": ""
},
{
"docid": "10c1396a6c5bbb216816bd5c002e7e5c",
"score": "0.6229095",
"text": "def show\n @final_grade = FinalGrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @final_grade }\n end\n end",
"title": ""
},
{
"docid": "d3e2db8cee827ee49ea9250af886d198",
"score": "0.6224136",
"text": "def show\n @title = \"View Grading Scheme\"\n @grade_scheme = GradeScheme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade_scheme }\n end\n end",
"title": ""
},
{
"docid": "d191ebc00b5001f1359edec548b5f0a9",
"score": "0.6205959",
"text": "def show\n @badge_list = BadgeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @badge_list }\n end\n end",
"title": ""
},
{
"docid": "3c9cf4caae26f57900df159081ad46f0",
"score": "0.61911064",
"text": "def index\n @other_graduates = OtherGraduate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @other_graduates }\n end\n end",
"title": ""
},
{
"docid": "d92ce9d458bc2a9cab727194741a781f",
"score": "0.6163474",
"text": "def index\n @org_lists = OrgList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @org_lists }\n end\n end",
"title": ""
},
{
"docid": "7f979c66aaaa57513bfc0d517044ec9e",
"score": "0.6161443",
"text": "def gradelist_params\n params.require(:gradelist).permit(:name, :id, :scr)\n end",
"title": ""
},
{
"docid": "079c562167b1661fe84451892883fae8",
"score": "0.61605203",
"text": "def index\n @item_grades = @current_user.items_with_grades(@course)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @grades }\n end\n end",
"title": ""
},
{
"docid": "77a1d3e486268772863d6922fb51ab9a",
"score": "0.6158535",
"text": "def list\n JSON.parse get(\"list/json\")\n end",
"title": ""
},
{
"docid": "b49c3329f9cc7a92f05b2fdc8835bc43",
"score": "0.6145521",
"text": "def index\n @luggages = luggages.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @luggages }\n end\n end",
"title": ""
},
{
"docid": "053cf1cf24e5d564b610ac28c7ede474",
"score": "0.61267424",
"text": "def grades\n @user = User.find(params[:user_id])\n @grades = @user.grades.all\n \n respond_to do |format|\n format.js \n end\n end",
"title": ""
},
{
"docid": "1ff88ef5a48b425b502d2a974c94ee15",
"score": "0.61091405",
"text": "def new\n @grade = Grade.new\n\t@repositories = Repository.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "2ca8047d990c0de40e1762c2f5a1fcaa",
"score": "0.61076003",
"text": "def show\n @grades = Grade.all\n end",
"title": ""
},
{
"docid": "383d72aa9131c526921e76ec5c605bc6",
"score": "0.6088255",
"text": "def index\n @bldg_permits = BldgPermit.all\n\n render json: @bldg_permits\n end",
"title": ""
},
{
"docid": "49d91c90ea7630e424042fda719d3b51",
"score": "0.6083651",
"text": "def show\n @interim_grade = InterimGrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interim_grade }\n end\n end",
"title": ""
},
{
"docid": "0cd55f5de5e1e186a95437c1c85abced",
"score": "0.60800207",
"text": "def show\n @employee_grade = EmployeeGrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee_grade }\n end\n end",
"title": ""
},
{
"docid": "c51e82de6f755b21c6626b48d09350bf",
"score": "0.60712093",
"text": "def new\n @resource = Resource.new\n @grades = Grade.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "b31695038e29f533d478527a0f1694db",
"score": "0.60507107",
"text": "def index\n @badges = Badge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges }\n end\n end",
"title": ""
},
{
"docid": "1e18e4d3553fdeebce81a5c5c0581a77",
"score": "0.6032057",
"text": "def new\n @student = Student.find(params[:student_id])\n @gradelevel = @student.gradelevels.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gradelevel }\n end\n end",
"title": ""
},
{
"docid": "7f1c500745fd5376581323716b434efe",
"score": "0.6024571",
"text": "def index\n @need_helps = NeedHelp.find_all_by_gid(params[:gid])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @need_helps }\n end\n end",
"title": ""
},
{
"docid": "c9680a49cb1263e53bad3f250514cc09",
"score": "0.60190105",
"text": "def destroy\n @gradelist.destroy\n respond_to do |format|\n format.html { redirect_to gradelists_url, notice: 'Gradelist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eabfaa72e4a93e70be1ac820b9787bbb",
"score": "0.6016856",
"text": "def index\n @lends = User.find_by_id(params[:user_id]).lends\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lends }\n end\n end",
"title": ""
},
{
"docid": "97750def90019b1325e45eb5b64db360",
"score": "0.6009903",
"text": "def index\n @badges = Badge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges.to_json }\n end\n end",
"title": ""
},
{
"docid": "ba58d372e470f90cfee30d4182647d5b",
"score": "0.59996015",
"text": "def new\n @title = \"Create a New Grading Scheme\"\n @grade_scheme = GradeScheme.new\n @assignments = Assignment.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade_scheme }\n end\n end",
"title": ""
},
{
"docid": "666c0aad87e4febf03734e612c0fecca",
"score": "0.59937614",
"text": "def index\n @grade_configs = GradeConfig.all\n #@grade_configs = current_user.grade_configs\n end",
"title": ""
},
{
"docid": "52d58446172cf9eefba82feeb604e5ee",
"score": "0.59725434",
"text": "def index\n @college_students = ListCollegeStudents.run!\n render json: @college_students\n end",
"title": ""
},
{
"docid": "d1434f155f1a3633f860e475841c4abd",
"score": "0.5965356",
"text": "def index\n @lists = MailingList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"title": ""
},
{
"docid": "2dab80b6e4b945ad4b75fdf2f3fdf448",
"score": "0.5964374",
"text": "def index\n @grades = Grade.order(sort_column + \" \" + sort_direction)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grades }\n end\n end",
"title": ""
},
{
"docid": "e8426c94c2dfac7fca3b6b20298fd8f8",
"score": "0.59597427",
"text": "def get_list(list_id:)\n JSON.parse(api_request(method: :get, path: \"lists/#{list_id}\"))\n end",
"title": ""
},
{
"docid": "49101526bcc3e4fda21eef708fb80c9c",
"score": "0.5955703",
"text": "def show\n @student_list = StudentList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_list }\n end\n end",
"title": ""
},
{
"docid": "051d11bfe5fa54679ac3504382ecd992",
"score": "0.59476393",
"text": "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "051d11bfe5fa54679ac3504382ecd992",
"score": "0.59476393",
"text": "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "051d11bfe5fa54679ac3504382ecd992",
"score": "0.59476393",
"text": "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "42b380181bed0ea721aa2a04d6ea3616",
"score": "0.5942663",
"text": "def index\n @gradebooks = Gradebook.all\n end",
"title": ""
},
{
"docid": "d6eeb68ac769f59284cbac96cc63c529",
"score": "0.59416723",
"text": "def highest_grade\n student = Student.order(grade: :desc).first\n render json: student\n end",
"title": ""
},
{
"docid": "8e9d458d51b82917bfd1a6ddde8f2575",
"score": "0.5939236",
"text": "def show\n @gear_list = GearList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gear_list }\n end\n end",
"title": ""
},
{
"docid": "6253467d54c67b7eeff394f32e24d317",
"score": "0.5933519",
"text": "def index\n user = Account.find(params[:account_id])\n @lists = user.lists\n json_response(@lists)\n end",
"title": ""
},
{
"docid": "f6bfbfe507379b995c844c6df52829f1",
"score": "0.5926935",
"text": "def new\n @degreelist = Degreelist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @degreelist }\n end\n end",
"title": ""
},
{
"docid": "793f951967470f9eb62cd219a3814470",
"score": "0.5914278",
"text": "def index\n @student_genders = StudentGender.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @student_genders }\n end\n end",
"title": ""
},
{
"docid": "472771bb98b682f9a7146944f7ead82c",
"score": "0.5913476",
"text": "def index\n @lists = List.find_all_by_user_id(current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lists }\n end\n end",
"title": ""
},
{
"docid": "7512436056673fdbf94e6aa6303b9189",
"score": "0.5906482",
"text": "def index\n @lab_badges = LabBadge.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lab_badges }\n end\n end",
"title": ""
},
{
"docid": "b5be5b0ea1ca23eb03bbafb385951e83",
"score": "0.59031636",
"text": "def index\n @lists = current_user.lists\n authorize! :read, @lists.first\n @lists= @lists.arrange\n\n respond_to do |format|\n format.html { redirect_to list_path(current_user.lists.first) }\n format.json { render json: List.json_tree(@lists) }\n end\n end",
"title": ""
},
{
"docid": "922db7f563586831d2c74b9ddffa8606",
"score": "0.58998257",
"text": "def index\n @students = Student.all\n render json: @students #status:\n end",
"title": ""
},
{
"docid": "d0c85d5a1fec61d9e5a61cbe5de3612f",
"score": "0.58952975",
"text": "def new\n @badge_list = BadgeList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @badge_list }\n end\n end",
"title": ""
},
{
"docid": "506b5a47de14166ea6258a61195307d7",
"score": "0.5894105",
"text": "def index\n @playlists = Playlists.all\n \n respond_to do |format|\n format.html\n format.json { sample_playlists = Playlists.find_by_username(\"nikeelevet\");\n render :json => sample_playlists.playlists_JSON.to_json } \n end\n end",
"title": ""
},
{
"docid": "96d6a3bffca1c7b5cf009935bf06e590",
"score": "0.5892644",
"text": "def get_org_unit_grade_schemes(org_unit_id)\n path = \"/d2l/api/le/#{$le_ver}/#{org_unit_id}/grades/schemes/\"\n _get(path)\n # Return: This action returns a JSON array of GradeScheme blocks.\nend",
"title": ""
},
{
"docid": "f6d4ae918e8d0b1e90c0079acf0cb1c8",
"score": "0.5891999",
"text": "def index\n @grading_levels = GradingLevel.all\n end",
"title": ""
},
{
"docid": "eec98efbbe39ef41fe46d9837eedd6c9",
"score": "0.5886016",
"text": "def index\n @grants = Grant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grants }\n end\n end",
"title": ""
},
{
"docid": "2e70b027401b75a77393389f324eb65a",
"score": "0.5881627",
"text": "def index\n @shopping_lists = @dwelling.shopping_lists\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shopping_lists }\n end\n end",
"title": ""
},
{
"docid": "1ffb86a61f1e7ceca984c006b18457a9",
"score": "0.5879018",
"text": "def index\n @gists = GistModel.all\n #byebug\n #render json: @gists\n end",
"title": ""
},
{
"docid": "54c8f7ebae54ce6d67f7c9115d35d71e",
"score": "0.58719486",
"text": "def show\n @list = current_user.lists.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"title": ""
},
{
"docid": "0e9e08cf3cbb141c282e25241063c2b0",
"score": "0.5871746",
"text": "def index\n @geeks = Geek.all\n render json: @geeks\n end",
"title": ""
},
{
"docid": "8ceb9605b2326472ab7847ce63720b51",
"score": "0.5871331",
"text": "def index\n @lists = List.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"title": ""
},
{
"docid": "8ceb9605b2326472ab7847ce63720b51",
"score": "0.5871331",
"text": "def index\n @lists = List.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"title": ""
},
{
"docid": "82ae2df379456c027829a65bd7a5d254",
"score": "0.5867332",
"text": "def index\n @gmps = Gmp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gmps }\n end\n end",
"title": ""
},
{
"docid": "2c0cab2c8151f4a79c92206574b258a7",
"score": "0.5866339",
"text": "def index\n @course_levels = CourseLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_levels }\n end\n end",
"title": ""
},
{
"docid": "fc224b3971a10664bc20e79923426b8b",
"score": "0.58632106",
"text": "def index\n @strength_mods = StrengthMod.all\n\n render json: @strength_mods\n end",
"title": ""
},
{
"docid": "ef3e846237080e01779977d9a82b12af",
"score": "0.58560956",
"text": "def show\n @grade = Grade.find(params[:id])\n @standards = Standard.where(:grading_period => params[:grading_period]||Period.current_grading_period).where(:course_id => @grade.schedule.section.course.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end",
"title": ""
},
{
"docid": "f551724494c644ea0e6e368d06e26eda",
"score": "0.58535016",
"text": "def get_lists\n return base_uri('get', 'lists')\n end",
"title": ""
},
{
"docid": "b984afe71af0c08c02c38ed65c25d456",
"score": "0.5850406",
"text": "def index\n @grades_imports = GradesImport.all\n end",
"title": ""
},
{
"docid": "fe02b76fa4151d86b14bbdfb745cf562",
"score": "0.5830184",
"text": "def index\n @guides = Guide.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"title": ""
},
{
"docid": "fdd1a2404285c2b12cebc23ca64b6f7b",
"score": "0.58282936",
"text": "def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end",
"title": ""
},
{
"docid": "e977156f19cc6d5d7a9ed26ec706bd66",
"score": "0.5822506",
"text": "def index\n @grade_classes = GradeClass.all\n end",
"title": ""
},
{
"docid": "e70649c15d97f7df223d71cd23d54d9a",
"score": "0.58191335",
"text": "def index\n @listings = Listing.all\n render json: @listings\n end",
"title": ""
},
{
"docid": "e26209806ebc11e244460e7504fb058d",
"score": "0.5814379",
"text": "def index\n @items = Item.where(:list_id => @list.id)\n render json: @items\n end",
"title": ""
},
{
"docid": "e16886f477f259a92b8608000c384feb",
"score": "0.5812406",
"text": "def show\n @grm_stylist = GrmStylist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_stylist }\n end\n end",
"title": ""
},
{
"docid": "582f4b1235968dedab56e41a432df948",
"score": "0.580298",
"text": "def index\n @checklists = Checklist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @checklists }\n end\n end",
"title": ""
},
{
"docid": "4c90364a20b2e1a1be1b72271355ca1c",
"score": "0.580217",
"text": "def index\n @grades = Grade.all.includes(:user, :course, :assessment_item)\n end",
"title": ""
},
{
"docid": "638d2841b6b11e54557b24f1bfa9ce33",
"score": "0.5796572",
"text": "def index\n @students = Student.all\n render json: {students: @students}\n end",
"title": ""
},
{
"docid": "0cd911a695102abdff2ade596ac0f040",
"score": "0.5796105",
"text": "def index\n @assignment_grades = find_grades\n end",
"title": ""
},
{
"docid": "1b6702640db753e1d6c7dd2d00ee2244",
"score": "0.5793113",
"text": "def index\n\n @resources = Resource.search(params)\n #filter results by grade\n grade_params = params.select{|key,value| key =~ /grade_/ }\n\n @filtered_resources = @resources\n #logger.debug(\"====before loop: #{@filtered_resources.count}\\n\")\n grade_params.each do |key, value|\n @filtered_resources = @filtered_resources.select do |r| \n logger.debug(\"====loop results: id: #{key.extract_grade_id} results: #{r.has_grade_id? key.extract_grade_id}\\n\")\n r.has_grade_id? key.extract_grade_id\n end\n end\n #logger.debug(\"====after loop: #{@filtered_resources.count}\\n\")\n @grades = Grade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resources }\n end\n end",
"title": ""
},
{
"docid": "b210b8353099f06597394ccff15c2896",
"score": "0.5787263",
"text": "def index\n @blacklists = Blacklist.all\n\n render json: @blacklists\n end",
"title": ""
},
{
"docid": "275bae1d28c4f8a8796d0f7d0ad7f2c9",
"score": "0.578491",
"text": "def index\n @grocery_lists = GroceryList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grocery_lists }\n end\n end",
"title": ""
},
{
"docid": "433588f7c48b5f31e40d17ec4f505155",
"score": "0.57811207",
"text": "def grades\n @sections = Section.order(:name)\n @grade_entry_form = GradeEntryForm.find(params[:id])\n end",
"title": ""
},
{
"docid": "0e7fdc17681e6b4bfc9f5ec0436d3334",
"score": "0.57752615",
"text": "def index\n @grados = Grado.order(\"nivel, grado\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grados }\n end\n end",
"title": ""
},
{
"docid": "f453ea6c3a953a3201a89790009fe38a",
"score": "0.5773365",
"text": "def playlists\n playlists = @user.playlists\n render json: playlists\n end",
"title": ""
},
{
"docid": "767ea860061badea65678173e3aac61e",
"score": "0.5772998",
"text": "def index\n @minimum_requirements = MinimumRequirement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @minimum_requirements }\n end\n end",
"title": ""
},
{
"docid": "e15e22feddf17d9ef56349b247c04053",
"score": "0.5763571",
"text": "def index\n @assignments = Assignment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assignments }\n end\n end",
"title": ""
},
{
"docid": "55842559e0bc8f3609d5c2284355d8f0",
"score": "0.57582647",
"text": "def index\n @gitgems = Gitgem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gitgems }\n end\n end",
"title": ""
}
] |
a2df6a15fbc47cb8e7e72e2c59799cab | This is necessary, as it allows Cordova to properly delegate 401 response handling to our application. If we keep this header, Cordova will defer handling to iOS, and we'll never see the 401 status in the app... it'll just do nothing. | [
{
"docid": "8ccb31b7331b154eba9521ff1036407a",
"score": "0.7370051",
"text": "def allow_client_to_handle_unauthorized_status\n headers.delete('WWW-Authenticate')\n end",
"title": ""
}
] | [
{
"docid": "05418fd6bd02355c8178bc55d0e969d3",
"score": "0.6749783",
"text": "def render_unauthorized\n logger.debug \" *** UNAUTHORIZED REQUEST: '#{request.env['HTTP_AUTHORIZATION']}' ***\"\n self.headers['WWW-Authenticate'] = 'Token realm=\"Application\"'\n render json: {error: \"Bad credentials\"}, status: 401\n end",
"title": ""
},
{
"docid": "559eb1e1cb3f85e9d548cd62e5cdc323",
"score": "0.6349953",
"text": "def handle_http_401(message, metric = nil, view = :unauthorized)\n logger.warn \"#{message}\\n\\t#{request.method} #{request.original_url}\"\n Metric.register(metric || Metric::METRIC_HTTP_401)\n render view, status: :unauthorized\n end",
"title": ""
},
{
"docid": "135cf50fca620fc4d2a43034dc8310f5",
"score": "0.63377297",
"text": "def skip_http_headers; end",
"title": ""
},
{
"docid": "56a7e6fd895c75a4eb4bc3862edcc34c",
"score": "0.62453437",
"text": "def handle_unverified_request\n reset_session\n render :nothing => true, :status => 401\n end",
"title": ""
},
{
"docid": "b4ca071ac89267f2feceb9a2c1b3c20f",
"score": "0.6219903",
"text": "def response_for_inauthentic_request(env)\n handle_head(env) do\n body = { 'errors' => { 'mauth' => ['Unauthorized'] } }\n [401, { 'Content-Type' => 'application/json' }, [JSON.pretty_generate(body)]]\n end\n end",
"title": ""
},
{
"docid": "dea407bd8702cb239bdd11d39e798432",
"score": "0.6187069",
"text": "def response_header\n nil\n end",
"title": ""
},
{
"docid": "0bb267b5726175d4c374ec2f201f5c78",
"score": "0.61247236",
"text": "def not_authorized\r\n render :file => 'public/401.html', :status => 401, :layout => false\r\n end",
"title": ""
},
{
"docid": "0a97d52b715fc05ec363b1c7b516dd5f",
"score": "0.61134803",
"text": "def unauthorized_msg(msg_header)\n msg_header['WWW-Authenticate'] = 'Token realm=\"Application\"'\n render json: {\n error: 'You are not authorized for this action.'\n }, status: 403\n end",
"title": ""
},
{
"docid": "64ee135eee05e1763f7ebc6e82fcde33",
"score": "0.60813564",
"text": "def response_for_unable_to_authenticate(env)\n handle_head(env) do\n body = { 'errors' => { 'mauth' => ['Could not determine request authenticity'] } }\n [500, { 'Content-Type' => 'application/json' }, [JSON.pretty_generate(body)]]\n end\n end",
"title": ""
},
{
"docid": "e404c6a26e957f14f7937851634de5b6",
"score": "0.60730445",
"text": "def authorize_request\n unless request.headers['Authorization'].present?\n render json: {message: 'Missing Token'}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "3f3fa3d3f786eb691d2960f45c5110e9",
"score": "0.6071067",
"text": "def not_authorised\n headers['WWW-Authenticate'] = 'Basic realm=\"Restricted Area\"'\n error(401, 'Not authorised.')\n end",
"title": ""
},
{
"docid": "cafc2285727345b0bb3684d16bb4bdf4",
"score": "0.6063149",
"text": "def process_no_auth(request, response)\n response.start(401, true) do |head,out|\n head['WWW-Authenticate'] = 'NTLM'\n end\n end",
"title": ""
},
{
"docid": "ec7c6ea601a857a55a109c1ade1d8939",
"score": "0.601104",
"text": "def response_for_missing_v2(env)\n handle_head(env) do\n body = {\n 'type' => 'errors:mauth:missing_v2',\n 'title' => 'This service requires mAuth v2 mcc-authentication header. Upgrade your mAuth library and ' \\\n 'configure it properly.'\n }\n [401, { 'Content-Type' => 'application/json' }, [JSON.pretty_generate(body)]]\n end\n end",
"title": ""
},
{
"docid": "1af04dbff38ecb17fe4a0bb5c3a4e899",
"score": "0.59928507",
"text": "def authorize_application\n render json: { ok: false, message: 'unauthorized' }, status: 401 unless request.headers['App-Key'] == 'R141p7THbd5vRdH20xb5SaOsN6bJ5J5S'\n end",
"title": ""
},
{
"docid": "04b971637ff452df885f60800196d0d7",
"score": "0.5991501",
"text": "def api_auth\n api_response(403, \"Invalid Authorization header\") unless api_user\n end",
"title": ""
},
{
"docid": "3af3389bab7f85e110ce586f17ad4405",
"score": "0.5974847",
"text": "def access_denied\n head 401\n end",
"title": ""
},
{
"docid": "a2c67ab58ddd344a0e750684c674a7a8",
"score": "0.5953458",
"text": "def require_login\n @response.add_header('WWW-Authenticate', \"Basic realm=\\\"#{@realm}\\\"\")\n @response.status = 401\n end",
"title": ""
},
{
"docid": "05c50161c6baceea6c6e525a28de3aa5",
"score": "0.5947336",
"text": "def render_unauthorized(message)\n head :unauthorized\n end",
"title": ""
},
{
"docid": "7bb0683bc3a10df603699e5a453c1cee",
"score": "0.5928867",
"text": "def error_401\n\t\t\tjson_error 'Unauthorized', 401,\n\t\t\t\t'WWW-Authenticate' => \"Basic realm=\\\"#{Nacreon::Config.domain}\\\"\"\n\t\tend",
"title": ""
},
{
"docid": "a23b6b554022b8a47a734fcaeadb229f",
"score": "0.5917675",
"text": "def http_auth_header?; end",
"title": ""
},
{
"docid": "f291550dbc38d93a85ce36effc81b68c",
"score": "0.59164625",
"text": "def authorization_denied\n head :unauthorized\n end",
"title": ""
},
{
"docid": "020eb52bfe497c4a2c2ec7e329231ff1",
"score": "0.58946157",
"text": "def respond_with_unauthorized(message: \"Unauthorized\", error_code: \"unauthorized\")\n render partial: \"api/error\", locals: { message: message, error_code: error_code }, status: 401\n return false\n end",
"title": ""
},
{
"docid": "96bb08a449d4a6bbfead45cbd5680f5c",
"score": "0.5888671",
"text": "def check_xhr_header\n return if request.xhr?\n\n render json: { error: 'forbidden' }, status: :forbidden\n end",
"title": ""
},
{
"docid": "a8d7586607fe5315ee82d22e3a4ccd80",
"score": "0.58824474",
"text": "def unauthorized\n render json: {error: 'Unauthorized'}, status: 401\n end",
"title": ""
},
{
"docid": "d0a2b124374f4f8a5872b168a515e654",
"score": "0.5877786",
"text": "def skip_http_headers=(_arg0); end",
"title": ""
},
{
"docid": "295f4f7d6308b1ad9b6d65583d06a17d",
"score": "0.5807179",
"text": "def unauthorized\n head :unauthorized\n end",
"title": ""
},
{
"docid": "eb3fad95a4fdccec6fbf0039d26a85bd",
"score": "0.5782843",
"text": "def handle_headers_for_json\n response[HDR_A_C_ALLOW_ORIGIN] = request.env[HDR_ORIGIN] if request.env.has_key? HDR_ORIGIN\n content_type :json\n end",
"title": ""
},
{
"docid": "329a7ff1a48baac9e31ad64df46dd11b",
"score": "0.57367563",
"text": "def request_http_token_authentication(realm = \"Application\", message='HTTP Token: Access denied. You did not provide an valid API key.')\n self.headers[\"WWW-Authenticate\"] = %(Token realm=\"#{realm.gsub(/\"/, '')}\")\n unauthenticated!\n end",
"title": ""
},
{
"docid": "8010afd3bd3d9432902e79b5e95c3104",
"score": "0.57231534",
"text": "def check_header\n !request.env[\"HTTP_X_ACCESS_TOKEN\"].nil?\n end",
"title": ""
},
{
"docid": "0c98079433b50fe0a20f4e19eedd6e97",
"score": "0.5706933",
"text": "def jwt_not_authenticated\n head :unauthorized\n end",
"title": ""
},
{
"docid": "9fbb1a519bd6af0c4b42534e2198ef3b",
"score": "0.57021654",
"text": "def http_auth_header\n return headers['Authorization'].split(' ').last if headers['Authorization'].present?\n\n raise(API::JWTExceptionHandler::MissingToken, APIMessages.missing_token)\n end",
"title": ""
},
{
"docid": "79606c3c9d541d52e7edb5686001ef9b",
"score": "0.57009923",
"text": "def unauthorized\n render \"errors/401\", :status => 401\n\tend",
"title": ""
},
{
"docid": "4717cefabd79044bf3f2661977659eac",
"score": "0.569141",
"text": "def default_http_header; end",
"title": ""
},
{
"docid": "0b9d99236f072e11c110be38341a71ad",
"score": "0.5681773",
"text": "def include_proxy_authorization_header; end",
"title": ""
},
{
"docid": "09bd853addcce0a5ba4c1b823dfad64c",
"score": "0.56771326",
"text": "def authenticate_request!\n payload, header = JsonWebToken.verify(http_token)\n header if false # Commeent this line\n @requested_user = {\n email: payload['https://sassbox.com/email'],\n first_name: payload['https://sassbox.com/first_name'],\n last_name: payload['https://sassbox.com/last_name']\n }\n rescue JWT::VerificationError, JWT::DecodeError\n render json: { errors: ['Not Authenticated'] }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "7d7ae6af1f33be9a960c061d2f8273ea",
"score": "0.56454897",
"text": "def render_401\n errors = JsonApiServer.errors(\n status: 401,\n title: I18n.t('json_api_server.render_401.title'),\n detail: I18n.t('json_api_server.render_401.detail')\n )\n render json: errors.to_json, status: 401\n end",
"title": ""
},
{
"docid": "12c1904d2b2c6138e238fe089b899312",
"score": "0.56351566",
"text": "def opening_access_control_header\n headers['Access-Control-Allow-Origin'] = '*'\n end",
"title": ""
},
{
"docid": "f60e3eb2be401272178c56c30b1cf7a8",
"score": "0.56204635",
"text": "def invalid_user_id\n Log.error(\"Error: Header 'user-id' not sent in the request.\")\n render json: {error: \"Header 'user-id' not sent.\"}, status: :bad_request\n end",
"title": ""
},
{
"docid": "bd55bf2bf0e53425b18baeb11bd7e7c1",
"score": "0.5614996",
"text": "def unauthorized\n [ 401, {'Content-Type' => 'text/plain', 'Content-Length' => '13'},\n ['Unauthorized.'] ]\n end",
"title": ""
},
{
"docid": "611d6bcfc19b09eaa7fd62f6a79ef3ad",
"score": "0.5603355",
"text": "def ensure_authenticated_user\n render json: {message: 'Unauthorized'}, status: 401 unless current_user\n # head :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "44d4b72d3a58df723d7843847a7c66e6",
"score": "0.557905",
"text": "def authenticate_request\n render :json => { :error => :unauthorized }, :status => :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "1dd0d06309e6f4910d341b8e27de81de",
"score": "0.5574225",
"text": "def check_authorization\n return head :unauthorized if request.env['HTTP_CAPKEY'].nil?\n\n head :forbidden unless request.env['HTTP_CAPKEY'] == Settings.API_KEY\n end",
"title": ""
},
{
"docid": "f8cc6a62fe05190bfe431bc66b8a0bc6",
"score": "0.55697966",
"text": "def unauthorized_response\n respond_to do |format|\n format.json { render json: {error: 'admin_required'}, status: :unauthorized }\n format.any { head :unauthorized }\n end\n end",
"title": ""
},
{
"docid": "990a7d86fb3ee08d8d74f2dd1cf61ec7",
"score": "0.5562703",
"text": "def handled_requested_user_app_not_available\n return if app_type_requested_id\n\n msg = 'This app is not available'\n respond_to do |type|\n type.html do\n flash[:warning] = msg\n redirect_to '/'\n end\n type.json do\n render json: { message: msg }, status: 401\n end\n end\n true\n end",
"title": ""
},
{
"docid": "3eb4a483bfc72e9cc4c7a341e9acc210",
"score": "0.5560171",
"text": "def requesting_auth?(authorization_header)\n authorization_header || !authorization_cookie.blank?\n end",
"title": ""
},
{
"docid": "66354986b497267f09e6e0987b17e3da",
"score": "0.5551033",
"text": "def headers\n { 'Status' => ActionController::Base::DEFAULT_RENDER_STATUS_CODE }\n end",
"title": ""
},
{
"docid": "4d46c1b54cc6ddd709a77ed35422360c",
"score": "0.5542898",
"text": "def http_auth_header\n request.headers['Authorization'].present? ? request.headers['Authorization'].split(' ').last : nil\n end",
"title": ""
},
{
"docid": "d107fb4308de4d1b100e90d6fbf101f6",
"score": "0.5528763",
"text": "def authorization_header\n @authorization_header ||= env['HTTP_AUTHORIZATION']\n end",
"title": ""
},
{
"docid": "2cb2a785adc1d2e5e8b561685e5b6242",
"score": "0.5524279",
"text": "def unauthorized_error\n error!(\"401 Unauthorized\", 401)\n end",
"title": ""
},
{
"docid": "e67d5c508e1a32a678a4b05292a54d74",
"score": "0.5521609",
"text": "def http_auth_header\n if header['Authorization'].present?\n return header['Authorization'].split(' ').last\n end\n raise(ExceptionHandler::MissingToken, 'Missing_token') #should be refactored into a singleton class man \n end",
"title": ""
},
{
"docid": "13aff3c6ff06216d54d764c9358e0a05",
"score": "0.5520571",
"text": "def challenge!\n response_headers = { \"WWW-Authenticate\" => %(Basic realm=\"My Application\"), 'Content-Type' => 'text/plain' }\n response_headers['X-WHATEVER'] = \"some other value\"\n body = \"401 Unauthorized\"\n response = Rack::Response.new(body, 401, response_headers)\n custom! response.finish\n end",
"title": ""
},
{
"docid": "03ab43c367e87fdb4fdeb818a54363c0",
"score": "0.5519133",
"text": "def handle_unverified_request\n \n # By default this method raises ActionController::InvalidAuthenticityToken\n #redirect_to root_url\n end",
"title": ""
},
{
"docid": "d18e13f34032b4c5b56403d8cbabc47c",
"score": "0.5516205",
"text": "def unauthorized\n respond_to do |format|\n format.html do\n if try_spree_current_user\n flash.now[:error] = t(:authorization_failure)\n render 'spree/shared/unauthorized', :layout => Spree::Config[:layout], :status => 401\n else\n store_location\n url = respond_to?(:spree_login_path) ? spree_login_path : root_path\n redirect_to url\n end\n end\n format.xml do\n request_http_basic_authentication 'Web Password'\n end\n format.json do\n render :text => \"Not Authorized \\n\", :status => 401\n end\n end\n end",
"title": ""
},
{
"docid": "82f0055139f0b45e1037239f24e63d50",
"score": "0.55021983",
"text": "def check_authorization\n render json: { error: 'unauthorized: device has been terminated' }, status: :internal_server_error unless @device.disabled_at == nil\n end",
"title": ""
},
{
"docid": "22e98d0b83b2a550b70d7c44717ba9ec",
"score": "0.54980934",
"text": "def handle_unverified_request\n super\n render :text => \"Forgery protection token was not present.\", :status => :unauthorized\n end",
"title": ""
},
{
"docid": "7e6a4e9237db8b0d24f2223a6cb06d65",
"score": "0.5492092",
"text": "def authenticate_with_response\n render nothing: true, status: 401 if current_user.nil?\n end",
"title": ""
},
{
"docid": "3cb6f1da850e2a4283697a35d60140cf",
"score": "0.5486579",
"text": "def auth_failed(response)\n response && response.code == 401\n end",
"title": ""
},
{
"docid": "6d81be5e566afd3758efd47ae5b28b22",
"score": "0.5484962",
"text": "def require_api_user_or_token\n authenticate_user\n rescue AuthenticationError => e\n api_log_error(\"AuthenticationError: #{e.message}\")\n response.headers[\"Content-Type\"] = \"application/json\"\n error_message = ErrorSerializer.new(:unauthorized, e).serialize(true).to_json\n render :status => 401, :json => error_message\n log_api_response\n end",
"title": ""
},
{
"docid": "1778960ceb80153807f3beae876c2714",
"score": "0.5482934",
"text": "def catch_bad_request_headers\n if request.headers[\"accept\"] == \"application/json\"\n render plain: \"Invalid request header: we do not provide a JSON version of our search results.\", status: 406\n end\n end",
"title": ""
},
{
"docid": "834d605706cd7195c3872a323008f09f",
"score": "0.54791",
"text": "def unauthorized_request(e)\n render json: { message: e.message }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "834d605706cd7195c3872a323008f09f",
"score": "0.54791",
"text": "def unauthorized_request(e)\n render json: { message: e.message }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "e80fdf6e691bc5e7b12097d44aab66db",
"score": "0.54754937",
"text": "def not_authorized\n flash[:error] = I18n.t :forbidden\n response.headers['Status-Code'] = '403'\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.54681784",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.54681784",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.54681784",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.54681784",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.54681784",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "6a15fb3d165929cf03ae1d745ba4cd2f",
"score": "0.5463862",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "d486eec77d67dec9dbe44fd40856d6ac",
"score": "0.54630697",
"text": "def browsers_only\n if !valid_browser?(request.user_agent) or valid_robot?(request.user_agent)\n respond_to do |format|\n format.html { render :file => \"public/401.html\", :status => :unauthorized }\n format.xml do\n headers[\"Status\"] = \"Unauthorized\"\n render :text => \"You appear to be a robot. No robots are allowed to access this page.\", :status => '401 Unauthorized'\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f2a2c9dd223b2d26c791d352e6d890f5",
"score": "0.54629207",
"text": "def rescue_unauthorized\n render nothing: true, status: 403\n end",
"title": ""
},
{
"docid": "f2a2c9dd223b2d26c791d352e6d890f5",
"score": "0.54629207",
"text": "def rescue_unauthorized\n render nothing: true, status: 403\n end",
"title": ""
},
{
"docid": "938669b138e7558f8f7ab4d16df6c7d4",
"score": "0.5455065",
"text": "def unauthorized_request(err)\n json_response({ message: err.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "e2d0d9b74f9c09135f88c7d834f660b5",
"score": "0.54415166",
"text": "def handle_unverified_request; end",
"title": ""
},
{
"docid": "e2d0d9b74f9c09135f88c7d834f660b5",
"score": "0.54415166",
"text": "def handle_unverified_request; end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.5436248",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.5436248",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.5436248",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.5436248",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "f1f41b81c48c69316c6a2a51c38a9f00",
"score": "0.5435636",
"text": "def invalid_authentication\n render json: {message: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "94ddd5871c5eb9a786a2048e4b65db86",
"score": "0.5425136",
"text": "def unauthorized(message)\n render json: {\n errors: message,\n status: :unauthorized\n }, status: 401\n end",
"title": ""
},
{
"docid": "95d179538352a7298c4b21f942e0f848",
"score": "0.54229414",
"text": "def unauthorized\n render :json => \"You are not authorized for access.\", :status => :unauthorized\n end",
"title": ""
},
{
"docid": "d0cbb4883bd98d1b6fafc27a25540461",
"score": "0.54225713",
"text": "def is_not_authorized?\n @code == 401\n end",
"title": ""
},
{
"docid": "441f59413c66007db4483c6587a28ffd",
"score": "0.5420157",
"text": "def protected!\n return if from_bitbooks?\n headers['WWW-Authenticate'] = 'Basic realm=\"Restricted Area\"'\n halt 401, \"Not authorized\\n\"\nend",
"title": ""
},
{
"docid": "ac4463170d1e07f4a10225203ea50e54",
"score": "0.5410479",
"text": "def unauthorized_request\n Rails.logger.debug \"------ 'Unauthorized' response from resource server ------\"\n\n authorize_path = @organization.authorization_server.authorize_path(callback_url)\n Rails.logger.debug \"------ Redirecting to: #{authorize_path} ------\"\n redirect_to authorize_path\n end",
"title": ""
},
{
"docid": "97fb8d30e944de780332ed5111cfab1b",
"score": "0.54083353",
"text": "def authenticate!\n # if the authentication header is an acceptible value\n if @env['HTTP_X_MY_API'] == 'foobar'\n user = { :id => 1, :name => \"some user\" }\n # warden doesn't care what the user is, so long as it's not nil.\n success! user, \"success\"\n end\n end",
"title": ""
},
{
"docid": "f7e55afde08c21a59da5975fc4bc823f",
"score": "0.5408022",
"text": "def access_denied\n {\n :html => 'Sorry, we cannot verify that you are a user. Please reinstall this Raplet.',\n :status => 401\n }\n end",
"title": ""
},
{
"docid": "0137c050f3d727a73fe919412537dc84",
"score": "0.53981614",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unauthorized)\nend",
"title": ""
},
{
"docid": "4bd89245c05b0b88bac8abe9be930e57",
"score": "0.53939396",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "1a22640ad4f2799a55545b062243fafb",
"score": "0.53808945",
"text": "def fill_header(response); end",
"title": ""
},
{
"docid": "412c3a28020626e3b86e6c827d9fd861",
"score": "0.5377724",
"text": "def not_auth(status = :unauthorized)\n render json: {\n result: 'Error',\n message: 'Unauthorized Access',\n status: 'Unauthorized'\n }, status: status\n end",
"title": ""
},
{
"docid": "7ffae2fdc0b02ca3a31cc60416c7a0c7",
"score": "0.5372517",
"text": "def handle_status_code(req)\n case req.code\n when 200..204; return\n when 400; raise ResponseError.new req\n when 401; raise ResponseError.new req\n else raise StandardError\n end\n end",
"title": ""
},
{
"docid": "7afdf85bee5886499dc4f1573b39b63c",
"score": "0.53719777",
"text": "def render_unauthorized(payload = { errors: { unauthorized: [\"You are not authorized perform this action.\"] } })\n render json: payload, status: 401\n end",
"title": ""
},
{
"docid": "e4d861193e49eee7964546304e24540d",
"score": "0.53698725",
"text": "def require_authentication\n render_failed_auth_response unless authentication_successful? # render a 401 error\n end",
"title": ""
},
{
"docid": "b8e4681b7cddb94bfcb4a44ca235a6cf",
"score": "0.5368458",
"text": "def _around_rodauth(&block)\n result = nil\n\n rails_controller_rescue do\n rails_controller_callbacks do\n result = catch(:halt) { super(&block) }\n end\n end\n\n if rails_controller_instance.performed?\n rails_controller_response\n elsif result\n result[1].merge!(rails_controller_instance.response.headers)\n throw :halt, result\n else\n result\n end\n end",
"title": ""
},
{
"docid": "3019ceb545820cb85dd10d1e9f999518",
"score": "0.536443",
"text": "def require_authentication\n render_failed_auth_response unless authentication_successful? # render a 401 error\n end",
"title": ""
},
{
"docid": "306b64c15797301315da79c936c93c95",
"score": "0.5362802",
"text": "def skip_authorization; end",
"title": ""
},
{
"docid": "7b6afb1d972f556276dc1c670f9d60c3",
"score": "0.5361051",
"text": "def unauthorized\n respond_to do |format|\n format.html do\n if admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n redirect_to login_path and return\n elsif current_user || admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n render 'shared/unauthorized'\n else\n store_location\n redirect_to login_path and return\n end\n end\n format.xml do\n request_http_basic_authentication 'Web Password'\n end\n format.json do\n render :text => \"Not Authorized \\n\", :status => 401\n end\n end\n end",
"title": ""
},
{
"docid": "ee88ae6cb2c35769b489c98ddb105ba7",
"score": "0.5346809",
"text": "def access_denied\n render status: 401, text: \"nice try\"\n end",
"title": ""
},
{
"docid": "2c46095ba842a009c075fc5bf5f596af",
"score": "0.5339285",
"text": "def unauthenticated\n render_json status: :unauthorized\n end",
"title": ""
},
{
"docid": "3f280197276b122657450e4a0a635baf",
"score": "0.5336494",
"text": "def set_response_headers\n response.set_header('Cache-Control', 'no-cache,no-store')\n response.set_header('Pragma', 'no-cache')\n response.set_header('Expires', 'Tue, 01 Jan 1980 00:00:00 GMT')\n response.set_header('Cross-Origin-Embedder-Policy', 'require-corp')\n response.set_header('Cross-Origin-Opener-Policy', 'same-origin')\n response.set_header('Cross-Origin-Resource-Policy', 'same-origin')\n end",
"title": ""
}
] |
afa51224faa2f00ac374e1c1fabab761 | Public: Find the number of divisors of the given number. number A positive integer. Returns an integer. | [
{
"docid": "7926cf56e288d81d5fdfdd53ac4b3ca8",
"score": "0.8005547",
"text": "def divisor_count_of(number)\n # Count the divisors by computing the prime factorization of the number and\n # multiplying PF exponents. 1 is added to the exponents since each base can\n # be raised to the 0 power, which is still a divisor of the given number.\n prime_factorization = prime_factorization_of(number)\n exponents = prime_factorization.values\n result = exponents.inject(1) {|accum, val| accum * (val + 1)}\n\n return result\nend",
"title": ""
}
] | [
{
"docid": "6c7c4384687903dd73c43446490f2e6b",
"score": "0.8761941",
"text": "def get_number_of_divisors(number)\n\t\tdivisors = 2 # 1 and number\n\t\tif (number == 1)\n\t\t\tdivisors = 1\n\t\telsif (number == 2)\n\t\t\tdivisors = 2\n\t\telse\t\t\n\t\t\tfor i in 2..Math.sqrt(number)\n\t\t\t\tif (number%i == 0)\n\t\t\t\t\tdivisors += 2\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tp \"number: #{number}, divisors: #{divisors}\"\n\t\tif (Math.sqrt(number)*Math.sqrt(number) == number)\n\t\t\tdivisors -= 1\n\t\tend\t\n\t\t@divisors = divisors\n\tend",
"title": ""
},
{
"docid": "abcdd8f74a28a6546c627fa147cee77e",
"score": "0.82466555",
"text": "def count_divisors(num)\n count = 0\n top = Math.sqrt(num)\n (1..top).each { |n| count += 2 if num % n == 0 }\n count -= 1 if is_square?(num)\n count\n end",
"title": ""
},
{
"docid": "29bd4006c98ec61d1140f4f9251da070",
"score": "0.82403356",
"text": "def divisor_count_of(number)\n divisors = divisors_of(number)\n\n return divisors.length\n end",
"title": ""
},
{
"docid": "df8453d1fbc0cc29f832c4c005fb79bb",
"score": "0.823694",
"text": "def divisors(num)\n\tcount = 0\n\tfor i in 1..Math.sqrt(num)\n\t\tif num % i == 0\n\t\t\tcount += 2\n\t\tend\n\tend\n\treturn count\nend",
"title": ""
},
{
"docid": "9b3402c36dd906b8d4d5ba8ff9f4dae9",
"score": "0.80304706",
"text": "def num_of_divisors(n)\n count = 1\n 1.upto(n/2+1) do |i|\n if n % i == 0\n count += 1\n end\n end\n count\nend",
"title": ""
},
{
"docid": "1133588cd93d3db2cbbd2c8dcdba35a8",
"score": "0.7962465",
"text": "def divisors(n)\n (1.upto(n ** 0.5).select { |d| (n % d).zero? }.size * 2) - 1\nend",
"title": ""
},
{
"docid": "5d682e9ba67b56d6146a4ae3528381f5",
"score": "0.7952081",
"text": "def divisors(n)\n count = 0\n (1..n).each { |div| count += 1 if n % div == 0 }\n return count\nend",
"title": ""
},
{
"docid": "3aa9be6ee507ed5e07580c30b7cf6f34",
"score": "0.79426014",
"text": "def number_of_divisors\n (1..Math.sqrt(self)).inject(0) {|sum, i| modulo(i) == 0 ? sum + 2 : sum}\n end",
"title": ""
},
{
"docid": "2843a6b1c92a68b71f76eb66ebc6f313",
"score": "0.79299814",
"text": "def number_of_divisors(num)\r\n\tprime_array = num.prime_division\r\n\tnum_of_divisors = 1\r\n\t(0..prime_array.length - 1).each do |x|\r\n\t\tnum_of_divisors *= (prime_array[x][1] + 1)\r\n\tend\r\n\treturn num_of_divisors\r\nend",
"title": ""
},
{
"docid": "9ea9a4af0f1b5f6efabb6994c681f1f6",
"score": "0.78812397",
"text": "def number_of_divisors\n return 1 if self == 1\n self.prime_division.map{|num, power| power + 1 }.inject(&:*)\n end",
"title": ""
},
{
"docid": "ca2634c8373669e0d2de7e2205749253",
"score": "0.78413504",
"text": "def divisors(num)\n (1...num).select{|n| num % n ==0}.reduce(:+)\nend",
"title": ""
},
{
"docid": "72bb76c087f38c77db97d4c5c76dcd9c",
"score": "0.783776",
"text": "def count_divisors(num)\n\n (1..num).count {|n| num % n == 0}\n\nend",
"title": ""
},
{
"docid": "3e877de83855edf8a9e3b88080efe967",
"score": "0.7812966",
"text": "def sumOfDivisors(number)\n\tsum=0\n\tlimit=number/2\n\ti=1\n\twhile i<=limit\n\t\tif number%i==0\n\t\t\tsum+=i\n\t\tend\n\t\ti+=1\n\tend\n\treturn sum\nend",
"title": ""
},
{
"docid": "107828e5104bf148a92e00c93573eedf",
"score": "0.77128863",
"text": "def get_divisors n\n n = n/2 if n % 2 == 0 \n divisors = 1\n count = 0\n while n % 2 == 0\n count += 1\n n = n/2\n end\n divisors *= (count + 1)\n p = 3\n while n != 1\n count = 0\n while n % p == 0\n count += 1\n n = n/p\n end\n divisors *= (count + 1)\n p += 2\n end\n #puts divisors\n return divisors\nend",
"title": ""
},
{
"docid": "dad2322649e7914cbfa4ccc011c6e328",
"score": "0.7711631",
"text": "def divisors(number)\n (1..number).select { |n| number % n == 0 }\nend",
"title": ""
},
{
"docid": "e8c352b16f0d787a4bb56534e6b16207",
"score": "0.7667776",
"text": "def divisors(num)\n count = []\n factors = Prime.prime_division(num)\n #prime_division returns nested array of [[prime, #of times],[prime, #oftimes]]\n #just want the second value of each subarray\n factors.flatten.each_with_index do |value, i|\n if i%2 != 0\n count << value\n end\n end\n #add one to each and multiply \n num_of_divisors = count.collect{|m| m+1}.inject(:*)\n end",
"title": ""
},
{
"docid": "e02cc46e5c8e10675f273a7f1f7159b6",
"score": "0.7554181",
"text": "def get_divisors(number)\n\tresult = []\n\n \tfor counter in 1..number / 2\n \tresult.push(counter) if number % counter == 0\n \tend\n\n \tresult.push(number)\n \tresult\nend",
"title": ""
},
{
"docid": "de4be126a5f69eb41d84198a7d6e1123",
"score": "0.7533307",
"text": "def divisors(number)\n sqrt = Math.sqrt(number).floor\n (1..sqrt).each_with_object([]) do |n, div|\n if number % n == 0\n div << n\n div << number / n\n end\n end.uniq.sort\nend",
"title": ""
},
{
"docid": "91924fcd64ed6c5c96704ae409b374bf",
"score": "0.7531866",
"text": "def divisors(number)\n (1..number).select do |candidate|\n number % candidate == 0\n end\nend",
"title": ""
},
{
"docid": "60f1925143a21a7f68abb567a37c33d9",
"score": "0.74791586",
"text": "def divisor(n)\n count = 0\n (1..n).each do |d|\n if n % d == 0\n count += 1\n end \n end \n count \nend",
"title": ""
},
{
"docid": "a1190e931fc57a4b15017b71caab5b7c",
"score": "0.74759555",
"text": "def sum_divisors(n)\r\n (1...n).select { |x| (n % x).zero? }.sum - 1\r\nend",
"title": ""
},
{
"docid": "b87412103fbb41f9de6ca08d17e115c7",
"score": "0.7398439",
"text": "def divisors(n)\n current_num = 1\n divs = []\n loop do\n result = n.divmod(current_num)\n return divs.uniq.sort if result[0] < current_num\n divs.concat([result[0], current_num]) if result[1].zero?\n current_num += 1\n end\nend",
"title": ""
},
{
"docid": "565ad8c58acbf0dbb8a0a0fb6949c727",
"score": "0.7297367",
"text": "def divisors(number)\n divs = []\n min = 1\n max = number\n while( min <= max )\n if ((number % min) == 0)\n divs << min\n divs << max unless max == min || max == number\n end\n min += 1\n end\n return divs.uniq\nend",
"title": ""
},
{
"docid": "bed4f951838dbea8f62be8d54b995c53",
"score": "0.72471356",
"text": "def divisors(int)\n (1..int).select do |possible_divisor| \n int % possible_divisor == 0\n end\nend",
"title": ""
},
{
"docid": "ce56f7bb11d44996081f0cf4a60d8b7e",
"score": "0.7246755",
"text": "def divisors(num)\n divisors = Array.new\n counter = 1\n while counter <= num\n divisors << counter if num % counter == 0\n counter += 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "02166ad78dee9b5ac8c0ae91bbbfe706",
"score": "0.72375333",
"text": "def divisors(num)\n divisors = []\n (1..num).each do |div|\n divisors << div if (num % div).zero?\n end\n return divisors\nend",
"title": ""
},
{
"docid": "57604c47f0c2381bdc5738ed5f826389",
"score": "0.722577",
"text": "def factors(number)\n # TODO: can optimise by only going up to the square of the number\n (1..number).select { |x| number % x == 0 }.count\nend",
"title": ""
},
{
"docid": "e3e173c09b0a868c5322feb8dcf76abf",
"score": "0.72124696",
"text": "def divisors(n)\n return (1..n/2).select { |i| (n % i) == 0 }\nend",
"title": ""
},
{
"docid": "60641d6465887676d530dbce25ab2aad",
"score": "0.71816903",
"text": "def numDivisors(n)\n exponents = []\n remaining = n\n\n return 1 if n == 1\n\n for i in 0...@primes.length\n\n if remaining == 1 then\n return exponents.inject(:*)\n end\n\n if remaining % @primes[i] == 0 then\n exponent_count = 0\n while remaining % @primes[i] == 0 do\n remaining /= @primes[i]\n\n exponent_count += 1\n end\n exponents.push(exponent_count + 1)\n end\n end\n return 1\nend",
"title": ""
},
{
"docid": "f52548395c22c9be64a9416761e4cad2",
"score": "0.7177625",
"text": "def divisor_counter(n)\n i, count = 1, 0\n\n until i * i > n\n if n % i == 0\n count += 1\n count += 1 if i * i != n\n end\n i += 1\n end\n\n count\nend",
"title": ""
},
{
"docid": "444aee358c33ee813d6e3ac030214226",
"score": "0.7177064",
"text": "def nontrivial_divisors_of number, options={}\n default_options = {upper_limit: number - 1}\n # Merge in default options because default options in the argument list will\n # be ignored/missed if a partial option hash is passed in\n options = default_options.merge options\n\n upper_limit = options[:upper_limit]\n\n divisors = []\n (2..upper_limit).each do |val|\n if number % val == 0\n divisors.push val\n end\n end\n divisors\nend",
"title": ""
},
{
"docid": "9fea9aaa2407b2ce2c6e5c3d3a36ebf5",
"score": "0.7175902",
"text": "def factors(number)\n divisors = []\n # 1 is always a divisor\n divisors << 1\n if number > 1\n # target number is also always a divisor\n divisors << number\n # start looking for other divisors from 2 on up.\n i = 2\n while (i <= Math.sqrt(number).to_i)\n # if number is evenly divisible by i, then retain i, and possibly also\n # the division of number/i.\n if (number % i == 0)\n divisors << i\n divisors << number/i if (i != number/i)\n end\n i += 1\n end\n divisors.sort!\n end\n divisors\nend",
"title": ""
},
{
"docid": "ca341df4e4a1c94dba204ddc63b24c35",
"score": "0.7124923",
"text": "def divisors(n)\n divisors_found = []\n (1..n).each do |i|\n divisors_found << i if n % i == 0\n end\n divisors_found.uniq.sort\nend",
"title": ""
},
{
"docid": "879b074a01707da233d859608731ad6e",
"score": "0.70587796",
"text": "def num_divisors\n\t\tndf = self.num_distinct_factors\n\t\tif ndf <= 0\n\t\t\tif @trivial_factor.nil?\n\t\t\t\traise \"Factorization.num_divisors: \" \\\n\t\t\t\t\t\"No factors have been inserted.\\n\"\n\t\t\tend\n\t\tend\n\t\trv = 1\n\t\tfor i in (0..(ndf-1))\n\t\t\trv *= @factors_and_multiplicities[i][1] + 1\n\t\tend\n\t\treturn rv\n\tend",
"title": ""
},
{
"docid": "cf3e9700a47730db4c8e6ff244084900",
"score": "0.7050062",
"text": "def d(n)\n divisors = (1...n).select{ |i| n % i == 0 }\n divisors.reduce(&:+)\nend",
"title": ""
},
{
"docid": "599f47664fa36f67a98883c32f85c849",
"score": "0.70375466",
"text": "def divisors(n)\n results = []\n max = Math.sqrt(n).floor\n (1..(max)).each do |div|\n # next if results.include?(div)\n x, y = n.divmod(div)\n results << x << div if y == 0\n end\n results.uniq.sort\nend",
"title": ""
},
{
"docid": "f66cb2560e9fca415c648c34298744dc",
"score": "0.6976926",
"text": "def divisors(n)\n divs = []\n # NOT INCLUDING ITSELF\n (1...n).each do |i|\n if n % i == 0\n divs << i\n end\n end\n divs\nend",
"title": ""
},
{
"docid": "f24617cba4f7aea607ba92713b9b1ecf",
"score": "0.69494617",
"text": "def find_proper_divisors_sum(num)\n\tsum = 0\n\tsqrt = Math.sqrt(num)\n\n\t# add all divisors into sum\n\t(1..sqrt).each do |n|\n\t\t# if num is a proper divisor\n\t\tif num % n == 0\n\t\t\t# add it--and its pair (other than 1 and sqrt)--into sum\n\t\t\tif [1,sqrt].include?(n)\n\t\t\t\tsum += n\n\t\t\telse\n\t\t\t\tsum += (n + (num / n))\n\t\t\tend\n\t\tend\n\tend\n\n\tsum\nend",
"title": ""
},
{
"docid": "a8b04f535042ab3a21456c065fe2e9f4",
"score": "0.6944232",
"text": "def divisors(integer)\n (1..integer).to_a.select {|num| integer % num == 0}\nend",
"title": ""
},
{
"docid": "7753cb7d1ae13216efb98c63e07af916",
"score": "0.69338065",
"text": "def factor_count(x)\n range = 2..Math.sqrt(x)\n count = range.count { |i| x % i == 0 }\n count * 2\nend",
"title": ""
},
{
"docid": "f93e0ac5d7ff1a26ce952818af446335",
"score": "0.6930029",
"text": "def factors(number)\n divisors = []\n if number > 0 \n dividend = number\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\n end\n divisors\nend",
"title": ""
},
{
"docid": "2fc4377c18a55938a673ce5a64c957da",
"score": "0.69158995",
"text": "def divisors(int)\n result = []\n 1.upto(int) do |num|\n if int % num == 0\n break if result.include?(num)\n result << num\n result << int / num unless int == num**2\n end\n end\n result.sort\nend",
"title": ""
},
{
"docid": "7ed004637a062d8e9f439cccaea11839",
"score": "0.6909863",
"text": "def first_triangle_number_with_divisors_of(num)\n\tcount = 0\n\ti = 0\n\tsum = 0\n\tuntil count >= num do\n\t\ti += 1\n\t\tsum += i\n\t\tcount = divisor_number_of(sum)\n\tend\n\tsum\nend",
"title": ""
},
{
"docid": "1b39b87fabbddb22f4dd06ef264737da",
"score": "0.68621194",
"text": "def divisors(num)\n arr = [1, num]\n (2..Integer.sqrt(num)).each do |n|\n quot, rem = num.divmod(n)\n arr << [n, quot] if rem.zero?\n end\n arr.uniq.flatten.sort\nend",
"title": ""
},
{
"docid": "a3c082bfe93f52a10d549c207654ca11",
"score": "0.68570185",
"text": "def p5\n\tdivisors = (1..20).to_a\n\tnum = divisors[-1]\n\tloop do\n\t\tbreak if divisible?(num, divisors)\n\t\tnum += divisors[-1]\n\tend\n\treturn num\nend",
"title": ""
},
{
"docid": "f9b4500f6f7fd585c6f6e292758cb291",
"score": "0.6839185",
"text": "def divisible_by number, divisor\n number % divisor == 0\n end",
"title": ""
},
{
"docid": "7c5aed246abb4cba68c1013d1e8cd7bf",
"score": "0.68375075",
"text": "def proper_divisors n\n if (n < 2)\n return []\n end\n\n r = Math.sqrt(n)\n p = (r - 1).ceil\n d = (2..p).collect { |x| [x, n/x] if n % x == 0 }.compact.flatten\n if (r == r.floor)\n d.concat([r.floor])\n end\n return d.concat([1])\nend",
"title": ""
},
{
"docid": "849516fc88a8c044c01b20e5b7e7d03f",
"score": "0.6834381",
"text": "def divisors(num)\n results = []\n \n 1.upto(num) do |current_num|\n results << current_num if num % current_num == 0\n end\n \n results\nend",
"title": ""
},
{
"docid": "ea8494dcf166aa71e7d5103522a75c01",
"score": "0.6833784",
"text": "def factors(number)\n dividend = number\n divisors = []\n while number >= 1\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n break if dividend == 0\n end\n divisors\nend",
"title": ""
},
{
"docid": "66f08069857bfd414ad8c66813b159da",
"score": "0.68187475",
"text": "def counting_the_divisor\n i = 12370\n count = 0\n triagular_factor = 0\n loop do\n triagular_factor = triangular_number_logic(i)\n p triagular_factor\n count = divisors(triagular_factor)\n break if count > 500\n\n p count\n i += 1\n end\n p triagular_factor\n p count\nend",
"title": ""
},
{
"docid": "32198467e21b82c969b7330de83bc57c",
"score": "0.6813671",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend == 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\n\n # number % dividend == 0 checks if the number is divisable with no remainder\n # returns the divisors array\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.68119615",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ba627e5a97281692dc5420fbdb38c4be",
"score": "0.68119615",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "ced0c716e0aee455d18284a59dac7cb7",
"score": "0.68096215",
"text": "def factors(number)\n dividend = number\n divisors = []\n loop do\n break if dividend <= 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "bbaec719ad914a2f7af4f3b2241c2f16",
"score": "0.6791644",
"text": "def divide(dividend, divisor)\r\n ((dividend < 0 && divisor >= 0) || (dividend >= 0 && divisor < 0)) ? negative = true : negative = false\r\n dividend = dividend.abs\r\n divisor = divisor.abs\r\n count = 0\r\n until dividend < divisor\r\n dividend -= divisor\r\n count += 1\r\n return negative ? 0 - (2**31) : 2**31 - 1 if count > 9999999\r\n end\r\n negative ? 0 - count : count\r\nend",
"title": ""
},
{
"docid": "5c3b893f9dd8ed45588c79737c350fbc",
"score": "0.678109",
"text": "def divisors(n)\n\th = [1]\n\ti = 2\n\twhile i**2 < n\n\t\tif n % i == 0\n\t\t\th << i << (n / i)\n\t\tend\n\t\ti += 1\n\tend\n\tif i**2 == n\n\t\th << i\n\tend\n\th\nend",
"title": ""
},
{
"docid": "2f9c5bc5f306106a94f15b57e0902146",
"score": "0.6777795",
"text": "def n_prime_factors(number)\n n_prime = 0\n (2..number / 2).each do |n|\n next unless (number % n).zero?\n n_prime += 1 if Prime.prime?(n)\n end\n n_prime\n end",
"title": ""
},
{
"docid": "d6c7a6a99e223df5a1579cceb4e6b585",
"score": "0.6777784",
"text": "def find_factors(number)\n\t# start with lowest prime number\n\tinteger = 2\n\n\t# make sure integer doesn't exceed the actual number\n\twhile integer <= number do\n\t\t# integer will be returned when if it is a factor of number\n\t\treturn integer if number % integer == 0\n\n\t\t# if integer is not a factor move to next integer\n\t\tinteger += 1\n\tend\nend",
"title": ""
},
{
"docid": "ae37bfb1bbef57d3ef7d7945a059b201",
"score": "0.67718446",
"text": "def factors(number)\n dividend = number\n divisors = []\n while number > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "f84e17993878acd7edc76488aa627ec1",
"score": "0.67600006",
"text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\ndivisors\nend",
"title": ""
},
{
"docid": "7cc493b4dab79de893db0294ee61b298",
"score": "0.67538",
"text": "def count_evenly_devide_numbers(\n number:\n)\n result = 0\n # Split the number into an array of its digits\n num_array = number.to_s.split('').map(&:to_i)\n # Iterate the array and inc the result if number modulo its digit in zero\n num_array.each { |num| result += 1 if !num.zero? && number.modulo(num).zero? }\n # Return the result\n result\nend",
"title": ""
},
{
"docid": "e64472ae65d6901540faa0f47a2683fe",
"score": "0.67534775",
"text": "def factors(number)\n dividend = number\n divisors = [] # make an empty array called divisors\n begin\n # if the number / dividend is a whole number add it to the array\n divisors << number / dividend if number % dividend == 0\n # minus 1 from the dividend\n dividend -= 1\n # end when dividend is 0\n end until dividend == 0\n divisors\nend",
"title": ""
},
{
"docid": "8aec8c26f2819c7d6a3ff498b62e1764",
"score": "0.67443186",
"text": "def dividers(num)\n\n (1..num).select { |x| num%x == 0}\n\nend",
"title": ""
},
{
"docid": "99eacc2b61a375589330c152ec88f7e1",
"score": "0.6727288",
"text": "def sumOfDivisor(n)\n\n\tif $sumOfDivisors.has_key?(n)\n\t\treturn $sumOfDivisors[n]\n\tend\n\n\tsum = 0\n\tsquareRootFloor = Math.sqrt(n).floor\n\n\tfor i in 1..squareRootFloor\n\t\tif n % i == 0\n\t\t\tsum += i\n\t\t\tsum += n/i\n\t\tend\n\tend\n\n\tif n.isPerfectSquare?\n\t\tsum -= squareRootFloor\n\tend\n\n\tsum -= n\n\n\t$sumOfDivisors[n] = sum\n\n\tif sum > n\n\t\t# add to abundant number hash if is abudant number\n\t\t$abundantNumbersHash[n] = 1\n\tend\n\n\treturn sum\nend",
"title": ""
},
{
"docid": "17c61b1de5f96197c4c9bba4e1d96e65",
"score": "0.6715406",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.6708194",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.6708194",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.6708194",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.6708194",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "41cd9ea2fce3b2fcdfad72a765f46c38",
"score": "0.6708194",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "bab02faac98f4f02b21ea69151d4e5fa",
"score": "0.66989154",
"text": "def find_min_num(num)\n return 1 if num == 1\n n = 2\n minimum_num = nil\n loop do\n minimum_num = n if divisors(n).flatten.uniq.size == num\n n += 1\n break if minimum_num\n end\n minimum_num\nend",
"title": ""
},
{
"docid": "1024e9008564d4908cf4f5b0f263b0bd",
"score": "0.66968155",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end \n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "3de58ce67bed78c3e572e0b34d516a1e",
"score": "0.6694511",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "377b6f0e253ef4d4fa2a8994ea499ea3",
"score": "0.6693794",
"text": "def divisors(int)\n result = []\n\n (1..int).each do |possible_divisor| \n if int % possible_divisor == 0\n result << possible_divisor\n end\n end\n\n result\nend",
"title": ""
},
{
"docid": "738cb4aecb73956a35bdb17207c3e88e",
"score": "0.66892827",
"text": "def factors(number)\n dividend = number\n divisors = []\n number.times do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "79ff787120a75eca3b65a7b360d63ef5",
"score": "0.66855794",
"text": "def is_perfect?(num)\n divisors = []\n (1..(num/2)).each do |div|\n if num % div == 0\n divisors.push(div)\n end\n end\n divisor_total = divisors.reduce(:+)\n if divisor_total == num\n 0\n elsif divisor_total < num\n -1\n elsif divisor_total > num\n 1\n end\nend",
"title": ""
},
{
"docid": "2f2da5d506ff87f3dcf3d1e5e63f27e2",
"score": "0.66767305",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend>0 do \n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n p divisors\nend",
"title": ""
},
{
"docid": "99e029f09fa7ff637e420f534a0558a7",
"score": "0.6670735",
"text": "def divide(dividend, divisor)\n\n denom = divisor\n current = 0\n\n return 0 if denom > dividend\n return 1 if denom == dividend\n\n # 5 45\n while denom <= dividend do \n \tdenom += divisor\n \tcurrent += 1 \n end\n remainder = dividend - (denom - divisor)\n current\nend",
"title": ""
},
{
"docid": "a14bf12b7fce6e0eb90e41aea5ce4884",
"score": "0.66689616",
"text": "def divisors(x)\n (2..Math.sqrt(x) + 1).select { |i| x % i == 0 }.map { |n| [n, x/n] }.flatten.uniq.sort\nend",
"title": ""
},
{
"docid": "ecc1c6ddd062e443b3a050c744907bb0",
"score": "0.66675675",
"text": "def divisors(n)\n arr = Prime.prime_division(n).map { |v,exp| (0..exp).map { |i| v**i } }\n arr.first.product(*arr[1..-1]).map { |a| a.reduce(:*) }.map { |m| [m,n/m] }\nend",
"title": ""
},
{
"docid": "e407b3404787e56f9f43d854d4a8842c",
"score": "0.6666404",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "9224f8d692ec5436190f561bbbe68392",
"score": "0.6655526",
"text": "def proper_divisors(n)\r\n divisors = Array.new\r\n 1.upto(Math.sqrt(n)) do |x|\r\n if n % x == 0\r\n divisors << x\r\n if x != n / x && x != 1\r\n divisors << n / x\r\n end\r\n end\r\n end\r\n divisors\r\n end",
"title": ""
},
{
"docid": "d07efd457a089d784faae47734557f16",
"score": "0.6639049",
"text": "def factors2(number)\n dividend = number\n divisors = []\n while number > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n break if dividend == 0\n end\n divisors\nend",
"title": ""
},
{
"docid": "4c06377cb1e7a5e2b240b31ec36ac57f",
"score": "0.6635462",
"text": "def factors(number)\n dividend = 1\n divisors = []\n while dividend <= number\n divisors << dividend if number % dividend == 0\n dividend += 1\n end\n divisors\nend",
"title": ""
},
{
"docid": "544c121dabc254031ccf4b2778edb3e1",
"score": "0.66341686",
"text": "def factors num\n if num != 1\n #Start with 1 and num as the first factors\n c = 2\n 2.upto(num/2) { |f|\n if num % f == 0\n c += 1\n end\n }\n else\n c = 1\n end\n\n c\nend",
"title": ""
},
{
"docid": "1095e1f8db72ce38de0733e9a9562a67",
"score": "0.66250575",
"text": "def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end \n divisors\nend",
"title": ""
},
{
"docid": "938c3106de515da2c19847e6a8df7497",
"score": "0.6616741",
"text": "def numbers_of_multiple (number)\n divisors = []\n (1..20).each do |divisor|\n if number % divisor ==0\n divisors.push divisor\n end\n end\n #if divisors.length == 20\n # return true\n #else\n # puts divisors.length\n # return false\n #end\n return divisors.length\nend",
"title": ""
},
{
"docid": "9fff48aa8f62fd38d4c7febb91b129ef",
"score": "0.66148627",
"text": "def divisors(n)\n div = Array.new\n curr = n - 1\n while curr > 1\n div.unshift(curr) if n % curr == 0\n curr -= 1\n end\n div.empty? ? \"#{n} is prime\" : div\nend",
"title": ""
},
{
"docid": "dd841a63acab433cc57bdd78f7f8200d",
"score": "0.66092926",
"text": "def factors_new(number)\n divisors = []\n dividend = number\n while dividend > 0 \n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end \n divisors\n end\n divisors\nend",
"title": ""
},
{
"docid": "4acaa54d5ceeac20be114792b983b34a",
"score": "0.66088676",
"text": "def divisors(num)\n divisors_results = [] \n 2.upto(num - 1) do |n|\n divisors_results << n if num % n == 0\n end\n return \"#{num} is prime\" if divisors_results.empty?\n divisors_results\nend",
"title": ""
},
{
"docid": "d1523505698c71d5eb979101e4465bbe",
"score": "0.65985155",
"text": "def findDigits(number_to_divide)\n divisor_count = 0\n \n char_array = number_to_divide.to_s.each_char.map {|ch| ch.to_i}\n char_array.delete_if{|ch| ch == 0}\n \n char_array.each{|digit| divisor_count += 1 if number_to_divide % digit == 0}\n return divisor_count \n\n\n\nend",
"title": ""
},
{
"docid": "be798d5dfe425fb9660c99ddd3ad769f",
"score": "0.65875614",
"text": "def d(n)\r\n proper_divisors(n).reduce(:+)\r\nend",
"title": ""
}
] |
e00e3dcdafd3bdcf0e5b72a316fa769a | Restore any relevant files that were present when repo was in the middle of a cherrypick. | [
{
"docid": "0026dd2a7202c6c59740433c7bce607e",
"score": "0.68509847",
"text": "def restore_cherry_pick_state\n if @cherry_head\n File.open(File.expand_path('CHERRY_PICK_HEAD',\n Overcommit::Utils.git_dir), 'w') do |f|\n f.write(\"#{@cherry_head}\\n\")\n end\n @cherry_head = nil\n end\n end",
"title": ""
}
] | [
{
"docid": "5ea08400aa7f1e0e33d72c98bfdb43be",
"score": "0.703418",
"text": "def restore_cherry_pick_state\n if @cherry_head\n File.open(File.expand_path('CHERRY_PICK_HEAD',\n Overcommit::Utils.git_dir), 'w') do |f|\n f.write(@cherry_head)\n end\n @cherry_head = nil\n end\n end",
"title": ""
},
{
"docid": "21666a1a1c0c8a9825986a7e61460e8f",
"score": "0.65562814",
"text": "def remove_moved_files\n scan_for_merges.each do |file|\n if File.amp_lexist?(@repo.working_join(file))\n UI.debug(\"removing #{file}\")\n File.unlink(@repo.working_join(file))\n end\n end\n end",
"title": ""
},
{
"docid": "b7e45311217f6d07f0d8f3f31413faae",
"score": "0.60023856",
"text": "def restore_cherry_pick_state; end",
"title": ""
},
{
"docid": "b7e45311217f6d07f0d8f3f31413faae",
"score": "0.60023856",
"text": "def restore_cherry_pick_state; end",
"title": ""
},
{
"docid": "5fe55b4dc0bc8f875b7bb357e0102a1c",
"score": "0.59590894",
"text": "def rollback!\n files.each { |file, contents| rollback_file(file, contents) }\n @files = {}\n end",
"title": ""
},
{
"docid": "2375129c59e891809d27d1679eb853f3",
"score": "0.58766305",
"text": "def reset_repo(&block)\n yield\n=begin\n Dir.chdir(@saved_cwd){\n system 'rm', '-rf', repo4test\n if !File.directory?(repo4test)\n repo = File.join(repo4test, Juli::REPO)\n FileUtils.mkdir_p(repo)\n FileUtils.cp(File.join(repo4test, '../data/config'), repo,\n :preserve=>true)\n end\n Dir.chdir(repo4test){\n yield\n }\n }\n=end\n end",
"title": ""
},
{
"docid": "0b40f8802617523fdebc1f46fa9d9a7c",
"score": "0.5835693",
"text": "def discard\n Dir.chdir @root do\n # First, add all files to the index. (Otherwise, we won't discard new\n # files.) Then, hard reset to revert to the last saved state.\n cmd = \"git add --all && git reset --hard\"\n stdout, stderr, status = Open3.capture3 cmd\n if status != 0\n case stderr\n when /Not a git repository/\n raise NotARepositoryError\n else\n raise Error, stderr\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e23493efa0e0df1ffbc9bf3c9cfe6673",
"score": "0.5814504",
"text": "def restore_merge_state; end",
"title": ""
},
{
"docid": "e23493efa0e0df1ffbc9bf3c9cfe6673",
"score": "0.5814504",
"text": "def restore_merge_state; end",
"title": ""
},
{
"docid": "7af59b853bc1219dcdb3b23473029d32",
"score": "0.580473",
"text": "def restore_source_files source\n dir = Conf::directories\n base = File.join(dir.data)\n source.folders.each do |fold|\n url = File.join(dir.backup,source.name.to_s,fold)\n files = ls(url).map { |f| CDR::File.new(::File.join(url,f),search: true)}\n nurl = File.join(dir.store,source.name.to_s,fold)\n download_all_files(files,nurl) unless files.empty?\n end\n Logger.<<(__FILE__,\"INFO\",\"Restored file from backup & server for #{source.name.to_s}\")\n end",
"title": ""
},
{
"docid": "2e178a880fd7c4f47463109eb97912ea",
"score": "0.5772451",
"text": "def after_source_download\n Dir.chdir cachedir/name do\n sh \"git checkout #{version}\"\n sh 'git submodule update --init'\n end\n end",
"title": ""
},
{
"docid": "34ca8f5b144a18e98c5e206dd35bdb94",
"score": "0.5737047",
"text": "def restore_archive\n end",
"title": ""
},
{
"docid": "907fe0a250b2a06000fefe252c937b20",
"score": "0.563026",
"text": "def revert(files=nil, opts={})\n # get the parents - used in checking if we haven an uncommitted merge\n parent, p2 = dirstate.parents\n \n # get the revision\n rev = opts[:revision] || opts[:rev] || opts[:to]\n \n # check to make sure it's logically possible\n unless rev || p2 == Amp::Mercurial::RevlogSupport::Node::NULL_ID\n raise abort(\"uncommitted merge - please provide a specific revision\")\n end\n \n # if we have anything here, then create a matcher\n matcher = if files\n Amp::Match.create :files => files ,\n :includer => opts[:include],\n :excluder => opts[:exclude]\n else\n # else just return nil\n # we can return nil because when it gets used in :match => matcher,\n # it will be as though it's not even there\n nil\n end\n \n # the changeset we use as a guide\n changeset = self[rev]\n \n # get the files that need to be changed\n stats = status :node_1 => rev, :match => matcher\n \n ###\n # now make the changes\n ###\n \n ##########\n # MODIFIED and DELETED\n ##########\n # Just write the old data to the files\n (stats[:modified] + stats[:deleted]).each do |path|\n File.open path, 'w' do |file|\n file.write changeset.get_file(path).data\n end\n UI::status \"restored\\t#{path}\"\n end\n \n ##########\n # REMOVED\n ##########\n # these files are set to be removed, and have thus far been dropped from the filesystem\n # we restore them and we alert the repo\n stats[:removed].each do |path|\n File.open path, 'w' do |file|\n file.write changeset.get_file(path).data\n end\n \n staging_area.normal path # pretend nothing happened\n UI::status \"saved\\t#{path}\"\n end\n \n ##########\n # ADDED\n ##########\n # these files have been added SINCE +rev+\n stats[:added].each do |path|\n remove path\n UI::status \"destroyed\\t#{path}\"\n end # pretend these files were never even there\n \n staging_area.save\n true # success marker\n end",
"title": ""
},
{
"docid": "1d435b214aa367913421ae2c3ac29136",
"score": "0.5617509",
"text": "def discard\n # First, add all files to the index. (Otherwise, we won't discard new\n # files.) Then, hard reset to revert to the last saved state.\n @git.index.add_all\n @git.index.write\n @git.reset('HEAD', :hard)\n end",
"title": ""
},
{
"docid": "72943edba19eef1146187006fe90cc58",
"score": "0.5557984",
"text": "def store_cherry_pick_state\n cherry_head = `git rev-parse CHERRY_PICK_HEAD 2> #{File::NULL}`.chomp\n\n # Store the merge state if we're in the middle of resolving a merge\n # conflict. This is necessary since stashing removes the merge state.\n if cherry_head != 'CHERRY_PICK_HEAD'\n @cherry_head = cherry_head\n end\n end",
"title": ""
},
{
"docid": "479fe6ba5257d20b3d7b116004ce8be4",
"score": "0.5549867",
"text": "def modified_files\n staged = squash?\n refs = 'HEAD^ HEAD' if merge_commit?\n @modified_files ||= Overcommit::GitRepo.modified_files(staged: staged, refs: refs)\n end",
"title": ""
},
{
"docid": "88644688e14f3250a7eb18bd707c6945",
"score": "0.5549426",
"text": "def setup\n # checkout to new branch\n initialize_revisions\n [@repo_dir, @tap_dir].each do |dir|\n Dir.chdir(dir.to_s) do\n shutup { `git checkout -b #{@new_branch}` }\n end\n end\n end",
"title": ""
},
{
"docid": "849bedb62d619fd0674e2e5bc5f174b4",
"score": "0.55326414",
"text": "def revert_unchanged_files(files = nil)\n files = (files && files.flatten) || self.files\n unless files.empty?\n @perforce.run(\"revert\", \"-a\", \"-c\", @number, *files)\n end\n end",
"title": ""
},
{
"docid": "2a980c65123643c858a86527a5ae4be8",
"score": "0.5520373",
"text": "def rebuild_files\n @project.rebuild_files()\n end",
"title": ""
},
{
"docid": "b287e76c2d2a675352a2debfa07e659b",
"score": "0.5516258",
"text": "def reset!\n repo.reset('origin/master', :hard)\n end",
"title": ""
},
{
"docid": "7d4ded5b02b5e8565cf9bb0963f3eea0",
"score": "0.5514829",
"text": "def set_up_old_test_repo\n require 'fileutils'\n test_old_repo_path.mkpath\n origin = ROOT + 'spec/fixtures/spec-repos/test_repo/.'\n destination = tmp_repos_path + '../master'\n FileUtils.cp_r(origin, destination)\n FileUtils.rm_r(destination + './.git')\n repo_make('../master')\n end",
"title": ""
},
{
"docid": "d85e3e2475735a66ca712a1dd24d363b",
"score": "0.54544425",
"text": "def initial_path_setup\n repo_name = @repo.repo_name.gsub(/[.]+/, '-') || @repo.repo_name\n repo_path = Rails.root.join('storage', 'repos', @repo.username, @repo.supplier_project_id.to_s, repo_name)\n FileUtils.mkdir_p(repo_path) unless File.directory?(repo_path)\n Dir.chdir(repo_path)\n ActiveRecord::Base.connection_pool.with_connection do \n @repo.update(clone_path: repo_path)\n end\n end",
"title": ""
},
{
"docid": "32e2c04a349bcc9f1d6cea7a1856def2",
"score": "0.5450849",
"text": "def restore_merge_state\n if @merge_head\n FileUtils.touch(File.expand_path('MERGE_MODE', Overcommit::Utils.git_dir))\n\n File.open(File.expand_path('MERGE_HEAD', Overcommit::Utils.git_dir), 'w') do |f|\n f.write(@merge_head)\n end\n @merge_head = nil\n end\n\n if @merge_msg\n File.open(File.expand_path('MERGE_MSG', Overcommit::Utils.git_dir), 'w') do |f|\n f.write(\"#{@merge_msg}\\n\")\n end\n @merge_msg = nil\n end\n end",
"title": ""
},
{
"docid": "005c7590d5691532ac74d326883f1215",
"score": "0.54448813",
"text": "def store_cherry_pick_state\n cherry_head = `git rev-parse CHERRY_PICK_HEAD 2> /dev/null`.chomp\n\n # Store the merge state if we're in the middle of resolving a merge\n # conflict. This is necessary since stashing removes the merge state.\n if cherry_head != 'CHERRY_PICK_HEAD'\n @cherry_head = cherry_head\n end\n end",
"title": ""
},
{
"docid": "3e267392d34e468a6601596e07cad450",
"score": "0.5443825",
"text": "def cleanup\n cleanup_unpack_path\n cleanup_download_path\n end",
"title": ""
},
{
"docid": "2bd63c4855bbbd55c806172cda288d18",
"score": "0.54357487",
"text": "def sanitize_cookbook\n puts \"Sanitizing remote cookbook path to #{source_path}\"\n\n # Define which elements should not be moved from the extracted cookbook.\n # PaxHeader is an archive artifact that exists in some older cookbooks.\n no_move = ['.', '..', 'PaxHeader'].map { |e| \"#{source_path}/#{name}/#{e}\" }\n to_move = Dir.glob(\"#{source_path}/#{name}/{.*,*}\").reject do |i|\n no_move.include? i\n end\n\n FileUtils.mv to_move, source_path\n\n bad_files = [name, 'PaxHeader', '.yardopts'].map { |bf| \"#{source_path}/#{bf}\" }\n FileUtils.rm_rf bad_files\n end",
"title": ""
},
{
"docid": "7f9c90bd3ef92be085151aad5ce6c45c",
"score": "0.5421757",
"text": "def cleanup\n @agent_file_history.each { |af| FileUtils.rm_f(af) }\n @key_file_history.each { |kf| FileUtils.rm_f(kf) }\n end",
"title": ""
},
{
"docid": "aa68c3e234d9f3489751401d83730b91",
"score": "0.5418203",
"text": "def reinit_submods\n # add back in our submodules\n `git submodule init`\n `git submodule update`\n\n # ensure we checkout master (cause it'll default to headless)\n `git --git-dir=#{self.submods}/.git checkout master`\n end",
"title": ""
},
{
"docid": "cbc3a8ed40d3c938cb2e81c3ce5e7929",
"score": "0.5362243",
"text": "def copy_files\n file_candidates.each do |remote_file|\n local_file = File.basename(remote_file)\n if File.exist?(local_file)\n if same_file?(local_file, remote_file)\n info \"\\n>> '#{local_file}' has the same contents here as in the repo. Leaving it alone.\"\n else\n if config['answer_yes']\n warn \"\\n>> '#{local_file}' is different than its counterpart in the repo.\"\n info \"Copying #{remote_file} to #{local_file}... (answer_yes is true)\"\n copy_file(remote_file, local_file)\n else\n warn \"\\n>> '#{local_file}' is different than its counterpart in the repo (see below)\"\n git_diff(local_file, remote_file)\n prompt \"\\nDo you want to overwrite #{local_file} with the version from the repo? [y/N]: \"\n\n answer = $stdin.gets.chomp\n case answer\n when ''\n error 'Moving on.' # Default behavior.\n when /y/i\n info \"Copying #{remote_file} to #{local_file}...\"\n copy_file(remote_file, local_file)\n when /n/i\n error 'Moving on.'\n else\n error 'Unknown selection. Moving on.'\n end\n end\n\n end\n else\n info \"\\n>> '#{local_file}' does not exist locally.\"\n info \"Copying #{remote_file} to #{local_file}...\"\n copy_file(remote_file, local_file)\n end\n end\n end",
"title": ""
},
{
"docid": "4a1990c89220352b9033d0cc1659124a",
"score": "0.535442",
"text": "def restore_merge_state\n if @merge_head\n FileUtils.touch(File.expand_path('MERGE_MODE', Overcommit::Utils.git_dir))\n\n File.open(File.expand_path('MERGE_HEAD', Overcommit::Utils.git_dir), 'w') do |f|\n f.write(\"#{@merge_head}\\n\")\n end\n @merge_head = nil\n end\n\n if @merge_msg\n File.open(File.expand_path('MERGE_MSG', Overcommit::Utils.git_dir), 'w') do |f|\n f.write(\"#{@merge_msg}\\n\")\n end\n @merge_msg = nil\n end\n end",
"title": ""
},
{
"docid": "dcc8fa1910a40305830c26a77c9ca83d",
"score": "0.5351927",
"text": "def reset!\n self.draft = find_original_file!.read\n save!\n end",
"title": ""
},
{
"docid": "ddbdac2cc0aaa51dec1b8b33509fec1d",
"score": "0.53226227",
"text": "def restore\n end",
"title": ""
},
{
"docid": "7f58c636e1d23ce22f0f6aa76d30eb0f",
"score": "0.5303592",
"text": "def restore; end",
"title": ""
},
{
"docid": "94ad3f17739baaad204273ac82ce03ec",
"score": "0.52929103",
"text": "def temporarily_merge_migration_files(explanation=nil)\n copy_files = []\n Rails.application.config.paths[\"db/migrate\"].expanded.each do |specified_migration_dir|\n if migrations_dir.to_s != specified_migration_dir\n Dir[File.join(specified_migration_dir, '*')].each do |file_name|\n copy_files.push([file_name, migrations_dir.join(File.basename(file_name)).to_s])\n end\n end\n end\n if explanation && copy_files.any?\n puts \"SequelRails: Detected migration files outside of the main db/migrate directory. Copying them to db/migrate temporarily to #{explanation}:\"\n copy_files.each { |o, _| puts \" - #{o}\"}\n end\n copy_files.each { |original, destination| FileUtils.cp(original, destination) }\n yield\n ensure\n copy_files.each { |_, destination| FileUtils.rm_f(destination) }\n end",
"title": ""
},
{
"docid": "40df2b1f3e078a141f9d31766dda7707",
"score": "0.5287831",
"text": "def cleanup_state\n delete_if_exists(state_file_path)\n delete_if_exists(chef_file_path)\n delete_if_exists(past_scripts_path)\n delete_if_exists(log_path)\n end",
"title": ""
},
{
"docid": "4edb8304b2017f8f4a3832d1eae8b814",
"score": "0.5282131",
"text": "def setup_path\n if !@repo.clone_path.nil? and !@repo.clone_path.empty?\n Dir.chdir(@repo.clone_path)\n else\n initial_path_setup\n end\n end",
"title": ""
},
{
"docid": "bca58fdd969e8dc2edc661fd0b358e79",
"score": "0.5275916",
"text": "def discard_repo\n @handler.discard\n end",
"title": ""
},
{
"docid": "a62e644a527516459d81a64e5de9166f",
"score": "0.52683747",
"text": "def undo \n if(@hasExecuted==true and (File::exist?(@newPath)))\n FileUtils.cp_r(@newPath, @ogPath)\n FileUtils::rm_r(@newPath)\n @hasExecuted=false\n end\n end",
"title": ""
},
{
"docid": "8f571364d4882ffc6fbd7e0a74658bd1",
"score": "0.5265248",
"text": "def restore(shaw, current_state_msg, restored_state_msg)\n @git.add_all\n @git.execute(%Q[commit -m \"#{current_state_msg}\"])\n @git.execute(%Q[revert -n #{shaw}..HEAD])\n @git.execute(%Q[commit -m \"#{restored_state_msg}\"])\n end",
"title": ""
},
{
"docid": "b036f2d36778ee1249d408fafa860a03",
"score": "0.52555263",
"text": "def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/b2_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"Directory does not exist!\"\n end\n\nend",
"title": ""
},
{
"docid": "d9cbc5b768be75b332cae12cd39bb784",
"score": "0.5255452",
"text": "def restore_dir\n cd @dir\n end",
"title": ""
},
{
"docid": "df0b0df7dd5ce71040d59a21faef718b",
"score": "0.52544034",
"text": "def cleanup\n if ::File.exist?(chef_backup_dir) # rubocop:disable Style/GuardClause\n converge_by(\"removing #{chef_backup_dir}\") do\n FileUtils.rm_rf chef_backup_dir\n end\n end\nend",
"title": ""
},
{
"docid": "c48b6aa0f684a8ff0ff22fda3d09e7fa",
"score": "0.5213462",
"text": "def unstage_files(*files)\n command = \"git reset #{files.join(' ')}\"\n command_success?(command)\n end",
"title": ""
},
{
"docid": "26c3a1bff63e30ea825a72e120e19434",
"score": "0.52127975",
"text": "def restore(path)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "f87d819384130a02442c92f8e2f6d290",
"score": "0.5206827",
"text": "def _rewire_cookbooks\n # Run context might be unset during test setup.\n if run_context\n run_context.cookbook_collection.keys.select {|cookbook_name| cookbook_name.start_with?('application_') }\n else\n []\n end\n end",
"title": ""
},
{
"docid": "ae4b328cfb3d6ba39d65be9960f78d57",
"score": "0.52035606",
"text": "def clear_obsoleted_cookbooks\n @events.cookbook_clean_start\n\n if remove_obsoleted_files\n remove_old_cookbooks\n else\n Chef::Log.info(\"Skipping removal of obsoleted cookbooks from the cache\")\n CookbookCacheCleaner.instance.skip_removal = true\n end\n\n remove_deleted_files\n\n @events.cookbook_clean_complete\n end",
"title": ""
},
{
"docid": "a05cc9e2f2ad77d097266dcb8a2f908c",
"score": "0.5195611",
"text": "def fetch_changesets\n puts \"Calling fetch changesets on #{clone_path}\"\n # runs git fetch\n self.fetch\n super\n end",
"title": ""
},
{
"docid": "9f8857c045369a276bdf3c4b9aa92bb2",
"score": "0.5189516",
"text": "def remove_stale_files() = stale_files.each { |file| remove_file(file) }",
"title": ""
},
{
"docid": "1cbafad5316131c539a2de24f280533a",
"score": "0.51864547",
"text": "def replaced_files; end",
"title": ""
},
{
"docid": "5023445cf1b58e31cde003754c25c3a8",
"score": "0.518398",
"text": "def after_fork\n @files_to_reopen.each do |file|\n begin\n file.reopen file.path, \"a+\"\n file.sync = true\n rescue ::IOError # rubocop:disable HandleExceptions\n end\n end\n end",
"title": ""
},
{
"docid": "1564ea85130e70481c4aad025ff608ea",
"score": "0.51814985",
"text": "def restore_branch\n @@obj.branch(@@save_branch.pop).checkout\n end",
"title": ""
},
{
"docid": "d159b594cb4eba8469f925dae1832724",
"score": "0.5172867",
"text": "def forget_removed\n action = branch_merge ? :remove : :forget\n working_changeset.deleted.each do |file|\n act action, file unless target_changeset[file]\n end\n\n unless branch_merge\n working_changeset.removed.each do |file|\n forget file unless target_changeset[file]\n end\n end\n end",
"title": ""
},
{
"docid": "a1e310fa80382ee7e9cfba602d5bc688",
"score": "0.51718956",
"text": "def recombinate_files_for_multiple_transfers_possibly\r\n got_end_big_transfer = false\r\n \tif @current_transfer_file =~ /recombinate_ok/\r\n\t recombinate_files_split_piece_wise @copied_files\r\n\t @copied_files = []\r\n\t got_end_big_transfer = true\r\n\tend\r\n\t@current_transfer_file = nil\r\n\tgot_end_big_transfer\r\n end",
"title": ""
},
{
"docid": "96872e17f346a570c69da49ffa997deb",
"score": "0.5170898",
"text": "def install\n if cached?\n # Update and checkout the correct ref\n Dir.chdir(cache_path) do\n hg %|pull|\n end\n else\n # Ensure the cache directory is present before doing anything\n FileUtils.mkdir_p(cache_path)\n\n Dir.chdir(cache_path) do\n hg %|clone #{uri} .|\n end\n end\n\n Dir.chdir(cache_path) do\n hg %|update --clean --rev #{revision || ref}|\n @revision ||= hg %|id -i|\n end\n\n # Gab the path where we should copy from (since it might be relative to\n # the root).\n copy_path = rel ? cache_path.join(rel) : cache_path\n\n begin \n # Validate the thing we are copying is a Chef cookbook\n validate_cached!(copy_path)\n\n # Remove the current cookbook at this location (this is required or else\n # FileUtils will copy into a subdirectory in the next step)\n FileUtils.rm_rf(install_path)\n\n # Create the containing parent directory\n FileUtils.mkdir_p(install_path.parent)\n\n # Copy whatever is in the current cache over to the store\n FileUtils.cp_r(copy_path, install_path)\n\n ensure\n\n # Remove the .hg directory to save storage space\n # TODO this can have huge performance implications, \n # make it a config option?\n if (hg_path = install_path.join('.hg')).exist?\n FileUtils.rm_r(hg_path)\n end\n\n FileUtils.rm_rf (copy_path)\n end\n end",
"title": ""
},
{
"docid": "6aa3255fb94bd56d3823f9e510046c3d",
"score": "0.5165323",
"text": "def post_process(file)\n if File.basename(file.to_s).match(/library/)\n oldfile = file\n file = file.to_s.sub(\"library\", @options[:lib_name_u])\n FileUtils.mv(oldfile, file)\n end\n if File.dirname(file.to_s).split(\"/\").last == \"library\"\n origdir = File.dirname(file.to_s)\n dirarr = origdir.split(\"/\")\n dirarr[dirarr.size-1] = @options[:lib_name_u]\n new_dir = File.join(dirarr)\n mkdir(new_dir)\n oldfile = file\n file = File.join(new_dir, File.basename(file))\n FileUtils.mv(oldfile, file)\n FileUtils.rmdir(origdir)\n end\n if file.to_s.match(/\\.seed$/)\n out_file = Pathname.new(file.to_s.sub(/\\.seed$/, ''))\n # Don't overwrite a file of the same name, unless they --force\n if copy_check(out_file)\n template = ::ERB.new(File.read(file))\n # This binding has access to any instance variables of\n # the ProjectCreator instance\n result = template.result(binding)\n File.open(file.to_s.sub(/\\.seed$/,''), 'w+') do |io|\n io.puts result\n end\n end\n # Remove the seed file whether we copied or not\n FileUtils.rm_f(file)\n end\n end",
"title": ""
},
{
"docid": "cee5342afdd9539cf6ba9f535c7e3b4e",
"score": "0.5153679",
"text": "def restore_files(paths, snapshot, all)\n #\n # Basic args\n #\n args = %w(rsync --archive --numeric-ids --inplace --relative --compress)\n\n #\n # Add on the I/O-timeout\n #\n args += ['--timeout', @io_timeout.to_s ] unless ( @io_timeout.nil? )\n args += ['--rsh', \"ssh -o BatchMode=yes -x -a -i #{@ssh_key} -l #{@destination_user}\"]\n args << '--verbose' if @verbose\n args += ['--rsync-path', \"byteback-restore --fake-super --snapshot #{snapshot}\" + (all ? \" --all\" : \"\")]\n\n #\n # To add extra rsync flags, a file can be used. This can have flags all on one line, or one per line.\n #\n if File.exists?(\"/etc/byteback/rsync_flags\")\n args += File.readlines(\"/etc/byteback/rsync_flags\").map(&:chomp)\n end\n\n dst = \"#{@destination_user}@#{@destination_host}:\"\n\n paths.each do |path|\n path = Byteback::Restore.encode_args(path).first\n args << File.join(dst,path)\n dst = \":\"\n end\n\n args << \".\"\n puts args.join(\" \") if @verbose\n system(*args)\nend",
"title": ""
},
{
"docid": "4fcc911211fffda7c7fd9d7569c32b9d",
"score": "0.51445305",
"text": "def rearrange\n rootpath = \"#{$paths.restore_path}/Student_Records_D20130520/Student_Records\"\n Dir.entries(rootpath).each{|entry|\n if !entry.gsub(/\\.|rb/,\"\").empty?\n Dir.chdir(\"#{rootpath}/#{entry}/SY_2012-2013\")\n if !File.directory?(\"#{rootpath}/#{entry}/SY_2012-2013/Withdrawal\")\n Dir.mkdir(\"#{rootpath}/#{entry}/SY_2012-2013/Withdrawal\")\n end\n Dir.glob('WD_**') do |file|\n #puts File.expand_path(file)\n oldpath = File.expand_path(file)\n FileUtils.mv(\"#{oldpath}\",\"#{rootpath}/#{entry}/SY_2012-2013/Withdrawal\")\n end\n end\n }\n end",
"title": ""
},
{
"docid": "d1b9365253ccfa726153498ca30b9a2b",
"score": "0.51410633",
"text": "def undo()\r\n #need to manipulate strings by taking file name off of OldFilePath and adding it onto NewFilePath\r\n oldname = @OldFilePath.basename\r\n @NewFilePath = \"#{@NewFilePath}/#{oldname}\"\r\n origfolder = @OldFilePath.dirname\r\n @OldFilePath = origfolder\r\n\r\n FileUtils.mv(@NewFilePath, @OldFilePath)\r\n end",
"title": ""
},
{
"docid": "9edc6e5f3951f8a5a3e22e481cb8b537",
"score": "0.5137722",
"text": "def scan_for_merges\n moves = []\n # prescan for merges in the list of actions.\n @actions.select {|act| act.is_a? Action::MergeAction}.each do |a|\n # destructure the list\n file, remote_file, filename_dest, flags, move = a.file, a.remote_file, a.file_dest, a.flags, a.move\n UI.debug(\"preserving #{file} for resolve of #{filename_dest}\")\n # look up our changeset for the merge state entry\n vf_local = working_changeset[file]\n vf_other = target_changeset[remote_file]\n vf_base = vf_local.ancestor(vf_other) || @repo.versioned_file(file, :file_id => Updating::NULL_REV)\n # track this merge!\n @repo.merge_state.add(vf_local, vf_other, vf_base, filename_dest, flags)\n\n moves << file if file != filename_dest && move\n end\n moves\n end",
"title": ""
},
{
"docid": "8ea6208421bd2995908c957cbf2ea32d",
"score": "0.51325417",
"text": "def reset\n @git = nil\n @configuration = nil\n end",
"title": ""
},
{
"docid": "348262441eaffcbcf25596c8c7359cb8",
"score": "0.5127414",
"text": "def clobber\n rm_r(srcdir)\n rm_r(blddir)\n rm_r(libdir)\n rm_r(config_file)\n end",
"title": ""
},
{
"docid": "d7ee8cd589669cdad9c59ca27e7fbc2a",
"score": "0.512115",
"text": "def unreference_source_files\n set_reference_source_file(@encoding_job, false)\n redirect_to play_encoding_job_path(@encoding_job)\n end",
"title": ""
},
{
"docid": "5f9a14f8ec5c81d67c12a9ea4cc0a92c",
"score": "0.51210964",
"text": "def reset\n FileUtils.rmtree SPEC_TMP\n FileUtils.cp_r SPEC_MOCKS, SPEC_TMP, :preserve => true\n end",
"title": ""
},
{
"docid": "835f56735dac86e2ec9fd5dff876803c",
"score": "0.51166284",
"text": "def tidy_up\n return if DEBUG\n\n puts heading(\"Tidying up PWD\")\n\n FileUtils.remove(Dir[\"#{FileUtils.pwd}/bugsnag-*.tgz\"])\nend",
"title": ""
},
{
"docid": "3c39b4642f51379e49f12879f9ac9ba7",
"score": "0.5102688",
"text": "def file_revert(file, ref)\n if file_revisions(file).map { |r| r[:commit] }.include? ref\n file = file.gsub(%r{^/}, '')\n full_path = File.expand_path(file, @root)\n content = File.read(file_revision_at(file, ref))\n File.open(full_path, 'w') { |f| f.puts content }\n end\n end",
"title": ""
},
{
"docid": "a7eef204925201c51b9f915cc618e625",
"score": "0.50978833",
"text": "def copy_importants_from(other_redmine)\n Dir.chdir(root) do\n # Copy database.yml\n FileUtils.cp(other_redmine.database_yml_path, database_yml_path)\n\n # Copy configuration.yml\n if File.exist?(other_redmine.configuration_yml_path)\n FileUtils.cp(other_redmine.configuration_yml_path, configuration_yml_path)\n end\n\n # Copy Gemfile.local\n if File.exist?(other_redmine.gemfile_local_path)\n FileUtils.cp(other_redmine.gemfile_local_path, gemfile_local_path)\n end\n\n # Copy files\n if task.options.copy_files_with_symlink\n FileUtils.rm_rf(files_path)\n FileUtils.ln_s(other_redmine.files_path, root)\n else\n FileUtils.cp_r(other_redmine.files_path, root)\n end\n\n # Copy old logs\n FileUtils.mkdir_p(log_path)\n Dir.glob(File.join(other_redmine.log_path, 'redmine_installer_*')).each do |log|\n FileUtils.cp(log, log_path)\n end\n\n # Copy bundle config\n if Dir.exist?(other_redmine.bundle_path)\n FileUtils.mkdir_p(bundle_path)\n FileUtils.cp_r(other_redmine.bundle_path, root)\n end\n end\n\n # Copy 'keep' files (base on options)\n Array(task.options.keep).each do |path|\n origin_path = File.join(other_redmine.root, path)\n next unless File.exist?(origin_path)\n\n # Ensure folder\n target_dir = File.join(root, File.dirname(path))\n FileUtils.mkdir_p(target_dir)\n\n # Copy recursive\n FileUtils.cp_r(origin_path, target_dir)\n end\n\n logger.info('Important files was copyied')\n end",
"title": ""
},
{
"docid": "c48a40fc733d3b9444b7cb028c42a1a8",
"score": "0.50959736",
"text": "def teardown\n FileUtils.rm_rf(\"test/resources/IncludesSinceTestRepository\")\n end",
"title": ""
},
{
"docid": "ba0646136f2531cfe1fb7d348bff332d",
"score": "0.5089479",
"text": "def rollback_file_states(files)\n files.update(state: UserFile::STATE_CLOSED, scope: \"private\")\n end",
"title": ""
},
{
"docid": "f7fe6acbeace7734159c17b5e5cdd637",
"score": "0.5088869",
"text": "def clean_up\n @files.each {|file| FileUtils.remove(file.path)}\n end",
"title": ""
},
{
"docid": "016d91b2d213eb5feb6fce9c4351c3f8",
"score": "0.5084462",
"text": "def refresh\n clone_appium = \"git clone #{clone} #{path}\"\n sh clone_appium unless File.exists? path\n\n sh 'git reset --hard'\n sh 'git fetch --tags'\n\n update_branches\n\n branches.each do |branch|\n sh \"git checkout #{branch}\"\n sh \"git pull --rebase origin #{branch}\"\n end\n\n update_tags\n end",
"title": ""
},
{
"docid": "7449170a51f513292af5b9214b6d2538",
"score": "0.5074497",
"text": "def sync_rspec_only\n copy_skel_files\n end",
"title": ""
},
{
"docid": "f728d357dea8f381cef493656f70e9bc",
"score": "0.50718236",
"text": "def update_file_paths \n if self.url_part_was && self.url_part && self.short_name_changed?\n old_url_part = self.url_part\n old_ref_path = self.assignment_reference_repository.git_path\n set_url_part\n \n if old_url_part == self.url_part\n # Nothing changes\n return\n end\n \n self.save\n \n # Move reference repository folder if necessary\n if File.directory?(old_ref_path) \n new_ref_path = String.new(old_ref_path)\n new_ref_path[new_ref_path.index(File.basename(new_ref_path))..-1] = self.url_part\n \n FileUtils.mv old_ref_path, new_ref_path\n end\n \n # Move assignment repositories if necessary\n self.assignment_offerings.each do |assignment_offering|\n old_assignment_repo_path = File.join(\n assignment_offering.course_offering.storage_path,\n 'assignments',\n old_url_part)\n \n if File.directory?(old_assignment_repo_path)\n new_assignment_repo_path = File.join(\n assignment_offering.course_offering.storage_path,\n 'assignments',\n self.url_part) \n \n FileUtils.mv old_assignment_repo_path, new_assignment_repo_path\n end \n \n end\n end\n end",
"title": ""
},
{
"docid": "fba622c3ffd4001ffb1ab339505786d5",
"score": "0.507101",
"text": "def uncommitted_merge_files\n merge_state.uncommitted_merge_files\n end",
"title": ""
},
{
"docid": "dd0455a319f5109e89ba7440f4947e6e",
"score": "0.50706196",
"text": "def cleanDownloads()\n dir(\"#{DOWNLOADS_DIR}/*\").each do |path|\n if path != PREV_DOWNLOADS_DIR\n # colourFile(path)\n moveOldDownload(path)\n end\n end\n end",
"title": ""
},
{
"docid": "4563cc51554120e8abd2d9c055e8705a",
"score": "0.50690126",
"text": "def rebase(dir, downstream_commits, upstream_ref)\n Dir.chdir(dir) do\n # simply checkout upstream ref\n puts `git checkout #{upstream_ref}`\n # for downstream, get a list of the commits newer than matching red\nputs downstream_commits.inspect\n downstream_commits.each do |dsc|\n puts `git cherry-pick #{dsc} --allow-empty`\n end\n end\nend",
"title": ""
},
{
"docid": "783417821cc5848be72e42bb91a58961",
"score": "0.5067188",
"text": "def reset!\n @file_path = nil\n load force: true\n end",
"title": ""
},
{
"docid": "963b2761ad42eedbe2fba7f6d8ce53a7",
"score": "0.50662255",
"text": "def load_all_files\n return unless File.exist?(cookbook_path)\n\n # If cookbook_path is a symlink, Find on Windows Ruby 2.3 will not traverse it.\n # Dir.entries will do so on all platforms, so we iterate the top level using\n # Dir.entries. Since we have different behavior at the top anyway (hidden\n # directories at the top level are not included for backcompat), this\n # actually keeps things a bit cleaner.\n Dir.entries(cookbook_path).each do |top_filename|\n # Skip top-level directories starting with \".\"\n top_path = File.join(cookbook_path, top_filename)\n next if File.directory?(top_path) && top_filename.start_with?(\".\")\n\n # Use Find.find because it:\n # (a) returns any children, recursively\n # (b) includes top_path as well\n # (c) skips symlinks, which is backcompat (no judgement on whether it was *right*)\n Find.find(top_path) do |path|\n # Only add files, not directories\n next unless File.file?(path)\n # Don't add .uploaded-cookbook-version.json\n next if File.basename(path) == UPLOADED_COOKBOOK_VERSION_FILE\n\n relative_path = Chef::Util::PathHelper.relative_path_from(cookbook_path, path)\n path = Pathname.new(path).cleanpath.to_s\n cookbook_settings[:all_files][relative_path] = path\n end\n end\n end",
"title": ""
},
{
"docid": "3689582ad33d48421d53d365a2781449",
"score": "0.5061197",
"text": "def fetch\n log.info(log_key) { \"Copying from `#{source_path}'\" }\n\n create_required_directories\n FileSyncer.sync(source_path, project_dir, source_options)\n # Reset target shasum on every fetch\n @target_shasum = nil\n target_shasum\n end",
"title": ""
},
{
"docid": "89d0795d634bc52091eef39ed795ae57",
"score": "0.5060177",
"text": "def copy_over_cache_files\n FileUtils.cp_r \"#{@cache}/.\", @path\n end",
"title": ""
},
{
"docid": "7ea645421029690db50c9986ab918f6e",
"score": "0.5054085",
"text": "def remove_materialized_artifacts\n Dir.glob(\"#{Terraspace.cache_root}/**/*\").each do |path|\n next unless within_env?(path)\n next if path.include?(\".tfstate\")\n FileUtils.rm_f(path) if File.file?(path)\n end\n end",
"title": ""
},
{
"docid": "711e9d72fc1000f52e546e78f06f0d52",
"score": "0.5049687",
"text": "def restore path_to_database\n path_to_database.sub Dir.pwd, \"\"\n path_to_database.sub \"/\", \"\"\n \n @database ||= Database.new(path_to_database, @log)\n @entries.each do |entry|\n unless @database[entry.sha512].nil?\n oldfile = entry.file\n entry.add_file @database[entry.sha512]\n @log.puts \"[II] restored #{ oldfile } => #{ entry.file }\"\n puts \"[II] restored #{ oldfile } => #{ entry.file }\" if $VERBOSE\n else\n @log.puts \"[WW] couldn't find and restore #{ entry.file } in Database\"\n puts \"[WW] couldn't find and restore #{ entry.file } in Database\" if $VERBOSE\n end\n end\n end",
"title": ""
},
{
"docid": "d82803163df25cff6964e2d4d19d733c",
"score": "0.5049009",
"text": "def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/s3_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"sightings directory does not exist!\"\n end\n\nend",
"title": ""
},
{
"docid": "c9d7109c3e1d066534746161e7b551de",
"score": "0.5048173",
"text": "def copy_files\n message \"Checking for existing #{@@app_name.capitalize} install in #{install_directory}\"\n files_yml = File.join(install_directory,'installer','files.yml')\n old_files = read_yml(files_yml) rescue Hash.new\n \n message \"Reading files from #{source_directory}\"\n new_files = sha1_hash_directory_tree(source_directory)\n new_files.delete('/config/database.yml') # Never copy this.\n \n # Next, we compare the original install hash to the current hash. For each\n # entry:\n #\n # - in new_file but not in old_files: copy\n # - in old files but not in new_files: delete\n # - in both, but hash different: copy\n # - in both, hash same: don't copy\n #\n # We really should add a third hash (existing_files) and compare against that\n # so we don't overwrite changed files.\n\n added, changed, deleted, same = hash_diff(old_files, new_files)\n \n if added.size > 0\n message \"Copying #{added.size} new files into #{install_directory}\"\n added.keys.sort.each do |file|\n message \" copying #{file}\"\n copy_one_file(file)\n end\n end\n \n if changed.size > 0\n message \"Updating #{changed.size} files in #{install_directory}\"\n changed.keys.sort.each do |file|\n message \" updating #{file}\"\n copy_one_file(file)\n end\n end\n \n if deleted.size > 0\n message \"Deleting #{deleted.size} files from #{install_directory}\"\n \n deleted.keys.sort.each do |file|\n message \" deleting #{file}\"\n rm(File.join(install_directory,file)) rescue nil\n end\n end\n \n write_yml(files_yml,new_files)\n end",
"title": ""
},
{
"docid": "1e150c67bbe01fbb0430c9d8d48252a4",
"score": "0.5046174",
"text": "def modified_files\n @modified_files ||= begin\n @modified_files = []\n\n rewritten_commits.each do |rewritten_commit|\n refs = \"#{rewritten_commit.old_hash} #{rewritten_commit.new_hash}\"\n @modified_files |= Overcommit::GitRepo.modified_files(refs: refs)\n end\n\n filter_modified_files(@modified_files)\n end\n end",
"title": ""
},
{
"docid": "0e49a2847c1939968de8ee2dca870c91",
"score": "0.50412905",
"text": "def reset\n FileUtils.remove_file(@path)\n end",
"title": ""
},
{
"docid": "d94f2c34678bb284cbc65a563e17e6bf",
"score": "0.5014626",
"text": "def unstage_all\n command = 'git reset'\n command_success?(command)\n end",
"title": ""
},
{
"docid": "138c726a7a796d264713fdaba12039ca",
"score": "0.5012884",
"text": "def revert_files(*files)\n files = files.flatten\n unless files.empty?\n @perforce.run(\"revert\", \"-c\", @number, *files)\n end\n end",
"title": ""
},
{
"docid": "612092bfbd4394a78f3454538149e702",
"score": "0.5008393",
"text": "def reformatFiles(theArgs)\n\n\t# Get the state we need\n\tpathConfig = getConfig(theArgs);\n\ttheFiles = getFiles( theArgs);\n\n\n\n\t# Reformat the files\n\ttheFiles.each do |theFile|\n\t\treformatFile(theArgs, theFile)\n\tend\n\t\n\tFileUtils.rm_rf(pathConfig);\n\nend",
"title": ""
},
{
"docid": "245b9aea29daa717bec5c97315e355a4",
"score": "0.5008007",
"text": "def reset_reincarnate\n #CONTCAR を最後から解釈していく。\n #全てだめだったら POSCAR を解釈する。\n #全部だめだったら例外を投げる。\n\n #CONTCAR を解釈できたディレクトリで INCAR, KPOINTS, POTCAR を取得。\n #geomopt01 という名前でディレクトリを作る。\n contcars = Dir.glob(\"#{@dir}/#{PREFIX}*/CONTCAR\").sort.reverse\n contcars += Dir.glob(\"#{@dir}/#{PREFIX}*/POSCAR\").sort.reverse\n poscar = nil\n path = nil\n contcars.each do |contcar|\n begin\n VaspUtils::Poscar.load_file contcar\n poscar = contcar\n path = File.dirname(contcar)\n break\n rescue VaspUtils::Poscar::ParseError\n next\n end\n end\n raise NoVaspDirError unless poscar\n\n new_dir = \"#{@dir}/new_#{PREFIX}00\"\n Dir.mkdir new_dir\n FileUtils.mv(\"#{path}/KPOINTS\", \"#{new_dir}/KPOINTS\")\n FileUtils.mv(\"#{path}/INCAR\" , \"#{new_dir}/INCAR\" )\n FileUtils.mv(\"#{path}/POTCAR\" , \"#{new_dir}/POTCAR\" )\n FileUtils.mv(poscar , \"#{new_dir}/POSCAR\")\n\n rm_list = Dir.glob \"#{@dir}/#{PREFIX}*\"\n rm_list += Dir.glob \"#{@dir}/lock*\"\n rm_list += Dir.glob \"#{@dir}/*.sh\"\n rm_list += Dir.glob \"#{@dir}/*.log\"\n rm_list += Dir.glob \"#{@dir}/*.o*\"\n rm_list.each do |file|\n FileUtils.rm_rf file\n end\n\n FileUtils.mv new_dir, \"#{@dir}/#{PREFIX}00\"\n end",
"title": ""
},
{
"docid": "f5f5e40c4ccce8bf6da10ecfd9f99fee",
"score": "0.5000399",
"text": "def changed_files\n DeliveryTruck::Helpers.changed_files(\n DeliveryTruck::Helpers.pre_change_sha(node),\n node['delivery']['change']['sha'],\n node\n )\n end",
"title": ""
},
{
"docid": "59b2e553f1c65c56a417ebb6a417bdfa",
"score": "0.499049",
"text": "def try_resolve_conflict\n # retry the merge\n working_changeset = self[nil]\n merge_changeset = working_changeset.parents.last\n \n # backup the current file to a .resolve file (but retain the extension\n # so editors that rely on extensions won't bug out)\n path = working_join file\n File.copy(path, path + \".resolve\" + File.extname(path))\n \n # try to merge the files!\n merge_state.resolve(file, working_changeset, merge_changeset)\n \n # restore the backup to .orig (overwriting the old one)\n File.move(path + \".resolve\" + File.extname(path), path + \".orig\" + File.extname(path))\n end",
"title": ""
},
{
"docid": "6e3781d8331016bc71e56605b370dc93",
"score": "0.49899766",
"text": "def checkout(repo_path, rev)\n Dir.chdir repo_path do\n hg('update','--clean', '--rev', rev)\n end\n end",
"title": ""
},
{
"docid": "cdae932091e6f8b3793c1366ea1c54be",
"score": "0.49853945",
"text": "def tidy_up\n Dir[\"*nin\"].each do |file|\n File.delete(file)\n end\n Dir[\"*nhr\"].each do |file|\n File.delete(file)\n end\n Dir[\"*nsq\"].each do |file|\n File.delete(file)\n end\n Dir[\"*blast\"].each do |file|\n File.delete(file)\n end\n end",
"title": ""
},
{
"docid": "5783d4c4413fa28b1d28c1461779ced3",
"score": "0.49794582",
"text": "def filter_only_cookbook_files\n info(\"Removing non-cookbook files before transfer\")\n FileUtils.rm(all_files_in_cookbooks - only_cookbook_files)\n Util.list_directory(tmpbooks_dir, recurse: true)\n .reverse_each { |fn| FileUtils.rmdir(fn) if File.directory?(fn) && Dir.entries(fn).size == 2 }\n end",
"title": ""
},
{
"docid": "7a0173edfc02fa926a826f9d2a898fad",
"score": "0.49783188",
"text": "def fileMoveOldXlsx()\n oldXlsx()\n downloadDir = '~/Downloads'\n Dir.chdir(File.expand_path(downloadDir))\n puts \"Checking Downloads Directory for .xlsx files to clean before initiating Fixit...\"\n Dir.glob(\"*.xlsx\") {|file|\n if file\n puts \"Storing file name '#{file}' with .xlsx extension into OLD_XLSX_DATA on Desktop...\"\n temp_data_path = '~/Desktop/OLD_XLSX_DATA'\n FileUtils.mv(\"#{file}\", File.expand_path(temp_data_path))\n else\n puts \"No .xlsx files found in ~/Downloads...\"\n end\n }\nend",
"title": ""
},
{
"docid": "fc44e3e4a2eb96d78b2b2c0e66f1b518",
"score": "0.49753553",
"text": "def from_sublime_to_repo\n copy_files(packages_files, \"#{SAVED_PREFS}/packages\")\n copy_files(settings_files, \"#{SAVED_PREFS}/settings\")\n copy_files(snippets_files, \"#{SAVED_PREFS}/snippets\")\nend",
"title": ""
},
{
"docid": "50200012b264f2dcb34110591a07dfac",
"score": "0.49704346",
"text": "def process_github_clones\n repos = get_github_repos_already_cloned\n repos.each do |r|\n # SMELL: does not work if the working copy directory does\n # not match the repo name\n clone_path = configatron.dir + r.name\n set_upstream(clone_path, r.parent.html_url)\n end\nend",
"title": ""
},
{
"docid": "44256d9daee2f4018cbcbdb3d107cfd9",
"score": "0.49703684",
"text": "def obsolete_files\n out = (existing_files - new_files - new_dirs + replaced_files).to_a\n Jekyll::Hooks.trigger :clean, :on_obsolete, out\n out\n end",
"title": ""
},
{
"docid": "b293881cddc0f73f20ad32c96ecd748e",
"score": "0.49658617",
"text": "def mirror_all!\n mirror_files_for mirrored_components + mirrored_public_components\n end",
"title": ""
},
{
"docid": "44a0b962d39b7be7a43bf4d98d8f126f",
"score": "0.4963134",
"text": "def target_files\n @target_files ||= git.modified_files + git.added_files\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "e4e46e4e5fd57b76d7c14629f360682a",
"score": "0.0",
"text": "def data_log_params\n params.require(:data_log).permit(:user_id, :plant_id, :humidity_soil, :humidity_air, :light, :temperature)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6978086",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6780264",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6742658",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.6738813",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.67338693",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.65908474",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6501793",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6495506",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.64796513",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64755446",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.6454826",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6437561",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.6377127",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.63722163",
"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.6364058",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63178706",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62979764",
"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.62968165",
"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.62913024",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6289789",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6289145",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62875307",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6280997",
"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.62420976",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62388235",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6216686",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.62122375",
"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.6208949",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.619173",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6176307",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6173907",
"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.6170346",
"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.616111",
"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.6150513",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150023",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61446756",
"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.6120429",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6104845",
"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.6102966",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6087884",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6079323",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.60699135",
"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.60602236",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.60191786",
"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.60170597",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.60100305",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.6009527",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\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": "74c092f6d50c271d51256cf52450605f",
"score": "0.600042",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.5999317",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59933805",
"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.5991528",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.5991221",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990094",
"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.5979497",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.5966058",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958738",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59579456",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957759",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5956938",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5951788",
"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.59511644",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.59423065",
"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.59373474",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59361076",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59361076",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.59331447",
"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.5928005",
"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.5924882",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924011",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59169155",
"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.5908037",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.5907541",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.59061426",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.59056246",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5897408",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.58960444",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.58951247",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5893136",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5892312",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5890385",
"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.58853275",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.58801144",
"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.58784765",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.5872648",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.58682626",
"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": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5867028",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58661693",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.586578",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.58643955",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.5863193",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.58609086",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.5859997",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5858935",
"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.5858632",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5853379",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.5852741",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.584806",
"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.5847703",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
562c371308546cd601f75116a975314c | Return the Thumbalizr URL for the screenshot requested | [
{
"docid": "cc058103e1fa49160a98c58affa03de0",
"score": "0.6705718",
"text": "def thumbalizr_url(url, options={})\n\t \t\tthumbalizr = Thumbalizr.new(ThumbalizrClient.api_key, ThumbalizrClient.secret)\n \t\t\treturn thumbalizr.url(url, options)\n\t\tend",
"title": ""
}
] | [
{
"docid": "37428bd6bc43452d80e39ae8f067f4c1",
"score": "0.7752141",
"text": "def screenshot_thumb_url(package)\n url_for :controller => :package, :action => :thumbnail, :package => package, protocol: 'https'\n end",
"title": ""
},
{
"docid": "e31a9cf1d19b3f4697f3d4e1f49bd6cd",
"score": "0.7467308",
"text": "def thumb_url\n @thumb_url ||= begin\n service = ImageServiceHelper.image_url_service_class(CHF::Env.lookup(:image_server_downloads)).new(\n file_set_id: work_presenter.representative_file_set_id,\n file_id: work_presenter.representative_file_id,\n checksum: work_presenter.representative_checksum\n )\n download_options = service.download_options(no_content_disposition: true)\n url = (download_options.find { |h| h[:option_key] == \"medium \"} || download_options.first).try { |h| h[:url] }\n # make it an absolute url\n if url\n url = Addressable::URI.parse(CHF::Env.lookup!(:app_url_base)) + url\n end\n\n url\n end\n end",
"title": ""
},
{
"docid": "6efb2612bf28d80ad9f1285e3046bb1a",
"score": "0.7413987",
"text": "def thumburl\n upload.url(:thumb, timestamp: false)\n end",
"title": ""
},
{
"docid": "d108c7862deaea58b3f64ff33917ffca",
"score": "0.73060554",
"text": "def url\n thumbnail_reference || generated_thumbnail\n end",
"title": ""
},
{
"docid": "e13f0bf00694157e9b93fc3bec7071f9",
"score": "0.73042417",
"text": "def thumbshot( url )\n \"http://www.thumbshots.de/cgi-bin/show.cgi?url=#{url}/.png\" #add /.png to get rif of error ms\n end",
"title": ""
},
{
"docid": "01f78f142a8c7d854c1c59e33f8641ea",
"score": "0.7280523",
"text": "def remote_thumbnail(width = Entry.thumbnail_width)\n \"http://www.thumbalizr.com/api/?url=http://#{url.gsub(/^http\\:\\/\\//,'')}&width=#{width}&api_key=b0afe046a661efc630a5a0dc082b9385\" \n #\"http://images.websnapr.com/?size=s&url=http://#{url.gsub(/^http\\:\\/\\//,'')}\"\n end",
"title": ""
},
{
"docid": "9f7cbad349092b7a28aed08a39cdfcee",
"score": "0.72776115",
"text": "def square_url\n thumb_url\n end",
"title": ""
},
{
"docid": "7146833af0794c801a62572dd5b6d5f3",
"score": "0.7240249",
"text": "def local_thumbnail\n ## when using webkit2png\n # \"/screenshots/#{id}-clipped.png\"\n ## when caching from thumbalizr\n \"/screenshots/#{id}.jpg\"\n end",
"title": ""
},
{
"docid": "773f590a6f14180f9669efb4274b9619",
"score": "0.7165235",
"text": "def url_thumb\n self.resource.url(:thumb)\n end",
"title": ""
},
{
"docid": "1c29e67aa2f183cc6a3ed79ff1500677",
"score": "0.7162166",
"text": "def thumbnail_url\n attach.url(:thumb)\n end",
"title": ""
},
{
"docid": "0d98114d73b549ab04888e6bd5489a11",
"score": "0.7069152",
"text": "def thumb_url\n if path = thumb_path \n url + File::SEPARATOR + path.split(File::SEPARATOR).last\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "237d88f03c0ea820486cf2287902fdb8",
"score": "0.69746876",
"text": "def thumbnail_url\n ApplicationController.base_url + image.url(:square)\n end",
"title": ""
},
{
"docid": "8b38aac554a53067e911eb792ac664f7",
"score": "0.69677156",
"text": "def get_thumbnail_url\r\n \"/#{fully_scoped_url file_thumbnail_name}\"\r\n end",
"title": ""
},
{
"docid": "18ad1fd3d372ee8c3a11936fd8caf38a",
"score": "0.69618434",
"text": "def thumbnail\n FlickRaw.url_t self\n end",
"title": ""
},
{
"docid": "6b80c9355a5b326de6be04f1d09ea8a7",
"score": "0.69273955",
"text": "def screenshot_url\n super || lessons.first.try(:screenshot_url) || \"holder.js/750x563/auto/sky/text:#{name}\"\n end",
"title": ""
},
{
"docid": "224289cdf9a6973a7a109dc0dc539bf7",
"score": "0.69064426",
"text": "def thumbnail_url\n secure_url(\"thumbnails/#{path}\")\n end",
"title": ""
},
{
"docid": "d53cee16191d980bbdeba4af7df21d7f",
"score": "0.6901756",
"text": "def thumb_url\n end",
"title": ""
},
{
"docid": "bdfe7c1bbc9fa8bc2749eca10b088c59",
"score": "0.6885877",
"text": "def thumbnail_url\n exists? ? \"#{URL_STUB}/#{thumbnail_name}\" : \"default_thumbnail.jpg\"\n #\"#{URL_STUB}/#{thumb}\"\n end",
"title": ""
},
{
"docid": "631c1858d57d5026fdfd8766ca8cd068",
"score": "0.68505937",
"text": "def avatar_small_thumb_permalink\n # NOTE: action_controller.asset_host MUST be set to a fqdn, eg. http://localhost:3000/\n # url will have path to cdn image in production\n url = avatar_small_thumb_url\n if Rails.env.production?\n url = \"https:\" + [Recognize::Application.config.asset_host, \"assets\", url].join(\"/\") if avatar.default?\n elsif Rails.env.test?\n url = url || \"\"\n else\n # development\n url = \"https://\" + [Rails.application.config.host, \"assets\", url].join(\"/\") if avatar.default?\n end\n url\n end",
"title": ""
},
{
"docid": "3ae8c85aab6a89bfe83afd1c63744c89",
"score": "0.6822516",
"text": "def thumbnail_80; image_url; end",
"title": ""
},
{
"docid": "aa91e8f2467d6190df8c9b4f13df0e57",
"score": "0.68078274",
"text": "def thumbnail_url\n media_file(7).try(:media_file_link)\n end",
"title": ""
},
{
"docid": "34051969825fc9c4d1494d210959d439",
"score": "0.68062365",
"text": "def thumbnail_url\n return self.endpoint.thumbnail_url(self.id)\n end",
"title": ""
},
{
"docid": "882bc610090603e2d3d14292730fb1fd",
"score": "0.6789134",
"text": "def url_thumb\n \"/images/mime_types/#{resource.content_type}.png\"\n end",
"title": ""
},
{
"docid": "c54ffd6a105c612cb212c7be0f20bb36",
"score": "0.678908",
"text": "def thumbnail_url\n return @thumbnail_url\n end",
"title": ""
},
{
"docid": "3acf1a6ef858692aeeeb1a1f3343024c",
"score": "0.67745703",
"text": "def thumb_url\n media.thumb.url\n end",
"title": ""
},
{
"docid": "79328f013e237bc93d27cc9c8ebb95cb",
"score": "0.6712184",
"text": "def thumb_url\n AwsTools::get_object(thumb_key).public_url\n end",
"title": ""
},
{
"docid": "df284693fba0bdef03913ade7876b820",
"score": "0.6708975",
"text": "def thumbnail_full_url(size)\n url = self.thumbnail.url(size)\n unless url =~ /^#{ENV[\"HOST_PROTOCOL\"]}:\\/\\//\n url = URI.join(\"#{ENV[\"HOST_PROTOCOL\"]}://#{ENV[\"DEFAULT_HOST\"]}\", url).to_s\n end\n url\n end",
"title": ""
},
{
"docid": "7cdc4eb45040b14eb1538c751c4dc5e1",
"score": "0.6690433",
"text": "def thumbnail_url(size = :default)\n @thumbnails ||= @data.fetch 'thumbnails', {}\n @thumbnails.fetch(size.to_s, {})['url']\n end",
"title": ""
},
{
"docid": "c1f3c85decaff10ae2045dad89b51c42",
"score": "0.668422",
"text": "def thumb_size_url\n object.attachment.url(:thumb)\n end",
"title": ""
},
{
"docid": "c1f3c85decaff10ae2045dad89b51c42",
"score": "0.668422",
"text": "def thumb_size_url\n object.attachment.url(:thumb)\n end",
"title": ""
},
{
"docid": "224d29bddac228526cd4b5143071b34e",
"score": "0.6641106",
"text": "def url_thumb\n @url_thumb ||= Ckeditor::Utils.filethumb(filename)\n end",
"title": ""
},
{
"docid": "e2872c4ccae12f2a13336346b464221b",
"score": "0.6635803",
"text": "def thumbnail_url uid\n response = call_api method: :get, id: uid, action: '/thumbnail_url'\n ap JSON.parse(response.body)\n return response\n end",
"title": ""
},
{
"docid": "85547eabc8bdbc8f926ed46b1a1f9e96",
"score": "0.6614579",
"text": "def cover_thumb_url\n if images('thumb').any?\n images('thumb').first[:src]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f0b0abad87021cf55deefc39cd42d630",
"score": "0.659666",
"text": "def thumb_url\n media.try(:url, :thumb) if converted\n end",
"title": ""
},
{
"docid": "c2161055bcacb4d4094308f798b38c1e",
"score": "0.6593764",
"text": "def file_url_thumb\n file.url(:thumb)\n end",
"title": ""
},
{
"docid": "5f86d2f4d760259129ba1bd4e6d23d96",
"score": "0.65782577",
"text": "def thumbnail_url(size = :small)\n @thumbnail_url ||=\n snippet.dig('thumbnails', size_mappings.fetch(size, 'default'), 'url')\n end",
"title": ""
},
{
"docid": "73b0349b2fd89209c79222b428bc5b80",
"score": "0.6572197",
"text": "def thumbnail_url\n return if picture.nil?\n\n picture.url(thumbnail_url_options) || \"alchemy/missing-image.svg\"\n end",
"title": ""
},
{
"docid": "b2851e4ba1aaf46d787d581af5c94317",
"score": "0.65590197",
"text": "def thumbnail_url\n begin\n (ipaper_document && ipaper_document.thumbnail_url) || attached_file.url(:thumb)\n rescue\n raise ScribdFu::ScribdFuError, \"The thumbnail doesn't exist.\"\n end\n end",
"title": ""
},
{
"docid": "8f0f40613f47cde1f63ec213390d2aff",
"score": "0.655379",
"text": "def thumbprint\n Acme::Client::Util.urlsafe_base64(THUMBPRINT_DIGEST.digest(to_json))\n end",
"title": ""
},
{
"docid": "cd79b20bedf13099ec4a28222aa4fdc4",
"score": "0.65323067",
"text": "def artboard_thumb\n artboard_image_attachment.payload.url(:thumb) if artboard_image_attachment\n end",
"title": ""
},
{
"docid": "8d2ffe6c703f06100ab5f401be15f1c4",
"score": "0.6528919",
"text": "def image_url(href)\n @live_image_request = true if href.include?('actionshots')\n href.slice!(0) if href.chars.first == '/' # remove initial '/'\n set_base request_url(href) + api_key_query_string\n end",
"title": ""
},
{
"docid": "bdd5cc6465f156924ffd9c23cc7d5ff0",
"score": "0.6525484",
"text": "def thumbnail_url\n is_processed ? FileSystem.url(thumbnail_path) : image_url\n end",
"title": ""
},
{
"docid": "814bae6cb6b8c5a9752df84969f21d52",
"score": "0.64843833",
"text": "def thumbnail_url\n (scribd_document && scribd_document.thumbnail_url) or\n public_filename(:thumb)\n end",
"title": ""
},
{
"docid": "40ca89bc7eedc7d007f6fadc18359995",
"score": "0.6482202",
"text": "def thumbnail_path\n self.class.thumbnail_path_service.call(resource)\n end",
"title": ""
},
{
"docid": "432bd15d14092fa505bae398e6f0eba4",
"score": "0.6479235",
"text": "def thumb_avatar\n avatar_url(:thumb)\n end",
"title": ""
},
{
"docid": "1ee97013613261d20c28755162f22c6c",
"score": "0.64679986",
"text": "def thumb_url(url_type = nil)\n converted ? THUMB_URL : placeholder_url(:thumb, url_type)\n end",
"title": ""
},
{
"docid": "8d75cf92d62a25749bf67c8bfbc95d52",
"score": "0.64540744",
"text": "def thumbnail_path(fetch: true)\n begin\n generate_thumbnail unless cached? || !fetch || !source_url\n # This is sensitive enough (depending on an external system) to\n # justify an agressive rescue. #open can produce the following\n # rescue Errno::ETIMEDOUT, Net::ReadTimeout, OpenURI::HTTPError => e\n # And also there is a chance of exception generating the thumbnail\n rescue Exception => e\n raise unless Rails.env.production?\n Rails.logger.error(\"No screenshot fetched for: \" + pkg_name)\n end\n\n if cached?\n generated_thumbnail_path\n else\n default_thumbnail_path\n end\n end",
"title": ""
},
{
"docid": "1a703981e0bc091a24711f2ef4f7ce49",
"score": "0.6420552",
"text": "def avatar_url_thumb\n avatar.url(:thumb)\n end",
"title": ""
},
{
"docid": "e254de7cb74c26f9cfd58fd191df8578",
"score": "0.6418083",
"text": "def thumb_path\n Settings.THUMBNAIL.BASE_PATH || 'thumbnails'\n end",
"title": ""
},
{
"docid": "ac3a112956492542337d7bb8d35cfc31",
"score": "0.6395917",
"text": "def url_thumbnail\n self.image_file.expiring_url(10, :square)\n end",
"title": ""
},
{
"docid": "c46294250b829c4828439c8d848a3353",
"score": "0.6391639",
"text": "def thumbnail(url, opts = {})\n if (Cayox::CONFIG[:thumb_api_key])\n opts.merge!({ :api_key => Cayox::CONFIG[:thumb_api_key] })\n end\n \"http://api.thumbalizr.com/?url=#{url}&#{opts.to_params}\"\n end",
"title": ""
},
{
"docid": "91d7ff4038fce6fcfc488a907188bf58",
"score": "0.6390923",
"text": "def thumbnail_image\n if thumbnail\n thumbnail.url\n else\n \"ColoredVinylePH.png\"\n end\n end",
"title": ""
},
{
"docid": "3da6e438b3d487cbdae85b4e884f6b55",
"score": "0.6386226",
"text": "def url(ref)\n \"http://www.eebeads.com/Pix/#{ref}L.jpg\"\n end",
"title": ""
},
{
"docid": "312411e2b06c26d80bc3ef159fbab4eb",
"score": "0.63655597",
"text": "def cover_url_hq\n media_file(6).try(:media_file_link)\n end",
"title": ""
},
{
"docid": "7000e27972507f486c2b1b013cd4a2f2",
"score": "0.63451135",
"text": "def thumbnail\n image_url = self.largest_image_url\n return image_url\n # the original script does some nice image processing in here, which we can add at a later date\n end",
"title": ""
},
{
"docid": "2a65051b51191f9756eebba678411ebd",
"score": "0.63447756",
"text": "def instagram_url\n opts = { fit_in: true, fill: 'fff', quality: 100, format: 'jpeg' }\n\n new_url = if self.is_vertical?\n width, height = 1080, 1350\n self.url(opts.merge(width: width, height: (height - 100)))\n else\n width, height = 1080, 1080\n self.url(opts.merge(width: (width - 100), height: height))\n end\n\n thumbor_url(new_url, opts.merge(width: width, height: height))\n end",
"title": ""
},
{
"docid": "f08734c6a2180afa5fcd441f0aea7f15",
"score": "0.6323765",
"text": "def get_url\n img.url\n end",
"title": ""
},
{
"docid": "7f9184763275bcab82a791c10f9ad12f",
"score": "0.63108355",
"text": "def get_tile_url\r\n end",
"title": ""
},
{
"docid": "92583c95adb2b6c17570be3198e50f6b",
"score": "0.62816924",
"text": "def thumbnail_url_for( media, height = 150, width = 185)\n url = nil\n if media.thumbnail_url.blank? == false\n # There is a custom url\n url = media.thumbnail_url\n elsif media.provider\n # Here, the url follows the pattern from the provider\n url = parse_variables_to_url(media.provider.thumbnail_url, media.provider_media_id, height, width)\n else\n # Looks like an issue, let's provide a default just in case\n url = \"http://placehold.it/#{width}x#{height}\"\n end\n url\n end",
"title": ""
},
{
"docid": "62e6ea6efea0549ba564e9d1fc68c6f2",
"score": "0.62593675",
"text": "def logo_thumbnail_url\n \"http://media.steampowered.com/steamcommunity/public/images/apps/#@app_id/##{@logo_hash}_thumb.jpg\"\n end",
"title": ""
},
{
"docid": "10ddb122390f8fa0d6247f799fcbe4d5",
"score": "0.62473243",
"text": "def image_url(size = nil)\n youtube_image_url\n end",
"title": ""
},
{
"docid": "9f30660f66b133ef68439c7f8ce5ac17",
"score": "0.6246877",
"text": "def before_validation\n self.permalink = PermalinkFu.escape(self.url_short.gsub('www.', '')) if self.permalink.blank?\n self.thumbnail_filename = self.screenshot.nil? ? nil : self.screenshot.public_filename(:thumb) \n end",
"title": ""
},
{
"docid": "de086098ed173fc3ac8dedafb99f9f51",
"score": "0.6246167",
"text": "def youtube_thumb\n code = extract_youtube_id\n \"http://img.youtube.com/vi/#{code}/2.jpg\" unless code.blank?\n end",
"title": ""
},
{
"docid": "0cf0bb42a74a1bdf0a47158c0e5b90c5",
"score": "0.6241406",
"text": "def image_url\n @object.image && @object.image.respond_to?(:url) ? @object.image.url : thumb_url\n end",
"title": ""
},
{
"docid": "e1f73da9249f2170267abc18653e4228",
"score": "0.6240647",
"text": "def base_url(size)\n \"http://image.tmdb.org/t/p/#{size}#{backdrop_path}\"\n end",
"title": ""
},
{
"docid": "05e3200360320127a06646e8f706652c",
"score": "0.6232677",
"text": "def path\n image.thumb.url\n end",
"title": ""
},
{
"docid": "91b0cb3783a6cc1cdff0b13c7af68396",
"score": "0.62294745",
"text": "def thumbnail_url(format= :thumb_medium)\n \"/videos/#{id}/thumb_#{format.to_s}.jpg\"\n end",
"title": ""
},
{
"docid": "c6f75fe7a9812c0ef8673d1cb359df9c",
"score": "0.6222919",
"text": "def image_url\n url_for(object.image)\n end",
"title": ""
},
{
"docid": "3c66a29f339fbfa1537e05d32a460527",
"score": "0.6211707",
"text": "def thumb_url\n # first see if we have a cached thumbnail\n if thumbnail_url\n return thumbnail_url\n else\n Rails.logger.debug(\"embed_url: #{embed_url}\")\n if self.youtube?\n thumbnail_url = \"http://i1.ytimg.com/vi/\"+self.vid_id+\"/hqdefault.jpg\"\n elsif self.vimeo?\n VideoInfo.provider_api_keys = {vimeo: '7219e68114dd5e1d0ecf20dbbffb06e1' }\n Rails.logger.debug(\"thumbnail_url: #{VideoInfo.new(embed_url).thumbnail_large}\")\n thumbnail_url = VideoInfo.new(embed_url).thumbnail_large\n end\n end\n \n # save the new thumbnail\n if thumbnail_url\n save\n end\n\n return thumbnail_url\n end",
"title": ""
},
{
"docid": "0139a2f0c301c6d2a43b522017bcc0af",
"score": "0.62041116",
"text": "def thumbnail_url\n first_available_jacket_image_url || NYPLContentType::DEFAULT_THUMBNAIL_URL\n end",
"title": ""
},
{
"docid": "15de7b24484b260d963f1017bec19edf",
"score": "0.6198063",
"text": "def thumbnail(url)\n @raw.thumbnail = Discordrb::Webhooks::EmbedThumbnail.new url: url\n end",
"title": ""
},
{
"docid": "bd475d17ccaacc927964f151b162c90b",
"score": "0.61933595",
"text": "def human_url\n api_file.web_view_link\n end",
"title": ""
},
{
"docid": "6c2a961748cff9715e78a867f1059f1f",
"score": "0.61809564",
"text": "def thumbnail_url(pid = nil)\n if pid.nil?\n if params[:pid].blank?\n send_data({}, {:status => 404})\n return\n end\n pid = params[:pid]\n end\n\n file = TiffFile.find(pid)\n\n if file.datastreams['thumbnail'].nil?\n send_data({}, {:status => 404})\n return\n end\n\n send_data(file.thumbnail.content, {:filename => file.thumbnail.label, :type => file.thumbnail.mimeType, :disposition => 'inline'})\n end",
"title": ""
},
{
"docid": "92749570b755d1f4e8bc3d2dceaebe54",
"score": "0.6180856",
"text": "def thumbprint\n data.thumbprint\n end",
"title": ""
},
{
"docid": "f6f91b09b2fe4b72373b4317925b0107",
"score": "0.61765385",
"text": "def logo_thumbnail_url; end",
"title": ""
},
{
"docid": "b0acf58e26261d9b679ed08aa65df597",
"score": "0.6159638",
"text": "def thumbnail_url(url, options = {})\n options = defaults.merge(options)\n @url = url\n @size = valid_size_value(options[:size])\n @root = valid_root_value(options[:root])\n @nothumb = options[:nothumb]\n \n query_url = PG_API_URL + generate_url('thumbnails')\n end",
"title": ""
},
{
"docid": "543d952da006dbd4d4d375a7ad8d9595",
"score": "0.61549115",
"text": "def build_shirt_image_url(id)\n \"http://media.threadless.com/imgs/products/#{id}/636x460design_01.jpg\"\n end",
"title": ""
},
{
"docid": "eebc6f511e8491c0cfa5846ce2104785",
"score": "0.6153754",
"text": "def screenshot_thumbnail(id=0, parameters={})\n\t\tparameters[:id] = id\n\n\t\tbegin\n url = make_url('screenshot/thumbnail', parameters)\n response = fetch(url.to_s)\n case response\n when Net::HTTPSuccess then \n return response.response.body\n else\n return ''\n end\n rescue Exception => e\n puts \"{e.message}\" if (@debug)\n raise e\n end\n\tend",
"title": ""
},
{
"docid": "1a1937d31c77f297ca663a553498337e",
"score": "0.61482334",
"text": "def thumbnail(size)\n images.first.file.url(size)\n end",
"title": ""
},
{
"docid": "03de41a5bf63a6d2d5778e9c304d1e7a",
"score": "0.614719",
"text": "def generate_thumbnail_from_url\n \n # Skip thumbnail generation if:\n # a) there are already other validation errors\n # b) an image was manually specified\n # c) an image is already stored and the URL hasn't changed\n #skip_generate = self.errors.any? || (self.image_changed? ||\n skip_generate = self.errors.any? || self.image_stored?\n # (self.image_stored? && !self.url_changed?))\n # p \"*** generating thumbnail: #{!skip_generate}\"\n return if skip_generate\n \n # Generate and assign an image or set a validation error\n begin\n tempfile = temp_thumbnail_path\n cmd = \"wkhtmltoimage --quality 40 --width 50 --height 50 \\\"#{self.link}\\\" \\\"#{tempfile}\\\"\"\n p \"*** grabbing thumbnail: #{cmd}\"\n system(cmd) # sometimes returns false even if image was saved\n \n self.photo = File.new(tempfile) # will throw if not saved\n self.save\n rescue => e\n p \"*** thumbnail error: #{e}\"\n self.errors.add(:base, \"Cannot generate thumbnail. Is your URL valid?\")\n ensure\n end\n end",
"title": ""
},
{
"docid": "f487736787b8001cd7f036db451a0559",
"score": "0.6141038",
"text": "def fixed_paperclip_route(object)\n \"/kairosgame#{object.thumbnail.url}\"\nend",
"title": ""
},
{
"docid": "e4dfc887bc44453f367309d4c4b436d7",
"score": "0.61277264",
"text": "def temp_thumbnail_path\n File.expand_path(\"#{self.link.parameterize.slice(0, 20)}.jpg\", \"#{Rails.root}/public/system\")\n end",
"title": ""
},
{
"docid": "a2fb6aba21df26b18be78d5b27bcde18",
"score": "0.6126189",
"text": "def convert_web_url_to_screenshot(input, opts = {})\n data, _status_code, _headers = convert_web_url_to_screenshot_with_http_info(input, opts)\n data\n end",
"title": ""
},
{
"docid": "308fd5989cff4167e9f6b59ba4ecd577",
"score": "0.612261",
"text": "def thumbnail_name\n require 'digest/md5'\n \"#{Digest::MD5.hexdigest(uri)}.png\"\n end",
"title": ""
},
{
"docid": "eacaf7875d184b4d86b8f482b318b0fc",
"score": "0.6122476",
"text": "def mugshot\n return Tr8n::Config.system_image if system?\n return super if remote?\n return Tr8n::Config.silhouette_image unless user\n img_url = Tr8n::Config.user_mugshot(user)\n return Tr8n::Config.silhouette_image if img_url.blank?\n img_url\n end",
"title": ""
},
{
"docid": "b8e7f300beb3227e1bc03f6e794dece2",
"score": "0.61207914",
"text": "def thumb_url(image_url, options = {})\n return image_url if image_url.nil? || image_url.empty?\n\n require 'ruby-thumbor'\n url = image_url.strip\n url.sub!(%r{^http(s|)://}, '')\n\n if @thumbor_service.nil?\n if options[:unsafe]\n @thumbor_service = Thumbor::CryptoURL.new(nil)\n else\n @thumbor_service = Thumbor::CryptoURL.new(ENV['THUMBOR_SECURITY_KEY'])\n end\n end\n\n options[:image] = URI.escape(url)\n host = ENV['THUMBOR_SERVER_URL']\n path = @thumbor_service.generate(options)\n host = (host % (Zlib.crc32(path) % 4)) if host =~ /%d/\n host + path\n end",
"title": ""
},
{
"docid": "a20b8e39470afab710d0b285aaf90d80",
"score": "0.612016",
"text": "def thumbnail\n self.picture['data']['url']\n end",
"title": ""
},
{
"docid": "553b9f845ebaeb5677637af9c1e9c90a",
"score": "0.6116724",
"text": "def medium_url\n is_processed ? FileSystem.url(medium_path) : image_url\n end",
"title": ""
},
{
"docid": "1a8652e3e714569b6c9800495ef45b3b",
"score": "0.6109984",
"text": "def url\n image[\"resource\"][\"@id\"].gsub(/\\/full.*$/, \"\")\n end",
"title": ""
},
{
"docid": "aea03677fba3f6b72b66193fc9177cf5",
"score": "0.6109705",
"text": "def picurl\n first_from_pix :imgurl\n end",
"title": ""
},
{
"docid": "cc444514d3bb3abdb4ca836bbf1d5d69",
"score": "0.61043334",
"text": "def poster_host_url\n \"https://jenny.smharley.com/posters/large/\"\n end",
"title": ""
},
{
"docid": "260adc76f7ecedc57b8c8ea0263d67ef",
"score": "0.61042637",
"text": "def thumbnail_path\n \"govtrack_us/photos/#{govtrack_id}-100px.jpeg\"\n end",
"title": ""
},
{
"docid": "cb1f499dcbb53ac66c547858182e290b",
"score": "0.6098474",
"text": "def thumbprint\n return @thumbprint\n end",
"title": ""
},
{
"docid": "3b205f152f37a7365a701410767e0757",
"score": "0.6091216",
"text": "def derivative_url(destination_name)\n if destination_name.to_s == 'thumbnail' || destination_name.to_s == 'poster'\n path = Hyrax::DerivativePath.derivative_path_for_reference(file_set, destination_name)\n URI(\"file://#{path}\").to_s\n else\n super\n end\n end",
"title": ""
},
{
"docid": "f99933b501c50d0233b608bc945105ce",
"score": "0.6089353",
"text": "def thumb_image_path\n begin\n self.attachment.url(:thumb) ? self.attachment.url(:thumb) : \"/public/no-image.png\"\n rescue\n \"/public/no-image.png\"\n end\n end",
"title": ""
},
{
"docid": "255de8fb7194deac2e3b6007dda35984",
"score": "0.6082516",
"text": "def thumbnail_path\n 't_' + image_path\n end",
"title": ""
},
{
"docid": "e5035abb6cf8d86d3010c6ee8140303c",
"score": "0.60780174",
"text": "def url(size = :medium)\n image_url(size)\n end",
"title": ""
},
{
"docid": "e5035abb6cf8d86d3010c6ee8140303c",
"score": "0.60780174",
"text": "def url(size = :medium)\n image_url(size)\n end",
"title": ""
},
{
"docid": "87a71afb2ae7b58609837311bd067ac8",
"score": "0.6068492",
"text": "def thumbnail\n return unless file_download\n \"#{file_download}?file=thumbnail\"\n end",
"title": ""
},
{
"docid": "b61a5bd0e8e9044c07b9b27ac455fefc",
"score": "0.60650015",
"text": "def thumbnail_video(talk)\n video = talk['video']\n return nil if video.nil?\n id = CGI.parse(URI.parse(video).query)['v'][0]\n \"https://img.youtube.com/vi/#{id}/0.jpg\"\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.