query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
POST /gears POST /gears.json
def create @current_usinfo @usinfo=Usinfo.all @usinfo.each do |elt| if(elt.user.email==current_user.email) @current_usinfo=elt end end @gear = @current_usinfo.gears.new(gear_params) respond_to do |format| if @gear.save format.html { redirect_to @gear, notice: 'Gear was successfully created.' } format.json { render :show, status: :created, location: @gear } else format.html { render :new } format.json { render json: @gear.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @hoge = Hoge.new(params[:hoge])\n\n respond_to do |format|\n if @hoge.save\n format.html { redirect_to @hoge, notice: 'Hoge was successfully created.' }\n format.json { render json: @hoge, status: :created, location: @hoge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hoge.errors, status: :unprocessable_entity }\n end\n end\n end", "def areas\n @area = Area.new(geo_json: params.to_json)\n if @area.save\n json_response([id: @area.id], :created, :geo_json_recieved)\n else\n json_response(nil, :error, :db_error)\n end\n end", "def create\n @geo = Geo.new(geo_params)\n\n respond_to do |format|\n if @geo.save\n format.html { redirect_to @geo, notice: 'Geo was successfully created.' }\n format.json { render :show, status: :created, location: @geo }\n else\n format.html { render :new }\n format.json { render json: @geo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @groep = Groep.new(params[:groep])\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n if @groep.save\n format.html { redirect_to @groep, notice: 'Groep werd succesvol aangemaakt.' }\n format.json { render json: @groep, status: :created, location: @groep }\n else\n format.html { render action: \"new\" }\n format.json { render json: @groep.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @geocach = Geocach.new(params[:geocach])\n\n respond_to do |format|\n if @geocach.save\n format.html { redirect_to @geocach, notice: 'A Geocache was successfully created.' }\n format.json { render json: @geocach, status: :created, location: @geocach }\n else\n format.html { render action: \"new\" }\n format.json { render json: @geocach.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n gig = Gig.new()\n respond_to do |format|\n if update_gig(gig)\n format.html { render json: gig, status: :created, location: gig }\n format.json { render json: gig, status: :created, location: gig }\n else\n format.html { render action: \"new\" }\n format.json { render json: gig.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @region = Region.new(region_params)\n\n if @region.save\n render json: @region, status: :created, location: @region\n else\n render json: @region.errors, status: :unprocessable_entity\n end\n end", "def create\n @gauge = Gauge.new(params[:gauge])\n\n respond_to do |format|\n if @gauge.save\n format.html { redirect_to @gauge, notice: 'Gauge was successfully created.' }\n format.json { render json: @gauge, status: :created, location: @gauge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @garply = Garply.new(garply_params)\n\n respond_to do |format|\n if @garply.save\n format.html { redirect_to @garply, notice: 'Garply was successfully created.' }\n format.json { render :show, status: :created, location: @garply }\n else\n format.html { render :new }\n format.json { render json: @garply.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lounge = Lounge.new(lounge_params)\n\n respond_to do |format|\n if @lounge.save\n format.html { redirect_to @lounge, notice: 'Lounge was successfully created.' }\n format.json { render :show, status: :created, location: @lounge }\n else\n format.html { render :new }\n format.json { render json: @lounge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @geo_datum = GeoDatum.new(geo_datum_params)\n\n respond_to do |format|\n if @geo_datum.save\n format.html { redirect_to @geo_datum, notice: 'Geo datum was successfully created.' }\n format.json { render :show, status: :created, location: @geo_datum }\n else\n format.html { render :new }\n format.json { render json: @geo_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @stilage = Stilage.new(stilage_params)\n respond_to do |format|\n if @stilage.save\n format.html { redirect_to @stilage, notice: 'Stilage was successfully created.' }\n format.json { render :show, status: :created, location: @stilage }\n else\n format.html { render :new }\n format.json { render json: @stilage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gig = current_user.gigs.new(gig_params)\n location = Location.find_or_create_by({\n postcode_address: params[:location][:postcode_address],\n street_address: params[:location][:street_address]\n })\n @gig.location = location\n respond_to do |format|\n if @gig.save\n format.html { redirect_to @gig, notice: 'Gig was successfully created.' }\n format.json { render :show, status: :created, location: @gig }\n else\n format.html { render :new }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @betraege = Betraege.new(params[:betraege])\n\n respond_to do |format|\n if @betraege.save\n format.html { redirect_to @betraege, :notice => 'Betraege was successfully created.' }\n format.json { render :json => @betraege, :status => :created, :location => @betraege }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @betraege.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @grade = Grade.new(grade_params)\n\n if @grade.save\n render json: @grade, status: :created, location: @grade\n else\n render json: @grade.errors, status: :unprocessable_entity\n end\n end", "def create\n @dog_poly = DogPoly.new(dog_poly_params)\n\n respond_to do |format|\n if @dog_poly.save\n format.html { redirect_to @dog_poly, notice: 'Dog poly was successfully created.' }\n format.json { render :show, status: :created, location: @dog_poly }\n else\n format.html { render :new }\n format.json { render json: @dog_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @geopoint = Geopoint.new(params[:geopoint])\n\n respond_to do |format|\n if @geopoint.save\n format.html { redirect_to @geopoint, notice: 'Geopoint was successfully created.' }\n format.json { render json: @geopoint, status: :created, location: @geopoint }\n else\n format.html { render action: \"new\" }\n format.json { render json: @geopoint.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gopy = Gopy.new(params[:gopy])\n\n respond_to do |format|\n if @gopy.save\n format.html { redirect_to @gopy, notice: 'Gopy was successfully created.' }\n format.json { render json: @gopy, status: :created, location: @gopy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gopy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @corge = Corge.new(corge_params)\n\n respond_to do |format|\n if @corge.save\n format.html { redirect_to @corge, notice: 'Corge was successfully created.' }\n format.json { render :show, status: :created, location: @corge }\n else\n format.html { render :new }\n format.json { render json: @corge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lugar = Lugar.new(lugar_params)\n\n if @lugar.save\n render json: @lugar, status: :created, location: @lugar\n else\n render json: @lugar.errors, status: :unprocessable_entity\n end\n end", "def create\n @gage = Gage.new(params[:gage])\n\n respond_to do |format|\n if @gage.save\n format.html { redirect_to @gage, notice: 'Gage was successfully created.' }\n format.json { render json: @gage, status: :created, location: @gage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gage.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @geopoints = Geopoint.all\n @jsons = @geopoints.to_gmaps4rails\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @geopoints }\n end\n end", "def create\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.new(params[:galaxies_lenticular_galaxy])\n\n respond_to do |format|\n if @galaxies_lenticular_galaxy.save\n format.html { redirect_to @galaxies_lenticular_galaxy, :notice => 'Lenticular galaxy was successfully created.' }\n format.json { render :json => @galaxies_lenticular_galaxy, :status => :created, :location => @galaxies_lenticular_galaxy }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @galaxies_lenticular_galaxy.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @hoge = Hoge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hoge }\n end\n end", "def create\n @location = Geolocation.new(params[:geolocation])\n @scene = Scene.new(:title => params[:title])\n @location.scenes << @scene\n @location.save\n @scene.save\n\n respond_to do |format|\n if @location.save\n format.html { redirect_to @location, notice: 'Location was successfully create.'}\n format.json { render json: @location, status: :created, location: @location }\n else\n format.html { render action: \"new\"}\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @grape = Grape.new(grape_params)\n\n respond_to do |format|\n if @grape.save\n format.html { redirect_to @grape, notice: \"Grape was successfully created.\" }\n format.json { render :show, status: :created, location: @grape }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @grape.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @fridge = Fridge.new(params[:fridge])\n\n respond_to do |format|\n if @fridge.save\n format.html { redirect_to @fridge, notice: 'Fridge was successfully created.' }\n format.json { render json: @fridge, status: :created, location: @fridge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fridge.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @groep = Groep.new\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groep }\n end\n end", "def create\n @elder_gallary = ElderGallary.new(elder_gallary_params)\n\n respond_to do |format|\n if @elder_gallary.save\n format.html { redirect_to @elder_gallary, notice: 'Elder gallary was successfully created.' }\n format.json { render :show, status: :created, location: @elder_gallary }\n else\n format.html { render :new }\n format.json { render json: @elder_gallary.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rigging = Rigging.new(rigging_params)\n\n respond_to do |format|\n if @rigging.save\n format.html { redirect_to @rigging, notice: 'Rigging was successfully created.' }\n format.json { render :show, status: :created, location: @rigging }\n else\n format.html { render :new }\n format.json { render json: @rigging.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @geopoint = Geopoint.new\n @lat = 13.7522222\n @lng = 100.4938889\n @json = '[{\"lng\": \"100.4938889\", \"lat\": \"13.7522222\"}]'\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @geopoint }\n end\n end", "def create\n @allergy = Allergy.new(allergy_params)\n\n respond_to do |format|\n if @allergy.save\n format.html { redirect_to new_allergy_path, notice: t('allergies.created') }\n format.json { render :show, status: :created, location: @allergy }\n else\n format.html { render :new, alert: t('errors.messages.empty') }\n format.json { render json: @allergy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ge_city_api = GeCityApi.new(ge_city_api_params)\n\n respond_to do |format|\n if @ge_city_api.save\n format.html { redirect_to @ge_city_api, notice: 'Ge city api was successfully created.' }\n format.json { render :show, status: :created, location: @ge_city_api }\n else\n format.html { render :new }\n format.json { render json: @ge_city_api.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @galaxy = Galaxy.new(params[:galaxy])\n\n respond_to do |format|\n if @galaxy.save\n format.html { redirect_to @galaxy, :notice => 'Galaxy was successfully created.' }\n format.json { render :json => @galaxy, :status => :created, :location => @galaxy }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @galaxy.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @grade_scale = GradeScale.new(params[:grade_scale])\n\n respond_to do |format|\n if @grade_scale.save\n format.json { render :json => @grade_scale, :status => :created, :location => @grade_scale }\n else\n format.json { render :json => @grade_scale.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @parking_garage = ParkingGarage.new(parking_garage_params)\n\n respond_to do |format|\n if @parking_garage.save\n format.html { redirect_to @parking_garage, notice: 'Parking garage was successfully created.' }\n format.json { render :show, status: :created, location: @parking_garage }\n else\n format.html { render :new }\n format.json { render json: @parking_garage.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @positions = Position.all.order :id\n @geojson = Hash.new\n\n @points = Position.geopoints\n @geojson = {\n type: 'FeatureCollection',\n features: @points\n }\n\n respond_to do |format|\n format.html\n format.json { render json: @geojson } # respond with the created JSON object\n end\n end", "def new\n @fridge = Fridge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fridge }\n end\n end", "def new\n @polygon = Polygon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @polygon }\n end\n end", "def create\n @geometry = Geometry.new(geometry_params)\n\n respond_to do |format|\n if @geometry.save\n format.html { redirect_to @geometry, notice: 'Geometry was successfully created.' }\n format.json { render action: 'show', status: :created, location: @geometry }\n else\n format.html { render action: 'new' }\n format.json { render json: @geometry.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lodge = Lodge.new(params[:lodge])\n\n respond_to do |format|\n if @lodge.save\n format.html { redirect_to @lodge, notice: 'Lodge was successfully created.' }\n format.json { render json: @lodge, status: :created, location: @lodge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lodge.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @gauge = Gauge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gauge }\n end\n end", "def create\n @gauge_graph = GaugeGraph.new(gauge_graph_params)\n\n respond_to do |format|\n if @gauge_graph.save\n format.html { redirect_to edit_gauge_graph_path(@gauge_graph), notice: 'Gauge graph was successfully created.' }\n format.json { render :edit, status: :created, location: @gauge_graph }\n else\n format.html { render :new }\n format.json { render json: @gauge_graph.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @galaxies_elliptical_galaxy = Galaxies::EllipticalGalaxy.new(galaxies_elliptical_galaxy_params)\n\n respond_to do |format|\n if @galaxies_elliptical_galaxy.save\n format.html { redirect_to @galaxies_elliptical_galaxy, notice: 'Elliptical galaxy was successfully created.' }\n format.json { render action: 'show', status: :created, location: @galaxies_elliptical_galaxy }\n else\n format.html { render action: 'new' }\n format.json { render json: @galaxies_elliptical_galaxy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lodge = Lodge.new(lodge_params)\n\n respond_to do |format|\n if @lodge.save\n format.html { redirect_to @lodge, notice: 'Lodge was successfully created.' }\n format.json { render :show, status: :created, location: @lodge }\n else\n format.html { render :new }\n format.json { render json: @lodge.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @lodge = Lodge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lodge }\n end\n end", "def create\n @grocery = Grocery.new(grocery_params)\n\n if @grocery.save\n render json: @grocery, status: :created, location: @grocery\n else\n render json: @grocery.errors, status: :unprocessable_entity\n end\n end", "def create\n @admin_geonode = Admin::Geonode.new(params[:admin_geonode])\n\n respond_to do |format|\n if @admin_geonode.save\n format.html { redirect_to @admin_geonode, notice: 'Geonode was successfully created.' }\n format.json { render json: @admin_geonode, status: :created, location: @admin_geonode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_geonode.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @layer = Layer.new(params[:layer])\n\n respond_to do |format|\n if @layer and @layer.save\n @layers = Layer.all\n format.html { redirect_to layers_path, notice: 'Layer was successfully created.' }\n format.json { render json: {layers: @layers.map {|layer| {id: layer.id, name:layer.name, number_of_polygons: layer.areas.count}}} }\n else\n format.html { render action: \"new\" }\n format.json { render json: @layer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "def create\n @lounges = Lounge.new(params[:lounge])\n if @lounges.save\n CustomLogger.debug(\"Lounge created\")\n CustomLogger.debug(\"--------------\") \n to_log(@lounges) \n @lounges = Lounge.new\n end\n @all_lounges = Lounge.all \n end", "def gelato_params\n ActiveModelSerializers::Deserialization\n .jsonapi_parse(\n params, only: [\n :name, :id, :flavor_id\n ]\n )\n end", "def new\n @gopy = Gopy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gopy }\n end\n end", "def create\n @plate = Plate.new(params[:plate])\n\n if @plate.save\n render json: @plate, status: :created, location: @plate\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end", "def index\n \t@posts = Post.all\n\n @geojson = Array.new\n users = User.all\n users.each do |user|\n @geojson << {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [user.longitude, user.latitude]\n },\n properties: {\n name: user.restaurant,\n address: user.address,\n :'marker-color' => '#00607d',\n :'marker-symbol' => 'circle',\n :'marker-size' => 'medium'\n }\n }\n end\n \n respond_to do |format|\n format.html\n format.json { render json: @geojson }\n end\n end", "def new\n @location = Location.new\n @json = @location.to_gmaps4rails\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @location }\n end\n end", "def create\n @agency = Agency.new(agency_params)\n\n if @agency.save\n render json: @agency, status: :created, location: @agency\n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def create\n @polygon = Polygon.new(params[:polygon])\n\n respond_to do |format|\n if @polygon.save\n format.html { redirect_to @polygon, notice: 'Polygon was successfully created.' }\n format.json { render json: @polygon, status: :created, location: @polygon }\n else\n format.html { render action: \"new\" }\n format.json { render json: @polygon.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @fish_poly = FishPoly.new(fish_poly_params)\n\n respond_to do |format|\n if @fish_poly.save\n format.html { redirect_to @fish_poly, notice: 'Fish poly was successfully created.' }\n format.json { render :show, status: :created, location: @fish_poly }\n else\n format.html { render :new }\n format.json { render json: @fish_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def geojson(fields)\n geojson = Array.new\n fields.each do |field|\n geojson << {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [field.longitude, field.latitude]\n },\n properties: {\n id: field.id,\n name: field.name,\n address: print_field(field),\n :'marker-color' => '#00607d',\n :'marker-symbol' => 'circle',\n :'marker-size' => 'medium',\n title: \"<a href=#{field_url(field)} data-no-turbolink><b>#{field.name}</b></a>\",\n description: print_field(field)\n }\n }\n end\n geojson\n end", "def new\n @gig_request = GigRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig_request }\n end\n end", "def new\n # @gethotelstaticdatagd = Gethotelstaticdatagd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end", "def create\n @galaxy = Galaxy.new(galaxy_params)\n\n respond_to do |format|\n if @galaxy.save\n format.html { redirect_to @galaxy, notice: 'Galaxy was successfully created.' }\n format.json { render :show, status: :created, location: @galaxy }\n else\n format.html { render :new }\n format.json { render json: @galaxy.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @svgpost = Svgpost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @svgpost }\n end\n end", "def new\n @post_geo = current_user.post_geos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post_geo }\n end\n end", "def create\n @galaxy = Galaxy.new(galaxy_params)\n\n respond_to do |format|\n if @galaxy.save\n format.html { redirect_to @galaxy, notice: 'Galaxy was successfully created.' }\n format.json { render action: 'show', status: :created, location: @galaxy }\n else\n format.html { render action: 'new' }\n format.json { render json: @galaxy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @regions = Region.all\n @location = Location.new(location_params)\n\n if params[:regions]\n @location_regions = Region.find(params[:regions])\n else\n @location_regions = []\n end\n\n @location.regions = @location_regions\n\n respond_to do |format|\n if @location.save\n @location.create_stat\n format.html { redirect_to @location, notice: 'Location was successfully created.' }\n format.json { render :show, status: :created, location: @location }\n else\n format.html { render :new }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n post_params = {\n name: params[:name].downcase,\n units: params[:units] || 0\n }\n render json: Ingredient.create!(post_params), status: :created\n end", "def create_region\n Region.create!(params[:record])\n render :json => {}\n end", "def create\n @bracket_golfer = BracketGolfer.new(bracket_golfer_params)\n\n respond_to do |format|\n if @bracket_golfer.save\n format.json { respond_with @bracket_golfer }\n else\n format.json { render json: @bracket_golfer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @region = Region.new(params[:region])\n \n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, flash: {success: \"Region was successfully created!\"}}\n format.json { render json: @region, status: :created, location: @region }\n else\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @gpath = Gpath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gpath }\n end\n end", "def create\n @garrage = Garrage.new(garrage_params)\n @garrage.user_id = current_user.id\n\n respond_to do |format|\n if @garrage.save\n format.html { redirect_to garrage_stuffs_path(@garrage), notice: 'Garrage was successfully created.' }\n format.json { render :show, status: :created, location: @garrage }\n else\n format.html { render :new }\n format.json { render json: @garrage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gempost = Gempost.new(gempost_params)\n\n respond_to do |format|\n if @gempost.save\n format.html { redirect_to @gempost, notice: 'Gempost was successfully created.' }\n format.json { render :show, status: :created, location: @gempost }\n else\n format.html { render :new }\n format.json { render json: @gempost.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gonullu = Gonullu.new(gonullu_params)\n\n respond_to do |format|\n if @gonullu.save\n format.html { redirect_to @gonullu, notice: 'Gonullu was successfully created.' }\n format.json { render :show, status: :created, location: @gonullu }\n else\n format.html { render :new }\n format.json { render json: @gonullu.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @betraege = Betraege.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @betraege }\n end\n end", "def create\n @apartment_geopoint = ApartmentGeopoint.new(apartment_geopoint_params)\n\n respond_to do |format|\n if @apartment_geopoint.save\n format.html { redirect_to @apartment_geopoint, notice: 'Apartment geopoint was successfully created.' }\n format.json { render action: 'show', status: :created, location: @apartment_geopoint }\n else\n format.html { render action: 'new' }\n format.json { render json: @apartment_geopoint.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @gage = Gage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gage }\n end\n end", "def create\n @plate = @restaurante.plates.create(plate_params)\n @plate.ratings ||= []\n @plate.clients_ratings ||= []\n\n respond_to do |format|\n if @plate.save\n format.html { redirect_to restaurante_plate_path(@restaurante, @plate),\n notice: 'Plato creado exitosamente.' }\n format.json { render :show, status: :created, location: @plate }\n else\n format.html { render :new }\n format.json { render json: @plate.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def create\n @geocoded_location = GeocodedLocation.new(geocoded_location_params)\n\n respond_to do |format|\n if @geocoded_location.save\n format.html { redirect_to :root, notice: 'Geocoded location was successfully created.' }\n format.json { render :show, status: :created, location: @geocoded_location }\n else\n format.html { render :new }\n format.json { render json: @geocoded_location.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n data = []\n trace_params.each do |p|\n hash = {\n latitude: p[\"latitude\"],\n longitude: p[\"longitude\"]\n }\n data << hash\n end\n\n if Trace.upload_data(data)\n render json: {status: 'OK'}\n else\n render json: @trace.errors, status: :unprocessable_entity\n end\n end", "def create\n\n has = params[\"area\"].to_json\n data_has = JSON.parse(has)\n @zone = Zone.new();\n @zone.nombre_zona = params[\"nombre_zona\"]\n @zone.color = params[\"color\"]\n\n respond_to do |format|\n if @zone.save\n \n data_has.each do |geo|\n @coordenada = CoordinateZone.new()\n geo.each do |data|\n @coordenada.zone_id = @zone.id\n @coordenada.latitud = data[\"lat\"].to_f\n @coordenada.longitud = data[\"lng\"].to_f \n end\n @coordenada.save\n end\n\n format.html { redirect_to @zone, notice: 'Zone was successfully created.' }\n format.js \n # format.js { render js: \"window.location.href=#{ directories_path }\" }\n format.json { render :show, status: :created, location: @zone }\n \n else\n format.html { render :new }\n format.json { render json: @zone.errors, status: :unprocessable_entity }\n end\n\n end\n end", "def create\n @solar_garden = SolarGarden.new(solar_garden_params)\n\n respond_to do |format|\n if @solar_garden.save\n format.html { redirect_to @solar_garden, notice: 'Solar garden was successfully created.' }\n format.json { render :show, status: :created, location: @solar_garden }\n else\n format.html { render :new }\n format.json { render json: @solar_garden.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n tag = @user.tags.new(:location => params[:location])\n\n if tag.save\n render :status => 200,\n :json => tag_as_hash(tag).merge(status: 200)\n else\n render :status => 400,\n :json => {\n status: 400,\n message: \"Bad request\",\n errors: tag.errors,\n }\n end\n end", "def create\n @gigapan = Gigapan.new(gigapan_params)\n\n respond_to do |format|\n if @gigapan.save\n format.html { redirect_to @gigapan, notice: 'Gigapan was successfully created.' }\n format.json { render :show, status: :created, location: @gigapan }\n else\n format.html { render :new }\n format.json { render json: @gigapan.errors, status: :unprocessable_entity }\n end\n end\n end", "def lodge_params\n params.require(:lodge).permit(:name, :lat, :long, :category, :image, :address)\n end", "def create\n @messege = Messege.new(params[:messege])\n\n respond_to do |format|\n if @messege.save\n format.html { redirect_to @messege, notice: 'Messege was successfully created.' }\n format.json { render json: @messege, status: :created, location: @messege }\n else\n format.html { render action: \"new\" }\n format.json { render json: @messege.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n plant = Plant.create(plant_params)\n render json: plant, status: :created\n end", "def new\n @dimgeom = Dimgeom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dimgeom }\n end\n end", "def create\n @galletum = Galletum.new(galletum_params)\n\n respond_to do |format|\n if @galletum.save\n format.html { redirect_to @galletum, notice: 'Galletum was successfully created.' }\n format.json { render :show, status: :created, location: @galletum }\n else\n format.html { render :new }\n format.json { render json: @galletum.errors, status: :unprocessable_entity }\n end\n end\n end", "def data_to_api(snack_name, snack_location, snack_optional)\n RestClient.post ENV['NERDERY_API'], { name: snack_name,\n location: snack_location,\n optional: snack_optional\n }.to_json, content_type: :json\n end", "def index\n @lugars = Lugar.all\n\n render json: @lugars\n end", "def create\n @badge = Badge.new(params[:badge])\n\n respond_to do |format|\n if @badge.save\n format.html { redirect_to @badge, :notice => 'Badge was successfully created.' }\n format.json { render :json => @badge, :status => :created, :location => @badge }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @badge.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @galeria = Galeria.new(params[:galeria])\n\n respond_to do |format|\n if @galeria.save\n format.html { redirect_to @galeria, notice: 'Galeria was successfully created.' }\n format.json { render json: @galeria, status: :created, location: @galeria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @galeria.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @region = Region.new(params[:region])\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render json: @region, status: :created, location: @region }\n else\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pigeon = current_user.pigeons.new(pigeon_params)\n\n respond_to do |format|\n if @pigeon.save\n format.html { redirect_to @pigeon, notice: 'Pigeon was successfully created.' }\n format.json { render :show, status: :created, location: @pigeon }\n else\n format.html { render :new }\n format.json { render json: @pigeon.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if geo_params\n point = @user.geopoints.build\n point[:lat] = @geopoint[:lat]\n point[:lon] = @geopoint[:lon]\n point[:battery] = @geopoint[:battery]\n point[:time] = @geopoint[:time]\n if point.save\n @user.update(lat: point[:lat], lon: point[:lon], time: point[:time])\n #geopoint saved successfuly\n render json: \"ok\", status: 200\n else\n #validate error\n render json: \"validate_error\", status: 422\n end\n else\n #NotFound user\n render json: \"empty_error\", status: 423\n end\nend", "def garrage_params\n params.require(:garrage).permit(:address, :title, :latitude, :longitude, :image)\n end", "def create\n @galaxy = Galaxy.find_by(params[:galaxy_id])\n @star = Star.find_by(id: params[:star_id])\n @planet = @star.planets.new(planet_params)\n\n respond_to do |format|\n if @planet.save\n format.html { redirect_to galaxy_star_path(@galaxy, @star), notice: 'Planet was successfully created.' }\n format.json { render :show, status: :created, location: @planet }\n else\n format.html { render :new }\n format.json { render json: @planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gig_type = GigType.new(gig_type_params)\n\n respond_to do |format|\n if @gig_type.save\n format.html { redirect_to @gig_type, notice: 'Gig type was successfully created.' }\n format.json { render :show, status: :created, location: @gig_type }\n else\n format.html { render :new }\n format.json { render json: @gig_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def coordinates\n location = Location.new(location_params)\n if location.save\n render json: location\n else\n render json: \"ERROR\"\n end\n end" ]
[ "0.58995456", "0.58931917", "0.5794838", "0.5666305", "0.5658326", "0.5608585", "0.55977917", "0.559703", "0.55921036", "0.55805635", "0.55743784", "0.5565814", "0.5558166", "0.55503505", "0.55340135", "0.55311775", "0.55119294", "0.55114686", "0.5503323", "0.550055", "0.5495403", "0.5487288", "0.54745173", "0.546198", "0.54609007", "0.5460254", "0.54584765", "0.5457016", "0.545621", "0.5451903", "0.5451423", "0.53910214", "0.537716", "0.5376898", "0.53704756", "0.536397", "0.5347804", "0.5342926", "0.5334174", "0.5327088", "0.53257436", "0.5319876", "0.5319469", "0.5312233", "0.5309513", "0.53079325", "0.5303357", "0.5288616", "0.52865094", "0.5282989", "0.5281772", "0.5272076", "0.5263994", "0.526172", "0.5249267", "0.5246914", "0.52445686", "0.5244174", "0.5240329", "0.52394074", "0.5224012", "0.52167785", "0.52162755", "0.52114415", "0.5209282", "0.5204383", "0.52027774", "0.5202604", "0.51986414", "0.5198356", "0.51977855", "0.5177728", "0.51727", "0.5168213", "0.51657873", "0.51642025", "0.5158045", "0.51548624", "0.51495105", "0.5148077", "0.5148051", "0.51471996", "0.51300675", "0.5124143", "0.51174533", "0.5115514", "0.51101595", "0.5107172", "0.5102071", "0.5099491", "0.50991285", "0.50990665", "0.5089576", "0.50821465", "0.5082057", "0.5081558", "0.5076583", "0.50731575", "0.5069196", "0.5064306", "0.50637466" ]
0.0
-1
PATCH/PUT /gears/1 PATCH/PUT /gears/1.json
def update respond_to do |format| if @gear.update(gear_params) format.html { redirect_to @gear, notice: 'Gear was successfully updated.' } format.json { render :show, status: :ok, location: @gear } else format.html { render :edit } format.json { render json: @gear.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update!(**args)\n @geometries = args[:geometries] if args.key?(:geometries)\n @id = args[:id] if args.key?(:id)\n @type = args[:type] if args.key?(:type)\n end", "def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end", "def update\n respond_to do |format|\n if @allergy.update(allergy_params)\n format.html { redirect_to @allergy, notice: t('allergies.update_success') }\n format.json { render :show, status: :ok, location: @allergy }\n else\n format.html { render :edit }\n format.json { render json: @allergy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def patch!\n request! :patch\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update!(**args)\n @geometries = args[:geometries] if args.key?(:geometries)\n @type = args[:type] if args.key?(:type)\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end", "def update\n @hoge = Hoge.find(params[:id])\n\n respond_to do |format|\n if @hoge.update_attributes(params[:hoge])\n format.html { redirect_to @hoge, notice: 'Hoge was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hoge.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, **args); end", "def update\n respond_to do |format|\n if @latstraps1.update(latstraps1_params)\n format.html { redirect_to \"/latstraps1s\"}\n format.json { render :show, status: :ok, location: @latstraps1 }\n else\n format.html { render :edit }\n format.json { render json: @latstraps1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end", "def update\n respond_to do |format|\n if @galaxies_elliptical_galaxy.update(galaxies_elliptical_galaxy_params)\n format.html { redirect_to @galaxies_elliptical_galaxy, notice: 'Elliptical galaxy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @galaxies_elliptical_galaxy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @geometry.update(geometry_params)\n format.html { redirect_to @geometry, notice: 'Geometry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @geometry.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end", "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def update\n @fridge = Fridge.find(params[:id])\n\n respond_to do |format|\n if @fridge.update_attributes(params[:fridge])\n format.html { redirect_to @fridge, notice: 'Fridge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fridge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end", "def update\n respond_to do |format|\n if @fish_poly.update(fish_poly_params)\n format.html { redirect_to @fish_poly, notice: 'Fish poly was successfully updated.' }\n format.json { render :show, status: :ok, location: @fish_poly }\n else\n format.html { render :edit }\n format.json { render json: @fish_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @geocach = Geocach.find(params[:id])\n\n respond_to do |format|\n if @geocach.update_attributes(params[:geocach])\n format.html { redirect_to @geocach, notice: 'This Geocache was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @geocach.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update_location(params)\n @client.put(\"#{path}/location\", nil, params, \"Content-Type\" => \"application/json\")\n end", "def update\n respond_to do |format|\n if @dog_poly.update(dog_poly_params)\n format.html { redirect_to @dog_poly, notice: 'Dog poly was successfully updated.' }\n format.json { render :show, status: :ok, location: @dog_poly }\n else\n format.html { render :edit }\n format.json { render json: @dog_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @galaxy = Galaxy.find(params[:id])\n\n respond_to do |format|\n if @galaxy.update_attributes(params[:galaxy])\n format.html { redirect_to @galaxy, :notice => 'Galaxy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @galaxy.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n if @gopy.update_attributes(params[:gopy])\n format.html { redirect_to @gopy, notice: 'Gopy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gopy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @admin_geonode = Admin::Geonode.find(params[:id])\n\n respond_to do |format|\n if @admin_geonode.update_attributes(params[:admin_geonode])\n format.html { redirect_to @admin_geonode, notice: 'Geonode was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_geonode.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n respond_to do |format|\n if @geocache.update_attributes(params[:geocache])\n format.html { redirect_to(@geocache, :notice => 'Geocache was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @geocache.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def update\n @geopoint = Geopoint.find(params[:id])\n\n respond_to do |format|\n if @geopoint.update_attributes(params[:geopoint])\n format.html { redirect_to @geopoint, notice: 'Geopoint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @geopoint.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @geotopics = args[:geotopics] if args.key?(:geotopics)\n end", "def update\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n if @gethotel.update_attributes(params[:gethotel])\n format.html { redirect_to @gethotel, notice: 'Gethotel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gethotel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def update\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.find(params[:id])\n\n respond_to do |format|\n if @galaxies_lenticular_galaxy.update_attributes(params[:galaxies_lenticular_galaxy])\n format.html { redirect_to @galaxies_lenticular_galaxy, :notice => 'Lenticular galaxy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @galaxies_lenticular_galaxy.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @galaxy.update(galaxy_params)\n format.html { redirect_to @galaxy, notice: 'Galaxy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @galaxy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client.update(client_params)\n render json: @client\n end", "def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end", "def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end", "def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end", "def update\n respond_to do |format|\n if @apartment_geopoint.update(apartment_geopoint_params)\n format.html { redirect_to @apartment_geopoint, notice: 'Apartment geopoint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @apartment_geopoint.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n if @golfer.update_attributes(params[:golfer])\n format.html { redirect_to @golfer, notice: 'Golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @golfer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gig_set.update(gig_set_params)\n format.html { redirect_to edit_gig_path(@gig_set.gig) }\n format.json { redirect_to edit_gig_path(@gig_set.gig) }\n else\n format.html { redirect_to edit_gig_path(@gig_set.gig), error: \"Couldn't update set\" }\n format.json { redirect_to edit_gig_path(@gig_set.gig), status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grape.update(grape_params)\n format.html { redirect_to @grape, notice: \"Grape was successfully updated.\" }\n format.json { render :show, status: :ok, location: @grape }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @grape.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @json_schemas = args[:json_schemas] if args.key?(:json_schemas)\n @schema = args[:schema] if args.key?(:schema)\n end", "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "def patch\n end", "def update\n respond_to do |format|\n if @pigeon.update(pigeon_params)\n format.html { redirect_to @pigeon, notice: 'Pigeon was successfully updated.' }\n format.json { render :show, status: :ok, location: @pigeon }\n else\n format.html { render :edit }\n format.json { render json: @pigeon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n respond_to do |format|\n if @garply.update(garply_params)\n format.html { redirect_to @garply, notice: 'Garply was successfully updated.' }\n format.json { render :show, status: :ok, location: @garply }\n else\n format.html { render :edit }\n format.json { render json: @garply.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end", "def update\n respond_to do |format|\n if @geographic_item.update(geographic_item_params)\n format.html { redirect_to @geographic_item.metamorphosize, notice: 'Geographic item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @geographic_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, body_params = {})\n debug_log \"PATCH #{@host}#{path} body:#{body_params}\"\n headers = { 'Content-Type' => 'application/json' }\n res = connection.run_request :put, path, body_params.to_json, headers\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end", "def update(path)\n output { patch(path, params) }\n end", "def update\n respond_to do |format|\n if @goofball.update(goofball_params)\n format.html { redirect_to @goofball, notice: 'Goofball was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @goofball.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @latstrapshome4.update(latstrapshome4_params)\n format.html { redirect_to \"/latstrapshome4s\"}\n format.json { render :show, status: :ok, location: @latstrapshome4 }\n else\n format.html { render :edit }\n format.json { render json: @latstrapshome4.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ge_city_api.update(ge_city_api_params)\n format.html { redirect_to @ge_city_api, notice: 'Ge city api was successfully updated.' }\n format.json { render :show, status: :ok, location: @ge_city_api }\n else\n format.html { render :edit }\n format.json { render json: @ge_city_api.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n animal = Animal.find(params[:id])\n\n if validate_params(animal_params)\n animal.update(animal_params)\n render json: animal, status: 200, location: [:api, animal]\n else\n render json: { errors: animal.errors }, status: 422\n end\n end", "def update\n respond_to do |format|\n if @cat_poly.update(cat_poly_params)\n format.html { redirect_to @cat_poly, notice: 'Cat poly was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat_poly }\n else\n format.html { render :edit }\n format.json { render json: @cat_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end", "def update\n @gig_request = GigRequest.find(params[:id])\n\n respond_to do |format|\n if @gig_request.update_attributes(params[:gig_request])\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(data = :object || :json)\n end", "def update\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n if update_gig(@gig)\n format.html { redirect_to @gig, notice: 'Gig was successfully updated.' }\n format.json { render json: @gig, status: :ok, location: @gig }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n\n format.json { render json: Axis.find(params[:id]).update( name: params[:name]) }\n end\n\n # end\n end", "def update\n respond_to do |format|\n if @clothing.update(clothing_params)\n format.html { redirect_to @clothing, notice: 'Clothing was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing }\n else\n format.html { render :edit }\n format.json { render json: @clothing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @galaxy.update(galaxy_params)\n format.html { redirect_to @galaxy, notice: 'Galaxy was successfully updated.' }\n format.json { render :show, status: :ok, location: @galaxy }\n else\n format.html { render :edit }\n format.json { render json: @galaxy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @galaxy.update(galaxy_params)\n format.html { redirect_to @galaxy, notice: 'Galaxy was successfully updated.' }\n format.json { render :show, status: :ok, location: @galaxy }\n else\n format.html { render :edit }\n format.json { render json: @galaxy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @animal = Animal.find(params[:id])\n @species = ['Lion', 'Koala', 'Panda']\n @zoo = Zoo.find(params[:zoo_id])\n\n respond_to do |format|\n\n if @animal.update_attributes(params[:animal])\n format.html { redirect_to zoo_animal_path(params[:zoo_id],@animal.id),\n notice: 'animal was successfully updated.' }\n format.json { head :no_content }\n else\n\n format.html { render action: \"edit\"}\n format.json { render json: @animal.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { render :show, status: :ok, location: @patch }\n else\n format.html { render :edit }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @geoname = Geoname.find(params[:id])\n\n respond_to do |format|\n if @geoname.update_attributes(params[:geoname])\n flash[:notice] = 'Geoname was successfully updated.'\n format.html { redirect_to(@geoname) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @geoname.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bracket_golfer.update(bracket_golfer_params)\n format.html { redirect_to @bracket_golfer, notice: 'Bracket golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bracket_golfer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create_method\n :put_json\n end", "def update\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n if @gauge.update_attributes(params[:gauge])\n format.html { redirect_to @gauge, notice: 'Gauge 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", "def put(*args)\n request :put, *args\n end", "def update\n put :update\n end", "def patch(operation, path, value = nil)\n ensure_client && ensure_uri\n body = {\n 'op' => operation,\n 'path' => path,\n 'value' => value\n }\n response = @client.rest_patch(@data['uri'], { 'Content-Type' => 'application/json-patch+json', 'body' => [body] }, @api_version)\n @client.response_handler(response)\n end", "def update\n @grocery = Grocery.find(params[:id])\n\n if @grocery.update(grocery_params)\n head :no_content\n else\n render json: @grocery.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(*args)\n put(*args)\n end", "def update(*args)\n put(*args)\n end", "def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end", "def from_merge_patch_json\n if request.patch?\n from_json\n else\n 415\n end\n end", "def update\r\n @location = Location.find(params[:id])\r\n \r\n respond_to do |format|\r\n if @location.update_attributes(params[:location])\r\n format.json { head :no_content }\r\n else\r\n format.json { render json: @location.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end" ]
[ "0.62767726", "0.6131888", "0.6125057", "0.61098313", "0.60706264", "0.60611045", "0.60294735", "0.5997472", "0.5949212", "0.5912289", "0.59080017", "0.5846397", "0.58446854", "0.5841438", "0.58330303", "0.5825231", "0.5822197", "0.5808913", "0.5803559", "0.5787294", "0.5785735", "0.5784211", "0.5777324", "0.57752067", "0.57752067", "0.5772555", "0.57676435", "0.575311", "0.57445586", "0.57412046", "0.5737174", "0.5735895", "0.5729777", "0.5729777", "0.5723823", "0.57193583", "0.57056856", "0.5702182", "0.57018995", "0.5684866", "0.56841403", "0.5683093", "0.5683093", "0.5682392", "0.56760484", "0.5674369", "0.5657071", "0.5654591", "0.56488687", "0.56461334", "0.5639293", "0.5627633", "0.5619904", "0.5615548", "0.5614401", "0.5614304", "0.56137764", "0.56005526", "0.55987877", "0.5585404", "0.5584936", "0.5583213", "0.55757993", "0.5573732", "0.5570657", "0.55667555", "0.55609965", "0.55579454", "0.5551742", "0.5551599", "0.5548695", "0.55409914", "0.5540912", "0.5536049", "0.5535199", "0.5533248", "0.55297375", "0.5525724", "0.55208886", "0.55187005", "0.55133647", "0.55133647", "0.5501438", "0.54947484", "0.5492976", "0.54899156", "0.54874104", "0.54867214", "0.54857254", "0.5482068", "0.5481673", "0.54809433", "0.54806405", "0.5478552", "0.54697186", "0.54697186", "0.54668444", "0.5466497", "0.54646856" ]
0.5701789
40
DELETE /gears/1 DELETE /gears/1.json
def destroy @gear.destroy respond_to do |format| format.html { redirect_to gears_url, notice: 'Gear was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @hoge = Hoge.find(params[:id])\n @hoge.destroy\n\n respond_to do |format|\n format.html { redirect_to hoges_url }\n format.json { head :ok }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def delete\n render json: Location.delete(params[\"id\"])\n end", "def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @geocach = Geocach.find(params[:id])\n @geocach.destroy\n\n respond_to do |format|\n format.html { redirect_to geocaches_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @admin_geonode = Admin::Geonode.find(params[:id])\n @admin_geonode.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_geonodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gopy = Gopy.find(params[:id])\n @gopy.destroy\n\n respond_to do |format|\n #format.html { redirect_to gopies_url }\n format.html { redirect_to hienthi_gopies_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n @gethotelstaticdatagd.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotelstaticdatagds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gethotel = Gethotel.find(params[:id])\n @gethotel.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @geopoint = Geopoint.find(params[:id])\n @geopoint.destroy\n\n respond_to do |format|\n format.html { redirect_to geopoints_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gauge = Gauge.find(params[:id])\n @gauge.destroy\n\n respond_to do |format|\n format.html { redirect_to gauges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @geometry.destroy\n respond_to do |format|\n format.html { redirect_to geometries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galaxies_elliptical_galaxy.destroy\n respond_to do |format|\n format.html { redirect_to galaxies_elliptical_galaxies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galaxy = Galaxy.find(params[:id])\n @galaxy.destroy\n\n respond_to do |format|\n format.html { redirect_to galaxies_url }\n format.json { head :ok }\n end\n end", "def destroy\n @allergy.destroy\n respond_to do |format|\n format.html { redirect_to allergies_url, notice: t('allergies.destroy_success') }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @geographic_item.destroy\n respond_to do |format|\n format.html { redirect_to geographic_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @fridge = Fridge.find(params[:id])\n @fridge.destroy\n\n respond_to do |format|\n format.html { redirect_to fridges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @alley.destroy\n\n respond_to do |format|\n format.html { redirect_to alleys_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galaxy.destroy\n respond_to do |format|\n format.html { redirect_to galaxies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @garply.destroy\n respond_to do |format|\n format.html { redirect_to garplies_url, notice: 'Garply was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gl.destroy\n respond_to do |format|\n format.html { redirect_to gls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @geo.destroy\n respond_to do |format|\n format.html { redirect_to geos_url, notice: 'Geo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @gatha.destroy\n respond_to do |format|\n format.html { redirect_to gathas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gear = Gear.find(params[:id])\n @gear.destroy\n\n respond_to do |format|\n format.html { redirect_to(gears_url) }\n format.xml { head :ok }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def destroy\n @gig = Gig.find(params[:id])\n @gig.destroy\n\n respond_to do |format|\n format.html { redirect_to gigs_url }\n format.json { render json: nil, status: :ok }\n end\n end", "def destroy\n @golfer = Golfer.find(params[:id])\n @golfer.destroy\n\n respond_to do |format|\n format.html { redirect_to golfers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stilage.destroy\n respond_to do |format|\n format.html { redirect_to stilages_url, notice: 'Stilage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ge_city_api.destroy\n respond_to do |format|\n format.html { redirect_to ge_city_apis_url, notice: 'Ge city api was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @geoname = Geoname.find(params[:id])\n @geoname.destroy\n\n respond_to do |format|\n format.html { redirect_to(geonames_url) }\n format.xml { head :ok }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @geo_datum.destroy\n respond_to do |format|\n format.html { redirect_to geo_data_url, notice: 'Geo datum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.find(params[:id])\n @galaxies_lenticular_galaxy.destroy\n\n respond_to do |format|\n format.html { redirect_to galaxies_lenticular_galaxies_url }\n format.json { head :ok }\n end\n end", "def destroy\n @gig_request = GigRequest.find(params[:id])\n @gig_request.destroy\n\n respond_to do |format|\n format.html { redirect_to gig_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bracket_golfer.destroy\n respond_to do |format|\n format.html { redirect_to bracket_golfers_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @earth.destroy\n respond_to do |format|\n format.html { redirect_to earths_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gravity.destroy\n respond_to do |format|\n format.html { redirect_to gravities_url }\n format.json { head :no_content }\n end\n end", "def delete_region\n Region.find(params[:id]).destroy\n render :json => {}\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @gl = Gl.find(params[:id])\n @gl.destroy\n\n respond_to do |format|\n format.html { redirect_to gls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @apartment_geopoint.destroy\n respond_to do |format|\n format.html { redirect_to apartment_geopoints_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galeria = Galeria.find(params[:id])\n @galeria.destroy\n\n respond_to do |format|\n format.html { redirect_to galerias_url }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @lodge.destroy\n respond_to do |format|\n format.html { redirect_to lodges_url, notice: 'Lodge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @village = Village.find(params[:id])\n @village.destroy\n\n respond_to do |format|\n format.html { redirect_to villages_url }\n format.json { head :no_content }\n end\n end", "def delete_json(url)\n JSON.parse(delete(url, :json, :json))\n end", "def destroy\n @gasto = Gasto.find(params[:id])\n @gasto.destroy\n\n respond_to do |format|\n format.html { redirect_to gastos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dimgeom = Dimgeom.find(params[:id])\n @dimgeom.destroy\n\n respond_to do |format|\n format.html { redirect_to dimgeoms_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gravity = Gravity.find(params[:id])\n @gravity.destroy\n\n respond_to do |format|\n format.html { redirect_to gravities_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gage = Gage.find(params[:id])\n @gage.destroy\n\n respond_to do |format|\n format.html { redirect_to gages_url }\n format.json { head :no_content }\n end\n end", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def destroy\n @lounge.destroy\n respond_to do |format|\n format.html { redirect_to lounges_url, notice: 'Lounge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @grave.destroy\n respond_to do |format|\n format.html { redirect_to graves_url, notice: 'Grave was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_village = Admin::Village.find(params[:id])\n @admin_village.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_villages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galaxy.destroy\n respond_to do |format|\n format.html { redirect_to galaxies_url, notice: 'Galaxy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @galaxy.destroy\n respond_to do |format|\n format.html { redirect_to galaxies_url, notice: 'Galaxy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lodge = Lodge.find(params[:id])\n @lodge.destroy\n\n respond_to do |format|\n format.html { redirect_to lodges_url }\n format.json { head :ok }\n end\n end", "def destroy\n @goody = Goody.find(params[:id])\n @goody.destroy\n\n respond_to do |format|\n format.html { redirect_to goodies_url }\n format.json { head :no_content }\n end\n end", "def test_del\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 id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end", "def destroy\n @polygon = Polygon.find(params[:id])\n @polygon.destroy\n\n respond_to do |format|\n format.html { redirect_to polygons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gig.destroy\n respond_to do |format|\n format.html { redirect_to gigs_url, notice: 'Gig was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @location = Location.find(params[:id])\r\n RemovedLocation.create(server_id: Integer(params[:id]))\r\n directory = Rails.root.join('app','assets','locations');\r\n\r\n path = File.join(directory, @location.image)\r\n File.delete(path)\r\n @location.destroy\r\n mv = MapsVersion.first\r\n mv.version = mv.version+1\r\n mv.save\r\n respond_to do |format|\r\n format.html { redirect_to locations_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @gig.destroy\n respond_to do |format|\n format.html { redirect_to gigs_url, notice: \"Gig was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end", "def destroy\n @geofence.destroy\n respond_to do |format|\n format.html { redirect_to geofences_url, notice: 'Geofence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @goofball.destroy\n respond_to do |format|\n format.html { redirect_to goofballs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hdfs_path = HdfsPath.find(params[:id])\n @hdfs_path.destroy\n\n respond_to do |format|\n format.html { redirect_to hdfs_paths_url }\n format.json { head :ok }\n end\n end", "def destroy\n @map.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\r\n @location = Location.find(params[:id])\r\n @location.destroy\r\n\r\n respond_to do |format|\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @betraege = Betraege.find(params[:id])\n @betraege.destroy\n\n respond_to do |format|\n format.html { redirect_to betraeges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bath.destroy\n respond_to do |format|\n format.html { redirect_to baths_url, notice: 'Bath was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cephalopod.destroy\n respond_to do |format|\n format.html { redirect_to cephalopods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n compute.delete_flavor(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to flavors_path }\n format.json { head :ok }\n end\n end", "def destroy\n @brag = Brag.find(params[:id])\n @brag.destroy\n\n respond_to do |format|\n format.html { redirect_to brags_url }\n format.json { head :no_content }\n end\n end", "def delete!\n request! :delete\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end" ]
[ "0.68400866", "0.6823084", "0.6697232", "0.6686432", "0.6678645", "0.66611385", "0.66562134", "0.6606179", "0.66030663", "0.65987885", "0.6589246", "0.65831405", "0.6579576", "0.65362775", "0.65352786", "0.65276307", "0.6521699", "0.65040785", "0.65021765", "0.6500294", "0.6490912", "0.6490912", "0.64850646", "0.6476543", "0.6466549", "0.64663064", "0.64627486", "0.64605063", "0.6434899", "0.6419494", "0.640993", "0.63974583", "0.6394717", "0.63730866", "0.6372893", "0.63654864", "0.6365155", "0.63639456", "0.6360628", "0.6360628", "0.63584244", "0.6356522", "0.6356261", "0.63516873", "0.63490427", "0.6348297", "0.6344775", "0.634116", "0.6336656", "0.63320637", "0.6316992", "0.6298164", "0.6292397", "0.6288681", "0.62854457", "0.62814695", "0.62812513", "0.6280845", "0.6280285", "0.6280234", "0.62794113", "0.6274944", "0.62739503", "0.6272813", "0.6271678", "0.6268204", "0.62673193", "0.6265537", "0.6265537", "0.6265171", "0.62608033", "0.6257523", "0.6256313", "0.62418985", "0.6239603", "0.62355614", "0.6234743", "0.6234616", "0.622749", "0.6221213", "0.62202126", "0.6217842", "0.6217825", "0.62175727", "0.6217453", "0.62143254", "0.62025946", "0.6199446", "0.61950654", "0.61939096", "0.6189063", "0.6188261", "0.6184928", "0.6183153", "0.61813337", "0.61807317", "0.61803114", "0.61779654", "0.61779654" ]
0.64951694
21
Use callbacks to share common setup or constraints between actions.
def set_gear @gear = Gear.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "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", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def setup\n #implement in subclass;\n end", "def after_set_callback; end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def around_hooks; end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def duas1(action)\n action.call\n action.call\nend" ]
[ "0.6165152", "0.60463154", "0.59467196", "0.5917112", "0.5890387", "0.58345735", "0.57773316", "0.56991524", "0.56991524", "0.565454", "0.5622282", "0.54232633", "0.54119074", "0.54119074", "0.54119074", "0.53937256", "0.53801376", "0.5358599", "0.53412294", "0.5340814", "0.53314966", "0.53114754", "0.52984965", "0.52977055", "0.5296272", "0.5260649", "0.5245076", "0.52388334", "0.52388334", "0.52388334", "0.52388334", "0.52388334", "0.5235081", "0.52321917", "0.5228592", "0.5220735", "0.52198535", "0.52139324", "0.5208539", "0.5206585", "0.5178542", "0.5175199", "0.5173538", "0.5167041", "0.51614195", "0.51577675", "0.5153909", "0.51528823", "0.5152225", "0.51429904", "0.5141399", "0.51345575", "0.51145", "0.5114052", "0.5114052", "0.5110216", "0.5108656", "0.50935394", "0.5089196", "0.5081936", "0.5079627", "0.50675833", "0.5056105", "0.5053687", "0.5050475", "0.5050475", "0.503471", "0.5028311", "0.501982", "0.50157547", "0.5013552", "0.50014806", "0.50011593", "0.49976763", "0.4990292", "0.4990292", "0.49882022", "0.4981269", "0.49792367", "0.49766538", "0.4967978", "0.49667212", "0.4958987", "0.49572337", "0.49550423", "0.4954479", "0.4952353", "0.494726", "0.4944055", "0.4935437", "0.4931248", "0.49283475", "0.49281213", "0.49268973", "0.4921738", "0.49204507", "0.4918924", "0.49182287", "0.4916538", "0.49158585", "0.49156788" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def gear_params params.require(:gear).permit(:title, :definitionkey, :usinfo_id, :latitude, :longitude, :address, :description) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "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", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "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", "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", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "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", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "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", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "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", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "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", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "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", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "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", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "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", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "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", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "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", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "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", "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", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "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", "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", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "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", "def secure_params\n params.require(:location).permit(:name)\n end", "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", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "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", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "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", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "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", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Includes a partial. The path is relative to the Selenium tests root. The starting _ and the file extension don't have to be specified. include test/selenium/_partial. include_partial 'partial' include test/selenium/suite/_partial. include_partial 'suite/partial' include test/selenium/suite/_partial. and provide local assigns include_partial 'suite/partial', :foo => bar
def include_partial path, local_assigns = {} partial = @view.render :partial => path, :locals => local_assigns @output << partial end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def include_partial(relative_path)\n return if @partial_templates.key?(relative_path)\n\n @partial_templates[relative_path] = nil\n render(Pathname.new(\"#{@script_path}/#{relative_path}\"))\n end", "def render_partial(p,local_assigns={})\n# ActionView::TestCase::Behavior#, which invokes ActionView::Rendering#:\n if local_assigns.blank? # Work around bugs:\n render :partial => p\n else\n render p, local_assigns\n end\n @partial=p.clone.insert p.index(?/)+1, '_'\n end", "def partial_in(controller, partial_name, *args)\n partial_name = PARTIAL_PREFIX + partial_name.to_s\n begin\n controller.render_partial(partial_name, *args)\n rescue\n Ramaze::Log.error(\"Error loading partial #{controller.to_s}.#{partial_name}\")\n raise $!\n end\n end", "def lookup_partials_path\n # See FAQ for Views::Base class\n dir = ::File.join(wiki.path, ::File.dirname(file.path))\n path = ::File.join('_includes')\n\n partials_dir = lookup_path(path, dir)\n\n if partials_dir && ::File.directory?(partials_dir)\n partials_dir\n else\n ::File.join(LIBDIR, 'templates', 'includes')\n end\n end", "def render(context)\n file = render_variable(context) || @file # use parsed variable filename unless passed explicit filename\n validate_file_name(file)\n path = locate_include_file(context, file, true) # ensure file exists in safe path\n return unless path\n # # ???????\n # add_include_to_dependency(site, path, context)\n #\n # Load the partial if it's identical to one we've already loaded ???\n partial = File.read(path) # reads the template file\n partial = Liquid::Template.parse(partial) # compiles template\n # setup and perform render\n context.stack do\n # create a hash object for any passed k/v pair args\n # by parsing passed parameters using the parent file's scope\n context[\"include\"] = parse_params(context) if @params\n begin # render the include for output\n partial.render!(context)\n rescue Liquid::Error => e\n e.template_name = path\n e.markup_context = \"included \" if e.markup_context.nil?\n raise e\n end\n end\n end", "def partial(filename, assigns = {})\n if template.partials.has_key?(filename)\n p = template.partials[filename]\n else\n p = Documatic::OpenDocumentText::Partial.new(filename)\n template.add_partial(filename, p)\n end\n assigns.merge!(:template => template, :master => master)\n p.process(assigns)\n end", "def partial(name)\n partial_name = \"_#{name}.#{Stache.template_extension}\"\n template_dir = self.virtual_path.split(\"/\")[0..-2].join(\"/\")\n partial_path = File.expand_path(File.join(Stache.template_base_path, template_dir, partial_name))\n # ::Rails.logger.info \"Checking for #{partial_path} in template_dir: #{template_dir}\"\n unless File.file?(partial_path)\n partial_path = \"#{Stache.shared_path}/#{partial_name}\"\n end\n \n # ::Rails.logger.info \"LOADING PARTIAL: #{partial_path}\"\n File.read(partial_path)\n end", "def load_cached_partial(path, context)\n context.registers[:cached_partials] ||= {}\n cached_partial = context.registers[:cached_partials]\n\n if cached_partial.key?(path)\n cached_partial[path]\n else\n unparsed_file = context.registers[:site]\n .liquid_renderer\n .file(path)\n begin\n cached_partial[path] = unparsed_file.parse(File.read(path, **context.registers[:site].file_read_opts))\n rescue Liquid::Error => e\n e.template_name = path\n e.markup_context = \"included \" if e.markup_context.nil?\n raise e\n end\n end\n end", "def partial(partial_name)\n partial_name = partial_name.to_s\n ext = nil\n partial_dir = File.join [@current_group.name, @current_page.name]\n \n partial_string = \"\"\n partial_file = nil\n \n while ext.nil? do\n if File.exist?(File.expand_path(\"project/site/#{partial_dir}/#{partial_name}.erb\", MOKA_ROOT))\n partial_file = File.new(File.expand_path(\"project/site/#{partial_dir}/#{partial_name}.erb\", MOKA_ROOT), \"r\")\n ext = \"erb\"\n elsif File.exist?(File.expand_path(\"project/site/#{partial_dir}/#{partial_name}.haml\", MOKA_ROOT))\n partial_file = File.new(File.expand_path(\"project/site/#{partial_dir}/#{partial_name}.haml\", MOKA_ROOT), \"r\")\n ext = \"haml\"\n end\n if partial_dir == \"\" and ext.nil?\n puts \"WARNING: cannot find partial file #{partial_name}.erb or #{partial_name}.haml\"\n break\n end\n partial_dir = File.dirname partial_dir\n if partial_dir == \".\"\n partial_dir = \"\"\n end\n end\n \n unless partial_file.nil?\n partial_string = partial_file.read\n partial_file.close\n end\n \n return Moka::Utilities.eval_erb_haml(partial_string, ext, self.get_binding)\n end", "def set_partial_path\n @partial_path = params[:partial_path]\n end", "def load_cached_partial(path, context)\n context.registers[:cached_partials] ||= {}\n cached_partial = context.registers[:cached_partials]\n\n if cached_partial.key?(path)\n cached_partial[path]\n else\n unparsed_file = context.registers[:globals]\n .liquid_renderer\n .file(path)\n begin\n # Cache a version of the\n cached_partial[path] = unparsed_file.parse(read_file(path, context))\n rescue Liquid::Error => e\n e.template_name = path\n e.markup_context = \"included \" if e.markup_context.nil?\n raise e\n end\n end\n end", "def partial(file=nil, locals={})\n # self.instance_variables.each { | k | \n # locals[k.gsub(/@/,'').to_s] = eval(k)\n # }\n # p locals.inspect\n locals[:request] = @request\n Doozer::Partial.partial(file, locals, route=@route)\n end", "def embedded_partial(path,name,opts={})\n additional_opts = opts\n additional_opts.merge!({ :partial => name, :locals => { :___embedded_html___ => element_at(path).inner_html }.merge(opts[:locals]||{}) })\n renderer.view.instance_eval { render(additional_opts) }\n end", "def partial (filename,locals={})\n source = File.read(find(filename))\n engine = Haml::Engine.new(source)\n engine.render(binding,locals)\nend", "def partial(template, locals = {})\n haml(template, :layout => false, :locals => locals)\n end", "def partial(filename, binding)\n template_file = get_template_file(filename)\n ERB.new(template_file, nil, '-', '_erbout2').result(binding)\nend", "def apply_partial(partial_path)\n manager.partials(partial_path).each do |partial_data|\n self.deep_merge!(partial_data)\n end\n end", "def partial(name)\n partial_name = \"_#{name}.#{Config.template_extension}\"\n template_dir = Pathname.new(self.template_file).dirname\n partial_path = File.expand_path(\"#{template_dir}/#{partial_name}\")\n unless File.file?(partial_path)\n partial_path = \"#{Config.shared_path}/#{partial_name}\"\n end\n File.read(partial_path)\n end", "def template_content(folder = 'content', partial = 'dummy')\n render_to_string(:partial => \"shared/#{ folder }/#{ partial }\")\n end", "def include_file(spec)\n elements << Raw.new(\" Include '#{spec}'\")\n end", "def shared_partial(*args)\n partial_name = args.shift.to_sym\n partial_in(SharedController, partial_name, *args)\n end", "def partial(template, locals = {})\n haml(template, { layout: false }, locals)\n end", "def render_partial(path, locals = {})\n raw theme_view.render(partial: path, locals: locals)\n end", "def render_partial(name, options={})\n if File.exists?(Rails.root.join(\"app\", \"views\", \"layouts\", \"#{name.gsub(/\\/(?!.*\\/)/, \"/_\")}.html.erb\"))\n name = \"#{website.folder}/#{name}\"\n end\n eval(\"render '#{name}', options\")\n end", "def render(partial_relative_path, vars=nil)\n pathname = partial_pathname(partial_relative_path)\n\n if vars.is_a?(Hash)\n context = Context.new(self, (variables || {}).merge(vars))\n else\n context = nil\n end\n\n template_result(pathname.read, context)\n end", "def render_partial(name, options={})\n name = name.to_s\n if File.exists?(Rails.root.join(\"app\", \"views\", \"#{website.folder}/#{name.gsub(/\\/(?!.*\\/)/, \"/_\")}.html.erb\"))\n name = \"#{website.folder}/#{name}\"\n end\n eval(\"render '#{name}', options\")\n end", "def partial(page, locals={})\n haml page, {:layout => false}, locals\n end", "def header_partial\n render :partial => \"shared/header\"\n end", "def include(mod,*more) end", "def partial(*args)\n partial_name = args.shift.to_s\n partial_name = PARTIAL_PREFIX + partial_name\n render_partial(partial_name, *args)\n end", "def partial (template, options = {})\n options = { :layout => false }.merge options\n if template.is_a? Hash\n options[:locals] = template[:locals] || {}\n template.delete(:locals) if template[:locals] \n options[:locals].merge! template\n template = template.reject{ |key, value| [:locals].include? key }.keys.first.to_s\n end \n haml(\"_#{template}\".to_sym, options)\n end", "def include\n File.join(@root, 'include')\n end", "def partial(template, locals = {})\n haml(template, {:layout => false}, locals)\n end", "def partial(template, locals = {})\n haml(template, {:layout => false}, locals)\n end", "def partial_path(path)\n \"listings/form_partials/#{path}\"\n end", "def render_partial_with_inherit_views(partial_path, local_assigns = nil, deprecated_local_assigns = nil)\n if (controller.inherit_views? rescue false) && found_path = controller.find_inherited_template_path(\"#{controller.controller_path}/_#{partial_path}\")\n partial_path = found_path.sub(\"/_#{partial_path}\", \"/#{partial_path}\")\n end\n with_current_render_of(partial_path) do\n render_partial_without_inherit_views(partial_path, local_assigns, deprecated_local_assigns)\n end\n end", "def partial(file, locales)\n template = config.get(:template)\n options = template[:options]\n path = \"#{template[:root]}/#{file}.slim\"\n Slim::Template.new(\n # delegate file read to slim\n path,\n # declare default options\n options\n ).render(\n # ensure helpers are scoped\n self,\n # pass locales via parameters\n locales\n )\n end", "def _pick_partial_template(partial_path)\n if partial_path.include?('/')\n path = File.join(File.dirname(partial_path), \"_#{File.basename(partial_path)}\")\n else\n path = \"_#{partial_path}\"\n end\n\n _pick_template(path)\n end", "def include(header)\n @inc << \"#include #{header}\"\n end", "def included(mod); end", "def include(arg)\n Object.module_eval \"include #{arg}\"\n end", "def partial\n segments = @page.template.split(\"/\").map!(&:underscore)\n\n # If we have multiple segments & they target an existing page partial\n if segments.count > 1 && lookup_context.exists?(segments.join(\"/\"), [\"pages\"], true)\n partial = segments.pop\n\n return partial_path(segments.join(\"/\"), partial)\n end\n\n partial_path(segments.join(\"/\"))\n end", "def partial(template, locals = {})\n erb(template, layout: false, locals: locals)\n end", "def partials(partial_path)\n @partials ||= {}\n if @partials[partial_path].nil?\n [Path.provider_base, Path.provider].each do |provider_dir|\n path = File.join(provider_dir, partial_path)\n if File.exists?(path)\n @partials[partial_path] ||= []\n @partials[partial_path] << load_json(path, Config::Object)\n end\n end\n if @partials[partial_path].nil?\n raise RuntimeError, 'no such partial path `%s`' % partial_path, caller\n end\n end\n @partials[partial_path]\n end", "def include_above(mod1, mod) end", "def render_partial(file_name)\n # The \"default\" version of the partial.\n file_to_render = \"#{@input_folder}/partials/#{file_name.to_s}.haml\"\n if @scope\n # Look for a partial prefixed with the current \"scope\" (which is just the name of the\n # primary template being rendered).\n scope_file = \"#{@input_folder}/partials/#{@scope.to_s}_#{file_name.to_s}.haml\"\n # Use it if it's there.\n file_to_render = scope_file if File.exists? scope_file\n end\n # If we found a matching partial (either the scoped one or the default), render it now.\n if File.exists? file_to_render\n partial = Haml::Engine.new(File.read(file_to_render), @options)\n partial.render self\n else\n nil\n end\n rescue Exception => e\n raise $!, \"#{$!} PARTIAL::#{file_name} \", $!.backtrace\n end", "def partial(template, locals = {})\n erb(template, :layout => false, :locals => locals)\n end", "def partial(template, locals = {})\n erb(template, :layout => false, :locals => locals)\n end", "def include_strategy\n :includes\n end", "def add_include(path)\n @includes << path\n end", "def add_include(path)\n @includes << path\n end", "def partial; end", "def partial; end", "def partial; end", "def partial; end", "def partial(template_name, locals, &content)\n self.kramdown_source.render(template_name)\n end", "def add(partial_name, *args)\n workbook.partials.get(partial_name).tap do |p|\n instance_exec(*args, &p) if p\n end\n end", "def some_partial\n # Used for testing.\n render_in_modal('layouts/some_partial')\n end", "def partial(name, options = {})\n options[:partial] = name\n action_view.render(options)\n end", "def includes(*paths)\n self.included_files.concat(expand_globs(paths))\n end", "def render_partial(url, options = {})\n Ramaze.deprecated('Helper::Partial#render_partial', 'Helper::Render#render_full')\n\n uri = URI(url)\n query = options # Innate::Current.request.params.merge(options)\n uri.query = Rack::Utils.build_query(query)\n\n body = nil\n\n Innate::Mock.session do |session|\n cookie = Innate::Current.session.cookie\n session.cookie = cookie\n body = session.get(uri.to_s, options).body\n end\n\n body\n end", "def main_navigation_partial\n partial_path = \"shared/\"\n partial_name = \"main_navigation\"\n path_exists?(\"app/views/#{partial_path}_#{partial_name}.html.*\") ? \"#{partial_path}#{partial_name}\" : nil\n end", "def render_partial(context, options, &block); end", "def partials(collection)\n partial(collection) if collection\n end", "def include_helpers(scope); end", "def partial(template, options={})\n options = { :locals => {}, :layout => false }.merge(options)\n path = template.to_s.split(File::SEPARATOR)\n object_name = path[-1].to_sym\n path[-1] = \"_#{path[-1]}\"\n template_path = File.join(path)\n raise 'Partial collection specified but is nil' if options.has_key?(:collection) && options[:collection].nil?\n if collection = options.delete(:collection)\n options.delete(:object)\n counter = 0\n collection.collect do |member|\n counter += 1\n options[:locals].merge!(object_name => member, \"#{object_name}_counter\".to_sym => counter)\n render_template(template_path, options.merge(:layout => false))\n end.join(\"\\n\")\n else\n if member = options.delete(:object)\n options[:locals].merge!(object_name => member)\n end\n render_template(template_path, options.merge(:layout => false))\n end\n end", "def get_partial_name( file, line )\n if line =~ /=\\s*render\\s*\\(?:partial\\s*=>\\s*[\"'](.*?)[\"']/\n path = $1\n\n if path.index( '/' )\n path = File.join( 'app/views', path )\n else\n path = File.join( File.dirname( file.path ), path )\n end\n\n path.gsub!( /([^\\/]+)$/, '_\\1')\n\n ( %w[erb rhtml rb haml] ).each do |ext|\n return \"#{path}.#{ext}\" if File.exists?( \"#{path}.#{ext}\" )\n return \"#{path}.html.#{ext}\" if File.exists?( \"#{path}.html.#{ext}\" )\n end\n end\n\n return nil\nend", "def __partial(source, data={})\n if source.kind_of?(Source)\n Undies::Template.new(source, data, @_undies_io)\n else\n @_undies_io.current.partial(source.to_s)\n end\n end", "def mcp_engines_render_partial (path, opts = {})\n dir, file = path.split('/')\n skip = opts.delete(:skip) || []\n skip = [skip] if skip.is_a? Symbol\n skip = [skip.to_sym] if skip.is_a? String\n c = ''\n APPLICATION_ENGINES.each do |engine|\n lookup_path = dir.eql?('layouts') ? \"#{dir}/#{engine[:name]}\" : \"#{engine[:name]}/#{dir}\"\n if not skip.include? engine[:name].to_sym and lookup_context.template_exists?(file, lookup_path, true)\n c = c + render(partial: \"#{lookup_path}/#{file}\", locals: opts[:locals])\n end\n end\n c.html_safe\n end", "def includes filename\n Waitress::Chef.include_file filename\n end", "def add_include include\n add_to @includes, include\n\n include\n end", "def partial(name, options={})\n path = \"com/\"+(params[:path].empty? ? ['index'] : params[:path]).join(\"/\") + \"/\"\n path = 'com' if name.starts_with?('/')\n \n render options.merge(:partial => \"#{RIGHTJS_SRC_DOCS}/#{path}#{name}.html.erb\")\n end", "def partial(template, *args)\n template_array = template.to_s.split('/')\n template = template_array[0..-2].join('/') + \"/_#{template_array[-1]}\"\n options = args.last.is_a?(Hash) ? args.pop : {}\n options.merge!(:layout => false)\n locals = options[:locals] || {}\n\n if (collection = options.delete(:collection))\n collection.inject([]) do |buffer, member|\n buffer << haml(:\"#{template}\",\n options.merge(:layout => false,\n :locals => {template_array[-1].to_sym => member}.merge(locals)))\n end.join(\"\\n\")\n else\n haml(:\"#{template}\", options)\n end\n end", "def partial(partial)\n partial_view = \"partials/_#{partial}\".to_sym\n erb partial_view, :layout => false\nend", "def respond_with_partial(layout_path: \"/layouts/_panel\")\n respond_to do |format|\n format.html do\n render template: partial_path, layout: layout_path\n end\n end\n end", "def render_element_head element\n render :partial => \"elements/partials/element_head\", :locals => {:element_head => element}\n end", "def include(*args)\n include_or_extend(:include, *args)\n end", "def nice_partials_locale_prefix_from_view_context_and_block(context, block)\n root_paths = context.view_renderer.lookup_context.view_paths.map(&:path)\n partial_location = block.source_location.first.dup\n root_paths.each { |path| partial_location.gsub!(/^#{path}\\//, '') }\n partial_location.split('.').first.gsub('/_', '/').gsub('/', '.')\nend", "def includes\n @mpc_project.recipe.get_relative_paths(@mpc_project.includes)\n end", "def partial?\n @partial ||= filename.start_with?(\"_\")\n end", "def include(mod)\n mod.included(self)\n end", "def partial_expand(actual_params)\n self.class.new(\n \"name\" => name,\n \"rel\" => rel,\n \"uri_template\" => partial_expand_uri_template(uri_template, actual_params),\n \"path_template\" => partial_expand_uri_template(path_template, actual_params),\n \"params\" => params - actual_params.keys,\n \"optional_params\" => optional_params - actual_params.keys,\n \"options\" => options,\n \"resource_templates\" => resource_templates.partial_expand(actual_params))\n end", "def partial(name)\n BaseController.render_partial(\"#{name}\")\n end", "def partial(file=nil, locals={})\n locals[:view_dir] = mailer_class.view_dir\n Doozer::MailerPartial.partial(file, locals)\n end", "def partial(template, *args)\n template_array = template.to_s.split('/')\n template = template_array[0..-2].join('/') + \"/_#{template_array[-1]}\"\n options = args.last.is_a?(Hash) ? args.pop : {}\n options.merge!(:layout => false)\n locals = options[:locals] || {}\n if collection = options.delete(:collection) then\n collection.inject([]) do |buffer, member|\n buffer << erb(:\"#{template}\", options.merge(:layout =>\n false, :locals => {template_array[-1].to_sym => member}.merge(locals)))\n end.join(\"\\n\")\n else\n erb(:\"#{template}\", options)\n end\n end", "def include(mod)\n mod.append_features(self)\n Rubinius.privately do\n mod.included self\n end\n self\n end", "def main_content\n do_include(@template)\n end", "def test_partial_override\n\t\tp = { '--properties' => '{\"title\" : \"Awesome Changelog Volume 43\" }'}\n\t\t\n\t\t#Generate the settings, using command line arguments p and the config file defined in c_props\n\t\tsettings = Core.generate_settings(p, @@c_props)\n\n\t\t#Extract the properties\n\t\tproperties = @@generator.to_liquid_properties(settings)\n\n\t\t#Render the template. At this point we just need to make sure that the property properties.title has been substituted\n\t\textra_template = '{{properties.title}} and {{properties.extra}}'\n\t\trender = @@generator.render_template(extra_template, properties)\n\n\t\texpected = 'Awesome Changelog Volume 43 and Extra Stuff'\n\t\tassert_equal(expected, render)\t\t\n\tend", "def include_from(path)\n mod = import(path, caller(1..1).first)\n add_module_methods(mod, self)\n add_module_constants(mod, self)\n end", "def render_extra_partials(f)\n @extension_partials.inject(\"\") do |extras, partial|\n extras += render :partial => partial, :locals => {:f => f}\n end\n end", "def require_relative(relative_feature)\n c = caller.first\n e = c.rindex(/:\\d+:in /)\n file = $`\n if /\\A\\((.*)\\)/ =~ file # eval, etc.\n raise LoadError, \"require_relative is called in #{$1}\"\n end\n absolute_path = File.expand_path(File.join(File.dirname(file),\n relative_feature))\n require absolute_path\nend", "def to_partial_path\n \"alchemy/site_layouts/#{partial_name}\"\n end", "def copy_partial\n copy_file \"app/views/shared/_disqus.html.haml\", \"app/views/shared/_disqus.html.haml\"\n end", "def partial_for(obj, partial, parent_directory)\n\t\ttmp = obj.class.to_s.split('::')\n\t\tklass_sym = tmp[-1] # e.g, 'OfferArtifact'\n\t\tcontract_sym = tmp[-2] # e.g, 'Bet'\n\t\tpath = nil\n\t\tif (parent_directory != '') then\n\t\t\tpath = \"contract_views/#{contract_sym.underscore}/#{parent_directory}/#{klass_sym.underscore}\"\n\t\t\t# e.g, contract_views/bet/artifacts/OfferArtifact\n\t\telse\n\t\t\tpath = \"contract_views/#{contract_sym.underscore}/\"\n\t\t\t# e.g, contract_views/bet/\n\t\tend\n\t\tFile.join(path, partial)\n\tend", "def include(*expected)\n Matchers::Include.new(*expected)\n end", "def add_includes out, includes\n add_extension_modules out, 'Includes', includes\n end", "def partial(name)\n @logger.debug( \"#{__method__} name=#{name}\" )\n get_partial( name )\n end", "def test_include(all,one)\n return expect(all).to include(one)\n end", "def test_include(all,one)\n return expect(all).to include(one)\n end" ]
[ "0.68579316", "0.6286506", "0.61970615", "0.61375266", "0.61279833", "0.60859585", "0.58853424", "0.5802644", "0.5724634", "0.57098573", "0.5702608", "0.56954813", "0.5687252", "0.5617213", "0.5612826", "0.5583607", "0.5576045", "0.55722475", "0.5568694", "0.55496705", "0.545506", "0.54434264", "0.5435629", "0.543412", "0.5433003", "0.54188406", "0.53892386", "0.5387618", "0.5374001", "0.5373924", "0.53509045", "0.5348574", "0.53141266", "0.53141266", "0.5301248", "0.52969706", "0.529361", "0.52755564", "0.5272866", "0.52474666", "0.5233377", "0.5231792", "0.5219003", "0.52183366", "0.5211936", "0.5202623", "0.5190955", "0.5190955", "0.5166385", "0.51537937", "0.51537937", "0.5152886", "0.5152886", "0.5152886", "0.5152886", "0.515173", "0.5131556", "0.5128922", "0.5119077", "0.5112552", "0.51075816", "0.5102755", "0.510056", "0.50938135", "0.505556", "0.50443053", "0.5029734", "0.5019761", "0.50071335", "0.5000526", "0.49963215", "0.499298", "0.49784032", "0.497239", "0.49647248", "0.4961644", "0.49608618", "0.49582362", "0.49550113", "0.49481657", "0.49433777", "0.4935443", "0.49279168", "0.4920855", "0.4918908", "0.48639598", "0.48620898", "0.48575586", "0.48571458", "0.48462692", "0.48435402", "0.4842735", "0.48341364", "0.48326376", "0.48322675", "0.48182467", "0.48159626", "0.4793582", "0.4793582" ]
0.7437805
1
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call +wait_for_page_to_load+.
def click locator command 'click', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click\n\tbegin\n\t @selenium.click(@locator)\n\trescue => e\n\t sleep(3)\n\t @selenium.click(@locator)\n\tend\n\n\tbegin\n\t @selenium.wait_for_page_to_load\n\trescue => e\n\t sleep(2)\n\t @selenium.wait_for_condition(\"selenium.browserbot.getCurrentWindow()\", TIMEOUT)\n\tend\n\t\n end", "def click_wait\n @webpage.click_wait(@locator)\n end", "def click\n @mech.click self\n end", "def click link\n case link\n when Page::Link then\n referer = link.page || current_page()\n if @agent.robots\n if (referer.is_a?(Page) and referer.parser.nofollow?) or\n link.rel?('nofollow') then\n raise RobotsDisallowedError.new(link.href)\n end\n end\n if link.noreferrer?\n href = @agent.resolve(link.href, link.page || current_page)\n referer = Page.new\n else\n href = link.href\n end\n get href, [], referer\n when String, Regexp then\n if real_link = page.link_with(:text => link)\n click real_link\n else\n button = nil\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n button = f.button_with(:value => link)\n button.is_a? Form::Submit\n end\n submit form, button if form\n end\n when Form::Submit, Form::ImageButton then\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n f.buttons.include?(link)\n end\n submit form, link if form\n else\n referer = current_page()\n href = link.respond_to?(:href) ? link.href :\n (link['href'] || link['src'])\n get href, [], referer\n end\n end", "def click_link(string)\n name_link(string).click\n wait_for_ajax\n end", "def click_and_wait(locator, wait_for = default_timeout)\n click locator\n assert_page_loaded(wait_for)\n end", "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "def click_and_wait(locator, wait_for = default_timeout)\n selenium.click locator\n wait_for_page_to_load(wait_for)\n end", "def click(xpath, options = {})\n rc = nil\n Log.Debug(:h4, \"[CLICK]\") {\n _check_repl_lock\n _compile_click xpath\n rc = exec\n Log.Debug \"do_click rc: #{rc.safe_s}\"\n unless rc == CLICKED\n # unable to click on element => total failure\n rc = false\n else\n # give the browser some time to get the navigation going\n sleep 0.5\n\n # we clicked!\n unless wait_page_load\n # page didn't seem to load properly\n rc = :clicked\n else\n # finding the element, clicking on it and waiting for the\n # page to load succeeded. if caller wants us to wait for\n # particular conditions, we'll do it, but the caller has to\n # figure out if those conditions were ultimately satisfied.\n rc = true\n get_url options if options[:wait_for]\n end\n end\n }\n Log.Debug \"{click} :=> #{rc.safe_s}\"\n rc\n end", "def click(link); end", "def click_batch_link\n wait_for_page_and_click batch_link\n end", "def click_act_as_link\n act_as_link.click\n sleep(10)\n end", "def wait_for_load_and_click(element)\n click_element(element, Utils.medium_wait)\n end", "def click(page, doc)\n js = doc[\"href\"] || doc[\"onclick\"]\n if js =~ /javascript:__doPostBack\\('(.*)','(.*)'\\)/\n event_target = $1\n event_argument = $2\n form = page.form_with(id: \"aspnetForm\")\n form[\"__EVENTTARGET\"] = event_target\n form[\"__EVENTARGUMENT\"] = event_argument\n form.submit\n elsif js =~ /return false;__doPostBack\\('(.*)','(.*)'\\)/\n nil\n else\n # TODO Just follow the link likes it's a normal link\n raise\n end\nend", "def click_link_with_href(href)\n find(:xpath, \"//a[@href='#{href}']\").click\n wait_for_turbolinks\n end", "def click_reports_link\n wait_for_page_and_click reports_link\n end", "def js_click(selector)\n find(selector) # wait for the page to contain the selector\n page.execute_script(\"$('#{selector}').click()\")\n\n # wait for triggered ajax requests to be finished\n steps = 0\n while page.evaluate_script('$.active').to_i > 0 and steps < 25\n sleep 0.1\n steps += 1\n end\n end", "def click_wait(locator)\n when_present(locator).click\n wait_js_inactive\n end", "def click_home\n wait_for_load_and_click home_link_element\n end", "def click_link_with_text(text)\n find(:xpath, \"//a[text()='#{text}']\").click\n wait_for_turbolinks\n end", "def click_on_link(selector)\n\n click_link(selector)\n\n end", "def wait_click_e(xpath)\n $browser.element(:xpath => xpath).wait_until(&:present?).click\nend", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def click_visible_link(locator)\n wait_randomly\n click_link(locator.to_s, match: :first, visible: true)\nrescue StandardError\n raise_with_new_message 'Unable to click on link'\nend", "def click_submit_button\n\t\tsubmit_button.click\n\tend", "def click_selenium_test1\n @session.click_link(@link_text)\n end", "def trigger_click_link(selector)\n find_link(selector).trigger(\"click\")\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def basic_click()\n scroll_to_visible\n @driver.sc_basic_click action_target, *action_locator_args\n stall :click\n end", "def click_term_list_link\n wait_for_page_and_click term_lists_link\n end", "def click_radiobutton(element)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n button = send(\"#{element}_element\")\n wait_until{button.enabled?}\n wait_until{button.visible?}\n\n send(\"select_#{element}\")\n end", "def link_account_click\n link_account_button.click\n end", "def click_web_link(text)\n\t\t@log.debug(\"Clicking web link #{text}\")\n\t\t\n\t\t@main_window.click(text)\n\tend", "def click\n assert_enabled\n clicked = false\n wait_until do\n @window.activate\n @window.active? &&\n UiaDll::control_click(search_information) &&\n clicked = true # is clicked at least once\n\n block_given? ? yield : clicked && !exist?\n end\n end", "def flash_and_ensure_click(dom_element)\n dom_element.wait_until(&:present?)\n dom_element.flash\n dom_element.click\nend", "def click_on_button(button_name)\r\n\r\n given_button = $browser.button(id: \"#{button_name}\")\r\n\r\n given_button.wait_until_present(2)\r\n\r\n given_button.click\r\n\r\n sleep(1)\r\n end", "def js_click\n href = node.attributes['onclick'].to_s.match(/location.href='(.*)'/)[1]\n full_uri = URI::HTTP.build({scheme: page.uri.scheme, host: page.uri.host, path: href})\n mech.get(full_uri)\n end", "def js_click(css_locator)\n page.execute_script(\"$('#{css_locator}').trigger('click')\")\n sleep settings.timeout_tiny\n end", "def click_approach_link\n click APPROACH_LINK\n end", "def click_wait(locator, sec, _arg = nil)\n click_on(locator)\n wait(sec)\n end", "def click_submit\n @chrome_driver.find_element(:name, SUBMIT_BUTTON).click\n sleep 2\n end", "def wait_for_page\n sleep 0.7\n end", "def wait_to_load\n activity_div.wait_until(&:exists?)\n @page = @bank_page.load_page\n end", "def clicks_link(link_text)\n link = links.detect { |el| el.innerHTML =~ /#{link_text}/i }\n return flunk(\"No link with text #{link_text.inspect} was found\") if link.nil?\n \n onclick = link.attributes[\"onclick\"]\n href = link.attributes[\"href\"]\n \n http_method = http_method_from_js(onclick)\n authenticity_token = authenticity_token_value(onclick)\n \n request_page(http_method, href, authenticity_token.blank? ? {} : {\"authenticity_token\" => authenticity_token})\n end", "def click_on_alink(link_id)\r\n\r\n link_using_id = get_link_using_id(link_id)\r\n\r\n link_using_id.click\r\n\r\n # With logout button, it is noted that click on it doesn't cause the\r\n # 'onclick' event to be automatically fired, so having to explicitly fire the event\r\n link_using_id.fire_event('onclick')\r\n\r\n sleep(1)\r\n\r\n end", "def click_xpath path\n wait { find_element(:xpath, path).click }\nend", "def click_on_assign_to\n @stream_post.find(input_elements[:result_more]).click\n @stream_post.find(input_elements[:result_more]).click unless @page.has_css?(input_elements[:assign_to])\n wait_for_css(input_elements[:assign_to])\n @page.find(input_elements[:assign_to]).click\n #@stream_post.find(input_elements[:assign_to]).click\n end", "def click_link_containing_text(text)\n find(:xpath, \"//a[contains(text(),'#{text}')]\").click\n wait_for_turbolinks\n end", "def clicks_get_link(link_text)\n link = find_link(link_text)\n link.click(:get)\n end", "def wait_for_submit(b)\n # 2. Wait for the submit button to be click-able\n wait = Selenium::WebDriver::Wait.new(:timeout => @metz.timeout)\n # wait.until {\n # driver.find_element(b.node)\n # }\n end", "def user_agreement\n self.user_agreement_link\n sleep 1\n #wait_for_ajax\n # New Class goes here.new @browser\n end", "def click_on_a_text_button_link(selector)\n\n click_on(selector)\n\n end", "def click_submit\n end", "def click_until(link_css, &block)\n raise ArgumentError if link_css.blank? || block.nil?\n\n begin\n Timeout::timeout(10) do\n until block.call\n find(link_css).click\n sleep 0.1\n end\n end\n rescue Timeout::Error\n fail \"'#{text}' did not appear in page source within 10 seconds\"\n end\n end", "def click(selector)\n if selector.is_a? String\n find(selector).click\n else\n selector.click\n end\n end", "def submit_search\n @page.click_button('searchButton')\n end", "def click_become_user_link_element(user)\n logger.debug \"Become user #{user.uid}\"\n wait_for_load_and_click(become_user_link_element user)\n end", "def click_on_link(text, scroll_to=false)\n if has_css?(\"a\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"a\"\n elsif has_css?(\"span\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"span\"\n elsif has_css?(\"label\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"label\"\n else\n raise Capybara::ElementNotFound.new(\"Can't find link with '#{text}' text\")\n end\n\n if scroll_to\n js_scroll_script = \"arguments[0].scrollIntoView(true);\"\n Capybara.page.execute_script(js_scroll_script, find(link_type, text: text, match: :prefer_exact))\n sleep 0.5\n end\n\n find(link_type, text: text, match: :prefer_exact).click\n end", "def click(locator, opts = {}, &block)\n actions << lambda {\n path = find_link(locator, opts)[:href] rescue nil\n raise SpiderCore::ClickPathNotFound, \"#{locator} not found\" if path.nil?\n if block_given?\n spider = self.spawn\n spider.entrance(path)\n spider.learn(&block)\n current_location[:click] ||= []\n current_location[:click] << spider.crawl[:results]\n else\n visit(path)\n end\n }\n end", "def test_click_base\n page = @mech.get(\"http://google.com/tc_base_link.html\")\n page = page.links.first.click\n assert @mech.visited?(\"http://localhost/index.html\")\n end", "def click_first_loan_link\n find(:xpath, ta(@first_loan_ta, @first_loan_il)).click\n end", "def click(type, query)\n browser.send(type, query).click\n end", "def visit url\n @agent.get url\n @agent.page.form&.submit\n end", "def select!\n raise \"Locator at #{locator} is not visible\" unless visible?\n begin\n wd_element.click\n rescue\n raise \"Locator at #{locator} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def click_button\n find(:css, 'button.button-blue',wait:10).click\n $tim = Time.now\n end", "def click_link_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, link_prop, link_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).link(link_prop.intern, /#{link_prop_val}/).click_no_wait\nend", "def click_result(unique_identifier)\n wait_for_results\n wait_for_page_and_click result_row(unique_identifier)\n end", "def prepare_to_click_button_in_popup(button = \"OK\", wait_time = 3)\n # !@web_browser.is_firefox?\n # TODO: firefox is OK\n if RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/ then\n start_checking_js_dialog(button, wait_time)\n else\n raise \"this only support on Windows and on IE\"\n end\n end", "def open_and_wait( location)\n selenium.open(location)\n wait_for_page_to_load\n end", "def show_read\n find('#show-read').click\n\n # Ensure entries have finished loading\n expect(page).to have_no_css 'div#loading'\nend", "def custom_click(selector)\n selector.click\nrescue Capybara::Poltergeist::MouseEventFailed\n selector.trigger('click')\nend", "def click_button(value = nil)\n find_button(value).click\n end", "def click_to_submit_search_button\n click('Click to submit search button', @driver.find_element(:xpath, SUBMIT_BUTTON))\n end", "def click(div_id)\n page.find_by_id(div_id).click\n rescue Capybara::Webkit::ClickFailed\n page.execute_script \"$('##{div_id}').click()\"\n end", "def click_element(opt = {})\n search_element(opt) if opt != {}\n # click @element_id\n url=@session_url + \"/element/#{@element_id}/click\"\n click=post(url,'')\n return click\n end", "def click(locator)\n wait_for do\n begin\n element = find_element(locator)\n element.enabled? && element.click.nil?\n rescue Selenium::WebDriver::Error::ElementClickInterceptedError\n false\n end\n end\n end", "def click_search\n search_button.click\n end", "def click(driver = $focus_driver)\r\n begin\r\n driver.find_element(self).click\r\n Log.info(\"Element clicked #{self.how} => #{self.what}\")\r\n rescue StandardError => e\r\n Log.fail(\"Element not clicked #{self.how} => #{self.what}\" + e.message)\r\n end\r\n end", "def click_element (element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if internally\n script = <<-JS\n arguments[0].click();\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n select.click\n end\n end", "def clickPeopleLink()\n sleep(5)\n @driver.find_element(:xpath, \"//*[@id='main-content']/nav/div[2]/div/a[3]\").click\n wait = Selenium::WebDriver::Wait.new(:timeout => 10)\n wait.until { @driver.find_element(:id => \"attendees\").displayed? }\n end", "def search_for_proffesional()\r\n @search_dropdown.is_element_present_with_wait?()\r\n @search_dropdown.click()\r\n end", "def continue_shopping\n self.lnkContinueShopping_element.when_present(30).click\n end", "def select!\n raise \"Locator at #{location} is not visible\" unless visible?\n begin\n el.click\n rescue\n raise \"Locator at #{location} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def click_create_new_admission_button\n click \"//input[@name='action' and @value='Create New Admission']\", :wait_for => :page\n sleep 2\n if is_element_present(\"successMessages\")\n get_text(\"successMessages\")\n else\n get_text(\"errorMessages\")\n end\n end", "def wait_for_update_and_click(element)\n click_element(element, Utils.short_wait)\n end", "def link_click(ele)\n ref=$array[\"#{ele}\"]\n path=ele.split(\"_\").last\n $log.info \"verifying the #{ele} present or not \"\n if $browser.link(:\"#{path}\", \"#{ref}\").exists?\n $log.info \"#{ele} is prsented on the webpage\"\n $browser.link(:\"#{path}\", \"#{ref}\").click\n $log.info \"clicked the #{ele} link\"\n\n elsif $browser.span(:\"#{path}\", \"#{ref}\").exists?\n $log.info \"{ele} is presented on the webpage\"\n $browser..span(:\"#{path}\", \"#{ref}\").click\n $log.info \"clicked the #{ele}\"\n else\n $log.info \"failed to find the #{ele} link\"\n raise(\"failed to find the #{ele} link\") \n end\n \n \nend", "def wait_for_load_and_click_js(element)\n click_element_js(element, Utils.medium_wait)\n end", "def click_on_change_tags\n @page.find(input_elements[:result_more]).click\n wait_for_css(input_elements[:change_tags])\n @page.find(input_elements[:change_tags]).click\n end", "def js_click(locator)\n execute_script('arguments[0].click();', find_element(locator))\n end", "def click_visible_button(locator)\n wait_randomly\n click_button(locator.to_s, match: :first, visible: true)\nrescue StandardError\n raise_with_new_message 'Unable to click on button'\nend", "def wait_page_load\n @browser.wait_for_load\n end", "def navigate_to_specialtypizza\n\torder_online_page\n\tselecting_delivery_store\n\tfind(\".navigation-Pizza\").click\nend", "def wait_for_element_and_click(element)\n wait_for_element(element)\n \n i = 0\n begin\n @element.click\n rescue Exception => ex\n i+=1\n sleep(1)\n retry if i<20\n raise ex \n end\n \n end", "def wait_for_page_to_load(page)\n Logbook.message(\"Waiting for page #{page} to load...\")\n wait_for do\n @browser.execute_script(\"return document.querySelector('link[rel=\\\"icon\\\"]') !== null\")\n end\n end", "def click_on(locator)\n Logbook.message(\"Click on the element with locator #{locator}\")\n find(locator).click\n end", "def click_submit_button\n @driver.find_element(xpath: @submit_button).click\n end", "def continue_button\n\tfind(\".btn--large\").click\nend", "def wait_for_page_and_verify_text(text)\n @selenium.wait_for_page_to_load(120000)\n check_page_and_verify_text(text)\n end", "def submit_search\n click SEARCH_SUBMIT_BUTTON\n end", "def click_on_predict_main_link\n\n click_on PREDICT_MAIN_LINK\n sleep(THREAD_SLEEP_2)\n\n end", "def download_account(b)\n b.link(text: /Asset Management/).when_present.click\n b.button(text: 'Export').when_present.click\nend" ]
[ "0.69821095", "0.69451565", "0.67499757", "0.6737292", "0.6681251", "0.6659841", "0.66534156", "0.66018605", "0.6596637", "0.65921646", "0.6462643", "0.64394325", "0.63739634", "0.6367312", "0.6353962", "0.6342224", "0.6320168", "0.6247299", "0.62356454", "0.61320055", "0.61025405", "0.60892475", "0.5997761", "0.59714675", "0.59705585", "0.596102", "0.59117526", "0.58887553", "0.5877608", "0.587264", "0.586038", "0.5846504", "0.58320504", "0.5825369", "0.5821418", "0.58091885", "0.57709384", "0.57531995", "0.57262504", "0.57136625", "0.56975645", "0.5684657", "0.56761986", "0.5647073", "0.5643967", "0.5632057", "0.56277287", "0.5614568", "0.56124043", "0.5610005", "0.5603624", "0.56031185", "0.5567962", "0.5563784", "0.5560884", "0.5559388", "0.55587226", "0.5557154", "0.55556643", "0.5544426", "0.5540496", "0.55403364", "0.55134624", "0.5513224", "0.5506267", "0.55023676", "0.5494748", "0.5489191", "0.54849", "0.54757243", "0.5475179", "0.5454719", "0.54493165", "0.5448288", "0.5447705", "0.54469717", "0.54446805", "0.54413587", "0.5436421", "0.5428251", "0.5417001", "0.5404978", "0.54041225", "0.5392181", "0.53892446", "0.538312", "0.5382254", "0.5380145", "0.53783464", "0.5377749", "0.5374185", "0.53738064", "0.5371178", "0.53630656", "0.53622776", "0.53620064", "0.5359717", "0.53571403", "0.53498685", "0.5343713", "0.53220415" ]
0.0
-1
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call wait_for_page_to_load.
def click_at locator, coord_string command 'clickAt', locator, coord_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click\n\tbegin\n\t @selenium.click(@locator)\n\trescue => e\n\t sleep(3)\n\t @selenium.click(@locator)\n\tend\n\n\tbegin\n\t @selenium.wait_for_page_to_load\n\trescue => e\n\t sleep(2)\n\t @selenium.wait_for_condition(\"selenium.browserbot.getCurrentWindow()\", TIMEOUT)\n\tend\n\t\n end", "def click link\n case link\n when Page::Link then\n referer = link.page || current_page()\n if @agent.robots\n if (referer.is_a?(Page) and referer.parser.nofollow?) or\n link.rel?('nofollow') then\n raise RobotsDisallowedError.new(link.href)\n end\n end\n if link.noreferrer?\n href = @agent.resolve(link.href, link.page || current_page)\n referer = Page.new\n else\n href = link.href\n end\n get href, [], referer\n when String, Regexp then\n if real_link = page.link_with(:text => link)\n click real_link\n else\n button = nil\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n button = f.button_with(:value => link)\n button.is_a? Form::Submit\n end\n submit form, button if form\n end\n when Form::Submit, Form::ImageButton then\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n f.buttons.include?(link)\n end\n submit form, link if form\n else\n referer = current_page()\n href = link.respond_to?(:href) ? link.href :\n (link['href'] || link['src'])\n get href, [], referer\n end\n end", "def click\n @mech.click self\n end", "def click_wait\n @webpage.click_wait(@locator)\n end", "def click(link); end", "def click(xpath, options = {})\n rc = nil\n Log.Debug(:h4, \"[CLICK]\") {\n _check_repl_lock\n _compile_click xpath\n rc = exec\n Log.Debug \"do_click rc: #{rc.safe_s}\"\n unless rc == CLICKED\n # unable to click on element => total failure\n rc = false\n else\n # give the browser some time to get the navigation going\n sleep 0.5\n\n # we clicked!\n unless wait_page_load\n # page didn't seem to load properly\n rc = :clicked\n else\n # finding the element, clicking on it and waiting for the\n # page to load succeeded. if caller wants us to wait for\n # particular conditions, we'll do it, but the caller has to\n # figure out if those conditions were ultimately satisfied.\n rc = true\n get_url options if options[:wait_for]\n end\n end\n }\n Log.Debug \"{click} :=> #{rc.safe_s}\"\n rc\n end", "def click_act_as_link\n act_as_link.click\n sleep(10)\n end", "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "def click_link(string)\n name_link(string).click\n wait_for_ajax\n end", "def click_batch_link\n wait_for_page_and_click batch_link\n end", "def click_and_wait(locator, wait_for = default_timeout)\n selenium.click locator\n wait_for_page_to_load(wait_for)\n end", "def click_link_with_href(href)\n find(:xpath, \"//a[@href='#{href}']\").click\n wait_for_turbolinks\n end", "def click_and_wait(locator, wait_for = default_timeout)\n click locator\n assert_page_loaded(wait_for)\n end", "def click(page, doc)\n js = doc[\"href\"] || doc[\"onclick\"]\n if js =~ /javascript:__doPostBack\\('(.*)','(.*)'\\)/\n event_target = $1\n event_argument = $2\n form = page.form_with(id: \"aspnetForm\")\n form[\"__EVENTTARGET\"] = event_target\n form[\"__EVENTARGUMENT\"] = event_argument\n form.submit\n elsif js =~ /return false;__doPostBack\\('(.*)','(.*)'\\)/\n nil\n else\n # TODO Just follow the link likes it's a normal link\n raise\n end\nend", "def click_reports_link\n wait_for_page_and_click reports_link\n end", "def click_on_link(selector)\n\n click_link(selector)\n\n end", "def wait_for_load_and_click(element)\n click_element(element, Utils.medium_wait)\n end", "def click_home\n wait_for_load_and_click home_link_element\n end", "def js_click(selector)\n find(selector) # wait for the page to contain the selector\n page.execute_script(\"$('#{selector}').click()\")\n\n # wait for triggered ajax requests to be finished\n steps = 0\n while page.evaluate_script('$.active').to_i > 0 and steps < 25\n sleep 0.1\n steps += 1\n end\n end", "def click_selenium_test1\n @session.click_link(@link_text)\n end", "def click_link_with_text(text)\n find(:xpath, \"//a[text()='#{text}']\").click\n wait_for_turbolinks\n end", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def basic_click()\n scroll_to_visible\n @driver.sc_basic_click action_target, *action_locator_args\n stall :click\n end", "def trigger_click_link(selector)\n find_link(selector).trigger(\"click\")\n end", "def click_wait(locator)\n when_present(locator).click\n wait_js_inactive\n end", "def link_account_click\n link_account_button.click\n end", "def click_submit_button\n\t\tsubmit_button.click\n\tend", "def click_web_link(text)\n\t\t@log.debug(\"Clicking web link #{text}\")\n\t\t\n\t\t@main_window.click(text)\n\tend", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def click_visible_link(locator)\n wait_randomly\n click_link(locator.to_s, match: :first, visible: true)\nrescue StandardError\n raise_with_new_message 'Unable to click on link'\nend", "def wait_click_e(xpath)\n $browser.element(:xpath => xpath).wait_until(&:present?).click\nend", "def click_radiobutton(element)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n button = send(\"#{element}_element\")\n wait_until{button.enabled?}\n wait_until{button.visible?}\n\n send(\"select_#{element}\")\n end", "def click_on_alink(link_id)\r\n\r\n link_using_id = get_link_using_id(link_id)\r\n\r\n link_using_id.click\r\n\r\n # With logout button, it is noted that click on it doesn't cause the\r\n # 'onclick' event to be automatically fired, so having to explicitly fire the event\r\n link_using_id.fire_event('onclick')\r\n\r\n sleep(1)\r\n\r\n end", "def click_approach_link\n click APPROACH_LINK\n end", "def click_on_button(button_name)\r\n\r\n given_button = $browser.button(id: \"#{button_name}\")\r\n\r\n given_button.wait_until_present(2)\r\n\r\n given_button.click\r\n\r\n sleep(1)\r\n end", "def click_term_list_link\n wait_for_page_and_click term_lists_link\n end", "def click\n assert_enabled\n clicked = false\n wait_until do\n @window.activate\n @window.active? &&\n UiaDll::control_click(search_information) &&\n clicked = true # is clicked at least once\n\n block_given? ? yield : clicked && !exist?\n end\n end", "def click_first_loan_link\n find(:xpath, ta(@first_loan_ta, @first_loan_il)).click\n end", "def js_click(css_locator)\n page.execute_script(\"$('#{css_locator}').trigger('click')\")\n sleep settings.timeout_tiny\n end", "def click_on_a_text_button_link(selector)\n\n click_on(selector)\n\n end", "def click_on_link(text, scroll_to=false)\n if has_css?(\"a\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"a\"\n elsif has_css?(\"span\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"span\"\n elsif has_css?(\"label\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"label\"\n else\n raise Capybara::ElementNotFound.new(\"Can't find link with '#{text}' text\")\n end\n\n if scroll_to\n js_scroll_script = \"arguments[0].scrollIntoView(true);\"\n Capybara.page.execute_script(js_scroll_script, find(link_type, text: text, match: :prefer_exact))\n sleep 0.5\n end\n\n find(link_type, text: text, match: :prefer_exact).click\n end", "def click(selector)\n if selector.is_a? String\n find(selector).click\n else\n selector.click\n end\n end", "def click_on_assign_to\n @stream_post.find(input_elements[:result_more]).click\n @stream_post.find(input_elements[:result_more]).click unless @page.has_css?(input_elements[:assign_to])\n wait_for_css(input_elements[:assign_to])\n @page.find(input_elements[:assign_to]).click\n #@stream_post.find(input_elements[:assign_to]).click\n end", "def click_submit\n @chrome_driver.find_element(:name, SUBMIT_BUTTON).click\n sleep 2\n end", "def js_click\n href = node.attributes['onclick'].to_s.match(/location.href='(.*)'/)[1]\n full_uri = URI::HTTP.build({scheme: page.uri.scheme, host: page.uri.host, path: href})\n mech.get(full_uri)\n end", "def click(locator, opts = {}, &block)\n actions << lambda {\n path = find_link(locator, opts)[:href] rescue nil\n raise SpiderCore::ClickPathNotFound, \"#{locator} not found\" if path.nil?\n if block_given?\n spider = self.spawn\n spider.entrance(path)\n spider.learn(&block)\n current_location[:click] ||= []\n current_location[:click] << spider.crawl[:results]\n else\n visit(path)\n end\n }\n end", "def clicks_link(link_text)\n link = links.detect { |el| el.innerHTML =~ /#{link_text}/i }\n return flunk(\"No link with text #{link_text.inspect} was found\") if link.nil?\n \n onclick = link.attributes[\"onclick\"]\n href = link.attributes[\"href\"]\n \n http_method = http_method_from_js(onclick)\n authenticity_token = authenticity_token_value(onclick)\n \n request_page(http_method, href, authenticity_token.blank? ? {} : {\"authenticity_token\" => authenticity_token})\n end", "def click(driver = $focus_driver)\r\n begin\r\n driver.find_element(self).click\r\n Log.info(\"Element clicked #{self.how} => #{self.what}\")\r\n rescue StandardError => e\r\n Log.fail(\"Element not clicked #{self.how} => #{self.what}\" + e.message)\r\n end\r\n end", "def click_become_user_link_element(user)\n logger.debug \"Become user #{user.uid}\"\n wait_for_load_and_click(become_user_link_element user)\n end", "def clicks_get_link(link_text)\n link = find_link(link_text)\n link.click(:get)\n end", "def flash_and_ensure_click(dom_element)\n dom_element.wait_until(&:present?)\n dom_element.flash\n dom_element.click\nend", "def click_link_containing_text(text)\n find(:xpath, \"//a[contains(text(),'#{text}')]\").click\n wait_for_turbolinks\n end", "def click_xpath path\n wait { find_element(:xpath, path).click }\nend", "def click(type, query)\n browser.send(type, query).click\n end", "def click_element(opt = {})\n search_element(opt) if opt != {}\n # click @element_id\n url=@session_url + \"/element/#{@element_id}/click\"\n click=post(url,'')\n return click\n end", "def continue_shopping\n self.lnkContinueShopping_element.when_present(30).click\n end", "def click_button(value = nil)\n find_button(value).click\n end", "def click_submit\n end", "def continue_button\n\tfind(\".btn--large\").click\nend", "def click_wait(locator, sec, _arg = nil)\n click_on(locator)\n wait(sec)\n end", "def select!\n raise \"Locator at #{locator} is not visible\" unless visible?\n begin\n wd_element.click\n rescue\n raise \"Locator at #{locator} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def click_to_submit_search_button\n click('Click to submit search button', @driver.find_element(:xpath, SUBMIT_BUTTON))\n end", "def custom_click(selector)\n selector.click\nrescue Capybara::Poltergeist::MouseEventFailed\n selector.trigger('click')\nend", "def click_button\n find(:css, 'button.button-blue',wait:10).click\n $tim = Time.now\n end", "def clickPeopleLink()\n sleep(5)\n @driver.find_element(:xpath, \"//*[@id='main-content']/nav/div[2]/div/a[3]\").click\n wait = Selenium::WebDriver::Wait.new(:timeout => 10)\n wait.until { @driver.find_element(:id => \"attendees\").displayed? }\n end", "def click_on(locator)\n Logbook.message(\"Click on the element with locator #{locator}\")\n find(locator).click\n end", "def js_click(locator)\n execute_script('arguments[0].click();', find_element(locator))\n end", "def click_on_change_tags\n @page.find(input_elements[:result_more]).click\n wait_for_css(input_elements[:change_tags])\n @page.find(input_elements[:change_tags]).click\n end", "def submit_search\n @page.click_button('searchButton')\n end", "def click_element (element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if internally\n script = <<-JS\n arguments[0].click();\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n select.click\n end\n end", "def click_submit_button\n @driver.find_element(xpath: @submit_button).click\n end", "def click(locator)\n wait_for do\n begin\n element = find_element(locator)\n element.enabled? && element.click.nil?\n rescue Selenium::WebDriver::Error::ElementClickInterceptedError\n false\n end\n end\n end", "def click_search\n search_button.click\n end", "def link_click(ele)\n ref=$array[\"#{ele}\"]\n path=ele.split(\"_\").last\n $log.info \"verifying the #{ele} present or not \"\n if $browser.link(:\"#{path}\", \"#{ref}\").exists?\n $log.info \"#{ele} is prsented on the webpage\"\n $browser.link(:\"#{path}\", \"#{ref}\").click\n $log.info \"clicked the #{ele} link\"\n\n elsif $browser.span(:\"#{path}\", \"#{ref}\").exists?\n $log.info \"{ele} is presented on the webpage\"\n $browser..span(:\"#{path}\", \"#{ref}\").click\n $log.info \"clicked the #{ele}\"\n else\n $log.info \"failed to find the #{ele} link\"\n raise(\"failed to find the #{ele} link\") \n end\n \n \nend", "def follow(link_text)\n Praline::browser.find_element(:link, link_text).click\n end", "def click(div_id)\n page.find_by_id(div_id).click\n rescue Capybara::Webkit::ClickFailed\n page.execute_script \"$('##{div_id}').click()\"\n end", "def click_link_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, link_prop, link_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).link(link_prop.intern, /#{link_prop_val}/).click_no_wait\nend", "def navigate_to_specialtypizza\n\torder_online_page\n\tselecting_delivery_store\n\tfind(\".navigation-Pizza\").click\nend", "def click_result(unique_identifier)\n wait_for_results\n wait_for_page_and_click result_row(unique_identifier)\n end", "def click\n `#{@el}.click() || Opal.nil`\n end", "def click; end", "def click; end", "def click; end", "def click_until(link_css, &block)\n raise ArgumentError if link_css.blank? || block.nil?\n\n begin\n Timeout::timeout(10) do\n until block.call\n find(link_css).click\n sleep 0.1\n end\n end\n rescue Timeout::Error\n fail \"'#{text}' did not appear in page source within 10 seconds\"\n end\n end", "def click_on_predict_main_link\n\n click_on PREDICT_MAIN_LINK\n sleep(THREAD_SLEEP_2)\n\n end", "def click\n raise \"Must implement custom click method.\"\n end", "def click_button(button_name, button_index: nil)\n #The button maybe a link that looks like a button - we want to handle both\n if button_index\n button = Element.new(\"Clicking #{button_name} button (#{button_index})\", :xpath, \"(//button[contains(., \\\"#{button_name}\\\")])[#{button_index}]\")\n else\n button = Element.new(\"Clicking #{button_name} button\", :xpath, \"//button[contains(., \\\"#{button_name}\\\")]\")\n end\n begin\n button.click\n rescue Exception => exception\n Log.debug(\"[GRIDIUM::Page] Button not found and this exception was rescued: #{exception} Attempting Link - speed up test by using click_link method if this works...\")\n click_link button_name, link_index: button_index\n end\n end", "def user_agreement\n self.user_agreement_link\n sleep 1\n #wait_for_ajax\n # New Class goes here.new @browser\n end", "def clicks_button(value = nil)\n button = nil\n \n forms.each do |form|\n button = form.find_button(value)\n break if button\n end\n\n flunk(\"Could not find button #{value.inspect}\") if button.nil?\n button.click\n end", "def activate_tab_with_click\n click\n \n # No event yet so just cheat and sleep\n sleep(0.1);\n end", "def click_create_new_admission_button\n click \"//input[@name='action' and @value='Create New Admission']\", :wait_for => :page\n sleep 2\n if is_element_present(\"successMessages\")\n get_text(\"successMessages\")\n else\n get_text(\"errorMessages\")\n end\n end", "def test_click_base\n page = @mech.get(\"http://google.com/tc_base_link.html\")\n page = page.links.first.click\n assert @mech.visited?(\"http://localhost/index.html\")\n end", "def click_radio_button(button)\n append_to_script \"click_radio_button \\\"#{button}\\\"\"\n end", "def click\n `#@native.click()`\n end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def navigate_to_link(link_name)\n find_link(link_name).click\n end", "def select!\n raise \"Locator at #{location} is not visible\" unless visible?\n begin\n el.click\n rescue\n raise \"Locator at #{location} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def perform_action action_name, *args\n raise \"No such action #{action_name} defined for current page\" if !@current_page[:page_data].user_data['actions'].has_key?(action_name)\n # override locator from config file if needed\n if args[0].is_a?(Hash) and args[0].has_key?('locator')\n locator = args[0]['locator']\n else\n locator = @current_page[:page_data].user_data['actions'][action_name]['locator']\n end\n # search the entire dom or just under the current element\n if args[0].is_a?(Hash) and args[0].has_key?('root_search')\n dom = args[0]['root_search'].eql?(true) ? @driver : @element\n else\n dom = @driver\n end\n # perform the search\n @element = dom.find_element(locator)\n # json contains only a predefined set of instructions\n if action_name.include?('click')\n @element.click\n elsif action_name.include?('type')\n @element.send_keys args[0]\n elsif action_name.include?('submit')\n @element.submit\n elsif action_name.include?('inspect')\n @element\n else\n raise \"Don't know how to perform this action\"\n end\n # wait for a specific element or page to be present after the action\n wait_and_update @current_page[:page_data].user_data['actions'][action_name]['wait']\n end", "def doubleClick\n\t@selenium.double_click(@locator)\n end", "def click_asset_library_link(driver)\n driver.switch_to.default_content\n WebDriverUtils.wait_for_element_and_click asset_library_link_element\n current_url\n end", "def select_link (linktext)\n\t\t@link = @browser.link :text => linktext\n\t\t@link.click\n\tend" ]
[ "0.6902581", "0.6847484", "0.68288517", "0.67822367", "0.66871935", "0.66806656", "0.6621515", "0.6600374", "0.65989035", "0.64404273", "0.6402006", "0.6396098", "0.6364666", "0.6359558", "0.6242625", "0.62425977", "0.621873", "0.62060416", "0.61963314", "0.61458576", "0.61406", "0.6125811", "0.6109278", "0.6061985", "0.60399944", "0.6036502", "0.59486496", "0.5918542", "0.5916844", "0.58572656", "0.58428234", "0.58388215", "0.58181053", "0.580125", "0.5796739", "0.5791777", "0.5783505", "0.5777779", "0.5775953", "0.57638985", "0.57406497", "0.5734132", "0.5720545", "0.5703106", "0.56993306", "0.5693912", "0.5664287", "0.5659068", "0.5654364", "0.5610034", "0.5609274", "0.5605114", "0.55990463", "0.55889714", "0.55876344", "0.5575757", "0.55492276", "0.5532469", "0.5528063", "0.5521393", "0.5520153", "0.55197495", "0.5510811", "0.55084944", "0.5501318", "0.54935324", "0.5487887", "0.548503", "0.5477569", "0.5460562", "0.54558927", "0.5453378", "0.5451617", "0.5451269", "0.5449106", "0.5445692", "0.5441747", "0.54412997", "0.54249614", "0.54239714", "0.5422177", "0.5422177", "0.5422177", "0.54195607", "0.5415583", "0.53946906", "0.5390539", "0.5370717", "0.53703976", "0.5367616", "0.5366902", "0.536678", "0.53657556", "0.53647643", "0.5352228", "0.5352057", "0.53487796", "0.53462535", "0.53419244", "0.5339413", "0.53385264" ]
0.0
-1
Explicitly simulate an event (e.g. "focus", "blur"), to trigger the corresponding "on_event_" handler.
def fire_event locator, event_name command 'fireEvent', locator, event_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trigger(owner, event, *args); end", "def trigger(node, event)\n Capybara.current_session.execute_script(\"arguments[0].#{event}()\", node)\n end", "def on event,&b\n @element.set \"on#{event}\",&b\n end", "def trigger_event(eventSymbol, *args)\n engine.send(eventSymbol, *args)\n end", "def trigger_event(event)\n event.watch(self) if can_trigged?(event)\n end", "def trigger(event, *params, &block)\n catch :return do\n return_value = nil\n __handlers[event.to_sym].each do |handler|\n return_value = handler.call(*params, &block)\n end\n return_value\n end\n end", "def on(event, &handler)\n # TODO raise error (for the time being)?\n end", "def fire evt, can_bubble = true, cancellable = true, &b\n evt_type = \"Event\"\n \n types = {\n :focus => \"UIEvent\",\n :blur => \"UIEvent\",\n :keyup => \"KeyboardEvent\",\n :keydown => \"KeyboardEvent\",\n :click => \"MouseEvent\",\n :mousedown => \"MouseEvent\",\n :mouseup => \"MouseEvent\"\n }\n \n if h=types[evt.to_sym]\n evt_type = h\n end\n \n each do |q|\n e = q.get_owner_document.create_event(evt_type)\n \n if b\n b.call(e)\n end\n \n e.init_event evt.to_s, can_bubble, cancellable\n q.dispatch_event(e)\n end\n \n self\n end", "def on(event, &handler)\n # TODO raise error?\n end", "def fire_event(type, query, event = :click)\n browser.send(type, query).fire_event event\n end", "def on_event(event_name=:__default__, &block)\n event_handler.register( event_name, &block )\n end", "def trigger(locator, event)\n execute_script(%(\n var element = arguments[0];\n var eventName = arguments[1];\n var event = new Event(eventName, {\"bubbles\": false, \"cancelable\": false});\n element.dispatchEvent(event);\n ), find_element(locator), event)\n end", "def trigger_function(type)\n case type\n when \"onClick\" then \"click\"\n when \"onChange\" then \"change\"\n when \"onFocus\" then \"focus\"\n when \"onFocusOut\" then \"blur\"\n else fail \"Undefined trigger function!\"\n end\n end", "def trigger(event_name, payload = {})\n handlers.each do |handler|\n next unless handler.respond_to?(:trigger)\n\n handler.trigger(self, event_name, payload)\n end\n end", "def call event\n fire(event)\n end", "def trigger(event)\n if @events.include? event\n @triggered << event\n catch(:transition) do\n @events[event].each { |block| instance_eval(&block) }\n nil\n end\n else\n raise NameError, \"No such event: #{event}\"\n end\n end", "def trigger(event)\n if @events.include? event\n @triggered << event\n catch(:transition) do\n @events[event].each { |block| instance_eval(&block) }\n nil\n end\n else\n raise NameError, \"No such event: #{event}\"\n end\n end", "def fire_event(name)\n @_node.fireEvent(name)\n end", "def fire_events!(*events); end", "def fire_action_event\n require 'canis/core/include/ractionevent'\n fire_handler :PRESS, ActionEvent.new(self, :PRESS, text)\n end", "def on(event, options = {}, &block)\n event = event.to_sym\n @event_handlers[event] ||= []\n @event_handlers[event] << Handler.new(event, options, &block)\n true\n end", "def fire(event_type, data={})\n event_for(event_type, self, data).bubble!\n end", "def fire_event(event)\n blocks = FastlyNsq.events.fetch(event)\n blocks.each do |block|\n block.call\n rescue => e\n logger.error \"[#{event}] #{e.inspect}\"\n end\n end", "def trigger(event, payload={})\n broadcast(false, \"triggered.event\", { event: event, payload: payload })\n broadcast(true, event, payload)\n end", "def trigger(side, event, *args)\n self.class.hooks[:\"#{ side }_#{ event }\"].each do |method_name|\n if method(method_name).arity.zero?\n __send__(method_name)\n else\n __send__(method_name, *args)\n end\n end\n\n nil\n end", "def dispatch_event(type: event_type, with_data: data, token: nil)\n # This wierd Object include check has to do with Ruby's odd main/top level behaviours\n # We are basically just checking that the method was defined in this file\n if(type && Object.private_instance_methods.include?(type.to_sym))\n send(type.to_sym, with_data, token: token)\n else\n logger.info \"Did not find a handler for event type '#{type}'\"\n empty_response\n end\nend", "def on(event, proc = nil, &block)\n cmd = get_command proc, &block\n root.bind(event) { cmd.call }\n end", "def respond_to_event(type, options)\n options[:once] = true if options[:once].nil?\n \n handler_opts = {}\n handler_opts[:widget_id] = options[:on] || self.name\n handler_opts[:state] = options[:with]\n \n handler = InvokeEventHandler.new(handler_opts)\n \n return if options[:once] and event_table.all_handlers_for(type, options[:from]).include?(handler)\n \n on(type, :do => handler, :from => options[:from])\n end", "def call\n catch_event unless no_event_possible?\n end", "def fire(event_name)\n\t\t\tcallback = @events[event_name]\n\t\t\t\n\t\t\tif callback\n\t\t\t\tcallback.call(self)\n\t\t\tend\n\t\tend", "def handle_event(event)\n\n\t\tend", "def fire_handler event, object\n $log.debug \"inside def fire_handler evt:#{event}, o: #{object.class}\"\n if !@handler.nil?\n if @_events\n raise ArgumentError, \"fire_handler: #{self.class} does not support this event: #{event}. #{@_events} \" if !event? event\n else\n $log.debug \"bIND #{self.class} XXXXX TEMPO no events defined in @_events \"\n end\n ablk = @handler[event]\n if !ablk.nil?\n aeve = @event_args[event]\n ablk.each_with_index do |blk, ix|\n #$log.debug \"#{self} called EventHandler firehander #{@name}, #{event}, obj: #{object},args: #{aeve[ix]}\"\n $log.debug \"#{self} called EventHandler firehander #{@name}, #{event}\"\n begin\n blk.call object, *aeve[ix]\n rescue FieldValidationException => fve\n # added 2011-09-26 1.3.0 so a user raised exception on LEAVE\n # keeps cursor in same field.\n raise fve\n rescue PropertyVetoException => pve\n # added 2011-09-26 1.3.0 so a user raised exception on LEAVE\n # keeps cursor in same field.\n raise pve\n rescue => ex\n ## some don't have name\n #$log.error \"======= Error ERROR in block event #{self}: #{name}, #{event}\"\n $log.error \"======= Error ERROR in block event #{self}: #{event}\"\n $log.error ex\n $log.error(ex.backtrace.join(\"\\n\")) \n #$error_message = \"#{ex}\" # changed 2010 \n $error_message.value = \"#{ex.to_s}\"\n Ncurses.beep\n end\n end\n else\n # there is no block for this key/event\n # we must behave exactly as processkey\n # NOTE this is too risky since then buttons and radio buttons\n # that don't have any command don;t update,so removing 2011-12-2 \n #return :UNHANDLED\n return :NO_BLOCK\n end # if\n else\n # there is no handler\n # I've done this since list traps ENTER but rarely uses it.\n # For buttons default, we'd like to trap ENTER even when focus is elsewhere\n # we must behave exactly as processkey\n # NOTE this is too risky since then buttons and radio buttons\n # that don't have any command don;t update,so removing 2011-12-2 \n #return :UNHANDLED\n # If caller wants, can return UNHANDLED such as list and ENTER.\n return :NO_BLOCK\n end # if\n end", "def on_click(elem)\n elem.fire_event('onClick')\n end", "def on_event(public, event)\n subsequent.on_event public, event if subsequent\n end", "def trigger_event(event_name, *args)\n event_callbacks[event_name].each do |cb|\n begin\n cb.call(*args)\n rescue Exception => ex\n warn \"[OnStomp/Event] triggering #{event_name} raised an error: #{ex}\"\n end\n end\n end", "def fire(event_type, *arguments)\n @events[event_type].each do |event|\n event.call(*arguments)\n end if event_is_defined(event_type)\n end", "def handle(event)\n raise NotImplementedError\n end", "def method_missing(method_name, *args, &block)\n _, event_name, callback_name = *method_name.to_s.match(/^(\\w*?on_\\w+?)_(\\w+)$/)\n if callback_name && callback_names.include?(callback_name.to_sym)\n public_send(event_name, :\"#{callback_name}\", *args, &block)\n else\n super\n end\n end", "def test_handler_queueing_when_triggered_in_cell_state\n m = mouse_mock('mommy')\n m << s= mouse_mock('sender', :fire_event) do\n def fire_event\n trigger :click \n render :nothing => true\n end\n end\n \n m << r= mouse_mock('receiver', :receive_event) do\n def receive_event; render :text => \"gotcha!\"; end\n end\n m.respond_to_event :click, :on => 'receiver', :with => :receive_event\n \n s.invoke # trigger :click\n \n assert_equal 1, @processor.queue.size\n a = @processor.queue.first\n # test [handler, event]:\n assert_equal \"InvokeEventHandler:receiver#receive_event\", a.first.to_s\n assert_equal s.name, a.last.source.name\n end", "def method_missing(method_name, *args, &block)\n _, event_name, callback_name = *method_name.to_s.match(/^(\\w*?on_\\w+?)_(\\w+)$/)\n if callback_names.include?(callback_name.to_sym)\n public_send(event_name, :\"#{callback_name}\", *args, &block)\n else\n super\n end\n end", "def method_missing(method_name, *args, &block)\n _, event_name, callback_name = *method_name.to_s.match(/^(\\w*?on_\\w+?)_(\\w+)$/)\n if callback_names.include?(callback_name.to_sym)\n public_send(event_name, :\"#{callback_name}\", *args, &block)\n else\n super\n end\n end", "def register(event = nil, &handler)\r\n \r\n @handler = handler\r\n @event_type = event\r\n \r\n @event_type = :any unless event\r\n \r\n if @event_type == :any\r\n handler.instance_eval(&handler)\r\n end\r\n \r\n end", "def method_missing(sym,*args, &block)\n if sym.to_s.match(/^(on|before|after)_/)\n register_handler(sym.to_s,args.first,&block)\n else\n super\n end\n end", "def on_keypress &b\n on :keypress, &b\n end", "def on(event, &block)\n return unless EVENTS.include? event\n\n instance_variable_set(:\"@#{event}_callback\", block)\n end", "def on event,&b\n each do |e| \n e.on event,&b\n end\n self\n end", "def on(eventName, &block)\n id = DOM.get_event_id\n InternalDOM.add_event_listener(@selector, eventName, id)\n DOM.add_listener(id, &block)\n end", "def handle\n puts \"***************************\"\n puts \"HANDLING EVENT: #{@event.inspect}\"\n puts \"***************************\"\n\n # Pass event off to handlers based on event name/title\n if @event.title == \"Out of range\"\n DeviceOutOfRangeHandler.new(@event).handle\n elsif @event.title == \"In Range\"\n DeviceWithinRangeHandler.new(@event).handle\n end\n end", "def event(event, opts={}, &block)\r\n tt = read_inheritable_attribute(:transition_table)\r\n \r\n et = read_inheritable_attribute(:event_table)\r\n e = et[event.to_sym] = SupportingClasses::Event.new(event, opts, tt, &block)\r\n define_method(\"#{event.to_s}!\") { e.fire(self) }\r\n end", "def method_missing(sym,*args, &block)\n if sym.to_s.match(/^(on|before|after)_/)\n register_handler(sym.to_s,args.first,&block)\n else\n super\n end\n end", "def trigger(command, *args)\n command = command.to_sym if command\n\n if Event.command?(command)\n event = Event.new(self, command, args)\n handlers = @event_handlers[event.name] || []\n handlers.each do |handler|\n success = handler.run(event)\n handlers.delete(handler) if success && handler.once\n end\n end\n\n true\n end", "def on(event_type, options={}, &block)\n site.on event_type, options, &block\n end", "def event(*type, &block)\n if type.nil? || type.empty?\n log \"Setting up catch-all event handler...\"\n setup_event_handler(nil, &block) # catch all\n elsif type.length == 1\n log \"Setting up event handler for: #{type.inspect}\"\n setup_event_handler(type.first, &block)\n else\n log \"Setting up event handler for multiple events: #{type.inspect}\"\n type.each {|t| setup_event_handler(t, &block) }\n end\n end", "def on_event(event_name=:__default__, &block)\n raise TypeError, 'event_name must be nil or respond to #to_sym' unless event_name.nil? || event_name.respond_to?(:to_sym)\n \n ( callbacks[ event_name.to_sym ] ||= [] ) << block\n \n block\n end", "def event(event, &block)\n if @_event == event\n throw(:__matched__, yield(*@_args))\n end\n rescue UncaughtThrowError\n end", "def handle\n puts 'ignoring event -- no handler defined'\n end", "def on(event_name, &block)\n\t\t\t@events[event_name] = block\n\t\tend", "def define_event_helpers; end", "def fire(event, payload=nil)\n step_result = StepResult.new(true, \"manual event\")\n step_result.payload = payload if payload\n fire_events event, step_result\n step_result\n end", "def fire_event(event_name, resource)\n unless event = find_event(event_name)\n raise InvalidEvent, \"Could not find event (#{event_name.inspect})\"\n end\n transition = event.transitions.find do |t|\n t[:from].to_s == @current_state_name.to_s\n end\n unless transition\n raise InvalidEvent, \"Event (#{event_name.inspect}) does not\" +\n \"exist for current state (#{@current_state_name.inspect})\"\n end\n\n # == Run :exit hook (if present) ==\n resource.run_hook_if_present current_state.options[:exit]\n\n # == Change the current_state ==\n @current_state_name = transition[:to]\n\n # == Run :enter hook (if present) ==\n resource.run_hook_if_present current_state.options[:enter]\n end", "def fire\n fire_handler :PRESS, ActionEvent.new(self, :PRESS, text)\n end", "def on trigger, &block\n @handlers[trigger] = [] unless @handlers.key? trigger\n @handlers[trigger] << block\n end", "def trigger event, env\n triggered(event).each do |triggered_event|\n Nark.class_eval 'triggered_event.method_block.call env'\n end\n end", "def handle(evt)\n meth = \"handle_#{evt.name}\"\n send(meth, evt, evt.source) if respond_to?(meth)\n end", "def on(key, function)\n @events[key] = function\n end", "def on(event, &block)\n hooks[event.to_sym] ||= []\n hooks[event.to_sym] << block\n end", "def on(key, &block)\n add_event(Event.new(key, &block))\n end", "def trigger(name, *args)\n Events.use(name, *args)\n end", "def fire_event_js( locator, event, ret: false, wait: 0.1 )\n r = javascript.run <<-EOJS\n var element = document.querySelector( #{locator.css.inspect} );\n var event = document.createEvent( \"Events\" );\n\n event.initEvent( \"#{event}\", true, true );\n\n event.view = window;\n event.altKey = false;\n event.ctrlKey = false;\n event.shiftKey = false;\n event.metaKey = false;\n event.keyCode = 0;\n event.charCode = 'a';\n\n #{'return' if ret} element.dispatchEvent( event );\n EOJS\n\n sleep wait\n r\n end", "def on(event, &block)\n if block_given?\n if (@@valid_events.include? event)\n define_singleton_method(event, block)\n else\n puts \"Error: trying to assign invalid event | Letteropend::Film, event: #{event}\"\n end\n end\n end", "def on(event, &block) # open, message, close, ping, pong\n @events[event] = block\n end", "def process_event(event)\n return if Events.processed? event\n name = 'handle_' + event['type'].match(/\\w+$/).to_s\n send(name, event) if respond_to? name, true\n end", "def fire_on_method(method, event_type, &block)\n if method.is_a? Array\n method.map { |sym| fire_on_method(sym, event_type, &block) }\n return\n end\n \n # We alias @parent to parent here, because class_eval can't see outside\n # this scope otherwise.\n parent, old_method = @parent, ('ruby_events_' + method.to_s + '_event_old').to_sym\n if parent && parent.respond_to?(method)\n parent.class.class_eval do\n # If the parent is already responding to the alias method, it means\n # the fire_on_method event was already triggered. Remove the other\n # event and continue if this happens.\n if parent.respond_to?(old_method, true)\n remove_method method\n alias_method method, old_method\n remove_method old_method\n end\n \n alias_method old_method, method\n private old_method\n \n # Make sure the self.send is at the end, or we won't return what we\n # are supposed to.\n define_method method do |*args|\n events.fire(event_type, *args)\n block.call(*args) if block # Calling the block we've been passed\n __send__(old_method, *args)\n end\n end\n else\n raise 'The given object does not respond to method you are trying to intercept calls to.'\n end\n end", "def on(event, options = {})\n events << Event.new(event, options, Proc.new)\n end", "def fire\n #$log.debug \"firing PRESS #{text}\"\n fire_handler :PRESS, ActionEvent.new(self, :PRESS, text)\n end", "def on_click &b\n on :click, &b\n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def on(event_type = Event, *args, &callback)\n sync_exclusive do\n name, async, _ = args\n name = ANY_EVENT if name.nil?\n async = false if async.nil?\n ensure_valid_callback_name!(name)\n callback.extend(Async) if async == :async\n hooks.register event_type.to_s, name, callback\n end\n end", "def find_and_trigger_event(event_type, args = nil)\r\n \r\n case event_type\r\n when :before_change\r\n \r\n if respond_to?(:before_change)\r\n \r\n results = send(:before_change, args)\r\n return false if results == false\r\n \r\n end\r\n \r\n when :after_change\r\n \r\n if respond_to?(:after_change)\r\n \r\n results = send(:after_change, args)\r\n return false if results == false\r\n \r\n end\r\n \r\n when :before_change_field\r\n \r\n #CALL FOR A SPECIFIC FIELD THAT HAS CHANGED\r\n trigger_function_name = \"#{:before_change_field}_#{args.field_name}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args) \r\n return false if results == false\r\n \r\n end\r\n \r\n #CALL FOR ANY FIELD THAT CHANGES\r\n trigger_function_name = \"#{:before_change_field}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args) \r\n return false if results == false\r\n \r\n end\r\n \r\n when :after_change_field\r\n #looks in own class for :after_change_field for the field passed, requires the parameter of a Field object to be passed\r\n \r\n #SAPPHIRE UPDATE\r\n #SEARCH FOR ACTIVE MAP DEFINITION THAT INCLUDES THE CURRENT TABLE AND FIELD.\r\n #IF ANY ARE FOUND QUEUE THE PROCESS\r\n if args.table.field_order.include?(\"student_id\")\r\n \r\n if map_id = $tables.attach(\"SAPPHIRE_INTERFACE_MAP\").field_value(\r\n \"primary_id\",\r\n \"WHERE athena_table = '#{table_name }'\r\n AND athena_field = '#{args.field_name }'\r\n AND trigger_event = 'after_change_field'\"\r\n )\r\n \r\n sid = $tables.attach(args.table.table_name).field_value(\"student_id\", \"WHERE primary_id = '#{args.primary_id}'\")\r\n student = $students.get(sid)\r\n \r\n if student && student.active.is_true?\r\n \r\n queue_record = $tables.attach(\"SAPPHIRE_INTERFACE_QUEUE\").new_row\r\n queue_record.fields[\"map_id\" ].value = map_id\r\n queue_record.fields[\"athena_pid\" ].value = args.primary_id\r\n queue_record.save\r\n \r\n end\r\n \r\n end\r\n \r\n end\r\n \r\n #CALL FOR A SPECIFIC FIELD THAT HAS CHANGED\r\n trigger_function_name = \"#{:after_change_field}_#{args.field_name}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args) \r\n return false if results == false\r\n \r\n end\r\n \r\n #CALL FOR ANY FIELD THAT CHANGES\r\n trigger_function_name = \"#{:after_change_field}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args)\r\n return false if results == false\r\n \r\n end\r\n \r\n when :before_load #any table can have this event for self table\r\n \r\n continue_with_load = true\r\n \r\n this_trigger_event = \"before_load_#{table_name.downcase}\"\r\n \r\n tables_with_before_load_events = args ? args : event_array(this_trigger_event)\r\n \r\n tables_with_before_load_events.each{|file|\r\n this_table = $tables.attach(file)\r\n \r\n begin\r\n continue_with_load = this_table.send(this_trigger_event)\r\n \r\n rescue=> e\r\n #raise e #THIS SHOULD HAVE BEEN A SYSTEM NOTIFICATION - ADDING NOW BUT LEACING THIS NOTE HERE TO HELP IDENTIFY ANY ISSUES THAT MAY COME TO LIGHT WHICH WERE CONCEALED BY THIS BEFORE...\r\n $base.system_notification(\r\n subject = \"BEFORE LOAD FAILED - #{file}\",\r\n content = \"Don't just stand there and shout it; do something about it... Here's the error:\r\n #{e.message}\r\n <br>\r\n <br>\r\n #{e.backtrace}\"\r\n )\r\n \r\n end\r\n \r\n } if tables_with_before_load_events\r\n \r\n return continue_with_load\r\n \r\n when :after_load #any table can have this event for self table\r\n \r\n this_trigger_event = \"after_load_#{table_name.downcase}\"\r\n \r\n tables_with_after_load_events = args ? args.dup : event_array(this_trigger_event)\r\n \r\n db_config_record(\r\n field_name = \"phase_total\",\r\n new_value = tables_with_after_load_events.join(\",\")\r\n )\r\n db_config_record(\r\n field_name = \"phase_completed\",\r\n new_value = nil\r\n )\r\n \r\n if !args || args.include?(\"move_source_to_dest\")\r\n tables_with_after_load_events.delete(\"move_source_to_dest\")\r\n move_source_to_dest\r\n end\r\n \r\n tables_with_after_load_events.each{|file|\r\n this_table = $tables.attach(file)\r\n db_config_record(\r\n field_name = \"after_load_status\",\r\n new_value = \"Started #{file} - #{DateTime.now.strftime(\"%Y-%m-%d %H:%M:%S\")}\"\r\n )\r\n \r\n begin\r\n this_table.send(this_trigger_event)\r\n db_config_record = $tables.attach(\"Db_Config\").by_table_name(table_name)\r\n phase_completed = db_config_record.fields[\"phase_completed\"].value\r\n phase_completed = (phase_completed ? \"#{phase_completed},#{file}\" : file)\r\n db_config_record(\r\n field_name = \"phase_completed\",\r\n new_value = phase_completed\r\n )\r\n db_config_record(\r\n field_name = \"after_load_status\",\r\n new_value = \"Completed #{file} - #{DateTime.now.strftime(\"%Y-%m-%d %H:%M:%S\")}\"\r\n )\r\n \r\n rescue=> e\r\n after_load_failed(message = \"#{file} - #{e.message} <br><br> #{e.backtrace}\", e)\r\n raise e\r\n end\r\n \r\n } if tables_with_after_load_events\r\n \r\n when :after_insert\r\n send(:after_insert, args) if respond_to?(:after_insert)\r\n \r\n when :after_save\r\n send(:after_save, args) if respond_to?(:after_save)\r\n \r\n when :before_insert\r\n #Looks in own class for before_insert event, requires the parameter of a Row object to be passed\r\n if respond_to?(:before_insert)\r\n send(:before_insert, args)\r\n else\r\n return true\r\n end\r\n \r\n end\r\n \r\n return true\r\n \r\n end", "def event(event) # TODO args for events like keypress\n @events << event\n self\n end", "def add_event event, delay\n # check to see if the event has a type\n if event.type == :event_none\n bug \"add_event: no type.\"\n return\n end\n\n # check to see of the event has a callback function\n if event.fun == nil\n bug \"add_event: event type %d has no callback function.\", event.type\n return\n end\n\n # set the correct variables for this event\n event.ownertype = :event_owner_dmob\n event.owner = self\n\n # attach the event to the mobiles local list\n @events << event\n\n # attempt to enqueue the event\n if enqueue_event(event, delay) == false\n bug \"add_event: event type %d failed to be enqueued.\", event.type\n end\n end", "def trigger_by_scope!(event, *args, &block)\n trigger!(event, block, *args)\n end", "def bind_event(selector, event, options={})\n @bound_events[selector] = BoundEvent.new(event, selector)\n Element.find(selector).on(event) do\n #puts \"bind_event: #{selector}: #{event}\"\n propagate = false\n capture_exception do\n if options[:returns_propagation_result]\n propagate = yield\n else\n yield\n end\n end\n #puts \"bind_event: propagate = #{propagate}\"\n propagate\n end\n end", "def send_event\n raise 'send_event must be defined in the child class'\n end", "def work(raw_event)\n event = JSON.parse(raw_event)\n EventManager.new.handle_event(event)\n end", "def wrap_event(js_event)\n js_event = JEvent.new(js_event) unless js_event.is_a?(JEvent)\n Event.new(js_event)\n end", "def fire(event, *args) #:nod\n ensure_valid event\n listeners = @subscriptions[event] if @subscriptions\n listeners.each do |l|\n if l.is_a? Array\n l[0].send(l[1],*args)\n else\n l.call(*args)\n end\n end if listeners\n end", "def pre_hook_send(handler); end", "def on evt, bool = false, &b\n each do |q|\n q.add_event_listener evt.to_s, bool, &b\n end\n \n return nil\n end", "def on(name, &block)\n @handlers[name.to_s] = block\n end", "def fire\n checked(!@value)\n @item_event = ItemEvent.new self, self if @item_event.nil?\n @item_event.set(@value ? :SELECTED : :DESELECTED)\n fire_handler :PRESS, @item_event # should the event itself be ITEM_EVENT\n end", "def handle_event event \n case event[:name]\n when 'sleep'\n puts 'sleep'\n sleep 4\n \n when 'change_state'\n puts 'change_state'\n \n when 'tick'\n puts 'tick'\n \n end\n end", "def trigger(event_type, source_id=self.name)\n puts \"triggered #{event_type.inspect} in #{source_id.inspect}\"\n \n event = Event.new\n event.type = event_type\n event.source_id = source_id\n \n fire(event)\n end", "def event!(*args)\n @events&.call(*args)\n end", "def send_events; end", "def execute\n raise \"Event.execute is abstract\"\n end", "def new_handler\n handler.new(event)\n end", "def on(event_type = ANY_EVENT, name = ANY_STATE, &callback)\n sync_exclusive do\n ensure_valid_callback_name!(name)\n hooks.register event_type, name, callback\n end\n end", "def fire(event)\n @mootex.synchronize do\n condition = @waiting.delete(event)\n condition.broadcast unless condition.nil?\n end\n self\n end" ]
[ "0.65624875", "0.6540697", "0.6539327", "0.6538149", "0.6413261", "0.6406174", "0.63974315", "0.63536614", "0.6310573", "0.62667656", "0.6172383", "0.61198634", "0.61120665", "0.6031996", "0.5956242", "0.59550804", "0.59550804", "0.5951419", "0.59200275", "0.58917105", "0.58869344", "0.58701694", "0.57908607", "0.57716477", "0.5743957", "0.57373744", "0.57231015", "0.5722655", "0.5689167", "0.5681897", "0.5667929", "0.5651181", "0.5635881", "0.5623204", "0.562041", "0.5617277", "0.56153697", "0.56131583", "0.5600147", "0.5586268", "0.5586268", "0.5579971", "0.5577948", "0.55632025", "0.55596757", "0.5505555", "0.5501007", "0.54971975", "0.54858816", "0.5484358", "0.54708964", "0.546746", "0.54594725", "0.5452549", "0.54517585", "0.5442789", "0.5442321", "0.5433737", "0.5416443", "0.54139835", "0.53942484", "0.53828394", "0.5379172", "0.53777957", "0.53660285", "0.53660244", "0.5345788", "0.532324", "0.5319991", "0.5315566", "0.5312145", "0.52867776", "0.5269979", "0.5263589", "0.5259795", "0.5240727", "0.52267784", "0.52231455", "0.5221814", "0.52210355", "0.52014816", "0.5196529", "0.518053", "0.51726526", "0.5171073", "0.5151716", "0.5146778", "0.51401824", "0.51269317", "0.512195", "0.51200247", "0.5115571", "0.5106883", "0.51008534", "0.51003736", "0.5099559", "0.50958866", "0.5095752", "0.5090947" ]
0.57997626
23
Simulates a user pressing and releasing a key. +keycode+ is the numeric keycode of the key to be pressed, normally the ASCII value of that key.
def key_press locator, keycode command 'keyPress', locator, keycode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_keycode(keycode)\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::DOWN))\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::UP))\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def press(key_sequence)\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def send_key(keycode, ctrl=false, alt=false, shift=false)\n matchingshortcuts = @shortcuts.select { |shortcut|\n shortcut.keycode == keycode && shortcut.ctrl == ctrl &&\n shortcut.alt == alt && shortcut.shift == shift\n }\n counter = 0\n matchingshortcuts.each { |shortcut|\n action = shortcut.action\n @actions[action].each { |handler|\n handler.call(shortcut)\n counter+=1\n }\n }\n counter\n end", "def keypress(key = nil, name = nil)\n Vedeu.trigger(:key, key)\n\n return false unless key\n\n new(key, name).keypress\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def key_stroke(keycodeText)\n append_to_script \"key_stroke \\\"#{keycodeText}\\\"\"\n end", "def keypress(key)\n puts \"Got key: #{key} (#{key.class})\"\n if key.is_a?(String)\n if key.length == 1\n # Assume letter\n @vnc.keyevent(key.chr, true)\n @vnc.keyevent(key.chr, false)\n else\n # Assume keysym\n puts \"I don't know how to type '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end\n else\n # type printables, key others.\n if 32.upto(127).include?(key)\n @vnc.keyevent(key, true)\n @vnc.keyevent(key, false)\n else\n case key\n when 8 \n @vnc.keyevent(0xff08, true)\n @vnc.keyevent(0xff08, false)\n when 13\n @vnc.keyevent(0xff0D, true)\n @vnc.keyevent(0xff0D, false)\n else\n puts \"I don't know how to type web keycode '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end # case key\n end # if 32.upto(127).include?(key)\n end # if key.is_a?String\n return nil\n end", "def key_released( event )\n @keys -= [event.key]\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def press_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_down @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def keypress &block\n @keyblock = block\n end", "def press_key(letter)\n advance_rotors\n @plugboard.translate(letter)\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def key_down key\n @keys.push key\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def key_combination(*keys)\n keys.each {|k| press(k) }\n keys.reverse.each {|k| release(k) }\n end", "def key_pressed( event )\n @keys += [event.key]\n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def key_press *args\n\t\t\tevent(:key_press, *args)\n\t\tend", "def getch\n map_key(key_press)\n end", "def press(key, delay: nil, text: nil)\n focus\n page.keyboard.press key, delay: delay, text: text\n end", "def move_for_keypress(window, pressed_buttons)\n # Generated once for each keypress\n until pressed_buttons.empty?\n button = pressed_buttons.shift\n case button\n when Gosu::KbUp then return :flip\n when Gosu::KbP then @conn.send_ping; return nil\n when Gosu::KbLeft, Gosu::KbRight # nothing\n else puts \"Ignoring key #{button}\"\n end\n end\n\n # Continuously-generated when key held down\n case\n when window.button_down?(Gosu::KbLeft) then :slide_left\n when window.button_down?(Gosu::KbRight) then :slide_right\n end\n end", "def handle(key)\n case key\n when :left, :right, :space, :s\n @player_controller.events.trigger(:key, key)\n when :down, :up, :enter, :u\n @track_controller.events.trigger(:key, key)\n end\n end", "def handle(key)\n case key\n when :left, :right, :space, :one, :two, :three, :four, :five, :six, :seven, :eight, :nine\n @player_controller.events.trigger(:key, key)\n when :down, :up, :enter, :u, :f, :s, :j, :k, :m, :h, :o\n @track_controller.events.trigger(:key, key)\n end\n end", "def keyevent(key, metastate = nil)\n @bridge.keyevent(key, metastate)\n end", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def keyPressed(key, x, y)\n\n # If escape is pressed, kill everything. \n if (key == 27) \n # shut down our window \n glutDestroyWindow(@window)\n # exit the program...normal termination.\n exit(0) \n end\nend", "def on_char(evt)\n ch = evt.get_key_code\n mflag = evt.modifiers\n\n case ch\n when Wx::K_RIGHT : move_cursor_right(evt.shift_down)\n when Wx::K_LEFT : move_cursor_left(evt.shift_down)\n when Wx::K_DOWN : move_cursor_down(evt.shift_down)\n when Wx::K_UP : move_cursor_up(evt.shift_down)\n when Wx::K_BACK : on_key_back(evt)\n when Wx::K_DELETE : on_key_delete(evt)\n when Wx::K_TAB : on_key_tab(evt)\n when (mflag == Wx::MOD_CMD and ?a) # select all\n do_select_all\n when (mflag == Wx::MOD_CMD and ?c) # copy\n do_clipboard_copy\n when (mflag == Wx::MOD_CMD and ?x) # cut\n do_clipboard_cut\n when (mflag == Wx::MOD_CMD and ?v) # paste\n do_clipboard_paste\n when ((mflag == Wx::MOD_NONE or mflag == Wx::MOD_SHIFT) and 0x20..0x7e)\n if @cursor.area\n # redirect regular typing to on_char_AREANAME\n return self.send(\"on_char_#{AREAS[@cursor.area]}\", evt)\n end\n else # everything else is for dynamically handling key combo handlers\n m = []\n m << 'alt' if (mflag & Wx::MOD_ALT) != 0\n m << 'cmd' if (mflag & Wx::MOD_CMD) != 0\n m << 'shift' if (mflag & Wx::MOD_SHIFT) != 0\n mods = (m.empty?)? \"\" : \"_\" + m.join('_')\n\n ch = evt.get_key_code\n hex = ch.to_s(16).rjust(2,'0')\n meth=nil\n\n if (n=resolve_key_code(ch)) and respond_to?(\"on_key#{mods}_#{n}\")\n meth=\"on_key#{mods}_#{n}\"\n elsif respond_to?(\"on_key#{mods}_0x#{hex}\")\n meth=\"on_key#{mods}_#{hex}\"\n end\n\n if meth and ret=self.send(meth, evt)\n return ret\n else\n evt.skip()\n end\n end\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def released( key )\n return KeyReleaseTrigger.new( key )\nend", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def keystroke(character, *special_keys)\n special_keys = [\"command\"] if special_keys.length == 0\n special_keys_as_applescript_array = special_keys.map { |k|\n \"#{k} down\"\n }.join(\", \")\n execute_applescript(%Q'\n tell application \"System Events\"\n set frontApp to name of first item of (processes whose frontmost is true)\n tell application frontApp\n keystroke \"#{character}\" using {#{special_keys_as_applescript_array}}\n end\n end tell\n ')\n end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def send_keycode_to_selector keycode, selector\n keypress_script = \"var e = $.Event('keydown', { keyCode: #{keycode} }); $('#{selector}').trigger(e);\"\n page.driver.browser.execute_script(keypress_script)\n end", "def press_key(criteria,element,key)\r\n\t\t\tputs key\r\n\t\t\t@driver.find_element(criteria.to_sym, element).send_keys [:control, 'a'], key.to_sym\r\n\t\t\tsleep 1\r\n\t\t\t#http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Keys#KEYS-constant\r\n\t\tend", "def process_key keycode, object\n return _process_key keycode, object, @window\n end", "def type(*keys)\n keys = normalize_keys(Array(keys))\n\n keys.each do |key|\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", type: type, **key)\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n end\n\n self\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def read_keypress(options = {})\n opts = { echo: false, raw: true }.merge(options)\n codes = unbufferred { get_codes(opts) }\n char = codes ? codes.pack('U*') : nil\n\n trigger_key_event(char) if char\n char\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def press key, options = {}\n key = 'Return' if key == 'ENTER'\n widget = options[:in] || Gtk::Window.toplevels.first\n event = Gdk::EventKey.new(Gdk::Event::KEY_PRESS)\n event.window = widget\n event.state |= Gdk::Window::CONTROL_MASK if key =~ /CTRL+/\n event.state |= Gdk::Window::MOD1_MASK if key =~ /ALT+/\n event.state |= Gdk::Window::SHIFT_MASK if key =~ /SHIFT+/\n event.keyval = Gdk::Keyval.from_name(key.split('+').last)\n widget.grab_focus\n event.send_event = true\n entry = Gdk::Keymap.default.get_entries_for_keyval(event.keyval).first\n event.hardware_keycode = entry[0]\n widget.signal_emit('key_press_event', event)\n process_events\nend", "def input_key(key)\n @driver.action.send_keys(key).perform\n end", "def move_for_keypress(keypress); nil; end", "def key_pressed?(key)\r\n\t\tif (GetKeyState.call(VALUES[key]).abs & 0x8000 == 0x8000)\r\n\t\t\tKeyRepeatCounter[key] = 0\r\n\t\t\treturn true\r\n\t\tend\r\n\t\treturn false\r\n\tend", "def keyboard_send_keyevent(keyevent)\r\n adb_exec(\"shell input keyevent #{keyevent}\")\r\nend", "def unbind_key keycode\n @_key_args.delete keycode unless @_key_args.nil?\n @_key_map.delete keycode unless @_key_map.nil?\n end", "def key_pressed?(key)\n key_const = Gosu.const_get(:\"Kb#{key.to_s.gsub(/\\b\\w/){$&.upcase}}\")\n button_down?(key_const)\n end", "def send_key(*args); end", "def on_key(ch)\n end", "def key_pressed?(key)\n SDL::Key.press?(key)\n end", "def keypress\n key = input\n\n @keypress ||= Vedeu::Input::Translator.translate(key)\n end", "def button_up(key)\n close if key == Gosu::KbEscape\n\n # reset the game\n if @state == :end && key == Gosu::MsLeft\n @board = Board.new(self, 22, @root_dir)\n @state = :game\n return\n end\n\n @player_b.ai_inc if key == Gosu::KbS\n @player_b.ai_dec if key == Gosu::KbD\n\n if @player_on_turn.class == HotseatPlayer && key == Gosu::MsLeft\n if @board.cell_clicked(mouse_x, mouse_y, @player_on_turn.sym)\n\n return if @state == :end\n\n switch_players\n\n if @player_on_turn.class == AIPlayer\n @player_on_turn.make_move(@board)\n switch_players\n end\n end\n end\n end", "def key_press\n x = $stdin.getch\n x += handle_esc if x == \"\\e\"\n\n x\nend", "def handle_keys\n exit if SDL::Key.press? SDL::Key::ESCAPE\n exit if SDL::Key.press? SDL::Key::Q\n self.paused = !paused if SDL::Key.press? SDL::Key::P\n end", "def press_element_key(id, key)\r\n element = find_by_id(id);\r\n keypress_on(element, key)\r\n end", "def activate_up(key)\n key_down.deactivate(key)\n key_held.deactivate(key)\n key_up.activate(key)\n end", "def send_keys(*key)\n @bridge.send_keys_to_active_element(key)\n end", "def key_down_event _value\n send_cmd(\"key_down_event #{_value}\")\n end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def handle_key_press(key)\n case @scene\n when 'intro'\n handle_intro_key_press(key)\n when 'level'\n handle_level_key_press(key)\n when 'transition'\n when 'credits'\n end\n end", "def _handle_key ch\n begin\n ret = process_key ch, self\n $multiplier = 0\n bounds_check\n rescue => err\n $log.error \" TEXTPAD ERROR _handle_key #{err} \"\n $log.debug(err.backtrace.join(\"\\n\"))\n alert \"#{err}\"\n #textdialog [\"Error in TextPad: #{err} \", *err.backtrace], :title => \"Exception\"\n ensure\n padrefresh\n Ncurses::Panel.update_panels\n end\n return 0\n end", "def getch\n\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def activate_down(key)\n key_down.activate(key)\n key_held.deactivate(key)\n key_up.deactivate(key)\n end", "def send_keys(keys)\n platform.send_keys(keys)\n end", "def add(key)\n cmd = \"input keyevent #{map_key(key)};\"\n @sequence == \"\" ? @sequence = cmd : @sequence = @sequence + cmd\n end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def onKeyDown(key, repeat, flags, view)\n #puts \"onKeyDown: #{key}, #{flags}\"\n return if repeat > 1\n self.set_flags flags\n \n case( key )\n when VK_LEFT\n @keys |= LEFT_ARROW\n when VK_RIGHT\n @keys |= RIGHT_ARROW\n when VK_UP\n @keys |= UP_ARROW\n when VK_DOWN\n @keys |= DOWN_ARROW\n when '+'[0]\n @@speed += 1.0\n when '-'[0]\n @@speed -= 1.0\n @@speed = 1.0 if @@speed < 1.0\n else\n return\n end\n @speedx = @@speed\n @speedy = @@speed\n \n # get the distance from the camera to what we are looking at to control the speed\n @distance_to_target = self.guess_target_distance view\n \n view.animation = self\n view.dynamic = 3\nend", "def keypress_handler(scancode)\n i = scancode & 0x7f\n x = SCREEN_W() - 100 * 3 + (i % 3) * 100\n y = SCREEN_H() / 2 + (i / 3 - 21) * 10\n color = scancode & 0x80 != 0 ? makecol(255, 255, 0) : makecol(128, 0, 0)\n rectfill(screen, x, y, x + 95, y + 8, color)\n str = ustrzncpy(scancode_to_name(i), 12)\n textprintf_ex(screen, font, x + 1, y + 1, makecol(0, 0, 0), -1, str)\nend", "def key_pressed(event)\n case event.key\n when :left\n update_position :left\n when :right\n update_position :right\n when :up\n update_position :up\n when :down\n update_position :down\n when :space\n build_ladder\n end\n end", "def key_press(*args)\n options = Hash === args.last ? args.pop : {}\n keys = args\n raise ArgumentError, 'Must have at least one key argument' if keys.empty?\n begin\n key_down keys.first\n if keys.length == 1\n yield if block_given?\n else\n key_press(*(keys[1..-1] + [options]))\n end\n ensure\n key_up keys.first\n end\n end", "def ORIG_process_key keycode, object, window\n return :UNHANDLED if @_key_map.nil?\n blk = @_key_map[keycode]\n $log.debug \"XXX: _process key keycode #{keycode} #{blk.class}, #{self.class} \"\n return :UNHANDLED if blk.nil?\n if blk.is_a? OrderedHash \n #Ncurses::nodelay(window.get_window, bf = false)\n # if you set nodelay in ncurses.rb then this will not\n # wait for second key press, so you then must either make it blocking\n # here, or set a wtimeout here.\n #\n # This is since i have removed timeout globally since resize was happeing\n # after a keypress. maybe we can revert to timeout and not worry about resize so much\n Ncurses::wtimeout(window.get_window, 500) # will wait a second on wgetch so we can get gg and qq\n ch = window.getch\n # we should not reset here, resetting should happen in getch itself so it is consistent\n #Ncurses::nowtimeout(window.get_window, true)\n\n $log.debug \" process_key: got #{keycode} , #{ch} \"\n # next line ignores function keys etc. C-x F1, thus commented 255 2012-01-11 \n if ch < 0 #|| ch > 255\n return nil\n end\n #yn = ch.chr\n blk1 = blk[ch]\n # FIXME we are only returning the second key, what if form\n # has mapped first and second combo. We should unget keycode and ch. 2011-12-23 \n # check this out first.\n window.ungetch(ch) if blk1.nil? # trying 2011-09-27 \n return :UNHANDLED if blk1.nil? # changed nil to unhandled 2011-09-27 \n $log.debug \" process_key: found block for #{keycode} , #{ch} \"\n blk = blk1\n end\n if blk.is_a? Symbol\n if respond_to? blk\n return send(blk, *@_key_args[keycode])\n else\n ## 2013-03-05 - 19:50 why the hell is there an alert here, nowhere else\n alert \"This ( #{self.class} ) does not respond to #{blk.to_s} [PROCESS-KEY]\"\n # added 2013-03-05 - 19:50 so called can know\n return :UNHANDLED \n end\n else\n $log.debug \"rwidget BLOCK called _process_key \" if $log.debug? \n return blk.call object, *@_key_args[keycode]\n end\n #0\n end", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def process_keyboard\n ACCEPTED_KEYS.each {|key|\n if Input.repeat?(key[0])\n c = (key[0] != :kSPACE) ? Keyboard.add_char(Ascii::SYM[key[0]]) : \" \"\n process_add(c)\n #Sound.play_ok\n play_random_key_sound\n end\n }\n end", "def while_key_up *args\n\t\t\tevent(:while_key_up, *args)\n\t\tend", "def handle_key ch\n if ch == 32\n toggle\n else\n super\n end\n end", "def send_keys(*args); end", "def keypress\n $prompt.keypress(\"Press space or enter to continue\", keys: [:space, :return])\nend", "def show_single_key\n c = read_char\n\n case c\n when \" \"\n pickUpItem()\n when \"i\"\n showInventory\n when \"m\"\n showMap\n when \"v\"\n inspectSurroundings\n puts \"working\"\n when \"q\"\n system ('clear && printf \"\\e[3J\"') or system (\"cls\")\n exit 0\n when \"k\"\n gameOver\n when \"\\e[A\"\n move(c)\n when \"\\e[B\"\n move(c)\n when \"\\e[C\"\n move(c)\n when \"\\e[D\"\n move(c)\n when \"\\u0003\"\n puts \"CONTROL-C\"\n exit 0\n end\nend", "def getch\n @window.getch\n end", "def ctrl_w() send_keys(:ctrl_w) end", "def onKeyDown( *args )\r\n capture = relay_event( :onKeyDown, args )\r\n relay_event( :onSetCursor, [] )\r\n capture\r\n end", "def ****_hidekeyboard\r\n begin\r\n\tif $driver.is_keyboard_shown\r\n\t $driver.press_keycode(4)\r\n\tend\r\n rescue Exception => e\r\n\t raise e.message\r\n\t raise e.backtrace.inspect\r\n end\r\nend", "def clear_and_send_keys(*args)\r\n clear($focus_driver)\r\n send_keys(*args)\r\n end", "def close_menu_with_key_press(menu_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_menu_closed(menu_name)\n end" ]
[ "0.7103145", "0.6518238", "0.6518238", "0.6268375", "0.61894727", "0.61248404", "0.61248404", "0.6020581", "0.6017116", "0.59580517", "0.5817396", "0.5737996", "0.57043767", "0.57005626", "0.564944", "0.5619901", "0.56014204", "0.5576751", "0.5564746", "0.5554468", "0.5554468", "0.5514952", "0.55074334", "0.5482678", "0.54417545", "0.54155195", "0.54122496", "0.5411197", "0.5390968", "0.5341517", "0.5337363", "0.5273351", "0.52208436", "0.5200632", "0.5190736", "0.51878154", "0.51623756", "0.5153628", "0.5153535", "0.51350826", "0.5134149", "0.51308846", "0.5110832", "0.511009", "0.5109449", "0.50994647", "0.5075041", "0.50190324", "0.50128114", "0.50128114", "0.50089693", "0.49991673", "0.49962094", "0.49949422", "0.49911183", "0.49745363", "0.49579", "0.49568442", "0.4951056", "0.49363443", "0.4926432", "0.49191847", "0.49012098", "0.48678625", "0.48649436", "0.4860684", "0.48546812", "0.4853404", "0.48369613", "0.48303843", "0.4825045", "0.4820451", "0.48142934", "0.47816932", "0.47760674", "0.4769958", "0.4769958", "0.47692415", "0.47642636", "0.47614717", "0.47419974", "0.47419637", "0.47182947", "0.47124547", "0.47060782", "0.470539", "0.47050315", "0.46987674", "0.46927464", "0.46602395", "0.4657413", "0.4639984", "0.46351168", "0.46299705", "0.46299404", "0.462587", "0.4620527", "0.46080253", "0.46071756" ]
0.62748545
4
Simulates a user pressing a key (without releasing it yet). +keycode+ is the numeric keycode of the key to be pressed, normally the ASCII value of that key.
def key_down locator, keycode command 'keyDown', locator, keycode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_keycode(keycode)\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::DOWN))\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::UP))\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def keypress(key = nil, name = nil)\n Vedeu.trigger(:key, key)\n\n return false unless key\n\n new(key, name).keypress\n end", "def key_press locator, keycode\r\n command 'keyPress', locator, keycode\r\n end", "def key_press locator, keycode\r\n command 'keyPress', locator, keycode\r\n end", "def press(key_sequence)\n end", "def send_key(keycode, ctrl=false, alt=false, shift=false)\n matchingshortcuts = @shortcuts.select { |shortcut|\n shortcut.keycode == keycode && shortcut.ctrl == ctrl &&\n shortcut.alt == alt && shortcut.shift == shift\n }\n counter = 0\n matchingshortcuts.each { |shortcut|\n action = shortcut.action\n @actions[action].each { |handler|\n handler.call(shortcut)\n counter+=1\n }\n }\n counter\n end", "def keypress(key)\n puts \"Got key: #{key} (#{key.class})\"\n if key.is_a?(String)\n if key.length == 1\n # Assume letter\n @vnc.keyevent(key.chr, true)\n @vnc.keyevent(key.chr, false)\n else\n # Assume keysym\n puts \"I don't know how to type '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end\n else\n # type printables, key others.\n if 32.upto(127).include?(key)\n @vnc.keyevent(key, true)\n @vnc.keyevent(key, false)\n else\n case key\n when 8 \n @vnc.keyevent(0xff08, true)\n @vnc.keyevent(0xff08, false)\n when 13\n @vnc.keyevent(0xff0D, true)\n @vnc.keyevent(0xff0D, false)\n else\n puts \"I don't know how to type web keycode '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end # case key\n end # if 32.upto(127).include?(key)\n end # if key.is_a?String\n return nil\n end", "def keypress &block\n @keyblock = block\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def press_key(letter)\n advance_rotors\n @plugboard.translate(letter)\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def key_stroke(keycodeText)\n append_to_script \"key_stroke \\\"#{keycodeText}\\\"\"\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def press_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_down @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def input_key(key)\n @driver.action.send_keys(key).perform\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def press(key, delay: nil, text: nil)\n focus\n page.keyboard.press key, delay: delay, text: text\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def getch\n map_key(key_press)\n end", "def key_press *args\n\t\t\tevent(:key_press, *args)\n\t\tend", "def press_key(criteria,element,key)\r\n\t\t\tputs key\r\n\t\t\t@driver.find_element(criteria.to_sym, element).send_keys [:control, 'a'], key.to_sym\r\n\t\t\tsleep 1\r\n\t\t\t#http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Keys#KEYS-constant\r\n\t\tend", "def key_down key\n @keys.push key\n end", "def read_keypress(options = {})\n opts = { echo: false, raw: true }.merge(options)\n codes = unbufferred { get_codes(opts) }\n char = codes ? codes.pack('U*') : nil\n\n trigger_key_event(char) if char\n char\n end", "def keystroke(character, *special_keys)\n special_keys = [\"command\"] if special_keys.length == 0\n special_keys_as_applescript_array = special_keys.map { |k|\n \"#{k} down\"\n }.join(\", \")\n execute_applescript(%Q'\n tell application \"System Events\"\n set frontApp to name of first item of (processes whose frontmost is true)\n tell application frontApp\n keystroke \"#{character}\" using {#{special_keys_as_applescript_array}}\n end\n end tell\n ')\n end", "def key_pressed( event )\n @keys += [event.key]\n end", "def press key, options = {}\n key = 'Return' if key == 'ENTER'\n widget = options[:in] || Gtk::Window.toplevels.first\n event = Gdk::EventKey.new(Gdk::Event::KEY_PRESS)\n event.window = widget\n event.state |= Gdk::Window::CONTROL_MASK if key =~ /CTRL+/\n event.state |= Gdk::Window::MOD1_MASK if key =~ /ALT+/\n event.state |= Gdk::Window::SHIFT_MASK if key =~ /SHIFT+/\n event.keyval = Gdk::Keyval.from_name(key.split('+').last)\n widget.grab_focus\n event.send_event = true\n entry = Gdk::Keymap.default.get_entries_for_keyval(event.keyval).first\n event.hardware_keycode = entry[0]\n widget.signal_emit('key_press_event', event)\n process_events\nend", "def send_key(*args); end", "def keyevent(key, metastate = nil)\n @bridge.keyevent(key, metastate)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def send_keycode_to_selector keycode, selector\n keypress_script = \"var e = $.Event('keydown', { keyCode: #{keycode} }); $('#{selector}').trigger(e);\"\n page.driver.browser.execute_script(keypress_script)\n end", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def move_for_keypress(keypress); nil; end", "def key_pressed?(key)\r\n\t\tif (GetKeyState.call(VALUES[key]).abs & 0x8000 == 0x8000)\r\n\t\t\tKeyRepeatCounter[key] = 0\r\n\t\t\treturn true\r\n\t\tend\r\n\t\treturn false\r\n\tend", "def keyboard_send_keyevent(keyevent)\r\n adb_exec(\"shell input keyevent #{keyevent}\")\r\nend", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def key_released( event )\n @keys -= [event.key]\n end", "def process_key keycode, object\n return _process_key keycode, object, @window\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def unbind_key keycode\n @_key_args.delete keycode unless @_key_args.nil?\n @_key_map.delete keycode unless @_key_map.nil?\n end", "def accesskey(key) send_keys(key.to_sym) end", "def keypress\n key = input\n\n @keypress ||= Vedeu::Input::Translator.translate(key)\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def on_key(ch)\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def add(key)\n cmd = \"input keyevent #{map_key(key)};\"\n @sequence == \"\" ? @sequence = cmd : @sequence = @sequence + cmd\n end", "def key_combination(*keys)\n keys.each {|k| press(k) }\n keys.reverse.each {|k| release(k) }\n end", "def handle(key)\n case key\n when :left, :right, :space, :s\n @player_controller.events.trigger(:key, key)\n when :down, :up, :enter, :u\n @track_controller.events.trigger(:key, key)\n end\n end", "def process_keyboard\n ACCEPTED_KEYS.each {|key|\n if Input.repeat?(key[0])\n c = (key[0] != :kSPACE) ? Keyboard.add_char(Ascii::SYM[key[0]]) : \" \"\n process_add(c)\n #Sound.play_ok\n play_random_key_sound\n end\n }\n end", "def handle(key)\n case key\n when :left, :right, :space, :one, :two, :three, :four, :five, :six, :seven, :eight, :nine\n @player_controller.events.trigger(:key, key)\n when :down, :up, :enter, :u, :f, :s, :j, :k, :m, :h, :o\n @track_controller.events.trigger(:key, key)\n end\n end", "def key_press\n x = $stdin.getch\n x += handle_esc if x == \"\\e\"\n\n x\nend", "def getch\n\n end", "def send_keys(*key)\n @bridge.send_keys_to_active_element(key)\n end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def type(*keys)\n keys = normalize_keys(Array(keys))\n\n keys.each do |key|\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", type: type, **key)\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n end\n\n self\n end", "def send_keys(*args); end", "def press_element_key(id, key)\r\n element = find_by_id(id);\r\n keypress_on(element, key)\r\n end", "def keypress\n $prompt.keypress(\"Press space or enter to continue\", keys: [:space, :return])\nend", "def keyPressed(key, x, y)\n\n # If escape is pressed, kill everything. \n if (key == 27) \n # shut down our window \n glutDestroyWindow(@window)\n # exit the program...normal termination.\n exit(0) \n end\nend", "def move_for_keypress(window, pressed_buttons)\n # Generated once for each keypress\n until pressed_buttons.empty?\n button = pressed_buttons.shift\n case button\n when Gosu::KbUp then return :flip\n when Gosu::KbP then @conn.send_ping; return nil\n when Gosu::KbLeft, Gosu::KbRight # nothing\n else puts \"Ignoring key #{button}\"\n end\n end\n\n # Continuously-generated when key held down\n case\n when window.button_down?(Gosu::KbLeft) then :slide_left\n when window.button_down?(Gosu::KbRight) then :slide_right\n end\n end", "def on_char(evt)\n ch = evt.get_key_code\n mflag = evt.modifiers\n\n case ch\n when Wx::K_RIGHT : move_cursor_right(evt.shift_down)\n when Wx::K_LEFT : move_cursor_left(evt.shift_down)\n when Wx::K_DOWN : move_cursor_down(evt.shift_down)\n when Wx::K_UP : move_cursor_up(evt.shift_down)\n when Wx::K_BACK : on_key_back(evt)\n when Wx::K_DELETE : on_key_delete(evt)\n when Wx::K_TAB : on_key_tab(evt)\n when (mflag == Wx::MOD_CMD and ?a) # select all\n do_select_all\n when (mflag == Wx::MOD_CMD and ?c) # copy\n do_clipboard_copy\n when (mflag == Wx::MOD_CMD and ?x) # cut\n do_clipboard_cut\n when (mflag == Wx::MOD_CMD and ?v) # paste\n do_clipboard_paste\n when ((mflag == Wx::MOD_NONE or mflag == Wx::MOD_SHIFT) and 0x20..0x7e)\n if @cursor.area\n # redirect regular typing to on_char_AREANAME\n return self.send(\"on_char_#{AREAS[@cursor.area]}\", evt)\n end\n else # everything else is for dynamically handling key combo handlers\n m = []\n m << 'alt' if (mflag & Wx::MOD_ALT) != 0\n m << 'cmd' if (mflag & Wx::MOD_CMD) != 0\n m << 'shift' if (mflag & Wx::MOD_SHIFT) != 0\n mods = (m.empty?)? \"\" : \"_\" + m.join('_')\n\n ch = evt.get_key_code\n hex = ch.to_s(16).rjust(2,'0')\n meth=nil\n\n if (n=resolve_key_code(ch)) and respond_to?(\"on_key#{mods}_#{n}\")\n meth=\"on_key#{mods}_#{n}\"\n elsif respond_to?(\"on_key#{mods}_0x#{hex}\")\n meth=\"on_key#{mods}_#{hex}\"\n end\n\n if meth and ret=self.send(meth, evt)\n return ret\n else\n evt.skip()\n end\n end\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def send_keys(keys)\n platform.send_keys(keys)\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def keypress\n begin\n _call = direction\n if _call.present?\n _call.keypress(params) if defined?(_call.keypress)\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n end\n render :plain => '', content_type: \"text/html\", :status => 200\n end", "def handle_key ch\n if ch == 32\n toggle\n else\n super\n end\n end", "def clear_and_send_keys(*args)\r\n clear($focus_driver)\r\n send_keys(*args)\r\n end", "def ctrl_w() send_keys(:ctrl_w) end", "def ****_hidekeyboard\r\n begin\r\n\tif $driver.is_keyboard_shown\r\n\t $driver.press_keycode(4)\r\n\tend\r\n rescue Exception => e\r\n\t raise e.message\r\n\t raise e.backtrace.inspect\r\n end\r\nend", "def method_missing(sym, *args, &block)\n super if !args.empty? or block\n cmds = sym.to_s.split(\"_\")\n callsequence = \"\"\n cmds.each do |cmd|\n callsequence << case cmd.downcase\n when \"ctrl\" then \"^\"\n when \"shift\" then \"+\"\n when \"alt\" then \"!\"\n when \"win\" then \"#\"\n when \"enter\" then \"{ENTER}\"\n when \"return\" then \"{ENTER}\"\n when \"del\" then \"{DEL}\"\n else\n cmd\n end\n end\n send_keys(callsequence)\n end", "def key_pressed?(key)\n SDL::Key.press?(key)\n end", "def show_single_key\n c = read_char\n\n case c\n when \" \"\n pickUpItem()\n when \"i\"\n showInventory\n when \"m\"\n showMap\n when \"v\"\n inspectSurroundings\n puts \"working\"\n when \"q\"\n system ('clear && printf \"\\e[3J\"') or system (\"cls\")\n exit 0\n when \"k\"\n gameOver\n when \"\\e[A\"\n move(c)\n when \"\\e[B\"\n move(c)\n when \"\\e[C\"\n move(c)\n when \"\\e[D\"\n move(c)\n when \"\\u0003\"\n puts \"CONTROL-C\"\n exit 0\n end\nend", "def any_key\n puts \"\"\n puts \"Press any key to continue..\"\n STDIN.getch\n end", "def keypress\n return false unless key\n\n return true if key_defined? && keymap.use(key)\n\n return true if global_key? && keymap('_global_').use(key)\n\n Vedeu.log(type: :input, message: \"Key detected: #{key.inspect}\".freeze)\n\n false\n end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def hit(key, *modifiers)\n script = ''\n if key == '\"'\n type(key)\n return\n elsif key.index('0x') == 0\n script = hit_with_system_events(key, *modifiers)\n else\n script = hit_with_extra_suites(key, *modifiers)\n end\n execute_applescript(script)\n end", "def getch\n @window.getch\n end", "def ORIG_process_key keycode, object, window\n return :UNHANDLED if @_key_map.nil?\n blk = @_key_map[keycode]\n $log.debug \"XXX: _process key keycode #{keycode} #{blk.class}, #{self.class} \"\n return :UNHANDLED if blk.nil?\n if blk.is_a? OrderedHash \n #Ncurses::nodelay(window.get_window, bf = false)\n # if you set nodelay in ncurses.rb then this will not\n # wait for second key press, so you then must either make it blocking\n # here, or set a wtimeout here.\n #\n # This is since i have removed timeout globally since resize was happeing\n # after a keypress. maybe we can revert to timeout and not worry about resize so much\n Ncurses::wtimeout(window.get_window, 500) # will wait a second on wgetch so we can get gg and qq\n ch = window.getch\n # we should not reset here, resetting should happen in getch itself so it is consistent\n #Ncurses::nowtimeout(window.get_window, true)\n\n $log.debug \" process_key: got #{keycode} , #{ch} \"\n # next line ignores function keys etc. C-x F1, thus commented 255 2012-01-11 \n if ch < 0 #|| ch > 255\n return nil\n end\n #yn = ch.chr\n blk1 = blk[ch]\n # FIXME we are only returning the second key, what if form\n # has mapped first and second combo. We should unget keycode and ch. 2011-12-23 \n # check this out first.\n window.ungetch(ch) if blk1.nil? # trying 2011-09-27 \n return :UNHANDLED if blk1.nil? # changed nil to unhandled 2011-09-27 \n $log.debug \" process_key: found block for #{keycode} , #{ch} \"\n blk = blk1\n end\n if blk.is_a? Symbol\n if respond_to? blk\n return send(blk, *@_key_args[keycode])\n else\n ## 2013-03-05 - 19:50 why the hell is there an alert here, nowhere else\n alert \"This ( #{self.class} ) does not respond to #{blk.to_s} [PROCESS-KEY]\"\n # added 2013-03-05 - 19:50 so called can know\n return :UNHANDLED \n end\n else\n $log.debug \"rwidget BLOCK called _process_key \" if $log.debug? \n return blk.call object, *@_key_args[keycode]\n end\n #0\n end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def onKeyDown( *args )\r\n capture = relay_event( :onKeyDown, args )\r\n relay_event( :onSetCursor, [] )\r\n capture\r\n end", "def macNativeShortcut(element, key)\n\t\tputs key\n\t\tcase key\n\t\twhen 'x'\n\t\t\tputs \"something\"\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar event = new Event('cut', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(event);\n\t\t\t\t\")\n\n\t\twhen 'p'\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar pasteevent = new Event('paste', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(pasteevent);\n\t\t\t\t\")\n\t\tend\n\n\t\telement.native.send_keys [:command, key]\n\tend", "def pressKey\n STDIN.echo = false\n STDIN.raw!\n input = STDIN.getc.chr\n if input == \"\\e\" then\n input << STDIN.read_nonblock(3) rescue nil\n input << STDIN.read_nonblock(2) rescue nil\n end\nensure\n STDIN.echo = true\n STDIN.cooked!\n return input\nend", "def press_key_for_feature(key)\n # dirty hack to send an Enter keypress to chrome (cannot be sent directly, have to send :enter symbol)\n if key == 13\n send_char = :enter\n else\n send_char = key.chr\n end\n page.find('body').native.send_keys send_char\nend", "def safe_threadsafe_blocking_getch\n nonblocking_getch\n rescue Interrupt\n KEY_CANCEL\n end", "def send_keys(*args)\n @driver.switch_to.active_element.send_keys(*args)\n end", "def _handle_key ch\n begin\n ret = process_key ch, self\n $multiplier = 0\n bounds_check\n rescue => err\n $log.error \" TEXTPAD ERROR _handle_key #{err} \"\n $log.debug(err.backtrace.join(\"\\n\"))\n alert \"#{err}\"\n #textdialog [\"Error in TextPad: #{err} \", *err.backtrace], :title => \"Exception\"\n ensure\n padrefresh\n Ncurses::Panel.update_panels\n end\n return 0\n end", "def press?(key)\r\n\t\treturn ow_dt_i_press(key) if !VALUES.has_key?(key)\r\n\t\treturn true unless KeyRepeatCounter[key].nil?\r\n\t\treturn key_pressed?(key)\r\n\tend", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def getchar\n getch\n end", "def key_press(*args)\n options = Hash === args.last ? args.pop : {}\n keys = args\n raise ArgumentError, 'Must have at least one key argument' if keys.empty?\n begin\n key_down keys.first\n if keys.length == 1\n yield if block_given?\n else\n key_press(*(keys[1..-1] + [options]))\n end\n ensure\n key_up keys.first\n end\n end", "def kbhit\n @@kbhit ||= Fiddle::Function.new(CRT_HANDLE[\"_kbhit\"], [], TYPE_INT)\n @@kbhit.call\n end" ]
[ "0.72402436", "0.68287456", "0.68287456", "0.64481556", "0.63882345", "0.63882345", "0.6264518", "0.6153972", "0.58997905", "0.58930486", "0.5874915", "0.5874915", "0.5845825", "0.5840914", "0.57237774", "0.5711504", "0.5611759", "0.5599707", "0.5574866", "0.5557808", "0.55496085", "0.5549337", "0.5500429", "0.5459558", "0.5452731", "0.5426504", "0.5425532", "0.53916514", "0.5380965", "0.5359646", "0.53512484", "0.5338861", "0.530688", "0.52968264", "0.5294733", "0.5294733", "0.5290881", "0.52835935", "0.52621216", "0.52279013", "0.5214248", "0.5201025", "0.5200131", "0.51568216", "0.5147971", "0.51353323", "0.5131373", "0.51291186", "0.51277626", "0.5127708", "0.5085383", "0.50844324", "0.50844324", "0.5076563", "0.506318", "0.5059579", "0.50543886", "0.5052258", "0.5049973", "0.5039335", "0.50389844", "0.5034775", "0.5033194", "0.5031808", "0.50287515", "0.5014318", "0.5005433", "0.5005031", "0.50023353", "0.49995828", "0.4999267", "0.49908575", "0.49774116", "0.49440104", "0.49416313", "0.49340475", "0.49134228", "0.49089283", "0.48996818", "0.48882088", "0.4884616", "0.48824936", "0.48703697", "0.48652175", "0.48572138", "0.48548228", "0.48376644", "0.4832904", "0.4827698", "0.48164582", "0.4812686", "0.48113546", "0.48113537", "0.4808171", "0.48062837", "0.4788147", "0.47859898", "0.47823483", "0.47794753" ]
0.5305396
34
Simulates a user releasing a key. +keycode+ is the numeric keycode of the key to be released, normally the ASCII value of that key.
def key_up locator, keycode command 'keyUp', locator, keycode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def key_released( event )\n @keys -= [event.key]\n end", "def send_keycode(keycode)\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::DOWN))\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::UP))\n end", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def unbind_key keycode\n @_key_args.delete keycode unless @_key_args.nil?\n @_key_map.delete keycode unless @_key_map.nil?\n end", "def released( key )\n return KeyReleaseTrigger.new( key )\nend", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_stroke(keycodeText)\n append_to_script \"key_stroke \\\"#{keycodeText}\\\"\"\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def press(key_sequence)\n end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def keyPressed(key, x, y)\n\n # If escape is pressed, kill everything. \n if (key == 27) \n # shut down our window \n glutDestroyWindow(@window)\n # exit the program...normal termination.\n exit(0) \n end\nend", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def press_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_down @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def key_down key\n @keys.push key\n end", "def key_press locator, keycode\r\n command 'keyPress', locator, keycode\r\n end", "def key_press locator, keycode\r\n command 'keyPress', locator, keycode\r\n end", "def key_down_event _value\n send_cmd(\"key_down_event #{_value}\")\n end", "def send_key(keycode, ctrl=false, alt=false, shift=false)\n matchingshortcuts = @shortcuts.select { |shortcut|\n shortcut.keycode == keycode && shortcut.ctrl == ctrl &&\n shortcut.alt == alt && shortcut.shift == shift\n }\n counter = 0\n matchingshortcuts.each { |shortcut|\n action = shortcut.action\n @actions[action].each { |handler|\n handler.call(shortcut)\n counter+=1\n }\n }\n counter\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def keypress(key = nil, name = nil)\n Vedeu.trigger(:key, key)\n\n return false unless key\n\n new(key, name).keypress\n end", "def close_window_with_key_press(win_name, key, *opts)\n wait_start\n key_press_direct(key, *opts)\n wait_for_window_close(win_name)\n end", "def close_window_with_key_press(win_name, key, *opts)\n wait_start\n key_press_direct(key, *opts)\n wait_for_window_close(win_name)\n end", "def keypress(key)\n puts \"Got key: #{key} (#{key.class})\"\n if key.is_a?(String)\n if key.length == 1\n # Assume letter\n @vnc.keyevent(key.chr, true)\n @vnc.keyevent(key.chr, false)\n else\n # Assume keysym\n puts \"I don't know how to type '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end\n else\n # type printables, key others.\n if 32.upto(127).include?(key)\n @vnc.keyevent(key, true)\n @vnc.keyevent(key, false)\n else\n case key\n when 8 \n @vnc.keyevent(0xff08, true)\n @vnc.keyevent(0xff08, false)\n when 13\n @vnc.keyevent(0xff0D, true)\n @vnc.keyevent(0xff0D, false)\n else\n puts \"I don't know how to type web keycode '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end # case key\n end # if 32.upto(127).include?(key)\n end # if key.is_a?String\n return nil\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def release(key, value)\n return\n end", "def close_menu_with_key_press(menu_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_menu_closed(menu_name)\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def decr(key); end", "def decr(key); end", "def keystroke(character, *special_keys)\n special_keys = [\"command\"] if special_keys.length == 0\n special_keys_as_applescript_array = special_keys.map { |k|\n \"#{k} down\"\n }.join(\", \")\n execute_applescript(%Q'\n tell application \"System Events\"\n set frontApp to name of first item of (processes whose frontmost is true)\n tell application frontApp\n keystroke \"#{character}\" using {#{special_keys_as_applescript_array}}\n end\n end tell\n ')\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def ****_hidekeyboard\r\n begin\r\n\tif $driver.is_keyboard_shown\r\n\t $driver.press_keycode(4)\r\n\tend\r\n rescue Exception => e\r\n\t raise e.message\r\n\t raise e.backtrace.inspect\r\n end\r\nend", "def remove_key(key)\n\t\tdelete(\"/user/keys/#{escape(key)}\")\n\tend", "def remove_key(key)\n\t\tdelete(\"/user/keys/#{escape(key)}\")\n\tend", "def invoke_drop(key); end", "def press_key(letter)\n advance_rotors\n @plugboard.translate(letter)\n end", "def keypress &block\n @keyblock = block\n end", "def remove\n key = shift_argument\n if key.nil? || key.empty?\n error(\"Usage: heroku keys:remove KEY\\nMust specify KEY to remove.\")\n end\n validate_arguments!\n\n action(\"Removing #{key} SSH key\") do\n api.delete_key(key)\n end\n end", "def release_key(key_id)\r\n @transport.iso_apdu! :ins => 0x28, :p1 => key_id\r\n return true\r\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def decrby(key, decrement)\n send_command([:decrby, key, Integer(decrement)])\n end", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def decrease key, amount=1\n @lock.write_sync do\n return unless @data[key].nil? || Numeric === @data[key]\n @data[key] ||= 0\n @data[key] -= amount\n end\n end", "def key_combination(*keys)\n keys.each {|k| press(k) }\n keys.reverse.each {|k| release(k) }\n end", "def getch\n map_key(key_press)\n end", "def decrby(key, decrement); end", "def decrby(key, decrement); end", "def shell_registry_unloadkey(key)\n key = normalize_key(key)\n shell_registry_cmd_result(\"unload \\\"#{key}\\\"\")\n end", "def keyevent(key, metastate = nil)\n @bridge.keyevent(key, metastate)\n end", "def wdelch\n Ncurses.wdelch(pointer)\n end", "def registry_deletekey(key, view = REGISTRY_VIEW_NATIVE)\n if session_has_registry_ext\n meterpreter_registry_deletekey(key, view)\n else\n shell_registry_deletekey(key, view)\n end\n end", "def decr(key)\n node_for(key).decr(key)\n end", "def delete_key(key)\n end", "def deActivateKey _args\n \"deActivateKey _args;\" \n end", "def move_for_keypress(keypress); nil; end", "def key_released?(key)\n @prev_down.index(key) and @down.index(key).nil?\n end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def button_down(key)\n end", "def activate_down(key)\n key_down.activate(key)\n key_held.deactivate(key)\n key_up.deactivate(key)\n end", "def delete(key)\n timeout_retry(3, 3){\n write \"DEL #{key}\\r\\n\"\n integer_reply == 1\n }\n end", "def _handle_key ch\n begin\n ret = process_key ch, self\n $multiplier = 0\n bounds_check\n rescue => err\n $log.error \" TEXTPAD ERROR _handle_key #{err} \"\n $log.debug(err.backtrace.join(\"\\n\"))\n alert \"#{err}\"\n #textdialog [\"Error in TextPad: #{err} \", *err.backtrace], :title => \"Exception\"\n ensure\n padrefresh\n Ncurses::Panel.update_panels\n end\n return 0\n end", "def _rl_unget_char(key)\r\n if (ibuffer_space()!=0)\r\n @pop_index-=1\r\n if (@pop_index < 0)\r\n @pop_index = @ibuffer_len - 1\r\n end\r\n @ibuffer[@pop_index] = key\r\n return (1)\r\n end\r\n return (0)\r\n end", "def decr(key, increment=nil)\n timeout_retry(3, 3){\n if increment\n write \"DECRBY #{key} #{increment}\\r\\n\"\n else\n write \"DECR #{key}\\r\\n\"\n end \n integer_reply\n }\n end", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def shell_registry_deletekey(key, view)\n key = normalize_key(key)\n # REG DELETE KeyName [/v ValueName | /ve | /va] [/f]\n shell_registry_cmd_result(\"delete \\\"#{key}\\\" /f\", view)\n end", "def mouse_release *args\n\t\t\tevent(:mouse_release, *args)\n\t\tend", "def down_key\n @last = @choice\n @choice = (@choice < 2 ? @choice += 1 : 0)\n @choice_sound.play(1, 0.5, false)\n end", "def release(key, value)\n waiters = pop_waiters(key)\n return unless waiters\n while w = waiters.pop\n w.resume(value)\n end\n end", "def process_key keycode, object\n return _process_key keycode, object, @window\n end", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def handle(key)\n case key\n when :left, :right, :space, :s\n @player_controller.events.trigger(:key, key)\n when :down, :up, :enter, :u\n @track_controller.events.trigger(:key, key)\n end\n end", "def decr(key, value = 1)\n mon_synchronize do\n perform [\"decr\", key, value], proc: T_INT\n end\n end", "def press(key, delay: nil, text: nil)\n focus\n page.keyboard.press key, delay: delay, text: text\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def delete(key)\n @succ.delete key\n end", "def send_keycode_to_selector keycode, selector\n keypress_script = \"var e = $.Event('keydown', { keyCode: #{keycode} }); $('#{selector}').trigger(e);\"\n page.driver.browser.execute_script(keypress_script)\n end", "def remove_key(key)\n delete(\"/users/ssh_keys/#{escape(key)}\").to_s\n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def handle_key(ch)\n ret = process_key ch, self\n return :UNHANDLED if ret == :UNHANDLED\n 0\n end", "def destroy\n @key.destroy\n end", "def clear\n @keys_pressed.clear\n @keys_released.clear\n @keys_down.cleae\n end", "def kill(sig=DEFAULT_SIGNAL, key)\n @children[key].kill sig\n end", "def registry_unloadkey(key)\n if session_has_registry_ext\n meterpreter_registry_unloadkey(key)\n else\n shell_registry_unloadkey(key)\n end\n end", "def decr(key, value = 1)\n mon_synchronize do\n perform [\"decr\", key, value], :proc => T_INT\n end\n end", "def hide_keyboard(close_key = nil, strategy = nil)\n @bridge.hide_keyboard close_key, strategy\n end", "def hide_keyboard(close_key = nil, strategy = nil)\n @bridge.hide_keyboard close_key, strategy\n end", "def key_pressed?(key)\n key_const = Gosu.const_get(:\"Kb#{key.to_s.gsub(/\\b\\w/){$&.upcase}}\")\n button_down?(key_const)\n end", "def delete key\n write_data_entry key, nil, true\n @keydict[key] = nil\n\n sync\n end" ]
[ "0.6685104", "0.6529529", "0.63903046", "0.62510663", "0.6145858", "0.60009706", "0.5849529", "0.57238495", "0.57238495", "0.5618662", "0.55491483", "0.55491483", "0.5510891", "0.5435164", "0.5338007", "0.5316883", "0.52794236", "0.52316177", "0.522361", "0.5180588", "0.5162421", "0.5146677", "0.5146677", "0.5144843", "0.51267976", "0.51258904", "0.50545263", "0.5025854", "0.5025854", "0.49975842", "0.49962494", "0.49962494", "0.4867349", "0.48638108", "0.48081386", "0.47979963", "0.47979963", "0.47924906", "0.47732455", "0.47444358", "0.47219577", "0.47219577", "0.47211686", "0.47102237", "0.4709803", "0.46944505", "0.46870264", "0.46719405", "0.46709102", "0.46709102", "0.46566856", "0.46529204", "0.46465233", "0.4625848", "0.46214953", "0.4616625", "0.4616625", "0.45999834", "0.45967317", "0.45846048", "0.45750627", "0.45731452", "0.45725593", "0.45510137", "0.45478538", "0.45312864", "0.451582", "0.45079255", "0.45015672", "0.44984958", "0.4497802", "0.44656318", "0.44472143", "0.4445399", "0.4444721", "0.44426894", "0.44425973", "0.44319883", "0.44233543", "0.44075397", "0.4369965", "0.43607315", "0.43601137", "0.4358096", "0.43555078", "0.43541282", "0.43500227", "0.43469116", "0.4346426", "0.4339717", "0.4335302", "0.43307096", "0.43262845", "0.43250382", "0.43221483", "0.43212575", "0.43212575", "0.4311131", "0.43052447" ]
0.56391865
10
Simulates a user hovering a mouse over the specified element.
def mouse_over locator command 'mouseOver', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def hover_element (element)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n wait_until{select.visible?}\n\n select.hover\n end", "def simulate_hover(element)\n page.execute_script(\"$('#{element}').show()\")\n wait_a_sec_for_selenium\n end", "def hover_click(element)\n driver.action.click(element).perform\n end", "def native_hover\n # original watir-webdriver code for hover\n assert_exists\n assert_has_input_devices_for :hover\n\n driver.action.move_to(@element).perform\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def hover(name, *args)\n widget(name, *args).hover\n end", "def hover_over_element(access_type, access_name)\n element = $driver.find_element(:\"#{access_type}\" => \"#{access_name}\")\n $driver.action.move_to(element).perform\nend", "def mouse_over(x: 1, y: 1)\n Log.debug(\"[GRIDIUM::Element] Triggering mouse over for (#{self})...\")\n if element.enabled?\n $verification_passes += 1\n ElementExtensions.mouse_over(self, x: x, y: y)\n else\n Log.error('[GRIDIUM::Element] Cannot mouse over. Element is not present.')\n end\n end", "def hover_event(element)\n # replaces element colour with overlay only\n # while mouse over\n element.colour = OVERLAY\nend", "def mouse_over_link(link_id)\r\n\r\n link_using_id = get_link_using_id(link_id)\r\n\r\n link_using_id.fire_event 'onMouseOver'\r\n\r\n end", "def hover_over_icon\n element = Element.new(locator_to_node_cover)\n $browser.execute_script(\"var evt = document.createEvent('MouseEvents');\" +\n \"evt.initMouseEvent('mouseover',true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0,null);\" +\n \"arguments[0].dispatchEvent(evt);\", element.get_element)\n end", "def hover_over_element(access_type,access_name)\n element = WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}\n $driver.action.move_to(element).perform\nend", "def hover_over_sponsor(sponsor)\n page.execute_script(\"$('#{sponsor_container_selector(sponsor)}').trigger('mouseover')\")\nend", "def hover(componentName, componentInfo = nil, delay = 500)\n driver.action.move_to(get_component(componentName, componentInfo)).perform\n java.lang.Thread.sleep(delay)\nend", "def on_hover(&block)\n hover_handlers << block\n self\n end", "def mouse_over(criteria,value,seconds_over)\r\n\t\t\t\r\n\t\t\telement = @driver.find_element(criteria.to_sym,value)\t\r\n\t\t\t\r\n\t\t\tputs element\r\n\t\t\t\r\n\t\t\t@driver.action.move_to(element).perform\r\n\t\t\tsleep seconds_over\r\n\t\tend", "def mouse_in(e)\n @state = :hover\n end", "def mouse_over(&block)\n self.listen_to :event => :mousemove, :with => :location, &block\n end", "def hover(componentName, delay = 500, componentInfo = nil)\n driver.action.move_to(get_component(componentName, componentInfo)).perform\n java.lang.Thread.sleep(delay)\nend", "def hover_click(*args)\n if args.size == 1\n driver.action.click(element).perform\n else\n sym,id = args\n driver.action.click(driver.find_element(sym.to_sym,id)).perform\n end\n\n end", "def hover\n root_node.hover\n end", "def hover_over_link(text)\n find(\"a\", text: text).hover\n end", "def mouseover_and_click(method, element_over, element_click)\n\tp(\"-- clicking on element: \" + element_click.to_s + \" by \" + method.to_s)\n\t@selenium.action.move_to(@selenium.find_element(method, element_over)).perform\n\tsleep 5\n\t@selenium.find_element(method, element_click).click\n end", "def mouse_over(&block)\n self.listen_to :event => :mouseover do |script|\n script << \"mouse_location = last_mouse_location;\"\n\n yield script, :mouse_location\n end\n end", "def hover\n base.image_for(\"#{name}_hover\")\n end", "def mouse_over(text, x: 0, y: 0, index: 1)\n Element.new(\"Clicking #{text}\", :xpath, \"(//*[text()=\\\"#{text}\\\"])[#{index}]\").mouse_over(x: x, y: y)\n end", "def hover\n next_btn = page.find('.ytp-play-button')\n mute_btn = page.find('.ytp-mute-button')\n page.driver.browser.action.move_to(next_btn.native).perform\n page.driver.browser.action.move_to(mute_btn.native).perform\nend", "def hover_and_move_slow(how, what, move_x, move_y)\n $debug and print \"In hover_and_move_slow: #{how}, #{what}, #{move_x}, #{move_y}\\n\"\n distance = [ 40, ((move_x + move_y)/4).abs].max\n e=$driver.find_element(how, what)\n $driver.action.click_and_hold(e).perform\n\n x = e.location.x\n y = e.location.y\n\n goal_x = x + move_x\n goal_y = y + move_y\n\n while( (goal_x - x).abs > 5 or (goal_y - y).abs > 5 )\n diff_x = goal_x - x\n diff_y = goal_y - y\n\n while( diff_x.abs > distance )\n diff_x = diff_x / 2;\n end\n\n while( diff_y.abs > distance )\n diff_y = diff_y / 2;\n end\n\n $debug and print \"In hover_and_move_slow: moving x #{diff_x} and y #{diff_y}, given current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.move_by(diff_x, diff_y).perform\n\n #$debug and sleep 2\n\n e=$driver.find_element(how, what)\n x = e.location.x\n y = e.location.y\n end\n\n $debug and print \"In hover_and_move_slow: exited main loop, current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.release.perform\n end", "def wait_and_hover_click(sym,id)\n found = false\n #wait until an element with sym,id is displayed. When it is, hover click it\n @wait.until {\n elements = driver.find_elements(sym, id)\n elements.each do |element| \n if element.displayed?\n found = true\n @element = element\n end\n \n end\n found == true\n } \n self.hover_click(@element)\n end", "def hover_within(wrapper, locator, type)\n within(wrapper) do\n find(type.to_sym, locator).hover\n end\n end", "def isHover\n return @hover\n end", "def mouse_in(mouse_event)\n end", "def draw_element(*args)\n image_to_draw = hovering? && !image_hover.nil? ? image_hover : image\n image_to_draw.draw(point.x, point.y, *args)\n end", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def clicked\n @callback.call if mouse_over?\n end", "def pick_game_element\n @level.add_mouse(@input_controller.mouse_screen_coords)\n end", "def on_unhover(&block)\n unhover_handlers << block\n self\n end", "def open_suggestion(suggestion)\n suggestion.hover\n wait_until { suggestion.hovered? }\n end", "def mouse_released(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_released event')\nend", "def isAutoHoverOn _args\n \"isAutoHoverOn _args;\" \n end", "def hover_provider\n attributes.fetch(:hoverProvider)\n end", "def update\n \n if(isOverButton)\n @hover = true\n else\n @hover = false\n end\n \n if(@clicked)\n @clicked = false\n @hover = false\n return true\n end\n \n return false\n end", "def mouse_out(mouse_event)\n end", "def on_mouse_move(new_point)\n end", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def curatorMouseOver \n \"curatorMouseOver\" \n end", "def mouse_over_hill?\n state.hills.each_key do | hill |\n return true if inputs.mouse.point.inside_rect?(scale_up(hill))\n end\n\n false\n end", "def menu_relatorios\n relatorios_div.hover\n end", "def update\n @prev_hovering ||= false\n return unless @prev_hovering != hovering?\n\n (hovering? ? hover_handlers : unhover_handlers).each(&:call) if enabled?\n @prev_hovering = hovering?\n end", "def mouseX; end", "def mouse_move locator\r\n command 'mouseMove', locator\r\n end", "def clicked(mouse_event)\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def highlight_element(element)\n execute_script(\"arguments[0].style.border='3px solid red'\", element)\n end", "def click_on_element(element_name)\n $LOG.info \"clicking on element #{element_name} \"\n begin\n wait_and_find_element element_name\n click_ele = el(element_name)\n click_ele.click\n rescue Exception => e\n $LOG.error \"Can't click on element \"+ e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Can't click on element \"+ e.message\n end\n end", "def mouse_over_target?\n inputs.mouse.point.inside_rect?(scale_up(state.target))\n end", "def mouse_up *args; end", "def mouse_over_hill2?\n state.hills.each_key do | hill |\n return true if inputs.mouse.point.inside_rect?(move_and_scale_up(hill))\n end\n\n false\n end", "def mouseMove(event)\n self.sprites.each do | sprite |\n sprite.mouseMove(event.pos) if sprite.respond_to?(:mouseMove)\n end\n end", "def mouse_press *args\n\t\t\tevent(:mouse_press, *args)\n\t\tend", "def mouse_out locator\r\n command 'mouseOut', locator\r\n end", "def set_mouse_position(x, y); end", "def ListView_SetHoverTime(hwndLV, dwHoverTimeMs)\n send_listview_message(hwndLV, :SETHOVERTIME, lparam: dwHoverTimeMs)\n end", "def mouse_over_star?\n inputs.mouse.point.inside_rect?(scale_up(state.star))\n end", "def press element\n element.perform :press\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def initialize(point, image, image_hover=nil)\n super()\n @point = point\n @image = image\n @image_hover = image_hover\n @click_handlers = []\n @hover_handlers = []\n @unhover_handlers = []\n @enabled = true\n\n puts \"WARNING: different image size for hover on MouseElement\" \\\n unless images_safe?\n end", "def emulate_lowrez_mouse args\n #Declares the mouse as a new entity and sets values for the x and y variables.\n args.state.new_entity_strict(:lowrez_mouse) do |m|\n m.x = args.mouse.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1\n m.y = args.mouse.y.idiv(TINY_SCALE)\n\n #If the mouse is clicked, the click variable stores the mouse click's position.\n #Otherwise, the mouse is not considered to be clicked or down.\n if args.mouse.click\n m.click = [\n args.mouse.click.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,\n args.mouse.click.point.y.idiv(TINY_SCALE)\n ]\n m.down = m.click\n else\n m.click = nil\n m.down = nil\n end\n\n #If the mouse is up, the position of the mouse is stored in the up variable.\n #Otherwise, the mouse is not considered to be up.\n if args.mouse.up\n m.up = [\n args.mouse.up.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,\n args.mouse.up.point.y.idiv(TINY_SCALE)\n ]\n else\n m.up = nil\n end\n end\nend", "def mouse_over?\n\t\tmouse_x = @janela_pai.mouse_x\n\t\tmouse_y = @janela_pai.mouse_y\n\t\tmouse_x > @x and mouse_x < @x + @largura_campo and\n\t\tmouse_y > @y and mouse_y < @y + height\n\tend", "def tooltip(hover_element_id, text, title='')\n content = \"<div style='width: 25em'>#{textilize(text)}</div>\"\n \"<script>\" +\n \"new Tip('#{hover_element_id}', '#{escape_javascript(content)}',\"+\n \"{title : '#{escape_javascript title}', className: 'silver_smaller_div',\"+\n \"showOn: 'mouseover', hideOn: { event: 'mouseout' }, fixed: false});\"+\n \"</script>\"\n end", "def mouse_motion *args\n\t\t\tevent(:mouse_motion, nil, *args)\n\t\tend", "def update_mouse_blink_position\n case $game_player.mouse_over\n when 1 then @mouse_blink.x = @layout.x + (5)\n when 2 then @mouse_blink.x = @layout.x + (5 + 32)\n when 3 then @mouse_blink.x = @layout.x + (5 + 64)\n when 4 then @mouse_blink.x = @layout.x + (5 + 96)\n when 5 then @mouse_blink.x = @layout.x + (5 + 128)\n when 6 then @mouse_blink.x = @layout.x + (5 + 160)\n when 7 then @mouse_blink.x = @layout.x + (5 + 192)\n when 8 then @mouse_blink.x = @layout.x + (5 + 224)\n when 9 then @mouse_blink.x = @layout.x + (5 + 256)\n end\n end", "def change_picture\n profile_pic_arrow_element.fire_event(\"onclick\")\n self.link(:id=>\"changepic_container_trigger\").click\n self.class.class_eval { include ChangePicturePopUp }\n end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def rollover(mx, my)\n @rollover_on = r.contains(mx, my)\n end", "def go_to_preferences\n page.find('.account').trigger(:mouseover)\n click_link \"preferences\"\n page.should have_content(\"Edit Introductory Email\")\n end", "def mouse_over_target2?\n inputs.mouse.point.inside_rect?(move_and_scale_up(state.target))\n end", "def edit_description\n self.div(:id=>\"contentmetadata_description_container\").fire_event \"onmouseover\"\n self.div(:id=>\"contentmetadata_description_container\").fire_event \"onclick\"\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouse_move_to element.ref, right_by, down_by\n end", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def display_shortcut(element)\n # Interface method\n end", "def mouse_over_star2?\n inputs.mouse.point.inside_rect?(move_and_scale_up(state.star))\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def on_click(elem)\n elem.fire_event('onClick')\n end", "def rollover()\n puts \"*rollover*\"\n end", "def mouse_x\n end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def fire_events_for_mouse_movement\n current_state.each {|cs| cs.fire_events_for_mouse_movement }\n end", "def mouse_over?\n return @window.mouse_x.between?(@x, @x+@width) && @window.mouse_y.between?(@y, @y+@height)\n end", "def click\n Log.Trace(\"Clicking on #{@symbolicName}\")\n mouseClick(waitForObject(@symbolicName))\n Log.AppendLog(@@logCmd.click(self))\n end", "def hovering?(slot)\n\t\t\tarea = [(slot.left..(slot.left + slot.width)).to_a, (slot.top..(slot.top + slot.height))]\n\t\t\tpointer = [mouse[1], mouse[2]]\n\t\t\tif area[0].include?(pointer[0]) && area[1].include?(pointer[1])\n\t\t\t\ttrue\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend", "def double_click(element_name)\n begin\n $driver.action.double_click(el(element_name)).perform\n rescue Exception => e\n $LOG.error \"error in perform double click on element \\n element name : #{element_name} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in perform double click on element \\n element name : #{element_name} \"+e.message\n end\n end", "def draw_flyover(locator, options = {})\n attribute_name = options.fetch(:attribute, 'title')\n offset_x = options.fetch(:offset_x, 5)\n offset_y = options.fetch(:offset_y, 15)\n from_last_pos = options.fetch(:from_last_pos, false)\n draw_symbol = options.fetch(:draw_symbol, false)\n\n symbol_id = random_id\n tooltip_id = random_id\n\n execute_script(%(\n var element = arguments[0];\n if (! window.rudraTooltipSymbol) {\n window.rudraTooltipSymbol = 9311;\n }\n if (! window.rudraTooltipLastPos) {\n window.rudraTooltipLastPos = { x: 0, y: 0 };\n }\n var rect = element.getBoundingClientRect();\n var title = element.getAttribute(\"#{attribute_name}\") || 'N/A';\n var left = window.scrollX + rect.left;\n var top = window.scrollY + rect.top;\n if (#{draw_symbol}) {\n window.rudraTooltipSymbol++;\n var symbol = document.createElement('div');\n symbol.id = \"#{symbol_id}\";\n symbol.textContent = String.fromCharCode(rudraTooltipSymbol);\n symbol.style.color = '#f00';\n symbol.style.display = 'block';\n symbol.style.fontSize = '12px';\n symbol.style.left = (left - 12) + 'px';\n symbol.style.position = 'absolute';\n symbol.style.top = top + 'px';\n symbol.style.zIndex = '99999';\n document.body.appendChild(symbol);\n }\n var tooltip = document.createElement('div');\n tooltip.id = \"#{tooltip_id}\";\n tooltip.textContent = (#{draw_symbol}) ?\n String.fromCharCode(rudraTooltipSymbol) + \" \" + title : title;\n tooltip.style.position = 'absolute';\n tooltip.style.color = '#000';\n tooltip.style.backgroundColor = '#F5FCDE';\n tooltip.style.border = '3px solid #f00';\n tooltip.style.fontSize = '12px';\n tooltip.style.zIndex = '99999';\n tooltip.style.display = 'block';\n tooltip.style.height = '16px';\n tooltip.style.padding = '2px';\n tooltip.style.verticalAlign = 'middle';\n tooltip.style.top = ((#{from_last_pos}) ?\n window.rudraTooltipLastPos.y : (top + #{offset_y})) + 'px';\n tooltip.style.left = ((#{from_last_pos}) ?\n window.rudraTooltipLastPos.x : (left + #{offset_x})) + 'px';\n document.body.appendChild(tooltip);\n if (tooltip.scrollHeight > tooltip.offsetHeight) {\n \ttooltip.style.height = (tooltip.scrollHeight + 3) + 'px';\n }\n var lastPos = tooltip.getBoundingClientRect();\n window.rudraTooltipLastPos = {\n x: window.scrollX + lastPos.left, y: window.scrollY + lastPos.bottom\n };\n return;\n ), find_element(locator))\n\n find_element(\"id=#{tooltip_id}\")\n end", "def custom_click(selector)\n selector.click\nrescue Capybara::Poltergeist::MouseEventFailed\n selector.trigger('click')\nend", "def change_picture\n self.div(:class=>\"entity_profile_picture_down_arrow\").fire_event(\"onclick\")\n self.link(:id=>\"changepic_container_trigger\").click\n self.class.class_eval { include ChangePicturePopup }\n end", "def pick element\n element.perform :pick\n end", "def menu_email\n email_label.hover\n end", "def highlight(element)\n if is_here?(element)\n engine.execute_script(\"arguments[0].setAttribute\"\\\n \"('martaclass','foundbymarta')\", element)\n end\n end" ]
[ "0.7789843", "0.7561055", "0.75514287", "0.7413604", "0.7379427", "0.72173977", "0.6907109", "0.6802585", "0.677844", "0.6562503", "0.64924705", "0.6471078", "0.6438174", "0.64250255", "0.6333567", "0.6316942", "0.631517", "0.6278317", "0.62777287", "0.6232908", "0.6182475", "0.6128801", "0.5953479", "0.5953468", "0.5837484", "0.5674534", "0.56450385", "0.5642321", "0.5500734", "0.5437988", "0.54354954", "0.543296", "0.5396899", "0.5316233", "0.52957046", "0.5220489", "0.5207315", "0.50810295", "0.49877158", "0.4950635", "0.49451104", "0.4886059", "0.48798", "0.48213887", "0.4819509", "0.48180106", "0.48131707", "0.47992688", "0.4784986", "0.47673795", "0.47315153", "0.4722861", "0.47174728", "0.471746", "0.47057524", "0.4693448", "0.46895534", "0.46827453", "0.4681319", "0.46799254", "0.467964", "0.46735105", "0.46659562", "0.46158203", "0.45999566", "0.45987293", "0.45955515", "0.45723203", "0.45645118", "0.45640248", "0.45625678", "0.45591053", "0.4524836", "0.45239207", "0.4517251", "0.45146105", "0.4495144", "0.44805247", "0.44727543", "0.44703996", "0.44544116", "0.44450065", "0.44437757", "0.4439806", "0.44275674", "0.4425792", "0.44257736", "0.44186294", "0.44109178", "0.43976545", "0.43853533", "0.43773594", "0.43739402", "0.43589976", "0.43544036", "0.433357", "0.43275365", "0.43198097", "0.4319439" ]
0.65184844
11
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
def mouse_down locator command 'mouseDown', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def press element\n element.perform :press\n end", "def click_and_hold(element = T.unsafe(nil), button: T.unsafe(nil), device: T.unsafe(nil)); end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def release_mouse(button)\n XDo::FFILib.xdo_mouseup @_xdo_pointer, @_window, button\n end", "def press_mouse(button)\n XDo::FFILib.xdo_mousedown @_xdo_pointer, @_window, button\n end", "def click_mouse(button)\n XDo::FFILib.xdo_click @_xdo_pointer, @_window, button\n end", "def press_element_key(id, key)\r\n element = find_by_id(id);\r\n keypress_on(element, key)\r\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def mouse_pressed\n return unless button.clicked(mouse_x, mouse_y)\n\n population.selection\n population.reproduction\nend", "def mouse_up *args; end", "def mouseup(btn = 'left')\n compatible_call :mouseup, btn\n end", "def button_up(id)\n case id\n when Gosu::MsLeft\n if iterate_element() != nil\n element = iterate_element()\n click_event(element)\n end\n end\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def press\n\t\t@current_phase = :click\n\t\t\n\t\t\n\t\t# if there has been a mouse event\n\t\tpoint = @mouse_position_callback.call(@current_phase)\n\t\t\n\t\t\n\t\t# store the initial point to be able to trigger mouse drag\n\t\t@origin = point\n\t\t\n\t\t\n\t\t@active_action = @parse_input_callback.call(:click, point)\n\t\t@active_action.press(point)\n\t\t\n\tend", "def mouse_press *args\n\t\t\tevent(:mouse_press, *args)\n\t\tend", "def hover_click(element)\n driver.action.click(element).perform\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def mousedown(btn = 'left')\n compatible_call :mousedown, btn\n end", "def mouseover_and_click(method, element_over, element_click)\n\tp(\"-- clicking on element: \" + element_click.to_s + \" by \" + method.to_s)\n\t@selenium.action.move_to(@selenium.find_element(method, element_over)).perform\n\tsleep 5\n\t@selenium.find_element(method, element_click).click\n end", "def onClick(block=nil)\n @gtkEvent.signal_connect(\"button_release_event\") { |_, event|\n isClick(event.x.truncate,event.y.truncate)\n }\n end", "def unclicked(mouse_event)\n end", "def click\r\n start_point = screen.find ident\r\n click_x = start_point.x + offset_x\r\n click_y = start_point.y + offset_y\r\n\r\n screen.click click_x, click_y\r\n end", "def macNativeShortcut(element, key)\n\t\tputs key\n\t\tcase key\n\t\twhen 'x'\n\t\t\tputs \"something\"\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar event = new Event('cut', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(event);\n\t\t\t\t\")\n\n\t\twhen 'p'\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar pasteevent = new Event('paste', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(pasteevent);\n\t\t\t\t\")\n\t\tend\n\n\t\telement.native.send_keys [:command, key]\n\tend", "def button_down(id)\n click_handlers.each(&:call) if enabled? && id == Gosu::MS_LEFT &&\n within_bounds?(mouse_point)\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def press_key(criteria,element,key)\r\n\t\t\tputs key\r\n\t\t\t@driver.find_element(criteria.to_sym, element).send_keys [:control, 'a'], key.to_sym\r\n\t\t\tsleep 1\r\n\t\t\t#http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Keys#KEYS-constant\r\n\t\tend", "def click\n @clicked_x = @x\n @clicked_y = @y\n fire(:click, @clicked_x, @clicked_y)\n end", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def mouse_pressed\n # Check to see if the mouse was clicked on the box and if so create\n # a real spring and bind the mouse location to the box with a spring\n return unless box.contains(mouse_x, mouse_y)\n\n @spring = spring.bind(mouse_x, mouse_y, box)\nend", "def mouseButton()\n @view__.mouseButton\n end", "def on_click(elem)\n elem.fire_event('onClick')\n end", "def click_button(button = T.unsafe(nil)); end", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def press(point)\n\t\t\n\tend", "def double_click(element = T.unsafe(nil), device: T.unsafe(nil)); end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def click\n `#@native.click()`\n end", "def button_down(id)\n if id == Gosu::Button::KbEscape\n close\n end\n end", "def click_element (element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if internally\n script = <<-JS\n arguments[0].click();\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n select.click\n end\n end", "def clickButton(buttonId)\n EnziUIUtility.clickElement(@driver, :id, buttonId)\n sleep(10)\n end", "def button_down(id)\n # ENTER: launch A* algorithm\n if id == Gosu::KbReturn && ready?\n @grid.update_neighbors\n a_star\n @needs_reset = true\n end\n\n # SUPPR: clear window\n reset! if id == Gosu::KbDelete\n end", "def mouse_pressed\n flock << Boid.new(mouse_x, mouse_y)\nend", "def button_down(id)\n fire :button_down, id\n end", "def click\n `#@native.click()`\n self\n end", "def double_click_on(object)\n page.driver.browser.mouse.double_click(object.native)\n end", "def click; end", "def click; end", "def click; end", "def unclicked(e)\n puts \"Unclicked!\"\n end", "def click_on_button(button_name)\r\n\r\n given_button = $browser.button(id: \"#{button_name}\")\r\n\r\n given_button.wait_until_present(2)\r\n\r\n given_button.click\r\n\r\n sleep(1)\r\n end", "def tap_element element\n tapAction = Appium::TouchAction.new\n tapAction.tap(element: element).perform\n puts \"TAP is Working \\\\o/\"\n end", "def button_down(id)\n super(id)\n unless @buttons_down.include?(id)\n @input_lag = INPUT_LAG\n @buttons_down << id\n end\n return unless PRINT_INPUT_KEY\n #print(\"Buttons currently held down: #{@buttons_down} T:#{@triggered}\\n\")\n print(\"Window button pressed: (#{id}) which is (#{self.get_input_symbol(id).to_s})\\n\")\n end", "def click(btn = 'left')\n compatible_call :click, btn\n end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def doubleclick(btn = 'left')\n compatible_call :doubleclick, btn\n end", "def clicked(mouse_event)\n end", "def pressed?() sdl_event.press end", "def click(driver = $focus_driver)\r\n begin\r\n driver.find_element(self).click\r\n Log.info(\"Element clicked #{self.how} => #{self.what}\")\r\n rescue StandardError => e\r\n Log.fail(\"Element not clicked #{self.how} => #{self.what}\" + e.message)\r\n end\r\n end", "def mouse_release *args\n\t\t\tevent(:mouse_release, *args)\n\t\tend", "def js_click(elem)\n self.execute_script('arguments[0].click();', elem)\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def button_up(id)\r\n $scene.button_up(id)\r\n end", "def click\n raise \"Must implement custom click method.\"\n end", "def mouse_released(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_released event')\nend", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def click(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES click mouse\n end tell\n `)\n end", "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def clicar(element)\n element.click\n end", "def pointer_down(button = T.unsafe(nil), device: T.unsafe(nil), **opts); end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def click_point(x, y, is_double = false)\n if is_double\n @java_obj.doubleClick(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n else\n @java_obj.click(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n end\n end", "def left_button_up(sender, selector, event)\n @canvas.ungrab\n @mouse_down = false\n flush_commands\n board_draw\n end", "def button_down(key)\n end", "def button_down(id)\n Log.start { \"GW#button_down...\" }\n Log.puts { \"button id: #{id.inspect}\" }\n # puts \"gosu enter (#{Gosu::KbEnter}) == #{ENTER_KEY}\"\n if Gosu::MsLeft == id\n Log.puts { \"got left mouse, now what...\" }\n if @answer_field.clicked?\n Log.puts { \"answer clicked\" }\n # Mouse click: Select text field based on mouse position.\n # Advanced: Move caret to clicked position\n self.text_input.move_caret(mouse_x) unless self.text_input.nil?\n @answer_field.text = \"\" # a bit abrupt\n self.text_input = @answer_field\n @answer_field.text = \"\" # a bit abrupt\n elsif @submit_button.clicked?\n Log.puts { \"submit\" }\n game.raw_response = @answer_field.text\n @answer_field.text = \"\" # a bit abrupt\n elsif @continue_button.clicked?\n Log.puts { \"continue\" }\n @game.sleep_end = Gosu::milliseconds - 1\n else\n Log.puts { \"no-op\" }\n end\n elsif ENTER_KEY == id #Gosu::KbEnter == id\n game.raw_response = @answer_field.text\n end\n Log.stop { \"GW#button_down...\" }\n end", "def left_button_down(sender, selector, event)\n @canvas.grab\n @mouse_down = true\n end", "def wait_for_press\n wait_for_presses(1)\n end", "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\tend", "def press(point)\n\t\t\t\t\n\t\t\tend", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def pay_button_tap(x=nil, y=nil)\n x = 720 if x==nil\n y = 1421 if y==nil\n Appium::Core::TouchAction.new(self).press( x, y).release.perform\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def button_down(id)\r\n $scene.button_down(id)\r\n end", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def mouse_down()\n mouse_down_at :center, :center\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def click(*args)\n\t\t\t# if no argument has been provided, click on the\n\t\t\t# window itself\n\t\t\th = (args.length == 0) ? @handle : child(args[0]).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def mouse_pressed(x, y)\n window_point = Geo3d::Vector.new(x,y)\n\n @sphere_point_when[:mouse_down] = window_to_sphere_space(window_point)\n @sphere_point_when[:mouse_draged] = @sphere_point_when[:mouse_down]\n end", "def release(button: T.unsafe(nil), device: T.unsafe(nil)); end", "def onClick(block=nil)\n return unless block_given?\n @gtkObject.signal_connect(\"button_release_event\") { |_, event|\n if event.button==Click::LEFT\n yield\n end\n }\n end", "def mouse_pressed\n super\n\n if mouse_button == RIGHT\n @right_mouse_down_x = mouseX\n @right_mouse_down_y = mouseY\n end\n end", "def click_button(value = nil)\n find_button(value).click\n end", "def setButton(button, mySample, doublePress=0)\n live_loop button.to_sym do\n use_real_time\n x = sync \"/osc*/2/#{button}\"\n x = x.choose\n sample mySample if doublePress===1\n sample mySample if doublePress===0 && x===1\n end\nend", "def key_press *args\n\t\t\tevent(:key_press, *args)\n\t\tend", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end" ]
[ "0.7458295", "0.71502155", "0.71259904", "0.6914235", "0.6856933", "0.6848331", "0.6602123", "0.6527265", "0.6421767", "0.6391393", "0.62895757", "0.6270785", "0.62118787", "0.61354506", "0.60891366", "0.6072993", "0.606333", "0.6012703", "0.59778637", "0.59750634", "0.59722733", "0.5942532", "0.59401953", "0.59379154", "0.58937746", "0.5873079", "0.5846805", "0.5845599", "0.58278", "0.5808377", "0.5801568", "0.5795509", "0.5777495", "0.5764228", "0.57595176", "0.5758108", "0.5755447", "0.57457334", "0.57122624", "0.571182", "0.57092613", "0.5704013", "0.567517", "0.5674792", "0.56718147", "0.5671355", "0.56693333", "0.56672704", "0.5665935", "0.56529266", "0.5649447", "0.5649447", "0.5649447", "0.5647893", "0.56319016", "0.5628278", "0.5624179", "0.56216425", "0.56213826", "0.5619403", "0.5616666", "0.56078595", "0.56068075", "0.56032175", "0.55929565", "0.5590645", "0.55882585", "0.5587267", "0.5584778", "0.5582402", "0.5574349", "0.55628735", "0.55527425", "0.55511606", "0.55478346", "0.5546939", "0.5535293", "0.5529486", "0.5525256", "0.5520726", "0.5511981", "0.55103457", "0.55054647", "0.54930663", "0.5477667", "0.5471568", "0.54701537", "0.5465419", "0.5456232", "0.545417", "0.5451599", "0.5447691", "0.5442373", "0.54394805", "0.54244536", "0.5415595", "0.5412998", "0.54126257", "0.5410582", "0.5410225", "0.5409548" ]
0.0
-1
Sets the value of an input field, as though you typed it in. Can also be used to set the value of combo boxes, check boxes, etc. In these cases, +value+ should be the value of the option selected, not the visible text.
def type locator, value command 'type', locator, value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(name, value)\n set_text_content(name, 'input-field', @klass, value)\n end", "def set_field(field, value)\n find(:xpath, \"//input[@name='#{field}']\").set(value)\n end", "def text_field_enter(value)\n control = @field.all(:css, 'input[type=\"text\"]').first\n control.set \"#{value}\"\n end", "def set_field_value(name, value)\n\t\tend", "def set_value new_value\n if validate_value new_value\n @value = new_value\n end\n end", "def set_SearchValue(value)\n set_input(\"SearchValue\", value)\n end", "def set_text_box_value(id, value, timeout=nil)\r\n find_by_id_and_class(id, \"gwt-TextBox\", timeout) # so we get an error if it doesn't have the right type\r\n fill_in id, :with => value\r\n end", "def value=(value)\n `#{@el}.value = #{value}`\n end", "def set_Text(value)\n set_input(\"Text\", value)\n end", "def set_Text(value)\n set_input(\"Text\", value)\n end", "def set_Text(value)\n set_input(\"Text\", value)\n end", "def value=(value)\n `#{@element}.value = #{value}`\n end", "def set_value( value )\n @value = value \n end", "def set_search_field_value value\n search_field = SearchField.new(\"\", \"#{@locator}/ancestor::div[div[@class='toolbar']]/div[@class='toolbar']\")\n search_field.clear_value\n search_field.set_value(value)\n end", "def set_search_field_value value\n search_field = SearchField.new(\"\", \"#{@locator}/ancestor::div[div[@class='toolbar']]/div[@class='toolbar']\")\n search_field.clear_value\n search_field.set_value(value)\n end", "def set_value value\n if allows? value\n @set_value_handler.call value\n end\n end", "def set_value(value)\n @value = value\n end", "def setValue(value)\n @value = value\n end", "def set_text(text_field_name, value_to_set)\r\n\r\n given_text_field = $browser.text_field(name: \"#{text_field_name}\")\r\n\r\n given_text_field.wait_until_present(2)\r\n given_text_field.set \"#{value_to_set}\"\r\n\r\n #Make sure the value set is retained in the text field\r\n begin\r\n value_after_set = given_text_field.value\r\n\r\n if value_after_set != value_to_set\r\n raise \"The attempt to set the text: #{value_to_set} in the text field #{text_field_name} was not successful. The text field contains #{value_after_set}\"\r\n end\r\n end\r\n\r\n end", "def set_EntityValue(value)\n set_input(\"EntityValue\", value)\n end", "def set_value(value)\n send(\"set_#{value[:type]}_value\", value)\n end", "def edit_value(val)\n if data_type == \"string\"\n self.text_raw_value = val\n elsif data_type == \"number\"\n self.number_raw_value = val\n end\n # Note: *_validated_value field is set in the set_validated_values\n # validator.\n end", "def value(value)\n\t\t@value=value\n\tend", "def set_element_value(id, value, timeout=nil)\r\n input = normalizeInput(value)\r\n find_by_id(id, timeout) # so we get an error if it isn't found\r\n fill_in id, :with => input\r\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_input(name, value)\n @inputs[name] = value\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_field(name, value)\n name = name.to_sym\n raise NonexistentFieldError.new(\"'#{name}' field does not exist in form\") unless has_field?(name)\n @stamper.getAcroFields.setField(name.to_s, value.to_s)\n value\n end", "def value=(new_value)\n return nil if readonly?\n @value = send(\"sanitize_#{options[:type]}\", new_value)\n end", "def update_value( element_id, value )\r\n call_function( 'UI.update_value', element_id, value )\r\n end", "def set(value)\n @value = handler.sanitize(value)\n validate\n @value\n end", "def enter_element_value(original_field, value)\n field = original_field.downcase.gsub(\" \", \"_\")\n unless self.respond_to? field + \"_element\"\n warn \"undefined method '#{field + '_element'}' for #{@current_page.class}\"\n return\n end\n\n field_type = self.send(field + \"_element\").class.to_s\n\n if verbose_messages\n p field_type\n p field\n p value\n end\n\n if value.class.to_s == \"Array\"\n value = eval(value[0]).call(:param_string => value[1], :current_page => self, :repeatable_field_index => value[2])\n end\n\n if value =~ /^lambda/\n value = eval(value).call(:current_page => self)\n end\n\n formatted_value = value.to_s.downcase.gsub(\" \", \"_\")\n\n p value if verbose_messages\n\n return if value.nil? or (value == \"nil\")\n\n keep_trying_to_set(1) do\n case field_type\n when /select/i\n Watir::Wait.until(10) {self.send(field + \"_element\").exists?}\n return if self.send(field.downcase.gsub(\" \", \"_\")) == value and value != \"Please Select\"\n self.send(field + \"=\", value)\n when /text/i\n Watir::Wait.until(10) {self.send(field + \"_element\").exists?}\n return if self.send(field) == value and value != \"\"\n self.send(field + \"=\", value)\n self.send(field + \"_element\").send_keys(:tab)\n when /checkbox/i\n Watir::Wait.until(10) {self.send(field + \"_element\").exists?}\n #value should be: \"check\" or \"uncheck\"\n self.send(value.downcase + \"_\" + field)\n when /radio/i\n Watir::Wait.until(10) { self.send( field + \"_\" + formatted_value + \"_element\" ).exists? }\n self.send( \"select_\" + field + \"_\" + formatted_value )\n when /label/i\n if value =~ /check/\n if (value == \"check\" and not self.send( field + \"_element\" ).element.parent.checkbox.checked?) or\n (value == \"uncheck\" and self.send( field + \"_element\" ).element.parent.checkbox.checked?)\n self.send( field + \"_element\" ).click\n end\n else #radio button\n if ENV['browser_type'] == 'ie'\n self.send(field + \"_\" + formatted_value + \"_element\").click\n else\n self.send(field + \"_\" + formatted_value + \"_element\").focus\n self.send(field + \"_\" + formatted_value + \"_element\").fire_event \"onclick\"\n end\n end\n else\n raise(\"Unknown field type:\" + field_type)\n end\n end\n end", "def fills_in(field, options = {})\n value = options[:with]\n return flunk(\"No value was provided\") if value.nil?\n input = find_field_by_name_or_label(field)\n return flunk(\"Could not find input #{field.inspect}\") if input.nil?\n add_form_data(input, value)\n # TODO - Set current form\n end", "def set option_value\n self.select option_value\n end", "def set_field(key, value)\n @form_fields.setField key.to_s, value.to_s\n end", "def setTextBoxValue(element_id, val)\n @driver.find_element(:id, element_id).clear()\n EnziUIUtility.setValue(@driver, :id, element_id, val)\n end", "def select_input(input, value = nil)\n case value\n when \"true\", true\n value = true\n when \"false\", false\n value = false\n else\n value = !input.checked?\n end\n\n #\n # Hack:\n # cant use input.set(#{value})\n # because element can be hidden or covered by other eement\n # in which case Selenium raises error\n #\n trigger(parent_node(input), 'click')\n\n Capybara.current_session.execute_script(\"arguments[0].checked = #{value}\", input)\n end", "def value=(value)\n @value = value\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_SearchForUser(value)\n set_input(\"SearchForUser\", value)\n end", "def update_text_field(new_value)\n self.row.text_field.text = row_value\n end", "def update_text_field(new_value)\n self.row.text_field.text = row_value.to_s\n end", "def set(text)\n wait_until_exists\n @text_field.set(text)\n end", "def set_field(field_name, field_value)\n super field_name.to_s, field_value.to_s\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set(value)\n old_value = refresh(value)\n handle_event :type => :change, :old_value => old_value, :value => @value if old_value != @value\n old_value\n end", "def set(value)\n value\n end", "def value=(value)\n case tag_name\n when \"textarea\"\n @_node.setText(\"\")\n type(value)\n when \"input\"\n if file_input?\n @_node.setValueAttribute(value)\n else\n @_node.setValueAttribute(\"\")\n type(value)\n end\n end\n end", "def value= value\n\t\t@value = value\n\t\trefresh\n\tend", "def set_field(key, value)\n pdf_field(key).setValue(value.to_s)\n end", "def value=(v)\n set(v)\n end", "def []=(field_name, value)\n f = field(field_name)\n if f\n f.value = value\n else\n add_field!(field_name, value)\n end\n end", "def set_City(value)\n set_input(\"City\", value)\n end", "def set_City(value)\n set_input(\"City\", value)\n end", "def set_City(value)\n set_input(\"City\", value)\n end", "def fill_username_input_with(username)\n find(@username_input).set username\n end", "def set_dropdown_value_for_name(name,value)\n if dropdowns[name.to_s]\n dropdowns[name.to_s][\"value\"] = \"#{value}\" if value\n end\n end", "def set_text field_label, field_value\n #field_id = self.full_content_element.html.match(/for=\".+\">#{field_label}/).to_s.sub('for=\"','').sub(\">#{field_label}\",'').chop\n field_id = self.html.match(/for=\".+\">#{field_label}/).to_s.sub('for=\"','').sub(\">#{field_label}\",'').chop\n self.execute_script(\"document.getElementById('\" + field_id + \"').value = '\" + field_value + \"';\")\n end", "def value=(value)\n @value = value\n end", "def value=(value)\n @value = value\n @value_set = true\n end", "def set_Phone(value)\n set_input(\"Phone\", value)\n end", "def set_date_box_value(id, value, timeout=nil)\r\n find_by_id_and_class(id, \"gwt-DateBox\", timeout) # so we get an error if it doesn't have the right type\r\n fill_in id, :with => value\r\n end" ]
[ "0.7001082", "0.68968534", "0.6829919", "0.6777252", "0.652977", "0.65186894", "0.6513307", "0.64366263", "0.63665414", "0.63665414", "0.63665414", "0.63572764", "0.6228541", "0.6179237", "0.6179237", "0.6108942", "0.60895807", "0.6083963", "0.6039292", "0.60343057", "0.6014567", "0.60060835", "0.6000828", "0.59960455", "0.5987742", "0.5987742", "0.5987066", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5986811", "0.5979933", "0.59663033", "0.59663004", "0.5949165", "0.59364897", "0.59297913", "0.5914236", "0.58602446", "0.58446366", "0.58405304", "0.5817237", "0.5803912", "0.5803912", "0.5803912", "0.5803912", "0.5803912", "0.5803912", "0.5803912", "0.58037436", "0.58011055", "0.58007103", "0.57987076", "0.57892746", "0.5782316", "0.5781573", "0.5781573", "0.5781573", "0.5781573", "0.5781573", "0.5781573", "0.5781573", "0.5781573", "0.5781573", "0.5781573", "0.57787746", "0.5765672", "0.57637936", "0.575041", "0.57490474", "0.5739125", "0.57318705", "0.5719838", "0.5719838", "0.5719838", "0.5695204", "0.56898004", "0.5684496", "0.56834793", "0.56738645", "0.56637114", "0.5651174" ]
0.0
-1
Check a togglebutton (checkbox/radio).
def check locator command 'check', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check\n click unless checked?\n end", "def toggle_field(attrs = {})\n if attrs.has_key?(:checked)\n if attrs[:checked]\n attrs[:checked] = \"checked\"\n else\n attrs.delete(:checked)\n end\n end\n \n check_box(attrs)\n end", "def check_box_toggle(name, checked, elt, ifchecked, ifnotchecked)\n check_box_tag name, 1, checked, :onchange => %Q{$('##{elt}').text($(this).is(':checked') ? '#{escape_javascript ifchecked}' : '#{escape_javascript ifnotchecked}')}\n end", "def assert_checkbox_selected(checkbox_name)\n assert_togglebutton_selected checkbox_name\n end", "def assert_togglebutton_selected(togglebutton_name)\n assert_true togglebutton_name, \"selected\"\n end", "def check_box; end", "def checked\n `!!#{@el}.checked`\n end", "def checkbox_checked\n return 'checked=checked' if show\n\n ''\n end", "def click_on_TW_ON_toggle\n\n find(TW_ON_TOGGLE).click\n\n end", "def check!\n update_attribute :checked, true\n end", "def switch_paddle(attr, options = {})\n @inside_switch_paddle = true\n output_html = check_box attr, options\n @inside_switch_paddle = false\n\n output_html\n end", "def event_switch_checkbox(event, attribute, conference_id)\n check_box_tag(\n conference_id,\n event.id,\n event.send(attribute),\n url: admin_conference_program_event_path(\n conference_id,\n event,\n event: { attribute => nil }\n ),\n class: 'switch-checkbox'\n )\n end", "def check_checkbox (check, element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if check.downcase == 'check'\n if internally\n script = <<-JS\n arguments[0].checked = true;\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n send(\"check_#{element}\")\n end\n\n elsif check.downcase == 'uncheck'\n if internally\n script = <<-JS\n arguments[0].checked = false;\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n send(\"uncheck_#{element}\")\n end\n else\n raise 'invalid option for step definition selected!'\n end\n end", "def checkbox(box)\n if box.checked?\n 'set'\n else\n 'clear'\n end\n end", "def boolean_input(method, options)\n html_options = options.delete(:input_html) || {}\n checked = options.key?(:checked) ? options[:checked] : options[:selected]\n html_options[:checked] = checked == true if [:selected, :checked].any? { |k| options.key?(k) }\n\n input = self.check_box(method, strip_formtastic_options(options).merge(html_options),\n options.delete(:checked_value) || '1', options.delete(:unchecked_value) || '0')\n options = options_for_label(options)\n\n # the label() method will insert this nested input into the label at the last minute\n options[:label_prefix_for_nested_input] = input\n\n self.label(method, options)\n end", "def checked?\n state == :on\n end", "def checkbox(&block)\n @template.form_checkbox(&block)\n end", "def bool_checked(field)\n filename = field ? \"check.png\" : \"blank.gif\"\n image_tag(filename, :alt => \"yes\", :size => \"16x16\") \n end", "def wrt_checkbox(chkbox, state,loc = nil, ret = nil)\n if loc \n loc.click \n edit.click\n chkbox.send state \n save.click_no_wait\n jsClick(\"OK\")\n sleep 1\n ret.click \n else\n chkbox.send state\n end\n end", "def checkbox(key)\n field_type = @form.getFieldType(key.to_s)\n return unless field_type == @acrofields.FIELD_TYPE_CHECKBOX\n\n all_states = @form.getAppearanceStates(key.to_s)\n yes_state = all_states.reject{|x| x == \"Off\"}\n \n \n @form.setField(key.to_s, yes_state.first) unless (yes_state.size == 0)\n end", "def assert_radiobutton_selected(radiobutton_name)\n assert_togglebutton_selected radiobutton_name\n end", "def checked=(value)\n `#{@el}.checked = #{value}`\n end", "def click_on_On_fb_toggle\n\n find(FB_ON_TOGGLE).click\n\n end", "def checked?\n native.has_attribute?('checked')\n end", "def click_checkbox(button, value)\n append_to_script \"click_checkbox \\\"#{button}\\\" \\\"#{value}\\\"\"\n end", "def checkbox(key)\n field_type = @form.getFieldType(key.to_s)\n return unless is_checkbox(field_type)\n\n all_states = @form.getAppearanceStates(key.to_s)\n yes_state = all_states.reject{|x| x == \"Off\"}\n \n \n @form.setField(key.to_s, yes_state.first) unless (yes_state.size == 0)\n end", "def toggle\n set_switch(!self.switch) if @switch\n end", "def quick_checkbox(how, what)\n QuickCheckbox.new(self, how, what, parent_widget, window_id, :checkbox)\n end", "def add_check_box(name, label_text, options = {}, &block)\n options = options.dup\n proc = get_command(options.delete(:command), &block)\n add_widget Tk::Tile::Checkbutton, name, label_text, options.merge(create_var: :variable), &proc\n end", "def toggle!\n if status\n off!\n return false\n else\n on!\n return true\n end\n end", "def check(field_locator)\n locate_field(field_locator, CheckboxField).check\n end", "def toggle(switch)\n switch == 1 ? 0 : 1\nend", "def checkbox_value\n show\n # return 'true' if show\n # 'false'\n end", "def uncheck\n click unless unchecked?\n end", "def check_Checkbox(id, checked)\n find(:xpath, \"//*[@id='#{id}']\").set(checked)\n if (checked == true)\n expect(find(:xpath, \"//*[@id='#{id}']\")).to be_checked\n else\n expect(find(:xpath, \"//*[@id='#{id}']\")).to_not be_checked\n end\nend", "def onCheckedChanged(_, checked_or_id)\n @callback.call(checked_or_id) if @callback\n end", "def checked tf\n\n if @button_group.value == value\n @button_group.value = \"\"\n else\n @button_group.value = value\n end\n end", "def check_box(method, orig_options = {}, checked_value = '1',\n unchecked_value = '0')\n options = decorate_opts_with_disabled(orig_options)\n div_wrapper do\n @template.content_tag :div, class: 'checkbox' do\n label_control(method) do\n orig_check_box(method, options, checked_value, unchecked_value) +\n method.to_s.humanize\n end\n end\n end\n end", "def set?\n class_name.include? 'mat-checked'\n end", "def toggle_service_announcement_checkbox\n logger.info 'Clicking the service announcement posting checkbox'\n (el = post_service_announcement_checkbox_element).when_present Utils.short_wait\n js_click el\n el.when_not_present Utils.short_wait\n post_service_announcement_checkbox_element.when_present Utils.short_wait\n end", "def checked?\n `!!#@native.checked`\n end", "def display_checked?(_preferences, _value)\n false\n end", "def checkboxes; end", "def checks(field)\n checkbox = find_field_by_name_or_label(field)\n return flunk(\"Could not find checkbox #{field.inspect}\") if checkbox.nil?\n return flunk(\"Input #{checkbox.inspect} is not a checkbox\") unless checkbox.attributes['type'] == 'checkbox'\n add_form_data(checkbox, checkbox.attributes[\"value\"] || \"on\")\n end", "def checkbox(name, locator)\n define_method(name) do\n platform.click_checkbox(locator)\n end\n end", "def js_active_toggle\n %Q{\n if (this.checked) {\n $('#{dom_id(:operator_div)}').show();\n #{js_value_settle};\n }\n else {\n $('#{dom_id(:operator_div)}').hide();\n $('#{dom_id(:value_div)}').hide();\n }\n }\n end", "def has_toggles\n options.has_key?(:toggles)\n end", "def checkbox_checked_inside_frame?(browser_handle, frame_prop, frame_prop_val, checkbox_prop, checkbox_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).checkbox(checkbox_prop.intern, /#{checkbox_prop_val}/).checked?\nend", "def toggle\n @toggle ||= toggle_class.new(self)\n end", "def accessible\n has_toggles\n end", "def toggle_click(name, tag, state = true)\n toggle_click_on_button(name, tag, @klass, state)\n end", "def check_checkbox(checkBoxName, values=nil)\r\n elements = find_checkboxes_by_name(checkBoxName)\r\n if values\r\n values.class == Array ? arys = values : arys = [values] \r\n arys.each { |cbx_value|\r\n elements.each do |elem|\r\n elem.click if elem.attribute('value') == cbx_value && !elem.selected?\r\n end\r\n }\r\n else\r\n the_checkbox = elements[0] \r\n the_checkbox.click unless the_checkbox.selected?\r\n end\r\n end", "def toggle\n action(action: Actions::TOGGLE)\n self\n end", "def toggle_state\n puts \"******* toggle_state *******\"\n end", "def check_assignment(assignment_name)\n assignment_row(assignment_name).checkbox.set\n end", "def checkbox(name, identifier=nil, &block)\n define_method(\"check_#{name}\") do\n return platform.check_checkbox(identifier.clone) unless block_given?\n self.send(\"#{name}_element\").check\n end\n define_method(\"uncheck_#{name}\") do\n return platform.uncheck_checkbox(identifier.clone) unless block_given?\n self.send(\"#{name}_element\").uncheck\n end\n define_method(\"#{name}_checked?\") do\n return platform.checkbox_checked?(identifier.clone) unless block_given?\n self.send(\"#{name}_element\").checked?\n end\n define_method(\"#{name}_element\") do\n return call_block(&block) if block_given?\n platform.checkbox_for(identifier.clone)\n end\n define_method(\"#{name}?\") do\n return call_block(&block).exists? if block_given?\n platform.checkbox_for(identifier.clone).exists?\n end\n alias_method \"#{name}_checkbox\".to_sym, \"#{name}_element\".to_sym\n end", "def input_checkbox(name)\n field = field_content(name)\n option_item(field, field_id(name), name)\n end", "def assert_togglebutton_not_selected(togglebutton_name)\n assert_false togglebutton_name, \"selected\"\n end", "def checkbox?\n (user.premium? && ( record.user_id == user.id )) || user.admin?\n end", "def verify_checkbox_status(name, status)\n case status.upcase\n when \"CHECKED\"\n send(\"#{name}_element\").parent.element.checkbox.checked?\n when \"UNCHECKED\"\n not send(\"#{name}_element\").parent.element.checkbox.checked?\n when \"DISABLED\"\n send(\"#{name}_element\").parent.element.checkbox.disabled?\n when \"ENABLED\"\n send(\"#{name}_element\").parent.element.checkbox.enabled?\n end\n end", "def toggle\n if on?\n off\n else\n on\n end\n end", "def checkbox_checked(element_name, be_selected=true)\n begin\n select_check = select(element_name)\n select_check unless be_selected == selected?(element_name)\n rescue Exception => e\n $LOG.error \"error in selecting check box on element \\n element name : #{element_name} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in selecting check box on element \\n element name : #{element_name} \"+e.message\n end\n end", "def html_label\n check_box_tag(input_name(:fields, true, nil), name, active, :id => dom_id(:active), :onclick => js_active_toggle) + h(label)\n end", "def is_checkbox_checked(access_type, access_name, should_be_checked = true)\n checkbox = $driver.find_element(:\"#{access_type}\" => \"#{access_name}\")\n\n expect(checkbox.selected?).to be should_be_checked\nend", "def checkbox(item)\n name_li(item).checkbox\n end", "def display_check_box( value )\n html = String.new\n html += \"<input type=\\\"checkbox\\\" readonly disabled\"\n html += \" checked\" if value\n html += \"/>\"\n html.html_safe\n end", "def checkbox(name = \"\", value = nil, checked = nil)\n attributes = if name.kind_of?(String)\n { \"TYPE\" => \"checkbox\", \"NAME\" => name,\n \"VALUE\" => value, \"CHECKED\" => checked }\n else\n name[\"TYPE\"] = \"checkbox\"\n name\n end\n input(attributes)\n end", "def toggle\n\t\t@toggle ||= Toggle.new(self)\n\tend", "def get_bool\n skip_tkspace\n tk = get_tk\n if :on_kw == tk[:kind] && 'true' == tk[:text]\n true\n elsif :on_kw == tk[:kind] && ('false' == tk[:text] || 'nil' == tk[:text])\n false\n else\n unget_tk tk\n true\n end\n end", "def openToggle()\n @openToggle_duration = @w_openToggle.animationSpeed\n if (@w_openToggle.openness != 255)\n @w_openToggle.open()\n else\n @w_openToggle.close()\n end\n end", "def checks(id_or_name_or_label)\n field = find_field(id_or_name_or_label, CheckboxField)\n field.check\n end", "def toggle\n cmd = \"{\\\"id\\\":7,\\\"method\\\":\\\"toggle\\\",\\\"params\\\":[]}\\r\\n\"\n request(cmd)\n end", "def sync_checkbox_visible\n begin\n find(:id, 'user_enable_stash')\n puts \"======find the sync checkbox======\"\n return true\n rescue\n puts \"======sync checkbox is not found======\"\n return false\n end\n end", "def checkbox_guard_for(elt_name, visible=false)\n check_box_tag(\"show_\" << elt_name.to_s, '1', visible,\n :onclick => %Q{$('##{elt_name}').slideToggle();})\n end", "def toggle_class\n Toggles::Value\n end", "def click_on_Tw_OFF_Toggle\n\n find(TW_OFF_TOGGLE).click\n\nend", "def toggle\n set_switch(!self.switch) if @switch\n method(@method).call(self.switch) if @method\n end", "def selected?\n element(true).isSelected()\n end", "def check_assignment(id) #FIXME to use name instead of id.\n frm.checkbox(:value, /#{id}/).set\n end", "def check_box_tag(name, value = \"1\", checked = false, options = {}) \n\t\toptions = check_options(options)\n\t\toptions[:class] << 'check_box'\n\t\tsuper(name, value, checked, options)\n\tend", "def setCheckBox ( name , value , newState , formName = \"\" , frameName = \"\" )\n\n fname = getFunctionName()\n log fname + \" Starting. Trying to set checkbox: #{name.to_s} (#{value.to_s}) to \" + getDescriptionOfState(newState )if $debuglevel >=0\n container = getObjectContainer( name , formName , frameName )\n\n thisCheckBox = nil\n\n # does it exist\n #o = container.all[ name.to_s ]\n # another one of those hacky frame things...\n container.all.each do |box|\n next unless thisCheckBox == nil\n begin\n if box.name == name.to_s and thisCheckBox== nil\n # do we have a value as well?\n if value != \"\"\n if box.value == value\n thisCheckBox = box\n end\n else\n thisCheckBox = box\n end\n end\n rescue\n # probably doesnt have a name\n end\n\n end\n\n if thisCheckBox== nil\n return false, [ OBJECTNOTFOUND ]\n end\n setBackGround(thisCheckBox)\n\n # we now have a reference to the checkbox we want!\n\n if thisCheckBox.disabled\n clearBackground\n return false, [ OBJECTDISABLED ] \n end \n\n if thisCheckBox.checked == true\n currentState = CHECKBOX_CHECKED\n toggleState = false\n else\n currentState = CHECKBOX_UNCHECKED\n toggleState = true\n end\n state = getDescriptionOfState(currentState)\n log fname + \" Found Checkbox #{name.to_s} (#{value.to_s}). Its Current value is: \" + state + \" Setting to: \" + getDescriptionOfState(newState )if $debuglevel >=0\n\n # now set the new state\n \n case newState \n when CHECKBOX_CHECKED\n if currentState == CHECKBOX_CHECKED\n # we dont need to do anything!\n else\n a, messages = setCheckBoxState( thisCheckBox , true )\n if !a\n clearBackground\n return false, [ fname + \" Problem setting checkbox (1)\"]\n end\n end \n when CHECKBOX_UNCHECKED\n if currentState == CHECKBOX_CHECKED\n a, messages = setCheckBoxState( thisCheckBox , false )\n if !a \n clearBackground\n return false, [ fname + \" Problem setting checkbox (2)\"]\n end\n else\n # we dont need to do anything\n end \n when CHECKBOX_TOGGLE\n a, messages = setCheckBoxState( thisCheckBox , toggleState )\n if !a\n clearBackground\n return false, [ fname + \" Problem setting checkbox (3)\" ]\n end\n end\n clearBackground\n return true, [ \"\" ]\n\n end", "def button?\n\t\tcan_button? and show_button\n\tend", "def build_check_box(unchecked_value, options); end", "def select_input(input, value = nil)\n case value\n when \"true\", true\n value = true\n when \"false\", false\n value = false\n else\n value = !input.checked?\n end\n\n #\n # Hack:\n # cant use input.set(#{value})\n # because element can be hidden or covered by other eement\n # in which case Selenium raises error\n #\n trigger(parent_node(input), 'click')\n\n Capybara.current_session.execute_script(\"arguments[0].checked = #{value}\", input)\n end", "def toggle_click_on_button(name, tag, container, state = true)\n attr = SELECTOR_MAPPING[container][name][tag][STATE][state] || (state ? 'fa-caret-down' : 'fa-caret-right')\n click_on_button(name, tag, container) if (!wait_visibility(name, tag, container)[:class].include? attr)\n end", "def build_check_box(unchecked_value = unchecked_value())\n @builder.check_box(attribute_name, input_html_options, checked_value, unchecked_value)\n end", "def assert_checkbox_not_selected(checkbox_name)\n assert_togglebutton_not_selected checkbox_name\n end", "def mat_slide_toggle_hooked(name, identifier = { index: 0 }, &block)\n hooked_standard_methods(name, identifier, 'mat_slide_toggle_for', &block)\n define_method(\"check_#{name}\") do\n send(\"#{name}_element\").check\n end\n define_method(\"uncheck_#{name}\") do\n send(\"#{name}_element\").uncheck\n end\n define_method(\"#{name}_checked?\") do\n send(\"#{name}_element\").checked?\n end\n end", "def radio_button; end", "def check_box_tag(name, value = T.unsafe(nil), checked = T.unsafe(nil), options = T.unsafe(nil)); end", "def radio_checked? model, cell\n cell.value == model.send(cell.attribute) ? true : false if cell.attribute.present?\n end", "def radio_button_checked_inside_frame?(browser_handle, frame_prop, frame_prop_val, radio_prop, radio_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).radio(radio_prop.intern, /#{radio_prop_val}/).checked?\nend", "def get_checkbox_value(checkbox_value )\n if checkbox_value == true\n return TRUE_CHECK\n else\n return FALSE_CHECK\n end\n end", "def get_checkbox_value(checkbox_value )\n if checkbox_value == true\n return TRUE_CHECK\n else\n return FALSE_CHECK\n end\n end", "def nested_boolean_choice_field(form, name, attribute, opts = {})\n on_change = (attribute.new_record? ? \"nestedCheckboxChanged(this)\" : nil)\n class_name = (attribute.new_record? ? \"nested_checkbox\" : nil)\n\n if opts[:onchange] and on_change\n on_change += \"; #{ opts[:onchange] }\"\n end\n\n opts[:class] = \"#{ opts[:class] } #{ class_name }\"\n\n options = opts.merge({ :onchange => on_change, :index => attribute.id })\n return form.check_box(name, options)\n end", "def click_checkbox_inside_frame(browser_handle, frame_prop, frame_prop_val, checkbox_prop, checkbox_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).checkbox(checkbox_prop.intern, /#{checkbox_prop_val}/).click\nend", "def wiki_checkbox\n adding_field do |f|\n output = \"\".html_safe\n output << f.label(:wiki, \"Wiki\")\n output << f.check_box(:wiki)\n output\n end\n end", "def button_down?(button)\n end", "def form_checkbox(&block)\n content_tag(:div, capture(&block), class: \"checkbox\")\n end", "def has_toggle_default_open(item)\n options.has_key?(:open_active_toggle) && item.selected?\n end", "def click_radio_button(button)\n append_to_script \"click_radio_button \\\"#{button}\\\"\"\n end" ]
[ "0.68846136", "0.68083274", "0.6751992", "0.6609702", "0.65960133", "0.6512086", "0.65030104", "0.6387153", "0.638281", "0.63141483", "0.62815034", "0.61913115", "0.61274004", "0.6090666", "0.6074506", "0.60514295", "0.60511833", "0.59693676", "0.5955382", "0.59002954", "0.58990633", "0.5895158", "0.58839256", "0.58823764", "0.5873197", "0.585631", "0.5837207", "0.5830049", "0.5772893", "0.57495636", "0.5733667", "0.5726749", "0.57165873", "0.56957006", "0.5690956", "0.568914", "0.56212425", "0.5617622", "0.5615782", "0.560812", "0.5593303", "0.5591209", "0.5577408", "0.5575112", "0.55741197", "0.55720925", "0.55494976", "0.5512475", "0.54917985", "0.54808474", "0.5471258", "0.54671043", "0.5452412", "0.5429067", "0.54262847", "0.541831", "0.54099053", "0.53986186", "0.53933907", "0.5392316", "0.5377409", "0.53605676", "0.53592104", "0.53442496", "0.5338005", "0.5335309", "0.5331193", "0.53267473", "0.5325567", "0.532343", "0.53014344", "0.530036", "0.5291486", "0.5279433", "0.52603805", "0.5258857", "0.52568847", "0.5248079", "0.52449983", "0.5238279", "0.523699", "0.5233164", "0.5220964", "0.52106154", "0.52068377", "0.5202567", "0.52001095", "0.517621", "0.5168474", "0.5166079", "0.51509005", "0.514059", "0.51388973", "0.51388973", "0.5132858", "0.51323885", "0.5131782", "0.51246834", "0.5121074", "0.51123095", "0.51118803" ]
0.0
-1
Uncheck a togglebutton (checkbox/radio).
def uncheck locator command 'uncheck', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uncheck\n click unless unchecked?\n end", "def unchecks(id_or_name_or_label)\n field = find_field(id_or_name_or_label, CheckboxField)\n field.uncheck\n end", "def uncheck\n action(action: Actions::UNCHECK)\n self\n end", "def uncheck(field_locator)\n locate_field(field_locator, CheckboxField).uncheck\n end", "def uncheck\n return unless checked?\n\n @checked = false\n @group.value = value\n @border_color = @unchecked_border_color.dup\n publish :changed, @checked\n\n nil\n end", "def unchecks(field)\n checkbox = find_field_by_name_or_label(field)\n return flunk(\"Could not find checkbox #{field.inspect}\") if checkbox.nil?\n return flunk(\"Input #{checkbox.inspect} is not a checkbox\") unless checkbox.attributes['type'] == 'checkbox'\n remove_form_data(checkbox)\n \n (form_for_node(checkbox) / \"input\").each do |input|\n next unless input.attributes[\"type\"] == \"hidden\" && input.attributes[\"name\"] == checkbox.attributes[\"name\"]\n add_form_data(input, input.attributes[\"value\"])\n end\n end", "def uncheck\n self.checked = Time.at(0)\n end", "def uncheck_checkbox(checkBoxName, values = nil)\r\n elements = find_checkboxes_by_name(checkBoxName)\r\n \r\n if values\r\n values.class == Array ? arys = values : arys = [values] \r\n arys.each { |cbx_value|\r\n elements.each do |elem|\r\n elem.click if elem.attribute('value') == cbx_value && elem.selected?\r\n end\r\n }\r\n else\r\n the_checkbox = elements[0] \r\n the_checkbox.click if the_checkbox.selected?\r\n end\r\n end", "def toggle_off\n set_state_to(:off)\n end", "def click_un_mute_all\n logger.debug 'Clicking the un-mute checkbox'\n wait_for_load_and_click un_mute_all_cbx_element\n end", "def uncheck_content(item)\n name_li(item).checkbox.clear\n end", "def toggle_field(attrs = {})\n if attrs.has_key?(:checked)\n if attrs[:checked]\n attrs[:checked] = \"checked\"\n else\n attrs.delete(:checked)\n end\n end\n \n check_box(attrs)\n end", "def uncheck_content(item)\n self.div(:class=>\"fl-container fl-fix mylibrary_item\", :text=>/#{Regexp.escape(item)}/).checkbox.clear\n end", "def toggle_off(outlet = 1)\n toggle(outlet, false)\n end", "def uncheck_remove_contact(contact)\n @browser.div(:id=>\"addpeople_selected_contacts_container\").link(:text=>contact).parent.checkbox.clear\n end", "def unclick\n # Reset dragging slider\n @dragging_slider = false if @dragging_slider\n # Reset buttons\n @button_down_sprite.set_rect_div(0, 0, 1, 2) unless @button_down_sprite.src_rect.y == 0\n @button_up_sprite.set_rect_div(0, 0, 1, 2) unless @button_up_sprite.src_rect.y == 0\n @button_slider_sprite.set_rect_div(0, 0, 1, 2) unless @button_slider_sprite.src_rect.y == 0\n end", "def clear_checkbox_inside_frame(browser_handle, frame_prop, frame_prop_val, checkbox_prop, checkbox_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).checkbox(checkbox_prop.intern, /#{checkbox_prop_val}/).clear\nend", "def uncheckout(url, options={})\n request :uncheckout, url, nil, options\n end", "def check_box_toggle(name, checked, elt, ifchecked, ifnotchecked)\n check_box_tag name, 1, checked, :onchange => %Q{$('##{elt}').text($(this).is(':checked') ? '#{escape_javascript ifchecked}' : '#{escape_javascript ifnotchecked}')}\n end", "def uncheck_all_checkboxes(count, id)\n Log.logger.info(\"Unchecking all '#{count}' options in the checkbox\")\n count.times {|i|\n i += 1\n check = @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).selected?\n if(check == true)\n @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).click\n end\n }\n end", "def assert_checkbox_not_selected(checkbox_name)\n assert_togglebutton_not_selected checkbox_name\n end", "def check\n click unless checked?\n end", "def uncheck *params\n opt = parse_params_for_check params\n @adapter.check opt, false\n end", "def clear_toggle_area\n @ta = nil\n end", "def toggle\n set_switch(!self.switch) if @switch\n end", "def remove_logo\n # Never want the checkbox checked by default\n false\n end", "def remove_logo\n # Never want the checkbox checked by default\n false\n end", "def toggle(instance)\n # do nothing\n end", "def clear_radio_button_inside_frame(browser_handle, frame_prop, frame_prop_val, radio_prop, radio_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).radio(radio_prop.intern, /#{radio_prop_val}/).clear\nend", "def clearRadio \n \"clearRadio\" \n end", "def assert_togglebutton_not_selected(togglebutton_name)\n assert_false togglebutton_name, \"selected\"\n end", "def unclicked(mouse_event)\n end", "def off!\n set(:on => false)\n end", "def checked tf\n if tf\n toggle\n elsif !@variable.nil? and getvalue() != @value # XXX ???\n @variable.set_value \"\", \"\"\n end\n end", "def unflag\n @flagged != @flagged = false\n end", "def unhide\n client.post('/api/unhide', id: read_attribute(:name))\n end", "def unclicked(e)\n puts \"Unclicked!\"\n end", "def toggle\n if on?\n off\n else\n on\n end\n end", "def checked tf\n\n if @button_group.value == value\n @button_group.value = \"\"\n else\n @button_group.value = value\n end\n end", "def mark_response_as_checked_out\n @response.check_out!(current_user)\n end", "def mark_response_as_checked_out\n @response.check_out!(current_user)\n end", "def deselectplugin(browser)\n browser.checkbox(:id,\"plugins-select-all\").clear\nend", "def check_remove(field_name)\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(field_name)}/).checkbox.set\n end", "def toggle\n action(action: Actions::TOGGLE)\n self\n end", "def reset_button?(button_name); end", "def clear\r\n assert_exists\r\n assert_enabled\r\n highlight( :set)\r\n if @o.checked == true\r\n set_clear_item( false )\r\n end\r\n highlight( :clear)\r\n end", "def checkbox(box)\n if box.checked?\n 'set'\n else\n 'clear'\n end\n end", "def toggle\n @done = !@done\n end", "def toggle_state\n state\n end", "def deselect_item\n @selected = nil\n\n items\n end", "def unchecked?\n state == :off\n end", "def toggle(switch)\n switch == 1 ? 0 : 1\nend", "def remove_vuln_check(check_id)\n checks = REXML::XPath.first(@xml, '//VulnerabilityChecks')\n checks.elements.delete(\"Disabled/Check[@id='#{check_id}']\")\n checks.elements.delete(\"Enabled/Check[@id='#{check_id}']\")\n end", "def clear_radio_option(radio_group, radio_option)\r\n the_radio_button = find_element(:xpath, \"//input[@type='radio' and @name='#{radio_group}' and @value='#{radio_option}']\")\r\n the_radio_button.clear\r\n end", "def assert_radiobutton_not_selected(radiobutton_name)\n assert_togglebutton_not_selected radiobutton_name\n end", "def turn_off!\n set_power!(:off)\n end", "def unselect\n @unselect || \"future\"\n end", "def false_label\n raise 'Called false_label from a Non Single CheckBox type' unless single_value?\n \n label = Label.find(false_label_id)\n\n raise \"True label not set for CustomFields::CheckBox id=#{self[:id]}\" if label.nil?\n\n label\n end", "def toggle_click(name, tag, state = true)\n toggle_click_on_button(name, tag, @klass, state)\n end", "def toggle\n @toggle ||= toggle_class.new(self)\n end", "def off\n change_state(pin, :low)\n @is_on = false\n true\n end", "def select_hide\n frm.radio(:id=>\"hidden_true\").set\n end", "def unhide\n post(\"/api/unhide\", id: fullname)\n end", "def unselect; end", "def unmark!\n @session.chanserv.mark(self.name, :off)\n end", "def disable(thing)\n toggle.disable(thing)\n end", "def unflag(cell)\n announce_unflag(cell)\n @minefield.unflag(cell)\n end", "def unselect_board\n select_board nil\n end", "def toggle!\n if status\n off!\n return false\n else\n on!\n return true\n end\n end", "def toggle\n cmd = \"{\\\"id\\\":7,\\\"method\\\":\\\"toggle\\\",\\\"params\\\":[]}\\r\\n\"\n request(cmd)\n end", "def toggle_state\n puts \"******* toggle_state *******\"\n end", "def build_check_box_without_hidden_field(options); end", "def onstatechange_unregister(b)\n @onstatechange_list.delete b\n end", "def onstatechange_unregister(b)\n @onstatechange_list.delete b\n end", "def clear_switchable()\n end", "def remove_membership_button(name)\n self.button(:title=>\"Remove membership from #{name}\")\n end", "def unsubscribe_from_label(project, name)\n post(\"/projects/#{url_encode project}/labels/#{url_encode name}/unsubscribe\")\n end", "def disable\n exclusively do\n @enabled = false\n @manual_toggle = true\n end\n\n save_state\n sync_control { stop_upkeep }\n end", "def toggle\n\t\t@toggle ||= Toggle.new(self)\n\tend", "def clear(bit)\n set(bit, false)\n end", "def build_check_box_without_hidden_field\n build_check_box(nil)\n end", "def unrelease_version\n unrelease_version_btn.click\n unrelease_modal_btn.click\n end", "def toggle_on(outlet = 1)\n toggle(outlet, true)\n end", "def unsubscribe_from_group_label(group, name)\n post(\"/groups/#{url_encode group}/labels/#{url_encode name}/unsubscribe\")\n end", "def unchecked?\n self.checkState == FALSE\n end", "def unchecked?\n self.checkState == FALSE\n end", "def unchecked?\n self.checkState == FALSE\n end", "def unchecked?\n self.checkState == FALSE\n end", "def check!\n update_attribute :checked, true\n end", "def uncheck_event(event_name)\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(event_name)}/)\n end", "def mark_unsubscribed!\n return unless with_states?\n # todo: move to callback\n user.unsubscribe! if user.subscribed?\n end", "def toggle\n set_switch(!self.switch) if @switch\n method(@method).call(self.switch) if @method\n end", "def toggle(sym)\n `c$Element.prototype.m$toggle_class.call(#{@element},sym)`\n return @element\n end", "def switch_off(except)\n\t\tunless self.name == except\n\t\t\t#puts \"switching off : #{self.name}\"\n\t\t\tself.state = \"off\"\n\t\tend\n\t\tself.components.each do |c|\n\t\t\tc.switch_off(except)\n\t\tend\n\tend", "def unsubscribe(topic, callback)\n options = {\n :\"hub.mode\" => \"unsubscribe\",\n :\"hub.topic\" => topic,\n :\"hub.callback\" => callback,\n }\n post(\"/hub\", options, 3, true, true, true)\n true\n end", "def unmute()\n self.mute()\n end", "def reload_feature_toggles\n @feature_toggles = nil\n end", "def toggle_state(state)\n @states.select { |s, _| s == state }.each do |s, v|\n v[1] = !v[1]\n classify_state v\n end\n end", "def off\n @handler.off\n deactivate\n end" ]
[ "0.8033514", "0.7108564", "0.70739645", "0.69831014", "0.66750646", "0.64087695", "0.6358552", "0.6299613", "0.6103307", "0.6086294", "0.6077194", "0.60344464", "0.5838463", "0.5803889", "0.5675678", "0.55932236", "0.5501412", "0.54863834", "0.5469167", "0.543729", "0.54313993", "0.53595597", "0.5358549", "0.53583735", "0.532034", "0.53160155", "0.53160155", "0.53135836", "0.53130525", "0.529197", "0.5242247", "0.52248544", "0.5196417", "0.5169616", "0.5162731", "0.51483864", "0.5123338", "0.51185673", "0.5087749", "0.50768876", "0.5074255", "0.506699", "0.50391704", "0.50341916", "0.5033086", "0.5027186", "0.5021015", "0.4965705", "0.49474013", "0.4930518", "0.4930056", "0.49290368", "0.4925264", "0.49171373", "0.49130106", "0.49110806", "0.4907531", "0.4905212", "0.48919478", "0.4881951", "0.48730826", "0.48459002", "0.48437944", "0.48363504", "0.48206958", "0.4809521", "0.4808467", "0.48048162", "0.47986102", "0.47879693", "0.478076", "0.47759464", "0.47751373", "0.47751373", "0.4770096", "0.4769701", "0.47399297", "0.4729933", "0.4721321", "0.4717908", "0.46875706", "0.4683856", "0.4681307", "0.46751666", "0.46750113", "0.46750113", "0.46750113", "0.46750113", "0.4671707", "0.46691513", "0.46603233", "0.4658636", "0.46512732", "0.46407712", "0.46360746", "0.46251208", "0.46234435", "0.461981", "0.4605227" ]
0.68385905
5
Select an option from a dropdown using an option locator. Option locators provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option, or for asserting that the selected option satisfies a specification). There are several forms of Select Option Locator. label=labelPattern matches options based on their labels, i.e. the visible text. (This is the default.) label=regexp:^[Oo]ther value=valuePattern matches options based on their values. value=other id=id matches options based on their ids. id=option1 index=index matches an option based on its index (offset from zero). index=2 If no option locator prefix is provided, the default behaviour is to match on label.
def select locator, option_locator command 'select', locator, option_locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_dropdown(locator, option, method = :value)\n Console.log.info \"Selecting field: #{locator} \\n\\toption: #{option}\n select method: #{method}\"\n select_list = Selenium::WebDriver::Support::Select.new(find(locator))\n select_list.select_by(method, option)\n end", "def select(option_locator)\n find_element(option_locator).click\n end", "def select_value(locator:, option_value:)\n find(locator, visible: false).find(\"option[value='#{option_value}']\").select_option\n rescue => ex\n p ex\n $logger.error(ex) # armazena o erro em logs.\n raise \"Erro ao Selecionar o combobox com o valor #{option_value} e locator #{locator}.\"\n end", "def select_by_value(id, option, form = self)\n form.find_field(id.to_s).find(\"option[value='#{option}']\").select_option\n end", "def select_custom(locator:, option_value:)\n find(locator, visible: false).first(:option, option_value.to_s, visible: false).select_option\n rescue => ex\n p ex\n $logger.error(ex) # armazena o erro em logs.\n raise \"Erro ao Selecionar o combobox com o valor #{option_value} e locator #{locator}.\"\n end", "def choose_from_drop_down(locator, value, type='css')\n find(type.to_sym, locator).find(:option, \"#{value}\").select_option\n Zpg.wait_for_ajax\n end", "def set_select_option(name, tag, container, option)\n eval(SELECTOR_MAPPING[container][name][tag]['options'][ELEMENT]).detect{ |elem| elem.text == option }.select_option\n end", "def select_option(how=nil, what=nil)\n raise \"Locator at #{location} can not be interacted with\" unless visible?\n el.click if how.nil?\n Selenium::WebDriver::Support::Select.new(el).select_by(how, what)\n end", "def selects(option_text, options = {})\n id_or_name_or_label = options[:from]\n \n if id_or_name_or_label\n field = find_field(id_or_name_or_label, SelectField)\n option = field.find_option(option_text)\n else\n option = find_select_option(option_text)\n end\n \n flunk(\"Could not find option #{option_text.inspect}\") if option.nil?\n option.choose\n end", "def select(option)\n locator = \"#{@locator}//li[text()='#{option}']\"\n DwrElement.new(locator).click\n end", "def select_option_from_dropdown(form, dropdown_id, option_text)\n dropdown = form.find_element(:id, dropdown_id)\n opts = dropdown.find_elements(:tag_name, 'option')\n option = opts.detect {|opt| opt['text'] == option_text}\n option.click\n end", "def select(option)\n locator = \"#{@locator}//li/a[text()='#{option}'] | #{@locator}//span[text()='#{option}']\"\n DwrElement.new(locator).click\n end", "def set option_value\n self.select option_value\n end", "def select_option_from_dropdown(access_name, option)\n\tfind(:xpath, \"#{access_name}\")\n\twithin(:xpath, \"#{access_name}\") do\n \tselect(\"#{option}\")\n \tend\nend", "def select_option(selectName, text)\t\r\n\t\t\t\tSelenium::WebDriver::Support::Select.new(find_element(:name, selectName)).select_by(:text, text)\r\n end", "def select_by_text(value)\n uf2 = find('select[id$=UF]')\n uf2.click\n uf2.find('option', text: value).click\n end", "def select_item_from_list(by, value, option_text)\n items = @browser.find_elements(by, value).first\n items.find_elements(tag_name: 'option').find do |option|\n option.text == option_text\n end.click\n end", "def select_with_name(val)\n option_locator = \"label=regexi:^#{val}$\"\n @driver.sc_select(:view, option_locator, self.abs_path)\n stall :select\n end", "def select_by(key, value)\n option = Selenium::WebDriver::Support::Select.new(element)\n option.select_by(key, value)\n end", "def select(field, values, options = {})\n opts = set_options(:select, field, options)\n opts.delete(:type)\n\n values = [values] if values.is_a?(String) || values.is_a?(Symbol)\n values = Hash[values.map { |k| [k.to_s, k.to_s] }] if values.is_a?(Array)\n\n id = opts[:id]\n vals = opts.delete(:value) || ''\n content = values.map do |value_, label_|\n opts_ = {}\n opts_[:id] = \"#{id}_#{value_.to_s.underscore}\"\n opts_[:value] = value_\n opts_[:selected] = 'selected' if vals.to_s == value_.to_s\n tag :option, label_, opts_\n end.join('')\n\n tag :select, content, opts\n end", "def choose_option(id, text)\n click_wait xpath: select_xpath(id)\n click_wait xpath: select_option_xpath(id, text)\n end", "def select_with_value(val)\n guid = @driver.get_sc_guid(val)\n option_locator = \"value=regexi:^#{guid}$\"\n @driver.sc_select(:view, option_locator, self.abs_path)\n stall :select\n end", "def mselect2(value, options)\n id = find_label_by_text(options[:from])\n options[:from] = \"#s2id_#{id}\"\n\n find(\"#{options[:from]} ul.select2-choices\").click\n find(:xpath, \"//div[@class='select2-result-label' and contains(., '#{value}')]\").click\n end", "def select_item_by_value(webelement,value)\n option=Selenium::WebDriver::Support::Select.new(@driver.find_element(webelement))\n option.select_by(:value,value)\n end", "def select_option(selector, selection)\r\n options = selector.options.select { |o| o.text == selection }\r\n options = selector.options.select { |o| o.value == selection } if options.empty?\r\n options = selector.options.select { |o| o.text.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\r\n options = selector.options.select { |o| o.value.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\r\n options = selector.options.select { |o| o.text.include?(selection) } if options.empty?\r\n options = selector.options.select { |o| o.value.include?(selection) } if options.empty?\r\n\r\n option = options.first\r\n option.select() unless option.nil?\r\n return option\r\n end", "def select_from_chosen(item_text, options)\n option_value = page.evaluate_script(\"$(\\\"##{options[:id]} option:contains('#{item_text}')\\\").val()\")\n page.execute_script(\"$('##{options[:id]}').val('#{option_value}')\")\n end", "def set_dropdown_value(id, value, timeout=nil)\r\n find_by_id_and_class(id, \"gwt-ListBox\", 0) # so we get an error if it doesn't have the right type\r\n option = find(:xpath, \"//*[@id='#{id}']/option[text()='#{value}']\").text\r\n select(option, :from => id)\r\n end", "def select_option(selector, selection)\n options = selector.options.select { |o| o.text == selection }\n options = selector.options.select { |o| o.value == selection } if options.empty?\n options = selector.options.select { |o| o.text.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\n options = selector.options.select { |o| o.value.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\n options = selector.options.select { |o| o.text.include?(selection) } if options.empty?\n options = selector.options.select { |o| o.value.include?(selection) } if options.empty?\n\n option = options.first\n option.select() unless option.nil?\n return option\n end", "def click_selector(sym,id,selector_value)\n option = Selenium::WebDriver::Support::Select.new(driver.find_element(sym.to_sym,id))\n option.select_by(:text, selector_value)\n end", "def select_from_dropdown(name, tag, container, value, dropdown = 'dropdown')\n selection = SELECTOR_MAPPING[container][name][tag][dropdown]\n\n elem = wait_visibility(name, tag, container)\n elem.select(value, :from => selection)\n end", "def select_with_index(val)\n option_locator = \"index=#{val}\"\n @driver.sc_select(:view, option_locator, self.abs_path)\n stall :select\n end", "def select_item_in_select_list(attribute, value)\r\n assert_exists\r\n highlight( :set )\r\n doBreak = false\r\n #element.log \"Setting box #{@o.name} to #{attribute} #{value} \"\r\n @o.each do |option| # items in the list\r\n if value.matches( option.invoke(attribute.to_s))\r\n if option.selected\r\n doBreak = true\r\n break\r\n else\r\n option.selected = true\r\n @o.fireEvent(\"onChange\")\r\n @o.wait\r\n doBreak = true\r\n break\r\n end\r\n end\r\n end\r\n unless doBreak\r\n raise NoValueFoundException, \r\n \"No option with #{attribute.to_s} of #{value} in this select element\" \r\n end\r\n highlight( :clear )\r\n end", "def drop_down_field_select(value)\n control = @field.all(:css, 'select[class=\"form-control\"]').first[:id]\n select(value, :from => control)\n end", "def select_category_option(value, _)\n locators = %w[.cucumber-popular-item .cucumber-item]\n locators.each do |locator|\n return find(locator, text: value).click if page.has_css?(locator, text: value)\n end\n raise Capybara::ElementNotFound.new(\"Can't click on #{value} target option\")\n end", "def click_dropdown(options = {}, container = page)\n options = { index: nil, text: nil, prompt: nil, name: nil, wait: nil }.merge(options)\n dropdown = find_dropdown(options, container)\n selector = \"\"\n keyword_args = {}\n\n dropdown_options = dropdown_click_and_get_options(dropdown)\n yield if block_given?\n\n keyword_args[:wait] = options[:wait] if options[:wait].present? && options[:wait] > 0\n\n if options[:text].present?\n selector = \"div .cf-select__option\"\n keyword_args[:text] = options[:text]\n elsif options[:index].present?\n selector = \"div[id$='-option-#{options[:index]}']\"\n end\n\n click_dropdown_menu_item(dropdown, selector, keyword_args)\n\n dropdown_options\n end", "def selects(option_text, options = {})\n find_select_option(option_text, options[:from]).choose\n end", "def selects(option_text, options = {})\n if options[:from]\n select = find_select_list_by_name_or_label(options[:from])\n return flunk(\"Could not find select list #{options[:from].inspect}\") if select.nil?\n option_node = find_option_by_value(option_text, select)\n return flunk(\"Could not find option #{option_text.inspect}\") if option_node.nil?\n else\n option_node = find_option_by_value(option_text)\n return flunk(\"Could not find option #{option_text.inspect}\") if option_node.nil?\n select = option_node.parent\n end\n add_form_data(select, option_node.attributes[\"value\"] || option_node.innerHTML)\n # TODO - Set current form\n end", "def select_option value, contents, attrs = {}\n Tagz.tag :option, contents, { :value => value }.merge(attrs)\n end", "def select(select=nil)\n @options[:select] = select if select.kind_of?(String)\n end", "def choose_random_option_from_drop_down(type, locator)\n options = find(type, locator).all(:option)\n if options.last.text.include? 'My address is not listed'\n tmp_options = options.drop(1)\n # remove my address is not listed option\n tmp_options2 = tmp_options.first options.size - 1\n # select from what is left\n tmp_options2[rand(tmp_options2.count)].select_option\n elsif options.count <= 2\n options[1].select_option\n else\n tmp_options3 = options.drop(1)\n tmp_options3[rand(tmp_options3.count)].select_option\n end\n end", "def select_from_dropdown(field, value)\n sleep 3\n found_value = case field\n when :dictionary_name\n select_name_options.detect { |item| item.text.downcase.include? value.downcase }\n when :version\n select_version_options.detect { |item| item.text.include? value }\n when :locale\n select_locale_options.detect { |item| item.text.downcase.include? value.downcase }\n when :synonym_list\n select_list_options.detect { |item| item.text.downcase.include? value.downcase }\n else\n raise 'Please provide valid input'\n end\n\n raise \"Value #{value} for field #{field.to_s} not found\" unless found_value\n found_value.click\n sleep 5\n end", "def getSelect(key,option)\n begin\n Selenium::WebDriver::Support::Select.new(getElement_xpath(key)).select_by(:text,option)\n rescue\n\n end\nend", "def select(*args, &block)\n _gestalt_call_tag(:select, args, &block)\n end", "def select_account_filter_option(option)\n options = @page.all(input_elements[:filter_options])\n options.each do |op|\n return op.click if op.text.eql?(option)\n end\n fail(ArgumentError.new(\"Unable to click on option: #{option}\"))\n end", "def select_extjs_dropdown_by_hiddenname(value, options={})\n raise \"Must pass a hash containing 'hidden_name'\" if not options.is_a?(Hash) or not options.has_key?(:hidden_name)\n field = find('input[name=\\'' + options[:hidden_name] + '\\'] ~input')\n field.click\n field.send_keys(value[0..3])\n find('.x-combo-list .x-combo-list-item', :text => value).click\n end", "def selectOptionByName(list, option_name)\n case list\n when \"Roles Allowed to Assign and Remove Idea Coordinator\" then\n rolesideacoordinator.find(\"option\", :text => /\\A#{option_name}\\Z/).select_option\n\n ###Security Page options###\n when \"Users Who Can Include Links\" then\n rolestoincludelinks_selector.find(\"option\", :text => /\\A#{option_name}\\Z/).select_option\n\n else\n \"'#{list}' list doesn't exist.\"\n end\n sleep 2\n end", "def find_select_option(name_or_id)\n return nil if self.select_options.blank?\n self.select_options.detect { |option| option.name.to_s == name_or_id.to_s || option._id == name_or_id }\n end", "def select(selector, *values)\n values.each { |value| raise \"Values must be strings. Found value '#{value}' of type '#{value.class}'\" unless value.is_a? String }\n\n select_values = <<~JAVASCRIPT\n (element, values) => {\n if (element.nodeName.toLowerCase() !== 'select')\n throw new Error('Element is not a <select> element.');\n\n const options = Array.from(element.options);\n element.value = undefined;\n for (const option of options) {\n option.selected = values.includes(option.value);\n if (option.selected && !element.multiple)\n break;\n }\n element.dispatchEvent(new Event('input', { 'bubbles': true }));\n element.dispatchEvent(new Event('change', { 'bubbles': true }));\n return options.filter(option => option.selected).map(option => option.value);\n }\n JAVASCRIPT\n\n query_selector_evaluate_function(selector, select_values, values).value!\n end", "def edit_dropdown_field(id, val)\n Log.logger.info(\"Selecting the drop-down list value to #{val}\")\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n select_elem = wait.until { @browser.find_element(:xpath => \"//select[@id = '#{id}']\") }\n flag = false\n select_elem.find_elements(:xpath => \"//option\").each {|e|\n next unless e.text.downcase.include?(val.downcase) ; flag = true ; e.click ; break ;\n }\n Log.logger.info(\"Failed to edit dropdown field for #{val}\") unless flag\n end", "def as_select\n Selenium::WebDriver::Support::Select.new(element)\n end", "def select(val)\n raise \"select requires a String.\" unless val.is_a? String\n @select = val\n self\n end", "def select(*args, &block)\n browser.within(component_locator) do\n browser.select(*args, &block)\n end\n end", "def select_from_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val, select_value)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).select(select_value)\nend", "def draw_select(locator, options = {})\n offset_x = options.fetch(:offset_x, 0)\n offset_y = options.fetch(:offset_y, 0)\n\n id = random_id\n\n execute_script(%(\n var element = arguments[0];\n var rect = element.getBoundingClientRect();\n var x = rect.left;\n var y = rect.bottom;\n var width = element.offsetWidth;\n function escape(str) {\n \treturn str.replace(\n /[\\\\x26\\\\x0A<>'\"]/g,\n function(r) { return \"&#\" + r.charCodeAt(0) + \";\"; }\n );\n }\n var content = \"\";\n for (var i = 0; i < element.length; i++) {\n \tif (!element.options[i].disabled) {\n content += escape(element.options[i].text) + \"<br />\";\n }\n }\n var dropdown = document.createElement('div');\n dropdown.id = \"#{id}\";\n dropdown.innerHTML = content;\n dropdown.style.backgroundColor = '#fff';\n dropdown.style.border = '1px solid #000';\n dropdown.style.color = '#000';\n dropdown.style.display = 'block';\n dropdown.style.fontSize = '12px';\n dropdown.style.height = '1px';\n dropdown.style.padding = '2px';\n dropdown.style.position = 'absolute';\n dropdown.style.width = width + 'px';\n dropdown.style.zIndex = '99999';\n document.body.appendChild(dropdown);\n dropdown.style.height = (dropdown.scrollHeight + 8) + 'px';\n if (dropdown.scrollWidth > width) {\n \tdropdown.style.width = (dropdown.scrollWidth + 8) + 'px';\n }\n dropdown.style.left = (x + #{offset_x}) + \"px\";\n dropdown.style.top = (y + #{offset_y}) + \"px\";\n return;\n ), find_element(locator))\n\n find_element(\"id=#{id}\")\n end", "def select *params\n raise_without_self \"Parameters are not specified!\", HOWT if params.empty?\n params = params[0]\n\n unless params.is_a?(Hash) && params.size > 0\n raise_without_self \"Invalid parameters. Should be Text or Fuzzy Search parameters!\", HOWT\n end\n\n # reduce to full form\n params = {@select_default => params.keys[0], :option => params.values[0]} if params.size == 1\n\n # parse full form\n opt = OpenStruct.new(:control_text => nil)\n options = params[:option]\n parse_metric params, opt\n\n raise_without_self \"Options cannot be 'nil'\", HOWT unless options\n options = options.is_a?(Array) ? options : [options]\n options.each do |o|\n unless o.is_a? String\n raise_without_self \"Options should be 'String' or 'Array of String' but is the '#{o.class.name}'!\", HOWT\n end\n end\n\n return @adapter.select(opt, options)\n end", "def select name, options, attrs = {}\n options = select_options options, attrs\n attrs.delete :selected\n Tagz.tag :select, options, { :name => name }.merge(attrs)\n end", "def select_item_by_index(webelement,index)\n option=Selenium::WebDriver::Support::Select.new(@driver.find_element(webelement))\n option.select_by(:index,index)\n end", "def check_dropdown_value(id, value, timeout=nil)\r\n find_by_id_and_class(id, \"gwt-ListBox\", 0) # so we get an error if it doesn't have the right type\r\n begin\r\n page.should have_select(\"#{id}\", :selected => value)\r\n rescue\r\n raise \"Dropdown \\\"\" + id + \"\\\" does not have selected value \\\"\" + value + \"\\\"\"\r\n end\r\n end", "def option (attribute, value)\r\n assert_exists\r\n Option.new(self, attribute, value)\r\n end", "def handy_has_select?(css_selector, select_options)\n selector = css_selector[1..-1]\n case css_selector[0,1]\n when '.'\n attribute = \"@class='#{selector}'\"\n when '#'\n attribute = \"@id='#{selector}'\"\n else\n raise 'only css_selector class or id is currently supported'\n end\n\n page.should have_xpath(\"//select[#{attribute}]\")\n selects = page.find(:xpath, \"//select[#{attribute}]\")\n\n select_options.each do |h|\n selects.find(:xpath, \"./option[#{h[:position]}]\", :text => h[:text])\n if h[:value_match_type] == 'regex'\n selects.find(:xpath, \"./option[#{h[:position]}]\").value.should match Regexp.new(h[:value])\n else\n selects.find(:xpath, \"./option[#{h[:position]}]\", :text => h[:value])\n end\n end\nend", "def select(how, what)\n case how\n when :text, :index, :value\n raise NotImplementedError\n else\n raise ArgumentError, \"can't select options by #{how.inspect}\"\n end\n end", "def get_selected_country\n country_list = @chrome_driver.find_element(:id, COUNTRY_DROP_DOWN_LIST)\n options = country_list.find_elements(:tag_name => 'option')\n options.each do |option|\n if option.text == \"Brazil\"\n option.click\n end\n end\n\n end", "def setPresetView(val)\n EnziUIUtility.wait(@driver, :id, 'presetViews', 100)\n EnziUIUtility.clickElement(@driver, :id, 'presetViews')\n EnziUIUtility.wait(@driver, nil, nil, 2)\n EnziUIUtility.selectOption(@driver, :id, 'presetViews', val)\n #puts \"PresetViewValue: #{@driver.find_element(id: 'presetViews').attribute('text')}\"\n #puts \"val: #{val}\"\n selectedOption = nil\n #Get all the options for this element\n all_options = @driver.find_elements(:tag_name, \"option\")\n #select the options\n all_options.each do |option|\n if option.text == val then\n selectedOption = option\n break\n end\n end\n if selectedOption.text == val\n return true\n else\n return false\n end\n end", "def select\r\n assert_exists\r\n if(@how == :text)\r\n @select_list.select(@what)\r\n elsif(@how == :value)\r\n @select_list.select_value(@what)\r\n end \r\n end", "def ui_dropdown_select_field(content = nil, options = nil, html_options = nil, &block)\n UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(content, options, html_options, &block).render\n end", "def get_value(element, label = false, _browser = @browser)\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n elem = wait.until { _browser.find_element(:xpath => element) }\n val = nil\n text = nil\n if (label)\n val = elem.find_element(:xpath => \"//option[@selected]\").text\n else\n val = elem.attribute(\"value\")\n text = elem.text\n Log.logger.info(\"Value: #{val} Text: #{text}\")\n end\n return val if text.nil? or text.empty? or (text == val)\n return text\n end", "def select(label, name, args = {})\n id = args[:id] ? args[:id] : id_for(name)\n multiple, size = args.values_at(:multiple, :size)\n \n # Get all the values\n if !args[:values] and @form_values.respond_to?(name)\n values = @form_values.send(name)\n else\n values = args[:values]\n args.delete(:values)\n end\n \n args[:multiple] = 'multiple' if multiple\n args[:size] = (size || values.count || 1).to_i\n args[:name] = multiple ? \"#{name}[]\" : name\n args = args.merge(:id => id)\n\n # Retrieve the selected value\n has_selected, selected = args.key?(:selected), args[:selected]\n selected = [selected] if !selected.is_a?(Array)\n args.delete(:selected)\n\n @g.p do\n label_for(id, label, name)\n @g.select args do\n values.each do |value, o_name|\n o_name ||= value\n o_args = {:value => value}\n \n if has_selected and selected.include?(value)\n o_args[:selected] = 'selected'\n end\n \n @g.option(o_args){ o_name }\n end\n end\n end\n end", "def set_option(field, value)\n return @opts[field] if value.nil?\n Scope.new(collection, selector, @opts.merge(field => value))\n end", "def select_by(how, what)\n case how\n when :text\n select_by_text what\n when :index\n select_by_index what\n when :value\n select_by_value what\n else\n raise ArgumentError, \"can't select options by #{how.inspect}\"\n end\n end", "def element_option\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n return_value = ElementOptionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal127 = nil\n id126 = nil\n option_value128 = nil\n\n tree_for_char_literal127 = nil\n stream_LABEL_ASSIGN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token LABEL_ASSIGN\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n stream_option_value = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule option_value\" )\n begin\n # at line 279:4: id '=' option_value\n @state.following.push( TOKENS_FOLLOWING_id_IN_element_option_1997 )\n id126 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id126.tree )\n end\n char_literal127 = match( LABEL_ASSIGN, TOKENS_FOLLOWING_LABEL_ASSIGN_IN_element_option_1999 )\n if @state.backtracking == 0\n stream_LABEL_ASSIGN.add( char_literal127 )\n end\n @state.following.push( TOKENS_FOLLOWING_option_value_IN_element_option_2001 )\n option_value128 = option_value\n @state.following.pop\n if @state.backtracking == 0\n stream_option_value.add( option_value128.tree )\n end\n # AST Rewrite\n # elements: option_value, id, LABEL_ASSIGN\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 279:24: -> ^( '=' id option_value )\n # at line 279:27: ^( '=' id option_value )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_LABEL_ASSIGN.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_id.next_tree )\n @adaptor.add_child( root_1, stream_option_value.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end\n \n return return_value\n end", "def dob_month_list_select\n months = @chrome_driver.find_element(:id, DOB_MONTH_DROPDOWN_LIST)\n options = months.find_elements(:tag_name => 'option')\n options.each do |option|\n if option.text == \"7\"\n option.click\n end\n end\n end", "def ui_select_field(content = nil, options = nil, html_options = nil, &block)\n UiBibz::Ui::Core::Forms::Selects::SelectField.new(content, options, html_options, &block).render\n end", "def select_value(values)\n raise \"select_value is only valid for select items\" unless self.tag_name == \"select\"\n\n if values.is_a?(Array)\n values.each do |value|\n html_safe_value = \"\".html_safe + value.to_s\n self.find(\"option[value=\\\"#{html_safe_value}\\\"]\", visible: false).select_option\n end\n else\n html_safe_value = \"\".html_safe + values.to_s\n self.find(\"option[value=\\\"#{html_safe_value}\\\"]\", visible: false).select_option\n end\n end", "def set_option_value\n @option_value = OptionValue.find(params[:id])\n end", "def select_value( item )\r\n select_item_in_select_list( :value , item )\r\n end", "def selectize_single_select(key, value)\n # It may be tempting to combine these into one execute_script, but don't; it will cause failures.\n open_selectize_chooser(key)\n execute_script \"\n var options = #{find_selectized_control_js(key)}.querySelectorAll('.option');\n var option = Array.from(options).find((opt) => opt.innerHTML.match(/#{value}/));\n option.click() \"\n end", "def select_category_from_dropdown(category)\n click('Click to select category from dropdown', @driver.find_element(:xpath, DROPDOWN_OPTIONS_FORMAT % [category]))\n end", "def option(opt)\n @options[opt]\n end", "def setCity(val)\n EnziUIUtility.wait(@driver, :id, 'city', 20)\n EnziUIUtility.clickElement(@driver, :id, 'city')\n EnziUIUtility.selectOption(@driver, :id, 'city', val)\n #EnziUIUtility.setValue(@driver,:value,'city',val)\n end", "def select(*a)\n page.select selector_for(*a)\n end", "def select(attribute, choices, options = {})\n object_value = @object ? @object.send(attribute) : nil # grab the object's value\n options.reverse_merge!(:label => attribute.to_s.titleize, :id => \"#{object_name(:id)}_#{attribute}\")\n @renderer.select_tag(\"#{object_name}[#{attribute}]\", @template.options_for_select(choices, object_value), options)\n end", "def select_month(month)\n dropdown_list = find(\"#duration-month\")\n options = dropdown_list.all(\"option\")\n options.each do |option|\n if option.text == month\n option.click\n end\n end\n end", "def define_select_accessor(identifier, *locator, element, &block)\n define_method(\"#{identifier}=\".to_sym) do |*values|\n if block_given?\n instance_exec(&block).select(*values)\n else\n reference_element(element, locator).select(*values)\n end\n end\n end", "def option(name)\n @options[name.to_s]\n end", "def option_for(field, option)\n @options[field][option] if @options[field]\n end", "def wait_for_element_and_select_js(select_element, option)\n wait_for_update_and_click_js select_element\n wait_until(Utils.short_wait) { (select_element.options.map { |o| o.text.strip }).include? option }\n option_to_select = (select_element.options.find { |o| o.text.strip == option })\n option_to_select.click\n end", "def selecione(ator) \n\t\t\t\t\tfind('.select2-selection--multiple').click #Nesse caso os elementos estão sendo encapsulados dentro do método!\n\t\t\t\t\tfind('.select2-search__field').set ator\n\t\t\t\t\tfind('.select2-results__option').click\n\t\t\t\tend", "def options\n @element.find_elements :tag_name => \"option\"\n end", "def ui_dropdown(name, options = nil, html_options = nil, &block)\n UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new(name, options, html_options).tap(&block).render\n end", "def assert_selected(locator, value)\n assert_element_present locator\n wait_for do |context|\n actual = selenium.get_selected_label(locator)\n context.message = \"Expected '#{locator}' to be selected with '#{value}' but was '#{actual}\"\n value == actual\n end\n end", "def label\n option ? option.text : read_attribute(:label)\n end", "def set_option\n @option = Option.find(params[:id])\n end", "def set_option\n @option = Option.find(params[:id])\n end", "def set_option\n @option = Option.find(params[:id])\n end", "def set_option\n @option = Option.find(params[:id])\n end", "def set_option\n @option = Option.find(params[:id])\n end", "def set_option\n @option = Option.find(params[:id])\n end", "def set_option\n @option = Option.find(params[:id])\n end", "def set_option\n @option = Option.find(params[:id])\n end" ]
[ "0.7034256", "0.68587095", "0.67471915", "0.67297506", "0.658079", "0.6499297", "0.64912707", "0.638011", "0.62805694", "0.6278522", "0.62738323", "0.62417895", "0.6230046", "0.61781883", "0.6116308", "0.6002265", "0.5991919", "0.5985307", "0.59189576", "0.58101934", "0.5797505", "0.57378626", "0.56335145", "0.55915153", "0.55869156", "0.5572384", "0.55531555", "0.5539997", "0.55143356", "0.5505765", "0.5487838", "0.5460968", "0.54605347", "0.5445206", "0.54033595", "0.539308", "0.5380862", "0.5377994", "0.5331157", "0.53200656", "0.5303465", "0.5276324", "0.52688503", "0.52267927", "0.5221172", "0.51960844", "0.51662457", "0.51536185", "0.5150455", "0.5148776", "0.5093988", "0.50771827", "0.5073345", "0.5058938", "0.5022312", "0.50158054", "0.5008313", "0.49681655", "0.49190852", "0.491065", "0.48962456", "0.48843014", "0.48776528", "0.48760566", "0.4840172", "0.4805597", "0.4797816", "0.47938403", "0.47733954", "0.47557083", "0.47398734", "0.47336465", "0.47336203", "0.47317487", "0.47289836", "0.47115734", "0.47112435", "0.47100744", "0.47017905", "0.46998143", "0.46968633", "0.46945968", "0.4679492", "0.46725512", "0.46592015", "0.4657554", "0.46573412", "0.4651027", "0.4646379", "0.46352312", "0.46327478", "0.46308327", "0.46295434", "0.46295434", "0.46295434", "0.46295434", "0.46295434", "0.46295434", "0.46295434" ]
0.6640405
5
Add a selection to the set of selected options in a multiselect element using an option locator. See the select command for more information about option locators.
def add_selection locator, option_locator command 'addSelection', locator, option_locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_selected_option(option)\n if new_record?\n self.selected_options = build_selected_options\n else\n update_column(:selected_options, build_selected_options(vote_proposal_options + [option]))\n end\n end", "def store_select_options locator, variable_name\r\n command 'storeSelectOptions', locator, variable_name\r\n end", "def store_selected_options locator, variable_name\r\n command 'storeSelectedOptions', locator, variable_name\r\n end", "def store_selected_values select_locator, variable_name\r\n command 'storeSelectedValues', select_locator, variable_name\r\n end", "def add_to_selection\n case @selection_mode \n when :multiple\n if @selected_indices.include? @current_index\n @selected_indices.delete @current_index\n else\n @selected_indices << @current_index\n end\n else\n end\n @repaint_required = true\n end", "def select locator, option_locator\r\n command 'select', locator, option_locator\r\n end", "def select locator, option_locator\r\n command 'select', locator, option_locator\r\n end", "def selectize_multi_select(key, *values)\n values.flatten.each do |value|\n open_selectize_chooser(key)\n execute_script(\"\n #{find_selectized_control_js(key)}.querySelector('input').value = '#{value}';\n document.querySelector$('##{key}.selectized').selectize.createItem();\n \")\n end\n end", "def store_selected_ids select_locator, variable_name\r\n command 'storeSelectedIds', select_locator, variable_name\r\n end", "def select(option_locator)\n find_element(option_locator).click\n end", "def build_options_and_select(type, selected, options = {})\n build_select(type, build_options(selected, options))\n end", "def store_selected_value select_locator, variable_name\r\n command 'storeSelectedValue', select_locator, variable_name\r\n end", "def selecione(ator) \n\t\t\t\t\tfind('.select2-selection--multiple').click #Nesse caso os elementos estão sendo encapsulados dentro do método!\n\t\t\t\t\tfind('.select2-search__field').set ator\n\t\t\t\t\tfind('.select2-results__option').click\n\t\t\t\tend", "def store_something_selected select_locator, variable_name\r\n command 'storeSomethingSelected', select_locator, variable_name\r\n end", "def select_multi(field_name, choices, options = {})\n power_options = power_options!(field_name, options)\n # generic_field(:select, super(field_name, choices, options), field_name, power_options)\n generic_field(:select, 'SELECT MULTI', field_name, power_options)\n end", "def add_select_options(opt)\n opt.on('--select x,y,z', Array,\n \"Select x, y, z columns only\") do |value|\n self.select = value.collect{|c| c.to_sym}\n end\n opt.on('--allbut x,y,z', Array,\n \"Select all but x, y, z columns\") do |value|\n self.allbut = value.collect{|c| c.to_sym}\n end\n end", "def select_multiple(*values)\n clear\n values.flatten.each{ |value| select(value) }\n end", "def store_selected locator, option_locator, variable_name\r\n raise 'Not supported in Selenium Core at the moment'\r\n end", "def set_multiple(options)\n options.each do |option, value|\n set(option, value)\n end\n end", "def select_item_in_select_list(attribute, value)\r\n assert_exists\r\n highlight( :set )\r\n doBreak = false\r\n #element.log \"Setting box #{@o.name} to #{attribute} #{value} \"\r\n @o.each do |option| # items in the list\r\n if value.matches( option.invoke(attribute.to_s))\r\n if option.selected\r\n doBreak = true\r\n break\r\n else\r\n option.selected = true\r\n @o.fireEvent(\"onChange\")\r\n @o.wait\r\n doBreak = true\r\n break\r\n end\r\n end\r\n end\r\n unless doBreak\r\n raise NoValueFoundException, \r\n \"No option with #{attribute.to_s} of #{value} in this select element\" \r\n end\r\n highlight( :clear )\r\n end", "def add_selection(pane, options = {})\n @selections[pane] = Selection.new(options.merge(:pane => pane))\n end", "def select_dropdown(locator, option, method = :value)\n Console.log.info \"Selecting field: #{locator} \\n\\toption: #{option}\n select method: #{method}\"\n select_list = Selenium::WebDriver::Support::Select.new(find(locator))\n select_list.select_by(method, option)\n end", "def store_selected_indexes select_locator, variable_name\r\n command 'storeSelectedIndexes', select_locator, variable_name\r\n end", "def build_options_and_select(type, selected, options = T.unsafe(nil)); end", "def selected=(selected)\n @selected = selected\n update_cursor\n end", "def clear_multi_option_select(how, what)\n select_element=$driver.find_element(how, what)\n select_element.find_elements(:tag_name, \"option\").each do |option|\n if option.selected?\n option.toggle\n end\n end\n end", "def change_selected_elements(element, selected)\n code = \"var selected_elements = $('#{selected}').value.split(',').without('');\"\n code += \"if ($(this).checked) {$('#{selected}').value = selected_elements.concat('#{element}').join(',')}\"\n code += \"else {$('#{selected}').value = selected_elements.without('#{element}').join(',')};\"\n end", "def store_selected_labels select_locator, variable_name\r\n command 'storeSelectedLabels', select_locator, variable_name\r\n end", "def selected_options\n options.select { |e| e.selected? }\n end", "def add_select_option()\n session[:count] += 1\n end", "def remove_all_selections locator\r\n command 'removeAllSelections', locator\r\n end", "def options_for_multiselect_selected( object, method, ids, options = {} )\n return [] if ( ids.nil? or ids.empty? )\n class_name = options[:class_name] || object\n model = get_object(class_name)\n items = get_selected_items(:model => model, :options => options, :ids => ids, :method => method)\n options_from_collection_for_select(items, :to_param, options[:display_value] ||= method)\n end", "def add_select(column)\n @selects.push(column)\n end", "def selected_options\n options.select(&:selected?)\n end", "def set_selected_options_of_pc\n @selected_options_of_pc = SelectedOptionsOfPc.find(params[:id])\n end", "def set_select_option(name, tag, container, option)\n eval(SELECTOR_MAPPING[container][name][tag]['options'][ELEMENT]).detect{ |elem| elem.text == option }.select_option\n end", "def option_groups_from_collection_for_select(collection, group_method, group_label_method, option_key_method, option_value_method, selected_key = T.unsafe(nil)); end", "def select_more( *attributes )\n\t\treturn self.select( *(Array(@options[:select]) | attributes) )\n\tend", "def ui_multi_select_field(content = nil, options = nil, html_options = nil, &block)\n options = (options || {}).merge(multiple: true)\n UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(content, options, html_options, &block).render\n end", "def selected_options\n options.select { |e| e.selected? }\n end", "def lbSetSelected _obj, _args\n \"_obj lbSetSelected _args;\" \n end", "def insert_select(*values)\n with_sql_first(insert_select_sql(*values))\n end", "def store_selected_index select_locator, variable_name\r\n command 'storeSelectedIndex', select_locator, variable_name\r\n end", "def remove_selection locator, option_locator\r\n command 'removeSelection', locator, option_locator\r\n end", "def remove_selection locator, option_locator\r\n command 'removeSelection', locator, option_locator\r\n end", "def select_from_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val, select_value)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).select(select_value)\nend", "def select_option(selectName, text)\t\r\n\t\t\t\tSelenium::WebDriver::Support::Select.new(find_element(:name, selectName)).select_by(:text, text)\r\n end", "def set_sel(first, last)\n send_message(:SETSEL, first, last)\n end", "def remove_selected_option(option)\n if new_record?\n self.selected_options = build_selected_options\n else\n update_column(:selected_options, build_selected_options(vote_proposal_options - [option]))\n end\n end", "def selected\r\n assert_exists\r\n #@option.selected\r\n option_selected\r\n end", "def select(*args, &block)\n _gestalt_call_tag(:select, args, &block)\n end", "def format_select\n @attr[:multiple] = :multiple if @opts[:multiple]\n copy_options_to_attributes([:size])\n\n os = process_select_optgroups(:_format_select_optgroup) do |label, value, sel, attrs|\n if !value.nil? || sel\n attrs = attrs.dup\n attrs[:value] = value unless value.nil?\n attrs[:selected] = :selected if sel\n end\n tag(:option, attrs, [label])\n end\n tag(:select, @attr, os)\n end", "def add_option(option)\n @options += [option]\n end", "def select_item_from_list(by, value, option_text)\n items = @browser.find_elements(by, value).first\n items.find_elements(tag_name: 'option').find do |option|\n option.text == option_text\n end.click\n end", "def select(option)\n locator = \"#{@locator}//li[text()='#{option}']\"\n DwrElement.new(locator).click\n end", "def select_from_chosen(item_text, options)\n option_value = page.evaluate_script(\"$(\\\"##{options[:id]} option:contains('#{item_text}')\\\").val()\")\n page.execute_script(\"$('##{options[:id]}').val('#{option_value}')\")\n end", "def store_selected_id select_locator, variable_name\r\n command 'storeSelectedId', select_locator, variable_name\r\n end", "def set_selectbox_options\n set_kind_option\n set_scheduled_times_option\n set_user_option\n end", "def insert_select(*values)\n unless @opts[:disable_insert_returning]\n ds = opts[:returning] ? self : returning\n ds.insert(*values){|r| return r}\n end\n end", "def as_select\n Selenium::WebDriver::Support::Select.new(element)\n end", "def add_option_selection \n @product = Product.find(params[:product_id])\n @product_option = ProductOption.find(params[:product_option_id])\n name = params[:product_option_selection][:name]\n weight_adjustment = params[:product_option_selection][:weight_adjustment]\n price_adjustment = params[:product_option_selection][:price_adjustment]\n sku_adjustment = params[:product_option_selection][:sku_adjustment]\n @selection = ProductOptionSelection.new(:name => name,\n :weight_adjustment => weight_adjustment,\n :price_adjustment => price_adjustment,\n :sku_adjustment => sku_adjustment)\n @product_option.product_option_selections << @selection\n\n end", "def project_tree_options_for_select_with_multiple_selected(projects, selected, options = {})\n options = project_tree_options_for_select(projects) do |project|\n { :selected => (selected.include?(project) ? 'selected' : nil) }\n end\n return options\n end", "def select_list(list, value)\n append_to_script \"select_list \\\"#{list}\\\" , \\\"#{value}\\\"\"\n end", "def fill_select_option\n @search_by_values = QcLaboratory.get_search_values\n end", "def insert_select(*values)\n return unless supports_insert_select?\n # Handle case where query does not return a row\n server?(:default).with_sql_first(insert_select_sql(*values)) || false\n end", "def select(*args, &block)\n browser.within(component_locator) do\n browser.select(*args, &block)\n end\n end", "def reset_options_for_select\n Specification.reset_options_for_select\n end", "def selectize_single_select(key, value)\n # It may be tempting to combine these into one execute_script, but don't; it will cause failures.\n open_selectize_chooser(key)\n execute_script \"\n var options = #{find_selectized_control_js(key)}.querySelectorAll('.option');\n var option = Array.from(options).find((opt) => opt.innerHTML.match(/#{value}/));\n option.click() \"\n end", "def store_selected_label select_locator, variable_name\r\n command 'storeSelectedLabel', select_locator, variable_name\r\n end", "def selected_options\n @options.find_all { |o| o.selected? }\n end", "def select(option)\n locator = \"#{@locator}//li/a[text()='#{option}'] | #{@locator}//span[text()='#{option}']\"\n DwrElement.new(locator).click\n end", "def toggle_multiple_selection\n toggle_value :multiple_selection\nend", "def api_add_select(model, association, klass, options, html_options = nil)\n html_options ||= {}\n name, url, i18n_key = get_api_relationship_info(model, association, :add)\n new_options = {\n title: t(i18n_key % 'button'),\n data: {\n class: 'SelectPicker', live_search: true, size: 5, type: :jsonapi,\n handling: {method: 'POST', url: url, data: [type: klass.model_name.plural, id: '{id}']},\n 'success-message': t((i18n_key % 'message') + 'Success', model: get_name_for(model))\n }\n }\n select_tag name, options, html_options.deep_merge(new_options)\n end", "def set option_value\n self.select option_value\n end", "def select_value(values)\n raise \"select_value is only valid for select items\" unless self.tag_name == \"select\"\n\n if values.is_a?(Array)\n values.each do |value|\n html_safe_value = \"\".html_safe + value.to_s\n self.find(\"option[value=\\\"#{html_safe_value}\\\"]\", visible: false).select_option\n end\n else\n html_safe_value = \"\".html_safe + values.to_s\n self.find(\"option[value=\\\"#{html_safe_value}\\\"]\", visible: false).select_option\n end\n end", "def select_days_selection(days_selected, days_menu)\n TTY::Prompt.new.multi_select(\"Please select your days to book in:\", days_menu, cycle: true, marker: '>', echo: false, per_page: 7).each do |day|\n @availability[day.to_sym] = \"Booked Out\" # the string is converted back to a symbol, and availability is changed\n days_selected.push(day)\n end\n end", "def step(value)\n\t\tselected.options[:on_deselect].call(selected)\n\t\t@selected += value\n\t\t@selected %= @items.count\n\t\tselected.options[:on_select].call(selected)\n\tend", "def select(*args, &block)\n browser.select(*args, &block)\n end", "def set_item_options user_options\n puts \"========= Setting product options\"\n @b.div(id: \"j-product-info-sku\").dls.each_with_index do |option, index|\n selected = user_options[index]\n if selected.nil?\n option.a.click\n else\n option.as[selected-1].click\n end\n end\n end", "def add_option(choice, *args, &block)\n self.options << choice\n self.builder.add_choice(choice, *args, &block)\n end", "def select_all_items_from_list(loc)\n select_list = @browser.select(parse_location(loc))\n select_list.options.each do |item|\n select_list.select_value(item.value) # Using value because it's more likely to be programmatically ensured unique\n end\n end", "def grouped_collection_select(method, collection, group_method, group_label_method, option_key_method, option_value_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end", "def items=(selected_items)\n @items = selected_items.to_a\n end", "def select(selector, *values)\n values.each { |value| raise \"Values must be strings. Found value '#{value}' of type '#{value.class}'\" unless value.is_a? String }\n\n select_values = <<~JAVASCRIPT\n (element, values) => {\n if (element.nodeName.toLowerCase() !== 'select')\n throw new Error('Element is not a <select> element.');\n\n const options = Array.from(element.options);\n element.value = undefined;\n for (const option of options) {\n option.selected = values.includes(option.value);\n if (option.selected && !element.multiple)\n break;\n }\n element.dispatchEvent(new Event('input', { 'bubbles': true }));\n element.dispatchEvent(new Event('change', { 'bubbles': true }));\n return options.filter(option => option.selected).map(option => option.value);\n }\n JAVASCRIPT\n\n query_selector_evaluate_function(selector, select_values, values).value!\n end", "def select!(*fields)\n @options[:select] ||= fields.join ','\n self\n end", "def selected_options; end", "def selected_options; end", "def sub_select _value=0\n send_cmd(\"sub_select #{_value}\")\n end", "def mselect2(value, options)\n id = find_label_by_text(options[:from])\n options[:from] = \"#s2id_#{id}\"\n\n find(\"#{options[:from]} ul.select2-choices\").click\n find(:xpath, \"//div[@class='select2-result-label' and contains(., '#{value}')]\").click\n end", "def add_row_selection_interval ix0, ix1\n return if @obj.selection_mode != :multiple\n @anchor_selection_index = ix0\n @lead_selection_index = ix1\n ix0.upto(ix1) {|i| \n @selected_indices << i unless @selected_indices.include? i\n @obj.fire_row_changed i\n }\n lse = ListSelectionEvent.new(ix0, ix1, @obj, :INSERT)\n @obj.fire_handler :LIST_SELECTION_EVENT, lse\n #$log.debug \" DLSM firing LIST_SELECTION EVENT #{lse}\"\n end", "def selects(option_text, options = {})\n if options[:from]\n select = find_select_list_by_name_or_label(options[:from])\n return flunk(\"Could not find select list #{options[:from].inspect}\") if select.nil?\n option_node = find_option_by_value(option_text, select)\n return flunk(\"Could not find option #{option_text.inspect}\") if option_node.nil?\n else\n option_node = find_option_by_value(option_text)\n return flunk(\"Could not find option #{option_text.inspect}\") if option_node.nil?\n select = option_node.parent\n end\n add_form_data(select, option_node.attributes[\"value\"] || option_node.innerHTML)\n # TODO - Set current form\n end", "def collection_select(method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end", "def set_selected_values(port, selection_mask, value_mask)\n send_request(FUNCTION_SET_SELECTED_VALUES, [port, selection_mask, value_mask], 'k C C', 0, '')\n end", "def build_options(selected, options = T.unsafe(nil)); end", "def select_list_elements(identifier)\n platform.select_lists_for(identifier.clone)\n end", "def grouped_collection_select(object, method, collection, group_method, group_label_method, option_key_method, option_value_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end", "def select *selection\n @measures.merge! paramerize(selection, VALID_MEASURES, 'Invalid measurement selection')\n self\n end", "def add_to_selection file\n ff = file\n case file\n when String\n ff = [file]\n end\n @current_dir ||= Dir.pwd\n ff.each do |f|\n # this is wrong if the file is a dir listing or visited files listing.\n # full = File.join(@current_dir, f)\n full = expand_path(f)\n @selected_files.push(full) unless @selected_files.include?(full)\n end\nend", "def select\n @product = Product.find_by_param!(params[:product_id])\n @product.option_types << OptionType.find(params[:id])\n @product.reload\n @option_types = @product.option_types\n set_available_option_types\n end" ]
[ "0.66450036", "0.63963354", "0.63625973", "0.60460186", "0.6039635", "0.6022019", "0.6022019", "0.59825194", "0.59673065", "0.5697151", "0.55566144", "0.555519", "0.55261797", "0.5519465", "0.5498487", "0.54579663", "0.5404081", "0.5355633", "0.53060555", "0.52610403", "0.52585924", "0.52394116", "0.5223248", "0.5199826", "0.5183956", "0.518003", "0.5167916", "0.5166758", "0.51456666", "0.51308006", "0.5117233", "0.5112834", "0.50972", "0.50826913", "0.5036251", "0.5031104", "0.50210094", "0.5003204", "0.49916974", "0.4984921", "0.4984416", "0.49742728", "0.49718252", "0.49579316", "0.49579316", "0.4950769", "0.4948331", "0.49469566", "0.49399832", "0.49397025", "0.4932082", "0.4930637", "0.49239254", "0.49111226", "0.48929134", "0.48892832", "0.48810706", "0.48667195", "0.4862735", "0.4861282", "0.48567858", "0.4851247", "0.4827178", "0.4824356", "0.4813507", "0.4812469", "0.48072696", "0.47990772", "0.47843313", "0.47834033", "0.4771556", "0.47645217", "0.4760618", "0.4754013", "0.47520706", "0.47515872", "0.47479412", "0.4744126", "0.4742227", "0.47402084", "0.47377247", "0.47373676", "0.47339225", "0.47238606", "0.47135267", "0.4700953", "0.4700953", "0.46973747", "0.46909565", "0.46903148", "0.46652538", "0.46584186", "0.46579283", "0.46444884", "0.46384698", "0.46371484", "0.46368787", "0.4606184", "0.460315" ]
0.669435
1
Remove a selection from the set of selected options in a multiselect element using an option locator. See the +select+ command for more information about option locators.
def remove_selection locator, option_locator command 'removeSelection', locator, option_locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_multi_option_select(how, what)\n select_element=$driver.find_element(how, what)\n select_element.find_elements(:tag_name, \"option\").each do |option|\n if option.selected?\n option.toggle\n end\n end\n end", "def remove_all_selections locator\r\n command 'removeAllSelections', locator\r\n end", "def remove_selected_option(option)\n if new_record?\n self.selected_options = build_selected_options\n else\n update_column(:selected_options, build_selected_options(vote_proposal_options - [option]))\n end\n end", "def unselect *params\n opt = parse_params_for_select params\n return @adapter.unselect(opt)\n end", "def reset_options_for_select\n Specification.reset_options_for_select\n end", "def deselect_item\n @selected = nil\n\n items\n end", "def clear_selection_from_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).clearSelection\nend", "def clearSelection\r\n assert_exists\r\n #highlight( :set)\r\n wait = false\r\n @o.each do |selectBoxItem|\r\n if selectBoxItem.selected\r\n selectBoxItem.selected = false\r\n wait = true\r\n end\r\n end\r\n @o.wait if wait\r\n #highlight( :clear)\r\n end", "def deselect\n execute_only(:deselect)\n end", "def selection_clear\n execute_only(:selection, :clear)\n end", "def remove_option_selection \n @product = Product.find(params[:product_id])\n @product_option = ProductOption.find(params[:product_option_id])\n @selection = ProductOptionSelection.find(params[:selection_id])\n \n @product_option.product_option_selections.delete(@selection)\n end", "def clear_selection\n return if @selected_indices.nil? || @selected_indices.empty?\n arr = @selected_indices.dup # to un highlight\n @selected_indices.clear\n arr.each {|i| @obj.fire_row_changed(i) }\n @selected_index = nil\n @old_selected_index = nil\n # User should ignore first two params\n lse = ListSelectionEvent.new(0, arr.size, @obj, :CLEAR)\n @obj.fire_handler :LIST_SELECTION_EVENT, lse\n arr = nil\n end", "def onSelectedRemoved(*args)\n onSelectionRemoved(*args)\n end", "def unselect; end", "def deselect\n select(0, 0)\n end", "def remove_selected\n case @selected\n when Stroke\n remove_stroke(@selected)\n when ToyInScene\n remove_toy(@selected)\n end\n end", "def remove_selected(selected)\n case selected\n when Stroke\n @main_view.remove_stroke(selected)\n when ToyInScene\n @main_view.remove_toy(selected)\n end\n close_popover\n moveToSceneBar\n end", "def post_select(model, iter, mc)\n model.remove(iter.first_child)\n end", "def ask_unselect prompt=\"Enter selection pattern: \"\n ret = get_string prompt\n return if ret.nil? || ret == \"\"\n indices = get_matching_indices ret\n return if indices.nil? || indices.empty?\n indices.each { |e|\n # will not work if single select !! FIXME\n remove_row_selection_interval e,e\n }\n end", "def deselectplugin(browser)\n browser.checkbox(:id,\"plugins-select-all\").clear\nend", "def select_multiple(*values)\n clear\n values.flatten.each{ |value| select(value) }\n end", "def remove(*a)\n # event is namespaced to not accidently trigger closing the dialog box\n select(*a).trigger('clockwork.remove')\n select(*a).remove()\n end", "def remove_all(*args)\n set_option_value(:remove_all, true, *args)\n end", "def unselect_place\n @selected_place = nil;\n end", "def deselect_all\n map(&:deselect).all?\n end", "def deregister_options(*names)\n\t\tnames.each { |name|\n\t\t\tself.options.remove_option(name)\n\t\t\tself.datastore.delete(name)\n\t\t}\n\tend", "def unselect_values values\n return unless values\n values.each do |val|\n row = @list.index val\n remove_row_selection_interval row, row unless row.nil?\n end\n end", "def clear_options\r\n\t\tself.option_values.clear\r\n\tend", "def clear_options\r\n\t\t# this line _may_ be doing nothing\r\n\t\t#self.option_values.clear\r\n\t\t# has_many :through needs this?\r\n\t\tself.line_item_option_values.clear\r\n\r\n#\t\tself.line_item_option_values.each do |liov|\r\n#\t\t\tliov.destroy\r\n#\t\tend\r\n\tend", "def clear_selection()\n @last_pos = nil\n @selection = nil\n end", "def trim_branches\n @selection = Downup::Base.new(\n options: branch_options,\n type: :multi_select,\n multi_select_selector: multi_select_selector,\n selected_color: selected_color,\n header_proc: header_proc\n ).prompt\n\n delete_branches_confirmation\n @selection\n end", "def remove_selection\n buffer_current.remove_selection\n update_status_line\n end", "def remove(*names)\n extract_and_apply_options!(names)\n delete_if { |name| names.include?(name) }\n self\n end", "def remove(*names)\r\n extract_and_apply_options!(names)\r\n delete_if { |name| names.include?(name) }\r\n self\r\n end", "def deselect_piece\n @selected_piece_pos = nil\n\n end", "def selected_options\n options.select { |e| e.selected? }\n end", "def selected_options\n options.select { |e| e.selected? }\n end", "def delete_option(name)\n @options.delete(name)\n end", "def unselect\n @unselect || \"future\"\n end", "def select_by_id_clear(id_name)\n select_by_id(id_name).clear\nend", "def selected_options\n options.select(&:selected?)\n end", "def deselect(how, what)\n case how\n when :value, :index, :text\n raise NotImplementedError\n else\n raise ArgumentError, \"can't deselect options by #{how.inspect}\"\n end\n end", "def remove_item(remove_options)\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n JQuery.wait_for_events_to_finish(@browser)\n\n regular_options = \"//a[@href='#' and contains(text(),'Options')]\"\n expanded_options = \"//a[@href='#' and @aria-expanded='true' and contains(text(),'Options')]\"\n unexpanded_options = \"//a[@href='#' and @aria-expanded='false' and contains(text(),'Options')]\"\n\n Log.logger.info(\"Waiting for the unexpanded 'Options' tab.\")\n unexpanded_opts = wait.until { @browser.find_element(:xpath => unexpanded_options) }\n Log.logger.info(\"Clicking on the unexpanded 'Options' tab.\")\n unexpanded_opts.click\n JQuery.wait_for_events_to_finish(@browser)\n Log.logger.info(\"Waiting for the expanded 'Options' tab.\")\n expanded_opts = wait.until { @browser.find_element(:xpath => expanded_options) }\n\n JQuery.wait_for_events_to_finish(@browser)\n remove_options.each {|remove_option|\n temp = wait.until { @browser.find_element(:xpath =>\n \"//input[contains(@class, 'form-radio option-default') and @value = '#{remove_option}']/../../td[3]/a[contains(@class, 'remove')]\") }\n puts \"Found element to remove\"\n wait.until {temp.displayed?}\n puts \"Element is visible now, clicking\"\n temp.click\n JQuery.wait_for_events_to_finish(@browser)\n wait.until { @browser.find_elements(:xpath => \"//input[contains(@class, 'form-radio option-default') and @value = '#{remove_option}']\").empty? }\n }\n end", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def remove\n selected.each { |view| view.parent.removeView(view) }\n self\n end", "def store_selected_options locator, variable_name\r\n command 'storeSelectedOptions', locator, variable_name\r\n end", "def unselected\n @unselected ||= @cache.reject { |i,s,c| s }\n end", "def drop_external_selection(list, name)\n list.each do |l|\n drop_external_selection(l[:entries], name) if l[:entries]\n list.delete(l) if l[:name] == name\n end\n end", "def toggle_multiple_selection\n toggle_value :multiple_selection\nend", "def clearOption(name)\n @options.delete(name)\n end", "def store_select_options locator, variable_name\r\n command 'storeSelectOptions', locator, variable_name\r\n end", "def select_by_class_clear(class_name)\n select_by_class(class_name).clear\nend", "def delete_users_choices\n choices = get_choices\n choices.each do |choice|\n choice.delete\n end\n end", "def change_selected_elements(element, selected)\n code = \"var selected_elements = $('#{selected}').value.split(',').without('');\"\n code += \"if ($(this).checked) {$('#{selected}').value = selected_elements.concat('#{element}').join(',')}\"\n code += \"else {$('#{selected}').value = selected_elements.without('#{element}').join(',')};\"\n end", "def uncheck_all_checkboxes(count, id)\n Log.logger.info(\"Unchecking all '#{count}' options in the checkbox\")\n count.times {|i|\n i += 1\n check = @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).selected?\n if(check == true)\n @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).click\n end\n }\n end", "def eliminateChoices(cell)\n if (value = cell.hasFinalValue)\n cell.mark\n [@boxes[cell.box],@rows[cell.row],@cols[cell.col]].each do |set|\n eliminateChoiceFromSet(set, cell, value)\n end\n end\n end", "def remove_row_selection_interval ix0, ix1\n @anchor_selection_index = ix0\n @lead_selection_index = ix1\n arr = @selected_indices.dup # to un highlight\n @selected_indices.delete_if {|x| x >= ix0 and x <= ix1 }\n arr.each {|i| @obj.fire_row_changed(i) }\n lse = ListSelectionEvent.new(ix0, ix1, @obj, :DELETE)\n @obj.fire_handler :LIST_SELECTION_EVENT, lse\n end", "def unselect(index)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_unselect(@handle.ptr, index)\n end", "def select locator, option_locator\r\n command 'select', locator, option_locator\r\n end", "def select locator, option_locator\r\n command 'select', locator, option_locator\r\n end", "def ingredient_remove_helper(recipe_id)\n new_recipe_ingredient_arr = prompt.multi_select(\"Please choose from the list, ingredients you would like to keep\") do |menu|\n menu.choices user.recipes.where(id: recipe_id)[0].ingredient.split(\", \")\n end\n ingredient_change_helper(recipe_id, new_recipe_ingredient_arr)\n end", "def remove_target_set(value)\n @children['target-set'][:value].delete(value)\n end", "def RemoveObsoleteResolvables\n Builtins.y2milestone(\"--------- removing obsolete selections ---------\")\n\n # this removes only information about selections and applied patches\n # it doesn't remove any package\n Builtins.y2milestone(\n \"Removing all information about selections and patches in %1\",\n Installation.destdir\n )\n Pkg.TargetStoreRemove(Installation.destdir, :selection)\n\n # disabled by FATE #301990, bugzilla #238488\n # Pkg::TargetStoreRemove (Installation::destdir, `patch);\n\n Builtins.y2milestone(\"--------- removing obsolete selections ---------\")\n\n nil\n end", "def remove_all_except(*args)\n set_option_array_values(:remove_all_except, *args)\n end", "def delete_at(index)\n delete_idx = @indexes.each_index.find { |i| index == @indexes[i] }\n return nil unless delete_idx\n\n @indexes.delete_at(delete_idx)\n choice = @selected.delete_at(delete_idx)\n @size -= 1\n choice\n end", "def prune_opts opts, remove=[:selected, :checked]\n remove.each { |k| opts.delete(k) unless opts[k] }\n opts\n end", "def select!\n return enum_for(:select!) if not block_given?\n each { |n| remove(n) if not yield n }\n self\n end", "def remove_patron(selected)\n\tp = Patron.find(selected)\n\tBook.all.each do |b|\n\t\tif b.patron_id = p.id\n\t\t\tb.update_attributes(patron_id: nil)\n\t\tend\n\tend\t\n\tp.destroy\nend", "def unselect_board\n select_board nil\n end", "def select_item_in_select_list(attribute, value)\r\n assert_exists\r\n highlight( :set )\r\n doBreak = false\r\n #element.log \"Setting box #{@o.name} to #{attribute} #{value} \"\r\n @o.each do |option| # items in the list\r\n if value.matches( option.invoke(attribute.to_s))\r\n if option.selected\r\n doBreak = true\r\n break\r\n else\r\n option.selected = true\r\n @o.fireEvent(\"onChange\")\r\n @o.wait\r\n doBreak = true\r\n break\r\n end\r\n end\r\n end\r\n unless doBreak\r\n raise NoValueFoundException, \r\n \"No option with #{attribute.to_s} of #{value} in this select element\" \r\n end\r\n highlight( :clear )\r\n end", "def unset(*args)\n run \"unset #{OptArg.parse(*args)}\"\n nil\n end", "def rm_tag(tag, *values)\n tag.upcase!\n @selected_files.each { |file| file.rm_values(tag, *values) }\n self\n end", "def setUserOptions option, value\n uOptions[option].delete\n uOptions[option] = value\n end", "def choose_random_option_from_drop_down(type, locator)\n options = find(type, locator).all(:option)\n if options.last.text.include? 'My address is not listed'\n tmp_options = options.drop(1)\n # remove my address is not listed option\n tmp_options2 = tmp_options.first options.size - 1\n # select from what is left\n tmp_options2[rand(tmp_options2.count)].select_option\n elsif options.count <= 2\n options[1].select_option\n else\n tmp_options3 = options.drop(1)\n tmp_options3[rand(tmp_options3.count)].select_option\n end\n end", "def delete_option\n option = Option.find params[:id]\n\n session[:chosen_options].delete option.id\n\n # skipped_steps has to be emptied, because after deletion other options may become available \n\n session[:skipped_steps] = []\n\n redirect_to workflow_url\n end", "def topic_options\n wait_for_update_and_click add_topic_select_element\n wait_until(1) { add_topic_select_element.options.any? }\n (topic_option_elements.map { |el| el.attribute 'value' }).delete_if &:empty?\n end", "def remove_chosen_presenter\n self.chosen_presenter = nil\n self.save\n end", "def options_for_multiselect_selected( object, method, ids, options = {} )\n return [] if ( ids.nil? or ids.empty? )\n class_name = options[:class_name] || object\n model = get_object(class_name)\n items = get_selected_items(:model => model, :options => options, :ids => ids, :method => method)\n options_from_collection_for_select(items, :to_param, options[:display_value] ||= method)\n end", "def remove_items\n system 'clear'\n CoffeeMan.stay_logo\n @@cart = @@cart.flatten\n cart_arr = @@cart \n if cart_arr.count == 0 \n puts \"Your cart is empty, please add items\"\n sleep 1\n view_cart\n end\n if cart_arr.count > 0 \n splitted_cart = cart_arr.split(\" \")\n selected_items = prompt.multi_select(\"Which item would you like to remove?\", splitted_cart)\n selected_items.each do |del| \n cart_arr.delete_at(cart_arr.index(del))\n end \n # @@cart = cart_arr\n sleep(0.6)\n view_cart\n end\n end", "def property_value_delete(opts={})\n parent_select = Array( opts[:parent_select] )\n parent_index = opts[:parent_index]\n child_index = opts[:child_index]\n xpath_select = opts[:select]\n \n if !xpath_select.nil?\n node = lookup(xpath_select, nil).first\n else\n parent_nodeset = lookup(parent_select, parent_select)\n # parent_nodeset = lookup(parent_select[0])\n \n if parent_index.nil?\n node = node_from_set(parent_nodeset, child_index)\n else\n parent = node_from_set(parent_nodeset, parent_index)\n # this next line is a hack around the fact that element_children() sometimes doesn't work.\n node = node_from_set(parent.xpath(\"*\"), child_index)\n end\n end\n \n node.remove\n end", "def select(option_locator)\n find_element(option_locator).click\n end", "def clear_items_from_list(loc)\n @browser.select(parse_location(loc)).clear\n end", "def RemoveAll()\r\n ret = _invoke(1610743824, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def RemoveAll()\r\n ret = _invoke(1610743824, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def clear(locator)\n @driver.find_element(locator).send_keys [:command, 'a'], :delete\n end", "def selectize_multi_select(key, *values)\n values.flatten.each do |value|\n open_selectize_chooser(key)\n execute_script(\"\n #{find_selectized_control_js(key)}.querySelector('input').value = '#{value}';\n document.querySelector$('##{key}.selectized').selectize.createItem();\n \")\n end\n end", "def remove_vines(params)\n get_selected_vines\n params.each_pair do |k,v|\n if (k.include? \"_check_box\") && (v == \"1\")\n @vid = k.dup\n @vid[\"_check_box\"] = \"\"\n @selected_vines.delete(@vid.to_i)\n end\n end\n session[:selected_vines] = @selected_vines\n end", "def select_dropdown(locator, option, method = :value)\n Console.log.info \"Selecting field: #{locator} \\n\\toption: #{option}\n select method: #{method}\"\n select_list = Selenium::WebDriver::Support::Select.new(find(locator))\n select_list.select_by(method, option)\n end", "def remove_contacts_from_selection\n logger.debug \"**** REMOVE CONTACTS FROM SELN ****\"\n show_params(params) #debug params and put them in logs\n #@role_contactinfos_ids = params[:role_contactinfos][:ids]\n \n\t# case for removing all\n\tif params[:remove] == 'all'\n\t session[SELECTED_CONTACTS] = Array.new\n\t session[:contacts_to_add] = Array.new\n\t\n\t# case for removing seleted only \n\telse\n\t @selected_role_contactinfos = session[:contacts_to_add]\n\t\n\t @role_contactinfos_ids = @selected_role_contactinfos.map{|rc| \"role_contactinfo_\" + rc.role_contactinfo_id.to_s}\n\t\n previously_selected_contacts = session[SELECTED_CONTACTS]\n \n # remove contacts\n for removed_contact_id in @role_contactinfos_ids\n # get the contact to remove\n removed_contact = RoleContactinfo.find( removed_contact_id.gsub('role_contactinfo_', '') )\n previously_selected_contacts.delete(removed_contact)\n\t session[:contacts_to_add].delete(removed_contact)\n # new_contacts = new_contacts + [new_person_contact] unless previously_selected_contacts.include?new_person_contact\n end\n \n # update session variable with removed contacts\n session[SELECTED_CONTACTS] = previously_selected_contacts\n end\n\t\n # UI variables\n @contacts = session[SELECTED_CONTACTS]\n @already_selected = get_already_selected()\n \n\tpaginated_selected_results\n\t\n\trender :layout => false\n end", "def remove_book(selected)\n\tb = Book.find(selected)\n\tb.destroy\nend", "def define_selected!(array)\r\n array.each do |o|\r\n unless(o.respond_to?(:selected?))\r\n def o.selected?\r\n false\r\n end\r\n end\r\n end\r\n end", "def teacher_remove_selected \n \n string = params[:string1].split(\",\")#Select string by adding a , to the string\n @teacher = Teacher.find(session[:teacher_id]) #Find teacher with the corresponding ID\n @teacher.reserved[params[:place].to_i] = \"Avalible\" #String maniuplation to change ,\n @teacher.save#Save teacher\n @user = User.find(string[4].to_i) #Repeat down the list\n y=0\n for x in @user.your_times#Removes selected time from your schedule\n if x.split(\",\")[1] == @teacher.name\n @user.your_times[y] = \"NA\"#Reset time to NA\n end\n y+=1\n end\n @user.save\n redirect_to student_page_url#Direct to student Home\n \n end", "def delete_modifier_option(location_id, modifier_list_id, modifier_option_id, opts = {})\n data, _status_code, _headers = delete_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, opts)\n return data\n end", "def store_selected_values select_locator, variable_name\r\n command 'storeSelectedValues', select_locator, variable_name\r\n end", "def select_multi(field_name, choices, options = {})\n power_options = power_options!(field_name, options)\n # generic_field(:select, super(field_name, choices, options), field_name, power_options)\n generic_field(:select, 'SELECT MULTI', field_name, power_options)\n end", "def rm(key)\n options.values.collect do |option| \n if option.key == key \n unregister(option)\n else\n nil\n end\n end.compact\n end", "def options_remove opts, colors\n\t\t\t\topts.separator \"\"\n\t\t\t\topts.separator \" *\".colorize(colors[:cyan]) + \" remove, rm\".colorize(colors[:yellow]) + \n\t\t\t\t\" removes the list completely.\".colorize(colors[:magenta])\n\t\t\t\topts.separator \" usage: \".colorize(colors[:cyan]) + USAGE[:remove].colorize(colors[:red])\n\t\t\tend", "def selected_options\n @options.find_all { |o| o.selected? }\n end" ]
[ "0.7457269", "0.68023884", "0.67169696", "0.6498675", "0.6164828", "0.6052039", "0.6043551", "0.59594905", "0.5926916", "0.57622933", "0.5711452", "0.569925", "0.5647475", "0.5641553", "0.5609179", "0.55459076", "0.53664416", "0.53641564", "0.5297133", "0.5282017", "0.5189424", "0.51659864", "0.5154749", "0.5145238", "0.51143634", "0.51084787", "0.5073766", "0.50649726", "0.50464964", "0.5037398", "0.4995668", "0.49629307", "0.49223843", "0.4920178", "0.49193588", "0.48996142", "0.48726857", "0.4869602", "0.4840587", "0.48401427", "0.4796784", "0.47518632", "0.47481257", "0.47469977", "0.47469977", "0.47421288", "0.47363326", "0.47258455", "0.47069135", "0.4698397", "0.46968085", "0.46936983", "0.467785", "0.46712807", "0.46384734", "0.4627148", "0.46203458", "0.4615306", "0.46054226", "0.4599248", "0.4599248", "0.45887014", "0.45702013", "0.45519796", "0.45317724", "0.45278135", "0.45231977", "0.45181993", "0.44945788", "0.44846588", "0.44841436", "0.4467282", "0.44481432", "0.44475898", "0.4443673", "0.44434252", "0.44422427", "0.44262734", "0.4424891", "0.4419393", "0.44169834", "0.4406082", "0.4400677", "0.43849102", "0.43849102", "0.43846905", "0.438431", "0.43780798", "0.4372393", "0.4369471", "0.43576726", "0.43549824", "0.43537515", "0.43426734", "0.4337953", "0.4322181", "0.43209705", "0.43083978", "0.4300102" ]
0.7001168
2
Submit the specified form. This is particularly useful for forms without submit buttons, e.g. singleinput "Search" forms.
def submit locator command 'submit', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submit_form(form)\n @agent.submit(form)\n end", "def submit(form, button = nil, headers = {})\n form.add_button_to_query(button) if button\n\n case form.method.upcase\n when 'POST'\n post_form(form.action, form, headers)\n when 'GET'\n get(form.action.gsub(/\\?[^\\?]*$/, ''),\n form.build_query,\n form.page,\n headers)\n else\n raise ArgumentError, \"unsupported method: #{form.method.upcase}\"\n end\n end", "def submit_form\n @page = @form.submit\n end", "def submit(form_name)\n Praline::browser.find_element(:name, form_name).submit\n end", "def form_submit(form, opts = {})\n opts[:class] ||= \"btn btn-primary\"\n opts[:value] ||= submit_default_value(form)\n content_tag(:div, :class => \"form-actions\") do\n form.submit(opts)\n end\n end", "def i_submit(form, args = {})\n assert_not_nil form, __last_because + \"(form has not been found)\"\n raise ArgumentError, \"i_submit requires a Tag instance, #{form.inspect} received\" unless Tag===form\n i_invoke(form[:action], args)\n end", "def submit_form\n click_button 'submit'\n end", "def submit(form, button = T.unsafe(nil), headers = T.unsafe(nil)); end", "def form_submit\r\n form.submit\r\n @form = nil\r\nend", "def submit(form_selector='form', submit_matcher='submit', input_values_hash={})\n forms = (self.html/form_selector)\n\n if forms.length != 1\n raise \"Problem with parsing form page -- expected only 1 form tag on `#{self.url}` matching selector `#{form_selector}`, but selected `#{forms.length}` fom tags\\n#{forms.inspect}\"\n end\n\n form_values = Hpricotscape::Form.parse(forms[0])\n full_action_url = if form_values[:action].starts_with?('/')\n \"#{self.url.split('://').first}://#{self.url.split('://').last.split('/').first}#{form_values[:action]}\"\n elsif form_values[:action].index('://').nil?\n \"#{self.url.rpartition('/').first}/#{form_values[:action]}\"\n else\n form_values[:action]\n end\n\n # Allow user to use strings or symbols for input values, and merge them into the form\n form_values[:inputs].keys.each do |k|\n form_values[:inputs][k.to_s] = input_values_hash[k.to_s] if input_values_hash.has_key?(k.to_s)\n form_values[:inputs][k.to_s] = input_values_hash[k.to_sym] if input_values_hash.has_key?(k.to_sym)\n end\n\n submit_key = form_values[:submits].keys.select { |k| k.downcase.index(submit_matcher) }.first\n form_post_body = form_values[:inputs].merge(submit_key => form_values[:submits][submit_key])\n\n _load(full_action_url, form_values[:method], form_post_body)\n end", "def ajax_form_submit(opts = {})\n form_id = opts[:form_id] || id\n \"javascript:$('form##{form_id}').submit()\"\n end", "def submit(contents, attrs = {})\n current_form_context.submit(contents, attrs)\n end", "def submit_button(form, args = {})\n classes = \"btn btn-primary #{args.delete(:class)}\".strip!\n label = args.delete(:label)\n form.submit(label, args.merge!(class: classes))\n end", "def submit_without_clicking_button\n path = self.action.blank? ? self.uri : self.action # If no action attribute on form, it submits to the same URI where the form was displayed\n params = {}\n fields.each {|field| params[field.name] = field.value unless field.value.nil? || field.value == [] || params[field.name] } # don't submit the nils, empty arrays, and fields already named\n \n # Convert arrays and hashes in param keys, since test processing doesn't do this automatically\n params = ActionController::UrlEncodedPairParser.new(params).result\n @testcase.make_request(request_method, path, params, self.uri, @xhr)\n end", "def submit(value = \"Submit\", options = {})\n @template.submit_tag(value, options)\n end", "def submit(opts={})\n msg = \"Submit button not found in form\"\n selector = 'input[type=\"submit\"], input[type=\"image\"], button[type=\"submit\"]'\n if @submit_value\n msg << \" with a value of '#{@submit_value}'\"\n selector.gsub!(/\\]/, \"][value=#{@submit_value}]\")\n end\n raise MissingSubmitError, msg unless tag.select(selector).any?\n fields_hash.update(opts)\n submit_without_clicking_button\n end", "def submit\n frm.button(:value=>\"Submit\").click\n SubmissionConfirmation.new(@browser)\n end", "def submit\n frm.button(:value=>\"Submit\").click\n SubmissionConfirmation.new(@browser)\n end", "def submit(value = \"Submit\", options = {})\n @template.submit_tag(value, options)\n end", "def onSubmit(request, response, form, errors)\r\n return form\r\n end", "def onSubmit(request, response, form, errors)\r\n return form\r\n end", "def post_message(form)\n begin\n config.sleep_before_post\n form.submit\n rescue StandardError => err\n raise Impostor::PostError.new(err)\n end\n end", "def onSubmit(request, response, form, errors)\r\n\treturn form\r\n end", "def submit(buttonName = nil)\r\n if (buttonName.nil?) then\r\n buttons.each { |button|\r\n next if button.type != 'submit'\r\n button.click\r\n return\r\n }\r\n else\r\n click_button_with_name(buttonName)\r\n end\r\n end", "def submit\r\n assert_exists\r\n submit_form \r\n @o.wait\r\n end", "def onSubmit(request, response, form, errors) \r\n return form\r\n end", "def onSubmit(request, response, form, errors) \r\n return form\r\n end", "def onSubmit(request, response, form, errors) \r\n return form\r\n end", "def onSubmit(request, response, form, errors) \r\n return form\r\n end", "def onSubmit(request, response, form, errors) \n return form\n end", "def search_button(form)\n form.submit(\"Search\", hidden: \"\")\n end", "def submit_or_cancel(form, name='Cancel')\n form.submit + ' or ' + link_to(name, 'javascript:history.go(-1);', :class => 'cancel')\n end", "def submit\n click_button 'SEND'\n self\n end", "def submit_or_cancel(form, name='Cancel')\n form.submit + \" or \" +\n link_to(name, root_path, :class => \"for_black_font_link\")\n #link_to(name, 'javascript:history.go(-1);', :class => 'cancel')\n end", "def submit(button = T.unsafe(nil), headers = T.unsafe(nil)); end", "def create_submit_button(args)\n\n\t\tform = args[\"form\"]\n\t\tdestination = args[\"destination\"]\n\t\ttext = args[\"text\"] || \"Submit\"\n\n\t\tform_ids = @@current_forms[form]\n\t\tsubmit_script = \"\"\n\t\tif form_ids\n\t\t\tsubmit_script = \"<script>function submit_form_#{form}() {var form_args = \"\n\t\t\tform_args = []\n\t\t\t@@current_forms[form].each do |id|\n\t\t\t\tform_args << \"'#{id}=' + encodeURIComponent(document.getElementById('#{id}').value)\"\n\t\t\tend\n\t\t\t@@current_forms.delete(form)\n\t\t\tsubmit_script += \"#{form_args.join(\" + '&' + \")};\"\n\t\t\tsubmit_script += \"location.href = '#{destination}?' + form_args;}</script>\"\n\t\tend\n\t\treturn \"#{submit_script}<button onclick='submit_form_#{form}();'>#{text}</button>\"\n\tend", "def submit(value = nil, name = nil)\n attributes = if (not value) or value.kind_of?(String)\n { \"TYPE\" => \"submit\", \"VALUE\" => value, \"NAME\" => name }\n else\n value[\"TYPE\"] = \"submit\"\n value\n end\n input(attributes)\n end", "def link_to_formsubmit(name, id, html_options = {}) \n \tlink_to_function(name, \"if(document.forms['#{id}'].onsubmit()) { document.forms['#{id}'].submit(); }\", html_options)\n end", "def submit(locator)\n find_element(locator).submit\n end", "def submit_button(label, options={})\n @renderer.submit_tag(label, options)\n end", "def apphelp_submit( form, action_or_string, indent = nil )\n return apphelp_complex_button(\n form,\n action_or_string,\n {\n :indent => indent,\n :button_image => 'accept'\n }\n )\n end", "def submit\n frm.button(:value=>\"Submit\").click\n @@file_number=0\n if frm.div(:class=>\"portletBody\").h3.text=~/Submission Confirmation/\n SubmissionConfirmation.new(@browser)\n elsif frm.button(:value=>\"Back to list\").exist?\n SubmissionConfirmation.new(@browser)\n else\n AssessmentsList.new(@browser)\n end\n end", "def submit\n frm.button(:value=>\"Submit\").click\n @@file_number=0\n if frm.div(:class=>\"portletBody\").h3.text=~/Submission Confirmation/\n SubmissionConfirmation.new(@browser)\n elsif frm.button(:value=>\"Back to list\").exist?\n SubmissionConfirmation.new(@browser)\n else\n AssessmentsList.new(@browser)\n end\n end", "def fb_request_form_submit(options={})\n\t\t\t tag(\"fb:request-form-submit\",stringify_vals(options))\n\t\t\tend", "def link_to_submit text, args\n link_to_function text, \"$(this).closest('form').submit()\", args\n end", "def submit_for_grading\n frm.button(:value=>\"Submit for Grading\").click\n ConfirmSubmission.new(@browser)\n end", "def submit(button_name=nil, opts={})\n # 1. Loop through the non hidden fields and if they're active and displayed enter the value\n fill_in_field_data\n\n # 2. Submit Form\n submit_button = select_submit_button(button_name, opts)\n\n wait_for_submit(submit_button)\n submit_button.node.click\n\n # 3. Wait for Page page\n wait_for_page(driver, metz)\n\n # 4. Return new Page\n Metallize::Page.new(driver, metz)\n\n end", "def link_to_submit(*args, &block)\n link_to_function (block_given? ? capture(&block) : args[0]), \"$(this).closest('form').submit()\", args.extract_options!\n end", "def submit(label, options = {})\n options = {\n wrapper_html: {class: \"submit\"},\n }.update(options)\n template.content_tag(\"div\", options.delete(:wrapper_html)) do\n template.content_tag(\"button\", label, options.delete(:input_html))\n end\n end", "def click_submit\n end", "def link_to_submit(*args, &block)\n\t\tlink_to_function (block_given? ? capture(&block) : args[0]), \"$(this).closest('form').submit()\", args.extract_options!\n\tend", "def on_submit\n controller.send(@form_name+'_submit', @model) unless controller.nil?\n clear\n end", "def form(*args, &blk)\n _singleton_form_context.form(*args, &blk)\n end", "def fb_request_form_submit\n tag \"fb:request-form-submit\"\n end", "def test_submit_on_form\n page = @agent.get(\"http://localhost/form_multival.html\")\n form = page.form_with(:name => 'post_form')\n\n assert_not_nil(form)\n assert_equal(2, form.fields_with(:name => 'first').length)\n\n form.fields_with(:name => 'first')[0].value = 'Aaron'\n form.fields_with(:name => 'first')[1].value = 'Patterson'\n\n page = form.submit\n\n assert_not_nil(page)\n\n assert_equal(2, page.links.length)\n assert_not_nil(page.link_with(:text => 'first:Aaron'))\n assert_not_nil(page.link_with(:text => 'first:Patterson'))\n end", "def post_form(uri, form, headers = {})\n cur_page = form.page || current_page ||\n Page.new\n\n request_data = form.request_data\n\n log.debug(\"query: #{ request_data.inspect }\") if log\n\n headers = {\n 'Content-Type' => form.enctype,\n 'Content-Length' => request_data.size.to_s,\n }.merge headers\n\n # fetch the page\n page = @agent.fetch uri, :post, headers, [request_data], cur_page\n add_to_history(page)\n page\n end", "def submit_button(*args, &block)\n if block_given?\n options = args.extract_options!.dup\n options[:type] = :submit\n options[:name] ||= 'commit'\n args << options\n button_button(options, &block)\n else\n submit(*args)\n end\n end", "def submit_for_grading\n frm.button(:value=>\"Submit for Grading\").click\n SubmissionSummary.new(@browser)\n end", "def submit_button(label = 'submit', options = {})\n @template.content_tag 'div',\n @template.submit_tag(label.to_s.humanize),\n :class => 'form_buttons'\n end", "def submit\n end", "def navigate_to_form(form_name)\n form = menu_forms.find { |item| item.text == form_name }\n if form\n form.click\n sleep 1\n else\n raise \"Form: #{form_name} is not available on the page.\"\n end\n end", "def submit; end", "def submitIncidentForm(page, startYear, endYear)\n form = page.form_with(:action => \"search.php\");\n form['start_year'] = startYear;\n form['end_year'] = endYear;\n page = page.form_with(:action => \"search.php\").click_button();\nend", "def fill_form_and_submit(agent, creds, url, category, tech, data)\n case category\n when 'extensions'\n puts \"uploading #{category.chop}: #{data[category.chop].to_s}\" unless $quiet\n cat_page = get_page(agent, creds, url + CONFIG, {display: category, tech_hardware: 'custom_custom'})\n frm = cat_page.form('frm_extensions')\n when 'trunks'\n puts \"uploading #{category.chop}: #{data['trunk_name'].to_s}\" unless $quiet\n cat_page = get_page(agent, creds, url + CONFIG, {display: category, tech: tech.upcase})\n frm = cat_page.form('trunkEdit')\n end\n abort 'error: form not found' unless frm\n\n if $debug\n frm.fields.each { |field| puts \"send_sever_request: #{field.name}: #{field.value}\" }\n frm.checkboxes.each { |chkbx| puts \"send_sever_request: #{chkbx.name}: #{chkbx.value}\" }\n frm.radiobuttons.each { |rdb| puts \"send_sever_request: #{rdb.name}: #{rdb.value}\" if rdb.checked }\n end\n # Fill in the form, and submit it!\n data.each { |key, val| frm[key] = val }\n frm.submit\nend", "def click_submit_button\n\t\tsubmit_button.click\n\tend", "def submit_form_with_rest(form_element: nil, action: nil, params: nil, expected_redirect: nil)\n if form_element.nil? && ( action.nil? && params.nil?)\n raise \"Must pass in either a form element to submit or an action url with a parameters hash\"\n end\n\n if form_element\n params = form_element.all(:css, \"input\").inject({}){|result, input| result[input[\"name\"]] = input.value ; result }\n action = form_element[\"action\"]\n end\n\n rest_request(:post, action, payload: params, format: :html, retry_login: true, expected_redirect: expected_redirect)\n end", "def ogone_form options={}, html={}\n ogone_form_tag(html) do\n output = ogone_fields(options)\n output << \"\\t<input type='submit' value='ga verder naar ogones' id='submit2' name='submit2'>\\n\"\n end\n end", "def execute_submit(form)\n # Logout\n user = ::GDO::User::GDO_User.current\n ::GDO::User::GDO_User.current = nil\n # Call event\n publish(:gdo_user_signed_out, user)\n # Build response\n success(t(:msg_signed_out))\n end", "def xf_submit (label = \"Submit\", target_options = {}, id = \"submit\", attrs = {})\n attrs = attrs.symbolize_keys()\n attrs[:submission] = id\n labelAttrs = attrs.delete(:labelAttrs)\n label = label(label, labelAttrs)\n method = attrs.delete(:method)\n model = model(attrs[:model])\n model.submission = submission(method, url_for(target_options), {:id => id})\n typeWithAttrs(\"submit\", label, attrs)\n end", "def submit_search\n click SEARCH_SUBMIT_BUTTON\n end", "def post_form(uri, form, headers = T.unsafe(nil)); end", "def form_submitted(evt)\n unless evt[:form_action] == 'cancel'\n attributes, special = get_form_attributes(evt)\n set_record evt[:id], evt[:pid]\n was_new = record.new_record?\n record.update_attributes(attributes)\n reaction = after_form_update(:record => record, :was_new => was_new,\n :form_action => evt[:form_action], :special => special)\n trigger :flash, :notice => reaction[:notice]\n trigger :display_form, reaction[:display_form] if reaction[:display_form]\n trigger :reload_grid\n render :text => reaction[:text]\n else\n trigger :flash_deveal\n render :text => form_deveal('#FF8888') #cancel\n end\n end", "def submit(value = nil, options = {})\n div_form_group do\n div_col_md_9 do\n options[:class] = 'btn btn-success'\n # Disable button when the form is submitted\n data_options = options[:data] || {}\n options[:data] = data_options.merge(disable_with: 'Please wait..')\n orig_submit(value, options)\n end\n end\n end", "def submit!\n\tend", "def submit_button_for(builder, value=nil, options={})\n value ||= builder.send(:submit_default_value)\n content_tag(:button, value, options.reverse_merge(:class => 'button big', :id => \"#{builder.object_name}_submit\"))\n end", "def submit_default_value(form)\n key = form.object ? (form.object.persisted? ? :update : :create) : :submit\n defaults = []\n defaults << \"%s.%s\" % [controller_name.singularize, key]\n defaults << \"metadata_ingest_form.%s\" % key\n defaults << key\n defaults << \"Submit\"\n\n return I18n.t(defaults.shift, scope: [:helpers, :submit], default: defaults)\n end", "def link_to_submit(*args, &block)\n link_to (block_given? ? capture(&block) : args[0]), \"#\", args.extract_options!.merge(onclick: \"jQuery(this).closest('form').submit(); return false\")\nend", "def safe_submit(label)\n return %Q{<span class=\"field\"><label>&nbsp;</label><input name=\"commit\" type=\"submit\" value=\"#{label}\" onclick=\"this.disabled=true; this.form.submit();\"/></span>}\n end", "def input_submit(value = nil, args = {})\n args = args.merge(:type => :submit)\n args[:value] = value unless value.nil?\n\n @g.p do\n @g.input(args)\n end\n end", "def post_new_topic(form)\n begin\n config.sleep_before_post\n form.submit\n rescue StandardError => err\n raise Impostor::TopicError.new(err)\n end\n end", "def standard_submit name=nil, object=nil\n name = post_type unless name\n object = @post unless object\n submit_tag(\"Save #{name}\") + (object.new_record? ? \"\" : (\" or \" + link_to(\"Delete\", { :action => 'show' }, :method => :delete, :confirm => \"Are you sure?\", :class => \"delete\")))\n end", "def form\n find_parent_by_tag_name('FORM')\n end", "def form\n find_parent_by_tag_name('FORM')\n end", "def my_ajax_submit_tag caption, url, html_options={}\n my_ajax_form_tag url do\n submit_tag caption, html_options\n end\n end", "def submit(value = nil, options = {})\n value = (@object.new_record?? \"Create\" : \"Update\") if value.nil?\n build_shell(value, options, 'submit_button') { super }\n end", "def submit(label, options = nil)\n str = ''\n \n label = options.delete(:value) unless label \n \n str << '<input type=\"submit\"'\n str << %[ value=\"#{label}\"] if label\n\n unless options.empty?\n opts = options.collect { |k, v| %[#{k}=\"#{v}\"] }.join(' ')\n str << %[ #{opts} ]\n end\n \n str << ' />'\n\n return str\n end", "def submit_panel(f, heading = nil)\n\t\trender :partial => \"shared/forms/panel/submit\", :locals => { :f => f, :heading => heading }\n\tend", "def select_and_submit(page, form_name, select_name, selection)\n option = nil\n form = page.form(form_name)\n unless form.nil?\n selector = form.field(select_name)\n unless selector.nil?\n option = select_option(selector, selection)\n form.submit\n end\n end\n return option\n end", "def submit_search\n @page.click_button('searchButton')\n end", "def ajaxform(form, url='/ajax/', style='display:inline;')\n \"<form action='#{url}' method='post' style='#{style}' class='RHA form container'>\" + form.to_s + \"</form>\"\n end", "def form_to_be_sent(path, form)\n end", "def form_search(form_name)\n form_filter.set \"#{form_name}\"\n search_link.click\n end", "def with_form(name, &blk)\n name = ('saved_form_' + name.to_s).to_sym\n form = @_env['rack.session'][name]\n if form then blk.call(form) end\n @_env['rack.session'].delete name\n end", "def thelper_submit_with_named_button( n = 'commit' )\n thelper_find_input_by_name( n ).click\n end", "def select_and_submit(page, form_name, select_name, selection)\r\n option = nil\r\n form = page.form(form_name)\r\n unless form.nil?\r\n selector = form.field(select_name)\r\n unless selector.nil?\r\n option = select_option(selector, selection)\r\n form.submit\r\n end\r\n end\r\n return option\r\n end", "def pretty_submit(content, options={}, &blk)\n default_form = \"document.getElementById(this.id).parentNode.parentNode\"\n options[:form] ||= default_form\n form = options[:form] == default_form ? default_form : \"document.getElementById('#{options[:form]}')\"\n \n options[:btn] ||= {}\n options[:btn][:id] ||= \"submit-#{rand(9999)}\"\n options[:btn][:class] = options[:btn][:class].nil? ? \"button\" : (\"button \" << options[:btn][:class])\n options[:btn][:onclick] = \"#{form}.submit();\"\n \n options[:div] ||= {}\n options[:div][:class] = options[:div][:class].nil? ? \"clear submit-line\" : (\"clear submit-line \" << options[:div][:class])\n \n options.delete :form\n btn = link_to(\"<span>#{content}</span>\".html_safe, '#', options[:btn])\n if block_given?\n concat content_tag(:div, \"#{btn}#{capture(&blk)}\", options[:div]), blk.binding\n\t else\n\t content_tag :div, btn, options[:div]\n end\n end", "def submit_button \n\t\t@browser.button(id: @submit)\n\tend", "def submit_or_cancel_for_users(form, cancel_name = t('application.cancel')) # \"Cancel\"\n if logged_in?\n form.submit + \" \" + t('application.or') + \" \" + link_to(cancel_name, \"javascript:history.go(-1);\", :class => \"cancel\") # \"or\"\n else\n form.submit + \" \" + t('application.or') + \" \" + link_to(cancel_name, login_path, :class => \"cancel\") # \"or\"\n end\n end", "def post_form(parameters = {}, headers = {}, &block)\n build_post_form(parameters, headers, &block).invoke\n end" ]
[ "0.79387325", "0.76258916", "0.74015117", "0.7384888", "0.7277278", "0.7246576", "0.7137908", "0.710554", "0.70852757", "0.6931294", "0.66373646", "0.66164416", "0.65152353", "0.6364485", "0.6348291", "0.6332506", "0.6279995", "0.6279995", "0.6275278", "0.6264246", "0.6264246", "0.6244669", "0.6214867", "0.6187547", "0.6159371", "0.6143045", "0.6143045", "0.6143045", "0.6143045", "0.6140585", "0.6108215", "0.60779345", "0.6010627", "0.59943664", "0.59904844", "0.59869176", "0.5985322", "0.5983215", "0.5980853", "0.59606445", "0.5959902", "0.58493394", "0.58493394", "0.58469486", "0.58449304", "0.5836663", "0.5835675", "0.58182967", "0.58160496", "0.58136684", "0.58006126", "0.5800153", "0.5786112", "0.5767723", "0.5761759", "0.57030505", "0.56722444", "0.5653122", "0.56443036", "0.56190336", "0.56039405", "0.5595543", "0.5553396", "0.5551354", "0.5529995", "0.5523771", "0.54818505", "0.54578626", "0.5446403", "0.5440366", "0.5431198", "0.54289025", "0.5408494", "0.53997314", "0.5366961", "0.53391623", "0.5338584", "0.53370684", "0.5288153", "0.5261748", "0.52585095", "0.5256676", "0.5256676", "0.5240781", "0.5236047", "0.5235209", "0.5233873", "0.52270097", "0.5225874", "0.5200714", "0.520044", "0.51910305", "0.5190331", "0.5180202", "0.5178478", "0.5178411", "0.5175029", "0.51586246", "0.51582134" ]
0.55685633
63
Opens an URL in the test frame. This accepts both relative and absolute URLs. The open command waits for the page to load before proceeding, i.e. you don't have to call +wait_for_page_to_load+. Note: The URL must be on the same domain as the runner HTML due to security restrictions in the browser (Same Origin Policy).
def open url command 'open', url_arg(url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open(url = @url)\n @browser.goto(url)\n wait_for_page_to_load\n end", "def open_in_browser\n puts url\n `#{open} #{url}`\n end", "def open(url)\n driver.get(url)\n end", "def openURL(step)\n url = @step['Parameter1']\n @browser.goto(url)\n end", "def go()\n\t@selenium.open @url\n end", "def launch_browser(url)\n case RUBY_PLATFORM\n when /darwin/\n system \"open\", url\n when /mswin|mingw|cygwin/\n system \"start\", url\n else\n system \"xdg-open\", url\n end\n end", "def goto_url(url)\r\n @web_browser.goto_url url\r\n end", "def goto_url(url)\n @web_browser.goto_url url\n end", "def go_to(url)\n driver.get url\n end", "def go_to_page(url)\n Logbook.step(\"Open start page #{url} :)\")\n @browser.get url\n sleep 2\n\n @browser\n end", "def go_to(url)\n @browser.goto(url)\n end", "def open_new_page(url)\n $verbose ? puts(\"opening new page: #{url}\") : nil\n @driver.execute_script('window.open()')\n @driver.switch_to.window(@driver.window_handles.last)\n sleep(1)\n @driver.get(url)\n end", "def open_url(url)\n @ole.OpenURL(url)\n end", "def open_url(url)\n unless url.is_a?(NSURL)\n url = NSURL.URLWithString(url)\n end\n NSWorkspace.sharedWorkspace.openURL(url)\n end", "def load_browser_tab(url:)\n @browser.execute_script('window.open()')\n @browser.windows.last.use\n @browser.goto(url)\n end", "def goto(url)\r\n #set_defaults()\r\n get_window_number()\r\n set_browser_document()\r\n # Load the given url.\r\n $jssh_socket.send(\"#{BROWSER_VAR}.loadURI(\\\"#{url}\\\");\\n\" , 0)\r\n read_socket()\r\n\r\n wait()\r\n end", "def open_url(url)\n url = NSURL.URLWithString(url) unless url.is_a?(NSURL)\n NSWorkspace.sharedWorkspace.openURL(url)\n end", "def go_to_url (url)\n\t\t@browser.goto (url)\n\tend", "def open_browser(base_url, options = {})\n default_options = {:resynchronize => false, :firefox => false } \n options = default_options.merge(options)\n options[:firefox] ||= (ENV['LOADWISE_PREVIEW'] || $LOADWISE_PREVIEW)\n RWebSpec::WebBrowser.new(base_url, nil, options)\n end", "def goto_url(url)\r\n @browser.navigate.to url\r\n end", "def open(url)\n super\n assert_page_loaded\n end", "def go_to(url)\n @browser.navigate.to url\n end", "def open_url(url)\n unless url.is_a?(NSURL)\n url = NSURL.URLWithString(url)\n end\n UIApplication.sharedApplication.openURL(url)\n end", "def open_url(url)\n unless url.is_a?(NSURL)\n url = NSURL.URLWithString(url)\n end\n UIApplication.sharedApplication.openURL(url)\n end", "def browse(url)\n if RUBY_PLATFORM =~ /darwin/\n `open #{url}`\n elsif RUBY_PLATFORM =~ /linux/\n `#{ENV['BROWSER']} #{url}`\n elsif ENV['OS'] == 'Windows_NT' or\n RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i\n `start \"\" \"#{url}\"`\n end\n end", "def open_url(url)\n url = url.is_a?(NSURL) ? url : NSURL.URLWithString(url)\n request = NSURLRequest.requestWithURL(url, cachePolicy: NSURLRequestUseProtocolCachePolicy, timeoutInterval: 20)\n web.loadRequest request\n end", "def goto(url = \"\")\n active_window.url = url\n sleep(1)\n end", "def open\n html_url = url.sub('.json?', '?')\n Launchy.open(html_url)\n end", "def openurl(url)\n runcmd 'openurl', url\n end", "def browse(url)\n if RUBY_PLATFORM =~ /darwin/\n `open #{url}`\n elsif ENV['OS'] == 'Windows_NT' or\n RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i\n `start \"\" \"#{url}\"`\n end\n end", "def goto relative_url\n destination = File.join(@site.origin, relative_url) \n @browser.goto destination\n end", "def open_compare_page\n cli.copy_to_clipboard compare_url\n cli.open compare_url\n end", "def open\n @browser.goto @@site_url + \"/login.php\"\n\tWatir::Wait.until { self.loaded? LoginPage.title}\n self\n end", "def open_dialog_with_url(dialog_name, url)\n wait_start\n opera_desktop_action(\"Open url in new page\", url)\n # The loading of the page will happen first then the dialog will be shown\n wait_for_window_shown(dialog_name)\n end", "def open_dialog_with_url(dialog_name, url)\n wait_start\n opera_desktop_action(\"Open url in new page\", url)\n # The loading of the page will happen first then the dialog will be shown\n wait_for_window_shown(dialog_name)\n end", "def browse url\n @@headless = Headless.new\n @@headless.start\n @@browser = Watir::Browser.start url\n end", "def navigate_to(url)\n self.visit url\n end", "def open_and_wait( location)\n selenium.open(location)\n wait_for_page_to_load\n end", "def browser_open_linux(url)\n system(\"xdg-open\", url)\n end", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n run \"open #{url}\"\n else\n # Ubuntu\n run \"xdg-open #{url}\"\n end\n end\n end\n end", "def cmd\n c = [\"open #{page_url}\"]\n c << argument_string(unknown_options) unless unknown_options.empty?\n c.join(\"\\n\")\n end", "def start_browser(url, browser = 'firefox')\n self.open_browser browser\n @browser.goto url\n return @browser\n end", "def begin_at(url)\r\n dump_caller_stack\r\n @web_browser.begin_at(url)\r\n end", "def open_url(url)\n if RbConfig::CONFIG['host_os'] =~ /darwin/\n system %(open \"#{url}\")\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system %(xdg-open \"#{url}\")\n else\n puts 'Not Supported OS!'.red\n end\n end", "def open_browser(base_url = nil, options = {})\n base_url ||= $ITEST2_PROJECT_BASE_URL\n base_url ||= $BASE_URL\n raise \"base_url must be set\" if base_url.nil?\n\n default_options = {:speed => \"fast\",\n :visible => true,\n :highlight_colour => 'yellow',\n :close_others => true,\n :start_new => false, \t# start a new browser always\n :go => true}\n\n options = default_options.merge options\n options[:firefox] = true if \"Firefox\" == $ITEST2_BROWSER || \"Firefox\" == $BROWSER\n ($ITEST2_HIDE_BROWSER) ? $HIDE_IE = true : $HIDE_IE = false\n\n if base_url =~ /^file:/\n uri_base = base_url\n else\n uri = URI.parse(base_url)\n uri_base = \"#{uri.scheme}://#{uri.host}:#{uri.port}\"\n end\n\n if options[:start_new]\n @web_browser = WebBrowser.new(uri_base, nil, options)\n else\n @web_browser = WebBrowser.reuse(uri_base, options) # Reuse existing browser\n end\n\n if base_url =~ /^file:/\n goto_url(base_url) # for files, no base url\n else\n (uri.path.length == 0) ? begin_at(\"/\") : begin_at(uri.path) if options[:go]\n end\n\n return @web_browser\n end", "def open_window url, window_id\r\n command 'openWindow', url, window_id\r\n end", "def begin_at(url)\n dump_caller_stack\n @web_browser.begin_at(url)\n end", "def show_page\n save_page Rails.root.join('public', 'capybara.html')\n %x(`launchy http://localhost:3000/capybara.html`)\nend", "def open_url\n u = URI.parse(@host_url)\n u.open { |file| @html_doc = Nokogiri::HTML(file) }\n\n rescue OpenURI::HTTPError => excp\n raise \"#{excp}, could not open #{@host_url} \"\n ensure\n @html_doc\n end", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n `open #{url}`\n else\n # Ubuntu\n `xdg-open #{url}`\n end\n end\n end\n end", "def navigate_to(url)\n self.visit url\n end", "def open_root_page\n @selenium.open \"/#{@config.app_context}\"\n @selenium.wait_for_page_to_load\n end", "def request_for_url\n driver.request_for_url\n end", "def open(url);\n if !@already_opened_prs.include? url\n # Because Launchy sometimes fails to open multiple tabs if it is called too quickly\n sleep(0.1)\n Launchy.open(url) do |exception|\n puts \"Attempted to open #{url} and failed because #{exception}\"\n end\n @already_opened_prs.add url\n else\n puts \"filtered #{url}\"\n end\n end", "def open_page(name)\n name_link(name).click\n self.wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end", "def open_browser\n `open #{@report_file.path}`\n end", "def visit\n @browser.goto(URL)\n end", "def open\n require \"launchy\"\n\n Launchy.open(BASE_URL)\n end", "def open_page(name)\n name_link(name).click \n wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end", "def browser_open_darwin(url)\n system(\"open\", \"-a\", \"chrome\", url)\n end", "def goto_page(browser_handle, url)\n browser_handle.goto(url)\nend", "def visit(url)\n url = absolute_url(url)\n puts \"Visiting: #{url}\"\n @body = Nokogiri::HTML(open(url))\n end", "def goto_base_url\n @browser.goto base_url\n end", "def launch(url)\n Java::limelight.Context.instance.os.launch(url)\n end", "def go_to_url(url)\n visit(\"https://#{url}\")\n end", "def open_home_page\n selenium.open(context.browser_url)\n wait_for_page_to_load\n end", "def crawler_page\n open(crawler_url)\n end", "def open_target( url )\n\tnewt = Target.new(url)\n\tnewt.open\n\t[ newt.status, newt.uri, newt.ip, newt.body, newt.headers, newt.raw_headers ]\nend", "def go_to_url(base_url)\r\n\t\t\tputs \"Going to: #{base_url}\" \r\n\t\t\t@driver.get(base_url)\r\n\t\t\t@driver.manage.timeouts.implicit_wait = 10\r\n\t\tend", "def open_browser_with_search(url)\n Launchy.open(url)\nend", "def open_in_browser\n link = \"http://www.bandsintown.com/cities/pittsburgh-pa\"\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n system \"start #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n system \"open #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system \"xdg-open #{link}\"\n end\n end", "def launch_browser(html)\n fork do\n Tempfile.open(%w[bud .html]) do |handle|\n handle.write(html)\n handle.flush\n system(\"open #{handle.path}\")\n sleep 300\n end\n end\nend", "def open(url)\n Net::HTTP.get(URI.parse(url))\nend", "def open(url)\n Net::HTTP.get(URI.parse(url))\nend", "def open_html\n console_message(J2R.open_file_command(@report.temp_html))\n end", "def goto(url)\n fname = getFunctionName()\n log fname + \" Starting. Going to url: #{url}\" if $debuglevel >=0\n @ie.navigate(url)\n sleep 2\n return waitForIE()\n end", "def load_page_in_new_tab(options = {})\n screenshoter = File.join Chromeshot.root, 'bin', 'load-screenshot.js'\n tab = `nodejs #{screenshoter} --url='#{options[:url]}' --delay=5 --debugPort=#{self.debug_port}`\n tab.chomp\n end", "def visit(url)\n begin\n @browser.goto url\n rescue Errno::ECONNREFUSED\n puts \"Webdriver reconnecting...\"\n @browser = Watir::Browser.new $driver.to_sym\n login\n @browser.goto url\n end\n end", "def browse(number)\n request = get_request_by_number(number)\n Launchy.open(request.html_url)\n end", "def open_random\n Defcli.open_in_browser random_url(:api => false)\n end", "def open_browser_by_watir(options = {})\r\n\r\n begin\r\n support_unicode\r\n rescue => e\r\n puts \"Unicode may not work in IE, #{e}\"\r\n end\r\n\r\n\t\t\tif options && options.class == String\r\n\t\t\t options = {:base_url => options.to_s }\r\n\t\t\tend\r\n\t\t\t \r\n\t\t\tif options && options.class == Hash && options[:base_url]\r\n \tbase_url ||= options[:base_url]\r\n\t\t\tend\r\n\t\t\t\r\n\t\t\tbase_url = options[:base_url] rescue nil \r\n\t\t\tbase_url ||= $TESTWISE_PROJECT_BASE_URL\t\t\t\r\n base_url ||= $BASE_URL\r\n \r\n raise \"base_url must be set\" if base_url.nil?\r\n\r\n default_options = {:speed => \"fast\",\r\n :visible => true,\r\n :highlight_colour => 'yellow',\r\n :close_others => true,\r\n :start_new => false, # start a new browser always\r\n :go => true}\r\n\r\n options = default_options.merge options\r\n ($TESTWISE_HIDE_BROWSER) ? $HIDE_IE = true : $HIDE_IE = false\r\n\r\n if base_url =~ /^file:/\r\n uri_base = base_url\r\n else\r\n uri = URI.parse(base_url)\r\n uri_base = \"#{uri.scheme}://#{uri.host}:#{uri.port}\"\r\n end\r\n\r\n if options[:start_new]\r\n @web_browser = WebBrowser.new(uri_base, nil, options)\r\n else\r\n @web_browser = WebBrowser.reuse(uri_base, options) # Reuse existing browser\r\n end\r\n\r\n if base_url =~ /^file:/\r\n goto_url(base_url) # for files, no base url\r\n else\r\n (uri.path.length == 0) ? begin_at(\"/\") : begin_at(uri.path) if options[:go]\r\n end\r\n\r\n return @web_browser\r\n end", "def open_in_browser?(job)\n puts \"\\nURL: #{job.full_url}\"\n # print \"Open job page in browser?(yes/no): \".blue\n # response = gets.chomp.downcase\n\n response = @prompt.yes?(\"Open job page in browser?\")\n\n if response == \"y\" || response == \"yes\"\n system(\"xdg-open #{job.full_url}\")\n end\n end", "def open_url(term)\n Defcli.open_in_browser search_url(term, :api => false)\n end", "def visit_url(path)\n unless path.include? \"://\"\n path = @base_url.to_s + path\n end\n @selenium_driver.navigate.to(path)\n# @driver.switch_to_default_context\n end", "def open_url(code)\n url = URL+code\n puts url\n open(url).read\n end", "def open_url\n opts = [config.oui_full_url]\n opts << { 'User-Agent' => config.user_agent } if config.user_agent\n open(*opts).read\n rescue OpenURI::HTTPError\n ''\n end", "def url=(url)\n driver.navigate.to(url)\n end", "def open_page(key)\n return if verify_page?(key, false)\n site.goto(site.get_path(key))\n page_delay\n verify_page?(key)\n end", "def openUsernameRequestLink\n page.visit(@@usernameRequestLink)\n sleep 3\n end", "def load_page(url)\n retries_count = 0\n # For use URLs with TH symbols.\n url = URI.encode(url)\n begin\n retries_count += 1\n @browser.visit url\n rescue Exception => error\n display_error \"\\e[34;1m#{error.class} < #{error.class.superclass.name}\\e[0m \\e[31;1m#{error.message}\\e[0m\"\n Rollbar.error(error, 'Parser#load_page', {url: url})\n\n if retries_count < 3\n display_error \"##{__method__} failed for \\e[34;1m#{url}\\e[0m\"\n display_info \"Retry request \\e[33;1m#{retries_count}\\e[0m time...\"\n retry\n else\n display_error \"All attempts are exhausted! Failed to load \\e[34;1m#{url}\\e[0m\"\n @browser = nil\n end\n end\n end", "def openBrowser(step)\n browserName = @envConfig['Browser']\n browserDriver = \"#{$ROOT}/../webDriver/#{browserName}driver.exe\"\n case browserName\n when 'chrome'\n Selenium::WebDriver::Chrome.driver_path = browserDriver\n # @browser = Watir::Browser.new(:chrome, :switches => %w[--start-maximized])\n @browser = Watir::Browser.new(:chrome)\n when 'firefox'\n Selenium::WebDriver::Firefox.driver_path = browserDriver\n # @browser = Watir::Browser.new(:firefox, :switches => %w[--start-maximized])\n @browser = Watir::Browser.new(:firefox)\n end\n Watir.default_timeout = @envConfig['DefaultWaitTime'].to_s.to_i\n pageObject = PageObject.new\n @actionObjects = pageObject.initializePageObject(@browser, @pageObjects)\n end", "def visit_page \n visit URL \n end", "def ws_go args\n\t\tget_alert\n\t\turl = args[:url].should_not!(:be_nil).should_not!(:be_empty)\n\t\turl = (url =~ /(^http:)|(^file:)/) ? url : \"http://#{url}\"\n\t\t\n\t\t@selenium.open url\n\t\twait_for_load\n\t\treturn \"\"\n\tend", "def frame(*args)\n return yield unless ui_enabled?\n CLI::UI::Frame.open(*args) { yield }\n end", "def click_link_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, link_prop, link_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).link(link_prop.intern, /#{link_prop_val}/).click_no_wait\nend", "def open(args, options)\n _closest_branch = closest_branch\n\n if _closest_branch\n branch_name = clean_branch_name_for( _closest_branch )\n link = @url_generator.branch_url( branch_name )\n\n launch link\n else\n fail \"Could not find closest remote branch for sha: #{@git_object.oid.inspect}\"\n end\n end", "def load_page\n @mechanize_instance.get(@url)\n end", "def open_viewer(urn,access_token)\n path = File.expand_path(File.dirname(__FILE__))\n url = \"file://#{path}/viewer.html?token=#{access_token}&urn=#{urn}\"\n text_to_print_in_color = \"Please open the following url in your favorite browser:\\n#{url}\"\n puts(\"\\e[7m#{text_to_print_in_color}\\e[27m\")\n\nend", "def open_home_page\n open(configuration.browser_url)\n end" ]
[ "0.76494616", "0.7229314", "0.6956772", "0.6775287", "0.6741164", "0.6500982", "0.648671", "0.64762646", "0.6465396", "0.6428695", "0.64100754", "0.640556", "0.6404947", "0.63899314", "0.638606", "0.63822156", "0.635228", "0.6344248", "0.62733537", "0.62622356", "0.6247108", "0.62410116", "0.6234586", "0.6234586", "0.62339246", "0.6211112", "0.61930054", "0.6188282", "0.6167851", "0.61626697", "0.6129327", "0.60955095", "0.60658735", "0.606537", "0.606537", "0.60252494", "0.6018529", "0.601486", "0.59911937", "0.5982738", "0.594255", "0.59246975", "0.5915429", "0.5908044", "0.588248", "0.5880489", "0.58719134", "0.5862701", "0.585955", "0.5851149", "0.5850831", "0.58491594", "0.5827514", "0.58213764", "0.58202654", "0.5818318", "0.58165616", "0.5810661", "0.5793122", "0.57747144", "0.57624936", "0.57482475", "0.57242763", "0.5691735", "0.56904525", "0.5689657", "0.56808877", "0.5644392", "0.56400853", "0.5636497", "0.5604217", "0.55944085", "0.55881315", "0.55881315", "0.5575495", "0.557537", "0.55624855", "0.5562323", "0.55468863", "0.55468583", "0.5538632", "0.5528033", "0.5520995", "0.55171555", "0.5493866", "0.54773235", "0.5457951", "0.5449447", "0.54230267", "0.5420187", "0.54136455", "0.5396037", "0.5389735", "0.53817326", "0.5376628", "0.5349092", "0.534052", "0.53275806", "0.5307496" ]
0.7124611
3
Selects a popup window; once a popup window has been selected, all commands go to that window. To select the main window again, use +nil+ as the target.
def select_window window_id command 'selectWindow', window_id||'null' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selected_window\n list_windows[@command_window.item]\n end", "def command_select\n @items_window.smooth_move(0 - @items_window.width, @items_window.y)\n @materials_window.smooth_move(0 - @materials_window.width, @materials_window.y)\n #@gold_window.smooth_move(0 - @gold_window.width, @gold_window.y)\n @details_window.smooth_move(Graphics.width, @details_window.y)\n @confirm_window.set_item(@items_window.item)\n @confirm_window.open\n end", "def item_selected\n if @last_frame < Graphics.frame_count\n @option_window.item.value = popup.selected_value\n @option_window.refresh\n @help_window.refresh\n close_popup\n else\n popup.activate\n end\n end", "def popup\n return @popup if @popup\n return Generic_PopupWindow if @need_popup\n return nil\n end", "def focus_window(win=nil)\n window(win) << '.dialog().dialog(\"focus\");'\n nil\n end", "def popup\n return @popup if @popup\n return Generic_PopupWindow if @need_popup\n nil\n end", "def wait_for_popup window_id, timeout\r\n command 'waitForPopUp', window_id||'null', timeout\r\n end", "def wait_for_popup window_id, timeout\r\n command 'waitForPopUp', window_id||'null', timeout\r\n end", "def item_selected\n if @last_frame < Graphics.frame_count\n @option_window.item.value = popup.selected_value\n @option_window.refresh\n close_popup\n else\n popup.activate\n end\n end", "def select_previous_window(num = 1)\n @server.invoke_command \"select-window -t:-#{num}\"\n current_window\n end", "def create_selection_window\r\r\n @command_window = CSCA_Window_AchievementSelect.new(0,@head_window.height,\r\r\n Graphics.width/2,Graphics.height-@head_window.height-48)\r\r\n @command_window.viewport = @viewport\r\r\n @command_window.help_window = @achievement_window\r\r\n @command_window.set_handler(:cancel, method(:return_scene))\r\r\n @command_window.activate\r\r\n end", "def select_next_window(num = 1)\n @server.invoke_command \"select-window -t #{identifier}:+#{num}\"\n current_window\n end", "def select_with_click\n if mac_internal?\n press_menu\n else\n click\n end\n selected?\n end", "def window_focus window_name\r\n command 'windowFocus', window_name\r\n end", "def switch_to_main_window\n $previous_window = $driver.window_handle\n $driver.switch_to.window($driver.window_handles.first)\nend", "def start_item_selection\n @actor_command_window.active = false\n \n @help_window = Window_Help.new()\n #@help_window = Window_Info_Help.new(0, 384, nil) \n #@help_window = Window_Info_Help.new(0, 0, nil)\n #@help_window.width = 544\n \n #@item_back_window = Window_Base.new(0, 56, 640, 328)\n #@dataviews_window = Window_Dataviews.new(0, 56, MENU_CONFIG::DATAVIEWS)\n #@dataviews_window.active = false\n #@dataviews_window.opacity = 0\n \n #@item_window = Window_Item.new(0, 96, 640, 272, @dataviews_window.apply_dataview($game_party.items))\n @item_window = Window_Item.new(0, 56, 544, 232, $game_party.items)\n #@item_window.opacity = 0\n @item_window.help_window = @help_window\n \n #@item_details_window = Window_ItemDetails.new(0,384,nil)\n #@item_details_window = Window_ItemDetails.new(0,0,nil)\n #@item_details_window.visible = false\n #@item_window.detail_window = @item_details_window\n end", "def close_popup\n popup.deactivate\n x = Graphics.width\n y = @help_window.height\n if $imported[\"H87_SmoothMovements\"]\n @option_window.smooth_move(0, y)\n popup.smooth_move(x, y)\n else\n @option_window.x = 0\n popup.x = x\n end\n @option_window.activate\n @popup_index = nil\n end", "def close_popup\n popup.deactivate\n x = Graphics.width\n y = @help_window.height\n if $imported[\"H87_SmoothMovements\"]\n @option_window.smooth_move(0, y)\n popup.smooth_move(x, y)\n else\n @option_window.x = 0\n popup.x = x\n end\n @option_window.activate\n @popup_index = nil\n end", "def show_popup(index)\n @last_frame = Graphics.frame_count\n @popup_index = index\n x = Graphics.width - popup.width\n y = @help_window.height\n popup.x = Graphics.width\n popup.visible = true\n if $imported[\"H87_SmoothMovements\"]\n @option_window.smooth_move(0 - popup.width, y)\n popup.smooth_move(x, y)\n else\n @option_window.x = 0 - popup.width\n popup.x = x\n end\n popup.activate\n end", "def show_popup(index)\n @last_frame = Graphics.frame_count\n @popup_index = index\n x = Graphics.width - popup.width\n y = @help_window.height\n popup.x = Graphics.width\n popup.visible = true\n if $imported[\"H87_SmoothMovements\"]\n @option_window.smooth_move(0 - popup.width, y)\n popup.smooth_move(x, y)\n else\n @option_window.x = 0 - popup.width\n popup.x = x\n end\n popup.activate\n end", "def pbChooseTarget(index,targettype)\n curwindow=pbFirstTarget(index,targettype)\n if curwindow==-1\n raise RuntimeError.new(\"No targets somehow...\")\n end\n numwindows=@battle.doublebattle ? 4 : 2\n for i in 0...numwindows\n @pkmnwindows[i].highlighted=(i==curwindow)\n end\n pbRefresh\n loop do\n Graphics.update\n Input.update\n pbFrameUpdate(nil)\n if Input.trigger?(Input::DOWN)\n newwindow=pbNextTarget(curwindow,index)\n if newwindow>=0\n curwindow=newwindow\n for i in 0...numwindows\n @pkmnwindows[i].highlighted=(i==curwindow)\n end\n end\n end\n if Input.trigger?(Input::UP)\n newwindow=pbPrevTarget(curwindow,index)\n if newwindow>=0\n curwindow=newwindow\n for i in 0...numwindows\n @pkmnwindows[i].highlighted=(i==curwindow)\n end\n end\n end\n if Input.trigger?(Input::B)\n for i in 0...numwindows\n @pkmnwindows[i].highlighted=false\n @pkmnwindows[i].update\n end\n return -1\n end\n if Input.trigger?(Input::C)\n for i in 0...numwindows\n @pkmnwindows[i].highlighted=false\n @pkmnwindows[i].update\n end\n return curwindow\n end\n end\n end", "def window(name)\n Tk.execute_only(:tkwait, :window, name)\n end", "def select()\n return unless @@auth\n window.getSelection().removeAllRanges()\n @state = ( @state == :open ? :closed : :open )\n end", "def open_window(options = nil)\n window = terminal.make( :new => :terminal )\n window.launch_ :session => 'New session'\n end", "def dialog( title, seconds=3 )\n\t\td = begin\n\t\t\t\tw = Window.top_level(title, seconds)\n\t\t\t\tyield(w) ? w : nil\n\t\trescue TimeoutError\n\t\tend\n\n\t\td.wait_for_close if d\n\t\treturn d\n\tend", "def bring_current_window_to_front\n @fox_driver.switch_to.window(@fox_driver.window_handles.first)\n end", "def open_window(options = nil)\n terminal_process.keystroke(\"n\", :using => :command_down)\n # Options of the first tab must be set before window options, \n # because change of the first tab options causes change of window size\n if options \n set_options(return_last_tab, allowed_options(:tab, options))\n set_options(active_window, allowed_options(:window, options))\n end\n return_last_tab\n end", "def on_target_cancel\n @target_window.hide\n case @actor_command_window.current_symbol\n when :attack\n @actor_command_window.activate\n when :skill\n @skill_window.activate\n when :item\n @item_window.activate\n end\n end", "def select(...)\n prompt.select(...)\n end", "def focus(window)\n WIN[:focus].call window\n end", "def focus(window)\n WIN[:focus].call window\n end", "def focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def real_focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_sane_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def window name, cwd, cmd\n raise NotImplementedError.new(\n \"window should be implemented to open new window\")\n end", "def new_popup_window(options, browser = \"ie\")\r\n raise \"not implemented\"\r\n end", "def main_window\r\n super\r\n # Make help window\r\n @help_window = Window_Help.new\r\n @help_window.set_text(@help_text)\r\n # Make save file window\r\n @savefile_windows = []\r\n for i in 0..3\r\n @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))\r\n end\r\n @savefile_windows[@file_index].selected = true\r\n end", "def clear_popup(popup_win_title, seconds = 10, yes = true)\r\n # commonly \"Security Alert\", \"Security Information\"\r\n if is_windows?\r\n sleep 1\r\n autoit = WIN32OLE.new('AutoItX3.Control')\r\n # Look for window with given title. Give up after 1 second.\r\n ret = autoit.WinWait(popup_win_title, '', seconds)\r\n #\r\n # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).\r\n if ret == 1 then\r\n puts \"about to send click Yes\" if debugging?\r\n button_id = yes ? \"Button1\" : \"Button2\" # Yes or No\r\n autoit.ControlClick(popup_win_title, '', button_id)\r\n end\r\n sleep(0.5)\r\n else\r\n raise \"Currently supported only on Windows\"\r\n end\r\n end", "def window(name_or_handle)\n logger.info 'EyesTargetLocator.window()'\n logger.info 'Making preparaions...'\n on_will_switch.will_switch_to_window name_or_handle\n logger.info 'Done! Switching to window..'\n __getobj__.window name_or_handle\n logger.info 'Done!'\n driver\n end", "def cancel_command()\n # Switch Window\n @list_window.active = true\n @list_window.visible = true\n @content_window.active = false\n end", "def open_dialog_with_click(method, selector, win_name)\n wait_start\n OperaWatir::WebElement.new(self, method, selector).click\n wait_for_window_shown(win_name)\n end", "def open_dialog_with_click(method, selector, win_name)\n wait_start\n OperaWatir::WebElement.new(self, method, selector).click\n wait_for_window_shown(win_name)\n end", "def do_nothing\n @command_window.activate\n @rename_window.close\n end", "def switch_to_new_window\n $previous_window = $driver.window_handle\n $driver.switch_to.window($driver.window_handles.last)\nend", "def source_window window_number=0\n execute_script \"UIATarget.localTarget().frontMostApp().windows()[#{window_number}].getTree()\"\n end", "def popup(message, selection = \"Okay\")\n setKeypad(true)\n\n while true\n clearBox(true)\n Color.set(self, :yellow, :bright)\n setCursor(1, 0)\n\n curspos = getCursor()\n message.split(/\\n/).each { |line|\n setCursor(curspos[0], getCursor()[1] + 1)\n addText(line)\n }\n\n Color.set(self, :white, :dim)\n setCursor(2, getCursor()[1] + 1)\n addText(\"- Press Enter, K or 3 to continue.\", true)\n\n setCursor(1, getCursor()[1] + 2)\n Color.set(self, :green, :bright)\n addText(\"-> \" + selection, false)\n\n character = @display.getch\n case character\n when 10, \"k\", \"K\", \"3\" # Confirm option\n break\n else\n debug \"#{character}\"\n end\n doupdate\n end\n setKeypad(false)\n @display.refresh()\n return true\n end", "def popup\n @popups[@popup_index]\n end", "def XOselectWindow(tag, tvalue)\n\t\tres= OK\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# default is OK\n\t\t$pfd.tstart( @wwBrws.url.to_s)\n\t\tbegin\n\t\t\tself.setPageTimer()\t\t\t\t\t\t\t\t\t \t\t\t\t# set or clear the page timer\n\t\t\t$pfd.tstart( @wwBrws.url.to_s)\n\t\t\ttimedOut= false\n\n @winHandles.checkHandle (self) \t\t\t\t\t\t# add/ delete any new window\n\t\t\t$alog.lwrite(('There are '+@wwBrws.windows.size.to_s+' active windows.'), 'DEBG')\n\t\t\tcase tag\n\t\t\t\twhen :index\n\t\t\t\t\tuntil ((timedOut=self.getPageTimer()) || @wwBrws.window(:index => tvalue).exists?)\n\t\t\t\t\t\tsleep TIMETICK\n\t\t\t\t\tend\n\t\t\t\t\t$alog.lwrite(('2nd. Found. There are '+@wwBrws.windows.size.to_s+' active windows.'), 'DEBG')\n\t\t\t\t\tif timedOut\n\t\t\t\t\t\tres= CRITICAL\n\t\t\t\t\telse\n\t\t\t\t\t\t$alog.lwrite(('3nd. Activating. There are '+@wwBrws.windows.size.to_s+' active windows.'), 'DEBG')\n \t\t\tres= @winHandles.activateHandle(self, tvalue)\n\t\t\t\t\tend\n\t\t\t\twhen :url\n\t\t\t\t\tuntil ((timedOut=self.getPageTimer()) || @wwBrws.window(:url => /#{tvalue}/).exists?)\n\t\t\t\t\t\tsleep TIMETICK\n\t\t\t\t\tend\n\t\t\t\t\tif timedOut\n\t\t\t\t\t\tres= CRITICAL\n\t\t\t\t\telse\n\t\t\t\t\t\t@wwBrws.window(:url => /#{tvalue}/).use\n\t\t\t\t\tend\n\t\t\t\twhen :title\n\t\t\t\t\tuntil ((timedOut=self.getPageTimer()) || @wwBrws.window(:title => /#{tvalue}/).exists?)\n\t\t\t\t\t\tsleep TIMETICK\n\t\t\t\t\tend\n\t\t\t\t\tif timedOut\n\t\t\t\t\t\tres= CRITICAL\n\t\t\t\t\telse\n\t\t\t\t\t\t@wwBrws.window(:title => /#{tvalue}/).use\n\t\t\t\t\tend\n\t\t\tend\n\t\t\tif(res==CRITICAL)\n\t\t\t\tres= setResCritical('CANnot switch to window: /'+tvalue.to_s+'/ :'+$!.to_s)\n\t\t\telse\n\t\t\t\t$alog.lwrite(('Now using Windows w/title '+@wwBrws.window.title.to_s+' '), 'DEBG')\n\t\t\tend\n\t\trescue\n\t\t\tres= setResCritical('CANnot switch to window: /'+tvalue.to_s+'/ :'+$!.to_s) \t\t\t\t#\n\t\tend\n\t\treturnRes (res )\n\tend", "def new_tab\n execute_script('window.open();')\n window_handles.last\n end", "def active_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_active @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def focus\n XDo::FFILib.xdo_window_focus @_xdo_pointer, @_window\n end", "def test_default\n w = Window_Selectable_Implemented.new(0,0,160,128,$data_items.compact)\n @windows.push(w)\n end", "def on_target_ok\n BattleManager.actor.input.set = [@target_window.target]\n @target_window.hide\n @skill_window.hide\n @item_window.hide\n next_command\n end", "def cancel_command()\n @command_window.active = true\n end", "def click_open_openas_popup(title, open_file_path)\n click_button_saveas_or_openas_popup(title, open_file_path, \"&Open\")\nend", "def main_window\r\n super\r\n # Make help window, item window\r\n @help_window = Window_Help.new\r\n @item_window = Window_Item.new\r\n # Associate help window\r\n @item_window.help_window = @help_window\r\n # Make target window (set to invisible / inactive)\r\n @target_window = Window_Target.new\r\n @target_window.visible = false\r\n @target_window.active = false\r\n end", "def click_open_file_dialog_popup(title)\n click_button_popup(title, \"&Open\")\nend", "def switch_to_other_window\n @window_id = (@window_id - 1).abs\n if @window_id != 0 and @window_id !=1\n puts @window_id\n raise(Exception::WindowMatchError, \"You cannot use this keyword when more than 2 windows are open; you must use 'Switch To Window', 'Switch to Next Window', or 'Switch to Previous Window'\")\n end\n\n @browser.windows[@window_id].use\n end", "def open_window(options = nil)\n session_number = @konsole.currentSession\n session_object = @konsole_service.object(\"/Sessions/#{session_number}\")\n session_object.introspect\n session_object[\"org.kde.konsole.Session\"]\n end", "def popup\n return @popups[@popup_index]\n end", "def show_com_menu\n TactBattleManager.selecting(true)\n show_tb_command_window_tb\n end", "def get_window; @window; end", "def open_team_actions_window\n @all_shared_acts_win.show if TM.use_shared_actions?\n end", "def main_window\r\n super\r\n # Make help window, status window, and skill window\r\n @help_window = Window_Help.new\r\n @status_window = Window_SkillStatus.new(@actor)\r\n @skill_window = Window_Skill.new(@actor)\r\n # Associate help window\r\n @skill_window.help_window = @help_window\r\n # Make target window (set to invisible / inactive)\r\n @target_window = Window_Target.new\r\n @target_window.visible = false\r\n @target_window.active = false\r\n end", "def click(*args)\n\t\t\t# if no argument has been provided, click on the\n\t\t\t# window itself\n\t\t\th = (args.length == 0) ? @handle : child(args[0]).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def on_pou_ok\n @party_or_unit_win.hide\n @select_text_win.text = \"Select the items to give to #{@actor.name}\"\n @select_text_win.show\n @category_window.show\n deactivate_all_but(@category_window)\n @category_window.activate\n @item_window.show\n end", "def switch_to_window(id)\n driver.switch_to.window(id)\n end", "def show_window\n end", "def goto(url = \"\")\n active_window.url = url\n sleep(1)\n end", "def select_tab\n select find_by_id(handles.selected.tab_id)\n end", "def show_window(win, modal)\n modal ||= false\n check_for_window(win) do\n window(win) << \".dialog('option', 'modal', #{format_type_to_js(modal)});\"\n window(win) << \".dialog('option', 'autoOpen', true);\"\n window(win) << '.dialog(\"open\");'\n end\n nil\n end", "def open_window url, window_id\r\n command 'openWindow', url, window_id\r\n end", "def switch_to_new_window(window)\t\r\n\t\t\t# Switch to new window\r\n\t\t\t#new_window = @driver.window_handles.last\r\n\t\t\t@driver.switch_to.window(window)\r\n\t\tend", "def create_popup_windows\n @popups = {}\n opt = H87Options.option_list\n y = @help_window.height\n for i in 0..opt.size - 1\n if opt[i].popup\n popup = opt[i].popup.new(y, opt[i])\n popup.visible = false\n popup.set_handler(:cancel, method(:close_popup))\n popup.set_handler(:ok, method(:item_selected))\n @popups[i] = popup\n end\n end\n end", "def show_window\n\t\tif self.visible?\n\t\t\tself.bring_to_front\n\t\telse\n\t\t\t# We use set_file here to prevent Macs loading the whole dialog when the\n\t\t\t# plugin loads. No need to populate the dialog and use extra resources\n\t\t\t# if it will never be used.\n\t\t\tfilepath = File.join(PATH, 'webdialog/ui_manager.html')\n\t\t\tself.set_file(filepath)\n\t\t\tif PLUGIN.is_mac?\n\t\t\t\tself.show_modal\n\t\t\telse\n\t\t\t\tself.show\n\t\t\tend\n\t\tend\n\tend", "def create_popup_windows\n @popups = {}\n opt = H87Options.option_list\n y = @help_window.height\n for i in 0..opt.size-1\n if opt[i].popup\n popup = opt[i].popup.new(y, opt[i])\n popup.visible = false\n popup.set_handler(:cancel, method(:close_popup))\n popup.set_handler(:ok, method(:item_selected))\n @popups[i] = popup\n end\n end\n end", "def switch_to_previous_window\n $driver.switch_to.window $previous_window\nend", "def open_window\n terminal_process.keystroke(\"n\", :using => :command_down)\n return_last_tab\n end", "def buttonOpenModal__clicked(*argv)\n ModalWindow.new.show_glade(self) # self = parent, so always on top of parent\n end", "def window\n @window || create_window\n end", "def select!\n raise \"Locator at #{locator} is not visible\" unless visible?\n begin\n wd_element.click\n rescue\n raise \"Locator at #{locator} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def activate_cat(cat_win)\n cat_win.activate\n cat_win.select(0)\n end", "def create_select_party_or_unit_win\n @party_or_unit_win = Window_UnitPartyChoice.new(0,0)\n @party_or_unit_win.set_handler(:unit, method(:on_unit_ok))\n @party_or_unit_win.set_handler(:party, method(:on_pou_ok))\n @party_or_unit_win.set_handler(:cancel, method(:on_pou_cancel))\n @party_or_unit_win.viewport = @viewport\n @party_or_unit_win.deactivate\n @party_or_unit_win.hide\n end", "def window\r\n return $window\r\n end", "def close_window\n end", "def activate_current_window\n if @item_window.index > -1\n @item_window.activate\n else\n @category_window.activate\n end\n end", "def click_run_file_dialog_popup(title)\n click_button_popup(title, \"&Run\")\nend", "def main_window\r\n super\r\n # Make actor command window\r\n s1 = $data_system.words.attack\r\n s2 = $data_system.words.skill\r\n s3 = $data_system.words.guard\r\n s4 = $data_system.words.item\r\n @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])\r\n @actor_command_window.y = 160\r\n @actor_command_window.back_opacity = 160\r\n @actor_command_window.active = false\r\n @actor_command_window.visible = false\r\n # Make other windows\r\n @party_command_window = Window_PartyCommand.new\r\n @help_window = Window_Help.new\r\n @help_window.back_opacity = 160\r\n @help_window.visible = false\r\n @status_window = Window_BattleStatus.new\r\n @message_window = Window_Message.new\r\n end", "def dialog message, *arguments\n launch 'xmessage', '-nearmouse', *arguments, message, :type => 'DIALOG'\n end", "def popup(name)\n win = Browser.new(@browser_type, @proxy_port)\n\n win.proxy_host = @proxy_host\n win.proxy_port = @proxy_port\n win.sahisid = @sahisid\n win.print_steps = @print_steps\n win.popup_name = name\n win.domain_name = @domain_name\n win\n end", "def pop_frame()\n CLI::UI::Frame.close(\"Pop!\")\n end", "def popup(name)\n win = Browser.new(@browser_type, @browser_process_name, @proxy_host, @proxy_port)\n\n win.proxy_host = @proxy_host\n win.proxy_port = @proxy_port\n win.sahisid = @sahisid\n win.print_steps = @print_steps\n win.popup_name = name\n win.domain_name = @domain_name\n win\n end", "def exit_command_select\n hide_turn_dir_window\n hide_tb_command_window_tb\n hide_unit_hud\n @tb_event.flash_soft_tb = false unless !@tb_event\n TactBattleManager.selecting(false)\n end", "def switch_to_previous_window\n @window_id -= 1\n if @window_id < 0\n # wrap back to the last\n @window_id = @browser.windows.count - 1\n end\n\n @browser.windows[@window_id].use\n end", "def create_target_window\n @target_window = Window_BattleTarget.new(@info_viewport)\n @target_window.set_handler(:ok, method(:on_target_ok))\n @target_window.set_handler(:cancel, method(:on_target_cancel))\n end", "def select_frame locator\r\n command 'selectFrame', locator\r\n end", "def window\n self\n end", "def show_window\r\n if visible?\r\n bring_to_front()\r\n else\r\n show_modal()\r\n end\r\n end", "def get_window_for_target(target_id: nil)\n {\n method: \"Browser.getWindowForTarget\",\n params: { targetId: target_id }.compact\n }\n end", "def within_new_window_by(action: nil, url: nil)\n case\n when action\n opened_window = window_opened_by { action.call }\n within_window(opened_window) do\n yield\n current_window.close\n end\n when url\n within_window(open_new_window) do\n visit(url)\n\n yield\n current_window.close\n end\n else\n raise \"Specify action or url\"\n end\n end" ]
[ "0.62809134", "0.6073564", "0.6022672", "0.60094774", "0.599787", "0.5973498", "0.59362465", "0.59362465", "0.5925488", "0.58022827", "0.5791248", "0.57736117", "0.571978", "0.5690645", "0.5688694", "0.5666692", "0.5644722", "0.5644722", "0.56007415", "0.56007415", "0.5584952", "0.55699486", "0.5546289", "0.5532004", "0.5494266", "0.54655", "0.54614055", "0.54433155", "0.54294777", "0.54197395", "0.54197395", "0.5402373", "0.54006326", "0.53981525", "0.53816366", "0.53814894", "0.5365216", "0.53506374", "0.5317679", "0.5290287", "0.5290287", "0.5281486", "0.52700543", "0.52476543", "0.52313197", "0.5231048", "0.5226124", "0.52181673", "0.5208378", "0.5206708", "0.5203524", "0.5187036", "0.51776516", "0.5165171", "0.51641244", "0.5163361", "0.51504517", "0.51454526", "0.51428884", "0.51340324", "0.51195925", "0.5115277", "0.51127034", "0.5104791", "0.51005983", "0.5098727", "0.5097365", "0.5092549", "0.50870997", "0.50865877", "0.5076195", "0.50752664", "0.50735474", "0.5072632", "0.50680125", "0.5067031", "0.5055403", "0.50525737", "0.50517625", "0.50491935", "0.5044861", "0.5040341", "0.5026113", "0.5025996", "0.5025896", "0.50236094", "0.50221133", "0.50193137", "0.50183", "0.5014868", "0.5013449", "0.5013052", "0.5003581", "0.50021136", "0.50012255", "0.49680188", "0.49659595", "0.49644107", "0.49615967" ]
0.6254492
2
Waits for a popup window to appear and load up. The +timeout+ is specified in milliseconds.
def wait_for_popup window_id, timeout command 'waitForPopUp', window_id||'null', timeout end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait(timeout = 0)\n Window.wait(@title, @text, timeout)\n end", "def wait_for_element(element, timeout)\n element.when_present timeout\n element.when_visible timeout\n sleep Utils.click_wait\n end", "def load_window(waittime, window)\n begin\n Timeout::timeout(waittime) do\n time = Time.new\n yield\n end\n rescue Exception => e\n time = Time.new\n if window.exists?\n puts \"#{time.strftime('%Y.%m.%d %H:%M:%S')} - Exception occurred:\\n window.title = #{window.title}\\n #{e}\\n\"\n else\n puts \"#{time.strftime('%Y.%m.%d %H:%M:%S')} - Exception occurred:\\n #{e}\\n\"\n end\n retries ||= 0\n puts \"#{time.strftime('%Y.%m.%d %H:%M:%S')} - Exception: retries = #{retries}\\n\"\n if retries < @max_retries\n retries += 1\n time_to_wait = (Float(waittime) / @max_retries).round\n puts \"#{time.strftime('%Y.%m.%d %H:%M:%S')} - Exception: time_to_wait = #{time_to_wait}\\n\"\n sleep time_to_wait\n retry\n else\n puts \"#{time.strftime('%Y.%m.%d %H:%M:%S')} - Exception: raise Exception\\n\"\n raise e\n end\n end\n end", "def dialog( title, seconds=3 )\n\t\td = begin\n\t\t\t\tw = Window.top_level(title, seconds)\n\t\t\t\tyield(w) ? w : nil\n\t\trescue TimeoutError\n\t\tend\n\n\t\td.wait_for_close if d\n\t\treturn d\n\tend", "def wait_close(timeout = 0)\n Window.functions[__method__] ||= AU3_Function.new(\"WinWaitClose\", 'SSL', 'L')\n Window.functions[__method__].call(@title.wide, @text.wide, timeout) != 0\n end", "def wait_until_displayed(element, timeout=10)\n wait_until(timeout) { element.displayed? }\nend", "def wait_until_present(context=nil)\n adapter.window.wait_until_present context\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def wait_visible!(timeout=@wait)\n self.el\n wait_for(timeout: timeout, message: \"Element at #{location} is not visible\") { visible? }\n end", "def wait_visible!(timeout=@wait)\n wait_for(timeout: timeout, message: \"Element at #{locator} is not visible\") { visible? }\n end", "def wait_active(timeout = 0)\n Window.functions[__method__] ||= AU3_Function.new(\"WinWaitActive\", 'SSL', 'L')\n Window.functions[__method__].call(@title.wide, @text.wide, timeout) != 0\n end", "def wait_for_modal_visible\n wait_until { page.find(modal_id).visible? }\nrescue Capybara::TimeoutError\n flunk 'Expected modal to be visible.'\nend", "def close(wait_timeout=nil)\n @main_window.close\n if wait_timeout\n timeout(wait_timeout) do\n sleep SLEEP_DELAY while @main_window.window?\n end\n end\n# @main_window.wait_for_close(timeout) if timeout - does not work as Window#wait_for_close relies on window_visible?\n end", "def wait_for_pdf_window(string)\n Timeout.timeout(Nenv.browser_timeout) do\n loading = true\n while loading\n check = url_match(string, RouteHelper.browser.windows.last.use.url)\n loading = false if check\n sleep(1)\n end\n return true\n end\n rescue Timeout::Error => e\n raise \"Timeout waiting for window to load - #{e}\"\n exit\n end", "def wait_for_visible(locator, options={})\n builder = JavascriptExpressionBuilder.new\n wait_for_condition builder.visible(locator).script, options[:timeout_in_seconds]\n end", "def wait_for_javascript(timeout = 30)\n wait_for_ajax(timeout)\n wait_for_effects(timeout)\n end", "def wait_for_loading_for(timeout)\n original_timeout = Capybara.default_wait_time\n loop until page.evaluate_script('jQuery.active').zero?\n Capybara.default_wait_time = timeout\n page.has_no_selector?('.loading-indicator')\n Capybara.default_wait_time = original_timeout\n end", "def wait_for_element_to_be_visible(id, name, time)\n begin\n wait = [60, time].max\n element = get_element(id, name)\n !wait.times {\n break if element.displayed?\n sleep 1\n }\n rescue\n end\nend", "def wait_for_modal_hidden\n wait_until { !page.find(modal_id).visible? }\nrescue Capybara::TimeoutError\n flunk 'Expected modal to be visible.'\nend", "def wait_until(timeout: @timeout)\n Log.debug('[GRIDIUM::Element] Waiting for new element...')\n ElementVerification.new(self, timeout, fail_test: true)\n end", "def wait timeout: 3, &block\n wait = Selenium::WebDriver::Wait.new timeout: timeout\n wait.until(&block)\nend", "def check_popup_state(id, visible, timeout=nil)\r\n if visible\r\n find_by_id_and_class(id, \"ss-DialogBox\", timeout);\r\n else\r\n find_by_id_and_class_fail(id, \"ss-DialogBox\", timeout);\r\n end\r\n end", "def wait_page_load\n @browser.wait_for_load\n end", "def window(title, timeout = 0)\n timeout = 30 if timeout == 0\n $webdriver.switch_to.default_content \n if not $marathon.windowMatchingTitle(title)\n bmark = MyBenchMark.new\n bmark.report(\"Waiting for window '\" + title + \"'\") {\n wait = Wait.new(:timeout => timeout, :message => \"Waiting for window '\" + title + \"'\")\n begin\n wait.until {\n waitSucceeded = false\n $webdriver.window_handles.each { |h|\n $webdriver.switch_to.window(h) unless waitSucceeded\n waitSucceeded = true if $marathon.windowMatchingTitle(title)\n }\n waitSucceeded\n }\n ensure\n bmark.close\n end\n }\n end\n $marathon.current_search_context = $webdriver\n $marathon.namingStrategy.setTopLevelComponent($marathon.getDriverAsAccessor())\n $marathon.context_handles.clear\n $marathon.context_handles.push( Proc.new { \n $marathon.current_search_context = $webdriver\n $marathon.namingStrategy.setTopLevelComponent($marathon.getDriverAsAccessor())\n } )\nend", "def with_window(windowTitle, timeout = 0)\n endTime = System.currentTimeMillis + (timeout * 1000)\n begin\n window(windowTitle, timeout)\n rescue Exception => e\n if System.currentTimeMillis < endTime\n retry\n else\n raise e\n end\n end\n yield\n $marathon.close\n return true\nend", "def check_popup_content(id, string, timeout=nil)\r\n popup = find_by_id_and_class(id, \"ss-DialogBox\", timeout);\r\n popup.should have_content(string)\r\n end", "def wait_not_visible!(timeout=@wait)\n self.el\n wait_for(timeout: timeout, message: \"Element at #{location} is still visible\") { !visible? }\n end", "def wait(title, text = \"\", timeout = 0)\n @functions[__method__] ||= AU3_Function.new(\"WinWait\", 'SSL', 'L')\n @functions[__method__].call(title.wide, text.wide, timeout) != 0\n end", "def wait_for(seconds = timeout)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\n end", "def prepare_to_click_button_in_popup(button = \"OK\", wait_time = 3)\n # !@web_browser.is_firefox?\n # TODO: firefox is OK\n if RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/ then\n start_checking_js_dialog(button, wait_time)\n else\n raise \"this only support on Windows and on IE\"\n end\n end", "def wait_not_visible!(timeout=@wait)\n wait_for(timeout: timeout, message: \"Element at #{locator} is still visible\") { !visible? }\n end", "def open_and_wait( location)\n selenium.open(location)\n wait_for_page_to_load\n end", "def wait_not_active(timeout = 0)\n Window.functions[__method__] ||= AU3_Function.new(\"WinWaitNotActive\", 'SSL', 'L')\n Window.functions[__method__].call(@title.wide, @text.wide, timeout) != 0\n end", "def wait_for_effects(timeout = 30)\n wait_for(timeout) { @browser.document.js_eval(\"document.defaultView.Effect.Queue.size()\").to_i == 0 }\n end", "def wait_for_modal_open(id)\n # sanity check in case modal has already opened and closed - if no modal opens in 10 seconds then exit and continue\n i = 0\n while @driver.execute_script(\"return OPEN_MODAL\") == ''\n if i == 30\n $verbose ? puts(\"Exiting wait_for_modal_open(#{id}) after 30 seconds - no modal open\") : nil\n return true\n else\n sleep(1)\n i += 1\n end\n end\n $verbose ? puts(\"current open modal: #{@driver.execute_script(\"return OPEN_MODAL\")}\") : nil\n # need to wait until modal is in the page and has completed opening\n @wait.until {@driver.execute_script(\"return OPEN_MODAL\") == id}\n $verbose ? puts(\"requested modal #{id} now open\") : nil\n true\n end", "def notification_confirm\n wait = Selenium::WebDriver::Wait.new(timeout: 5)\n wait.until {\n @driver.find_element(id: 'flash-messages').displayed?\n }\nend", "def wait_alert_accept_if_exist\n sleep 1.5 #should wait animation\n wait_true(timeout: 30, message: 'waiting alert dialog via wait_alert_accept_until_display_alert') {\n execute_script('$.mainApp().alert().buttons().length > 0')\n }\n alert_accept_if_exist\n end", "def wait_for(timeout = DEFAULT_TIMEOUT)\n Selenium::WebDriver::Wait.new(:timeout => timeout).until {yield}\nend", "def wait_for_browser\r\n # NOTE: no need any more\r\n end", "def wait(timeout=60)\n countdown = timeout.to_f\n\n while countdown > 0\n if @zmq_thread and @zmq_thread.alive?\n sleep 0.1\n countdown = countdown - 0.1\n else\n break\n end\n end\n\n super()\n end", "def wait_for_message\n @message_window.update\n while $game_message.visible \n update_basic\n end\n end", "def wait_for_visible(locator)\n wait_for { find_element(locator).displayed? }\n end", "def wait_for_element(element)\n wait = Selenium::WebDriver::Wait.new(timeout: 60)\n wait.until { find_element(element) }\n end", "def wait(timeout=10)\n Selenium::WebDriver::Wait.new(:timeout => timeout)\n end", "def wait_until(timeout=nil)\n Log.debug('Waiting for new element...')\n timeout = Corundum.config.element_timeout if timeout.nil?\n ElementVerification.new(self, timeout, fail_test=true)\n end", "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", "def upload_modal_displayed?\n wait = Selenium::WebDriver::Wait.new(timeout: 15)\n wait.until { displayed? UPLOAD_MODAL }\n end", "def restrictions_option_popup_present?\n until @browser.section(:id, 'update-page-restrictions-dialog').exists? do\n sleep 1\n end\n # for some reason the div never appeared as visible, only existing, and only becamne existing when the functionality\n # was invoked. Given this the only ways to validate presence was to check the z access it the style attribute or the exist? flag\n # neither of which i like very much and would like to discuss a better solution with developers as html implementation may be causing issues.\n expect(@browser.div(:id, 'update-page-restrictions-dialog').attribute_value('style')).to include('z-index: 3000')\n # or\n expect(@browser.div(:id, 'update-page-restrictions-dialog').exist?).to eq(true)\nend", "def wait_for_ajax(timeout = 15)\n wait(timeout: timeout, msg: \"Timeout after waiting #{timeout} for all ajax requests to finish\").until do\n driver.execute_script 'return window.jQuery != undefined && jQuery.active == 0'\n end\n end", "def wait_for_launching\n sleep @delay\n end", "def wait_until timeout=10, &block\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until &block\nend", "def wait_for_results_to_load\n wait_until { searchbar_element.attribute('class').include?(Constants::SEARCHING_CLASS) }\n rescue StandardError\n puts 'Loading in search modal didn\\'t appear!'\n ensure\n wait_until { !searchbar_element.attribute('class').include?(Constants::SEARCHING_CLASS) }\n end", "def wait_for_disappear(element, timeout = 5)\n\tstart_time = time_now_sec\n\tbegin\n\t\twhile element.displayed? do\n\t\t\tif time_now_sec >= start_time + timeout\n\t\t\t\tfail(element.to_s + \" did not disappear\")\n\t\t\tend\n\t\tend\n\trescue Selenium::WebDriver::Error::StaleElementReferenceError\n\t\treturn\n\trescue Selenium::WebDriver::Error::NoSuchElementError\n\t\treturn\n\tend\nend", "def wait_for_dom_has_loaded\n Capybara.default_max_wait_time = 40\n Timeout.timeout(Capybara.default_max_wait_time) do\n loop until page_has_loaded?\n end\n end", "def wait_for_page_to_load\n @wait_on.each { |element| wait_for_element(element) }\n loading_message.wait_while_present if loading_message.present?\n true\n rescue\n false\n end", "def wait_for\n wait = Selenium::WebDriver::Wait.new(:timeout => 1000)\n wait.until { yield(@session) }\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def accept_browser_dialog\n wait = Selenium::WebDriver::Wait.new(:timeout => 10)\n wait.until {\n begin\n page.driver.browser.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end\n }\n page.driver.browser.switch_to.alert.accept\n sleep(1) # This is the issue: it looks like we need to wait some time (how much?) manually\nend", "def wait_for_load_and_click(element)\n click_element(element, Utils.medium_wait)\n end", "def switch_to_alert(timeout = 300)\n sleep_time = 0.5\n start_time = Time.now\n alert = nil\n loop do\n alert = @driver.switch_to.alert rescue nil\n break unless alert.nil? && Time.now - start_time < timeout\n sleep(sleep_time)\n end\n alert\n end", "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", "def wait_for_prompt\n while !@prompted do\n sleep(0.2)\n end\n end", "def wait_for_freelancer_page_visible\n sleep 15\n end", "def wait_cbox_open(&block)\n wait_for_js_ready\n wait_event_to_fire(\"cbox_complete\", &block)\n wait_for_js_ready\n end", "def wait_for_element(element)\n self.send(element).wait_until_present(@ole.explicit_wait)\n end", "def wait_for_element(element_id, timeout = $testwise_polling_timeout, interval = $testwise_polling_interval)\r\n start_time = Time.now\r\n #TODO might not work with Firefox\r\n until @web_browser.element_by_id(element_id) do\r\n sleep(interval)\r\n if (Time.now - start_time) > timeout\r\n raise RuntimeError, \"failed to find element: #{element_id} for max #{timeout}\"\r\n end\r\n end\r\n end", "def pbWaitMessage\r\n return if !@briefMessage\r\n pbShowWindow(MESSAGE_BOX)\r\n cw = @sprites[\"messageWindow\"]\r\n MESSAGE_PAUSE_TIME.times do\r\n pbUpdate(cw)\r\n end\r\n cw.text = \"\"\r\n cw.visible = false\r\n @briefMessage = false\r\n end", "def wait_for\n subject = nil\n wait.until { (subject = yield).displayed? }\n sleep(1.2) # FIXME: wait animations to complete\n subject\n end", "def is_element_present_with_wait?(timeout = Config.implicit_wait, driver = $focus_driver)\r\n Wait.wait_for_element(self, timeout)\r\n is_present?(driver)\r\n end", "def window(windowTitle, timeout = 0)\n $marathon.window(windowTitle, timeout)\n return true\nend", "def wait_for_id(id, timeout = 10)\n @driver.wait_true(timeout) do\n @driver.exists { @driver.find_element(:id, id)}\n end\n end", "def wait_for_element(id, name, time)\n wait = Selenium::WebDriver::Wait.new(:timeout => time)\n wait.until {@driver.find_element(id => name) }\nend", "def wait_until_element_disappears(type, name, timeout: 5)\n \t\twait = Selenium::WebDriver::Wait.new(timeout: timeout)\n \t\twait.until { !@selenium_driver.find_element(type, name).visible? }\n\tend", "def wait_to_appear(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", "def wait_for_appearance(timeout_in_s)\n puts \"Start waiting for wait_for_appearance of agents for #{timeout_in_s} seconds\"\n start = Time.now\n stop = false\n while !stop\n if (Time.now - start) > timeout_in_s\n stop = true\n end\n\n if letter = letter_reader.read_new\n identified_agent = letter.getACLMessage.getSender.getName\n puts \"#{from}: received letter with content from: #{identified_agent}\"\n if identified_agent !~ /^mts/\n @known_agents[identified_agent] = true\n else\n puts \" that is a message from an mts\"\n end\n end\n end\n puts \"Done waiting for agents (timeout after #{timeout_in_s} seconds -- identified: #{@known_agents.keys.join(\",\")}\"\n end", "def wait_for(seconds)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\nend", "def wait_for_element(element_id, timeout = @@default_timeout, interval = @@default_polling_interval)\n start_time = Time.now\n #TODO might not work with Firefox\n until @web_browser.element_by_id(element_id) do\n sleep(interval)\n if (Time.now - start_time) > timeout\n raise RuntimeError, \"failed to find element: #{element_id} for max #{timeout}\"\n end\n end\n end", "def wait_for_input\n wait_for_input_core = lambda do\n text = %x{#{TM_DIALOG} -w #{@dialog_token} }\n raise WindowNotFound if $CHILD_STATUS == 54528 # -43\n raise \"Error (#{text})\" if $CHILD_STATUS != 0\n\n OSX::PropertyList::load(text)\n end\n\n if block_given? then\n loop do\n should_continue = yield(wait_for_input_core.call)\n break unless should_continue\n end\n else\n wait_for_input_core.call\n end\n end", "def wait_until\n Timeout.timeout(Capybara.default_wait_time) do\n loop until yield\n end\n end", "def wait_for_element_to_load(locator)\n sleep 1\n puts \"Waiting for this locator to be visible on the page: #{locator}\"\n if isElementVisible(locator)\n return true\n else\n raise Selenium::WebDriver::Error::NoSuchElementError\n end\n sleep 1\n end", "def should_show_alert(alert_id)\n expect(page).to have_css \"div##{alert_id}\", visible: true\n\n # It should close automatically after 5 seconds\n sleep 5\n expect(page).to have_no_css \"div##{alert_id}\", visible: true\nend", "def wait_for_element(element)\n wait = Selenium::WebDriver::Wait.new(timeout: 10)\n wait.until { find_elements(element) }\n end", "def Wait_For_Element(locator_type, locator_value)\n for iSecond in 0..$config['Longwait']\n sleep 1\n if(@driver.find_element(\"#{locator_type}\", \"#{locator_value}\").displayed?)\n\tbreak\n else \t\n if (iSecond >= $config['Longwait']) \n return false\n @driver.find_element(\"#{locator_type}\", \"#{locator_value}\").displayed?\n break\n end\n end \n end\n return true\nend", "def wait(timeout = nil)\n event.wait(timeout) if timeout != 0 && incomplete?\n self\n end", "def wait_for_not_visible(locator, options={})\n builder = JavascriptExpressionBuilder.new\n wait_for_condition builder.not_visible(locator).script, options[:timeout_in_seconds]\n end", "def wait_for_not_visible(locator, seconds = 3)\n how, what = parse_locator(locator)\n\n implicit_wait(seconds)\n\n begin\n wait_for(seconds) do\n begin\n elements = driver.find_elements(how, what)\n elements.empty? || elements.map(&:displayed?).none?\n rescue Selenium::WebDriver::Error::StaleElementReferenceError\n false\n end\n end\n rescue Selenium::WebDriver::Error::TimeoutError\n true\n rescue Net::ReadTimeout\n true\n ensure\n implicit_wait(timeout)\n end\n end", "def wait_for_ajax(timeout: 20)\n wait(timeout).until do\n driver.execute_script('return jQuery.active == 0')\n sleep 1\n end\n rescue StandardError\n 'wait_for_ajax: jQuery not active'\n end", "def wait(message, timeout=$element_timeout)\n Selenium::WebDriver::Wait.new :timeout => timeout, :interval => 1, :ignore=>[Selenium::WebDriver::Error::NoSuchElementError,Selenium::WebDriver::Error::StaleElementReferenceError], :message=>message\n end", "def wait_until(timeout=10, &block)\n time = Time.now\n success = false\n until success\n if (Time.now - time) >= timeout\n raise \"Waited for #{timeout} seconds, but block never returned true\"\n end\n sleep 0.5\n success = yield\n end\n end", "def clickWindowsButton (windowCaption , buttonCaption , maxWaitTime=30 )\n\n sleep 1\n\n hwnd = -1\n begin \n timeout(maxWaitTime) do\n\n hwnd = getWindowHandle(windowCaption)\n\n while hwnd == -1 \n hwnd = getWindowHandle(windowCaption)\n sleep 0.5\n end\n makeWindowActive(hwnd)\n end\n rescue\n puts \"clickWindowsButton: Cant make window active in specified time ( \" + maxWaitTime.to_s + \") - no handle\"\n return false\n end\n\n puts ' Window handle is : ' + hwnd.to_s\n if hwnd != -1 \n puts \"clickWindowsButton: Handle for window: \" + windowCaption + \" is: \" + hwnd.to_s\n makeWindowActive(hwnd)\n else\n end\n\n d = getChildHandle( hwnd , buttonCaption )\n puts (\"clickWindowsButton: handle for button: \" + buttonCaption + \" is \" + d.to_s )\n\n if d != -1 \n makeWindowActive(hwnd)\n clickButtonWithHandle (d)\n else\n return false\n end\n\n return true\n\n end", "def wait_for_progress\n sleep 2\n wait_for(timeout: 60) { element_does_not_exist \"* marked:'#{loading_screen}'\" }\n end", "def check_if_join_public_league_pop_up_is_displayed\n\n page.should have_content(read_file_content(JOIN_A_PUBLIC_LEAGUE_PATH))\n sleep(THREAD_SLEEP_1)\n\n end", "def check_if_join_private_league_pop_up_is_displayed\n\n page.should have_content(read_file_content(JOIN_A_PRIVATE_LEAGUE_PATH))\n sleep(THREAD_SLEEP_1)\n\n end", "def popup\n return @popup if @popup\n return Generic_PopupWindow if @need_popup\n return nil\n end", "def clear_popup(popup_win_title, seconds = 10, yes = true)\r\n # commonly \"Security Alert\", \"Security Information\"\r\n if is_windows?\r\n sleep 1\r\n autoit = WIN32OLE.new('AutoItX3.Control')\r\n # Look for window with given title. Give up after 1 second.\r\n ret = autoit.WinWait(popup_win_title, '', seconds)\r\n #\r\n # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).\r\n if ret == 1 then\r\n puts \"about to send click Yes\" if debugging?\r\n button_id = yes ? \"Button1\" : \"Button2\" # Yes or No\r\n autoit.ControlClick(popup_win_title, '', button_id)\r\n end\r\n sleep(0.5)\r\n else\r\n raise \"Currently supported only on Windows\"\r\n end\r\n end", "def check_window(tag = nil, match_timeout = USE_DEFAULT_MATCH_TIMEOUT)\n target = Applitools::Selenium::Target.window.tap do |t|\n t.timeout(match_timeout)\n t.fully if force_full_page_screenshot\n end\n check(tag, target)\n end", "def ajax_wait_for_element(element_id, seconds, status='show', check_interval = @@default_polling_interval)\n count = 0\n check_interval = 1 if check_interval < 1 or check_interval > seconds\n while count < (seconds / check_interval) do\n search_indicator = @web_browser.element_by_id(element_id)\n search_indicator_outer_html = search_indicator.outerHtml if search_indicator\n if status == 'hide'\n return true if search_indicator_outer_html and !search_indicator_outer_html.include?('style=\"DISPLAY: none\"')\n else\n return true if search_indicator_outer_html and search_indicator_outer_html.include?('style=\"DISPLAY: none\"')\n end\n sleep check_interval if check_interval > 0 and check_interval < 5 * 60 # wait max 5 minutes\n count += 1\n end\n return false\n end" ]
[ "0.67727995", "0.65322536", "0.618935", "0.61204183", "0.59789014", "0.5959777", "0.5941881", "0.5924773", "0.5924773", "0.5867076", "0.5864496", "0.5825298", "0.5792088", "0.5713232", "0.5685096", "0.5676842", "0.56285006", "0.5603574", "0.55893207", "0.5570003", "0.5546727", "0.5535251", "0.5524307", "0.55177206", "0.54883885", "0.5479579", "0.54662037", "0.5455471", "0.5435588", "0.5410206", "0.5403615", "0.5395193", "0.5388032", "0.536331", "0.5354394", "0.53322935", "0.5323647", "0.53211635", "0.53109807", "0.531088", "0.53017336", "0.5300873", "0.5300822", "0.5298799", "0.52935094", "0.52884996", "0.52831554", "0.5273361", "0.52687263", "0.52507037", "0.52335036", "0.5231273", "0.5222396", "0.5189984", "0.5188411", "0.517002", "0.5170013", "0.5147743", "0.5147743", "0.51447046", "0.514455", "0.51405823", "0.5130881", "0.5117427", "0.5113124", "0.5100578", "0.5084258", "0.5083146", "0.5080305", "0.50771815", "0.50766426", "0.50751394", "0.50556237", "0.5040593", "0.50403845", "0.5039482", "0.4999841", "0.49947593", "0.49938205", "0.49896497", "0.4950603", "0.4941157", "0.49410847", "0.49261984", "0.49245065", "0.49145752", "0.49137792", "0.48971468", "0.48943532", "0.48936206", "0.48836595", "0.48797342", "0.48774713", "0.48605484", "0.48580346", "0.48550364", "0.48528662", "0.48512697", "0.4843496" ]
0.79213357
1
By default, Selenium's overridden window.confirm() function will return +true+, as if the user had manually clicked OK. After running this command, the next call to confirm() will return +false+, as if the user had clicked Cancel.
def choose_cancel_on_next_confirmation command 'chooseCancelOnNextConfirmation' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm?(text='')\n return self.run_cmd('confirm ' + text) == 0\n end", "def confirm?(text)\n return self.run_cmd('confirm ' + text) == 0\n end", "def confirm(question)\n CLI::UI.confirm(question)\n end", "def confirm(prompt)\n 'y'\n end", "def confirm(question, append_instructions = true, default_choice = nil)\n unless confirm_without_exit(question, append_instructions, default_choice)\n exit 3\n end\n true\n end", "def click_alert_box(flag)\n if %w[selenium selenium_dev sauce].include? settings.driver\n if flag\n page.driver.browser.switch_to.alert.accept\n else\n page.driver.browser.switch_to.alert.dismiss\n end\n else\n if flag\n page.evaluate_script('window.confirm = function() { return true; }')\n else\n page.evaluate_script('window.confirm = function() { return false; }')\n end\n end\n end", "def confirm\n options.fetch(:confirm, nil)\n end", "def confirm(prompt)\n return true if config[:yes]\n valid_responses = %w[yes no y n]\n response = nil\n 3.times do\n response = ui.ask(prompt).downcase\n break if valid_responses.include? response\n ui.warn \"Valid responses are #{valid_responses}\"\n end\n response.match(/^y/)\n end", "def confirm(prompt); end", "def confirm\n end", "def confirm\n end", "def test_JSDialog_002_Confirmation\n\n puts2(\"\")\n puts2(\"###############################\")\n puts2(\"# BEGIN: test_JSDialog_002_Confirmation #\")\n puts2(\"###############################\")\n\n # Only run if NOT using Watir-WebDriver\n if(is_webdriver? == true)\n puts2(\"Not supported with WebDriver\")\n return\n end\n\n # Only run on windows\n if(is_win?() == true)\n\n # Text on the buttons to select\n sButtonCaption = \"Display a Confirmation\"\n\n # Define components of the URL\n sProtocol = \"file:///\"\n sRootURL =Dir.pwd\n sPage = \"data/html/jsdialogs.html\"\n\n # Construct the URL\n sURL = sProtocol + sRootURL + \"/\" + sPage\n\n begin # Confirmation Dialog\n\n # Start a browser,\n #browser = Watir::Browser.new\n browser = start_browser($sDefaultBrowser)\n\n # Load a blank page (Workaround for issues with click_no_wait)\n browser.goto(\"about:blank\")\n\n # Load the page\n browser.goto(sURL)\n\n if(browser.is_ie?)\n sDialogTitle = \"Message from webpage\"\n elsif(browser.is_firefox?)\n sDialogTitle = \"[JavaScript Application]\"\n end\n\n puts2(\" Selecting button \\\"#{sButtonCaption}\\\" \")\n\n browser.button(:value, /#{sButtonCaption}/).click_no_wait\n #\n if(browser.is_firefox?)\n # Use this workaround until click_no_wait is fixed in firewatir\n #pause(\"Manually select the button: \" + sButtonCaption + \"\\nThen dismiss this pause dialog\")\n end\n\n # Define the text on the control that AutoIt should select\n sControlID = \"OK\"\n\n # Dismiss the JS-Dialog\n puts2(\"Dismissing JS Confirmation dialog via the #{sControlID} button...\")\n browser.handle_win_dialog_generic_modal(sDialogTitle, sControlID)\n\n #\n # Do it again but dismiss the JS dialog by selecting the other button\n #\n\n sButtonCaption = \"Display a Confirmation\"\n puts2(\" Selecting button \\\"#{sButtonCaption}\\\" \")\n\n # Raise a JS-Prompt-Dialog\n #\n browser.button(:value, /#{sButtonCaption}/).click_no_wait\n #\n if(browser.is_firefox?)\n # Use this workaround until click_no_wait is fixed in firewatir\n #pause(\"Manually select the button: \" + sButtonCaption + \"\\nThen dismiss this pause dialog\")\n end\n\n # Define the text on the control that AutoIt should select\n sControlID = \"Cancel\"\n\n # Dismiss the JS-Dialog\n puts2(\"Dismissing JS Confirmation dialog via the #{sControlID} button...\")\n browser.handle_win_dialog_generic_modal(sDialogTitle, sControlID)\n\n rescue => e\n\n puts2(\"*** ERROR and Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\n\n # Raise the error with a custom message after the rest of the rescue actions\n raise(\"*** TESTCASE - test_JSDialog_002_Confirmation\")\n\n ensure\n\n # Close the browser\n browser.close()\n\n end # Confirmation Dialog\n\n else\n puts2(\"*** Skipping - Non-Windows platform\")\n end # Only run on windows\n\n end", "def confirm(title = nil, hint: nil, result_type: :boolean)\n args = owner.generate_args_list([['confirm'],\n ['-t', title],\n ['-i', hint]\n ])\n single_result(args, result_type)\n end", "def confirm msg\n document.get_default_view.confirm(msg)\n end", "def js_confirm(status)\n page.evaluate_script 'window.original_confirm_function = window.confirm;'\n page.evaluate_script \"window.confirm = function(msg) { return #{status == 'accept'}; }\"\n yield\n page.evaluate_script 'window.confirm = window.original_confirm_function;'\nend", "def press_confirm_in_alert\r\n\t\t\t@driver.switch_to.alert.accept\r\n\t\t\tsleep 20\r\n\t\tend", "def confirm\n\n end", "def confirm(question)\n formatted_question = \"\\n #{question} [Y/n]\"\n answer = ask(formatted_question).strip\n fail unless [\"Y\", \"y\", \"\"].include?(answer)\n end", "def confirm_with_user\n confirmed = Helper::Util.confirm \"Is this OK? \", true\n return if confirmed\n\n loop do\n Helper::Util.clear\n\n print_identification\n\n say \"<%= color('The following options may be adjusted before continuing.', BOLD) %>\"\n choice = choose do |menu|\n self.class.available_options.reject(&:skip_confirmation).each do |option|\n value = send option.confirm_symbol\n menu.choice \"#{option.label}: #{option.display_value(value)}\"\n end\n\n menu.choice \"Accept and continue\"\n menu.choice \"Quit\"\n menu.readline = true\n menu.prompt = \"What would you like to do?\"\n end\n\n Helper::Util.clear\n\n print_identification\n\n if (option = self.class.available_options.find { |o| choice =~ /^#{Regexp.quote(o.label)}/ })\n loop do\n break if prompt_for_option(option)\n say \"Invalid value for option.\\n\\n\"\n end\n elsif choice =~ /^Accept/\n log\n return\n else\n exit(0)\n end\n end\n end", "def proceed_to_confirm(params = {})\n self.status = 'confirming'\n if self.update(params)\n true\n else\n false\n end\n end", "def confirm_visible\n return false if @windows.nil?\n return false if @windows[Win_Confirm].nil?\n return (@windows[Win_Confirm].active && @windows[Win_Confirm].visible)\n end", "def confirm element\n element.perform :confirm\n end", "def confirm(message='Are you sure?')\n while true\n tell_user [message, '(Y)es | (N)o']\n case input = user_input\n when /y|yes/ then return true\n when /n|no/ then return false\n else tell_user \"Invalid option: '#{input}'\"\n end\n end\n end", "def confirm_execution(*args)\n # pass\n end", "def confirm!\n @@api.post(endpoint: self.endpoint + ['confirm'])\n end", "def request_confirmation(options = Hash.new,&block)\n button1 = options[:button1] || \"Continue\"\n button2 = options[:button2] || \"Cancel\"\n title = options[:title] || \"Something Happened\"\n prompt = options[:prompt] || \"Should we continue or cancel?\"\n\n \tres = alert(:informational, title, prompt, button1, button2)\n\n if res == button1 then\n block_given? ? yield : true\n else\n block_given? ? raise(SystemExit) : false\n end\n end", "def test_confirm_sigint\n start_process do\n Prompt.confirm('q')\n rescue Interrupt\n @ret.write(Marshal.dump(:SIGINT))\n end\n\n sleep(0.05)\n Process.kill('INT', @pid)\n\n expected_out = strip_heredoc(<<-EOF) + ' '\n ? q (Choose with ↑ ↓ ⏎)\n \\e[?25l> 1. yes\\e[K\n 2. no\\e[K\n \\e[?25h\n EOF\n assert_result(expected_out, \"\", :SIGINT)\n end", "def confirm\n puts \"#{@gre}[ok] #{@lastMsg}. #{@ncl}\"\n end", "def confirm_delete\n wait_for_update_and_click confirm_delete_button_element unless \"#{browser.browser}\" == 'firefox'\n end", "def confirm(prompt, default=false)\n raise RuntimeError, Trepan::NotImplementedMessage\n end", "def handleConfirm(page, message)\n @text = message\n return handleConfirmValue.nil? ? true : handleConfirmValue\n end", "def prompt_for_continue\n result = @env.ui.ask(\"Deployment paused for manual review. Would you like to continue? (y/n) \")\n if result.upcase != \"Y\"\n @env.ui.info(\"Deployment push action cancelled by user\")\n return false\n end\n true\n end", "def test_confirm_sigint\n start_process do\n begin\n Prompt.confirm('q')\n rescue Interrupt\n @ret.write(Marshal.dump(:SIGINT))\n end\n end\n\n sleep(0.05)\n Process.kill('INT', @pid)\n\n expected_out = strip_heredoc(<<-EOF) + ' '\n ? q (choose with ↑ ↓ ⏎)\n \\e[?25l> 1. yes\n 2. no\n \\e[?25h\\e[\\e[C\n EOF\n assert_result(expected_out, \"\", :SIGINT)\n end", "def is_confirmable?\n true\n end", "def confirm text, config={}, &block\n title = config['title'] || \"Confirm\"\n config[:default_button] ||= 0\n\n mb = Canis::MessageBox.new config do\n title title\n message text, &block \n button_type :yes_no\n end\n index = mb.run\n return index == 0\nend", "def confirm(prompt)\n readline(prompt) == \"y\"\n end", "def confirmation\n end", "def confirmed?\n confirmation == 'yes'\n end", "def require_confirmation!(msg=\"\", &block)\n answer = ask(\"#{msg} [yn]\") do |q|\n q.echo = false\n q.character = true\n q.validate = /\\A[yn]\\Z/\n end\n exit(0) if answer.index('n')\n end", "def confirm\n text = \" Notifier #{@selected_size} abonnement(s)\"\n return unless GuiQt.confirm_dialog(text)\n answer = do_notify\n report(answer.join(\"\\n\"))\n JacintheManagement.log(answer.join(\"\\n\"))\n update_classification\n redraw_selection_area\n update_selection\n @show_button.enabled = true\n end", "def confirm(message, options = {})\n confirm_message = options[:confirm_message] || 'Are you sure?'\n banner = options[:banner] || false\n banner ? header(message) : puts(\"\\n#{message}\")\n print \"#{confirm_message} (yes/no) \"\n choice = STDIN.gets.chomp\n\n case choice\n when 'yes'\n return true\n else\n puts 'Aborted'\n end\nend", "def confirm(msg)\n print(\"%s (y/n) \" % msg)\n\n $stdout.flush\n\n exit(1) unless $stdin.gets.strip.match?(/^(?:y|yes)$/i)\n end", "def x__confirm(message='y(es) or no? ')\n print message\n e_confirm = STDIN.gets.chomp\n case e_confirm\n when /\\Ay(es)?\\z/i\n true\n else\n false\n end\n end", "def confirmed?\n confirmation == 'yes'\n end", "def confirm!\n return false if purchased?\n confirmed!\n end", "def confirmable?\n status.to_sym.in? [:done]\n end", "def click_yes_js_popup(title)\n click_button_popup(title, \"&Yes\")\nend", "def confirming?\n self.status == 'confirming'\n end", "def continue?(message = 'Continue? (y|n)', expectation = 'y')\n abort 'Aborted!' unless prompt(message) == expectation\nend", "def confirmation_prompt(message, add_options=true)\n # used to disable skip with ctrl+c\n trap(\"INT\", \"SIG_IGN\")\n message += \" (yes|no)\" if add_options\n\n while line = Readline.readline(\"#{message}: \", true)\n if (line.eql?(\"yes\") || line.eql?(\"y\"))\n trap(\"INT\",false)\n return true\n elsif (line.eql?(\"no\") || line.eql?(\"n\"))\n trap(\"INT\",false)\n return false\n end\n end\n end", "def send_confirmation\n reply 'confirmation'\n end", "def confirm_placement\n end", "def confirmation_required?\n return true\n end", "def ask_for_confirmation( description, abort_on_decline=true )\n\t\t\tprompt = 'Continue?'\n\n\t\t\t# If the description looks like a question, use it for the prompt. Otherwise,\n\t\t\t# print it out and\n\t\t\tif description.strip.rindex( '?' )\n\t\t\t\tprompt = description\n\t\t\telse\n\t\t\t\tlog description\n\t\t\tend\n\n\t\t\tanswer = prompt_with_default( prompt, 'n' ) do |input|\n\t\t\t\tinput =~ /^[yn]/i\n\t\t\tend\n\n\t\t\tif answer =~ /^y/i\n\t\t\t\treturn yield\n\t\t\telsif abort_on_decline\n\t\t\t\terror \"Aborted.\"\n\t\t\t\tfail\n\t\t\tend\n\n\t\t\treturn false\n\t\tend", "def win_confirm_update \n @windows[Win_Confirm].update\n @windows[Win_Help].hide\n case @windows[Win_Confirm].question\n when Command_Confirm::Move\n show_range_after_move? \n case confirm_trigger?\n when 0; confirm_move \n when 1; cancel_move\n end\n\n when Command_Confirm::Attack \n case confirm_trigger?\n when 0; confirm_attack\n when 1; cancel_attack\n end\n \n when Command_Confirm::Skill\n update_status_revive(@spell)\n case confirm_trigger?\n when 0; confirm_skill\n when 1; cancel_skill\n end\n \n when Command_Confirm::Wait_Skill_Targeting\n if Input.trigger?(Input::C)\n Sound.play_decision\n case @windows[Win_Confirm].index\n when 0; confirm_skill_panel_targeting\n when 1; confirm_skill\n end\n close_confirm_window \n elsif Input.trigger?(Input::B) \n Sound.play_cancel\n close_confirm_window\n cancel_skill\n end\n when Command_Confirm::Item\n update_status_revive(@item)\n case confirm_trigger?\n when 0; confirm_item\n when 1; cancel_item\n end\n \n when Command_Confirm::Wait\n case confirm_trigger?\n when 0\n activate_wait_phase\n @windows[Menu_Actor].active = false\n when 1\n actor_menu_open\n end\n when Command_Confirm::Place\n case confirm_trigger?\n when 0\n close_confirm_window \n @cursor.active = false \n @windows[Win_Status].visible = false\n clear_tr_sprites\n #leave the prepare phase\n return true\n when 1\n close_confirm_window\n @cursor.active = true\n return nil\n end\n when Command_Confirm::Revive\n case @cursor.mode\n when TBS_Cursor::Item\n case confirm_trigger?\n when 0; confirm_item\n when 1; cancel_item\n end\n when TBS_Cursor::Skill\n case confirm_trigger?\n when 0; confirm_skill\n when 1; cancel_skill\n end\n end \n end \n end", "def confirmation_required?; end", "def confirm_account\n confirm\n end", "def test_customCommandsText\n w = Window_Confirmation.new(0,80,320,\"Êtes-vous certain ?\", \"Oui\", \"Non\")\n @windows.push(w)\n return true\n end", "def confirm_for_fulfillment\n\n\t\t\tresult = PrintfulAPI.request( :POST, \"/orders/#{self.id}/confirm\", {} )\n\n\t\t\tself.load_data( result )\n\n\t\t\treturn true\n\n\t\tend", "def confirm_without_exit(question, append_instructions = true, default_choice = nil)\n return true if config[:yes]\n\n stdout.print question\n stdout.print confirmation_instructions(default_choice) if append_instructions\n\n answer = stdin.readline\n answer.chomp!\n\n case answer\n when \"Y\", \"y\"\n true\n when \"N\", \"n\"\n msg(\"You said no, so I'm done here.\")\n false\n when \"\"\n unless default_choice.nil?\n default_choice\n else\n msg(\"I have no idea what to do with '#{answer}'\")\n msg(\"Just say Y or N, please.\")\n confirm_without_exit(question, append_instructions, default_choice)\n end\n else\n msg(\"I have no idea what to do with '#{answer}'\")\n msg(\"Just say Y or N, please.\")\n confirm_without_exit(question, append_instructions, default_choice)\n end\n end", "def confirmation_required?\n true\n end", "def confirm_checkout\n system 'clear'\n CoffeeMan.stay_logo\n choice = self.prompt.select(\"Are you done\") do |menu|\n menu.choice \"Yes\", -> {checkout}\n menu.choice \"No\", -> {view_cart}\n end\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def test_JSDialog_003_Prompt\n\n puts2(\"\")\n puts2(\"###############################\")\n puts2(\"# BEGIN: test_JSDialog_003_Prompt #\")\n puts2(\"###############################\")\n\n # Only run if NOT using Watir-WebDriver\n if(is_webdriver? == true)\n puts2(\"Not supported with WebDriver\")\n return\n end\n\n # Only run on windows\n if(is_win?() == true)\n\n # Text on the buttons to select\n sButtonCaption = \"Display a Prompt\"\n\n # Define components of the URL\n sProtocol = \"file:///\"\n sRootURL =Dir.pwd\n sPage = \"data/html/jsdialogs.html\"\n\n # Construct the URL\n sURL = sProtocol + sRootURL + \"/\" + sPage\n\n begin # Prompt Dialog\n\n # Start a browser,\n #browser = Watir::Browser.new\n browser = start_browser($sDefaultBrowser)\n\n # Load a blank page (Workaround for issues with click_no_wait)\n browser.goto(\"about:blank\")\n\n # Load the page\n browser.goto(sURL)\n\n if(browser.is_ie?)\n sDialogTitle = \"Explorer User Prompt\"\n elsif(browser.is_firefox?)\n sDialogTitle = \"[JavaScript Application]\"\n end\n\n puts2(\" Selecting button \\\"#{sButtonCaption}\\\" \")\n\n # Raise a popup JS Dialog by using the method - click_no_wait\n browser.button(:value, /#{sButtonCaption}/).click_no_wait\n #\n if(browser.is_firefox?)\n # Use this workaround until click_no_wait is fixed in firewatir\n #pause(\"Manually select the button: \" + sButtonCaption + \"\\nThen dismiss this pause dialog\")\n end\n\n # Define the text on the control that AutoIt should select\n sControlID = \"Cancel\"\n\n # Dismiss the JS-Dialog\n puts2(\"Dismissing JS Confirmation dialog via the #{sControlID} button...\")\n browser.handle_win_dialog_generic_modal(sDialogTitle, sControlID)\n\n #\n # Do it again but dismiss the JS dialog by selecting the other button after entering some text\n #\n\n sButtonCaption = \"Display a Prompt\"\n puts2(\" Selecting button \\\"#{sButtonCaption}\\\" \")\n\n # Raise a JS-Prompt-Dialog\n #\n browser.button(:value, /#{sButtonCaption}/).click_no_wait\n #\n if(browser.is_firefox?)\n # Use this workaround until click_no_wait is fixed in firewatir\n #pause(\"Manually select the button: \" + sButtonCaption + \"\\nThen dismiss this pause dialog\")\n end\n\n sInputTextControlID=\"Edit1\"\n sInputText = random_sentence(5)\n\n # Define the text on the control that AutoIt should select\n sControlID = \"OK\"\n\n # Dismiss the JS-Dialog\n puts2(\"Dismissing JS Confirmation dialog via the #{sControlID} button...\")\n browser.handle_win_dialog_generic_modal(sDialogTitle, sControlID, sInputTextControlID, sInputText)\n\n rescue => e\n\n puts2(\"*** ERROR and Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\n\n # Raise the error with a custom message after the rest of the rescue actions\n raise(\"*** TESTCASE - test_JSDialog_003_Prompt\")\n\n ensure\n\n # Close the browser\n browser.close()\n\n end # Confirmation Dialog\n\n else\n puts2(\"*** Skipping - Non-Windows platform\")\n end # Only run on windows\n\n end", "def process_confirm_input\n print_confirm(true, true)\n @confirm_loop = true\n while @confirm_loop\n input = IO.input\n process_confirm_mouse_click input\n process_confirm_keyboard_input input[:key]\n end\n end", "def cancel_event?\n puts \"WARNING: Action can not be undone.\".colorize(:yellow)\n self.class.prompt.select(\"Are you sure you want to cancel this event?\") do |menu|\n menu.choice \"Yes\", -> {cancel_event_confirmed}\n menu.choice \"No\"\n end\n end", "def confirm!\n welcome_message\n super\n end", "def confirm!\n welcome_message\n super\n end", "def open_confirm_window(msg, options={})\n options[:width] ||= 200\n options[:modal] = true\n options[:title] ||= 'Confirm'\n options[:buttons] ||= {'OK' => 'function(){ jQuery(this).dialog(\"close\");}'}\n store_content(msg, 'confirmation_modal')\n self << \"\n if(jQuery('#confirmation_modal').size() == 0){\n jQuery('<div id=\\\"confirmation_modal\\\"></div>')\n .html(window_rails_contents['confirmation_modal'])\n .dialog(#{format_type_to_js(options)});\n } else {\n jQuery('#confirmation_modal')\n .html(window_rails_contents['confirmation_modal'])\n .dialog(#{format_type_to_js(options)}).focus();\n }\"\n nil\n end", "def confirm(prompt, default)\n default_str = default ? 'Y/n' : 'N/y'\n while true do\n begin\n response = readline('%s (%s) ' % [prompt, default_str])\n rescue EOFError\n return default\n end\n response = response.strip.downcase\n\n # We don't catch \"Yes, I'm sure\" or \"NO!\", but I leave that\n # as an exercise for the reader.\n break if YES_OR_NO.member?(response)\n msg \"Please answer 'yes' or 'no'. Try again.\"\n end\n return YES.member?(response)\n end", "def accept_browser_dialog\n wait = Selenium::WebDriver::Wait.new(:timeout => 10)\n wait.until {\n begin\n page.driver.browser.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end\n }\n page.driver.browser.switch_to.alert.accept\n sleep(1) # This is the issue: it looks like we need to wait some time (how much?) manually\nend", "def confirm # shortcut to add 'confirm:true' flag\n params[:flag_name] = 'confirm:true'\n flag\n end", "def confirm_quit\n connection.puts \"Are you sure you want to quit?\"\n if yes_entered?\n connection.close\n\n else\n @world.render\n end\n end", "def confirmation_required?\n false\n end", "def confirm(prompt)\r\n print \"#{prompt} \"\r\n yes = gets.downcase.strip[0] == 'y'\r\n puts 'Skipping.' if !yes\r\n yes\r\nend", "def confirm(question, default_value)\n yn_opts = default_value ? \"Y/n\" : \"y/N\"\n value = ask \"#{question} (#{yn_opts}) \", nil\n\n # Convert to true/false\n dummy_option = Configuration::Option.new({})\n value = dummy_option.convert(value)\n\n return default_value if value.nil? || value.kind_of?(String)\n value\n end", "def test_default\n w = Window_Confirmation.new(0,0,320,nil)\n @windows.push(w)\n return true\n end", "def confirm_order\n end", "def apphelp_confirm\n heading = apphelp_heading( controller, :delete, '' )\n heading << \"\\n\\n\" unless ( heading.empty? )\n\n return heading + apphelp_generic( :confirmation )\n end", "def app_admin_confirm\n end", "def approval_confirm\n @minimal_ui = true\n \n case params[:decision]\n when 'approve'\n render :confirm_approve\n when 'disapprove'\n render :confirm_disapprove\n else\n raise\n end\n end", "def accept_popup\n popup = browser.switch_to.alert\n popup.accept\n end", "def after_confirmation\n puts 'xxxxxxxx'\n end", "def ask_confirmation\n $stdout.print(\"This operation will uninstall following packages:\n docker,\n vagrant,\n libvirt-client,\n libvirt-dev,\nas well as all installed vagrant plugins and 'default' libvirt pool.\nAre you sure you want to continue? [y/N]: \")\n while (input = gets.strip)\n return true if input == 'y'\n return false if input == 'N'\n $stdout.print('Please enter one of the options [y/N]: ')\n end\n end", "def confirm(*args, &block)\n # `console.log(#{\"#{__FILE__}[#{__LINE__}]:#{self.class.name}##{__method__}\"})`\n bootbox_call(__method__, *args, &block)\n end", "def clean_pot\n refresh\n ConfirmationWindow.yes if click_on 'Clean'\n sleep 4\n end", "def send_confirmation_notification?\n false\n end", "def send_confirmation_notification?\n false\n end", "def confirmation_prompt_simple(message, add_options=true)\n # used to disable skip with ctrl+c\n trap(\"INT\", \"SIG_IGN\")\n message += \" (Y/n)\" if add_options\n\n while line = Readline.readline(\"#{message}: \", true)\n if (line.downcase.eql?(\"yes\") || line.downcase.eql?(\"y\") || line.empty?)\n trap(\"INT\",false)\n return true\n elsif (line.downcase.eql?(\"no\") || line.downcase.eql?(\"n\"))\n trap(\"INT\",false)\n return false\n end\n end\n end", "def process_confirm_keyboard_input(key)\n case key\n when :enter then print_confirm(@res, false)\n when :Y, :y then print_confirm(true, false)\n when :N, :n then print_confirm(false, false)\n when :tab, :down, :left, :space, :up, :right then print_confirm(!@res, true)\n end\n end", "def ask_yes_no(question, default = nil)\n ui.ask_yes_no question, default\n end", "def confirm(message)\n begin\n unless(consumer.confirm(message[:message]))\n error \"Failed to confirm payload from source! (#{e})\"\n false\n else\n true\n end\n rescue Krakow::Error::LookupFailed => e\n error \"Failed to confirm payload from source! (#{e})\"\n false\n end\n end", "def confirm_js_operation\n assert Capybara.current_driver, :selenium # default javascript driver\n visit root_path\n alert = page.driver.browser.switch_to.alert\n assert alert.text, 'welcome#index'\n end", "def seat_popup_ok\n get_elem_and_click(:xpath, \"//*[contains(text(), 'Ok, thanks')]\")\n end" ]
[ "0.76433855", "0.74781847", "0.7227953", "0.7113574", "0.7058949", "0.7055892", "0.70246726", "0.68944895", "0.67951393", "0.676039", "0.676039", "0.67318195", "0.6710915", "0.6700826", "0.6696433", "0.66524863", "0.66421974", "0.66277665", "0.65891874", "0.65615475", "0.6547435", "0.65355724", "0.651639", "0.65089244", "0.6453475", "0.6431553", "0.6424977", "0.63818526", "0.63530856", "0.6300906", "0.62831736", "0.62616885", "0.62439895", "0.62271327", "0.62172234", "0.6216661", "0.6173521", "0.6151711", "0.61403257", "0.61206245", "0.6115824", "0.6044671", "0.60402966", "0.6009184", "0.60044587", "0.6001447", "0.59952706", "0.59808254", "0.5977443", "0.5947184", "0.594441", "0.5944147", "0.59333694", "0.5926634", "0.5914625", "0.59119844", "0.5910015", "0.5905511", "0.5898559", "0.5890021", "0.5885503", "0.58771163", "0.5868471", "0.5868471", "0.5868471", "0.5868471", "0.5868471", "0.5866915", "0.5861878", "0.5860636", "0.5849955", "0.5848144", "0.5848144", "0.58321625", "0.5831497", "0.5824191", "0.5823009", "0.5816109", "0.58046556", "0.5803508", "0.5791006", "0.5773131", "0.5765764", "0.57644284", "0.5759926", "0.5758465", "0.57453537", "0.5733289", "0.57315534", "0.57152677", "0.5695563", "0.5684398", "0.5684398", "0.5677548", "0.56690997", "0.5668052", "0.5661474", "0.5655388", "0.56548214" ]
0.58997667
59
Instructs Selenium to return the specified answer string in response to the next JavaScript prompt (window.prompt()).
def answer_on_next_prompt answer command 'answerOnNextPrompt', answer end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def answer_prompt(answer)\n\tputs \"The answer to your problem is: #{answer}\"\nend", "def prompt(prompt_string = \"?\", default = \"\")\n print \"#{prompt_string} (#{default}) \"\n response = gets\n response.chomp!\n return response == \"\" ? default : response\n end", "def prompt(question, default: nil)\n answer = ask(question) \n answer.empty? ? default : answer\nend", "def element_prompt step\n step.attended=true\n step.cmd=Patir::RubyCommand.new(\"prompt\") do |cmd| \n cmd.output=\"\"\n cmd.error=\"\"\n if HighLine.new.agree(\"#{step.text}\")\n step.output=\"y\"\n else\n raise \"n\"\n end#if\n end#do rubycommand\n return step\n end", "def query_ask\n # NOTE: The trailing space at the end of the ask() parameter\n # obliquely instructs HighLine to remain on the prompt line when\n # gathering user input. If the String did not end with a space\n # or tab, HighLine would move to the next line (which, for our\n # purposes, looks confusing).\n\n# FIXME: When the more-intelligible, string color methods are\n# used here instead of the ERB template, the unit tests that examine\n# HighLine output fail because of missing <CR>s that are not in the\n# output StringIO, even though they appear in the console output, when\n# run manually.\n# value = ask( \"#{query_prompt.white.bold}: \",\n#\n # gsub is to escape any single quotes in the prompt\n value = ask( \"<%= color('#{query_prompt.gsub(\"'\",\"\\\\\\\\'\")}', WHITE, BOLD) %>: \",\n highline_question_type ) do |q|\n q.default = default_value unless default_value.to_s.empty?\n\n # validate input via the validate() method\n q.validate = lambda{ |x| validate( x )}\n\n # do this before constructing reply to invalid response, to allow\n # any specializations to q parameters to be made (e.g., q.default)\n query_extras q\n\n # if the answer is not valid, construct a reply:\n q.responses[:not_valid] = 'Invalid answer!'.red + \"\\n\"\n err_msg = not_valid_message || description\n q.responses[:not_valid] += \"#{err_msg}\".red\n q.responses[:ask_on_error] = :question\n q\n end\n value\n end", "def obtain(prompt, default = '')\n Settings.console.ask \"#{prompt}: \" do |answer|\n answer.default = default\n end\n end", "def prompt(text, prompt_symbol = \">>\")\n print \"#{text} #{prompt_symbol} \"\n STDOUT.flush\n @last_response = gets\nend", "def prompt(question)\n puts question\n gets.chomp\nend", "def set_prompt(string)\n @prompt = string\n end", "def ask(prompt, echo = T.unsafe(nil)); end", "def prompt(mess) # prompt for all questions\n puts \"==> #{mess}\"\nend", "def prompt msg, val=\"\"\n document.get_default_view.prompt(msg, val)\n end", "def ask(question, default='')\n question = \"\\n\" + question.join(\"\\n\") if question.respond_to?(:uniq)\n answer = Capistrano::CLI.ui.ask(space(question)).strip\n answer.empty? ? default : answer\n end", "def ask(question, default='')\n question = \"\\n\" + question.join(\"\\n\") if question.respond_to?(:uniq)\n answer = Capistrano::CLI.ui.ask(space(question)).strip\n answer.empty? ? default : answer\n end", "def test_method\n prompt(\"test message\")\nend", "def ask(question, expected_answer)\n answer = ''\n until answer.match?(expected_answer)\n answer = Readline.readline(question, true)\n end\n\n answer\n end", "def test_JSDialog_003_Prompt\n\n puts2(\"\")\n puts2(\"###############################\")\n puts2(\"# BEGIN: test_JSDialog_003_Prompt #\")\n puts2(\"###############################\")\n\n # Only run if NOT using Watir-WebDriver\n if(is_webdriver? == true)\n puts2(\"Not supported with WebDriver\")\n return\n end\n\n # Only run on windows\n if(is_win?() == true)\n\n # Text on the buttons to select\n sButtonCaption = \"Display a Prompt\"\n\n # Define components of the URL\n sProtocol = \"file:///\"\n sRootURL =Dir.pwd\n sPage = \"data/html/jsdialogs.html\"\n\n # Construct the URL\n sURL = sProtocol + sRootURL + \"/\" + sPage\n\n begin # Prompt Dialog\n\n # Start a browser,\n #browser = Watir::Browser.new\n browser = start_browser($sDefaultBrowser)\n\n # Load a blank page (Workaround for issues with click_no_wait)\n browser.goto(\"about:blank\")\n\n # Load the page\n browser.goto(sURL)\n\n if(browser.is_ie?)\n sDialogTitle = \"Explorer User Prompt\"\n elsif(browser.is_firefox?)\n sDialogTitle = \"[JavaScript Application]\"\n end\n\n puts2(\" Selecting button \\\"#{sButtonCaption}\\\" \")\n\n # Raise a popup JS Dialog by using the method - click_no_wait\n browser.button(:value, /#{sButtonCaption}/).click_no_wait\n #\n if(browser.is_firefox?)\n # Use this workaround until click_no_wait is fixed in firewatir\n #pause(\"Manually select the button: \" + sButtonCaption + \"\\nThen dismiss this pause dialog\")\n end\n\n # Define the text on the control that AutoIt should select\n sControlID = \"Cancel\"\n\n # Dismiss the JS-Dialog\n puts2(\"Dismissing JS Confirmation dialog via the #{sControlID} button...\")\n browser.handle_win_dialog_generic_modal(sDialogTitle, sControlID)\n\n #\n # Do it again but dismiss the JS dialog by selecting the other button after entering some text\n #\n\n sButtonCaption = \"Display a Prompt\"\n puts2(\" Selecting button \\\"#{sButtonCaption}\\\" \")\n\n # Raise a JS-Prompt-Dialog\n #\n browser.button(:value, /#{sButtonCaption}/).click_no_wait\n #\n if(browser.is_firefox?)\n # Use this workaround until click_no_wait is fixed in firewatir\n #pause(\"Manually select the button: \" + sButtonCaption + \"\\nThen dismiss this pause dialog\")\n end\n\n sInputTextControlID=\"Edit1\"\n sInputText = random_sentence(5)\n\n # Define the text on the control that AutoIt should select\n sControlID = \"OK\"\n\n # Dismiss the JS-Dialog\n puts2(\"Dismissing JS Confirmation dialog via the #{sControlID} button...\")\n browser.handle_win_dialog_generic_modal(sDialogTitle, sControlID, sInputTextControlID, sInputText)\n\n rescue => e\n\n puts2(\"*** ERROR and Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\n\n # Raise the error with a custom message after the rest of the rescue actions\n raise(\"*** TESTCASE - test_JSDialog_003_Prompt\")\n\n ensure\n\n # Close the browser\n browser.close()\n\n end # Confirmation Dialog\n\n else\n puts2(\"*** Skipping - Non-Windows platform\")\n end # Only run on windows\n\n end", "def ask(question)\n answer = 'n'\n answer = 'y' if agree(\"#{question} (y/n) \")\n answer\n end", "def prompt(str=\"#{@name}> \")\n @client.prompt(str)\n end", "def prompt; end", "def prompt; end", "def prompt; end", "def prompt; end", "def pcr_prompt\n puts \"\\n***************For the following questions, Please provide which test you have receieved.***********************************\"\n puts \"\\n\\nDid you receive a PCR swab test? Please type 'yes' or 'no'. (For informaiton about PCR or other testing types, please visit https://www.cdc.gov/coronavirus/2019-ncov/lab/testing.html\"\n pcr_response = gets.strip.downcase\n return_to_menu(pcr_response)\n exit_anything(pcr_response)\n if pcr_response == \"yes\"\n pcr_test = true\n elsif pcr_response == \"no\"\n pcr_test = false\n else puts \"\\nDid you mean to hit 'yes', 'no', 'menu', or 'exit'?\"\n pcr_prompt\n end\n pcr_test\nend", "def prompt\n puts\"=>\"\n gets.chomp\nend", "def prompt(string)\n puts \"==> #{string}\"\nend", "def ask(question)\n ui.ask question\n end", "def prompt_text(form, answer, hint)\n form.text_field :answer, :class => 'form-control input-lg', :placeholder => hint\n end", "def confirm(prompt)\n return true if config[:yes]\n valid_responses = %w[yes no y n]\n response = nil\n 3.times do\n response = ui.ask(prompt).downcase\n break if valid_responses.include? response\n ui.warn \"Valid responses are #{valid_responses}\"\n end\n response.match(/^y/)\n end", "def prompt_with_default( prompt_string, default, failure_msg=\"Try again.\" )\n\t\t\tresponse = nil\n\n\t\t\tbegin\n\t\t\t\tdefault ||= '~'\n\t\t\t\tresponse = prompt( \"%s [%s]\" % [ prompt_string, default ] )\n\t\t\t\tresponse = default.to_s if !response.nil? && response.empty?\n\n\t\t\t\ttrace \"Validating response %p\" % [ response ]\n\n\t\t\t\t# the block is a validator.\t We need to make sure that the user didn't\n\t\t\t\t# enter '~', because if they did, it's nil and we should move on.\t If\n\t\t\t\t# they didn't, then call the block.\n\t\t\t\tif block_given? && response != '~' && ! yield( response )\n\t\t\t\t\terror_message( failure_msg + \"\\n\\n\" )\n\t\t\t\t\tresponse = nil\n\t\t\t\tend\n\t\t\tend while response.nil?\n\n\t\t\treturn nil if response == '~'\n\t\t\treturn response\n\t\tend", "def query_ask\n # NOTE: This trailing space at the end of the String obliquely instructs\n # Highline to keep the prompt on the same line as the question. If the\n # String did not end with a space or tab, Highline would move the input\n # prompt to the next line (which, for our purposes, looks confusing)\n value = ask( \"<%= color('#{@key}', WHITE, BOLD) %>: \",\n highline_question_type ) do |q|\n q.default = default_value unless default_value.to_s.empty?\n\n # validate input via the validate() method\n q.validate = lambda{ |x| validate( x )}\n\n # if the answer is not valid, construct a reply:\n q.responses[:not_valid] = \"<%= color( %q{Invalid answer!}, RED ) %>\\n\"\n q.responses[:not_valid] += \"<%= color( %q{#{ (not_valid_message || description) }}, YELLOW) %>\\n\"\n q.responses[:not_valid] += \"#{q.question} |#{q.default}|\"\n\n query_extras q\n end\n value\n end", "def ask_for_password(prompt)\n ui.ask_for_password prompt\n end", "def ask_with_default(question, default='')\n user_answer = ask(\"#{question} (default: #{default.to_s})\").strip\n user_answer.empty? ? default : user_answer\nend", "def ask_question(question)\n\tprint question\n\t\n\tgets.chomp # what gets returned from the function\nend", "def prompt(message)\n\tprint message\n\tgets.chomp #Implicit Return\nend", "def prompt(message)\n\tprint messaage\n\tgets.chomp # implicit return\nend", "def ask_question(question, options)\n say nil, \"*\" * 50\n say nil, question\n say nil, \"Options: #{options}\"\n gets.chomp.downcase # canonicalization\n end", "def prompt_user(message)\n \"no\"\n end", "def ask(question, default: nil, **opts)\n CLI::UI.ask(question, default: default, **opts)\n end", "def confirm(prompt); end", "def send_command_prompt\n send_data options[:command_prompt]\n end", "def ask(question, answer_type = String, non_interactive_value = nil, &continuation)\n if interactive?\n interaction_highline.ask(question, answer_type, &continuation)\n else\n nil\n end\n end", "def prompt(key, prompt_text, **options, &block)\n answer = Answer.new\n answer.instance_eval(&block)\n\n help = help(**options)\n prompt = \"<bold>#{prompt_text}</bold>#{\" (#{help})\" if help}: \".colourise\n @data[key] = answer.run(@block.call(prompt))\n raise InvalidResponse if @data[key].nil? && options[:required]\n @data[key]\n rescue InvalidResponse => error\n puts \"<red>Invalid response</red> (#{error.message}), try again.\".colourise\n retry\n end", "def prompt(text)\n Kernel.puts(\"=> #{text}\")\nend", "def askPassword(prompt=\"Enter Password : \")\n ask(prompt) {|q| q.echo = false}\nend", "def prompting(v = true)\n @at_prompt = v\n end", "def continue_prompt\n puts \"Do you wish to continue?\"\n response = gets.chomp\n response.downcase\nend", "def promptAndGet(prompt)\n print prompt\n res = readline.chomp\n throw :quitRequested if res == \"!\"\n return res\nend", "def ask(prompt, echo = true)\n $stdout.print(prompt)\n $stdout.flush\n ret = $stdin.noecho(&:gets).chomp\n $stdout.print(\"\\n\")\n ret\n end", "def prompt_for_guess\n puts (\"1. Enter a vowel.\")\n\tputs (\"2. Enter a consonant.\")\n\tputs (\"3. Guess the entire word.\")\n\tputs (\"(Enter your letter choice now. If you enter more than a letter than its your own fault.)\")\n end", "def get_response(prompt)\n print prompt\n $stdout.flush\n gets\nend", "def promptAndGet(prompt)\n print prompt\n res = readline.chomp\n throw :quitRequested if res == '!'\n return res\nend", "def prompt(text)\n puts \"==> #{text}\"\nend", "def prompt (message)\r\n puts \"==> #{message}\"\r\nend", "def ask( prompt )\n print prompt\n gets.chomp\nend", "def prompt(output, err, options = nil)\n\t\t@return = \"\"\n\t\tif options.nil?\n\t\t\twhile @return.empty?\n\t\t\t\tputs output\n\t\t\t\tprint \">> \"\n\t\t\t\t@return = gets.chomp\n\t\t\t\tif @return.empty?\n\t\t\t\t\tputs err\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\t@selected_option = nil\n\t\t\tuntil (1..options.length).include?(@selected_option)\n\t\t\t\tputs output\n\t\t\t\tputs options\n\t\t\t\tprint \">> \"\n\t\t\t\t@selected_option = gets.chomp.to_i\n\t\t\tend\n\t\t\treturn true\n\t\tend\n\t\treturn @return\n\tend", "def prompt(message)\n Kernel.puts(message.to_s)\nend", "def ask_question\n\n end", "def test_method\n prompt('test method')\nend", "def prompt(string)\n puts \"=> #{string}\"\n gets.chomp\nend", "def promptAndGet(prompt)\n print prompt\n res = readline.chomp\n throw :quitRequested if res == \"!\"\n return res\nend", "def prompt_function\n puts \"Add, subtract, multiply, divide?\"\n return gets.chomp.downcase #returns answer to above Q for: def prompt\nend", "def prompt(message, valid_options)\n if valid_options\n answer = get_stdin(\"#{message} #{valid_options.to_s.gsub(/\"/, '').gsub(/, /,'/')} \") while !valid_options.include?(answer)\n else\n answer = get_stdin(message)\n end\n answer\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def prompt(message)\r\n puts \"=> #{message}\"\r\nend", "def ask_for_selection(question, opts={}, &block)\n res = nil\n while res.to_s.empty?\n print \"\\e[1;32m#{question}\\e[m:\"\n if opts[:prompt] and opts[:prompt].is_a? Array and not opts[:prompt].empty?\n puts; puts\n opts[:prompt].each.with_index do |o, i|\n puts \"\\t[ #{i} ] #{o}\"\n end\n puts; print \"\\e[1;33mYour choice is [\\e[m#{opts[:default]}\\e[1;33m]:\\e[m \"\n end\n begin\n res = STDIN.gets.chomp\n res = opts[:default] if res.empty? and opts[:default]\n rescue Interrupt\n puts; puts; puts \"Canceled, bye.\"\n exit\n end\n res = res.split.map(&:to_i).compact if res.is_a? String\n res = nil if res.is_a? Array and res.any?{|i| i.to_i >= opts[:prompt].size}\n res = nil if block_given? and ! yield res\n res = res.first if res.is_a? Array and res.size == 1\n print \"\\e[31mInvalid Selection, please re-enter.\\e[m\\n\\n\" unless res\n end\n if res\n return ( opts[:output_value] ? res.map{|i| opts[:prompt][i] } : res )\n end\n nil\nend", "def prompt( message )\n\tprint message\n\tgets.chomp\nend", "def update_prompt(jqconsole)\n jqconsole.SetPromptText(new_prompt_text) if new_prompt?\n end", "def prompt(str)\n puts \"=> #{str}\"\nend", "def prompt\n\tputs \"Any Key to continue\"\n\tgets\nend", "def prompt(msg, default)\n result = nil\n while not result\n display(msg)\n result = gets.strip\n if result.downcase == \"q\"\n throw :quit\n elsif result.downcase == \"i\"\n result = nil\n instructions\n elsif result.downcase == \"m\"\n display(\"Statistics can only be shown during a round!\")\n elsif result == \"\"\n return default.to_s\n else \n return result \n end\n end\n return result\n end", "def prompt\n gets.strip\nend", "def ask_user(question, default = nil, answers = nil, force = false)\n ans = \" (#{answers.join(' / ')})\" unless answers.nil?\n dft = \" [#{default}]\" unless default.nil?\n print \"#{question}#{ans}#{dft} > \"\n if self[:auto] && !force\n puts ''\n else\n y = gets.chomp\n end\n y = default.to_s if y.nil? or y.empty?\n unless answers.nil? or answers.map(&:to_s).include?(y)\n warn \"Answer not recognized: '#{y}'\"\n return ask_user(question, default, answers, force)\n end\n y\n end", "def prompt_action \n puts \"You have six options: list users, list channels, select user, select channel, display details, send message, or quit.\"\n puts \"\\n\"\n print \"Please enter your choice: \"\n return gets.chomp.downcase\nend", "def ask_the_question(question, valid_response)\n loop do\n answer = ask(question + \"? [Y/N] \") { |yn| yn.limit = 1, yn.validate = /[yn]/i }\n return answer if answer.downcase == valid_response.downcase || valid_response == ''\n end\nend", "def chut\n IRB.conf[:PROMPT][ IRB.conf[:PROMPT_MODE] ][:RETURN].replace('')\nend", "def prompt(message)\r\n Kernel.puts(\"=> #{message}\")\r\nend", "def prompt( prompt_string, failure_msg=\"Try again.\" ) # :yields: response\n\t\t\tprompt_string.chomp!\n\t\t\tprompt_string << \":\" unless /\\W$/.match( prompt_string )\n\t\t\tresponse = nil\n\n\t\t\tbegin\n\t\t\t\tprompt = make_prompt_string( prompt_string )\n\t\t\t\tresponse = readline( prompt ) || ''\n\t\t\t\tresponse.strip!\n\t\t\t\tif block_given? && ! yield( response )\n\t\t\t\t\terror_message( failure_msg + \"\\n\\n\" )\n\t\t\t\t\tresponse = nil\n\t\t\t\tend\n\t\t\tend while response.nil?\n\n\t\t\treturn response\n\t\tend", "def prompt(message)\n\tprint message\n\tgets.chomp\nend", "def prompt(message)\n puts(\"#{message}\")\nend", "def format_prompt(result)\n @result_prompt\n end", "def ask_question\n puts \"#{@current_player.name} what is the answer to: #{@a} #{@operator} #{@b} = ?\"\n end", "def prompt(message)\n\tKernel.puts \"=> #{message}\"\nend", "def prompt(message)\n print message\n gets.chomp\nend", "def asks_question(question)\n puts question\n gets.chomp\nend", "def print_prompt_for_spoken_question\n puts \"-----------------------------------------------------------------\"\n puts \"Ask a YES/NO question aloud for the MAGIC 8-BALL and press enter \"\n puts \"\\n [[ SPEAK HERE ]] \\n\\n\"\n puts \"-----------------------------------------------------------------\"\nend", "def ask_question(question, options)\n\tputs question, options\n\tgets.chomp.downcase\nend", "def prompt(message)\r\n puts(\"=> #{message}\")\r\nend", "def answer(question)\n puts question\n answer = gets.chomp\nend", "def prompt(message)\n puts \"=> #{message}\"\nend", "def prompt(message=\"Are you sure?\", options=\"Yn\")\n opts = options.scan(/./)\n optstring = opts.join(\"/\") # case maintained\n defaults = opts.select{|o| o.upcase == o }\n opts = opts.map{|o| o.downcase}\n\n raise \"Error: Too many default values for the prompt: #{default.inspect}\" if defaults.size > 1\n\n default = defaults.first\n\n loop do\n\n print \"#{message} (#{optstring}) \"\n\n response = STDIN.gets.strip.downcase\n\n case response\n when *opts\n return response\n when \"\"\n return default.downcase\n else\n puts \" |_ Invalid option: #{response.inspect}. Try again.\"\n end\n\n end\nend", "def prompt(message=\"Are you sure?\", options=\"Yn\")\n opts = options.scan(/./)\n optstring = opts.join(\"/\") # case maintained\n defaults = opts.select{|o| o.upcase == o }\n opts = opts.map{|o| o.downcase}\n\n raise \"Error: Too many default values for the prompt: #{default.inspect}\" if defaults.size > 1\n\n default = defaults.first\n\n loop do\n\n print \"#{message} (#{optstring}) \"\n\n response = STDIN.gets.strip.downcase\n\n case response\n when *opts\n return response\n when \"\"\n return default.downcase\n else\n puts \" |_ Invalid option: #{response.inspect}. Try again.\"\n end\n\n end\nend", "def continue_prompt\n puts \"\\nWould you like to explore more?\"\n puts \"Yes/No\"\n input = gets.strip.downcase\n if input == \"n\" || input == \"no\" || input == \"exit\"\n goodbye\n else\n system(\"clear\")\n initial_prompt\n end\n end", "def confirm(prompt, default)\n default_str = default ? 'Y/n' : 'N/y'\n while true do\n begin\n response = readline('%s (%s) ' % [prompt, default_str])\n rescue EOFError\n return default\n end\n response = response.strip.downcase\n\n # We don't catch \"Yes, I'm sure\" or \"NO!\", but I leave that\n # as an exercise for the reader.\n break if YES_OR_NO.member?(response)\n msg \"Please answer 'yes' or 'no'. Try again.\"\n end\n return YES.member?(response)\n end", "def prompt(message)\n puts \"=> #{message}\"\n end", "def get_answer_to(question)\n puts question\n answer = gets.chomp\nend" ]
[ "0.7306606", "0.69295007", "0.6752206", "0.66363007", "0.6631393", "0.6617939", "0.66150963", "0.65574247", "0.65348", "0.65162057", "0.64809555", "0.6406424", "0.6394429", "0.6394429", "0.63883054", "0.63582027", "0.6341132", "0.6336194", "0.6333684", "0.6318423", "0.6318423", "0.6318423", "0.6318423", "0.6301473", "0.62968534", "0.6290272", "0.6289996", "0.628918", "0.62842065", "0.62840974", "0.62778914", "0.6258458", "0.6247896", "0.6245143", "0.6243415", "0.6233735", "0.6227062", "0.62260646", "0.6216062", "0.6202747", "0.6202403", "0.6199915", "0.61944467", "0.6189813", "0.6182958", "0.6182823", "0.6177763", "0.61748934", "0.6161014", "0.6159753", "0.6155869", "0.6152381", "0.61445516", "0.61413425", "0.61401296", "0.6138064", "0.61346155", "0.6132422", "0.61315644", "0.6130501", "0.61270314", "0.6126878", "0.6124102", "0.6119785", "0.6119785", "0.6119785", "0.6119785", "0.6119785", "0.6111209", "0.61091495", "0.61048806", "0.6102952", "0.6099997", "0.6099737", "0.60997015", "0.6099317", "0.6097344", "0.60942596", "0.6090859", "0.60851985", "0.6082123", "0.6081924", "0.6076269", "0.60762155", "0.60737616", "0.6068771", "0.6062906", "0.6058164", "0.6052776", "0.6051", "0.60508657", "0.60495037", "0.6047546", "0.60435206", "0.60435206", "0.6037219", "0.6036491", "0.6035169", "0.60348284" ]
0.70795363
2
Simulates the user clicking the "back" button on their browser.
def go_back command 'goBack' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_back\n @browser.back\n end", "def back\r\n @browser.navigate.back\r\n end", "def back\n fetch(\"window.history.go(-1)\")\n\n end", "def go_back\n begin\n @driver.back\n\n rescue Exception => e\n @@logger.an_event.error \"browser go back : #{e.message}\"\n raise Errors::Error.new(BROWSER_NOT_GO_BACK, :values => {:browser => name}, :error => e)\n\n else\n\n @@logger.an_event.debug \"browser go back\"\n\n ensure\n\n end\n end", "def back\n @driver.navigate.back\n @after_hooks.run\n end", "def back\n driver.navigate.back\n end", "def back\n driver.navigate.back\n end", "def back()\r\n #set_browser_document()\r\n $jssh_socket.send(\"if(#{BROWSER_VAR}.canGoBack) #{BROWSER_VAR}.goBack();\\n\", 0)\r\n read_socket();\r\n wait()\r\n end", "def click_on_back_button\n\n click_button BACK_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def back\n navigate.back\n end", "def back\n navigate.back\n end", "def back\n navigate.back\n end", "def back\n $LOG.info \"Browser navigating backward\"\n begin\n $driver.navigate.back\n rescue Exception => e\n $LOG.error \"Browser navigating backward error \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Browser navigating backward error \\n Error Message :: \"+e.message\n end\n end", "def back\n history_navigate(delta: -1)\n end", "def goBack(sender)\n web_view.goBack\n end", "def goto_previous_page(browser_handle)\n browser_handle.back\nend", "def back\n fetch(\"_sahi.go_back()\")\n end", "def go_back\n back\n wait { find_ele_by_predicate_include(class_name: ui_ios.navbar, value: 'UICatalog') }\n end", "def back\n @agent.history.pop\n end", "def go_back\n back\n wait { !exists { id 'ArrowButton' } } # successfully transitioned back\n end", "def go_back\n back\n wait { !exists { id 'ArrowButton' } } # successfully transitioned back\n end", "def go_back_and_wait\n selenium.go_back\n wait_for_page_to_load\n end", "def link_back(text = t(\"common.link_back\"))\n link_to_function text, \"self.history.back();\", :class => 'back'\n end", "def link_to_back\n link_to \"Back\", session[:prev_page]\n end", "def link_to_back\n link_to 'back', :back if request.env['HTTP_REFERER'].present?\n end", "def back(number = 1)\n `History.go(-number)`\n end", "def go_back_and_wait\n go_back\n assert_page_loaded\n end", "def back_click\n back\nend", "def redirect_back\n send_to = session[:return_to]\n session[:return_to] = nil\n redirect_to(send_to || root_path)\n end", "def interactive_history_back e\n if not @history.at_beginning\n store_in_history\n @history.back\n restore_from_history\n end\n end", "def back(sender)\n self.navigationController.popViewControllerAnimated(true)\n end", "def lp_back_button\n find_element(:xpath, \"//UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAButton[1]\")\n end", "def test_on_back_requests\n controller = new_controller\n go_back controller, '/path1'\n assert_equal nil, controller.session['previous_paths']\n end", "def back_button_should_not_be_displayed\n\n page.should_not have_button(BACK_BUTTON)\n sleep(THREAD_SLEEP_1)\n\n end", "def back\n return root_path unless request.env['HTTP_REFERER']\n :back\n end", "def redirect_back \n\t\tredirect_to request.env['HTTP_REFERER']\n\tend", "def go_forward\n @browser.forward\n end", "def check_if_back_button_is_displayed\n\n page.should have_button(BACK_BUTTON)\n sleep(THREAD_SLEEP_1)\n\n end", "def go_back\n redirect_to '/account/property-syndication'\n end", "def link_to_back(text, path, options={})\n link_to_action(text, path, options.reverse_merge(:action => :back))\n end", "def previous_page\n @current_page = @agent.page.links.find { |l| l.text == \"← Previous\" }.click\n rescue\n nil\n end", "def redirect_back_to\n if !session[:return_to].blank?\n redirect_to session[:return_to]\n session[:return_to] = nil\n end\n end", "def back(number = 1)\n `#@native.go(-number)`\n end", "def do_back\n update_screen(get_step_content(@step - 1, @editor.value, @output.value))\n end", "def redirect_back(params)\n begin\n redirect_to :back, params\n rescue ActionController::RedirectBackError\n redirect_to root_url, params\n end\n end", "def go_to_agencies\n if params[:back]\n session[:back] = true\n else\n session[:back] = false\n redirect_to agencies_url(:clear=>true)\n end\n end", "def back_url\n @back_marked ? session[:back_url] : session[:prev_url]\n end", "def page_back_button_path\n registered_applications_path\n end", "def go_home\n wait_for_home_button\n home_button.click\n end", "def determinate_back_link_url\n if history.nil? || history.size == 1\n default_url\n else\n \"#{url}?page=#{session.dig(:back_link_history, previous_step)}?back=true\"\n end\n end", "def previous_page!\n return unless previous_page?\n @page -= 1\n clear!\n end", "def redirect_back(*params)\n url = session[:return_to]\n clear_return_point\n default_url ||= params.shift\n except_url = params.delete(:except_url)\n if (url.blank? || (except_url && match_url?(url, url_for(except_url))))\n url = default_url\n end\n redirect_to(url, *params)\n end", "def redirect_to_back(default = root_url)\n if request.env[\"HTTP_REFERER\"].present? and request.env[\"HTTP_REFERER\"] != request.env[\"REQUEST_URI\"]\n redirect_to :back\n else\n redirect_to default\n end\n end", "def previous_page\n end", "def redirect_back\n RedirectBack.new self\n end", "def redirect_to_back(default_url = root_path)\n redirect_back(fallback_location: default_url)\n end", "def navigate_back_to(window, presenter)\n until window.presenter_stack.last == presenter\n window.presenter_stack.pop\n window.presenter_state_stack.pop\n end\nend", "def go_back_after(&block)\n @page_stack ? @page_stack.push(current_path) : @page_stack = [current_path]\n yield(block)\n visit(@page_stack.pop)\n end", "def _back_url\n _filtered_referrer || \"javascript:history.back()\"\n end", "def forward\n driver.navigate.forward\n end", "def forward\n driver.navigate.forward\n end", "def navigate(direction)\n if direction==\"back\"\n\t $driver.navigate.back\n else\n $driver.navigate.forward\n end\nend", "def redirect_back(default)\n redirect_to(session[:forward_url] || default)\n session.delete(:forward_url)\n end", "def reset_browser\n # clear cookies\n Testing.browser.cookies.clear\n\n # open homepage\n unless Testing.browser.url == \"#{Testing.base_url}/\"\n Testing.browser.goto(Testing.base_url)\n end\n\n Testing.browser\n end", "def previous__clicked(*argv)\t\t\t\t\n\t\tif @@page == 0 \n\t\telse\n\t\t\t@@page = @@page - 8\n\t\t\tdestroy_window()\n\t\t\tif @@load_favs == 0\t\n\t\t\t\tshow()\n\t\t\telse\n\t\t\t\tshow_favs()\n\t\t\tend\n\t\tend \n\tend", "def go_to_last_page\n to_last_page.click\n end", "def render_back_link\n # Dont render back link if the back url is the same as the current page\n return if back_url == request.url\n\n if back_url && back_label\n link_to \"&laquo; Back to '#{back_label}'\", back_url, :id => 'back_link'\n end\n end", "def prev\n goto(@current_page - 1)\n end", "def redirect_back_or(path)\n redirect_to :back\n rescue ActionController::RedirectBackError\n redirect_to path\n end", "def back_button(path:, name: :BACK.t, **args, &block)\n content = block ? capture(&block) : \"\"\n html_options = {\n class: \"\", # usually also btn\n data: { toggle: \"tooltip\", placement: \"top\", title: name }\n }.merge(args)\n\n link_to(path, html_options) do\n [content, link_icon(:back)].safe_join\n end\n end", "def test_when_going_backwards\n controller = new_controller\n trail controller, ['/path1', '/path2', '/path3']\n go_back controller, '/path2'\n\n assert_equal '/path1', controller.previous_path\n assert_equal 1, controller.session['previous_paths'].length\n end", "def redirect_back_or(path)\nredirect_to :back\nrescue ActionController::RedirectBackError\nredirect_to path\nend", "def test_link_back(link, parent_title, expected_title, lowercase = false, timeout = 5, dont_scroll = false)\n $logger.info(\"Link for \" + expected_title)\n wait = Selenium::WebDriver::Wait.new(timeout: timeout)\n\n if !dont_scroll\n js_scroll_up(link,true)\n end\n wait.until { link.displayed? }\n link.click\n begin\n if lowercase\n wait.until { $test_driver.title.downcase.include? expected_title }\n else\n wait.until { $test_driver.title.include? expected_title }\n end\n rescue Selenium::WebDriver::Error::TimeOutError\n fail(\"Error loading page \" + expected_title)\n end\n #Go back; some browsers have problems navigating back the first time\n num_retry = 0\n begin\n $test_driver.navigate.back\n wait.until { $test_driver.title.include? parent_title }\n rescue Selenium::WebDriver::Error::TimeOutError\n num_retry += 1\n retry if num_retry == 1\n fail(\"Error navigating back from \" + expected_title)\n end\nend", "def previous_page; end", "def redirect_back\n super(fallback_location: root_path)\n end", "def return_to_home_page(_browser = @browser)\n Log.logger.debug(\"Returning Home Page\")\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n wait.until { _browser.find_element(:xpath => @galmgr.home) }.click\n end", "def redirect_back(*params)\n uri = session[:original_uri]\n session[:original_uri] = nil\n if uri\n redirect_to uri\n else\n redirect_to(*params)\n end\nend", "def redirect_back_or(default = root_path)\n redirect_to(session[:return_to] || default)\n clear_return_to\n end", "def redirect_back(msg)\n flash[:notice] = msg unless msg.nil?\n if session[:prevpage].nil?\n redirect_to :action => 'index'\n else\n redirect_to session[:prevpage]\n end\n end", "def save_previous_page\n session[:return_to] = request.fullpath\n end", "def index\n redirect_to :back\n rescue ActionController::RedirectBackError\n redirect_to root_path\n end", "def navigate(direction)\n if direction == 'back'\n\t $driver.navigate.back\n else\n $driver.navigate.forward\n end\nend", "def redirect_back\n if request.referer && request.referer.include?(\"http://#{request.host}\")\n request.referer\n else\n url(:root)\n end\n end", "def previous__clicked(*argv)\t\t\t\t\n\t\tif @@page == 0 \n\t\telse\n\t\t\t@@page = @@page - 8\n\t\t\trefresh_links()\n\t\t\tif @@load_favs != 0\t\n\t\t\t\tshow_favs()\n\t\t\tend\n\t\tend \n\tend", "def redirect_back_or_to(url)\n if session[:return_url]\n redirect_to session[:return_url]\n session[:return_url] = nil\n else\n redirect_to url\n end\n end", "def cancel_and_redirect\r\n redirect_back\r\n end", "def redirect_back(*params)\n uri = session[:original_uri]\n session[:original_uri] = nil\n if uri\n redirect_to uri\n else\n redirect_to(*params)\n end\n end", "def redirect_back(*params)\n uri = session[:original_uri]\n session[:original_uri] = nil\n if uri\n redirect_to uri\n else\n redirect_to(*params)\n end\n end", "def redirect_back(*params)\n uri = session[:original_uri]\n session[:original_uri] = nil\n if uri\n redirect_to uri\n else\n redirect_to(*params)\n end\n end", "def redirect_back(*params)\n uri = session[:original_uri]\n session[:original_uri] = nil\n if uri\n redirect_to uri\n else\n redirect_to(*params)\n end\n end", "def go_home\n self.homelink.click\n end", "def redirect_back_or(default)\n redirect_to(session[:return_to] || default)\n clear_return_to\n end", "def redirect_back_or(default)\n redirect_to(session[:return_to] || default)\n clear_return_to\n end", "def visit_prev_page(model, **opt)\n click_on PREV_LABEL, match: :first\n if block_given?\n yield\n else\n show_url\n end\n assert_valid_index_page(model, **opt)\n end", "def back_button_to(path, text = t('back'))\n link_to path, class: 'button small secondary' do\n concat text\n end\n end", "def invalid_page\n redirect_to(:back)\n end", "def history\n session[:back_link_history]\n end", "def redirect_back_or( default )\n redirect_to( session[ :return_to ] || default )\n session.delete( :return_to )\n end", "def goto_end_of_history\r\n end" ]
[ "0.8658754", "0.8351272", "0.8216751", "0.8181099", "0.8138481", "0.8018701", "0.8018701", "0.793352", "0.7924963", "0.7753032", "0.7753032", "0.7753032", "0.7745229", "0.76320916", "0.75829506", "0.7552698", "0.75072104", "0.74551696", "0.73752326", "0.73166203", "0.73166203", "0.7211581", "0.7106461", "0.70326966", "0.69718397", "0.6944414", "0.6884706", "0.68791693", "0.685586", "0.67537075", "0.6752268", "0.66798353", "0.65746933", "0.65702593", "0.6568753", "0.6558078", "0.65499794", "0.6546136", "0.65375537", "0.64699703", "0.6434842", "0.64283293", "0.6405594", "0.6358501", "0.6350506", "0.6335923", "0.6328236", "0.63004756", "0.62807006", "0.62530655", "0.6244779", "0.6195529", "0.6188954", "0.618703", "0.6174572", "0.6171502", "0.6160513", "0.6151748", "0.6141998", "0.6128492", "0.6128492", "0.61235887", "0.61217886", "0.6113143", "0.60997415", "0.60873026", "0.6063281", "0.6050929", "0.60506713", "0.60492605", "0.602265", "0.59947556", "0.59795016", "0.5978064", "0.5977305", "0.5973151", "0.5972747", "0.59681404", "0.5966255", "0.5946829", "0.5939924", "0.5928727", "0.5926201", "0.5915381", "0.59111744", "0.5903077", "0.5888699", "0.5888699", "0.5888699", "0.5888699", "0.58761334", "0.58627343", "0.58627343", "0.58596605", "0.5844055", "0.583475", "0.5821463", "0.5799626", "0.5783806" ]
0.7715111
14
Simulates the user clicking the "Refresh" button on their browser.
def refresh command 'refresh' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh\n @browser.refresh\n end", "def refresh\n driver.navigate.refresh\n end", "def refresh\n driver.navigate.refresh\n end", "def refresh\n driver.navigate.refresh\n end", "def refresh\n send_cmd \"refresh\"\n nil\n end", "def refresh\n command(\"Page.reload\", wait: timeout, slowmoable: true)\n end", "def refresh()\r\n #set_browser_document()\r\n $jssh_socket.send(\"#{BROWSER_VAR}.reload();\\n\", 0)\r\n read_socket();\r\n wait()\r\n end", "def refresh\n url=$driver.current_url\n $driver.navigate.to 'http://www.google.com/'\n quiesce\n $driver.navigate.to url\n quiesce\n $driver.current_url.should == url\n end", "def reload\n selenium.get_eval(\"selenium.browserbot.getCurrentWindow().location.reload()\")\n end", "def reload\n get_eval(\"selenium.browserbot.getCurrentWindow().location.reload()\")\n end", "def refresh_browser\n page.driver.browser.navigate.refresh\n page.driver.browser.switch_to.alert.accept rescue Selenium::WebDriver::Error::NoAlertPresentError\n end", "def refresh\n $driver.refresh\n end", "def refresh_browser\n page.driver.browser.navigate.refresh\n page.driver.browser.switch_to.alert.accept rescue Selenium::WebDriver::Error::NoAlertPresentError\n end", "def refresh!\n refresh\n @window.refresh\n end", "def reload\n Howitzer::Log.info \"Reload '#{current_url}'\"\n visit current_url\n end", "def reloads\n load_page\n end", "def refresh\n do_refresh\n end", "def refresh\n do_refresh\n end", "def refresh\n render js: \"location.reload()\"\n end", "def refresh\n @window.refresh\n end", "def handle_reader_popup()\n if ENV['BROWSER_TYPE'] == 'FIREFOX'\n $test_driver.navigate.refresh\n sleep 1\n end\nend", "def refresh\n end", "def refresh\n end", "def refresh\n end", "def reload\n browser_files\n end", "def refresh\n # FIXME\n end", "def refresh\r\n end", "def restart\n page.driver.browser.restart\n end", "def refresh!; end", "def reload\n begin\n @driver.reload\n\n rescue Exception => e\n @@logger.an_event.error \"browser reload #{url}\"\n raise Errors::Error.new(BROWSER_NOT_RELOAD, :values => {:url => url}, :error => e)\n\n else\n\n @@logger.an_event.debug \"browser reload #{url}\"\n\n ensure\n\n end\n end", "def refresh\n Vedeu.trigger(\"_refresh_#{current}_\".to_sym)\n end", "def request_ui_refresh\n @ui_refresh_executor.call\n end", "def refresh; end", "def refresh\n do_refresh\n self\n end", "def reload\n refresh\n end", "def reload\n refresh\n end", "def refresh\n Vedeu.trigger(:_refresh_, current)\n end", "def refresh\n page = @agent.get('https://wwws.mint.com/overview.event')\n\n @agent.post(\"https://wwws.mint.com/refreshFILogins.xevent\", {\"token\"=>@token})\n\n true\n \n end", "def refresh\r\n @view.refresh\r\n end", "def ui_refresh\n\t\t\t\tCurses.refresh\n\t\t\tend", "def reload\n do_url 'reload', :put\n end", "def refresh_feed\n open_feeds_menu\n expect(page).to have_css '#refresh-feed'\n find('#refresh-feed').click\n # Ensure entries have finished loading\n expect(page).to have_no_css 'div#loading'\nend", "def html_reload(url = nil)\n if url != nil && url != ''\n \"<meta http-equiv=\\\"Refresh\\\" content=\\\"0; URL=#{url}\\\">\\n\"\n else\n ''\n end\n end", "def refresh\n conf['dashboard']['refresh'].to_s\n end", "def reload\n\t\tself.request( :reload )\n\tend", "def refresh\n tracking = tracking_handler.refresh!\n if tracking.success?\n flash[:success] = 'Tracking was successfully refreshed'\n else\n flash[:error] = tracking.error\n end\n redirect_to navigation.back(1)\n end", "def refresh\n return false\n end", "def refresh!\n unpack(agent.get(url))\n self\n end", "def refresh\n\t\t\t@window.refresh\n\t\t\t@windows.each { |w| w.refresh if w.visible? }\n\t\tend", "def refresh; schedule_update end", "def refresh()\n\t\t@pipe.puts \"refresh\"\n\tend", "def wrefresh\n Ncurses.wrefresh(@window)\n end", "def reload\n end", "def reload\n end", "def refresh(op)\n check_connection\n @protocol.refresh_command op\n self\n end", "def do_refresh_confirmed!\n end", "def reset_browser\n # clear cookies\n Testing.browser.cookies.clear\n\n # open homepage\n unless Testing.browser.url == \"#{Testing.base_url}/\"\n Testing.browser.goto(Testing.base_url)\n end\n\n Testing.browser\n end", "def reload\n msg = \"guard-self_test is reloaded...\"\n UI.info msg\n Notifier.notify(msg)\n end", "def refresh\n @server.make_json_request('show.refresh', tvdbid: @tvdbid)['message']\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def update\n @browser.update(browser_params)\n head :no_content\n end", "def refresh_token\n @agent.shutdown\n @agent = Mechanize.new\n\n get_token\n set_headers\n end", "def reset\n @browser.link(:href=>/tool-reset/).click\n end", "def enable_refresh\n add option: \"-refresh=true\"\n end", "def button\n @edit = session[:edit] # Restore @edit for adv search box\n @refresh_div = \"main_div\" # Default div for button.rjs to refresh\n\n unless @refresh_partial # if no button handler ran, show not implemented msg\n add_flash(_(\"Button not yet implemented\"), :error)\n @refresh_partial = \"layouts/flash_msg\"\n @refresh_div = \"flash_msg_div\"\n end\n end", "def refresh!\n load if changed?\n end", "def reload\n get\n end", "def objRefresh(obj)\n\n @counter = 0\n\n while obj.present? == false do\n @counter +=1\n if @counter == 9\n puts \" *** Requested object was not found ***\"\n break\n else\n @browser.refresh\n sleep 3\n end\n end\n end", "def refresh(options = {})\n self.link(:edit).get\n end", "def action_reload\n proxy_action(:reload)\n end", "def reload\n resp = api_client.get(url)\n refresh(JSON.load(resp.body))\n end", "def wrefresh\n FFI::NCurses.wrefresh(@pointer)\n end", "def run\n @form.repaint\n @window.wrefresh\n return handle_keys\n end", "def call\n space\n puts \"Welcome to Rotoworld NFL - Player News\"\n puts \"______________________________________\"\n Rotoworld::Scraper.new.get_posts\n show_posts\n\n puts \"Would you like to refresh or exit?\"\n input = gets.strip\n if input.downcase == \"refresh\"\n call\n elsif input.downcase == \"exit\"\n system(\"clear\")\n puts \"Thanks for visiting.\"\n sleep(5)\n \n end\n end", "def refresh!\n description.update!(send_messages([ refresh_command ]).documents[0])\n end", "def refresh\n load if changed?\n end", "def refresh!\n self.size! if @size\n refresh_digests! if respond_to?(:refresh_all_digests!)\n self.mimetype! if @mimetype\n self\n end", "def visit\n @browser.goto(URL)\n end", "def refresh()\n self.route(history.state.path, history.state.query)\n end", "def refresh\n response = Clever.request :get, url\n refresh_from response[:data]\n self\n end", "def refresh\n raise NotImplementedError.new('I do not know how to refresh myself, please implement it in subclass.')\n end", "def button\n @refresh_div = \"main_div\" # Default div for button.rjs to refresh\n timeprofile_delete if params[:pressed] == \"tp_delete\"\n copy_record if params[:pressed] == \"tp_copy\"\n edit_record if params[:pressed] == \"tp_edit\"\n\n if !@refresh_partial && @flash_array.nil? # if no button handler ran, show not implemented msg\n add_flash(_(\"Button not yet implemented\"), :error)\n @refresh_partial = \"layouts/flash_msg\"\n @refresh_div = \"flash_msg_div\"\n end\n\n if params[:pressed].ends_with?(\"_edit\", \"_copy\")\n javascript_redirect(:action => @refresh_partial, :id => @redirect_id)\n else\n build_tabs\n render :update do |page|\n page << javascript_prologue\n page.replace(\"flash_msg_div\", :partial => \"layouts/flash_msg\")\n page << \"miqScrollTop();\" if @flash_array.present?\n page.replace_html(\"main_div\", :partial => \"ui_4\") # Replace the main div area contents\n page << javascript_reload_toolbars\n end\n end\n end", "def refresh_status_sm\n assert_privileges(\"storage_manager_refresh_status\")\n sm_button_operation('request_status_update', _('Refresh Status'))\n end", "def reload\n true\n end", "def reload\n true\n end", "def reload;end", "def close_browser\r\n @browser.quit\r\n sleep 1\r\n end", "def reload_status\n get(\"reload\")\n end", "def reload\n end", "def refresh!\n raise NotImplementedError, \"#refresh! is not implemented on #{@provider}:#{@type}\"\n end", "def refresh\n Vedeu.trigger(:_refresh_view_, current)\n\n Vedeu.trigger(:_refresh_cursor_, current)\n end", "def after_refresh(_options = {}); end", "def reload\n restart\n end" ]
[ "0.8199763", "0.7778025", "0.7778025", "0.7778025", "0.77688974", "0.7606692", "0.7599507", "0.73085624", "0.72726357", "0.72669005", "0.7084642", "0.70487535", "0.70370454", "0.696099", "0.6950224", "0.6870822", "0.68665975", "0.68665975", "0.67399365", "0.67103165", "0.6708387", "0.669811", "0.669811", "0.66436666", "0.6632099", "0.65764153", "0.6554937", "0.6539404", "0.6480468", "0.64225256", "0.6407622", "0.64018077", "0.63085395", "0.63003", "0.630009", "0.630009", "0.62037516", "0.6201199", "0.61488694", "0.60790914", "0.605377", "0.5998019", "0.5935615", "0.59319955", "0.5914307", "0.58657235", "0.5835971", "0.5832771", "0.5819877", "0.581805", "0.57970303", "0.57966477", "0.57899463", "0.57899463", "0.5786078", "0.57816684", "0.5770709", "0.5764865", "0.5756042", "0.5707733", "0.5707733", "0.5707733", "0.5707733", "0.5707733", "0.5707733", "0.5707733", "0.5692544", "0.56749636", "0.56411135", "0.56362", "0.5624886", "0.5613681", "0.5592347", "0.55873334", "0.5576109", "0.5557782", "0.55304015", "0.5519162", "0.5508657", "0.550116", "0.55001295", "0.5495528", "0.5473556", "0.5463318", "0.5461957", "0.54565334", "0.5455709", "0.544283", "0.5442234", "0.5439439", "0.5439439", "0.54270154", "0.5422935", "0.54211724", "0.5413306", "0.54095197", "0.54067963", "0.5399376", "0.5391681" ]
0.7161584
11
Simulates the user clicking the "close" button in the titlebar of a popup window or tab.
def close command 'close' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_window\n end", "def close\n @window.close\n end", "def close\n Window.functions[__method__] ||= AU3_Function.new(\"WinClose\", 'SS', 'L')\n Window.functions[__method__].call(@title.wide, @text.wide)\n nil\n end", "def cookie_popup_close\n get_elem_and_click(:xpath, \"//core-icon[@icon-id='glyphs.close']\")\n end", "def close_popups\n return if driver.doc.at('.cb_close').nil?\n driver.first('.cb_close').click\n end", "def close\n @window.destroy if @window\n @window = nil\n end", "def close_popup\n popup.deactivate\n x = Graphics.width\n y = @help_window.height\n if $imported[\"H87_SmoothMovements\"]\n @option_window.smooth_move(0, y)\n popup.smooth_move(x, y)\n else\n @option_window.x = 0\n popup.x = x\n end\n @option_window.activate\n @popup_index = nil\n end", "def close_popup\n popup.deactivate\n x = Graphics.width\n y = @help_window.height\n if $imported[\"H87_SmoothMovements\"]\n @option_window.smooth_move(0, y)\n popup.smooth_move(x, y)\n else\n @option_window.x = 0\n popup.x = x\n end\n @option_window.activate\n @popup_index = nil\n end", "def close\n wait_for_exists\n @alert.dismiss\n @browser.after_hooks.run\n end", "def windowWillClose(notification)\n OSX::NSApp.terminate(self)\n end", "def windowWillClose(notification)\n OSX::NSApp.terminate(self)\n end", "def close\n @window.destroy if @window\n VER::stop_ncurses\n end", "def CloseWindow\n @window.hide\n Gtk.main_quit\n end", "def close_internal_frame(title)\n append_to_script \"close_internal_frame \\\"#{title}\\\"\"\n end", "def close_browser_tab(position:)\n @browser.windows[position - 1].close\n end", "def close_game\r\n $window.close\r\n end", "def close_current_window()\n $driver.close.should be_nil\n # Just in case\n $driver.switch_to.window($driver.window_handles.last).should be_nil\n end", "def exit\n @window.pause = true\n @window.close\n end", "def close_new_window\n $driver.close\nend", "def close\n \"<body onload='window.close();'/>\"\n end", "def dialog_closed(title)\n append_to_script \"dialog_closed \\\"#{title}\\\"\"\n end", "def close_window(options = {})\n win_name = if(options.is_a?(Hash))\n [(options[:window] || options[:name]).to_s]\n elsif(options.is_a?(Array))\n options.map(&:to_s)\n else\n [options.to_s]\n end\n win_name.each do |win|\n self << check_for_window(win, false){ self << \"#{window(win, :raw)}.dialog('close');\"}\n end\n end", "def close_cvv_help_popup\n close_cvv_help_link.click\n end", "def close_window(close_loc = :current, active_loc = nil)\n if @browser.windows.count == 1\n # doesn't matter what they enter, bc closing the only window of a browser\n # instance causes the browser to crash\n @browser.close\n end\n\n\n if close_loc == :current\n # if the current window is being closed, we have to move to another before closing it\n if active_loc.nil?\n # if new active window is unspecified, make the previous window the new active one\n self.switch_to_previous_window\n else\n self.switch_to_window(active_loc)\n end\n else\n # a specific window to be closed has been specified (though it may still be the active one)\n if close_loc[0..3] == 'url=' or close_loc[0..5] == 'title='\n if @browser.window(parse_location(close_loc)).current?\n # if the current window is being closed, we have to move to another before closing it\n if active_loc.nil?\n # if new active window is unspecified, make the previous window the new active one\n self.switch_to_previous_window\n else\n self.switch_to_window(active_loc)\n end\n end\n @browser.window(parse_location(close_loc)).close\n else\n # assume close_loc is an integer\n # since Robot Framework sends all args as text, the above check for\n # \"url=\" and \"title=\" is the best we can do to ensure argument correctness\n close_loc = close_loc.to_i\n # the number of the window\n # user-facing numbers are 1-based, internal we use 0-based because @browser.windows\n # is a Ruby array, so minus 1\n window_id = close_loc - 1\n if window_id == -1\n # either the user has been too smart for his/her own good and thinks the windows are 0-based,\n # or they've entered text that doesn't match 'url=' or 'title=', in which case\n # the above loc.to_i will make loc equal 0\n raise(ArgumentError, \"You must provide the url or title of the window in the format 'url=' or 'title=', or you must provide the number of the window, starting with 1 for the first window opened.\")\n end\n \n if @browser.windows[window_id].current?\n # if the current window is being closed, we have to move to another before closing it\n if active_loc.nil?\n # if new active window is unspecified, make the previous window the new active one\n self.switch_to_previous_window\n else\n self.switch_to_window(active_loc)\n end\n end\n # this will throw its own error if the index is out of range\n @browser.windows[window_id].close\n end\n end\n end", "def pop_frame()\n CLI::UI::Frame.close(\"Pop!\")\n end", "def close\n start_time = Time.now\n is_open = true\n while is_open\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not close - your settings may need adjusting. Exiting...\") if Time.now - start_time > 2\n is_open = win_is_open?(@id)\n end\n end", "def close_fee_popup\n if self.btnOK_element.present?\n self.btnOK_element.when_present.click\n end\n end", "def dismiss_dialog\n @ole.browser.alert.ok if @ole.browser.alert.present?\n end", "def close_menu\n touch_screen_element 'Close menu Button', close_menu_button\n end", "def close \n #Self trigger window lost focus, since we are going to home\n focus_changed false, @screen_width, @screen_height\n @showing = false\n @activity.moveTaskToBack(true)\n end", "def clear_popup(popup_win_title, seconds = 10, yes = true)\r\n # commonly \"Security Alert\", \"Security Information\"\r\n if is_windows?\r\n sleep 1\r\n autoit = WIN32OLE.new('AutoItX3.Control')\r\n # Look for window with given title. Give up after 1 second.\r\n ret = autoit.WinWait(popup_win_title, '', seconds)\r\n #\r\n # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).\r\n if ret == 1 then\r\n puts \"about to send click Yes\" if debugging?\r\n button_id = yes ? \"Button1\" : \"Button2\" # Yes or No\r\n autoit.ControlClick(popup_win_title, '', button_id)\r\n end\r\n sleep(0.5)\r\n else\r\n raise \"Currently supported only on Windows\"\r\n end\r\n end", "def close_button\n content_tag(\n :button,\n class: 'close',\n data: { dismiss: 'alert' },\n aria: { label: 'Close' }\n ) do\n content_tag(:span, aria: { hidden: true }) { '&times;'.html_safe }\n end\n end", "def close_dialog(dialog_name)\n wait_start\n opera_desktop_action(\"Cancel\")\n wait_for_window_close(dialog_name)\n end", "def close_dialog(dialog_name)\n wait_start\n opera_desktop_action(\"Cancel\")\n wait_for_window_close(dialog_name)\n end", "def quit\n @browser.close\n end", "def ui_close\n\t\t\t\t#puts \"CursesApp->ui_close\"\n\t\t\t\t\n\t\t\t\traise 'ui already closed' if @ui_closed\n\t\t\t\t@ui_closed = true\n\t\t\t\t\n\t\t\t\t# Curses.setpos(10, 0)\n\t\t\t\t# Curses.addstr('CLOSE ')\n\t\t\t\t# Curses.refresh\n\t\t\t\t# sleep(2)\n\t\t\t\t\n\t\t\t\tCurses.refresh\n\t\t\t\tCurses.stdscr.clear\n\t\t\t\tCurses.stdscr.refresh\n\t\t\t\tCurses.stdscr.close\n\t\t\t\tCurses.close_screen\n\t\t\tend", "def close_other_windows\n cur_window = browser.window_handle\n browser.window_handles.each do |window|\n next if window.eql?(cur_window)\n\n browser.switch_to.window(window)\n browser.close\n end\n browser.switch_to.window(cur_window)\n end", "def should_close?\n @window.should_close?\n end", "def close_import_alert\n find('#start-info #import-process-state button.close', visible: true).click\nend", "def close_toybox\n p 'close_toybox'\n dismissModalViewControllerAnimated(true, completion: nil) \n end", "def window_closed(windowTitle)\n $marathon.sleepForSlowPlay\n $marathon.windowClosed(windowTitle)\nend", "def close_browser\r\n @browser.quit\r\n sleep 1\r\n end", "def close_info_window\n self << 'jQuery(\"#information_modal\").dialog(\"close\");'\n nil\n end", "def close_button\n content_tag(:button, class: 'close', data: { dismiss: 'alert' }, aria: { label: 'Close' }) do\n content_tag(:span, aria: { hidden: true }) { '&times;'.html_safe }\n end\n end", "def close_game\n show\n Ncurses.mvaddstr(MAXY - 1, 0, 'Press any key to exit')\n Ncurses.getch\n Ncurses.curs_set(1)\n Ncurses.endwin\n end", "def wait_close(timeout = 0)\n Window.functions[__method__] ||= AU3_Function.new(\"WinWaitClose\", 'SSL', 'L')\n Window.functions[__method__].call(@title.wide, @text.wide, timeout) != 0\n end", "def dojo_dialog_close\r\n \"zstaff.helpers.dialog.close();\"\r\n end", "def alert_close\n MenuControllerContracts.invariant(self)\n @alert_view = nil\n MenuControllerContracts.invariant(self)\n end", "def onClose(sender, sel, event)\n $app.exit(0)\n end", "def onClose(sender, sel, event)\n $app.exit(0)\n end", "def click_cancel_js_popup(title)\n click_button_popup(title, \"Cancel\")\nend", "def close_export_alert\n find('#start-info #export-process-state button.close', visible: true).click\nend", "def close_window_with_action(win_name, action_name, *params)\n wait_start\n opera_desktop_action(action_name, *params) \n wait_for_window_close(win_name)\n end", "def close_search\n close_search_bar.click\n end", "def exit_dlg()\n @parent.show\n self.destroy\n end", "def close_window\n $LOG.info \"Inside close window method\"\n begin\n $driver.close\n rescue Exception => e\n $LOG.error \"Error Close the current window, \\n Error Message :: \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Error Close the current window \\n Error Message :: \"+e.message\n end\n end", "def close(wait_timeout=nil)\n @main_window.close\n if wait_timeout\n timeout(wait_timeout) do\n sleep SLEEP_DELAY while @main_window.window?\n end\n end\n# @main_window.wait_for_close(timeout) if timeout - does not work as Window#wait_for_close relies on window_visible?\n end", "def close_browser\n @browser.close # Same for watir-webdriver and selenium-webdriver.\n end", "def close_browser\n Logbook.step('Stop webdriver. The End of a test:)')\n @browser.quit\n Logbook.publish_results\n end", "def close_all_dialogs\n append_to_script \"close_all_dialogs\"\n end", "def close_page\n Logbook.message('Closing browser page >>')\n\n if @browser.nil?\n Logbook.error('Page is already closed')\n else\n @browser.close\n Logbook.message('Done! Page closed')\n end\n end", "def close_window_with_action(win_name, action_name, *params)\n wait_start\n opera_desktop_action(action_name, *params)\n wait_for_window_close(win_name)\n end", "def Animate_Close(hwnd)\r\n Animate_Open(hwnd, nil)\r\n end", "def close()\r\n #puts \"current window number is : #{@@current_window}\"\r\n # Derek Berner 5/16/08\r\n # Try to join thread only if there is exactly one open window\r\n if js_eval(\"getWindows().length\").to_i == 1\r\n $jssh_socket.send(\" getWindows()[0].close(); \\n\", 0)\r\n @t.join if @t != nil\r\n #sleep 5\r\n else\r\n # Check if window exists, because there may be the case that it has been closed by click event on some element.\r\n # For e.g: Close Button, Close this Window link etc.\r\n window_number = find_window(\"url\", @window_url)\r\n\r\n # If matching window found. Close the window.\r\n if(window_number > 0)\r\n $jssh_socket.send(\" getWindows()[#{window_number}].close();\\n\", 0)\r\n read_socket();\r\n end \r\n \r\n #Get the parent window url from the stack and return that window.\r\n #@@current_window = @@window_stack.pop()\r\n @window_url = @@window_stack.pop()\r\n @window_title = @@window_stack.pop()\r\n # Find window with this url.\r\n window_number = find_window(\"url\", @window_url)\r\n @@current_window = window_number\r\n set_browser_document()\r\n end\r\n end", "def close_menu\n pending\n perform_action('drag', 20, 0, 10, 10, 10)\n end", "def exit_session\n @window.dispose\n @viewport.dispose\n ShellOptions.save\n end", "def close_popup_link\n $tracer.trace(__method__)\n return ToolTag.new(a.id(\"/lnkClosePopup$/\"), __method__)\n end", "def close\n SLogger.debug(\"[client] interrupting window (#{@window_pid})...\")\n\n Process.kill(:INT, @window_pid)\n end", "def XOclose\n\t\tsleep TIMETICK\n\n\t\tbegin\n\t\t\t@wwBrws.close\n\t\trescue\n#\t\t\t::Process.kill('KILL', browser_pid)\n\t\tend\n\t\t$alog.lwrite('Browser closed!', 'DEBG')\n\t\treturn retControl(OK)\n\tend", "def close_browser\n\t\t@browser.close\n\tend", "def close_other_window\n @window_id = (@window_id - 1).abs\n if @window_id != 0 and @window_id !=1\n raise(Exception::WindowMatchError, \"You cannot use this keyword when more than 2 windows are open; you must use 'Switch To Window', 'Switch to Next Window', or 'Switch to Previous Window'\")\n end\n\n @browser.windows[@window_id].close\n end", "def close_all_tabs\n #The collection has the activate tab first and then the rest sorted on number, so resort to get on descending position\n quick_tabbuttons(\"Browser Window\").sort {|t1, t2| (t2.position <=> t1.position) }.each do |btn|\n #Tab button is in Browser window which is prob not the active window,\n #so we cannot do this the easy way \n #btn.quick_button(:name, \"pb_CloseButton\").close_window_with_click(\"Document Window\") unless btn.position == 0\n #puts \"Current tab = #{btn}\"\n if btn.position != 0 or btn.value > 1 then\n quick_window(:name, \"Browser Window\").quick_tab(:pos, btn.position).quick_button(:name, \"pb_CloseButton\").close_window_with_click(\"Document Window\")\n end \n end\n end", "def exit\n stop\n $window.deleteAllWidgets\n $window.createWidgets\n $window.deleteAllImages\n $window.cursor.unforceVisible\n terminate\n end", "def close_all_tabs\n #The collection has the activate tab first and then the rest sorted on number, so resort to get on descending position\n quick_tabbuttons(\"Browser Window\").sort {|t1, t2| (t2.position <=> t1.position) }.each do |btn|\n #Tab button is in Browser window which is prob not the active window,\n #so we cannot do this the easy way\n #btn.quick_button(:name, \"pb_CloseButton\").close_window_with_click(\"Document Window\") unless btn.position == 0\n #puts \"Current tab = #{btn}\"\n if btn.position != 0 or btn.value > 1 then\n quick_window(:name, \"Browser Window\").quick_tab(:pos, btn.position).quick_button(:name, \"pb_CloseButton\").close_window_with_click(\"Document Window\")\n end\n end\n end", "def quit_browser\n @browser.quit\n end", "def closeBrowser(step)\n @browser.quit\n end", "def quit\n @ui.close\n @player.close\n @logger.close\n exit\n end", "def quit\n @ui.close\n @player.close\n @logger.close\n exit\n end", "def close\n Highgui.release_capture(FFI::MemoryPointer.new(:pointer).write_pointer(@capture_handler))\n @capture_handler = nil\n end", "def close_toybox\n dismissModalViewControllerAnimated(true, completion: nil)\n end", "def quitbrowser\n @browser.quit\n end", "def close_lid()\n \"Click the <b>Close Lid</b> button\"\n end", "def click_cancel_openas_popup(title, open_file_path)\n click_button_saveas_or_openas_popup(title, open_file_path, \"Cancel\")\nend", "def dismiss_modal(type, options = {}, &blk)\n appium_driver.alert_dismiss\n end", "def XOcloseWindow(tag, tvalue)\n\t\tres= OK\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# default is OK\n\t\tbegin\n\t\t\tself.setPageTimer() \t\t\t\t\t\t\t\t\t\t# set or clear the page timer\n\t\t\t$pfd.tstart( @wwBrws.url.to_s)\n\t\t\ttimedOut= false\n\n\t\t\t$alog.lwrite(('There are '+@wwBrws.windows.size.to_s+' active windows.'), 'DEBG')\n\n\t\t\tcase tag\n\t\t\t\twhen :allpopup\n\t\t\t\t\tres= @winHandles.closeAllHandle( self)\n\n\t\t\t\twhen :index\n\t\t\t\t\tuntil ((timedOut=self.getPageTimer()) || @wwBrws.window(:index => tvalue).exists?)\n\t\t\t\t\t\tsleep TIMETICK\n\t\t\t\t\tend\n\t\t\t\t\tif timedOut\n\t\t\t\t\t\tres= CRITICAL\n\t\t\t\t\telse\n\t\t\t\t\t\tres= @winHandles.closeHandle( self, tvalue)\n\t\t\t\t\tend\n\n\t\t\t\twhen :url\n\t\t\t\t\tuntil ((timedOut=self.getPageTimer()) || @wwBrws.window(:url => /#{tvalue}/).exists?)\n\t\t\t\t\t\tsleep TIMETICK\n\t\t\t\t\tend\n\t\t\t\t\tif timedOut\n\t\t\t\t\t\tres= CRITICAL\n\t\t\t\t\telse\n\t\t\t\t\t\t@wwBrws.window(:url => /#{tvalue}/).close\n\t\t\t\t\tend\n\t\t\t\twhen :title\n\t\t\t\t\tuntil ((timedOut=self.getPageTimer()) || @wwBrws.window(:title => /#{tvalue}/).exists?)\n\t\t\t\t\t\tsleep TIMETICK\n\t\t\t\t\tend\n\t\t\t\t\tif timedOut\n\t\t\t\t\t\tres= CRITICAL\n\t\t\t\t\telse\n\t\t\t\t\t\t@wwBrws.window(:title => /#{tvalue}/).close\n\t\t\t\t\tend\n\t\t\tend\n\n\t\t\tif(res==CRITICAL)\n\t\t\t\tres= setResCritical('CANnot close window: '+$!.to_s )\n\t\t\telse\n\t\t\t\t$alog.lwrite(('Now using Windows w/title '+@wwBrws.window.title.to_s+' '), 'DEBG')\n\t\t\tend\n\t\trescue\n\t\t\tres= setResCritical('CANnot close window: '+$!.to_s )\n\t\tend\n\t\treturnRes (res )\n\tend", "def shell_close()\n self.kill\n end", "def quit_command()\n @subSceneScan.hide_windows()\n @target_enemy_window.active = true\n end", "def click_cancel_file_dialog_popup(title)\n click_button_popup(title, \"Cancel\")\nend", "def on_buy_cancel\n @command_window.activate\n #@dummy_window.show\n @buy_window.hide\n @status_window.hide\n @status_window.item = nil\n @help_window.clear\n end", "def buttonCancel__clicked(*a)\n @builder[:window1].destroy\n end", "def close_status_window\n instance_variables.each do |varname|\n ivar = instance_variable_get(varname)\n ivar.openness = 0 if ivar.is_a?(Window)\n end\n end", "def close\n abort('Thanks for playing!')\n end", "def closeEvent(p_event)\n\t\t\tparentWidget.close\n\t\tend", "def close\n return if closed?\n\n nocbreak\n close_screen\n end", "def close\n {\n method: \"Page.close\"\n }\n end", "def close_blank_windows\n @driver.window_handles.each do |handle|\n @driver.switch_to.window(handle)\n @driver.close if @driver.current_url == 'about:blank'\n end\n end", "def close_all_dialogs\n win_id = driver.getActiveQuickWindowID()\n until quick_window(:id, win_id).type != :dialog do\n win = quick_window(:id, driver.getActiveQuickWindowID())\n if win.type == :dialog\n close_dialog(win.name)\n if (driver.getActiveQuickWindowID() != win_id)\n win_id = driver.getActiveQuickWindowID()\n else\n break\n end\n end\n end\n end", "def close!\n @controller.close! if @controller\n FFI::NCurses.endwin\n Process.exit!\n end", "def hide_window\n end" ]
[ "0.75794756", "0.75529367", "0.7407093", "0.72701716", "0.714634", "0.714485", "0.7026673", "0.7026673", "0.68902946", "0.68754786", "0.68754786", "0.6863469", "0.68300515", "0.6789777", "0.67855704", "0.6734649", "0.6690211", "0.6661472", "0.6650177", "0.6628381", "0.6602557", "0.65731096", "0.65580475", "0.6549471", "0.6536649", "0.6492364", "0.64816463", "0.6477915", "0.6456412", "0.6448577", "0.64300567", "0.64130783", "0.6406867", "0.6406867", "0.6367984", "0.6301678", "0.6301247", "0.62893873", "0.6286871", "0.6273539", "0.62516296", "0.62480855", "0.6244409", "0.62428516", "0.62252426", "0.62088555", "0.6207014", "0.6182322", "0.61821055", "0.61821055", "0.61694264", "0.61503947", "0.6143723", "0.61287457", "0.61205375", "0.6101418", "0.6097022", "0.60958284", "0.60675025", "0.606533", "0.6054209", "0.60331964", "0.6024715", "0.60197675", "0.6018488", "0.6012432", "0.60105693", "0.6009584", "0.60020155", "0.5985482", "0.5980078", "0.5959959", "0.5922913", "0.59082645", "0.59075373", "0.58987886", "0.5895188", "0.5895188", "0.5880485", "0.58727807", "0.58654356", "0.58569056", "0.58550495", "0.58518255", "0.58395624", "0.58352566", "0.5832154", "0.58314806", "0.5824983", "0.5813806", "0.580626", "0.58055043", "0.57954544", "0.57939017", "0.5784828", "0.5783873", "0.5753773", "0.57527", "0.5742999" ]
0.63031524
36
Simulates the user pressing the alt key and hold it down until do_alt_up() is called or a new page is loaded.
def alt_key_down command 'altKeyDown' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def enter_alt(alt)\n raise NotImplementedError\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def while_key_up *args\n\t\t\tevent(:while_key_up, *args)\n\t\tend", "def send_modified_key(element_selector, key, *meta)\n wait_for_loading\n \n key_string = key\n key_string = \"alt+\" + key_string if meta.include? :alt\n key_string = \"ctrl+\" + key_string if meta.include? :control\n key_string = \"command+\" + key_string if meta.include? :command\n\n page.driver.execute_script(\"Mousetrap.trigger('#{key_string}');\")\n end", "def hold_screen\n print 'Press Enter to continue.'\n gets.chomp\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def up_key\n @last = @choice\n @choice = (@choice > 0 ? @choice -= 1 : 2)\n @choice_sound.play(1, 0.5, false)\n end", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def activate_up(key)\n key_down.deactivate(key)\n key_held.deactivate(key)\n key_up.activate(key)\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def activate_down(key)\n key_down.activate(key)\n key_held.deactivate(key)\n key_up.deactivate(key)\n end", "def hotkeys\n loop do\n c = @screen.getch\n\n case c\n when Ncurses::KEY_DOWN, 14, 'j'.ord\n scroll_down\n\n when Ncurses::KEY_UP, 16, 'k'.ord\n scroll_up\n\n when Ncurses::KEY_NPAGE\n (maxy - 2).times do\n break if !scroll_down\n end\n\n when Ncurses::KEY_PPAGE\n (maxy - 2).times do\n break if !scroll_up\n end\n\n when Ncurses::KEY_LEFT\n while scroll_up; end\n\n when Ncurses::KEY_RIGHT\n while scroll_down; end\n\n when 'q'.ord\n break\n\n when @callbacks[c]\n true\n\n end\n\n @screen.move(0, 0)\n end\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\nend", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def meta_key_up\r\n command 'metaKeyUp'\r\n end", "def down_key\n @last = @choice\n @choice = (@choice < 2 ? @choice += 1 : 0)\n @choice_sound.play(1, 0.5, false)\n end", "def any_key\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def ctrl_l() send_keys(:ctrl_l) end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def activate_held(key)\n key_down.deactivate(key)\n key_held.activate(key) unless key_held.send(key)\n key_up.deactivate(key)\n end", "def resume(view)\n @ctrlDown = false\n @shiftDown = false\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def meta_key_down\r\n command 'metaKeyDown'\r\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def pagedown\n page.driver.browser\n .execute_script('return document.body')\n .send_keys(:page_down)\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n \n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\nend", "def wait_for_press\n wait_for_presses(1)\n end", "def button_down_game_replay_presenter(id, window, state)\n if id == Gosu::KbSpace\n navigate_back(window) if id == Gosu::KbSpace\n end\n level_up(state) if id == Gosu::KbRight\n level_down(state) if id == Gosu::KbLeft\nend", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n\n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n \n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\n end", "def ****_hidekeyboard\r\n begin\r\n\tif $driver.is_keyboard_shown\r\n\t $driver.press_keycode(4)\r\n\tend\r\n rescue Exception => e\r\n\t raise e.message\r\n\t raise e.backtrace.inspect\r\n end\r\nend", "def onKeyDown(key, repeat, flags, view)\r\n if key == VK_END # toggle zig direction\r\n toggle_direc_flag()\r\n end\r\n if key == VK_HOME # toggle use of flood fill\r\n @flood = !@flood\r\n if (@flood)\r\n @statusmsg = @statusmsgBase2 + \"FLOOD #{@stepover_percent}%\"\r\n else\r\n @statusmsg = @statusmsgBase + \"StepOver #{@stepover_percent}%\"\r\n end\r\n Sketchup::set_status_text(@statusmsg, SB_PROMPT)\r\n end\r\n\r\n if (key == VK_SHIFT)\r\n @keyflag = 1\r\n else\r\n if (key == VK_CONTROL)\r\n @keyflag = 2\r\n else\r\n super #process other keys for depth selection\r\n end\r\n end\r\n end", "def pressToContinue\n puts \"\\n\"\n print \"Press enter to continue. \"\n gets.chomp\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def zoom_in_out_till_element_display(access_type, in_out, access_name)\n \n if get_os==\"windows\"\n key=\"control\"\n elsif get_os==\"mac\"\n key=\"command\"\n end\n\n while true\n \n if WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}.displayed?\n break\n else\n $driver.action.key_down(:\"#{key}\").send_keys(:\"#{in_out}\").key_up(:\"#{key}\").perform\n end\n end\n\nend", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up(*args, device: T.unsafe(nil)); end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def button_up(key)\n close if key == Gosu::KbEscape\n\n # reset the game\n if @state == :end && key == Gosu::MsLeft\n @board = Board.new(self, 22, @root_dir)\n @state = :game\n return\n end\n\n @player_b.ai_inc if key == Gosu::KbS\n @player_b.ai_dec if key == Gosu::KbD\n\n if @player_on_turn.class == HotseatPlayer && key == Gosu::MsLeft\n if @board.cell_clicked(mouse_x, mouse_y, @player_on_turn.sym)\n\n return if @state == :end\n\n switch_players\n\n if @player_on_turn.class == AIPlayer\n @player_on_turn.make_move(@board)\n switch_players\n end\n end\n end\n end", "def show_menu\n puts \"Type 'q' to quit\"\n puts \"Or press Return to continue\"\nend", "def pause\n print \"Press Enter/Return to continue...\"\n gets\n end", "def restart\n while get_state() == 'LOST'\n # Press a key to get score.\n @driver.action.send_keys(:up).perform\n sleep(0.2)\n end\n\n while get_state() == 'MENU'\n @driver.action.send_keys(:space).perform\n sleep(0.2)\n end\n\n @driver.action.send_keys(:space).perform\n end", "def handle_keys\n exit if SDL::Key.press? SDL::Key::ESCAPE\n exit if SDL::Key.press? SDL::Key::Q\n self.paused = !paused if SDL::Key.press? SDL::Key::P\n end", "def button_down(id)\n # ENTER: launch A* algorithm\n if id == Gosu::KbReturn && ready?\n @grid.update_neighbors\n a_star\n @needs_reset = true\n end\n\n # SUPPR: clear window\n reset! if id == Gosu::KbDelete\n end", "def alt; end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def event_loop\n loop do\n Curses.doupdate\n @message.clear\n\n case key = @message.getch\n when 9 then @display.next_link\n when 'Z', 353, Curses::Key::BTAB then @display.previous_link # shift-tab\n\n when 10, Curses::Key::ENTER then display_name @display.current_link\n\n when Curses::Key::LEFT then go_to @history.back\n when Curses::Key::RIGHT then go_to @history.forward\n\n when Curses::Key::END then @display.scroll_bottom\n when Curses::Key::HOME then @display.scroll_top\n when 'j', Curses::Key::DOWN then @display.scroll_down\n when 'k', Curses::Key::UP then @display.scroll_up\n when ' ', Curses::Key::NPAGE then @display.page_down\n when Curses::Key::PPAGE then @display.page_up\n\n when 'h' then\n display @history.list, nil\n when 'i' then\n @message.show \"pos: #{@history.position} items: #{@history.pages.length}\"\n\n when 'Q', 3, 4 then\n break # ^C, ^D\n when 26, Curses::Key::SUSPEND then\n Curses.close_screen\n Process.kill 'STOP', $$\n when nil, Curses::Key::RESIZE then\n @display.update_size\n @message.update_size\n\n when 'g' then display_name @message.prompt\n\n else\n @message.error \"unknown key #{key.inspect}\"\n end\n end\n end", "def button_down(key)\n end", "def swipe_down_until(expected_element)\n while $home_page.user_expect_not_displayed?(expected_element) do\n $home_page.user_swipe_down\n end\nend", "def button_down(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n\r\n # Check if the player sprite can jump\r\n if [1,3,4,5,6].include?(get_tile_info(@player.get_x,\r\n @player.get_y,:down)) then\r\n\r\n # Call the jump function\r\n @player.jump\r\n\r\n # Player still might have a chance to \"double\" jump\r\n elsif @player.get_fall < 5 then\r\n @player.jump\r\n end\r\n end\r\n end", "def any_key\n puts \"\"\n puts \"Press any key to continue..\"\n STDIN.getch\n end", "def button_up(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n @player.reset_jump if @player.is_jumping?\r\n end\r\n end", "def zoom_in_out(in_out)\n if get_os==\"windows\"\n key=\"control\"\n elsif get_os==\"mac\"\n key=\"command\"\n end\n\n $driver.action.key_down(:\"#{key}\").send_keys(:\"#{in_out}\").key_up(:\"#{key}\").perform\nend", "def interact\n if not e_pause\n if interactable.is_a?(Chest)\n if @keys > 0 and interactable.locked\n interactable.unlock\n @keys -= 1\n @e_pause = true\n end\n end\n end\n end", "def show_single_key\n system(\"clear\")\n board.render\n\n c = read_char\n\n case c\n when \"\\e[A\"\n # puts \"UP ARROW\"\n board.selected_pos[0] -= 1 unless board.selected_pos[0] < 1\n when \"\\e[B\"\n board.selected_pos[0] += 1 unless board.selected_pos[0] > 7\n # puts \"DOWN ARROW\"\n when \"\\e[C\"\n board.selected_pos[1] += 1 unless board.selected_pos[1] > 7\n # puts \"RIGHT ARROW\"\n when \"\\e[D\"\n board.selected_pos[1] -= 1 unless board.selected_pos[1] < 1\n # puts \"LEFT ARROW\"\n when \"r\"\n make_move(board.selected_pos,\"r\")\n when \"f\"\n make_move(board.selected_pos,\"f\")\n when \"s\"\n save?\n end\n end", "def keyctrl_d(*)\n @stop = true\n end", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def process_key(key)\n case KeyHelper.key_symbol(key)\n when :up\n @past_menu = @cur_menu\n @cur_menu = (@cur_menu - 1) % @items.size\n when :down\n @past_menu = @cur_menu\n @cur_menu = (@cur_menu + 1) % @items.size\n when :enter\n # Erase body after call\n @past_menu = nil\n term.echo\n return :break, @items[@cur_menu].menu\n end\n\n return if key[0] != Ncurses::OK\n @items.each_with_index do |item, i|\n next unless key[2] =~ item.shortcut_regex\n @past_menu = @cur_menu\n @cur_menu = i\n end\n end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def update\n @held_timer.each do |k, v|\n if v < G.kb_held_delay; @held_timer[k] += 1\n else\n @held_interval[k] = 0\n @held_timer.delete k\n end\n end\n\n @held_interval.each do |k, v|\n if v < G.kb_held_interval; @held_interval[k] += 1\n else; @held_interval[k] = 0; end\n end\n\n @prev_down = @down.clone\n @down.clear\n @keys.each do |k|\n if G.window.button_down? k\n @down << k\n @held_timer[k] = 0 if @prev_down.index(k).nil?\n elsif @prev_down.index(k)\n @held_timer.delete k\n @held_interval.delete k\n end\n end\n end", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def control_key_down\r\n command 'controlKeyDown'\r\n end", "def scroll_up\n ESC + 'M'\n end", "def onKeyDown(key, repeat, flags, view)\n #puts \"onKeyDown: #{key}, #{flags}\"\n return if repeat > 1\n self.set_flags flags\n \n case( key )\n when VK_LEFT\n @keys |= LEFT_ARROW\n when VK_RIGHT\n @keys |= RIGHT_ARROW\n when VK_UP\n @keys |= UP_ARROW\n when VK_DOWN\n @keys |= DOWN_ARROW\n when '+'[0]\n @@speed += 1.0\n when '-'[0]\n @@speed -= 1.0\n @@speed = 1.0 if @@speed < 1.0\n else\n return\n end\n @speedx = @@speed\n @speedy = @@speed\n \n # get the distance from the camera to what we are looking at to control the speed\n @distance_to_target = self.guess_target_distance view\n \n view.animation = self\n view.dynamic = 3\nend", "def onKeyLongPress(keyCode, event) \n if @input.feed_key_event_up(keyCode)\n return true\n else\n return super keyCode, event\n end\n end", "def ctrl_w() send_keys(:ctrl_w) end", "def getchar \n while true \n ch = getch\n #$log.debug \"window getchar() GOT: #{ch}\" if ch != -1\n if ch == -1\n # the returns escape 27 if no key followed it, so its SLOW if you want only esc\n if @stack.first == 27\n #$log.debug \" -1 stack sizze #{@stack.size}: #{@stack.inspect}, ch #{ch}\"\n case @stack.size\n when 1\n @stack.clear\n return 27\n when 2 # basically a ALT-O, this will be really slow since it waits for -1\n ch = 128 + @stack.last\n @stack.clear\n return ch\n when 3\n $log.debug \" SHOULD NOT COME HERE getchar()\"\n end\n end\n @stack.clear\n next\n end\n # this is the ALT combination\n if @stack.first == 27\n # experimental. 2 escapes in quick succession to make exit faster\n if ch == 27\n @stack.clear\n return ch\n end\n # possible F1..F3 on xterm-color\n if ch == 79 or ch == 91\n #$log.debug \" got 27, #{ch}, waiting for one more\"\n @stack << ch\n next\n end\n #$log.debug \"stack SIZE #{@stack.size}, #{@stack.inspect}, ch: #{ch}\"\n if @stack == [27,79]\n # xterm-color\n case ch\n when 80\n ch = KEY_F1\n when 81\n ch = KEY_F2\n when 82\n ch = KEY_F3\n when 83\n ch = KEY_F4\n end\n @stack.clear\n return ch\n elsif @stack == [27, 91]\n if ch == 90\n @stack.clear\n return 353 # backtab\n end\n end\n # the usual Meta combos. (alt)\n ch = 128 + ch\n @stack.clear\n return ch\n end\n # append a 27 to stack, actually one can use a flag too\n if ch == 27\n @stack << 27\n next\n end\n return ch\n end\n end", "def elv_sepiatroce\n return Input.press?(:DOWN)\n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n elsif id == Gosu::KbA\n if @bgm_si == nil or !@bgm_si.playing?\n @bgm_si = @bgm.play(1, 1, true) # play (loop enabled)\n end\n elsif id == Gosu::KbZ\n if @bgm_si\n @bgm_si.stop # stop\n end\n elsif id == Gosu::KbP\n if @bgm_si\n if @bgm_si.paused?\n @bgm_si.resume # resume\n elsif @bgm_si.playing?\n @bgm_si.pause # pause\n end\n end\n end\n end", "def show_single_key\n c = read_char\n\n case c\n when \" \"\n pickUpItem()\n when \"i\"\n showInventory\n when \"m\"\n showMap\n when \"v\"\n inspectSurroundings\n puts \"working\"\n when \"q\"\n system ('clear && printf \"\\e[3J\"') or system (\"cls\")\n exit 0\n when \"k\"\n gameOver\n when \"\\e[A\"\n move(c)\n when \"\\e[B\"\n move(c)\n when \"\\e[C\"\n move(c)\n when \"\\e[D\"\n move(c)\n when \"\\u0003\"\n puts \"CONTROL-C\"\n exit 0\n end\nend", "def main_menu\n while(!$quit)\n case welcome_page\n when \"Login\"\n puts \"\\e[H\\e[2J\"\n login_loop\n when \"Register\"\n puts \"\\e[H\\e[2J\"\n register_loop\n when \"Exit\"\n exit\n end\n end\nend", "def button_down(key)\n MenuControllerContracts.invariant(self)\n @current_view.button_down(key)\n MenuControllerContracts.invariant(self)\n end", "def return_to_main_Screen\n puts \"\\nAny key to return \"\n print \":>\"\n gets.chomp\n clear_screen\nend", "def prompt\n\tputs \"Any Key to continue\"\n\tgets\nend", "def getchar \n while 1 \n ch = getch\n #$log.debug \"window getchar() GOT: #{ch}\" if ch != -1\n if ch == -1\n # the returns escape 27 if no key followed it, so its SLOW if you want only esc\n if @stack.first == 27\n #$log.debug \" -1 stack sizze #{@stack.size}: #{@stack.inspect}, ch #{ch}\"\n case @stack.size\n when 1\n @stack.clear\n return 27\n when 2 # basically a ALT-O, this will be really slow since it waits for -1\n ch = 128 + @stack.last\n @stack.clear\n return ch\n when 3\n $log.debug \" SHOULD NOT COME HERE getchar()\"\n end\n end\n @stack.clear\n next\n end\n # this is the ALT combination\n if @stack.first == 27\n # experimental. 2 escapes in quick succession to make exit faster\n if ch == 27\n @stack.clear\n return ch\n end\n # possible F1..F3 on xterm-color\n if ch == 79 or ch == 91\n #$log.debug \" got 27, #{ch}, waiting for one more\"\n @stack << ch\n next\n end\n #$log.debug \"stack SIZE #{@stack.size}, #{@stack.inspect}, ch: #{ch}\"\n if @stack == [27,79]\n # xterm-color\n case ch\n when 80\n ch = KEY_F1\n when 81\n ch = KEY_F2\n when 82\n ch = KEY_F3\n when 83\n ch = KEY_F4\n end\n @stack.clear\n return ch\n elsif @stack == [27, 91]\n if ch == 90\n @stack.clear\n return KEY_BTAB # backtab\n end\n end\n # the usual Meta combos. (alt)\n ch = 128 + ch\n @stack.clear\n return ch\n end\n # append a 27 to stack, actually one can use a flag too\n if ch == 27\n @stack << 27\n next\n end\n return ch\n end\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def rekey!; end", "def rekey!; end", "def scroll_down\n ESC + 'D'\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def keyUp(event)\n row = @autoCompleteTableView.selectedRow\n isShow = @autoCompletePopover.isShown\n\n #p \"wufield\"+ event.keyCode.to_s\n\n case event.keyCode\n when 125 #down\n if isShow\n @autoCompleteTableView.selectRowIndexes(NSIndexSet.indexSetWithIndex((row + 1)), byExtendingSelection: false)\n @autoCompleteTableView.scrollRowToVisible(@autoCompleteTableView.selectedRow)\n insert(self)\n return #skip default behavior\n end\n\n when 126 #up\n if isShow\n @autoCompleteTableView.selectRowIndexes(NSIndexSet.indexSetWithIndex((row - 1)), byExtendingSelection: false)\n @autoCompleteTableView.scrollRowToVisible(@autoCompleteTableView.selectedRow)\n insert(self)\n return #skip default behavior\n end\n when 36, 48, 51, 49 # return, tab, space\n if @myDelegate.respondsToSelector(\"didClickedCloseKey\")\n @myDelegate.didClickedCloseKey\n end\n\n self.autoCompletePopover.close()\n\n return #//skip default behavior\n else\n end\n\n super(event)\n complete(self)\n end", "def interactive_menu\n loop do\n print_menu\n user_input(STDIN.gets.chomp)\n end\nend", "def swipe_up_until(expected_element)\n while $home_page.user_expect_not_displayed?(expected_element) do\n $home_page.user_swipe_up\n end\nend" ]
[ "0.72400016", "0.6134243", "0.5773372", "0.5773372", "0.5691471", "0.56769526", "0.5587448", "0.5564512", "0.551409", "0.5501384", "0.5487634", "0.5484888", "0.5472499", "0.54629797", "0.5428086", "0.54059994", "0.5395215", "0.5380009", "0.5354265", "0.5317013", "0.53093505", "0.53040326", "0.5296565", "0.5267945", "0.5259734", "0.52459717", "0.524416", "0.52440596", "0.5203719", "0.51879734", "0.51879734", "0.5178565", "0.5172593", "0.5171292", "0.51650876", "0.5155201", "0.5147536", "0.514025", "0.5132632", "0.5126271", "0.50804377", "0.5074116", "0.5071211", "0.5066331", "0.50658697", "0.50658697", "0.5064542", "0.5064542", "0.50451666", "0.5042741", "0.5031311", "0.50245124", "0.5015558", "0.50058013", "0.50007343", "0.5000685", "0.49926007", "0.49654093", "0.49641868", "0.496021", "0.49587342", "0.49562877", "0.49495456", "0.49463603", "0.49462613", "0.49461263", "0.49307442", "0.49293524", "0.4928934", "0.49256724", "0.49162638", "0.49059314", "0.49054176", "0.49054176", "0.48913348", "0.48732346", "0.48644796", "0.48590896", "0.48580265", "0.48495907", "0.48419946", "0.4839689", "0.48375392", "0.48334813", "0.48260635", "0.48113647", "0.48029935", "0.48025852", "0.47973102", "0.47973102", "0.4781805", "0.4781805", "0.4777034", "0.477171", "0.477171", "0.47639182", "0.47609892", "0.47571525", "0.47459424", "0.4744801" ]
0.7090653
1
Simulates the user releasing the alt key.
def alt_key_up command 'altKeyUp' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alt_key_down\r\n command 'altKeyDown'\r\n end", "def key_released( event )\n @keys -= [event.key]\n end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def released( key )\n return KeyReleaseTrigger.new( key )\nend", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def enter_alt(alt)\n raise NotImplementedError\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def down_key\n @last = @choice\n @choice = (@choice < 2 ? @choice += 1 : 0)\n @choice_sound.play(1, 0.5, false)\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def button_down(id)\n if id == Gosu::Button::KbEscape\n close\n end\n end", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def up_key\n @last = @choice\n @choice = (@choice > 0 ? @choice -= 1 : 2)\n @choice_sound.play(1, 0.5, false)\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\nend", "def after_update\n @keys_pressed.clear\n @keys_released.clear\n end", "def meta_key_up\r\n command 'metaKeyUp'\r\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def activate_down(key)\n key_down.activate(key)\n key_held.deactivate(key)\n key_up.deactivate(key)\n end", "def unbind_key keycode\n @_key_args.delete keycode unless @_key_args.nil?\n @_key_map.delete keycode unless @_key_map.nil?\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def meta_key_down\r\n command 'metaKeyDown'\r\n end", "def deActivateKey _args\n \"deActivateKey _args;\" \n end", "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\tend", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def keyPressed(key, x, y)\n\n # If escape is pressed, kill everything. \n if (key == 27) \n # shut down our window \n glutDestroyWindow(@window)\n # exit the program...normal termination.\n exit(0) \n end\nend", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def deactivate()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.HotkeySystem_deactivate(@handle.ptr)\n end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def button_down(key)\n end", "def button_down(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n\r\n # Check if the player sprite can jump\r\n if [1,3,4,5,6].include?(get_tile_info(@player.get_x,\r\n @player.get_y,:down)) then\r\n\r\n # Call the jump function\r\n @player.jump\r\n\r\n # Player still might have a chance to \"double\" jump\r\n elsif @player.get_fall < 5 then\r\n @player.jump\r\n end\r\n end\r\n end", "def key_down_event _value\n send_cmd(\"key_down_event #{_value}\")\n end", "def key_up(*args, device: T.unsafe(nil)); end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def handle_keys\n exit if SDL::Key.press? SDL::Key::ESCAPE\n exit if SDL::Key.press? SDL::Key::Q\n self.paused = !paused if SDL::Key.press? SDL::Key::P\n end", "def any_key\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def key_down key\n @keys.push key\n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n end\n if id == Gosu::KbO && (not @twoplayer)\n @twoplayer = true\n @player.second_player_mode\n end\n if id == Gosu::KbR && @game_over\n @ball.reset\n @score.reset\n @game_over = false\n end\n end", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def control_key_down\r\n command 'controlKeyDown'\r\n end", "def send_modified_key(element_selector, key, *meta)\n wait_for_loading\n \n key_string = key\n key_string = \"alt+\" + key_string if meta.include? :alt\n key_string = \"ctrl+\" + key_string if meta.include? :control\n key_string = \"command+\" + key_string if meta.include? :command\n\n page.driver.execute_script(\"Mousetrap.trigger('#{key_string}');\")\n end", "def mouse_release *args\n\t\t\tevent(:mouse_release, *args)\n\t\tend", "def keystroke(character, *special_keys)\n special_keys = [\"command\"] if special_keys.length == 0\n special_keys_as_applescript_array = special_keys.map { |k|\n \"#{k} down\"\n }.join(\", \")\n execute_applescript(%Q'\n tell application \"System Events\"\n set frontApp to name of first item of (processes whose frontmost is true)\n tell application frontApp\n keystroke \"#{character}\" using {#{special_keys_as_applescript_array}}\n end\n end tell\n ')\n end", "def exit_game_reviews\n system('clear')\n graphic_thanks\n graphic_bottom\n print \"\\n\" + \" \" * 40 + \"Press any key to continue... \"\n STDIN.getch\n puts \"\"\n system('clear')\n exit\nend", "def close\n @graphic.ungetch(?q.ord)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def keyctrl_d(*)\n @stop = true\n end", "def remove_key_alt_name(id, key_alt_name)\n @encryption_io.remove_key_alt_name(id, key_alt_name)\n end", "def check_key_delete\n return unless open?\n return if @closing\n if Input.legacy_press?(:B)\n @esc_counter += 1\n if @esc_counter >= 50\n @esc_counter = 0\n selection_ok(nil)\n end\n else\n @esc_counter = 0\n end\n end", "def shift_key_down\r\n command 'shiftKeyDown'\r\n end", "def release(button: T.unsafe(nil), device: T.unsafe(nil)); end", "def press(key_sequence)\n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n elsif id == Gosu::KbA\n if @bgm_si == nil or !@bgm_si.playing?\n @bgm_si = @bgm.play(1, 1, true) # play (loop enabled)\n end\n elsif id == Gosu::KbZ\n if @bgm_si\n @bgm_si.stop # stop\n end\n elsif id == Gosu::KbP\n if @bgm_si\n if @bgm_si.paused?\n @bgm_si.resume # resume\n elsif @bgm_si.playing?\n @bgm_si.pause # pause\n end\n end\n end\n end", "def close_menu_with_key_press(menu_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_menu_closed(menu_name)\n end", "def activate_held(key)\n key_down.deactivate(key)\n key_held.activate(key) unless key_held.send(key)\n key_up.deactivate(key)\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def key_released?(key)\n @prev_down.index(key) and @down.index(key).nil?\n end", "def cursor_down(wrap = false)\n Sound.play_cursor\n Input.update\n deactivate\n call_handler(:down)\n end", "def ****_hidekeyboard\r\n begin\r\n\tif $driver.is_keyboard_shown\r\n\t $driver.press_keycode(4)\r\n\tend\r\n rescue Exception => e\r\n\t raise e.message\r\n\t raise e.backtrace.inspect\r\n end\r\nend", "def clear_screen_down\n CSI + 'J'\n end", "def clear\n @keys_pressed.clear\n @keys_released.clear\n @keys_down.cleae\n end", "def unclicked(e)\n puts \"Unclicked!\"\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def alt; end", "def while_key_up *args\n\t\t\tevent(:while_key_up, *args)\n\t\tend", "def ungetch(ch)\n Ncurses.ungetch(ch)\n end", "def button_up(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n @player.reset_jump if @player.is_jumping?\r\n end\r\n end", "def clear\n @key_down.clear\n @key_up.clear\n @key_held.clear\n @active = nil\n end", "def press_key(letter)\n advance_rotors\n @plugboard.translate(letter)\n end", "def rekey!; end", "def rekey!; end", "def button_down(id)\n # ENTER: launch A* algorithm\n if id == Gosu::KbReturn && ready?\n @grid.update_neighbors\n a_star\n @needs_reset = true\n end\n\n # SUPPR: clear window\n reset! if id == Gosu::KbDelete\n end", "def victory_end\n RPG::BGM.fade(500) unless skip?\n 20.times do; Graphics.update; end\n SceneManager.return\n battle_end(0)\n replay_bgm_and_bgs unless skip? || $BTEST\n end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def close_game\n show\n Ncurses.mvaddstr(MAXY - 1, 0, 'Press any key to exit')\n Ncurses.getch\n Ncurses.curs_set(1)\n Ncurses.endwin\n end", "def pointer_down(button = T.unsafe(nil), device: T.unsafe(nil), **opts); end", "def release? key=:any\n return @data.include? :up if key == :any\n @data[key] == :up\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def pressed?() sdl_event.press end", "def interact\n if not e_pause\n if interactable.is_a?(Chest)\n if @keys > 0 and interactable.locked\n interactable.unlock\n @keys -= 1\n @e_pause = true\n end\n end\n end\n end", "def unlock( actor, silent = false, override = false )\n\t\tif not @locked\n\t\t\tactor.output \"It isn't locked.\" unless silent\n\t\t\treturn false\n\t\telsif actor.items.map(&:id).include?(@key_id) || override\n @reset.activate if @reset\n\t\t\tunless silent\n\t\t\t\tactor.output \"Click.\"\n if @direction\n\t (actor.room.occupants - [actor]).each_output \"0<N> unlocks the #{self.name} to the #{@direction.name}.\", [actor]\n else\n (actor.room.occupants - [actor]).each_output \"0<N> unlocks #{self.name}.\", [actor]\n end\n\t\t\tend\n\n\t\t\t@locked = false\n\t\t\t@pair.unlock( actor, true, override ) if @pair\n\t\t\treturn true\n\t\telse\n\t\t\tactor.output \"You lack the key.\" unless silent\n\t\t\treturn false\n\t\tend\n\tend", "def shift_down\n if GameWindow.instance.button_down?(Gosu::KbRightShift) || GameWindow.instance.button_down?(Gosu::KbLeftShift)\n true\n else\n false\n end\n end", "def wdelch\n Ncurses.wdelch(pointer)\n end", "def release_mouse(button)\n XDo::FFILib.xdo_mouseup @_xdo_pointer, @_window, button\n end", "def update\n\t\tif self.button_down?(Gosu::KbLeft)\n \t\tclose\n \tend\n end", "def hold\n action('hold')\n end" ]
[ "0.71781206", "0.64977336", "0.61834204", "0.61346126", "0.6099386", "0.60806715", "0.5796961", "0.5782629", "0.57585025", "0.57407683", "0.57407683", "0.5729792", "0.5626446", "0.5597214", "0.55585194", "0.5549129", "0.55478543", "0.5514924", "0.5493437", "0.5482966", "0.547304", "0.54679304", "0.546735", "0.5454973", "0.54395896", "0.5432745", "0.5413819", "0.5391651", "0.5380437", "0.53714895", "0.5363978", "0.5363978", "0.5359003", "0.5351839", "0.53500605", "0.5323458", "0.5306065", "0.53021026", "0.52876014", "0.52611184", "0.525633", "0.525633", "0.52316856", "0.5172027", "0.51665676", "0.51592016", "0.51584905", "0.51487875", "0.5133825", "0.51303214", "0.5128029", "0.51279956", "0.5105428", "0.5102064", "0.5097784", "0.50913215", "0.50894177", "0.5085922", "0.5080317", "0.5080317", "0.5063859", "0.5063766", "0.5055422", "0.5055186", "0.50448626", "0.5043759", "0.503619", "0.50217474", "0.50093263", "0.500518", "0.5002187", "0.49341747", "0.49251515", "0.49175757", "0.49147382", "0.49106464", "0.4909385", "0.48941562", "0.48941085", "0.48853025", "0.48624107", "0.48611328", "0.486006", "0.4849352", "0.4849352", "0.48492166", "0.48198786", "0.4803719", "0.48015684", "0.48004243", "0.47974288", "0.47965577", "0.47889256", "0.47885796", "0.47881675", "0.4782693", "0.4781711", "0.477729", "0.47768798", "0.47723427" ]
0.73549134
0
Halt the currently running test, and wait for the user to press the Continue button. This command is useful for debugging, but be careful when using it, because it will force automated tests to hang until a user intervenes manually. NOTE: break is a reserved word in Ruby, so we have to simulate Selenium core's break() with brake()
def brake command 'break' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait\n continue = false\n trap \"SIGINT\" do\n puts \"Continuing...\"\n continue = true\n end\n puts \"Waiting. Press ^C to continue test...\"\n wait_until(3600) { continue }\n trap \"SIGINT\", \"DEFAULT\"\n end", "def _pause_if_needed\n return unless Nenv.cuke_step?\n\n STDOUT.puts \"\\n\\nPress enter to continue\"\n STDIN.gets\n end", "def halt\n StepResult.new(false)\n end", "def click_continue_button\n click_button(@continue_button_text)\n end", "def break\n @break = true\n end", "def cancel\n self.break_condition = 1\n end", "def enter_to_continue\n puts \"\\n\"\n puts \"\\t\\t--------Press Enter to Continue------\"\n continue = gets\n end", "def click_continue\n logger.debug 'Clicking continue'\n wait_for_load_and_click_js continue_button_element\n end", "def continue?(message = 'Continue? (y|n)', expectation = 'y')\n abort 'Aborted!' unless prompt(message) == expectation\nend", "def test_03()\n\t\tputs \"Inside test 3\"\n\t\t$browser.stop\n\t\t\n\tend", "def halt!\n @halt = true\n end", "def halt!\n @running = false\n return nil\n end", "def abort(reason)\n puts \"Test failed: #{reason}\"\n if EventMachine.reactor_running?\n EventMachine.stop()\n end\n exit(FAILURE_EXIT_STATUS)\n end", "def halt\n throw :halt\n end", "def exit_skipping_test()\n Process.exit 99\nend", "def halt\n @executor.shutdown\n end", "def click_on_end_tour_button\n\n click_button END_TOUR_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def run_until_halt frequenz = 0\n\n # clear Istruction Register\n @ir.content = [0]*@ir.length\n\n # set controlunit to start of fetch\n @controlunit.mip = 0x00\n\n until cur_cmd.description.include? \"HALT\"\n clk\n yield if block_given?\n sleep frequenz\n end\n\n end", "def pause\n $stderr.write('Press CTRL+j or ENTER to continue') && $stdin.gets\n end", "def pause\n print \"Press Enter/Return to continue...\"\n gets\n end", "def halt!(*)\n @halted = true\n end", "def te_st_099_WIP\r\n\r\n sTestCase_Name = \"test_099_WIP\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n puts2(\"Close the window\")\r\n\r\n # Set the flag to close the $browser after the last test case runs\r\n @@bCloseBrowser = true\r\n\r\nend", "def delayed_exit\n sleep 0.1\n exit\n end", "def expect_interrupt\n\tbegin\n\t\tyield\n\trescue Interrupt\n\t\tputs # to separate the typed `^C` from upcoming program output or shell prompt\n\tend\nend", "def mission_abort_protocol\n puts \"\"\n puts \"The launch was aborted!\"\n puts \"\"\n puts \"Would you like to retry mission: #{@mission.name}? (y/n):\"\n\n if affirm_prompt\n @mission.reset\n execute_mission\n end\n end", "def option_to_continue\n puts \"Would you like to continue? yes/no\"\n continue?\nend", "def resume\n @halt = false\n end", "def continue_when_ready\n wait_until(5, \"Continue element not visible in 5 seconds\") do\n continue_element.visible? \n end\n continue\n end", "def prompt_for_continue\n result = @env.ui.ask(\"Deployment paused for manual review. Would you like to continue? (y/n) \")\n if result.upcase != \"Y\"\n @env.ui.info(\"Deployment push action cancelled by user\")\n return false\n end\n true\n end", "def go_back_and_wait\n selenium.go_back\n wait_for_page_to_load\n end", "def breakpoint!(text='Click anywhere to continue...', timeout=0)\n puts \">> breakpoint reached. click anywhere in the browser to continue\"\n\n text = text.gsub(\"\\\"\", \"\\\\\\\"\")\n\n execute_scopejs_script %(\n document.body.appendChild(div(\n {\n id: '_breakpoint_overlay',\n style: 'background-color: rgba(0, 0, 0, 0.6); position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; text-align: center;',\n onClick: function() { App.remove_element('_breakpoint_overlay'); }\n },\n p({ style: 'margin: 150px 100px; line-height: 60px; font-size: 50px; color: white; text-shadow: 3px 3px #000' }, \"#{text}\"))\n );\n if (#{timeout} > 0) setTimeout(function() {\n var e = document.getElementById('_breakpoint_overlay');\n e.parentNode.removeChild(e);\n }, #{timeout});\n console.log(\"** Breakpoint reached **\");\n )\n\n while execute_scopejs_script(\"return document.getElementById('_breakpoint_overlay');\") do\n sleep 0.25 # waiting a little\n end\n\n puts \">> continuing from breakpoint\"\n end", "def stop\n msg = \"guard-self_test is stopped...\"\n UI.info msg\n Notifier.notify(msg)\n end", "def break\n if ! advance? then return self end\n @@logger.debug \"Handle break.\"\n SandboxModule::set_break\n @break_at = SandboxModule::line_count\n return self\n end", "def testStop(testResult)\n\n params = {\n :success => testResult.isSuccessful\n }\n\n if !testResult.isSuccessful\n params['failureDescription'] = testResult.message\n params['failureReason'] = testResult.failureReason\n end\n\n executeScript($END_TEST_COMMAND, params)\n return true\n end", "def trap(sig)\n ::Signal.trap(sig) do\n puts\n puts \"Interrupt! Signals from an interruption are not thread-safe.\"\n \n call_prompt = true\n 3.times do\n print \"Wait for thread-safe break? (y/n): \"\n\n case gets.strip\n when /^y(es)?$/i\n puts \"waiting for break...\"\n app.pq(self, [])\n call_prompt = false\n break\n\n when /^no?$/i\n break\n end\n end\n\n if call_prompt\n call([])\n end\n end\n end", "def halt\n end", "def continue\n @proceed = true\n end", "def break?\n @break\n end", "def setup_end_action\n @break_action = true\n @finish = true\n end", "def test_08_stop_browser()\n\t\tstopBrowser()\n\tend", "def enter_to_continue\r\n @prompt.keypress('Press space or enter to continue', keys: %i[space return])\r\n end", "def manual_stop!\n exit 1 if stopping?\n stop!\n STDOUT.puts \"Press Ctrl-C again to stop immediately.\"\n end", "def step_2(continue = true)\n\twait = Selenium::WebDriver::Wait.new(timeout: 3)\n\tsaa = SaaPage.new()\n\t#Click 'no' under \"Has this patient had an exam with us in the past?\"\n\twait.until { saa.past_exam_no.displayed? }\n\tsaa.past_exam_no.click\n\n\t#Click \"18 or older\" under \"How old is the patient?\"\n\twait.until { saa.how_old_over_18.displayed? }\n\tsaa.how_old_over_18.click\n\n\t# Click on \"Select primary reason\" and choose an item\n\twait.until { saa.primary_reason_dropdown.displayed? }\n\tjs_scroll_up(saa.primary_reason_dropdown)\n\tsaa.primary_reason_dropdown.click\n\n\twait.until { saa.primary_reason_item(2).displayed? }\n\tjs_scroll_up(saa.primary_reason_item,true)\n\tsaa.primary_reason_item(2).click\n\n\t#Click on \"Next Step\" CTA\n\tif continue\n\t\twait.until { saa.next_step.displayed? }\n\t\tsaa.next_step.click\n\t\t#Allow accordion menu to open\n\t\tsleep 1\n\tend\nend", "def halt; end", "def halt; end", "def wait(str='Press ENTER to continue.')\n puts\n self.warning(str)\n STDIN.gets\n end", "def run\n until halted?\n step\n end\n end", "def pause_here\n puts \"\\n\\nHit ENTER to continue\"\n gets.chomp\nend", "def loop(break_condition=-1, timeout=0, &blck)\n self.break_condition = block_given? ? blck : break_condition\n self.timeout_period = timeout\n self\n end", "def break!\n if @broke\n puts \"Cup is already broken! calm yourself!\"\n else\n @broke = true\n puts \"Splat!!!\"\n end\n end", "def continue\n if gets == \"\\n\"\n system \"clear\"\n main\n end\n end", "def quit!\n @done = true\n @quit = true\n\n # If quit! is called from other than a command, we need to interrupt the\n # breakpoint listener thread\n unless @debug_thread\n @breakpoint_tracker.debug_channel.send nil\n @breakpoint_listener.join\n end\n end", "def break_v_return_2(r_v_b)\n\tcounter = 0\n\tuntil counter == 10\n\t\tputs counter +=1\n\t\treturn if counter == 5 && r_v_b == \"return\"\n\t\tbreak if counter == 5 && r_v_b == \"break\"\n\tend\n\n\tputs \"If you see me, a break(or nothing) must have been used\"\nend", "def pressToContinue\n puts \"\\n\"\n print \"Press enter to continue. \"\n gets.chomp\n end", "def abort_test!\n throw 'abort_test!'\n end", "def wait_for_prompt\n while !@prompted do\n sleep(0.2)\n end\n end", "def break\n\t\t# Jump back into the outer loop of #each \n\t\tthrow( :break ) if @iterating\n\tend", "def stop_test(test)\n puts \"Test was stopped mid execution: #{test.uri}\"\n end", "def test_05_stop_browser()\n\t\tstopBrowser()\n\tend", "def finish_turn\n waiting_to_confirm_done = true\n invalid_confirmation = nil\n\n while waiting_to_confirm_done\n DisplayManager.prepare_ingame_display\n show_state\n puts 'Done! Your turn is now over.'\n puts InputManager.input_options({ affirmative: 'Hide my Rack'}, invalid_confirmation)\n invalid_confirmation = nil\n \n response = InputManager.get\n\n if InputManager.affirmative?(response)\n waiting_to_confirm_done = false\n elsif InputManager.negative?(response)\n # do nothing, wait\n else\n invalid_confirmation = response\n end\n end \n\n DisplayManager.prepare_ingame_display\n end", "def quit()\n $webdriver.quit()\n cleanUp();\n $webdriver = nil;\n TestAttributes.put(\"reuseFixture\", null);\n end", "def finish_wait\n if @thread\n unless @thread.alive?\n breakpoints = @thread[:breakpoints] || []\n breakpoints_reached = @thread[:breakpoints_reached] || []\n missed_breakpoints = breakpoints - breakpoints_reached\n if missed_breakpoints.any?\n raise \"Breakpoint(s) #{missed_breakpoints.to_a.join(', ')}\" +\n \"not reached!\"\n end\n end\n @thread.wakeup\n ::Thread.stop\n else\n run_until(nil)\n end\n end", "def continue\n frm.div(:class=>\"highlightPanel\").span(:id=>\"submitnotifxxx\").wait_while_present\n frm.button(:value=>\"Continue\").click\n end", "def go\n catch(:quit) do\n loop do\n step\n end\n end\n end", "def go\n catch(:quit) do\n loop do\n step\n end\n end\n end", "def halt\n begin\n \n # how can i check something like cygcheck -l shutdown|grep shutdown.exe ??\n # I'd like to show a message like: You do not have a proper shutdown for cygwin installed, please install shutdown.\n # Don't use windows shutdown, wasn't cutting it for me. We need cyg-get shutdown!! Don't have cyg-get, install it with cinst cyg-get\n su_cmd = vm.config.cygwin.suexec_cmd\n su_cmd += \" \" if ! su_cmd.empty? \n @logger.info(\"Cygwin shutdown -s -f now\")\n vm.communicate.execute(\"#{su_cmd}shutdown -s -f now\")\n rescue IOError\n # Ignore, this probably means connection closed because it\n # shut down.\n end\n end", "def go\n catch(:quit) do\n loop do\n step\n end\n end\n end", "def abort(message)\n UI.puts \"PROGRAM HALT: #{message}\"\n Kernel.abort message\n end", "def skip_wait\n @skip_wait = true\n end", "def stop_test_step\n return logger.error { \"Could not stop test step, no step is running\" } unless current_test_step\n\n logger.debug { \"Stopping test step: #{current_test_step.name}\" }\n current_test_step.stop = ResultUtils.timestamp\n current_test_step.stage = Stage::FINISHED\n clear_last_test_step\n end", "def click_wait\n @webpage.click_wait(@locator)\n end", "def wait_for_elements\n super\n @wait_on << :continue_button\n end", "def exit_jukebox\n puts \"Goodbye!\"\n # I feel like this still needs something to exit the program though, but apparently rspec doesn't care\nend", "def run_until(breakpoint=nil)\n Breakpoints.main_thread = ::Thread.current\n if breakpoint && @thread\n @thread[:breakpoints] ||= Set.new\n @thread[:breakpoints_reached] ||= Set.new\n @thread[:breakpoints] << breakpoint\n self.finish_wait\n return\n end\n\n @thread ||= ::Thread.new do\n if breakpoint\n ::Thread.current[:breakpoints] ||= Set.new\n ::Thread.current[:breakpoints_reached] ||= Set.new\n ::Thread.current[:breakpoints] << breakpoint\n begin\n @block_to_run.call\n unless ::Thread.current[:breakpoints_reached].include?(breakpoint)\n raise \"Breakpoint #{breakpoint} not reached!\"\n end\n end\n else\n @block_to_run.call\n end\n # return control back to main thread\n Breakpoints.main_thread.run\n end\n ::Thread.stop\n end", "def continue_prompt\r\n puts \"Press enter key to continue....\"\r\n continue = gets.chomp\r\n end", "def i_continue\n yield\n puts \"after yield\"\nend", "def debug it\n PryByebug::BreakCommand.new.send :add_breakpoint, \"Testo::Test#run\", nil\n # How to \"next next step\" automatically when the breakpoint is hit?\n\n begin\n run it\n raise \"Cannot reproduce. It might be a heisebug.\"\n rescue\n $!\n end\nend", "def before_step_result(keyword, step_match, multiline_arg, status,\n exception, source_indent, background)\n if status != :failed && @in_background ^ background\n @hide_this_step = true\n else\n @hide_this_step = false\n end\n end", "def test_a_few_nonfunctional_cases\n run_test_as('wizard') do\n assert_equal 0, simplify(command(%Q|; fork (0); suspend(0); endfork|))\n send_string %Q|; kill_task(task_id());|\n end\n end", "def go_back_and_wait\n go_back\n assert_page_loaded\n end", "def _interrupt\n\t\tbegin\n\t\t\tuser_want_abort?\n\t\trescue Interrupt\n\t\t\t# The user hit ctrl-c while we were handling a ctrl-c, send a\n\t\t\t# literal ctrl-c to the shell. XXX Doesn't actually work.\n\t\t\t#$stdout.puts(\"\\n[*] interrupted interrupt, sending literal ctrl-c\\n\")\n\t\t\t#$stdout.puts(run_cmd(\"\\x03\"))\n\t\tend\n\tend", "def wait_for_step_event\n while(true)\n event = wait_for_event\n if(event.java_event.java_kind_of?(com.sun.jdi.event.StepEvent))\n return\n else\n process_event(event)\n end\n end\n end", "def check_if_end_tour_button_is_displayed\n\n page.should have_button(END_TOUR_BUTTON)\n sleep(THREAD_SLEEP_1)\n\n end", "def halt\n throw :halt, response\n end", "def stop(message = nil)\r\n @assert = false\r\n end", "def halt(status = 0)\n exit status\n end", "def pause\n puts \"press ENTER to cotinue\"\n h_line \n gets\n nil\nend", "def wait\n sleep WAIT_TIME unless @skip_wait\n end", "def use_blocker\n blocker do\n # next\n # break\n # return\n \"HA!\"\n # next\n # break\n # return\n end\n puts \"DONE!\"\nend", "def wait_for_element_and_click(element)\n wait_for_element(element)\n \n i = 0\n begin\n @element.click\n rescue Exception => ex\n i+=1\n sleep(1)\n retry if i<20\n raise ex \n end\n \n end", "def stop_hooks_unless(result)\n\t\t\t\t\t(result == true) ? continue(true) : stop(false)\n\t\t\t\tend", "def test_break_statement_returns_values\n i = 1\n result = while i <= 10\n break i if i % 2 == 0\n i += 1\n end\n\n assert_equal 2, result\n end", "def halted(command)\n end", "def pullBreakWindows\n puts \"You pull the break\"\n sleep(1)\n puts \"This disrupts the natural order of the trolley schedule\"\n sleep(1)\n puts \"because of this millions of people are late to work and the economy is ruined\"\n sleep(1)\n puts \"the collapse of society is on your hands\"\n sleep(1)\n\n end", "def test_document_server(url)\n test_name = \"Test Document Server Connection\"\n puts test_name\n get_website(url)\n login_as_guest_test\n if @browser.find_element(:css=>'.focus') #Dismisses the splashscreen if present\n @wait.until{@browser.find_element(:css=>'.focus')}.click\n end\n login_toolshelf_button_test\n login_test\nend", "def break(breakpoint)\n if ::Thread.current[:breakpoints] &&\n ::Thread.current[:breakpoints].include?(breakpoint)\n ::Thread.current[:breakpoints_reached] << breakpoint\n puts \"breaking on #{breakpoint}\"\n self.main_thread.run\n ::Thread.stop\n end\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def break!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n type = BREAK\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 139:9: 'break'\n match( \"break\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end", "def first_steps\n loop do\n puts \"Right foot back\"\n sleep (0.5)\n puts \"Left foot back\"\n sleep (0.5)\n puts \"Right foot back\"\n sleep (0.5)\n puts \"Stop\"\n sleep (1)\n end\nend", "def continue_browsing\n puts \"Would you like to keep learning more about COVID-19 spread?\".green\n user_input = gets.strip.downcase\n\n until user_input == \"yes\" || user_input == \"no\"\n puts \"I didn't understand that command.\".red\n puts \"Please enter YES or NO\".green\n user_input = gets.strip.downcase\n end\n\n user_input == \"yes\" ? program_run : sign_off\n end" ]
[ "0.6622353", "0.6220131", "0.59026587", "0.584939", "0.5823783", "0.5711176", "0.56882495", "0.5548701", "0.5527768", "0.5438415", "0.5418043", "0.54177445", "0.53967035", "0.537108", "0.5368323", "0.5338758", "0.53374106", "0.53285336", "0.532562", "0.52835774", "0.5270502", "0.5258251", "0.52424246", "0.5220177", "0.5202681", "0.51975995", "0.5197324", "0.51911026", "0.5174768", "0.5153272", "0.5152044", "0.5150101", "0.5148996", "0.51474124", "0.51392066", "0.5138895", "0.51352376", "0.5129847", "0.5123576", "0.5115773", "0.51132", "0.5099919", "0.5097611", "0.50945896", "0.50945896", "0.50875837", "0.5084828", "0.5071636", "0.5063295", "0.50439715", "0.5039666", "0.5035472", "0.5033274", "0.5033079", "0.50330323", "0.5024074", "0.50057185", "0.5001768", "0.49742785", "0.49728408", "0.4962913", "0.4961728", "0.49602744", "0.49589974", "0.49589974", "0.49512908", "0.49470562", "0.49463773", "0.4937297", "0.4927197", "0.49225014", "0.4915991", "0.49111536", "0.49103966", "0.4907615", "0.48997518", "0.48974684", "0.489123", "0.48909825", "0.48900384", "0.48882043", "0.4883602", "0.48830646", "0.4880478", "0.48794818", "0.4874979", "0.48666033", "0.48659688", "0.48648417", "0.48641604", "0.48630992", "0.48621562", "0.4852265", "0.4850204", "0.48484385", "0.48404202", "0.48378605", "0.48288757", "0.48254615", "0.48245972" ]
0.5519459
9
Simulates the user pressing the alt key and hold it down until do_control_up() is called or a new page is loaded.
def control_key_down command 'controlKeyDown' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def alt_key_down\r\n command 'altKeyDown'\r\n end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def while_key_up *args\n\t\t\tevent(:while_key_up, *args)\n\t\tend", "def ctrl_l() send_keys(:ctrl_l) end", "def send_modified_key(element_selector, key, *meta)\n wait_for_loading\n \n key_string = key\n key_string = \"alt+\" + key_string if meta.include? :alt\n key_string = \"ctrl+\" + key_string if meta.include? :control\n key_string = \"command+\" + key_string if meta.include? :command\n\n page.driver.execute_script(\"Mousetrap.trigger('#{key_string}');\")\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def hold_screen\n print 'Press Enter to continue.'\n gets.chomp\n end", "def enter_alt(alt)\n raise NotImplementedError\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def resume(view)\n @ctrlDown = false\n @shiftDown = false\n end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def keyctrl_d(*)\n @stop = true\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def meta_key_up\r\n command 'metaKeyUp'\r\n end", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def hotkeys\n loop do\n c = @screen.getch\n\n case c\n when Ncurses::KEY_DOWN, 14, 'j'.ord\n scroll_down\n\n when Ncurses::KEY_UP, 16, 'k'.ord\n scroll_up\n\n when Ncurses::KEY_NPAGE\n (maxy - 2).times do\n break if !scroll_down\n end\n\n when Ncurses::KEY_PPAGE\n (maxy - 2).times do\n break if !scroll_up\n end\n\n when Ncurses::KEY_LEFT\n while scroll_up; end\n\n when Ncurses::KEY_RIGHT\n while scroll_down; end\n\n when 'q'.ord\n break\n\n when @callbacks[c]\n true\n\n end\n\n @screen.move(0, 0)\n end\n end", "def meta_key_down\r\n command 'metaKeyDown'\r\n end", "def ctrl_w() send_keys(:ctrl_w) end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\nend", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def any_key\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def up_key\n @last = @choice\n @choice = (@choice > 0 ? @choice -= 1 : 2)\n @choice_sound.play(1, 0.5, false)\n end", "def zoom_in_out_till_element_display(access_type, in_out, access_name)\n \n if get_os==\"windows\"\n key=\"control\"\n elsif get_os==\"mac\"\n key=\"command\"\n end\n\n while true\n \n if WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}.displayed?\n break\n else\n $driver.action.key_down(:\"#{key}\").send_keys(:\"#{in_out}\").key_up(:\"#{key}\").perform\n end\n end\n\nend", "def button_down_game_replay_presenter(id, window, state)\n if id == Gosu::KbSpace\n navigate_back(window) if id == Gosu::KbSpace\n end\n level_up(state) if id == Gosu::KbRight\n level_down(state) if id == Gosu::KbLeft\nend", "def activate_up(key)\n key_down.deactivate(key)\n key_held.deactivate(key)\n key_up.activate(key)\n end", "def onKeyDown(key, repeat, flags, view)\r\n if key == VK_END # toggle zig direction\r\n toggle_direc_flag()\r\n end\r\n if key == VK_HOME # toggle use of flood fill\r\n @flood = !@flood\r\n if (@flood)\r\n @statusmsg = @statusmsgBase2 + \"FLOOD #{@stepover_percent}%\"\r\n else\r\n @statusmsg = @statusmsgBase + \"StepOver #{@stepover_percent}%\"\r\n end\r\n Sketchup::set_status_text(@statusmsg, SB_PROMPT)\r\n end\r\n\r\n if (key == VK_SHIFT)\r\n @keyflag = 1\r\n else\r\n if (key == VK_CONTROL)\r\n @keyflag = 2\r\n else\r\n super #process other keys for depth selection\r\n end\r\n end\r\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def ****_hidekeyboard\r\n begin\r\n\tif $driver.is_keyboard_shown\r\n\t $driver.press_keycode(4)\r\n\tend\r\n rescue Exception => e\r\n\t raise e.message\r\n\t raise e.backtrace.inspect\r\n end\r\nend", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def activate_down(key)\n key_down.activate(key)\n key_held.deactivate(key)\n key_up.deactivate(key)\n end", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def button_up(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n @player.reset_jump if @player.is_jumping?\r\n end\r\n end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def key_up(*args, device: T.unsafe(nil)); end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def down_key\n @last = @choice\n @choice = (@choice < 2 ? @choice += 1 : 0)\n @choice_sound.play(1, 0.5, false)\n end", "def pagedown\n page.driver.browser\n .execute_script('return document.body')\n .send_keys(:page_down)\n end", "def pressToContinue\n puts \"\\n\"\n print \"Press enter to continue. \"\n gets.chomp\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n \n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\nend", "def button_up(key)\n close if key == Gosu::KbEscape\n\n # reset the game\n if @state == :end && key == Gosu::MsLeft\n @board = Board.new(self, 22, @root_dir)\n @state = :game\n return\n end\n\n @player_b.ai_inc if key == Gosu::KbS\n @player_b.ai_dec if key == Gosu::KbD\n\n if @player_on_turn.class == HotseatPlayer && key == Gosu::MsLeft\n if @board.cell_clicked(mouse_x, mouse_y, @player_on_turn.sym)\n\n return if @state == :end\n\n switch_players\n\n if @player_on_turn.class == AIPlayer\n @player_on_turn.make_move(@board)\n switch_players\n end\n end\n end\n end", "def zoom_in_out(in_out)\n if get_os==\"windows\"\n key=\"control\"\n elsif get_os==\"mac\"\n key=\"command\"\n end\n\n $driver.action.key_down(:\"#{key}\").send_keys(:\"#{in_out}\").key_up(:\"#{key}\").perform\nend", "def scroll_up\n ESC + 'M'\n end", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def wait_for_press\n wait_for_presses(1)\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n\n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\n end", "def pause\n print \"Press Enter/Return to continue...\"\n gets\n end", "def button_down(id)\n # ENTER: launch A* algorithm\n if id == Gosu::KbReturn && ready?\n @grid.update_neighbors\n a_star\n @needs_reset = true\n end\n\n # SUPPR: clear window\n reset! if id == Gosu::KbDelete\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n \n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\n end", "def button_down(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n\r\n # Check if the player sprite can jump\r\n if [1,3,4,5,6].include?(get_tile_info(@player.get_x,\r\n @player.get_y,:down)) then\r\n\r\n # Call the jump function\r\n @player.jump\r\n\r\n # Player still might have a chance to \"double\" jump\r\n elsif @player.get_fall < 5 then\r\n @player.jump\r\n end\r\n end\r\n end", "def button_down(key)\n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n elsif id == Gosu::KbA\n if @bgm_si == nil or !@bgm_si.playing?\n @bgm_si = @bgm.play(1, 1, true) # play (loop enabled)\n end\n elsif id == Gosu::KbZ\n if @bgm_si\n @bgm_si.stop # stop\n end\n elsif id == Gosu::KbP\n if @bgm_si\n if @bgm_si.paused?\n @bgm_si.resume # resume\n elsif @bgm_si.playing?\n @bgm_si.pause # pause\n end\n end\n end\n end", "def event_loop\n loop do\n Curses.doupdate\n @message.clear\n\n case key = @message.getch\n when 9 then @display.next_link\n when 'Z', 353, Curses::Key::BTAB then @display.previous_link # shift-tab\n\n when 10, Curses::Key::ENTER then display_name @display.current_link\n\n when Curses::Key::LEFT then go_to @history.back\n when Curses::Key::RIGHT then go_to @history.forward\n\n when Curses::Key::END then @display.scroll_bottom\n when Curses::Key::HOME then @display.scroll_top\n when 'j', Curses::Key::DOWN then @display.scroll_down\n when 'k', Curses::Key::UP then @display.scroll_up\n when ' ', Curses::Key::NPAGE then @display.page_down\n when Curses::Key::PPAGE then @display.page_up\n\n when 'h' then\n display @history.list, nil\n when 'i' then\n @message.show \"pos: #{@history.position} items: #{@history.pages.length}\"\n\n when 'Q', 3, 4 then\n break # ^C, ^D\n when 26, Curses::Key::SUSPEND then\n Curses.close_screen\n Process.kill 'STOP', $$\n when nil, Curses::Key::RESIZE then\n @display.update_size\n @message.update_size\n\n when 'g' then display_name @message.prompt\n\n else\n @message.error \"unknown key #{key.inspect}\"\n end\n end\n end", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def getchar \n while true \n ch = getch\n #$log.debug \"window getchar() GOT: #{ch}\" if ch != -1\n if ch == -1\n # the returns escape 27 if no key followed it, so its SLOW if you want only esc\n if @stack.first == 27\n #$log.debug \" -1 stack sizze #{@stack.size}: #{@stack.inspect}, ch #{ch}\"\n case @stack.size\n when 1\n @stack.clear\n return 27\n when 2 # basically a ALT-O, this will be really slow since it waits for -1\n ch = 128 + @stack.last\n @stack.clear\n return ch\n when 3\n $log.debug \" SHOULD NOT COME HERE getchar()\"\n end\n end\n @stack.clear\n next\n end\n # this is the ALT combination\n if @stack.first == 27\n # experimental. 2 escapes in quick succession to make exit faster\n if ch == 27\n @stack.clear\n return ch\n end\n # possible F1..F3 on xterm-color\n if ch == 79 or ch == 91\n #$log.debug \" got 27, #{ch}, waiting for one more\"\n @stack << ch\n next\n end\n #$log.debug \"stack SIZE #{@stack.size}, #{@stack.inspect}, ch: #{ch}\"\n if @stack == [27,79]\n # xterm-color\n case ch\n when 80\n ch = KEY_F1\n when 81\n ch = KEY_F2\n when 82\n ch = KEY_F3\n when 83\n ch = KEY_F4\n end\n @stack.clear\n return ch\n elsif @stack == [27, 91]\n if ch == 90\n @stack.clear\n return 353 # backtab\n end\n end\n # the usual Meta combos. (alt)\n ch = 128 + ch\n @stack.clear\n return ch\n end\n # append a 27 to stack, actually one can use a flag too\n if ch == 27\n @stack << 27\n next\n end\n return ch\n end\n end", "def restart\n while get_state() == 'LOST'\n # Press a key to get score.\n @driver.action.send_keys(:up).perform\n sleep(0.2)\n end\n\n while get_state() == 'MENU'\n @driver.action.send_keys(:space).perform\n sleep(0.2)\n end\n\n @driver.action.send_keys(:space).perform\n end", "def return_to_main_Screen\n puts \"\\nAny key to return \"\n print \":>\"\n gets.chomp\n clear_screen\nend", "def getchar \n while 1 \n ch = getch\n #$log.debug \"window getchar() GOT: #{ch}\" if ch != -1\n if ch == -1\n # the returns escape 27 if no key followed it, so its SLOW if you want only esc\n if @stack.first == 27\n #$log.debug \" -1 stack sizze #{@stack.size}: #{@stack.inspect}, ch #{ch}\"\n case @stack.size\n when 1\n @stack.clear\n return 27\n when 2 # basically a ALT-O, this will be really slow since it waits for -1\n ch = 128 + @stack.last\n @stack.clear\n return ch\n when 3\n $log.debug \" SHOULD NOT COME HERE getchar()\"\n end\n end\n @stack.clear\n next\n end\n # this is the ALT combination\n if @stack.first == 27\n # experimental. 2 escapes in quick succession to make exit faster\n if ch == 27\n @stack.clear\n return ch\n end\n # possible F1..F3 on xterm-color\n if ch == 79 or ch == 91\n #$log.debug \" got 27, #{ch}, waiting for one more\"\n @stack << ch\n next\n end\n #$log.debug \"stack SIZE #{@stack.size}, #{@stack.inspect}, ch: #{ch}\"\n if @stack == [27,79]\n # xterm-color\n case ch\n when 80\n ch = KEY_F1\n when 81\n ch = KEY_F2\n when 82\n ch = KEY_F3\n when 83\n ch = KEY_F4\n end\n @stack.clear\n return ch\n elsif @stack == [27, 91]\n if ch == 90\n @stack.clear\n return KEY_BTAB # backtab\n end\n end\n # the usual Meta combos. (alt)\n ch = 128 + ch\n @stack.clear\n return ch\n end\n # append a 27 to stack, actually one can use a flag too\n if ch == 27\n @stack << 27\n next\n end\n return ch\n end\n end", "def show_menu\n puts \"Type 'q' to quit\"\n puts \"Or press Return to continue\"\nend", "def any_key\n puts \"\"\n puts \"Press any key to continue..\"\n STDIN.getch\n end", "def activate_held(key)\n key_down.deactivate(key)\n key_held.activate(key) unless key_held.send(key)\n key_up.deactivate(key)\n end", "def onKeyDown(key, repeat, flags, view)\n #puts \"onKeyDown: #{key}, #{flags}\"\n return if repeat > 1\n self.set_flags flags\n \n case( key )\n when VK_LEFT\n @keys |= LEFT_ARROW\n when VK_RIGHT\n @keys |= RIGHT_ARROW\n when VK_UP\n @keys |= UP_ARROW\n when VK_DOWN\n @keys |= DOWN_ARROW\n when '+'[0]\n @@speed += 1.0\n when '-'[0]\n @@speed -= 1.0\n @@speed = 1.0 if @@speed < 1.0\n else\n return\n end\n @speedx = @@speed\n @speedy = @@speed\n \n # get the distance from the camera to what we are looking at to control the speed\n @distance_to_target = self.guess_target_distance view\n \n view.animation = self\n view.dynamic = 3\nend", "def button_up(id)\n @bgm.play(true) if id == Gosu::KbA # play (loop enabled)\n @bgm.stop if id == Gosu::KbZ # stop\n @bgm.pause if id == Gosu::KbX # pause\n end", "def scroll_down\n ESC + 'D'\n end", "def handle_keys\n exit if SDL::Key.press? SDL::Key::ESCAPE\n exit if SDL::Key.press? SDL::Key::Q\n self.paused = !paused if SDL::Key.press? SDL::Key::P\n end", "def button_down(id)\n if id == Gosu::Button::KbEscape\n close\n end\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def main_menu\n while(!$quit)\n case welcome_page\n when \"Login\"\n puts \"\\e[H\\e[2J\"\n login_loop\n when \"Register\"\n puts \"\\e[H\\e[2J\"\n register_loop\n when \"Exit\"\n exit\n end\n end\nend", "def update\n @held_timer.each do |k, v|\n if v < G.kb_held_delay; @held_timer[k] += 1\n else\n @held_interval[k] = 0\n @held_timer.delete k\n end\n end\n\n @held_interval.each do |k, v|\n if v < G.kb_held_interval; @held_interval[k] += 1\n else; @held_interval[k] = 0; end\n end\n\n @prev_down = @down.clone\n @down.clear\n @keys.each do |k|\n if G.window.button_down? k\n @down << k\n @held_timer[k] = 0 if @prev_down.index(k).nil?\n elsif @prev_down.index(k)\n @held_timer.delete k\n @held_interval.delete k\n end\n end\n end", "def interact\n if not e_pause\n if interactable.is_a?(Chest)\n if @keys > 0 and interactable.locked\n interactable.unlock\n @keys -= 1\n @e_pause = true\n end\n end\n end\n end", "def shift_key_down\r\n command 'shiftKeyDown'\r\n end", "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\tend", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def swipe_down_until(expected_element)\n while $home_page.user_expect_not_displayed?(expected_element) do\n $home_page.user_swipe_down\n end\nend", "def button_down(key)\n MenuControllerContracts.invariant(self)\n @current_view.button_down(key)\n MenuControllerContracts.invariant(self)\n end", "def show_single_key\n system(\"clear\")\n board.render\n\n c = read_char\n\n case c\n when \"\\e[A\"\n # puts \"UP ARROW\"\n board.selected_pos[0] -= 1 unless board.selected_pos[0] < 1\n when \"\\e[B\"\n board.selected_pos[0] += 1 unless board.selected_pos[0] > 7\n # puts \"DOWN ARROW\"\n when \"\\e[C\"\n board.selected_pos[1] += 1 unless board.selected_pos[1] > 7\n # puts \"RIGHT ARROW\"\n when \"\\e[D\"\n board.selected_pos[1] -= 1 unless board.selected_pos[1] < 1\n # puts \"LEFT ARROW\"\n when \"r\"\n make_move(board.selected_pos,\"r\")\n when \"f\"\n make_move(board.selected_pos,\"f\")\n when \"s\"\n save?\n end\n end", "def update_ctrl_button\n if Input.trigger?(:B) # Quit\n action_b\n elsif Input.trigger?(:A) # Action\n action_a\n elsif Input.trigger?(:X) # Info\n action_x\n elsif Input.trigger?(:Y) # Sort\n action_y\n else\n return true\n end\n return false\n end", "def _pause_if_needed\n return unless Nenv.cuke_step?\n\n STDOUT.puts \"\\n\\nPress enter to continue\"\n STDIN.gets\n end", "def process_key(key)\n case KeyHelper.key_symbol(key)\n when :up\n @past_menu = @cur_menu\n @cur_menu = (@cur_menu - 1) % @items.size\n when :down\n @past_menu = @cur_menu\n @cur_menu = (@cur_menu + 1) % @items.size\n when :enter\n # Erase body after call\n @past_menu = nil\n term.echo\n return :break, @items[@cur_menu].menu\n end\n\n return if key[0] != Ncurses::OK\n @items.each_with_index do |item, i|\n next unless key[2] =~ item.shortcut_regex\n @past_menu = @cur_menu\n @cur_menu = i\n end\n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n end\n if id == Gosu::KbO && (not @twoplayer)\n @twoplayer = true\n @player.second_player_mode\n end\n if id == Gosu::KbR && @game_over\n @ball.reset\n @score.reset\n @game_over = false\n end\n end", "def scroll_down(n); puts \"\\e[#{n}T\" end", "def show_single_key\n c = read_char\n\n case c\n when \" \"\n pickUpItem()\n when \"i\"\n showInventory\n when \"m\"\n showMap\n when \"v\"\n inspectSurroundings\n puts \"working\"\n when \"q\"\n system ('clear && printf \"\\e[3J\"') or system (\"cls\")\n exit 0\n when \"k\"\n gameOver\n when \"\\e[A\"\n move(c)\n when \"\\e[B\"\n move(c)\n when \"\\e[C\"\n move(c)\n when \"\\e[D\"\n move(c)\n when \"\\u0003\"\n puts \"CONTROL-C\"\n exit 0\n end\nend", "def move_down(n); print \"\\e[#{n}B\" end", "def button_down; end", "def enter_to_continue\n puts \"\\n\"\n puts \"\\t\\t--------Press Enter to Continue------\"\n continue = gets\n end" ]
[ "0.7280026", "0.7124824", "0.6042346", "0.5867983", "0.5809598", "0.57798", "0.5756327", "0.5756327", "0.57253754", "0.57208925", "0.57151484", "0.5689603", "0.5664537", "0.5654561", "0.5615121", "0.5611255", "0.5608991", "0.5608974", "0.56033903", "0.5584858", "0.5539292", "0.5535517", "0.5517665", "0.5505257", "0.5489169", "0.54756975", "0.5445796", "0.5415768", "0.5411993", "0.54101676", "0.54058206", "0.54058206", "0.53958195", "0.53819835", "0.5346497", "0.53210604", "0.53210604", "0.53138715", "0.5312812", "0.52907735", "0.52907735", "0.5276921", "0.52690595", "0.52687913", "0.5263562", "0.5262916", "0.52585155", "0.5249973", "0.5243934", "0.5240471", "0.52364725", "0.52338576", "0.5221356", "0.52179825", "0.52179825", "0.5205247", "0.5202469", "0.5197239", "0.5193274", "0.5188021", "0.5184343", "0.51674235", "0.5163054", "0.513561", "0.5133696", "0.5110717", "0.51021963", "0.50659657", "0.50562286", "0.5052596", "0.50503534", "0.50416815", "0.5030812", "0.5027122", "0.50252485", "0.5021857", "0.5012669", "0.5009849", "0.4985887", "0.4985887", "0.49815944", "0.49695715", "0.49571317", "0.49527767", "0.49521092", "0.4941734", "0.49414685", "0.49378082", "0.49345145", "0.4929761", "0.49221823", "0.49175045", "0.49132836", "0.4911284", "0.49097273", "0.4904427", "0.48957705", "0.4892096", "0.4879963", "0.48793328" ]
0.58634657
4
Simulates the user releasing the control key.
def control_key_up command 'controlKeyUp' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def control_key_down\r\n command 'controlKeyDown'\r\n end", "def key_released( event )\n @keys -= [event.key]\n end", "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def keyctrl_d(*)\n @stop = true\n end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def button_down(id)\n if id == Gosu::Button::KbEscape\n close\n end\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def released( key )\n return KeyReleaseTrigger.new( key )\nend", "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\tend", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def button_down(key)\n end", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def handle_key ch\n if ch == 32\n toggle\n else\n super\n end\n end", "def check_key_delete\n return unless open?\n return if @closing\n if Input.legacy_press?(:B)\n @esc_counter += 1\n if @esc_counter >= 50\n @esc_counter = 0\n selection_ok(nil)\n end\n else\n @esc_counter = 0\n end\n end", "def handle_control_character(search, key)\n case key\n\n when KEY_CTRL_N then search.down\n when KEY_CTRL_P then search.up\n\n when KEY_CTRL_U then search.clear_query\n when KEY_CTRL_W then search.delete_word\n when KEY_CTRL_H, KEY_DELETE then search.backspace\n\n when ?\\r, KEY_CTRL_J, KEY_CTRL_M then search.done\n\n when KEY_CTRL_C then raise Abort\n\n else search\n end\n end", "def default_controls\n it_is Controllable\n controls Gosu::Button::KbEscape => :close\n end", "def wdelch\n Ncurses.wdelch(pointer)\n end", "def down_key\n @last = @choice\n @choice = (@choice < 2 ? @choice += 1 : 0)\n @choice_sound.play(1, 0.5, false)\n end", "def deactivate()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.HotkeySystem_deactivate(@handle.ptr)\n end", "def cut\n\n # FIXME\n if OperaWatir::Platform.os == :macosx\n keys.send [:command, 'x']\n else\n keys.send [:control, 'x']\n end\n end", "def ctrl_w() send_keys(:ctrl_w) end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def shift_key_down\r\n command 'shiftKeyDown'\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n end\n if id == Gosu::KbO && (not @twoplayer)\n @twoplayer = true\n @player.second_player_mode\n end\n if id == Gosu::KbR && @game_over\n @ball.reset\n @score.reset\n @game_over = false\n end\n end", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def any_key\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def keyPressed(key, x, y)\n\n # If escape is pressed, kill everything. \n if (key == 27) \n # shut down our window \n glutDestroyWindow(@window)\n # exit the program...normal termination.\n exit(0) \n end\nend", "def key_down_event _value\n send_cmd(\"key_down_event #{_value}\")\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def alt_key_down\r\n command 'altKeyDown'\r\n end", "def release(button: T.unsafe(nil), device: T.unsafe(nil)); end", "def close\n @graphic.ungetch(?q.ord)\n end", "def clear_screen_down\n CSI + 'J'\n end", "def after_update\n @keys_pressed.clear\n @keys_released.clear\n end", "def deActivateKey _args\n \"deActivateKey _args;\" \n end", "def update_ctrl_button\n if Input.trigger?(:B) # Quit\n action_b\n elsif Input.trigger?(:A) # Action\n action_a\n elsif Input.trigger?(:X) # Info\n action_x\n elsif Input.trigger?(:Y) # Sort\n action_y\n else\n return true\n end\n return false\n end", "def up_key\n @last = @choice\n @choice = (@choice > 0 ? @choice -= 1 : 2)\n @choice_sound.play(1, 0.5, false)\n end", "def press(key_sequence)\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def meta_key_up\r\n command 'metaKeyUp'\r\n end", "def meta_key_down\r\n command 'metaKeyDown'\r\n end", "def setup_input\n set_keys(KbEscape => :close,\n KbF1 => [:toggle_text, false],\n KbF2 => [:debug!, false],\n KbF3 => [:pause!, false])\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\nend", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def button_down(key)\n MenuControllerContracts.invariant(self)\n @current_view.button_down(key)\n MenuControllerContracts.invariant(self)\n end", "def clear\n @key_down.clear\n @key_up.clear\n @key_held.clear\n @active = nil\n end", "def unbind_key keycode\n @_key_args.delete keycode unless @_key_args.nil?\n @_key_map.delete keycode unless @_key_map.nil?\n end", "def key_clicked(p_key_event)\n\t\t\n\t\t\t# Forward event to specialized handlers, if the key matches\n\t\t\tclose_and_cleanup if p_key_event.key == Qt::Key_Return \n\t\t\temit(cancel_button_clicked) if p_key_event.key == Qt::Key_Escape\n\t\tend", "def activate_down(key)\n key_down.activate(key)\n key_held.deactivate(key)\n key_up.deactivate(key)\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n elsif id == Gosu::KbA\n if @bgm_si == nil or !@bgm_si.playing?\n @bgm_si = @bgm.play(1, 1, true) # play (loop enabled)\n end\n elsif id == Gosu::KbZ\n if @bgm_si\n @bgm_si.stop # stop\n end\n elsif id == Gosu::KbP\n if @bgm_si\n if @bgm_si.paused?\n @bgm_si.resume # resume\n elsif @bgm_si.playing?\n @bgm_si.pause # pause\n end\n end\n end\n end", "def clear\n @keys_pressed.clear\n @keys_released.clear\n @keys_down.cleae\n end", "def ungetch(ch)\n Ncurses.ungetch(ch)\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def close_game\n show\n Ncurses.mvaddstr(MAXY - 1, 0, 'Press any key to exit')\n Ncurses.getch\n Ncurses.curs_set(1)\n Ncurses.endwin\n end", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def key_down key\n @keys.push key\n end", "def move_for_keypress(keypress); nil; end", "def on_key_delete(evt)\n @hexbyte_started=false\n if not @selection.nil?\n idx=gui_set_value(nil, '')\n move_to_idx(idx)\n elsif @data[self.cur_pos]\n gui_set_value(self.cur_pos, '')\n refresh\n end\n end", "def ****_hidekeyboard\r\n begin\r\n\tif $driver.is_keyboard_shown\r\n\t $driver.press_keycode(4)\r\n\tend\r\n rescue Exception => e\r\n\t raise e.message\r\n\t raise e.backtrace.inspect\r\n end\r\nend", "def handle_key ch\n $log.debug \"inside handle key of field with #{ch}\"\n @repaint_required = true \n case ch\n when 32..126\n putc ch\n when 27 # cannot bind it, so hardcoding it here\n restore_original_value\n else\n ret = super\n return ret\n end\n 0 # 2008-12-16 23:05 without this -1 was going back so no repaint\n end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def key_clear(pc)\n old_user = pc.user\n command(\"key clear\") do\n pc.user = \"\"\n pc.save!\n end.un do\n pc.user = old_user\n pc.save!\n end.run\n commands_end\n end", "def _handle_key ch\n begin\n ret = process_key ch, self\n $multiplier = 0\n bounds_check\n rescue => err\n $log.error \" TEXTPAD ERROR _handle_key #{err} \"\n $log.debug(err.backtrace.join(\"\\n\"))\n alert \"#{err}\"\n #textdialog [\"Error in TextPad: #{err} \", *err.backtrace], :title => \"Exception\"\n ensure\n padrefresh\n Ncurses::Panel.update_panels\n end\n return 0\n end", "def update\n\t\tif self.button_down?(Gosu::KbLeft)\n \t\tclose\n \tend\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def on_key_back(evt)\n @hexbyte_started=false\n if not @selection.nil?\n idx=gui_set_value(nil, '')\n move_to_idx(idx)\n elsif (didx=self.cur_pos-1) >= 0\n gui_set_value(didx, '')\n move_cursor_left()\n end\n end", "def exit_game_reviews\n system('clear')\n graphic_thanks\n graphic_bottom\n print \"\\n\" + \" \" * 40 + \"Press any key to continue... \"\n STDIN.getch\n puts \"\"\n system('clear')\n exit\nend", "def button_up(key)\n close if key == Gosu::KbEscape\n\n # reset the game\n if @state == :end && key == Gosu::MsLeft\n @board = Board.new(self, 22, @root_dir)\n @state = :game\n return\n end\n\n @player_b.ai_inc if key == Gosu::KbS\n @player_b.ai_dec if key == Gosu::KbD\n\n if @player_on_turn.class == HotseatPlayer && key == Gosu::MsLeft\n if @board.cell_clicked(mouse_x, mouse_y, @player_on_turn.sym)\n\n return if @state == :end\n\n switch_players\n\n if @player_on_turn.class == AIPlayer\n @player_on_turn.make_move(@board)\n switch_players\n end\n end\n end\n end", "def key_up(*args, device: T.unsafe(nil)); end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def ctrl_l() send_keys(:ctrl_l) end", "def cursor_down(wrap = false)\n Sound.play_cursor\n Input.update\n deactivate\n call_handler(:down)\n end", "def handle_keys\n exit if SDL::Key.press? SDL::Key::ESCAPE\n exit if SDL::Key.press? SDL::Key::Q\n self.paused = !paused if SDL::Key.press? SDL::Key::P\n end", "def keyscan_stop\n\t\trequest = Packet.create_request('stdapi_ui_stop_keyscan')\n\t\tresponse = client.send_request(request)\n\t\treturn true\n\tend", "def clear_screen_up\n CSI + '1J'\n end", "def clear_and_send_keys(*args)\r\n clear($focus_driver)\r\n send_keys(*args)\r\n end", "def release_mouse(button)\n XDo::FFILib.xdo_mouseup @_xdo_pointer, @_window, button\n end", "def cmd_keyscan_stop(*args)\n\t\tprint_line(\"Stopping the keystroke sniffer...\")\t\t\n\t\tclient.ui.keyscan_stop\n\t\treturn true\n\tend", "def return_to_main_Screen\n puts \"\\nAny key to return \"\n print \":>\"\n gets.chomp\n clear_screen\nend", "def getch\n map_key(key_press)\n end", "def cmd_keyscan_stop(*args)\n\t\tprint_line(\"Stopping the keystroke sniffer...\")\n\t\tclient.ui.keyscan_stop\n\t\treturn true\n\tend", "def close_menu_with_key_press(menu_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_menu_closed(menu_name)\n end" ]
[ "0.71004444", "0.7075031", "0.6776605", "0.64335394", "0.6366527", "0.6346033", "0.631607", "0.62931114", "0.6287399", "0.6281883", "0.6230533", "0.6169614", "0.61186373", "0.6095681", "0.6080647", "0.6079532", "0.6070555", "0.60401744", "0.6029993", "0.59985405", "0.5992777", "0.58962005", "0.5874869", "0.5868365", "0.5851803", "0.584806", "0.584563", "0.5836822", "0.5836822", "0.5833701", "0.5822502", "0.5822502", "0.5810043", "0.5798379", "0.5779773", "0.5773407", "0.57698745", "0.5767536", "0.5731978", "0.5712677", "0.5695483", "0.56918925", "0.56729", "0.56579626", "0.5635291", "0.5629686", "0.5624735", "0.56218714", "0.560664", "0.5591915", "0.5591915", "0.5591657", "0.5588626", "0.5561723", "0.55614406", "0.55591255", "0.55568445", "0.55550593", "0.5547284", "0.5547284", "0.5544627", "0.5544205", "0.5536045", "0.55336565", "0.5521356", "0.5514865", "0.54981923", "0.54973775", "0.54870915", "0.54617023", "0.5456499", "0.54535025", "0.5446013", "0.5437908", "0.5434012", "0.5430565", "0.5425", "0.5414826", "0.54046416", "0.5394127", "0.53938246", "0.53830934", "0.53819436", "0.53757405", "0.53472227", "0.53462076", "0.5345703", "0.53391105", "0.5333005", "0.5327267", "0.5324381", "0.5323576", "0.5322498", "0.52868193", "0.5279807", "0.5276265", "0.52582747", "0.52473074", "0.5244956", "0.5237102" ]
0.7302922
0
Create a new cookie whose path and domain are same with those of current page under test, unless you specified a path for this cookie explicitly. Arguments: name_value_pair name and value of the cookie in a format "name=value" options_string options for the cookie. Currently supported options include 'path' and 'max_age'. The options_string's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second.
def create_cookie name_value_pair, options_string command 'createCookie', name_value_pair, options_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cookie(name, value = nil, duration = 15)\n if value\n response.set_cookie name, { \n :value => value,\n :expires => Time.now + (60 * duration),\n :path => \"/\",\n :httponly => true,\n :secure => production?\n }\n else\n request.cookies[name]\n end\n end", "def set_cookie(name, value, options = {})\n @_options_lookup[name] = options\n self[name] = value\n end", "def initialize( name, value, options={} )\n\t\toptions ||= {}\n\t\t# self.log.debug \"New cookie: %p = %p (%p)\" % [ name, value, options ]\n\n\t\t@name = name\n\t\t@value = value\n\n\t\t@domain = nil\n\t\t@path = nil\n\t\t@secure = false\n\t\t@httponly = false\n\t\t@max_age = nil\n\t\t@expires = nil\n\t\t@version = 0\n\n\t\t# self.log.debug \" setting options: %p\" % [ options ]\n\t\toptions.each do |meth, val|\n\t\t\tself.__send__( \"#{meth}=\", val )\n\t\tend\n\tend", "def set_cookie name, value=nil, opts={}\n if Hash === value\n opts = value\n else\n opts[:value] = value\n end\n\n @response.set_cookie name, opts\n end", "def []=(name, value)\n if value.is_a?(Hash)\n value = value.collect {|key, val| \"#{key}=#{val.gsub('=', '^^')}\" }.join('|')\n end\n options = { :value => value }\n\n options[:path] = \"/\" unless options.has_key?(:path)\n super(name.to_s, options[:value])\n @controller.response.set_cookie(name, options)\n end", "def set_cookie(cookie_name, value, expires)\n cookies[cookie_name.to_sym] = {\n value: value,\n expires: expires,\n domain: GlobalConstant::Base.cookie_domain,\n http_only: true,\n secure: Rails.env.production?,\n same_site: :strict\n }\n end", "def set_cookie(options) #:doc:\n options[\"path\"] = \"/\" unless options[\"path\"]\n cookie = CGI::Cookie.new(options)\n @controller.logger.info \"Cookie set: #{cookie}\" unless @controller.logger.nil?\n @controller.response.headers[\"cookie\"] << cookie\n end", "def set_cookie(name, value)\n test_cookies[name] = value\n end", "def install_persistent_cookie(name, cookie)\n cookies[name] = {\n :value => cookie,\n :expires => 10.years.from_now\n }\n end", "def set_cookie(name, value, attributes = {})\n cookie = Webmachine::Cookie.new(name, value, attributes).to_s\n case headers['Set-Cookie']\n when nil\n headers['Set-Cookie'] = [cookie]\n when Array\n headers['Set-Cookie'] << cookie\n end\n end", "def build_cookie(key, value)\n case value\n when Hash\n domain = \"; domain=\" + value[:domain] if value[:domain]\n path = \"; path=\" + value[:path] if value[:path]\n # According to RFC 2109, we need dashes here.\n # N.B.: cgi.rb uses spaces...\n expires = \"; expires=\" + value[:expires].clone.gmtime.\n strftime(\"%a, %d-%b-%Y %H:%M:%S GMT\") if value[:expires]\n secure = \"; secure\" if value[:secure]\n httponly = \"; HttpOnly\" if value[:httponly]\n value = value[:value]\n end\n value = [value] unless Array === value\n cookie = Rack::Utils.escape(key) + \"=\" +\n value.map { |v| Rack::Utils.escape(v) }.join(\"&\") +\n \"#{domain}#{path}#{expires}#{secure}#{httponly}\"\n end", "def cookie_named(name); end", "def build_cookie(key, value)\n case value\n when Hash\n domain = \"; domain=\" + value[:domain] if value[:domain]\n path = \"; path=\" + value[:path] if value[:path]\n # According to RFC 2109, we need dashes here.\n # N.B.: cgi.rb uses spaces...\n expires = \"; expires=\" + value[:expires].clone.gmtime.\n strftime(\"%a, %d-%b-%Y %H:%M:%S GMT\") if value[:expires]\n secure = \"; secure\" if value[:secure]\n httponly = \"; HttpOnly\" if value[:httponly]\n value = value[:value]\n end\n value = [value] unless Array === value\n Rack::Utils.escape(key) + \"=\" +\n value.map { |v| Rack::Utils.escape(v) }.join(\"&amp;\") +\n \"#{domain}#{path}#{expires}#{secure}#{httponly}\"\n end", "def set_cookie(name, value, path = '/', httponly = true, secure = true)\n \n cookie = WEBrick::Cookie.new(name, value)\n cookie.path = path\n cookie.httponly = httponly\n cookie.secure = secure\n \n # add cookie to response header\n @header['Set-Cookie'] = cookie.to_s\n end", "def manually_set_cookie(value, expire_in)\n expire_date = expire_in.from_now.gmtime.strftime('%a, %d %b %Y %H:%M:%S GMT')\n response['Set-Cookie'] =\n \"cookiePermissions=#{value}; Expires=#{expire_date}; Path=/; SameSite=Lax\"\n end", "def set_cookie(cookie_name, value, expires, encrypt=false)\n cookie_obj = (encrypt == true) ? cookies.encrypted : cookies\n cookie_obj[cookie_name.to_sym] = {\n value: value,\n expires: expires,\n domain: request.host,\n http_only: true,\n secure: !(Rails.env.development? || Rails.env.staging?),\n same_site: :strict\n }\n end", "def cookie_path=(_arg0); end", "def set_cookie(name, value)\n @cookies[\"flexi_#{@id}_#{name}\"] = value\n return value\n end", "def cookie_add(name, value=nil)\n return dup_without_response.cookie_add(name, value) if response\n\n cookies_string = HTTY::CookiesUtil.cookies_to_string(cookies +\n [[name.to_s, value]])\n if cookies_string\n @headers[COOKIES_HEADER_NAME] = cookies_string\n else\n @headers.delete COOKIES_HEADER_NAME\n end\n self\n end", "def cookie\n { :value => Crypt.encrypt(cookie_value), :expires => 1.year.from_now }\n end", "def test_cookie_using_url_path\n url = URI.parse('http://rubygems.org/login.php')\n cookie_params = {}\n cookie_params['expires'] = 'expires=Sun, 27-Sep-2037 00:00:00 GMT'\n cookie_params['path'] = 'path=/'\n cookie_params['domain'] = 'domain=.rubygems.org'\n cookie_params['httponly'] = 'HttpOnly'\n cookie_value = '12345%7D=ASDFWEE345%3DASda'\n\n expires = Time.parse('Sun, 27-Sep-2037 00:00:00 GMT')\n\n cookie_params.keys.combine.each do |c|\n next if c.find { |k| k == 'path' }\n cookie_text = \"#{cookie_value}; \"\n c.each_with_index do |key, idx|\n if idx == (c.length - 1)\n cookie_text << \"#{cookie_params[key]}\"\n else\n cookie_text << \"#{cookie_params[key]}; \"\n end\n end\n\n cookie = assert_cookie_parse url, cookie_text\n\n assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s)\n assert_equal('/', cookie.path)\n\n # if expires was set, make sure we parsed it\n if c.find { |k| k == 'expires' }\n assert_equal(expires, cookie.expires)\n else\n assert_nil(cookie.expires)\n end\n end\n end", "def initialize (name, value = nil, maxage = nil, path = nil, domain = nil, secure = false)\n\t\t# {{{\n\t\t# HTTP headers (Cookies are a HTTP header) can only set, while no content\n\t\t# is send. So an exception will be raised, when @@allowed is set to false\n\t\t# and a new cookie has set.\n\t\tunless defined?(@@allowed)\n\t\t\t@@allowed = true\n\t\tend\n\t\tunless @@allowed\n\t\t\traise \"You can't set cookies after the HTTP headers are send.\"\n\t\tend\n\n\t\tunless defined?(@@list)\n\t\t\t@@list = []\n\t\tend\n\t\t@@list += [self]\n\n\t\tunless defined?(@@type)\n\t\t\t@@type = \"netscape\"\n\t\tend\n\n\t\tunless name.class == String\n\t\t\traise TypeError, \"The name of a cookie must be a string\", caller\n\t\tend\n\t\tif value.class.superclass == Integer || value.class == Float\n\t\t\tvalue = value.to_s\n\t\telsif value.class != String && value != nil\n\t\t\traise TypeError, \"The value of a cookie must be a string, integer, float or nil\", caller\n\t\tend\n\t\tif maxage.class == Time\n\t\t\tmaxage = maxage - Time.now\n\t\telsif !maxage.class.superclass == Integer || !maxage == nil\n\t\t\traise TypeError, \"The maxage date of a cookie must be an Integer or Time object or nil.\", caller\n\t\tend\n\t\tunless path.class == String || path == nil\n\t\t\traise TypeError, \"The path of a cookie must be nil or a string\", caller\n\t\tend\n\t\tunless domain.class == String || domain == nil\n\t\t\traise TypeError, \"The value of a cookie must be nil or a string\", caller\n\t\tend\n\t\tunless secure == true || secure == false\n\t\t\traise TypeError, \"The secure field of a cookie must be true or false\", caller\n\t\tend\n\n\t\t@name, @value, @maxage, @path, @domain, @secure = name, value, maxage, path, domain, secure\n\t\t@comment = nil\n\t\t# }}}\n\tend", "def []=(name, options)\n if options.is_a?(Hash)\n options = options.inject({}) { |options, pair| options[pair.first.to_s] = pair.last; options }\n options[\"name\"] = name.to_s\n else\n options = { \"name\" => name.to_s, \"value\" => options }\n end\n\n set_cookie(options)\n end", "def assert_cookie(name, value)\n assert cookies[name.to_s]\n assert_equal value, cookies[name.to_s]\n end", "def cookie_path; end", "def set_cookie(name, value, expires)\n (headers['Set-Cookie'] ||=[]) << (Merb::Const::SET_COOKIE % [\n name.to_s, \n ::Merb::Request.escape(value.to_s), \n # Cookie expiration time must be GMT. See RFC 2109\n expires.gmtime.strftime(Merb::Const::COOKIE_EXPIRATION_FORMAT)\n ])\n end", "def add_cookie(cookie, value = nil)\n @response_cookies ||= {}\n\n if value\n @response_cookies[cookie] = Cookie.new(cookie, value)\n else \n @response_cookies[cookie.name] = cookie\n end\n end", "def initialize(*args)\n @version = 0 # Netscape Cookie\n\n @domain = @path = @secure = @comment = @max_age =\n @expires = nil\n\n @created_at = @accessed_at = Time.now\n case args.size\n when 2\n self.name, self.value = *args\n @for_domain = false\n return\n when 3\n self.name, self.value, attr_hash = *args\n when 1\n attr_hash = args.first\n else\n raise ArgumentError, \"wrong number of arguments (#{args.size} for 1-3)\"\n end\n for_domain = false\n origin = nil\n attr_hash.each_pair { |key, val|\n skey = key.to_s.downcase\n if skey.sub!(/\\?\\z/, '')\n val = val ? true : false\n end\n case skey\n when 'for_domain'\n for_domain = !!val\n when 'origin'\n origin = val\n else\n setter = :\"#{skey}=\"\n send(setter, val) if respond_to?(setter)\n end\n }\n if @name.nil? || @value.nil?\n raise ArgumentError, \"at least name and value must be specified\"\n end\n @for_domain = for_domain\n if origin\n self.origin = origin\n end\n end", "def handle_cookies(file_path = nil)\n if file_path\n path = Pathname(file_path).expand_path\n \n if !File.exist?(file_path) && !File.writable?(path.dirname)\n raise ArgumentError, \"Can't create file #{path} (permission error)\"\n elsif File.exist?(file_path) && !File.writable?(file_path)\n raise ArgumentError, \"Can't read or write file #{path} (permission error)\"\n end\n else\n path = nil\n end\n \n # Apparently calling this with an empty string sets the cookie file,\n # but calling it with a path to a writable file sets that file to be\n # the cookie jar (new cookies are written there)\n add_cookie_file(path.to_s)\n \n self\n end", "def cookies(path=\"/\")\n _cookies(path_to_array(path))\n end", "def send_cookie(name, value = nil)\n @context.add_cookie(name, value)\n end", "def create_cookies(username, password)\r\n\t\tcookies.signed[:username] = { \r\n\t \t\tvalue: username,\r\n\t \t\texpires: 1.weeks.from_now }\r\n\t \tcookies.signed[:pwd] = {\r\n\t \t\tvalue: password,\r\n\t \t\texpires: 1.weeks.from_now }\r\n\tend", "def hubssolib_set_secure_cookie_data(name, value)\n if (@hubssolib_have_written_cookie)\n raise \"HubSsoLib: Attmept to set cookie '#{name}' more than once\"\n end\n\n @hubssolib_have_written_cookie = true\n\n # Using cookies.delete *should* work but doesn't. Set the\n # cookie with nil data instead.\n\n data = value.nil? ? nil : HubSsoLib::Crypto.encode_object(value, request.remote_ip)\n\n # No expiry time; to aid security, use session cookies only.\n\n cookies[name] = {\n :value => data,\n :path => HUBSSOLIB_COOKIE_PATH,\n :secure => true\n }\n end", "def []=( name, value )\n\t\tvalue = Strelka::Cookie.new( name.to_s, value ) unless value.is_a?( Strelka::Cookie )\n\t\traise ArgumentError, \"cannot set a cookie named '%s' with a key of '%s'\" %\n\t\t\t[ value.name, name ] if value.name.to_s != name.to_s\n\n\t\tself << value\n\tend", "def delete(name, options = {})\n options.stringify_keys!\n set_cookie(options.merge(\"name\" => name.to_s, \"value\" => \"\", \"expires\" => Time.at(0)))\n end", "def add_cookie(key,value)\n $LOG.info \"adding cookie with key => #{key} and value => #{value}\"\n begin\n $driver.manage.add_cookie(:name => \"#{key}\", :value => \"#{value}\")\n rescue Exception => e\n $LOG.error \"Add Cookie can't be completed \"+e.message\n raise \"Add Cookie can't be completed \"+e.message\n end\n end", "def cookie_named(name)\n driver.manage.cookie_named(name)\n end", "def set_auth_tkt_cookie(options)\n # get signed cookie string\n tkt_hash = get_tkt_hash(options)\n\n cookie_data = { :value => tkt_hash }\n\n # set domain for cookie, if wanted\n cookie_data[:domain] = options[:domain] if options[:domain]\n\n # store data into cookie\n cookies[:auth_tkt] = cookie_data\n\n # return signed cookie\n return tkt_hash\n end", "def set_uuid_cookie\n uuid = cookies[:uuid] || UUIDTools::UUID.random_create.to_s\n cookies[:uuid] = { value: uuid, expires: 5.years.from_now }\n end", "def cookies_for domain\n @cookies ||= {}\n @cookies[ domain ]\n end", "def set_cookie(uri, sc)\n cookie = Cookie.new\n name, sc = sc.split '=', 2\n value, sc = sc.split ';', 2\n cookie.name, cookie.value = CGI::unescape(name), CGI::unescape(value)\n \n opts = {}\n sc && sc.split(';').each do |opt|\n opt, optval = opt.split '=', 2\n opts[opt.downcase] = (optval && CGI::unescape(optval)) || true\n end\n \n # restrict by domain-- not spec-compliant and possibly unsafe (allows \n # infinite levels of subdomains)\n if opts['domain'] && opts['domain'] != uri.host\n if opts['domain'].end_with?('.'+uri.host)\n cookie.domain = opts['domain']\n else\n return false\n end\n else\n cookie.domain = uri.host\n end\n \n if opts['path']\n cookie.path = opts['path']\n else\n # the resource path is the \"directory\" containing the request path\n ri = uri.path.rindex '/'\n cookie.path = ri ? uri.path[0..ri] : '/'\n end\n \n if opts['expires']\n begin\n cookie.expires = DateTime.parse opts['expires']\n rescue ArgumentError; end\n end\n \n cookie.secure = opts.has_key?('secure')\n \n @jar << cookie\n return true\n end", "def store_location\n cookies[:return_to] = { value: request.fullpath, expires: 1.minute.from_now }\n end", "def create(cookies, options = {})\n return nil if self.class.site_key.nil?\n expires = (options.delete(:expires) || 1.week.from_now).to_i # we want unix time\n cookies[:tender_email] = cookie_value(@user.email)\n cookies[:tender_expires] = cookie_value(expires)\n\n # Optionally set the user's name. This is also signed.\n if options[:name_field]\n options[:name] = @user.send(options[:name_field])\n end\n options.each do |key, value|\n cookies[:\"tender_#{key}\"] = cookie_value(value)\n end\n cookies[:tender_hash] = cookie_value(expiring_token(expires, options[:name]))\n cookies\n end", "def do_write!(cookie_name, spec)\n @controller.write_cookie! cookie_name, spec.merge(same_site: self.class.cookie_same_site)\n @controller.write_cookie! \"#{cookie_name}_legacy\", spec\n end", "def test_cookie_with_secure\n url = URI.parse('http://rubygems.org/')\n cookie_params = {}\n cookie_params['expires'] = 'expires=Sun, 27-Sep-2037 00:00:00 GMT'\n cookie_params['path'] = 'path=/'\n cookie_params['domain'] = 'domain=.rubygems.org'\n cookie_params['secure'] = 'secure'\n cookie_value = '12345%7D=ASDFWEE345%3DASda'\n\n expires = Time.parse('Sun, 27-Sep-2037 00:00:00 GMT')\n\n cookie_params.keys.combine.each do |c|\n next unless c.find { |k| k == 'secure' }\n cookie_text = \"#{cookie_value}; \"\n c.each_with_index do |key, idx|\n if idx == (c.length - 1)\n cookie_text << \"#{cookie_params[key]}\"\n else\n cookie_text << \"#{cookie_params[key]}; \"\n end\n end\n\n cookie = assert_cookie_parse url, cookie_text\n\n assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s)\n assert_equal('/', cookie.path)\n assert_equal(true, cookie.secure)\n\n # if expires was set, make sure we parsed it\n if c.find { |k| k == 'expires' }\n assert_equal(expires, cookie.expires)\n else\n assert_nil(cookie.expires)\n end\n end\n end", "def []=(name, value)\n @crumbs[name.to_s] = value.to_s\n set_cookie\n end", "def delete(name, options = {})\n set_cookie(name, \"\", options.merge(\"expires\" => Time.at(0)))\n end", "def path=(path)\n\t\t# {{{\n\t\tunless path.class == String || path == nil\n\t\t\traise TypeError, \"The path of a cookie must be nil or a string\", caller\n\t\tend\n\t\t@path = path\n\t\t# }}}\n\tend", "def add_cookie(cookie)\n domain_paths = find_or_add_domain_for_cookie cookie\n add_cookie_to_path domain_paths, cookie\n cookie\n end", "def set_cookie(response)\n response.set_cookie(Webmetrics::Config.cookie_name, {\n :value => self.id,\n :path => \"/\",\n :expires => Time.now+Webmetrics::Config.cookie_expiration\n })\n end", "def stash_cookie\n cookies[self.class.els_options['cookie']] = {\n :value => @els_identity.token_id,\n :domain => request.env[\"SERVER_NAME\"],\n :path => '/',\n :expires => Time.now + 24.hours\n }\n end", "def store_session(response)\n attributes = { path: \"/\", value: @cookie.to_json }\n response.set_cookie(APP_NAME, attributes)\n end", "def save_cookie(requested_lang)\n cookies[:lang] = {\n :value => requested_lang,\n :expires => 1.month.from_now,\n :path => root_path\n }\n end", "def set_session_cookie_value(value, options = {})\n defaults = {}\n defaults[:expires] = Time.now + _session_expiry if _session_expiry > 0\n cookies.set_cookie(_session_id_key, value, defaults.merge(options))\n end", "def set_WithCookie(value)\n set_input(\"WithCookie\", value)\n end", "def get_cookie(name)\n browser.cookie_named(name)\n end", "def set_cookies(response)\n cookie_str = response.header['set-cookie']\n return if cookie_str.nil?\n\n fields = cookie_str.split(\"; \").inject({}) { |h, field|\n key, value = field.split(\"=\")\n h[key] = value\n\n h\n }\n\n # This is obviously not a generalized cookie implementation. Heh.\n fields.delete('path')\n @cookies = fields\n end", "def delete_cookie(name)\n cookie = Cookie.new(name, \"\")\n cookie.expires = 1.year.ago \n @context.add_cookie(cookie) \n end", "def initialize(name = \"\", *value)\n @domain = nil\n @expires = nil\n if name.kind_of?(String)\n @name = name\n @path = (%r|\\A(.*/)| =~ ENV[\"SCRIPT_NAME\"] ? $1 : \"\")\n @secure = false\n @httponly = false\n return super(value)\n end\n\n options = name\n unless options.has_key?(\"name\")\n raise ArgumentError, \"`name' required\"\n end\n\n @name = options[\"name\"]\n value = Array(options[\"value\"])\n # simple support for IE\n @path = options[\"path\"] || (%r|\\A(.*/)| =~ ENV[\"SCRIPT_NAME\"] ? $1 : \"\")\n @domain = options[\"domain\"]\n @expires = options[\"expires\"]\n @secure = options[\"secure\"] == true\n @httponly = options[\"httponly\"] == true\n\n super(value)\n end", "def cookie\n # 'frontend=aaa'\n nil\n end", "def bake_vote_cookie_for(question)\n cookies[\"voted_for_#{question.id}\"] = {\n :value => '1',\n :expires => 1.year.from_now # Expire not anytime soon.\n }\n end", "def add_cookie(opts = {})\n driver.manage.add_cookie(opts)\n end", "def store_cookie variable_name\r\n command 'storeCookie', variable_name\r\n end", "def <<( cookies )\n [cookies].flatten.compact.each do |cookie|\n ((@domains[cookie.domain] ||= {})[cookie.path] ||= {})[cookie.name] = cookie.dup\n end\n self\n end", "def set_cookie(key, value)\n ::Rack::Utils.set_cookie_header!(@_headers, key, value)\n end", "def set_cookie(key, value)\n ::Rack::Utils.set_cookie_header!(@_headers, key, value)\n end", "def new\n\t\tcookies[:sign_up] = { value: \"XJ-122\", expires: 1.hour.from_now }\n\t\tsuper\n\tend", "def handle_cookies(file = nil)\n if file\n path = Pathname(file).expand_path\n unless File.exists?(file) and File.writable?(path.dirname)\n raise ArgumentError, \"Can't create file #{path} (permission error)\"\n end\n unless File.readable?(file) or File.writable?(path)\n raise ArgumentError, \"Cant read or write file #{path} (permission error)\"\n end\n end\n enable_cookie_session(path.to_s)\n self\n end", "def set_cookie options\n options ||= {}\n \n @header[\"Set-Cookie\"] = options.collect{|key,value|\"#{key}=#{value}\"}.join(\"; \")\n end", "def delete_cookie(name); end", "def set_cookie(cookie, uri = nil)\n cookie_jar.merge(cookie, uri)\n end", "def add_to_cookie key, value\n cookie_hash = get_accesses_cookie\n cookie_hash[key] = value\n cookies[:accesses] = cookie_hash.to_json\n end", "def []= key, val\n return if confined?\n @response.set_cookie key, val\n end", "def cookies; @cookies ||= CookieJar.new; end", "def cookie_name\n super\n end", "def cookie(params = nil)\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"cookie \" + params.to_s + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "def get_cookie(name)\n @driver.manage.cookie_named(name)\n end", "def set(resource)\n @cookies.signed[cookie_name] = {value: [resource.id, Time.now.to_i]}.merge(cookie_options)\n end", "def cookie_persistence_method\n super\n end", "def extract_cookie(response, uri, login=nil)\n # response['set-cookie'] returns multiple cookies comma-separated,\n # which is difficult to parse since Expires field also uses comma in it.\n # Fortunately, response.get_fields('set-cookie') returns an array of cookies.\n cookies = response.get_fields('set-cookie')\n if cookies.nil?\n puts \"extract_cookie finds no cookie in response\" if (@debug)\n return\n end\n cookiefile = get_cookiefile(login)\n cookies.each do |one_cookie|\n # It doesn't look like it matters for our purposes at the moment, but\n # according to rfc2965, 3.2.2 the Set-Cookie header can contain more\n # than one cookie, separated by commas.\n puts \"extract_cookie processing #{one_cookie}\" if (@debug)\n newcookie = parse_cookie('Set-Cookie: ' + one_cookie)\n next if newcookie.nil?\n\n # Some cookie fields are optional, and should default to the\n # values in the request. We need to insert these so that we\n # save them properly.\n # http://cgi.netscape.com/newsref/std/cookie_spec.html\n if !newcookie[:attributes]['domain']\n puts \"Adding domain #{uri.host} to cookie\" if (@debug)\n newcookie = parse_cookie(newcookie[:line] + \"; domain=#{uri.host}\")\n end\n if !newcookie[:attributes]['path']\n puts \"Adding path #{uri.path} to cookie\" if (@debug)\n newcookie = parse_cookie(newcookie[:line] + \"; path=#{uri.path}\")\n end\n cookies = []\n change = false\n existing_cookie = false\n read_cookiefile(cookiefile).each do |cookie|\n # Remove any existing cookies with the same name, domain and path\n puts \"Comparing #{cookie.inspect} to #{newcookie.inspect}\" if (@debug)\n if cookie[:name] == newcookie[:name] &&\n cookie[:attributes]['domain'] == newcookie[:attributes]['domain'] &&\n cookie[:attributes]['path'] == newcookie[:attributes]['path']\n existing_cookie = true\n if cookie == newcookie\n puts \"Existing cookie is identical to new cookie\" if (@debug)\n else\n # Cookie removed by virtue of us not saving it here\n puts \"Replacing existing but not identical cookie #{cookie.inspect}\" if (@debug)\n cookies << newcookie\n change = true\n end\n else\n puts \"Keeping non-matching cookie #{cookie.inspect}\" if (@debug)\n cookies << cookie\n end\n end\n if !existing_cookie\n puts \"No existing cookie matching new cookie, adding new cookie\" if (@debug)\n cookies << newcookie\n change = true\n end\n if change\n puts \"Updating cookiefile #{cookiefile}\" if (@debug)\n File.open(cookiefile, 'w') { |file| file.puts(cookies.collect{|cookie| cookie[:line]}.join(\"\\n\")) }\n else\n puts \"No cookie changes, leaving cookiefile untouched\" if (@debug)\n end\n end\n end", "def from_cookie(value)\n ticket = value && find_by_value(value)\n ticket\n end", "def set_cookie(email=nil, nav=false)\n if nav\n cookies[\"bunch__nav\"] = {\n value: \"open\", \n expires: 365.days.from_now\n }\n end\n end", "def session_remember\n httpsession = Thread.current[:hayabusa][:httpsession]\n raise \"Could not figure out HTTP-session.\" if !httpsession\n session = httpsession.session\n raise \"Could not get session-variable from HTTP-session.\" if !session\n session[:remember] = 1\n \n self.cookie(\n \"name\" => \"HayabusaSession\",\n \"value\" => _httpsession.session_id,\n \"path\" => \"/\",\n \"expires\" => Time.now + 32140800 #add around 12 months\n )\n end", "def set_cookie(env, headers, cookie)\n request = Rack::Request.new(env)\n if request.cookies[@key] != cookie[:value] || cookie[:expires]\n Utils.set_cookie_header!(headers, @key, cookie)\n end\n end", "def cookie\n @cookie ||= Coca::AuthCookie.new(cookies, scope)\n end", "def cookie_jar=(_arg0); end", "def cookie_jar=(_arg0); end", "def store_location\n cookies[:return_to] = {:value => @request.request_uri, :expires => nil }\n end", "def cookie_expiration\n super\n end", "def cookie=(val)\n @xmlrpc.cookie = val\n end", "def remember(user)\n user.remember # Defined in the User model\n cookies[:user_id] = { value: user.id,\n expires: 20.years.from_now.utc }\n\n cookies[:remember_token] = { value: user.remember_token,\n expires: 20.years.from_now.utc }\n end", "def set_cookie_name(opts)\n opts = check_params(opts,[:cookie_names])\n super(opts)\n end", "def remember(company)\n company.remember\n cookies.permanent.signed[:company_id] = company.id\n cookies.permanent[:remember_token] = company.remember_token\n end", "def store_session(res)\n res_cookie = WEBrick::Cookie.new(\n \"_rails_lite_app\",\n @value.to_json\n )\n\n res_cookie.path = \"/\"\n res.cookies << res_cookie\n end", "def set_pickup_cookies!\n if @pickup\n cookies[:pickup_id] = @pickup.id\n cookies[:key] = @pickup.key\n elsif params[:pickup_id] && params[:key]\n cookies[:pickup_id] = params[:pickup_id]\n cookies[:key] = params[:key]\n end\n end", "def []=(key, value)\n changes << key\n @cookies[key] = value\n end", "def []=(key, value)\n changes << key\n @cookies[key] = value\n end", "def encode_to_cookie h, cookie\n cookie[@name] = encode h\n end", "def cookie_value; end", "def [](name)\n cookie = @cookies[name.to_s]\n if cookie && cookie.respond_to?(:value)\n cookie.size > 1 ? cookie.value : cookie.value[0]\n else\n cookie\n end\n end" ]
[ "0.69611", "0.66825527", "0.6548742", "0.63547105", "0.6351173", "0.6256915", "0.62071717", "0.61513406", "0.6103352", "0.60696465", "0.6057598", "0.6044874", "0.5985113", "0.5978178", "0.59584033", "0.5943332", "0.59138983", "0.5909007", "0.5890583", "0.5864552", "0.5862495", "0.579932", "0.57980806", "0.5773135", "0.57705027", "0.56727934", "0.56319904", "0.5610449", "0.5581363", "0.55787474", "0.5572083", "0.5549743", "0.55385953", "0.552145", "0.5515145", "0.5513992", "0.5465338", "0.5387803", "0.5371287", "0.5359254", "0.5356706", "0.53526324", "0.5351113", "0.5341895", "0.53387946", "0.53135824", "0.53034025", "0.5289078", "0.5271101", "0.52615035", "0.5255362", "0.5250494", "0.52418166", "0.5201441", "0.51889116", "0.517626", "0.51461935", "0.5131994", "0.51233864", "0.50943613", "0.5089859", "0.508733", "0.5067943", "0.50605965", "0.50558054", "0.50558054", "0.5042658", "0.5034762", "0.50284505", "0.501451", "0.5011357", "0.50061506", "0.50044346", "0.5004052", "0.49873134", "0.49850872", "0.49671826", "0.49141535", "0.49060935", "0.49037975", "0.49021456", "0.4898443", "0.48970932", "0.48957768", "0.4894532", "0.48772007", "0.48772007", "0.48736772", "0.4872457", "0.48703322", "0.48657733", "0.48653603", "0.48475918", "0.48437", "0.4835386", "0.48339993", "0.48339993", "0.48316115", "0.48192525", "0.4817763" ]
0.6608455
2
Delete a named cookie with specified path.
def delete_cookie name, path command 'deleteCookie', name, path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_cookie(name); end", "def delete(name)\n @control.delete_cookie(name)\n end", "def delete_cookie name\n @response.delete_cookie name\n end", "def delete_cookie(name)\n browser.delete_cookie(name)\n end", "def delete(name)\n set_cookie(\"name\" => name.to_s, \"value\" => \"\")\n end", "def delete_cookie(name)\n @driver.manage.delete_cookie(name)\n end", "def delete_cookie(name)\n driver.manage.delete_cookie(name)\n end", "def delete(name, options = {})\n set_cookie(name, \"\", options.merge(\"expires\" => Time.at(0)))\n end", "def delete_cookie(cookie_name:, url:)\n {\n method: \"Page.deleteCookie\",\n params: { cookieName: cookie_name, url: url }.compact\n }\n end", "def delete(name, options = {})\n options.stringify_keys!\n set_cookie(options.merge(\"name\" => name.to_s, \"value\" => \"\", \"expires\" => Time.at(0)))\n end", "def delete_cookie(name)\n $LOG.info \"deleting cookie #{name}\"\n begin\n $driver.manage.delete_cookie name\n rescue Exception => e\n $LOG.error \"error in deleting cookie #{name} \"+e.message\n raise \"Error in deleting cookie #{name} \"+e.message\n end\n end", "def delete(name)\n @cookies.reject! do |cookie|\n cookie.name == name\n end\n nil\n end", "def delete_cookie(name)\n cookie = Cookie.new(name, \"\")\n cookie.expires = 1.year.ago \n @context.add_cookie(cookie) \n end", "def delete_cookie(key, value = {})\n Rack::Utils.delete_cookie_header!(@headers, key, value)\n end", "def delete_cookie(name)\n set_cookie(name, nil, Merb::Const::COOKIE_EXPIRED_TIME)\n end", "def delete(name)\n @crumbs.delete name.to_s\n set_cookie\n end", "def delete_cookie(key)\n ::Rack::Utils.delete_cookie_header!(@_headers, key, {})\n end", "def delete_cookie(key)\n ::Rack::Utils.delete_cookie_header!(@_headers, key, {})\n end", "def delete_cookie(cookie_name)\n cookies.delete(\n cookie_name.to_sym,\n domain: GlobalConstant::CompanyApi.cookie_domain,\n secure: Rails.env.production?,\n same_site: :strict\n )\n end", "def delete(cookie)\n # self\n end", "def delete_cookie(cookie_name)\n cookies.delete(cookie_name.to_sym, domain: request.host, secure: !(Rails.env.development? || Rails.env.staging?), same_site: :strict)\n end", "def delete_cookie(cookie_name)\n cookies.delete(\n cookie_name.to_sym,\n domain: GlobalConstant::Base.cookie_domain,\n secure: Rails.env.production?,\n same_site: :strict\n )\n end", "def delete(path)\n request(:delete, path)\n end", "def delete(path)\n request 'DELETE', path\n end", "def delete(path)\n request(:delete, path)\n end", "def delete(path)\n uri = build_uri(path)\n\n request = Net::HTTP::Delete.new(uri.request_uri)\n set_authorisation_header(request)\n\n response = https_client(uri).request(request)\n end", "def delete key, opts ={}\n return if confined?\n @response.delete_cookie key, opts\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def unset\n @cookies.delete cookie_name, cookie_options\n end", "def destroy\n @cooky = Cookie.find(params[:id])\n @cooky.destroy\n\n respond_to do |format|\n format.html { redirect_to cookies_url }\n format.json { head :no_content }\n end\n end", "def delete_cookie(cookies)\n cookies.delete('token')\n @user.update(token: '')\n end", "def delete(path)\n make_call(mk_conn(path), :delete)\n end", "def delete key, opts ={}\n return if readonly?\n response.delete_cookie key, opts\n end", "def delete(path)\n\t\trequest(path, :delete)\n\tend", "def delete(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'delete'}.merge(authentication))\n end", "def delete(path)\n root.delete(path)\n end", "def destroy(path)\n output { delete(path) }\n end", "def delete(name)\n @ctx.delete(@path + name)\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete(path)\n with_remote do |http|\n http.delete(path)\n end\n end", "def destroy\n @username_cookie = UsernameCookie.find(params[:id])\n @username_cookie.destroy\n\n respond_to do |format|\n format.html { redirect_to username_cookies_url }\n format.json { head :no_content }\n end\n end", "def cookie_remove(name)\n return dup_without_response.cookie_remove(name) if response\n\n # Remove just one matching cookie from the end.\n rejected = false\n new_cookies = cookies.reverse.reject do |cookie_name, cookie_value|\n if !rejected && (cookie_name == name)\n rejected = true\n else\n false\n end\n end.reverse\n\n cookies_string = HTTY::CookiesUtil.cookies_to_string(new_cookies)\n if cookies_string\n @headers[COOKIES_HEADER_NAME] = cookies_string\n else\n @headers.delete COOKIES_HEADER_NAME\n end\n self\n end", "def delete(id, cookie_or_cookies = nil)\n add_cookie_to_http_header(cookie_or_cookies)\n return @client.get(\"#{@resource_uri}/#{id}/delete\")\n end", "def delete_cookie\n cookies.delete :auth_token\n end", "def delete(path, headers = {})\n with_auth { request(:delete, path, nil, build_request_headers(headers, :delete, build_uri(path))) }\n end", "def delete(path)\n bucket.objects.delete(path)\n end", "def delete(path = nil, options = {})\n connection.delete(path, options)\n end", "def delete(path, options = {})\n connection.delete path, options\n end", "def delete(path, options = {})\n execute('DELETE', path, options)\n end", "def destroy\n\t\tcookies.delete 'Vanilla'\n\t\tcookies.delete 'Vanilla-Volatile'\n\t\tsuper\n\tend", "def delete(path, options = nil)\n add(path, options).delete\n end", "def delete(name)\n File.delete(path(name))\n end", "def delete(path, options = {})\n request(:delete, path, options)\n end", "def delete(path, options = {})\n request(:delete, path, options)\n end", "def delete(path, headers = {})\n request(:delete, path, nil, merge_default_headers(headers))\n end", "def delete(path, options={})\n send_request 'delete', path, options\n end", "def delete(path)\n path = format_path(path)\n bucket_path = get_bucket_path(path)\n date = gmtdate\n headers = {\n 'Host' => @aliyun_upload_host,\n 'Date' => date,\n 'Authorization' => sign('DELETE', bucket_path, '', '', date)\n }\n url = path_to_url(path)\n response = RestClient.delete(url, headers)\n response.code == 204 ? url : nil\n end", "def delete(path, **options)\n execute :delete, path, options\n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def destroy\n @cooky.destroy\n respond_to do |format|\n format.html { redirect_to cookies_url, notice: 'Cookie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path, rev=-1)\n invoke(Request.new(:path => path, :rev => rev, :verb => Request::Verb::DEL))\n nil\n end", "def delete(path, options = {})\n request(:delete, path, options)\n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def delete(path, params = {})\n request(:delete, path, params)\n end", "def cookies(path=\"/\")\n _cookies(path_to_array(path))\n end", "def delete_file(path)\n path = File.join('/', path)\n raise ArgumentError if path == '/'\n self.class.delete(path, request_options)\n end", "def delete(path, headers = {})\n process :delete, path, headers\n end", "def delete(path, data={})\n request(:delete, path, data)\n end", "def delete(path, params={}) # :nodoc:\n handle_response(@session.delete(path, MultiJson.dump(params)))\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def delete_path(path)\n @zk.delete(path)\n logger.info(\"Deleted ZK node #{path}\")\n rescue ZK::Exceptions::NoNode => ex\n logger.info(\"Tried to delete missing znode: #{ex.inspect}\")\n end", "def delete(path, params={})\n request(:delete, path, params)\n end", "def destroy\n cookies.each do |k|\n cookies.delete(k.at(0))\n end\n reset_session\n flash[:notice] = \"Kirjauduttu ulos\"\n redirect_to login_path\n end", "def delete_all_cookies; end", "def delete(path, opts = {})\n request(:delete, path, opts).body\n end", "def delete(path, options = {})\n request = Net::HTTP::Delete.new(request_uri(path))\n make_request(request, options.merge(no_callbacks: true))\n end", "def delete_cookies\n @log.info('Deleting the ' + @browser_name + ' browser cookies')\n @driver.manage.delete_all_cookies\n end", "def delete_file(basepath = MP3_STORAGE_PATH)\n FileUtils.rm_rf(\"#{basepath}/#{id}\")\n end", "def delete!\n exist!\n File.unlink @path\n @path = nil\n end", "def file_delete(path)\n params = {\n \"root\" => @root,\n \"path\" => format_path(path, false),\n }\n response = @session.do_post build_url(\"/fileops/delete\", params)\n parse_response(response)\n end", "def delete(path, options = {})\n request(:delete, parse_query_and_convenience_headers(path, options))\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def delete(path, params={}, args={})\n inject_token_auth_headers!(args)\n response = self.class.delete(request_url(path, params), args)\n update_token_auth_headers(response)\n return response\n end", "def delete(path = '/files/', params = {})\n request :delete, path, params\n end", "def delete_bookmark(name, bookmark_path, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = delete_bookmark_with_http_info(name, bookmark_path, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = delete_bookmark_with_http_info(name, bookmark_path, opts)\n else\n raise\n end\n return data\n end", "def rm(path)\n remove(path, nil, true, false)\n end", "def delete(name)\n request(uri = uri(name), Net::HTTP::Delete.new(uri.request_uri))\n end", "def delete(path, query={})\n request.delete(path, query_options(query))\n end", "def delete(path, data = {})\n self.class.delete path, :body => data.merge(:u => access_token)\n end", "def delete(path, headers: {}, query: {})\n headers = @default_headers.merge(headers)\n\n response = @http.delete(full_path(path, query: query), headers)\n ensure_success!(response)\n parse_response(response)\n end", "def uncookie_user\n cookies.delete :auth, :domain => site_domain\n end", "def delete(path, opts = {})\n input_json = {\n path: path,\n }\n response = @session.do_rpc_endpoint(\"/#{ @namespace }/delete\", input_json)\n Dropbox::API::File.from_json(Dropbox::API::HTTP.parse_rpc_response(response))\n end" ]
[ "0.80507576", "0.79902595", "0.78462714", "0.78460497", "0.7762308", "0.7753331", "0.7736792", "0.7722644", "0.76973075", "0.766335", "0.7624122", "0.7584712", "0.7552487", "0.74235904", "0.7396429", "0.71628356", "0.69966125", "0.69966125", "0.6991922", "0.69721454", "0.6944477", "0.69215375", "0.6821107", "0.6804802", "0.6797686", "0.67717546", "0.6733691", "0.66804045", "0.66479456", "0.66099125", "0.6606197", "0.65782887", "0.65170556", "0.64874655", "0.64843786", "0.64732933", "0.6459033", "0.6398678", "0.6353027", "0.6340479", "0.6336098", "0.62563336", "0.6246342", "0.6246167", "0.6243575", "0.6218441", "0.6214338", "0.61919516", "0.61849946", "0.61755085", "0.61698186", "0.6135772", "0.6123527", "0.6123527", "0.6117185", "0.611665", "0.6115312", "0.60912436", "0.6080397", "0.6080397", "0.6080397", "0.60701627", "0.6058213", "0.60525405", "0.60506207", "0.60506207", "0.6029822", "0.6028676", "0.60275733", "0.6023844", "0.60218656", "0.60191905", "0.60191905", "0.60191905", "0.60191905", "0.60191905", "0.60191905", "0.60191905", "0.6017577", "0.6015055", "0.6007432", "0.600414", "0.5975926", "0.59689856", "0.59556776", "0.5940184", "0.5918243", "0.5895359", "0.58881485", "0.5886904", "0.5883526", "0.5878186", "0.58778995", "0.5871834", "0.5869381", "0.58591217", "0.5856549", "0.58484155", "0.58423537", "0.5816731" ]
0.8839943
0
Double clicks on a link, button, checkbox or radio button. If the double click action causes a new page to load (like a link usually does), call wait_for_page_to_load.
def double_click locator command 'doubleClick', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doubleClick\n\t@selenium.double_click(@locator)\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def double_click_on(object)\n page.driver.browser.mouse.double_click(object.native)\n end", "def double_click(name, *args)\n widget(name, *args).double_click\n end", "def double_click_button_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).fire_event(\"ondblclick\")\nend", "def double_click_button_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).fire_event_no_wait(\"ondblclick\")\nend", "def doubleclick(btn = 'left')\n compatible_call :doubleclick, btn\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def click_act_as_link\n act_as_link.click\n sleep(10)\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def double_click_button_with_popup(browser_handle, property, property_value)\n browser_handle.button(property.intern, /#{property_value}/).fire_event_no_wait(\"ondblclick\")\nend", "def double_click_button(browser_handle, property, property_value)\n browser_handle.button(property.intern, /#{property_value}/).fire_event(\"ondblclick\")\nend", "def click_wait\n @webpage.click_wait(@locator)\n end", "def click\n\tbegin\n\t @selenium.click(@locator)\n\trescue => e\n\t sleep(3)\n\t @selenium.click(@locator)\n\tend\n\n\tbegin\n\t @selenium.wait_for_page_to_load\n\trescue => e\n\t sleep(2)\n\t @selenium.wait_for_condition(\"selenium.browserbot.getCurrentWindow()\", TIMEOUT)\n\tend\n\t\n end", "def dClick\n doubleClick(waitForObject(@symbolicName))\n Log.AppendLog(@@logCmd.dClick(self))\n end", "def click_batch_link\n wait_for_page_and_click batch_link\n end", "def double_click(element_name)\n begin\n $driver.action.double_click(el(element_name)).perform\n rescue Exception => e\n $LOG.error \"error in perform double click on element \\n element name : #{element_name} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in perform double click on element \\n element name : #{element_name} \"+e.message\n end\n end", "def click_twice_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def click_link(string)\n name_link(string).click\n wait_for_ajax\n end", "def click(link); end", "def click\n @mech.click self\n end", "def double_click?(btn)\n @dbl_click[btn]\n end", "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "def tripleclick(btn = 'left')\n compatible_call :doubleclick, btn\n end", "def click(page, doc)\n js = doc[\"href\"] || doc[\"onclick\"]\n if js =~ /javascript:__doPostBack\\('(.*)','(.*)'\\)/\n event_target = $1\n event_argument = $2\n form = page.form_with(id: \"aspnetForm\")\n form[\"__EVENTTARGET\"] = event_target\n form[\"__EVENTARGUMENT\"] = event_argument\n form.submit\n elsif js =~ /return false;__doPostBack\\('(.*)','(.*)'\\)/\n nil\n else\n # TODO Just follow the link likes it's a normal link\n raise\n end\nend", "def double_click_div_with_popup(browser_handle, property, property_value)\n browser_handle.div(property.intern, /#{property_value}/).fire_event_no_wait(\"ondblclick\")\nend", "def doubleclick(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES click mouse with double click\n end tell\n `)\n end", "def double_click(*args)\n case args.length\n when 1 then click_image(args[0], true)\n when 2 then click_point(args[0], args[1], true)\n else raise ArgumentError\n end\n end", "def double_click(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n\n action\n .move_to(element, x, y)\n .double_click\n .perform\n end", "def click_on_alink(link_id)\r\n\r\n link_using_id = get_link_using_id(link_id)\r\n\r\n link_using_id.click\r\n\r\n # With logout button, it is noted that click on it doesn't cause the\r\n # 'onclick' event to be automatically fired, so having to explicitly fire the event\r\n link_using_id.fire_event('onclick')\r\n\r\n sleep(1)\r\n\r\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def click link\n case link\n when Page::Link then\n referer = link.page || current_page()\n if @agent.robots\n if (referer.is_a?(Page) and referer.parser.nofollow?) or\n link.rel?('nofollow') then\n raise RobotsDisallowedError.new(link.href)\n end\n end\n if link.noreferrer?\n href = @agent.resolve(link.href, link.page || current_page)\n referer = Page.new\n else\n href = link.href\n end\n get href, [], referer\n when String, Regexp then\n if real_link = page.link_with(:text => link)\n click real_link\n else\n button = nil\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n button = f.button_with(:value => link)\n button.is_a? Form::Submit\n end\n submit form, button if form\n end\n when Form::Submit, Form::ImageButton then\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n f.buttons.include?(link)\n end\n submit form, link if form\n else\n referer = current_page()\n href = link.respond_to?(:href) ? link.href :\n (link['href'] || link['src'])\n get href, [], referer\n end\n end", "def click_link_with_href(href)\n find(:xpath, \"//a[@href='#{href}']\").click\n wait_for_turbolinks\n end", "def click_term_list_link\n wait_for_page_and_click term_lists_link\n end", "def click_reports_link\n wait_for_page_and_click reports_link\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def double_click_div(browser_handle, property, property_value)\n browser_handle.div(property.intern, /#{property_value}/).fire_event(\"ondblclick\")\nend", "def click(xpath, options = {})\n rc = nil\n Log.Debug(:h4, \"[CLICK]\") {\n _check_repl_lock\n _compile_click xpath\n rc = exec\n Log.Debug \"do_click rc: #{rc.safe_s}\"\n unless rc == CLICKED\n # unable to click on element => total failure\n rc = false\n else\n # give the browser some time to get the navigation going\n sleep 0.5\n\n # we clicked!\n unless wait_page_load\n # page didn't seem to load properly\n rc = :clicked\n else\n # finding the element, clicking on it and waiting for the\n # page to load succeeded. if caller wants us to wait for\n # particular conditions, we'll do it, but the caller has to\n # figure out if those conditions were ultimately satisfied.\n rc = true\n get_url options if options[:wait_for]\n end\n end\n }\n Log.Debug \"{click} :=> #{rc.safe_s}\"\n rc\n end", "def click_wait(locator)\n when_present(locator).click\n wait_js_inactive\n end", "def double_click_image_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, image_prop, image_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).image(image_prop.intern, /#{image_prop_val}/).fire_event_no_wait(\"ondblclick\")\nend", "def click_on_predict_main_link\n\n click_on PREDICT_MAIN_LINK\n sleep(THREAD_SLEEP_2)\n\n end", "def double_click()\n double_click_at :center, :center\n end", "def double_click(element = T.unsafe(nil), device: T.unsafe(nil)); end", "def click_selenium_test1\n @session.click_link(@link_text)\n end", "def js_click(selector)\n find(selector) # wait for the page to contain the selector\n page.execute_script(\"$('#{selector}').click()\")\n\n # wait for triggered ajax requests to be finished\n steps = 0\n while page.evaluate_script('$.active').to_i > 0 and steps < 25\n sleep 0.1\n steps += 1\n end\n end", "def click_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def click_and_wait(locator, wait_for = default_timeout)\n selenium.click locator\n wait_for_page_to_load(wait_for)\n end", "def click_wait(locator, sec, _arg = nil)\n click_on(locator)\n wait(sec)\n end", "def step_2(continue = true)\n\twait = Selenium::WebDriver::Wait.new(timeout: 3)\n\tsaa = SaaPage.new()\n\t#Click 'no' under \"Has this patient had an exam with us in the past?\"\n\twait.until { saa.past_exam_no.displayed? }\n\tsaa.past_exam_no.click\n\n\t#Click \"18 or older\" under \"How old is the patient?\"\n\twait.until { saa.how_old_over_18.displayed? }\n\tsaa.how_old_over_18.click\n\n\t# Click on \"Select primary reason\" and choose an item\n\twait.until { saa.primary_reason_dropdown.displayed? }\n\tjs_scroll_up(saa.primary_reason_dropdown)\n\tsaa.primary_reason_dropdown.click\n\n\twait.until { saa.primary_reason_item(2).displayed? }\n\tjs_scroll_up(saa.primary_reason_item,true)\n\tsaa.primary_reason_item(2).click\n\n\t#Click on \"Next Step\" CTA\n\tif continue\n\t\twait.until { saa.next_step.displayed? }\n\t\tsaa.next_step.click\n\t\t#Allow accordion menu to open\n\t\tsleep 1\n\tend\nend", "def click_3rd_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def click_submit\n @chrome_driver.find_element(:name, SUBMIT_BUTTON).click\n sleep 2\n end", "def wait_for_update_and_click(element)\n click_element(element, Utils.short_wait)\n end", "def double_click_image_inside_frame(browser_handle, frame_prop, frame_prop_val, image_prop, image_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).image(image_prop.intern, /#{image_prop_val}/).fire_event(\"ondblclick\")\nend", "def wait_for_load_and_click(element)\n click_element(element, Utils.medium_wait)\n end", "def user_agreement\n self.user_agreement_link\n sleep 1\n #wait_for_ajax\n # New Class goes here.new @browser\n end", "def keep_clicking(classes)\n while true\n begin\n BR.link(:class => classes).click()\n rescue\n break\n end\n end\nend", "def select_formula\n sleep(1)\n general_locator_clicker(\"Formula1\", 'ExtraStep')\n sleep(1)\n general_locator_clicker(\"Formula2\", 'ExtraStep')\n\t super()\n end", "def flash_and_ensure_click(dom_element)\n dom_element.wait_until(&:present?)\n dom_element.flash\n dom_element.click\nend", "def click_result(unique_identifier)\n wait_for_results\n wait_for_page_and_click result_row(unique_identifier)\n end", "def onDoubleClick _obj, _args\n \"_obj onDoubleClick _args;\" \n end", "def click_link_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, link_prop, link_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).link(link_prop.intern, /#{link_prop_val}/).click_no_wait\nend", "def test01_L1DLT01_TC_24418\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_review_follow.when_present.fire_event(\"onclick\")\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert $directory_group_follow_ok.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L1DLT01: FAILED! Unable to click directory listing\"\n\t\tend\n\t\t\n\t\t$directory_group_follow_ok.click\n\tend", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def basic_click()\n scroll_to_visible\n @driver.sc_basic_click action_target, *action_locator_args\n stall :click\n end", "def click_web_link(text)\n\t\t@log.debug(\"Clicking web link #{text}\")\n\t\t\n\t\t@main_window.click(text)\n\tend", "def click_and_wait(locator, wait_for = default_timeout)\n click locator\n assert_page_loaded(wait_for)\n end", "def click_on_button(button_name)\r\n\r\n given_button = $browser.button(id: \"#{button_name}\")\r\n\r\n given_button.wait_until_present(2)\r\n\r\n given_button.click\r\n\r\n sleep(1)\r\n end", "def go_to_elearning_page\n elearning_link.click\n sleep 5\n end", "def js_click(css_locator)\n page.execute_script(\"$('#{css_locator}').trigger('click')\")\n sleep settings.timeout_tiny\n end", "def click_on_link(selector)\n\n click_link(selector)\n\n end", "def click_and_change_window(how, what, tag_name, resulting_url)\n e = $driver.find_element(how, what)\n 3.times do \n e.tag_name.should == tag_name\n e.click.should be_nil\n\n quiesce\n\n if $driver.window_handles.length > 1\n break\n end\n end\n\n # The actual window switching\n $driver.switch_to.window($driver.window_handles.last).should be_nil\n\n check_url_match(resulting_url)\n return e\n end", "def clicks_get_link(link_text)\n link = find_link(link_text)\n link.click(:get)\n end", "def click_home\n wait_for_load_and_click home_link_element\n end", "def onLButtonDoubleClick(flags, x, y, view)\n end", "def user_click_until(element1, element2)\r\n begin\r\n key_processor(element1)\r\n locator1 = @locator\r\n selector1 = @selector\r\n\r\n key_processor(element2)\r\n locator2 = @locator\r\n selector2 = @selector\r\n\r\n ****_click_until(selector1, locator1, selector2, locator2)\r\n rescue Exception => e\r\n raise e.message\r\n raise e.backtrace.inspect\r\n end\r\n end", "def click\n assert_enabled\n clicked = false\n wait_until do\n @window.activate\n @window.active? &&\n UiaDll::control_click(search_information) &&\n clicked = true # is clicked at least once\n\n block_given? ? yield : clicked && !exist?\n end\n end", "def click_continue\n logger.debug 'Clicking continue'\n wait_for_load_and_click_js continue_button_element\n end", "def click_on_join_with_twitter_button\n\n click_on JOIN_WITH_TWITTER_BUTTON\n sleep(2)\n\n end", "def go_back_and_wait\n selenium.go_back\n wait_for_page_to_load\n end", "def click_visible_link(locator)\n wait_randomly\n click_link(locator.to_s, match: :first, visible: true)\nrescue StandardError\n raise_with_new_message 'Unable to click on link'\nend", "def click_save_and_publish\n scroll_to_bottom\n wait_for_update_and_click_js save_and_publish_button_element\n end", "def click_point(x, y, is_double = false)\n if is_double\n @java_obj.doubleClick(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n else\n @java_obj.click(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n end\n end", "def wait_and_click(sym, id)\n found_element = false\n\n #if the specified symbol and id point to multiple elements, we want to find the first visible one\n #and click that\n @wait.until do\n driver.find_elements(sym,id).shuffle.each do |element|\n if element.displayed? and element.enabled?\n @element=element\n found_element = true\n end \n \n end\n found_element \n end\n\n i = 0\n\n begin\n @element.click\n rescue Exception => ex\n i+=1\n sleep(1)\n retry if i<20\n raise ex \n end\n \n end", "def clicks_link(link_text)\n link = links.detect { |el| el.innerHTML =~ /#{link_text}/i }\n return flunk(\"No link with text #{link_text.inspect} was found\") if link.nil?\n \n onclick = link.attributes[\"onclick\"]\n href = link.attributes[\"href\"]\n \n http_method = http_method_from_js(onclick)\n authenticity_token = authenticity_token_value(onclick)\n \n request_page(http_method, href, authenticity_token.blank? ? {} : {\"authenticity_token\" => authenticity_token})\n end", "def js_click\n href = node.attributes['onclick'].to_s.match(/location.href='(.*)'/)[1]\n full_uri = URI::HTTP.build({scheme: page.uri.scheme, host: page.uri.host, path: href})\n mech.get(full_uri)\n end", "def user_click_until_gone(element1, element2)\r\n begin\r\n key_processor(element1)\r\n locator1 = @locator\r\n selector1 = @selector\r\n\r\n key_processor(element2)\r\n locator2 = @locator\r\n selector2 = @selector\r\n\r\n ****_click_until_gone(selector1, locator1, selector2, locator2)\r\n rescue Exception => e\r\n raise e.message\r\n raise e.backtrace.inspect\r\n end\r\n end", "def click_button\n find(:css, 'button.button-blue',wait:10).click\n $tim = Time.now\n end", "def click_link_with_text(text)\n find(:xpath, \"//a[text()='#{text}']\").click\n wait_for_turbolinks\n end", "def click\n Log.Trace(\"Clicking on #{@symbolicName}\")\n mouseClick(waitForObject(@symbolicName))\n Log.AppendLog(@@logCmd.click(self))\n end", "def click_on_link(text, scroll_to=false)\n if has_css?(\"a\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"a\"\n elsif has_css?(\"span\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"span\"\n elsif has_css?(\"label\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"label\"\n else\n raise Capybara::ElementNotFound.new(\"Can't find link with '#{text}' text\")\n end\n\n if scroll_to\n js_scroll_script = \"arguments[0].scrollIntoView(true);\"\n Capybara.page.execute_script(js_scroll_script, find(link_type, text: text, match: :prefer_exact))\n sleep 0.5\n end\n\n find(link_type, text: text, match: :prefer_exact).click\n end", "def wait_for_element_and_click(element)\n wait_for_element(element)\n \n i = 0\n begin\n @element.click\n rescue Exception => ex\n i+=1\n sleep(1)\n retry if i<20\n raise ex \n end\n \n end", "def activate_tab_with_click\n click\n \n # No event yet so just cheat and sleep\n sleep(0.1);\n end", "def click_delay(seconds = 0)\n sleep(ENV['MIN_CLICK_DELAY'].to_i + seconds) if ENV['DO_CLICK_DELAY'] == \"true\"\n end", "def continue_shopping\n self.lnkContinueShopping_element.when_present(30).click\n end", "def click_on_fb_toggle\n\n find(FB_OFF_TOGGLE).click\n sleep(1)\n\nend", "def trigger_click_link(selector)\n find_link(selector).trigger(\"click\")\n end", "def wait_for_update_and_click_js(element)\n click_element_js(element, Utils.short_wait)\n end", "def click_image(filename, is_double = false)\n begin\n if is_double\n @java_obj.doubleClick(filename, 0)\n else\n @java_obj.click(filename, 0)\n end\n rescue NativeException => e\n raise_exception e, filename\n end\n end", "def double_click_at locator, coord_string\r\n command 'doubleClickAt', locator, coord_string\r\n end", "def flash_scroll_and_ensure_click(dom_element)\n dom_element.wait_until(&:present?)\n dom_element.scroll.to\n dom_element.flash\n dom_element.click\nend" ]
[ "0.72414553", "0.63665897", "0.6324928", "0.6145949", "0.6117014", "0.6070342", "0.5995119", "0.5991177", "0.5963943", "0.59449744", "0.587923", "0.5868195", "0.5858383", "0.58537346", "0.5807184", "0.57931024", "0.57734835", "0.5759906", "0.571925", "0.5707611", "0.56754845", "0.5666257", "0.5652605", "0.5611456", "0.5609065", "0.56061476", "0.560591", "0.55917925", "0.5583546", "0.556848", "0.5541879", "0.5502981", "0.54925907", "0.5465578", "0.5456688", "0.54397905", "0.53708184", "0.5360429", "0.5356712", "0.535589", "0.5330227", "0.5324562", "0.5324054", "0.5309384", "0.5300879", "0.5299615", "0.52746356", "0.52707744", "0.526968", "0.5262142", "0.5257838", "0.5253361", "0.5252282", "0.5222236", "0.5203959", "0.51729506", "0.516153", "0.51561886", "0.5155274", "0.51486385", "0.5141375", "0.51348495", "0.5133581", "0.512344", "0.5098507", "0.5046", "0.50279963", "0.5018621", "0.501524", "0.5014855", "0.49792284", "0.4966369", "0.49619594", "0.49609447", "0.49604884", "0.49578667", "0.49537534", "0.49482834", "0.49459675", "0.4944805", "0.49418652", "0.4939764", "0.49184164", "0.49103576", "0.49093246", "0.49082914", "0.48997134", "0.48993772", "0.48880017", "0.48839426", "0.48778522", "0.4877164", "0.4877072", "0.4876516", "0.48761052", "0.4875911", "0.4871732", "0.48716763", "0.48686594", "0.486553" ]
0.6170935
3
Doubleclicks on a link, button, checkbox or radio button. If the action causes a new page to load (like a link usually does), call wait_for_page_to_load.
def double_click_at locator, coord_string command 'doubleClickAt', locator, coord_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doubleClick\n\t@selenium.double_click(@locator)\n end", "def click_act_as_link\n act_as_link.click\n sleep(10)\n end", "def click_batch_link\n wait_for_page_and_click batch_link\n end", "def click\n @mech.click self\n end", "def click(link); end", "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "def double_click_on(object)\n page.driver.browser.mouse.double_click(object.native)\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def click_link(string)\n name_link(string).click\n wait_for_ajax\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def double_click(name, *args)\n widget(name, *args).double_click\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def click(page, doc)\n js = doc[\"href\"] || doc[\"onclick\"]\n if js =~ /javascript:__doPostBack\\('(.*)','(.*)'\\)/\n event_target = $1\n event_argument = $2\n form = page.form_with(id: \"aspnetForm\")\n form[\"__EVENTTARGET\"] = event_target\n form[\"__EVENTARGUMENT\"] = event_argument\n form.submit\n elsif js =~ /return false;__doPostBack\\('(.*)','(.*)'\\)/\n nil\n else\n # TODO Just follow the link likes it's a normal link\n raise\n end\nend", "def click_term_list_link\n wait_for_page_and_click term_lists_link\n end", "def click link\n case link\n when Page::Link then\n referer = link.page || current_page()\n if @agent.robots\n if (referer.is_a?(Page) and referer.parser.nofollow?) or\n link.rel?('nofollow') then\n raise RobotsDisallowedError.new(link.href)\n end\n end\n if link.noreferrer?\n href = @agent.resolve(link.href, link.page || current_page)\n referer = Page.new\n else\n href = link.href\n end\n get href, [], referer\n when String, Regexp then\n if real_link = page.link_with(:text => link)\n click real_link\n else\n button = nil\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n button = f.button_with(:value => link)\n button.is_a? Form::Submit\n end\n submit form, button if form\n end\n when Form::Submit, Form::ImageButton then\n # Note that this will not work if we have since navigated to a different page.\n # Should rather make each button aware of its parent form.\n form = page.forms.find do |f|\n f.buttons.include?(link)\n end\n submit form, link if form\n else\n referer = current_page()\n href = link.respond_to?(:href) ? link.href :\n (link['href'] || link['src'])\n get href, [], referer\n end\n end", "def double_click_button_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).fire_event_no_wait(\"ondblclick\")\nend", "def double_click locator\r\n command 'doubleClick', locator\r\n end", "def click_wait\n @webpage.click_wait(@locator)\n end", "def doubleclick(btn = 'left')\n compatible_call :doubleclick, btn\n end", "def click_twice_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def click\n\tbegin\n\t @selenium.click(@locator)\n\trescue => e\n\t sleep(3)\n\t @selenium.click(@locator)\n\tend\n\n\tbegin\n\t @selenium.wait_for_page_to_load\n\trescue => e\n\t sleep(2)\n\t @selenium.wait_for_condition(\"selenium.browserbot.getCurrentWindow()\", TIMEOUT)\n\tend\n\t\n end", "def double_click_button_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).fire_event(\"ondblclick\")\nend", "def basic_click()\n scroll_to_visible\n @driver.sc_basic_click action_target, *action_locator_args\n stall :click\n end", "def double_click_button_with_popup(browser_handle, property, property_value)\n browser_handle.button(property.intern, /#{property_value}/).fire_event_no_wait(\"ondblclick\")\nend", "def click_submit\n @chrome_driver.find_element(:name, SUBMIT_BUTTON).click\n sleep 2\n end", "def js_click(selector)\n find(selector) # wait for the page to contain the selector\n page.execute_script(\"$('#{selector}').click()\")\n\n # wait for triggered ajax requests to be finished\n steps = 0\n while page.evaluate_script('$.active').to_i > 0 and steps < 25\n sleep 0.1\n steps += 1\n end\n end", "def click_action(action)\n dom_reader.find_element(self.values).find(\"[data-action='#{action}']\").click\n end", "def click(xpath, options = {})\n rc = nil\n Log.Debug(:h4, \"[CLICK]\") {\n _check_repl_lock\n _compile_click xpath\n rc = exec\n Log.Debug \"do_click rc: #{rc.safe_s}\"\n unless rc == CLICKED\n # unable to click on element => total failure\n rc = false\n else\n # give the browser some time to get the navigation going\n sleep 0.5\n\n # we clicked!\n unless wait_page_load\n # page didn't seem to load properly\n rc = :clicked\n else\n # finding the element, clicking on it and waiting for the\n # page to load succeeded. if caller wants us to wait for\n # particular conditions, we'll do it, but the caller has to\n # figure out if those conditions were ultimately satisfied.\n rc = true\n get_url options if options[:wait_for]\n end\n end\n }\n Log.Debug \"{click} :=> #{rc.safe_s}\"\n rc\n end", "def double_click_button(browser_handle, property, property_value)\n browser_handle.button(property.intern, /#{property_value}/).fire_event(\"ondblclick\")\nend", "def click_on_alink(link_id)\r\n\r\n link_using_id = get_link_using_id(link_id)\r\n\r\n link_using_id.click\r\n\r\n # With logout button, it is noted that click on it doesn't cause the\r\n # 'onclick' event to be automatically fired, so having to explicitly fire the event\r\n link_using_id.fire_event('onclick')\r\n\r\n sleep(1)\r\n\r\n end", "def double_click(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n\n action\n .move_to(element, x, y)\n .double_click\n .perform\n end", "def dClick\n doubleClick(waitForObject(@symbolicName))\n Log.AppendLog(@@logCmd.dClick(self))\n end", "def doubleclick(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES click mouse with double click\n end tell\n `)\n end", "def double_click(element_name)\n begin\n $driver.action.double_click(el(element_name)).perform\n rescue Exception => e\n $LOG.error \"error in perform double click on element \\n element name : #{element_name} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in perform double click on element \\n element name : #{element_name} \"+e.message\n end\n end", "def click_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def click_reports_link\n wait_for_page_and_click reports_link\n end", "def click_web_link(text)\n\t\t@log.debug(\"Clicking web link #{text}\")\n\t\t\n\t\t@main_window.click(text)\n\tend", "def click_selenium_test1\n @session.click_link(@link_text)\n end", "def action\n trigger :click\n end", "def click_link_with_href(href)\n find(:xpath, \"//a[@href='#{href}']\").click\n wait_for_turbolinks\n end", "def click_on_predict_main_link\n\n click_on PREDICT_MAIN_LINK\n sleep(THREAD_SLEEP_2)\n\n end", "def go_to_elearning_page\n elearning_link.click\n sleep 5\n end", "def tripleclick(btn = 'left')\n compatible_call :doubleclick, btn\n end", "def select_formula\n sleep(1)\n general_locator_clicker(\"Formula1\", 'ExtraStep')\n sleep(1)\n general_locator_clicker(\"Formula2\", 'ExtraStep')\n\t super()\n end", "def perform_action action_name, *args\n raise \"No such action #{action_name} defined for current page\" if !@current_page[:page_data].user_data['actions'].has_key?(action_name)\n # override locator from config file if needed\n if args[0].is_a?(Hash) and args[0].has_key?('locator')\n locator = args[0]['locator']\n else\n locator = @current_page[:page_data].user_data['actions'][action_name]['locator']\n end\n # search the entire dom or just under the current element\n if args[0].is_a?(Hash) and args[0].has_key?('root_search')\n dom = args[0]['root_search'].eql?(true) ? @driver : @element\n else\n dom = @driver\n end\n # perform the search\n @element = dom.find_element(locator)\n # json contains only a predefined set of instructions\n if action_name.include?('click')\n @element.click\n elsif action_name.include?('type')\n @element.send_keys args[0]\n elsif action_name.include?('submit')\n @element.submit\n elsif action_name.include?('inspect')\n @element\n else\n raise \"Don't know how to perform this action\"\n end\n # wait for a specific element or page to be present after the action\n wait_and_update @current_page[:page_data].user_data['actions'][action_name]['wait']\n end", "def click_submit\n end", "def double_click?(btn)\n @dbl_click[btn]\n end", "def double_click(*args)\n case args.length\n when 1 then click_image(args[0], true)\n when 2 then click_point(args[0], args[1], true)\n else raise ArgumentError\n end\n end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def js_click\n href = node.attributes['onclick'].to_s.match(/location.href='(.*)'/)[1]\n full_uri = URI::HTTP.build({scheme: page.uri.scheme, host: page.uri.host, path: href})\n mech.get(full_uri)\n end", "def wait_for_update_and_click(element)\n click_element(element, Utils.short_wait)\n end", "def click_3rd_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def click_on_join_with_twitter_button\n\n click_on JOIN_WITH_TWITTER_BUTTON\n sleep(2)\n\n end", "def click_link_with_text(text)\n find(:xpath, \"//a[text()='#{text}']\").click\n wait_for_turbolinks\n end", "def click_on_change_tags\n @page.find(input_elements[:result_more]).click\n wait_for_css(input_elements[:change_tags])\n @page.find(input_elements[:change_tags]).click\n end", "def click_on_link(selector)\n\n click_link(selector)\n\n end", "def show_other_sites\n frm.link(:text=>\"Show other sites\").click\n end", "def user_agreement\n self.user_agreement_link\n sleep 1\n #wait_for_ajax\n # New Class goes here.new @browser\n end", "def click_submit_button\n\t\tsubmit_button.click\n\tend", "def double_click_div_with_popup(browser_handle, property, property_value)\n browser_handle.div(property.intern, /#{property_value}/).fire_event_no_wait(\"ondblclick\")\nend", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def sub_navigate\n page(FeedDetailsPage).touch_row\n page(MorePage).page_handler(\"Submission\")\n end", "def step_2(continue = true)\n\twait = Selenium::WebDriver::Wait.new(timeout: 3)\n\tsaa = SaaPage.new()\n\t#Click 'no' under \"Has this patient had an exam with us in the past?\"\n\twait.until { saa.past_exam_no.displayed? }\n\tsaa.past_exam_no.click\n\n\t#Click \"18 or older\" under \"How old is the patient?\"\n\twait.until { saa.how_old_over_18.displayed? }\n\tsaa.how_old_over_18.click\n\n\t# Click on \"Select primary reason\" and choose an item\n\twait.until { saa.primary_reason_dropdown.displayed? }\n\tjs_scroll_up(saa.primary_reason_dropdown)\n\tsaa.primary_reason_dropdown.click\n\n\twait.until { saa.primary_reason_item(2).displayed? }\n\tjs_scroll_up(saa.primary_reason_item,true)\n\tsaa.primary_reason_item(2).click\n\n\t#Click on \"Next Step\" CTA\n\tif continue\n\t\twait.until { saa.next_step.displayed? }\n\t\tsaa.next_step.click\n\t\t#Allow accordion menu to open\n\t\tsleep 1\n\tend\nend", "def flash_and_ensure_click(dom_element)\n dom_element.wait_until(&:present?)\n dom_element.flash\n dom_element.click\nend", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def trigger_click_link(selector)\n find_link(selector).trigger(\"click\")\n end", "def double_click_image_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, image_prop, image_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).image(image_prop.intern, /#{image_prop_val}/).fire_event_no_wait(\"ondblclick\")\nend", "def test01_L1DLT01_TC_24418\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_review_follow.when_present.fire_event(\"onclick\")\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert $directory_group_follow_ok.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L1DLT01: FAILED! Unable to click directory listing\"\n\t\tend\n\t\t\n\t\t$directory_group_follow_ok.click\n\tend", "def click; end", "def click; end", "def click; end", "def click_home\n wait_for_load_and_click home_link_element\n end", "def click_on_button(button_name)\r\n\r\n given_button = $browser.button(id: \"#{button_name}\")\r\n\r\n given_button.wait_until_present(2)\r\n\r\n given_button.click\r\n\r\n sleep(1)\r\n end", "def click_and_wait(locator, wait_for = default_timeout)\n selenium.click locator\n wait_for_page_to_load(wait_for)\n end", "def wait_for_load_and_click(element)\n click_element(element, Utils.medium_wait)\n end", "def click_result(unique_identifier)\n wait_for_results\n wait_for_page_and_click result_row(unique_identifier)\n end", "def continue_button\n\tfind(\".btn--large\").click\nend", "def click_button\n find(:css, 'button.button-blue',wait:10).click\n $tim = Time.now\n end", "def js_click(css_locator)\n page.execute_script(\"$('#{css_locator}').trigger('click')\")\n sleep settings.timeout_tiny\n end", "def click_on_fb_toggle\n\n find(FB_OFF_TOGGLE).click\n sleep(1)\n\nend", "def click_wait(locator, sec, _arg = nil)\n click_on(locator)\n wait(sec)\n end", "def click_save_and_publish\n scroll_to_bottom\n wait_for_update_and_click_js save_and_publish_button_element\n end", "def click_link_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, link_prop, link_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).link(link_prop.intern, /#{link_prop_val}/).click_no_wait\nend", "def click_wait(locator)\n when_present(locator).click\n wait_js_inactive\n end", "def clicks_get_link(link_text)\n link = find_link(link_text)\n link.click(:get)\n end", "def activate_tab_with_click\n click\n \n # No event yet so just cheat and sleep\n sleep(0.1);\n end", "def share\n self.button(:id=>\"contentpermissions_members_autosuggest_sharebutton\").flash\n self.button(:id=>\"contentpermissions_members_autosuggest_sharebutton\").click\n wait_for_ajax\n end", "def click\n Log.Trace(\"Clicking on #{@symbolicName}\")\n mouseClick(waitForObject(@symbolicName))\n Log.AppendLog(@@logCmd.click(self))\n end", "def clicks_link(link_text)\n link = links.detect { |el| el.innerHTML =~ /#{link_text}/i }\n return flunk(\"No link with text #{link_text.inspect} was found\") if link.nil?\n \n onclick = link.attributes[\"onclick\"]\n href = link.attributes[\"href\"]\n \n http_method = http_method_from_js(onclick)\n authenticity_token = authenticity_token_value(onclick)\n \n request_page(http_method, href, authenticity_token.blank? ? {} : {\"authenticity_token\" => authenticity_token})\n end", "def click_first_loan_link\n find(:xpath, ta(@first_loan_ta, @first_loan_il)).click\n end", "def link_account_click\n link_account_button.click\n end", "def double_click(element = T.unsafe(nil), device: T.unsafe(nil)); end", "def next_thread\n find(next_thread_css).click\n wait_until_loaded\n end", "def click_and_change_window(how, what, tag_name, resulting_url)\n e = $driver.find_element(how, what)\n 3.times do \n e.tag_name.should == tag_name\n e.click.should be_nil\n\n quiesce\n\n if $driver.window_handles.length > 1\n break\n end\n end\n\n # The actual window switching\n $driver.switch_to.window($driver.window_handles.last).should be_nil\n\n check_url_match(resulting_url)\n return e\n end", "def continue_shopping\n self.lnkContinueShopping_element.when_present(30).click\n end", "def click_on_assign_to\n @stream_post.find(input_elements[:result_more]).click\n @stream_post.find(input_elements[:result_more]).click unless @page.has_css?(input_elements[:assign_to])\n wait_for_css(input_elements[:assign_to])\n @page.find(input_elements[:assign_to]).click\n #@stream_post.find(input_elements[:assign_to]).click\n end", "def download\n begin\n $results.log_action(\"button(#{@params[0]})\")\n @driver.find_element(:partial_link_text, \"Download\").click\n $results.success\n rescue => ex\n $results.fail(\"button(#{@params[0]})\", ex)\n end\n end", "def click_on_link(text, scroll_to=false)\n if has_css?(\"a\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"a\"\n elsif has_css?(\"span\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"span\"\n elsif has_css?(\"label\", text: text, match: :prefer_exact, wait: 1)\n link_type = \"label\"\n else\n raise Capybara::ElementNotFound.new(\"Can't find link with '#{text}' text\")\n end\n\n if scroll_to\n js_scroll_script = \"arguments[0].scrollIntoView(true);\"\n Capybara.page.execute_script(js_scroll_script, find(link_type, text: text, match: :prefer_exact))\n sleep 0.5\n end\n\n find(link_type, text: text, match: :prefer_exact).click\n end", "def onDoubleClick _obj, _args\n \"_obj onDoubleClick _args;\" \n end", "def comment\n comment_button\n wait_for_ajax(2)\n end" ]
[ "0.66928685", "0.62854445", "0.6092348", "0.6029516", "0.6002439", "0.5998282", "0.59527886", "0.59223086", "0.5920581", "0.58934367", "0.5889081", "0.5845576", "0.5825619", "0.5805953", "0.5804198", "0.57945234", "0.57842624", "0.5772199", "0.57469606", "0.5745088", "0.5734148", "0.5715151", "0.5707616", "0.5704619", "0.56968313", "0.56235445", "0.5612527", "0.55626136", "0.55473423", "0.5544369", "0.55073225", "0.5485218", "0.545487", "0.54407126", "0.54356015", "0.54354954", "0.54292506", "0.54250747", "0.54022753", "0.5398557", "0.5381014", "0.53782946", "0.53768235", "0.5341915", "0.53407574", "0.52894354", "0.52713317", "0.5271076", "0.5270846", "0.52493435", "0.52466536", "0.52384746", "0.52383506", "0.5235823", "0.5229443", "0.52281076", "0.52200353", "0.5211967", "0.52116", "0.520563", "0.5205044", "0.52004683", "0.5195276", "0.5161449", "0.51611", "0.5152228", "0.5150882", "0.51358825", "0.51312727", "0.5126557", "0.5126557", "0.5126557", "0.51197135", "0.5116099", "0.511166", "0.5106719", "0.50994694", "0.50961864", "0.5093907", "0.509014", "0.50816494", "0.5072956", "0.5070405", "0.5063005", "0.5062342", "0.5056976", "0.5054801", "0.50361526", "0.5024043", "0.5012907", "0.50077885", "0.4998957", "0.49875867", "0.49753687", "0.49748617", "0.4961122", "0.4954111", "0.49514768", "0.4947583", "0.49464136", "0.49355152" ]
0.0
-1
Drags an element a certain distance and then drops it.
def drag_and_drop locator, movements_string command 'dragAndDrop', locator, movements_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retreat(distance = 1)\n # Don't let the cursor get below zero\n return if @position.x < distance\n\n @position.x -= distance\n end", "def move(distance)\n self.position -= distance\n ensure_bounds\n end", "def shrink_ship\n @length -= 1\n end", "def drop_piece\n return unless @falling_piece\n\n loop do\n # piece_down takes care of finishing on hit\n break if piece_down\n end\n end", "def drop_all_the_way\n if @game.is_running?\n ran = @current_block.drop_by_one\n ran2 = @current_block2.drop_by_one\n @current_pos1.each{|block| block.remove}\n @current_pos2.each{|block| block.remove}\n while ran\n @score += 1\n ran = @current_block.drop_by_one\n end\n while ran2\n @score += 1\n ran2 = @current_block2.drop_by_one\n end\n draw\n store_current\n if !game_over?\n next_piece\n next_piece2\n end\n @game.update_score\n draw\n end\n end", "def drop(w)\r\n @contents.push(w)\r\n show_disk(size,w,@delay)\r\n end", "def moveLeft(dist)\n @body.p.x -= dist\n end", "def blur(distance)\n find_ones.each do |one|\n spread(one, distance)\n end\n end", "def garden_grow(points)\r\n end", "def pop()\n min_dist = 1.0/0.0\n min_tuple = nil\n @queue.each{ |tuple|\n if(tuple.distance < min_dist)\n min_dist = tuple.distance\n min_tuple = tuple\n end\n }\n return @queue.delete(min_tuple)\n end", "def reduce_hitpoint(damage)\r\n @hitpoint -= damage\r\n end", "def drive(distanceInMiles)\n\t\t\n\t\tgasToRemove = self.fuelEfficiency * distanceInMiles\n\n\t\tself.fuelLevel -= gasToRemove\n\n\t\t#\tEnsure we don't go below zero gas\n\t\tself.fuelLevel = [self.fuelLevel, 0].max\n\tend", "def drop(pos)\n @myPositions[pos].player = @myPlayerTurn\n @myUnplaced[@myPlayerTurn] -= 1\n @myPlaced[@myPlayerTurn] +=1\n end", "def truncate(decplace = 0)\n #This is a stub, used for indexing\n end", "def move_west\n @x -= 1\n end", "def drop\n spawn\n\n begin\n push\n landed = drop1\n end until landed\n\n commit\n\n if @caching\n cache\n else\n nil\n end\n end", "def pile(w)\n w.drag_to(@current)\n w.set_default_refresh_loc('tl')\n @current.x += PILE_OFFSET\n end", "def drop_bomb(x,y)\n return nil if out_of_range?(x,y) || !spot_empty?(x,y)\n self[x,y] = spot_unoccupied?(x,y) ? MISS_MARK : HIT_MARK\n end", "def moveRight(distance)\n @x = @x + distance\n @image.x = @x\n end", "def delete_element(element); end", "def move_dist(deltx, delty)\n @x += deltx\n @y += delty\n normalize\n end", "def move_card_down(card, num_spots)\n card_index = @cards.index(card)\n new_index = (card_index + num_spots)\n if new_index > 53\n new_index = (new_index % 54) + 1 # The plus 1 prevents it from becoming the first card\n end\n @cards.delete_at(card_index)\n @cards.insert(new_index, card)\n end", "def drop(x, z)\n @chunks[x] && @chunks[x].delete(z)\n end", "def take_damage(damage)\n @hitpoint -= damage\n end", "def remove_slot\n @limit -= 1\n end", "def move_higher\n movement { self.position -= 1 }\n end", "def attract(el)\n if inert?\n dx = x-el.x\n dy = y-el.y\n \n dist = Math.sqrt(dx*dx+dy*dy)\n f = Ftor.new(dx,dy)/dist.to_f/100.0\n # repel a little, too much makes it weird at the end when most atoms are inert\n el.force += f*-0.1*electron_count\n return false\n else\n if point_hits? el.x, el.y\n add_electron el\n play_sound :electron_freed\n return true\n else\n dx = x-el.x\n dy = y-el.y\n \n dist = Math.sqrt(dx*dx+dy*dy)\n f = Ftor.new(dx,dy)/dist.to_f/100.0\n el.force += f\n el.force += f*0.2*electron_count\n end\n false\n end\n end", "def drop( gobject )\r\n\t\t\t@contents -= [ gobject ]\r\n\t\tend", "def hit_by_bullet\n $p_bullets.delete_if do |b|\n if self.bounding_box_collision?(b)\n @meter.change_width(b.dmg)\n b.destroy\n during(100) { @color.alpha = 100 }.then { @color.alpha = 255 }\n @life -= 1.0\n true\n end\n end\n end", "def drop_to(container, bikes)\n bikes.each do |bike|\n container.dock(bike)\n release(bike) \n end \n end", "def click_and_drag_to_position(capybara_element, xLoc, yLoc)\n wait_for_loading\n execute_script(\"jQuery('body').append('<div id=\\\"tempPositionMarker\\\" style=\\\"position:absolute; left:#{xLoc}px; top:#{yLoc}px; width: 0px; height: 0px;\\\"></div>');\")\n capybara_element.drag_to(find(:css, \"#tempPositionMarker\"))\n execute_script(\"jQuery('#tempPositionMarker').remove();\")\n wait_for_loading\n end", "def attract\n @edges.each do |edge|\n delta_x = edge.end.position.x - edge.beginning.position.x\n delta_y = edge.end.position.y - edge.beginning.position.y\n\n norm = normal(delta_x, delta_y)\n\n if 0 < norm && 1.5 * @optimal_distance < norm\n attraction = attractive_force(norm)\n if edge.end.disposition.nil? # wtf?\n edge.end.disposition = Coordinates.new(0, 0)\n else\n edge.end.disposition.x -= (delta_x * norm) / attraction\n edge.end.disposition.y -= (delta_y * norm) / attraction\n end\n edge.beginning.disposition.x += (delta_x * norm) / attraction\n edge.beginning.disposition.y += (delta_y * norm) / attraction\n end\n end\n end", "def remove!\n update_attributes(x_position: nil, y_position: nil)\n end", "def remove_water (ounces)\n @water_level -= ounces\n if @water_level < 0\n @water_level = 0\n end\n end", "def move_down\n @array[-XSIZE..-1].each_with_index { |e, x| yield e } if block_given?\n @array = @array[-XSIZE..-1].concat(@array[0...-XSIZE])\n end", "def drop_item(index)\n @children.delete_at(index)\n end", "def cut\n rmagick_img.crop_resized!(@x, @y, gravity)\n end", "def turn_left\n @shape.body.t -= 300.0\n end", "def tick\n lose_energy\n if @energy <= 0\n @world.roids.delete self\n end \n end", "def decrementX\n @currentPos.x -= 1\n if @currentPos.x < @grid.minX\n @currentPos.x = @grid.maxX\n end\n end", "def move\n super\n gravitize\n end", "def filter_down element\n left_child_is_less_than_element = element.left && element.left.rating < element.rating\n right_child_is_less_than_element = element.right && element.right.rating < element.rating\n\n while left_child_is_less_than_element or right_child_is_less_than_element\n lower_rated_element = nil\n if left_child_is_less_than_element\n lower_rated_element = element.left\n elsif right_child_is_less_than_element\n lower_rated_element = element.right\n end\n element = swap_node_position(element, lower_rated_element)\n left_child_is_less_than_element = element.left && element.left.rating < element.rating\n right_child_is_less_than_element = element.right && element.right.rating < element.rating\n end\n end", "def blur(distance)\r\n distance.times do\r\n blurred\r\n end\r\n end", "def delete(element); end", "def update_eggs\n @eggs.each do |egg|\n if egg.position.y <= EggNestHeight and rand<EggHatchChance\n self << egg.hatch\n @eggs.delete(egg)\n @eggs.compact!\n elsif egg.position.y > EggNestHeight\n egg.move\n end\n end\n end", "def drop_item1\n return enemy.drop_item1\n end", "def delete_at(index)\n return nil if index >= @size || index < 0\n element = self[index]\n if direct_index = @map[index]\n @added.delete_at(direct_index)\n @map.delete(index)\n @map.keys.sort.each do |key|\n if key > index\n value = @map.delete(key)\n value -= 1 if value > direct_index\n @map[key-1] = value\n else\n if (value = @map[key]) > direct_index\n @map[key] -= 1\n end\n end\n end\n else\n lazy_index = lazy_index(index)\n position = @deleted.bsearch_upper_boundary{|e| e <=> lazy_index }\n @deleted.insert(position,lazy_index)\n @map.keys.sort.each do |key|\n if key > index\n @map[key-1] = @map.delete(key)\n end\n end\n end\n #@commands << [:delete,[index]]\n @size -= 1\n element\n end", "def drop_item2\n return enemy.drop_item2\n end", "def finalize\r\n drop_chopsticks\r\n end", "def move!(end_pos)\n board.remove_piece(pos)\n\n if (pos[0] - end_pos[0]).abs == 2\n board.remove_piece(jumped_place(end_pos))\n end\n\n self.pos = end_pos\n board.place_piece(self, end_pos)\n\n maybe_promote\n end", "def drop(n)\n #This is a stub, used for indexing\nend", "def move_object_down(object)\n object.location_move_down unless is_wall?(object.location_down)\n end", "def remove_preceding(node_or_range, size); end", "def remove_tower\n end", "def dirgap( gap = @gap )\n if @pack == :d || @pack == :u\n Pos.set( 0, gap )\n else\n Pos.set( gap, 0 )\n end\n end", "def optimize\n operand.drop(offset)\n end", "def remove!(jumped_pos)\n board[jumped_pos] = nil\n end", "def updatePosition\n super\n\n Bullet.BulletInstances.each { |bullet|\n if collision?(bullet)\n bullet.destroy\n explode\n end\n }\n\n Ship.ShipInstances.each { |ship|\n if collision?(ship)\n ship.destroy\n explode\n end\n }\n end", "def move_down\n down_tile = Couple.new(@location.first + 1, @location.second)\n move_to(down_tile)\n end", "def drops\n @drops\n end", "def delete element\n self.delete_at index_of(element) \n end", "def delete element\n self.delete_at index_of(element) \n end", "def remove_foliage!(x, y)\n raise GameLogicError.new(\"Cannot remove foliage while exploring!\") \\\n if exploring?\n raise GameLogicError.\n new(\"Cannot remove foliage from battleground planet!\") \\\n if solar_system.battleground?\n \n tile = Tile.where(:planet_id => id, :x => x, :y => y).first\n raise GameLogicError.new(\"There is no tile @ #{x},#{y}!\") if tile.nil?\n \n kind = tile.kind\n raise GameLogicError.new(\n \"Tile @ #{x},#{y} should have been exploration tile but was #{\n kind.inspect}!\") unless Tile::EXPLORATION_TILES.include?(kind)\n \n width, height = Tile::BLOCK_SIZES[kind] \n cost = Cfg.foliage_removal_cost(width, height)\n \n player = self.player\n raise GameLogicError.\n new(\"#{self} must have a player to remove foliage!\") \\\n if player.nil?\n \n raise GameLogicError.new(\n \"Not enough creds for #{player}! Required: #{cost}, had: #{\n player.creds}\"\n ) if player.creds < cost\n \n stats = CredStats.remove_foliage(player, width, height)\n player.creds -= cost\n \n tile.destroy!\n stats.save!\n player.save!\n\n self\n end", "def valid_drop_spot(x,y)\n return true\n end", "def remove_from_list\n if in_list?\n decrement_positions_on_lower_items\n set_my_position nil\n end\n end", "def move\n self.speed += random_vector(0.5)\n self.position.x -= window.current_speed/4\n bounce_off_border_y\n on_hitting_x { destroy!; return }\n end", "def displace_to_waste\n @areas[:waste].add_from(@pile, @card)\n end", "def remove_from_list\n return unless in_list?\n decrement_positions_on_lower_items\n set_my_position nil\n end", "def reposition_item\n return true unless displace_item && perspective && perspective == PERSPECTIVES.first\n # Determine insertion point and clear space for move\n insertion_point = displace_item.position + displace_item.subtree.count\n fund_item.fund_grant.fund_items.update_all(\n [ \"position = position + ?\", fund_item.subtree.count ],\n [ \"position >= ?\", insertion_point ]\n )\n # Determine offset and move item with subtree\n offset = insertion_point - fund_item.position\n offset -= fund_item.subtree.count if fund_item.position >= insertion_point\n fund_item.subtree.update_all( [ 'position = position + ?', offset ] )\n # Close gap beyond moved item\n fund_item.fund_grant.fund_items.update_all(\n [ 'position = position - ?', fund_item.subtree.count ],\n [ 'position >= ?', fund_item.position + fund_item.subtree.count ]\n )\n fund_item.reload\n true\n end", "def remove_topping(x)\n @toppings.delete_at(x)\n end", "def calculate_heel_drop\n\t\tself.heel_drop = self.heel_stack - self.forefoot_stack\n\tend", "def moveLeft(distance)\n @x = @x - distance\n @image.x = @x\n end", "def moveLeft(distance)\n @x = @x - distance\n @image.x = @x\n end", "def remove_wagon(wagon)\n @wagon_list.delete(wagon) if speed.zero?\n end", "def delete_min\n loc = delete_min_locator\n loc and loc.value\n end", "def swipe_element_to_rigth(xpath)\r\n\r\n #get 'mobile element' form xpath\r\n mobile_element = get_mobile_element xpath\r\n\r\n if mobile_element.nil? or mobile_element.to_s.empty?\r\n raise \"Element Not Found. XPATH => ''#{xpath}''\"\r\n end\r\n\r\n begin\r\n\r\n found_bounds = get_bounds_from_element(mobile_element) do |x1, y1, x2, y2|\r\n ym = (y1 + y2) >> 1\r\n adb_exec(\"shell input swipe #{x1} #{ym} 10000 #{ym}\")\r\n #puts \"EXEC SHELL => shell input swipe #{x1} #{ym} 10000 #{ym}\"\r\n end\r\n\r\n result = !found_bounds.nil?\r\n\r\n return result\r\n\r\n rescue Exception => e\r\n raise \"swipe_element_to_rigth => EXCEPTION => #{e.message}\"\r\n\r\n end\r\n\r\nend", "def dropOff(simulator)\n end", "def remove(row, column)\n # We have to do four things:\n #\n # 1. Make sure \"row\" is in bounds\n # 2. Make sure \"column\" is in bounds\n # 3. Make sure there's a piece at (row, column) to remove\n # 4. If all the above check out, remove the appropriate piece\n end", "def update_projectiles\n\t\t@projectiles.delete_if do |projectile|\n\t\t\tprojectile.move\n\t\t\tprojectile.out_of_bounds\n\t\tend\n\tend", "def surge; end", "def drop_item(item)\n #this will take an item from the hero's inventory and place it in the current room\n end", "def shift\n if @elements.empty?\n return nil\n end\n\n swap(0,@elements.size-1)\n ele = @elements.pop\n heapify(0)\n ele\n end", "def drag_element_to(xpath_element_origin, x_fate, y_fate, duration = nil)\r\n\r\n result = false\r\n mobile_element_source = get_mobile_element xpath_element_origin\r\n\r\n duration_time = duration.nil? ? 500 : duration\r\n xm1 = nil\r\n ym1 = nil\r\n xm2 = x_fate\r\n ym2 = y_fate\r\n\r\n if mobile_element_source.nil? or mobile_element_source.to_s.empty?\r\n raise \"Element sourse Not Found. XPATH => ''#{xpath_element_origin}''\"\r\n end\r\n\r\n begin\r\n\r\n fb_1 = get_bounds_from_element(mobile_element_source) do |x1, y1, x2, y2|\r\n xm1 = (x1 + x2) >> 1\r\n ym1 = (y1 + y2) >> 1\r\n #puts(\"shell input swipe #{xm1} #{ym1} #{xm2} #{ym2} #{duration_time}\")\r\n adb_exec(\"shell input swipe #{xm1} #{ym1} #{xm2} #{ym2} #{duration_time}\")\r\n end\r\n\r\n result = !fb_1.nil?\r\n\r\n unless result\r\n raise \"drag_element_to => Fail => no fue posible hacer scroll down => '#{xpath_element_origin}'.\"\r\n end\r\n\r\n return result\r\n\r\n rescue Exception => e\r\n raise \"drag_element_to_element => EXCEPTION => #{e.message}\"\r\n\r\n end\r\n\r\nend", "def delete_at(p0) end", "def release_attachment_position(attachment_position)\n\t\t@ring_positions.delete(attachment_position)\n\t\t# FIXME - NEED TO HAVE LIST OF POSITIONS TO CONSUME\n\tend", "def drag_and_drop_by(source, right_by, down_by, device: T.unsafe(nil)); end", "def reposition_element(index)\n return if size <= 1\n\n element = @backing_store.delete_at(index)\n index = binary_index(@backing_store, element)\n\n @backing_store.insert(index, element)\n end", "def filter_up(element)\n element_index = @tree.index(element)\n parent = element_index / 2\n element_is_greater_than_child = @tree[parent] && @tree[parent].rating > element.rating\n while element_is_greater_than_child\n swap_node_position(@tree[parent], element)\n parent = element_index / 2\n element_is_greater_than_child = @tree[parent] && @tree[parent].rating > element.rating\n end\n end", "def clicked(position:)\n d = position.dist(location)\n return unless d < @mass\n\n @dragging = true\n @drag_offset = location - position\n end", "def drop(object)\n\t\t\traise GreyGoo::Error, \"You don't have that object\" if !has?(object)\n\t\t\tcurrent_room.take(object)\n\t\t\tself.reload # because the object's parent has lost the object, not us\n\t\tend", "def remove_leading(node_or_range, size); end", "def move_one_patch\n target = patch_ahead 1\n\n # faced patch desirable\n # faced patch force move\n #\n # find desirable neighboring patch\n # no desirable, about face\n\n if passable?(target)\n if patch_desirable?(target)\n walk_forward 1\n self.random_walk_suitable_count += 1\n elsif should_leave?\n walk_forward 1\n self.random_walk_unsuitable_count += 1\n else\n select_forage_patch_and_move\n end\n else\n select_forage_patch_and_move\n end\n end", "def clicked(position:)\n d = position.dist(@location)\n return unless d < @mass\n\n @dragging = true\n @drag_offset = @location - position\n end", "def move_disk(from,to)\n @towers[to] << @towers[from][-1]\n @towers[from].pop\n nil\nend", "def delete\n raise \"Bad things happen\" if @size == 0\n @size -= 1\n end", "def relax(edge)\n #If the distance currently is lower than the added distance,\n #Don't increase it.\n return if @dist_to[edge.dest] <= @dist_to[edge.source] + edge.weight\n \n #Update the distance and add it back to the queue\n @dist_to[edge.dest] = @dist_to[edge.source] + edge.weight\n @path[edge.dest] = edge.source\n @queue.insert(edge.dest, @dist_to[edge.dest])\n end", "def drop_row(pos)\n start = pos[:at].to_i\n count = pos[:count].to_i\n stop = start + count - 1\n rows.where(position: start..stop).destroy_all\n rows.each_with_index do |row,i|\n row.position = i\n row.save\n end\n end", "def update\n space.fall(self) if should_fall?\n move\n end", "def move_joker_b\n b_pos = $deck.find_index('B')\n $deck.delete('B')\n if b_pos == 51\n $deck << 'B'\n else\n $deck.insert (b_pos + 2) % 53, 'B'\n end\nend", "def remove_from_list\n # if in_list?\n # decrement_positions_on_lower_items\n # update_attribute position_column, nil\n # end \n return unless in_list?\n decrement_positions_on_lower_items\n update_attribute position_column, nil \n end", "def clicked(position:)\n d = position.dist(location)\n return unless d < mass\n\n @dragging = true\n @drag_offset = location - position\n end" ]
[ "0.6291463", "0.5994315", "0.5739622", "0.5558997", "0.5538032", "0.54609877", "0.54457396", "0.5436836", "0.54139566", "0.5399398", "0.5311409", "0.52965623", "0.52940357", "0.5273117", "0.52564263", "0.5237877", "0.51937807", "0.51923263", "0.5144261", "0.5097549", "0.50788295", "0.50678766", "0.50237924", "0.49940136", "0.49836516", "0.49758828", "0.49690944", "0.4968083", "0.49650145", "0.49586555", "0.49434382", "0.49280426", "0.49052066", "0.49011108", "0.48959398", "0.48916844", "0.48864195", "0.4884313", "0.4879173", "0.48634955", "0.48608953", "0.48565978", "0.48525956", "0.48514414", "0.4836179", "0.48190597", "0.4817455", "0.48017696", "0.47937715", "0.47914737", "0.4784574", "0.4784267", "0.47831267", "0.47810876", "0.47805005", "0.47790748", "0.47768152", "0.4769836", "0.47614476", "0.4758085", "0.4758075", "0.4758075", "0.47523552", "0.47462586", "0.4743051", "0.47414118", "0.47407752", "0.47377226", "0.47295424", "0.47217464", "0.47197995", "0.4718905", "0.4718905", "0.47154093", "0.4714047", "0.47132647", "0.4700882", "0.46914274", "0.4691019", "0.46822283", "0.46813792", "0.4681065", "0.4678967", "0.4675872", "0.4671863", "0.4669672", "0.46654466", "0.46617702", "0.46580422", "0.4650814", "0.46413383", "0.4625423", "0.4624558", "0.46243867", "0.462102", "0.46168745", "0.46154094", "0.46114945", "0.46087715", "0.46005723", "0.4600102" ]
0.0
-1
Drags an element and drops it on another element.
def drag_and_drop_to_object locator_of_object_to_be_dragged, locator_of_drag_destination_object command 'dragAndDropToObject', locator_of_object_to_be_dragged, locator_of_drag_destination_object end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graft!(other)\n verify_graft(other)\n other.parent = parent\n parent.children.add other\n parent.children.delete self\n end", "def drop( gobject )\r\n\t\t\t@contents -= [ gobject ]\r\n\t\tend", "def drag_and_drop_by(source, right_by, down_by, device: T.unsafe(nil)); end", "def hand_off_to!(other)\n verify_hand_off_to(other)\n other.children.replace children\n other.parent = parent\n @children = EmptyClass\n @parent = nil\n end", "def drop_to(container, bikes)\n bikes.each do |bike|\n container.dock(bike)\n release(bike) \n end \n end", "def splice!(other, type)\n # We have to get the container list via a topological sort on the\n # configuration graph, because otherwise containers that contain\n # other containers will add those containers back into the\n # graph. We could get a similar affect by only setting relationships\n # to container leaves, but that would result in many more\n # relationships.\n containers = other.topsort.find_all { |v| v.is_a?(type) and vertex?(v) }\n containers.each do |container|\n # Get the list of children from the other graph.\n children = other.adjacent(container, :direction => :out)\n\n # Just remove the container if it's empty.\n if children.empty?\n remove_vertex!(container)\n next\n end\n\n # First create new edges for each of the :in edges\n [:in, :out].each do |dir|\n edges = adjacent(container, :direction => dir, :type => :edges)\n edges.each do |edge|\n children.each do |child|\n if dir == :in\n s = edge.source\n t = child\n else\n s = child\n t = edge.target\n end\n\n add_edge(s, t, edge.label)\n end\n\n # Now get rid of the edge, so remove_vertex! works correctly.\n remove_edge!(edge)\n end\n end\n remove_vertex!(container)\n end\n end", "def drag_and_drop(source, target, device: T.unsafe(nil)); end", "def drop(w)\r\n @contents.push(w)\r\n show_disk(size,w,@delay)\r\n end", "def delete_element(element); end", "def drag_and_drop(source_element_, target_element)\n $LOG.info \"draging and droping the element Source : #{source_element_} and Target : #{target_element}\"\n begin\n wait_and_find_element(source_element_)\n wait_and_find_element(target_element)\n element = el(source_element_)\n target = el(target_element)\n $driver.action.drag_and_drop(element, target).perform\n rescue Exception => e\n $LOG.error \"Error in drag and drop \\n source element :: #{source_element_} \\n target element #{target_element}\"\n $LOG.error \"Error Message :: \" +e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Error in drag and drop \\n source element :: #{source_element_} \\n target element #{target_element} \\n \" + e.message\n end\n end", "def replace_element_by_own_content(element)\n if element.has_children_elements?\n element.get_children_elements.each do |child|\n element.insert_before(child)\n end\n element.remove_node\n elsif element.has_children?\n element.replace_node(element.get_first_node_child)\n end\n end", "def hand_off_to!(other)\n verify_hand_off_to(other)\n\n other.normal_children.replace normal_children\n other.fallback_child = fallback_child\n @normal_children = []\n @fallback_child = nil\n if parent\n if normal?\n parent.normal_children.delete(self)\n parent.normal_children << other\n else\n parent.fallback_child = other\n end\n other.parent = parent\n @parent = nil\n end\n end", "def make_drop_recieving(options={})\n drop_recieving_element_js(javascript_variable('this'), options)\n end", "def assign_to_parent(element)\n element.remove!\n element.parent = parent\n end", "def unlink(other)\n self.class.graph.disjoin(vertex, other.vertex)\n end", "def drop_all_the_way\n if @game.is_running?\n ran = @current_block.drop_by_one\n ran2 = @current_block2.drop_by_one\n @current_pos1.each{|block| block.remove}\n @current_pos2.each{|block| block.remove}\n while ran\n @score += 1\n ran = @current_block.drop_by_one\n end\n while ran2\n @score += 1\n ran2 = @current_block2.drop_by_one\n end\n draw\n store_current\n if !game_over?\n next_piece\n next_piece2\n end\n @game.update_score\n draw\n end\n end", "def drop\n spawn\n\n begin\n push\n landed = drop1\n end until landed\n\n commit\n\n if @caching\n cache\n else\n nil\n end\n end", "def delete(element); end", "def drop_item(index)\n @children.delete_at(index)\n end", "def skt_bringToFront\n\t\tparent = self.parent\n\t\tself.removeFromParent\n\t\tparent.addChild(self)\n\tend", "def drag_and_drop(source, sourceinfo, target, targetinfo, action)\n $marathon.dragAndDrop(ComponentId.new(source, sourceinfo), ComponentId.new(target, targetinfo), action)\nend", "def drop(object)\n\t\t\traise GreyGoo::Error, \"You don't have that object\" if !has?(object)\n\t\t\tcurrent_room.take(object)\n\t\t\tself.reload # because the object's parent has lost the object, not us\n\t\tend", "def addto!(other)\n\t\treplace(addto(other))\n\tend", "def drag_and_drop(source, sourceinfo, target, targetinfo, action)\n $marathon.dragAndDrop(ComponentId.new(source, sourceinfo), ComponentId.new(target, targetinfo), action)\nend", "def reposition_element(index)\n return if size <= 1\n\n element = @backing_store.delete_at(index)\n index = binary_index(@backing_store, element)\n\n @backing_store.insert(index, element)\n end", "def drag_and_drop_by(source, offset = {})\n element = find_element(source)\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n action.drag_and_drop_by(element, x, y).perform\n end", "def pop\n until @queue_1.size == 1\n @queue_2 << @queue_1.shift\n end\n\n # popped_element = @queue_1.shift\n # @queue_1 = @queue_2\n # @queue_2 = []\n # popped_element\n\n # ..is the same as..\n\n # q1 has 1 el, q2 has the rest. we want q2 empty, q1 full - last\n @queue_1, @queue_2 = @queue_2, @queue_1\n @queue_2.shift\n end", "def drop_item; self['DropItem'] = 1 end", "def cut(x, y)\n x.left.right = x.right\n x.right.left = x.left\n y.degree -= 1\n if (y.degree == 0)\n y.child = nil\n elsif (y.child == x)\n y.child = x.right\n end\n x.right = @next\n x.left = @next.left\n @next.left = x\n x.left.right = x\n x.parent = nil\n x.marked = false\n end", "def click_and_drag_to_position(capybara_element, xLoc, yLoc)\n wait_for_loading\n execute_script(\"jQuery('body').append('<div id=\\\"tempPositionMarker\\\" style=\\\"position:absolute; left:#{xLoc}px; top:#{yLoc}px; width: 0px; height: 0px;\\\"></div>');\")\n capybara_element.drag_to(find(:css, \"#tempPositionMarker\"))\n execute_script(\"jQuery('#tempPositionMarker').remove();\")\n wait_for_loading\n end", "def disown(w)\n super(w)\n DOM.changeToStaticPositioning(w.getElement)\n end", "def drop\n container.drop_context(self)\n end", "def move_under new_parent\n ensure_exists!\n ensure_no_cycle! new_parent\n if parent\n parent.remove_child self\n else\n trace.remove_root self\n end\n if new_parent\n new_parent.add_child self\n @parent_span_id = new_parent.span_id\n else\n trace.add_root self\n @parent_span_id = 0\n end\n @parent = new_parent\n self\n end", "def drop_piece\n return unless @falling_piece\n\n loop do\n # piece_down takes care of finishing on hit\n break if piece_down\n end\n end", "def XOdragAndDrop(tag, tvalue, right_by, down_by)\n\n\t\turl= @wwBrws.url.to_s\n\t\t$pfd.tstart(url)\n\t\tbegin\n\t\t\tel= @wwBrws.element(tag, tvalue)\n\t\t\tel.drag_and_drop_by( right_by, down_by)\n\t\t\t$pfd.calcApplRes(true, 'Drag and drop '+par1+' by '+right_by.to_s+'/'+down_by.to_s, url)\n\t\t\tsleep TIMETICK\t\t\t\t\t\t\t\t\t\t\t\t\t\t# small sleep to let objects appear\n\t\t\tres= OK\n\t\trescue\n\t\t\tmsg='DragAndDrop failed. Values: /'+tag.to_s+'/'+tvalue+'/ '+$!.to_s\n\t\t\tres= setResCritical( msg)\n\t\tend\n\t\treturnRes (res )\n\tend", "def drag_drop(start_x, start_y, end_x, end_y)\n @java_obj.dragDrop(\n org.sikuli.script::Location.new(start_x, start_y).offset(x(), y()),\n org.sikuli.script::Location.new(end_x, end_y).offset(x(), y()),\n 0\n )\n end", "def teardown\n @root.remove!(@left_child1)\n @root.remove!(@right_child1)\n @root = nil\n end", "def drops\n @drops\n end", "def cut(x, y)\n x.left.right = x.right\n x.right.left = x.left\n y.degree -= 1\n if (y.degree == 0)\n y.child = nil\n elsif (y.child == x)\n y.child = x.right\n end\n x.right = @next\n x.left = @next.left\n @next.left = x\n x.left.right = x\n x.parent = nil\n x.marked = false\n end", "def remove_edge(id1, id2)\n # YOUR WORK HERE\n end", "def move_to_top\n unless @in_palette\n delete\n @parent.add_draggable(self)\n end\n end", "def drop(color, column)\n #append color to column\n @grid[column] << color\n @last_x = column\n @lasy_y = @grid[column].length - 1\n @last_color = color\n end", "def shift\n if @elements.empty?\n return nil\n end\n\n swap(0,@elements.size-1)\n ele = @elements.pop\n heapify(0)\n ele\n end", "def push(element)\t\t\n\t\twhile !@q1.empty? do\n\t\t\t@q2.enq(@q1.pop) # Dequeue element from queue q1 and enque the same to q2\n\t\tend\n\t\t@q1.enq(element)\n\t\twhile !@q2.empty? do\n\t\t\t@q1.enq(@q2.pop) # Dequeue element from queue q2 and enque the same to q1\n\t\tend\t\n\tend", "def drop_toy(toy_index)\n p 'drop toy'\n # get the toy\n @main_view.add_toy(ToyInScene.new(@state.toys[toy_index]))\n #add toy's actions to scene\n @state.toys[toy_index].actions.each do |action|\n @main_view.add_action(action)\n end\n close_toybox\n @main_view.addSceneToy\n grab\n end", "def remove!\n update_attributes(x_position: nil, y_position: nil)\n end", "def test_drop\n filter = TagFilter.new( HTML::P, Action::DROP )\n [ :walk_depth_first, :walk_breadth_first ].each do |order|\n assert_transform( DROP_HTML, filter, order )\n end\n end", "def delete!\n graph.remove_edge element\n end", "def delete!\n graph.remove_edge element\n end", "def drag_to(target)\n raise Gridium::InvalidTypeError, \"source element selector must be ':css'\" unless self.by == :css\n raise Gridium::InvalidTypeError, \"target element selector must be ':css'\" unless target.by == :css\n\n Log.debug(\"[GRIDIUM::Element] Dragging (#{self}) to (#{target})\")\n ElementExtensions.drag_to(self, target)\n end", "def drop_one!(label)\n i = self.labels.index(label)\n return nil unless i\n self.items.each do |item|\n item.delete_at(i)\n end\n self.labels.delete_at(i)\n self\n end", "def degroup!\n self.explicit_boundaries = []\n self\n end", "def remove_tower\n end", "def test_same_edge_cannot_be_dropped_twice\n s0, s1, e01, e10 = nil\n fa = Automaton.new do |fa|\n s0 = fa.add_state(:initial => true)\n s1 = fa.add_state\n e01 = fa.connect(s0, s1, 'a')\n e10 = fa.connect(s1, s0, 'b')\n end\n\n # we drop first edge\n fa.drop_edge(e01)\n\n # cannot drop it again\n assert_raise ArgumentError do\n fa.drop_edge(e01)\n end\n end", "def deunion\n [self]\n end", "def swap(node_or_tags); end", "def swap(node_or_tags); end", "def drop_item\n @order.order_items.find(params[:id]).destroy\n\n refresh\n end", "def bubble_down()\n\t\t# remove max and swap with last node\n\t\t@elements[0] = @elements.pop\n\t\ti = 0\n\t\twhile(i < @elements.length)\n\t\t\tmax_idx = i\n\t\t\t# find greater of left and right child\n\t\t\tif((2*i + 1) < @elements.length && @elements[2*i + 1][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 1\n\t\t\tend\n\t\t\tif((2*i + 2) < @elements.length && @elements[2*i + 2][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 2\n\t\t\tend\n\t\t\t# if left or right child is greater, swap and update i\n\t\t\tif(max_idx != i)\n\t\t\t\tswap(i, max_idx)\n\t\t\t\ti = max_idx\n\t\t\t# if not, we are done\n\t\t\telse\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\tend", "def merge!(other)\n other = other.dup\n other.each_child do |other_child|\n my_child = get_child?(other_child.name)\n # Directly add if a child with the same name does not already exist.\n # Merge if the other child and my child are nodes.\n # Raise an exception otherwise.\n if not my_child\n add_child(other_child)\n elsif my_child.class == other_child.class\n my_child.merge!(other_child)\n else\n source_details = \"#{other_child} (#{other_child.class.name})\"\n target_details = \"#{my_child} (#{my_child.class.name})\"\n raise ConfigurationError.new(\"Cannot merge incompatible types - Source: #{source_details} - Target: #{target_details}\")\n end\n end\n end", "def move(thing, to, check=true)\n item = find(thing)\n dest = find(to)\n\n return if item.nil?\n if check && item.hidden?\n puts \"You can't get to that right now\"\n return\n end\n\n return if dest.nil?\n if check && (dest.hidden? || dest.open == false)\n puts \"You can't put that there\"\n return\n end\n\n if dest.ancestors.include?(item)\n puts \"Are you trying to destroy the universe?\"\n return\n end\n\n item.parent.children.delete(item)\n dest.children << item\n item.parent = dest\n end", "def bring_down(typename, cmd)\n execute_with_fail(typename, cmd, 'to remove')\n end", "def unwrap(node)\n node.children.each do |child|\n node.parent << child\n end\n node.remove\n end", "def test_0620_drop\n @@log.debug \"test_0620_drop starts\" if @@log.debug?\n assert_respond_to(@list, :drop, \"test_0620_drop_respond\")\n # Drop the first element\n assert_equal([@bsb, @cab, @dad], @list.drop(1), \"test_0620_drop_one\")\n # Drop the first two elements\n assert_equal([@cab, @dad], @list.drop(2), \"test_0620_drop_two\")\n @@log.debug \"test_0620_drop ends\" if @@log.debug?\n end", "def drop_compass\n # In the majority of SketchUp tools, you would reset the tool to its\n # initial state here. When you've finished drawing one rectangle, you\n # can draw a second and a third rectangle.\n #\n # Solar North tool is however an exception to the general rule.\n # You typically set the north angle once and then continue drawing\n # with your previous tool. Solar North tool also performs live updates\n # to the north angle as it is used, and you don't click until you are\n # happy with the north direction.\n\n # This is the code you'd use in a typical extension.\n ### @state = PLACE_STATE\n ### @reference_input_point.clear\n ### update_status_text\n\n Sketchup.active_model.tools.pop_tool\n end", "def copyElementWithReplacements(element, newElement)\n raise \"element is not an REXML::Element (#{element})\" unless element.is_a?(REXML::Element)\n raise \"newElement is not an REXML::Element (#{newElement})\"unless newElement.is_a?(REXML::Element)\n\n element.children.each() do |child|\n if (child.is_a?(REXML::Element)) then\n if (child.expanded_name == \"xi:xinclude\") then\n newChild = processInclude(child)\n else\n newChild = REXML::Element.new(child)\n copyElementWithReplacements(child,newChild)\n end\n newElement.add(newChild) \n elsif (child.is_a?(REXML::Text))\n newElement.add(REXML::Text.new(child))\n elsif (child.is_a?(REXML::Comment))\n newElement.add(REXML::Comment.new(child))\n end\n #puts \"==\" + child.to_s() + \"==\"\n end\n end", "def fdrop!\n @session.chanserv.fdrop(self.name)\n end", "def detach()\n @left.detach\n @right.detach\n @results.clear\n end", "def drop\n do_callback(:before_drop)\n collection.drop\n do_callback(:after_drop)\n end", "def drop_item2\n return enemy.drop_item2\n end", "def move_from_old_parent\n parent.remove(self)\n end", "def remove shape\n @remove_shapes << shape\n end", "def drag_and_drop locator, movements_string\r\n command 'dragAndDrop', locator, movements_string\r\n end", "def drop\n @client.send_packet Packet::PlayerDigging.drop\n end", "def drop_bomb(x,y)\n return nil if out_of_range?(x,y) || !spot_empty?(x,y)\n self[x,y] = spot_unoccupied?(x,y) ? MISS_MARK : HIT_MARK\n end", "def disown container\n children.delete container\n end", "def fake_drop(from,to)\n to = to.gsub(/#/,\"\")\n from = from.gsub(/#/,\"\")\n script = <<-EOF\n var drop = Droppables.drops.find( function (e) { if (e.element.id == '#{to.gsub(/#/,\"\")}') return true; });\n if (drop) {\n drop.onDrop($('#{from}'));\n }\n EOF\n page.execute_script(script)\nend", "def remove_element\n @app.dom_on_sockets.remove_element @id\n end", "def take \n element = @root.level.maps.first.element_at @position\n \n unless element.is_a? Interactable \n say(\"I can't pick it up!\") \n return\n end\n @inventory << element \n @root.level.maps.first.game_objects.delete(element)\n @root.inventory_updated if defined? @root.inventory_updated\n end", "def swap_elements(array)\n array.insert(1,array.delete_at(2))\nend", "def merge!\n duplicate_category.each_with_children {|subcategory| swap_businesses_and_taggings(subcategory) }\n duplicate_category.destroy\n end", "def drop( number )\n\n load_parent_state\n \n return super\n\n end", "def remove\n if @pop_stack.is_empty?\n transfer(@push_stack, @pop_stack)\n end\n\n @pop_stack.pop\n end", "def paste_from_clipboard(page_id, element, method, position)\n element_copy = copy(element, :page_id => page_id)\n element_copy.insert_at(position)\n if method == \"move\" && element_copy.valid?\n element.destroy\n end\n element_copy\n end", "def pop\r\n removed_item = @data\r\n @data = @data.next_node\r\n removed_item.next_node = nil\r\n removed_item\r\n end", "def sash_dragto(index, x, y)\n execute_only(:sash, :dragto, index, x, y)\n end", "def delete_left(other)\n left.delete(other.project(left.header))\n end", "def swap_with(other)\n self.class.base_class.transaction do\n old_position = position\n update_attribute(:position, other.position)\n other.update_attribute(:position, old_position)\n end\n end", "def drop_item1\n return enemy.drop_item1\n end", "def remove_node(index)\n nodes.data.delete_at(index)\n insert_toolbar_before = n_state(:insert_toolbar_before)\n insert_toolbar_before.delete(index)\n set_state post: state.post, insert_toolbar_before: insert_toolbar_before\n end", "def escalate_bbtree(element)\n @current_node = TagNode.new(element)\n @tags_list.push @current_node\n end", "def draggable_element(element_id, options = {})\n javascript_tag(draggable_element_js(element_id, options).chop!)\n end", "def draggable_element(element_id, options = {})\n javascript_tag(draggable_element_js(element_id, options).chop!)\n end", "def remove_edge(x, y)\n raise\n end", "def drop(pos)\n @myPositions[pos].player = @myPlayerTurn\n @myUnplaced[@myPlayerTurn] -= 1\n @myPlaced[@myPlayerTurn] +=1\n end", "def pop\n @tape.pop()\n end", "def remove_at(index)\n node = get_node index\n remove_node node\n node.element\n end", "def delete_at(index)\t\n\t\tif index==1\n\t\t\t@first = tmp.front\n\t\t\t@first.back = nil\n\t\telsif @length==index\n\t\t\tpop;\n\t\telse\n\t\t\ttmp = get(index)\n\t\t\ttmp.back.front = tmp.front \n\t\t\ttmp.front.back = tmp.back\n\t\tend\n\t\t@length-=1\n\tend", "def swap_elements(array)\n array.insert(1, array.delete_at(2))\nend", "def drop_event(items, real_x, real_y, dropper = nil, time = nil)\n # map coordinates\n x, y, icon = real_x / 128, real_y / 128, false\n # if gold dropped and no corpses used\n if dropper == nil && items[0].is_a?(Numeric) &&\n !BlizzABS::Config::CORPSES\n # set up everything for map display\n event = create_drop_event(x, y, BlizzABS::Config::GOLD_DROP)\n # setup the event commands\n setup_drop_event(event, items, BlizzABS::Config::GOLD_PICKUP_SOUND_FILE)\n else\n # if not dropped by enemy\n if dropper == nil\n # create drop event with icon spriteset\n event = create_drop_event(x, y, items[0].icon_name)\n # event with icon spriteset\n icon = !Items.drop_sprite(items[0].id)\n # if using corpses\n elsif BlizzABS::Config::CORPSES\n # create drop event\n event = create_drop_event(x, y, dropper.character_name_org +\n BlizzABS::SPRCorpse, dropper.character_hue, 0)\n else\n # create drop event\n event = create_drop_event(x, y, dropper.character_name_org,\n dropper.character_hue)\n end\n # setup the event commands\n setup_drop_event(event, items)\n end\n # call superclass method\n drop = Game_Event.new($game_map.map_id, event)\n # mark created event as icon event\n drop.icondrop = icon\n # refresh\n drop.refresh\n # set up drop mode\n drop.activate_drop_mode(BlizzABS::Config::DROP_TIME * 40)\n # add into map events\n $game_map.events[event.id] = drop\n # stop if scene not Scene_Map or spriteset doesn't exist\n return if !$scene.is_a?(Scene_Map) || $scene.spriteset == nil\n # create own sprite as dropped\n sprite = Sprite_Character.new($scene.spriteset.viewport1, drop)\n # add to spriteset handler\n $scene.spriteset.character_sprites.push(sprite)\n end" ]
[ "0.59738415", "0.5907787", "0.5711887", "0.5687148", "0.56057733", "0.55802524", "0.5513796", "0.55060804", "0.5489238", "0.547944", "0.5426555", "0.53494436", "0.5304165", "0.5298642", "0.52739054", "0.5234847", "0.5163752", "0.5152643", "0.5147337", "0.51200956", "0.510614", "0.50875515", "0.5073158", "0.5072114", "0.5049267", "0.5045358", "0.5027391", "0.50141835", "0.5008555", "0.5007616", "0.4966549", "0.49487612", "0.49394944", "0.4913917", "0.49098045", "0.4886673", "0.48795766", "0.4864225", "0.4859262", "0.48463428", "0.48251373", "0.4823708", "0.48136955", "0.48136473", "0.4804761", "0.48034298", "0.48021162", "0.47894856", "0.47894856", "0.47865295", "0.47774568", "0.4775728", "0.4769871", "0.47667342", "0.47600982", "0.47550014", "0.47550014", "0.47431213", "0.4741191", "0.47408956", "0.47302186", "0.47257566", "0.47245845", "0.47198337", "0.4717663", "0.4703017", "0.47022805", "0.46956924", "0.4694542", "0.4692758", "0.46846792", "0.46788394", "0.4678357", "0.46780768", "0.467771", "0.4674933", "0.4671963", "0.4671432", "0.46679708", "0.46625128", "0.46625054", "0.46555373", "0.46546453", "0.46533903", "0.46492258", "0.46487215", "0.4642175", "0.46382898", "0.46357915", "0.4633226", "0.46330076", "0.46318555", "0.46318555", "0.46261212", "0.46212205", "0.46209723", "0.46201006", "0.46197677", "0.46192026", "0.46173915" ]
0.53685355
11
Prints the specified message into the third table cell in your Selenese tables. Useful for debugging.
def echo message command 'echo', message end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_doc(retval_arr)\n message = retval_arr[0]\n table = retval_arr[1]\n \n table.each do |row|\n puts row\n end\n puts\n end", "def output\n\t\tif @@message_box.length < 5 \n\t\t\t(5 - @@message_box.length).times { @@message_box << \"\\n\" }\n\t\tend\n\t\tputs @@message_box[0] \n\t\tputs @@message_box[1]\n\t\tputs @@v_row.join \n\t\tputs @@message_box[2]\n\t\tputs @@message_box[3]\n\t\tputs @@message_box[4]\n\tend", "def print_error(message, file)\n @output.puts \"\\u{274c} #{file} - #{message}\"\n end", "def print_error(message, file)\n @output.puts \"\\u{274c} #{file} - #{message}\"\n end", "def print_table\n $table_page.puts \"<tr> <td>\" + @fed_no.to_s + \"</td> <td>\"+ @fed_author.join(' ') + \"</td><td> <a href=docs.html#\" + @fed_number[2] + \">\" + @fed_title.join(' ') + \"</td> <td>\" + @fed_place.join(' ') + \"</td> </tr>\"\n end", "def print_table\n\t$table.each do |row|\n\t\trow.each_with_index do |c, index|\n\t\t\tif index != 0\n\t\t\t\tprint ' '\n\t\t\tend\n\t\t\tprint c\n\t\tend\n\t\tprint \"\\n\"\n\tend\nend", "def print_error_message text=$error_message\n r = $error_message_row || Ncurses.LINES-1\n c = $error_message_col || (Ncurses.COLS-text.length)/2 \n\n $log.debug \"got ERROR MESSAGE #{text} row #{r} \"\n clear_error r, $datacolor\n printstring r, c, text, color = $promptcolor\n $error_message_clear_pending = true\n end", "def print\n puts \"Multiplication Table of Prime Numbers\"\n table = Terminal::Table.new :title => \"#{(grid.length - 1).to_s} prime numbers\" do |t|\n \n # For each prime number, create a row\n for x in 0..(grid.length - 1) do\n\n # Start each row with the prime number\n row = [nil]\n \n for y in 0..(grid.length - 1) do\n row << grid[x][y]\n end\n \n # Add the row as well as a seperator for every row, except the last\n t << row\n t << :separator unless x == (grid.length)\n end\n \n end\n puts table\n end", "def display\r\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\r\n puts \"-----------\"\r\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\r\n puts \"-----------\"\r\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\r\n end", "def ui_message(message)\n puts message\n end", "def show_board(msg = '')\n clr\n puts \" A B C \"\n puts \" -------------\"\n puts \"1 | #{@board[\"a1\"]} | #{@board[\"b1\"]} | #{@board[\"c1\"]} |\"\n puts \" -------------\"\n puts \"2 | #{@board[\"a2\"]} | #{@board[\"b2\"]} | #{@board[\"c2\"]} |\" \n puts \" -------------\"\n puts \"3 | #{@board[\"a3\"]} | #{@board[\"b3\"]} | #{@board[\"c3\"]} |\"\n puts \" -------------\"\n puts msg\n end", "def display\n puts \" #{@cells[0]} \" + \"|\" + \" #{@cells[1]} \" + \"|\" + \" #{@cells[2]} \"\n puts \"-----------\"\n puts \" #{@cells[3]} \" + \"|\" + \" #{@cells[4]} \" + \"|\" + \" #{@cells[5]} \"\n puts \"-----------\"\n puts \" #{@cells[6]} \" + \"|\" + \" #{@cells[7]} \" + \"|\" + \" #{@cells[8]} \"\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def display_board(matrix, message = [])\n message.each{ |m| puts m }\n\n puts <<-eos\n A B C D E F G H I J\n +---------------------------------------+\n eos\n matrix.each_with_index do |x, i|\n puts <<-eos\n #{i+1} #{\" \" if i != 9}| #{x[0]} | #{x[1]} | #{x[2]} | #{x[3]} | #{x[4]} | #{x[5]} | #{x[6]} | #{x[7]} | #{x[8]} | #{x[9]} |\n |---|---|---|---|---|---|---|---|---|---|\n eos\n end\n\n puts <<-eos\n +---------------------------------------+\n eos\nend", "def display\n puts \" #{@cells[0]} | #{@cells[1]} | #{@cells[2]} \"\n puts \"-----------\"\n puts \" #{@cells[3]} | #{@cells[4]} | #{@cells[5]} \"\n puts \"-----------\"\n puts \" #{@cells[6]} | #{@cells[7]} | #{@cells[8]} \"\n end", "def display\n puts \" #{@cells[0]} | #{@cells[1]} | #{@cells[2]} \"\n puts \"-----------\"\n puts \" #{@cells[3]} | #{@cells[4]} | #{@cells[5]} \"\n puts \"-----------\"\n puts \" #{@cells[6]} | #{@cells[7]} | #{@cells[8]} \"\n end", "def table_of_contents\n lineWidth = 50\n table_name = \"Table of Contents\"\n colume1_label = \"Chapter\"\n colume2_label = \"\"\n colume3_label = \"page\"\n spacer = \"\"\n puts table_name.center(lineWidth)\n puts spacer\n puts (colume1_label + \" 1:\").ljust(lineWidth/4) + \"Numbers\".ljust(lineWidth/4) + (colume3_label+\" 1\").rjust(lineWidth/2)\n puts (colume1_label + \" 2:\").ljust(lineWidth/4) + \"Letters\".ljust(lineWidth/4) + (colume3_label+\" 72\").rjust(lineWidth/2)\n puts (colume1_label + \" 3:\").ljust(lineWidth/4) + \"Variables\".ljust(lineWidth/4) + (colume3_label+\" 118\").rjust(lineWidth/2)\n\nend", "def display\n\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n\n end", "def display_table(rows, columns)\n\tputs \"\\nYour Multiplication table:\"\n\tputs_labels(columns)\n puts_divider(columns)\n 1.upto(rows) do |row|\n \tputs_row(row, columns)\n end\nend", "def print_error(msg)\n puts \" #{color(\"!\", 33)} #{color(msg, 31)}\"\n end", "def display\n puts \" #{@cells[0]} | #{@cells[1]} | #{@cells[2]} \"\n puts \"-----------\"\n puts \" #{@cells[3]} | #{@cells[4]} | #{@cells[5]} \"\n puts \"-----------\"\n puts \" #{@cells[6]} | #{@cells[7]} | #{@cells[8]} \"\nend", "def print msg, color\n @text[2] = @text[1]\n @text[1] = @text[0]\n @text[0] = Message.new(msg, color, 18)\n end", "def report(title, columns, rows)\n table = capture_table([columns] + rows)\n title = \"=== #{title} \"\n title << \"=\" * [(table.split($/).max{|a,b| a.size <=> b.size }.size - title.size), 3].max\n puts title\n puts table\n end", "def error(message, line, column)\n puts \"*-*-* error at #{line}:#{column}: #{message}\"\n end", "def display_error(message)\n puts \"\\e[31;1m[ERROR]\\e[0m #{message}\"\n end", "def info(message)\n puts \"\\e[35m#{message}\\e[0m\"\n end", "def message text, type=:warning\n colString = ''\n colReset = \"\\033[0m\"\n offset = \"\\033[14C\"\n\n case type\n when :warning\n colString = \"\\033[1;33m\"\n when :error\n colString = \"\\033[1;31m\"\n end\n\n message = \"#{colString}#{offset}middleman-gnuplot: #{text}#{colReset}\"\n\n puts message\n end", "def display\n\t\tputs \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n\t\tputs \"-----------\"\n\t\tputs \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n\t\tputs \"-----------\"\n\t\tputs \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n\tend", "def welcome_message\n puts \"\\n\"\n puts \"The object of the game is to get three spots in a row, diagonally/horizontally/vertically\"\n puts \"Use the numbers from 1-9 to select your position:\"\n puts \"\\n\"\n (1..9).each_slice(3) {|a| puts a.join(' | ')} # sample layout of grid to show the relevant numbers matched to the cell\n puts \"\\n\"\n end", "def matchTableLabel(tblname, tablenum, driver)\n if driver.find_element(:css, \"th:nth-of-type(#{tablenum})\").text == \"#{tblname}\"\n loggEr(\"Log: Table \\\"#{tblname}\\\" appears\")\n else\n loggEr(\"Error: Table \\\"#{tblname}\\\" does not appear\")\n end\nend", "def print\n @cell_board.each do |row|\n string_row_separator = '-'\n string_row = '|'\n row.each do |element|\n string_row += \" #{element.to_s} |\"\n string_row_separator += '----'\n end\n puts string_row\n puts string_row_separator\n end\n end", "def print_multi_table(separator = ' ')\n primes = find_primes\n header = primes.collect{|prim| format_num(prim)}.join separator\n puts separator * (1+ @num_len) + header\n primes.each{|prime_side,row|\n row= primes.collect{|prime_top,col|\n format_num(prime_top*prime_side)\n }.join(separator)\n puts \"#{format_num(prime_side)} #{row}\"\n }\n end", "def display_print\n @grid.each_with_index do |row, row_idx|\n row.each_with_index do |element, column_idx|\n separator = (column_idx % 3 == 2) ? \" \" : \" \"\n print element.to_s + separator\n end\n puts\n puts if (row_idx % 3 == 2)\n end\n nil\n end", "def header(message)\n puts \"\\n\"\n puts '+---'\n puts \"| #{message}\"\n puts '+---'\nend", "def display\n puts \" #{self.cells[0]} | #{self.cells[1]} | #{self.cells[2]} \"\n puts \"-----------\"\n puts \" #{self.cells[3]} | #{self.cells[4]} | #{self.cells[5]} \"\n puts \"-----------\"\n puts \" #{self.cells[6]} | #{self.cells[7]} | #{self.cells[8]} \"\n end", "def puts_failure_data header:, additional_info: []\n break_after_print\n checked_puts header + @messages.join(SEPERATOR)\n\n additional_info.each.with_index do |text, index|\n checked_puts indent(text, index + 1)\n end\n end", "def printMultiplicationTable(numArray)\n puts \"\\nPrime numbers multiplication table\"\n \n # Printing beautified first row with initial margin\n firstRow = \" \"\n numArray.each do |i|\n firstRow += alignTabularValue(i.to_s) + \" | \"\n end\n \n puts firstRow\n \n numArray.each do |i|\n printString = alignTabularValue(i.to_s) + ' | '\n numArray.each do |ii|\n result = (i * ii).to_s\n \n printString += alignTabularValue(result) + ' | '\n end\n puts printString\n end\n \n puts \"\\n\"\n end", "def print\n table_header = \"Last Name | First Name | Gender | Date of Birth | Favorite Color\"\n puts table_header\n puts \"-\" * 50\n @people_array.each do |p|\n puts \"#{p['LastName']} | #{p['FirstName']} | #{p['Gender']} | #{p['DateOfBirth']} | #{p['FavoriteColor']}\"\n end\n end", "def show_error(text)\n puts Header % ['No', text]\n puts Footer % Version\nend", "def print_message(msg)\n print \">> #{msg.to_s} \\n\"\n end", "def action(message)\n print(6, message)\n end", "def check_log_display(list_choice, total_amount, log_name)\n system(\"clear\")\n if total_amount > 0\n table = Terminal::Table.new :title => \"#{log_name}\", :headings => ['Title', 'Author'], :rows => list_choice, :style => {:width => 100}\n table.style = {:all_separators => true}\n puts table\n box = TTY::Box.frame(width: 100, height: 5, align: :center, padding: 1, border: :thick, title: {top_center: ' TOTAL '}) do\n \"#{total_amount} books in your #{log_name}.\"\n end\n puts box\n else\n empty_log()\n end\nend", "def display(msg)\n puts\n puts msg\n end", "def print_table(n)\n printer = Printer.new(first n)\n printer.print\n end", "def history_report(rows)\n table = Terminal::Table.new :headings => ['Date','Exercise', 'Set', 'Weight', 'Reps'], \n :title => \"Exercise Log History\",\n :rows => rows \n puts table\nend", "def testAssert(message, test, assertion)\n puts message\n if test != assertion\n puts \"!!! Assertion Failed !!!\"\n puts \"On page text \\\"\" + \"#{test}\" + \"\\\" does not match #{assertion}\"\n else\n puts \"... Assertion Passed ...\"\n end\nend", "def log_own_htmlmessage(text, is_notice)\n time = Time.now\n anchor = timestamp_anchor(time)\n converter = Cinch::MircCodesConverter.new\n @htmllogfile.puts(<<-HTML)\n <tr id=\"#{anchor}\">\n <td class=\"msgtime\"><a href=\"##{anchor}\">#{time.strftime(timelogformat)}</a></td>\n <td class=\"msgnick selfbot\">#{bot.nick}</td>\n <td class=\"msgmessage\">#{converter.convert(process_message(text))}</td>\n </tr>\n HTML\n end", "def log_html_topic(msg)\n anchor = timestamp_anchor(msg.time)\n @htmllogfile.write(<<-HTML)\n <tr id=\"#{anchor}\">\n <td class=\"msgtime\"><a href=\"##{anchor}\">#{msg.time.strftime(timelogformat)}</a></td>\n <td class=\"msgnick nickaction\">*</td>\n <td class=\"msgtopic\"><span class=\"actionnick #{determine_status(msg)}\">#{msg.user.name}</span>&nbsp;changed the topic to “#{process_message(msg.message)}”.</td>\n </tr>\n HTML\n end", "def print(message)\n output.print(message)\n end", "def draw_error(value)\n draw_table_header\n printf(\"%1$s \\e[31m%2$-#{Renderer::OUTPUT_LENGTH - 6}s\\e[0m %1$5s\\n\", '║', 'ERROR: ' + value.to_s)\n draw_table_footer\n end", "def print_message_text()\n @renderer.puts(\"Msg: #{@message_to_post.text_for_display}\")\n end", "def print_info(message)\n Weechat.print '', \"%sTTS\\t%s\" % [\n Weechat.color('yellow'),\n message\n ]\n end", "def cell(i)\n printf ' %3d ', i\n end", "def print_list(shopping_list)\n table = Terminal::Table.new :title => @list_name, :headings => ['Item'.white.on_green, 'Quantity'.white.on_green], :rows => shopping_list[\"items\"]\n table.style = {:width => 40, :padding_left => 3, :border_x => \"-\", :border_i => \"x\"}\n puts table\nend", "def errmsg(message)\n error.print(\"*** #{message}\\n\")\n end", "def error_table_heading(population_errors, stratification_errors, supp_data_errors)\n if population_errors.present?\n %(#{population_errors.first.message}. The following errors were also identified for this population.)\n elsif supp_data_errors.present?\n %(The following errors were identified for #{supp_data_errors.first.error_details['population_key']}\n #{supp_data_errors.first.error_details['population_id']}.)\n elsif stratification_errors.present?\n population_id = stratification_errors.first.error_details['population_id']\n %(The following errors were identified for\n #{@task.product_test.measures.first.population_criteria.select { |_key, pc| pc['hqmf_id'] == population_id }.keys.first}\n #{stratification_errors.first.error_details['population_id']}.)\n end\n end", "def print_status_message text=$status_message\n r = $status_message_row || Ncurses.LINES-1\n clear_error r, $datacolor\n # print it in centre\n printstring r, (Ncurses.COLS-text.length)/2, text, color = $promptcolor\n end", "def print_error(msg)\n tag = '[ ERROR ]'\n print_formatted(tag,msg)\n end", "def print(msg)\n Java::OrgFusesourceJansi::AnsiConsole::out.print msg\n end", "def print_table\n dimension_length = (@numbers_to_multiply.length)\n topColumn = \"\"\n for i in 0..dimension_length\n topColumn += \" #{@multiplication_table[0][i]} |\"\n end\n for x in 0..dimension_length \n rowValues = \"\"\n for y in 0..dimension_length\n nextEntry = @multiplication_table[x][y]\n rowValues << \" #{nextEntry} |\"\n end\n puts rowValues\n end\n end", "def print_error_message(msg)\n print \"<< ERROR: #{msg.to_s} !!\\n\"\n end", "def message_point couleur, point = '.'\n STDOUT.write \"\\e[#{couleur}m#{point}\\e[0m\"\n sleep 0.1\n end", "def output(message, type)\n puts \"\\e[31m[ ✘ ]\\e[0m #{message}\" if type == 'error'\n puts \"\\e[32m[ ✔︎ ]\\e[0m #{message}\" if type == 'success'\n puts \"\\e[33m[ ✻ ]\\e[0m #{message}\" if type == 'info'\nend", "def print_result\n puts @cells.map{ |row| row.map{ |cell| (cell.determine? ? cell.number : '?').to_s.rjust(length.to_s.length) }.join() }.join(\"\\n\")\n end", "def set_message message, style\n session[:message] = \"\n <div class='row message-wrapper #{style}'>\n <div class=message>#{message}</div>\n <div class=close><i class='material-icons'>clear</i></div>\n </div>\"\n end", "def print(message); end", "def print(message); end", "def alert(msg, action)\n\tSTDERR.puts \"ERROR:\\t#{msg}\"\n\tSTDERR.puts \"\\t#{action}\"\nend", "def chew_error_and_print_message(e)\n case e.message\n when 'ARTICLE_NIL_REQUIRED_VALUE_ERROR'\n puts \"Artigo com título ou autor nulos.\".yellow\n # log_article_error_to_file(article, a_link)\n # interrupt(interrupt_option)\n when \"ARTICLE_ALREADY_IN_DB_ERROR\"\n puts \"Artigo já está no Banco de Dados.\".green\n # log_article_error_to_file(article, a_link)\n when \"FORBIDDEN_ARTICLE_TITLE_ERROR\"\n puts \"Artigo com título proibido.\".yellow\n # interrupt(interrupt_option)\n # log_article_error_to_file(article, a_link)\n else\n puts e.message\n end\n puts \"Ignorando artigo com problemas... OK\\n\"\nend", "def print_cell(c)\n result = \"-------|\\n\"\n if c.solved?\n rows = <<EOT\n ` ` ` |\n ` #{c.val} ` |\n ` ` ` |\nEOT\n result += rows # don't += on the same line as above, it screws up my syntax highlighting\n return result\n else\n result += print_unsolved_cell(c)\n end\n return result\n end", "def print_table(username, percent, numgames, forindex, indexmax)\n if forindex == 0 \n percent = percent.to_s\n numgames = numgames.to_s\n i = 0\n name = \"\"\n line_name = \"\"\n percentw = \"\"\n line_percent = \"\"\n line_games = \"\"\n gamesw = \"\"\n s_username = \"Username\"\n s_percent = \"Win %\"\n s_games = \"Total\"\n for i in 0..10\n if s_username[i] != nil\n name << s_username[i]\n else\n name << \" \"\n end\n line_name << \"═\"\n end\n\n for i in 0..5\n if s_percent[i] != nil\n percentw << s_percent[i]\n else\n percentw << \" \"\n end\n line_percent << \"═\"\n end\n for i in 0..5\n if s_games[i] != nil\n gamesw << s_games[i]\n else\n gamesw << \" \"\n end\n line_games << \"═\"\n end\n puts \"╔═\" + line_name + \"═╦═\" + line_percent + \"═╦═\" + line_games + \"═╗\"\n puts \"║ \" + name + \" ║ \" + percentw + \" ║ \" + gamesw + \" ║\"\n end\n if forindex != indexmax\n percent = percent.to_s\n numgames = numgames.to_s\n i = 0\n name = \"\"\n line_name = \"\"\n percentw = \"\"\n line_percent = \"\"\n line_games = \"\"\n gamesw = \"\"\n for i in 0..10\n if username[i] != nil\n name << username[i]\n else\n name << \" \"\n end\n line_name << \"═\"\n end\n\n for i in 0..5\n if percent[i] != nil\n percentw << percent[i]\n else\n percentw << \" \"\n end\n line_percent << \"═\"\n end\n for i in 0..5\n if numgames[i] != nil\n gamesw << numgames[i]\n else\n gamesw << \" \"\n end\n line_games << \"═\"\n end\n\n puts \"╠═\" + line_name + \"═╬═\" + line_percent + \"═╬═\" + line_games + \"═╣\"\n puts \"║ \" + name + \" ║ \" + percentw + \" ║ \" + gamesw + \" ║\"\n else\n percent = percent.to_s\n numgames = numgames.to_s\n i = 0\n name = \"\"\n line_name = \"\"\n percentw = \"\"\n line_percent = \"\"\n line_games = \"\"\n gamesw = \"\"\n for i in 0..10\n if username[i] != nil\n name << username[i]\n else\n name << \" \"\n end\n line_name << \"═\"\n end\n\n for i in 0..5\n if percent[i] != nil\n percentw << percent[i]\n else\n percentw << \" \"\n end\n line_percent << \"═\"\n end\n for i in 0..5\n if numgames[i] != nil\n gamesw << numgames[i]\n else\n gamesw << \" \"\n end\n line_games << \"═\"\n end\n\n puts \"╠═\" + line_name + \"═╬═\" + line_percent + \"═╬═\" + line_games + \"═╣\"\n puts \"║ \" + name + \" ║ \" + percentw + \" ║ \" + gamesw + \" ║\"\n puts \"╚═\" + line_name + \"═╩═\" + line_percent + \"═╩═\" + line_games + \"═╝\"\n puts \"\\n\\n\\n\"\n end\nend", "def print_board\n horizontal_rule = \" -------------\"\n row_one = \" 1 2 3 \"\n row_two = \" a | #{@array[0][0]} | #{@array[0][1]} | #{@array[0][2]} |\"\n row_three = \" b | #{@array[1][0]} | #{@array[1][1]} | #{@array[1][2]} |\"\n row_four = \" c | #{@array[2][0]} | #{@array[2][1]} | #{@array[2][2]} |\"\n \n print row_one + \"\\n\", row_two + \"\\n\", horizontal_rule + \"\\n\", \n row_three + \"\\n\", horizontal_rule + \"\\n\", row_four + \"\\n\"\n end", "def print_prime_table(n_primes)\n out = ''\n prime_array = is_prime_new(n_primes)\n top_line = \"\\t#{prime_array.join(\"\\t\")}\"\n out += top_line + \"\\n\"\n for prime_row in prime_array\n line = \"\"\n line += \"#{prime_row}\\t\"\n for prime_col in prime_array\n line += \"#{prime_row * prime_col}\\t\"\n end\n out += line + \"\\n\"\n end\n out\nend", "def mostrar_tablero(tablero)\r\n for i in (0...3)\r\n for j in (0...3)\r\n print tablero[i][j]\r\n\t\t\tprint \" \"\r\n\t\tend\r\n\t\tprint \"\\n\"\r\n\tend\r\nend", "def print_stderr(msg)\n puts \" #{color(msg, 31)}\"\n end", "def log_html_message(msg)\n converter = Cinch::MircCodesConverter.new\n anchor = timestamp_anchor(msg.time)\n str = <<-HTML\n <tr id=\"#{anchor}\">\n <td class=\"msgtime\"><a href=\"##{anchor}\">#{msg.time.strftime(timelogformat)}</a></td>\n <td class=\"msgnick #{determine_status(msg)}\">#{msg.user}</td>\n <td class=\"msgmessage\">#{converter.convert(process_message(msg.message))}</td>\n </tr>\n HTML\n\n @htmllogfile.write(str)\n end", "def print_board\n\t\tcell_index=1\n\t\tputs \"\\n\\n\\t[A]\\t[B]\\t[C]\"\n\t\t@cell_status.each_key do |cell|\n\t\t\tcase cell\n\t\t\twhen \"A1\" \n\t\t\t\tprint \" [1]\\t #{marker_on_cell(cell)}\"\n\t\t\twhen \"B1\" \n\t\t\t\tprint \" | #{marker_on_cell(cell)}\"\n\t\t\twhen \"C1\" \n\t\t\t\tprint \" |\\t#{marker_on_cell(cell)}\\n\"\n\t\t\t\tputs \"\\t--------------------\"\n\t\t\twhen \"A2\" \n\t\t\t\tprint \" [2]\\t #{marker_on_cell(cell)}\"\n\t\t\twhen \"B2\" \n\t\t\t\tprint \" | #{marker_on_cell(cell)}\"\n\t\t\twhen \"C2\" \n\t\t\t\tprint \" |\\t#{marker_on_cell(cell)}\\n\"\n\t\t\t\tputs \"\\t--------------------\"\n\t\t\twhen \"A3\" \n\t\t\t\tprint \" [3]\\t #{marker_on_cell(cell)}\"\n\t\t\twhen \"B3\" \n\t\t\t\tprint \" | #{marker_on_cell(cell)}\"\n\t\t\twhen \"C3\" \n\t\t\t\tprint \" |\\t#{marker_on_cell(cell)}\\n\"\n\t\t\tend\t\n\t\tend\n\tend", "def print_errors(rows)\n print \"Errors:\\n\"\n rows.each do |row|\n print \"Row #{row[:row_number]} rejected: #{row[:validation_errors].join(\", \")}\\n\"\n\n end\n print \"\\n\"\n end", "def display(message)\n __display(message)\n end", "def show_board\n \n puts \" 1 2 3\"\n puts \" a #{@A1.content} | #{@A2.content} | #{@A3.content}\"\n puts \" ---------\"\n puts \" b #{@B1.content} | #{@B2.content} | #{@B3.content}\"\n puts \" ---------\"\n puts \" c #{@C1.content} | #{@C2.content} | #{@C3.content}\"\n\n end", "def template(group_title, snippet_title, comment, code)\n rows = []\n rows << [print_group_title(group_title)]\n rows << :separator\n rows << [print_snippet_title(snippet_title)]\n unless comment.text.length == 0\n rows << :separator\n rows << [print_comment(comment.text)]\n end\n\n puts Terminal::Table.new(rows: rows)\n puts print_code(code.text)\n end", "def print_context(message)\n return if message[:check] == 'documentation'\n return if message[:kind] == :fixed\n line = get_context(message)\n offset = line.index(%r{\\S}) || 1\n puts \"\\n #{line.strip}\"\n printf(\"%#{message[:column] + 2 - offset}s\\n\\n\", '^')\n end", "def thud(title, message)\r\n Tk.messageBox('icon' => 'error', 'type' => 'ok', \r\n 'title' => title, 'message' => message)\r\nend", "def put_table(table)\n table.each {|row| puts row.join(' ') }\nend", "def update_status_message\n opts = table_options.merge(headings: HEADINGS, rows: table)\n\n _ttable = Terminal::Table.new(opts)\n\n @status_message = TEMPLATE.result(binding)\n end", "def log_table(str)\n @game_in_pro.nal_server.log_table_comm(str) if @game_in_pro\n end", "def error_message( msg, details='' )\n\t\t\t$stderr.puts colorize( 'bold', 'white', 'on_red' ) { msg } + details\n\t\tend", "def show_table(game_status)\n prompt \"================================\"\n prompt \"================================\"\n prompt \"#{game_status[:current_game_status]}\"\n prompt \"================================\"\n prompt \"================================\"\nend", "def show_table(game_status)\n prompt \"================================\"\n prompt \"================================\"\n prompt \"#{game_status[:current_game_status]}\"\n prompt \"================================\"\n prompt \"================================\"\nend", "def log_html_action(msg)\n converter = Cinch::MircCodesConverter.new\n anchor = timestamp_anchor(msg.time)\n str = <<-HTML\n <tr id=\"#{anchor}\">\n <td class=\"msgtime\"><a href=\"##{anchor}\">#{msg.time.strftime(timelogformat)}</a></td>\n <td class=\"msgnick nickaction\">*</td>\n <td class=\"msgaction\"><span class=\"actionnick #{determine_status(msg)}\">#{msg.user.name}</span>&nbsp;#{converter.convert(process_message(msg.action_message))}</td>\n </tr>\n HTML\n\n @htmllogfile.write(str)\n end", "def drawToSTDOUT\n for r in (0..6).step(3) do\n print \"+-----++-----++-----+\\n\"\n print \"| \\\\\"+@table[r].getTop.to_s+\"/ || \\\\\"+@table[r+1].getTop.to_s+\"/ || \\\\\"+@table[r+2].getTop.to_s+\"/ |\\n\"\n print \"|\"+@table[r].getLeft.to_s+\" × \"+@table[r+1].getRight.to_s+\"||\"+@table[r+2].getLeft.to_s+\" × \"+@table[r].getRight.to_s+\"||\"+@table[r+1].getLeft.to_s+\" × \"+@table[r+2].getRight.to_s+\"|\\n\"\n print \"| /\"+@table[r].getBottom.to_s+\"\\\\ || /\"+@table[r+1].getBottom.to_s+\"\\\\ || /\"+@table[r+2].getBottom.to_s+\"\\\\ |\\n\"\n print \"+-----++-----++-----+\\n\"\n end\n end", "def error_message( msg, details='' )\n\t\t$stderr.puts colorize( 'bold', 'white', 'on_red' ) { msg } + ' ' + details\n\tend", "def print_in_box(message)\n width = message.length + 2\n line = '++'\n space = '||'\n banner = \"| #{message} |\"\n\n (width).times do |i|\n line.insert(1,'-')\n space.insert(1,' ')\n end\n\n puts line\n puts space\n puts banner\n puts space\n puts line\nend", "def write_message(message)\n\t\tupdate_screen_size\n\t\txpos = (@cols - message.length)/2\n\t\t@screen.attroff Curses::A_REVERSE\n\t\twrite_str(@rows-1,0,\" \"*@cols)\n\t\t@screen.attron Curses::A_REVERSE\n\t\twrite_str(@rows-1,xpos,message)\n\t\t@screen.attroff Curses::A_REVERSE\n\tend", "def print_prime_table\n out = ''\n prime_array = print_prime\n top_line = \"\\t#{prime_array.join(\"\\t\")}\"\n out += top_line + \"\\n\"\n for prime_row in prime_array\n line = \"\"\n line += \"#{prime_row}\\t\"\n for prime_col in prime_array\n line += \"#{prime_row * prime_col}\\t\"\n end\n out += line + \"\\n\"\n end\n out\n end", "def table(array_table)\n\t\tputs \" _____1___________2____________3_____ \".colorize(:green)\n\t\tputs \" | | | |\".colorize(:green)\n\t\tputs \" | #{array_table[0]*3} | #{array_table[1]*3} | #{array_table[2]*3} |\".colorize(:green)\n\t\tputs \"A | #{array_table[0]*3} | #{array_table[1]*3} | #{array_table[2]*3} |\".colorize(:green)\n\t\tputs \" | #{array_table[0]*3} | #{array_table[1]*3} | #{array_table[2]*3} |\".colorize(:green)\n\t\tputs \" |___________|___________|____________|\".colorize(:green)\n\t\tputs \" | | | |\".colorize(:green)\n\t\tputs \"B | #{array_table[3]*3} | #{array_table[4]*3} | #{array_table[5]*3} |\".colorize(:green)\n\t\tputs \" | #{array_table[3]*3} | #{array_table[4]*3} | #{array_table[5]*3} |\".colorize(:green)\n\t\tputs \" | #{array_table[3]*3} | #{array_table[4]*3} | #{array_table[5]*3} |\".colorize(:green)\n\t\tputs \" |___________|___________|____________|\".colorize(:green)\n\t\tputs \" | | | |\".colorize(:green) \n\t\tputs \" | #{array_table[6]*3} | #{array_table[7]*3} | #{array_table[8]*3} |\".colorize(:green) \n\t\tputs \"C | #{array_table[6]*3} | #{array_table[7]*3} | #{array_table[8]*3} |\".colorize(:green)\n\t\tputs \" | #{array_table[6]*3} | #{array_table[7]*3} | #{array_table[8]*3} |\".colorize(:green)\n\t\tputs \" |___________|___________|____________|\".colorize(:green)\n\tend", "def print_prime_multiplication_table(number_of_primes)\n multiplication_table = prime_multiplication_table(number_of_primes)\n pretty_print(multiplication_table)\n end", "def print(data, file = nil)\n table = Table.from(data)\n set_columns table.columns\n table.each { |row| add_row row }\n finished\n end" ]
[ "0.5834202", "0.57699615", "0.56857413", "0.56857413", "0.5684039", "0.5614771", "0.5598147", "0.5593911", "0.5524416", "0.5521265", "0.5507472", "0.5472406", "0.54630417", "0.54630417", "0.54630417", "0.54630417", "0.54392004", "0.5431981", "0.5431981", "0.54305005", "0.54254186", "0.5402849", "0.537953", "0.53323525", "0.5315098", "0.5312463", "0.5309717", "0.530039", "0.52775025", "0.52662385", "0.5264763", "0.5260422", "0.52587056", "0.52486295", "0.5243047", "0.52295613", "0.52283436", "0.5227909", "0.5226088", "0.5219715", "0.52196336", "0.5217537", "0.518424", "0.51738787", "0.5167397", "0.51520383", "0.51518655", "0.51494515", "0.5145018", "0.51431084", "0.5142146", "0.51334846", "0.51322716", "0.51319695", "0.5119089", "0.51140684", "0.51108295", "0.51030004", "0.50831527", "0.5082747", "0.50812745", "0.50701576", "0.5069383", "0.50633246", "0.5062163", "0.50602883", "0.5055931", "0.5050275", "0.50460523", "0.50460523", "0.50253206", "0.50139093", "0.5010728", "0.50104296", "0.5010423", "0.5007242", "0.50036", "0.5000709", "0.4997383", "0.49945417", "0.49876112", "0.49810526", "0.49802506", "0.49779013", "0.4976435", "0.49745142", "0.4968234", "0.49629527", "0.4960646", "0.4957379", "0.495695", "0.495695", "0.49565655", "0.49559155", "0.49487314", "0.49404818", "0.4940026", "0.49383894", "0.4938286", "0.49311054", "0.4927769" ]
0.0
-1
Briefly changes the backgroundColor of the specified element yellow. Useful for debugging.
def highlight locator command 'highlight', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yellow\n colorize(33)\n end", "def yellow\n colorize \"\\033[33m\"\n end", "def highlight(locator)\n execute_script(%(\n arguments[0].style.backgroundColor = '#ff3';\n ), find_element(locator))\n end", "def yellow(string)\n colorize(string, 33)\n end", "def yellow(output)\n color(33, output)\n end", "def yellow\n puts \" yellow\".yellow\n puts\n print \"red\"\n puts \" blue\"\n puts\n puts \" green\"\n puts\n end", "def yellow \n\t\tlight COLOR_KEY_YELLOW\n\tend", "def background_color(color); end", "def recolor(tag, color)\r\n @listarea.tag_configure(tag, 'foreground' => color)\r\n end", "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "def highlight_element(element)\n execute_script(\"arguments[0].style.border='3px solid red'\", element)\n end", "def setClueHighlightColor(clueHighlightColor)\n\t\t@clueHighlightColor=clueHighlightColor\n\tend", "def blue = \"\\e[36m#{self}\\e[0m\"", "def set_color(piece)\n # sets color to red if at cursor [row, col]\n if cursor.cursor_pos == piece.position\n to_color = {:color => :light_blue, :background => :red}\n # otherwise color is blue\n else\n to_color = :blue\n end\n\n to_color\n end", "def colorChange(couleur)\n @color=couleur\n apply\n end", "def set_color(color)\n @color = color\n end", "def puts_color( msg, color=nil )\n color_set( color ); puts msg; color_end\n end", "def backgroundColor=(color)\n self.layer.backgroundColor = case color.is_a?(UIColor)\n when true ; color.CGColor\n else ; color\n end\n end", "def recolor(color)\n @color = color\n self\n end", "def highlight_color=(color)\n color = @img.to_color(color) if color.respond_to?(:to_color)\n @img.define('highlight-color', color)\n end", "def set_color color\n unless COLORS.include? color\n raise \"Invalid color: #{color}\"\n end\n reset\n set_color_raw color\n end", "def setColor(color_as_hex)\n led_color = LEDColor.new(color_as_hex)\n # Change the colors\n red_pin.pwm.duty_cycle = led_color.red\n green_pin.pwm.duty_cycle = led_color.green\n blue_pin.pwm.duty_cycle = led_color.blue\n\n puts \"[Color Change] rgb(#{red_pin.pwm.duty_cycle}, #{green_pin.pwm.duty_cycle}, #{blue_pin.pwm.duty_cycle})\"\n end", "def set_color=(new_color)\n @@color = new_color\n end", "def colorize(*args)\n shell.set_color(*args)\n end", "def purple\n colorize(35)\n end", "def color=(new_color)\n\t\t@color = new_color\n\tend", "def paint( color )\n self.update(color: color)\n end", "def color=(value)\n @color = value\n end", "def color=(value)\n @color = value\n end", "def setColor(color)\n\t\t@color = color\n\n\tend", "def backgroundColor(theColor, target = nil)\n return if theColor.nil?\n if target == 'window'\n @alert.window.backgroundColor = MEalert.getColor(theColor, 'windowBackground')\n else # set the color name for the accessory textField\n @coloration[:background] = theColor\n end\n end", "def green\n\t\tlight COLOR_KEY_GREEN\n\tend", "def color(color); end", "def fill_color(color)\n end", "def put_colour_to(item, color)\n item.colorize(color: :\"#{color}\")\n end", "def red\n\t\tlight COLOR_KEY_RED\n\tend", "def puts_blue(string)\n puts \"\\033[34m\" + string + \"\\033[0m\"\nend", "def yellow_log_formatter()\n orig_formatter = ::Logger::Formatter.new\n\n proc do |s,dt,pn,msg|\n \"#{CLEAR}#{YELLOW}#{orig_formatter.call(s,dt,pn,msg)}#{CLEAR}\"\n end\n end", "def set_Color(value)\n set_input(\"Color\", value)\n end", "def piece_color(piece); ((piece.color == :white) ? \"#FFEED5\" : \"#063848\") end", "def red\n colorize(31)\n end", "def blue; end", "def blue; end", "def setBackGround(o)\n if useHighLightOnCurrentElement\n begin \n @currentObjectBackGroundColor = o.style.backgroundColor\n #puts \"Current Back ground color is: #{@currentObjectBackGroundColor}\"\n @backGroundObject = o\n @backGroundObject.style.backgroundColor = \"red\"\n rescue\n\n end\n end\n end", "def tutu_color(color) \n\t\tp \"your tutu color has changed to #{color}\"\n\tend", "def puts_red(str)\n puts \" \\e[00;31m#{str}\\e[00m\"\nend", "def red\n colorize \"\\033[31m\"\n end", "def set_background_color(color)\n color = Wasko::Color.color_from_string(color)\n advanced_typing_apparatus.set_background_color(color.to_applescript)\n end", "def color(*args)\n @instructions << Instruction.new(:color, args)\n self\n end", "def color(text, color)\n if COLORS[color]\n \"#{start_color color}#{text}#{reset_color}\"\n end\n end", "def background_color=(value)\n @peer.background_color = value.to_s\n end", "def blue\n end", "def spray_paint(new_color)\n self.color = new_color\n end", "def pullup_red\n\t\t\tif black? and children_color?(:red)\n\t\t\t\tself\n\t\t\t\t\t.with_left(@left.with_color(:black))\n\t\t\t\t\t.with_right(@right.with_color(:black))\n\t\t\t\t\t.with_color(:red)\n\t\t\telse\n\t\t\t\tself\n\t\t\tend\n\t\tend", "def green\n colorize(32)\n end", "def with_color(color=\"999999\", &block)\n fill_color color\n yield if block_given?\n # Reset the color to the default\n fill_color grey\n end", "def add_bright_color(str, color)\n color = color.to_s.sub(\"bright_\", \"\").to_sym\n str = reset_prev_formatting str, :color\n \"\\e[1m\\e[#{TC_CONFIG[:colors][color].to_s}m#{str}\"\n end", "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "def blue\n Color.new(80, 0, 67, 88)\n end", "def lbSetColor _obj, _args\n \"_obj lbSetColor _args;\" \n end", "def backgroundColor\n if self.highest?\n \"#ff884d\"\n elsif self.high?\n \"#ffcc80\"\n else\n \"#ffefcc\"\n end\n end", "def red(string)\n \"\\033[0;33m#{string}\\033[0m\"\nend", "def red(string)\n \"\\033[0;33m#{string}\\033[0m\"\nend", "def colorize!(color_code) \"#{COLORS[color_code]}#{self.to_s}\\e[0m\" ; end", "def color\n\t\t \t\t\t\"El color de tu vaca es #{@color}\"\n\t\t \t\tend", "def bg_red; use_code(41) end", "def green=(value)\n end", "def print_comment(comment)\n COLOR.send(:yellow, comment)\n end", "def red\n colorize(:red)\nend", "def red(text)\n colorize text, \"\\033[1;31m\"\n end", "def start!\n @color = @@colors[:green]\n end", "def white!\n self.color = :white\n end", "def green; end", "def green; end", "def background_color=(value)\n @background_color = value\n end", "def open_background_color_span\n \"<span style=\\\"background-color:##{self.html_color};\\\">\"\n end", "def change_color(color)\n self.font.color = color\n end", "def color=(c)\n @color = Color.new(c)\n end", "def on_49(_) { fg: fg_color(9) } end", "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "def change_bg_color(color)\n @bg_color = color\n self.bitmap.fill_rect(self.bitmap.rect,color)\n end", "def color=(value)\n @color = value.nil? ? nil : value.to_s\n end", "def set_svg_fill_color(xml, color)\n # Find all primitives.\n primitives = ['path', 'circle', 'rect', 'line', 'ellipse', 'polyline', 'polygon', 'text']\n \n # Strip existing fills.\n primitives.each do |primitive|\n xml.xpath(\"//xmlns:#{primitive}\").each do |child|\n child['fill'] = \"##{color}\"\n end\n end\n end", "def red_(string)\n print $color.wrap(\"#{string}\").red\nend", "def colorize!; @colors = true; end", "def colorized?; end", "def remove_black_color(env)\n node = env[:node]\n return unless node.element?\n return unless node.attr('style').present?\n node['style'] = node['style'].gsub(/(?<!background-)(color:#000000;?)/, '')\n end", "def red(output)\n color(31, output)\n end", "def blue=(_); end", "def set_color\n self.color = [\"#7AD8E5\", \"#63b4d1\", \"6da7d3\", \"#7699d4\", \"#816ec4\", \"#8658bc\", \"#602278\", \"#34023C\"].sample\n end", "def color(string, hash = nil)\n hash ||= self.class::COLORS\n set_color(string, hash.fetch(string.to_sym, :yellow))\n end", "def set_custom_color(index, red = 0, green = 0, blue = 0)\n # Match a HTML #xxyyzz style parameter\n if red.to_s =~ /^#(\\w\\w)(\\w\\w)(\\w\\w)/\n red = ::Regexp.last_match(1).hex\n green = ::Regexp.last_match(2).hex\n blue = ::Regexp.last_match(3).hex\n end\n\n # Check that the colour index is the right range\n raise \"Color index #{index} outside range: 8 <= index <= 64\" if index < 8 || index > 64\n\n # Check that the colour components are in the right range\n if (red < 0 || red > 255) ||\n (green < 0 || green > 255) ||\n (blue < 0 || blue > 255)\n raise \"Color component outside range: 0 <= color <= 255\"\n end\n\n index -= 8 # Adjust colour index (wingless dragonfly)\n\n # Set the RGB value\n @palette[index] = [red, green, blue]\n\n # Store the custome colors for the style.xml file.\n @custom_colors << sprintf(\"FF%02X%02X%02X\", red, green, blue)\n\n index + 8\n end", "def setDefaultColor\n self.changeColor A_NORMAL, COLOR_WHITE, COLOR_BLACK\n end" ]
[ "0.6527087", "0.6384671", "0.6303622", "0.6282736", "0.62592286", "0.6226689", "0.61911815", "0.5857364", "0.58308905", "0.58069414", "0.58069414", "0.58069414", "0.58069414", "0.5756448", "0.5747222", "0.5741669", "0.5712561", "0.56675494", "0.5649998", "0.56474006", "0.55427545", "0.5528679", "0.5523593", "0.5515327", "0.5503953", "0.5496434", "0.5472167", "0.5453146", "0.54436517", "0.54376256", "0.5433134", "0.5432416", "0.53992987", "0.5384117", "0.5359316", "0.53282905", "0.532407", "0.5316511", "0.53068876", "0.53043896", "0.52925766", "0.52925265", "0.52873516", "0.5286843", "0.5285057", "0.5285057", "0.5259327", "0.525583", "0.52485967", "0.5239109", "0.5234756", "0.52337855", "0.5226", "0.52247524", "0.5221518", "0.5220146", "0.52180856", "0.52180505", "0.5217962", "0.52168804", "0.5202358", "0.5202358", "0.5202358", "0.5202358", "0.5202358", "0.51962626", "0.51863545", "0.5182679", "0.51761454", "0.51761454", "0.51751226", "0.51601946", "0.5159088", "0.51577955", "0.5156191", "0.51517165", "0.51463693", "0.5145269", "0.5143508", "0.51434034", "0.51434034", "0.5138948", "0.5138191", "0.51326245", "0.51321644", "0.51220995", "0.5116486", "0.5116486", "0.5116377", "0.5115127", "0.5114907", "0.5114636", "0.5114474", "0.5112472", "0.51093376", "0.51064074", "0.5105035", "0.5100131", "0.50985897", "0.5098534", "0.5097632" ]
0.0
-1
Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.
def meta_key_down command 'metaKeyDown' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meta_key_up\r\n command 'metaKeyUp'\r\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def while_key_up *args\n\t\t\tevent(:while_key_up, *args)\n\t\tend", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def send_modified_key(element_selector, key, *meta)\n wait_for_loading\n \n key_string = key\n key_string = \"alt+\" + key_string if meta.include? :alt\n key_string = \"ctrl+\" + key_string if meta.include? :control\n key_string = \"command+\" + key_string if meta.include? :command\n\n page.driver.execute_script(\"Mousetrap.trigger('#{key_string}');\")\n end", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def open_page(key)\n return if verify_page?(key, false)\n site.goto(site.get_path(key))\n page_delay\n verify_page?(key)\n end", "def follow_meta_refresh; end", "def follow_meta_refresh; end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end", "def update_meta_tag(key, value)\n set_meta_tags({key => value})\n end", "def follow_meta_refresh_self; end", "def follow_meta_refresh_self; end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def cursor_pageup\r\n end", "def cursor_pageup\n end", "def cursor_pageup\n end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end", "def set_meta\n puts 'meta'\n end", "def rekey!; end", "def rekey!; end", "def update_skip_key\n SceneManager.goto(Scene_Title) if Input.trigger?(TH::Splash_Screen_Map::Skip_Button)\n end", "def hold_screen\n print 'Press Enter to continue.'\n gets.chomp\n end", "def keyevent(key, metastate = nil)\n @bridge.keyevent(key, metastate)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def long_press_keycode(key, metastate: [], flags: [])\n @bridge.long_press_keycode(key, metastate: metastate, flags: flags)\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def activate_up(key)\n key_down.deactivate(key)\n key_held.deactivate(key)\n key_up.activate(key)\n end", "def initial_setup_pause\n puts\n say \"Thanks, #{human.name}, I have everything I need to get started.\\n\" \\\n \"Please hit any key when you are ready to begin.\"\n getchar\n end", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def set_page_keys\n @page_index = @vert_page_index = 0\n @item_pages = Bubs::InfoPages::ITEM_INFO_PAGES.clone\n @equipitem_pages = Bubs::InfoPages::EQUIP_INFO_PAGES.clone\n @item_pages.unshift(:ingredients)\n @equipitem_pages.unshift(:ingredients)\n refresh\n end", "def up_key\n @last = @choice\n @choice = (@choice > 0 ? @choice -= 1 : 2)\n @choice_sound.play(1, 0.5, false)\n end", "def render_meta_refresh\n (@meta_refresh_self) ?\n tag(\"meta\", \"http-equiv\" => \"refresh\", \"content\" => @meta_refresh_self) : \"\"\n end", "def resume(view)\n @ctrlDown = false\n @shiftDown = false\n end", "def getup\n send_command 0x23, 0x2\n end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def press(key_sequence)\n end", "def go\n require 'pashua'\n pagetmp = wikipage_selector(\"Jump to which page?\")\n exit unless pagetmp\n @chrome.windows[1].get.tabs[@chrome.windows[1].get.active_tab_index.get].get.URL.set(\"http://localhost/wiki/#{pagetmp}\")\nend", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\nend", "def handle_keys\n exit if SDL::Key.press? SDL::Key::ESCAPE\n exit if SDL::Key.press? SDL::Key::Q\n self.paused = !paused if SDL::Key.press? SDL::Key::P\n end", "def wait_for_press\n wait_for_presses(1)\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def set_account_meta_key(account_meta_key)\n @logger.info \"Setting account meta key for tenant #{@fog_options[:hp_tenant_id]}...\"\n response = @connection.request({\n :method => 'POST',\n :headers => { \n 'X-Account-Meta-Temp-URL-Key' => account_meta_key\n }\n })\n \n # Confirm meta data changes\n response = @connection.request({\n :method => 'HEAD'\n })\n \n @logger.info \"Done setting account meta key.\"\n end", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\nend", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\nend", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\nend", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\nend", "def activate_held(key)\n key_down.deactivate(key)\n key_held.activate(key) unless key_held.send(key)\n key_up.deactivate(key)\n end", "def button_up(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n @player.reset_jump if @player.is_jumping?\r\n end\r\n end", "def set_meta\n meta.tap do |m|\n m.tag = [{\n system: META_SYSTEM,\n code: META_CODE,\n display: META_DISPLAY\n }]\n end\n end", "def clear\n @page_handler.meta.clear\n end", "def cursor_pagedown\r\n end", "def follow_meta_refresh\n @agent.follow_meta_refresh\n end", "def next__clicked(*argv)\t\t\t\t\n\t\tif (@@page == 24 && @@load_favs == 0) || (@@page == @@json_titles.length && @@load_favs == 1) # if nothing on next or previous page, do nothing\n\t\telse\t\t\n\t\t\t@@page = @@page + 8\n\t\t\tdestroy_window()\n\t\t\tif @@load_favs == 0\t\n\t\t\t\tshow()\n\t\t\telse\n\t\t\t\tshow_favs()\n\t\t\tend\n\t\tend\n\tend", "def key_up(*args, device: T.unsafe(nil)); end", "def move_to_home!\n print \"\\e[H\"\n end", "def move_to_home!\n print \"\\e[H\"\n end", "def move_to_home!\n print \"\\e[H\"\n end", "def move_to_home!\n print \"\\e[H\"\n end", "def pagedown\n page.driver.browser\n .execute_script('return document.body')\n .send_keys(:page_down)\n end", "def meta_refresh; end", "def hotkeys\n loop do\n c = @screen.getch\n\n case c\n when Ncurses::KEY_DOWN, 14, 'j'.ord\n scroll_down\n\n when Ncurses::KEY_UP, 16, 'k'.ord\n scroll_up\n\n when Ncurses::KEY_NPAGE\n (maxy - 2).times do\n break if !scroll_down\n end\n\n when Ncurses::KEY_PPAGE\n (maxy - 2).times do\n break if !scroll_up\n end\n\n when Ncurses::KEY_LEFT\n while scroll_up; end\n\n when Ncurses::KEY_RIGHT\n while scroll_down; end\n\n when 'q'.ord\n break\n\n when @callbacks[c]\n true\n\n end\n\n @screen.move(0, 0)\n end\n end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def hotkey=(key)\n @link.HotKey = key\n end", "def follow_meta_refresh=(follow); end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def cursor_pagedown\n end", "def cursor_pagedown\n end", "def update_page_window\n if Input.trigger?(Input::B)\n Sound.play_cancel\n @event_window.show.activate\n @page_window.hide.deactivate\n elsif Input.trigger?(Input::C)\n Sound.play_ok\n @mode_window.show.activate\n @page_window.deactivate\n end\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def kopal_layout_after_page_meta\n\n end", "def onsig(sig)\n close_screen\n @exit = true\n end", "def follow_meta_refresh_self=(follow); end", "def press key, options = {}\n key = 'Return' if key == 'ENTER'\n widget = options[:in] || Gtk::Window.toplevels.first\n event = Gdk::EventKey.new(Gdk::Event::KEY_PRESS)\n event.window = widget\n event.state |= Gdk::Window::CONTROL_MASK if key =~ /CTRL+/\n event.state |= Gdk::Window::MOD1_MASK if key =~ /ALT+/\n event.state |= Gdk::Window::SHIFT_MASK if key =~ /SHIFT+/\n event.keyval = Gdk::Keyval.from_name(key.split('+').last)\n widget.grab_focus\n event.send_event = true\n entry = Gdk::Keymap.default.get_entries_for_keyval(event.keyval).first\n event.hardware_keycode = entry[0]\n widget.signal_emit('key_press_event', event)\n process_events\nend", "def set_page_meta_tags\n req = self.request\n set_meta_tags_for_url_path(req.base_url, req.fullpath)\n end", "def turn_page\n # puts statement required\n puts \"Flipping the page...wow, you read fast!\"\n end", "def back()\r\n #set_browser_document()\r\n $jssh_socket.send(\"if(#{BROWSER_VAR}.canGoBack) #{BROWSER_VAR}.goBack();\\n\", 0)\r\n read_socket();\r\n wait()\r\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def move_to_home\n print \"\\e[H\"\nend", "def navigate\n unless current_page?\n preview_screen = go_to(InstagramPreviewScreen)\n sleep(WAIT_SCREENLOAD)\n #wait_for_elements_exist(preview_screen.share, :timeout => MAX_TIMEOUT)\n #touch preview_screen.share\n touch query(\"* id:'shareButton'\")\n sleep(WAIT_SCREENLOAD)\n \n end\n await\n end", "def printSurrenderMessage\n puts \"Aww it's sad to see you go so early. Better luck next round!\"\n pressKeyToContinue\nend", "def after_update(playlist)\n if playlist.god_like == true\n expires_page(:controller => :main, :page => :index)\n expires_page(:controller => :main, :page => :radio)\n #expires_page(:controller => :main, :page => :track)\n end\n end", "def pressToContinue\n puts \"\\n\"\n print \"Press enter to continue. \"\n gets.chomp\n end", "def move_to_home\n print \"\\e[H\"\nend", "def move_to_home\n print \"\\e[H\"\nend", "def page(key)\n end", "def follow_meta_refresh=(_arg0); end" ]
[ "0.73959273", "0.5958385", "0.5958385", "0.57138026", "0.57138026", "0.5493059", "0.54181105", "0.5400129", "0.53765786", "0.53765786", "0.5357723", "0.5101127", "0.50555325", "0.50555325", "0.5010577", "0.5010577", "0.4997196", "0.4990738", "0.4990738", "0.4976433", "0.49741253", "0.49741253", "0.4952831", "0.4927786", "0.49218345", "0.49218345", "0.48784247", "0.48756602", "0.48756602", "0.48697957", "0.48687133", "0.48687133", "0.48510268", "0.48414817", "0.48410437", "0.4812859", "0.4812859", "0.4802488", "0.47835648", "0.4776298", "0.47465718", "0.4742191", "0.47413382", "0.47369927", "0.47031698", "0.46886954", "0.46747398", "0.4667214", "0.46600905", "0.46551943", "0.46539384", "0.46504995", "0.4644189", "0.4633763", "0.4633763", "0.46278498", "0.46204773", "0.46204773", "0.46204773", "0.46204773", "0.4596736", "0.45966747", "0.45909628", "0.45878133", "0.456324", "0.45616043", "0.45599768", "0.45565644", "0.4553538", "0.4553538", "0.4553538", "0.4553538", "0.45433098", "0.45376995", "0.45360407", "0.45301843", "0.4526604", "0.45208985", "0.45117965", "0.4492554", "0.4492554", "0.44831657", "0.44812402", "0.4472341", "0.44695735", "0.44640273", "0.44597685", "0.44505116", "0.44431123", "0.4441781", "0.44416147", "0.4432264", "0.44314697", "0.44173014", "0.44104424", "0.44086784", "0.44017094", "0.44017094", "0.43987188", "0.43967745" ]
0.6653389
1
Release the meta key.
def meta_key_up command 'metaKeyUp' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def release(key, value)\n return\n end", "def del(key)\n @meta.delete(key.to_sym) if key\n end", "def destroy\n @key.destroy\n end", "def unset key\n storage.delete key\n end", "def delete key\n write_data_entry key, nil, true\n @keydict[key] = nil\n\n sync\n end", "def destroy\n self.class.remove(key)\n end", "def destroy\n self.class.remove(key)\n end", "def delete _key\n store.transaction() { |s| s.delete(prepare_key(_key)) }\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def clear_tag(key)\n meta.delete(key)\n end", "def release_key(key_id)\r\n @transport.iso_apdu! :ins => 0x28, :p1 => key_id\r\n return true\r\n end", "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def destroy\n bucket.delete(key)\n self\n end", "def released( key )\n return KeyReleaseTrigger.new( key )\nend", "def destroy_key(key_id)\n destroy_resource :key, key_id\n end", "def decr(key); end", "def decr(key); end", "def delete\n redis.del key\n end", "def delete_key(key)\n end", "def del\n connection.del(key_label)\n end", "def shell_registry_unloadkey(key)\n key = normalize_key(key)\n shell_registry_cmd_result(\"unload \\\"#{key}\\\"\")\n end", "def unlock!(key)\n ::DatabaseEntryLock.destroy_by(lock_key: key)\n end", "def remove\n heroku.remove_key(args.first)\n display \"Key #{args.first} removed.\"\n end", "def remove\n heroku.remove_key(args.first)\n display \"Key #{args.first} removed.\"\n end", "def release(entry)\n @lock.synchronize do\n unlocked_release(entry.id)\n end\n end", "def del_meta(name)\n _manage_meta_init\n \n name = _manage_meta_name_to_sym name\n @manage_meta_meta_hash.delete name if @manage_meta_meta_hash.has_key? name\n end", "def release_item\n update_attribute( :pub_assmt, new_assmt )\n end", "def release\n fail AlreadyRelease unless prerelease?\n @special = ''\n @metadata = ''\n end", "def release(key, value)\n waiters = pop_waiters(key)\n return unless waiters\n while w = waiters.pop\n w.resume(value)\n end\n end", "def delete_metadata(key_name)\n requires :id\n service.delete_snapshot_metadata(id, key_name)\n true\n end", "def delete_attribute(key); end", "def delete_key_pair\n @os_aws.delete_key_pair\n end", "def delete(key, cas)\n encoded_key, base64 = KeyRegularizer.encode(key)\n req = RequestFormatter.meta_delete(key: encoded_key, cas: cas,\n base64: base64, quiet: quiet?)\n write(req)\n response_processor.meta_delete unless quiet?\n end", "def delete key\n @internal_hash[key].clear\n end", "def delete key\n find_slot(key)&.free\nend", "def release\n end", "def delete_pair(key)\r\n @redis.del key \r\n end", "def delete(key)\n key = alternate_key(key) unless has_key?(key)\n super\n end", "def registry_unloadkey(key)\n if session_has_registry_ext\n meterpreter_registry_unloadkey(key)\n else\n shell_registry_unloadkey(key)\n end\n end", "def delete(key); end", "def delete(key); end", "def delete(key); end", "def delete(key); end", "def delete(key); end", "def delete(key)\n\n end", "def del(key)\n @first.del(key)\n end", "def release\n locked? && release!\n end", "def release\n result = eval_script(\n RedisScripts::RELEASE_SCRIPT,\n RedisScripts::RELEASE_SCRIPT_HASH,\n keys: [redis_key],\n argv: [owner]\n )\n result != 0\n end", "def delete\n client.delete_access_key(resource_options)\n nil\n end", "def remove\n key = shift_argument\n if key.nil? || key.empty?\n error(\"Usage: heroku keys:remove KEY\\nMust specify KEY to remove.\")\n end\n validate_arguments!\n\n action(\"Removing #{key} SSH key\") do\n api.delete_key(key)\n end\n end", "def decr(key)\n node_for(key).decr(key)\n end", "def destroy\n authorizable_keystore = client(resource).authorizable_keystore(resource[:intermediate_path], resource[:authorizable_id])\n result = authorizable_keystore.delete\n\n handle(result)\n end", "def cleanup\n @redis.del(key)\n @current_id = nil\n end", "def delete(key)\n storage.transaction {storage.delete(key)}\n end", "def unregister(key_or_instance)\n proxy_across_keytypes(:delete, key_or_instance)\n end", "def release(resource); end", "def release\n end", "def release\n end", "def bucket_delete_object(key)\n http.delete(\"/#{key}\", bucket: bucket, key: key)\n end", "def release_lock( my_owner = oval )\n # Use my_owner = oval to make testing easier.\n with_watch( okey, xkey ) do\n owner = redis.get( okey )\n if owner == my_owner then\n redis.multi do |multi|\n multi.del( okey )\n multi.del( xkey )\n end\n end\n end\n end", "def remove_key(key)\n\t\tdelete(\"/user/keys/#{escape(key)}\")\n\tend", "def remove_key(key)\n\t\tdelete(\"/user/keys/#{escape(key)}\")\n\tend", "def destroy_image(key)\n return unless key.is_a?(String) && !key.empty?\n name, ext = key.split('.')\n self.transaction do\n record = find_by_name name\n # do nothing if not found\n return unless record\n if record.refcount > 1\n record.refcount -= 1\n record.save\n else\n if record.keep_till && record.keep_till > Time.now\n record.refcount = 0\n record.save\n else\n record.purge_image_data\n record.delete\n end\n end\n end\n cleanup_temporary_image\n end", "def delete\n connection.delete(\"/#{URI.escape(@key)}\", @bucket_name)\n end", "def remove_key(key)\n deprecate # 07/31/2012\n delete(\"/user/keys/#{escape(key)}\").to_s\n end", "def delete(key)\n File.unlink cache_path(key)\n rescue Errno::ENOENT\n end", "def dec(key)\n \n end", "def delete(key)\n @internal_hash.delete(key)\n end", "def delete(kind, key, version)\n end", "def remove(_bucket, _key)\n nil\n end", "def destroy\n resource.destroy\n respond_with(resource, location: i18n_keys_path)\n end", "def destroy\n @public_key.destroy\n # PublicKey.regenerate_authorized_keys\n GitWit.remove_authorized_key(@public_key.raw_content)\n\n respond_to do |format|\n format.html { redirect_to public_keys_url }\n format.json { head :no_content }\n end\n end", "def release\n action('release')\n end", "def delete(key)\n if Dottie.dottie_key?(key)\n Dottie.delete(wrapped_object_or_self, key)\n else\n super\n end\n end", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def delete(key)\n ref = @cache.delete(key)\n ref.__getobj__ rescue nil\n end", "def release(ptr = nil)\n V2.raptor_free_term(self) unless ptr.null?\n end", "def registry_deletekey(key, view = REGISTRY_VIEW_NATIVE)\n if session_has_registry_ext\n meterpreter_registry_deletekey(key, view)\n else\n shell_registry_deletekey(key, view)\n end\n end", "def delete(key)\n removeAttribute(key.to_s)\n end", "def delete(key)\n removeAttribute(key.to_s)\n end", "def delete(key)\n removeAttribute(key.to_s)\n end", "def delete(key)\n unimplemented\n end", "def delete_option(key, meta_key = \"_default\")\n values = cama_options(meta_key)\n key = key.to_sym\n values.delete(key) if values.has_key?(key)\n set_meta(meta_key, values)\n end", "def getdel(key); end", "def getdel(key); end", "def remove(key)\n File.unlink cache_path(key)\n rescue Errno::ENOENT\n end", "def delete(key)\n value = self[key]\n\n @memcached.delete key\n\n value\n end", "def unbind_meta_app key, &block\n application \"unbind_meta_app\", key.to_s, &block\n end", "def release\n variables[:release]\n end", "def hdel(key, *fields); end", "def remove(key)\n Lib.remove @path, @no_follow, key.to_s\n end", "def key_released( event )\n @keys -= [event.key]\n end", "def wikify_destroy\n new_version = self.send(wikify_options[:assoc_name]).new\n new_version.data = @wikify_cached_object\n new_version.event = \"destroy\"\n new_version.save\n end", "def release_lock\n super\n end", "def delete(key)\n super(convert_key(key))\n end", "def unset_value(key)\n database.delete(key)\n removed_keys << key\n end", "def release\n return unless @lock_file # Skip if we don't have a file\n\n @lock_file.flock(File::LOCK_UN)\n File.delete( @lock_file )\n close_file\n end", "def delete_secret_key\n\t\takey = GPGME::Key.find(:secret, @dname)\n\t\takey.each do |akey|\n\t\takey.delete!(allow_secret = true)\n\t\tend\n\tend", "def delete(resource, key)\n @cache[resource].delete(key)\n end", "def release!\n ensure_service!\n service.delete_session path\n end", "def remove!\n MiGA.DEBUG \"Metadata.remove! #{path}\"\n File.unlink(path)\n nil\n end" ]
[ "0.7197445", "0.65381044", "0.6269027", "0.61559856", "0.60230446", "0.60089207", "0.60089207", "0.5981219", "0.5959423", "0.5922984", "0.59213674", "0.59212875", "0.5903592", "0.5862747", "0.5847556", "0.57960176", "0.57960176", "0.5795305", "0.5790555", "0.5766674", "0.57375556", "0.57208866", "0.5718792", "0.5718792", "0.57162267", "0.5662411", "0.5649348", "0.5640313", "0.5636478", "0.5578936", "0.5573729", "0.556562", "0.5556778", "0.553735", "0.5528203", "0.54950887", "0.548838", "0.5475464", "0.5471868", "0.54529846", "0.54529846", "0.54529846", "0.54529846", "0.54529846", "0.54091275", "0.5406547", "0.540204", "0.53928626", "0.5392475", "0.5389435", "0.5382083", "0.53811723", "0.53773654", "0.537254", "0.53719234", "0.53692806", "0.53676736", "0.53676736", "0.53663456", "0.53608364", "0.5359597", "0.5359597", "0.53445303", "0.5337072", "0.5327328", "0.5314718", "0.5313587", "0.5313561", "0.5298773", "0.5295716", "0.5291512", "0.52903986", "0.52897793", "0.5287604", "0.5269897", "0.5260205", "0.5251252", "0.524883", "0.5245153", "0.5245153", "0.5245153", "0.52324015", "0.523124", "0.5226792", "0.5226792", "0.5224617", "0.52201796", "0.5218821", "0.52058953", "0.5190606", "0.51901585", "0.51835805", "0.51821536", "0.5173231", "0.5170612", "0.51699847", "0.5158773", "0.51563543", "0.51471525", "0.51470935", "0.51456547" ]
0.0
-1
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
def mouse_down_at locator, coord_string command 'mouseDownAt', locator, coord_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def press element\n element.perform :press\n end", "def click_and_hold(element = T.unsafe(nil), button: T.unsafe(nil), device: T.unsafe(nil)); end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def release_mouse(button)\n XDo::FFILib.xdo_mouseup @_xdo_pointer, @_window, button\n end", "def press_mouse(button)\n XDo::FFILib.xdo_mousedown @_xdo_pointer, @_window, button\n end", "def click_mouse(button)\n XDo::FFILib.xdo_click @_xdo_pointer, @_window, button\n end", "def press_element_key(id, key)\r\n element = find_by_id(id);\r\n keypress_on(element, key)\r\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def mouse_pressed\n return unless button.clicked(mouse_x, mouse_y)\n\n population.selection\n population.reproduction\nend", "def mouse_up *args; end", "def mouseup(btn = 'left')\n compatible_call :mouseup, btn\n end", "def button_up(id)\n case id\n when Gosu::MsLeft\n if iterate_element() != nil\n element = iterate_element()\n click_event(element)\n end\n end\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def press\n\t\t@current_phase = :click\n\t\t\n\t\t\n\t\t# if there has been a mouse event\n\t\tpoint = @mouse_position_callback.call(@current_phase)\n\t\t\n\t\t\n\t\t# store the initial point to be able to trigger mouse drag\n\t\t@origin = point\n\t\t\n\t\t\n\t\t@active_action = @parse_input_callback.call(:click, point)\n\t\t@active_action.press(point)\n\t\t\n\tend", "def mouse_press *args\n\t\t\tevent(:mouse_press, *args)\n\t\tend", "def hover_click(element)\n driver.action.click(element).perform\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def mousedown(btn = 'left')\n compatible_call :mousedown, btn\n end", "def mouseover_and_click(method, element_over, element_click)\n\tp(\"-- clicking on element: \" + element_click.to_s + \" by \" + method.to_s)\n\t@selenium.action.move_to(@selenium.find_element(method, element_over)).perform\n\tsleep 5\n\t@selenium.find_element(method, element_click).click\n end", "def onClick(block=nil)\n @gtkEvent.signal_connect(\"button_release_event\") { |_, event|\n isClick(event.x.truncate,event.y.truncate)\n }\n end", "def unclicked(mouse_event)\n end", "def click\r\n start_point = screen.find ident\r\n click_x = start_point.x + offset_x\r\n click_y = start_point.y + offset_y\r\n\r\n screen.click click_x, click_y\r\n end", "def macNativeShortcut(element, key)\n\t\tputs key\n\t\tcase key\n\t\twhen 'x'\n\t\t\tputs \"something\"\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar event = new Event('cut', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(event);\n\t\t\t\t\")\n\n\t\twhen 'p'\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar pasteevent = new Event('paste', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(pasteevent);\n\t\t\t\t\")\n\t\tend\n\n\t\telement.native.send_keys [:command, key]\n\tend", "def button_down(id)\n click_handlers.each(&:call) if enabled? && id == Gosu::MS_LEFT &&\n within_bounds?(mouse_point)\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def press_key(criteria,element,key)\r\n\t\t\tputs key\r\n\t\t\t@driver.find_element(criteria.to_sym, element).send_keys [:control, 'a'], key.to_sym\r\n\t\t\tsleep 1\r\n\t\t\t#http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Keys#KEYS-constant\r\n\t\tend", "def click\n @clicked_x = @x\n @clicked_y = @y\n fire(:click, @clicked_x, @clicked_y)\n end", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def mouse_pressed\n # Check to see if the mouse was clicked on the box and if so create\n # a real spring and bind the mouse location to the box with a spring\n return unless box.contains(mouse_x, mouse_y)\n\n @spring = spring.bind(mouse_x, mouse_y, box)\nend", "def mouseButton()\n @view__.mouseButton\n end", "def on_click(elem)\n elem.fire_event('onClick')\n end", "def click_button(button = T.unsafe(nil)); end", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def press(point)\n\t\t\n\tend", "def double_click(element = T.unsafe(nil), device: T.unsafe(nil)); end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def click\n `#@native.click()`\n end", "def button_down(id)\n if id == Gosu::Button::KbEscape\n close\n end\n end", "def click_element (element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if internally\n script = <<-JS\n arguments[0].click();\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n select.click\n end\n end", "def clickButton(buttonId)\n EnziUIUtility.clickElement(@driver, :id, buttonId)\n sleep(10)\n end", "def button_down(id)\n # ENTER: launch A* algorithm\n if id == Gosu::KbReturn && ready?\n @grid.update_neighbors\n a_star\n @needs_reset = true\n end\n\n # SUPPR: clear window\n reset! if id == Gosu::KbDelete\n end", "def mouse_pressed\n flock << Boid.new(mouse_x, mouse_y)\nend", "def button_down(id)\n fire :button_down, id\n end", "def click\n `#@native.click()`\n self\n end", "def double_click_on(object)\n page.driver.browser.mouse.double_click(object.native)\n end", "def click; end", "def click; end", "def click; end", "def unclicked(e)\n puts \"Unclicked!\"\n end", "def click_on_button(button_name)\r\n\r\n given_button = $browser.button(id: \"#{button_name}\")\r\n\r\n given_button.wait_until_present(2)\r\n\r\n given_button.click\r\n\r\n sleep(1)\r\n end", "def tap_element element\n tapAction = Appium::TouchAction.new\n tapAction.tap(element: element).perform\n puts \"TAP is Working \\\\o/\"\n end", "def button_down(id)\n super(id)\n unless @buttons_down.include?(id)\n @input_lag = INPUT_LAG\n @buttons_down << id\n end\n return unless PRINT_INPUT_KEY\n #print(\"Buttons currently held down: #{@buttons_down} T:#{@triggered}\\n\")\n print(\"Window button pressed: (#{id}) which is (#{self.get_input_symbol(id).to_s})\\n\")\n end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def click(btn = 'left')\n compatible_call :click, btn\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def doubleclick(btn = 'left')\n compatible_call :doubleclick, btn\n end", "def pressed?() sdl_event.press end", "def clicked(mouse_event)\n end", "def click(driver = $focus_driver)\r\n begin\r\n driver.find_element(self).click\r\n Log.info(\"Element clicked #{self.how} => #{self.what}\")\r\n rescue StandardError => e\r\n Log.fail(\"Element not clicked #{self.how} => #{self.what}\" + e.message)\r\n end\r\n end", "def mouse_release *args\n\t\t\tevent(:mouse_release, *args)\n\t\tend", "def js_click(elem)\n self.execute_script('arguments[0].click();', elem)\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def button_up(id)\r\n $scene.button_up(id)\r\n end", "def click\n raise \"Must implement custom click method.\"\n end", "def mouse_released(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_released event')\nend", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def click(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES click mouse\n end tell\n `)\n end", "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def clicar(element)\n element.click\n end", "def pointer_down(button = T.unsafe(nil), device: T.unsafe(nil), **opts); end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def click_point(x, y, is_double = false)\n if is_double\n @java_obj.doubleClick(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n else\n @java_obj.click(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n end\n end", "def left_button_up(sender, selector, event)\n @canvas.ungrab\n @mouse_down = false\n flush_commands\n board_draw\n end", "def button_down(key)\n end", "def button_down(id)\n Log.start { \"GW#button_down...\" }\n Log.puts { \"button id: #{id.inspect}\" }\n # puts \"gosu enter (#{Gosu::KbEnter}) == #{ENTER_KEY}\"\n if Gosu::MsLeft == id\n Log.puts { \"got left mouse, now what...\" }\n if @answer_field.clicked?\n Log.puts { \"answer clicked\" }\n # Mouse click: Select text field based on mouse position.\n # Advanced: Move caret to clicked position\n self.text_input.move_caret(mouse_x) unless self.text_input.nil?\n @answer_field.text = \"\" # a bit abrupt\n self.text_input = @answer_field\n @answer_field.text = \"\" # a bit abrupt\n elsif @submit_button.clicked?\n Log.puts { \"submit\" }\n game.raw_response = @answer_field.text\n @answer_field.text = \"\" # a bit abrupt\n elsif @continue_button.clicked?\n Log.puts { \"continue\" }\n @game.sleep_end = Gosu::milliseconds - 1\n else\n Log.puts { \"no-op\" }\n end\n elsif ENTER_KEY == id #Gosu::KbEnter == id\n game.raw_response = @answer_field.text\n end\n Log.stop { \"GW#button_down...\" }\n end", "def left_button_down(sender, selector, event)\n @canvas.grab\n @mouse_down = true\n end", "def wait_for_press\n wait_for_presses(1)\n end", "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\tend", "def press(point)\n\t\t\t\t\n\t\t\tend", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def pay_button_tap(x=nil, y=nil)\n x = 720 if x==nil\n y = 1421 if y==nil\n Appium::Core::TouchAction.new(self).press( x, y).release.perform\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def button_down(id)\r\n $scene.button_down(id)\r\n end", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def mouse_down()\n mouse_down_at :center, :center\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def click(*args)\n\t\t\t# if no argument has been provided, click on the\n\t\t\t# window itself\n\t\t\th = (args.length == 0) ? @handle : child(args[0]).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def mouse_pressed(x, y)\n window_point = Geo3d::Vector.new(x,y)\n\n @sphere_point_when[:mouse_down] = window_to_sphere_space(window_point)\n @sphere_point_when[:mouse_draged] = @sphere_point_when[:mouse_down]\n end", "def release(button: T.unsafe(nil), device: T.unsafe(nil)); end", "def onClick(block=nil)\n return unless block_given?\n @gtkObject.signal_connect(\"button_release_event\") { |_, event|\n if event.button==Click::LEFT\n yield\n end\n }\n end", "def mouse_pressed\n super\n\n if mouse_button == RIGHT\n @right_mouse_down_x = mouseX\n @right_mouse_down_y = mouseY\n end\n end", "def key_press *args\n\t\t\tevent(:key_press, *args)\n\t\tend", "def setButton(button, mySample, doublePress=0)\n live_loop button.to_sym do\n use_real_time\n x = sync \"/osc*/2/#{button}\"\n x = x.choose\n sample mySample if doublePress===1\n sample mySample if doublePress===0 && x===1\n end\nend", "def click_button(value = nil)\n find_button(value).click\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end" ]
[ "0.7457933", "0.71486145", "0.712525", "0.6915357", "0.6859056", "0.6851255", "0.66038543", "0.65281534", "0.6422567", "0.63917696", "0.62894577", "0.6270494", "0.62123", "0.6135251", "0.6089427", "0.6073249", "0.60639745", "0.6013347", "0.59785193", "0.5976101", "0.59714246", "0.5942169", "0.59413046", "0.5937262", "0.58926636", "0.5872022", "0.5846976", "0.5845909", "0.5829059", "0.5808388", "0.58018327", "0.5794484", "0.57775503", "0.5764532", "0.5760223", "0.5755109", "0.57539725", "0.574576", "0.571198", "0.5710062", "0.5709764", "0.57033294", "0.56755626", "0.5672938", "0.5672595", "0.5672074", "0.5669331", "0.5666946", "0.5665243", "0.5651914", "0.564698", "0.564698", "0.564698", "0.5646373", "0.56323266", "0.5626769", "0.56249166", "0.5621743", "0.5621188", "0.56189185", "0.5615701", "0.5606446", "0.56064224", "0.56015265", "0.5592612", "0.55888784", "0.55881685", "0.55874515", "0.5582156", "0.5581693", "0.5574255", "0.55649126", "0.55519664", "0.55499315", "0.55487126", "0.55472434", "0.55350363", "0.55316836", "0.55257225", "0.5520711", "0.55144024", "0.55109936", "0.5505411", "0.549244", "0.5478848", "0.547183", "0.5471643", "0.5465086", "0.545677", "0.5453836", "0.5451615", "0.544755", "0.54417986", "0.544074", "0.54240096", "0.54157853", "0.54149926", "0.54114574", "0.5411219", "0.5410613", "0.541046" ]
0.0
-1
Simulates a user moving the mouse.
def mouse_move locator command 'mouseMove', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_mouse(window_x, window_y)\n old_location = @xdo.mouse.location\n move_mouse_async window_x, window_y\n @xdo.mouse.wait_for_move_from old_location[0], old_location[1]\n end", "def set_mouse_position(x, y); end", "def on_mouse_move(new_point)\n end", "def move_mouse(x_delta, y_delta)\n send_request RequestMessage.new(mouse_event_message: MouseEvent.new(x_delta: x_delta, y_delta: y_delta))\n end", "def move_mouse_async(window_x, window_y)\n XDo::FFILib.xdo_mousemove_relative_to_window @_xdo_pointer, @_window,\n window_x, window_y\n end", "def mouse_moved(x,y)\n\t\t[\n\t\t\t# @live_wrapper,\n\t\t\t@input_test,\n\t\t].each do |dynamic_obj|\n\t\t\tdynamic_obj.mouse_moved x,y\n\t\tend\n\tend", "def set_mouse_pos _x, _y\n send_cmd(\"set_mouse_pos #{_x} #{_y}\")\n end", "def move\n request_animation_frame { move } if @mouse_is_down\n return if !@position || !@started\n trigger 'move', @position\n end", "def mouse_motion *args\n\t\t\tevent(:mouse_motion, nil, *args)\n\t\tend", "def fire_events_for_mouse_movement\n current_state.each {|cs| cs.fire_events_for_mouse_movement }\n end", "def mousemove_relative(x, y)\n @logger.info(\"mousemove not supported\")\n end", "def mouse_x_update(val)\n $mouse_x += val\n sc_osc \"/n_set\", $synth_g, \"x\", $mouse_x\nend", "def update_mouse(moved)\n return update_mouse_index if Mouse.wheel != 0\n return false if moved && update_mouse_list\n return update_pocket_input && update_ctrl_button_mouse\n end", "def mouse_x=(value); self.set_mouse_x(value); end", "def mouseX; end", "def mouseMove(event)\n self.sprites.each do | sprite |\n sprite.mouseMove(event.pos) if sprite.respond_to?(:mouseMove)\n end\n end", "def ai\n mx = window.level.mouse.x\n my = window.level.mouse.y\n if @x + 35.0 < mx\n move_right\n if @y >= my + 15.0\n up\n end\n elsif @x > mx + 35.0\n move_left\n if @y >= my + 15.0\n up\n end\n end\n end", "def move(x:, y:, steps: 1)\n from_x = @x\n from_y = @y\n @x = x\n @y = y\n\n steps.times do |i|\n new_x = from_x + ((@x - from_x) * ((i + 1) / steps.to_f))\n new_y = from_y + ((@y - from_y) * ((i + 1) / steps.to_f))\n\n @page.command(\"Input.dispatchMouseEvent\",\n slowmoable: true,\n type: \"mouseMoved\",\n x: new_x.to_i,\n y: new_y.to_i)\n end\n\n self\n end", "def mouse_move_at locator, coord_string\r\n command 'mouseMoveAt', locator, coord_string\r\n end", "def update_mouse(moved)\n @buttons.each_with_index do |button, index|\n next unless button.simple_mouse_in?\n if moved\n last_index = @index\n @index = index\n if last_index != index\n update_buttons\n play_cursor_se\n end\n elsif Mouse.trigger?(:LEFT)\n @index = index\n update_buttons\n play_decision_se\n action\n end\n return false\n end\n return true\n end", "def mouse_x\n end", "def mouse\n r = SDL::Mouse.state\n r[1] = h-r[1]\n r\n end", "def move\n if me\n turn_left if window.button_down? Gosu::KbLeft\n turn_right if window.button_down? Gosu::KbRight\n run if window.button_down? Gosu::KbUp\n run_with_ball\n end\n end", "def mouse_x; mouseX; end", "def mouse_x; mouseX; end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def move(y, x)\n Ncurses.wmove(pointer, y, x)\n end", "def setMousePosition _args\n \"setMousePosition _args;\" \n end", "def unit_move_tb(x,y)\n @tb_event.flash_soft_tb = false if @tb_event\n give_move_command(@tb_event)\n @tb_event.tb_unit.used_action(:move, @tb_event.tb_unit.move)\n @showing_temp_hls = false\n end", "def move\n @x = (@x + @x_velocity) % Window.width\n @y = (@y + @y_velocity) % Window.height\nend", "def set_mouse_speed pixels\r\n command 'setMouseSpeed', pixels\r\n end", "def hover_and_move_slow(how, what, move_x, move_y)\n $debug and print \"In hover_and_move_slow: #{how}, #{what}, #{move_x}, #{move_y}\\n\"\n distance = [ 40, ((move_x + move_y)/4).abs].max\n e=$driver.find_element(how, what)\n $driver.action.click_and_hold(e).perform\n\n x = e.location.x\n y = e.location.y\n\n goal_x = x + move_x\n goal_y = y + move_y\n\n while( (goal_x - x).abs > 5 or (goal_y - y).abs > 5 )\n diff_x = goal_x - x\n diff_y = goal_y - y\n\n while( diff_x.abs > distance )\n diff_x = diff_x / 2;\n end\n\n while( diff_y.abs > distance )\n diff_y = diff_y / 2;\n end\n\n $debug and print \"In hover_and_move_slow: moving x #{diff_x} and y #{diff_y}, given current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.move_by(diff_x, diff_y).perform\n\n #$debug and sleep 2\n\n e=$driver.find_element(how, what)\n x = e.location.x\n y = e.location.y\n end\n\n $debug and print \"In hover_and_move_slow: exited main loop, current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.release.perform\n end", "def update_mouse\n @my = Mouse.y\n unless Mouse.wheel == 0\n Mouse.wheel > 0 ? update_cursor_up : update_cursor_down\n return Mouse.wheel = 0\n end\n return unless simple_mouse_in?\n\n @texts.stack.each_with_index do |text, i|\n next unless text.simple_mouse_in?\n\n if @index < i\n update_cursor_down while @index < i\n elsif @index > i\n update_cursor_up while @index > i\n end\n break\n end\n end", "def move_raw_async(x, y)\n XDo::FFILib.xdo_window_move @_xdo_pointer, @_window, x, y\n end", "def move\n\t\t# move 5px to the left\n\t @x = @x - 5\n\t # move up or down based on the Y velocity\n\t @y = @y + @vy\n\tend", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def mouse_up *args; end", "def update\n @position = @mouse.getMousePos\n if !@position.nil?\n @x = @position[0]\n @y = @position[1]\n end\n @sprite.visible = @visible\n @sprite.x = @x\n @sprite.y = @y\n end", "def mouseY; end", "def move\n self.speed += random_vector(0.5)\n self.position.x -= window.current_speed/4\n bounce_off_border_y\n on_hitting_x { destroy!; return }\n end", "def update\n super\n # Process mouse operations if mouse is on screen and custom method implemented\n #if $mouse.on_screen? and @active_mod_on\n # if mouse_on_window?\n # Mouse.window_add(self)\n # end\n #end\n end", "def move(y, x)\n update(y, x)\n apply_pos\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def pinch direction, magnification = 1, obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.pinch direction, magnification\n sleep wait\n end", "def update_mouse(_moved)\n if Mouse.trigger?(:left)\n @mouse_button_cancel.set_press(@mouse_button_cancel.simple_mouse_in?)\n elsif Mouse.released?(:left)\n @running = false if @mouse_button_cancel.simple_mouse_in?\n @mouse_button_cancel.set_press(false)\n end\n return true\n end", "def move(x, y)\n start_time = Time.now\n xdotool \"windowmove #{@id} #{x} #{y}\"\n # Inconsistencies exist between xwininfo and xdotool.\n # \"xdotool windowmove\" is local to the selected monitor, not reflecting the\n # true coordinates of the X session. Using the screen geometry determined,\n # we can get around this.\n while [x+$screen_geometry[0][0], y+$screen_geometry[0][1]] != get_position(@id)\n puts \"#{get_position(@id)}\"\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not react - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end", "def update_basic\n cursor_update\n mouse_cursor\n \n checkLeftClick()\n checkClickHover()\n end", "def update\n if Input.repeat?(:DOWN)\n update_cursor_down\n elsif Input.repeat?(:UP)\n update_cursor_up\n elsif @my != Mouse.y || Mouse.wheel != 0\n update_mouse\n end\n super\n end", "def mouseDown(event)\n windowFrame = self.frame\n # grab the mouse location in global coordinates\n @initialLocation = self.convertBaseToScreen(event.locationInWindow)\n @initialLocation.x -= windowFrame.origin.x;\n @initialLocation.y -= windowFrame.origin.y;\n end", "def speed\n # speeds should be between 1 and 2\n @window.mouse_y_percent\n end", "def robot_move\n state_execute do |robot|\n robot.move\n end\n end", "def scroll_mouse(x_amount, y_amount)\n send_request RequestMessage.new(mouse_wheel_message: MouseWheel.new(x_scroll: x_amount, y_scroll: y_amount))\n end", "def move(player, x, y)\n\n end", "def right_mouse_up()\n right_mouse_up_at :center, :center\n end", "def mouse_y\n end", "def moving!\n end", "def move_raw(x, y)\n old_location = self.location\n return_value = move_raw_async x, y\n 100.times do\n break unless self.location == old_location\n sleep 0.01\n end\n return_value\n end", "def mouse_moved\n modulate_amount = map1d(mouse_y, (0..height), (220..1))\n modulate_frequency = map1d(mouse_x, (0..width), (0.1..100)) \n fm.frequency.set_last_value(modulate_frequency )\n fm.amplitude.set_last_value(modulate_amount)\nend", "def mouse_over(&block)\n self.listen_to :event => :mousemove, :with => :location, &block\n end", "def move\n # Force evaluation of both update_x and update_y (no short-circuit)\n # If we're moving faster horizontally, do that first\n # Otherwise do the vertical move first\n moved = @space.process_moving_entity(self) do\n if @x_vel.abs > @y_vel.abs then move_x; move_y\n else move_y; move_x\n end\n end\n\n # Didn't move? Might be time to go to sleep\n if !moved && sleep_now?\n puts \"#{self} going to sleep...\"\n @moving = false\n end\n end", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def move(x,y)\n @x +=x\n @y +=y\n end", "def update\n state.fire_events_for_mouse_movement\n state.fire_events_for_held_buttons\n scene.base_update\n end", "def move\r\n @x += @velx\r\n @y += @vely\r\n\r\n #To introduce friction to the player so that it can slow down\r\n @velx *= FRICTION\r\n @vely *= FRICTION\r\n\r\n #To stop the player from moving out of the left of the window\r\n if @x > @window.width - @radius\r\n @velx = 0\r\n @x = @window.width - @radius\r\n end\r\n\r\n #To stop the player from moving out of the right of the window\r\n if @x < @radius\r\n @velx = 0\r\n @x = @radius\r\n end\r\n\r\n #To stop the player from moving out of the bottom of the window\r\n if @y > @window.height - @radius\r\n @vely = 0\r\n @y = @window.height - @radius\r\n end\r\n end", "def mouse_dragged(x, y)\n window_point = Geo3d::Vector.new(x,y)\n\n @sphere_point_when[:mouse_draged] = window_to_sphere_space(window_point)\n end", "def move\n \n end", "def move\n \n end", "def input\n # If the mouse was lifted this tick\n if inputs.mouse.up\n # Set current input to none\n state.user_input = :none\n end\n\n # If the mouse was clicked this tick\n if inputs.mouse.down\n # Determine what the user is editing and edit the state.user_input variable\n determine_input\n end\n\n # Process user input based on user_input variable and current mouse position\n process_input\n end", "def update_mouse_selector_move\n return unless Mouse.moved || Mouse.trigger?(:left) # Safety preventing index conflict\n @team_buttons.each_with_index do |btn, i|\n next unless btn.simple_mouse_in?\n update_selector_coordinates(@index = i) if @index != i\n action_A if Mouse.trigger?(:left)\n return true\n end\n end", "def emulate_lowrez_mouse args\n #Declares the mouse as a new entity and sets values for the x and y variables.\n args.state.new_entity_strict(:lowrez_mouse) do |m|\n m.x = args.mouse.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1\n m.y = args.mouse.y.idiv(TINY_SCALE)\n\n #If the mouse is clicked, the click variable stores the mouse click's position.\n #Otherwise, the mouse is not considered to be clicked or down.\n if args.mouse.click\n m.click = [\n args.mouse.click.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,\n args.mouse.click.point.y.idiv(TINY_SCALE)\n ]\n m.down = m.click\n else\n m.click = nil\n m.down = nil\n end\n\n #If the mouse is up, the position of the mouse is stored in the up variable.\n #Otherwise, the mouse is not considered to be up.\n if args.mouse.up\n m.up = [\n args.mouse.up.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,\n args.mouse.up.point.y.idiv(TINY_SCALE)\n ]\n else\n m.up = nil\n end\n end\nend", "def mouse_tech_demo\n x = 460\n\n outputs.labels << small_label(x, 11, \"Mouse input: inputs.mouse\")\n\n if inputs.mouse.click # if click has a value and is not nil\n state.last_mouse_click = inputs.mouse.click # coordinates of click are stored\n end\n\n if state.last_mouse_click # if mouse is clicked (has coordinates as value)\n # outputs the time (frame) the click occurred, as well as how many frames have passed since the event\n outputs.labels << small_label(x, 12, \"Mouse click happened at: #{state.last_mouse_click.created_at}, #{state.last_mouse_click.created_at_elapsed}\")\n # outputs coordinates of click\n outputs.labels << small_label(x, 13, \"Mouse click location: #{state.last_mouse_click.point.x}, #{state.last_mouse_click.point.y}\")\n else # otherwise if the mouse has not been clicked\n outputs.labels << small_label(x, 12, \"Mouse click has not occurred yet.\")\n outputs.labels << small_label(x, 13, \"Please click mouse.\")\n end\n end", "def update_cursor\n cursor_rect.set((@index % 2) * DELTA_X, (@index / 2) * DELTA_Y)\n $game_system.se_play($data_system.cursor_se)\n end", "def mouse_down()\n mouse_down_at :center, :center\n end", "def drag_mouse_to arg, opts = {}\n move_mouse_to opts[:from] if opts[:from]\n Mouse.drag_to arg.to_point, (opts[:duration] || 0.2)\n sleep(opts[:wait] || 0.2)\n end", "def move\n @cursor.x = wrap(@cursor.x + @delta.x, @code.width)\n @cursor.y = wrap(@cursor.y + @delta.y, @code.height)\n end", "def swipe direction, obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.swipe direction\n sleep wait\n end", "def update_move\n self.x = screen_x\n self.y = screen_y\n update_move_arch if @type == Arched\n end", "def mouse_wheel_delta_x(delta)\n @driver.sc_mouse_wheel_delta_x action_target, delta, *action_locator_args\n stall :mouse_wheel\n end", "def move!\n\t\tbounce! until !will_bounce? #TODO add surroundedness checking\n\t\t@x += @@target_coords[@direction][:dx]\n\t\t@y += @@target_coords[@direction][:dy]\n\tend", "def move\n @coord_x1 = @coord_x1 + @move_x\n @coord_x2 = @coord_x1 + @radius\n @coord_y1 = @coord_y1 + @slope * @move_x * Math.tan(@ankle)\n @coord_y2 = @coord_y1 + @radius\n @coord_ym = @coord_y1 + @radius/2\n\n #draw()\n end", "def move\n # Force evaluation of both update_x and update_y (no short-circuit)\n # If we're moving faster horizontally, do that first\n # Otherwise do the vertical move first\n moved = @space.process_moving_entity(self) do\n if @x_vel.abs > @y_vel.abs then move_x; move_y\n else move_y; move_x\n end\n end\n\n # Didn't move? Might be time to go to sleep\n @moving = false if !moved && sleep_now?\n\n moved\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def mouseDown(theEvent)\n window_frame = frame\n \n # grab the mouse location in global coordinates\n @initialLocation = convertBaseToScreen(theEvent.locationInWindow)\n @initialLocation.x -= window_frame.origin.x\n @initialLocation.y -= window_frame.origin.y\n end", "def mouse_pressed(x, y)\n window_point = Geo3d::Vector.new(x,y)\n\n @sphere_point_when[:mouse_down] = window_to_sphere_space(window_point)\n @sphere_point_when[:mouse_draged] = @sphere_point_when[:mouse_down]\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def mvtb_cursor(x,y)\n (p=$game_player).x = x; p.y = y\n end", "def move_to(x, y)\n @x, @y = x, y\n @gui.move_to(x, y)\n self\n end", "def mouse_in(mouse_event)\n end", "def move\n\t\t@x += 0\n\t\t@y += @vel\n\tend", "def move(x, y, speed = 1, delay = 0)\n @destx = x\n @desty = y\n @move_speed = speed\n @move_delay = delay\n @move_old = Graphics.frame_count\n @moving = true\nend", "def move_to(x, y); end", "def mouse_position\n mouse_state.position\n end", "def mouse_pressed\n # Check to see if the mouse was clicked on the box and if so create\n # a real spring and bind the mouse location to the box with a spring\n return unless box.contains(mouse_x, mouse_y)\n\n @spring = spring.bind(mouse_x, mouse_y, box)\nend", "def move_by a, m\n rad = a * D2R\n self.x += Math.cos(rad) * m\n self.y += Math.sin(rad) * m\n end", "def move(window)\n\t\t# use the velocities to move the x and y\n\t\t@x = @x + @vx\n\t\t@y = @y + @vy\n\t\t# if the star hits the left edge change the vx to positive 5\n\t\tif @x < 0\n\t\t\t@vx = 5\n\t\tend\n\t\t# if the star hits the right side of the screen change the vx to negative 5\n\t\tif @x > window.width - @image.width\n\t\t\t@vx = -5\n\t\tend\n\t\t# if the star hits the top of the screen change the vy to positive 5\n\t\tif @y < 0\n\t\t\t@vy = 5\n\t\tend\n\t\t# if the star hits the bottom of the screen change the vy to negative 5 \n\t\tif @y > window.height - @image.height\n\t\t\t@vy = -5\n\t\tend\n\tend", "def move_home_x\n @axis_x.move_home()\n @axis_x.disable_motor()\n end", "def update_move\n update_last_coordinate\n @point.update_move\n update_placement\n move_animation(diff_x, diff_y)\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def update(playerCenter, mouse)\n case @state\n when 0 # default, average of player and bg.\n # note, player's coordinates are in world while mouse are in camera, so we transform player\n # NOTE: right now there is jumpiness!!!!\n playerPos = playerCenter * @scale + @pos\n @pos = (playerPos + mouse) / 2\n when 1 # interpolates with bspline\n\n @t += 0.8;\n if(@t >= 1)\n while (@t >= 1)\n @t -= 1;\n end\n if (@path.length > 1)\n @path.shift\n end\n while(@path.length < 5)\n @path.push(@path[-1])\n end\n end\n \n if (@path.length < 3) \n return\n end\n \n # @pos = (1 - @t) ** 2 * @path[0] + 2 * (1 - @t) * @t * @path[1] + @t ** 2 * @path[2] \n @pos = Vector[0,0]\n for i in -2..1\n point = @path[i + 2];\n @pos[0] += point[0] * basis(i,@t)\n @pos[1] += point[1] * basis(i,@t)\n end\n when 2 # focus on average of objects\n avgVec = Vector[0, 0]\n for obj in @focusObjects\n avgVec += obj.center\n end\n avgVec /= @focusObjects.length\n @pos = avgVec * @scale\n end\n\n # make sure our specified position is placed at the center of the canvas\n @pos = Vector[@pos[0] - (CANVAS_WIDTH / 2), @pos[1] - (CANVAS_HEIGHT / 2)]\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end" ]
[ "0.7200083", "0.6847979", "0.6835807", "0.67562014", "0.66624224", "0.6658199", "0.66025347", "0.6555582", "0.652789", "0.6414712", "0.63360834", "0.6311428", "0.6185305", "0.61765814", "0.6164319", "0.6130741", "0.6099895", "0.6095381", "0.6060319", "0.6033424", "0.6031912", "0.6023731", "0.5993664", "0.59611535", "0.59611535", "0.5955317", "0.5937218", "0.59240913", "0.59145886", "0.58810216", "0.58436346", "0.5831278", "0.5819666", "0.5767373", "0.5760882", "0.57565534", "0.5733833", "0.5714622", "0.5713303", "0.5707837", "0.57077336", "0.56953984", "0.56820965", "0.5672507", "0.5665658", "0.5653018", "0.56496817", "0.56442857", "0.56194115", "0.55946577", "0.55926204", "0.558513", "0.5581981", "0.55735743", "0.5569146", "0.556227", "0.5553566", "0.55212325", "0.55184126", "0.55115354", "0.55086666", "0.54952157", "0.5494877", "0.547662", "0.54683113", "0.5453303", "0.5453303", "0.54509497", "0.5450156", "0.54474103", "0.5441527", "0.5433803", "0.54082644", "0.5383693", "0.53751034", "0.5372176", "0.5367738", "0.53658116", "0.5363828", "0.5350183", "0.53430784", "0.53423196", "0.53416306", "0.5336091", "0.5327979", "0.5325392", "0.532495", "0.53143746", "0.5312282", "0.5308633", "0.5293668", "0.52876747", "0.52845716", "0.5280615", "0.5270709", "0.52693415", "0.5263288", "0.5262509", "0.52428424", "0.52299136" ]
0.683311
3
Simulates a user moving the mouse relative to the specified element.
def mouse_move_at locator, coord_string command 'mouseMoveAt', locator, coord_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def mouse_move locator\r\n command 'mouseMove', locator\r\n end", "def move_mouse(window_x, window_y)\n old_location = @xdo.mouse.location\n move_mouse_async window_x, window_y\n @xdo.mouse.wait_for_move_from old_location[0], old_location[1]\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouse_move_to element.ref, right_by, down_by\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def mousemove_relative(x, y)\n @logger.info(\"mousemove not supported\")\n end", "def hover_and_move_slow(how, what, move_x, move_y)\n $debug and print \"In hover_and_move_slow: #{how}, #{what}, #{move_x}, #{move_y}\\n\"\n distance = [ 40, ((move_x + move_y)/4).abs].max\n e=$driver.find_element(how, what)\n $driver.action.click_and_hold(e).perform\n\n x = e.location.x\n y = e.location.y\n\n goal_x = x + move_x\n goal_y = y + move_y\n\n while( (goal_x - x).abs > 5 or (goal_y - y).abs > 5 )\n diff_x = goal_x - x\n diff_y = goal_y - y\n\n while( diff_x.abs > distance )\n diff_x = diff_x / 2;\n end\n\n while( diff_y.abs > distance )\n diff_y = diff_y / 2;\n end\n\n $debug and print \"In hover_and_move_slow: moving x #{diff_x} and y #{diff_y}, given current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.move_by(diff_x, diff_y).perform\n\n #$debug and sleep 2\n\n e=$driver.find_element(how, what)\n x = e.location.x\n y = e.location.y\n end\n\n $debug and print \"In hover_and_move_slow: exited main loop, current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.release.perform\n end", "def on_mouse_move(new_point)\n end", "def set_mouse_position(x, y); end", "def move_mouse(x_delta, y_delta)\n send_request RequestMessage.new(mouse_event_message: MouseEvent.new(x_delta: x_delta, y_delta: y_delta))\n end", "def move_mouse_async(window_x, window_y)\n XDo::FFILib.xdo_mousemove_relative_to_window @_xdo_pointer, @_window,\n window_x, window_y\n end", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def move\n request_animation_frame { move } if @mouse_is_down\n return if !@position || !@started\n trigger 'move', @position\n end", "def mouse_moved(x,y)\n\t\t[\n\t\t\t# @live_wrapper,\n\t\t\t@input_test,\n\t\t].each do |dynamic_obj|\n\t\t\tdynamic_obj.mouse_moved x,y\n\t\tend\n\tend", "def set_mouse_pos _x, _y\n send_cmd(\"set_mouse_pos #{_x} #{_y}\")\n end", "def simulate_hover(element)\n page.execute_script(\"$('#{element}').show()\")\n wait_a_sec_for_selenium\n end", "def mouseMove(event)\n self.sprites.each do | sprite |\n sprite.mouseMove(event.pos) if sprite.respond_to?(:mouseMove)\n end\n end", "def ai\n mx = window.level.mouse.x\n my = window.level.mouse.y\n if @x + 35.0 < mx\n move_right\n if @y >= my + 15.0\n up\n end\n elsif @x > mx + 35.0\n move_left\n if @y >= my + 15.0\n up\n end\n end\n end", "def drag_mouse_to arg, opts = {}\n move_mouse_to opts[:from] if opts[:from]\n Mouse.drag_to arg.to_point, (opts[:duration] || 0.2)\n sleep(opts[:wait] || 0.2)\n end", "def native_hover\n # original watir-webdriver code for hover\n assert_exists\n assert_has_input_devices_for :hover\n\n driver.action.move_to(@element).perform\n end", "def mouse_over(criteria,value,seconds_over)\r\n\t\t\t\r\n\t\t\telement = @driver.find_element(criteria.to_sym,value)\t\r\n\t\t\t\r\n\t\t\tputs element\r\n\t\t\t\r\n\t\t\t@driver.action.move_to(element).perform\r\n\t\t\tsleep seconds_over\r\n\t\tend", "def fire_events_for_mouse_movement\n current_state.each {|cs| cs.fire_events_for_mouse_movement }\n end", "def mouse_motion *args\n\t\t\tevent(:mouse_motion, nil, *args)\n\t\tend", "def mouseover_and_click(method, element_over, element_click)\n\tp(\"-- clicking on element: \" + element_click.to_s + \" by \" + method.to_s)\n\t@selenium.action.move_to(@selenium.find_element(method, element_over)).perform\n\tsleep 5\n\t@selenium.find_element(method, element_click).click\n end", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def mouse_over(x: 1, y: 1)\n Log.debug(\"[GRIDIUM::Element] Triggering mouse over for (#{self})...\")\n if element.enabled?\n $verification_passes += 1\n ElementExtensions.mouse_over(self, x: x, y: y)\n else\n Log.error('[GRIDIUM::Element] Cannot mouse over. Element is not present.')\n end\n end", "def pick_game_element\n @level.add_mouse(@input_controller.mouse_screen_coords)\n end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def move_to element_name, right_by = nil, down_by = nil\n begin\n $driver.action.move_to(el(element_name), right_by, down_by).perform\n rescue Exception => e\n $LOG.error \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n end\n end", "def pinch direction, magnification = 1, obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.pinch direction, magnification\n sleep wait\n end", "def hover_click(element)\n driver.action.click(element).perform\n end", "def mouse_x=(value); self.set_mouse_x(value); end", "def mouseX; end", "def setMousePosition _args\n \"setMousePosition _args;\" \n end", "def move(y, x)\n Ncurses.wmove(pointer, y, x)\n end", "def hover(componentName, componentInfo = nil, delay = 500)\n driver.action.move_to(get_component(componentName, componentInfo)).perform\n java.lang.Thread.sleep(delay)\nend", "def move_window_to(point_x, point_y)\n driver.manage.window.move_to(point_x, point_y)\n end", "def hover(componentName, delay = 500, componentInfo = nil)\n driver.action.move_to(get_component(componentName, componentInfo)).perform\n java.lang.Thread.sleep(delay)\nend", "def move_to(x, y); end", "def move_to_element(element)\n driver.execute_script('arguments[0].scrollIntoView(true)', element)\n end", "def hover_over_element(access_type, access_name)\n element = $driver.find_element(:\"#{access_type}\" => \"#{access_name}\")\n $driver.action.move_to(element).perform\nend", "def move_to(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n\n action\n .move_to(element, x, y)\n .perform\n end", "def unit_move_tb(x,y)\n @tb_event.flash_soft_tb = false if @tb_event\n give_move_command(@tb_event)\n @tb_event.tb_unit.used_action(:move, @tb_event.tb_unit.move)\n @showing_temp_hls = false\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def move(x:, y:, steps: 1)\n from_x = @x\n from_y = @y\n @x = x\n @y = y\n\n steps.times do |i|\n new_x = from_x + ((@x - from_x) * ((i + 1) / steps.to_f))\n new_y = from_y + ((@y - from_y) * ((i + 1) / steps.to_f))\n\n @page.command(\"Input.dispatchMouseEvent\",\n slowmoable: true,\n type: \"mouseMoved\",\n x: new_x.to_i,\n y: new_y.to_i)\n end\n\n self\n end", "def click_and_drag_to_position(capybara_element, xLoc, yLoc)\n wait_for_loading\n execute_script(\"jQuery('body').append('<div id=\\\"tempPositionMarker\\\" style=\\\"position:absolute; left:#{xLoc}px; top:#{yLoc}px; width: 0px; height: 0px;\\\"></div>');\")\n capybara_element.drag_to(find(:css, \"#tempPositionMarker\"))\n execute_script(\"jQuery('#tempPositionMarker').remove();\")\n wait_for_loading\n end", "def mouse_x\n end", "def move\n @x = (@x + @x_velocity) % Window.width\n @y = (@y + @y_velocity) % Window.height\nend", "def hover_over_element(access_type,access_name)\n element = WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}\n $driver.action.move_to(element).perform\nend", "def move_raw_async(x, y)\n XDo::FFILib.xdo_window_move @_xdo_pointer, @_window, x, y\n end", "def update_mouse_selector_move\n return unless Mouse.moved || Mouse.trigger?(:left) # Safety preventing index conflict\n @team_buttons.each_with_index do |btn, i|\n next unless btn.simple_mouse_in?\n update_selector_coordinates(@index = i) if @index != i\n action_A if Mouse.trigger?(:left)\n return true\n end\n end", "def mouse_over(&block)\n self.listen_to :event => :mousemove, :with => :location, &block\n end", "def move(y, x)\n update(y, x)\n apply_pos\n end", "def move_task(initial, target)\n initial_x = initial.wd.location['x']\n initial_y = initial.wd.location['y']\n\n target_x = target.wd.location['x']\n target_y = target.wd.location['y']\n\n total_x = target_x - initial_x + 5\n total_y = target_y - initial_y + 5\n\n initial.when_present.drag_and_drop_by(total_x, total_y)\n sleep 1 #Allow for motion to happen\n end", "def mouse_x_update(val)\n $mouse_x += val\n sc_osc \"/n_set\", $synth_g, \"x\", $mouse_x\nend", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def move!\n\t\tbounce! until !will_bounce? #TODO add surroundedness checking\n\t\t@x += @@target_coords[@direction][:dx]\n\t\t@y += @@target_coords[@direction][:dy]\n\tend", "def mouse_x; mouseX; end", "def mouse_x; mouseX; end", "def mouse_up *args; end", "def swipe direction, obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.swipe direction\n sleep wait\n end", "def move\n\t\t# move 5px to the left\n\t @x = @x - 5\n\t # move up or down based on the Y velocity\n\t @y = @y + @vy\n\tend", "def update_mouse(moved)\n @buttons.each_with_index do |button, index|\n next unless button.simple_mouse_in?\n if moved\n last_index = @index\n @index = index\n if last_index != index\n update_buttons\n play_cursor_se\n end\n elsif Mouse.trigger?(:LEFT)\n @index = index\n update_buttons\n play_decision_se\n action\n end\n return false\n end\n return true\n end", "def robot_move\n state_execute do |robot|\n robot.move\n end\n end", "def set_mouse_speed pixels\r\n command 'setMouseSpeed', pixels\r\n end", "def mouse_up_at locator, coord_string\r\n command 'mouseUpAt', locator, coord_string\r\n end", "def move_to(x, y)\n @x, @y = x, y\n @gui.move_to(x, y)\n self\n end", "def hover_element (element)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n wait_until{select.visible?}\n\n select.hover\n end", "def right_mouse_up()\n right_mouse_up_at :center, :center\n end", "def mouse\n r = SDL::Mouse.state\n r[1] = h-r[1]\n r\n end", "def move(x,y)\n @x +=x\n @y +=y\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def move\n self.speed += random_vector(0.5)\n self.position.x -= window.current_speed/4\n bounce_off_border_y\n on_hitting_x { destroy!; return }\n end", "def move_to(x_coord, y_coord)\n Selenium::WebDriver::Point.new(Integer(x_coord), Integer(y_coord)).tap do |point|\n use { @driver.manage.window.position = point }\n end\n end", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def mouseDown(event)\n windowFrame = self.frame\n # grab the mouse location in global coordinates\n @initialLocation = self.convertBaseToScreen(event.locationInWindow)\n @initialLocation.x -= windowFrame.origin.x;\n @initialLocation.y -= windowFrame.origin.y;\n end", "def mouseDown(theEvent)\n window_frame = frame\n \n # grab the mouse location in global coordinates\n @initialLocation = convertBaseToScreen(theEvent.locationInWindow)\n @initialLocation.x -= window_frame.origin.x\n @initialLocation.y -= window_frame.origin.y\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def mouse_in(mouse_event)\n end", "def move_to(x, y)\n object.x = x\n object.y = y\n end", "def navigate_dropdown(id, x1, y1, x2, y2)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by position to x1, y1, x2, y2\n x1 += position[0]\n y1 += position[1]\n x2 += position[0]\n y2 += position[1]\n # It's ugly, but \"moving\" the mouse on and off the dropdown button works better\n xdotool \"mousemove #{x1} #{y1}\"\n xdotool \"mousemove #{x1} #{y1-30}\"\n xdotool \"mousemove #{x1} #{y1}\"\n xdotool \"mousedown 1\"\n sleep $sleep_time\n xdotool \"mousemove #{x2} #{y2}\"\n xdotool \"mouseup 1\"\n sleep $sleep_time\nend", "def mouse_wheel_delta_x(delta)\n @driver.sc_mouse_wheel_delta_x action_target, delta, *action_locator_args\n stall :mouse_wheel\n end", "def move_to(point)\n offset(point.x - @left, point.y - @top)\n end", "def move(x, y)\n start_time = Time.now\n xdotool \"windowmove #{@id} #{x} #{y}\"\n # Inconsistencies exist between xwininfo and xdotool.\n # \"xdotool windowmove\" is local to the selected monitor, not reflecting the\n # true coordinates of the X session. Using the screen geometry determined,\n # we can get around this.\n while [x+$screen_geometry[0][0], y+$screen_geometry[0][1]] != get_position(@id)\n puts \"#{get_position(@id)}\"\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not react - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def click\n @clicked_x = @x\n @clicked_y = @y\n fire(:click, @clicked_x, @clicked_y)\n end", "def move(player, x, y)\n\n end", "def next_slide\n switch_to_current_frame\n body = $driver.find_element(:tag_name => \"body\")\n $driver.mouse.move_to(body, 3*body.size.width/4, body.size.height/4)\n $driver.mouse.down\n $driver.mouse.move_by(-body.size.width/2, 0)\n $driver.mouse.up\n sleep(1)\n switch_to_current_frame\n end", "def test_moveTo_Inside_Left\n w = Window_Base.new(-100, 100, 100, 50)\n @windows.push(w)\n w.animationSpeed = 2000\n w.moveTo(0, 100)\n return true\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def update_mouse(moved)\n return update_mouse_index if Mouse.wheel != 0\n return false if moved && update_mouse_list\n return update_pocket_input && update_ctrl_button_mouse\n end", "def move\n # Force evaluation of both update_x and update_y (no short-circuit)\n # If we're moving faster horizontally, do that first\n # Otherwise do the vertical move first\n moved = @space.process_moving_entity(self) do\n if @x_vel.abs > @y_vel.abs then move_x; move_y\n else move_y; move_x\n end\n end\n\n # Didn't move? Might be time to go to sleep\n if !moved && sleep_now?\n puts \"#{self} going to sleep...\"\n @moving = false\n end\n end", "def locate\n x = mouse_x + @viewport.ox\n approx = x * value.length / @sprite.bitmap.width\n match = approach(approx, x)\n @text.cursor_jump(match)\n @viewport.ox -= 10 if mouse_x < 0\n @viewport.ox += 10 if (self.width - mouse_x) < 0\n end", "def move_raw(x, y)\n old_location = self.location\n return_value = move_raw_async x, y\n 100.times do\n break unless self.location == old_location\n sleep 0.01\n end\n return_value\n end", "def move_by(x_delta, y_delta)\n if respond_to?(:x) && respond_to?(:y) && respond_to?(:x=) && respond_to?(:y=)\n if default_x?\n self.x_delta += x_delta\n else\n self.x += x_delta\n end\n if default_y?\n self.y_delta += y_delta\n else\n self.y += y_delta\n end\n end\n end", "def emulate_lowrez_mouse args\n #Declares the mouse as a new entity and sets values for the x and y variables.\n args.state.new_entity_strict(:lowrez_mouse) do |m|\n m.x = args.mouse.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1\n m.y = args.mouse.y.idiv(TINY_SCALE)\n\n #If the mouse is clicked, the click variable stores the mouse click's position.\n #Otherwise, the mouse is not considered to be clicked or down.\n if args.mouse.click\n m.click = [\n args.mouse.click.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,\n args.mouse.click.point.y.idiv(TINY_SCALE)\n ]\n m.down = m.click\n else\n m.click = nil\n m.down = nil\n end\n\n #If the mouse is up, the position of the mouse is stored in the up variable.\n #Otherwise, the mouse is not considered to be up.\n if args.mouse.up\n m.up = [\n args.mouse.up.point.x.idiv(TINY_SCALE) - CENTER_OFFSET.idiv(TINY_SCALE) - 1,\n args.mouse.up.point.y.idiv(TINY_SCALE)\n ]\n else\n m.up = nil\n end\n end\nend", "def test_moveTo_Inside_Right\n w = Window_Base.new(740, 100, 100, 50)\n @windows.push(w)\n w.animationSpeed = 2000\n w.moveTo(300, 100)\n return true\n end", "def move\n if me\n turn_left if window.button_down? Gosu::KbLeft\n turn_right if window.button_down? Gosu::KbRight\n run if window.button_down? Gosu::KbUp\n run_with_ball\n end\n end" ]
[ "0.72543204", "0.7125403", "0.6954894", "0.6909444", "0.67207175", "0.6685737", "0.6566773", "0.6464211", "0.6431148", "0.63728815", "0.635722", "0.6182271", "0.6069073", "0.60624975", "0.60135365", "0.5974087", "0.59176713", "0.5868106", "0.58583367", "0.58514285", "0.5846825", "0.5828498", "0.5781977", "0.5772105", "0.5768741", "0.5764848", "0.57641906", "0.5764129", "0.57244754", "0.5696443", "0.5694311", "0.5693419", "0.56589156", "0.56476957", "0.5638021", "0.56249785", "0.56249124", "0.5604875", "0.5596241", "0.5595351", "0.55694944", "0.5560252", "0.55581844", "0.5533689", "0.5529862", "0.551556", "0.5508168", "0.54914975", "0.5484228", "0.54467297", "0.5436478", "0.5434498", "0.5421377", "0.54195493", "0.54124576", "0.5408774", "0.53963435", "0.53924537", "0.5391044", "0.5391044", "0.5389023", "0.5381029", "0.5371228", "0.53607327", "0.53601456", "0.53555024", "0.53367186", "0.532966", "0.5312724", "0.5305652", "0.52969825", "0.52963287", "0.527388", "0.527388", "0.527135", "0.5267755", "0.5265566", "0.5262836", "0.5261213", "0.52532214", "0.5243566", "0.5239838", "0.5234362", "0.5228826", "0.5214315", "0.52116996", "0.5206453", "0.51998746", "0.51986504", "0.51932", "0.51921296", "0.5190848", "0.51888037", "0.51818854", "0.51562613", "0.5153643", "0.51531214", "0.51515234", "0.51482344", "0.51464295" ]
0.6295467
11
Simulates the user moving the mouse off the specified element.
def mouse_out locator command 'mouseOut', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouse_off(&block)\n self.listen_to :event => :mouseout, &block\n end", "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def mouse_out(mouse_event)\n end", "def mouse_out(e)\n @state = nil\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def unclicked(mouse_event)\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouse_move_to element.ref, right_by, down_by\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def unhighlight(element)\n if is_here?(element)\n engine.execute_script(\"arguments[0].removeAttribute('martaclass')\",\n element)\n end\n end", "def off what\n element.off what\n end", "def native_hover\n # original watir-webdriver code for hover\n assert_exists\n assert_has_input_devices_for :hover\n\n driver.action.move_to(@element).perform\n end", "def release_mouse(button)\n XDo::FFILib.xdo_mouseup @_xdo_pointer, @_window, button\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def off\r\n\t@controller.command(@house, @unit, :off, 0)\r\n end", "def click_and_hold(element = T.unsafe(nil), button: T.unsafe(nil), device: T.unsafe(nil)); end", "def hover_and_move_slow(how, what, move_x, move_y)\n $debug and print \"In hover_and_move_slow: #{how}, #{what}, #{move_x}, #{move_y}\\n\"\n distance = [ 40, ((move_x + move_y)/4).abs].max\n e=$driver.find_element(how, what)\n $driver.action.click_and_hold(e).perform\n\n x = e.location.x\n y = e.location.y\n\n goal_x = x + move_x\n goal_y = y + move_y\n\n while( (goal_x - x).abs > 5 or (goal_y - y).abs > 5 )\n diff_x = goal_x - x\n diff_y = goal_y - y\n\n while( diff_x.abs > distance )\n diff_x = diff_x / 2;\n end\n\n while( diff_y.abs > distance )\n diff_y = diff_y / 2;\n end\n\n $debug and print \"In hover_and_move_slow: moving x #{diff_x} and y #{diff_y}, given current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.move_by(diff_x, diff_y).perform\n\n #$debug and sleep 2\n\n e=$driver.find_element(how, what)\n x = e.location.x\n y = e.location.y\n end\n\n $debug and print \"In hover_and_move_slow: exited main loop, current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.release.perform\n end", "def simulate_hover(element)\n page.execute_script(\"$('#{element}').show()\")\n wait_a_sec_for_selenium\n end", "def mouseover_and_click(method, element_over, element_click)\n\tp(\"-- clicking on element: \" + element_click.to_s + \" by \" + method.to_s)\n\t@selenium.action.move_to(@selenium.find_element(method, element_over)).perform\n\tsleep 5\n\t@selenium.find_element(method, element_click).click\n end", "def off\n set_power(\"off\", \"smooth\",1000)\n end", "def drag_stop \n @dragging = false\n $document.body.off @mouse_up_cb\n $document.body.off @mouse_move_cb\n end", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def stop_all_movements\n @move_obj.clear_move_info\n @shadow_point.clear_move_info\n end_smooth_slide\n @shadow_point.end_smooth_slide\n end", "def hover_click(element)\n driver.action.click(element).perform\n end", "def off\n pwm(0x00)\n end", "def mouse_released\n spring.destroy\n @spring = DummySpring.new\nend", "def mouse_over(criteria,value,seconds_over)\r\n\t\t\t\r\n\t\t\telement = @driver.find_element(criteria.to_sym,value)\t\r\n\t\t\t\r\n\t\t\tputs element\r\n\t\t\t\r\n\t\t\t@driver.action.move_to(element).perform\r\n\t\t\tsleep seconds_over\r\n\t\tend", "def on_unhover(&block)\n unhover_handlers << block\n self\n end", "def move_to element_name, right_by = nil, down_by = nil\n begin\n $driver.action.move_to(el(element_name), right_by, down_by).perform\n rescue Exception => e\n $LOG.error \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n end\n end", "def mouse_down_at locator, coord_string\r\n command 'mouseDownAt', locator, coord_string\r\n end", "def right_mouse_up()\n right_mouse_up_at :center, :center\n end", "def move_pos_off\n @move_pos_selecting = false\n remove_show_hls\n # @spriteset.remove_group(DISPLAY_TB) # @spriteset.dispose_highlights_tb\n end", "def right_mouse_down()\n right_mouse_down_at :center, :center\n end", "def mouse_down()\n mouse_down_at :center, :center\n end", "def hover_over_element(access_type, access_name)\n element = $driver.find_element(:\"#{access_type}\" => \"#{access_name}\")\n $driver.action.move_to(element).perform\nend", "def disown(w)\n super(w)\n DOM.changeToStaticPositioning(w.getElement)\n end", "def unclicked(e)\n puts \"Unclicked!\"\n end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def move_object_down(object)\n object.location_move_down unless is_wall?(object.location_down)\n end", "def hide_element(element)\n execute_script(\"arguments[0].style.display='none'\", element)\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def mouse_released(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_released event')\nend", "def mouse_up *args; end", "def toggle_element(element)\n update_page do |page|\n page[element].toggle\n end\n end", "def unclick\n # Reset dragging slider\n @dragging_slider = false if @dragging_slider\n # Reset buttons\n @button_down_sprite.set_rect_div(0, 0, 1, 2) unless @button_down_sprite.src_rect.y == 0\n @button_up_sprite.set_rect_div(0, 0, 1, 2) unless @button_up_sprite.src_rect.y == 0\n @button_slider_sprite.set_rect_div(0, 0, 1, 2) unless @button_slider_sprite.src_rect.y == 0\n end", "def mouse_move locator\r\n command 'mouseMove', locator\r\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def cancel_move\n @cursor.active = true\n @active_battler.moveto(@pre_x, @pre_y)\n clear_tr_sprites\n draw_ranges(@active_battler, 3)\n end", "def hover_element (element)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n wait_until{select.visible?}\n\n select.hover\n end", "def mouse_over(x: 1, y: 1)\n Log.debug(\"[GRIDIUM::Element] Triggering mouse over for (#{self})...\")\n if element.enabled?\n $verification_passes += 1\n ElementExtensions.mouse_over(self, x: x, y: y)\n else\n Log.error('[GRIDIUM::Element] Cannot mouse over. Element is not present.')\n end\n end", "def toggle_off(outlet = 1)\n toggle(outlet, false)\n end", "def mouseDown(theEvent)\n window_frame = frame\n \n # grab the mouse location in global coordinates\n @initialLocation = convertBaseToScreen(theEvent.locationInWindow)\n @initialLocation.x -= window_frame.origin.x\n @initialLocation.y -= window_frame.origin.y\n end", "def moveToggle()\n @moveToggle_duration = @w_moveToggle.animationSpeed\n if (@w_moveToggle.x != 300 && @w_moveToggle.y != 250)\n @w_moveToggle.moveTo(300, 250)\n else\n @w_moveToggle.moveTo(350, 300)\n end\n end", "def scrollDown\n \th = getProperty('height')\n w = getProperty('width')\n mouseClick(waitForObject(@symbolicName, OBJECT_WAIT_TIMEOUT), w/2, h-20, 0, Qt::LEFT_BUTTON)\n end", "def right_click(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n action.move_to(element, x, y).context_click.perform\n end", "def blink_off\n if @_blink\n @_blink = false\n self.color.set(0, 0, 0, 0)\n end\n end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def disable_mouse\n\t\treturn enable_mouse(false)\n\tend", "def disable_mouse\n\t\treturn enable_mouse(false)\n\tend", "def turn_off!\n set_power!(:off)\n end", "def hover_over_element(access_type,access_name)\n element = WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}\n $driver.action.move_to(element).perform\nend", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def double_click(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n\n action\n .move_to(element, x, y)\n .double_click\n .perform\n end", "def kill\n fromx, fromy = [@x, @y]\n @x = @y = nil\n @board.piece_event self, fromx, fromy\n self\n end", "def power_off\n target = entity_xml\n class_name = self.class.name.split(\"::\").last\n Config.logger.debug \"#{class_name} status: #{target[:status]}\"\n if is_status?(target, :SUSPENDED)\n error_msg = \"#{class_name} #{target.name} suspended, discard state before powering off.\"\n fail class_name == \"VApp\" ? VappSuspendedError : VmSuspendedError,\n error_msg\n end\n if is_status?(target, :POWERED_OFF)\n Config.logger.info \"#{class_name} #{target.name} is already powered off.\"\n return\n end\n\n power_off_link = target.power_off_link\n unless power_off_link\n fail CloudError, \"#{class_name} #{target.name} is not in a state that could be powered off.\"\n end\n\n task = connection.post(power_off_link, nil)\n monitor_task task, @session.time_limit[:power_off]\n Config.logger.info \"#{class_name} #{target.name} is powered off.\"\n\n undeploy(target, class_name)\n end", "def swipe direction, obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.swipe direction\n sleep wait\n end", "def off\n @handler.off\n deactivate\n end", "def off\n :off\n end", "def toggle_off\n set_state_to(:off)\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def move_down(environment)\n @previous_action = 'moved down'\n location[:y] += 1 if can_move_down?(environment)\n environment.state\n end", "def off!\n digital_write(:off)\n end", "def mouseup(btn = 'left')\n compatible_call :mouseup, btn\n end", "def ole_stop\n @ole.quit\n end", "def off(event,context=nil)\n if @events[event]\n if context\n @events[event].delete(context)\n else\n @events[event].clear\n end\n @events.delete(event) if @events[event].empty?\n end\n end", "def user_click_until_gone(element1, element2)\r\n begin\r\n key_processor(element1)\r\n locator1 = @locator\r\n selector1 = @selector\r\n\r\n key_processor(element2)\r\n locator2 = @locator\r\n selector2 = @selector\r\n\r\n ****_click_until_gone(selector1, locator1, selector2, locator2)\r\n rescue Exception => e\r\n raise e.message\r\n raise e.backtrace.inspect\r\n end\r\n end", "def dropOff(simulator)\n end", "def moveto(x, y)\n super(x, y)\n @move_update.clear\n end", "def mouseDown(event)\n windowFrame = self.frame\n # grab the mouse location in global coordinates\n @initialLocation = self.convertBaseToScreen(event.locationInWindow)\n @initialLocation.x -= windowFrame.origin.x;\n @initialLocation.y -= windowFrame.origin.y;\n end", "def update_mouse_blink_position\n case $game_player.mouse_over\n when 1 then @mouse_blink.x = @layout.x + (5)\n when 2 then @mouse_blink.x = @layout.x + (5 + 32)\n when 3 then @mouse_blink.x = @layout.x + (5 + 64)\n when 4 then @mouse_blink.x = @layout.x + (5 + 96)\n when 5 then @mouse_blink.x = @layout.x + (5 + 128)\n when 6 then @mouse_blink.x = @layout.x + (5 + 160)\n when 7 then @mouse_blink.x = @layout.x + (5 + 192)\n when 8 then @mouse_blink.x = @layout.x + (5 + 224)\n when 9 then @mouse_blink.x = @layout.x + (5 + 256)\n end\n end", "def stop_moving(ev_id)\r\n event = $game_map.events[ev_id]\r\n event.stop_moving\r\nend", "def mouse_up_at locator, coord_string\r\n command 'mouseUpAt', locator, coord_string\r\n end", "def mouse_in(e)\n @state = :hover\n end", "def smart_magnify obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.smart_magnify\n sleep wait\n end", "def off(event_name)\n events.delete(event_name.to_sym)\n end", "def hover(componentName, delay = 500, componentInfo = nil)\n driver.action.move_to(get_component(componentName, componentInfo)).perform\n java.lang.Thread.sleep(delay)\nend", "def hover(componentName, componentInfo = nil, delay = 500)\n driver.action.move_to(get_component(componentName, componentInfo)).perform\n java.lang.Thread.sleep(delay)\nend", "def leave!\n @interact=false\n end", "def leave!\n @interact=false\n end", "def move_to_element(element)\n driver.execute_script('arguments[0].scrollIntoView(true)', element)\n end", "def deselect_piece\n @selected_piece_pos = nil\n\n end", "def mouse\n r = SDL::Mouse.state\n r[1] = h-r[1]\n r\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def cancel element\n element.perform :cancel\n end", "def mouse_release *args\n\t\t\tevent(:mouse_release, *args)\n\t\tend", "def off\n @speed = OFF\n puts \"#{@location} ceiling fan is off\"\n end", "def off\n @speed = OFF\n puts \"#{@location} ceiling fan is off\"\n end", "def swipe_down_until(expected_element)\n while $home_page.user_expect_not_displayed?(expected_element) do\n $home_page.user_swipe_down\n end\nend" ]
[ "0.6569883", "0.6426304", "0.63511056", "0.6227264", "0.611674", "0.59779125", "0.57419497", "0.5704998", "0.5700616", "0.5695627", "0.56000936", "0.54263026", "0.53523606", "0.53523606", "0.5324792", "0.5310525", "0.52759033", "0.5275746", "0.5220234", "0.52154577", "0.52119505", "0.5207118", "0.5201946", "0.5181776", "0.5163639", "0.5163162", "0.5159578", "0.5146464", "0.51428914", "0.5128771", "0.5125161", "0.5016296", "0.50004685", "0.49943906", "0.49562326", "0.49555153", "0.49472734", "0.49321812", "0.4919183", "0.4909631", "0.49080658", "0.4907399", "0.49057484", "0.48891512", "0.48814404", "0.48803824", "0.4878442", "0.48743972", "0.4870786", "0.48666912", "0.48651433", "0.48549584", "0.48404607", "0.48394942", "0.48377672", "0.48247585", "0.48205706", "0.48167336", "0.48167336", "0.4810268", "0.48045012", "0.47941375", "0.47941375", "0.4779418", "0.47780114", "0.47708964", "0.47624835", "0.47541454", "0.47538635", "0.4751369", "0.4750543", "0.4750543", "0.4744118", "0.47319433", "0.47232887", "0.4709444", "0.4709102", "0.4706177", "0.4698741", "0.46877813", "0.4685024", "0.46845698", "0.46777204", "0.46746275", "0.46740815", "0.4646845", "0.46411625", "0.4634133", "0.46290112", "0.46276262", "0.46276262", "0.46154284", "0.46140867", "0.46138558", "0.46094528", "0.46049842", "0.46048772", "0.46046546", "0.46046546", "0.45807037" ]
0.63808614
2
Simulates the user releasing the mouse button on the specified element.
def mouse_up locator command 'mouseUp', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def release_mouse(button)\n XDo::FFILib.xdo_mouseup @_xdo_pointer, @_window, button\n end", "def mouse_release *args\n\t\t\tevent(:mouse_release, *args)\n\t\tend", "def click_and_hold(element = T.unsafe(nil), button: T.unsafe(nil), device: T.unsafe(nil)); end", "def mouse_released(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_released event')\nend", "def unclicked(mouse_event)\n end", "def release(button: T.unsafe(nil), device: T.unsafe(nil)); end", "def press element\n element.perform :press\n end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def key_released( event )\n @keys -= [event.key]\n end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def button_down(id)\n if id == Gosu::Button::KbEscape\n close\n end\n end", "def mouse_up *args; end", "def mouse_out(mouse_event)\n end", "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def mouse_released\n spring.destroy\n @spring = DummySpring.new\nend", "def mouseup(btn = 'left')\n compatible_call :mouseup, btn\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\tend", "def unclick\n # Reset dragging slider\n @dragging_slider = false if @dragging_slider\n # Reset buttons\n @button_down_sprite.set_rect_div(0, 0, 1, 2) unless @button_down_sprite.src_rect.y == 0\n @button_up_sprite.set_rect_div(0, 0, 1, 2) unless @button_up_sprite.src_rect.y == 0\n @button_slider_sprite.set_rect_div(0, 0, 1, 2) unless @button_slider_sprite.src_rect.y == 0\n end", "def button_down(id)\r\n $scene.button_down(id)\r\n end", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def pointer_down(button = T.unsafe(nil), device: T.unsafe(nil), **opts); end", "def joyreleased( button )\n return AndTrigger.new( InstanceOfTrigger.new( JoystickButtonReleased ),\n AttrTrigger.new(:joystick_id => 0,\n :button => button))\nend", "def unclicked(e)\n puts \"Unclicked!\"\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def press_mouse(button)\n XDo::FFILib.xdo_mousedown @_xdo_pointer, @_window, button\n end", "def button_down(id)\n fire :button_down, id\n end", "def button_up(id)\n case id\n when Gosu::MsLeft\n if iterate_element() != nil\n element = iterate_element()\n click_event(element)\n end\n end\n end", "def mouse_pressed\n return unless button.clicked(mouse_x, mouse_y)\n\n population.selection\n population.reproduction\nend", "def on_button_down(button_id, point)\n end", "def button_down(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n\r\n # Check if the player sprite can jump\r\n if [1,3,4,5,6].include?(get_tile_info(@player.get_x,\r\n @player.get_y,:down)) then\r\n\r\n # Call the jump function\r\n @player.jump\r\n\r\n # Player still might have a chance to \"double\" jump\r\n elsif @player.get_fall < 5 then\r\n @player.jump\r\n end\r\n end\r\n end", "def button_down(key)\n end", "def decrement element\n element.perform :decrement\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def mouse_out(e)\n @state = nil\n end", "def left_button_up(sender, selector, event)\n @canvas.ungrab\n @mouse_down = false\n flush_commands\n board_draw\n end", "def button_up(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n @player.reset_jump if @player.is_jumping?\r\n end\r\n end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def button_down(id)\n Log.start { \"GW#button_down...\" }\n Log.puts { \"button id: #{id.inspect}\" }\n # puts \"gosu enter (#{Gosu::KbEnter}) == #{ENTER_KEY}\"\n if Gosu::MsLeft == id\n Log.puts { \"got left mouse, now what...\" }\n if @answer_field.clicked?\n Log.puts { \"answer clicked\" }\n # Mouse click: Select text field based on mouse position.\n # Advanced: Move caret to clicked position\n self.text_input.move_caret(mouse_x) unless self.text_input.nil?\n @answer_field.text = \"\" # a bit abrupt\n self.text_input = @answer_field\n @answer_field.text = \"\" # a bit abrupt\n elsif @submit_button.clicked?\n Log.puts { \"submit\" }\n game.raw_response = @answer_field.text\n @answer_field.text = \"\" # a bit abrupt\n elsif @continue_button.clicked?\n Log.puts { \"continue\" }\n @game.sleep_end = Gosu::milliseconds - 1\n else\n Log.puts { \"no-op\" }\n end\n elsif ENTER_KEY == id #Gosu::KbEnter == id\n game.raw_response = @answer_field.text\n end\n Log.stop { \"GW#button_down...\" }\n end", "def button_down(id)\n click_handlers.each(&:call) if enabled? && id == Gosu::MS_LEFT &&\n within_bounds?(mouse_point)\n end", "def mousedown(btn = 'left')\n compatible_call :mousedown, btn\n end", "def press_element_key(id, key)\r\n element = find_by_id(id);\r\n keypress_on(element, key)\r\n end", "def button_down(id)\n if id == Gosu::KbEscape\n close\n end\n if id == Gosu::KbO && (not @twoplayer)\n @twoplayer = true\n @player.second_player_mode\n end\n if id == Gosu::KbR && @game_over\n @ball.reset\n @score.reset\n @game_over = false\n end\n end", "def drag_stop \n @dragging = false\n $document.body.off @mouse_up_cb\n $document.body.off @mouse_move_cb\n end", "def button_down(id)\n super(id)\n unless @buttons_down.include?(id)\n @input_lag = INPUT_LAG\n @buttons_down << id\n end\n return unless PRINT_INPUT_KEY\n #print(\"Buttons currently held down: #{@buttons_down} T:#{@triggered}\\n\")\n print(\"Window button pressed: (#{id}) which is (#{self.get_input_symbol(id).to_s})\\n\")\n end", "def released( key )\n return KeyReleaseTrigger.new( key )\nend", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def on_button_up(button_id, point)\n end", "def onClick(block=nil)\n @gtkEvent.signal_connect(\"button_release_event\") { |_, event|\n isClick(event.x.truncate,event.y.truncate)\n }\n end", "def button_up(id)\r\n $scene.button_up(id)\r\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def button_down(id)\n @@game_state.button_down(id)\n end", "def button_released?(btn)\n @prev_down[btn] and not @down[btn]\n end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouse_move_to element.ref, right_by, down_by\n end", "def release(point)\n\t\t\n\tend", "def release(point)\n\t\t\n\tend", "def release(point)\n\t\t\n\tend", "def release(point)\n\t\t\n\tend", "def button_down(id)\n # ENTER: launch A* algorithm\n if id == Gosu::KbReturn && ready?\n @grid.update_neighbors\n a_star\n @needs_reset = true\n end\n\n # SUPPR: clear window\n reset! if id == Gosu::KbDelete\n end", "def button_down(id); end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def mouseUp(event)\n x,y = event.pos\n ups = collide_point(x,y)\n ups = ups.sort\n for sprite in ups\n if event.button == :mouse_left ||\n event.button == :mouse_right ||\n event.button == :mouse_middle\n sprite.click(x,y) if sprite.respond_to?(:click)\n else\n if sprite.respond_to?(:wheel)\n sprite.wheel(event.button == :mouse_wheel_up,x,y)\n end\n end\n break if sprite.click_stops_here\n end\n return ups\n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def keyPressed(key, x, y)\n\n # If escape is pressed, kill everything. \n if (key == 27) \n # shut down our window \n glutDestroyWindow(@window)\n # exit the program...normal termination.\n exit(0) \n end\nend", "def mouse_down()\n mouse_down_at :center, :center\n end", "def pay_button_tap(x=nil, y=nil)\n x = 720 if x==nil\n y = 1421 if y==nil\n Appium::Core::TouchAction.new(self).press( x, y).release.perform\n end", "def button_down; end", "def button_down(id)\n case id\n when Gosu::MsLeft\n button_handler\n end\n end", "def mouse_out locator\r\n command 'mouseOut', locator\r\n end", "def cursor_down(wrap = false)\n Sound.play_cursor\n Input.update\n deactivate\n call_handler(:down)\n end", "def click_mouse(button)\n XDo::FFILib.xdo_click @_xdo_pointer, @_window, button\n end", "def right_mouse_up()\n right_mouse_up_at :center, :center\n end", "def left_button_down(sender, selector, event)\n @canvas.grab\n @mouse_down = true\n end", "def release(point)\n\t\t\t\t\n\t\t\tend", "def released(&block)\n @up_callback = block\n end", "def pen_up\n @pen_is_down = false\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def button_up(key)\n close if key == Gosu::KbEscape\n\n # reset the game\n if @state == :end && key == Gosu::MsLeft\n @board = Board.new(self, 22, @root_dir)\n @state = :game\n return\n end\n\n @player_b.ai_inc if key == Gosu::KbS\n @player_b.ai_dec if key == Gosu::KbD\n\n if @player_on_turn.class == HotseatPlayer && key == Gosu::MsLeft\n if @board.cell_clicked(mouse_x, mouse_y, @player_on_turn.sym)\n\n return if @state == :end\n\n switch_players\n\n if @player_on_turn.class == AIPlayer\n @player_on_turn.make_move(@board)\n switch_players\n end\n end\n end\n end", "def on_button_down( button_id )\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def click_element(element, timeout)\n wait_for_element(element, timeout)\n hide_canvas_footer\n sleep Utils.click_wait\n element.click\n end", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def delete_element(element); end", "def pointer_up(button = T.unsafe(nil), device: T.unsafe(nil), **opts); end", "def mouse_pressed\n flock << Boid.new(mouse_x, mouse_y)\nend", "def hold\n action('hold')\n end", "def button_down(id)\n end", "def double_click(element = T.unsafe(nil), device: T.unsafe(nil)); end", "def mouse_pressed\n # Check to see if the mouse was clicked on the box and if so create\n # a real spring and bind the mouse location to the box with a spring\n return unless box.contains(mouse_x, mouse_y)\n\n @spring = spring.bind(mouse_x, mouse_y, box)\nend" ]
[ "0.72497416", "0.65927655", "0.6166525", "0.6025591", "0.58834934", "0.58391625", "0.56883866", "0.5684693", "0.56724447", "0.5662293", "0.5638707", "0.5576783", "0.5576489", "0.55759776", "0.5542504", "0.5527727", "0.54942125", "0.54700303", "0.5426609", "0.5412116", "0.5327555", "0.53153735", "0.5269037", "0.5238305", "0.5222704", "0.5213777", "0.5190909", "0.5190876", "0.5147075", "0.5108946", "0.510451", "0.5103128", "0.50945634", "0.50916344", "0.50842613", "0.5084061", "0.50056744", "0.49837857", "0.49723637", "0.49709547", "0.49555564", "0.4926896", "0.49257496", "0.49209586", "0.48977125", "0.48957637", "0.4893388", "0.48913905", "0.48877048", "0.48747352", "0.4868535", "0.48621565", "0.48615035", "0.48481658", "0.48353794", "0.48326862", "0.48154962", "0.48099625", "0.47928032", "0.47833326", "0.47754255", "0.47754255", "0.47754255", "0.47754255", "0.47612715", "0.47485268", "0.47331604", "0.47331604", "0.47316518", "0.47253874", "0.47210446", "0.47192788", "0.47191516", "0.47156823", "0.47133127", "0.4712068", "0.4706561", "0.46997336", "0.46948236", "0.4680868", "0.4668542", "0.46676478", "0.4665176", "0.4654617", "0.4654617", "0.46465635", "0.4628779", "0.46218717", "0.46127534", "0.46127534", "0.46068776", "0.45980805", "0.45926827", "0.4564633", "0.45624495", "0.45595762", "0.4553963", "0.45524418", "0.45505226", "0.45473176" ]
0.49565053
40
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
def mouse_up_at locator, coord_string command 'mouseUpAt', locator, coord_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def press element\n element.perform :press\n end", "def click_and_hold(element = T.unsafe(nil), button: T.unsafe(nil), device: T.unsafe(nil)); end", "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def release_mouse(button)\n XDo::FFILib.xdo_mouseup @_xdo_pointer, @_window, button\n end", "def press_mouse(button)\n XDo::FFILib.xdo_mousedown @_xdo_pointer, @_window, button\n end", "def click_mouse(button)\n XDo::FFILib.xdo_click @_xdo_pointer, @_window, button\n end", "def press_element_key(id, key)\r\n element = find_by_id(id);\r\n keypress_on(element, key)\r\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def mouse_pressed\n return unless button.clicked(mouse_x, mouse_y)\n\n population.selection\n population.reproduction\nend", "def mouse_up *args; end", "def mouseup(btn = 'left')\n compatible_call :mouseup, btn\n end", "def button_up(id)\n case id\n when Gosu::MsLeft\n if iterate_element() != nil\n element = iterate_element()\n click_event(element)\n end\n end\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def press\n\t\t@current_phase = :click\n\t\t\n\t\t\n\t\t# if there has been a mouse event\n\t\tpoint = @mouse_position_callback.call(@current_phase)\n\t\t\n\t\t\n\t\t# store the initial point to be able to trigger mouse drag\n\t\t@origin = point\n\t\t\n\t\t\n\t\t@active_action = @parse_input_callback.call(:click, point)\n\t\t@active_action.press(point)\n\t\t\n\tend", "def mouse_press *args\n\t\t\tevent(:mouse_press, *args)\n\t\tend", "def hover_click(element)\n driver.action.click(element).perform\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def mousedown(btn = 'left')\n compatible_call :mousedown, btn\n end", "def mouseover_and_click(method, element_over, element_click)\n\tp(\"-- clicking on element: \" + element_click.to_s + \" by \" + method.to_s)\n\t@selenium.action.move_to(@selenium.find_element(method, element_over)).perform\n\tsleep 5\n\t@selenium.find_element(method, element_click).click\n end", "def onClick(block=nil)\n @gtkEvent.signal_connect(\"button_release_event\") { |_, event|\n isClick(event.x.truncate,event.y.truncate)\n }\n end", "def unclicked(mouse_event)\n end", "def click\r\n start_point = screen.find ident\r\n click_x = start_point.x + offset_x\r\n click_y = start_point.y + offset_y\r\n\r\n screen.click click_x, click_y\r\n end", "def macNativeShortcut(element, key)\n\t\tputs key\n\t\tcase key\n\t\twhen 'x'\n\t\t\tputs \"something\"\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar event = new Event('cut', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(event);\n\t\t\t\t\")\n\n\t\twhen 'p'\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar pasteevent = new Event('paste', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(pasteevent);\n\t\t\t\t\")\n\t\tend\n\n\t\telement.native.send_keys [:command, key]\n\tend", "def button_down(id)\n click_handlers.each(&:call) if enabled? && id == Gosu::MS_LEFT &&\n within_bounds?(mouse_point)\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def press_key(criteria,element,key)\r\n\t\t\tputs key\r\n\t\t\t@driver.find_element(criteria.to_sym, element).send_keys [:control, 'a'], key.to_sym\r\n\t\t\tsleep 1\r\n\t\t\t#http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Keys#KEYS-constant\r\n\t\tend", "def click\n @clicked_x = @x\n @clicked_y = @y\n fire(:click, @clicked_x, @clicked_y)\n end", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def mouse_pressed\n # Check to see if the mouse was clicked on the box and if so create\n # a real spring and bind the mouse location to the box with a spring\n return unless box.contains(mouse_x, mouse_y)\n\n @spring = spring.bind(mouse_x, mouse_y, box)\nend", "def mouseButton()\n @view__.mouseButton\n end", "def on_click(elem)\n elem.fire_event('onClick')\n end", "def click_button(button = T.unsafe(nil)); end", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def press(point)\n\t\t\n\tend", "def double_click(element = T.unsafe(nil), device: T.unsafe(nil)); end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def click\n `#@native.click()`\n end", "def button_down(id)\n if id == Gosu::Button::KbEscape\n close\n end\n end", "def click_element (element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if internally\n script = <<-JS\n arguments[0].click();\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n select.click\n end\n end", "def clickButton(buttonId)\n EnziUIUtility.clickElement(@driver, :id, buttonId)\n sleep(10)\n end", "def button_down(id)\n # ENTER: launch A* algorithm\n if id == Gosu::KbReturn && ready?\n @grid.update_neighbors\n a_star\n @needs_reset = true\n end\n\n # SUPPR: clear window\n reset! if id == Gosu::KbDelete\n end", "def mouse_pressed\n flock << Boid.new(mouse_x, mouse_y)\nend", "def button_down(id)\n fire :button_down, id\n end", "def click\n `#@native.click()`\n self\n end", "def double_click_on(object)\n page.driver.browser.mouse.double_click(object.native)\n end", "def click; end", "def click; end", "def click; end", "def unclicked(e)\n puts \"Unclicked!\"\n end", "def click_on_button(button_name)\r\n\r\n given_button = $browser.button(id: \"#{button_name}\")\r\n\r\n given_button.wait_until_present(2)\r\n\r\n given_button.click\r\n\r\n sleep(1)\r\n end", "def tap_element element\n tapAction = Appium::TouchAction.new\n tapAction.tap(element: element).perform\n puts \"TAP is Working \\\\o/\"\n end", "def button_down(id)\n super(id)\n unless @buttons_down.include?(id)\n @input_lag = INPUT_LAG\n @buttons_down << id\n end\n return unless PRINT_INPUT_KEY\n #print(\"Buttons currently held down: #{@buttons_down} T:#{@triggered}\\n\")\n print(\"Window button pressed: (#{id}) which is (#{self.get_input_symbol(id).to_s})\\n\")\n end", "def click(btn = 'left')\n compatible_call :click, btn\n end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def doubleclick(btn = 'left')\n compatible_call :doubleclick, btn\n end", "def clicked(mouse_event)\n end", "def pressed?() sdl_event.press end", "def click(driver = $focus_driver)\r\n begin\r\n driver.find_element(self).click\r\n Log.info(\"Element clicked #{self.how} => #{self.what}\")\r\n rescue StandardError => e\r\n Log.fail(\"Element not clicked #{self.how} => #{self.what}\" + e.message)\r\n end\r\n end", "def mouse_release *args\n\t\t\tevent(:mouse_release, *args)\n\t\tend", "def js_click(elem)\n self.execute_script('arguments[0].click();', elem)\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def button_up(id)\r\n $scene.button_up(id)\r\n end", "def click\n raise \"Must implement custom click method.\"\n end", "def mouse_released(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_released event')\nend", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def click(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES click mouse\n end tell\n `)\n end", "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def clicar(element)\n element.click\n end", "def pointer_down(button = T.unsafe(nil), device: T.unsafe(nil), **opts); end", "def button_up(id)\n Game.begin_game(@score) if id == Gosu::KbEscape or id == Gosu::KbReturn or Gosu::KbSpace\n end", "def click_point(x, y, is_double = false)\n if is_double\n @java_obj.doubleClick(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n else\n @java_obj.click(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n end\n end", "def left_button_up(sender, selector, event)\n @canvas.ungrab\n @mouse_down = false\n flush_commands\n board_draw\n end", "def button_down(key)\n end", "def button_down(id)\n Log.start { \"GW#button_down...\" }\n Log.puts { \"button id: #{id.inspect}\" }\n # puts \"gosu enter (#{Gosu::KbEnter}) == #{ENTER_KEY}\"\n if Gosu::MsLeft == id\n Log.puts { \"got left mouse, now what...\" }\n if @answer_field.clicked?\n Log.puts { \"answer clicked\" }\n # Mouse click: Select text field based on mouse position.\n # Advanced: Move caret to clicked position\n self.text_input.move_caret(mouse_x) unless self.text_input.nil?\n @answer_field.text = \"\" # a bit abrupt\n self.text_input = @answer_field\n @answer_field.text = \"\" # a bit abrupt\n elsif @submit_button.clicked?\n Log.puts { \"submit\" }\n game.raw_response = @answer_field.text\n @answer_field.text = \"\" # a bit abrupt\n elsif @continue_button.clicked?\n Log.puts { \"continue\" }\n @game.sleep_end = Gosu::milliseconds - 1\n else\n Log.puts { \"no-op\" }\n end\n elsif ENTER_KEY == id #Gosu::KbEnter == id\n game.raw_response = @answer_field.text\n end\n Log.stop { \"GW#button_down...\" }\n end", "def left_button_down(sender, selector, event)\n @canvas.grab\n @mouse_down = true\n end", "def wait_for_press\n wait_for_presses(1)\n end", "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::KbEscape\n\t\t\tclose\n\t\tend\n\tend", "def press(point)\n\t\t\t\t\n\t\t\tend", "def button_down(id)\n case id\n when Gosu::KbEnter, Gosu::KbReturn\n @paused = !@paused\n end\n end", "def pay_button_tap(x=nil, y=nil)\n x = 720 if x==nil\n y = 1421 if y==nil\n Appium::Core::TouchAction.new(self).press( x, y).release.perform\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def mouse_up()\n mouse_up_at :center, :center\n end", "def button_down(id)\r\n $scene.button_down(id)\r\n end", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def mouse_down()\n mouse_down_at :center, :center\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def click(*args)\n\t\t\t# if no argument has been provided, click on the\n\t\t\t# window itself\n\t\t\th = (args.length == 0) ? @handle : child(args[0]).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def mouse_pressed(x, y)\n window_point = Geo3d::Vector.new(x,y)\n\n @sphere_point_when[:mouse_down] = window_to_sphere_space(window_point)\n @sphere_point_when[:mouse_draged] = @sphere_point_when[:mouse_down]\n end", "def release(button: T.unsafe(nil), device: T.unsafe(nil)); end", "def onClick(block=nil)\n return unless block_given?\n @gtkObject.signal_connect(\"button_release_event\") { |_, event|\n if event.button==Click::LEFT\n yield\n end\n }\n end", "def mouse_pressed\n super\n\n if mouse_button == RIGHT\n @right_mouse_down_x = mouseX\n @right_mouse_down_y = mouseY\n end\n end", "def click_button(value = nil)\n find_button(value).click\n end", "def setButton(button, mySample, doublePress=0)\n live_loop button.to_sym do\n use_real_time\n x = sync \"/osc*/2/#{button}\"\n x = x.choose\n sample mySample if doublePress===1\n sample mySample if doublePress===0 && x===1\n end\nend", "def key_press *args\n\t\t\tevent(:key_press, *args)\n\t\tend", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end" ]
[ "0.7458295", "0.71502155", "0.71259904", "0.6914235", "0.6856933", "0.6848331", "0.6602123", "0.6527265", "0.6421767", "0.6391393", "0.62895757", "0.6270785", "0.62118787", "0.61354506", "0.60891366", "0.6072993", "0.606333", "0.6012703", "0.59778637", "0.59750634", "0.59722733", "0.5942532", "0.59401953", "0.59379154", "0.58937746", "0.5873079", "0.5846805", "0.5845599", "0.58278", "0.5808377", "0.5801568", "0.5795509", "0.5777495", "0.5764228", "0.57595176", "0.5758108", "0.5755447", "0.57457334", "0.57122624", "0.571182", "0.57092613", "0.5704013", "0.567517", "0.5674792", "0.56718147", "0.5671355", "0.56693333", "0.56672704", "0.5665935", "0.56529266", "0.5649447", "0.5649447", "0.5649447", "0.5647893", "0.56319016", "0.5628278", "0.5624179", "0.56216425", "0.56213826", "0.5619403", "0.5616666", "0.56078595", "0.56068075", "0.56032175", "0.55929565", "0.5590645", "0.55882585", "0.5587267", "0.5584778", "0.5582402", "0.5574349", "0.55628735", "0.55527425", "0.55511606", "0.55478346", "0.5546939", "0.5535293", "0.5529486", "0.5525256", "0.5520726", "0.5511981", "0.55103457", "0.55054647", "0.54930663", "0.5477667", "0.5471568", "0.54701537", "0.5465419", "0.5456232", "0.545417", "0.5451599", "0.5447691", "0.5442373", "0.54394805", "0.54244536", "0.5415595", "0.5412998", "0.54126257", "0.5410582", "0.5410225", "0.5409548" ]
0.0
-1
Opens a popup window (if a window with that ID isn't already open). After opening the window, you'll need to select it using the select_window command. This command can also be a useful workaround for bug SEL339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: open_window("", "myFunnyWindow").
def open_window url, window_id command 'openWindow', url, window_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def switch_to_window(id)\n driver.switch_to.window(id)\n end", "def wait_for_popup window_id, timeout\r\n command 'waitForPopUp', window_id||'null', timeout\r\n end", "def wait_for_popup window_id, timeout\r\n command 'waitForPopUp', window_id||'null', timeout\r\n end", "def ensure_open_window\n window_handles = @selenium.window_handles\n\n if window_handles.size == 0\n @javascript.run( 'window.open()' )\n @selenium.switch_to.window( @selenium.window_handles.last )\n else\n if window_handles.size > 1\n # Keep the first\n window_handles[1..-1].each do |handle|\n @selenium.switch_to.window( handle )\n @selenium.close\n end\n\n @selenium.switch_to.window( @selenium.window_handles.first )\n end\n\n @selenium.navigate.to 'about:blank'\n end\n\n @selenium.manage.window.resize_to( @width, @height )\n end", "def open_window(options = nil)\n window = terminal.make( :new => :terminal )\n window.launch_ :session => 'New session'\n end", "def new_window(name)\n execute_script(%(\n var w = Math.max(\n document.documentElement.clientWidth, window.innerWidth || 0\n );\n var h = Math.max(\n document.documentElement.clientHeight, window.innerHeight || 0\n );\n window.open(\"about:blank\", arguments[0], `width=${w},height=${h}`);\n ), name)\n end", "def select_window window_id\r\n command 'selectWindow', window_id||'null'\r\n end", "def select_window window_id\r\n command 'selectWindow', window_id||'null'\r\n end", "def switch_to_new_window(window)\t\r\n\t\t\t# Switch to new window\r\n\t\t\t#new_window = @driver.window_handles.last\r\n\t\t\t@driver.switch_to.window(window)\r\n\t\tend", "def open_window(options = nil)\n session_number = @konsole.currentSession\n session_object = @konsole_service.object(\"/Sessions/#{session_number}\")\n session_object.introspect\n session_object[\"org.kde.konsole.Session\"]\n end", "def window name, cwd, cmd\n raise NotImplementedError.new(\n \"window should be implemented to open new window\")\n end", "def click_open_openas_popup(title, open_file_path)\n click_button_saveas_or_openas_popup(title, open_file_path, \"&Open\")\nend", "def open_window(content, options={})\n window_setup\n key = nil\n if(options[:iframe])\n iframe = @context.url_for(options.delete(:iframe))\n end\n if(content.is_a?(Hash))\n if(content[:url])\n options[:iframe] = @context.url_for(content[:url])\n content = nil\n elsif(content[:content_url])\n options[:url] = @context.url_for(content[:content_url])\n content = nil\n else\n content = @context.render(content)\n end\n end\n options[:width] ||= 300\n options[:height] ||= 200\n modal = options[:modal]\n if(options[:on_close])\n options[:close] = options.delete(:on_close)\n end\n if(options[:iframe])\n key = :iframe\n elsif(options[:url])\n key = :url\n else\n key = store_content(content)\n end\n win = options.delete(:window) || \"win_#{rand(99999)}\"\n if(options.delete(:no_update))\n create_window(key, win, options)\n show_window(win, modal)\n else\n check_for_window(win, false) do\n update_window_contents(key, win, options)\n focus_window(win)\n end\n else_block do\n create_window(key, win, options)\n show_window(win, modal)\n end\n end\n nil\n end", "def new_tab\n execute_script('window.open();')\n window_handles.last\n end", "def open_window_with_action(win_name, action_name, *params)\n if LoadActions.include?(action_name) then\n raise(DesktopExceptions::UnsupportedActionException, \"Action #{action_name} not supported\")\n end\n \n wait_start\n opera_desktop_action(action_name, *params)\n wait_for_window_shown(win_name)\n end", "def open_window_with_action(win_name, action_name, *params)\n if LoadActions.include?(action_name) then\n raise(DesktopExceptions::UnsupportedActionException, \"Action #{action_name} not supported\")\n end\n\n wait_start\n opera_desktop_action(action_name, *params)\n wait_for_window_shown(win_name)\n end", "def switch_to_new_window\n $previous_window = $driver.window_handle\n $driver.switch_to.window($driver.window_handles.last)\nend", "def window_focus window_name\r\n command 'windowFocus', window_name\r\n end", "def open_window(options = nil)\n terminal_process.keystroke(\"n\", :using => :command_down)\n # Options of the first tab must be set before window options, \n # because change of the first tab options causes change of window size\n if options \n set_options(return_last_tab, allowed_options(:tab, options))\n set_options(active_window, allowed_options(:window, options))\n end\n return_last_tab\n end", "def window(name_or_handle)\n logger.info 'EyesTargetLocator.window()'\n logger.info 'Making preparaions...'\n on_will_switch.will_switch_to_window name_or_handle\n logger.info 'Done! Switching to window..'\n __getobj__.window name_or_handle\n logger.info 'Done!'\n driver\n end", "def new_popup_window(options, browser = \"ie\")\r\n raise \"not implemented\"\r\n end", "def window(id)\n if block_given?\n original = begin\n @bridge.window_handle\n rescue Error::NoSuchWindowError\n nil\n end\n\n unless @bridge.window_handles.include? id\n raise Error::NoSuchWindowError, \"The specified identifier '#{id}' is not found in the window handle list\"\n end\n\n @bridge.switch_to_window id\n\n begin\n returned = yield\n ensure\n current_handles = @bridge.window_handles\n original = current_handles.first unless current_handles.include? original\n @bridge.switch_to_window original\n returned\n end\n else\n @bridge.switch_to_window id\n end\n end", "def open_window_deprecated(options={})\n frame_url = options.has_key?(:iframe) ? url_for(options.delete(:iframe)) : nil\n window_url = options.has_key?(:url) ? url_for(options.delete(:url)) : nil\n method = options.delete(:method) || 'get'\n delay = options.delete(:delay) || 0.5\n delay = delay * 1000\n url = open_window_path(\n :window_url => window_url,\n :iframe_url => frame_url,\n :window_options => options\n ).html_safe\n javascript_tag{\n \"setTimeout(function(){\n jQuery.#{method}('#{url}');\n }, #{delay.to_i});\".html_safe\n }\n end", "def window(name)\n Tk.execute_only(:tkwait, :window, name)\n end", "def open_team_turn_window\n @team_turn_window.open\n end", "def new_tab\n @session.open_new_window\n rescue Capybara::WindowError => e\n new_tab_via_link\n end", "def click_open_file_dialog_popup(title)\n click_button_popup(title, \"&Open\")\nend", "def get_window_object()\n driver.manage.window\nend", "def open_in_browser\n puts url\n `#{open} #{url}`\n end", "def get_window_object()\n driver.manage.window\nend", "def open_dialog_with_click(method, selector, win_name)\n wait_start\n OperaWatir::WebElement.new(self, method, selector).click\n wait_for_window_shown(win_name)\n end", "def open_dialog_with_click(method, selector, win_name)\n wait_start\n OperaWatir::WebElement.new(self, method, selector).click\n wait_for_window_shown(win_name)\n end", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n `open #{url}`\n else\n # Ubuntu\n `xdg-open #{url}`\n end\n end\n end\n end", "def open_input_window\n @input_window.open\n end", "def switch_to_window(loc)\n if loc[0..3] == 'url=' or loc[0..5] == 'title='\n @browser.window(parse_location(loc)).use\n else\n # assume loc is an integer\n # since Robot Framework sends all args as text, the above check for\n # \"url=\" and \"title=\" is the best we can do to ensure argument correctness\n loc = loc.to_i\n # the number of the window\n # user-facing numbers are 1-based, internal we use 0-based because @browser.windows\n # is a Ruby array, so minus 1\n @window_id = loc - 1\n if @window_id == -1\n # either the user has been too smart for his/her own good and thinks the windows are 0-based,\n # or they've entered text that doesn't match 'url=' or 'title=', in which case\n # the above loc.to_i will make loc equal 0\n raise(ArgumentError, \"You must provide the url or title of the window in the format 'url=' or 'title=', or you must provide the number of the window, starting with 1 for the first window opened.\")\n end\n # this will throw its own error if the index is out of range\n @browser.windows[loc].use\n end\n end", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n run \"open #{url}\"\n else\n # Ubuntu\n run \"xdg-open #{url}\"\n end\n end\n end\n end", "def switch_to_other_window\n @window_id = (@window_id - 1).abs\n if @window_id != 0 and @window_id !=1\n puts @window_id\n raise(Exception::WindowMatchError, \"You cannot use this keyword when more than 2 windows are open; you must use 'Switch To Window', 'Switch to Next Window', or 'Switch to Previous Window'\")\n end\n\n @browser.windows[@window_id].use\n end", "def open_window_with_key_press(win_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_shown(win_name)\n end", "def open_window_with_key_press(win_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_shown(win_name)\n end", "def open_dialog_with_url(dialog_name, url)\n wait_start\n opera_desktop_action(\"Open url in new page\", url)\n # The loading of the page will happen first then the dialog will be shown\n wait_for_window_shown(dialog_name)\n end", "def open_dialog_with_url(dialog_name, url)\n wait_start\n opera_desktop_action(\"Open url in new page\", url)\n # The loading of the page will happen first then the dialog will be shown\n wait_for_window_shown(dialog_name)\n end", "def switch_to_window_by_title window_title\n $previous_window = $driver.window_handle\n window_found = false\n $driver.window_handles.each{ |handle|\n $driver.switch_to.window handle\n if $driver.title == window_title\n window_found = true\n break\n end\n }\n raise \"Window having title \\\"#{window_title}\\\" not found\" if not window_found\nend", "def browser_open_linux(url)\n system(\"xdg-open\", url)\n end", "def show_window(win, modal)\n modal ||= false\n check_for_window(win) do\n window(win) << \".dialog('option', 'modal', #{format_type_to_js(modal)});\"\n window(win) << \".dialog('option', 'autoOpen', true);\"\n window(win) << '.dialog(\"open\");'\n end\n nil\n end", "def open_command\n if darwin?\n 'open'\n elsif windows?\n 'start'\n else\n 'xdg-open'\n end\n end", "def switch_to_main_window\n $previous_window = $driver.window_handle\n $driver.switch_to.window($driver.window_handles.first)\nend", "def get_window_for_target(target_id: nil)\n {\n method: \"Browser.getWindowForTarget\",\n params: { targetId: target_id }.compact\n }\n end", "def launch_browser(url)\n case RUBY_PLATFORM\n when /darwin/\n system \"open\", url\n when /mswin|mingw|cygwin/\n system \"start\", url\n else\n system \"xdg-open\", url\n end\n end", "def open_window\n terminal_process.keystroke(\"n\", :using => :command_down)\n return_last_tab\n end", "def within_new_window_by(action: nil, url: nil)\n case\n when action\n opened_window = window_opened_by { action.call }\n within_window(opened_window) do\n yield\n current_window.close\n end\n when url\n within_window(open_new_window) do\n visit(url)\n\n yield\n current_window.close\n end\n else\n raise \"Specify action or url\"\n end\n end", "def focus_window(win=nil)\n window(win) << '.dialog().dialog(\"focus\");'\n nil\n end", "def open_new_page(url)\n $verbose ? puts(\"opening new page: #{url}\") : nil\n @driver.execute_script('window.open()')\n @driver.switch_to.window(@driver.window_handles.last)\n sleep(1)\n @driver.get(url)\n end", "def js_popup(options = {})\n o = {\n :width => 320,\n :height => 240,\n :title => 'Popup',\n :resizable => false,\n :scrollbars => false,\n }.merge(options)\n\n poptions = (o[:resizable] ? 'resizable=yes,' : 'resizable=no,')\n poptions << (o[:scrollbars] ? 'scrollbars=yes' : 'scrollbars=no')\n \n uri = o[:url] || o[:uri]\n \n %[javascript: var pwl = (screen.width - #{o[:width]}) / 2; var pwt = (screen.height - #{o[:height]}) / 2; window.open('#{uri}', '#{o[:title]}', 'width=#{o[:width]},height=#{o[:height]},top='+pwt+',left='+pwl+', #{poptions}'); return false;\"] \n end", "def close_new_window\n $driver.close\nend", "def window(title, timeout = 0)\n timeout = 30 if timeout == 0\n $webdriver.switch_to.default_content \n if not $marathon.windowMatchingTitle(title)\n bmark = MyBenchMark.new\n bmark.report(\"Waiting for window '\" + title + \"'\") {\n wait = Wait.new(:timeout => timeout, :message => \"Waiting for window '\" + title + \"'\")\n begin\n wait.until {\n waitSucceeded = false\n $webdriver.window_handles.each { |h|\n $webdriver.switch_to.window(h) unless waitSucceeded\n waitSucceeded = true if $marathon.windowMatchingTitle(title)\n }\n waitSucceeded\n }\n ensure\n bmark.close\n end\n }\n end\n $marathon.current_search_context = $webdriver\n $marathon.namingStrategy.setTopLevelComponent($marathon.getDriverAsAccessor())\n $marathon.context_handles.clear\n $marathon.context_handles.push( Proc.new { \n $marathon.current_search_context = $webdriver\n $marathon.namingStrategy.setTopLevelComponent($marathon.getDriverAsAccessor())\n } )\nend", "def current_window\n @driver.window_handle\n rescue Selenium::WebDriver::Error::NoSuchWindowError\n nil\n end", "def window\n @window || create_window\n end", "def close_window(close_loc = :current, active_loc = nil)\n if @browser.windows.count == 1\n # doesn't matter what they enter, bc closing the only window of a browser\n # instance causes the browser to crash\n @browser.close\n end\n\n\n if close_loc == :current\n # if the current window is being closed, we have to move to another before closing it\n if active_loc.nil?\n # if new active window is unspecified, make the previous window the new active one\n self.switch_to_previous_window\n else\n self.switch_to_window(active_loc)\n end\n else\n # a specific window to be closed has been specified (though it may still be the active one)\n if close_loc[0..3] == 'url=' or close_loc[0..5] == 'title='\n if @browser.window(parse_location(close_loc)).current?\n # if the current window is being closed, we have to move to another before closing it\n if active_loc.nil?\n # if new active window is unspecified, make the previous window the new active one\n self.switch_to_previous_window\n else\n self.switch_to_window(active_loc)\n end\n end\n @browser.window(parse_location(close_loc)).close\n else\n # assume close_loc is an integer\n # since Robot Framework sends all args as text, the above check for\n # \"url=\" and \"title=\" is the best we can do to ensure argument correctness\n close_loc = close_loc.to_i\n # the number of the window\n # user-facing numbers are 1-based, internal we use 0-based because @browser.windows\n # is a Ruby array, so minus 1\n window_id = close_loc - 1\n if window_id == -1\n # either the user has been too smart for his/her own good and thinks the windows are 0-based,\n # or they've entered text that doesn't match 'url=' or 'title=', in which case\n # the above loc.to_i will make loc equal 0\n raise(ArgumentError, \"You must provide the url or title of the window in the format 'url=' or 'title=', or you must provide the number of the window, starting with 1 for the first window opened.\")\n end\n \n if @browser.windows[window_id].current?\n # if the current window is being closed, we have to move to another before closing it\n if active_loc.nil?\n # if new active window is unspecified, make the previous window the new active one\n self.switch_to_previous_window\n else\n self.switch_to_window(active_loc)\n end\n end\n # this will throw its own error if the index is out of range\n @browser.windows[window_id].close\n end\n end\n end", "def switch_to_previous_window\n $driver.switch_to.window $previous_window\nend", "def new_window\n @manifest_options[:new_window]\n end", "def open_in_browser\n link = \"http://www.bandsintown.com/cities/pittsburgh-pa\"\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n system \"start #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n system \"open #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system \"xdg-open #{link}\"\n end\n end", "def window_by_id(id)\n @windows.ID(id)\n end", "def window_by_id(id)\n @windows.ID(id)\n end", "def window_by_id(id)\n @windows.ID(id)\n end", "def select_next_window(num = 1)\n @server.invoke_command \"select-window -t #{identifier}:+#{num}\"\n current_window\n end", "def popup(name)\n win = Browser.new(@browser_type, @browser_process_name, @proxy_host, @proxy_port)\n\n win.proxy_host = @proxy_host\n win.proxy_port = @proxy_port\n win.sahisid = @sahisid\n win.print_steps = @print_steps\n win.popup_name = name\n win.domain_name = @domain_name\n win\n end", "def within_modal\n convert_modal_to_window = %{\n window.showModalDialog = function(sURL, vArguments, sFeatures) {\n window.dialogArguments = vArguments;\n modalWin = window.open(sURL, 'modal', sFeatures);\n return modalWin;\n }\n }\n browser.execute_script(convert_modal_to_window)\n yield if block_given?\n end", "def open_random\n Defcli.open_in_browser random_url(:api => false)\n end", "def open_command\n darwin? ? 'open' : 'xdg-open'\n end", "def window_name(win_id)\n driver.getQuickWindowName(win_id)\n end", "def popup(name)\n win = Browser.new(@browser_type, @proxy_port)\n\n win.proxy_host = @proxy_host\n win.proxy_port = @proxy_port\n win.sahisid = @sahisid\n win.print_steps = @print_steps\n win.popup_name = name\n win.domain_name = @domain_name\n win\n end", "def browser_open_darwin(url)\n system(\"open\", \"-a\", \"chrome\", url)\n end", "def focus(window)\n WIN[:focus].call window\n end", "def focus(window)\n WIN[:focus].call window\n end", "def raise\n # Unsure of the proper tool to use here. \"windowactivate\" seems to work.\n xdotool \"windowactivate #{@id}\"\n sleep $sleep_time\n end", "def switch_to_next_window\n @window_id += 1\n if @window_id >= @browser.windows.count\n # wrap back to the first\n @window_id = 0\n end\n\n @browser.windows[@window_id].use\n end", "def window_handle\n driver.window_handle\n end", "def set_window\n @window = Window.find(params[:id])\n end", "def set_window\n @window = Window.find(params[:id])\n end", "def activate_window(title)\n append_to_script \"activate_window \\\"#{title}\\\"\"\n end", "def switch_window\n current_window = window\n wins = windows\n wait_until { (wins = windows) && wins.size > 1 } if wins.size == 1\n raise StandardError, 'Unable to determine which window to switch to' if wins.size > 2\n\n wins.find { |w| w != current_window }.use\n window\n end", "def get_window_name(win_id)\n @driver.getWindowName(win_id)\n end", "def open_alert_window(msg, options={})\n options[:width] ||= 200\n options[:modal] = true\n options[:title] ||= 'Alert!'\n options[:buttons] ||= {'OK' => 'function(){ jQuery(this).dialog(\"close\");}'}\n store_content(msg, 'alert_modal');\n self << \"\n if(jQuery('#alert_modal').size() == 0){\n jQuery('<div id=\\\"alert_modal\\\"></div>')\n .html(window_rails_contents['alert_modal'])\n .dialog(#{format_type_to_js(options)});\n } else {\n jQuery('#alert_modal')\n .html(window_rails_contents['alert_modal'])\n .dialog(#{format_type_to_js(options)}).focus();\n }\"\n nil\n end", "def wait_for_modal_open(id)\n # sanity check in case modal has already opened and closed - if no modal opens in 10 seconds then exit and continue\n i = 0\n while @driver.execute_script(\"return OPEN_MODAL\") == ''\n if i == 30\n $verbose ? puts(\"Exiting wait_for_modal_open(#{id}) after 30 seconds - no modal open\") : nil\n return true\n else\n sleep(1)\n i += 1\n end\n end\n $verbose ? puts(\"current open modal: #{@driver.execute_script(\"return OPEN_MODAL\")}\") : nil\n # need to wait until modal is in the page and has completed opening\n @wait.until {@driver.execute_script(\"return OPEN_MODAL\") == id}\n $verbose ? puts(\"requested modal #{id} now open\") : nil\n true\n end", "def open_tab(options = nil)\n current_terminal.launch_ :session => 'New session'\n end", "def load_browser_tab(url:)\n @browser.execute_script('window.open()')\n @browser.windows.last.use\n @browser.goto(url)\n end", "def open(url = @url)\n @browser.goto(url)\n wait_for_page_to_load\n end", "def open_info_window(msg, options={})\n options[:width] ||= 200\n options[:modal] = true\n options[:title] ||= 'Information'\n options[:close_on_escape] = false\n store_content(msg, 'information_modal')\n self << \"\n if(jQuery('#information_modal').size() == 0){\n jQuery('<div id=\\\"information_modal\\\"></div>')\n .html(window_rails_contents['information_modal'])\n .dialog(#{format_type_to_js(options)});\n } else {\n jQuery('#information_modal')\n .html(window_rails_contents['information_modal'])\n .dialog(#{format_type_to_js(options)}).focus();\n }\"\n nil\n end", "def focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def open_url(url)\n url = NSURL.URLWithString(url) unless url.is_a?(NSURL)\n NSWorkspace.sharedWorkspace.openURL(url)\n end", "def open(*args)\n cmd = RUBY_PLATFORM.match(/darwin/) ? 'open' : 'xdg-open'\n open_with(cmd, *args)\n end", "def real_focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_sane_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def click_run_file_dialog_popup(title)\n click_button_popup(title, \"&Run\")\nend", "def open_contract_window(contract_id, opts = {})\n open_contract_window_with_http_info(contract_id, opts)\n return nil\n end", "def go()\n\t@selenium.open @url\n end", "def open_and_wait( location)\n selenium.open(location)\n wait_for_page_to_load\n end", "def open_url(url)\n unless url.is_a?(NSURL)\n url = NSURL.URLWithString(url)\n end\n NSWorkspace.sharedWorkspace.openURL(url)\n end", "def auto_link_new_window(text)\n auto_link(text, :html => {:target => '_blank'})\n end", "def close_other_window\n @window_id = (@window_id - 1).abs\n if @window_id != 0 and @window_id !=1\n raise(Exception::WindowMatchError, \"You cannot use this keyword when more than 2 windows are open; you must use 'Switch To Window', 'Switch to Next Window', or 'Switch to Previous Window'\")\n end\n\n @browser.windows[@window_id].close\n end", "def active_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_active @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end" ]
[ "0.69990504", "0.6681354", "0.6681354", "0.66316944", "0.65099555", "0.6451773", "0.6411729", "0.6411729", "0.6404836", "0.62769806", "0.62484086", "0.6238764", "0.621939", "0.6118268", "0.6080029", "0.6063865", "0.60496545", "0.6017028", "0.60162187", "0.59910357", "0.59667313", "0.5904698", "0.58983713", "0.585736", "0.58571696", "0.5824393", "0.5817824", "0.5811159", "0.58074147", "0.58016914", "0.5792171", "0.5792171", "0.5789643", "0.5779029", "0.57609856", "0.57579815", "0.5749442", "0.56887245", "0.56887245", "0.56874317", "0.56874317", "0.5672814", "0.56655556", "0.56475466", "0.5643358", "0.5633711", "0.563184", "0.5612472", "0.5581265", "0.5566298", "0.55393755", "0.55244887", "0.5506953", "0.54730403", "0.54712343", "0.54482114", "0.5439239", "0.541017", "0.53978443", "0.5393128", "0.5368998", "0.5361533", "0.5361533", "0.5361533", "0.5357053", "0.5348174", "0.53479415", "0.5347359", "0.5345692", "0.5310103", "0.5282002", "0.52642065", "0.525476", "0.525476", "0.52517337", "0.5251419", "0.5243136", "0.5199492", "0.5199492", "0.5198542", "0.5192233", "0.5183597", "0.51679367", "0.51527387", "0.5148013", "0.5134781", "0.51277965", "0.5122655", "0.51074", "0.5095253", "0.50945115", "0.5090746", "0.5089345", "0.5088887", "0.50871295", "0.50850326", "0.5079959", "0.50722456", "0.506777", "0.5065892" ]
0.81492454
0
Wait for the specified amount of time (in milliseconds).
def pause wait_time command 'pause', wait_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait(seconds)\n @waiting = seconds * 1000\n end", "def wait(timeout, &block)\n end_time = @end_time || (current_time + timeout)\n loop do\n yield(block)\n @remaining_time = end_time - current_time\n break if @remaining_time.negative?\n end\n end", "def brute_wait(delay)\n sleep(delay)\n end", "def wait_for_seconds\n\t\tsleep(1 * rand + 1)\n\tend", "def wait(sec = 5)\n Logbook.message(\"Waiting #{sec} sec >>\" + \"\\n\")\n sec.instance_of?(Integer) ? sleep(sec) : Logbook.message(\"Waiting time is not integer: [#{sec}]\" + \"\\n\")\n end", "def wait(time)\n if time.kind_of?(ExperimentProperty)\n duration = time.value\n else\n duration = time\n end\n info \"Request from Experiment Script: Wait for #{duration}s....\"\n Kernel.sleep duration\n end", "def wait_until(timeout=10, &block)\n time = Time.now\n success = false\n until success\n if (Time.now - time) >= timeout\n raise \"Waited for #{timeout} seconds, but block never returned true\"\n end\n sleep 0.5\n success = yield\n end\n end", "def wait(seconds) \r\n\t\texec(\"Wait\", seconds.to_s)\r\n\tend", "def msleep( msec )\n NSThread.sleepForTimeInterval(msec / 1000.0)\n end", "def wait_async(time)\n EM::Synchrony.sleep(time)\nend", "def wait_for(wait_max: 3, step: 0.001, &block)\n stop_at = wait_max.seconds.from_now\n\n sleep step while !block.call && (@time = Time.now) < stop_at\n\n fail \"Timeout of #{wait_max} seconds exceeded!\" unless @time < stop_at\nend", "def wait_for(seconds = timeout)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\n end", "def wait\n sleep 0.0001\n end", "def abs_wait_short\n wait(15)\n end", "def wait(timeout = nil)\n @latch.wait(timeout)\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def wait!\n sleep(@sleep)\n end", "def wait_for(seq,timeout=1)\n begin\n ::Timeout.timeout(timeout) do\n wait(seq)\n end\n rescue ::Timeout::Error\n end\n end", "def wait(seconds)\n sleep(seconds)\n\n self\n end", "def wait(duration, value)\n for i in 0...duration\n @wait_time += 1 if value == false\n @wait_time2 += 1 if value\n break if i >= duration / 2\n end\n end", "def wait(duration, value)\n for i in 0...duration\n @wait_time += 1 if value == false\n @wait_time2 += 1 if value\n break if i >= duration / 2\n end\n end", "def wait_until(timeout=20, &block)\n time_to_stop = Time.now + timeout\n until yield do\n sleep(0.1) # much less cpu stress\n break if Time.now > time_to_stop\n end\nend", "def wait(duration)\n info \"Request from Experiment Script: Wait for #{duration}s....\"\n warn \"Calling 'wait' or 'sleep' will block entire EC event loop. Please try 'after' or 'every'\"\n sleep duration\n end", "def timeout_after(time); end", "def wait(duration)\n for i in 0...duration\n update_basic(false, true, true)\n end\n end", "def wait\n return if @timers.empty?\n\n interval = wait_interval\n sleep interval if interval >= Timer::QUANTUM\n fire\n end", "def wait(timeout=60)\n countdown = timeout.to_f\n\n while countdown > 0\n if @zmq_thread and @zmq_thread.alive?\n sleep 0.1\n countdown = countdown - 0.1\n else\n break\n end\n end\n\n super()\n end", "def wait(duration, variable)\n for i in 0...duration\n @wait_time += 1 if variable\n @wait_time_thirst if variable == false \n break if i >= duration / 2\n end\n end", "def wait_for(seconds)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\nend", "def wait_until times: 5, delay: 1, &condition\n times.times do\n return if condition.call\n sleep delay\n end\n raise \"Condition not met. Waited #{times} times with #{delay} sec delay\"\n end", "def wait\n sleep WAIT_TIME unless @skip_wait\n end", "def sleep(n)\n Kernel.sleep(n)\n end", "def sleep(timeout = nil)\n unlock\n begin\n timeout ? Kernel.sleep(timeout) : Kernel.sleep\n ensure\n lock\n end\n end", "def wait\n @timer_thread.join\n end", "def wait(duration)\n for i in 0...duration\n update_basic\n end\n end", "def wait(time, increment = 1, elapsed_time = 0, &block)\n begin\n yield\n rescue Exception => e\n if elapsed_time >= time\n raise e\n else\n sleep increment\n wait(time, increment, elapsed_time + increment, &block)\n end\n end\nend", "def wait timeout: 3, &block\n wait = Selenium::WebDriver::Wait.new timeout: timeout\n wait.until(&block)\nend", "def sleep(dur=0) end", "def sleep(seconds)\n task = start(Tasks::Timeout.new(delay: seconds), explicit_start: true)\n wait task.stop_event\n end", "def sleep(time)\n dt = @clock + time\n\n due_to_clock = dt<=>@clock\n raise 'Time is out of range' if due_to_clock < 0\n\n @clock = dt\n end", "def wait!\n now = Time.now.utc.to_i\n duration = (reset.to_i - now) + 1\n\n sleep duration if duration >= 0\n\n yield if block_given?\n\n duration\n end", "def wait_for_launching\n sleep @delay\n end", "def wait(timeout = nil)\n synchronize do\n touch\n # TODO interruptions ?\n super timeout if incomplete?\n self\n end\n end", "def wait_until(timeout = 30, retry_interval = 0.1, &block)\n start = Time.now\n while (result = !block.call)\n break if (Time.now - start).to_i >= timeout\n sleep(retry_interval)\n end\n !result\nend", "def checkTimeout_Flooding()\n\tsleep(2);\n\tputs \"time out!\";\n\n\nend", "def click_wait(locator, sec, _arg = nil)\n click_on(locator)\n wait(sec)\n end", "def delay(seconds)\n sleep(seconds)\n end", "def sleep(timeout)\n @sleeper.sleep(timeout)\n loop do\n next_waitable = @condition_variable.next_waitable_to_wake\n break if next_waitable == self\n next_waitable.wait_until_resumed\n end\n end", "def delay(x=1) \n current_time = Time.now.to_i\n while Time.now.to_i - current_time < x \n\tend\nend", "def wait_until timeout=10, &block\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until &block\nend", "def wait_for(timeout = 30, &block)\n start = Time.now\n while true\n raise RuntimeError, \"Timed out waiting for event\" if Time.now - start > timeout\n\n break if yield\n\n sleep(0.1)\n end\n end", "def wait(timeout = nil)\n raise_unless_locked!\n return false if timeout && timeout < 0\n @cv.wait(@lock, timeout)\n end", "def wait\n loop do sleep 1 end\n end", "def sleep_after(seconds)\n write_bytes(27, 56, seconds)\n end", "def sleep_some_time\n sleep 1\n end", "def wait(timeout = nil)\n event.wait(timeout) if timeout != 0 && incomplete?\n self\n end", "def wait_for_host(seconds=5)\n platform.wait_for_host(seconds)\n end", "def delay(seconds); end", "def delay(seconds); end", "def wait timeout = nil\n @mutex.synchronize {\n if @cnt != 0\n if timeout\n @cond_var.wait @mutex, timeout\n else\n @cond_var.wait @mutex\n end\n end\n }\n end", "def sleep_until(time, pulse = 1)\n time.times do\n break if block_given? && yield\n sleep(pulse)\n end\n end", "def sleep_until(timeout = QUE_SLEEP_UNTIL_TIMEOUT)\n deadline = Time.now + timeout\n loop do\n break if yield\n if Time.now > deadline\n puts \"sleep_until timeout reached!\"\n raise \"sleep_until timeout reached!\"\n end\n sleep 0.01\n end\nend", "def delay\n sleep(2)\n end", "def wait_second\n now = Time.now.to_i\n # p [ 'wait_second', now, $lastpage ]\n unless @lastpage.nil?\n if now <= @lastpage + 2\n sleep 2\n now = Time.now.to_i\n end\n end\n @lastpage = now\n end", "def wait(timeout = nil)\n\t\t\tbegin\n\t\t\t\t@queue.wait(timeout)\n\t\t\trescue DRb::DRbConnError\n\t\t\tend\n\t\tend", "def wait_and_proceed\n Thread.new do\n sleep TIMEOUT\n proceed\n end\n end", "def wait_until(msg, timeout_at, sleep_time = 10, options = {})\n logger = options.fetch(:logger, nil)\n\n done = block_given? ? yield : false\n\n while Time.now.to_i < timeout_at && !done do\n done = block_given? ? yield : false\n\n unless done\n logger ? logger.info(msg) : puts(msg)\n sleep(sleep_time)\n end\n end\n\n done\n end", "def wait(per = nil)\n @target += per || @period\n error = @target - Time.now\n sleep error if error > 0\n true\n end", "def wait\n @wait.synchronize do\n sleep 1 while @count >= THREAD_MAX\n @count += 1\n end\n end", "def delay(time, &b)\n time = time.to_a.sample unless time.is_a? Integer\n EM.add_timer(time, &b)\n end", "def wait_until_not_full; end", "def wait_for_element(id, name, time)\n wait = Selenium::WebDriver::Wait.new(:timeout => time)\n wait.until {@driver.find_element(id => name) }\nend", "def wait_until_with_buffer(args, &block)\n original_timeout = args[:timeout] || ENV['WAIT_TIMEOUT'].to_i\n args_buffered = args.dup\n\n args_buffered[:timeout] = 60\n\n start_time = Time.now\n Frank::Cucumber::WaitHelper.wait_until(args_buffered) { block.call() }\n end_time = Time.now\n\n delta = end_time - start_time\n puts(\"wait_until exceeded timeout #{original_timeout}. Took #{delta}. #{caller[0]}\") if delta > original_timeout\nend", "def wait_for(params={})\n timeout = params[:timeout] || default_wait_for_time\n message = params[:message] || \"Timeout exceeded\"\n context = Context.new(message)\n begin_time = time_class.now\n while (time_class.now - begin_time) < timeout\n return if yield(context)\n sleep 0.25\n end\n flunk(context.message + \" (after #{timeout} sec)\")\n end", "def wait(timeout: nil)\n if connected?\n client.wait(timeout: timeout)\n else\n wait_connection_attempt_result(timeout: timeout)\n end\n end", "def delay_1() sleep(3) end", "def wait_for_element_to_be_visible(id, name, time)\n begin\n wait = [60, time].max\n element = get_element(id, name)\n !wait.times {\n break if element.displayed?\n sleep 1\n }\n rescue\n end\nend", "def wait(timeout=10)\n Selenium::WebDriver::Wait.new(:timeout => timeout)\n end", "def implicit_wait=(seconds); end", "def sleep_millis(millis)\n sleep(Duration.from_millis(millis))\n end", "def wait_for_condition(timeout)\n deadline = Process.clock_gettime(Process::CLOCK_MONOTONIC) + timeout\n loop do\n break if yield ||\n Process.clock_gettime(Process::CLOCK_MONOTONIC) > deadline\n\n sleep 1\n end\n end", "def sleep seconds\n w = Fiber.current.worker\n dt = Time.now.to_i\n f = Finishable.new do\n return (Time.now.to_i - dt) >= seconds\n end\n wait_for f\n end", "def untilTimeout()\n return Timer.timeRemaining(@name)\n end", "def timeout(ms = 0)\n `setTimeout(function(){#{yield}},#{ms})`\n end", "def wait\n 0\n end", "def wait_for(timeout = DEFAULT_TIMEOUT)\n Selenium::WebDriver::Wait.new(:timeout => timeout).until {yield}\nend", "def wait\n @t.each{|t| t.join}\n end", "def wait_for_element(element, timeout)\n element.when_present timeout\n element.when_visible timeout\n sleep Utils.click_wait\n end", "def sleep\n sleep_after(0)\n end", "def on_timeout(options = {})\n timeout = options[:timeout] || 0.5\n\n sleep timeout\n\n yield\n end", "def wait!\n wait\n raise @error if timeout?\n @messages\n end", "def wait_to_animate(wait_time, element_to_animate)\n\t\twait_for(:timeout => wait_time) { query(\"* marked:'#{element_to_animate}'\").size > 0 }\n\tend", "def wait(timeout = 0)\n Window.wait(@title, @text, timeout)\n end", "def wait_until\n require \"timeout\"\n Timeout.timeout(Capybara.default_wait_time + 5) do\n sleep(0.1) until value = yield\n value\n end\n end", "def lock_for(duration)\n @mutex.synchronize { sleep duration }\n end", "def countdown(wait_time)\n\t\t@printer.print(wait_time.to_s + \" seconds left\\n\")\n\n\t\twait_time.downto(1).each do |time_left|\n\t\t\tsleep 1\n\t\t\t@printer.print(time_left.to_s + \" seconds left\\n\") if (((time_left % 60) == 0) && time_left != wait_time);\n\t\tend\n\n\t\t@printer.print(\"Finished waiting\")\n\tend", "def wait(frames)\n return if @wait > 0\n @wait = frames\n end", "def wait_until_without_failing(timeout=UI_UPDATE_DELAY)\n start = Time.now\n while ((Time.now - start) <= timeout)\n break if yield\n sleep(WaitHelpers::LOOP_DELAY)\n end\nend", "def delay(time)\n @context.backend.delay(time)\n end" ]
[ "0.773617", "0.74005187", "0.7322458", "0.7275752", "0.7269518", "0.71708983", "0.7170409", "0.71445405", "0.71216816", "0.7063904", "0.7045436", "0.7031939", "0.6984108", "0.69810474", "0.6970102", "0.6955069", "0.6955069", "0.69401044", "0.6862873", "0.6842004", "0.68379873", "0.68379873", "0.68363917", "0.6825782", "0.68227625", "0.68209666", "0.6818684", "0.6816068", "0.6805403", "0.67918175", "0.6789205", "0.6778213", "0.67322564", "0.6726447", "0.6719704", "0.67191803", "0.6717313", "0.66746545", "0.66468114", "0.66364", "0.66124684", "0.658325", "0.65703154", "0.6557859", "0.6516487", "0.65101236", "0.6489587", "0.6487412", "0.648465", "0.64506537", "0.6440458", "0.64300185", "0.64167744", "0.6370166", "0.6361201", "0.63601357", "0.63466275", "0.6328174", "0.6324635", "0.6324635", "0.6321577", "0.6321509", "0.63126725", "0.629681", "0.6296352", "0.62691504", "0.6269059", "0.62598175", "0.625816", "0.62520415", "0.6250901", "0.62465155", "0.62419933", "0.6220694", "0.62088764", "0.6205193", "0.61901456", "0.61889243", "0.61819375", "0.6180385", "0.61759007", "0.61732", "0.6159263", "0.61450505", "0.61430013", "0.6140467", "0.61355937", "0.6134923", "0.61271703", "0.61267185", "0.6126679", "0.61241347", "0.61229676", "0.6119745", "0.61100584", "0.61050737", "0.6097032", "0.60939485", "0.6081009", "0.6080174" ]
0.6418842
52
Unselects all of the selected options in a multiselect element.
def remove_all_selections locator command 'removeAllSelections', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_multi_option_select(how, what)\n select_element=$driver.find_element(how, what)\n select_element.find_elements(:tag_name, \"option\").each do |option|\n if option.selected?\n option.toggle\n end\n end\n end", "def unselect *params\n opt = parse_params_for_select params\n return @adapter.unselect(opt)\n end", "def deselect_all\n map(&:deselect).all?\n end", "def unselect; end", "def deselect_item\n @selected = nil\n\n items\n end", "def deselect\n execute_only(:deselect)\n end", "def clearSelection\r\n assert_exists\r\n #highlight( :set)\r\n wait = false\r\n @o.each do |selectBoxItem|\r\n if selectBoxItem.selected\r\n selectBoxItem.selected = false\r\n wait = true\r\n end\r\n end\r\n @o.wait if wait\r\n #highlight( :clear)\r\n end", "def deselect\n select(0, 0)\n end", "def clear_selection\n return if @selected_indices.nil? || @selected_indices.empty?\n arr = @selected_indices.dup # to un highlight\n @selected_indices.clear\n arr.each {|i| @obj.fire_row_changed(i) }\n @selected_index = nil\n @old_selected_index = nil\n # User should ignore first two params\n lse = ListSelectionEvent.new(0, arr.size, @obj, :CLEAR)\n @obj.fire_handler :LIST_SELECTION_EVENT, lse\n arr = nil\n end", "def reset_options_for_select\n Specification.reset_options_for_select\n end", "def uncheck_all_checkboxes(count, id)\n Log.logger.info(\"Unchecking all '#{count}' options in the checkbox\")\n count.times {|i|\n i += 1\n check = @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).selected?\n if(check == true)\n @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).click\n end\n }\n end", "def select_multiple(*values)\n clear\n values.flatten.each{ |value| select(value) }\n end", "def selection_clear\n execute_only(:selection, :clear)\n end", "def clear_selection_from_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).clearSelection\nend", "def unselect_values values\n return unless values\n values.each do |val|\n row = @list.index val\n remove_row_selection_interval row, row unless row.nil?\n end\n end", "def deselectplugin(browser)\n browser.checkbox(:id,\"plugins-select-all\").clear\nend", "def clear_options\r\n\t\tself.option_values.clear\r\n\tend", "def toggle_multiple_selection\n toggle_value :multiple_selection\nend", "def unselected\n @unselected ||= @cache.reject { |i,s,c| s }\n end", "def onSelectedRemoved(*args)\n onSelectionRemoved(*args)\n end", "def remove_all(*args)\n set_option_value(:remove_all, true, *args)\n end", "def ask_unselect prompt=\"Enter selection pattern: \"\n ret = get_string prompt\n return if ret.nil? || ret == \"\"\n indices = get_matching_indices ret\n return if indices.nil? || indices.empty?\n indices.each { |e|\n # will not work if single select !! FIXME\n remove_row_selection_interval e,e\n }\n end", "def unselect(index)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_unselect(@handle.ptr, index)\n end", "def clear_selection()\n @last_pos = nil\n @selection = nil\n end", "def remove_selected\n case @selected\n when Stroke\n remove_stroke(@selected)\n when ToyInScene\n remove_toy(@selected)\n end\n end", "def uncheck_checkbox(checkBoxName, values = nil)\r\n elements = find_checkboxes_by_name(checkBoxName)\r\n \r\n if values\r\n values.class == Array ? arys = values : arys = [values] \r\n arys.each { |cbx_value|\r\n elements.each do |elem|\r\n elem.click if elem.attribute('value') == cbx_value && elem.selected?\r\n end\r\n }\r\n else\r\n the_checkbox = elements[0] \r\n the_checkbox.click if the_checkbox.selected?\r\n end\r\n end", "def unselect\n @unselect || \"future\"\n end", "def click_un_mute_all\n logger.debug 'Clicking the un-mute checkbox'\n wait_for_load_and_click un_mute_all_cbx_element\n end", "def post_select(model, iter, mc)\n model.remove(iter.first_child)\n end", "def unselect_place\n @selected_place = nil;\n end", "def remove_selected_option(option)\n if new_record?\n self.selected_options = build_selected_options\n else\n update_column(:selected_options, build_selected_options(vote_proposal_options - [option]))\n end\n end", "def selected_options\n options.select(&:selected?)\n end", "def trim_branches\n @selection = Downup::Base.new(\n options: branch_options,\n type: :multi_select,\n multi_select_selector: multi_select_selector,\n selected_color: selected_color,\n header_proc: header_proc\n ).prompt\n\n delete_branches_confirmation\n @selection\n end", "def define_selected!(array)\r\n array.each do |o|\r\n unless(o.respond_to?(:selected?))\r\n def o.selected?\r\n false\r\n end\r\n end\r\n end\r\n end", "def clear_options\r\n\t\t# this line _may_ be doing nothing\r\n\t\t#self.option_values.clear\r\n\t\t# has_many :through needs this?\r\n\t\tself.line_item_option_values.clear\r\n\r\n#\t\tself.line_item_option_values.each do |liov|\r\n#\t\t\tliov.destroy\r\n#\t\tend\r\n\tend", "def selectize_multi_select(key, *values)\n values.flatten.each do |value|\n open_selectize_chooser(key)\n execute_script(\"\n #{find_selectized_control_js(key)}.querySelector('input').value = '#{value}';\n document.querySelector$('##{key}.selectized').selectize.createItem();\n \")\n end\n end", "def select_by_id_clear(id_name)\n select_by_id(id_name).clear\nend", "def selected_options\n options.select { |e| e.selected? }\n end", "def multiple_select_ids(arr) # :doc:\n arr = [arr] unless arr.is_a?(Array)\n arr.collect{|x| x.to_i}.delete_if{|x| x == 0}\n end", "def selected_options\n options.select { |e| e.selected? }\n end", "def deregister_options(*names)\n\t\tnames.each { |name|\n\t\t\tself.options.remove_option(name)\n\t\t\tself.datastore.delete(name)\n\t\t}\n\tend", "def remove_all_except(*args)\n set_option_array_values(:remove_all_except, *args)\n end", "def select_multi(field_name, choices, options = {})\n power_options = power_options!(field_name, options)\n # generic_field(:select, super(field_name, choices, options), field_name, power_options)\n generic_field(:select, 'SELECT MULTI', field_name, power_options)\n end", "def unselect_board\n select_board nil\n end", "def select_by_class_clear(class_name)\n select_by_class(class_name).clear\nend", "def unselected_features(deactivating_contexts, active_contexts)\n concerned = concerned_features(deactivating_contexts)\n unselected = []\n \n concerned.each {\n |feature|\n concerned_contexts = @feature_to_contexts[feature]\n # TODO Guess feature selection counts before and after\n # deactivation ?\n }\n end", "def remove_all()\n @items.clear()\n end", "def unbind_select_memory\n API.unbind 'TAB', @mash\n API.unbind \"'\", @mash\nend", "def change_selected_elements(element, selected)\n code = \"var selected_elements = $('#{selected}').value.split(',').without('');\"\n code += \"if ($(this).checked) {$('#{selected}').value = selected_elements.concat('#{element}').join(',')}\"\n code += \"else {$('#{selected}').value = selected_elements.without('#{element}').join(',')};\"\n end", "def clear_clicked(txtvu)\n s, e = txtvu.buffer.selection_bounds\n txtvu.buffer.remove_all_tags(s, e)\nend", "def clear\n @selected_indices.clear\n super\n end", "def unchecks(id_or_name_or_label)\n field = find_field(id_or_name_or_label, CheckboxField)\n field.uncheck\n end", "def select_all\n clone(:select => nil)\n end", "def delete_all\n target.clear\n end", "def RemoveAll()\r\n ret = _invoke(1610743824, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def RemoveAll()\r\n ret = _invoke(1610743824, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def clear_all_vines\n session[:selected_vines] = []\n end", "def uncheck_content(item)\n name_li(item).checkbox.clear\n end", "def remove_selection locator, option_locator\r\n command 'removeSelection', locator, option_locator\r\n end", "def remove_selection locator, option_locator\r\n command 'removeSelection', locator, option_locator\r\n end", "def uncheck(field_locator)\n locate_field(field_locator, CheckboxField).uncheck\n end", "def uncheck\n click unless unchecked?\n end", "def remove_from_all_groups\n self.group_memberships.each {|m| m.destroy}\n end", "def unchosen\n the_set = []\n self.itemlist.each { |k,v| the_set << self.object(k).unchosen }\n the_set\n end", "def clear_flags\n each(&:clear_flags)\n self\n end", "def remove_selected(selected)\n case selected\n when Stroke\n @main_view.remove_stroke(selected)\n when ToyInScene\n @main_view.remove_toy(selected)\n end\n close_popover\n moveToSceneBar\n end", "def unkeyword!(keyword_ids:)\n taggings.where(tag_id: keyword_ids).each(&:destroy)\n end", "def destroy_all\n klass.destroy_all(:conditions => selector)\n end", "def clear_targets\n @builder_sets.clear\n end", "def select_all\n\t\treturn self.clone( :select => [] )\n\tend", "def drop_external_selection(list, name)\n list.each do |l|\n drop_external_selection(l[:entries], name) if l[:entries]\n list.delete(l) if l[:name] == name\n end\n end", "def remove_row_selection_interval ix0, ix1\n @anchor_selection_index = ix0\n @lead_selection_index = ix1\n arr = @selected_indices.dup # to un highlight\n @selected_indices.delete_if {|x| x >= ix0 and x <= ix1 }\n arr.each {|i| @obj.fire_row_changed(i) }\n lse = ListSelectionEvent.new(ix0, ix1, @obj, :DELETE)\n @obj.fire_handler :LIST_SELECTION_EVENT, lse\n end", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def deselect(how, what)\n case how\n when :value, :index, :text\n raise NotImplementedError\n else\n raise ArgumentError, \"can't deselect options by #{how.inspect}\"\n end\n end", "def eliminateChoices(cell)\n if (value = cell.hasFinalValue)\n cell.mark\n [@boxes[cell.box],@rows[cell.row],@cols[cell.col]].each do |set|\n eliminateChoiceFromSet(set, cell, value)\n end\n end\n end", "def remove_all\n @sequence.remove_all\n end", "def remove_option_selection \n @product = Product.find(params[:product_id])\n @product_option = ProductOption.find(params[:product_option_id])\n @selection = ProductOptionSelection.find(params[:selection_id])\n \n @product_option.product_option_selections.delete(@selection)\n end", "def clearAretes()\n @listeArete.each{ |arete|\n arete.supprimer()\n }\n end", "def unset(*args)\n fields = args.map { |a| a.is_a?(Hash) ? a.keys : a }\n .__find_args__\n .map { |f| [database_field_name(f), true] }\n view.update_many(\"$unset\" => Hash[fields])\n end", "def delete_users_choices\n choices = get_choices\n choices.each do |choice|\n choice.delete\n end\n end", "def uncheck\n return unless checked?\n\n @checked = false\n @group.value = value\n @border_color = @unchecked_border_color.dup\n publish :changed, @checked\n\n nil\n end", "def deselect_piece\n @selected_piece_pos = nil\n\n end", "def options_for_multiselect_selected( object, method, ids, options = {} )\n return [] if ( ids.nil? or ids.empty? )\n class_name = options[:class_name] || object\n model = get_object(class_name)\n items = get_selected_items(:model => model, :options => options, :ids => ids, :method => method)\n options_from_collection_for_select(items, :to_param, options[:display_value] ||= method)\n end", "def removeAllItems _args\n \"removeAllItems _args;\" \n end", "def selected_options; end", "def selected_options; end", "def clearAllItemsFromBackpack _args\n \"clearAllItemsFromBackpack _args;\" \n end", "def selected_options\n @options.find_all { |o| o.selected? }\n end", "def disown_all!\n self.groups.each do |group|\n self.disown!(group)\n end\n end", "def off(*a)\n case a.size\n when 1 then var(a[0], Array).clear\n when 2 then var(a[0], Array).tap { |e| e.delete a[1] }\n when 3 then var(a[0], Array).tap { |e| e.delete a[1].method(a[2]) }\n end\n self\n end", "def reformat_multiselect_params_format\n params = @associations[\"0\"][:element_id]\n params.each_with_index do |id, idx|\n @associations[(idx + 1).to_s] = { element_id: id, \"_destroy\" => \"0\" } if id.present?\n end\n @associations.delete(\"0\")\n end", "def remove_all\n @batch = Batch.shod(params[:id])\n @exam_groups = @batch.exam_groups.all\n end", "def deunion\n [self]\n end", "def select_all\n # FIXME\n driver.operaAction('Select all')\n end", "def clearAretes()\n laTaille = @aretes.size()\n for i in 0...laTaille do\n @aretes[0].supprimer()\n end\n end", "def do_select_all\n return nil unless @data.size > 0\n select_range(0..@data.size-1)\n refresh\n end", "def deintersect\n [self]\n end", "def remove\n selected.each { |view| view.parent.removeView(view) }\n self\n end", "def remove_selection\n buffer_current.remove_selection\n update_status_line\n end" ]
[ "0.7398284", "0.70754564", "0.6560151", "0.6528219", "0.64798075", "0.646353", "0.6355395", "0.62131923", "0.62049633", "0.6197127", "0.61154103", "0.6053899", "0.5854853", "0.57252765", "0.5656143", "0.55325687", "0.5439404", "0.5435767", "0.5429539", "0.5345924", "0.5334642", "0.52984464", "0.5284878", "0.52761024", "0.5245267", "0.5235195", "0.5221735", "0.5179097", "0.51302564", "0.5106467", "0.5091313", "0.5085698", "0.5082254", "0.5071557", "0.5068961", "0.50470054", "0.5011126", "0.5004389", "0.49668634", "0.49456254", "0.4941298", "0.49313033", "0.49284074", "0.49027884", "0.48997477", "0.48754418", "0.4864222", "0.48616537", "0.48575038", "0.48381665", "0.48367858", "0.48331222", "0.48088264", "0.47803372", "0.47561598", "0.47561598", "0.4751985", "0.47366127", "0.47313204", "0.47313204", "0.469845", "0.4673123", "0.46612856", "0.4655262", "0.46550164", "0.46435815", "0.46347526", "0.46291173", "0.4624818", "0.462379", "0.4620908", "0.4608701", "0.45987117", "0.45987117", "0.45600688", "0.4559737", "0.4546673", "0.45459983", "0.45448643", "0.45338255", "0.4507363", "0.45059904", "0.44793925", "0.44716516", "0.44567674", "0.4419722", "0.4419722", "0.44143632", "0.4412833", "0.44098413", "0.43953678", "0.43733913", "0.43642408", "0.4357176", "0.4355764", "0.4352752", "0.43501866", "0.4347855", "0.43416327", "0.4331999" ]
0.648715
4
Selects a frame within the current window. (You may invoke this command multiple times to select nested frames.) To select the parent frame, use "relative=parent" as a locator; to select the top frame, use "relative=top". You may also use a DOM expression to identify the frame you want directly, like this: dom=frames["main"].frames["subframe"]
def select_frame locator command 'selectFrame', locator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frame(selector, argument)\n case selector\n when :name\n driver.switch_to.frame(argument)\n when :index\n driver.switch_to.frame(argument.to_i - 1) # index starts from 1 in Watir\n else\n raise OperaWatir::Exceptions::NotImplementedException,\n \"We do not support the `#{selector}' selector yet\"\n end\n end", "def switch_to_parent_frame\n driver.switch_to.parent_frame\n end", "def select_frame(id)\n @driver.switch_to().frame(id)\n pause\n end", "def select_iframeid\r\n storeHtmlSource = @driver.page_source\r\n storeHtmlSource2 = storeHtmlSource.gsub(/frameborder=\"0\" /, '')\r\n index = storeHtmlSource2.to_s.match(/iframe id=\"[a-z]+[0-9]+\"/)\r\n @iframe = index[0].match(/[a-z]+[0-9]+/)\r\n end", "def click_button_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).click\nend", "def switch_frame frame\n $driver.switch_to.frame(frame)\nend", "def switch_to_frame(criteria,value)\r\n\t\t\tel = @driver.find_element(criteria.to_sym, value)\t\r\n\t\t\tputs \"Iframe: \"\r\n\t\t\tputs el\t\r\n\t\t\t@driver.switch_to.frame(el)\r\n\t\tend", "def find_frame(selector, &block)\n using_wait_time(7) do\n frame = find(selector)\n within_frame(frame) do\n block.call\n end\n end\n end", "def switch_to_frame(id)\n driver.switch_to.frame(id)\n end", "def switch_to_frame_and_wait_for_element_found(frame_id, locator)\n switch_to_frame frame_id\n\n how, what = parse_locator(locator)\n\n wait_for do\n begin\n driver.find_element(how, what)\n rescue Selenium::WebDriver::Error::NoSuchWindowError\n false\n end\n end\n end", "def switch_to_frame\n wait.until { wrapper_element.attribute('class').include?('modal_open') }\n @browser.switch_to.frame(@browser.find_element(Selectors::FAST_SEARCH_MODAL[:iframe]))\n end", "def click_radio_button_inside_frame(browser_handle, frame_prop, frame_prop_val, radio_prop, radio_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).radio(radio_prop.intern, /#{radio_prop_val}/).click\nend", "def select_from_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val, select_value)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).select(select_value)\nend", "def check_frame(options = {})\n options = { timeout: USE_DEFAULT_MATCH_TIMEOUT, tag: nil }.merge!(options)\n frame = options[:frame] || options[:frame_element] || options[:name_or_id]\n target = Applitools::Selenium::Target.frame(frame).timeout(options[:timeout]).fully\n check(options[:tag], target)\n end", "def click_button_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).click_no_wait\nend", "def nav\n frame_text = self.redirect {$ie.show_frames}\n if frame_text =~ /mainFrameSet/ then $ie.frame(:id, 'main').frame(:id, 'navigationFrame')\n else $ie.frame(:id, 'navigationFrame')\n end\n end", "def showFrames()\n=begin\n \n ff = @ie.document.frames\n\n log \"there are \" + ff.length.to_s + \" frames\" if $debuglevel >=0\n\n for f in 0 .. ff.length-1\n log \"Frame: \" + ff[f.to_s].name.to_s if $debuglevel >=0 \n log \"My parent is: \" + ff[f.to_s].parentWindow.name.to_s if $debuglevel >=0\n end \n\n #frame = @ie.document.frames[ frameName ].document\n \n=end\n end", "def change_to_iframe(index)\n @driver.switch_to.frame(index)\n end", "def parent_frame\n logger.info 'EyesTargetLocator.parent_frame()'\n unless driver.frame_chain.empty?\n on_will_switch.will_switch_to_frame :parent_frame, nil\n logger.info 'Done! Switching to parent_frame...'\n __getobj__.parent_frame\n end\n logger.info 'Done!'\n driver\n end", "def content_frame\n node_info = client.command(\n Protocol::DOM.describe_node(object_id: remote_object[\"objectId\"])\n ).value\n return unless node_info.dig(\"node\", \"frameId\").is_a? String\n\n frame_manager.frame node_info.dig(\"node\", \"frameId\")\n end", "def click_image_inside_frame(browser_handle, frame_prop, frame_prop_val, image_prop, image_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).image(image_prop.intern, /#{image_prop_val}/).click\nend", "def getObjectFrameReference( name , frameName )\n\n if frameName == \"\" then\n frame = @ie.document\n else\n ff = @ie.document.frames\n\n #log \"there are \" + ff.length.to_s + \" frames\"\n #for f in 0 .. ff.length-1\n # log \"Frame: \" + ff[f.to_s].name.to_s \n #end \n\n frame = @ie.document.frames[ frameName.to_s ].document\n end \n return frame\n end", "def frame_chain\n Applitools::Selenium::FrameChain.new other: @frame_chain\n end", "def parent_frame; end", "def check_in_frame(options)\n frames = options.delete :target_frames\n\n Applitools::ArgumentGuard.is_a? options, 'options', Hash\n Applitools::ArgumentGuard.is_a? frames, 'target_frames: []', Array\n\n return yield if block_given? && frames.empty?\n\n original_frame_chain = driver.frame_chain\n logger.info 'Switching to target frame according to frames path...'\n driver.switch_to.frames(frames_path: frames)\n logger.info 'Done!'\n\n yield if block_given?\n\n logger.info 'Switching back into top level frame...'\n driver.switch_to.default_content\n return unless original_frame_chain\n logger.info 'Switching back into original frame...'\n driver.switch_to.frames frame_chain: original_frame_chain\n end", "def select_frame(frame_name, selected_frame, validate: true)\n if validate\n if !(tr = model.transformer)\n raise ArgumentError, \"expecting to select frame '#{selected_frame}' for #{frame_name}, but #{self} does not use transformations\"\n elsif !tr.has_frame?(frame_name)\n raise ArgumentError, \"expecting to select frame '#{selected_frame}' for #{frame_name}, but #{self} has no such frame\"\n end\n end\n\n if current = selected_frames[frame_name]\n if current != selected_frame\n raise FrameSelectionConflict.new(self, frame_name, current, selected_frame), \"cannot select both #{current} and #{selected_frame} for the frame #{frame_name} of #{self}\"\n end\n else\n selected_frames[frame_name] = selected_frame\n end\n end", "def get_frames\n return driver.find_elements(:css, 'internal-frame')\nend", "def check_region_in_frame(options = {})\n options = { timeout: USE_DEFAULT_MATCH_TIMEOUT, tag: nil, stitch_content: false }.merge!(options)\n Applitools::ArgumentGuard.not_nil options[:by], 'options[:by]'\n Applitools::ArgumentGuard.is_a? options[:by], 'options[:by]', Array\n\n how_what = options.delete(:by)\n frame = options[:frame] || options[:frame_element] || options[:name_or_id]\n\n target = Applitools::Selenium::Target.new.timeout(options[:timeout])\n target.frame(frame) if frame\n target.fully if options[:stitch_content]\n target.region(*how_what)\n\n check(options[:tag], target)\n end", "def parent_frame\n @bridge.switch_to_parent_frame\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def click_image_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, image_prop, image_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).image(image_prop.intern, /#{image_prop_val}/).click_no_wait\nend", "def frm\n self.frame(:src=>/sakai2samigo.launch.html/)\n end", "def frm\n self.frame(:src=>/sakai2samigo.launch.html/)\n end", "def switch_frame(frame_name)\n begin\n $driver.switch_to.frame frame_name\n rescue Exception => e\n $LOG.error \" frame_name : #{frame_name} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"\\n frame_name : #{frame_name} \"+e.message\n end\n end", "def select_frame(frame_name, selected_frame)\n if current = selected_frames[frame_name]\n if current != selected_frame\n raise FrameSelectionConflict.new(self, frame_name, current, selected_frame), \"cannot select both #{current} and #{selected_frame} for the frame #{frame_name} of #{self}\"\n end\n else\n selected_frames[frame_name] = selected_frame\n end\n end", "def frm\n self.frame(:src=>/sakai2forums.launch.html/)\n end", "def det\r\n if has_frame?('infoArea') then $ie.frame(:name, 'infoArea').frame(:name, 'detailArea')\r\n else $ie.frame(:index, 3)\r\n end\r\n end", "def click_checkbox_inside_frame(browser_handle, frame_prop, frame_prop_val, checkbox_prop, checkbox_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).checkbox(checkbox_prop.intern, /#{checkbox_prop_val}/).click\nend", "def activate_internal_frame(title)\n append_to_script \"activate_internal_frame \\\"#{title}\\\"\"\n end", "def frames\n @frames ||=\n search('frame').map { |node| Frame.new(node, @mech, self) }\n end", "def frames\n @frames ||=\n search('frame').map { |node| Frame.new(node, @mech, self) }\n end", "def nav\r\n frame_text = self.redirect {$ie.show_frames}\r\n if frame_text =~ /infoArea/ then $ie.frame(:name, 'infoArea').frame(:name, 'navTreeArea')\r\n else $ie.frame(:id, 'navigationFrame')\r\n end\r\n end", "def frame(id)\n @bridge.switch_to_frame id\n end", "def store_whether_this_frame_match_frame_expression current_frame_string, target, variable_name\r\n raise 'Not supported in Selenium Core at the moment'\r\n end", "def frame(options = {})\n raise Applitools::EyesIllegalArgument.new 'You must pass :index or :name_or_id or :frame_element option' unless\n options[:index] || options[:name_or_id] || options[:frame_element]\n if (needed_keys = (options.keys & [:index, :name_or_id, :frame_element])).length == 1\n send \"frame_by_#{needed_keys.first}\", options[needed_keys.first]\n else\n raise Applitools::EyesIllegalArgument.new 'You\\'ve passed some extra keys!' /\n 'Only :index, :name_or_id or :frame_elenent are allowed.'\n end\n end", "def set_frame\n @frame = Frame.find(params[:id])\n end", "def set_frame\n @frame = Frame.find(params[:id])\n end", "def set_frame\n @frame = Frame.find(params[:id])\n end", "def set_frame\n @frame = Frame.find(params[:id])\n end", "def set_frame\n @frame = Frame.find(params[:id])\n end", "def has_frame?(frame_name)\n frame_text = self.redirect {$ie.show_frames}\n !frame_text.match(\"#{frame_name}\").nil?\n end", "def has_frame?(frame_name)\n frame_text = self.redirect {$ie.show_frames}\n !frame_text.match(\"#{frame_name}\").nil?\n end", "def getFrameHTML( frameName = \"\" )\n container = getObjectFrameReference( \"\" , frameName )\n return container.body.innerHTML\n end", "def set_frame\n @frame = Frame.find(params[:id])\n end", "def capybara_element(wait: 0)\n context.capybara_context.find(\"iframe[src='#{site_value}']\", match: :first, wait: wait)\n rescue Capybara::ElementNotFound\n nil\n end", "def iframe(name, iframe_class, *find_args)\n define_method(name) do\n iframe_class.new(find(*find_args))\n end\n end", "def click_link_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, link_prop, link_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).link(link_prop.intern, /#{link_prop_val}/).click_no_wait\nend", "def double_click_button_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).fire_event(\"ondblclick\")\nend", "def get_all_contents_of_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).getAllContents\nend", "def frame(options)\n set RGhost::Frame.new(options)\n end", "def frame(*args)\n return yield unless ui_enabled?\n CLI::UI::Frame.open(*args) { yield }\n end", "def flash_button_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).flash\nend", "def get_frame(block_name, frame)\n if frame[:vlocks].has_key?(block_name)\n frame\n elsif frame[:parent_frame]\n get_frame(block_name, frame[:parent_frame])\n end\n end", "def iframe(name)\n iframes.find { |el| el.name == name.to_s }\n end", "def use_frames(spec)\n selected_frames.merge!(spec)\n self\n end", "def xhtml_frameset(attrs = {}, &block)\n self.tagset = Markaby::XHTMLFrameset\n xhtml_html(attrs, &block)\n end", "def xhtml_frameset(attrs = {}, &block)\n self.tagset = Markaby::XHTMLFrameset\n xhtml_html(attrs, &block)\n end", "def flash_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).flash\nend", "def get_frame_owner(frame_id:)\n {\n method: \"DOM.getFrameOwner\",\n params: { frameId: frame_id }.compact\n }\n end", "def current_frame\n @current_frame\n end", "def preview_project(&blk)\n within_frame(\"authorfrm\") do\n click_on(\"Preview Project\")\n end\n \n page.driver.browser.window_handles.length.should == 2\n \n within_window(page.driver.browser.window_handles.last) do\n current_path.should be_start_with('/webapp/vle/preview.html')\n yield blk\n end\nend", "def clear_selection_from_select_list_inside_frame(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).clearSelection\nend", "def select_list_exists_inside_frame?(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).exists?\nend", "def flash_radio_button_inside_frame(browser_handle, frame_prop, frame_prop_val, radio_prop, radio_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).radio(radio_prop.intern, /#{radio_prop_val}/).flash\nend", "def radio_button_checked_inside_frame?(browser_handle, frame_prop, frame_prop_val, radio_prop, radio_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).radio(radio_prop.intern, /#{radio_prop_val}/).checked?\nend", "def radio_button_exists_inside_frame?(browser_handle, frame_prop, frame_prop_val, radio_prop, radio_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).radio(radio_prop.intern, /#{radio_prop_val}/).exists?\nend", "def button_exists_inside_frame?(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).exists?\nend", "def frame(id); end", "def double_click_button_with_popup_inside_frame(browser_handle, frame_prop, frame_prop_val, button_prop, button_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).button(button_prop.intern, /#{button_prop_val}/).fire_event_no_wait(\"ondblclick\")\nend", "def add_frame(frame)\n end", "def set_frame\n @frame = Frame.find_by!(number: params[:id])\n end", "def select_all\n self.frame(:id=>\"elm1_ifr\").send_keys( [:command, 'a'] )\n end", "def get_frame_tree\n {\n method: \"Page.getFrameTree\"\n }\n end", "def is_value_selected_from_select_list_inside_frame?(browser_handle, frame_prop, frame_prop_val, select_list_prop, select_list_prop_val, selected_value)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).select_list(select_list_prop.intern, /#{select_list_prop_val}/).selected?(selected_value)\nend", "def switch_to_canvas_iframe(driver)\n hide_canvas_footer\n wait_until { driver.find_element(id: 'tool_content') }\n driver.switch_to.frame driver.find_element(id: 'tool_content')\n end", "def assert_ponzu_frame(options = {})\n ponzu_frames = css_select \"[data-container='ponzu_frame']\"\n if @request.user_agent != user_agent_strings_for(:galapagos)\n assert_equal 1, ponzu_frames.size, \n \"ponzu_frame not found within #{@templates.keys}\"\n else\n assert_equal 0, ponzu_frames.size, \n \"ponzu_frame advertantly found within #{@templates.keys}\"\n end\n assert_absence_of_non_kamishibai_links(options)\n end", "def select(*args, &block)\n browser.within(component_locator) do\n browser.select(*args, &block)\n end\n end", "def set_game_frame(frame)\n @frame = frame\n end", "def catdet; $ie.frame(:name, 'infoArea').frame(:name, 'detailArea').frame(:name, 'categDetailArea'); end", "def select!\n raise \"Locator at #{locator} is not visible\" unless visible?\n begin\n wd_element.click\n rescue\n raise \"Locator at #{locator} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def change_frame_to(index, run_whereami = T.unsafe(nil)); end", "def morcego_iframe(control_window_name, destination_name)\n control_window_name ||= \"morcego\"\n destination_name ||= \"morcego-destination\"\n return <<EOD\n <iframe name=\"#{control_window_name}\" id=\"#{control_window_name}\"\n onload=\"morcegoNavigate();\" style=\"display: none;\"></iframe>\n\t <div id=\"#{destination_name}\"></div>\n\t <script language=\"JavaScript\">\n\t function morcegoNavigate() {\n\t var cont = window.frames.#{control_window_name}.document.documentElement;\n\t document.getElementById('#{destination_name}').innerHTML = cont.innerHTML;\n\t }\n\t </script>\nEOD\n end", "def catdet; $ie.frame(:name, 'infoArea').frame(:name, 'detailArea').frame(:name, 'categDetail'); end", "def iframe\n end", "def frame\n context.frame\n end", "def set_frame\n frames = @animations[@playing_animation]\n case frames\n when Range\n reset_clipping_rect\n @clip_x = @current_frame * @clip_width\n when Array\n f = frames[@current_frame]\n @clip_x = f[:x] || @defaults[:clip_x]\n @clip_y = f[:y] || @defaults[:clip_y]\n @clip_width = f[:width] || @defaults[:clip_width]\n @clip_height = f[:height] || @defaults[:clip_height]\n @frame_time = f[:time] || @defaults[:frame_time]\n end\n end", "def double_click_image_inside_frame(browser_handle, frame_prop, frame_prop_val, image_prop, image_prop_val)\n browser_handle.frame(frame_prop.intern, /#{frame_prop_val}/).image(image_prop.intern, /#{image_prop_val}/).fire_event(\"ondblclick\")\nend" ]
[ "0.67133945", "0.6637828", "0.6467598", "0.6302869", "0.62870646", "0.6228209", "0.6050934", "0.60387737", "0.59692645", "0.5949901", "0.58981776", "0.58876044", "0.5780057", "0.57478094", "0.5740962", "0.5740382", "0.5737422", "0.572849", "0.57204854", "0.5668381", "0.56124276", "0.55360734", "0.5515643", "0.54838526", "0.5453142", "0.5430493", "0.54029644", "0.5375208", "0.53094035", "0.5295084", "0.5295084", "0.5295084", "0.5295084", "0.52743447", "0.5242663", "0.5242663", "0.5227525", "0.5219664", "0.5186908", "0.5132966", "0.5124078", "0.5122457", "0.5105632", "0.5105632", "0.5092536", "0.5078429", "0.5071887", "0.5069574", "0.5067634", "0.5067634", "0.5067634", "0.5067634", "0.5067634", "0.50632876", "0.50632876", "0.5016142", "0.49988374", "0.49889627", "0.49832183", "0.49735004", "0.49562028", "0.4940757", "0.49092978", "0.49022895", "0.4874354", "0.48661342", "0.48559874", "0.48205742", "0.48028454", "0.48028454", "0.4792402", "0.4790242", "0.47760004", "0.4764884", "0.47635767", "0.4743415", "0.47353262", "0.4728044", "0.47270265", "0.4708353", "0.46906146", "0.46852902", "0.46837267", "0.46738133", "0.46656412", "0.4618544", "0.46179768", "0.4601091", "0.45926687", "0.45822158", "0.4575562", "0.45654088", "0.4548643", "0.45465806", "0.45444885", "0.4529634", "0.45114252", "0.45097473", "0.44993186", "0.44920298" ]
0.7479179
0
Moves the text cursor to the specified position in the given input element or textarea. This method will fail if the specified element isn't an input element or textarea.
def set_cursor_position locator, position command 'setCursorPosition', locator, position end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_element(element)\n driver.execute_script('arguments[0].scrollIntoView(true)', element)\n end", "def move_caret_to_mouse\n # Test character by character\n 1.upto(self.text.length) do |i|\n if @window.mouse_x < x + FONT.text_width(text[0...i])\n self.caret_pos = self.selection_start = i - 1;\n return\n end\n end\n # Default case: user must have clicked the right edge\n self.caret_pos = self.selection_start = self.text.length\n end", "def move_to_end\n @cursor = @text.length # put cursor outside of text\n end", "def move_to_end\n @cursor = @text.length # put cursor outside of text\n end", "def move_to(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n\n action\n .move_to(element, x, y)\n .perform\n end", "def entering text, options = {}\n widget = find_widget options[:into]\n widget.insert_text text, widget.position\n process_events\nend", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouse_move_to element.ref, right_by, down_by\n end", "def move_caret(mouse_x)\n # Test character by character\n 1.upto(self.text.length) do |i|\n if mouse_x < x + @font.text_width(text[0...i]) then\n self.caret_pos = self.selection_start = i - 1;\n return\n end\n end\n # Default case: user must have clicked the right edge\n self.caret_pos = self.selection_start = self.text.length\n end", "def move_caret(mouse_x)\n 1.upto(text.length) do |i|\n if mouse_x < x + @font.text_width(text[0...i])\n self.caret_pos = self.selection_start = i - 1\n return\n end\n end\n self.caret_pos = self.selection_start = text.length\n end", "def move_caret(mouse_x)\n # Test character by character\n 1.upto(self.text.height) do |i|\n if mouse_x < x + @font.text_width(text[0...i]) then\n self.caret_pos = self.selection_start = i - 1;\n return\n end\n end\n # Default case: user must have clicked the right edge\n # self.caret_pos = self.selection_start = self.text.height\n end", "def move_caret(mouse_x)\n len = text.length\n # Default case: user must have clicked the right edge\n self.caret_pos = self.selection_start = len\n\n # Test character by character\n 1.upto(len) do |index|\n next unless mouse_x < @point.x + @font.text_width(text[0...index])\n\n self.caret_pos = self.selection_start = index - 1\n break\n end\n end", "def cursor_to_input_line\n setpos(input_line, 0)\n end", "def move_caret(mouse_x)\n # Test character by character\n 1.upto(self.text.length) do |i|\n if mouse_x < x + @font.text_width(text[0...i]) then\n self.caret_pos = self.selection_start = i - 1;\n return\n end\n end\n \n # Default case: user must have clicked the right edge\n self.caret_pos = self.selection_start = self.text.length\n end", "def move_cursor(input)\n\n if input == 'w'\n dx,dy = [-1,0]\n elsif input == 's'\n dx,dy = [1,0]\n elsif input == 'a'\n dx,dy = [0,-1]\n elsif input == 'd'\n dx,dy = [0,1]\n elsif input == 'q'\n exit\n end\n\n\n x, y = [cursor[0] + dx, cursor[1] + dy]\n #returns cursor position, doesn't return a new cursor UNLESS x, and y are between 0 and 7, valid board spaces\n self.cursor = ([x, y].all? { |i| i.between?(0, 7) } ? [x, y] : self.cursor)\n end", "def mouse_move_at locator, coord_string\r\n command 'mouseMoveAt', locator, coord_string\r\n end", "def text_cursor_position(text_input_handle)\n end", "def enter_text(element, text)\n @driver.find_element(element[:type], element[:value]).send_keys text\n @driver.hide_keyboard\n end", "def cursor_move_to_end\n @cursor_position = @text.scan(/./m).size\n self.reset_cursor_blinking\n end", "def type_text(locator, text)\n Logbook.step(\"Type text '#{text}' to the input with locator #{locator}\")\n find(locator).send_keys(:backspace, text)\n end", "def move_to(element, right_by = nil, down_by = nil)\n assert_element element\n\n @bridge.mouseMoveTo element.ref, Integer(right_by), Integer(down_by)\n end", "def move_if_necessary(x, y)\n return if textcursor.left == x && textcursor.top == y\n move_textcursor(x, y)\n end", "def typenew(locator, text)\n wait_for(locator)\n clear(locator)\n find(locator).send_keys(text)\n end", "def moveToEditPosition(new_position)\n return @field_win.wmove(0, @field_width - new_position - 1)\n end", "def move_to(x, y)\n @x, @y = x, y\n @gui.move_to(x, y)\n self\n end", "def store_cursor_position locator, variable_name\r\n command 'storeCursorPosition', locator, variable_name\r\n end", "def move(y, x)\n Ncurses.wmove(pointer, y, x)\n end", "def restore_cursor_position() set_cursor_position(@event[\"line\"], @event[\"column\"]) end", "def set_current_text_input(text_input_handle)\n end", "def move\n @cursor.x = wrap(@cursor.x + @delta.x, @code.width)\n @cursor.y = wrap(@cursor.y + @delta.y, @code.height)\n end", "def move_to(row, col)\n @row, @col = wrap(row, col)\n end", "def move_to(x, y)\n cur_page.move_to(x, y)\n end", "def move_to element_name, right_by = nil, down_by = nil\n begin\n $driver.action.move_to(el(element_name), right_by, down_by).perform\n rescue Exception => e\n $LOG.error \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"error in moving element \\n element name : #{element_name}, right: #{right_by} and down: #{down_by} \"+e.message\n end\n end", "def moveto(point={})\n set RGhost::Cursor.moveto(point)\n end", "def send_keys(*args)\r\n begin\r\n $focus_driver.find_element(self).send_keys(*args)\r\n rescue StandardError => e\r\n Log.fail(\"You cannot set text to element #{self.how } => #{self.what}\" + e.message)\r\n end\r\n end", "def focus(locator)\n execute_script(\n 'var element = arguments[0]; element.focus();',\n find_element(locator)\n )\n end", "def move_to(x_coord, y_coord)\n Selenium::WebDriver::Point.new(Integer(x_coord), Integer(y_coord)).tap do |point|\n use { @driver.manage.window.position = point }\n end\n end", "def fixCursorPosition\n scrollbar_adj = if @scrollbar_placement == LEFT then 1 else 0 end\n ypos = self.SCREEN_YPOS(@current_item - @current_top)\n xpos = self.SCREEN_XPOS(0) + scrollbar_adj\n\n @input_window.wmove(ypos, xpos)\n @input_window.wrefresh\n end", "def _stomp_input_text(*args)\n Log.debug(\"[GRIDIUM::Element] Clearing \\\"#{value}\\\" from element: (#{self})\")\n element.clear\n sleep @text_padding_time\n Log.debug(\"[GRIDIUM::Element] Typing: #{args} into element: (#{self}).\")\n element.send_keys(*args)\n sleep @text_padding_time\n end", "def type(text, into:)\n node = find(into)\n\n node.click\n sleep 0.1 # wait 100 milliseconds\n node.send_keys(text)\n end", "def enter(locator, text)\r\n @browser.type(locator, text)\r\n end", "def move_cursor(index)\n cursor = $arrows.index(\"^\")\n $arrows[index], $arrows[cursor] = $arrows[cursor], $arrows[index]\nend", "def make_move(board, display)\n new_pos = nil\n until new_pos\n display.render\n new_pos = display.cursor.get_input\n end\n new_pos\n end", "def scroll_to(element, x = 0, y = 0, device: nil)\n scroll(x, y, origin: ScrollOrigin.element(element, 0, 0), device: device)\n end", "def advance \n \n @pos += 1\n if @pos > @text.length - 1\n @currentChar = nil\n else \n @currentChar = @text[@pos]\n end\n \n end", "def move(board, input_to_index, character)\n board[input_to_index] = character\nend", "def move_for_keypress(keypress); nil; end", "def update_position\n chr = Console.read_char\n\n offset = arrow_val(chr)\n if offset\n new_position = Coord.sum(position, offset)\n self.position = new_position if in_range?(new_position)\n end\n\n chr\n end", "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def send_keys(loc, text)\n @browser.element(parse_location(loc)).send_keys(text)\n end", "def move(position, char)\n @board[position] = char\n end", "def move_window_to(point_x, point_y)\n driver.manage.window.move_to(point_x, point_y)\n end", "def insert(text, at: caret)\n editable? and @native.insert_text(at.to_i, text.to_s, text.to_s.length)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def set_Cursor(value)\n set_input(\"Cursor\", value)\n end", "def js_element_text_edit( startelem,\n elemtype, elemloc,\n pchildtype, pchildloc,\n text )\n\n parent = startelem.find_element(:xpath, '..')\n\n startelem.click.should == nil\n\n input = parent.find_element(elemtype, elemloc)\n\n input.clear\n\n input.send_keys([ :backspace, :backspace, :backspace, :backspace,\n :backspace, :backspace, :backspace, :backspace,\n :backspace, :backspace, :backspace, :backspace,\n :backspace, :backspace, :backspace, :backspace,\n text, :enter ])\n\n # Give things time to update\n sleep 2\n quiesce\n\n pchild = parent.find_element(pchildtype, pchildloc)\n 5.times do |x|\n if pchild.text == text\n break\n else\n sleep 1\n end\n end\n pchild.text.should == text\n end", "def move_to(x, y); end", "def move(user_input, character = \"X\")\n @board[user_input] = character\n end", "def text_selection_start__position(text_input_handle)\n end", "def move(board, input_to_index, character = \"X\")\n board[input_to_index] = character\nend", "def put_text_node_at(position)\n clear_insert_toolbar_before(@current_edited_node_position)\n @current_edited_node_position = position\n nodes.insert(position + 1, PostNode.new(node: PostText.new, node_type: 'PostText'))\n set_state post: state.post\n end", "def insert_text_at_cursor(text) \n\t\tinsert_text(@cursor_row, @cursor_col, text)\n\t\n\t\tif text.include?(\"\\n\")\n\t\t\t#todo what about multiple \\n's\n\t\t\t@cursor_row += 1\n\t\t\t@cursor_col = 0\n\t\t\t#resize_contents(500, line_num_to_coord(@text.num_lines + 1))\n\t\t\temit_changed(@cursor_row - 1)\n\t\telse\n\t\t\t@cursor_col += text.length\n\t\t\temit_changed(@cursor_row)\n\t\tend\n\tend", "def set_cursor_position(x, y)\n if stdout && x && y\n coord = Coord.new(x, y)\n self.set_console_cursor_position(stdout, coord)\n end\n end", "def MoveTo(arg0)\r\n ret = _invoke(1610743824, [arg0], [VT_BYREF|VT_ARRAY|VT_BSTR])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def scroll_to element\n element.ancestor(:scroll_area).scroll_to element\n end", "def enter_text_to_field(text, field)\n puts \"I'm going to touch #{field} label\"\n field.to_s.start_with?(\"UI\") ? touch(\"#{field}\") : touch(\"* marked:'#{field}'\")\n wait_for_keyboard\n keyboard_enter_text text\n end", "def moveArrowInputRangeToRight(how,element, numberOfArrowMove)\n findElement(how,element).send_keys :tab\n sleep 1\n for i in 1..numberOfArrowMove\n findElement(how, element).send_keys :arrow_right\n sleep 1\n end\n end", "def scroll_to(element, device: T.unsafe(nil)); end", "def set_text_input(id, text)\n touch(\"ReactEditText tag:'#{id}'\")\n wait_for_keyboard\n enter_text \"* tag:'#{id}'\", text\n hide_soft_keyboard\n sleep(1)\nend", "def move_to (x, y)\n @x, @y = x, y\n end", "def rmoveto(point={})\n set RGhost::Cursor.rmoveto(point)\n end", "def moveCursor buffer, direction, nb\n @frames[buffer].moveCursor direction, nb\n end", "def text_input(element, input, will_highlight = false, on_blur_element = nil, long_wait = false)\n\t\tif long_wait\n\t\t\t@wait_long.until { element.displayed? }\n\t\telse\n\t\t\t@wait.until { element.displayed? }\n\t\tend\n\t\tjs_scroll_up(element,true)\n\t\telement.clear()\n\t\telement.send_keys(input)\n\t\t#Click another element to fire on-blur\n\t\tnum_retry = 0\n\t\tbegin\n\t\t\tif(on_blur_element != nil)\n\t\t\t\tjs_scroll_up(on_blur_element,true)\n\t\t\t\ton_blur_element.click\n\t\t\tend\n\n\t\t\t#Check highlight\n\t\t\t@wait.until { (element.attribute(\"class\").include? \"is-error\") == will_highlight }\n\t\trescue Selenium::WebDriver::Error::TimeOutError\n\t\t\tretry if (num_retry += 1) == 1\n\t\tend\n\tend", "def set_input_focus! (focus, time = 0, revert_to: INPUT_FOCUS_POINTER_ROOT)\n super(revert_to, focus, time)\n end", "def move_text(from, to)\n \"#{from}->#{to}\"\nend", "def move\n index = board.data.split(\"\").index { |c| c == ' ' }\n board.data[index] = 'o'\n end", "def move_to(end_pos)\n if @board[end_pos].nil?\n @board.moves_since_capture += 1\n else\n @board.moves_since_capture = 0\n end\n\n @board[end_pos] = self\n @board[self.position] = nil\n self.position = end_pos\n end", "def set_text_input(input); end", "def replace(text)\n @text = text\n @cursor = @text.length # put cursor outside of text\n end", "def move(line, column = T.unsafe(nil)); end", "def move(line, column = T.unsafe(nil)); end", "def focus\n assert_exists\n driver.execute_script \"return arguments[0].focus()\", @element\n end", "def focus\n assert_exists\n driver.execute_script \"return arguments[0].focus()\", @element\n end", "def scroll_to_exact(text)\n err = nil\n w_s = window_rect\n\n (1..30).each do |_count|\n action\n .move_to_location(w_s.width / 2, (w_s.height * 2) / 5) # pointer based magic number\n .pointer_down(:left)\n .move_to_location(0, w_s.height / 5)\n .release\n .perform\n sleep 1 # we must wait finish scrolling\n\n return text_exact(text)\n rescue StandardError => e\n err = e\n end\n\n raise err\n end", "def move_to(piece)\r\n cols = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']\r\n rows = [1, 2, 3, 4, 5, 6, 7, 8]\r\n counter = 0; x = ''; y = ''\r\n until counter == 1\r\n print \"Enter destination coordinates: \"\r\n coordinate = STDIN.gets.chomp\r\n x = coordinate[0]; y = coordinate[1].to_i\r\n counter+=1 if ((cols.include? x) && (rows.include? y))\r\n end\r\n puts ''\r\n puts \"#{piece.class} to #{x}#{y}.\"\r\n stop = []\r\n stop[0] = cols.index(x)\r\n stop[1] = rows.index(y)\r\n stop \r\n end", "def position(user_input)\n\t\tindex = (user_input.to_i-1)\n\t\tself.cells[index]\n\tend", "def cursor_move_right_word\n chars = @text.scan(/./m)\n # skip all non-whitespaces first\n while @cursor_position < chars.size && chars[@cursor_position] != ' '\n @cursor_position += 1\n end\n # skip all whitespaces\n while @cursor_position < chars.size && chars[@cursor_position] == ' '\n @cursor_position += 1\n end\n self.reset_cursor_blinking\n end", "def type_text(loc, text)\n @browser.element(parse_location(loc)).send_keys(text)\n end", "def move(s, x, y, isTextMode)\n if isTextMode\n puts \"# move(sp, #{x}, #{y})\"\n puts \"PA#{x.to_i()},#{y.to_i()};\"\n else\n s.puts \"PA#{x.to_i()},#{y.to_i()};\"\n end\nend" ]
[ "0.5737054", "0.5690897", "0.5686064", "0.5686064", "0.5540334", "0.55158687", "0.5475659", "0.5445528", "0.54310524", "0.5392322", "0.53905773", "0.53389335", "0.5309308", "0.5301979", "0.5290331", "0.52765924", "0.52651703", "0.5264895", "0.52563196", "0.522613", "0.5187994", "0.5156463", "0.509906", "0.5094583", "0.5073861", "0.50612754", "0.5058672", "0.50134975", "0.50095165", "0.500321", "0.49954087", "0.4980345", "0.49468854", "0.493058", "0.49292776", "0.49016544", "0.4892436", "0.48843098", "0.48810282", "0.4877474", "0.48709854", "0.48535183", "0.48512727", "0.48460373", "0.48242915", "0.4806162", "0.4791136", "0.4785005", "0.47814316", "0.47557163", "0.4755283", "0.47362527", "0.47254008", "0.47254008", "0.47247356", "0.47247356", "0.47247356", "0.47247356", "0.47247356", "0.47247356", "0.47247356", "0.47247356", "0.47247356", "0.47247356", "0.47246686", "0.47246686", "0.47244316", "0.47194004", "0.47077608", "0.4703581", "0.46967405", "0.4695177", "0.46783268", "0.46728915", "0.466826", "0.46597117", "0.46552724", "0.4654157", "0.46466228", "0.4636125", "0.463222", "0.46237415", "0.46200338", "0.46180725", "0.46002483", "0.4598019", "0.4596514", "0.45898142", "0.4573357", "0.45715827", "0.45707443", "0.45707443", "0.4564421", "0.4564421", "0.45484972", "0.4546141", "0.45453408", "0.45445016", "0.45430696", "0.45359203" ]
0.5751592
0
Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10). Setting this value to 0 means that we'll send a "mousemove" event to every single pixel in between the start location and the end location; that can be very slow, and may cause some browsers to force the JavaScript to timeout. If the mouse speed is greater than the distance between the two dragged objects, we'll just send one "mousemove" at the start location and then one final one at the end location.
def set_mouse_speed pixels command 'setMouseSpeed', pixels end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mousemove_relative(x, y)\n @logger.info(\"mousemove not supported\")\n end", "def move(x:, y:, steps: 1)\n from_x = @x\n from_y = @y\n @x = x\n @y = y\n\n steps.times do |i|\n new_x = from_x + ((@x - from_x) * ((i + 1) / steps.to_f))\n new_y = from_y + ((@y - from_y) * ((i + 1) / steps.to_f))\n\n @page.command(\"Input.dispatchMouseEvent\",\n slowmoable: true,\n type: \"mouseMoved\",\n x: new_x.to_i,\n y: new_y.to_i)\n end\n\n self\n end", "def mouse_moved(x,y)\n\t\t[\n\t\t\t# @live_wrapper,\n\t\t\t@input_test,\n\t\t].each do |dynamic_obj|\n\t\t\tdynamic_obj.mouse_moved x,y\n\t\tend\n\tend", "def on_mouse_move(new_point)\n end", "def cursor(*options)\n options = combine_options(*options)\n\n apply_offset(options)\n @cursor_loc ||= {}\n @cursor_loc[:x] = options[:to][:left]\n @cursor_loc[:y] = options[:to][:top]\n\n options[:speed] ||= 1\n\n automatically \"mousemove #{@cursor_loc[:x]} #{@cursor_loc[:y]} #{options[:speed]}\"\n end", "def mouse_move locator\r\n command 'mouseMove', locator\r\n end", "def mouse_moved\n modulate_amount = map1d(mouse_y, (0..height), (220..1))\n modulate_frequency = map1d(mouse_x, (0..width), (0.1..100)) \n fm.frequency.set_last_value(modulate_frequency )\n fm.amplitude.set_last_value(modulate_amount)\nend", "def set_mouse_pos _x, _y\n send_cmd(\"set_mouse_pos #{_x} #{_y}\")\n end", "def speed\n # speeds should be between 1 and 2\n @window.mouse_y_percent\n end", "def wantsPeriodicDraggingUpdates \n true\n end", "def move_mouse(window_x, window_y)\n old_location = @xdo.mouse.location\n move_mouse_async window_x, window_y\n @xdo.mouse.wait_for_move_from old_location[0], old_location[1]\n end", "def move_mouse(x_delta, y_delta)\n send_request RequestMessage.new(mouse_event_message: MouseEvent.new(x_delta: x_delta, y_delta: y_delta))\n end", "def hover_and_move_slow(how, what, move_x, move_y)\n $debug and print \"In hover_and_move_slow: #{how}, #{what}, #{move_x}, #{move_y}\\n\"\n distance = [ 40, ((move_x + move_y)/4).abs].max\n e=$driver.find_element(how, what)\n $driver.action.click_and_hold(e).perform\n\n x = e.location.x\n y = e.location.y\n\n goal_x = x + move_x\n goal_y = y + move_y\n\n while( (goal_x - x).abs > 5 or (goal_y - y).abs > 5 )\n diff_x = goal_x - x\n diff_y = goal_y - y\n\n while( diff_x.abs > distance )\n diff_x = diff_x / 2;\n end\n\n while( diff_y.abs > distance )\n diff_y = diff_y / 2;\n end\n\n $debug and print \"In hover_and_move_slow: moving x #{diff_x} and y #{diff_y}, given current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.move_by(diff_x, diff_y).perform\n\n #$debug and sleep 2\n\n e=$driver.find_element(how, what)\n x = e.location.x\n y = e.location.y\n end\n\n $debug and print \"In hover_and_move_slow: exited main loop, current x #{x} and y #{y} with goals x #{goal_x} and y #{goal_y}\\n\"\n\n $driver.action.release.perform\n end", "def set_mouse_position(x, y); end", "def move\n @speed = map1d(total_count, (5..25), (0.1..0.4))\n @speed = (0..10.0).clip speed\n @position[Y] += speed\n @position[Y] = -height if position[Y] > height * 2\n end", "def move_task(initial, target)\n initial_x = initial.wd.location['x']\n initial_y = initial.wd.location['y']\n\n target_x = target.wd.location['x']\n target_y = target.wd.location['y']\n\n total_x = target_x - initial_x + 5\n total_y = target_y - initial_y + 5\n\n initial.when_present.drag_and_drop_by(total_x, total_y)\n sleep 1 #Allow for motion to happen\n end", "def move(xdiff, ydiff, xtilediff, ytilediff)\n if xtilediff != 0\n xdiff *= 32\n $visuals.maps.values.each { |m| m.real_x -= xtilediff * 32 }\n $visuals.map_renderer.move_x(xdiff)\n end\n if ytilediff != 0\n ydiff *= 32\n $visuals.maps.values.each { |m| m.real_y -= ytilediff * 32 }\n $visuals.map_renderer.move_y(ydiff)\n end\n skip_movement\n end", "def drag_mouse_to arg, opts = {}\n move_mouse_to opts[:from] if opts[:from]\n Mouse.drag_to arg.to_point, (opts[:duration] || 0.2)\n sleep(opts[:wait] || 0.2)\n end", "def update_smooth_movements\n return unless @start_move\n update_smooth_x\n update_smooth_y\n check_move_end\n end", "def mouse_dragged(x, y)\n window_point = Geo3d::Vector.new(x,y)\n\n @sphere_point_when[:mouse_draged] = window_to_sphere_space(window_point)\n end", "def move_mouse_async(window_x, window_y)\n XDo::FFILib.xdo_mousemove_relative_to_window @_xdo_pointer, @_window,\n window_x, window_y\n end", "def update_slider_dragging(mouse_x, mouse_y, trigger)\n if trigger && @button_slider_sprite.simple_mouse_in?\n @dragging_slider = true\n @button_slider_sprite.set_rect_div(0, 1, 1, 2)\n end\n if @dragging_slider\n m_coord = @direction.select_coord(mouse_x, mouse_y)\n b_coord = @direction.select_coord(@background_sprite)\n diff = m_coord - b_coord\n b_size = @background_sprite.height - @button_slider_sprite.height\n value = (diff / b_size.to_f) * @max\n scroll(value, true)\n return true\n end\n return false\n end", "def move_steps()\n\n # check end stops\n\n if @board.pins[@pin_min].value == 1 and @steps < 0\n @nr_steps = 0\n @pos = @min\n puts \"end stop min #{@name} reached\"\n end\n\n if @board.pins[@pin_max].value == 1 and @steps > 0\n @nr_steps = 0\n @pos = @max\n puts \"end stop max #{@name} reached\"\n end\n\n # check minimum and maximum position\n\n if (@pos <= @min and @steps < 0) or (@pos >= @max and @steps > 0)\n @nr_steps = 0\n puts \"end position reached #{@name}\"\n end\n\n # send the step pulses to the motor drivers\n\n if @nr_steps > 0\n set_pulse_on_pin(@pin_stp)\n\n @pos += 1.0 / @steps_per_unit * (@steps<=>0.0)\n @nr_steps -= 1\n\n return false\n else\n return true\n end\n\n end", "def only_cursor_moved flag=true\n @cursor_movement = flag\nend", "def mouse_x=(value); self.set_mouse_x(value); end", "def move\n\t\tunless @y >= 0 then\n\t\t\t@y += 1\n\t\tend\n\t\tif @x_total <= 150 and @y_total <= 150 then\n\t\t\t@x += 1\n\t\t\t@y += 1\n\t\t\t@x_total +=1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 150 and @y_total > 150 and @x_total < 300 and @y_total < 300 then\n\t\t\t@y -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 298 and @y_total > 298 and @x_total < 450 and @y_total < 450 then\n\t\t\t@y +=1\n\t\t\t@x -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 448 and @y_total > 448 and @x_total < 600 and @y_total < 600 then\n\t\t\t@y -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total == 599 and @y_total == 599 then\n\t\t\t@x_total = @y_total = 0\n\t\tend\n\tend", "def update_movement\r\n # If stop count exceeds a certain value (computed from move frequency)\r\n if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)\r\n # Branch by move type\r\n case @move_type\r\n when 1 # Random\r\n move_type_random\r\n when 2 # Approach\r\n move_type_toward_player\r\n when 3 # Custom\r\n move_type_custom\r\n end\r\n end\r\n end", "def drag_xy(object,limit_x=nil,limit_y=nil,limit_width=nil,limit_height=nil)\n return false if !defined?(object.x) or !defined?(object.y)\n if self.leftPress?(object)\n if @object_ox.nil?\n @object_ox = @x - object.x\n end\n if @object_oy.nil?\n @object_oy = @y - object.y\n end\n object.x = @x - @object_ox\n object.x = limit_x if limit_x && object.xlimit_width\n object.y = @y - @object_oy\n object.y = limit_y if limit_y && object.ylimit_height\n else\n @object_ox=nil\n @object_oy=nil\n end\n end", "def move_by(x_delta, y_delta)\n if respond_to?(:x) && respond_to?(:y) && respond_to?(:x=) && respond_to?(:y=)\n if default_x?\n self.x_delta += x_delta\n else\n self.x += x_delta\n end\n if default_y?\n self.y_delta += y_delta\n else\n self.y += y_delta\n end\n end\n end", "def notifyObjectsDragMove(iSelection)\n @DragSelection = iSelection\n @DragMode = Wx::DRAG_MOVE\n notifyRegisteredGUIs(:onObjectsDragMove, @DragSelection)\n end", "def process_movement\n # Move the cursor back to the selected unit\n proc = Proc.new{@unit.selected = false\n @unit.sprite.move(@passed_positions.clone)\n @unit.stop_capture if @passed_positions.size != 0\n @passed_positions = []}\n cursor.add_move_action(@unit.x, @unit.y, proc, 0, nil, true)\n # Delete the arrow path graphics and move-range tiles\n @arrow_path.each{|a| a.dispose}\n @arrow_path = []\n remove_ranges\n # Disable input, proceed to moving unit\n cursor.disable_input = true\n @phase = 4\n end", "def move_forward\r\r\n @move_poll+= [[@direction, true]] * (32.0 / CXJ::FREE_MOVEMENT::PIXELS_PER_STEP).ceil\r\r\n end", "def update_move\n return unless @moving\n movinc = @move_speed == 0 ? 1 : @move_speed\n if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0\n self.x += movinc if self.x < @destx\n self.x -= movinc if self.x > @destx\n self.y += movinc if self.y < @desty\n self.y -= movinc if self.y > @desty\n @move_old = Graphics.frame_count\n end\n if @move_speed > 1 # Check if sprite can't reach that point\n self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and\n (@destx - self.x).abs <= @move_speed\n self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and\n (@desty - self.y).abs <= @move_speed\n end\n if self.x == @destx and self.y == @desty\n @moving = false\n end\nend", "def start_dragging(start_position)\n @dragging = true\n @start_position = start_position\n end", "def scroll_mouse(x_amount, y_amount)\n send_request RequestMessage.new(mouse_wheel_message: MouseWheel.new(x_scroll: x_amount, y_scroll: y_amount))\n end", "def move(x, y, speed = 1, delay = 0)\n @destx = x\n @desty = y\n @move_speed = speed\n @move_delay = delay\n @move_old = Graphics.frame_count\n @moving = true\nend", "def mouse_x_update(val)\n $mouse_x += val\n sc_osc \"/n_set\", $synth_g, \"x\", $mouse_x\nend", "def unit_move_tb(x,y)\n @tb_event.flash_soft_tb = false if @tb_event\n give_move_command(@tb_event)\n @tb_event.tb_unit.used_action(:move, @tb_event.tb_unit.move)\n @showing_temp_hls = false\n end", "def update_mouse_selector_move\n return unless Mouse.moved || Mouse.trigger?(:left) # Safety preventing index conflict\n @team_buttons.each_with_index do |btn, i|\n next unless btn.simple_mouse_in?\n update_selector_coordinates(@index = i) if @index != i\n action_A if Mouse.trigger?(:left)\n return true\n end\n end", "def move_to(x, y, nb_frame)\n @moving = true\n @move_frame = nb_frame\n @move_total = nb_frame\n @new_x = x\n @new_y = y\n @del_x = self.x - x\n @del_y = self.y - y\n end", "def dragging(button, x, y)\n# puts \"DRAGGING!\"\n @x = x\n @y = y\n end", "def show_move_range_tb(x,y, hloc = :def)\n e = Era::AI.show_move_range_tb(x, y, hloc)\n turn_off_flash_tbe\n can_move = e && e.tb_unit.is_friend? && (@tb_event = e) && can_move?\n @move_pos_selecting = true if can_move\n end", "def mouseMove(event)\n self.sprites.each do | sprite |\n sprite.mouseMove(event.pos) if sprite.respond_to?(:mouseMove)\n end\n end", "def update_mouse_blink_position\n case $game_player.mouse_over\n when 1 then @mouse_blink.x = @layout.x + (5)\n when 2 then @mouse_blink.x = @layout.x + (5 + 32)\n when 3 then @mouse_blink.x = @layout.x + (5 + 64)\n when 4 then @mouse_blink.x = @layout.x + (5 + 96)\n when 5 then @mouse_blink.x = @layout.x + (5 + 128)\n when 6 then @mouse_blink.x = @layout.x + (5 + 160)\n when 7 then @mouse_blink.x = @layout.x + (5 + 192)\n when 8 then @mouse_blink.x = @layout.x + (5 + 224)\n when 9 then @mouse_blink.x = @layout.x + (5 + 256)\n end\n end", "def picture_scroll_x(ids, speed = nil)\n return pictures[ids].scroll_speed_x unless speed\n select_pictures(ids).each {|id| pictures[id].scroll_speed_x = speed}\n end", "def move\n position_after_move = @position.new_coordinates_for_step_size(@direction.step_size_for_x_axis, @direction.step_size_for_y_axis)\n\n #ignore the command if robot is being out off tabletop\n if(@table_top.has_within_bounds?(position_after_move))\n @position = @position.new_coordinates_for(@direction.step_size_for_x_axis, @direction.step_size_for_y_axis)\n\n end\n end", "def scroll_speed() 6 end", "def check_limits_on_x_and_y\n\t\tself.x = self.window.limit_max_x if x > self.window.limit_max_x \n\t\tself.y = self.window.limit_min_y if y > self.window.limit_max_y \n\tend", "def update\n if (sprite = @dragging)\n return end_drag(sprite) unless Mouse.press?(:left)\n update_drag(sprite)\n else\n return unless Mouse.trigger?(:left)\n proc_to_call = nil\n @sprites_to_drag.each do |sprite2drag, procs|\n next unless sprite2drag.simple_mouse_in? # Start dragging only if the mouse is inside\n next if @dragging && @dragging.z >= sprite.z # Fix z-fighting\n proc_to_call = procs[:start_drag]\n # Put the sprite in dragging state\n @dragging = sprite2drag\n end\n if @dragging\n proc_to_call&.call(@dragging)\n # Save the @last_x and @last_y\n @last_x = Mouse.x\n @last_y = Mouse.y\n end\n end\n end", "def process_cursor_move\n #==========================================================================\n # First we set oldpage to the current page number, so that we can check\n # if the page ended up changing. Then we check if the player has pressed\n # left - if they have and we are not on the first page, we go back a\n # page. After that we check if they have pressed right, and go forward if\n # we are not on the last page. Then we move on to scrolling up and down\n # within a page - if they hit up and are not at the top of the page, it\n # will scroll up, and if they hit down and are not at the bottom of the\n # page it will scroll down. After we are done checking for input, we\n # redraw the page if the page has changed.\n #==========================================================================\n if @changed\n @changed = false\n return\n end\n oldpage = @page\n if Input.trigger?(:LEFT) && 1 < @page\n @page -= 1\n elsif Input.trigger?(:RIGHT) && @page < max_pages\n @page += 1\n elsif ((Input.press?(:UP)) if Input.repeat?(:UP)) && self.oy > 0\n self.oy -= [scroll_speed, [0, (height+oy+contents_height-24)].min.abs].max\n draw_scroll\n elsif ((Input.press?(:DOWN)) if Input.repeat?(:DOWN))\n self.oy += [scroll_speed, [0, contents_height + 24 - height - oy].max].min\n draw_scroll\n end\n if oldpage != @page\n refresh and @changed = true\n end\n return true\n end", "def update_mouse_tiles\n mx = (Mouse.pos[0] / 32) ; my = (Mouse.pos[1] / 32)\n case [mx, my]\n when [Tile_X, Tile_Y] then $game_player.mouse_over = 1\n when [Tile_X + 1, Tile_Y] then $game_player.mouse_over = 2\n when [Tile_X + 2, Tile_Y] then $game_player.mouse_over = 3\n when [Tile_X + 3, Tile_Y] then $game_player.mouse_over = 4\n when [Tile_X + 4, Tile_Y] then $game_player.mouse_over = 5\n when [Tile_X + 5, Tile_Y] then $game_player.mouse_over = 6\n when [Tile_X + 6, Tile_Y] then $game_player.mouse_over = 7\n when [Tile_X + 7, Tile_Y] then $game_player.mouse_over = 8\n when [Tile_X + 8, Tile_Y] then $game_player.mouse_over = 9\n else \n $game_player.mouse_over = 0 if $game_player.mouse_over != 0\n end\n if $game_player.mouse_over > 0\n create_mouse_blink\n update_mouse_blink_position\n @mouse_blink.opacity -= 3\n @mouse_blink.opacity = 70 if @mouse_blink.opacity <= 6\n else\n dispose_mouse_blink\n end\n end", "def update_move\n return unless @moving\n \n grad = direction(@destx,@desty,self.x,self.y)\n \n if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0\n self.x += Math.cos(grad).abs * @move_speed if self.x < @destx\n self.y += Math.sin(grad).abs * @move_speed if self.y < @desty\n self.x -= Math.cos(grad).abs * @move_speed if self.x > @destx\n self.y -= Math.sin(grad).abs * @move_speed if self.y > @desty\n \n @move_old = Graphics.frame_count\n end\n if @move_speed > 0 # Check if sprite can't reach that point\n self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and\n (@destx - self.x).abs <= @move_speed\n self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and\n (@desty - self.y).abs <= @move_speed\n end\n if self.x == @destx and self.y == @desty\n @moving = false\n end\n end", "def distance_per_frame\r\n 2 ** real_move_speed / 256.0\r\n end", "def fire_events_for_mouse_movement\n current_state.each {|cs| cs.fire_events_for_mouse_movement }\n end", "def set(left_value, right_value)\n @left.analog_speed = left_value\n @right.analog_speed = right_value\n end", "def scroll_left (x1,x2,y1,y2)\r\n #driver.swipe(start_x: 1000, end_x: 100, start_y: y, end_y: y, duration: 1000)\r\n #driver.swipe(start_x: x1, end_x: x2, start_y: y1, end_y: y2, duration: 1000)\r\n scroll_in_any_direction(x1,x2,y1,y2)\r\n end", "def mouseDragged event\n end", "def update_auto_movement\n return if @movement_options[:moving]\n distance = @movement_options[:distance] || @width\n delay = @movement_options[:delay] || 1\n if @movement_options[:type].to_s == 'random'\n Thread.new { random_movement(distance, delay) }\n end\n end", "def move\n @x = (@x + @x_velocity) % Window.width\n @y = (@y + @y_velocity) % Window.height\nend", "def step_cursor()\r\n unless @@busy_cursors \r\n self.class.send(:get_cursors)\r\n end\r\n \r\n @cursor_index = (@cursor_index + 1) % 8\r\n UI.set_cursor(@@busy_cursors[@cursor_index]) if @mouse_in_viewport\r\n end", "def onMouseMove(flags, x, y, view)\n if( @state == 0 )\n # We are getting the first end of the line. Call the pick method\n # on the InputPoint to get a 3D position from the 2D screen position\n # that is passed as an argument to this method.\n @ip.pick view, x, y\n if( @ip != @ip1 )\n # if the point has changed from the last one we got, then\n # see if we need to display the point. We need to display it\n # if it has a display representation or if the previous point\n # was displayed. The invalidate method on the view is used\n # to tell the view that something has changed so that you need\n # to refresh the view.\n view.invalidate if( @ip.display? or @ip1.display? )\n @ip1.copy! @ip\n\n # set the tooltip that should be displayed to this point\n view.tooltip = @ip1.tooltip\n end\n else\n # Getting the second end of the line\n # If you pass in another InputPoint on the pick method of InputPoint\n # it uses that second point to do additional inferencing such as\n # parallel to an axis.\n @ip2.pick view, x, y, @ip1\n view.tooltip = @ip2.tooltip if( @ip2.valid? )\n view.invalidate\n\n # Update the length displayed in the VCB\n if( @ip2.valid? )\n length = @ip1.position.distance(@ip2.position)\n Sketchup::set_status_text length.to_s, SB_VCB_VALUE\n end\n\n # Check to see if the mouse was moved far enough to create a line.\n # This is used so that you can create a line by either dragging\n # or doing click-move-click\n if( (x-@xdown).abs > 10 || (y-@ydown).abs > 10 )\n @dragging = true\n end\n end\n end", "def update_selector_move\n party_size = @team_buttons.size\n index2 = @index % 2\n if Input.trigger?(:DOWN)\n next_index = @index + 2\n next_index = index2 if next_index >= party_size\n update_selector_coordinates(@index = next_index)\n elsif Input.trigger?(:UP)\n next_index = @index - 2\n if next_index < 0\n next_index += 6\n next_index -= 2 while next_index >= party_size\n end\n update_selector_coordinates(@index = next_index)\n elsif index_changed(:@index, :LEFT, :RIGHT, party_size - 1)\n update_selector_coordinates\n else\n update_mouse_selector_move\n end\n end", "def change_speed\n @statistics[:speed_changes] += 1\n # pick a coordination to change speed for\n @changed_coord = @coordinations.rand\n @previous_speed = @current_speed[@changed_coord]\n @current_speed[@changed_coord] = @previous_speed + SPEED_CHANGE_OPTIONS.rand\n delta_eval(@changed_coord)\n end", "def start_drag(button, x, y)\n# puts \"START DRAGGING!\"\n end", "def move(xplace, yplace, relative, refresh_flag)\n windows = [@win, @list_win, @shadow_win, @scrollbar_win]\n self.move_specific(xplace, yplace, relative, refresh_flag,\n windows, [])\n end", "def move_dist(deltx, delty)\n @x += deltx\n @y += delty\n normalize\n end", "def cursor_scroll_dn\n @cursor_movement = :down\n @old_cursor = @cursor\n move_to(pos + MSCROLL)\nend", "def move\n self.speed += random_vector(0.5)\n self.position.x -= window.current_speed/4\n bounce_off_border_y\n on_hitting_x { destroy!; return }\n end", "def move_to(x, y, speed = 2)\n @new_x = x\n @new_y = y\n @speed = speed\n end", "def generate_moves\n @delta.each do |step|\n new_pos = [@pos[0] + step[0], @pos[1] + step[1]]\n @move_list << new_pos if valid_coord?(new_pos)\n end\n end", "def update_move\n if in_quicksand?\n slowdown = distance_per_frame * [qcks_max_slow_down, (1 - @sunk*qcks_slow_down)].max\n @real_x = [@real_x - slowdown, @x].max if @x < @real_x\n @real_x = [@real_x + slowdown, @x].min if @x > @real_x\n @real_y = [@real_y - slowdown, @y].max if @y < @real_y\n @real_y = [@real_y + slowdown, @y].min if @y > @real_y\n update_bush_depth\n else\n mrts_qcksnd_update_move\n end\n end", "def cursor(dst_loc)\n start_arr ||= execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES mouse location\n end tell\n `).to_s.split(',').collect{|p| p.to_s.to_i}\n start_loc = {:x=>start_arr[0], :y=>start_arr[1]}\n dist = {\n :x=>(start_loc[:x] - dst_loc[:x]),\n :y=>(start_loc[:y] - dst_loc[:y])\n }\n steps = dist.values.collect{|p| p.to_s.to_i.abs}.max / 10.0\n \n dist = {:x=>dist[:x] / BigDecimal.new(steps.to_s), :y=>dist[:y] / BigDecimal.new(steps.to_s)}\n \n execute_applescript(%Q`\n tell application \"Extra Suites\"\n set x to #{start_loc[:x]}\n set y to #{start_loc[:y]}\n repeat while x #{dist[:x] > 0 ? '>' : '<'} #{dst_loc[:x]} or y #{dist[:y] > 0 ? '>' : '<'} #{dst_loc[:y]}\n ES move mouse {x, y}\n set x to x - #{dist[:x].round(2)}\n set y to y - #{dist[:y].round(2)}\n delay 1.0E-6\n end repeat\n ES move mouse {#{dst_loc[:x]}, #{dst_loc[:y]}}\n end tell\n `)\n end", "def move(x,y=@y)\r\n @x2=x+(@x2-@x1)\r\n @y2=y+(@y2-@y1)\r\n @y1=y\r\n @x1=x\r\n end", "def store_mouse_speed variable_name\r\n command 'storeMouseSpeed', variable_name\r\n end", "def update_cursor\n cursor_rect.set((@index % 2) * DELTA_X, (@index / 2) * DELTA_Y)\n $game_system.se_play($data_system.cursor_se)\n end", "def cursor_scroll_dn\n moveto(pos() + MSCROLL)\nend", "def cursor_scroll_dn\n moveto(pos() + MSCROLL)\nend", "def pile_over(a, b)\n move_array(a, b)\n end", "def move\n request_animation_frame { move } if @mouse_is_down\n return if !@position || !@started\n trigger 'move', @position\n end", "def mouse_wheel_delta_x(delta)\n @driver.sc_mouse_wheel_delta_x action_target, delta, *action_locator_args\n stall :mouse_wheel\n end", "def move(x, y)\n start_time = Time.now\n xdotool \"windowmove #{@id} #{x} #{y}\"\n # Inconsistencies exist between xwininfo and xdotool.\n # \"xdotool windowmove\" is local to the selected monitor, not reflecting the\n # true coordinates of the X session. Using the screen geometry determined,\n # we can get around this.\n while [x+$screen_geometry[0][0], y+$screen_geometry[0][1]] != get_position(@id)\n puts \"#{get_position(@id)}\"\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not react - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end", "def move(x,y)\n @x +=x\n @y +=y\n end", "def moving(range, destination)\n return if range.count == 0\n\n @access.begin_move(range.min, range.max, destination)\n ret = yield\n @access.end_move\n ret\n end", "def update_move\n update_last_coordinate\n @point.update_move\n update_placement\n move_animation(diff_x, diff_y)\n end", "def move(window)\n\t\t# use the velocities to move the x and y\n\t\t@x = @x + @vx\n\t\t@y = @y + @vy\n\t\t# if the star hits the left edge change the vx to positive 5\n\t\tif @x < 0\n\t\t\t@vx = 5\n\t\tend\n\t\t# if the star hits the right side of the screen change the vx to negative 5\n\t\tif @x > window.width - @image.width\n\t\t\t@vx = -5\n\t\tend\n\t\t# if the star hits the top of the screen change the vy to positive 5\n\t\tif @y < 0\n\t\t\t@vy = 5\n\t\tend\n\t\t# if the star hits the bottom of the screen change the vy to negative 5 \n\t\tif @y > window.height - @image.height\n\t\t\t@vy = -5\n\t\tend\n\tend", "def set(max, position)\n @max = max\n @number = 1\n @cursor_y = position\n refresh\n end", "def move!\n\t\tbounce! until !will_bounce? #TODO add surroundedness checking\n\t\t@x += @@target_coords[@direction][:dx]\n\t\t@y += @@target_coords[@direction][:dy]\n\tend", "def Pager_ForwardMouse(hwnd, bForward) send_pager_message(hwnd, :FORWARDMOUSE, wparam: bForward) end", "def update_drag(sprite)\n return @dragging = nil unless (procs = @sprites_to_drag[sprite])\n mx = Mouse.x.clamp(0, Graphics.width - 1)\n my = Mouse.y.clamp(0, Graphics.height - 1)\n dx = mx - @last_x\n dy = my - @last_y\n @last_x = mx\n @last_y = my\n return if dx == 0 && dy == 0\n sprite.set_position(sprite.x + dx, sprite.y + dy)\n procs[:update_drag]&.call(sprite)\n end", "def move_effect(duration, x, y)\n if @temp_basic_step_x == nil && @temp_basic_step_y == nil\n @temp_basic_step_x = x / duration.to_f\n @temp_basic_step_y = y / duration.to_f\n \n @we_move_start_x = self.x\n @we_move_start_y = self.y\n end\n \n step_x = x - (duration * @temp_basic_step_x)\n step_y = y - (duration * @temp_basic_step_y)\n\n self.x = @we_move_start_x + step_x\n self.y = @we_move_start_y + step_y\n\n if duration == 0\n @temp_basic_step_x = nil\n @temp_basic_step_y = nil\n @we_move_start_x = nil\n @we_move_start_y = nil\n end\n end", "def test_moveTo_Speed\n w = Window_Base.new(500, 100, 100, 50)\n @windows.push(w)\n w.animationSpeed = 2000\n w.moveTo(500, 150)\n return true\n end", "def drag_and_drop locator, movements_string\r\n command 'dragAndDrop', locator, movements_string\r\n end", "def process_movement\n # Delete the graphics associated to moving\n @ranges.each{|tile| tile.visible = false}\n @ranges = []\n @arrow_path.each{|a| a.dispose}\n @arrow_path = []\n # Move the cursor back to the selected unit\n proc = Proc.new{@selected_unit.selected = false\n @show_move = false\n @selected_unit.sprite.move(@passed_positions)\n @selected_unit.stop_capture if @passed_positions.size != 0}\n cursor.add_move_action(@selected_unit.x, @selected_unit.y, proc)\n # go to phase 3\n @phase = 3\n end", "def move_to(x, y); end", "def interpret_move(step_left = distance_per_frame)\r\r\n current_move = super(step_left)\r\r\n @last_poll.push(current_move) if !current_move.nil?\r\r\n end", "def drag_to_order_internal( dimension, items, positions )\n if items.length == 1\n return true\n end\n\n while true\n current=$driver.find_element( items[0][0].to_sym, items[0][1] )\n\n current_loc = current.location.send( dimension )\n jitter = 0\n if dimension == :x\n jitter = current.size.width\n else\n jitter = current.size.height\n end\n\n diff = positions[0] - current_loc\n\n $debug and print \"In drag_to_order_internal: current: #{current}\\n\"\n $debug and print \"In drag_to_order_internal: d0: #{positions[0]}\\n\"\n $debug and print \"In drag_to_order_internal: current_loc: #{current_loc}\\n\"\n $debug and print \"In drag_to_order_internal:diff : #{diff}\\n\"\n\n # Increase the absolute value of diff slightly, and keep the\n # sign\n fixed_diff = diff != 0 ? ((diff.abs + jitter - 1) * (diff/diff.abs)) : 0\n if diff.abs > jitter\n x = 0\n y = 0\n if dimension == :x\n x = [ fixed_diff, (diff * 1.2).to_i ].max\n end\n if dimension == :y\n y = [ fixed_diff, (diff * 1.2).to_i ].max\n end\n\n hover_and_move_slow( items[0][0].to_sym, items[0][1], x, y )\n else\n break\n end\n end\n\n drag_to_order_internal( dimension, items[1..-1], positions[1..-1] )\n end", "def mouse_move_at locator, coord_string\r\n command 'mouseMoveAt', locator, coord_string\r\n end", "def update_mouse(moved)\n @buttons.each_with_index do |button, index|\n next unless button.simple_mouse_in?\n if moved\n last_index = @index\n @index = index\n if last_index != index\n update_buttons\n play_cursor_se\n end\n elsif Mouse.trigger?(:LEFT)\n @index = index\n update_buttons\n play_decision_se\n action\n end\n return false\n end\n return true\n end", "def cursor_dn\n @cursor_movement = :down\n @old_cursor = @cursor\n move_to(pos + 1)\nend", "def set_bounds(list_start, list_end)\n @start, @end = list_start, list_end\n end" ]
[ "0.55520976", "0.53963435", "0.53243816", "0.5292193", "0.52682006", "0.52484757", "0.51959443", "0.5171521", "0.5144172", "0.5103676", "0.50555176", "0.50542754", "0.5039077", "0.49192286", "0.48991948", "0.48554626", "0.48400736", "0.48159108", "0.47878376", "0.47598165", "0.47375724", "0.47286758", "0.4721525", "0.4715532", "0.47126034", "0.4712", "0.46995485", "0.46803015", "0.46590006", "0.46433118", "0.46334708", "0.4619276", "0.46181345", "0.46067536", "0.46006662", "0.45998248", "0.45959437", "0.45911586", "0.4584568", "0.45788836", "0.45745125", "0.456737", "0.45629168", "0.45627758", "0.4549449", "0.4549236", "0.4545036", "0.4543987", "0.45407438", "0.4533793", "0.4524083", "0.4507629", "0.45070738", "0.45054483", "0.44990808", "0.44933408", "0.4491929", "0.4473802", "0.44727147", "0.4467423", "0.4464718", "0.4463992", "0.44550425", "0.4454022", "0.44535652", "0.4431951", "0.44305515", "0.44258654", "0.4425252", "0.4423065", "0.4418278", "0.4412677", "0.44099146", "0.44088572", "0.43981045", "0.4394771", "0.4394771", "0.43915388", "0.4386343", "0.43857962", "0.43656206", "0.43620202", "0.43528366", "0.43441635", "0.4343439", "0.43426234", "0.43392354", "0.43343705", "0.43341425", "0.43300813", "0.43258834", "0.43193424", "0.43154258", "0.43139422", "0.4300635", "0.4298957", "0.42978507", "0.429671", "0.42964062", "0.42955852" ]
0.59022546
0
Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.
def shift_key_down command 'shiftKeyDown' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def shift_down\n if GameWindow.instance.button_down?(Gosu::KbRightShift) || GameWindow.instance.button_down?(Gosu::KbLeftShift)\n true\n else\n false\n end\n end", "def ctrl_w() send_keys(:ctrl_w) end", "def shift\n conn.lpop key\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def load_page_with_key_press(key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_loaded(\"\")\n end", "def while_key_up *args\n\t\t\tevent(:while_key_up, *args)\n\t\tend", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\nend", "def control_key_down\r\n command 'controlKeyDown'\r\n end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def shift() end", "def shift() end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def shift; end", "def shift; end", "def send_modified_key(element_selector, key, *meta)\n wait_for_loading\n \n key_string = key\n key_string = \"alt+\" + key_string if meta.include? :alt\n key_string = \"ctrl+\" + key_string if meta.include? :control\n key_string = \"command+\" + key_string if meta.include? :command\n\n page.driver.execute_script(\"Mousetrap.trigger('#{key_string}');\")\n end", "def onKeyDown(key, repeat, flags, view)\r\n if key == VK_END # toggle zig direction\r\n toggle_direc_flag()\r\n end\r\n if key == VK_HOME # toggle use of flood fill\r\n @flood = !@flood\r\n if (@flood)\r\n @statusmsg = @statusmsgBase2 + \"FLOOD #{@stepover_percent}%\"\r\n else\r\n @statusmsg = @statusmsgBase + \"StepOver #{@stepover_percent}%\"\r\n end\r\n Sketchup::set_status_text(@statusmsg, SB_PROMPT)\r\n end\r\n\r\n if (key == VK_SHIFT)\r\n @keyflag = 1\r\n else\r\n if (key == VK_CONTROL)\r\n @keyflag = 2\r\n else\r\n super #process other keys for depth selection\r\n end\r\n end\r\n end", "def ctrl_l() send_keys(:ctrl_l) end", "def resume(view)\n @ctrlDown = false\n @shiftDown = false\n end", "def alt_key_down\r\n command 'altKeyDown'\r\n end", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def shift\n end", "def shift\n end", "def shift\n end", "def meta_key_down\r\n command 'metaKeyDown'\r\n end", "def keyctrl_d(*)\n @stop = true\n end", "def send_key(keycode, ctrl=false, alt=false, shift=false)\n matchingshortcuts = @shortcuts.select { |shortcut|\n shortcut.keycode == keycode && shortcut.ctrl == ctrl &&\n shortcut.alt == alt && shortcut.shift == shift\n }\n counter = 0\n matchingshortcuts.each { |shortcut|\n action = shortcut.action\n @actions[action].each { |handler|\n handler.call(shortcut)\n counter+=1\n }\n }\n counter\n end", "def hotkeys\n loop do\n c = @screen.getch\n\n case c\n when Ncurses::KEY_DOWN, 14, 'j'.ord\n scroll_down\n\n when Ncurses::KEY_UP, 16, 'k'.ord\n scroll_up\n\n when Ncurses::KEY_NPAGE\n (maxy - 2).times do\n break if !scroll_down\n end\n\n when Ncurses::KEY_PPAGE\n (maxy - 2).times do\n break if !scroll_up\n end\n\n when Ncurses::KEY_LEFT\n while scroll_up; end\n\n when Ncurses::KEY_RIGHT\n while scroll_down; end\n\n when 'q'.ord\n break\n\n when @callbacks[c]\n true\n\n end\n\n @screen.move(0, 0)\n end\n end", "def zoom_in_out(in_out)\n if get_os==\"windows\"\n key=\"control\"\n elsif get_os==\"mac\"\n key=\"command\"\n end\n\n $driver.action.key_down(:\"#{key}\").send_keys(:\"#{in_out}\").key_up(:\"#{key}\").perform\nend", "def upcase?\r\n\t\treturn !press?(:SHIFT) if GetCapState.call(VALUES[:CAPS]) == 1\r\n\t\treturn true if press?(:SHIFT)\r\n\t\treturn false\r\n\tend", "def meta_key_up\r\n command 'metaKeyUp'\r\n end", "def zoom_in_out_till_element_display(access_type, in_out, access_name)\n \n if get_os==\"windows\"\n key=\"control\"\n elsif get_os==\"mac\"\n key=\"command\"\n end\n\n while true\n \n if WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}.displayed?\n break\n else\n $driver.action.key_down(:\"#{key}\").send_keys(:\"#{in_out}\").key_up(:\"#{key}\").perform\n end\n end\n\nend", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def press(key_sequence)\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n \n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n\n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\n end", "def pressKeyToContinue\n puts \"\\n-- press any key to continue --\"\n gets\nend", "def key_down key\n @keys.push key\n end", "def getchar \n while true \n ch = getch\n #$log.debug \"window getchar() GOT: #{ch}\" if ch != -1\n if ch == -1\n # the returns escape 27 if no key followed it, so its SLOW if you want only esc\n if @stack.first == 27\n #$log.debug \" -1 stack sizze #{@stack.size}: #{@stack.inspect}, ch #{ch}\"\n case @stack.size\n when 1\n @stack.clear\n return 27\n when 2 # basically a ALT-O, this will be really slow since it waits for -1\n ch = 128 + @stack.last\n @stack.clear\n return ch\n when 3\n $log.debug \" SHOULD NOT COME HERE getchar()\"\n end\n end\n @stack.clear\n next\n end\n # this is the ALT combination\n if @stack.first == 27\n # experimental. 2 escapes in quick succession to make exit faster\n if ch == 27\n @stack.clear\n return ch\n end\n # possible F1..F3 on xterm-color\n if ch == 79 or ch == 91\n #$log.debug \" got 27, #{ch}, waiting for one more\"\n @stack << ch\n next\n end\n #$log.debug \"stack SIZE #{@stack.size}, #{@stack.inspect}, ch: #{ch}\"\n if @stack == [27,79]\n # xterm-color\n case ch\n when 80\n ch = KEY_F1\n when 81\n ch = KEY_F2\n when 82\n ch = KEY_F3\n when 83\n ch = KEY_F4\n end\n @stack.clear\n return ch\n elsif @stack == [27, 91]\n if ch == 90\n @stack.clear\n return 353 # backtab\n end\n end\n # the usual Meta combos. (alt)\n ch = 128 + ch\n @stack.clear\n return ch\n end\n # append a 27 to stack, actually one can use a flag too\n if ch == 27\n @stack << 27\n next\n end\n return ch\n end\n end", "def onKeyDown(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY && repeat == 1 )\n @shift_down_time = Time.now\n \n # if we already have an inference lock, then unlock it\n if( view.inference_locked? )\n # calling lock_inference with no arguments actually unlocks\n view.lock_inference\n elsif( @state == 0 && @ip1.valid? )\n view.lock_inference @ip1\n elsif( @state == 1 && @ip2.valid? )\n view.lock_inference @ip2, @ip1\n end\n end\nend", "def rekey!; end", "def rekey!; end", "def shift_in\n end", "def any_key\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def getchar \n while 1 \n ch = getch\n #$log.debug \"window getchar() GOT: #{ch}\" if ch != -1\n if ch == -1\n # the returns escape 27 if no key followed it, so its SLOW if you want only esc\n if @stack.first == 27\n #$log.debug \" -1 stack sizze #{@stack.size}: #{@stack.inspect}, ch #{ch}\"\n case @stack.size\n when 1\n @stack.clear\n return 27\n when 2 # basically a ALT-O, this will be really slow since it waits for -1\n ch = 128 + @stack.last\n @stack.clear\n return ch\n when 3\n $log.debug \" SHOULD NOT COME HERE getchar()\"\n end\n end\n @stack.clear\n next\n end\n # this is the ALT combination\n if @stack.first == 27\n # experimental. 2 escapes in quick succession to make exit faster\n if ch == 27\n @stack.clear\n return ch\n end\n # possible F1..F3 on xterm-color\n if ch == 79 or ch == 91\n #$log.debug \" got 27, #{ch}, waiting for one more\"\n @stack << ch\n next\n end\n #$log.debug \"stack SIZE #{@stack.size}, #{@stack.inspect}, ch: #{ch}\"\n if @stack == [27,79]\n # xterm-color\n case ch\n when 80\n ch = KEY_F1\n when 81\n ch = KEY_F2\n when 82\n ch = KEY_F3\n when 83\n ch = KEY_F4\n end\n @stack.clear\n return ch\n elsif @stack == [27, 91]\n if ch == 90\n @stack.clear\n return KEY_BTAB # backtab\n end\n end\n # the usual Meta combos. (alt)\n ch = 128 + ch\n @stack.clear\n return ch\n end\n # append a 27 to stack, actually one can use a flag too\n if ch == 27\n @stack << 27\n next\n end\n return ch\n end\n end", "def process_key(key)\n case KeyHelper.key_symbol(key)\n when :up\n @past_menu = @cur_menu\n @cur_menu = (@cur_menu - 1) % @items.size\n when :down\n @past_menu = @cur_menu\n @cur_menu = (@cur_menu + 1) % @items.size\n when :enter\n # Erase body after call\n @past_menu = nil\n term.echo\n return :break, @items[@cur_menu].menu\n end\n\n return if key[0] != Ncurses::OK\n @items.each_with_index do |item, i|\n next unless key[2] =~ item.shortcut_regex\n @past_menu = @cur_menu\n @cur_menu = i\n end\n end", "def press_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_down @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def move_down(n); print \"\\e[#{n}B\" end", "def getch\n FFI::NCurses.wtimeout(@pointer, $ncurses_timeout || 1000)\n c = FFI::NCurses.wgetch(@pointer)\n if c == 27 ## {{{\n\n # don't wait for another key\n FFI::NCurses.nodelay(@pointer, true)\n k = FFI::NCurses.wgetch(@pointer)\n if k == -1\n # wait for key\n #FFI::NCurses.nodelay(@pointer, false)\n return 27\n else\n buf = \"\"\n loop do\n n = FFI::NCurses.wgetch(@pointer)\n break if n == -1\n buf += n.chr\n end\n # wait for next key\n #FFI::NCurses.nodelay(@pointer, false)\n\n # this works for all alt-keys but it messes with shift-function keys\n # shift-function keys start with M-[ (91) and then have more keys\n if buf == \"\"\n return k + 128\n end\n #$log.debug \" getch buf is #{k.chr}#{buf} \"\n # returning a string key here which is for Shift-Function keys or other undefined keys.\n key = 27.chr + k.chr + buf\n return key\n\n end\n end ## }}}\n #FFI::NCurses.nodelay(@pointer, false) # this works but trying out for continueous updates\n c\n rescue SystemExit, Interrupt \n 3 # is C-c\n rescue StandardError\n -1 # is C-c\n end", "def down(key)\n key = normalize_keys(Array(key)).first\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: type, **key)\n self\n end", "def button_up(key)\n close if key == Gosu::KbEscape\n\n # reset the game\n if @state == :end && key == Gosu::MsLeft\n @board = Board.new(self, 22, @root_dir)\n @state = :game\n return\n end\n\n @player_b.ai_inc if key == Gosu::KbS\n @player_b.ai_dec if key == Gosu::KbD\n\n if @player_on_turn.class == HotseatPlayer && key == Gosu::MsLeft\n if @board.cell_clicked(mouse_x, mouse_y, @player_on_turn.sym)\n\n return if @state == :end\n\n switch_players\n\n if @player_on_turn.class == AIPlayer\n @player_on_turn.make_move(@board)\n switch_players\n end\n end\n end\n end", "def press key, options = {}\n key = 'Return' if key == 'ENTER'\n widget = options[:in] || Gtk::Window.toplevels.first\n event = Gdk::EventKey.new(Gdk::Event::KEY_PRESS)\n event.window = widget\n event.state |= Gdk::Window::CONTROL_MASK if key =~ /CTRL+/\n event.state |= Gdk::Window::MOD1_MASK if key =~ /ALT+/\n event.state |= Gdk::Window::SHIFT_MASK if key =~ /SHIFT+/\n event.keyval = Gdk::Keyval.from_name(key.split('+').last)\n widget.grab_focus\n event.send_event = true\n entry = Gdk::Keymap.default.get_entries_for_keyval(event.keyval).first\n event.hardware_keycode = entry[0]\n widget.signal_emit('key_press_event', event)\n process_events\nend", "def pagedown\n page.driver.browser\n .execute_script('return document.body')\n .send_keys(:page_down)\n end", "def wcursyncup\n Ncurses.wcursyncup(pointer)\n end", "def shiftGbk\n\nend", "def shift(text, shift_num)\n\t\t\tClassicalCrypto::Utils::Text.substitute(text) do |ch| \n\t\t\t\tClassicalCrypto::Utils::Text.shift_alpha ch, shift_num\n\t\t\tend\n\t\tend", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def back_main_menu\n puts \"\\n\\n Press any key to go back to the main menu\"\n $stdin.getch\n clear\nend", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def process_pagedown\n Sound.play_cursor\n Input.update\n call_handler(:pagedown)\n end", "def cut\n\n # FIXME\n if OperaWatir::Platform.os == :macosx\n keys.send [:command, 'x']\n else\n keys.send [:control, 'x']\n end\n end", "def button_down_game_replay_presenter(id, window, state)\n if id == Gosu::KbSpace\n navigate_back(window) if id == Gosu::KbSpace\n end\n level_up(state) if id == Gosu::KbRight\n level_down(state) if id == Gosu::KbLeft\nend", "def setShift(sx,sy) \n @device.setShift(sx,sy) \n end", "def wsyncup\n Ncurses.wsyncup(pointer)\n end", "def update_other_commands\n return unless active && cursor_movable?\n shift_left if Input.repeat?(:LEFT)\n shift_right if Input.repeat?(:RIGHT)\n #shift_left(true) if Input.repeat?(:L)\n #shift_right(true) if Input.repeat?(:R)\n action if Input.trigger?(:C) && enable?(item)\n end", "def restart\n while get_state() == 'LOST'\n # Press a key to get score.\n @driver.action.send_keys(:up).perform\n sleep(0.2)\n end\n\n while get_state() == 'MENU'\n @driver.action.send_keys(:space).perform\n sleep(0.2)\n end\n\n @driver.action.send_keys(:space).perform\n end", "def getch\n @window.getch\n end", "def handle_key ch\n if ch == 32\n toggle\n else\n super\n end\n end", "def move_for_keypress(window, pressed_buttons)\n # Generated once for each keypress\n until pressed_buttons.empty?\n button = pressed_buttons.shift\n case button\n when Gosu::KbUp then return :flip\n when Gosu::KbP then @conn.send_ping; return nil\n when Gosu::KbLeft, Gosu::KbRight # nothing\n else puts \"Ignoring key #{button}\"\n end\n end\n\n # Continuously-generated when key held down\n case\n when window.button_down?(Gosu::KbLeft) then :slide_left\n when window.button_down?(Gosu::KbRight) then :slide_right\n end\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def process_pageup\n Sound.play_cursor\n Input.update\n call_handler(:pageup)\n end", "def press_and_release(key, sleep_for = 0.05)\n press(key)\n release(key)\n sleep(sleep_for) unless sleep_for == 0 \n end", "def send_keycode_to_selector keycode, selector\n keypress_script = \"var e = $.Event('keydown', { keyCode: #{keycode} }); $('#{selector}').trigger(e);\"\n page.driver.browser.execute_script(keypress_script)\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def getch\n map_key(key_press)\n end", "def update_skip_key\n SceneManager.goto(Scene_Title) if Input.trigger?(TH::Splash_Screen_Map::Skip_Button)\n end", "def activate_tab_with_key_press(key, *modifiers)\n wait_start\n # TODO: FIXME. key_down and up are not yet implemented on mac and windows\n if linux?\n key_down_direct(key,*modifiers)\n key_up_direct(key, *modifiers)\n else\n key_press_direct(key, *modifiers)\n end\n wait_for_window_activated(\"Document Window\")\n end", "def show_single_key\n system(\"clear\")\n board.render\n\n c = read_char\n\n case c\n when \"\\e[A\"\n # puts \"UP ARROW\"\n board.selected_pos[0] -= 1 unless board.selected_pos[0] < 1\n when \"\\e[B\"\n board.selected_pos[0] += 1 unless board.selected_pos[0] > 7\n # puts \"DOWN ARROW\"\n when \"\\e[C\"\n board.selected_pos[1] += 1 unless board.selected_pos[1] > 7\n # puts \"RIGHT ARROW\"\n when \"\\e[D\"\n board.selected_pos[1] -= 1 unless board.selected_pos[1] < 1\n # puts \"LEFT ARROW\"\n when \"r\"\n make_move(board.selected_pos,\"r\")\n when \"f\"\n make_move(board.selected_pos,\"f\")\n when \"s\"\n save?\n end\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def char_shift(char,shift)\n code = char.codepoints[0]\n if ((code>=65 && code<=90) || (code>=97 && code<=122))\n shifted = mod(code + shift - codegroup(code),26) + codegroup(code);\n return shifted.chr\n else\n return char\n end\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def action_down\n @ui.index += 1\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def shift_out\n end", "def activate_tab_with_key_press(key, *modifiers)\n wait_start\n # TODO: FIXME. key_down and up are not yet implemented on mac and windows\n if linux? \n key_down(key,*modifiers)\n key_up(key, *modifiers)\n else\n key_press_direct(key, *modifiers)\n end\n wait_for_window_activated(\"Document Window\")\n end", "def hold_screen\n print 'Press Enter to continue.'\n gets.chomp\n end", "def macNativeShortcut(element, key)\n\t\tputs key\n\t\tcase key\n\t\twhen 'x'\n\t\t\tputs \"something\"\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar event = new Event('cut', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(event);\n\t\t\t\t\")\n\n\t\twhen 'p'\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar pasteevent = new Event('paste', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(pasteevent);\n\t\t\t\t\")\n\t\tend\n\n\t\telement.native.send_keys [:command, key]\n\tend", "def button_up(id)\r\n\r\n # Up-Arrow key\r\n if id == Gosu::KbUp then\r\n @player.reset_jump if @player.is_jumping?\r\n end\r\n end", "def getch\n\n end" ]
[ "0.7590204", "0.6493804", "0.61667556", "0.6057411", "0.59113073", "0.5875903", "0.5875903", "0.58300763", "0.5730001", "0.57031566", "0.56700045", "0.56697965", "0.5658143", "0.5642233", "0.56276506", "0.56259835", "0.55793124", "0.55793124", "0.5566451", "0.55504555", "0.55389434", "0.55389434", "0.5523354", "0.54666775", "0.5461016", "0.545921", "0.5446579", "0.54076326", "0.5406303", "0.5406303", "0.5406303", "0.5329449", "0.5298468", "0.52954894", "0.5293301", "0.52833754", "0.52733314", "0.5272262", "0.52456135", "0.5201789", "0.5201789", "0.5194133", "0.5167969", "0.51663554", "0.5157804", "0.5150341", "0.5117118", "0.50849855", "0.5083577", "0.50768626", "0.50768626", "0.5058286", "0.50452816", "0.50448143", "0.503572", "0.503397", "0.50336665", "0.5024564", "0.5023005", "0.50143343", "0.5011897", "0.50103045", "0.4990546", "0.49750885", "0.4973343", "0.49640092", "0.4951573", "0.4951573", "0.494642", "0.494642", "0.4934312", "0.4926218", "0.49181476", "0.4908152", "0.4906668", "0.48903853", "0.48881736", "0.48845014", "0.48780653", "0.48776552", "0.48776552", "0.48723203", "0.4871539", "0.48602688", "0.48602688", "0.48568675", "0.4843245", "0.48344445", "0.48222807", "0.48176363", "0.48163754", "0.48124108", "0.48030177", "0.47923002", "0.4790847", "0.47829565", "0.47807798", "0.47773182", "0.4774757", "0.4772599" ]
0.7425063
1
Release the shift key.
def shift_key_up command 'shiftKeyUp' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift_key_down\r\n command 'shiftKeyDown'\r\n end", "def releaseKey(key)\n\t\t@keysPressed.delete(key)\n\tend", "def shift\n conn.lpop key\n end", "def release_keysequence(keysequence, delay = 0.012)\n XDo::FFILib.xdo_keysequence_up @_xdo_pointer, @_window, keysequence,\n (delay * 1_000_000).to_i\n end", "def key_released( event )\n @keys -= [event.key]\n end", "def released( key )\n return KeyReleaseTrigger.new( key )\nend", "def key_release *args\n\t\t\tevent(:key_release, *args)\n\t\tend", "def wdelch\n Ncurses.wdelch(pointer)\n end", "def remove\n key = shift_argument\n if key.nil? || key.empty?\n error(\"Usage: heroku keys:remove KEY\\nMust specify KEY to remove.\")\n end\n validate_arguments!\n\n action(\"Removing #{key} SSH key\") do\n api.delete_key(key)\n end\n end", "def shift_down\n if GameWindow.instance.button_down?(Gosu::KbRightShift) || GameWindow.instance.button_down?(Gosu::KbLeftShift)\n true\n else\n false\n end\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def removeHotkey(key, modifiers)\n Env.removeHotkey key, modifiers\n end", "def destroy\n @shift.destroy\n end", "def setShift(sx,sy) \n @device.setShift(sx,sy) \n end", "def shift; end", "def shift; end", "def shift() end", "def shift() end", "def shift\n delete @data.keys.shift\n end", "def destroy\n @shift_rotation.destroy\n @shift_rotations = ShiftRotation.all\n end", "def decr(key); end", "def decr(key); end", "def shift\n end", "def shift\n end", "def shift\n end", "def release(key, value)\n return\n end", "def destroy\n @shift.destroy\n render json: {message: 'Shift was Deleted'}\n end", "def decrby(key, decrement); end", "def decrby(key, decrement); end", "def shift\n if letter = left.shift || right.shift\n @length -= 1\n letter\n else\n nil\n end\n end", "def button_up(key)\n self.close if key == Gosu::KbEscape\n end", "def cut\n\n # FIXME\n if OperaWatir::Platform.os == :macosx\n keys.send [:command, 'x']\n else\n keys.send [:control, 'x']\n end\n end", "def shift(text, shift_num)\n\t\t\tClassicalCrypto::Utils::Text.substitute(text) do |ch| \n\t\t\t\tClassicalCrypto::Utils::Text.shift_alpha ch, shift_num\n\t\t\tend\n\t\tend", "def release_reg reg\n last = @regs.pop\n raise \"released register in wrong order, expect #{last} but was #{reg}\" if reg != last\n end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def key_down(key)\n focus\n @driver.sc_key_down action_target, key, *action_locator_args\n stall :key_down\n end", "def unbind_key keycode\n @_key_args.delete keycode unless @_key_args.nil?\n @_key_map.delete keycode unless @_key_map.nil?\n end", "def clear_screen_down\n CSI + 'J'\n end", "def shift_out\n end", "def shift key = nil\n value = @degrees.shift\n return_value_using_key value, key\n end", "def control_key_down\r\n command 'controlKeyDown'\r\n end", "def shiftGbk\n\nend", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def shift\n kvpair = self.to_h.shift\n @table.delete kvpair.first\n kvpair\n end", "def key(k, x, y)\n case k\n when 27 # Escape\n exit\n end\n GLUT.PostRedisplay()\n end", "def key(k, x, y)\n case k\n when ?z\n @view_rotz += 5.0\n when ?Z\n @view_rotz -= 5.0\n when 27 # Escape\n exit\n end\n glutPostRedisplay()\n end", "def close\n @graphic.ungetch(?q.ord)\n end", "def cmd_keyscan_stop(*args)\n\t\tprint_line(\"Stopping the keystroke sniffer...\")\t\t\n\t\tclient.ui.keyscan_stop\n\t\treturn true\n\tend", "def deActivateKey _args\n \"deActivateKey _args;\" \n end", "def release_register reg\n if reg.end_point\n raise Errors::AlreadyReleasedError, \"register #{reg.name} already released at #{reg.end_point}\"\n end\n\n reg.end_point = (@instructions.length - 1)\n end", "def close_menu_with_key_press(menu_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_menu_closed(menu_name)\n end", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def cmd_keyscan_stop(*args)\n\t\tprint_line(\"Stopping the keystroke sniffer...\")\n\t\tclient.ui.keyscan_stop\n\t\treturn true\n\tend", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def destroy\n @shift.destroy\n respond_to do |format|\n format.html { redirect_to shifts_url, notice: 'Shift was successfully destroyed.' }\n format.json { head :no_content }\n Shift.reset_pk_sequence\n end\n end", "def key_down key\n @keys.push key\n end", "def release_key(key_id)\r\n @transport.iso_apdu! :ins => 0x28, :p1 => key_id\r\n return true\r\n end", "def decrby(key, decrement)\n send_command([:decrby, key, Integer(decrement)])\n end", "def onKeyUp(key, repeat, flags, view)\n if( key == CONSTRAIN_MODIFIER_KEY &&\n view.inference_locked? &&\n (Time.now - @shift_down_time) > 0.5 )\n view.lock_inference\n end\nend", "def ungetch(ch)\n Ncurses.ungetch(ch)\n end", "def werase\n Ncurses.werase(pointer)\n end", "def handle_key ch\n if ch == 32\n toggle\n else\n super\n end\n end", "def press(key_sequence)\n end", "def rekey!; end", "def rekey!; end", "def shell_registry_unloadkey(key)\n key = normalize_key(key)\n shell_registry_cmd_result(\"unload \\\"#{key}\\\"\")\n end", "def shift\n return if @length == 0\n key = @head.next.key\n [key, delete(key)]\n end", "def decrypt( encrypt)\n @shift = @shift * -1\n encrypt( encrypt)\n end", "def key_combination(*keys)\n keys.each {|k| press(k) }\n keys.reverse.each {|k| release(k) }\n end", "def destroy\n @key.destroy\n end", "def down_key\n @last = @choice\n @choice = (@choice < 2 ? @choice += 1 : 0)\n @choice_sound.play(1, 0.5, false)\n end", "def while_key_down *args\n\t\t\tevent(:while_key_down, *args)\n\t\tend", "def ctrl_w() send_keys(:ctrl_w) end", "def decr(key)\n node_for(key).decr(key)\n end", "def unregister(key_or_instance)\n proxy_across_keytypes(:delete, key_or_instance)\n end", "def decr(key, increment=nil)\n timeout_retry(3, 3){\n if increment\n write \"DECRBY #{key} #{increment}\\r\\n\"\n else\n write \"DECR #{key}\\r\\n\"\n end \n integer_reply\n }\n end", "def char_shift(char,shift)\n code = char.codepoints[0]\n if ((code>=65 && code<=90) || (code>=97 && code<=122))\n shifted = mod(code + shift - codegroup(code),26) + codegroup(code);\n return shifted.chr\n else\n return char\n end\n end", "def decr(key, value = 1)\n mon_synchronize do\n perform [\"decr\", key, value], proc: T_INT\n end\n end", "def button_down(id)\n case id\n when Gosu::KbEscape\n exit\n end\n end", "def up(key)\n description = key_description_for_string key\n\n @modifiers &= ~(modifier_bit description[:key])\n @_pressed_keys.delete description[:code]\n\n client.command(\n Protocol::Input.dispatch_key_event(\n type: 'keyUp',\n modifiers: modifiers,\n key: description[:key],\n windows_virtual_key_code: description[:key_code],\n code: description[:code],\n location: description[:location]\n )\n ).wait!\n end", "def alt_key_down\r\n command 'altKeyDown'\r\n end", "def decr(key, value = 1)\n mon_synchronize do\n perform [\"decr\", key, value], :proc => T_INT\n end\n end", "def press_any_key\n # TODO: Print footer.\n get_wch\n end", "def dec(key)\n \n end", "def button_down(id)\r\n case id\r\n when Gosu::KbEscape\r\n close\r\n end\r\n end", "def destroy\n FFI::NCurses.delwin(@pad) if @pad # when do i do this ? FIXME\n @pad = nil\n end", "def destroy\n FFI::NCurses.delwin(@pad) if @pad # when do i do this ? FIXME\n @pad = nil\n end", "def meta_key_down\r\n command 'metaKeyDown'\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def button_down(id)\r\n if id == Gosu::KB_ESCAPE\r\n close\r\n else\r\n super\r\n end\r\n end", "def close_window_with_key_press(win_name, key, *opts)\n wait_start\n key_press_direct(key, *opts)\n wait_for_window_close(win_name)\n end", "def close_window_with_key_press(win_name, key, *opts)\n wait_start\n key_press_direct(key, *opts)\n wait_for_window_close(win_name)\n end", "def delwin\n Ncurses.delwin(pointer)\n pointer = nil\n end", "def meta_key_up\r\n command 'metaKeyUp'\r\n end", "def getch\n map_key(key_press)\n end", "def shift(letter, key)\n unless key.between?(0, 25)\n raise ArgumentError, \"Key must be an integer between 0 and 25\"\n end\n\n alphabet_end_code = is_upper?(letter) ? \"Z\".ord : \"z\".ord\n letter_code = letter.ord\n ciphered_code = letter_code + key\n\n if ciphered_code > alphabet_end_code\n # loop back around to start of alphabet\n ciphered_code -= 26\n end\n\n ciphered_code.chr\nend" ]
[ "0.67046523", "0.62143505", "0.6198159", "0.60833585", "0.60808146", "0.6000871", "0.589238", "0.58811814", "0.57741237", "0.57379013", "0.5606869", "0.5606869", "0.5571487", "0.5475465", "0.5427318", "0.5427318", "0.5419669", "0.5419669", "0.53687334", "0.5358958", "0.52987796", "0.52987796", "0.52615696", "0.52615696", "0.52615696", "0.52045107", "0.518333", "0.51772416", "0.51772416", "0.51678306", "0.5164999", "0.5160156", "0.51491857", "0.5112763", "0.50006646", "0.49914068", "0.49892506", "0.4963365", "0.49483576", "0.49472958", "0.49240857", "0.49166232", "0.49104127", "0.48888204", "0.48799482", "0.48780352", "0.4873684", "0.48546785", "0.48491535", "0.48491243", "0.48454958", "0.48279497", "0.4827724", "0.48261216", "0.48228076", "0.48170915", "0.48170915", "0.47970936", "0.4796959", "0.47962266", "0.47889", "0.47838452", "0.47712848", "0.4768913", "0.4767379", "0.47530454", "0.47527665", "0.47527665", "0.4747567", "0.47426474", "0.47195828", "0.47063592", "0.4693046", "0.4692572", "0.46920905", "0.4691326", "0.46815136", "0.46781245", "0.46752608", "0.46740404", "0.46471438", "0.46427676", "0.46313554", "0.4630784", "0.46207783", "0.4613654", "0.4609107", "0.46085924", "0.4605357", "0.4605357", "0.46039438", "0.46028906", "0.46028906", "0.45963383", "0.4595457", "0.4595457", "0.4591644", "0.4587161", "0.45852086", "0.4582651" ]
0.69267005
0
This command is a synonym for store_expression.
def store expression, variable_name command 'store', expression, variable_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_expression expression, variable_name\r\n command 'storeExpression', expression, variable_name\r\n end", "def store_eval script, variable_name\r\n command 'storeEval', script, variable_name\r\n end", "def eval_expression\n eval(expression, binding)\n end", "def expression; end", "def store(cmd, *args)\n @api.store \"#{cmd} #{@name}/#{args.join(' ')}\"\n end", "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end", "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end", "def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end", "def expression(options=[])\n evaluator = Bun::Expression.new(options)\n evaluator.data = self\n evaluator\n end", "def set_expression\n @expression = Expression.find params[:id]\n end", "def eval_expression\n # Shoes.show_log\n @numbers = @input.split(\" \")\n @first_number = @numbers.shift.to_f\n @numbers.unshift(@first_number)\n\n @last_number = @numbers.pop.to_f\n @numbers.push(@last_number.to_s)\n\n @input = @numbers.join\n @input = eval(@input).to_s\n @output.text = @input\n end", "def evalWrite(expr)\n\tsymbol = evalExpression(expr)\n\tputs symbol[1]\nend", "def simple_eval(expression)\n parsed_expression = @engine.parse(expression, false)\n notify_expression_listeners(expression)\n @engine.eval(parsed_expression, nil, false)\n end", "def emit_expr value\n statement :expr, value\n end", "def save_expression_instance_in_session\n session[:expression_being_edited] = @expression\n end", "def create\n @expression = Expression.new(params[:expression])\n\n respond_to do |format|\n if @expression.save\n flash[:notice] = 'Expression was successfully created.'\n format.html { redirect_to(@expression) }\n format.xml { render :xml => @expression, :status => :created, :location => @expression }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @expression.errors, :status => :unprocessable_entity }\n end\n end\n end", "def store(*args); end", "def eval(expr, *rest) end", "def evaluate(expression)\n eval(expression).inspect\nend", "def expressions; end", "def eval(expression, env = Environment.new)\n env = Trxl::Environment.new(env) if env.is_a?(Hash)\n ast = parse(expression)\n ast.eval(env)\n end", "def d(expression)\n result = binding.of_caller(1).eval(expression.to_s)\n inspection = result.inspect\n if result.inspect.length < 50\n sout = \"\\t<#{result.class.name}> #{expression} = #{inspection}\" \n else\n sout = \"\\n<#{result.class.name}> #{expression} =\\n\"\n sout += inspection + \"\\n\\n\" \n end\n DebugPrint.out(sout)\n end", "def expression_statement\n expr = expression\n consume(:semicolon, \"Expect ';' after expression.\")\n return Ringo::Expression.new(expr)\n end", "def eval_expression\n if @input.to_i.zero?\n @input = eval(@input).to_s\n else\n @input = eval(@input).to_f.to_s\n end\n @output.text = @input\n end", "def store_value locator, variable_name\r\n command 'storeValue', locator, variable_name\r\n end", "def parsed_expression=(value)\n @parsed_expression = value\n end", "def apply_expression(scope, expression)\n ast = calculator.ast(expression)\n apply_ast(scope, ast)\n end", "def create\n @expression = Expression.new expression_params\n respond_to do |format|\n if @expression.save\n format.html { redirect_to @expression, notice: 'Expression was successfully created.' }\n format.json { render json: @expression, status: :created, location: @expression }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expression.errors, status: :unprocessable_entity }\n end\n end\n end", "def eval_expression\n @evaluated_expression =\n ConlangWordGenerator::run_expression(@full_expression, @bindings)\n end", "def save_operation(operator, left, right, result, memory)\n result_access = VarAccess.new(result) unless result.nil?\n @quadruples.push Quadruple.new(\n Instruction.new(operator),\n left,\n right,\n result_access)\n memory.dealloc_temp right if right.is_a? VarAccess\n memory.dealloc_temp left if left.is_a? VarAccess\n end", "def expression\n super\n end", "def evaluate(expr)\n @api.function_for_object_method(self, :eval).call(@session, expr)\n end", "def expression=(_arg0); end", "def store_itself\n\n #ldebug { \"store_itself() for #{@fei.to_debug_s}\" }\n #ldebug { \"store_itself() \\n#{OpenWFE::caller_to_s(0, 6)}\" }\n\n get_expression_pool.update(self)\n end", "def add_expression(expression)\n puts \"Adding expression #{expression} to manifestation\"\n if expression.blank?\n raise ArgumentError, \"Expression cannot be nil\"\n end\n \n \n begin\n transaction do\n #Save the current manifestation (self) as we need an id\n raise if !self.save\n logger.debug \"DEBUG: Saved manifestation\"\n \n #Ditto the expression - the joy of has many through\n logger.debug \"DEBUG: **** Trying to save expression.. is it nil? #{expression == nil}\"\n \n logger.debug \"DEBUG: Pre save, \"\n expression_saved = expression.save\n\n logger.debug \"DEBUG: Expression has been saved\"\n raise ArgumentError if !expression_saved\n logger.debug \"DEBUG: Saved expression\"\n \n #We have both ends of the expression and manifestation saved, so now can create the join\n logger.debug \"DEBUG: Creating join\"\n em = ExpressionManifestation::new\n logger.debug \"DEBUG: Assigning manif\"\n em.manifestation = self\n \n logger.debug \"DEBUG: Assigning expression\"\n em.expression = expression\n \n logger.debug \"DEBUG: Saving join\"\n join_saved = em.save\n logger.debug em.to_yaml\n \n raise TransactionError if !join_saved\n \n logger.debug \"DEBUG: Saved join\"\n \n #Right, now we have the FRBR bit to do!\n logger.debug \"DEBUG: FRBR TIME....\"\n \n raise if !RelationshipHelper.add_frbr_relationship(:manifestation, self.manifestation_id, :is_the_embodiment_of, \n :expression, expression.expression_id, self.updated_by )\n \n logger.debug \"DEBUG: Saved FRBR\"\n \n end\n \n rescue Exception => e\n logger.error \"DEBUG: Transaction failed\" + e.message\n #Code errored out, indicate this by a false flag\n return false\n end\n \n #We got this far, everything is saved\n return true\n end", "def update!(**args)\n @dimension = args[:dimension] if args.key?(:dimension)\n @expression = args[:expression] if args.key?(:expression)\n @operator = args[:operator] if args.key?(:operator)\n end", "def add_expressions(*expressions); end", "def store_text locator, variable_name\r\n command 'storeText', locator, variable_name\r\n end", "def add_eval(id, &command)\n\t\t@val[id] = command\n\tend", "def _expression\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_assignment)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_value)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_expression unless _tmp\n return _tmp\n end", "def store_attribute locator, attribute_name, variable_name\r\n command 'storeAttribute', \"#{locator}@#{attribute_name}\", variable_name\r\n end", "def new\n #FIXME - this loses the work if you enter bad data on the new expression screen\n logger.debug \"** expression new **\"\n @expression = Expression.new\n\tprepare_new\n save_expression_instance_in_session\n end", "def sdiffstore(*arguments)\n\t\t\t\t\tcall(\"SDIFFSTORE\", *arguments)\n\t\t\t\tend", "def set_expression_value\n @expression_value = ExpressionValue.find(params[:id])\n end", "def expression(expression_string)\n state_depth_must_be(States::ATTRIBUTE)\n raise 'expression already defined' if @current_attribute.expression\n @current_attribute.expression = expression_string\n end", "def to_s\n @expression.to_s\n end", "def evaluate_expression(expression, eval_string = '')\n if expression.is_a? Yarpler::Models::Expression\n eval_string << evaluate_expression_inner(expression).to_s\n elsif expression.is_a? Yarpler::Models::Field\n obj = @problem.objects[expression.variable].get_value(expression.attribute)\n if (obj.is_a? Yarpler::Models::Relation)\n obj = @problem.objects[obj.to.first.to_s].id\n end\n eval_string << obj.to_s\n elsif expression.is_a? Yarpler::Models::Literal\n eval_string << expression.value.to_s\n else\n fail Yarpler::Exceptions::InvalidWhereExpression.new, 'Where Expression is illegal'\n end\n eval_string\n end", "def build_expression_storage\n\n init_storage(YamlFileExpressionStorage)\n end", "def interpret(context)\n evaluate_operator(@expression.interpret(context))\n end", "def expression\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n\n value = nil\n\n\n type = nil\n a = nil\n b = nil\n\n\n begin\n # at line 185:5: a= relation (type= ( '&&' | '||' ) b= expression )?\n @state.following.push( TOKENS_FOLLOWING_relation_IN_expression_1389 )\n a = relation\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = a \n # <-- action\n end\n\n # at line 186:3: (type= ( '&&' | '||' ) b= expression )?\n alt_45 = 2\n look_45_0 = @input.peek( 1 )\n\n if ( look_45_0 == T__33 || look_45_0 == T__54 )\n alt_45 = 1\n end\n case alt_45\n when 1\n # at line 186:6: type= ( '&&' | '||' ) b= expression\n type = @input.look\n\n if @input.peek(1) == T__33 || @input.peek(1) == T__54\n @input.consume\n @state.error_recovery = false\n\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n mse = MismatchedSet( nil )\n raise mse\n\n end\n\n\n @state.following.push( TOKENS_FOLLOWING_expression_IN_expression_1410 )\n b = expression\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = DoubleOperandExpressionEval.new(type.text, a, b) \n # <-- action\n end\n\n\n end\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__, 29 )\n\n\n end\n\n return value\n end", "def execute_expression\n valid_input\n to_roman(to_num(@operand_one).send(@operator, to_num(@operand_two)))\n end", "def setq(sym, expr)\n\t\tif expr.is_a?(String)\n\t\t\tif expr.match(/\\(list/)\t\n\t\t\t\tstr = \"(setq #{sym.to_s} #{expr.to_s})\" \n\t\t\telse\t\n\t\t\t\tstr = \"(setq #{sym.to_s} \\\"#{expr.to_s}\\\")\" \n\t\t\tend\t\n\t\t\tputs str\n\t\telse\n\t\t\tstr = \"(setq #{sym.to_s} #{expr.to_s})\" \n\t\t\tputs str\n\n\t\tend\t\n\t\tlisp_eval str\n\tend", "def set_expression(opts)\n opts = check_params(opts,[:expressions])\n super(opts)\n end", "def store_editable locator, variable_name\r\n command 'storeEditable', locator, variable_name\r\n end", "def expression\n if is_addop @look\n emit_ln 'CLR D0'\n else\n term\n end\n while is_addop @look\n emit_ln 'MOVE D0, -(SP)' \n case @look\n when '+': add\n when '-': subtract\n else expected('Addop')\n end\n end\nend", "def expression sexp\n return nil if sexp == nil\n #pp sexp\n body = sexp.sexp_body\n case sexp[0]\n # when :block # a collection of things to do!\n # body.map { |i| convert(i) + NL }.join\n when :iasgn # assign to instance variable\n value = expression( sexp[2] )\n name = @vars.set( sexp[1], value.type )\n \"#{name} = (#{value})\"\n when :lit, :false, :true, :array # literal values\n literal(sexp)\n when :ivar\n @vars.get(sexp.value)\n when :call # call a 'method' on something\n call(sexp[1], sexp[2], sexp[3].sexp_body)\n when :if # statements resembling ifs\n condition = expression(sexp[1])\n true_code = expression(sexp[2])\n false_code = expression(sexp[3])\n \"( ( #{condition} )?( #{true_code} ):( #{false_code} ) )\"\n when :colon2 # lookup constants\n if sexp[1][0] == :const and sexp[1][1] == :Math\n case sexp[2]\n when :PI\n Value.typed CTypeFloat, Math::PI.inspect\n end\n end\n when :not # the !something operator\n Value.typed CTypeBoolean, \"!(#{ expression(sexp.value) })\"\n else\n raise \"IDK how to handle this S-expression: #{ sexp.inspect }!\"\n end\n end", "def exp_commit(token)\n exp = exp_find_by_token(@edit[@expkey][:expression], token.to_i)\n case @edit[@expkey][:exp_typ]\n when \"field\" then exp_commit_field(exp)\n when \"count\" then exp_commit_count(exp)\n when \"tag\", \"tags\" then exp_commit_tag(exp)\n when \"regkey\" then exp_commit_regkey(exp)\n when \"find\" then exp_commit_find(exp)\n else\n add_flash(_(\"Select an expression element type\"), :error)\n end\n end", "def store_location expected_location, variable_name\r\n command 'storeLocation', expected_location, variable_name\r\n end", "def parse_expression(expr); end", "def lex_en_expr_cmdarg; end", "def lex_en_expr_cmdarg; end", "def lex_en_expr_cmdarg; end", "def lex_en_expr_variable; end", "def lex_en_expr_variable; end", "def lex_en_expr_variable; end", "def evaluate(expr)\n TupleExpression.coerce(expr).evaluate(self)\n end", "def parse_expression\n expr = []\n loop do\n raise ExpressionError, 'Expression definition incomplete.. more terms expected' unless current_token\n\n name = expect_token %i[name string]\n expr.append name\n\n debug \"Expression identifier found as #{name} - appending to expr stack\"\n\n if current_token.nil?\n raise ExpressionError, \"Expected terminator (;) or operator (+) following #{name} in expression.\"\n elsif !(current_token.type == :operator || current_token.type == :terminator)\n raise ExpressionError, \"Unexpected #{current_token} inside expression; expected terminator (;) or operator (+)\"\n elsif current_token.type == :terminator\n break\n end\n\n step_forward\n end\n\n expr\n rescue ExpressionError => e\n raise_parser_error \"Failed to parse expression: #{e.message}\" unless @state_arg\n raise_parser_error \"Expression error for #{@state_arg} command: #{e.message}\"\n end", "def sql_of( expr, dataset)\n dataset.send :literal_expression_append, rv=String.new, expr\n rv\n end", "def expression\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n\n value = nil\n\n\n a = nil\n b = nil\n\n\n begin\n # at line 9:28: a= mul ( ADD b= mul | SUB b= mul )*\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_44 )\n a = mul\n @state.following.pop\n # at line 9:33: ( ADD b= mul | SUB b= mul )*\n while true # decision 1\n alt_1 = 3\n look_1_0 = @input.peek( 1 )\n\n if ( look_1_0 == ADD )\n alt_1 = 1\n elsif ( look_1_0 == SUB )\n alt_1 = 2\n\n end\n case alt_1\n when 1\n # at line 10:5: ADD b= mul\n match( ADD, TOKENS_FOLLOWING_ADD_IN_expression_51 )\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_55 )\n b = mul\n @state.following.pop\n\n # --> action\n a += b \n # <-- action\n\n\n when 2\n # at line 11:5: SUB b= mul\n match( SUB, TOKENS_FOLLOWING_SUB_IN_expression_63 )\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_67 )\n b = mul\n @state.following.pop\n\n # --> action\n a -= b \n # <-- action\n\n\n else\n break # out of loop for decision 1\n end\n end # loop for decision 1\n\n\n # --> action\n value = a \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__, 2 )\n\n\n end\n\n return value\n end", "def expression(operator, val)\n val = (val.is_a?(String) || val.is_a?(Symbol)) ? \"'#{val}'\" : val\n \"#{@attr} #{operator} #{val}\"\n end", "def eval\n return @value unless @value.nil?\n \n debug \"\\nfor RPN expression: #{expression}\\nTerm\\tAction\\tStack\"\n stack = []\n expression.split.each do |term|\n if Operators.has_key?(term)\n a, b = stack.pop(2)\n raise ArgumentError, \"not enough operands on the stack\" if b.nil?\n a = a.to_f if term == \"/\"\n op = (term == \"^\" ? \"**\" : term)\n stack.push(a.method(op).call(b))\n debug \"#{term}\\t#{Operators[term].english}\\t#{stack}\"\n else\n begin\n number = Integer(term) rescue Float(term)\n rescue ArgumentError\n raise ArgumentError, \"cannot handle term: #{term}\"\n end\n stack.push(number)\n debug \"#{number}\\tPUSH\\t#{stack}\"\n end\n end\n @value = stack.pop\n debug \"Value = #@value\"\n @value\n end", "def expr(path_stack, nodeset, context = T.unsafe(nil)); end", "def e *args\n do_conn(:eval, *args).to_ruby\n end", "def evaluate(expression)\n @simpleParser.parse expression\n end", "def set_variable(expr, value)\n @variables[expr] = value.to_s.force_encoding(Encoding::UTF_8)\n end", "def push(x)\n @store << x\n \n end", "def quote(sexp)\n [:pushl, sexp]\n end", "def process_gasgn(exp)\n gvar = exp.shift\n value = exp.shift\n\n gvar_name = @model.encode_global_variable(gvar)\n\n str = without_result do\n want_expression do\n \"#{gvar_name}=#{process(value)}\"\n end\n end\n\n resultify(str)\n end", "def eval_memory_expression\n Assam.logger.debug \"Starting memory access...\"\n\n case ram_read\n when DIRECT\n # Direct memory reference, just read a memory address from RAM and\n # return it.\n value = ram_read(address_size)\n\n Assam.logger.debug \"Direct memory access. Read: #{value}\"\n return value\n when REGISTER\n # Register reference. Read the register code from memory, look it up in\n # the register table and return the value.\n register = register_codes[ram_read]\n\n if register.nil?\n raise \"Attempted to access a register that does not exist.\"\n else\n Assam.logger.debug \"Register value memory access. Read: #{register.value}\"\n return register.value\n end\n when EXPRESSION\n size = ram_read\n pc = MemoryLocation.from(registers[:eip])\n initial_pc = pc.read\n expression = []\n\n # Read the expression up until the size has been reached.\n until pc.read == (initial_pc + size)\n case ram_read\n when REGISTER\n expression << register_codes[ram_read].value\n when DIRECT\n expression << ram_read(address_size)\n when MEM_ADD\n expression << :+\n when MEM_SUB\n expression << :-\n when MEM_MUL\n expression << :*\n end\n end\n\n Assam.logger.debug \"Memory expression disassembled: #{expression}\"\n\n # We want to find if there's a multiplier and then group it with its\n # left and right operands so it gets evaluated in the correct\n # precedence.\n mul = expression.find_index :*\n\n # Messyish bit of code but all it does is turn something like:\n # [1, :+, 2, :*, 3]\n #\n # Into:\n #\n # [1, :+, 6]\n if mul\n # Grab the left and right sides of the expression.\n left = expression[mul - 1]\n right = expression[mul + 1]\n\n # Multiply them and insert them back into the expression.\n expression[(mul - 1)..(mul + 1)] = left * right\n end\n\n # Initialise the memory_location to the first value in expression.\n memory_location = expression.shift\n\n # Loop over the rest of the expression two elements at a time, modifying\n # the memory location appropriately as we go along.\n expression.each_slice(2) do |op, val|\n memory_location = memory_location.send(op, val)\n end\n\n Assam.logger.debug \"Calculated memory expression to refer to \" +\n \"0x#{memory_location.to_s(16)} which currently holds the value \" +\n \"0x#{ram[memory_location, 1]}\"\n return memory_location\n end\n end", "def execute_LES(destination, memory_operand)\n\t\tdestination.direct_value = memory_operand.value\n\t\t@es.direct_value = memory_operand.next_word_value\n\tend", "def evaluate(bindings = {})\n stack = []\n @expr.split.each do |token|\n case token\n when /\\A\\d+\\z/\n number = Number.new(token)\n stack.push(number)\n when \"+\"\n right = stack.pop(1)\n left = stack.pop(1)\n value.add(left, right)\n end\n end\n stack.pop\n end", "def push(x)\n @store << x\n end", "def update!(**args)\n @sql_expression = args[:sql_expression] if args.key?(:sql_expression)\n end", "def update!(**args)\n @sql_expression = args[:sql_expression] if args.key?(:sql_expression)\n end", "def E(*args)\n SyntaxNotes::E.build(*args)\n end", "def store_alert variable_name\r\n command 'storeAlert', variable_name\r\n end", "def to_nfa\n exec(:expression)\n end", "def save_all(expressions = {})\n conditions(expressions)\n klass = Parse::Model.find_class self.table\n if klass.blank?\n raise ArgumentError, \"Parse model with class name #{self.table} is not registered.\"\n end\n hash_constraints = constraints(true)\n\n klass.save_all(hash_constraints, &Proc.new) if block_given?\n klass.save_all(hash_constraints)\n end", "def store *args, &block; put *args, &block; end", "def cmd(command, val)\n @emq.push( raw_cmd command, val )\n end", "def process_iasgn(exp)\n ivar = exp.shift\n value = exp.shift\n ivar_name = @model.encode_instance_variable(ivar)\n\n str = without_result do\n want_expression do\n \"#{@model.encode_self}.#{ivar_name}=#{process(value)}\"\n end\n end\n\n resultify(str)\n end", "def process_dxstr exp\n process exp.last if sexp? exp.last\n\n add_simple_call :`, exp\n\n exp\n end", "def eval\n @token = @lexer.next\n expression(0)\n end", "def evaluate(ex)\n @stack=[]\n @expr.each do |el|\n case el\n when HopExprVar\n # evaluate variable\n var,dot,field=el.value.partition('.')\n if field==''\n # scalar\n val=VarStor.getScalar(ex,el.value)\n else\n # cortege field\n begin\n val=VarStor.getCortege(ex,var)[field]\n rescue\n warn \">> Opppps: #{var}.#{field}\"\n nil\n end\n end\n @stack.push val\n\n when Numeric, String\n # constant\n @stack.push el\n\n when HopExprOp\n case el.value\n when '+'\n a1=@stack.pop\n a2=@stack.pop\n warn \">>PLUS: #{a1},#{a2}\"\n raise SyntaxErrHopError if a2.nil?\n @stack.push a1.to_f+a2.to_f\n when '*'\n a1=@stack.pop\n a2=@stack.pop\n raise SyntaxErrHopError if a2.nil?\n @stack.push a1.to_f*a2.to_f\n when '-'\n a1=@stack.pop\n a2=@stack.pop\n warn \">>MINUS: #{a1},#{a2}\"\n raise SyntaxErrHopError if a2.nil?\n @stack.push a2.to_f-a1.to_f\n when '/'\n a1=@stack.pop\n a2=@stack.pop\n raise SyntaxErrHopError if a2.nil?\n @stack.push a2.to_f/a1.to_f\n when '%'\n a1=@stack.pop\n a2=@stack.pop\n raise SyntaxErrHopError if a2.nil?\n @stack.push a2.to_f%a1.to_f\n else\n raise SyntaxErrHopError\n end\n end #~case\n end # ~each expression\n raise SyntaxErrHopError.new(@expr.to_s+' ('+@stack.to_s+')') if @stack.size>1\n\n return @stack.pop\n end", "def fetch (exp)\n\n fei = extract_fei(exp)\n\n [ get_expression_storage[fei], fei ]\n end", "def save!\n subject.send(\"#{field}=\", store)\n subject.save!\n end", "def exp _args\n \"exp _args;\" \n end", "def parse_expression_statement\n expr = parse_expression\n stmt = node(:expression_statement, expression: expr)\n stmt = expect_statement_modifier(stmt) if statement_modifier?\n expect_terminator # NOTE: maybe it should be dropped?\n stmt\n end", "def expr=(p1)\n #This is a stub, used for indexing\n end", "def sinterstore(*arguments)\n\t\t\t\t\tcall(\"SINTERSTORE\", *arguments)\n\t\t\t\tend" ]
[ "0.8634716", "0.6388004", "0.61340773", "0.60463214", "0.60207146", "0.60176015", "0.59880316", "0.59880316", "0.59457415", "0.58091915", "0.5729557", "0.56832665", "0.5637354", "0.56163424", "0.55896956", "0.55484414", "0.5484326", "0.547495", "0.54747874", "0.5416711", "0.5415011", "0.54124886", "0.53984123", "0.5379574", "0.53769594", "0.53610116", "0.5355343", "0.5339791", "0.53356886", "0.53315115", "0.5326644", "0.5321839", "0.532182", "0.52873164", "0.5285895", "0.5281719", "0.5267685", "0.52621245", "0.52308756", "0.5220037", "0.52175355", "0.51984674", "0.5194705", "0.51926714", "0.51899725", "0.5170816", "0.51651585", "0.51580137", "0.5154165", "0.5152518", "0.51511407", "0.5146343", "0.5127291", "0.5125707", "0.5110982", "0.5109888", "0.5101128", "0.5099611", "0.50971466", "0.5080455", "0.5080455", "0.5080455", "0.5078873", "0.5078873", "0.5078873", "0.5072155", "0.50608623", "0.50545317", "0.50535643", "0.50325114", "0.5025554", "0.50226355", "0.5018366", "0.500921", "0.5001631", "0.4999318", "0.499778", "0.49759018", "0.49638453", "0.49634993", "0.49567634", "0.49538362", "0.49521872", "0.49521872", "0.49483666", "0.49479443", "0.49136758", "0.49083325", "0.4907862", "0.4907311", "0.49056053", "0.4904631", "0.48995182", "0.48920205", "0.48903018", "0.4879139", "0.48727638", "0.48705417", "0.48639074", "0.48632374" ]
0.8262684
1
Simulates keystroke events on the specified element, as though you typed the value keybykey. This is a convenience method for calling key_down, key_up, key_press for every character in the specified string; this is useful for dynamic UI widgets (like autocompleting combo boxes) that require explicit key events. Unlike the simple "type" command, which forces the specified value into the page directly, this command may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. For example, if you use "type_keys" on a form element, you may or may not see the results of what you typed in the field. In some cases, you may need to use the simple "type" command to set the value of the field and then the "type_keys" command to send the keystroke events corresponding to what you just typed.
def type_keys locator, value command 'typeKeys', locator, value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(*keys)\n keys = normalize_keys(Array(keys))\n\n keys.each do |key|\n type = key[:text] ? \"keyDown\" : \"rawKeyDown\"\n @page.command(\"Input.dispatchKeyEvent\", type: type, **key)\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n end\n\n self\n end", "def keypress_on(element, key)\r\n element.native.send_key(key)\r\n end", "def input_key(key)\n @driver.action.send_keys(key).perform\n end", "def send_keys(*args)\n Selenium::WebDriver::Keys.encode(args).each do |key|\n @driver.add_text_trigger(self, key.to_s)\n end\n web_element.send_keys(*args)\n end", "def key_press locator, keycode\r\n command 'keyPress', locator, keycode\r\n end", "def key_press locator, keycode\r\n command 'keyPress', locator, keycode\r\n end", "def send_keys(element,value)\n element.send_keys(value)\n end", "def send_keys(locator, *args)\n find_element(locator).send_keys(*args)\n end", "def send_keys(*args)\n ElementExtensions.highlight(self) if Gridium.config.highlight_verifications\n $verification_passes += 1\n unless element.enabled?\n raise \"Browser Error: tried to enter #{args} but the input is disabled\"\n end\n if only_symbols?(*args)\n append_keys(*args)\n else\n _stomp_input_text(*args)\n field_empty_afterward?(*args)\n end\n end", "def doKeyPress( value )\r\n begin\r\n maxLength = @o.maxLength\r\n if (maxLength != -1 && value.length > maxLength)\r\n original_value = value\r\n value = original_value[0..maxLength]\r\n element.log \" Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}\"\r\n end\r\n rescue\r\n # probably a text area - so it doesnt have a max Length\r\n maxLength = -1\r\n end\r\n for i in 0..value.length-1 \r\n #sleep element.typingspeed # typing speed\r\n c = value[i,1]\r\n #element.log \" adding c.chr \" + c #.chr.to_s\r\n @o.value = \"#{(@o.value.to_s + c)}\" #c.chr\r\n @o.fireEvent(\"onKeyDown\")\r\n @o.fireEvent(\"onKeyPress\")\r\n @o.fireEvent(\"onKeyUp\")\r\n end\r\n \r\n end", "def send_keys(*args)\n @driver.switch_to.active_element.send_keys(*args)\n end", "def send_keys(*args)\r\n begin\r\n $focus_driver.find_element(self).send_keys(*args)\r\n rescue StandardError => e\r\n Log.fail(\"You cannot set text to element #{self.how } => #{self.what}\" + e.message)\r\n end\r\n end", "def send_keys(*args); end", "def doKeyPress ( o , suppliedValue )\n # o is an object, we assume the calling method has verified its ok....\n\n # we need to check the length of the box here, as script overrides the length attribute of the text box\n # http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/maxlength.asp\n\n fname = getFunctionName()\n #log fname + ' doing keypress on field: ' + o.name.to_s\n value = suppliedValue.to_s\n begin\n maxLength = o.maxLength\n if value.length > maxLength\n value = suppliedValue[0 .. maxLength ]\n log fname + \" Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{maxLength}) of the field. Using value: #{value}\"if $debuglevel >=0\n end\n rescue\n # its probably a text area - so it doesnt have a max Length\n maxLength = -1\n end\n\n for i in 0 .. value.length-1 \n sleep @typingspeed # typing speed\n c = value[i]\n #log \" adding c.chr \" + c.chr.to_s\n o.value = o.value.to_s + c.chr\n o.fireEvent(\"onKeyPress\")\n if waitForIE( NOWAITFORIE ) \n # we dont do anything if its good....\n else\n return false, [fname + \" problem loading the page\"]\n end\n end\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def key_up locator, keycode\r\n command 'keyUp', locator, keycode\r\n end", "def send_keycode_to_selector keycode, selector\n keypress_script = \"var e = $.Event('keydown', { keyCode: #{keycode} }); $('#{selector}').trigger(e);\"\n page.driver.browser.execute_script(keypress_script)\n end", "def keypress(key)\n puts \"Got key: #{key} (#{key.class})\"\n if key.is_a?(String)\n if key.length == 1\n # Assume letter\n @vnc.keyevent(key.chr, true)\n @vnc.keyevent(key.chr, false)\n else\n # Assume keysym\n puts \"I don't know how to type '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end\n else\n # type printables, key others.\n if 32.upto(127).include?(key)\n @vnc.keyevent(key, true)\n @vnc.keyevent(key, false)\n else\n case key\n when 8 \n @vnc.keyevent(0xff08, true)\n @vnc.keyevent(0xff08, false)\n when 13\n @vnc.keyevent(0xff0D, true)\n @vnc.keyevent(0xff0D, false)\n else\n puts \"I don't know how to type web keycode '#{key}'\"\n return { :action => \"status\", :status => \"I don't know how to type '#{key}'\" }\n end # case key\n end # if 32.upto(127).include?(key)\n end # if key.is_a?String\n return nil\n end", "def press_element_key(id, key)\r\n element = find_by_id(id);\r\n keypress_on(element, key)\r\n end", "def macNativeShortcut(element, key)\n\t\tputs key\n\t\tcase key\n\t\twhen 'x'\n\t\t\tputs \"something\"\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar event = new Event('cut', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(event);\n\t\t\t\t\")\n\n\t\twhen 'p'\n\t\t\tpage.execute_script(\"\n\t\t\t\tvar pasteevent = new Event('paste', true, false);\n\t\t\t\t$('.wysihtml5-sandbox').contents().find('body')[0].dispatchEvent(pasteevent);\n\t\t\t\t\")\n\t\tend\n\n\t\telement.native.send_keys [:command, key]\n\tend", "def send_keys(*key)\n @bridge.send_keys_to_active_element(key)\n end", "def type_string text, options={}\n shift_key_down = nil\n\n text.each_char do |char|\n key_to_press = KEY_PRESS_CHARS[char]\n unless key_to_press.nil?\n key_press key_to_press\n else\n key_needs_shift = SHIFTED_CHARS.include? char\n\n if shift_key_down.nil? || shift_key_down != key_needs_shift\n if key_needs_shift\n key_down :shift\n else\n key_up :shift\n end\n end\n\n type char\n shift_key_down = key_needs_shift\n end\n end\n wait options\n end", "def send_keys(sym,id,value)\n #self.wait_and_click(sym, id)\n #driver.action.send_keys(driver.find_element(sym => id),value).perform\n wait_to_appear(sym,id)\n element = driver.find_element(sym,id)\n element.click\n element.send_keys(value)\n end", "def type(text, into:)\n node = find(into)\n\n node.click\n sleep 0.1 # wait 100 milliseconds\n node.send_keys(text)\n end", "def press_key(criteria,element,key)\r\n\t\t\tputs key\r\n\t\t\t@driver.find_element(criteria.to_sym, element).send_keys [:control, 'a'], key.to_sym\r\n\t\t\tsleep 1\r\n\t\t\t#http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Keys#KEYS-constant\r\n\t\tend", "def keystroke(character, *special_keys)\n special_keys = [\"command\"] if special_keys.length == 0\n special_keys_as_applescript_array = special_keys.map { |k|\n \"#{k} down\"\n }.join(\", \")\n execute_applescript(%Q'\n tell application \"System Events\"\n set frontApp to name of first item of (processes whose frontmost is true)\n tell application frontApp\n keystroke \"#{character}\" using {#{special_keys_as_applescript_array}}\n end\n end tell\n ')\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down locator, keycode\r\n command 'keyDown', locator, keycode\r\n end", "def key_down_event _value\n send_cmd(\"key_down_event #{_value}\")\n end", "def send_keys(*args, device: T.unsafe(nil)); end", "def send_key(*args); end", "def _stomp_input_text(*args)\n Log.debug(\"[GRIDIUM::Element] Clearing \\\"#{value}\\\" from element: (#{self})\")\n element.clear\n sleep @text_padding_time\n Log.debug(\"[GRIDIUM::Element] Typing: #{args} into element: (#{self}).\")\n element.send_keys(*args)\n sleep @text_padding_time\n end", "def on_char(evt)\n ch = evt.get_key_code\n mflag = evt.modifiers\n\n case ch\n when Wx::K_RIGHT : move_cursor_right(evt.shift_down)\n when Wx::K_LEFT : move_cursor_left(evt.shift_down)\n when Wx::K_DOWN : move_cursor_down(evt.shift_down)\n when Wx::K_UP : move_cursor_up(evt.shift_down)\n when Wx::K_BACK : on_key_back(evt)\n when Wx::K_DELETE : on_key_delete(evt)\n when Wx::K_TAB : on_key_tab(evt)\n when (mflag == Wx::MOD_CMD and ?a) # select all\n do_select_all\n when (mflag == Wx::MOD_CMD and ?c) # copy\n do_clipboard_copy\n when (mflag == Wx::MOD_CMD and ?x) # cut\n do_clipboard_cut\n when (mflag == Wx::MOD_CMD and ?v) # paste\n do_clipboard_paste\n when ((mflag == Wx::MOD_NONE or mflag == Wx::MOD_SHIFT) and 0x20..0x7e)\n if @cursor.area\n # redirect regular typing to on_char_AREANAME\n return self.send(\"on_char_#{AREAS[@cursor.area]}\", evt)\n end\n else # everything else is for dynamically handling key combo handlers\n m = []\n m << 'alt' if (mflag & Wx::MOD_ALT) != 0\n m << 'cmd' if (mflag & Wx::MOD_CMD) != 0\n m << 'shift' if (mflag & Wx::MOD_SHIFT) != 0\n mods = (m.empty?)? \"\" : \"_\" + m.join('_')\n\n ch = evt.get_key_code\n hex = ch.to_s(16).rjust(2,'0')\n meth=nil\n\n if (n=resolve_key_code(ch)) and respond_to?(\"on_key#{mods}_#{n}\")\n meth=\"on_key#{mods}_#{n}\"\n elsif respond_to?(\"on_key#{mods}_0x#{hex}\")\n meth=\"on_key#{mods}_#{hex}\"\n end\n\n if meth and ret=self.send(meth, evt)\n return ret\n else\n evt.skip()\n end\n end\n end", "def keyboard_send_keyevent(keyevent)\r\n adb_exec(\"shell input keyevent #{keyevent}\")\r\nend", "def keypress(key = nil, name = nil)\n Vedeu.trigger(:key, key)\n\n return false unless key\n\n new(key, name).keypress\n end", "def send_modified_key(element_selector, key, *meta)\n wait_for_loading\n \n key_string = key\n key_string = \"alt+\" + key_string if meta.include? :alt\n key_string = \"ctrl+\" + key_string if meta.include? :control\n key_string = \"command+\" + key_string if meta.include? :command\n\n page.driver.execute_script(\"Mousetrap.trigger('#{key_string}');\")\n end", "def on_key(ch)\n end", "def key_up(*args, device: T.unsafe(nil)); end", "def control_key_up\r\n command 'controlKeyUp'\r\n end", "def type(key)\n call_command(['type', key])\n end", "def key_press *args\n\t\t\tevent(:key_press, *args)\n\t\tend", "def key_down key\n @keys.push key\n end", "def enter_text(element, text)\n @driver.find_element(element[:type], element[:value]).send_keys text\n @driver.hide_keyboard\n end", "def type(key)\n call_command(['type', key])\n end", "def key_stroke(keycodeText)\n append_to_script \"key_stroke \\\"#{keycodeText}\\\"\"\n end", "def input_keypad(input)\n\n $test_logger.log(\"Keypad input value '#{input}'\")\n\n raise \"Testability driver not connected!\" if !$test_ref.td_proc\n\n #Open new testability thread to input string\n $test_ref.exe_in_thread(\"input_keypad\"){sleep 0.5; $test_ref.td_proc.wait_type_confirm(input)}\n\n end", "def send_keys(loc, text)\n @browser.element(parse_location(loc)).send_keys(text)\n end", "def type(key)\n send_command([:type, key])\n end", "def drb_input!\n Vedeu.bind(:_drb_input_) do |data, type|\n Vedeu.log(type: :drb, message: \"Sending input (#{type})\")\n\n case type\n when :command then Vedeu.trigger(:_command_, data)\n when :keypress then Vedeu.trigger(:_keypress_, data)\n else Vedeu.trigger(:_keypress_, data)\n end\n end\n end", "def type_search_text(text)\n send_keys SEARCH_BAR, text\n end", "def dispatch_key_event(type:, modifiers: nil, timestamp: nil, text: nil, unmodified_text: nil, key_identifier: nil, code: nil, key: nil, windows_virtual_key_code: nil, native_virtual_key_code: nil, auto_repeat: nil, is_keypad: nil, is_system_key: nil, location: nil)\n {\n method: \"Input.dispatchKeyEvent\",\n params: { type: type, modifiers: modifiers, timestamp: timestamp, text: text, unmodifiedText: unmodified_text, keyIdentifier: key_identifier, code: code, key: key, windowsVirtualKeyCode: windows_virtual_key_code, nativeVirtualKeyCode: native_virtual_key_code, autoRepeat: auto_repeat, isKeypad: is_keypad, isSystemKey: is_system_key, location: location }.compact\n }\n end", "def keypress\n begin\n _call = direction\n if _call.present?\n _call.keypress(params) if defined?(_call.keypress)\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n end\n render :plain => '', content_type: \"text/html\", :status => 200\n end", "def type_text(locator, text)\n Logbook.step(\"Type text '#{text}' to the input with locator #{locator}\")\n find(locator).send_keys(:backspace, text)\n end", "def key_up(key)\n focus\n @driver.sc_key_up action_target, key, *action_locator_args\n stall :key_up\n end", "def handle_input key_value\n\n @key_value = key_value.to_sym\n changed\n notify_observers self\n\n end", "def control_key_down\r\n command 'controlKeyDown'\r\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def press_keycode(key, metastate: [], flags: [])\n @bridge.press_keycode(key, metastate: metastate, flags: flags)\n end", "def keypress\n key = input\n\n @keypress ||= Vedeu::Input::Translator.translate(key)\n end", "def draw_key_command(key, index)\n rect = item_rect_for_text(index)\n change_color(normal_color)\n draw_text(rect.x, rect.y, rect.width/2, line_height, Vocab.command_name(key))\n if $game_system.xinput_key_set[key]\n change_color(crisis_color)\n draw_text(rect.width/2, rect.y, rect.width/2, line_height, Vocab.gamepad_key($game_system.xinput_key_set[key]), 1)\n else\n change_color(knockout_color)\n draw_text(rect.width/2, rect.y, rect.width/2, line_height, ControllerSettings::NO_KEY_SET, 1)\n end\n end", "def keypress &block\n @keyblock = block\n end", "def onKeyDown( *args )\r\n capture = relay_event( :onKeyDown, args )\r\n relay_event( :onSetCursor, [] )\r\n capture\r\n end", "def add(key)\n cmd = \"input keyevent #{map_key(key)};\"\n @sequence == \"\" ? @sequence = cmd : @sequence = @sequence + cmd\n end", "def send_keys(keys)\n platform.send_keys(keys)\n end", "def append_keys(*args)\n ElementExtensions.highlight(self) if Gridium.config.highlight_verifications\n $verification_passes += 1\n unless element.enabled?\n raise \"Browser Error: tried to enter #{args} but the input is disabled\"\n end\n element.send_keys(*args)\n sleep @text_padding_time\n # when it's possible to validate for more than non-empty outcomes, do that here\n end", "def clear_and_send_keys(*args)\r\n clear($focus_driver)\r\n send_keys(*args)\r\n end", "def typenew(locator, text)\n wait_for(locator)\n clear(locator)\n find(locator).send_keys(text)\n end", "def type_key(key)\n focus\n @driver.sc_type_key action_target, key, *action_locator_args\n stall :type_key\n end", "def keys(pattern = \"*\")\n send_command([:keys, pattern]) do |reply|\n if reply.is_a?(String)\n reply.split(\" \")\n else\n reply\n end\n end\n end", "def press key, options = {}\n key = 'Return' if key == 'ENTER'\n widget = options[:in] || Gtk::Window.toplevels.first\n event = Gdk::EventKey.new(Gdk::Event::KEY_PRESS)\n event.window = widget\n event.state |= Gdk::Window::CONTROL_MASK if key =~ /CTRL+/\n event.state |= Gdk::Window::MOD1_MASK if key =~ /ALT+/\n event.state |= Gdk::Window::SHIFT_MASK if key =~ /SHIFT+/\n event.keyval = Gdk::Keyval.from_name(key.split('+').last)\n widget.grab_focus\n event.send_event = true\n entry = Gdk::Keymap.default.get_entries_for_keyval(event.keyval).first\n event.hardware_keycode = entry[0]\n widget.signal_emit('key_press_event', event)\n process_events\nend", "def alt_key_up\r\n command 'altKeyUp'\r\n end", "def read_keypress(options = {})\n opts = { echo: false, raw: true }.merge(options)\n codes = unbufferred { get_codes(opts) }\n char = codes ? codes.pack('U*') : nil\n\n trigger_key_event(char) if char\n char\n end", "def begin_typing(&block)\n with_keyboard_focus do\n application.keyboard.when_element(:visible?) do\n yield application.keyboard if block_given?\n end\n end\n end", "def on_keypress &b\n on :keypress, &b\n end", "def key_press(*args)\n options = Hash === args.last ? args.pop : {}\n keys = args\n raise ArgumentError, 'Must have at least one key argument' if keys.empty?\n begin\n key_down keys.first\n if keys.length == 1\n yield if block_given?\n else\n key_press(*(keys[1..-1] + [options]))\n end\n ensure\n key_up keys.first\n end\n end", "def execute_set_command(index, keys, text, enabled = true)\n new_command = Key_Command_Container.new(keys, text, enabled)\n set_command(index, new_command)\n end", "def up(key)\n key = normalize_keys(Array(key)).first\n @page.command(\"Input.dispatchKeyEvent\", slowmoable: true, type: \"keyUp\", **key)\n self\n end", "def input(name, value)\n Praline::browser.find_element(:name, name).send_keys(value)\n end", "def press(key, delay: nil, text: nil)\n focus\n page.keyboard.press key, delay: delay, text: text\n end", "def raw_send_keys(*keys)\n invalidate_cache!\n keys.each { |key| vim.type(key) }\n end", "def [](key)\n send key\n end", "def [](key)\n send key\n end", "def method_missing(sym, *args, &block)\n super if !args.empty? or block\n cmds = sym.to_s.split(\"_\")\n callsequence = \"\"\n cmds.each do |cmd|\n callsequence << case cmd.downcase\n when \"ctrl\" then \"^\"\n when \"shift\" then \"+\"\n when \"alt\" then \"!\"\n when \"win\" then \"#\"\n when \"enter\" then \"{ENTER}\"\n when \"return\" then \"{ENTER}\"\n when \"del\" then \"{DEL}\"\n else\n cmd\n end\n end\n send_keys(callsequence)\n end", "def char_press\n begin\n system('stty raw -echo') # turn raw input on\n input = $stdin.getc if $stdin.ready?\n input.chr if input\n ensure\n system('stty -raw echo') # turn raw input off\n end\n end", "def keypress\n $prompt.keypress(\"Press space or enter to continue\", keys: [:space, :return])\nend", "def press(key_sequence)\n end", "def hit(key, *modifiers)\n script = ''\n if key == '\"'\n type(key)\n return\n elsif key.index('0x') == 0\n script = hit_with_system_events(key, *modifiers)\n else\n script = hit_with_extra_suites(key, *modifiers)\n end\n execute_applescript(script)\n end", "def enter(locator, text)\r\n @browser.type(locator, text)\r\n end", "def shift_key_up\r\n command 'shiftKeyUp'\r\n end", "def type(key, &blk)\n call_command(['type', key], &blk)\n end", "def getch\n map_key(key_press)\n end", "def edit(command, value=nil)\n command = command.gsub(/_./) { |i| i[1].upcase }\n \n focus\n\n if value\n `#{document}.native.execCommand(#{command}, false, #{value})`\n else\n `#{document}.native.execCommand(#{command}, false)`\n end\n end", "def type_message(message)\n @driver.find_element(:css => Constants::Css::ITEM_INPUT).click\n @driver.find_element(:css => Constants::Css::ITEM_INPUT).send_keys(message)\n end", "def set_typeahead_value(selector, query)\n find(selector).native.send_keys(*query.chars)\n end", "def update\n\t\tupdate_keypress\n\tend", "def type_text(loc, text)\n @browser.element(parse_location(loc)).send_keys(text)\n end", "def set_and_select(key, element, value)\n key = key.to_s.tr(' ', '_')\n chain(\"#{key}.set\", value) if element.class == Watir::TextField\n chain(\"#{key}.set\") if element.class == Watir::Radio\n chain(\"#{key}.select\", value) if element.class == Watir::Select\n end", "def [](key); send(key); end", "def key_press\n x = $stdin.getch\n x += handle_esc if x == \"\\e\"\n\n x\nend", "def send_keycode(keycode)\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::DOWN))\n send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::UP))\n end" ]
[ "0.678532", "0.67354816", "0.6682622", "0.63587093", "0.6225669", "0.6225669", "0.6135559", "0.6115631", "0.60594606", "0.6048383", "0.6022832", "0.60227036", "0.59938306", "0.59738773", "0.59339654", "0.59339654", "0.5930502", "0.5903649", "0.58866036", "0.5867132", "0.58555204", "0.57849723", "0.5724247", "0.5712591", "0.5694833", "0.56756127", "0.5661738", "0.5661738", "0.5657355", "0.56307065", "0.5612081", "0.55945444", "0.55811304", "0.55575675", "0.554529", "0.55395275", "0.5538417", "0.5488075", "0.54676545", "0.5461208", "0.5447395", "0.54083145", "0.53894395", "0.53084683", "0.52996826", "0.5299344", "0.5284358", "0.52580047", "0.5243739", "0.5233574", "0.52249205", "0.52122164", "0.5209641", "0.52092", "0.5190991", "0.5187712", "0.5177876", "0.5177876", "0.51740175", "0.5173849", "0.5164913", "0.51476187", "0.5106329", "0.5103326", "0.5101508", "0.50990444", "0.5047407", "0.50343204", "0.5025306", "0.5022841", "0.5006107", "0.5002891", "0.49935988", "0.4991145", "0.4972497", "0.49716786", "0.49649426", "0.49502814", "0.49331295", "0.49305415", "0.49157792", "0.49157792", "0.4882882", "0.48812503", "0.48809597", "0.4878578", "0.48785615", "0.48726726", "0.4867472", "0.48660725", "0.48660192", "0.48646805", "0.48626116", "0.48587072", "0.48316845", "0.4826575", "0.48184288", "0.48175383", "0.48146278", "0.48057598" ]
0.63075846
4
Gives focus to a window.
def window_focus window_name command 'windowFocus', window_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def focus(window)\n WIN[:focus].call window\n end", "def focus(window)\n WIN[:focus].call window\n end", "def focus_window(win=nil)\n window(win) << '.dialog().dialog(\"focus\");'\n nil\n end", "def focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def focus\n XDo::FFILib.xdo_window_focus @_xdo_pointer, @_window\n end", "def real_focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_sane_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def focus\n application.focus(self)\n end", "def bring_current_window_to_front\n @fox_driver.switch_to.window(@fox_driver.window_handles.first)\n end", "def open_window\n terminal_process.keystroke(\"n\", :using => :command_down)\n return_last_tab\n end", "def Edit_TakeFocus(hwndCtl) send_edit_message(hwndCtl, :TAKEFOCUS) end", "def open_window(options = nil)\n terminal_process.keystroke(\"n\", :using => :command_down)\n # Options of the first tab must be set before window options, \n # because change of the first tab options causes change of window size\n if options \n set_options(return_last_tab, allowed_options(:tab, options))\n set_options(active_window, allowed_options(:window, options))\n end\n return_last_tab\n end", "def activate_process_window( pid )\n pid , hwnd = find_parent_process_with_hwnd(pid)\n wsh.AppActivate(pid) if pid\n end", "def active_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_active @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end", "def focus!\n @gtk_socket.can_focus = true\n @gtk_socket.has_focus = true\n end", "def focus(locator)\n execute_script(\n 'var element = arguments[0]; element.focus();',\n find_element(locator)\n )\n end", "def focus\n `#@native.focus()`\n end", "def new_tab\n execute_script('window.open();')\n window_handles.last\n end", "def window(name_or_handle)\n logger.info 'EyesTargetLocator.window()'\n logger.info 'Making preparaions...'\n on_will_switch.will_switch_to_window name_or_handle\n logger.info 'Done! Switching to window..'\n __getobj__.window name_or_handle\n logger.info 'Done!'\n driver\n end", "def ctrlSetFocus _args\n \"ctrlSetFocus _args;\" \n end", "def focus\n assert_exists\n driver.execute_script \"return arguments[0].focus()\", @element\n end", "def focus\n assert_exists\n driver.execute_script \"return arguments[0].focus()\", @element\n end", "def show_window\r\n if visible?\r\n bring_to_front()\r\n else\r\n show_modal()\r\n end\r\n end", "def window(name)\n Tk.execute_only(:tkwait, :window, name)\n end", "def open_window_with_key_press(win_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_shown(win_name)\n end", "def open_window_with_key_press(win_name, key, *modifiers)\n wait_start\n key_press_direct(key, *modifiers)\n wait_for_window_shown(win_name)\n end", "def activate_tab_with_click\n wait_start\n click \n wait_for_window_activated(\"Document Window\")\n end", "def switch_to_main_window\n $previous_window = $driver.window_handle\n $driver.switch_to.window($driver.window_handles.first)\nend", "def open_window url, window_id\r\n command 'openWindow', url, window_id\r\n end", "def focus\r\n end", "def switch_to_window(id)\n driver.switch_to.window(id)\n end", "def switch_to_new_window\n $previous_window = $driver.window_handle\n $driver.switch_to.window($driver.window_handles.last)\nend", "def switch_to_new_window(window)\t\r\n\t\t\t# Switch to new window\r\n\t\t\t#new_window = @driver.window_handles.last\r\n\t\t\t@driver.switch_to.window(window)\r\n\t\tend", "def switch_to_previous_window\n @window_id -= 1\n if @window_id < 0\n # wrap back to the last\n @window_id = @browser.windows.count - 1\n end\n\n @browser.windows[@window_id].use\n end", "def window name, cwd, cmd\n raise NotImplementedError.new(\n \"window should be implemented to open new window\")\n end", "def activate_current_window\n if @item_window.index > -1\n @item_window.activate\n else\n @category_window.activate\n end\n end", "def active_window\n if File.exists?(wmii_namespace)\n 'wmiir cat /client/sel/ctl | sed 1q'\n else\n %q[xprop -root _NET_ACTIVE_WINDOW | awk '/#/ { print $(NF) ; exit } END { exit 1 }' || xdotool getwindowfocus]\n end\nend", "def switch_to_next_window\n @window_id += 1\n if @window_id >= @browser.windows.count\n # wrap back to the first\n @window_id = 0\n end\n\n @browser.windows[@window_id].use\n end", "def open_window(options = nil)\n window = terminal.make( :new => :terminal )\n window.launch_ :session => 'New session'\n end", "def open_input_window\n @input_window.open\n end", "def camSetFocus _obj, _args\n \"_obj camSetFocus _args;\" \n end", "def switch_window\n current_window = window\n wins = windows\n wait_until { (wins = windows) && wins.size > 1 } if wins.size == 1\n raise StandardError, 'Unable to determine which window to switch to' if wins.size > 2\n\n wins.find { |w| w != current_window }.use\n window\n end", "def activate_window(title)\n append_to_script \"activate_window \\\"#{title}\\\"\"\n end", "def focused_control\n Window.functions[__method__] ||= AU3_Function.new(\"ControlGetFocus\", 'SSPI')\n buffer = \" \" * AutoItX3::BUFFER_SIZE\n buffer.wide!\n Window.functions[__method__].call(@title.wide, @text.wide, buffer, AutoItX3::BUFFER_SIZE - 1)\n AutoItX3::Control.new(@title, @text, buffer.normal.strip)\n end", "def show_focus\n show_focus_on_row(@oldwinrow, @oldprow, false)\n show_focus_on_row(@winrow, @prow, true)\n # printstr @form.window, 23, 10, @prow\n end", "def focus_file_search\n @search_window.focus_file_search if @search_window\n end", "def focus(loc)\n @browser.element(parse_location(loc)).focus\n end", "def show_window\n\t\tif self.visible?\n\t\t\tself.bring_to_front\n\t\telse\n\t\t\t# We use set_file here to prevent Macs loading the whole dialog when the\n\t\t\t# plugin loads. No need to populate the dialog and use extra resources\n\t\t\t# if it will never be used.\n\t\t\tfilepath = File.join(PATH, 'webdialog/ui_manager.html')\n\t\t\tself.set_file(filepath)\n\t\t\tif PLUGIN.is_mac?\n\t\t\t\tself.show_modal\n\t\t\telse\n\t\t\t\tself.show\n\t\t\tend\n\t\tend\n\tend", "def Edit_NoSetFocus(hwndCtl) send_edit_message(hwndCtl, :NOSETFOCUS) end", "def window name, cwd, cmd\n tab name, cwd, cmd\n end", "def set_front_window(window_id)\n TSApi.tsapi_setFrontWindow(window_id)\n end", "def show_window\n end", "def setwindow(*)\n super\n end", "def window\n Window_Base.new(0, 0, 0, 0)\n end", "def linger caller_window=nil\n begin\n if caller_window\n ch = @win.getchar\n caller_window.ungetch(ch) # will this be available to underlying window XXX i think not !!\n else\n sleep 1\n end\n ensure\n destroy\n end\n end", "def switch_to_previous_window\n $driver.switch_to.window $previous_window\nend", "def new_window(name)\n execute_script(%(\n var w = Math.max(\n document.documentElement.clientWidth, window.innerWidth || 0\n );\n var h = Math.max(\n document.documentElement.clientHeight, window.innerHeight || 0\n );\n window.open(\"about:blank\", arguments[0], `width=${w},height=${h}`);\n ), name)\n end", "def select_next_window(num = 1)\n @server.invoke_command \"select-window -t #{identifier}:+#{num}\"\n current_window\n end", "def foregroundize\n SetForegroundWindow.call(@handle) != 0\n end", "def select_window window_id\r\n command 'selectWindow', window_id||'null'\r\n end", "def select_window window_id\r\n command 'selectWindow', window_id||'null'\r\n end", "def open_window(options = nil)\n session_number = @konsole.currentSession\n session_object = @konsole_service.object(\"/Sessions/#{session_number}\")\n session_object.introspect\n session_object[\"org.kde.konsole.Session\"]\n end", "def customWindowsToEnterFullScreenForWindow(window)\n\t\t[window]\n\tend", "def set_backing_window win\n @otherwin = win\n # XX should we extract the coordinates and use for printing ??\n # or for setting maxrow and maxcol\n end", "def get_window; @window; end", "def set_focus!(page=nil)\n @focus = page || @agent.current_page\n end", "def window(id)\n if block_given?\n original = begin\n @bridge.window_handle\n rescue Error::NoSuchWindowError\n nil\n end\n\n unless @bridge.window_handles.include? id\n raise Error::NoSuchWindowError, \"The specified identifier '#{id}' is not found in the window handle list\"\n end\n\n @bridge.switch_to_window id\n\n begin\n returned = yield\n ensure\n current_handles = @bridge.window_handles\n original = current_handles.first unless current_handles.include? original\n @bridge.switch_to_window original\n returned\n end\n else\n @bridge.switch_to_window id\n end\n end", "def click(*args)\n\t\t\t# if no argument has been provided, click on the\n\t\t\t# window itself\n\t\t\th = (args.length == 0) ? @handle : child(args[0]).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def window(title, timeout = 0)\n timeout = 30 if timeout == 0\n $webdriver.switch_to.default_content \n if not $marathon.windowMatchingTitle(title)\n bmark = MyBenchMark.new\n bmark.report(\"Waiting for window '\" + title + \"'\") {\n wait = Wait.new(:timeout => timeout, :message => \"Waiting for window '\" + title + \"'\")\n begin\n wait.until {\n waitSucceeded = false\n $webdriver.window_handles.each { |h|\n $webdriver.switch_to.window(h) unless waitSucceeded\n waitSucceeded = true if $marathon.windowMatchingTitle(title)\n }\n waitSucceeded\n }\n ensure\n bmark.close\n end\n }\n end\n $marathon.current_search_context = $webdriver\n $marathon.namingStrategy.setTopLevelComponent($marathon.getDriverAsAccessor())\n $marathon.context_handles.clear\n $marathon.context_handles.push( Proc.new { \n $marathon.current_search_context = $webdriver\n $marathon.namingStrategy.setTopLevelComponent($marathon.getDriverAsAccessor())\n } )\nend", "def window\n @window || create_window\n end", "def switch_next_window\n cur_window = browser.window_handle\n browser.close\n browser.window_handles.each do |window|\n next if window.eql?(cur_window)\n\n browser.switch_to.window(window)\n break\n end\n end", "def raise\n # Unsure of the proper tool to use here. \"windowactivate\" seems to work.\n xdotool \"windowactivate #{@id}\"\n sleep $sleep_time\n end", "def switch_to_window(loc)\n if loc[0..3] == 'url=' or loc[0..5] == 'title='\n @browser.window(parse_location(loc)).use\n else\n # assume loc is an integer\n # since Robot Framework sends all args as text, the above check for\n # \"url=\" and \"title=\" is the best we can do to ensure argument correctness\n loc = loc.to_i\n # the number of the window\n # user-facing numbers are 1-based, internal we use 0-based because @browser.windows\n # is a Ruby array, so minus 1\n @window_id = loc - 1\n if @window_id == -1\n # either the user has been too smart for his/her own good and thinks the windows are 0-based,\n # or they've entered text that doesn't match 'url=' or 'title=', in which case\n # the above loc.to_i will make loc equal 0\n raise(ArgumentError, \"You must provide the url or title of the window in the format 'url=' or 'title=', or you must provide the number of the window, starting with 1 for the first window opened.\")\n end\n # this will throw its own error if the index is out of range\n @browser.windows[loc].use\n end\n end", "def window_handle; end", "def new_window(type = :window)\n raise ArgumentError, \"Valid types are :tab and :window, received: #{type.inspect}\" unless %i[window\n tab].include?(type)\n\n handle = @bridge.new_window(type)['handle']\n\n if block_given?\n execute_and_close = proc do\n yield(self)\n begin\n @bridge.close\n rescue Error::NoSuchWindowError\n # window already closed\n end\n end\n window(handle, &execute_and_close)\n else\n window(handle)\n end\n end", "def window\r\n return $window\r\n end", "def focus(name)\n Vedeu.trigger(:_focus_by_name_, name)\n end", "def new_window(type); end", "def window\n Window\n end", "def minimize_window(win)\n # noop\n end", "def window_maximize window_name\r\n command 'windowMaximize', window_name\r\n end", "def window\n WIN[:find].call 'ConsoleWindowClass', title\n end", "def window\n WIN[:find].call 'ConsoleWindowClass', title\n end", "def focus!\n self.update_attribute :focus, 1\n end", "def switch_to_window_by_title window_title\n $previous_window = $driver.window_handle\n window_found = false\n $driver.window_handles.each{ |handle|\n $driver.switch_to.window handle\n if $driver.title == window_title\n window_found = true\n break\n end\n }\n raise \"Window having title \\\"#{window_title}\\\" not found\" if not window_found\nend", "def get_canvas_focus\n find(:css, '#umpleCanvas').click\n end", "def select_previous_window(num = 1)\n @server.invoke_command \"select-window -t:-#{num}\"\n current_window\n end", "def maximize_window(win=nil)\n # noop\n end", "def show_target_window(right)\n @item_window.active = false\n width_remain = (640 - @target_window.width)/2\n @target_window.x = width_remain.floor\n heigth_remain = (480 - @target_window.height)/2\n @target_window.y = heigth_remain.floor\n @target_window.visible = true\n @target_window.active = true\n end", "def show_target_window(right)\n @item_window.active = false\n width_remain = (640 - @target_window.width)/2\n @target_window.x = width_remain.floor\n heigth_remain = (480 - @target_window.height)/2\n @target_window.y = heigth_remain.floor\n @target_window.visible = true\n @target_window.active = true\n end", "def focus_onto_search_input\n click NAVBAR_SEARCH_INPUT_LOCATOR\n end", "def show_window(win, modal)\n modal ||= false\n check_for_window(win) do\n window(win) << \".dialog('option', 'modal', #{format_type_to_js(modal)});\"\n window(win) << \".dialog('option', 'autoOpen', true);\"\n window(win) << '.dialog(\"open\");'\n end\n nil\n end", "def window\n @win\n end", "def set_focus_to(id)\n javascript_tag(\" $(document).ready(function(){$('##{id}').focus()});\");\n end", "def set_focus_to(id)\n javascript_tag(\" $(document).ready(function(){$('##{id}').focus()});\");\n end", "def switch_window(new_window, coords: {})\n @window = new_window\n move(coords[:y], coords[:x]) unless coords.empty?\n end", "def activate_tab_with_key_press(key, *modifiers)\n wait_start\n # TODO: FIXME. key_down and up are not yet implemented on mac and windows\n if linux? \n key_down(key,*modifiers)\n key_up(key, *modifiers)\n else\n key_press_direct(key, *modifiers)\n end\n wait_for_window_activated(\"Document Window\")\n end", "def focus_by_name!\n Vedeu.bind(:_focus_by_name_) { |name| Vedeu.focus_by_name(name) }\n end", "def canBecomeKeyWindow\n true\n end", "def canBecomeKeyWindow\n true\n end", "def activate_tab_with_key_press(key, *modifiers)\n wait_start\n # TODO: FIXME. key_down and up are not yet implemented on mac and windows\n if linux?\n key_down_direct(key,*modifiers)\n key_up_direct(key, *modifiers)\n else\n key_press_direct(key, *modifiers)\n end\n wait_for_window_activated(\"Document Window\")\n end" ]
[ "0.85219616", "0.85219616", "0.8228429", "0.7777055", "0.77721494", "0.75178295", "0.72706217", "0.71527106", "0.68646634", "0.682412", "0.67956877", "0.66836363", "0.66465926", "0.6561443", "0.6542438", "0.64496785", "0.63475627", "0.6340831", "0.6290791", "0.62859464", "0.62859464", "0.62857395", "0.6259947", "0.62240267", "0.62240267", "0.6193716", "0.61778414", "0.6159117", "0.6158612", "0.6154481", "0.6148655", "0.61328137", "0.60633606", "0.6034482", "0.60195553", "0.60088456", "0.5988991", "0.59730434", "0.59408844", "0.58571607", "0.5833237", "0.58236957", "0.581644", "0.58003706", "0.57788104", "0.57571375", "0.57457066", "0.5741544", "0.5729188", "0.56896895", "0.56883883", "0.5675775", "0.5673605", "0.56682813", "0.5662894", "0.56500345", "0.56420845", "0.5640109", "0.5638506", "0.5638506", "0.5637941", "0.561226", "0.56047827", "0.559964", "0.5598519", "0.5586574", "0.5576501", "0.5575776", "0.55586934", "0.5550248", "0.5545928", "0.5538816", "0.5536328", "0.55311203", "0.55288446", "0.55053407", "0.55031294", "0.55027705", "0.5498973", "0.5495319", "0.5492983", "0.5492983", "0.5492644", "0.5485689", "0.548383", "0.54829305", "0.5460352", "0.54480964", "0.54480964", "0.54479927", "0.5447919", "0.5430304", "0.5426948", "0.5426948", "0.542239", "0.54200894", "0.54011405", "0.539857", "0.539857", "0.53925925" ]
0.8274748
2
Resize window to take up the entire screen.
def window_maximize window_name command 'windowMaximize', window_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximize_to_screen\n size = execute_script(%(\n return { width: window.screen.width, height: window.screen.height };\n ))\n\n move_window_to(0, 0)\n resize_window_to(size['width'], size['height'])\n end", "def unfullscreen_height\n\n return unless @window\n\n @window.decorated = true\n @window.set_resizable(true)\n\n # Resize the width of the window\n width = @window.screen.width\n height = @window.screen.height\n\n # We need to change the minimum size of the window\n min_width = width / 4\n min_height = height / 4\n @window.set_size_request(min_width, min_height)\n #puts \"height: #{width} / #{height}\"\n\n @window.unfullscreen\n\n # then we can resize to a smaller size\n new_height = height / 2\n @window.move(0, 0)\n @window.resize(width, new_height)\nend", "def unfullscreen_width\n\n return unless @window\n\n @window.decorated = true\n @window.set_resizable(true)\n\n # Resize the width of the window\n width = @window.screen.width\n height = @window.screen.height\n \n # We need to change the minimum size of the window\n min_width = width / 4\n min_height = height / 4\n @window.set_size_request(min_width, min_height)\n #puts \"width : #{width} / #{height}\"\n\n @window.unfullscreen\n\n # then we can resize to a smaller size\n new_width = width / 2 \n @window.move(0, 0)\n @window.resize( new_width , height)\nend", "def resize new_width, new_height\n win.resize new_width, new_height\n end", "def resize_window_to(width, height)\n driver.manage.window.resize_to(width, height)\n end", "def remake_window\n self.width = window_width\n self.height = window_height\n create_contents\n end", "def set_window_size(screen_width, screen_height)\n # Set screen_width and screen_height if defined\n screen_width ? screen_width : screen_width = 1280\n screen_height ? screen_height : screen_height = 1024\n\n @log.info('Setting the screen window size to: ' + screen_width.to_s + 'x' + screen_height.to_s)\n # @note this is currently supported in Chrome and FF\n @driver.manage.window.resize_to(screen_width, screen_height)\n end", "def set_window_size(screen_width, screen_height)\n # Set screen_width and screen_height if defined\n screen_width ? screen_width : screen_width = 1280\n screen_height ? screen_height : screen_height = 1024\n\n @log.info('Setting the screen window size to: ' + screen_width.to_s + 'x' + screen_height.to_s)\n # @note this is currently supported in Chrome and FF\n @driver.manage.window.resize_to(screen_width, screen_height)\n end", "def resize(w, h, animate=false)\n b = current_bounds\n w = absolutize_size(w, :width)\n h = absolutize_size(h, :height)\n app.windows[0].bounds.set([ b[0], b[1] + height, b[0] + w, b[1] + h + height ])\n end", "def update_local_window_size(size); end", "def maximize_browser_window\n @browser.execute_script(\n \"if (window.screen) {\n window.moveTo(0, 0);\n window.resizeTo(window.screen.availWidth, window.screen.availHeight);\n };\")\n end", "def window_size()\n\t@browser.window.resize_to(x, y)\nend", "def maximize_browser_window\n if ExecutionEnvironment.host_os == :macosx\n position = @browser.manage.window.position\n if position.x + position.y > 0\n position.x = 0\n position.y = 0\n @browser.manage.window.position = position\n end\n max_width, max_height = @browser.execute_script(\"return [window.screen.availWidth, window.screen.availHeight];\")\n @browser.manage.window.resize_to(max_width, max_height)\n else\n @browser.manage.window.maximize\n end\n end", "def resize_mix_window_yea_abe\n return unless $imported[\"YEA-BattleEngine\"]\n @mix_window.height = @skill_window.height\n @mix_window.width = @skill_window.width\n @mix_window.y = Graphics.height - @item_window.height\n end", "def set_size(width = nil, height = nil)\n @window_width = if ptrue?(width)\n # Convert to twips at 96 dpi.\n width.to_i * 1440 / 96\n else\n 16095\n end\n\n @window_height = if ptrue?(height)\n # Convert to twips at 96 dpi.\n height.to_i * 1440 / 96\n else\n 9660\n end\n end", "def fullscreen\n\n return unless @window\n\n # Restore the original dimensions and fullscreen\n @window.set_default_size(-1, -1)\n @window.move(0,0)\n @window.fullscreen\n @window.decorated = false\nend", "def reposition_window\n config = MARW_CONFIGURATION\n self.x = config[:window_x] == -1 ? (Graphics.width - window_width) / 2 : config[:window_x]\n self.y = 0\n end", "def set_size(w=nil, h=nil)\n @window_width = w if w.is_a?(Numeric) && w > 0 # TODO: > min_width\n @window_height = h if h.is_a?(Numeric) && h > 0 # TODO: > min_height\n super(@window_width, @window_height)\nend", "def resize\n # We need to nuke ncurses to pick up the new dimensions\n Curses.def_prog_mode\n Curses.close_screen\n Curses.reset_prog_mode\n height, width = Curses.dimensions\n \n # Resize tabs \n @tabs.resize(\n :width => width,\n :height => height\n )\n @tabs.render\n end", "def resize_to_desktop\n page.driver.browser.manage.window.resize_to(1280, 743)\n end", "def resize_async(width, height, use_hints = false)\n flags = use_hints ? XDo::FFILib::Consts::SIZE_U : 0\n XDo::FFILib.xdo_window_setsize @_xdo_pointer, @_window, width, height, flags\n end", "def resize(ht = 0, w = 0)\n # update sheight and swidth even if reduced, so that pad doesn't overwrite.\n @sheight = ht if ht > 0\n @swidth = w if w > 0\n return if ht < @padheight and w < @padwidth\n @padheight = ht if ht > @padheight\n @padwidth = w if w > @padwidth\n destroy\n $log.debug \" L502 resize, creating newpad with #{@padheight} and #{@padwidth} \"\n @window = Ncurses.newpad(@padheight, @padwidth)\n $log.debug \" L502 resize created #{@window} \"\n return @window\n end", "def handleResize w, h\n\t# Tell OpenGL how to convert from coordinates pixel values\n\tglViewport(0, 0, w, h)\n\t\n\tglMatrixMode(GL_PROJECTION) # Switch to setting the camera perspective\n\t\n\t# Set the camera perspective\n\tglLoadIdentity() # Reset the camera\n\tgluPerspective(45.0, # the camera angle\n\t\t\t\t\tw/ h,\n\t\t\t\t\t1.0,\n\t\t\t\t\t200.0)\nend", "def handleResize w, h\n\t# Tell OpenGL how to convert from coordinates pixel values\n\tglViewport(0, 0, w, h)\n\t\n\tglMatrixMode(GL_PROJECTION) # Switch to setting the camera perspective\n\t\n\t# Set the camera perspective\n\tglLoadIdentity() # Reset the camera\n\tgluPerspective(45.0, # the camera angle\n\t\t\t\t\tw/ h,\n\t\t\t\t\t1.0,\n\t\t\t\t\t200.0)\nend", "def window_size\n manage.window.size\n end", "def window_size\n manage.window.size\n end", "def window_size\n manage.window.size\n end", "def maximize_window(win=nil)\n # noop\n end", "def begin_with\n move_to(0, 0)\n resize_to(screen_width, screen_height)\n end", "def window_width\n MARW_CONFIGURATION[:window_width] == -1 ? Graphics.width : MARW_CONFIGURATION[:window_width]\n end", "def full_screen\n if Capybara.current_driver == :selenium\n this_path = current_path\n page.driver.browser.manage.window.resize_to(1366, 768)\n visit this_path\n end\n end", "def maximize_ish(x = 64, y = 64, w = -128, h = -128)\n if is_headless\n x = 0; y = 0; w = -2; h = -2\n end\n width = w\n height = h\n width = \"window.screen.availWidth - #{-w}\" if w <= 0\n height = \"window.screen.availHeight - #{-h}\" if h <= 0\n if is_headless\n @driver.manage.window.position= Selenium::WebDriver::Point.new(0,0)\n max_width, max_height = @driver.execute_script(\"return [window.screen.availWidth, window.screen.availHeight];\")\n @driver.manage.window.resize_to(max_width, max_height)\n else\n @driver.manage.window.position= Selenium::WebDriver::Point.new(40,30)\n max_width, max_height = @driver.execute_script(\"return [window.screen.availWidth, window.screen.availHeight];\")\n @driver.manage.window.resize_to(max_width-90, max_height-100)\n end\n @driver.execute_script %[\n if (window.screen) {\n window.moveTo(#{x}, #{y});\n window.resizeTo(#{width}, #{height});\n };\n ]\n end", "def resize_to(width, height)\n Selenium::WebDriver::Dimension.new(Integer(width), Integer(height)).tap do |dimension|\n use { @driver.manage.window.size = dimension }\n end\n end", "def ReSizeGLScene(width, height)\n if (height==0) # Prevent A Divide By Zero If The Window Is Too Small\n height=1\n end\n glViewport(0,0,width,height) # Reset The Current Viewport And\n # Perspective Transformation\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n gluPerspective(45.0,Float(width)/Float(height),0.1,100.0)\n glMatrixMode(GL_MODELVIEW)\nend", "def resize(width, height); end", "def ensure_browser_size(width = 1280, height = 1280)\n Capybara.current_session.driver.browser.manage.window.resize_to(width, height)\n end", "def window_width() Graphics.width - 128 end", "def resize_to_fit(win, padding=20)\n if(padding.is_a?(Hash))\n w_pad = padding[:width_pad]\n h_pad = padding[:height_pad]\n else\n w_pad = h_pad = padding\n end\n auto_resize(win, h_pad, :height)\n auto_resize(win, w_pad, :width)\n center_window(win)\n end", "def resize_to_fit_page driver\n width = driver.execute_script(\"return Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);\")\n height = driver.execute_script(\"return Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);\")\n driver.manage.window.resize_to(width, height)\n end", "def make_screen\n flags = [HWSURFACE, DOUBLEBUF] # FULLSCREEN will be added later\n @screen = Screen.open( [600, 900], 0, flags )\n @screen.title = \"Geotower for great good!\"\n end", "def size w = DEFAULT_SCREEN_WIDTH, h = DEFAULT_SCREEN_HEIGHT\n width w\n height h\n end", "def window_width\n Graphics.width / 2\n end", "def maximize\n wait_for_stable_size { @driver.maximize_window(handle) }\n end", "def resize_event event\n @widget.size = event.size\n scene.scene_rect =\n Qt::RectF.new(0, 0, event.size.width, event.size.height)\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def window_width\n return WINDOW_WIDTH\n end", "def screen_size\n coords = execute_applescript(%Q`\n tell application \"Finder\"\n get bounds of window of desktop\n end tell\n `)\n coords = coords.split(\", \").collect {|c| c.to_i}\n movie.to(*coords)\n end", "def resize width = max_width, height = max_height\n @form.resize width, height\n self.write Mine::Key.RESIZE\n end", "def before_show()\n $ENV = VR::load_yaml(SavableSettings, \"settings.yaml\")\n @builder[:window1].resize $ENV.width, $ENV.height\n refresh()\n end", "def main_window\r\n super\r\n # Make main command window\r\n main_command_window\r\n # Make play time window\r\n @playtime_window = Window_PlayTime.new\r\n @playtime_window.x = 0\r\n @playtime_window.y = 224\r\n # Make steps window\r\n @steps_window = Window_Steps.new\r\n @steps_window.x = 0\r\n @steps_window.y = 320\r\n # Make gold window\r\n @gold_window = Window_Gold.new\r\n @gold_window.x = 0\r\n @gold_window.y = 416\r\n # Make status window\r\n @status_window = Window_MenuStatus.new\r\n @status_window.x = 160\r\n @status_window.y = 0\r\n end", "def size\n console.winsize\n end", "def window\n @window ||= UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)\n end", "def with_window_size(window_size)\n reconfigure(configuration.with(window_size: window_size))\n end", "def set_selenium_window_size(width, height)\n window = Capybara.current_session.driver.browser.manage.window\n window.resize_to(width, height)\nend", "def resize_browser(x,y)\r\n\t\t#resize\r\n\t\t@driver.manage.window.resize_to(x,y)\r\n\t\tsleep 3\r\n\tend", "def fullscreen\n @driver.fullscreen_window(handle)\n end", "def with_you(window, position, width, height)\n\n initialize_config\n width = UserConfig[:with_you_width] unless width\n position = UserConfig[:with_you_position] unless position\n height = UserConfig[:with_you_height] unless height\n\n if UserConfig[:with_you_stick]\n window.stick(); end\n\n if UserConfig[:with_you_skip_taskbar]\n window.skip_taskbar_hint = true; end\n\n if UserConfig[:with_you_side] then\n notice \"[with_you] Dock mode:config=#{UserConfig[:with_you_side]}\"\n window.resizable = false\n window.set_default_size(width, height)\n window.set_size_request(width, height)\n window.gravity = Gdk::Window::GRAVITY_STATIC\n win_top = 0\n win_left = 0\n if position == LEFT_SIDE\n win_left = WORK_AREA[0]\n win_top = WORK_AREA[1]\n else\n win_left = WORK_AREA[0] + WORK_AREA[2] - width\n win_top = WORK_AREA[1]; end\n \n window.window.type_hint = Gdk::Window::TYPE_HINT_DOCK\n window.can_focus = true\n window.accept_focus = true\n window.move(win_left , win_top)\n\n # 左側\n if position == LEFT_SIDE\n NetWmStrutPartial::set(window.window, win_left + width, 0, 0, 0, win_top, win_top + height, 0, 0,\n 0, 0, 0, 0)\n # 右側\n else\n NetWmStrutPartial::set(window.window, 0, width, 0, 0, 0, 0, win_top, win_top + height,\n 0, 0, 0, 0); end\n\n else\n notice \"[with_you] NORMAL window mode:config=#{UserConfig[:with_you_side]}\"\n NetWmStrutPartial::set(window.window, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0)\n window.resizable = true\n window.window.type_hint = Gdk::Window::TYPE_HINT_NORMAL\n window.decorated = true\n window.set_default_size(0, 0)\n end\n end", "def resizeCanvas(w,h)\n puts(\"resizing canvas\")\n puts(w,h)\n @canvasHeight = h #Set the canvas height\n @canvasWidth = w #Set the canvas width\n @canvas.resize(w,h)\n @exportImage = FXPNGImage.new(@parentApp, nil, @canvasWidth, @canvasHeight)\n @exportImage.create #initializes the image object.\n @exportImage.resize(@canvasWidth, @canvasHeight) #Sets the image to match canvas width and height\n @layerArray = Array.new #Reset the layer array\n @imageArray = Array.new #Reset the image array\n @dirtyArray = Array.new #Reset the dirty array\n @activeIndex = 0 #Reset the active index\n createImage() #Push a blank image data.\n @activeImage = @imageArray[@activeIndex] #Update active index to default.\n @canvas.update #Update the draw canvas to reflect changes.\n end", "def draw_board_window\n heightpx = @board.height*@scale\n widthpx = @board.width*@scale\n TkCanvas.new(@root, bg: \"#ffffff\", height: heightpx, width: widthpx) { grid(row: 1, column: 1) }\n end", "def resize_browser(width, heigth)\n $driver.manage.window.resize_to(width, heigth)\nend", "def resize width, height\n @widgets[@index].width = width\n @widgets[@index].height = height\n @widgets[@index].repaint\n end", "def resize_to(width, height); end", "def center_window\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n refresh_cursor_position\n end", "def get_window_size\n Ncurses.refresh\n cols, rows = [], []\n Ncurses.stdscr.getmaxyx rows, cols\n [rows.first, cols.first]\n end", "def set_windows\n set_title \"R-Bloggyn::#{@usuario.alias}\" #nombre de la ventana\n set_default_size 640, 480 #tamaño de la ventana\n set_skip_taskbar_hint true\n set_window_position Gtk::Window::POS_CENTER #posicion de la ventana\n self.set_attributes\n add @hbox\n show_all #muestra todo\n end", "def maximize()\r\n $jssh_socket.send(\"#{WINDOW_VAR}.maximize();\\n\", 0)\r\n read_socket()\r\n end", "def fill_window(value = true, options = {})\n value ? add_style(FILL_WINDOW_CSS, options[:screen]) : remove_style(FILL_WINDOW_CSS, options[:screen])\n end", "def center_window\n self.x = (Graphics.width - self.width)/2\n self.y = (Graphics.height - self.height)/2\n end", "def win_width\n Curses.cols - win_padding\n end", "def local_window_size; end", "def screen_size\n coords = execute_applescript(%Q`\n tell application \"Finder\"\n get bounds of window of desktop\n end tell\n `)\n coords = coords.split(\", \").collect {|c| c.to_i}\n to(*coords)\n end", "def resize(width, height)\n end", "def refresh\n @window.resize(height, width)\n @window.move(top, left)\n @window.clear\n @window.bkgd(1) # even background hack\n buffer_content if @content.is_a?(Proc)\n print_buffer\n draw_border\n @window.noutrefresh\n visible_children.each(&:refresh)\n end", "def size(x, y)\n start_time = Time.now\n xdotool \"windowsize #{@id} #{x} #{y}\"\n while [x, y] != get_geometry(@id)\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not react - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end", "def setup\n \n\t# The size function is a statement that tells the computer \n\t# how large to make the window.\n\t# Each function statement has zero or more parameters. \n\t# Parameters are data passed into the function\n\t# and used as values for specifying what the computer will do.\n\tsize 640, 360\n\t\n\t# The background function is a statement that tells the computer\n\t# which color to make the background of the window \n\tbackground 102\n\t\nend", "def build_window\n max = @choices.size\n max = MaxChoice if max > MaxChoice\n self.height = max * default_line_height + window_builder[5] + window_builder[-1]\n refresh\n end", "def size_default\n start_time = 0\n xdotool \"windowsize #{@id} #{@default.join(\" \")}\"\n while @default != get_geometry(@id)\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not resize - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end", "def resize_browser(width,heigth)\n $driver.manage.window.resize_to(width,heigth)\nend", "def resize_to_mobile\n page.driver.browser.manage.window.resize_to(360, 591)\n end", "def make_screen\n @screen = Screen.new(Configuration.screen[:size], 32, [HWSURFACE, DOUBLEBUF])\n\n @screen.title = \"Towerdefence!\"\n end", "def window_width\n end", "def browser_width=(width)\n width = @browser.screen_width if width == FULL_SCREEN_SIZE\n @browser.window.resize_to(width.to_i, @browser.window.size.height)\n end", "def set_size(w,h)\n @width = w\n @height = h\n end", "def resize(width=nil, height=nil)\n config[:width], config[:height] = determine_terminal_size(width, height)\n pager.resize(config[:width], config[:height])\n end", "def create_screen(w = 640, h = 480, bpp = 16, flags = SDL::SWSURFACE)\n init\n self.screen ||= SDL.set_video_mode(w, h, bpp, flags).tap{|o|\n def o.update(x = 0, y = 0, w = 0, h = 0)\n update_rect(x, y, w, h)\n end\n }\n end", "def window_height\n fitting_height(11)\n end", "def window_height\n fitting_height(11)\n end", "def window_height\n fitting_height(11)\n end", "def reshape(width, height)\n h = height.to_f / width.to_f\n glViewport(0, 0, width, height)\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0)\n glMatrixMode(GL_MODELVIEW)\n glLoadIdentity()\n glTranslatef(0.0, 0.0, -40.0)\n end", "def wrefresh\n Ncurses.wrefresh(@window)\n end", "def window\n Window_Base.new(0, 0, 0, 0)\n end", "def remote_window_size; end", "def resize(w, h)\r\n @x2 = @x1 + w\r\n @y2 = @y1 + h\r\n end", "def main_window\r\n super\r\n # Make command window\r\n s1 = \"To Title\"\r\n s2 = \"Shutdown\"\r\n s3 = \"Cancel\"\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 240 - @command_window.height / 2\r\n end", "def resize_gl\n\n\t\tview_rectangle = bounds\n\n\t\t# Ensures camera knows size changed :\n\t\tif (@camera.view_height != view_rectangle.size.height) or (@camera.view_width != view_rectangle.size.width)\tthen\n\n\t\t\t@camera.view_height = view_rectangle.size.height\n\t\t\t@camera.view_width = view_rectangle.size.width\n\n\t\t\tglViewport(0, 0, @camera.view_width, @camera.view_height)\n\t\t\tupdate_projection\n\n\t\t\tupdate_info_string\n\n\t\tend\n\n\tend", "def screen_size\n compatible_call :screen_size\n end", "def setup\n \n size 640, 360\n \nend" ]
[ "0.73761135", "0.669949", "0.6638872", "0.6576199", "0.65397024", "0.6513494", "0.6507065", "0.6498855", "0.645071", "0.6394053", "0.63501805", "0.63484734", "0.61672306", "0.6164919", "0.61118096", "0.6039833", "0.59406614", "0.58985895", "0.5883884", "0.5853148", "0.57843107", "0.57841194", "0.57805336", "0.57805336", "0.57510793", "0.57510793", "0.57510793", "0.57459486", "0.5745244", "0.5734397", "0.57049984", "0.57007474", "0.56878734", "0.5670285", "0.5628249", "0.5622459", "0.5608148", "0.5512339", "0.5496394", "0.5492391", "0.5480872", "0.5471423", "0.5458082", "0.54488236", "0.54369617", "0.54369617", "0.54369617", "0.54369617", "0.54369617", "0.5417645", "0.54138696", "0.54044443", "0.5403998", "0.53963625", "0.5391114", "0.537307", "0.5372956", "0.5372299", "0.5351513", "0.5337878", "0.53130394", "0.53088284", "0.53000826", "0.52890927", "0.52844936", "0.52756226", "0.5270664", "0.52651656", "0.52633506", "0.52616537", "0.52599853", "0.52559555", "0.5247869", "0.52462924", "0.5216509", "0.521248", "0.5207324", "0.519804", "0.51940393", "0.5179686", "0.5164207", "0.5158358", "0.51526845", "0.5132179", "0.51270485", "0.51135063", "0.5113221", "0.5096032", "0.5074006", "0.5074006", "0.5074006", "0.50726014", "0.5065376", "0.5059624", "0.50461805", "0.5035292", "0.50289583", "0.5027705", "0.5017217", "0.50170344" ]
0.51145214
85
Writes a message to the status bar and adds a note to the browserside log. +context+ is the message sent to the browser. +log_level_threshold+ can be +nil+, :debug, :info, :warn or :error.
def set_context context, log_level_threshold = nil if log_level_threshold command 'setContext', context, log_level_threshold.to_s else command 'setContext', context end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warning(context, options = nil)\n options = options.merge(level: 'warning')\n log(context, options)\n end", "def log(context, msg)\n @log << \"#{context}: #{msg}\"\n end", "def notify(message)\n status_bar = @builder['statusbar']\n status_bar.push(status_bar.get_context_id(''), message)\n end", "def say_status(status, message, log_status = true)\n Strainer.log.info(\"status: #{status}, message: #{message}\")\n\n return if quiet?\n super(status, message, log_status)\n end", "def write( message )\n\t\t\tApache.request.server.log_debug( message )\n\t\tend", "def log( message )\n lp \"JavaScript: #{message}\", force_color: :purple, log_js: true\n end", "def add_context(context)\n context[:library] = 'analytics-ruby'\n end", "def add(level, context, message)\n @logger.send level, @formatter.format(level, context, message)\n rescue => e\n STDERR.puts \"Failed to log message for #{context} with appender #{self} - #{level} - #{message}\\n\"\n STDERR.puts \"#{e}\\n\"\n end", "def new(context)\n dup.tap do |logger|\n logger.context = \"#{logger.context}#{context_separator}#{context}\"\n end\n end", "def add_context(context)\n context[:library] = { :name => \"analytics-ruby\", :version => Segment::Analytics::VERSION.to_s }\n end", "def info_and_log(message)\n @ui.info(message)\n @logger.info(message)\n end", "def perform(log)\n log.write(\"#{@message ** @ctx}\\n\")\n true\n end", "def log(message)\n\t\t\t\t@shell.write_object ['log', message]\n\t\t\tend", "def info(context, options = nil)\n options = options.merge(level: 'info')\n log(context, options)\n end", "def log(message)\n if ENV['VERBOSE']\n output.puts \"*** #{message}\"\n elsif ENV['VVERBOSE']\n time = Time.now.strftime('%H:%M:%S %Y-%m-%d')\n output.puts \"** [#{time}] #$$: #{message}\"\n end\n end", "def write(level, message)\n if Boxlet.debug?\n if message.is_a? String\n puts message\n else\n pp message\n end\n else\n if level == :info\n pp message\n end\n @log.call(level, message)\n end\n end", "def print_status(msg)\n puts \"\" if verbose_mode?\n puts \"#{color('----->', 32)} #{msg}\"\n end", "def save_context(context)\n message_context_session[:context] = context\n end", "def print_status(msg='')\n end", "def say(status, message = \"\", log_status = true)\n shell = Thor::Shell::Color.new\n log_status = false if @options and @options[:quiet]\n shell.say_status(status, message, log_status)\n end", "def notify( message, log_level=:info)\n raise \"Log level #{log_level} does not exist!\" unless [:info,:warn,:error,:debug].include?(log_level.to_sym)\n cm=get_confManager\n \n $log=Logger.new( \"#{cm.target_dir}/sqweeze.log\" ) unless $log \n $log.send(log_level, ansi_nocolour(message)) \n \n puts message unless cm.get_conf( \"suppress_#{log_level}\".to_sym)\n end", "def add_global_offense(message = T.unsafe(nil), severity: T.unsafe(nil)); end", "def log_current_status(status)\n message = \"#{task_details_for_log}, status: #{status}\"\n if (UNDEFINED_STATUSES + STOPED_STATUSES).include?(status)\n Astute.logger.error message\n else\n Astute.logger.debug message\n end\n end", "def create_status_bar\n status_bar.show_message(tr(\"Ready\"))\n end", "def log_stuff\r\n log.info(\"TestLogger is here to log stuff.\")\r\n log.warn(\"TestLogger is finishged logging. Be careful.\")\r\n end", "def service_log status: :processed, message:\n colors_list = { failure: :red, success: :green, info: :cyan, warning: :yellow }\n\n log_header = ActiveSupport::LogSubscriber.new.send(:color, \"[SERVICE #{status.to_s.upcase}]\", colors_list[status])\n service_logger.warn \"#{log_header} #{message}\"\n end", "def log(*args) # :doc:\n if args.size == 1\n say args.first.to_s unless options.quiet?\n else\n args << (behavior == :invoke ? :green : :red)\n say_status(*args)\n end\n end", "def add_context(context)\n return unless context.present?\n @current_context ||= []\n @current_context << context.strip\n end", "def log(message)\n\t\tif !@progress_dialog.nil?\n\t\t\t@progress_dialog.logMessage(message)\n\t\telse\n\t\t\tputs message\n\t\tend\n\tend", "def write(msg)\n @logger.info msg\n end", "def update_status_bar\n VIM::evaluate(\"genutils#MoveCursorToWindow(1)\")\n @status_buffer[1] = \" \"*@width\n print_to_buffer(@status_buffer, 1, 0, \"Money: #{@city.coins.round}\")\n print_to_buffer(@status_buffer, 1, 18, \"Population: #{@city.population.round} / #{@city.population_cap}\")\n print_to_buffer(@status_buffer, 1, 40, \"Free people: #{@city.free_workers.round}\")\n print_to_buffer(@status_buffer, 1, 60, \"Oxygen: #{@city.oxygen.round}\")\n print_to_buffer(@status_buffer, 2, 90, \"- Press '?' for commands -\")\n VIM::evaluate(\"genutils#MoveCursorToWindow(2)\")\n end", "def log_message( level, message )\n\n end", "def alert(msg) log(1, msg); end", "def log_message(message, message_type = MessageType::NOTE, severity = Logger::UNKNOWN)\n case message_type\n when MessageType::SUCCESS\n html_class = 'success'\n when MessageType::FAIL\n html_class = 'fail'\n when MessageType::CJIMS\n html_class = 'note_cjims'\n when MessageType::INCOMPLETE\n html_class = 'incomplete'\n when MessageType::WARNING\n html_class = 'note_warn'\n else MessageType::NOTE\n case severity\n when Logger::FATAL\n html_class = 'note_fatal'\n when Logger::ERROR\n html_class = 'note_error'\n when Logger::WARN\n html_class = 'note_warn'\n when Logger::DEBUG\n html_class = 'note_debug'\n when Logger::INFO\n html_class = 'note_info'\n else Logger::UNKNOWN\n html_class = 'note_unknown'\n end\n end\n @logger.add(severity) {'<div class=\"' + html_class + '\">' + create_date_time_stamp(true, '-', ' ', ':') + ' ' + CGI.escapeHTML(message) + '</div>'}\n end", "def log(*args)\n if args.size == 1\n say args.first.to_s unless options.quiet?\n else\n args << (behavior == :invoke ? :green : :red)\n say_status(*args)\n end\n end", "def log_message(message)\n @log.info(message) if @options[:logging_enabled]\n end", "def log_message(message)\n @log.info(message) if @options[:logging_enabled]\n end", "def log_message(message)\n @log.info(message) if @options[:logging_enabled]\n end", "def log level, message; write level, message, caller[0] unless level > @level end", "def warning(msg) log(4, msg); end", "def print_status(msg = '')\n $stderr.puts \"[*] #{msg}\"\n end", "def log_own_message(text, level, is_notice)\n return if @stopped\n\n @filemutex.synchronize do\n log_own_htmlmessage(text, is_notice)\n end\n end", "def print_status(msg)\n\t\tself.module.print_status(msg)\n\tend", "def write_new_context(context, initial)\n # Write the context's index in the world\n write_bits(context.index, 11)\n # Write the context's state update flag bit\n write_bit(context.flags[:state?])\n # Write the context's discard_waypoints flag bit\n write_bit(context.flags[:discard_waypoints?])\n # Write deltas for the mob\n write_bits(initial.position[:current][:y] - context.position[:current][:y], 5)\n write_bits(initial.position[:current][:x] - context.position[:current][:x], 5)\n end", "def partial_status\n get_context!\n if @backend_job\n index = params[:log_end].to_i\n @logs = @backend_job.logger.segment(index, 100)\n else\n if @backend.nil? && @frontend_job\n @logs = @frontend_job.logger.segment(index, 100)\n end\n end\n end", "def log(*args)\n if args.size == 1\n say args.first.to_s unless options.quiet?\n else\n args << (self.behavior == :invoke ? :green : :red)\n say_status *args\n end\n end", "def log_write(msg)\n puts msg\n end", "def print_status(string)\n\tputs \"[*] \".light_blue + \"#{string}\".white\nend", "def print_message(message)\n puts message+\"\\n\"\n system('logger '+message+\"\\n\") \nend", "def add_processing_message(level, severity, text)\n \n # See if we are bumping the level up or down\n if @log_level < level\n while @log_level < level\n @process_log << \"<ul>\"\n @log_level += 1\n end\n elsif @log_level > level\n while @log_level > level\n @process_log << \"</ul>\"\n @log_level -= 1\n end\n end\n @log_level = level\n \n # Log Level 1 is a special case for top-level information. \n # All other levels are subordinate to some larger piece (e.g. MileageUpdate processing)\n if level == 1\n @process_log << \"<p class='text-#{severity}'>#{text}</p>\" \n else\n @process_log << \"<li><p class='text-#{severity}'>#{text}</p></li>\"\n end\n end", "def log_output(level, file_name, line_number, xcode_output, message)\n if xcode_output\n message = message.chomp\n case level\n when :error, :result_error\n puts \"#{file_name}:#{line_number}: error: #{message}\"\n when :warning\n puts \"#{file_name}:#{line_number}: warning: #{message}\"\n when :result_success\n puts \"✓ #{message}\"\n else\n puts \"#{message}\"\n end\n else\n case level\n when :error\n puts \"✘ Error, #{message}\".red\n when :result_error\n puts \"\\nResult: ✘ #{message}\".bold.red\n when :warning\n puts \"⊗ Warning, #{message}\".yellow\n when :result_success\n puts \"\\nResult: ✓ #{message}\".bold.green\n when :info\n puts \"#{message}\".blue\n end\n end\nend", "def send_status( severity, message )\n puts \"Telework: #{severity}: #{message}\"\n info= { 'host'=> @HOST, 'severity' => severity, 'message'=> message,\n 'date'=> Time.now }\n status_push(info)\n end", "def statusbar(message, time=nil)\n message << \" (#{time.round(3)}s)\" if time\n message = message.to_s.center term_width\n block_given? ? yield(message) : message\n end", "def flash(msg)\n\t$Log.info msg\nend", "def log_message(message)\n\t\tputs(message)\n\tend", "def log(message); logger.info(message); end", "def notify_warning(error, context_message = nil)\n log(error, level: :warn) do\n @config.warn_notifiers&.map { |notifier| notifier.call(error, context_message) }\n end\n end", "def log(message)\n @logger.info message\n end", "def log(message)\n warn \"dm-visualizer: #{message}\"\n end", "def log_message(env, message)\n if env['rack.logger']\n env['rack.logger'].info(message)\n end\n end", "def log message\n logger.info(\"[paperclip] #{message}\") if logging?\n end", "def log(message)\n STDOUT.puts message\nend", "def logs message\n puts \"#{Time.now}: #{message}\"\n end", "def format(level, context, message)\n msg = message.to_s.strip\n thread = thread_context ? \"[#{thread_name}] - \" : nil\n\n if message.ndc.any?\n msg = \"#{thread}#{level.to_s.upcase} - #{context} #{message.ndc.join(' ')} - #{msg}\"\n else\n msg = \"#{thread}#{level.to_s.upcase} - #{context} - #{msg}\"\n end\n\n with_backtrace(message, msg)\n end", "def log_v severity, argv, &block\n\n\t\treturn nil unless severity_logged? severity\n\n\t\tlog_or_trace_with_block_ 1, severity, argv, &block\n\tend", "def draw_status_text\n draw_text(0, 0, contents_width, line_height, status_text, 1)\n end", "def describe_context(context)\n @current_context = context\n end", "def set_context\n @context = Monitoring::Context.find(params[:context_id])\n end", "def send_message(message)\n @module_manager.bot.log prefix + message + \"\\e[0m\"\n end", "def write_server_status(pid)\n File.open(\"#{ENV['TM_PROJECT_DIRECTORY']}/config/.event_server\", 'w') {|f| f.write(\"pid: #{pid}\") }\n end", "def log(message)\n puts \"Worker ##{@id}: #{message}\" unless ENV['RACK_ENV'] == 'test'\n end", "def say(message)\n puts green(message) if self.verbose \n end", "def report_message(message, state)\n color = state == true ? :green : :red\n str = message.colorize(color)\n output_to_path(str)\n store(str, state)\n end", "def message(string)\n to_console loggify(string, :message, :green)\n to_file loggify(string, :message)\n end", "def log (msg, **kwargs) Log.write(msg, :info, kwargs) end", "def status(text)\n STDERR.puts blue_term_text(text)\n end", "def progress(msg, nontty_log = T.unsafe(nil)); end", "def puts_warning(msg)\n $stdout.puts \"\\e[33m[WARNING] #{msg}\\e[0m\" if Calamum::Config[:debug]\nend", "def write(message)\n @m.synchronize do\n @logfile.write(message) unless @logfile.nil?\n @responses.each{|res| res.send_event(\"build_log\", strip_control_chars(message)) }\n end\n end", "def report(text)\n @status.pop(0)\n @status.push(0, text)\n end", "def report(text)\n @status.pop(0)\n @status.push(0, text)\n end", "def write_status(state, mesg = '')\n msg = \"#{state} #{mesg}\\n\"\n $RQ_IO.syswrite(msg)\n log(\"#{state} #{mesg}\")\nend", "def write(msg)\n\t\tinfo(msg)\n\tend", "def myputs(msg)\n if $options[:mode] == 'cron'\n puts msg\n else\n $progressbar.log msg\n end\nend", "def show_cucumber_status(text = nil)\n print \"Spork Cucumber: #{status(@cucumber_pid, text)}\\n\"\n end", "def debug(message)\n warn \"==== VLO DEBUG: \" + message if ENV[\"VLO_DEBUG\"] == 'true'\nend", "def log_comment\n render json: { message: \"Webhook received\" }\n end", "def log(message)\n puts message\n Syslog.open('volume_testing', Syslog::LOG_PID | Syslog::LOG_CONS) { |s| s.warning message }\nend", "def context=(context = null)\n @bridge.set_context(context)\n end", "def context=(context = null)\n @bridge.set_context(context)\n end", "def warn message; write WARN, message, caller[0] unless level > @level end", "def run(context)\n if context[SHOW_VERSION_KEY]\n @output.puts(@version_string)\n else\n yield\n end\n end", "def warn message\n super message if @verbosity > 1\n end", "def critical(msg) log(2, msg); end", "def warn(message)\n log(\"#{color(\"WARNING:\", :yellow, :bold)} #{message}\")\n end", "def view_layouts_base_body_bottom(context = {})\n output = ''\n\n @controller = context[:controller]\n return output if !@controller\n return output if @@supported_controllers.include?(@controller.class.name) == false\n\n # all controller call \"issues_context_menu_path\" must be in @@supported_controllers\n output << @controller.send(:render_to_string, {:partial => 'timesheet/add_in_timesheet_popup.html.erb'})\n\n return output\n rescue Exception => exc\n puts exc\n puts exc.backtrace\n return ''\n end", "def print_context(message)\n return if message[:check] == 'documentation'\n return if message[:kind] == :fixed\n line = get_context(message)\n offset = line.index(%r{\\S}) || 1\n puts \"\\n #{line.strip}\"\n printf(\"%#{message[:column] + 2 - offset}s\\n\\n\", '^')\n end", "def log(message)\n puts message\n end", "def basic_status_and_output(messages); end" ]
[ "0.5786788", "0.5582664", "0.5557157", "0.50940627", "0.49781993", "0.48721188", "0.48417515", "0.48007002", "0.47826996", "0.47050846", "0.46999088", "0.46941087", "0.4640209", "0.4624585", "0.46027303", "0.45997378", "0.45621648", "0.45511734", "0.4550646", "0.4541792", "0.45233366", "0.4515852", "0.45077604", "0.45052132", "0.44937578", "0.4490752", "0.4481897", "0.44742596", "0.4470894", "0.44576055", "0.44505897", "0.44472045", "0.44378838", "0.44350022", "0.4432927", "0.44327414", "0.44327414", "0.44327414", "0.44304514", "0.4429462", "0.44283864", "0.44191554", "0.4406203", "0.44025892", "0.44015238", "0.4395251", "0.4382106", "0.43759385", "0.43738213", "0.43696907", "0.43665782", "0.43622857", "0.435", "0.4348385", "0.4345991", "0.43389544", "0.4332886", "0.43269426", "0.43229264", "0.43194798", "0.43128628", "0.43104455", "0.43067873", "0.43042538", "0.43041062", "0.4299922", "0.42968994", "0.42897967", "0.42843136", "0.42791432", "0.4278951", "0.42780146", "0.42692742", "0.4269158", "0.4268525", "0.42622298", "0.4259287", "0.42577946", "0.42543346", "0.42403203", "0.42403203", "0.42396098", "0.42381942", "0.4235941", "0.42287952", "0.42279318", "0.42170304", "0.4216749", "0.42161033", "0.42161033", "0.4211308", "0.4210669", "0.42046434", "0.4199553", "0.419895", "0.419313", "0.41907263", "0.4190721", "0.41885844" ]
0.6215824
1
Runs the specified JavaScript snippet repeatedly until it evaluates to +true+. The snippet may have multiple lines, but only the result of the last line will be considered. Note that, by default, the snippet will be run in the runner's test window, not in the window of your application. To get the window of your application, you can use the JavaScript snippet selenium.browserbot.getCurrentWindow(), and then run your JavaScript in there. +timeout+ is specified in milliseconds.
def wait_for_condition script, timeout command 'waitForCondition', script, timeout end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def breakpoint!(text='Click anywhere to continue...', timeout=0)\n puts \">> breakpoint reached. click anywhere in the browser to continue\"\n\n text = text.gsub(\"\\\"\", \"\\\\\\\"\")\n\n execute_scopejs_script %(\n document.body.appendChild(div(\n {\n id: '_breakpoint_overlay',\n style: 'background-color: rgba(0, 0, 0, 0.6); position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; text-align: center;',\n onClick: function() { App.remove_element('_breakpoint_overlay'); }\n },\n p({ style: 'margin: 150px 100px; line-height: 60px; font-size: 50px; color: white; text-shadow: 3px 3px #000' }, \"#{text}\"))\n );\n if (#{timeout} > 0) setTimeout(function() {\n var e = document.getElementById('_breakpoint_overlay');\n e.parentNode.removeChild(e);\n }, #{timeout});\n console.log(\"** Breakpoint reached **\");\n )\n\n while execute_scopejs_script(\"return document.getElementById('_breakpoint_overlay');\") do\n sleep 0.25 # waiting a little\n end\n\n puts \">> continuing from breakpoint\"\n end", "def wait_for_javascript(timeout = 30)\n wait_for_ajax(timeout)\n wait_for_effects(timeout)\n end", "def wait_for_element(locator, options={})\n builder = JavascriptExpressionBuilder.new\n builder.find_element(locator).append(\"element != null;\")\n wait_for_condition builder.script, options[:timeout_in_seconds]\n end", "def run_script\n %[timeout $((PBS_WALLTIME-300)) \"#{script}\"]\n end", "def wait_for_visible(locator, options={})\n builder = JavascriptExpressionBuilder.new\n wait_for_condition builder.visible(locator).script, options[:timeout_in_seconds]\n end", "def wait_until_zero(js)\n wait_until { page.evaluate_script(js).zero? }\n end", "def wait_for_effects(options={})\n\t\t builder = JavascriptExpressionBuilder.new active_javascript_framework(options)\n\t\t\t wait_for_condition builder.no_pending_effects.script,\n\t\t\t options[:timeout_in_seconds]\n\t\t\tend", "def wait_until timeout=10, &block\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until &block\nend", "def wait timeout: 3, &block\n wait = Selenium::WebDriver::Wait.new timeout: timeout\n wait.until(&block)\nend", "def wait_for(timeout = DEFAULT_TIMEOUT)\n Selenium::WebDriver::Wait.new(:timeout => timeout).until {yield}\nend", "def ms_check the_script\n @js = \"var switchHappened = checkMenuScreenForFunction();\" \n @js += \"if(switchHappened) {timeout = 100;} else {timeout = 0;}\"\n @js += \"setTimeout(function() {#{the_script}}, timeout);\"\n return @js\n end", "def wait_until\n Timeout.timeout(Capybara.default_wait_time) do\n loop until yield\n end\n end", "def wait_for_not_visible(locator, options={})\n builder = JavascriptExpressionBuilder.new\n wait_for_condition builder.not_visible(locator).script, options[:timeout_in_seconds]\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def continue_when_ready\n wait_until(5, \"Continue element not visible in 5 seconds\") do\n continue_element.visible? \n end\n continue\n end", "def loop_while(options={}, &block)\n timeout = options.delete(:timeout) || 2500\n timeout = 10 if timeout < 10\n\n result = block_given? ? block.call : true\n while result\n sleep 0.01\n result = block_given? ? block.call : true\n unless result\n timeout -= 10\n raise BarkestLcd::PicoLcdGraphic::Timeout if timeout < 0\n end\n end\n\n true\n end", "def wait_for(seconds = timeout)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\n end", "def js_exec(js, timeout=30)\n print_status \"Running the privileged javascript...\"\n token = \"[[#{Rex::Text.rand_text_alpha(8)}]]\"\n js = js_obfuscate(js)\n session.shell_write(\"#{token}[JAVASCRIPT]#{js}[/JAVASCRIPT]#{token}\")\n session.shell_read_until_token(\"[!JAVASCRIPT]\", 0, timeout)\n end", "def wait_for_text(pattern, options={})\n builder = JavascriptExpressionBuilder.new\n\t\t builder.find_text(pattern, options).append(\"text_match == true;\")\n wait_for_condition builder.script, options[:timeout_in_seconds]\n end", "def dom_updated?(delay: 1.1)\n element_call do\n begin\n driver.manage.timeouts.script_timeout = delay + 1\n driver.execute_async_script(DOM_OBSERVER, wd, delay)\n rescue Selenium::WebDriver::Error::JavascriptError => e\n # This situation can occur if the script execution has started before\n # a new page is fully loaded. The specific error being checked for\n # here is one that occurs when a new page is loaded as that page is\n # trying to execute a JavaScript function.\n retry if e.message.include?(\n 'document unloaded while waiting for result'\n )\n raise\n ensure\n # Note that this setting here means any user-defined timeout would\n # effectively be overwritten.\n driver.manage.timeouts.script_timeout = 1\n end\n end\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def wait_for_popup window_id, timeout\r\n command 'waitForPopUp', window_id||'null', timeout\r\n end", "def wait_for_popup window_id, timeout\r\n command 'waitForPopUp', window_id||'null', timeout\r\n end", "def wait_for(seconds)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\nend", "def wait_for_no_element(locator, options={})\n builder = JavascriptExpressionBuilder.new\n builder.find_element(locator).append(\"element == null;\")\n wait_for_condition builder.script, options[:timeout_in_seconds]\n end", "def js_click(selector)\n find(selector) # wait for the page to contain the selector\n page.execute_script(\"$('#{selector}').click()\")\n\n # wait for triggered ajax requests to be finished\n steps = 0\n while page.evaluate_script('$.active').to_i > 0 and steps < 25\n sleep 0.1\n steps += 1\n end\n end", "def Wait_For_Element(locator_type, locator_value)\n for iSecond in 0..$config['Longwait']\n sleep 1\n if(@driver.find_element(\"#{locator_type}\", \"#{locator_value}\").displayed?)\n\tbreak\n else \t\n if (iSecond >= $config['Longwait']) \n return false\n @driver.find_element(\"#{locator_type}\", \"#{locator_value}\").displayed?\n break\n end\n end \n end\n return true\nend", "def timeout_check_equal(duration, expected, &block)\n execute_ok = false\n duration.times do\n sleep(1)\n text = instance_eval(&block)\n execute_ok = true and break if (text == expected)\n end\n execute_ok.should == true\n end", "def wait_a_sec_for_selenium\n sleep 1 if Capybara.current_driver == :selenium_firefox\n end", "def wait_until\n Timeout.timeout(Capybara.default_max_wait_time) do\n loop until yield\n end\nend", "def simulate_hover(element)\n page.execute_script(\"$('#{element}').show()\")\n wait_a_sec_for_selenium\n end", "def wait_until\n require \"timeout\"\n Timeout.timeout(Capybara.default_wait_time + 5) do\n sleep(0.1) until value = yield\n value\n end\n end", "def wait_until(timeout = 30, retry_interval = 0.1, &block)\n start = Time.now\n while (result = !block.call)\n break if (Time.now - start).to_i >= timeout\n sleep(retry_interval)\n end\n !result\nend", "def wait_for_ajax(timeout = 15)\n wait(timeout: timeout, msg: \"Timeout after waiting #{timeout} for all ajax requests to finish\").until do\n driver.execute_script 'return window.jQuery != undefined && jQuery.active == 0'\n end\n end", "def click_until(link_css, &block)\n raise ArgumentError if link_css.blank? || block.nil?\n\n begin\n Timeout::timeout(10) do\n until block.call\n find(link_css).click\n sleep 0.1\n end\n end\n rescue Timeout::Error\n fail \"'#{text}' did not appear in page source within 10 seconds\"\n end\n end", "def wait_until_without_failing(timeout=UI_UPDATE_DELAY)\n start = Time.now\n while ((Time.now - start) <= timeout)\n break if yield\n sleep(WaitHelpers::LOOP_DELAY)\n end\nend", "def wait_until_true timeout=3, interval=0.1\n time_limit = Time.now + timeout\n loop do\n result = yield\n return if result || Time.now >= time_limit\n sleep interval\n end\n end", "def ajax_wait_for_element(element_id, seconds, status='show', check_interval = $testwise_polling_interval)\r\n count = 0\r\n check_interval = 1 if check_interval < 1 or check_interval > seconds\r\n while count < (seconds / check_interval) do\r\n search_indicator = @web_browser.element_by_id(element_id)\r\n search_indicator_outer_html = search_indicator.outerHtml if search_indicator\r\n if status == 'hide'\r\n return true if search_indicator_outer_html and !search_indicator_outer_html.include?('style=\"DISPLAY: none\"')\r\n else\r\n return true if search_indicator_outer_html and search_indicator_outer_html.include?('style=\"DISPLAY: none\"')\r\n end\r\n sleep check_interval if check_interval > 0 and check_interval < 5 * 60 # wait max 5 minutes\r\n count += 1\r\n end\r\n return false\r\n end", "def sleep_until(timeout = QUE_SLEEP_UNTIL_TIMEOUT)\n deadline = Time.now + timeout\n loop do\n break if yield\n if Time.now > deadline\n puts \"sleep_until timeout reached!\"\n raise \"sleep_until timeout reached!\"\n end\n sleep 0.01\n end\nend", "def wait(timeout = 0)\n Window.wait(@title, @text, timeout)\n end", "def wait_for_no_text(pattern, options={})\n builder = JavascriptExpressionBuilder.new\n\t\t builder.find_text(pattern, options).append(\"text_match == false;\")\n wait_for_condition builder.script, options[:timeout_in_seconds]\n end", "def wait_for_ajax(&block)\n wait_until do\n page.driver.browser.execute_script(<<-JS)\n return !Ext.Ajax.isLoading();\n JS\n end\n yield\n end", "def timeout(ms = 0)\n `setTimeout(function(){#{yield}},#{ms})`\n end", "def wait_until(timeout=10, &block)\n time = Time.now\n success = false\n until success\n if (Time.now - time) >= timeout\n raise \"Waited for #{timeout} seconds, but block never returned true\"\n end\n sleep 0.5\n success = yield\n end\n end", "def wait_for_field_value(locator, expected_value, options={})\n builder = JavascriptExpressionBuilder.new\n builder.find_element(locator).element_value_is(expected_value)\n wait_for_condition builder.script, options[:timeout_in_seconds]\n end", "def click_element_js(element, timeout)\n wait_for_element(element, timeout)\n sleep Utils.click_wait\n js_click element\n end", "def wait_for_load_and_click_js(element)\n click_element_js(element, Utils.medium_wait)\n end", "def wait_until(timeout: @timeout)\n Log.debug('[GRIDIUM::Element] Waiting for new element...')\n ElementVerification.new(self, timeout, fail_test: true)\n end", "def loop(break_condition=-1, timeout=0, &blck)\n self.break_condition = block_given? ? blck : break_condition\n self.timeout_period = timeout\n self\n end", "def wait_for_landing_page_load(timeout_ms = 1000)\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n $tracer.trace(current_method_name)\n sleep timeout_ms/1000 # ruby sleep is in seconds\n return nil\n end", "def wait_for timeout = 0, &condition\n if condition\n SeleniumAdapter.wait_for(timeout, &condition)\n return nil\n else\n @wait_for = timeout\n return self\n end\n end", "def wait_for_condition(timeout, step = 0.1, &block)\n defer{ wait_for_condition_sync(timeout, step, &block) }\n end", "def wait_for_jquery\n Timeout.timeout(Capybara.default_wait_time) do\n until page.evaluate_script(\"$.active === 0\")\n end\n end\n end", "def wait_for_update_and_click_js(element)\n click_element_js(element, Utils.short_wait)\n end", "def wait_for_element(element_id, timeout = $testwise_polling_timeout, interval = $testwise_polling_interval)\r\n start_time = Time.now\r\n #TODO might not work with Firefox\r\n until @web_browser.element_by_id(element_id) do\r\n sleep(interval)\r\n if (Time.now - start_time) > timeout\r\n raise RuntimeError, \"failed to find element: #{element_id} for max #{timeout}\"\r\n end\r\n end\r\n end", "def wait(options = {})\n timeout = options[:timeout] || 3\n ret = \"\"\n begin\n timeout(timeout) do\n ret = waitfor(/\\(gdb\\)/)\n end\n rescue TimeoutError\n #TODO: stop it\n raise ContinueTimeoutError, \"timeout after #{timeout} seconds\"\n end\n ret\n end", "def block_statement\n until %w(e l u).include?($lookahead)\n case $lookahead\n when \"i\"\n if_statement\n when \"w\"\n while_statement\n when \"p\"\n loop_statement\n when \"r\"\n repeat_statement\n else\n other\n end\n end\nend", "def wait_for_text(text)\n Watir::Wait.until { @browser.text.include? text }\n end", "def wait_for\n wait = Selenium::WebDriver::Wait.new(:timeout => 1000)\n wait.until { yield(@session) }\n end", "def keep_trying_till_true timeout = 30\n t_begin = Time.now\n delay = 10\n loop do\n if yield\n break\n elsif (Time.now - t_begin) > timeout\n fail \"Timeout after trying for #{timeout} seconds\"\n else\n sleep delay\n end\n delay += 1\n end\nend", "def wait_for_page_and_verify_text(text)\n @selenium.wait_for_page_to_load(120000)\n check_page_and_verify_text(text)\n end", "def wait_until(timeout=nil)\n Log.debug('Waiting for new element...')\n timeout = Corundum.config.element_timeout if timeout.nil?\n ElementVerification.new(self, timeout, fail_test=true)\n end", "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", "def wait_for_element(element, timeout)\n element.when_present timeout\n element.when_visible timeout\n sleep Utils.click_wait\n end", "def wait_for_element_and_type_js(element, text)\n wait_for_update_and_click_js element\n element.clear\n element.send_keys text\n end", "def execute_script(script, *args, function_name: nil)\n args.map! do |e|\n e.is_a?(Element) ? e.wait_until(&:exists?).wd : e\n end\n Watir.logger.info \"Executing Script on Browser: #{function_name}\" if function_name\n wrap_elements_in(self, @driver.execute_script(script, *args))\n end", "def wait_until\n require 'timeout'\n Timeout.timeout(Capybara.default_wait_time) do\n sleep(0.1) until (value = yield)\n value\n end\n end", "def execute_script(script)\n current_frame.executeJavaScript(script)\n nil\n end", "def wait_for_ajax(timeout: 20)\n wait(timeout).until do\n driver.execute_script('return jQuery.active == 0')\n sleep 1\n end\n rescue StandardError\n 'wait_for_ajax: jQuery not active'\n end", "def ajax_wait_for_element(element_id, seconds, status='show', check_interval = @@default_polling_interval)\n count = 0\n check_interval = 1 if check_interval < 1 or check_interval > seconds\n while count < (seconds / check_interval) do\n search_indicator = @web_browser.element_by_id(element_id)\n search_indicator_outer_html = search_indicator.outerHtml if search_indicator\n if status == 'hide'\n return true if search_indicator_outer_html and !search_indicator_outer_html.include?('style=\"DISPLAY: none\"')\n else\n return true if search_indicator_outer_html and search_indicator_outer_html.include?('style=\"DISPLAY: none\"')\n end\n sleep check_interval if check_interval > 0 and check_interval < 5 * 60 # wait max 5 minutes\n count += 1\n end\n return false\n end", "def wait_for_scroll_to_finish\n wait = Selenium::WebDriver::Wait.new(:timeout => 10)\n element = @browser.find_element xpath: TestConstants::SELECTION_BLOCK_XPATH\n wait.until { element.attribute('tabindex') == \"-1\" } \n end", "def wait_element(opt = {})\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => @timeout)\n wait.until {\n # post(@session_url+'/element/',opt)['status'].equal?(0)\n search_element(opt).length.equal?(32)\n }\n return true\n rescue\n return false\n end\n end", "def process_events_until(timeout: 5, **options)\n Roby.warn_deprecated \"do not use #process_events. Use the \"\\\n \"expect_execution infrastructure with \"\\\n \"the 'achieve' expectation instead\"\n\n start = Time.now\n until yield\n now = Time.now\n remaining = timeout - (now - start)\n if remaining < 0\n flunk(\"failed to reach expected condition \"\\\n \"within #{timeout} seconds\")\n end\n process_events(timeout: remaining, **options)\n sleep 0.01\n end\n end", "def wait_until(timeout=20, &block)\n time_to_stop = Time.now + timeout\n until yield do\n sleep(0.1) # much less cpu stress\n break if Time.now > time_to_stop\n end\nend", "def wait_for_element(element)\n wait = Selenium::WebDriver::Wait.new(timeout: 60)\n wait.until { find_element(element) }\n end", "def waitForElementPresent(how, what, waitTime = THE_TIMES)\n sleep 1\n puts waitTime\n if isElementPresent?(how, what)\n return true\n else\n raise Selenium::WebDriver::Error::NoSuchElementError\n end\n sleep 1\n end", "def evaluate_script(script)\n current_frame.executeJavaScript(script).getJavaScriptResult\n end", "def wait_for_condition(timeout)\n deadline = Process.clock_gettime(Process::CLOCK_MONOTONIC) + timeout\n loop do\n break if yield ||\n Process.clock_gettime(Process::CLOCK_MONOTONIC) > deadline\n\n sleep 1\n end\n end", "def wait_for_effects(timeout = 30)\n wait_for(timeout) { @browser.document.js_eval(\"document.defaultView.Effect.Queue.size()\").to_i == 0 }\n end", "def enter_message(app_window)\n within_window app_window do\n assert page.has_text?('login')\n login($privly_test_set[0][:content_server])\n fill_in 'content', :with => 'Hello WebDriver!'\n Selenium::WebDriver::Support::Select.new(page.driver.browser.find_element(:id, 'seconds_until_burn')).select_by(:text, '1 Day')\n find_button('save').click\n end\n # Give some time to close the app window\n sleep 1.5\n end", "def checkTimeout_Flooding()\n\tsleep(2);\n\tputs \"time out!\";\n\n\nend", "def long_wait_for_element(yaml_data_key, times = 6)\n how = get_yaml_data( yaml_data_key, 0 )\n what = get_yaml_data( yaml_data_key, 1 )\n e = nil\n times.times do\n # note that find-element auto-waits\n begin\n e = $driver.find_element(how, what)\n rescue Exception => error\n $debug and print \"Got exception in long_wait_for_element: #{error}\\n\"\n end\n if e and e.displayed?\n $debug and print \"element in long_wait_for_element: #{e.inspect}\\n\"\n break\n end\n $debug and print \"waiting in long_wait_for_elemnt\\n\"\n\n sleep 10\n end\n e.should be_displayed\n return e\n end", "def wait_for(condition_name, max_wait_time: Capybara.default_max_wait_time,\n polling_interval: 0.01)\n wait_until = Time.current + max_wait_time.seconds\n loop do\n break if yield\n\n raise \"Condition not met: #{condition_name}\" if Time.current > wait_until\n\n sleep(polling_interval)\n end\n end", "def wait_until_with_buffer(args, &block)\n original_timeout = args[:timeout] || ENV['WAIT_TIMEOUT'].to_i\n args_buffered = args.dup\n\n args_buffered[:timeout] = 60\n\n start_time = Time.now\n Frank::Cucumber::WaitHelper.wait_until(args_buffered) { block.call() }\n end_time = Time.now\n\n delta = end_time - start_time\n puts(\"wait_until exceeded timeout #{original_timeout}. Took #{delta}. #{caller[0]}\") if delta > original_timeout\nend", "def js_visit(path)\n visit path\n sleep 1\nend", "def with_window(windowTitle, timeout = 0)\n endTime = System.currentTimeMillis + (timeout * 1000)\n begin\n window(windowTitle, timeout)\n rescue Exception => e\n if System.currentTimeMillis < endTime\n retry\n else\n raise e\n end\n end\n yield\n $marathon.close\n return true\nend", "def wait_ckeditor_ready(element)\n wait_for_js_ready\n page.evaluate_async_script(WAIT_CKEDITOR_READY_SCRIPT, element)\n end", "def process_events_until(timeout: 5, join_all_waiting_work: false, **options)\n Roby.warn_deprecated \"Test#process_events_until is deprecated, use #expect_execution.to { achieve { ... } } instead\"\n start = Time.now\n until yield\n now = Time.now\n remaining = timeout - (now - start)\n if remaining < 0\n flunk(\"failed to reach condition #{proc} within #{timeout} seconds\")\n end\n process_events(timeout: remaining, join_all_waiting_work: join_all_waiting_work, **options)\n sleep 0.01\n end\n end", "def loop(timer: 0.1)\n loop do\n puts \"\\e[H\\e[2J\"\n puts step()\n sleep(timer)\n end\n end", "def run_once(timeout = nil)\n @selector.select(timeout) do |monitor|\n monitor.value.resume\n end\n end", "def brute_wait(delay)\n sleep(delay)\n end", "def js_click(css_locator)\n page.execute_script(\"$('#{css_locator}').trigger('click')\")\n sleep settings.timeout_tiny\n end", "def open_and_wait( location)\n selenium.open(location)\n wait_for_page_to_load\n end", "def wait_for_ajax\n counter = 0\n while page.execute_script(\"return $.active\").to_i > 0\n counter += 1\n sleep(0.1)\n raise \"AJAX request took longer than 20 seconds.\" if counter >= 400\n end\n end", "def wait_for_pdf_window(string)\n Timeout.timeout(Nenv.browser_timeout) do\n loading = true\n while loading\n check = url_match(string, RouteHelper.browser.windows.last.use.url)\n loading = false if check\n sleep(1)\n end\n return true\n end\n rescue Timeout::Error => e\n raise \"Timeout waiting for window to load - #{e}\"\n exit\n end", "def wait_for_e(xpath)\n $browser.element(:xpath => xpath).wait_until(&:present?)\nend", "def wait_for_debugger\n {\n method: \"Page.waitForDebugger\"\n }\n end" ]
[ "0.5836191", "0.574756", "0.56778574", "0.5505119", "0.54550177", "0.538669", "0.5349603", "0.53164285", "0.52733576", "0.5216456", "0.5195725", "0.51545227", "0.51406115", "0.5140196", "0.5140196", "0.5128487", "0.5110636", "0.51089597", "0.5102841", "0.5096742", "0.505757", "0.50483876", "0.50483876", "0.50414795", "0.50414795", "0.5033673", "0.5008755", "0.4951438", "0.49330533", "0.493185", "0.491912", "0.49028915", "0.4880439", "0.4869882", "0.48694155", "0.48617476", "0.48370105", "0.4825787", "0.48163962", "0.4803305", "0.47997913", "0.4798738", "0.4789937", "0.47864103", "0.4785291", "0.47828552", "0.4775179", "0.47711048", "0.47623828", "0.4760196", "0.47517726", "0.4732919", "0.47321114", "0.47229105", "0.47100073", "0.47093764", "0.46803474", "0.46800476", "0.4678478", "0.46719545", "0.46715686", "0.4670396", "0.4656277", "0.4651664", "0.46481457", "0.46479547", "0.4635289", "0.46316594", "0.4630716", "0.46189615", "0.4609816", "0.4609152", "0.4603379", "0.45818233", "0.45817593", "0.45751113", "0.4565552", "0.4564817", "0.45618242", "0.45511356", "0.45510805", "0.4549564", "0.4534767", "0.45207807", "0.45181733", "0.45180684", "0.45117325", "0.45079803", "0.45072678", "0.44961405", "0.44959846", "0.4490115", "0.44767016", "0.44724804", "0.44659328", "0.44418544", "0.44364104", "0.44334558", "0.44325283" ]
0.5539864
4
Specifies the amount of time that Selenium will wait for actions to complete. Actions that require waiting include +open+ and the wait_for actions. The default timeout is 30 seconds. +timeout+ is specified in milliseconds.
def set_timeout timeout command 'setTimeout', timeout end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_timeout(timeout = nil)\n timeout.nil? ? @open_timeout || DEFAULT_OPEN_TIMEOUT : @open_timeout = timeout\n end", "def open_timeout= open_timeout\n @agent.open_timeout = open_timeout\n end", "def timeout=(timeout)\n @timeout = timeout\n end", "def set_timeout(timeout)\n @log.info('Setting the selenium timeout to: ' + timeout.to_s)\n @driver.manage.timeouts.implicit_wait = timeout\n end", "def navigation_timeout\n Capybara.default_wait_time\n end", "def wait_timeout\n @wait_timeout ||= options[:wait_timeout] || DEFAULT_WAIT_TIMEOUT\n end", "def timeout\n @params[:timeout]\n end", "def timeout=(timeout)\n @timeout = timeout.to_f/1000 * 60\n end", "def open_timeout\n @agent.open_timeout\n end", "def timeout\n @timeout\n end", "def timeout_seconds\n return 1200\n end", "def default_timeout\n 3\n end", "def timeout_after(time); end", "def timeout_in\n 15.minutes\n end", "def default_timeout\n 60\n end", "def wait(timeout=10)\n Selenium::WebDriver::Wait.new(:timeout => timeout)\n end", "def default_timeout\n 900\n end", "def wait timeout: 3, &block\n wait = Selenium::WebDriver::Wait.new timeout: timeout\n wait.until(&block)\nend", "def normalize_timeout(timeout)\r\n if timeout == nil\r\n timeout = Capybara.default_wait_time\r\n end\r\n\r\n if timeout < 1\r\n timeout = 1\r\n end\r\n\r\n return timeout\r\n end", "def timeout=(value)\n @timeout = value\n end", "def timeout\n @timeout || Elected.timeout\n end", "def set_timeout(timeout, element_timeout)\n @log.info('Setting the selenium timeout to: ' + timeout.to_s + ' element timeout: '+element_timeout.to_s)\n @driver.manage.timeouts.implicit_wait = timeout\n Capybara.default_wait_time = element_timeout\n end", "def timeout\n configuration.timeout\n end", "def timeout\n @options[:timeout]\n end", "def timeout\n configuration[:timeout] || DEFAULT_TIMEOUT\n end", "def timeout\n configuration[:timeout] || DEFAULT_TIMEOUT\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def timeout\n @options[:timeout] || Settings.TIMEOUT_DOWNLOAD || 20\n end", "def idle_timeout= idle_timeout\n @agent.idle_timeout = idle_timeout\n end", "def timeout_in\n 30.days\n end", "def driver_timeout=(value)\n Watir.default_timeout = value\n end", "def driver_timeout=(value)\n Watir.default_timeout = value\n end", "def timeout=(value)\n @transfer[:timeout] = value\n end", "def open_timeout\n configuration.open_timeout\n end", "def timeout=(timeout=:default)\n @timeout = TIMEOUTS.member?(timeout) ? TIMEOUTS[timeout] : timeout\n NOTIFICATION[:set_timeout].call @notification, @timeout\n end", "def max_timeout=(timeout)\n self.device.max_timeout = timeout\n end", "def timeout\n return @timeout\n end", "def idle_timeout=(timeout); end", "def timeout\n @attributes[:timeout]\n end", "def timeout\n node['redmine']['executor']['timeout']\n end", "def idle_timeout\n @agent.idle_timeout\n end", "def default_timeout\n @default_timeout ||= 30\n end", "def wait_for(seconds = timeout)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\n end", "def _timeout_in\n 1.minute\n end", "def settransactiontimeout(timeout)\r\n setvalue(@@TRANSACTION_TIMEOUT, timeout)\r\n end", "def open_timeout=(open_timeout); end", "def timeout\n options[:timeout] || super\n end", "def timeout=(new_timeout)\n if new_timeout && new_timeout.to_f < 0\n raise ArgumentError, \"Timeout must be a positive number\"\n end\n @timeout = new_timeout.to_f\n end", "def setconnectiontimeout(timeout)\r\n setvalue(@@CONNECTION_TIMEOUT, timeout)\r\n end", "def with_max_timeout(max_timeout)\n @max_timeout = max_timeout\n self\n end", "def set_lock_timeout(timeout)\n @lock_timeout = timeout\n end", "def on_timeout(options = {})\n timeout = options[:timeout] || 0.5\n\n sleep timeout\n\n yield\n end", "def limit\n @timeout\n end", "def default_timeout\n @default_timeout ||= 20000\n end", "def pick_timeout!\n @timeout = (ENV['TIMEOUT'] || DEFAULT_TIME_LIMIT).to_i\n $stdout.puts \"TIMEOUT=#{@timeout}\"\n $stdout.flush\n end", "def pick_timeout!\n @timeout = (ENV['TIMEOUT'] || DEFAULT_TIME_LIMIT).to_i\n $stdout.puts \"TIMEOUT=#{@timeout}\"\n $stdout.flush\n end", "def pick_timeout!\n @timeout = (ENV['TIMEOUT'] || DEFAULT_TIME_LIMIT).to_i\n $stdout.puts \"TIMEOUT=#{@timeout}\"\n $stdout.flush\n end", "def timeout(seconds, &block)\n Timeout.timeout seconds, Pinglish::TooLong, &block\n end", "def timeout_in_minutes\n @stack.timeout_in_minutes\n end", "def wait_for_element(element, timeout)\n element.when_present timeout\n element.when_visible timeout\n sleep Utils.click_wait\n end", "def timeout_at; end", "def wait_until timeout=10, &block\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until &block\nend", "def timeout!(*args, &block)\n Timeout::timeout(*args, &block)\n end", "def timeout_in\n if self.admin?\n 10.minutes\n else\n 15.minutes\n end\n end", "def lock_timeout(duration:)\n add option: \"-lock-timeout=#{duration}\"\n end", "def wait_for timeout = 0, &condition\n if condition\n SeleniumAdapter.wait_for(timeout, &condition)\n return nil\n else\n @wait_for = timeout\n return self\n end\n end", "def wait(timeout, &block)\n end_time = @end_time || (current_time + timeout)\n loop do\n yield(block)\n @remaining_time = end_time - current_time\n break if @remaining_time.negative?\n end\n end", "def with_driver_timeout(timeout)\n\t\t\tcurrent = @driver_timeout\n\t\t\tdriver.manage.timeouts.implicit_wait = timeout\n\t\t\tyield\n\t\tensure\n\t\t\t@driver_timeout = current\n\t\t\tdriver.manage.timeouts.implicit_wait = current\n\t\tend", "def refresh_timeout\n @refresh_timeout ||= (options[:timeout] || 5)\n end", "def wait_for(timeout = DEFAULT_TIMEOUT)\n Selenium::WebDriver::Wait.new(:timeout => timeout).until {yield}\nend", "def err_timeout(timeout, name, action) \n logger.info \"About to do \" + name\n Timeout::timeout(5) do\n begin\n action.call\n rescue => e\n logger.error \"Got error: #{e.message}\"\n end\n end\nend", "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def timeout; end", "def timeout; end", "def timeout; end", "def event_wait_delay seconds\n ScriptActionHandler::HandlerResult::waitDelay seconds\n end", "def wait_for(seconds)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\nend", "def wait(timeout = 0)\n Window.wait(@title, @text, timeout)\n end", "def timeout\n if ENV['FETCH_ACCOUNT_FROM_CONFIG'].present?\n 10000\n else\n 10\n end\n end", "def wait(timeout=60)\n countdown = timeout.to_f\n\n while countdown > 0\n if @zmq_thread and @zmq_thread.alive?\n sleep 0.1\n countdown = countdown - 0.1\n else\n break\n end\n end\n\n super()\n end", "def timeout(arg = nil)\n set_or_return(\n :timeout,\n arg,\n kind_of: Integer\n )\n end", "def timeout=(value)\n Curl.set_option(:timeout, value_for(value, :int), handle)\n end", "def idle_timeout( new_timeout=nil )\n\t\t\t@idle_timeout = new_timeout if new_timeout\n\t\t\treturn @idle_timeout\n\t\tend", "def initialize( timeout: Arborist::Monitor::Webservice.default_timeout )\n\t\t\tself.timeout = timeout\n\t\tend", "def timeout_ms=(value)\n Curl.set_option(:timeout_ms, value_for(value, :int), handle)\n end", "def timeout\n nil\n end", "def timeout_in_minutes\n data[:timeout_in_minutes]\n end", "def wait(timeout = nil)\n synchronize do\n touch\n # TODO interruptions ?\n super timeout if incomplete?\n self\n end\n end", "def read_timeout(timeout = nil)\n timeout.nil? ? @read_timeout || DEFAULT_READ_TIMEOUT : @read_timeout = timeout\n end", "def timeout_interrupt_tests_secs\n @game_info['timeout_interrupt_tests_secs']\n end", "def abs_wait_short\n wait(15)\n end" ]
[ "0.6724241", "0.6654813", "0.66058743", "0.6501768", "0.64912426", "0.6471363", "0.6432314", "0.641971", "0.64179856", "0.6385762", "0.633143", "0.6319724", "0.6307915", "0.6304611", "0.62756854", "0.62651175", "0.6255703", "0.6248465", "0.6204523", "0.6193736", "0.61812675", "0.6171394", "0.61689997", "0.6124352", "0.6115892", "0.6115892", "0.6045257", "0.6045257", "0.5990441", "0.59754235", "0.5974316", "0.59500897", "0.59500897", "0.59049475", "0.5890152", "0.58786637", "0.58571005", "0.5839987", "0.5824954", "0.582242", "0.5803718", "0.57983816", "0.57768714", "0.5775491", "0.576361", "0.57628727", "0.57459545", "0.57423", "0.5719435", "0.5710702", "0.5707984", "0.5699591", "0.56978995", "0.5674468", "0.5656997", "0.56485426", "0.56485426", "0.56485426", "0.56437224", "0.5628594", "0.56276065", "0.56182796", "0.5617269", "0.5617133", "0.56121725", "0.56115234", "0.5604812", "0.56035984", "0.5592951", "0.5584633", "0.55763894", "0.5564601", "0.55598396", "0.55598396", "0.55598396", "0.55598396", "0.55598396", "0.55597913", "0.55486214", "0.55486214", "0.55309147", "0.55309147", "0.55309147", "0.5530484", "0.5521667", "0.55097663", "0.55065566", "0.54982847", "0.54722404", "0.5467104", "0.5453944", "0.54380876", "0.54338783", "0.5427681", "0.5424046", "0.5417015", "0.5410461", "0.54064274", "0.5379567" ]
0.62719405
16
Waits for a new page to load. You can use this command instead of the +and_wait+ suffixes, +click_and_wait+, +select_and_wait+, +type_and_wait+ etc. (which are only available in the JS API). Selenium constantly keeps track of new pages loading, and sets a +newPageLoaded+ flag when it first notices a page load. Running any other Selenium command after turns the flag to +false+. Hence, if you want to wait for a page to load, you must wait immediately after a Selenium command that caused a pageload. +timeout+ is specified in milliseconds.
def wait_for_page_to_load timeout command 'waitForPageToLoad', timeout end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_page_load\n @browser.wait_for_load\n end", "def wait(timeout=10)\n Selenium::WebDriver::Wait.new(:timeout => timeout)\n end", "def wait_loading\n puts \"[BrowserOperator] wait_loading\" << '..' * 10\n browser.div(:id, 'pageLoading').wait_while_present()\n end", "def wait_for_ready(wait: 10)\n Support::Waiter.wait_until(max_duration: wait, reload_page: false, raise_on_failure: true) do\n ready?\n end\n end", "def open_and_wait( location)\n selenium.open(location)\n wait_for_page_to_load\n end", "def wait_for_dom_has_loaded\n Capybara.default_max_wait_time = 40\n Timeout.timeout(Capybara.default_max_wait_time) do\n loop until page_has_loaded?\n end\n end", "def wait_until_page_loads(path)\n @wait.until { @driver.current_url == path}\n @wait.until { @driver.execute_script('return PAGE_RENDERED;') == true }\n $verbose ? puts(\"#{path} successfully loaded\") : nil\n end", "def wait_for_page\n sleep 0.7\n end", "def wait_until_page_loaded(page_name, prev_url)\n time_secs = 0\n while Capybara.current_session.current_url == prev_url\n break if time_secs > PAGE_TIMEOUT_SECS\n sleep 1\n time_secs+=1\n end\n fail \"ERROR: Page #{page_name} failed to load after #{PAGE_TIMEOUT_SECS} secs\" if Capybara.current_session.current_url == prev_url\n end", "def wait_for_loading_for(timeout)\n original_timeout = Capybara.default_wait_time\n loop until page.evaluate_script('jQuery.active').zero?\n Capybara.default_wait_time = timeout\n page.has_no_selector?('.loading-indicator')\n Capybara.default_wait_time = original_timeout\n end", "def wait timeout: 3, &block\n wait = Selenium::WebDriver::Wait.new timeout: timeout\n wait.until(&block)\nend", "def click_and_wait(locator, wait_for = default_timeout)\n click locator\n assert_page_loaded(wait_for)\n end", "def wait_page_load()\n rc = nil\n Log.Debug(:h5, \"[#{self.class.to_s}.WAIT_PAGE_LOAD]\") {\n _check_repl_lock\n _compile_wait_page_load\n rc = exec\n rc = (rc.is_str? and rc.include?(READY_STATE_COMPLETE)) ? true : false\n }\n Log.Debug \"{#{self.class.to_s}.wait_page_load} :=> #{rc.safe_s}\"\n rc\n end", "def wait_for_page_to_load\n @wait_on.each { |element| wait_for_element(element) }\n loading_message.wait_while_present if loading_message.present?\n true\n rescue\n false\n end", "def wait_until timeout=10, &block\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until &block\nend", "def click_and_wait(locator, wait_for = default_timeout)\n selenium.click locator\n wait_for_page_to_load(wait_for)\n end", "def wait_to_load\n activity_div.wait_until(&:exists?)\n @page = @bank_page.load_page\n end", "def click_wait\n @webpage.click_wait(@locator)\n end", "def wait_for_page_and_verify_text(text)\n @selenium.wait_for_page_to_load(120000)\n check_page_and_verify_text(text)\n end", "def wait_until(timeout: @timeout)\n Log.debug('[GRIDIUM::Element] Waiting for new element...')\n ElementVerification.new(self, timeout, fail_test: true)\n end", "def wait_for(timeout = DEFAULT_TIMEOUT)\n Selenium::WebDriver::Wait.new(:timeout => timeout).until {yield}\nend", "def wait_for_page_to_load(page)\n Logbook.message(\"Waiting for page #{page} to load...\")\n wait_for do\n @browser.execute_script(\"return document.querySelector('link[rel=\\\"icon\\\"]') !== null\")\n end\n end", "def waitForLoader\n element = @driver.find_element(:css, 'html')\n 45.times {\n if !element.attribute('css').include?(PAGELOADER_ELEMENT) # provide the loader class\n return\n else\n sleep 1\n end\n }\n raise 'Loading Spinner Timeout'\n end", "def wait_page_load(criteria,value,expected_element_text,seconds_wait)\r\n\t \t\ttext_on_page = @driver.find_element(criteria.to_sym, value).text\r\n\t \t\twait_for(seconds_wait) { text_on_page.include?(expected_element_text)}\r\n\t \tend", "def go_to_and_wait_to_load(url)\n current_name = driver.title\n driver.get url\n\n # wait until the current title changes to see that you're at a new url\n @wait.until { driver.title != current_name }\n end", "def wait_until(timeout=nil)\n Log.debug('Waiting for new element...')\n timeout = Corundum.config.element_timeout if timeout.nil?\n ElementVerification.new(self, timeout, fail_test=true)\n end", "def wait_for(seconds = timeout)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\n end", "def wait(timeout = 0)\n Window.wait(@title, @text, timeout)\n end", "def wait_a_sec_for_selenium\n sleep 1 if Capybara.current_driver == :selenium_firefox\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "def navigation_timeout\n Capybara.default_wait_time\n end", "def wait_for(seconds)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\nend", "def wait_for_landing_page_load(timeout_ms = 1000)\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n $tracer.trace(current_method_name)\n sleep timeout_ms/1000 # ruby sleep is in seconds\n return nil\n end", "def wait_for_load_and_click(element)\n click_element(element, Utils.medium_wait)\n end", "def wait_for timeout = 0, &condition\n if condition\n SeleniumAdapter.wait_for(timeout, &condition)\n return nil\n else\n @wait_for = timeout\n return self\n end\n end", "def wait_for_browser\r\n # NOTE: no need any more\r\n end", "def waitForPageToLoad(title, what='title')\n puts \"waitForPageToLoad:('#{title}',#{what})\"\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => THE_TIMEOUT)\n wait.until {@driver.title}\n puts \"waitForPageToLoad until reached title element with text set to [#{@driver.title}]\"\n rescue Exception => e\n puts \"waitForPageToLoad exception [#{e}]\"\n return\n end\n waitForElementPresent(:css, what)\n iter = 0\n found = false\n THE_TIMES.times do\n puts \"waitForPageToLoad: iter=[#{iter}] waiting for-->[#{title}] currently-->[#{@driver.find_element(:css, what).text}] \"\n iter += 1\n if @driver.find_element(:css, what).text == title\n found = true\n break\n end\n sleep 1.0\n end\n if found then\n puts \"waitForPageToLoad: After [#{iter}] tries: found expected text=[#{title}] in [#{what}] element\"\n else\n puts \"----TEST FAILED:---waitForPageToLoad: After [#{iter}] tries: NOT FOUND expected text=[#{title}] in [#{what}] element\"\n end\n found.should == true\n end", "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", "def test_MortgageAniversary_load\n @driver.get(@baseURL)\n #begin\n @Nexa_Util.loginAsNormalUser(@driver)\n # @wait.until { @driver.find_element(:id, 'leftNavigationContent') }\n\n # rescue Timeout::Error\n\n waitForPageFullyLoaded(60);\n @start = Time.now\n @driver.find_element(:link_text, 'Mortgage Anniversaries 2 Months').click\n #@wait.until { @driver.find_element(:class, 'resultTable') }\n waitForPageFullyLoaded(20);\n @stop = Time.now\n @sitePerformance.puts \"Page load time 'Mortgage Anniversaries 2 Months': #{@Nexa_Util.time_diff_milli(@start, @stop)}\"\n assert_operator 60000.00, :>, @Nexa_Util.time_diff_milli(@start, @stop)\n #end\n end", "def wait_for_element(element, timeout)\n element.when_present timeout\n element.when_visible timeout\n sleep Utils.click_wait\n end", "def wait_for_ajax(timeout = 15)\n wait(timeout: timeout, msg: \"Timeout after waiting #{timeout} for all ajax requests to finish\").until do\n driver.execute_script 'return window.jQuery != undefined && jQuery.active == 0'\n end\n end", "def go_back_and_wait\n selenium.go_back\n wait_for_page_to_load\n end", "def wait_for_element(element)\n wait = Selenium::WebDriver::Wait.new(timeout: 60)\n wait.until { find_element(element) }\n end", "def click\n\tbegin\n\t @selenium.click(@locator)\n\trescue => e\n\t sleep(3)\n\t @selenium.click(@locator)\n\tend\n\n\tbegin\n\t @selenium.wait_for_page_to_load\n\trescue => e\n\t sleep(2)\n\t @selenium.wait_for_condition(\"selenium.browserbot.getCurrentWindow()\", TIMEOUT)\n\tend\n\t\n end", "def wait(message, timeout=$element_timeout)\n Selenium::WebDriver::Wait.new :timeout => timeout, :interval => 1, :ignore=>[Selenium::WebDriver::Error::NoSuchElementError,Selenium::WebDriver::Error::StaleElementReferenceError], :message=>message\n end", "def wait_for_element(id, name, time)\n wait = Selenium::WebDriver::Wait.new(:timeout => time)\n wait.until {@driver.find_element(id => name) }\nend", "def go_back_and_wait\n go_back\n assert_page_loaded\n end", "def set_timeout(timeout)\n @log.info('Setting the selenium timeout to: ' + timeout.to_s)\n @driver.manage.timeouts.implicit_wait = timeout\n end", "def wait_for_ajax(&block)\n wait_until do\n page.driver.browser.execute_script(<<-JS)\n return !Ext.Ajax.isLoading();\n JS\n end\n yield\n end", "def wait_for\n wait = Selenium::WebDriver::Wait.new(:timeout => 1000)\n wait.until { yield(@session) }\n end", "def wait_for_javascript(timeout = 30)\n wait_for_ajax(timeout)\n wait_for_effects(timeout)\n end", "def setup\n @browser = Selenium::WebDriver.for :firefox\n @wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n @browser.get 'http://demo.redmine.org'\n end", "def wait_for_freelancer_page_visible\n sleep 15\n end", "def set_wait timeout=nil\n if timeout.nil?\n # puts \"timeout = @default_wait = @last_wait\"\n # puts \"timeout = @default_wait = #{@last_waits}\"\n timeout = @default_wait = @last_waits.first\n else\n @default_wait = timeout\n # puts \"last waits before: #{@last_waits}\"\n @last_waits = [@last_waits.last, @default_wait]\n # puts \"last waits after: #{@last_waits}\"\n end\n\n @driver.manage.timeouts.implicit_wait = timeout\n end", "def page_delay\n if $TESTWISE_PAGE_DELAY && $TESTWISE_PAGE_DELAY.to_i > 0 && $TESTWISE_PAGE_DELAY.to_i < 100\n sleep $TESTWISE_PAGE_DELAY.to_i\n end \n end", "def wait\n sleep WAIT_TIME unless @skip_wait\n end", "def wait_for_element(element)\n wait = Selenium::WebDriver::Wait.new(timeout: 10)\n wait.until { find_elements(element) }\n end", "def get_login_page_wait_until_ready(\n opts = {\n _retries: {\n max_tries: 30,\n base_sleep_seconds: 2,\n max_sleep_seconds: 2\n }\n }\n )\n opts[:_retries] ||= {}\n opts[:_retries][:max_tries] ||= 30\n opts[:_retries][:base_sleep_seconds] ||= 2\n opts[:_retries][:max_sleep_seconds] ||= 2\n\n # ensure integer retries setting (Puppet 3 passes numeric string)\n opts[:_retries][:max_tries] = opts[:_retries][:max_tries].to_i\n opts[:_retries][:base_sleep_seconds] = opts[:_retries][:base_sleep_seconds].to_i\n opts[:_retries][:max_sleep_seconds] = opts[:_retries][:max_sleep_seconds].to_i\n\n result = nil\n with_retries(max_tries: opts[:_retries][:max_tries], base_sleep_seconds: opts[:_retries][:base_sleep_seconds], max_sleep_seconds: opts[:_retries][:max_sleep_seconds]) { |retries_count|\n begin\n result = get_login_page\n if result.response.body !~ /QUICKSTART_HOMEPAGE/\n puts format('Retrieve login page attempt #%<retries_count>d: %<message>s but not ready yet', retries_count: retries_count, message: result.message)\n raise StandardError.new(result.message)\n else\n puts format('Retrieve login page attempt #%<retries_count>d: %<message>s and ready', retries_count: retries_count, message: result.message)\n end\n rescue RubyAem::Error => e\n puts format('Retrieve login page attempt #%<retries_count>d: %<message>s', retries_count: retries_count, message: e.message)\n raise StandardError.new(e.message)\n end\n }\n result\n end", "def loading_wait\n \tcase ENV['BROWSER']\n \twhen \"iphone\",\"ipad\",\"android_phone\",\"android_tablet\" then\n \t\tWatir::Wait.until {\n \t\tnot @browser.element(xpath: '//div[contains(@class, \"load\")]').visible?\n \t\t}\n \telse\n \t\tWatir::Wait.until {\n \t\tnot @browser.iframe(:id, 'quote-frame').div(xpath: '//div[contains(@id, \"load\")]').visible?\n \t\t}\n \tend\n \tend", "def wait_second\n now = Time.now.to_i\n # p [ 'wait_second', now, $lastpage ]\n unless @lastpage.nil?\n if now <= @lastpage + 2\n sleep 2\n now = Time.now.to_i\n end\n end\n @lastpage = now\n end", "def waitForElementPresent(how, what, waitTime = THE_TIMES)\n sleep 1\n puts waitTime\n if isElementPresent?(how, what)\n return true\n else\n raise Selenium::WebDriver::Error::NoSuchElementError\n end\n sleep 1\n end", "def wait_for(method, locator)\n @log.debug \" wait_for: Waiting up to #{DEFAULT_TIMEOUT} seconds to find_element(#{method}, #{locator})...\"\n wait = Selenium::WebDriver::Wait.new(:timeout => DEFAULT_TIMEOUT)\n sleep 0.1 # based on http://groups.google.com/group/ruby-capybara/browse_thread/thread/5e182835a8293def fixes \"NS_ERROR_ILLEGAL_VALUE\"\n wait.until { driver.find_element(method, locator) }\n end", "def wait_before_and_after\r\n wait_for_browser\r\n yield\r\n wait_for_browser\r\n end", "def wait_until\n Timeout.timeout(Capybara.default_wait_time) do\n loop until yield\n end\n end", "def wait_for_debugger\n {\n method: \"Page.waitForDebugger\"\n }\n end", "def wait_for_progress\n sleep 2\n wait_for(timeout: 60) { element_does_not_exist \"* marked:'#{loading_screen}'\" }\n end", "def wait_for_ajax\n counter = 0\n while page.execute_script(\"return $.active\").to_i > 0\n counter += 1\n sleep(0.1)\n raise \"AJAX request took longer than 20 seconds.\" if counter >= 400\n end\n end", "def synchronize_with_unload_wait(*args, &block)\n Timeout.timeout(dm_pre_load_wait_time) do\n until driver.evaluate_script('window.performance.timing.navigationStart < window.performance.timing.loadEventEnd')\n DEBUG_FILE.write \"#{Time.now.utc.round(10).iso8601(6)}: #{caller.to_a.select { |pth| pth.include? '/features/' }}\\n\"\n # navigationStart has been updated more recently than loadEventEnd, loadEventEnd presumably still\n # carrying the value set when the *old* page got loaded - that means the dom is probably in the\n # process of loading (or at least requesting) a new page. any following page queries will\n # presumably be targeted at the upcoming page, which isn't ready.\n sleep(0.01)\n end\n end\n synchronize_without_unload_wait(*args, &block)\n end", "def refresh\n command(\"Page.reload\", wait: timeout, slowmoable: true)\n end", "def open_new_page(url)\n $verbose ? puts(\"opening new page: #{url}\") : nil\n @driver.execute_script('window.open()')\n @driver.switch_to.window(@driver.window_handles.last)\n sleep(1)\n @driver.get(url)\n end", "def wait *xpaths, &block\n #todo 3 raise_if_site_too_slow if respond_to?(:raise_if_site_too_slow)\n common_wait *xpaths, &block\n end", "def test_PreApproval_load\n @driver.get(@baseURL)\n #begin\n @Nexa_Util.loginAsNormalUser(@driver)\n # @wait.until { @driver.find_element(:id, 'leftNavigationContent') }\n\n # rescue Timeout::Error\n waitForPageFullyLoaded(60);\n @start = Time.now\n\n # Click at All Contacts\n @driver.find_element(:link_text, 'Pre-Approvals Expiring 2 Months').click\n # @wait.until { @driver.find_element(:class, 'resultTable') }\n waitForPageFullyLoaded(20);\n @stop = Time.now\n @sitePerformance.puts \"Page load time 'Pre-Approvals Expiring 2 Months': #{@Nexa_Util.time_diff_milli(@start, @stop)}\"\n assert_operator 60000.00, :>, @Nexa_Util.time_diff_milli(@start, @stop)\n # end\n end", "def wait_for_progress\n sleep 2\n wait_for_element_does_not_exist(\"* id:'#{loading_screen}'\",\n timeout: 60)\n end", "def wait(last_url = nil)\r\n #puts \"In wait function \"\r\n isLoadingDocument = \"\"\r\n start = Time.now\r\n \r\n while isLoadingDocument != \"false\"\r\n isLoadingDocument = js_eval(\"#{BROWSER_VAR}=#{WINDOW_VAR}.getBrowser(); #{BROWSER_VAR}.webProgress.isLoadingDocument;\")\r\n #puts \"Is browser still loading page: #{isLoadingDocument}\"\r\n \r\n # Derek Berner 5/16/08\r\n # Raise an exception if the page fails to load\r\n if (Time.now - start) > 300\r\n raise \"Page Load Timeout\"\r\n end\r\n end\r\n # Derek Berner 5/16/08\r\n # If the redirect is to a download attachment that does not reload this page, this\r\n # method will loop forever. Therefore, we need to ensure that if this method is called\r\n # twice with the same URL, we simply accept that we're done.\r\n $jssh_socket.send(\"#{BROWSER_VAR}.contentDocument.URL;\\n\", 0)\r\n url = read_socket()\r\n \r\n if(url != last_url)\r\n # Check for Javascript redirect. As we are connected to Firefox via JSSh. JSSh\r\n # doesn't detect any javascript redirects so check it here.\r\n # If page redirects to itself that this code will enter in infinite loop.\r\n # So we currently don't wait for such a page.\r\n # wait variable in JSSh tells if we should wait more for the page to get loaded\r\n # or continue. -1 means page is not redirected. Anyother positive values means wait.\r\n jssh_command = \"var wait = -1; var meta = null; meta = #{BROWSER_VAR}.contentDocument.getElementsByTagName('meta');\r\n if(meta != null)\r\n {\r\n var doc_url = #{BROWSER_VAR}.contentDocument.URL;\r\n for(var i=0; i< meta.length;++i)\r\n {\r\n\t\t\t\t\t\t \t\t\tvar content = meta[i].content;\r\n\t\t\t\t\t\t\t \t\tvar regex = new RegExp(\\\"^refresh$\\\", \\\"i\\\");\r\n\t\t\t\t\t\t\t\t \tif(regex.test(meta[i].httpEquiv))\r\n\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t var arrContent = content.split(';');\r\n \t\t\t\t\t\t\t\t\t\tvar redirect_url = null;\r\n\t \t\t\t\t\t\t\t\t\tif(arrContent.length > 0)\r\n\t\t \t\t\t\t\t\t\t\t{\r\n\t\t\t \t\t\t\t\t\t\t\tif(arrContent.length > 1)\r\n\t\t\t\t \t\t\t\t\t\t\t\tredirect_url = arrContent[1];\r\n\t \r\n\t\t\t\t\t\t\t \t\t\t\tif(redirect_url != null)\r\n\t\t\t\t\t\t \t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t \t\t\t\tregex = new RegExp(\\\"^.*\\\" + redirect_url + \\\"$\\\");\r\n\t\t\t\t\t\t\t\t\t \t\t\tif(!regex.test(doc_url))\r\n\t\t\t\t\t\t\t\t\t\t \t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t \t\twait = arrContent[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t }\r\n }\r\n wait;\"\r\n #puts \"command in wait is : #{jssh_command}\" \r\n jssh_command = jssh_command.gsub(/\\n/, \"\")\r\n $jssh_socket.send(\"#{jssh_command}; \\n\", 0)\r\n wait_time = read_socket();\r\n #puts \"wait time is : #{wait_time}\"\r\n begin\r\n wait_time = wait_time.to_i\r\n if(wait_time != -1)\r\n sleep(wait_time)\r\n # Call wait again. In case there are multiple redirects.\r\n $jssh_socket.send(\"#{BROWSER_VAR} = #{WINDOW_VAR}.getBrowser(); \\n\",0)\r\n read_socket()\r\n wait(url)\r\n end \r\n rescue\r\n end\r\n\t\t\tend\r\n set_browser_document()\r\n run_error_checks()\r\n return self\r\n end", "def click_wait(locator, sec, _arg = nil)\n click_on(locator)\n wait(sec)\n end", "def wait_for_e(xpath)\n $browser.element(:xpath => xpath).wait_until(&:present?)\nend", "def wait_for_visible(locator, options={})\n builder = JavascriptExpressionBuilder.new\n wait_for_condition builder.visible(locator).script, options[:timeout_in_seconds]\n end", "def wait_for_launching\n sleep @delay\n end", "def wait(timeout = nil)\n event.wait(timeout) if timeout != 0 && incomplete?\n self\n end", "def wait_until\n Timeout.timeout(Capybara.default_max_wait_time) do\n loop until yield\n end\nend", "def when_ready(limit = nil, &block)\n begin\n Watir::Wait.until(timeout: (limit || page_ready_limit)) { _ready? }\n rescue Timeout::Error\n raise Timeout::Error, \"Timeout limit #{limit} reached waiting for #{self.class} to be ready\"\n end\n yield self if block_given?\n self\n end", "def test_allApplication_load\n @driver.get(@baseURL)\n #begin\n @Nexa_Util.loginAsNormalUser(@driver)\n # @wait.until { @driver.find_element(:id, 'leftNavigationContent') }\n\n # rescue Timeout::Error\n waitForPageFullyLoaded(40);\n @start = Time.now\n @driver.find_element(:link_text, 'All Applications').click\n # @wait.until { @driver.find_element(:class, 'resultTable') }\n waitForPageFullyLoaded(20);\n @stop = Time.now\n @sitePerformance.puts \"Page load time 'All Applications': #{@Nexa_Util.time_diff_milli(@start, @stop)}\"\n assert_operator 60000.00, :>, @Nexa_Util.time_diff_milli(@start, @stop)\n # end\n end", "def set_timeout(timeout, element_timeout)\n @log.info('Setting the selenium timeout to: ' + timeout.to_s + ' element timeout: '+element_timeout.to_s)\n @driver.manage.timeouts.implicit_wait = timeout\n Capybara.default_wait_time = element_timeout\n end", "def wait_for_ajax(timeout: 20)\n wait(timeout).until do\n driver.execute_script('return jQuery.active == 0')\n sleep 1\n end\n rescue StandardError\n 'wait_for_ajax: jQuery not active'\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def wait(duration)\n info \"Request from Experiment Script: Wait for #{duration}s....\"\n warn \"Calling 'wait' or 'sleep' will block entire EC event loop. Please try 'after' or 'every'\"\n sleep duration\n end", "def wait_for_element(locator, options={})\n builder = JavascriptExpressionBuilder.new\n builder.find_element(locator).append(\"element != null;\")\n wait_for_condition builder.script, options[:timeout_in_seconds]\n end", "def load_page\n page.visit('')\n end", "def load_page\n logger.info 'Loading Core homepage'\n get ConfigCore.base_url\n when_exists(page_heading, Config.medium_wait)\n end", "def wait_visible!(timeout=@wait)\n wait_for(timeout: timeout, message: \"Element at #{locator} is not visible\") { visible? }\n end", "def wait_until\n require \"timeout\"\n Timeout.timeout(Capybara.default_wait_time + 5) do\n sleep(0.1) until value = yield\n value\n end\n end" ]
[ "0.65442324", "0.64719754", "0.6388002", "0.6318073", "0.62589437", "0.6146749", "0.6137664", "0.60708106", "0.6063093", "0.60538274", "0.60408294", "0.6012535", "0.6002208", "0.59765744", "0.59114164", "0.59082437", "0.59002745", "0.5842679", "0.5834417", "0.5781306", "0.57471085", "0.5721384", "0.5653229", "0.5644679", "0.5617425", "0.56043905", "0.5591881", "0.55719405", "0.55587703", "0.55581236", "0.55581236", "0.5551498", "0.55442154", "0.54541916", "0.5404092", "0.53841573", "0.5382201", "0.53772455", "0.53706676", "0.53065044", "0.52681535", "0.52651453", "0.52096933", "0.52016306", "0.51983565", "0.5185516", "0.5164019", "0.51533544", "0.5118828", "0.51160944", "0.51062554", "0.5104153", "0.5079137", "0.5078047", "0.5075312", "0.5062701", "0.50522035", "0.5017795", "0.5010398", "0.5000458", "0.4997474", "0.4966157", "0.49649537", "0.49609372", "0.4931844", "0.49270427", "0.4923296", "0.49230096", "0.4913218", "0.4911409", "0.4897755", "0.4887914", "0.4874104", "0.48691532", "0.48654342", "0.485928", "0.48583183", "0.48501158", "0.4842129", "0.4832252", "0.48311684", "0.48311412", "0.4830451", "0.48248217", "0.48203135", "0.48176995", "0.48176995", "0.48176995", "0.48176995", "0.48176995", "0.48176995", "0.48176995", "0.48176995", "0.48016313", "0.47977597", "0.47884196", "0.47845173", "0.4784424", "0.477918" ]
0.7731514
1
utility method for reading yaml data
def read_yaml_file(file) if File.exist?(file) return YAML::load(File.read(file)) end raise "-- ERROR: file doesn't exist: " + file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml(filename); end", "def read_yaml(base, name)\n self.content = File.read(File.join(base, name))\n\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = $POSTMATCH\n\n begin\n self.data = YAML.load($1)\n rescue => e\n puts \"YAML Exception reading #{name}: #{e.message}\"\n end\n end\n\n self.data ||= {}\n end", "def load_yaml(path) # Path must be in /data\n # path must be a yaml file path\n YAML.load_file(File.join(__dir__, \"../data/#{path}.yml\"))\n # YAML keys will be allways strings (never symbols)\n # Returns hash of values (strings)\nend", "def read_yaml(base, name, opts = T.unsafe(nil)); end", "def read_yaml_data_file filename\n data = {}\n File.open(filename, 'r') do |f|\n data = YAML.load(f)\n end\n data\nend", "def read_yaml_data_file filename\n data = {}\n File.open(filename, 'r') do |f|\n data = YAML.load(f)\n end\n data\nend", "def take_yaml(yml)\n @data = YAML.load(yml)\n end", "def take_yaml(yml)\n @data = YAML.load(yml)\n end", "def read_yaml(throw_missing: T.unsafe(nil), **kwd); end", "def load_yml(filename); end", "def read_yaml(base, name, opts = {})\n begin\n self.content = File.read(File.join(base, name),\n merged_file_read_opts(opts))\n if content =~ /\\A(---\\s*\\n.*?\\n?)^((---|\\.\\.\\.)\\s*$\\n?)/m\n self.content = $POSTMATCH\n self.data = SafeYAML.load($1)\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n Jekyll.logger.warn \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n self.data ||= {}\n end", "def read file=STDIN\n\n yaml = case file\n when String\n raise \"Input file not defined\" unless file\n raise \"Input file does not exist\" unless File.exist? file\n raise \"Input file is not readable \" unless File.readable? file\n \n File.read(file)\n when IO\n file.read\n end\n\n raise \"Cannot read YAML data\" unless yaml\n load yaml\n end", "def loadyaml(filename) YAML.load_file(filename) end", "def pets\n load_yaml('personaje/pets')\nend", "def data\n YAML::load_file(files[:config])\n end", "def read_yaml(base, name)\n begin\n text = File.read(File.join(base, name))\n data = {'layout'=>'default'}\n\n if page_yaml = transfiguration['page_yaml']\n data.merge!(page_yaml)\n end\n\n # commented metadata\n if text =~ /<!--\\s+---\\s*(.*?)-->\\s*$\\n?/m\n text.delete($0)\n data.merge!(YAML.safe_load($1))\n end\n\n self.content = text\n self.data = data\n rescue SyntaxError => e\n puts \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n puts \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n unless self.data['layout']\n self.data['layout'] = 'page'\n end\n\n return self.data\n end", "def yaml_file?; end", "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend", "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend", "def read_yaml(path)\n data = File.read path\n\n # Necessary to be backward-compatible with documentation generated\n # by earliar RDoc versions.\n data = data.gsub(/ \\!ruby\\/(object|struct):(RDoc::RI|RI).*/, '')\n data = data.gsub(/ \\!ruby\\/(object|struct):SM::(\\S+)/,\n ' !ruby/\\1:RDoc::Markup::\\2')\n\n OpenStructHash.convert YAML.load(data)\n end", "def load_database_yaml; end", "def load_database_yaml; end", "def read_yaml(base, name)\n path = File.join(base, name)\n self.content = File.read(path)\n relative_base = base.gsub(Dir.pwd, \"\")\n if relative_base.start_with?(\"/#{JDoc::DocumentationFile.documentation_directory}\")\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = $POSTMATCH\n begin\n self.data = YAML.load($1)\n rescue => e\n puts \"YAML Exception reading #{name}: #{e.message}\"\n end\n self.data[\"layout\"] = \"documentation\" if self.data[\"layout\"].nil?\n self.data[\"title\"] = JDoc::DocumentationFile.file_title(path) if self.data[\"title\"].nil?\n return\n elsif self.content =~ /^(---\\s*\\n.*?\\n?)/m\n self.content = $POSTMATCH\n self.data = {\n \"layout\" => \"documentation\",\n \"title\" => JDoc::DocumentationFile.file_title(path)\n }\n return\n end\n end\n\n read_yaml_original(base, name)\n end", "def data_links\r\n puts \"pwd:\"\r\n puts Dir.pwd\r\n\r\n data = YAML.load_file( './data/links.yml' )\r\n puts data.inspect\r\n data\r\nend", "def read_yaml(base, name)\n filename = File.join(base, name)\n\n begin\n content = File.read(filename)\n if content =~ Jekyll::Document::YAML_FRONT_MATTER_REGEXP\n content = $POSTMATCH # rubocop:disable Lint/UselessAssignment\n data = SafeYAML.load(Regexp.last_match(1))\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n rescue StandardError => e\n Jekyll.logger.warn \"Error reading file #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n end\n\n data || {}\n end", "def getDataFrom_FieldPermission_YmlFile(yamlInfo)\n YAML.load_file(\"./config/FieldPermission.yml\")[yamlInfo]\nend", "def read_file(path)\r\n YAML::load( File.open(path) )\r\n end", "def read_yaml(_base, _name, _opts = {})\n self.content = self.output = \"\"\n self.data ||= DEFAULT_DATA.dup\n end", "def yaml(filename)\n YAML.load(IO.read(filename).gsub(/---\\z/, ''))\nend", "def yaml(*files, **options, &block) = read(*files, parse: :yaml, ext: ['.yml', '.yaml'], **options, &block)", "def read_yaml(base, name, opts = {})\n filename = @path || site.in_source_dir(base, name)\n Jekyll.logger.debug \"Reading:\", relative_path\n\n begin\n self.content = File.read(filename, **Utils.merged_file_read_opts(site, opts))\n if content =~ Document::YAML_FRONT_MATTER_REGEXP\n self.content = Regexp.last_match.post_match\n self.data = SafeYAML.load(Regexp.last_match(1))\n end\n rescue Psych::SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n rescue StandardError => e\n Jekyll.logger.warn \"Error reading file #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n end\n\n self.data ||= {}\n\n validate_data! filename\n validate_permalink! filename\n\n self.data\n end", "def load yaml\n data = YAML::load yaml \n raise \"Cannot load YAML data\" unless data\n\n @raw = @data = @errors = @commands = nil\n @errors = data.delete('__ERRORS__')\n @commands = data.delete('__COMMANDS__')\n @raw = OpenStruct.new data\n @data = { }\n end", "def load_yaml(data, safe: T.unsafe(nil), whitelist_classes: T.unsafe(nil), whitelist_symbols: T.unsafe(nil), aliases: T.unsafe(nil)); end", "def load_yaml(yaml_path, variables = nil)\n #puts \"load_yaml #{yaml_path}\"\n if variables\n YAML.load(ERB.new(File.read(yaml_path)).result(OpenStruct.new(variables).instance_eval { binding })) \n else\n YAML.load(ERB.new(File.read(yaml_path)).result)\n end\nend", "def load_yaml(args = {})\n file = File.read(args[:file] || CMUX_YAML)\n yaml = YAML.load(file)\n args[:key] ? yaml[args[:key]] : yaml\n rescue Psych::SyntaxError\n message = \"Make sure you've written #{file} in YAML Simple Mapping.\" \\\n ' Please check README.'\n raise message.red\n end", "def yaml\n parse_yaml_string(yaml_string(config_file), config_file)\n end", "def read_input(input)\n YAML.load_file(input)\nrescue => e\n raise \"Unable to open #{input}: #{e.message}\"\nend", "def yaml\n @yaml ||= YAML.load_file path\n rescue StandardError\n {}\n end", "def parse_file(source)\n begin\n yaml_pattern = /\\A(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n if source =~ yaml_pattern\n data = YAML.load($1)\n content = $POSTMATCH\n else\n data = {}\n content = source\n end\n rescue => e \n puts \"Error reading file #{File.join(ARGV[0])}: #{e.message}\"\n end\n return [data, content]\n end", "def parse_yaml(readable_obj)\n ::YAML.load(readable_obj)\n end", "def load_yaml(filename)\n\t\tpath = File.realpath(filename)\n\t\tdata = YAML.load_file(path)\n\t\tload_hash(data)\n\tend", "def read_yaml(base, name, opts = {})\n ret = site.yaml_cache.get(base, name, self.merged_file_read_opts(opts))\n self.content = ret[:content]\n self.data = ret[:yaml]\n self.modified = ret[:modified]\n end", "def read\n @metadata = {}\n @content = File.read(path)\n\n if @content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n @content = $POSTMATCH\n\n begin\n @metadata = YAML.load($1)\n raise unless @metadata.is_a? Hash\n rescue => ex\n $stderr.puts \"#{File.basename($PROGRAM_NAME)}: #{ex.to_s}\"\n $stderr.puts \"WARNING: Couldn't load metadata.\"\n @metadata = {}\n end\n\n @metadata.symbolize_keys!\n import_metadata\n end\n end", "def load\n if File.file?(@file_name)\n File.open(@file_name, 'r') do |file|\n YAML::load(file)\n end\n else\n default\n end\n end", "def yaml_load(filename)\n\t\tbegin\n\t\t YAML::load(File.read filename)\n\t\trescue\n\t\t\tputs \"Unable to read from file '#{ filename }'.\"\n\t\t\tnil\n\t\tend\n\tend", "def load_yaml(path, environment = nil)\n env = environment ? environment.to_s : env_name\n\n contents = File.read(path)\n if contents.empty?\n raise Mongoid::Errors::EmptyConfigFile.new(path)\n end\n\n # These are the classes that can be used in a Mongoid\n # configuration file in addition to standard YAML types.\n permitted_classes = [\n # Symbols occur as values for read preference, for example.\n Symbol,\n # BSON::Binary occur as keyId values for FLE (more precisely,\n # the keyIds are UUIDs).\n BSON::Binary,\n ]\n\n result = ERB.new(contents).result\n data = if RUBY_VERSION < '2.6'\n YAML.safe_load(result, permitted_classes, [], true)\n else\n YAML.safe_load(result, permitted_classes: permitted_classes, aliases: true)\n end\n\n unless data.is_a?(Hash)\n raise Mongoid::Errors::InvalidConfigFile.new(path)\n end\n\n data[env]\n end", "def read_codefile\n y = YamlReader.new(@@options.codefile)\n yamltab = y.parse\n end", "def load_yaml(path)\n YAML.load_file File.expand_path(\"../#{path}\", File.dirname(__FILE__))\n end", "def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end", "def load_yml_data\n if File.exist? self.class.file_location\n # YAML.load_file returns false if the file exists but is empty. So\n # added the || {} to ensure we always return a hash from this method\n YAML.load_file(self.class.file_location) || {}\n else\n {}\n end\n end", "def read_node(node)\n nodefile = File.join(YAMLDIR, \"#{node}.yaml\")\n if FileTest.exist?(nodefile)\n return YAML.load_file(nodefile)\n else\n raise \"Could not find information for #{node}\"\n end\nend", "def read_payloads()\n data = YAML.load_file('payloads.yaml')\n\n payloads = {}\n data.each do |entry|\n name = entry['name']\n long = entry['long']\n payload = entry['payload']\n description = entry['description']\n payloads[name] = [payload, description]\n end\n return payloads\nend", "def data\n exist!\n begin\n data = File.read @path\n data = @encrypter.decrypt(data) if encrypt?\n YAML.load data\n rescue Psych::SyntaxError\n raise EntrySyntaxError\n end\n end", "def yaml_properties\n if directory?\n yaml_path = ::File.join(@node.path, @yaml_file)\n @node.repos.stat(yaml_path, @node.rev_num) ?\n YAML.load(@node.repos.file(yaml_path, @node.rev_num)[0]) :\n {}\n else\n has_yaml_props? ?\n YAML.load(yaml_split[0]) :\n {}\n end\n end", "def load_yaml_file(path)\n if (file = find_data_file(path))\n YAML.load_file(file)\n end\n end", "def from_yaml\n results = YAML.load(self)\n \n # Replace bad values\n if results == false or results == nil\n \"\"\n else\n results\n end\n end", "def read!\n file = root + FILENAME\n if file.exist?\n data = YAML.load(File.new(file))\n data.each do |name, value|\n self[name] = value\n end\n end\n return self\n end", "def get_yaml_data_from_file(file)\n parsed = begin\n YAML.load(File.open(file))\n rescue ArgumentError => e\n fatal_error(\"invalid YAML syntax in file #{file}\")\n end\n return parsed\nend", "def read_metadata(path)\n unless path\n abort \"Must exist a markdown filename which have Yaml Front Matter.\"\n end\n yml, _ = Maliq::FileUtils.retrieveYFM(File.read path)\n return nil if yml.empty?\n YAML.load(yml).to_symkey\n end", "def simple_yaml_load1(file)\n r = []\n File.read(file).split(\"\\n\").each do |line|\n e = line.split(\": \", 2).map(&:strip)\n next if e.size != 2\n r.push(e)\n end\n return r\nend", "def load(args)\n YAML::load_file(args[:file_name])\n end", "def load_from_yaml(file)\n document_lines = File.readlines(file)\n\n headers = document_lines.enum_for(:each_with_index).\n find_all { |line, _| line =~ /^---/ }\n if headers.empty? || headers.first[1] != 0\n headers.unshift [\"--- name:default\", -1]\n end\n\n options = headers.map do |line, line_number|\n line_options = Hash.new\n line = line.chomp\n line.split(/\\s+/)[1..-1].each do |opt|\n if opt =~ /^(\\w+):(.*)$/\n line_options[$1] = $2\n else\n raise ArgumentError, \"#{file}:#{line_number}: wrong format #{opt}, expected option_name:value, where 'value' has no spaces\"\n end\n end\n line_options['merge'] = (line_options['merge'] == 'true')\n line_options['chain'] = (line_options['chain'] || '').split(',')\n [line_options, line_number]\n end\n options[0][0]['name'] ||= 'default'\n\n options.each do |line_options, line_number|\n if !line_options['name']\n raise ArgumentError, \"#{file}:#{line_number}: missing a 'name' option\"\n end\n end\n\n sections = []\n options.each_cons(2) do |(_, line0), (_, line1)|\n sections << document_lines[line0 + 1, line1 - line0 - 1]\n end\n sections << document_lines[options[-1][1] + 1, document_lines.size - options[-1][1] - 1]\n\n changed_sections = []\n @conf_options = options\n\n sections.each_with_index do |doc, idx|\n doc = doc.join(\"\")\n doc = evaluate_dynamic_content(file, doc)\n\n result = YAML.load(StringIO.new(doc))\n\n conf_options = options[idx].first\n name = conf_options.delete('name')\n changed = in_context(\"while loading section #{name} of #{file}\") do\n add(name, result || Hash.new, conf_options)\n end\n\n if changed\n changed_sections << name\n end\n end\n\t if !changed_sections.empty?\n\t \t@merged_conf.clear\n\t end\n changed_sections\n rescue Exception => e\n raise e, \"error loading #{file}: #{e.message}\", e.backtrace\n end", "def parse(path)\n YAML.load(File.read(path))\n end", "def read(opts = {})\n Jekyll.logger.debug \"Reading:\", relative_path\n\n if yaml_file?\n @data = SafeYAML.load_file(path)\n else\n begin\n merge_defaults\n read_content(**opts)\n read_post_data\n rescue StandardError => e\n handle_read_error(e)\n end\n end\n end", "def yaml_content() = JSON.parse(content.to_json).to_yaml", "def yaml_load(file)\n\t\tYAML.load_file(file.to_s)\n\tend", "def load_yaml(base=ENV['PWD'], env=\"active\")\n env = \"dev\" if env == \"active\" and not File.exist? \"#{base}/opt/active\"\n @data = ::YAML.load_file(\"#{base}/opt/#{env}/config.yaml\")\n end", "def from_yaml\n YAML.load(self)\n end", "def read_yml(filename)\n YAML.load(File.read(filename))\n end", "def read\n x = nil\n File.open(@filename, 'r') {|f| x = f.readlines }\n x.each do |line|\n\n line = self.class.remove_comments(line)\n\n if line.present?\n @data << self.class.extract_data_from_line(line)\n # puts self.class.extract_data_from_line(line).to_yaml\n end\n end\n end", "def config\n\tYAML.load(File.open(\"config.yaml\"))\nend", "def load_yaml_file file\r\n load_yaml \"parse_file\", file\r\n end", "def load_yaml_data( file )\n yaml_data = {}\n yaml_data.merge!( File.open( file ) { |yf| YAML::load( yf ) } )\n\n return yaml_data\n end", "def read_data dir = DIR[:data][:verbs]\n\t\t\tfilepath = File.join dir, \"#{self.class.name.sub('Verbs::','')}.yml\"\n\t\t\treturn {\n\t\t\t\t'keywords' => [self.class.to_s.downcase]\n\t\t\t} unless (File.file? filepath)\n\t\t\treturn YAML.load_file filepath\n\t\tend", "def read_concept_file(path)\n YAML.load(File.read path)\n end", "def handle_yaml(filename, &block) \n filedata = YAML.load_file(filename)\nrescue Errno::ENOENT\n puts \"The file with the file name #{filename} could not be found. Aborting.\"\n exit\nelse\n block_given? ? block.call(filedata) : filedata\nend", "def yaml( *args )\n ::Logging::Layouts::Parseable.yaml(*args)\n end", "def read_post(path)\n chunks = IO.read(path).split(/^---\\s*$/)\n\n metadata = YAML.load(\"---\\n\" + chunks[1])\n\n [metadata, chunks[2]]\nend", "def read_config_file\n config_path = File.expand_path(File.dirname(__FILE__)+\"/../../\")\n YAML.load_file(\"#{config_path}/config/#{@type}/config.yaml\")\n end", "def yaml\n @yaml ||= has_yaml? ? YAML.load(@content) : {}\n end", "def body\n return nil unless file?\n has_yaml_props? ?\n yaml_split[1] :\n data[0]\n end", "def read_template(name)\n File.open(\"#{resource_template_dir}/#{name}.yaml\").read\n end", "def read_config filename # {{{\n\n # Pre-condition check\n raise ArgumentError, \"Filename argument should be of type string, but it is (#{filename.class.to_s})\" unless( filename.is_a?(String) )\n\n # Main\n @log.message :debug, \"Loading this config file: #{filename.to_s}\"\n result = File.open( filename, \"r\" ) { |file| YAML.load( file ) } # return proc which is in this case a hash\n result = hashes_to_ostruct( result ) \n\n # Post-condition check\n raise ArgumentError, \"The function should return an OpenStruct, but instead returns a (#{result.class.to_s})\" unless( result.is_a?( OpenStruct ) )\n\n result\n end", "def load_from_yaml(curr_all_info)\n reset_info\n begin\n @curr_all_info = {}\n @curr_all_info = YAML::load(curr_all_info) #YAML::load_file(yamlfilename) if File.exist?(yamlfilename)\n \n process_my_curr_all_info\n \n return !is_empty?\n rescue => detail\n\t str = \"Error load_from_yaml \\n\"\n\t str += detail.backtrace.join(\"\\n\")\n\t puts str\n reset_info\n return false\n end \n end", "def load_yaml(yaml_file)\n data = []\n YAML.load_stream(File.read yaml_file) { |f| data << f }\n return data\n end", "def list_post(file_path)\n YAML::load(File.read(file_path));\nend", "def meta_data\n return if @meta_end.nil?\n\n cur, meta_end, @meta_end = tell, @meta_end, nil\n seek 0\n return YAML.load(self)\n\n ensure\n @meta_end = meta_end if defined? meta_end and meta_end\n seek cur if defined? cur and cur\n end", "def load_library(path)\n # code goes here\n data = YAML.load_file(path)\n \n YAML.dump(\"foo\")\n { :a => 'b'}.to_yaml\n #data.map do |english, japanese|\n # binding.pry\n #end\n binding.pry\nend", "def yaml_properties\n if directory?\n fs_yaml_path = fs_path.blank? ? 'meta.yml' : File.join(fs_path, 'meta.yml')\n yaml_path = File.join(@path, 'meta.yml')\n repos.stat(fs_yaml_path, revision) ?\n YAML.load(self.class.new(@changeset, yaml_path).body) :\n {}\n else\n has_yaml_props? ?\n YAML.load(yaml_split[0]) :\n {}\n end\n end", "def read_yml_file_base(yml_file)\n YAML.load(read_file_base(yml_file))\n end", "def load_config(config_file)\n YAML.load(File.open(config_file))\nend", "def load_user(filepath)\n $user = load_yaml(filepath)\nend", "def yml_file_to_object(options={})\n content = read_file_content(options)\n YAML.load(content)\nend", "def fill_from_yaml(yaml)\n fill_from_hash(Psych.load(yaml))\n end", "def test_load_from_yaml\n loaded = Syck.load(<<-eoyml)\n--- !set\nfoo: bar\nbar: baz\n eoyml\n assert_equal(@set, loaded)\n end", "def parse_yaml(path)\n require 'yaml'\n\n str = Nitro::Template.new.render(File.read(path))\n\n if yaml = YAML::load(str)\n for name, data in yaml\n self[name] = instantiate(data)\n end\n end\n\n # sort the objects.\n\n str.scan(/^(\\w*?):$/).each do |key|\n @objects << self[key.to_s]\n end\n end", "def load\n @yaml_parts, @ruby_parts = lookup_parts\n @data.clear\n self.yaml_parts_in_loading_order.each do |yaml_part|\n yaml_data = YAML.load_file(yaml_part)\n part_sections = File.basename(yaml_part, '.yml').split('.')\n part_sections.delete_at 0 # delete the 'en' at the beginning\n if part_sections.empty?\n @data.merge! yaml_data\n else\n begin\n target_section = @data[*part_sections]\n raise EntryNotFound unless target_section.respond_to? :merge!\n target_section.merge! yaml_data\n rescue EntryNotFound\n @data[*part_sections] = yaml_data\n end\n end\n end\n \n @ruby_parts.each do |ruby_part|\n Kernel.load ruby_part\n end\n end", "def import_yaml(io)\n require 'yaml' unless defined?(YAML)\n YAML.load(io).each {|data| import_record data }\n end", "def read_configuration\n\t\t@config = YAML.load_file(\"config.yml\")\n\t\treturn @config\n\tend", "def load_config_file\n require 'yaml'\n YAML.load_file(@path)\n rescue Errno::ENOENT\n return\n end" ]
[ "0.78454775", "0.7520975", "0.7516884", "0.7506102", "0.7404428", "0.740274", "0.73838675", "0.73838675", "0.7375904", "0.7331", "0.73000216", "0.7194318", "0.7184667", "0.7172474", "0.71660376", "0.7161847", "0.7149153", "0.71231365", "0.71231365", "0.7113149", "0.7084224", "0.7084224", "0.7072485", "0.7066131", "0.70645463", "0.7059044", "0.6963357", "0.6960071", "0.69573903", "0.6937706", "0.69202733", "0.6894335", "0.6869272", "0.68421876", "0.6842034", "0.6828765", "0.67694885", "0.67629534", "0.6756394", "0.6716831", "0.6714591", "0.67123896", "0.6659724", "0.6649576", "0.66315156", "0.66250956", "0.6608481", "0.65979654", "0.6583774", "0.65614164", "0.6560884", "0.6558666", "0.6534336", "0.6519636", "0.6514727", "0.6461322", "0.64566725", "0.64500165", "0.6443842", "0.64387333", "0.6436434", "0.64328873", "0.6422427", "0.64147365", "0.6406104", "0.6404016", "0.63753843", "0.6372417", "0.63675094", "0.6353357", "0.63428307", "0.63396597", "0.6329767", "0.63287723", "0.6319028", "0.63184285", "0.6317182", "0.6311957", "0.6309344", "0.62983125", "0.62831193", "0.6279796", "0.62758183", "0.6274943", "0.6273621", "0.62610054", "0.6260706", "0.6255997", "0.62528443", "0.6252273", "0.6248659", "0.62379754", "0.62254363", "0.62178934", "0.62098986", "0.6202562", "0.6192301", "0.6178451", "0.61630565", "0.61523825" ]
0.6371772
68
check connection to Selenium RC
def check_connection one_wait = 5 max_wait = 15 request = Net::HTTP::Get.new('/selenium-server/') wait = 0; while (wait < max_wait) begin response = Net::HTTP.start(@host, @port) {|http| http.request(request) } break if Net::HTTPForbidden === response break if Net::HTTPNotFound === response break if Net::HTTPSuccess === response # When we try to connect to a down server with an Apache proxy, # we'll get Net::HTTPBadGateway and get here rescue Errno::ECONNREFUSED # When we try to connect to a down server without an Apache proxy, # such as a dev instance, we'll get here end sleep one_wait; wait += one_wait end if (wait == max_wait) p("-- ERROR: couldn't connect to Selenium RC on " + @host) return false end return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selenium_env?\n true\nend", "def check_connection\n one_wait = 5\n max_wait = 5\n request = Net::HTTP::Get.new('/')\n wait = 0;\n while (wait < max_wait)\n begin\n response = Net::HTTP.start(@url.host, @url.port) {|http|\n http.request(request)\n }\n break if Net::HTTPForbidden === response\n break if Net::HTTPNotFound === response\n break if Net::HTTPSuccess === response\n # When we try to connect to a down server with an Apache proxy, \n # we'll get Net::HTTPBadGateway and get here\n rescue Errno::ECONNREFUSED\n # When we try to connect to a down server without an Apache proxy, \n # such as a dev instance, we'll get here\n end\n sleep one_wait;\n wait += one_wait\n end\n if (wait == max_wait)\n puts(\"-- ERROR: couldn't connect to test host on \" + @url.host.to_s)\n return false\n end\n puts(\"-- SUCCESS: test host is alive !\\n\")\n return true\nend", "def test_connection\n error = nil\n @basic_query_params = {\n :fields => {},\n :start_at => 0,\n :max_results => 1000000000\n }\n begin\n response = @access_client.get('/secure/Dashboard.jspa')\n\n if response.code == '502'\n error = 'Something going wrong in JIRA server side. Please, try later.'\n elsif response.code == '403'\n error = 'Please, check your access rights to JIRA.'\n end\n rescue JIRA::HTTPError\n error = 'Please check your credentials or right URL address for Jira'\n end\n check_for_correct_jira_project(error)\n end", "def ping\n url = URI.parse(\"http://localhost:#{@port_number}/selenium-server/driver/?cmd=testComplete&sessionId=smoketest\")\n request = Net::HTTP::Get.new(url.path)\n Net::HTTP.start(url.host, url.port) {|http|\n http.read_timeout=5\n http.request(request)\n }\n end", "def check_connection\n return\n check = HTTParty.get(\"#{@host}/api/process/check_connection?api_key=#{@api_key}\")\n if check.nil? || check[\"status\"][\"code\"] < 0\n @helper.terminate(\"Script was unable to establish connection with dFlow at #{@host}\")\n end\n end", "def check_connection\n return\n check = HTTParty.get(\"#{@host}/api/check_connection?api_key=#{@api_key}\")\n if check.nil? || check[\"status\"][\"code\"] < 0\n @helper.terminate(\"Script was unable to establish connection with dFile at #{@host}\")\n end\n end", "def check_client\n unless client\n raise ClientNotSetup\n end\n unless client.connected?\n if raise_on_error\n raise ClientNotConnected\n else\n @logger.error 'Client not connected! Check internet connection'\n return false\n end\n end\n true\n end", "def selenium_host\n ENV.fetch('SELENIUM_HOST', '192.168.56.102')\nend", "def setup\n @browser = Selenium::WebDriver.for :firefox\n @wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n @browser.get 'http://demo.redmine.org'\n end", "def connection?\n check = Netchecker.new() \n @alive = check.check_url(\"google.com\", 80) \n end", "def vbox_connection_ok?(connection)\n # VBox::WebService.connect\n return true\n rescue\n return false\n end", "def test_connection\n x = execute('test')\n return !x.empty?\n rescue StandardError\n return false\n end", "def wait_a_sec_for_selenium\n sleep 1 if Capybara.current_driver == :selenium_firefox\n end", "def attempt_connection\n conn = Puppet.runtime[:http]\n\n response = conn.get(test_uri, headers: test_headers, options: options)\n unless response.code.to_i == expected_code\n Puppet.notice \"Unable to connect to the server or wrong HTTP code (expected #{expected_code}) (#{test_uri}): [#{response.code}] #{response.reason}\"\n return false\n end\n return true\n rescue StandardError => e\n Puppet.notice \"Unable to connect to the server (#{test_uri}): #{e.message}\"\n return false\n end", "def setup\n # caps = Selenium::WebDriver::Remote::Capabilities.new\n # caps[:browserName] = :chrome\n #@driver = Selenium::WebDriver.for (\n # :remote,\n # :url=> 'http://localhost:4444/wd/hub',\n # :desired_capabilities=> caps )\n #ENV['base_url'] = 'http://codap.concord.org/~eireland/CodapClasses'\n @@driver = Selenium::WebDriver.for :chrome\n # ENV['base_url'] = 'http://localhost:4020/dg'\n ENV['base_url'] = 'http://codap.concord.org/releases/latest/'\n # setupHelper(@driver.session_id)\nrescue Exception => e\n puts e.message\n puts \"Could not start driver #{@@driver}\"\n exit 1\nend", "def wait_for_browser\r\n # NOTE: no need any more\r\n end", "def internet_connection?\n begin\n true if open(\"http://www.google.com/\")\n rescue\n false\n end\n end", "def check_connected\n raise NotConnected unless @session_id && @sso && @provider\n end", "def test_should_report_not_connected_when_new\n c = LibSSH.connect 'hostname'\n assert (not c.connected?)\n end", "def attempt_connection\n conn = Puppet::Network::HttpPool.http_instance(http_server, http_port, use_ssl, verify_peer)\n\n response = conn.get(test_path, test_headers)\n unless response.code.to_i == expected_code\n Puppet.notice \"Unable to connect to the server or wrong HTTP code (expected #{expected_code}) (http#{use_ssl ? 's' : ''}://#{http_server}:#{http_port}): [#{response.code}] #{response.msg}\"\n return false\n end\n return true\n rescue StandardError => e\n Puppet.notice \"Unable to connect to the server (http#{use_ssl ? 's' : ''}://#{http_server}:#{http_port}): #{e.message}\"\n return false\n end", "def check_connection\n logger.debug \"Checking connection (#{is_connected?})\"\n is_connected? || connect_database\n # return connection status\n is_connected?\n end", "def check_connection\n logger.debug \"Checking connection (#{is_connected?})\"\n is_connected? || connect_database\n # return connection status\n is_connected?\n end", "def setup\n caps = Selenium::WebDriver::Remote::Capabilities.internet_explorer\n caps.version = \"8\"\n caps.platform = \"Windows XP\"\n caps[:name] = \"Testing Selenium 2 with Ruby on Sauce\"\n\n @driver = Selenium::WebDriver.for(\n :remote,\n :url => \"http://the-internet:26bd4eac-9ef2-4cf0-a6e0-3b7736bd5359@ondemand.saucelabs.com:80/wd/hub\",\n :desired_capabilities => caps)\nend", "def wait_and_open\n info \"Attempting to connect to the web site...\"\n Http.head \"http://127.0.0.1:3000/\"\n rescue Errno::ECONNREFUSED\n sleep(0.5)\n retry if (self.try += 1) < max\n info \"Server not found, sorry.\"\n raise\n else\n Launchy.open(\"http://127.0.0.1:3000/\")\n end", "def can_rest?\n return false if driver_options[:ssh_options] && driver_options[:ssh_user]\n\n _, host, port = driver_url.split \":\", 3\n host != \"localhost\" || port.to_i > 0\n end", "def check_in\n defaults = OSX::NSUserDefaults.standardUserDefaults\n server_host = defaults.stringForKey(\"server_host\")\n server_port = defaults.integerForKey(\"server_port\")\n \n drb_url = \"druby://#{server_host}:#{server_port}\"\n \n OSX::NSLog(\"Trying to connect to #{drb_url}\")\n \n @server = DRbObject.new(nil, drb_url)\n @host = DRb.uri.scan(/druby:\\/\\/(.*):\\d*/)[0][0]\n begin\n @server.check_in @host\n OSX::NSLog(\"Connected to server\")\n rescue\n @server = nil\n OSX::NSLog(\"Couldn't connect to server: #{$!}\")\n end\n end", "def attempt_connection\n begin\n response = Net::HTTP.get_response(uri)\n unless response.code == \"200\"\n Puppet.notice \"HTTP request (#{uri}) failed: (#{response.code} #{response.body})\"\n return false\n end\n return true\n rescue Errno::ECONNREFUSED => e\n Puppet.notice \"Unable to establish HTTP connection to '#{uri}'; #{e}\"\n return false\n end\n end", "def check_connection( conn )\n\tbegin\n\t\tconn.exec( \"SELECT 1\" )\n\trescue PG::Error => err\n\t\t$stderr.puts \"%p while testing connection: %s\" % [ err.class, err.message ]\n\t\tconn.reset\n\tend\nend", "def network_available?(sample_uri = SAMPLE_URI.call)\n @agent.get('http://portal.titech.ac.jp').to_b\n rescue # check another website just to make sure\n @agent.get(sample_uri).to_b rescue return false\n end", "def client_active?\n @automation_client\n end", "def test_connection\n response = send_api_request(:index)\n response[:returncode]\n end", "def test_connection\n response = send_api_request(:index)\n response[:returncode]\n end", "def start\r\n #$driver=Selenium::WebDriver::Chrome::Service.driver_path=\"./Drivers/chromedriver\"\r\n $driver = Selenium::WebDriver.for :chrome\r\n $driver.get('https://lola-protected:LoLa_Access_4_Devsonly@app-staging.locationlive.co.uk/')\r\n #$driver.switch_to.window($driver.window_handles[1])\r\n $driver.manage.window.maximize\r\n $wait = Selenium::WebDriver::Wait.new(timeout:10)\r\n $wait.until{$driver.find_element(:id,\"sign-in-popover\").displayed? }\r\nend", "def connectable?\n ssl_context = OpenSSL::SSL::SSLContext.new\n ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n @http.head(URL_TO_CHECK, ssl_context: ssl_context).status.success?\n rescue StandardError\n false\n end", "def setup\n caps = Selenium::WebDriver::Remote::Capabilities.new\n\tcaps['browser'] = 'Firefox'\n @driver = Selenium::WebDriver.for :remote, url: \"http://localhost:8001\", :desired_capabilities => caps\n# @driver = Selenium::WebDriver.for :firefox\n\t@driver.manage.timeouts.implicit_wait = 10\nend", "def connection_valid?\n if status.untested? or (changed? and (changes.keys & @@status_fields).empty?)\n begin\n test_connection\n status.success!\n rescue => e\n error_str = map_connection_exception_to_error(e)\n status.fail!(error_str)\n end\n end\n status.success?\n end", "def connected?()\n (self.remote_address rescue nil) ? true : false\n end", "def connection_check\n handle_action_exceptions(__method__) do\n check_connection\n end\n rescue RToolsHCKConnectionError => e\n if @json\n { 'result' => 'Failure', 'message' => e.message }\n else\n puts \"WARNING: #{e.message}\"\n false\n end\n end", "def server_is_available?\n return true\n !@http_client.send_request(:get, \"#{@configuration.protocol}://#{@configuration.host}:#{@configuration.port}\", nil, {:timeout => 5}).nil?\n end", "def appium_available?\n `appium -v`\n true\n rescue Errno::ENOENT\n false\n end", "def connected?\n start_ssh {|ssh| } # do nothing\n rescue *CONNECTION_EXCEPTIONS => ex\n @connection_error = ex\n return false\n else\n return true\n end", "def test_connection\n synchronize{|conn|}\n true\n end", "def print_congifugartion\n puts \"Configuration : \"+$driver.execute_script(\"return navigator.userAgent;\")\n puts \"Date and Time : #{Time.now}\"\nend", "def is_js_alert_present\n begin\n WAIT.until{ $driver.switch_to.alert }\n return true\n rescue Exception => e\n return false\n end\nend", "def check_ci\n vm = @uri.vm\n ncp = 0\n\n if vm.is_ci\n vm.toggle_ci(false)\n\n # HACK wait max 10min to let ci finish his work\n while vm.checkci do\n break if ncp == 5\n sleep(120)\n ncp += 1\n end\n vm.clearci\n end\n\n return true\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def alert_present?()\n @driver.switch_to.alert\n true\n rescue Selenium::WebDriver::Error::NoAlertPresentError\n false\n end", "def connectable?\n begin; ping; rescue; false; end\n end", "def setup\n # Do nothing\n @driver = Selenium::WebDriver.for :firefox\n @driver.manage.window.maximize\n @driver.manage.timeouts.implicit_wait = 10\n @wait = Selenium::WebDriver::Wait.new :timeout => 10\n @verification_errors = []\n @baseURL = 'http://www.aci.aero/'\n end", "def is_connected?\n if @connection == nil\n return false\n else \n return true\n end\n end", "def internet_http?\n host_http = 'http://www.google.com/index.html'\n check = Net::Ping::HTTP.new(host_http) #now http not as console\n check.ping?\n end", "def internet_http?\n host_http = 'http://www.google.com/index.html'\n check = Net::Ping::HTTP.new(host_http) #now http not as console\n check.ping?\n end", "def connection?\n begin\n TCPSocket.new 'google.com', 80\n return true\n rescue SocketError\n return false\n end\n end", "def test_scm_st_001\n printf \"\\n Test 001\"\n open \"/devgroup/pj_index/1/1\"\n sleep SLEEP_TIME\n assert @selenium.is_text_present($page_titles[\"auth_login\"])\n end", "def connected?\n @host && @port\n end", "def is_connected?\n\t\tif @connection == nil\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend", "def setup\n @verification_errors = []\n if $selenium\n @selenium = $selenium\n else\n @selenium = Selenium::Client::Driver.new \"localhost\", 4444, \"*firefox\", $domain, 10000\n @selenium.start_new_browser_session\n end\n @selenium.set_context(\"selenium_helper\")\n end", "def go()\n\t@selenium.open @url\n end", "def test_connection_exists\n assert_not_nil @conn\n end", "def checkConnect(dns, sshport)\n connectionTimeout = Time.now \n connectionTimeout = connectionTimeout + (10 * 10)\n connection = false\n\n while ((connection == false) && ( Time.now < connectionTimeout )) do \n if dns.nil? || dns.empty? then\n log(\"ERROR\", \"Invalid dns\" + dns)\n return false\n end\n log(\"INFO\", \"Checking connectivity to: \" + dns)\n\n connection = ssh2_connect(dns, sshport)\n if connection == false then\n sleep(10)\n end\n end\n\n if connection == false then\n log(\"ERROR\", \"Failed to connect to \" + dns )\n return false\n else\n return true\n end\n end", "def ieIsAvailable()\n return false if @ie.busy \n return false if @ie.readyState != READYSTATE_COMPLETE\n return true\n end", "def check_formulary_server_connection\n session[:foo] = \"bar\" unless session.id\n raise \"session.id is nil\" unless session.id\n unless @client = ClientConnections.get(session.id.public_id)\n reset_session\n redirect_to root_path, flash: { error: \"Please connect to a formulary server\" }\n end\n end", "def test_connection\n end", "def connected?\n @connection.present?\n end", "def already_on_site?\n driver.current_url != 'about:blank' &&\n driver.current_url.include?(BASE_URL)\n end", "def Network_site_login(email,passwd,type)\n \n # New Firefox instance creation\n driver = Selenium::WebDriver.for :firefox, :profile => \"Selenium\"\n ff = Watir::Browser.new driver\n #ff.window.resize_to(800, 600)\n #ff.maximize()\n \n #capabilities = Selenium::WebDriver::Remote::Capabilities.firefox #(:javascript_enabled => true, :proxy=> Selenium::WebDriver::Proxy.new(:http => \"localhost:5865\"))\n #driver = Selenium::WebDriver::Remote::Capabilities.firefox(:profile => \"Selenium\")\n #ff = Watir::Browser.new(:remote, :url => \"http://127.0.0.1:4444/wd/hub\", :desired_capabilities => capabilities)\n# ff = Selenium::Client::Driver.new \\\n# :host => \"localhost\",\n# :port => 4444,\n# :browser => \"*chrome\",\n# :timeout_in_second => 60,\n# :url => \"https://p.network.u-samp.com/\"\n#\n# ff.driver.start_new_browser_session(:captureNetworkTraffic => true)\n #firefox.exe -P Selenium\n #ff = custom C:\\Program Files\\Mozilla Firefox\\firefox.exe -P firefox_browser\n #ff.clear_cookies\n # Opening Usampadmin site\n #capabilities = Selenium::WebDriver::Remote::Capabilities.firefox #(:javascript_enabled => true, :proxy=> Selenium::WebDriver::Proxy.new(:http => \"localhost:5865\"))\n #ff = Watir::Browser.new(:remote, :url => \"http://127.0.0.1:4444/wd/hub\", :desired_capabilities => capabilities)\n #ff = Watir::Browser.new(:remote, :url => \"http://127.0.0.1:4444/wd/hub\", :desired_capabilities => capabilities)\n #ff = Watir::Browser.new(:remote, :desired_capabilities => capabilities)\n #ff = Watir::Browser.start(\"http://127.0.0.1:4444/wd/hub\", :firefox, :remote)\n ff.goto('https://p.network.u-samp.com/login.php')\n #ff.clear_cookies\n # Setting login credentials (email/password)\n if (type == 'Client')\n ff.radio(:value, \"Client\").set\n else\n ff.radio(:value,\"Publisher\").set\n end\n ff.text_field(:id, \"txtEmail\").set(email)\n ff.text_field(:id, \"txtPassword\").set(passwd)\n #Click login button\n \n puts \"Before loging to Network site\"\n \n ff.link(:id,\"btnLogin\").click\n sleep 5\n \n puts \"After loging to Network site\"\n \n # Checkpoint to verify that login was successful\n #ff.frame(:id,\"iframebox\").link(:text, \"Click Menu Item\").click ...\n #iframe id=\"iframebox\"\n #ff.text.should include(\"welcome\")\n# if (ff.contains_text('Welcome'))\n# puts \"Logged it to Network site\"\n# else\n# puts \"Sorry! System Failed to login to Network site\"\n# end\n return ff\n end", "def verify!\n reconnect! unless active?\n end", "def initialize\n # Create an instance of the selenium driver.\n client = Selenium::WebDriver::Remote::Http::Default.new\n client.timeout = 60 # default seconds to wait for responses from web requests to the application server\n @driver = Selenium::WebDriver.for(:chrome, :http_client => client, :listener => DemoSeleniumEventListener.new)\n end", "def check_server_connection\n\t\tsession[:foo] = \"bar\" unless session.id \n\t\traise \"session.id is nil\" unless session.id\n\t\tunless @client = ClientConnections.get(session.id.public_id)\n\t\t\tredirect_to root_path, flash: { error: \"Please connect to a formulary server\" }\n\t\tend\n\tend", "def check_server_connection\n\t\tsession[:foo] = \"bar\" unless session.id \n\t\traise \"session.id is nil\" unless session.id\n\t\tunless @client = ClientConnections.get(session.id.public_id)\n\t\t\tredirect_to root_path, flash: { error: \"Please connect to a formulary server\" }\n\t\tend\n\tend", "def check\n # we want to handle cases where the port/target isn't open/listening gracefully\n begin\n # only catch the response if we're going to use it, in this case we do for the version\n # detection.\n res = send_request_cgi(\n 'uri' => normalize_uri(target_uri.path, 'index.php'),\n 'method' => 'GET'\n )\n # gracefully handle if res comes back as nil, since we're not guaranteed a response\n # also handle if we get an unexpected HTTP response code\n fail_with(Failure::UnexpectedReply, \"#{peer} - Could not connect to web service - no response\") if res.nil?\n fail_with(Failure::UnexpectedReply, \"#{peer} - Check URI Path, unexpected HTTP response code: #{res.code}\") if res.code == 200\n\n # here we're looking through html for the version string, similar to:\n # Version 1.2\n /Version: (?<version>[\\d]{1,2}\\.[\\d]{1,2})<\\/td>/ =~ res.body\n\n if version && Gem::Version.new(version) <= Gem::Version.new('1.3')\n vprint_good(\"Version Detected: #{version}\")\n Exploit::CheckCode::Appears\n end\n rescue ::Rex::ConnectionError\n fail_with(Failure::Unreachable, \"#{peer} - Could not connect to the web service\")\n end\n Exploit::CheckCode::Safe\n end", "def test_text_is_present\n @selenium.open \"/\"\n assert @selenium.text? \"Advanced Search\"\n end", "def setup\n if ENV['BROWSER'] == 'firefox'\n $driver = Selenium::WebDriver.for :firefox\n elsif ENV['BROWSER'] == 'chrome'\n $driver = Selenium::WebDriver.for :chrome\n else\n puts 'The only valid browser options are [firefox | chrome]'\n end\nend", "def connected?\r\n !@conn.nil?\r\n end", "def connected_to_dropbox_as_client?\n connect_client if $client.blank?\n end", "def connected?\n if @ssh\n return true\n else\n return false\n end\n end", "def waited_on_connect?\n @waited_on_connect\n end", "def test_Browser_001_is_browser_installed()\n\n puts2(\"\")\n puts2(\"#######################\")\n puts2(\"Testcase: test_Browser_001_is_browser_installed\")\n puts2(\"#######################\")\n\n puts2(\"\\n\\nTest - is_chrome64_installed?()\")\n puts2(\"is_chrome64_installed? = \" + is_chrome64_installed?().to_s)\n\n puts2(\"\\n\\nTest - is_firefox64_installed?()\")\n puts2(\"is_firefox64_installed? = \" + is_firefox64_installed?().to_s)\n\n end", "def test_connection_open?\n assert_equal true , @conn.open?\n @conn.disconnect\n assert_equal false, @conn.open?\n end", "def initialize(opts = {})\n opts[:timeout] = 120 unless opts[:timeout]\n @wait = Selenium::WebDriver::Wait.new(:timeout=>opts[:timeout])\n TelluriumDriver.wait_for_document_ready=true;\n\n opts[:caps] ||= {}\n opts[:caps][:browserName] ||= opts[:browser]\n opts[:caps][:version] ||= opts[:version]\n\n is_local = !opts[:hub_ip] and !opts[:hub_url]\n \n if is_local\n @driver = Selenium::WebDriver.for(opts[:browser].to_sym,:desired_capabilities=>opts[:caps])\n else\n @driver = Selenium::WebDriver.for(:remote,:desired_capabilities=>opts[:caps],:url=> \"http://#{opts[:hub_ip]}:4444/wd/hub\")\n end\n end", "def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end", "def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end", "def test_document_server(url)\n test_name = \"Test Document Server Connection\"\n puts test_name\n get_website(url)\n login_as_guest_test\n if @browser.find_element(:css=>'.focus') #Dismisses the splashscreen if present\n @wait.until{@browser.find_element(:css=>'.focus')}.click\n end\n login_toolshelf_button_test\n login_test\nend", "def wait_for_host_in_dashboard(host)\n hostname = host.node_name\n retry_command(\"Wait for #{hostname} to be in the console\", dashboard, \"! curl --sslv3 -k -I https://#{dashboard}/nodes/#{hostname} | grep '404 Not Found'\")\n end", "def run_on_browserstack?\n ENV['TEST_DRIVER'] && ENV['TEST_DRIVER'] == 'browserstack'\nend", "def server_ready?\n begin\n url = URI.parse(TEST_URI)\n req = Net::HTTP.new(url.host, url.port)\n res = req.request_head(\"/\")\n res.code == \"200\"\n rescue Errno::ECONNREFUSED\n false\n end\nend", "def check\n\t\t# if reconnect flag is set, we try to reconnect\n\t\tif @jabberReconnect then\n\t\t\tbegin\n\t\t\t\tconnectToJabber\n\t \t if @jabberRetryMessage != '' then\n\t \t \tsendJabber( @jabberRetryMessage )\n\t \t end\n\t\t\trescue Jabber::JabberError => e\n\t\t\t\tputs \"Reconnect failed: #{e.error.to_s.inspect}\"\n\t\t\t\tputs \"Maybe our network connection is down. Client will try to reconnect upon the next visit\"\n\t\t\tend\n\t\t\t# Retry only once, even if failed\n\t\t\t@jabberRetryMessage = ''\n\t\tend\n\tend", "def get_browser\n client = Selenium::WebDriver::Remote::Http::Default.new\n client.open_timeout = TIMEOUT # seconds – default is 30\n browser = Watir::Browser.new DRIVER.to_sym, :http_client => client\n return browser\nend", "def connected?\n Drone::Client.connected?\n end", "def can_we_connect\n\t\tbegin\n\t\t\t@sys_time = @manager.get_value(\"sysUpTime.0\")\n\t\trescue SNMP::RequestTimeout => e\n\t\t\tprint_error(\"#{e}\")\n\t\t\tprint_error(\"Can't connect using '#{@string.chomp}'!\")\n\t\t\t$fail=1\n\t\tend\n\tend", "def check\r\n vprint_status 'STEP 0: Get rConfig version...'\r\n res = send_request_cgi!(\r\n 'method' => 'GET',\r\n 'uri' => '/login.php'\r\n )\r\n if !res || !res.get_html_document\r\n fail_with(Failure::Unknown, 'Could not check rConfig version')\r\n end\r\n if res.get_html_document.at('div[@id=\"footer-copyright\"]').text.include? 'rConfig Version 3.9'\r\n print_good('rConfig version 3.9 detected')\r\n return Exploit::CheckCode::Appears\r\n elsif res.get_html_document.at('div[@id=\"footer-copyright\"]').text.include? 'rConfig'\r\n print_status('rConfig detected, but not version 3.9')\r\n return Exploit::CheckCode::Detected\r\n end\r\n end", "def connection_valid?\n begin\n result = client.call(:fe_dummy).body[:fe_dummy_response][:fe_dummy_result]\n @observations << \"app_server: #{result[:app_server]}, db_server: #{result[:db_server]}, auth_server: #{result[:auth_server]}\"\n result[:app_server] == \"OK\" and result[:db_server] == \"OK\" and result[:auth_server] == \"OK\"\n rescue => e\n @errors << e.message\n @backtrace = e.backtrace\n false\n end\n end", "def allow_net_connect?\n allow_net_connect\n end", "def check_server\n raise Exception.new(\"Could not reach Apocalypse server please check the address and port and try again.\") unless server_reachable?\n end" ]
[ "0.630713", "0.6283249", "0.6240378", "0.62243265", "0.6214046", "0.6088339", "0.608336", "0.60715514", "0.6028589", "0.59923273", "0.59914804", "0.5983569", "0.59712005", "0.59671694", "0.59448576", "0.5896287", "0.58333963", "0.5810538", "0.5808582", "0.5798259", "0.5796514", "0.5796514", "0.5782617", "0.5752901", "0.5752177", "0.57414824", "0.5733001", "0.5712046", "0.5688764", "0.5682141", "0.5678237", "0.5678237", "0.5676995", "0.56729394", "0.56708306", "0.5665109", "0.5651524", "0.5651346", "0.5650868", "0.56495374", "0.56274945", "0.56223744", "0.55866545", "0.558641", "0.5583305", "0.55681276", "0.55681276", "0.55681276", "0.55681276", "0.55681276", "0.55681276", "0.55681276", "0.55681276", "0.55665183", "0.55553144", "0.5538879", "0.5528352", "0.5528352", "0.55104035", "0.5503063", "0.5498498", "0.5491173", "0.5487966", "0.5474124", "0.54720443", "0.5460282", "0.546021", "0.5459329", "0.5456704", "0.5447714", "0.5447222", "0.5435384", "0.5433957", "0.5433223", "0.54258543", "0.54258543", "0.5423269", "0.54216653", "0.54128844", "0.54089814", "0.5405833", "0.5404551", "0.5402456", "0.53957546", "0.53942704", "0.53941196", "0.5382028", "0.5382028", "0.53788453", "0.53751165", "0.5369247", "0.53680503", "0.5367698", "0.5365898", "0.5362456", "0.5355791", "0.5352054", "0.5351205", "0.53384507", "0.5338118" ]
0.79851687
0
check the page for any abnormalities
def check_page(page) # -- if error is found, it will dump first 2000 characters of the page to the screen raise "-- [ERROR] User name incorrect !\n\n" if /User name or password is incorrect/.match(page) if /An Error Occurred/.match(page) p ("-- Error occured, dumping partial stack trace to the screen...") page[0,2000].each { |s| p s } if page.length >= 2000 raise "-- [ERROR] Exception occured !\n\n" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_page?\n false\n end", "def guessing?\n ! page.has_content?(\"Your Results\")\n end", "def check_pages\n if pages.length > 0\n return false\n end\n return true\n end", "def error_page?\n popup_msg = get_el(doc.css('div#outsidecontainer'))\n return false if popup_msg.nil?\n return false if popup_msg.css('@style').to_s.match('display: none')\n return true if popup_msg.to_s.match(/error/i)\n return false\n end", "def page_ok?(config, url)\n uri = URI.parse(url) rescue nil\n (uri.respond_to?(:host) && uri.host =~ config[\"host_re\"] &&\n uri.respond_to?(:path) && uri.path !~ %r{^/b/}).tap do |result|\n if !result\n puts \"Rejecting page #{url} for key #{config[\"key\"]}\"\n end\n end\n end", "def page_url_is_correct\n ( current_url =~ self.class.page_url_validation_value ) !=nil\n end", "def is_on_page? page_text, negation = ''\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 5) { has_text? page_text }\n # If negation is not nil, we should raise an error if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil, otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n raise \"Unexpected Page. The page should not have: '#{page_text}'\" if should_not_have_exception\n raise \"Unexpected Page. Expected was: '#{page_text}'\" if should_have_exception\n end", "def check_xml(html)\n doc = Hpricot.XML(html)\n \terrors = doc.search(\"*[@errCode]\")\n \tif errors.size > 0\n \t\terrors.each do |error|\n \t\t\traise error[:errCode]\n \t\tend\n \telsif (doc%'page').nil?\n \t\traise \"EmptyPage (#{url})\"\n \telse\n \t\treturn true\n \tend\n end", "def in_progress?\n allowed_page?\n end", "def i_may_not_reach(which_page)\n result = go(which_page)\n assert (Net::HTTPForbidden===result or Net::HTTPBadRequest===result), __last_because + \" (may actually reach #{which_page}: #{result})\"\n end", "def check_for_page_images\n\n issues = []\n pages.each do |p|\n issues.push \"#{p.title} does not have an associated image file.\" unless p.image_filename\n end\n\n warning issues unless issues.empty?\n end", "def is_available page\n return !page.nil? \nend", "def is_available page\n return !page.nil? \nend", "def is_available page\n return !page.nil? \nend", "def is_available page\n return !page.nil? \nend", "def verify_landing_page\n @higgs.page_title_present?('Puppet Enterprise Installer')\n @higgs.link_present?('email the CEO.')\n @higgs.select_link(\"Let's get started\")\n @higgs.page_title_present?('Puppet Enterprise Installer - Choose your deployment')\n end", "def verify_persinfo\n\t\t@browser.url == \"https://www.autogravity.com/credit/application/personal\"\n\t\t@browser.div(:visible_text, /Personal Information$/).present?\n\tend", "def validate_page(page)\n validator = MarkupValidator.new\n results = validator.validate_text(page)\n return unless results.errors.length > 0\n results.errors.each do |err|\n fail(\"Error #{err.message} on page #{page.current_url}\")\n end\nend", "def page_num_checker \n\t\t@page_num < @total_page || @total_page == 0\n\tend", "def check_site_read_only\r\n if OperatingParamCache.instance.read_only_site_enabled?\r\n if request.xhr?\r\n render :update do |page|\r\n page.redirect_to '/site_slow.html#hide_find_reviews'\r\n end\r\n else\r\n render :template => 'common/site_slow', :layout => 'application'\r\n end\r\n false\r\n else\r\n true\r\n end\r\n end", "def check_landing_page\n\t\tif self.landing_page? && !self.category.blank?\n\t\t\t@old_landing_page = Page.find_by_category_and_landing_page(self.category, true)\n\t\t\tunless @old_landing_page.nil? || @old_landing_page == self\n\t\t\t\t@old_home.landing_page = false\n\t\t\t\t@old_home.save\n\t\t\tend\n\t\telsif self.landing_page? && self.category.blank?\n\t\t\tself.landing_page = false\n\t\tend\n\t\t\n\tend", "def depricated_page?\n b = false\n DEPRICATED_PAGES_WITHOUT_CHECK_ACCOUNT.each do |page|\n b = true if controller_name == page[0] && action_name == page[1]\n end\n b\n end", "def deletable?\n is_regular_page?\n end", "def valid?\n is_valid = true\n\n pages.each do |page|\n # Loop through pages to get all errors\n is_valid = false if page.invalid?\n end\n\n is_valid\n end", "def is_available(page)\n\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n\n return !page.nil? \n\nend", "def is_available(page)\n\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n\n return !page.nil? \n\nend", "def page_status\n @status = \"OK\"\n @status = \"ERR\" if self.response_code > 399\n end", "def valid?\n return page_identifier?\n end", "def is_available(page)\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n return !page.nil? \nend", "def is_available(page)\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n return !page.nil? \nend", "def allow_page_to_be_cached?\n return !(agent_logged_in? or current_user.is_admin?)\n end", "def on_page?\n raise NotImplementedError, \"implement me, e.g. using #has_title?\"\n end", "def valid_page page\n # ignore case\n if page\n page.downcase!\n else\n return false\n end\n # verify page name\n exists = false\n if page == 'about'\n exists = true\n end\n if page == 'contact'\n exists = true\n end\n if page == 'welcome'\n exists = true\n end\n if page == 'info'\n exists = true\n end\n return exists\n end", "def handle_invalid_state\r\n logger.error \"INVALID STATE DETECTED:\\n #{caller.join(\"\\n\")}\"\r\n @web_analytics.page_stack = ['Admin', 'Invalid State']\r\n @web_analytics.error_page = true\r\n @left_rail_ad_pixels = -1\r\n render :template => 'common/invalid_state', :status => 500, :layout => 'application'\r\n false\r\n end", "def checkUserPageAccess(user, pagePath)\n return false\n end", "def out_of_bounds?\n current_page > total_pages\n end", "def errorPage?\n @driver.find_elements(:xpath, \".//*[@id='resultados']/ul\").size()==0 and \n @driver.find_elements(:xpath, \".//*[@id='details']/p\").first.text==\"No ha introducido ciudad de origen o destino\" or\n @driver.find_elements(:xpath, \".//*[@id='details']/p\").first.text==\"La fecha introducida no es correcta\"\nend", "def is_on_page?(page_text, negation = '')\n fail 'Página inesperada. Entre com uma mensagem válida' if\n page_text.to_s == ''\n\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 10) { has_text? page_text }\n # If negation is not nil, we should raise an error\n # if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil,\n # otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n\n fail \"Página inesperada. A página não contém: '#{page_text}'\" if\n should_not_have_exception\n\n fail \"Página inesperada. Era esperado: '#{page_text}'\" if\n should_have_exception\n\n true\n end", "def check_account_filling\n return unless depricated_page?\n\n redirect_to edit_account_path(current_account) unless\n request.get? &&\n current_user&.valid? &&\n current_account&.valid?\n end", "def is_on_page?(page_text, negation = '')\n fail 'Página inesperada. Entre com uma mensagem válida' if\n page_text.to_s == ''\n\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 5) { has_text? page_text }\n # If negation is not nil, we should raise an error\n # if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil,\n # otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n\n fail \"Página inesperada. A página não contém: '#{page_text}'\" if\n should_not_have_exception\n\n fail \"Página inesperada. Era esperado: '#{page_text}'\" if\n should_have_exception\n\n true\n end", "def sierra_856_perfect?\n @url == self.proper.proper_856_content\n end", "def landing_page? \n landing_page.present? \n end", "def vulnerable?\n !@results.empty?\n end", "def indexable?(page)\n (page.data['id'] == 'kb')\n end", "def visible_check(_traversal_env)\n Result::DENY\n end", "def extract_valid_rps(site)\r\n site.collections[rp_key].docs.map { |p| RpLogs::Page.new(p) }\r\n .reject do |p|\r\n message = p.errors?(self.class.parsers)\r\n skip_page(site, p, message) if message\r\n message\r\n end\r\n end", "def test_00010_home_page_contents\n check_main_menu\n check_bottom_menu\n check_footnote\n end", "def check_site\n\t\t\tpage = @agent.get(@page[:url])\n\t\t\traise \"got redirected on #{@page[:name]}\" if redirect?\n\n\t\t\tdoc = Nokogiri::HTML(page.parser.to_s)\n\t\t\tnodes_with_euros = doc.search(\"//text()[contains(.,'€')]\")\n\t\t\tcontainers_array = []\n\t\t\traise \"no euros found #{@page[:name]}\" if nodes_with_euros == []\n\n\t\t\t# Previous version was with ruby, now xpath, less code. \n\t\t\tcontainers_array = nodes_with_euros.collect { |node| node.ancestors(\"//table | //div\").first } unless @page[:search_string]\n\n\t\t\tif @page[:search_string]\n\t\t\t\t#remove escapes\n\t\t\t\t@page[:search_string].gsub!(/\\\\/) { ''}\n\t\t\t\tcontainers_array << doc.search(\"//text()[contains(.,#{@page[:search_string]})]\").first\n\t\t\tend\n\n\t\t\t#Nodeset is an array, but doesn't act like one, really annoying.\n\t\t\tcontainers_nodeset = Nokogiri::XML::NodeSet.new(doc)\n\t\t\tcontainers_freqs = containers_array.inject(Hash.new(0)) { |h,v| h[v] += 1; h}\n\t\t\t\n\t\t\t# Refactored from double block\n\t\t\tcontainers_nodeset = containers_freqs.collect { |node,freq| freq > 1 ? node : nil }\n\t\t\tcontainers_nodeset.uniq!\n\t\t\traise \"no hits found in #{@page[:name]}\" if (containers_nodeset.empty? || containers_nodeset == [nil])\n\n\t\t\twrite_to_file(containers_nodeset)\n\t\t\t\n\t\trescue Timeout::Error => e\n\t\t\t# Only occures when site is down or script runs too often. So we try again once, then bail\n\t\t\tretry if @retry\n\t\t\t@retry = false\n\t\t\traise\n\t\trescue => e\n\t\t\thandle_me(e)\n\t\tend", "def cache_page?\n return false unless @page && Alchemy::Config.get(:cache_pages)\n pagelayout = PageLayout.get(@page.page_layout)\n pagelayout['cache'] != false && pagelayout['searchresults'] != true\n end", "def check_visibility\n set_problem\n viewable = begin\n unless @problem.hide\n true\n else\n if logged_in? && current_user.is_admin?\n true\n else\n false\n end\n end\n end\n\n unless viewable\n render status: :forbidden, nothing: true\n return\n end\n end", "def render_fresh_page?\n must_not_cache? || stale?(\n etag: page_etag,\n last_modified: @page.published_at,\n public: !@page.restricted,\n template: \"pages/show\"\n )\n end", "def reachable?(url)\n page = MetaInspector.new(url)\n\n if page.response.status < 400\n true\n else\n false\n end\n rescue\n false\n end", "def render?\n pages.to_a.size > 1\n end", "def restricted?\n page.restricted?\n end", "def out_of_range?\n current_page > total_pages\n end", "def check_page_and_verify_text(text)\n #check_page(@selenium.find_element(:id, \"body\").text)\n verify_text(text)\n end", "def check_page(base, page, severity=:E, expectedStatus=\"200\", log=true)\n path = base + page\n response = getHTTP(path)\n code = response.code || '?'\n if code != expectedStatus\n test(severity, \"Fetched #{path} - HTTP status: #{code} expected: #{expectedStatus}\") unless severity == nil\n return nil\n end\n I \"Fetched #{path} - OK\" if log\n response.body\nend", "def _validate_homepage(h)\n if h =~ %r{http://EXAMPLE}\n results.add_warning('homepage', 'The homepage has not been updated' \\\n ' from default')\n end\n end", "def current_page_check(current_page)\n\n halt 400, \"Current page must be integer\" if !current_page.is_a?(Fixnum)\n\n return current_page\n\n end", "def reachable?\n return true if (page_ref && (page_ref.good? || (page_ref.http_status == 200))) || (gleaning && gleaning.good?)\n return false if (page_ref && @@BadResponseCodes.include?(page_ref.http_status)) &&\n (gleaning && @@BadResponseCodes.include?(gleaning.http_status))\n end", "def verifySignupPageTitle\n pageurl = $browser.url\n if (pageurl.eql?\"https://www.slideshare.net/w/signup\")\n puts \"Signup page URL matched\"\n else puts \"Signup page URL mismatched\"\n end\n end", "def cannot_edit_All\n if @page.name == Rails.application.config.ALL_PAGE\n redirect_to show_all_path\n end\n end", "def entry_should_not_be_visible(entry)\n expect(page).to have_no_css \"#feed-entries #entry-#{entry.id}\"\nend", "def webpage_site?\n marc_leader_06_match = record.leader.byteslice(6) == 'a'\n marc_leader_07_match = %w[b i s].include?(record.leader.byteslice(7))\n marc_008_21_match = record.fields('008').find do |field|\n field.value.byteslice(21) == 'w'\n end\n\n marc_006_match = record.fields('006').find do |field|\n field.value.byteslice(0) == 's' &&\n field.value.byteslice(4) == 'w'\n end\n\n return true if (marc_leader_06_match &&\n marc_leader_07_match &&\n marc_008_21_match) ||\n marc_006_match\n end", "def out_of_bounds?\n current_page > total_pages\n end", "def refresh_page_reset?\r\n # If no page fulfills conditions\r\n if @page == nil\r\n # Reset values\r\n refresh_reset\r\n # End method\r\n return true\r\n end\r\n return false\r\n end", "def i_dont_reach(which_page)\n result = go(which_page)\n assert (Net::HTTPNotFound===result or Net::HTTPForbidden===result), __last_because + \" (can reach #{which_page}: #{result})\"\n end", "def check_accessibility\n end", "def check_only_links\n end", "def expect_page_to_not_have_content(content)\n\n page.should_not have_content(content)\n\n end", "def sanitize?\n begin\n self.original_url.strip!\n page = MetaInspector.new(self.original_url)\n true\n rescue\n false\n end\n end", "def is_full?\n page.is_full?\n end", "def whitelisted_page?(page)\n return false unless page\n return false if /:/.match page\n page[0..5] == '/wiki/' ? true : false\n end", "def require_design\n unless @account && @account.current_design\n render :text => \"This site is currently offline\", :status => 503 \n return\n end\n end", "def restricted?\n pages.any? && pages.not_restricted.blank?\n end", "def restricted?\n pages.any? && pages.not_restricted.blank?\n end", "def restricted?\n pages.any? && pages.not_restricted.blank?\n end", "def correction_existent_check\n # Check first if there is a correction\n page_content = PageContent.where(:page_id => self.id).where(:content_type => 'correction').order(id: :asc).last\n\n # If there isn't a correction,\n # Go to the ocr or text extraction\n if !page_content \n page_content = PageContent.where(:page_id => self.id).first\n end\n\n return page_content\n end", "def validate_page_existence\n if page.blank?\n errors.add(:page_id, :invalid)\n return false\n end\n self.name = page['name']\n true\n end", "def has_page?\n if url.nil? or page.nil? or page.document.nil?\n errors.add(:page, \"can not be nil\")\n return false\n end\n true\n end", "def checks; end", "def passes_validations?\n return true if skip_validations\n result = true\n pages.each do |page|\n result = false unless page.passes_validations?\n end\n result\n end", "def search_result_page_existed?\r\n displayed?\r\n end", "def my_valid?\n application_events.each { |ev| ev.my_valid? }\n\n ap_nos = application_events.collect { |ap| ap.application_number }\n # XXX - use a case?\n if application_event_count > application_events.count\n diff = self._ap_nos - ap_nos\n if diff == []\n warn \"WARNING in #{report.class.name.inspect} report, missing application events for page #{number}: #{application_event_count} > #{application_events.count} #{(self._ap_nos - ap_nos).inspect} (probably because there was a duplicate application event on this page - i.e. not *our* fault.)\"\n else\n warn \"ERROR in #{report.class.name.inspect} report, missing application events for page #{number}: #{application_event_count} > #{application_events.count} #{(self._ap_nos - ap_nos).inspect}\"\n end\n elsif application_events.count > application_event_count \n warn \"ERROR in #{report.class.name.inspect} report, extra application events for page #{number}: #{application_events.count} > #{application_event_count} #{(ap_nos - self._ap_nos).inspect}\"\n elsif application_event_count == application_events.count\n true\n else\n raise \"ERROR unreachable\"\n end\n end", "def scraped?\n !url.blank?\n end", "def run_module?( mod, page )\n return false if mod.issue_limit_reached?\n\n elements = mod.info[:elements]\n return true if !elements || elements.empty?\n\n elems = {\n Element::LINK => page.links.any? && @opts.audit_links,\n Element::FORM => page.forms.any? && @opts.audit_forms,\n Element::COOKIE => page.cookies.any? && @opts.audit_cookies,\n Element::HEADER => page.headers.any? && @opts.audit_headers,\n Element::BODY => !page.body.empty?,\n Element::PATH => true,\n Element::SERVER => true\n }\n\n elems.each_pair { |elem, expr| return true if elements.include?( elem ) && expr }\n false\n end", "def on_the_page?\n dom_reader.has_attrs?(self.values)\n end", "def verify_page?(key, exit = true)\n base_title = wait_for_title(exit)\n puts \"Verify Title - Desired Prefix: #{site.get_title(key)} => Full Title: #{page_title}\" if exit\n if site.get_title(key) != base_title\n fail(\"Page title does not match expected result. EXPECTED: #{site.get_title(key)} FOUND: #{page_title}\") if exit\n return false\n end\n return true\n end", "def check_existing_home_page\n\t\tif self.home_page?\n\t\t\t@old_home = Page.get_home_page\n\t\t\tunless @old_home.nil? || @old_home == self\n\t\t\t\t@old_home.home_page = false\n\t\t\t\t@old_home.save\n\t\t\tend\n\t\tend\n\t\t\n\tend", "def request_empty_page\n @posts.empty? && request.env[\"HTTP_X_REQUESTED_WITH\"] != \"XMLHttpRequest\"\n end", "def pagehead(browser)\n puts \"inside pagehead\"\n #\tChecking for text in a page\n\t text1='WordPress Updates'\n\t if browser.text.include?(text1)\n\t puts text1+\" exists\"\n\t end\nend", "def healthy?\n super && ( (contents !~ %r{^\\{\"error\":}) )\n end", "def validate_html_input\n begin\n l = params[:low_ch].to_i\n h = params[:high_ch].to_i\n channel_list = (l..h).to_a \n blocked_list = params[:blocked_list].split(\" \").map { |e| e.to_i }\n @viewable_list = channel_list - blocked_list\n @browse_list = params[:view_sequence].split(\" \").map { |e| e.to_i }\n rescue Exception => e\n end\n end", "def check_adroll_on_other_pages(params, start_page)\n $tracer.trace(\"GameStopAnalyticsFunctions: #{__method__}, Line: #{__LINE__}\")\n $tracer.report(\"Should #{__method__}.\")\n if params[\"login\"] == \"\" and params[\"password\"] == \"\"\n open(\"#{start_page}/Profiles/OrderTrackingLogin.aspx\")\n order_lookup_email.value = \"robertsantos@gamestop.com\"\n order_lookup_confirmation_number.value = \"4131015095782760\"\n order_lookup_button.click\n wait_for_landing_page_load\n validate_cookies_and_tags(params)\n else\n open(\"#{start_page}/Profiles/MyAccount.aspx\")\n wait_for_landing_page_load\n validate_cookies_and_tags(params)\n\n open(\"#{start_page}/Orders/OrderHistory.aspx\")\n wait_for_landing_page_load\n validate_cookies_and_tags(params)\n\n open(\"#{start_page}/ps3\")\n wait_for_landing_page_load\n validate_cookies_and_tags(params)\n\n search_button.click\n wait_for_landing_page_load\n validate_cookies_and_tags(params)\n end\n end", "def page?\n !!self.page_id\n end", "def check_format\n not_found unless request.xhr?\n end", "def check_has_form(page)\n inputs = page.search('input')\n inputs.each do |input|\n attrs = input.attributes.select { |k,v| v.value =~ /^name|login|password|username|^email$$/i } \n go_ahead = (!attrs.compact.empty?)\n if go_ahead\n puts \"I think I found the login url for #{page.uri.to_s}\"\n login_page = page\n puts \">> #{login_page.uri}\\n\\n\"\n return true\n end\n\n \n end\n return false\nend", "def check_validity!\n # nothing\n end", "def test_pages\n oldpage = @current_page\n @current_page = nil\n for i in 0...pages.size\n if test_page_conditions(i)\n @current_page = i\n if oldpage != @current_page\n # Run only if the page actually changed\n @direction = current_page.graphic[:direction] || 2\n # Delete any interpreters there may be left trying to run the old page\n if oldpage\n if oldpage.has_trigger?(:parallel_process)\n $game.map.parallel_interpreters.delete_if { |i| i.event == self }\n else\n $game.map.event_interpreters.delete_if { |i| i.event == self }\n end\n end\n # Execute event if new page is Parallel Process or Autorun\n if current_page.has_trigger?(:parallel_process) || current_page.has_trigger?(:autorun)\n trigger\n end\n if current_page.automoveroute[:commands].size > 0\n # Wait 1 frame to start the new autonomous move route so the visuals have time to adjust to the new page.\n @automove_wait = 1\n end\n end\n break\n end\n end\n end", "def check\n \n end" ]
[ "0.6631442", "0.65320367", "0.6519046", "0.6248915", "0.61190647", "0.60940707", "0.60183764", "0.5983509", "0.5968726", "0.5920787", "0.5914261", "0.59142464", "0.59142464", "0.59142464", "0.59142464", "0.5890747", "0.58886456", "0.5872057", "0.58448946", "0.58171296", "0.57961786", "0.57922804", "0.57458556", "0.573725", "0.5700351", "0.5700351", "0.56980187", "0.56798536", "0.5667944", "0.5667944", "0.56604695", "0.5660369", "0.5658607", "0.5639866", "0.5636325", "0.5622664", "0.56078786", "0.560717", "0.56024975", "0.56007457", "0.55944455", "0.55929965", "0.55776024", "0.55763215", "0.5576085", "0.55716324", "0.5558462", "0.5552199", "0.555113", "0.55475026", "0.5546773", "0.55459976", "0.55451703", "0.55293196", "0.55227005", "0.5498256", "0.549623", "0.5495533", "0.5494487", "0.549424", "0.54892254", "0.54847485", "0.5482416", "0.54795486", "0.5478465", "0.5478184", "0.5476444", "0.5473589", "0.54709816", "0.546302", "0.5455759", "0.54501754", "0.5447647", "0.5443185", "0.5437089", "0.5437089", "0.5437089", "0.54355156", "0.54102767", "0.5405732", "0.5404365", "0.5403374", "0.5398889", "0.53951156", "0.5394016", "0.5386553", "0.53820324", "0.5379491", "0.5375323", "0.5374424", "0.5369549", "0.53686184", "0.53645176", "0.5357906", "0.53540623", "0.53536725", "0.5352846", "0.5350776", "0.5346651", "0.5342319" ]
0.64959544
3
wait for page to load and verify text
def wait_for_page_and_verify_text(text) @selenium.wait_for_page_to_load(120000) check_page_and_verify_text(text) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_page_and_verify_text(text)\n #check_page(@selenium.find_element(:id, \"body\").text)\n verify_text(text)\n end", "def wait_page_load(criteria,value,expected_element_text,seconds_wait)\r\n\t \t\ttext_on_page = @driver.find_element(criteria.to_sym, value).text\r\n\t \t\twait_for(seconds_wait) { text_on_page.include?(expected_element_text)}\r\n\t \tend", "def wait_for_page_to_load\n @wait_on.each { |element| wait_for_element(element) }\n loading_message.wait_while_present if loading_message.present?\n true\n rescue\n false\n end", "def wait_to_load\n activity_div.wait_until(&:exists?)\n @page = @bank_page.load_page\n end", "def wait_until_page_loads(path)\n @wait.until { @driver.current_url == path}\n @wait.until { @driver.execute_script('return PAGE_RENDERED;') == true }\n $verbose ? puts(\"#{path} successfully loaded\") : nil\n end", "def text_is_on_page(text, timeout = WAITING_TIMEOUT)\n self.wait_until(timeout, \"\\n\\nERROR! Text '#{text}' was not found after #{timeout} seconds of waiting!\\n\") do\n self.text.include? text\n end\n end", "def wait_for_text(text)\n Watir::Wait.until { @browser.text.include? text }\n end", "def wait_page_load\n @browser.wait_for_load\n end", "def wait_for_page\n sleep 0.7\n end", "def wait_for_page_title()\n wait_for :page_title, \"Error waiting for page title to load\"\n end", "def wait_for_page_title()\n wait_for :page_title, \"Error waiting for page title to load\"\n end", "def is_search_text_present\r\n selenium.wait_for_page_to_load\r\n return selenium.is_text_present(\"Search\")\r\n end", "def assert_text_on_screen(validation_msg)\n\t\tsleep(2)\n\t\tputs \"#{validation_msg}\"\n\t\ttext_from_screen=query(\"*\", \"text\")\n\t\telement_present=text_from_screen.include? validation_msg\n\t\tassert_equal true, element_present\n\tend", "def wait_for_recommended_page_load\n exp_text = 'Recommended for you'\n get_element(:xpath, \"//*[contains(text(), '#{exp_text}')]\")\n end", "def test_pageload\n @driver.navigate.to(@url)\n element = @driver.find_element(:class, \"ss-form-title\")\n assert_equal(element.text,\"Basic Web Forms\") # Check if the page open and the title is \"Basic Web Forms\"\n end", "def wait_for_browser\r\n # NOTE: no need any more\r\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def wait_for_page_to_load timeout\r\n command 'waitForPageToLoad', timeout\r\n end", "def wait_page_load()\n rc = nil\n Log.Debug(:h5, \"[#{self.class.to_s}.WAIT_PAGE_LOAD]\") {\n _check_repl_lock\n _compile_wait_page_load\n rc = exec\n rc = (rc.is_str? and rc.include?(READY_STATE_COMPLETE)) ? true : false\n }\n Log.Debug \"{#{self.class.to_s}.wait_page_load} :=> #{rc.safe_s}\"\n rc\n end", "def assert_wait_for_text(text, time_out=15)\n fail \"Text is empty\" if text==nil\n puts \"assert_wait_for_text (#{text})\"\n res=query(\"view\",:text)\n wait_for_element_exists(\"#{$g_query_str} text:'#{text}'\",{:timeout=>time_out.to_i,:timeout_message=>\"#{res}\"})\n end", "def verify_browser_text (browsertext)\n\t\t@browser.text.include? (browsertext)\n\tend", "def check_if_your_league_pop_up_is_dispalyed\n\n page.should have_content(read_file_content(YOUR_LEAGUES))\n sleep(THREAD_SLEEP_1)\n\n end", "def wait_for_pdf_window(string)\n Timeout.timeout(Nenv.browser_timeout) do\n loading = true\n while loading\n check = url_match(string, RouteHelper.browser.windows.last.use.url)\n loading = false if check\n sleep(1)\n end\n return true\n end\n rescue Timeout::Error => e\n raise \"Timeout waiting for window to load - #{e}\"\n exit\n end", "def wait_until_page_loaded(page_name, prev_url)\n time_secs = 0\n while Capybara.current_session.current_url == prev_url\n break if time_secs > PAGE_TIMEOUT_SECS\n sleep 1\n time_secs+=1\n end\n fail \"ERROR: Page #{page_name} failed to load after #{PAGE_TIMEOUT_SECS} secs\" if Capybara.current_session.current_url == prev_url\n end", "def verify_if_searchresult_page_is_shown\n handle_captcha\n wait_until_element_displays(SEARCH_RESULT_CLEAR_BTN,15)\n puts \"Search Result is shown\"\n storeResultsInHash\n end", "def wait_for_page_to_load(page)\n Logbook.message(\"Waiting for page #{page} to load...\")\n wait_for do\n @browser.execute_script(\"return document.querySelector('link[rel=\\\"icon\\\"]') !== null\")\n end\n end", "def wait_for_freelancer_page_visible\n sleep 15\n end", "def load_page\n page.visit('')\n end", "def waitForPageToLoad(title, what='title')\n puts \"waitForPageToLoad:('#{title}',#{what})\"\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => THE_TIMEOUT)\n wait.until {@driver.title}\n puts \"waitForPageToLoad until reached title element with text set to [#{@driver.title}]\"\n rescue Exception => e\n puts \"waitForPageToLoad exception [#{e}]\"\n return\n end\n waitForElementPresent(:css, what)\n iter = 0\n found = false\n THE_TIMES.times do\n puts \"waitForPageToLoad: iter=[#{iter}] waiting for-->[#{title}] currently-->[#{@driver.find_element(:css, what).text}] \"\n iter += 1\n if @driver.find_element(:css, what).text == title\n found = true\n break\n end\n sleep 1.0\n end\n if found then\n puts \"waitForPageToLoad: After [#{iter}] tries: found expected text=[#{title}] in [#{what}] element\"\n else\n puts \"----TEST FAILED:---waitForPageToLoad: After [#{iter}] tries: NOT FOUND expected text=[#{title}] in [#{what}] element\"\n end\n found.should == true\n end", "def wait_for_dom_has_loaded\n Capybara.default_max_wait_time = 40\n Timeout.timeout(Capybara.default_max_wait_time) do\n loop until page_has_loaded?\n end\n end", "def verify_text?(browser_handle, text)\n browser_handle.text.include?(text)\nend", "def verify_persinfo\n\t\t@browser.url == \"https://www.autogravity.com/credit/application/personal\"\n\t\t@browser.div(:visible_text, /Personal Information$/).present?\n\tend", "def confirm_on_page\n @browser.div(class: 'home').wait_until_present(5)\n end", "def test_text_is_present\n @selenium.open \"/\"\n assert @selenium.text? \"Advanced Search\"\n end", "def pageContainsText( text , frameName = \"\" , showResult = true)\n\n container = getObjectFrameReference( text , frameName )\n retryCount = 0\n begin \n t = container.body.innerText \n #puts t\n rescue => e\n # we sometimes get exceptions here... My guess is its something to do with load times.\n retryCount = retryCount +1\n if retryCount < 2\n log showException(e)\n sleep 0.5\n retry\n end\n end\n #log \"\\n------------------ #{frameName} ------------------\\n\"\n #log t\n #log \"\\n-----------------------------------------------\\n\"\n\n if ( t =~ /#{text}/ ) != nil\n log \"pageContainsText: Looking for: #{text} - found it ok\" unless showResult == false if $debuglevel >=0\n return true\n else\n log \"pageContainsText: Looking for: #{text} - Didnt Find it\" unless showResult == false\n return false\n end\n end", "def is_on_page? page_text, negation = ''\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 5) { has_text? page_text }\n # If negation is not nil, we should raise an error if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil, otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n raise \"Unexpected Page. The page should not have: '#{page_text}'\" if should_not_have_exception\n raise \"Unexpected Page. Expected was: '#{page_text}'\" if should_have_exception\n end", "def show_read\n find('#show-read').click\n\n # Ensure entries have finished loading\n expect(page).to have_no_css 'div#loading'\nend", "def verifySpeakers(url)\n clickPeopleLink()\n clickOnSpeakers()\n verifySpeakersDisplayed()\n refreshPage(url)\n end", "def checktitle(browser)\n puts \"Inside checktitle\"\n browser.text_field(:class,'customize-control-title')\n sleep (3)\n \nend", "def wait_for_ajax_complete\n wait_until { page.evaluate_script 'jQuery.active == 0' rescue true }\n end", "def verify_home_page\n home_header_tag = \"Welcome to Valley Wine Works\"\n\n @driver.find_element(:id, \"home_lodi_wine_business_solutions\").click\n assert_equal home_header_tag, @driver.find_element(:css, \"#main > h1\").text\n puts \"INFO: Home text = #{@driver.find_element(:css, \"#main > h1\").text}\"\n puts \"PASS: home page was loaded successfully\"\n end", "def wait_loading\n puts \"[BrowserOperator] wait_loading\" << '..' * 10\n browser.div(:id, 'pageLoading').wait_while_present()\n end", "def success_confirm_address_hp\n\tsleep 5\n\t page.has_content?('Su dirección ha sido guardada exitosamente')\nend", "def test_PreApproval_load\n @driver.get(@baseURL)\n #begin\n @Nexa_Util.loginAsNormalUser(@driver)\n # @wait.until { @driver.find_element(:id, 'leftNavigationContent') }\n\n # rescue Timeout::Error\n waitForPageFullyLoaded(60);\n @start = Time.now\n\n # Click at All Contacts\n @driver.find_element(:link_text, 'Pre-Approvals Expiring 2 Months').click\n # @wait.until { @driver.find_element(:class, 'resultTable') }\n waitForPageFullyLoaded(20);\n @stop = Time.now\n @sitePerformance.puts \"Page load time 'Pre-Approvals Expiring 2 Months': #{@Nexa_Util.time_diff_milli(@start, @stop)}\"\n assert_operator 60000.00, :>, @Nexa_Util.time_diff_milli(@start, @stop)\n # end\n end", "def test_document_server(url)\n test_name = \"Test Document Server Connection\"\n puts test_name\n get_website(url)\n login_as_guest_test\n if @browser.find_element(:css=>'.focus') #Dismisses the splashscreen if present\n @wait.until{@browser.find_element(:css=>'.focus')}.click\n end\n login_toolshelf_button_test\n login_test\nend", "def test_valley_smoketest\n @driver.get(@base_url)\n verify_home_page()\n verify_services_page()\n verify_about_page()\n verify_contact_page()\n verify_faq_page()\n verify_links_page()\n end", "def pagehead(browser)\n puts \"inside pagehead\"\n #\tChecking for text in a page\n\t text1='WordPress Updates'\n\t if browser.text.include?(text1)\n\t puts text1+\" exists\"\n\t end\nend", "def loading_wait\n \tcase ENV['BROWSER']\n \twhen \"iphone\",\"ipad\",\"android_phone\",\"android_tablet\" then\n \t\tWatir::Wait.until {\n \t\tnot @browser.element(xpath: '//div[contains(@class, \"load\")]').visible?\n \t\t}\n \telse\n \t\tWatir::Wait.until {\n \t\tnot @browser.iframe(:id, 'quote-frame').div(xpath: '//div[contains(@id, \"load\")]').visible?\n \t\t}\n \tend\n \tend", "def go_to_and_wait_to_load(url)\n current_name = driver.title\n driver.get url\n\n # wait until the current title changes to see that you're at a new url\n @wait.until { driver.title != current_name }\n end", "def wait_for_ajax\n counter = 0\n while page.execute_script(\"return $.active\").to_i > 0\n counter += 1\n sleep(0.1)\n raise \"AJAX request took longer than 20 seconds.\" if counter >= 400\n end\n end", "def wait_for_booking_page_load\n get_element(:xpath, \"//*[contains(text(), 'from')]\")\n end", "def test_scm_st_001\n printf \"\\n Test 001\"\n open \"/devgroup/pj_index/1/1\"\n sleep SLEEP_TIME\n assert @selenium.is_text_present($page_titles[\"auth_login\"])\n end", "def wait_for_render(how, what)\n @wait.until {element_visible?(how, what)}\n end", "def wait_for_text(pattern, options={})\n builder = JavascriptExpressionBuilder.new\n\t\t builder.find_text(pattern, options).append(\"text_match == true;\")\n wait_for_condition builder.script, options[:timeout_in_seconds]\n end", "def wait_for_results_to_load\n wait_until { searchbar_element.attribute('class').include?(Constants::SEARCHING_CLASS) }\n rescue StandardError\n puts 'Loading in search modal didn\\'t appear!'\n ensure\n wait_until { !searchbar_element.attribute('class').include?(Constants::SEARCHING_CLASS) }\n end", "def wait_for_shibboleth_form()\n wait_for :shibboleth_form, \"Error waiting for pds\"\n end", "def wait_for_shibboleth_form()\n wait_for :shibboleth_form, \"Error waiting for pds\"\n end", "def expect_game_to_be_over\n expect(page).to have_content(\"Your Results\")\n end", "def should_see(text)\n expect(page).to have_content(text)\n end", "def check_if_join_public_league_pop_up_is_displayed\n\n page.should have_content(read_file_content(JOIN_A_PUBLIC_LEAGUE_PATH))\n sleep(THREAD_SLEEP_1)\n\n end", "def verify_landing_page\n @higgs.page_title_present?('Puppet Enterprise Installer')\n @higgs.link_present?('email the CEO.')\n @higgs.select_link(\"Let's get started\")\n @higgs.page_title_present?('Puppet Enterprise Installer - Choose your deployment')\n end", "def guessing?\n ! page.has_content?(\"Your Results\")\n end", "def page_should_finish_loading\n expect(page).not_to have_css '.sidebar-spinner'\n expect(page).to have_css '#subscription-stats'\nend", "def ValidateCandidate()\n if ($driver.find_element(:tag_name => \"body\").text.include?(\"No result has been found\")) == true\n raise VerificationException.new(COLOR_RED + \"Text not matching. Check screenshot under features->Screenshots->#{ENV['CHANNEL']})\\n\")\n else\n puts \"match found\"\n end\nend", "def waitForLoader\n element = @driver.find_element(:css, 'html')\n 45.times {\n if !element.attribute('css').include?(PAGELOADER_ELEMENT) # provide the loader class\n return\n else\n sleep 1\n end\n }\n raise 'Loading Spinner Timeout'\n end", "def is_on_page?(page_text, negation = '')\n fail 'Página inesperada. Entre com uma mensagem válida' if\n page_text.to_s == ''\n\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 5) { has_text? page_text }\n # If negation is not nil, we should raise an error\n # if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil,\n # otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n\n fail \"Página inesperada. A página não contém: '#{page_text}'\" if\n should_not_have_exception\n\n fail \"Página inesperada. Era esperado: '#{page_text}'\" if\n should_have_exception\n\n true\n end", "def wait_for_ajax(&block)\n wait_until do\n page.driver.browser.execute_script(<<-JS)\n return !Ext.Ajax.isLoading();\n JS\n end\n yield\n end", "def is_on_page?(page_text, negation = '')\n fail 'Página inesperada. Entre com uma mensagem válida' if\n page_text.to_s == ''\n\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 10) { has_text? page_text }\n # If negation is not nil, we should raise an error\n # if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil,\n # otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n\n fail \"Página inesperada. A página não contém: '#{page_text}'\" if\n should_not_have_exception\n\n fail \"Página inesperada. Era esperado: '#{page_text}'\" if\n should_have_exception\n\n true\n end", "def is_text_present(ele)\n $log.info \"verifying #{ele} present or not\"\n if s=$browser.button(:id, \"#{ele}\").exists?\n $log.info \"{ele} available on the page\"\n elsif\n $log.info \"failed to find the element: #{ele}!\"\n raise Exception.new(\"Failed to find the element: #{ele}!\")\n end\n \nend", "def wait_for_login_element()\n wait_for :login_element, \"Error waiting for login element, you are possibly logged in \"\n end", "def wait_for_login_element()\n wait_for :login_element, \"Error waiting for login element, you are possibly logged in \"\n end", "def load_url_and_wait_for_element(url,sym,id)\n current_name = driver.title\n driver.get url\n\n @wait.until { driver.title != current_name and driver.find_elements(sym, id).size > 0 }\n end", "def check_if_join_private_league_pop_up_is_displayed\n\n page.should have_content(read_file_content(JOIN_A_PRIVATE_LEAGUE_PATH))\n sleep(THREAD_SLEEP_1)\n\n end", "def user_agreement\n self.user_agreement_link\n sleep 1\n #wait_for_ajax\n # New Class goes here.new @browser\n end", "def check_if_the_text_is_displayed_on_want_to_get_involved\n\n page.should have_content(read_file_content(WANT_TO_GET_INVOLVED_TEXT_PATH))\n\n end", "def wait_for_logout_page()\n wait_for :logout_page, \"Error waiting for search for logout\"\n end", "def wait_for_logout_page()\n wait_for :logout_page, \"Error waiting for search for logout\"\n end", "def load_page\n @mechanize_instance.get(@url)\n end", "def check_exist_text(text)\n puts text\n if text.length > 0\n q = query(\"* text:'#{text}'\")\n while q.empty?\n performAction('scroll_down')\n q = query(\"* text:'#{text}'\")\n end\n check_element_exists(\"* text:'#{text}'\")\n end\nend", "def go_back_and_wait\n go_back\n assert_page_loaded\n end", "def click_wait\n @webpage.click_wait(@locator)\n end", "def test_ajax_router\n visit(\"/ajax/auto_complete/name/Agaricus\")\n lines = page.html.split(\"\\n\")\n assert_equal(\"A\", lines.first)\n assert(lines.include?(\"Agaricus\"))\n assert(lines.include?(\"Agaricus campestris\"))\n end", "def test_validinput2\n @driver.navigate.to(@url)\n element = @driver.find_element(:id,'entry_1041466219') # Find the name field\n element.send_keys(\"Michael\")\n element = @driver.find_element(:id,'group_310473641_1') # Select the \"Yes\" checkbox\n element.click\n Selenium::WebDriver::Support::Select.new(@driver.find_element(:id => 'entry_262759813')).select_by :text, 'JUnit' # From the dropdown, select \"JUnit\"\n element = @driver.find_element(:id,'entry_649813199')\n element.send_keys(\"Some random text here.\") # Enter some text in the text area\n element.submit\n element = @driver.find_element(:class,'ss-resp-message') \n assert_equal(element.text,\"Your response has been recorded.\") # Check if on the submit page, the message displayed is the one expected\n end", "def test_ID_25890_published_posts_02\n login_as_user1\n go_to_edit_profile_page\n $profile_your_posts.click\n sleep 5\n $profile_published.when_present(60).click\n verify_text \"test_ID_25890_published_posts\",\"Your Posts\",\"Drafts\", \"Scheduled\", \"Published\",\"Submitted Drafts \",\"Published\"\n verify_elements_on_published_post \"test_ID_25890_published_posts\"\n end", "def test_MortgageAniversary_load\n @driver.get(@baseURL)\n #begin\n @Nexa_Util.loginAsNormalUser(@driver)\n # @wait.until { @driver.find_element(:id, 'leftNavigationContent') }\n\n # rescue Timeout::Error\n\n waitForPageFullyLoaded(60);\n @start = Time.now\n @driver.find_element(:link_text, 'Mortgage Anniversaries 2 Months').click\n #@wait.until { @driver.find_element(:class, 'resultTable') }\n waitForPageFullyLoaded(20);\n @stop = Time.now\n @sitePerformance.puts \"Page load time 'Mortgage Anniversaries 2 Months': #{@Nexa_Util.time_diff_milli(@start, @stop)}\"\n assert_operator 60000.00, :>, @Nexa_Util.time_diff_milli(@start, @stop)\n #end\n end", "def wait_for_text_to_include(locator, string)\n wait_for { text(locator).include?(string) }\n end", "def verifyMyAccountLinks()\n\t\n\tputs \"************** START: Verify MyAccount Links ****************\"\n\t\n\tputs \"Step 1 : Verify all the links under My Account screen.\"\n\t$browser.click \"myAccountHeaderLink\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"My Account\")\n\t\tputs \"Step 1.1 : User has reached the Account page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.1 : User had failed to reach the Account page.\"\n\t\t$verification_errors << $!\n\tend\n\t$browser.click \"link=Edit My Profile\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Edit My Profile\")\n\t\tputs \"Step 1.2 : User has reached the EditMyProfile page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.2 : User had failed to reach the EditMyProfile page.\"\n\t\t$verification_errors << $!\n\tend\n\t$browser.click \"link=My Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Start donating\")\n\t\tputs \"Step 1.3 : User has reached the My Donations page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.3 : User had failed to reach the My Donations page.\"\n\t\t$verification_errors << $!\n\tend\n\t$browser.click \"link=Account Settings\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Change your login information\")\n\t\tputs \"Step 1.4 : User has reached the Account Settings page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.4 : User had failed to reach the Account Settings page.\"\n\t\t$verification_errors << $!\n\tend\n\tbegin\n\t\tassert $browser.is_element_present(\"link=My Saved Cards\")\n\t\t$browser.click \"link=My Saved Cards\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"My Credit Cards\")\n\t\t\tputs \"Step 1.5 : User has reached the My Saved Card page successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 1.5 : User had failed to reach the My Saved Card page.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\trescue\n\t\t$verification_errors << $!\n\t\tputs \"Step 1.5 : My Saved card link is not available for this User.\"\n\tend\n\t\n\tputs \"************** END: Verify MyAccount Links ****************\"\n\t\nend", "def verifyMyAccountLinks()\n\t\n\tputs \"************** START: Verify MyAccount Links ****************\"\n\t\n\tputs \"Step 1 : Verify all the links under My Account screen.\"\n\t$browser.click \"myAccountHeaderLink\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"My Account\")\n\t\tputs \"Step 1.1 : User has reached the Account page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.1 : User had failed to reach the Account page.\"\n\t\t$verification_errors << $!\n\tend\n\t$browser.click \"link=Edit My Profile\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Edit My Profile\")\n\t\tputs \"Step 1.2 : User has reached the EditMyProfile page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.2 : User had failed to reach the EditMyProfile page.\"\n\t\t$verification_errors << $!\n\tend\n\t$browser.click \"link=My Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Start donating\")\n\t\tputs \"Step 1.3 : User has reached the My Donations page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.3 : User had failed to reach the My Donations page.\"\n\t\t$verification_errors << $!\n\tend\n\t$browser.click \"link=Account Settings\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Change your login information\")\n\t\tputs \"Step 1.4 : User has reached the Account Settings page successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1.4 : User had failed to reach the Account Settings page.\"\n\t\t$verification_errors << $!\n\tend\n\tbegin\n\t\tassert $browser.is_element_present(\"link=My Saved Cards\")\n\t\t$browser.click \"link=My Saved Cards\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"My Credit Cards\")\n\t\t\tputs \"Step 1.5 : User has reached the My Saved Card page successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 1.5 : User had failed to reach the My Saved Card page.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\trescue\n\t\t$verification_errors << $!\n\t\tputs \"Step 1.5 : My Saved card link is not available for this User.\"\n\tend\n\t\n\tputs \"************** END: Verify MyAccount Links ****************\"\n\t\nend", "def test_validinput1\n @driver.navigate.to(@url)\n element = @driver.find_element(:id,'entry_1041466219') # Find the name field\n element.send_keys(\"Michael\")\n element = @driver.find_element(:id,'group_310473641_1') # Select the \"Yes\" checkbox\n element.click\n element.submit\n element = @driver.find_element(:class,'ss-resp-message')\n assert_equal(element.text,\"Your response has been recorded.\")\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def initialize\n # Wait for the page to be displayed with 30 seconds timeout\n raise 'The page was not loaded' unless self.displayed?(30)\n end", "def test_find_contact_load\n @driver.get(@baseURL)\n @Nexa_Util.loginAsNormalUser(@driver)\n # Click at Contacts link Top Nav\n @driver.find_element(:link_text, 'Contacts').click\n @driver.find_element(:css, '#simpleSearchContactForm > table > tbody > tr:nth-child(3) > td.valueLabel > input[type=\"text\"]').send_keys 'Lisa'\n waitForPageFullyLoaded(20);\n @start = Time.now\n @driver.find_element(:css, '#simpleSearchContactForm > table > tbody > tr:nth-child(12) > td:nth-child(2) > table > tbody > tr > td.textButton2014').click\n # @wait.until { @driver.find_element(:class, 'standardTable') }\n waitForPageFullyLoaded(20);\n @stop = Time.now\n @sitePerformance.puts \"Page load time 'Find Contacts': #{@Nexa_Util.time_diff_milli(@start, @stop)}\"\n assert_operator 15000.00, :>, @Nexa_Util.time_diff_milli(@start, @stop)\n end", "def verifySignupPageTitle\n pageurl = $browser.url\n if (pageurl.eql?\"https://www.slideshare.net/w/signup\")\n puts \"Signup page URL matched\"\n else puts \"Signup page URL mismatched\"\n end\n end", "def wait_for_url(url)\n browser.wait_until(timeout: 5, message: \"URL did not become `#{url}`\") {\n browser.url.include? url\n }\n end" ]
[ "0.78336734", "0.73089623", "0.7136873", "0.7093599", "0.70578", "0.7016747", "0.69566554", "0.6863478", "0.67435616", "0.673521", "0.673521", "0.66841877", "0.66180944", "0.66152716", "0.65859807", "0.6542829", "0.6514236", "0.6514236", "0.65136313", "0.6485004", "0.64152056", "0.6371447", "0.63472646", "0.6311459", "0.6305167", "0.63042635", "0.62645817", "0.62149", "0.62023646", "0.6175943", "0.6148697", "0.6144031", "0.6134414", "0.6130172", "0.61041224", "0.6100974", "0.604989", "0.60387456", "0.6032627", "0.60308915", "0.6011766", "0.60065514", "0.6004716", "0.59932685", "0.59915036", "0.59767115", "0.59590864", "0.59459555", "0.59391475", "0.59329337", "0.5927972", "0.5921041", "0.5912912", "0.590597", "0.5905238", "0.5880045", "0.587807", "0.587277", "0.5863627", "0.5839656", "0.5838942", "0.58272", "0.58033544", "0.5802767", "0.57982576", "0.5784028", "0.5776529", "0.5774707", "0.5753037", "0.5747564", "0.5747564", "0.5739493", "0.5739439", "0.5734313", "0.5716151", "0.5713646", "0.5713646", "0.57036114", "0.5702496", "0.56879526", "0.56716096", "0.5668285", "0.56629205", "0.56618786", "0.5661864", "0.56597656", "0.5657524", "0.5657524", "0.56505203", "0.5647459", "0.5647459", "0.5647459", "0.5647459", "0.5647459", "0.5647459", "0.5647459", "0.5647459", "0.5646029", "0.5632808", "0.56282234" ]
0.86563647
0
check the page for any abnormalities and verify text
def check_page_and_verify_text(text) #check_page(@selenium.find_element(:id, "body").text) verify_text(text) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_page(page)\n validator = MarkupValidator.new\n results = validator.validate_text(page)\n return unless results.errors.length > 0\n results.errors.each do |err|\n fail(\"Error #{err.message} on page #{page.current_url}\")\n end\nend", "def check_page(page)\n # -- if error is found, it will dump first 2000 characters of the page to the screen\n raise \"-- [ERROR] User name incorrect !\\n\\n\" if /User name or password is incorrect/.match(page)\n if /An Error Occurred/.match(page)\n p (\"-- Error occured, dumping partial stack trace to the screen...\")\n page[0,2000].each { |s| p s } if page.length >= 2000\n raise \"-- [ERROR] Exception occured !\\n\\n\"\n end\n end", "def is_on_page? page_text, negation = ''\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 5) { has_text? page_text }\n # If negation is not nil, we should raise an error if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil, otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n raise \"Unexpected Page. The page should not have: '#{page_text}'\" if should_not_have_exception\n raise \"Unexpected Page. Expected was: '#{page_text}'\" if should_have_exception\n end", "def wait_for_page_and_verify_text(text)\n @selenium.wait_for_page_to_load(120000)\n check_page_and_verify_text(text)\n end", "def verify_browser_text (browsertext)\n\t\t@browser.text.include? (browsertext)\n\tend", "def guessing?\n ! page.has_content?(\"Your Results\")\n end", "def page_title_is_correct\n ( text =~ self.class.page_title_validation_value ) !=nil\n end", "def is_on_page?(page_text, negation = '')\n fail 'Página inesperada. Entre com uma mensagem válida' if\n page_text.to_s == ''\n\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 10) { has_text? page_text }\n # If negation is not nil, we should raise an error\n # if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil,\n # otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n\n fail \"Página inesperada. A página não contém: '#{page_text}'\" if\n should_not_have_exception\n\n fail \"Página inesperada. Era esperado: '#{page_text}'\" if\n should_have_exception\n\n true\n end", "def is_on_page?(page_text, negation = '')\n fail 'Página inesperada. Entre com uma mensagem válida' if\n page_text.to_s == ''\n\n should_not_have_exception = false\n should_have_exception = false\n begin\n wait_for(timeout: 5) { has_text? page_text }\n # If negation is not nil, we should raise an error\n # if this message was found on the view\n should_not_have_exception = true unless negation == ''\n rescue\n # only raise exception if negation is nil,\n # otherwise this is the expected behaviour\n should_have_exception = true if negation == ''\n end\n\n fail \"Página inesperada. A página não contém: '#{page_text}'\" if\n should_not_have_exception\n\n fail \"Página inesperada. Era esperado: '#{page_text}'\" if\n should_have_exception\n\n true\n end", "def text_is_on_page(text, timeout = WAITING_TIMEOUT)\n self.wait_until(timeout, \"\\n\\nERROR! Text '#{text}' was not found after #{timeout} seconds of waiting!\\n\") do\n self.text.include? text\n end\n end", "def verify_text?(browser_handle, text)\n browser_handle.text.include?(text)\nend", "def enough_text_detected?\n text_length = @pages.inject(0) {|sum, page| sum + page[:text].length }\n text_length > (@pages.length * 100)\n end", "def verify_tooltip(text)\n return @page.has_content?(text)\n end", "def verify_persinfo\n\t\t@browser.url == \"https://www.autogravity.com/credit/application/personal\"\n\t\t@browser.div(:visible_text, /Personal Information$/).present?\n\tend", "def multi_source_text_check(texts)\n texts.each do |text|\n page_text = $driver.page_source\n page_text.gsub!(/<[^>]*>/, '')\n page_text.gsub!(/\\s+/, ' ')\n page_text.should include( text )\n print \".\"\n end\n end", "def pageContainsText( text , frameName = \"\" , showResult = true)\n\n container = getObjectFrameReference( text , frameName )\n retryCount = 0\n begin \n t = container.body.innerText \n #puts t\n rescue => e\n # we sometimes get exceptions here... My guess is its something to do with load times.\n retryCount = retryCount +1\n if retryCount < 2\n log showException(e)\n sleep 0.5\n retry\n end\n end\n #log \"\\n------------------ #{frameName} ------------------\\n\"\n #log t\n #log \"\\n-----------------------------------------------\\n\"\n\n if ( t =~ /#{text}/ ) != nil\n log \"pageContainsText: Looking for: #{text} - found it ok\" unless showResult == false if $debuglevel >=0\n return true\n else\n log \"pageContainsText: Looking for: #{text} - Didnt Find it\" unless showResult == false\n return false\n end\n end", "def assert_text_on_screen(validation_msg)\n\t\tsleep(2)\n\t\tputs \"#{validation_msg}\"\n\t\ttext_from_screen=query(\"*\", \"text\")\n\t\telement_present=text_from_screen.include? validation_msg\n\t\tassert_equal true, element_present\n\tend", "def ValidateCandidate()\n if ($driver.find_element(:tag_name => \"body\").text.include?(\"No result has been found\")) == true\n raise VerificationException.new(COLOR_RED + \"Text not matching. Check screenshot under features->Screenshots->#{ENV['CHANNEL']})\\n\")\n else\n puts \"match found\"\n end\nend", "def pagehead(browser)\n puts \"inside pagehead\"\n #\tChecking for text in a page\n\t text1='WordPress Updates'\n\t if browser.text.include?(text1)\n\t puts text1+\" exists\"\n\t end\nend", "def text_not_search (string,text)\n\tif $browser.text.include? string \n\t\tputs \"Error: #{text} should not be present\"\n\tend\nend", "def check_xml(html)\n doc = Hpricot.XML(html)\n \terrors = doc.search(\"*[@errCode]\")\n \tif errors.size > 0\n \t\terrors.each do |error|\n \t\t\traise error[:errCode]\n \t\tend\n \telsif (doc%'page').nil?\n \t\traise \"EmptyPage (#{url})\"\n \telse\n \t\treturn true\n \tend\n end", "def verify_landing_page\n @higgs.page_title_present?('Puppet Enterprise Installer')\n @higgs.link_present?('email the CEO.')\n @higgs.select_link(\"Let's get started\")\n @higgs.page_title_present?('Puppet Enterprise Installer - Choose your deployment')\n end", "def verify_markup_options; end", "def validate_text(text)\n res = nil\n Tempfile.open \"html5_validator\" do |file|\n file.write text\n file.rewind\n res = validate_file file\n end\n res\n end", "def verifySignupPageTitle\n pageurl = $browser.url\n if (pageurl.eql?\"https://www.slideshare.net/w/signup\")\n puts \"Signup page URL matched\"\n else puts \"Signup page URL mismatched\"\n end\n end", "def verify_page?(key, exit = true)\n base_title = wait_for_title(exit)\n puts \"Verify Title - Desired Prefix: #{site.get_title(key)} => Full Title: #{page_title}\" if exit\n if site.get_title(key) != base_title\n fail(\"Page title does not match expected result. EXPECTED: #{site.get_title(key)} FOUND: #{page_title}\") if exit\n return false\n end\n return true\n end", "def guard_text( text )\n # todo/fix 2: note we need to differentiate between blocks and inline\n # thus, to avoid runs - use guard_block (add a leading newline to avoid getting include in block that goes before)\n \n # todo/fix: remove wrap_markup; replace w/ guard_text\n # why: text might be css, js, not just html\n \n ### !!!!!!!!!!!!\n ## todo: add print depreciation warning\n \n wrap_markup( text )\n end", "def want_involved_text_is_not_displayed\n\n page.should_not have_content(read_file_content(WANT_TO_GET_INVOLVED_TEXT_PATH))\n\n end", "def verify_admission_preview(options={})\n texts = get_text(\"css=#content\")\n texts.include?(options[:acct_class])== true\n #texts.include?(options[:patient]) == true\n #texts.include?(options[:pin]) == true\n #texts.include?(options[:nursing_display]) == true\n # (texts.include?(options[:package])) == true if options[:package] != \"Select Package\"\n (texts.include?(options[:diagnosis])) == true\n (texts.include?(options[:mobilization])) == true\n #texts.include?(options[:nursing_display]) == true\n (texts.include?(options[:guarantor_type])) == true\n end", "def should_see(text)\n expect(page).to have_content(text)\n end", "def should_spit_text?\n @tags_chain.size > 0 && \n #(not @text.empty?) &&\n [\"body\", \"p\", \"br\", \"b\", HTMLConvertor.ping_tag].include?(@tags_chain.last[:name])\n end", "def verifyStoryAdminLinks()\n\t\n\tputs \"************** START: Verify PRO page Links ****************\"\n\t\n\tputs \"Step 1 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Tell Your Story\")\n\t\tputs \"Step 1 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 3 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Set Up a Matching Grant\")\n\t\tputs \"Step 3 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\t\n\tputs \"Step 6 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 6 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify PRO page Links ****************\"\n\t\nend", "def validate_html\n @page.html.should be_valid_xhtml\n rescue RSpec::Expectations::ExpectationNotMetError\n # add exception to AcceptanceTesting.html_errors\n # which will be asserted in After hook\n Testing.html_errors << $!\n end", "def correction_existent_check\n # Check first if there is a correction\n page_content = PageContent.where(:page_id => self.id).where(:content_type => 'correction').order(id: :asc).last\n\n # If there isn't a correction,\n # Go to the ocr or text extraction\n if !page_content \n page_content = PageContent.where(:page_id => self.id).first\n end\n\n return page_content\n end", "def validate_text(text)\n return validate({:content => text})\n end", "def validate_html(html_str)\n resp = Net::HTTP.start('validator.w3.org') do |http|\n http.post '/nu/?out=text', html_str, 'Content-Type' => 'text/html; charset=utf-8'\n end\n resp.value # raise error if not 2xx\n unless resp.body.rstrip.end_with?(\"\\nThe document validates according to the specified schema(s) and to additional constraints checked by the validator.\")\n lines = []\n html_str.lines.each_with_index do |line, i|\n lines << \"#{i + 1}\\t#{line}\"\n end\n $stderr.puts \"Invalid HTML:\\n\\n#{lines.join}\\n\\n#{resp.body.force_encoding('utf-8')}\"\n fail \"Invalid HTML\"\n end\nend", "def verifyNPOAdminLinks(story_name)\n\t\n\tputs \"************** START: Verify ORG page Links ****************\"\n\t\n\tputs \"Click on MY NPO link at the Header.\"\n\tbegin \n\t\tassert $browser.is_element_present(\"link=My nonprofit\")\n\t\t$browser.click \"link=My nonprofit\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(story_name)\n\t\t\tputs \"Step 1 is Passed. User has reached the MY NPO screen successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 1 is Failed. User had failed to reach MY NPO screen.\"\n\t\tend\n\trescue\n\t\t$browser.click \"link=My nonprofits\"\n\t\t$browser.wait_for_page_to_load\n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"News Feed\")\n\t\t\tputs \"Step 1 is Passed. User has reached the Account screen successfully.\"\n\t\t\t$browser.click \"link=Harvard College\"\n\t\t\t$browser.wait_for_page_to_load\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 1 is Failed. User had failed to reach Account screen.\"\n\t\tend\n\tend \n\tsleep 5\n\tputs \"Step 2 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Tell Your Story\")\n\t\tputs \"Step 2 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Matching Grant\")\n\t\tputs \"Step 4 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 8 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 8 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 8 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\t# ------------------------------ Global Admin Links -----------------------------\n\tbegin \n\t\tassert $browser.is_element_present(\"link=Razoo Admins\")\n\t\tputs \"Step 10 : Click on Create Data Sources link on the Story page.\"\n\t\t$browser.click \"link=Data Sources\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"Razoo Admin Area\")\n\t\t\tputs \"Step 10 is Passed. User has reached the Data Sources screen successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 10 is Failed. User had failed to reach Data Sources screen.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\t\tputs \"Step 11 : Click on Create Audits link on the Story page.\"\n\t\t$browser.click \"link=Audits\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"PATRIOT Act\")\n\t\t\tputs \"Step 11 is Passed. User has reached the Audits screen successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 11 is Failed. User had failed to reach Audits screen.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\trescue\n\t\tputs \"Step 10 & 11 : I don't have access to view Data Sources and Audit links.\"\n\tend\n\t# ------------------------------ Global Admin Links -----------------------------\n\n\t\n\tputs \"************** END: Verify ORG page Links ****************\"\n\nend", "def validate_profile(page, first_name, last_name, employer, title)\n full_name = I18n.transliterate(\"#{first_name} #{last_name}\").alnum\n return false unless page.at_css(\"#name\")\n profile_name = I18n.transliterate(page.at_css(\"#name\").text).alnum\n puts '############# ACCESS GRANTED ############'\n puts profile_name\n return false unless page.css(\"#experience .positions .position\")\n positions = page.css(\"#experience .positions .position\")\n match = false\n unless split_string_comp(profile_name, full_name) == true\n return match\n end\n positions.each do |position|\n begin\n if position.at_css(\"header .item-title a\") && position.at_css(\"header .item-subtitle\")\n profile_title = I18n.transliterate(position.at_css(\"header .item-title a\").text).alnum\n profile_employer = I18n.transliterate(position.at_css(\"header .item-subtitle\").text).alnum\n title = I18n.transliterate(title).alnum\n employer = I18n.transliterate(employer).alnum\n if split_string_comp(profile_title, title) && split_string_comp(profile_employer, employer)\n match = true\n end\n end\n rescue Exception => e\n puts e\n end\n end\n return match\nend", "def check_page_source_match(string)\n $driver.page_source.should =~ Regexp.new(string, Regexp::MULTILINE)\n end", "def verify_page(page_title=nil, page_url=nil)\n if page_title\n raise \"Title of the page is not #{page_title}\" unless self.title == page_title\n elsif page_url\n raise \"URL of the page does not contain #{page_url}\" unless self.current_url.to_s.include?(page_url.downcase)\n else\n raise \"Provide either title or part of url to verify page\"\n end\n end", "def text_search (string,text)\n\tif !$browser.text.include? string \n\t\tputs \"Error: #{text} not found\"\n\tend\nend", "def test_get_page_content\r\n t = AuthorInfo.get_page({\"parse\" => {\"text\" => {\"*\" => \"some content\"}}})\r\n assert_equal(true, t === \"some content\")\r\n end", "def test_ID_25842_edit_profile_a_little_more_about_me\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_me_text_optional\n verify_text_can_be_entered_saved_on_little_more_about_me\n end", "def test_ID_25842_edit_profile_a_little_more_about_me\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_me_text_optional\n verify_text_can_be_entered_saved_on_little_more_about_me\n end", "def has_text?; end", "def scrape_text\n\n end", "def error_page?\n popup_msg = get_el(doc.css('div#outsidecontainer'))\n return false if popup_msg.nil?\n return false if popup_msg.css('@style').to_s.match('display: none')\n return true if popup_msg.to_s.match(/error/i)\n return false\n end", "def verifyNPOAdminLinks(story_name)\n\t\n\tputs \"************** START: Verify ORG page Links ****************\"\n\t\n\tputs \"Step 1 : Click on MY NPO link at the Header.\"\n\t$browser.click \"link=My NPO\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(story_name)\n\t\tputs \"Step 1 is Passed. User has reached the MY NPO screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach MY NPO screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 2 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit Page\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 2 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\n\tputs \"Step 3 : Click on Thumbnail link on the Story page.\"\n\t$browser.click \"link=Thumbnail\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Current Thumbnail\")\n\t\tputs \"Step 3 is Passed. User has reached the Thumbnail screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach Thumbnail screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Grantor\")\n\t\tputs \"Step 4 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 5 : Click on NPO Details link on the Story page.\"\n\t$browser.click \"link=NPO Details\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Charity Logo:\")\n\t\tputs \"Step 5 is Passed. User has reached the NPO Details screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 is Failed. User had failed to reach NPO Details screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 6 : Click on Promote link on the Story page.\"\n\t$browser.click \"link=Promote\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Or get a donation button to put on your website\")\n\t\tputs \"Step 6 is Passed. User has reached the Promote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach Promote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 7 : Click on DonateAnywhere link on the Story page.\"\n\t$browser.click \"link=DonateAnywhere\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"DonateAnywhere\")\n\t\tputs \"Step 7 is Passed. User has reached the DonateAnywhere screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 7 is Failed. User had failed to reach DonateAnywhere screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 8 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 8 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 8 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 9 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Disbursements\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Disbursements\")\n\t\tputs \"Step 9 is Passed. User has reached the Disbursements screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 9 is Failed. User had failed to reach Disbursements screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\t# ------------------------------ Global Admin Links -----------------------------\n\tbegin \n\t\tassert $browser.is_element_present(\"link=Data Sources\")\n\t\tputs \"Step 10 : Click on Create Data Sources link on the Story page.\"\n\t\t$browser.click \"link=Data Sources\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"Razoo Admin Area\")\n\t\t\tputs \"Step 10 is Passed. User has reached the Data Sources screen successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 10 is Failed. User had failed to reach Data Sources screen.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\t\tputs \"Step 11 : Click on Create Audits link on the Story page.\"\n\t\t$browser.click \"link=Audits\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"PATRIOT Act\")\n\t\t\tputs \"Step 11 is Passed. User has reached the Audits screen successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 11 is Failed. User had failed to reach Audits screen.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\trescue\n\t\tputs \"Step 10 & 11 : I don't have access to view Data Sources and Audit links.\"\n\tend\n\t# ------------------------------ Global Admin Links -----------------------------\n\t\n\tputs \"Step 12 : Click on Create Project link on the Story page.\"\n\t$browser.click \"link=Create Project\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 12 is Passed. User has reached the Create Project screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 12 is Failed. User had failed to reach Create Project screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify ORG page Links ****************\"\n\nend", "def verifyNPOAdminLinks(story_name)\n\t\n\tputs \"************** START: Verify ORG page Links ****************\"\n\t\n\tputs \"Step 1 : Click on MY NPO link at the Header.\"\n\t$browser.click \"link=My NPO\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(story_name)\n\t\tputs \"Step 1 is Passed. User has reached the MY NPO screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach MY NPO screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 2 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit Page\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 2 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\n\tputs \"Step 3 : Click on Thumbnail link on the Story page.\"\n\t$browser.click \"link=Thumbnail\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Current Thumbnail\")\n\t\tputs \"Step 3 is Passed. User has reached the Thumbnail screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach Thumbnail screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Grantor\")\n\t\tputs \"Step 4 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 5 : Click on NPO Details link on the Story page.\"\n\t$browser.click \"link=NPO Details\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Charity Logo:\")\n\t\tputs \"Step 5 is Passed. User has reached the NPO Details screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 is Failed. User had failed to reach NPO Details screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 6 : Click on Promote link on the Story page.\"\n\t$browser.click \"link=Promote\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Or get a donation button to put on your website\")\n\t\tputs \"Step 6 is Passed. User has reached the Promote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach Promote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 7 : Click on DonateAnywhere link on the Story page.\"\n\t$browser.click \"link=DonateAnywhere\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"DonateAnywhere\")\n\t\tputs \"Step 7 is Passed. User has reached the DonateAnywhere screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 7 is Failed. User had failed to reach DonateAnywhere screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 8 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 8 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 8 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 9 : Click on Disbursements link on the Story page.\"\n\t$browser.click \"link=Disbursements\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Disbursements\")\n\t\tputs \"Step 9 is Passed. User has reached the Disbursements screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 9 is Failed. User had failed to reach Disbursements screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\t# ------------------------------ Global Admin Links -----------------------------\n\tbegin \n\t\tassert $browser.is_element_present(\"link=Data Sources\")\n\t\tputs \"Step 10 : Click on Create Data Sources link on the Story page.\"\n\t\t$browser.click \"link=Data Sources\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"Razoo Admin Area\")\n\t\t\tputs \"Step 10 is Passed. User has reached the Data Sources screen successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 10 is Failed. User had failed to reach Data Sources screen.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\t\tputs \"Step 11 : Click on Create Audits link on the Story page.\"\n\t\t$browser.click \"link=Audits\"\n\t\t$browser.wait_for_page_to_load \n\t\tbegin\n\t\t\tassert $browser.is_text_present(\"PATRIOT Act\")\n\t\t\tputs \"Step 11 is Passed. User has reached the Audits screen successfully.\"\n\t\trescue Test::Unit::AssertionFailedError\n\t\t\tputs \"Step 11 is Failed. User had failed to reach Audits screen.\"\n\t\t\t$verification_errors << $!\n\t\tend\n\trescue\n\t\tputs \"Step 10 & 11 : I don't have access to view Data Sources and Audit links.\"\n\tend\n\t# ------------------------------ Global Admin Links -----------------------------\n\t\n\tputs \"Step 12 : Click on Create Project link on the Story page.\"\n\t$browser.click \"link=Create Project\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 12 is Passed. User has reached the Create Project screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 12 is Failed. User had failed to reach Create Project screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify ORG page Links ****************\"\n\nend", "def confirm_gift_message_warning()\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n wait_for_landing_page_load\n gift_messsage_error.should_exist\n invalid_gc_msg = gift_messsage_error.inner_text\n invalid_gc_msg.should match(\"Gift message cannot exceed 50 characters\")\n end", "def verifyStoryAdminLinks()\n\t\n\tputs \"************** START: Verify PRO page Links ****************\"\n\t\n\tputs \"Step 1 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit Page\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 1 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\n\tputs \"Step 2 : Click on Thumbnail link on the Story page.\"\n\t$browser.click \"link=Thumbnail\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Current Thumbnail\")\n\t\tputs \"Step 2 is Passed. User has reached the Thumbnail screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach Thumbnail screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 3 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Grantor\")\n\t\tputs \"Step 3 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on Promote link on the Story page.\"\n\t$browser.click \"link=Promote\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Or get a donation button to put on your website\")\n\t\tputs \"Step 4 is Passed. User has reached the Promote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach Promote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 5 : Click on DonateAnywhere link on the Story page.\"\n\t$browser.click \"link=DonateAnywhere\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"DonateAnywhere\")\n\t\tputs \"Step 5 is Passed. User has reached the DonateAnywhere screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 is Failed. User had failed to reach DonateAnywhere screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 6 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 6 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify PRO page Links ****************\"\n\t\nend", "def verifyStoryAdminLinks()\n\t\n\tputs \"************** START: Verify PRO page Links ****************\"\n\t\n\tputs \"Step 1 : Click on EditPage link on the Story page.\"\n\t$browser.click \"link=Edit Page\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Basics\")\n\t\tputs \"Step 1 is Passed. User has reached the EditPage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach EditPage screen.\"\n\t\t$verification_errors << $!\n\tend\n\n\tputs \"Step 2 : Click on Thumbnail link on the Story page.\"\n\t$browser.click \"link=Thumbnail\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Current Thumbnail\")\n\t\tputs \"Step 2 is Passed. User has reached the Thumbnail screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach Thumbnail screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 3 : Click on Matching Grants link on the Story page.\"\n\t$browser.click \"link=Matching Grants\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Grantor\")\n\t\tputs \"Step 3 is Passed. User has reached the Matching Grants screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach Matching Grants screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on Promote link on the Story page.\"\n\t$browser.click \"link=Promote\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Or get a donation button to put on your website\")\n\t\tputs \"Step 4 is Passed. User has reached the Promote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach Promote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 5 : Click on DonateAnywhere link on the Story page.\"\n\t$browser.click \"link=DonateAnywhere\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"DonateAnywhere\")\n\t\tputs \"Step 5 is Passed. User has reached the DonateAnywhere screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 is Failed. User had failed to reach DonateAnywhere screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 6 : Click on Donations link on the Story page.\"\n\t$browser.click \"link=Donations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donations Listing\")\n\t\tputs \"Step 6 is Passed. User has reached the Donations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach Donations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify PRO page Links ****************\"\n\t\nend", "def page_ok?(config, url)\n uri = URI.parse(url) rescue nil\n (uri.respond_to?(:host) && uri.host =~ config[\"host_re\"] &&\n uri.respond_to?(:path) && uri.path !~ %r{^/b/}).tap do |result|\n if !result\n puts \"Rejecting page #{url} for key #{config[\"key\"]}\"\n end\n end\n end", "def valid_page page\n # ignore case\n if page\n page.downcase!\n else\n return false\n end\n # verify page name\n exists = false\n if page == 'about'\n exists = true\n end\n if page == 'contact'\n exists = true\n end\n if page == 'welcome'\n exists = true\n end\n if page == 'info'\n exists = true\n end\n return exists\n end", "def check_if_the_text_is_displayed_on_want_to_get_involved\n\n page.should have_content(read_file_content(WANT_TO_GET_INVOLVED_TEXT_PATH))\n\n end", "def validate_html_input\n begin\n l = params[:low_ch].to_i\n h = params[:high_ch].to_i\n channel_list = (l..h).to_a \n blocked_list = params[:blocked_list].split(\" \").map { |e| e.to_i }\n @viewable_list = channel_list - blocked_list\n @browse_list = params[:view_sequence].split(\" \").map { |e| e.to_i }\n rescue Exception => e\n end\n end", "def verify_interactive_content\n key = random_string\n while Questionnaire.find_by(key: key)\n key = random_string\n end\n questionnaire = Questionnaire.new(name: key, key: key, content: @raw_questionnaire_content)\n return if questionnaire.valid?\n\n render status: :bad_request, json: { error: questionnaire.errors }\n end", "def sanitize_text(text)\n doc = Nokogiri::HTML.fragment(text)\n UNSUPPORTED_HTML_TAGS.each do |tag|\n doc.search(tag).each(&:remove)\n end\n doc.inner_html\n end", "def check_site\n\t\t\tpage = @agent.get(@page[:url])\n\t\t\traise \"got redirected on #{@page[:name]}\" if redirect?\n\n\t\t\tdoc = Nokogiri::HTML(page.parser.to_s)\n\t\t\tnodes_with_euros = doc.search(\"//text()[contains(.,'€')]\")\n\t\t\tcontainers_array = []\n\t\t\traise \"no euros found #{@page[:name]}\" if nodes_with_euros == []\n\n\t\t\t# Previous version was with ruby, now xpath, less code. \n\t\t\tcontainers_array = nodes_with_euros.collect { |node| node.ancestors(\"//table | //div\").first } unless @page[:search_string]\n\n\t\t\tif @page[:search_string]\n\t\t\t\t#remove escapes\n\t\t\t\t@page[:search_string].gsub!(/\\\\/) { ''}\n\t\t\t\tcontainers_array << doc.search(\"//text()[contains(.,#{@page[:search_string]})]\").first\n\t\t\tend\n\n\t\t\t#Nodeset is an array, but doesn't act like one, really annoying.\n\t\t\tcontainers_nodeset = Nokogiri::XML::NodeSet.new(doc)\n\t\t\tcontainers_freqs = containers_array.inject(Hash.new(0)) { |h,v| h[v] += 1; h}\n\t\t\t\n\t\t\t# Refactored from double block\n\t\t\tcontainers_nodeset = containers_freqs.collect { |node,freq| freq > 1 ? node : nil }\n\t\t\tcontainers_nodeset.uniq!\n\t\t\traise \"no hits found in #{@page[:name]}\" if (containers_nodeset.empty? || containers_nodeset == [nil])\n\n\t\t\twrite_to_file(containers_nodeset)\n\t\t\t\n\t\trescue Timeout::Error => e\n\t\t\t# Only occures when site is down or script runs too often. So we try again once, then bail\n\t\t\tretry if @retry\n\t\t\t@retry = false\n\t\t\traise\n\t\trescue => e\n\t\t\thandle_me(e)\n\t\tend", "def test_text_is_present\n @selenium.open \"/\"\n assert @selenium.text? \"Advanced Search\"\n end", "def check_pages\n if pages.length > 0\n return false\n end\n return true\n end", "def check_exist_text(text)\n puts text\n if text.length > 0\n q = query(\"* text:'#{text}'\")\n while q.empty?\n performAction('scroll_down')\n q = query(\"* text:'#{text}'\")\n end\n check_element_exists(\"* text:'#{text}'\")\n end\nend", "def validate_text(text)\n response = RestClient.post \"#{BASE_URI}/?out=json\", text, HEADERS\n @json = JSON.parse(response.body)\n @errors = retrieve_errors\n end", "def validate_text(text)\n return validate({:rawdata => text})\n end", "def test_00010_profanity_blocker\n \t@loginpage.login($user1)\n enable_profanity_blocker($networkslug, true)\n #check community post\n title_before = \"watir test profanity blocker - #{get_timestamp}\"\n title_after = PageObject.new(@browser).create_conversation($network, $networkslug, \"A Watir Topic\", \"discussion\", title_before, false)\n title_before[\"test profanity\"] = \"**** *********\"\n assert title_before == title_after\n # comment_root_post\n # reply_to_comment\n # #check hybris post\n # create_post_from_hybris\n enable_profanity_blocker($networkslug, false)\n title2_before = \"watir test profanity blocker - #{get_timestamp}\"\n title2_after = PageObject.new(@browser).create_conversation($network, $networkslug, \"A Watir Topic\", \"question\", title2_before, false)\n assert title2_before == title2_after\n end", "def validate_profile(page, first_name, last_name, employer, title)\n full_name = I18n.transliterate(\"#{first_name} #{last_name}\").alnum\n profile_name = I18n.transliterate(page.at_css(\"#name\").text).alnum\n puts '############# ACCESS GRANTED ############'\n puts profile_name\n positions = page.css(\"#experience .positions .position\")\n match = false\n unless split_string_comp(profile_name, full_name) == true\n return match\n end\n positions.each do |position|\n if position.at_css(\"header .item-title a\") && position.at_css(\"header .item-subtitle\")\n profile_title = I18n.transliterate(position.at_css(\"header .item-title a\").text).alnum\n profile_employer = I18n.transliterate(position.at_css(\"header .item-subtitle\").text).alnum\n title = I18n.transliterate(title).alnum\n employer = I18n.transliterate(employer).alnum\n if split_string_comp(profile_title, title) && split_string_comp(profile_employer, employer)\n match = true\n end\n end\n end\n return match\nend", "def scrape_text\n raise(Scraper::Exceptions::NotImplemented, \"Not implemented\")\n end", "def is_text_present(ele)\n $log.info \"verifying #{ele} present or not\"\n if s=$browser.button(:id, \"#{ele}\").exists?\n $log.info \"{ele} available on the page\"\n elsif\n $log.info \"failed to find the element: #{ele}!\"\n raise Exception.new(\"Failed to find the element: #{ele}!\")\n end\n \nend", "def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end", "def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end", "def confirm_pur_number_warning()\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n wait_for_landing_page_load\n gsm_error_message.should_exist\n invalid_gc_msg = gsm_error_message.inner_text\n invalid_gc_msg.should match(\"Please enter a valid loyalty card number\")\n end", "def check_page_title(text)\n $driver.title.should == text\n end", "def does_not_include_badwords\n\n badwords = %w(\n aloha!\n href=\n -online\n 1freewebspace.com\n 4u\n 5gighost.com\n accutane\n adipex\n adultsex\n advicer\n alprazolam\n amoxil\n arcadepages\n arimidex\n associations.missouristate.edu\n ativan\n augmentin\n baccarrat\n baclofen\n beaver\n blackjack\n bllogspot\n blogs.blackmarble.co.uk\n blowjob\n booker\n buspar\n byob\n car-rental-e-site\n car-rentals-e-site\n carisoprodol\n casino\n casinos\n chatroom\n cialis\n cipro\n citalopram\n clomid\n clonazepam\n comment1\n comment2\n comment3\n comment4\n comment5\n comment6\n coolcoolhu\n coolhu\n credit-card-debt\n credit-report-4u\n creditonlinepersonalloans\n cwas\n cyclen\n cyclobenzaprine\n dating-e-site\n day-trading\n debt-consolidation\n debt-consolidation-consultant\n diazepam\n diovan\n discreetordering\n dostinex\n duty-free\n dutyfree\n dvxuser.com\n equityloans\n fanreach.com\n fioricet\n flagyl\n flowers-leading-site\n fosamax\n freenet\n freenet-shopping\n gambling-\n hair-loss\n health-insurancedeals-4u\n hi5.com\n holdem\n holdempoker\n holdemsoftware\n holdemtexasturbowilson\n homeequityloans\n homefinance\n hotel-dealse-site\n hotele-site\n hotelse-site\n hydrocodone\n hyves.mn\n incest\n insurance-quotesdeals-4u\n insurancedeals-4u\n isuzuforums.com\n jestmaster\n jizz\n jrcreations\n kaboodle.com\n kamagra\n klonopin\n lamictal\n lesbian\n levaquin\n levitra\n lezbian\n loans\n lorazepam\n lycos\n macinstruct\n metformin\n metronidazole\n mortgage-4-u\n mortgagequotes\n musicstation\n nojazzfest\n nolvadex\n online-gambling\n onlinegambling-4u\n ottawavalleyag\n ownsthis\n palm-texas-holdem-game\n paxil\n paydal\n penguinforum\n penis\n personalloansbad\n pharmacy\n phenergan\n phentermine\n poker-chip\n porn\n poze\n profiles.friendster.com\n propecia\n proscar\n pussy\n remeron\n rental-car-e-site\n ringtone\n ringtones\n roulette\n shemale\n shoes\n slot-machine\n Staphcillin\n tamiflu\n tegretol\n texas-holdem\n thorcarlson\n top-e-site\n top-site\n toprol\n toradol\n tramadol\n tramodal\n tramodol\n trim-spa\n ultram\n valeofglamorganconservatives\n valium\n viagra\n vibramycin\n vicodin\n vioxx\n voltaren\n vytorin\n xanax\n zantac\n zithromax\n zofran\n zolpidem\n zolus\n )\n badwords.each do |bw|\n if !comment.nil? && comment.downcase.include?(bw) \n errors.add_to_base(\"Comment Rejected\") \n break\n end\n end\n end", "def confirm_pur_number_warning_hops()\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n wait_for_landing_page_load\n invalid_number_error_hops.should_exist\n invalid_gc_msg = invalid_number_error_hops.inner_text\n invalid_gc_msg.should match(\"We're sorry but the loyalty card number you provided is not valid\")\n end", "def clean?\n return @hygiene > 7\n end", "def url_should_contain(text)\n raise(Exception::UrlMatchError, \"The URL #{@browser.url} is not correct; it should contain #{text}\") unless\n @browser.url.include?(text)\n end", "def _validate_homepage(h)\n if h =~ %r{http://EXAMPLE}\n results.add_warning('homepage', 'The homepage has not been updated' \\\n ' from default')\n end\n end", "def mm_verify(hash)\n\terror = \"\"\n\n\thash.each do |k,text|\n\t\ttext = CGI::escapeHTML(text)\n\n \tif text\n\n\t\t\tif text.include?(\"*-\")\n\t\t\t\telem = text.split(\"*-\")\n\t\t\t\telem.shift\n\t\t\t\telem.each do |bl|\n\t\t\t\t\tif !text.include?(\"-*\")\n\t\t\t\t\t\terror = \"Markdown error, missing -* close tag.\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif text.include?(\"[==\")\n\t\t\t\telem = text.split(\"[==\")\n\t\t\t\telem.shift\n\t\t\t\telem.each do |bl|\n\t\t\t\t\tif !text.include?(\"==]\")\n\t\t\t\t\t\terror = \"Markdown error, missing ==] close tag.\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif text.include?(\"[~~\")\n\t\t\t\telem = text.split(\"[~~\")\n\t\t\t\telem.shift\n\t\t\t\telem.each do |bl|\n\t\t\t\t\tif !text.include?(\"~~]\")\n\t\t\t\t\t\terror = \"Markdown error, missing ~~] close tag.\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif text.include?(\"[[[\")\n\t\t\t\telem = text.split(\"[[[\")\n\t\t\t\telem.shift\n\t\t\t\telem.each do |bl|\n\t\t\t\t\tif !text.include?(\"]]]\")\n\t\t\t\t\t\terror = \"Markdown error, missing ]]] close tag.\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\treturn error\nend", "def clean_text(text)\n text = strip_html_quote_entities(text)\n text = Helper::Text.strip_html_tags(text)\n text = strip_copyright_text(text)\n text.strip!\n text = Helper::Text.clean_verse_start(text)\n text = Helper::Text.clean_verse_end(text)\n end", "def validarHome()\n assert_text(\"Dashboard\")\n end", "def test_valley_smoketest\n @driver.get(@base_url)\n verify_home_page()\n verify_services_page()\n verify_about_page()\n verify_contact_page()\n verify_faq_page()\n verify_links_page()\n end", "def check_accessibility\n end", "def expect_page_to_not_have_content_with_uniquenumber(content)\n\n page.should_not have_content(content + read_file.to_s)\n\n end", "def thelper_assert_has_form_error\n assert page.has_css?('div#errorExplanation')\n end", "def contains_text(target)\r\n #puts \"Text to match is : #{match_text}\"\r\n #puts \"Html is : #{self.text}\"\r\n if target.kind_of? Regexp\r\n self.text.match(target)\r\n elsif target.kind_of? String\r\n self.text.index(target)\r\n else\r\n raise ArgumentError, \"Argument #{target} should be a string or regexp.\"\r\n end\r\n end", "def check_html_element(name, doc)\r\n elements = doc.css(name)\r\n process_tag(name, elements, \"text\")\r\n end", "def match_http_response_text(check,http_response_text)\n\n # first convert to intrigue uri format\n\n # grab headers\n header_part = http_response_text.split(/\\n\\n/).first\n body_part = http_response_text.split(/\\n\\n/).last\n\n headers = header_part.split(\"\\n\");\n body = body_part\n\n # TODO - fix to only grab content!!!!\n cookies = headers.select{|x| x =~ /^set-cookie:(.*)/i }\n\n ### grab the page attributes\n match = body.match(/<title>(.*?)<\\/title>/i)\n title = match.captures.first if match\n\n match = response.body.match(/<meta name=\\\"?generator\\\"? content=\\\"?(.*?)\\\"?\\/?>/i)\n generator = match.captures.first.gsub(\"\\\"\",\"\") if match\n\n # rest is a response\n # save title\n # save Cookies\n # save scripts ?\n data = {\n \"details\" => {\n \"hidden_response_data\" => body,\n \"headers\" => headers,\n \"cookies\" => cookies,\n \"generator\" => generator,\n \"title\" => title\n }\n }\n\n match_uri_hash(check,data)\n end", "def verifyAboutUsLinks()\n\t\n\tputs \"************** START: Verify AboutUs Links ****************\"\n\t\n\tputs \"Step 1 : Click on AboutRazoo Link at the Footer.\"\n\t$browser.click \"link=About Razoo\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo Overview\")\n\t\tputs \"Step 1 is Passed. User has reached the AboutRazoo screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 1 is Failed. User had failed to reach the About Razoo screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 2 : Click on Overview Link in AboutRazoo screen.\"\n\t$browser.click \"link=Overview\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Donate. Fundraise. Connect.\")\n\t\tputs \"Step 2 is Passed. User has reached the Overview screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 is Failed. User had failed to reach the Overview screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 3 : Click on CloserLook Link in AboutRazoo screen.\"\n\t$browser.click \"link=A Closer Look\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"A Closer Look\")\n\t\tputs \"Step 3 is Passed. User has reached the CloserLook screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 is Failed. User had failed to reach the CloserLook screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 4 : Click on OurTeam Link in AboutRazoo screen.\"\n\t$browser.click \"link=Our Team\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo is a vibrant social enterprise with an accomplished, fun, and diverse team.\")\n\t\tputs \"Step 4 is Passed. User has reached the OurTeam screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 is Failed. User had failed to reach the CloserLook screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 5 : Click on Careers Link in AboutRazoo screen.\"\n\t$browser.click \"link=Careers\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Careers at Razoo\")\n\t\tputs \"Step 5 is Passed. User has reached the Careers screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 is Failed. User had failed to reach the Careers screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 6 : Click on PressCoverage Link in AboutRazoo screen.\"\n\t$browser.click \"link=Press Coverage\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo often appears in both local and national press in recognition of our innovative website and approach to online giving and fundraising.\")\n\t\tputs \"Step 6 is Passed. User has reached the PressCoverage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 6 is Failed. User had failed to reach the PressCoverage screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 7 : Click on ContactUs Link in AboutRazoo screen.\"\n\t$browser.click \"link=Contact Us\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Contact Us\")\n\t\tputs \"Step 7 is Passed. User has reached the ContactUs screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 7 is Failed. User had failed to reach the ContactUs screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 8 : Click on AtGlance Link in AboutRazoo screen.\"\n\t$browser.click \"link=At A Glance\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"What We Offer - At A Glance\")\n\t\tputs \"Step 8 is Passed. User has reached the AtGlance screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 8 is Failed. User had failed to reach the AtGlance screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 9 : Click on ForIndividuals Link in AboutRazoo screen.\"\n\t$browser.click \"link=For Individuals\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo For Individuals\")\n\t\tputs \"Step 9 is Passed. User has reached the ForIndividuals screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 9 is Failed. User had failed to reach the ForIndividuals screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 10 : Click on ForNonProfits Link in AboutRazoo screen.\"\n\t$browser.click \"link=For Nonprofits\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo For Nonprofits\")\n\t\tputs \"Step 10 is Passed. User has reached the ForNonProfits screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 10 is Failed. User had failed to reach the ForNonProfits screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 11 : Click on ForFoundations Link in AboutRazoo screen.\"\n\t$browser.click \"link=For Foundations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo For Foundations\")\n\t\tputs \"Step 11 is Passed. User has reached the ForFoundations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 11 is Failed. User had failed to reach the ForFoundations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 12 : Click on ForCorporations Link in AboutRazoo screen.\"\n\t$browser.click \"link=For Corporations\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo For Corporations\")\n\t\tputs \"Step 12 is Passed. User has reached the ForCorporations screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 12 is Failed. User had failed to reach the ForCorporations screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 13 : Click on SuccessStories Link in AboutRazoo screen.\"\n\t$browser.click \"link=Success Stories\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Success Stories\")\n\t\tputs \"Step 13 is Passed. User has reached the SuccessStories screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 13 is Failed. User had failed to reach the SuccessStories screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 14 : Click on BestValue Link in AboutRazoo screen.\"\n\t$browser.click \"link=The Best Value\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Best Value\")\n\t\tputs \"Step 14 is Passed. User has reached the BestValue screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 14 is Failed. User had failed to reach the BestValue screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 15 : Click on EFT Link in AboutRazoo screen.\"\n\t$browser.click \"link=EFT\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"EFT Authorization Form for Nonprofits\")\n\t\tputs \"Step 15 is Passed. User has reached the EFT screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 15 is Failed. User had failed to reach the EFT screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 16 : Click on DonateAnywhere Link in AboutRazoo screen.\"\n\t$browser.click \"link=DonateAnywhere Widget\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The DonateAnywhere Widget\")\n\t\tputs \"Step 16 is Passed. User has reached the DonateAnywhere screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 16 is Failed. User had failed to reach the DonateAnywhere screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 17 : Click on EDP Link in AboutRazoo screen.\"\n\t$browser.click \"link=Enhanced Donation Processing\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Enhanced Donation Processing\")\n\t\tputs \"Step 17 is Passed. User has reached the EDP screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 17 is Failed. User had failed to reach the EDP screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 18 : Click on Tips Link in AboutRazoo screen.\"\n\t$browser.click \"link=Introducing Tips\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"tips\")\n\t\tputs \"Step 18 is Passed. User has reached the Tips screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 18 is Failed. User had failed to reach the Tips screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 19 : Click on Blog Link in AboutRazoo screen.\"\n\t$browser.click \"link=Blog on Razoo Impact\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Razoo Impact\")\n\t\tputs \"Step 19 is Passed. User has reached the Blog screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 19 is Failed. User had failed to reach the Blog screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 20 : Click on HowDonationsWork Link in AboutRazoo screen.\"\n\t$browser.click \"link=How Donations Work\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"How Donations Work\")\n\t\tputs \"Step 20 is Passed. User has reached the HowDonationsWork screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 20 is Failed. User had failed to reach the HowDonationsWork screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 21 : Click on FundraisingIdeas Link in AboutRazoo screen.\"\n\t$browser.click \"link=Fundraising Ideas\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Fundraising Ideas\")\n\t\tputs \"Step 21 is Passed. User has reached the FundraisingIdeas screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 21 is Failed. User had failed to reach the FundraisingIdeas screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 22 : Click on SetUpFR Link in AboutRazoo screen.\"\n\t$browser.click \"link=How to Setup a Fundraiser\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Create a Fundraising Page\")\n\t\tputs \"Step 22 is Passed. User has reached the SetUpFR screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 22 is Failed. User had failed to reach the SetUpFR screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 23 : Click on MakeYourPageGreat Link in AboutRazoo screen.\"\n\t$browser.click \"link=Make Your Page Great\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Make Your Page Great\")\n\t\tputs \"Step 23 is Passed. User has reached the MakeYourPageGreat screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 23 is Failed. User had failed to reach the MakeYourPageGreat screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 24 : Click on SharePromote Link in AboutRazoo screen.\"\n\t$browser.click \"link=Share and Promote Your Page\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Share and Promote your page\")\n\t\tputs \"Step 24 is Passed. User has reached the SharePromote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 24 is Failed. User had failed to reach the SharePromote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 25 : Click on Logos Link in AboutRazoo screen.\"\n\t$browser.click \"link=Logos\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"We've collected a few logos for your use.\")\n\t\tputs \"Step 25 is Passed. User has reached the SharePromote screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 25 is Failed. User had failed to reach the SharePromote screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 26 : Click on OurHomepage Link in AboutRazoo screen.\"\n\t$browser.click \"link=Get Featured on Our Homepage\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Getting Featured on Razoo\")\n\t\tputs \"Step 26 is Passed. User has reached the OurHomepage screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 26 is Failed. User had failed to reach the OurHomepage screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 27 : Click on FAQIndividuals Link in AboutRazoo screen.\"\n\t$browser.click \"link=FAQs for Individuals\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"FAQs for Individuals\")\n\t\tputs \"Step 27 is Passed. User has reached the FAQIndividuals screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 27 is Failed. User had failed to reach the FAQIndividuals screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 28 : Click on FAQNonProfits Link in AboutRazoo screen.\"\n\t$browser.click \"link=FAQs for Nonprofits\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"FAQs for Nonprofits\")\n\t\tputs \"Step 28 is Passed. User has reached the FAQNonProfits screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 28 is Failed. User had failed to reach the FAQNonProfits screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 29 : Click on Security Link in AboutRazoo screen.\"\n\t$browser.click \"link=Security\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Security and Privacy\")\n\t\tputs \"Step 29 is Passed. User has reached the Security screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 29 is Failed. User had failed to reach the Security screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 30 : Click on Privacy Link in AboutRazoo screen.\"\n\t$browser.click \"link=Privacy\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Razoo.com Privacy Policy\")\n\t\tputs \"Step 30 is Passed. User has reached the Privacy screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 30 is Failed. User had failed to reach the Privacy screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"Step 31 : Click on TOU Link in AboutRazoo screen.\"\n\t$browser.click \"link=Terms of Use\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"The Razoo.com Terms of Use\")\n\t\tputs \"Step 31 is Passed. User has reached the TOU screen successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 31 is Failed. User had failed to reach the TOU screen.\"\n\t\t$verification_errors << $!\n\tend\n\t\n\tputs \"************** END: Verify AboutUs Links ****************\"\n\nend", "def test_valid_fields\n\t page = pages(:valid_page)\n\t assert page.valid?\n\tend", "def check_html(str)\n str = str.downcase\n str.gsub! /\\s/, ''\n check_for = [ /<a/, /<p/, /http:/ ]\n\n check_for.inject(false) { |accum, cond| accum ||= (str =~ cond) }\nend", "def check?\n if (@entry.text == \"\")\n false\n else\n true\n end\n end", "def check?\n if (@entry.text == \"\")\n false\n else\n true\n end\n end", "def confirm_invalid_gc_warning()\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n wait_for_landing_page_load\n invalid_gc_label.should_exist\n invalid_gc_msg = invalid_gc_label.inner_text\n invalid_gc_msg.should match(\"Please enter a valid Gift Card number\")\n end", "def page_url_is_correct\n ( current_url =~ self.class.page_url_validation_value ) !=nil\n end", "def valid_url?(url)\n resp = Curl.get url\n\n if resp.body_str.include? @invalid_text\n return false\n else\n return true\n end\nend", "def verify_iss; end", "def verify_iss; end", "def sierra_856_perfect?\n @url == self.proper.proper_856_content\n end", "def assert_no_records_match\n sleep 2\n expect(@polaris.login_home_page.text).to include(\"No matching records found\")\n end", "def verifyPageIsReadOnly(text = nil)\n self.wait_until_read_only_badge_visible\n\n return read_only_badge.text == 'Read-Only'\n end" ]
[ "0.695017", "0.68800837", "0.6849128", "0.67428565", "0.6643247", "0.66249406", "0.65778935", "0.6534989", "0.6519632", "0.64491427", "0.6311761", "0.6300621", "0.6258856", "0.62335503", "0.6215988", "0.6199817", "0.6123763", "0.60646707", "0.5976177", "0.585029", "0.5847198", "0.58447546", "0.5835746", "0.58145964", "0.58053166", "0.57384425", "0.57270366", "0.57083905", "0.5675035", "0.5666097", "0.5662864", "0.5644811", "0.5642534", "0.5603766", "0.55953383", "0.55719596", "0.5570094", "0.556697", "0.55461806", "0.55402243", "0.5536746", "0.5521389", "0.55111635", "0.55111635", "0.5510559", "0.55025774", "0.5488197", "0.54837644", "0.54837644", "0.5478342", "0.5469915", "0.5469915", "0.54687417", "0.5466462", "0.5460158", "0.54593587", "0.54587567", "0.545458", "0.5453852", "0.5450382", "0.54465556", "0.5446466", "0.54352945", "0.5435217", "0.5421162", "0.5414453", "0.5408921", "0.5407627", "0.537021", "0.537021", "0.5360429", "0.5352302", "0.5345576", "0.5342575", "0.53320545", "0.53282875", "0.5326794", "0.53243047", "0.5322332", "0.5321731", "0.53206545", "0.53142506", "0.53115094", "0.5309791", "0.52961385", "0.52958673", "0.52940714", "0.52909225", "0.52882296", "0.5287448", "0.5284968", "0.5284968", "0.52845883", "0.5279341", "0.52705705", "0.526733", "0.526733", "0.52673155", "0.52613", "0.5255433" ]
0.7796433
0
click on something that needs a mouse over
def mouseover_and_click(method, element_over, element_click) p("-- clicking on element: " + element_click.to_s + " by " + method.to_s) @selenium.action.move_to(@selenium.find_element(method, element_over)).perform sleep 5 @selenium.find_element(method, element_click).click end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def click; end", "def click; end", "def click; end", "def clicked(mouse_event)\n end", "def hover_click(element)\n driver.action.click(element).perform\n end", "def click\r\n start_point = screen.find ident\r\n click_x = start_point.x + offset_x\r\n click_y = start_point.y + offset_y\r\n\r\n screen.click click_x, click_y\r\n end", "def click\n `#{@el}.click() || Opal.nil`\n end", "def click locator\r\n command 'click', locator\r\n end", "def click locator\r\n command 'click', locator\r\n end", "def hover_click(*args)\n if args.size == 1\n driver.action.click(element).perform\n else\n sym,id = args\n driver.action.click(driver.find_element(sym.to_sym,id)).perform\n end\n\n end", "def click\n @mech.click self\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def click\n raise \"Must implement custom click method.\"\n end", "def click(link); end", "def click\n Log.Trace(\"Clicking on #{@symbolicName}\")\n mouseClick(waitForObject(@symbolicName))\n Log.AppendLog(@@logCmd.click(self))\n end", "def click(id)\n\t\t\th = child(id).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def click(*args)\n\t\t\t# if no argument has been provided, click on the\n\t\t\t# window itself\n\t\t\th = (args.length == 0) ? @handle : child(args[0]).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def click_mouse(button)\n XDo::FFILib.xdo_click @_xdo_pointer, @_window, button\n end", "def click\n `#@native.click()`\n end", "def custom_click(selector)\n selector.click\nrescue Capybara::Poltergeist::MouseEventFailed\n selector.trigger('click')\nend", "def clicked;end", "def clicked\n @callback.call if mouse_over?\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def click\n root_node.click\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def clicked(e)\n \n end", "def basic_click()\n scroll_to_visible\n @driver.sc_basic_click action_target, *action_locator_args\n stall :click\n end", "def click\n `#@native.click()`\n self\n end", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def mouse_clicked\n\t\t# Send the mouse click to the Interaction Controller. It'll do the dirty work.\n\t\t@interaction_controller.mouse_clicked\n\t\tputs \"Editor#mouse_clicked\"\n\tend", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def select!\n raise \"Locator at #{location} is not visible\" unless visible?\n begin\n el.click\n rescue\n raise \"Locator at #{location} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def click\n @clicked_x = @x\n @clicked_y = @y\n fire(:click, @clicked_x, @clicked_y)\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def double_click_on(object)\n page.driver.browser.mouse.double_click(object.native)\n end", "def rightclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, true, o1, o2, o3, o4, o5)\nend", "def rightclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, true, o1, o2, o3, o4, o5)\nend", "def click(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES click mouse\n end tell\n `)\n end", "def on_click(elem)\n elem.fire_event('onClick')\n end", "def on_click\n\t\tend", "def click(driver = $focus_driver)\r\n begin\r\n driver.find_element(self).click\r\n Log.info(\"Element clicked #{self.how} => #{self.what}\")\r\n rescue StandardError => e\r\n Log.fail(\"Element not clicked #{self.how} => #{self.what}\" + e.message)\r\n end\r\n end", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def clicar(element)\n element.click\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def mouse_over(text, x: 0, y: 0, index: 1)\n Element.new(\"Clicking #{text}\", :xpath, \"(//*[text()=\\\"#{text}\\\"])[#{index}]\").mouse_over(x: x, y: y)\n end", "def action\n trigger :click\n end", "def click_at locator, coord_string\r\n command 'clickAt', locator, coord_string\r\n end", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def hover_over_element(access_type, access_name)\n element = $driver.find_element(:\"#{access_type}\" => \"#{access_name}\")\n $driver.action.move_to(element).perform\nend", "def hover_over_element(access_type,access_name)\n element = WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}\n $driver.action.move_to(element).perform\nend", "def double_click locator\r\n command 'doubleClick', locator\r\n end", "def click(btn = 'left')\n compatible_call :click, btn\n end", "def click(selector)\n if selector.is_a? String\n find(selector).click\n else\n selector.click\n end\n end", "def click_act_as_link\n act_as_link.click\n sleep(10)\n end", "def clicked\n @return.clicked\n end", "def select_with_click\n if mac_internal?\n press_menu\n else\n click\n end\n selected?\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "def mouse_in(mouse_event)\n end", "def click_on(locator)\n Logbook.message(\"Click on the element with locator #{locator}\")\n find(locator).click\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def select!\n raise \"Locator at #{locator} is not visible\" unless visible?\n begin\n wd_element.click\n rescue\n raise \"Locator at #{locator} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def click_point(x, y, is_double = false)\n if is_double\n @java_obj.doubleClick(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n else\n @java_obj.click(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n end\n end", "def click(x, y)\n clicked = @board.click(x, y) == 'bomb'\n game_over if clicked == 'bomb'\n revealed if clicked == 'revealed'\n @board.print_board\n end", "def mouse_over(criteria,value,seconds_over)\r\n\t\t\t\r\n\t\t\telement = @driver.find_element(criteria.to_sym,value)\t\r\n\t\t\t\r\n\t\t\tputs element\r\n\t\t\t\r\n\t\t\t@driver.action.move_to(element).perform\r\n\t\t\tsleep seconds_over\r\n\t\tend", "def click(name, tag)\n within(SELECTOR_MAPPING[TOOLBAR_EDITOR]['Components']['items'][SELECTOR], visible: true) do\n find(SELECTOR_MAPPING[TOOLBAR_EDITOR][name][tag][SELECTOR], visible: true).click\n end\n end", "def press_mouse(button)\n XDo::FFILib.xdo_mousedown @_xdo_pointer, @_window, button\n end", "def mouse_up *args; end", "def onClick(block=nil)\n @gtkEvent.signal_connect(\"button_release_event\") { |_, event|\n isClick(event.x.truncate,event.y.truncate)\n }\n end", "def click(&block)\n @clicks << block\n end", "def click_web_link(text)\n\t\t@log.debug(\"Clicking web link #{text}\")\n\t\t\n\t\t@main_window.click(text)\n\tend", "def double_click()\n double_click_at :center, :center\n end", "def click\n @automation_element.get_current_pattern(System::Windows::Automation::InvokePattern.pattern).invoke\n end", "def simulate_hover(element)\n page.execute_script(\"$('#{element}').show()\")\n wait_a_sec_for_selenium\n end", "def click_on(*args, context: page)\n label = self.class.labels[args[0]] # attempt to get the label\n context = context.element if context.respond_to? :element\n label.present? ? context.click_on(label) : context.click_on(*args)\n end", "def click_button(atrans,acftrans)\r\n sleep 2\r\n hwnd = client.railgun.user32.FindWindowW(nil, \"Microsoft Outlook\")\r\n if hwnd != 0\r\n hwndChildCk = client.railgun.user32.FindWindowExW(hwnd['return'], nil, \"Button\", \"&#{acftrans}\")\r\n client.railgun.user32.SendMessageW(hwndChildCk['return'], 0x00F1, 1, nil)\r\n client.railgun.user32.SetCursorPos(707,475)\r\n client.railgun.user32.mouse_event(0x0002,719,502,nil,nil) \r\n client.railgun.user32.mouse_event(0x0004,719,502,nil,nil)\r\n client.railgun.user32.SetCursorPos(710,499)\r\n client.railgun.user32.mouse_event(0x0002,710,499,nil,nil)\r\n client.railgun.user32.mouse_event(0x0004,710,499,nil,nil)\r\n else\r\n print_error(\"Error while clicking on the Outlook security notification. Window could not be found\")\r\n end\r\n end", "def right_click(name, *args)\n widget(name, *args).right_click\n end", "def exibir_lojas()\n lojas.click\n end", "def click(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, false, o1, o2, o3, o4, o5)\nend", "def click_element (element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if internally\n script = <<-JS\n arguments[0].click();\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n select.click\n end\n end", "def hover_over_sponsor(sponsor)\n page.execute_script(\"$('#{sponsor_container_selector(sponsor)}').trigger('mouseover')\")\nend", "def click_action_icon(action_name)\n find(\"img[data-qtip='#{action_name}']\").click\n end", "def click(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, false, o1, o2, o3, o4, o5)\nend", "def click_on(what)\n if what.is_a? Integer\n child_elements = children\n child_elements[what - 1].click if what - 1 <= child_elements.count\n else\n click_label what\n end\n end", "def click\n p [ :app_click ]\n view.click\n end", "def select_item(what)\n item = find_item(what)\n item.click if item\n end", "def mouse_press *args\n\t\t\tevent(:mouse_press, *args)\n\t\tend", "def pick_game_element\n @level.add_mouse(@input_controller.mouse_screen_coords)\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def click_on_a_text_button_link(selector)\n\n click_on(selector)\n\n end", "def click_on_class_or_css(selector)\n\n find(selector).click\n\n end", "def right_click(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n action.move_to(element, x, y).context_click.perform\n end", "def mouseButton()\n @view__.mouseButton\n end" ]
[ "0.77243966", "0.76648784", "0.76648784", "0.76648784", "0.7643174", "0.75140417", "0.74957895", "0.71949273", "0.7159618", "0.7159618", "0.7156128", "0.7077946", "0.7069662", "0.7069662", "0.70654905", "0.70642394", "0.7055408", "0.7023907", "0.69852734", "0.69674504", "0.69538665", "0.6945699", "0.6937293", "0.6926922", "0.6902679", "0.6874628", "0.6862909", "0.6823351", "0.6798755", "0.679279", "0.67780566", "0.6698379", "0.6675541", "0.66395605", "0.66395605", "0.6616669", "0.661373", "0.6611187", "0.6605246", "0.6594872", "0.6572545", "0.6511923", "0.64918983", "0.6464884", "0.64593685", "0.6450649", "0.6434561", "0.6433945", "0.6383153", "0.63785195", "0.63747567", "0.63729346", "0.63676435", "0.6347242", "0.63421476", "0.63254625", "0.6302583", "0.6278257", "0.6276083", "0.62683904", "0.626735", "0.62644047", "0.62584835", "0.62456954", "0.62237924", "0.6212484", "0.62118894", "0.62102306", "0.62018776", "0.6185681", "0.6177478", "0.61729586", "0.61628014", "0.6134216", "0.61290044", "0.6117004", "0.6114746", "0.61083573", "0.6103801", "0.61007553", "0.60996044", "0.6096295", "0.6084522", "0.60812575", "0.60794425", "0.6079135", "0.60766226", "0.60744387", "0.6072763", "0.60623205", "0.60577005", "0.60575944", "0.6056098", "0.6055736", "0.60424256", "0.6040763", "0.6038215", "0.6034551", "0.60342604", "0.60318255" ]
0.6805285
28
click on something that needs a mouse over
def click_by_script(element_click) p("-- execute_script clicking on element: " + element_click.to_s) @selenium.execute_script("document.getElementById('#{element_click}').click();"); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click()\n mouse_down\n mouse_up\n stall :click\n end", "def click; end", "def click; end", "def click; end", "def clicked(mouse_event)\n end", "def hover_click(element)\n driver.action.click(element).perform\n end", "def click\r\n start_point = screen.find ident\r\n click_x = start_point.x + offset_x\r\n click_y = start_point.y + offset_y\r\n\r\n screen.click click_x, click_y\r\n end", "def click\n `#{@el}.click() || Opal.nil`\n end", "def click locator\r\n command 'click', locator\r\n end", "def click locator\r\n command 'click', locator\r\n end", "def hover_click(*args)\n if args.size == 1\n driver.action.click(element).perform\n else\n sym,id = args\n driver.action.click(driver.find_element(sym.to_sym,id)).perform\n end\n\n end", "def click\n @mech.click self\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def mouse_over locator\r\n command 'mouseOver', locator\r\n end", "def click\n raise \"Must implement custom click method.\"\n end", "def click(link); end", "def click\n Log.Trace(\"Clicking on #{@symbolicName}\")\n mouseClick(waitForObject(@symbolicName))\n Log.AppendLog(@@logCmd.click(self))\n end", "def click(id)\n\t\t\th = child(id).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def click(*args)\n\t\t\t# if no argument has been provided, click on the\n\t\t\t# window itself\n\t\t\th = (args.length == 0) ? @handle : child(args[0]).handle\n\t\t\t\n\t\t\trectangle = [0, 0, 0, 0].pack 'LLLL'\n\t\t\tget_window_rect h, rectangle\n\t\t\tleft, top, right, bottom = rectangle.unpack 'LLLL'\n\t\t\t\n\t\t\tcenter = [(left + right) / 2, (top + bottom) / 2]\n\t\t\tset_cursor_pos *center\n\t\t\t\n\t\t\tmouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n\t\t\tmouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n\t\tend", "def click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.click_down\n yield if block_given?\n ensure\n Mouse.click_up\n sleep wait\n end", "def click_mouse(button)\n XDo::FFILib.xdo_click @_xdo_pointer, @_window, button\n end", "def click\n `#@native.click()`\n end", "def custom_click(selector)\n selector.click\nrescue Capybara::Poltergeist::MouseEventFailed\n selector.trigger('click')\nend", "def clicked;end", "def clicked\n @callback.call if mouse_over?\n end", "def triple_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.triple_click\n sleep wait\n end", "def click\n root_node.click\n end", "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend", "def mouseover_and_click(method, element_over, element_click)\n\tp(\"-- clicking on element: \" + element_click.to_s + \" by \" + method.to_s)\n\t@selenium.action.move_to(@selenium.find_element(method, element_over)).perform\n\tsleep 5\n\t@selenium.find_element(method, element_click).click\n end", "def clicked(e)\n \n end", "def basic_click()\n scroll_to_visible\n @driver.sc_basic_click action_target, *action_locator_args\n stall :click\n end", "def click\n `#@native.click()`\n self\n end", "def click_on(id, x, y)\n # Get the position of this window id\n position = get_position(id)\n # Add the [x, y] passed in by get_position to our x and y\n x += position[0]\n y += position[1]\n # Move the mouse to (x, y), then click\n xdotool \"mousemove #{x} #{y}\"\n xdotool \"click 1\"\n # sleep $sleep_time\nend", "def mouse_clicked\n\t\t# Send the mouse click to the Interaction Controller. It'll do the dirty work.\n\t\t@interaction_controller.mouse_clicked\n\t\tputs \"Editor#mouse_clicked\"\n\tend", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def select!\n raise \"Locator at #{location} is not visible\" unless visible?\n begin\n el.click\n rescue\n raise \"Locator at #{location} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def click\n @clicked_x = @x\n @clicked_y = @y\n fire(:click, @clicked_x, @clicked_y)\n end", "def right_click()\n right_mouse_down\n right_mouse_up\n stall :right_click\n end", "def double_click_on(object)\n page.driver.browser.mouse.double_click(object.native)\n end", "def rightclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, true, o1, o2, o3, o4, o5)\nend", "def rightclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, true, o1, o2, o3, o4, o5)\nend", "def click(btn)\n not_supported \"anything other than left clicking\" unless btn == 'left'\n execute_applescript(%Q`\n tell application \"Extra Suites\"\n ES click mouse\n end tell\n `)\n end", "def on_click(elem)\n elem.fire_event('onClick')\n end", "def on_click\n\t\tend", "def click(driver = $focus_driver)\r\n begin\r\n driver.find_element(self).click\r\n Log.info(\"Element clicked #{self.how} => #{self.what}\")\r\n rescue StandardError => e\r\n Log.fail(\"Element not clicked #{self.how} => #{self.what}\" + e.message)\r\n end\r\n end", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' (x: #{x}, y: #{y})\")\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n end\n end", "def click_on_a_button(selector)\n\n click_button(selector)\n\n end", "def mouse_over_element(element)\n driver.action.move_to(element).perform\n end", "def clicar(element)\n element.click\n end", "def double_click obj = nil, wait = 0.2\n move_mouse_to obj, wait: 0 if obj\n Mouse.double_click\n sleep wait\n end", "def mouse_over(text, x: 0, y: 0, index: 1)\n Element.new(\"Clicking #{text}\", :xpath, \"(//*[text()=\\\"#{text}\\\"])[#{index}]\").mouse_over(x: x, y: y)\n end", "def action\n trigger :click\n end", "def click_at locator, coord_string\r\n command 'clickAt', locator, coord_string\r\n end", "def mouse_pressed(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.notSupported('Use webdriver directly to perform a mouse_pressed event')\nend", "def hover_over_element(access_type, access_name)\n element = $driver.find_element(:\"#{access_type}\" => \"#{access_name}\")\n $driver.action.move_to(element).perform\nend", "def hover_over_element(access_type,access_name)\n element = WAIT.until {$driver.find_element(:\"#{access_type}\" => \"#{access_name}\")}\n $driver.action.move_to(element).perform\nend", "def double_click locator\r\n command 'doubleClick', locator\r\n end", "def click(btn = 'left')\n compatible_call :click, btn\n end", "def click_act_as_link\n act_as_link.click\n sleep(10)\n end", "def click(selector)\n if selector.is_a? String\n find(selector).click\n else\n selector.click\n end\n end", "def clicked\n @return.clicked\n end", "def select_with_click\n if mac_internal?\n press_menu\n else\n click\n end\n selected?\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "def mouse_in(mouse_event)\n end", "def click_on(locator)\n Logbook.message(\"Click on the element with locator #{locator}\")\n find(locator).click\n end", "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "def select!\n raise \"Locator at #{locator} is not visible\" unless visible?\n begin\n wd_element.click\n rescue\n raise \"Locator at #{locator} can not be interacted with\" unless visible?\n end\n check_errors\n end", "def click_point(x, y, is_double = false)\n if is_double\n @java_obj.doubleClick(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n else\n @java_obj.click(org.sikuli.script::Location.new(x, y).offset(x(), y()), 0)\n end\n end", "def click(x, y)\n clicked = @board.click(x, y) == 'bomb'\n game_over if clicked == 'bomb'\n revealed if clicked == 'revealed'\n @board.print_board\n end", "def mouse_over(criteria,value,seconds_over)\r\n\t\t\t\r\n\t\t\telement = @driver.find_element(criteria.to_sym,value)\t\r\n\t\t\t\r\n\t\t\tputs element\r\n\t\t\t\r\n\t\t\t@driver.action.move_to(element).perform\r\n\t\t\tsleep seconds_over\r\n\t\tend", "def click(name, tag)\n within(SELECTOR_MAPPING[TOOLBAR_EDITOR]['Components']['items'][SELECTOR], visible: true) do\n find(SELECTOR_MAPPING[TOOLBAR_EDITOR][name][tag][SELECTOR], visible: true).click\n end\n end", "def press_mouse(button)\n XDo::FFILib.xdo_mousedown @_xdo_pointer, @_window, button\n end", "def mouse_up *args; end", "def onClick(block=nil)\n @gtkEvent.signal_connect(\"button_release_event\") { |_, event|\n isClick(event.x.truncate,event.y.truncate)\n }\n end", "def click(&block)\n @clicks << block\n end", "def click_web_link(text)\n\t\t@log.debug(\"Clicking web link #{text}\")\n\t\t\n\t\t@main_window.click(text)\n\tend", "def double_click()\n double_click_at :center, :center\n end", "def click\n @automation_element.get_current_pattern(System::Windows::Automation::InvokePattern.pattern).invoke\n end", "def simulate_hover(element)\n page.execute_script(\"$('#{element}').show()\")\n wait_a_sec_for_selenium\n end", "def click_on(*args, context: page)\n label = self.class.labels[args[0]] # attempt to get the label\n context = context.element if context.respond_to? :element\n label.present? ? context.click_on(label) : context.click_on(*args)\n end", "def click_button(atrans,acftrans)\r\n sleep 2\r\n hwnd = client.railgun.user32.FindWindowW(nil, \"Microsoft Outlook\")\r\n if hwnd != 0\r\n hwndChildCk = client.railgun.user32.FindWindowExW(hwnd['return'], nil, \"Button\", \"&#{acftrans}\")\r\n client.railgun.user32.SendMessageW(hwndChildCk['return'], 0x00F1, 1, nil)\r\n client.railgun.user32.SetCursorPos(707,475)\r\n client.railgun.user32.mouse_event(0x0002,719,502,nil,nil) \r\n client.railgun.user32.mouse_event(0x0004,719,502,nil,nil)\r\n client.railgun.user32.SetCursorPos(710,499)\r\n client.railgun.user32.mouse_event(0x0002,710,499,nil,nil)\r\n client.railgun.user32.mouse_event(0x0004,710,499,nil,nil)\r\n else\r\n print_error(\"Error while clicking on the Outlook security notification. Window could not be found\")\r\n end\r\n end", "def exibir_lojas()\n lojas.click\n end", "def right_click(name, *args)\n widget(name, *args).right_click\n end", "def click(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, false, o1, o2, o3, o4, o5)\nend", "def click_element (element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if internally\n script = <<-JS\n arguments[0].click();\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n select.click\n end\n end", "def hover_over_sponsor(sponsor)\n page.execute_script(\"$('#{sponsor_container_selector(sponsor)}').trigger('mouseover')\")\nend", "def click_action_icon(action_name)\n find(\"img[data-qtip='#{action_name}']\").click\n end", "def click(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, false, o1, o2, o3, o4, o5)\nend", "def click\n p [ :app_click ]\n view.click\n end", "def click_on(what)\n if what.is_a? Integer\n child_elements = children\n child_elements[what - 1].click if what - 1 <= child_elements.count\n else\n click_label what\n end\n end", "def select_item(what)\n item = find_item(what)\n item.click if item\n end", "def mouse_press *args\n\t\t\tevent(:mouse_press, *args)\n\t\tend", "def pick_game_element\n @level.add_mouse(@input_controller.mouse_screen_coords)\n end", "def click_on_x_button\n\n page.find(X_BUTTON).click\n sleep(THREAD_SLEEP_1)\n\n end", "def click_on_a_text_button_link(selector)\n\n click_on(selector)\n\n end", "def click_on_class_or_css(selector)\n\n find(selector).click\n\n end", "def right_click(locator, offset = {})\n x = offset.fetch(:x, 0)\n y = offset.fetch(:y, 0)\n\n element = find_element(locator)\n action.move_to(element, x, y).context_click.perform\n end", "def mouseButton()\n @view__.mouseButton\n end" ]
[ "0.7725141", "0.7665906", "0.7665906", "0.7665906", "0.7643736", "0.7513308", "0.7496356", "0.7195539", "0.71605915", "0.71605915", "0.7154908", "0.70794725", "0.70690316", "0.70690316", "0.70656794", "0.7064569", "0.70556337", "0.7024552", "0.6985338", "0.69681036", "0.69545877", "0.69473493", "0.6937425", "0.69280076", "0.69013685", "0.687474", "0.6863868", "0.68231046", "0.68045264", "0.6799504", "0.6793007", "0.677964", "0.6699373", "0.66768026", "0.66402304", "0.66402304", "0.6617753", "0.66143185", "0.66122574", "0.6606295", "0.6596418", "0.6574119", "0.65129447", "0.6492196", "0.6466112", "0.64599437", "0.6450595", "0.64358085", "0.6434367", "0.6382144", "0.63792557", "0.6375227", "0.637199", "0.6368274", "0.63478494", "0.6343", "0.63252527", "0.63026726", "0.6279051", "0.6276359", "0.62683684", "0.6268243", "0.62655985", "0.6259199", "0.6246522", "0.622509", "0.62133723", "0.62127995", "0.6211086", "0.6203299", "0.6187136", "0.61779916", "0.61723316", "0.61630046", "0.61353093", "0.61288035", "0.6117028", "0.6115051", "0.61088365", "0.61040395", "0.61019933", "0.6099624", "0.60963506", "0.60852516", "0.608174", "0.6081717", "0.60803217", "0.60774326", "0.6074711", "0.60722244", "0.60635316", "0.6059061", "0.6058955", "0.60579", "0.60561806", "0.6043562", "0.6041874", "0.60381436", "0.6034744", "0.60346675", "0.60332733" ]
0.0
-1
setup proper absolute url based on a given relative url
def proper_base_url(relative_url) p("-- evaluating the proper base url to use based on config settings: " + relative_url) if (ENV['qa.base.url'] != nil and ENV['qa.base.url'] != "") p("-- using ENV - URL: " + ENV['qa.base.url']) proper_base = (ENV['qa.base.url'] + relative_url) else p("-- using env.yaml file URL: " + @base_url) proper_base = (@base_url + relative_url) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relative_url(input); end", "def relative_url_root=(_arg0); end", "def relative_url_root=(_arg0); end", "def make_absolute_url(url)\n return url unless URI.parse(url).relative?\n begin\n URI.parse(@page_url).merge(url).to_s\n rescue URI::Error\n url\n end\n end", "def make_absolute_url(url)\n return url unless Addressable::URI.parse(url).relative?\n begin\n Addressable::URI.parse(@page_url).merge(url).to_s\n rescue\n url\n end\n end", "def to_absolute( relative_url )\n if (url = base)\n base_url = url\n else\n base_url = @url\n end\n\n super( relative_url, base_url )\n end", "def create_absolute_url_from_base(potential_base, relative_url)\n begin\n\t\t\t#puts \"Determine the absolute URL from potential base #{potential_base} and relative URL #{relative_url}\" if @verbose\n\t\t\tnaked_base = url_2_site(potential_base).strip.chop \n\t\t\tputs \"Found absolute URL: #{naked_base+relative_url}\" if @verbose\n\t\t\treturn naked_base + relative_url\n rescue => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n return nil\n end\n end", "def relative_url_root=(_); end", "def absolute_url(url)\n super\n end", "def absolutify_url(src, base_url, parent_url)\r\n if src.nil? || src.empty? || src == \"//:\" || src =~ /\\s*http:\\/\\//i\r\n return src\r\n end\r\n\r\n return \"#{base_url}#{src}\" if src =~ /^\\s*\\//\r\n return \"#{parent_url}#{src}\" if parent_url\r\n return src\r\n end", "def absolutify_url(src, base_url, parent_url)\n if src.nil? || src.empty? || src == \"//:\" || src =~ /\\s*http:\\/\\//i\n return src\n end\n \n return \"#{base_url}#{src}\" if src =~ /^\\s*\\//\n return \"#{parent_url}#{src}\" if parent_url\n return src\n end", "def absolute_url\n domain + path\n end", "def absolutify_url(url)\n url =~ /^\\w*\\:/i ? url : File.join(@url,url)\n end", "def fix_relative_path(entry)\n feed_url = Addressable::URI.parse(url)\n entry.url = feed_url.scheme + '://' + feed_url.host + entry.url\n end", "def url\n\t\tif relative? then\n\t\t\tif page.bases[0] then\n\t\t\t\t page.bases[0].href + src\n\t\t\telse\n\t\t\t\tpage.uri + src\n\t\t\tend\n\t\telse\n\t\t\tsrc\n\t\tend\n\tend", "def absolute_url(*args)\n base_url + url(*args)\n end", "def relative_url_root; end", "def relative_url_root; end", "def relative_url_root; end", "def complete_url(url, base)\n if url.start_with?(\"/\")\n resource_uri = base + url\n else\n resource_uri = url\n end \n return resource_uri\n end", "def make_absolute(base, relative_url)\n puts \"Determine and return the absolute URL:\\n Base: #{base}, Relative: #{relative_url} \" if @verbose\n\t\tbegin\n\t\t\tabsolute_url = nil;\n\t\t\tif relative_url =~ /^\\//\n\t\t\t\tabsolute_url = create_absolute_url_from_base(base, relative_url)\n\t\t\telse\n\t\t\t\tabsolute_url = create_absolute_url_from_context(base, relative_url)\n\t\t\tend\n\t\t\tputs \"Found absolute URL: #{absolute_url}\" if @verbose\n\t\t\treturn absolute_url\n rescue => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n return nil\n end\n end", "def absolute_url(url)\n url.match?(/^http:/) ? url : \"#{url_root}#{url}\"\n end", "def extended_url base_url, relative_url\n while base_url =~ /\\/$/\n base_url = base_url[0..-2]\n end\n while relative_url =~ /^\\//\n relative_url = relative_url[1..-1]\n end\n base_url + '/' + relative_url\n end", "def absolutize_url(url)\n # file_path = File.expand_path(File.join(working_directory, url))\n # full_path = File.expand_path(File.join(path, url))\n # full_path.gsub(File.expand_path(path), '')\n ('/' + url.split('./').last).gsub(%r(/+), '/')\n end", "def absolute_url(url)\n if url && !url.include?(\"http\") \n URI.join(root_url, url)\n else\n url\n end\n end", "def abs_url(site)\n\t\t\turl = site.config['url']\n\t\t\turl = url[0..-2] if site.config['url'].end_with?(\"/\")\n\t\t\turl + fix_path(site.config['git_to_rss_file_path'])\n\t\tend", "def absolute_url(url, source_url)\n url = URI.parse url\n url.absolute? ? url : URI.parse(source_url).merge(url)\nend", "def absolute_url\n File.join(BLOG.url, url)\n end", "def absolutize_url(url, base_path = '')\n ############# Refactor\n # original_url = url\n #unless original_url[URI::regexp(%w[http https])]\n # protocol = default_url_options[:protocol]\n # protocol = \"http://\" if protocol.blank?\n # protocol+= \"://\" unless protocol.include?(\"://\")\n\n # host = default_url_options[:host]\n\n # [host,protocol].each{|r| original_url.gsub!(r,\"\") }\n # host = protocol+host unless host[URI::regexp(%w[http https])]\n\n # url = URI.join host, base_path, original_url\n #end\n\n #url.to_s\n \n url\n end", "def base_url_path=(_arg0); end", "def absolute_url\n return unless fileable?\n Rails.application.routes.default_url_options[:host] ||= \"http://localhost:3000\"\n Rails.application.routes.url_helpers.root_url[0..-2] + file.url\n end", "def relativize(href, path, absolute_base, root_dir)\n # href = actual href string on page\n # path = actual current location / file path of current page\n # absolute_base = the base url for the site\n\n href_url = URI.join(URI.encode(absolute_base), URI.encode(href))\n path_url = URI.join(absolute_base, URI.encode(path))\n relative_url = path_url.route_to(href_url).to_s\n url_out = test_index(relative_url, href_url, absolute_base, root_dir)\n if href.match(/^#/)\n url_out = href\n end\n url_out\nend", "def to_relative_uri\n build_uri.route_from base_value\n end", "def original_url\r\nbase_url + original_fullpath\r\nend", "def get_absolute_file_url(url)\n orig_url = url.to_s.strip\n \n url = file_url(orig_url)\n # If a file:// was stripped from the url, this means it will always point\n # to a file\n force_file = (orig_url != url)\n # Indicates wether the base url is a network url or a file/directory\n base_is_net = !base_file_url.is_a?(String)\n # Try to find if we have a \"net\" URL if we aren't sure if this is a file. In\n # case the base url is a network url, we'll always assume that the\n # url is also a net thing. Otherwise we only have a net url if it contains a\n # '://' string\n is_net_url = !force_file && (base_is_net || url.include?('://'))\n # The url is absolute if there is a : character to be found\n \n \n if(is_net_url)\n base_is_net ? join_url(base_file_url, url) : url\n else\n base_is_net ? url : join_files(base_file_url, url)\n end\n end", "def url(p = path)\n \"/\" + relative_path(p).to_s.downcase.gsub(/\\s/, \" \")\n end", "def absolutify url, cd \n url = url.to_s\n # deal w/ bad URLs, already absolute, etc\n begin\n u = URI.parse(url)\n rescue\n # GIGO, no need for alarm\n return url\n end\n\n return url if u.absolute? # http://example.com/about\n c = URI.parse(cd)\n return c.scheme + \"://\" + c.host + url if url.index('/') == 0 # /about\n return cd + url if url.match(/^[a-zA-Z]+/) # about*\n\n # only relative from here on in; ../about, ./about, ../../about\n u_dirs = u.path.split('/')\n c_dirs = c.path.split('/')\n\n # move up the directory until there are no more relative paths\n u.path.split('/').each do |x|\n break unless (x == '' || x == '..' || x == '.')\n u_dirs.shift\n c_dirs.pop unless x == '.'\n end\n return c.scheme + \"://\" + c.host + c_dirs.join('/') + '/' + u_dirs.join('/')\n end", "def absolute_url(*args)\n url_path = args.shift\n if url_path.is_a?(String) && !url_path.start_with?('/')\n url_path = request.env['PATH_INFO'].rpartition('/').first << '/' << url_path\n end\n uri url(url_path, *args), true, false\n end", "def absolute_url_for(uri, str)\n # TODO: use URI.parse() for better handling?\n return str if str =~ /^[|[:alpha:]]+:\\/\\//\n File.join(((uri.path.empty?) ? uri.to_s : File.dirname(uri.to_s)), \n str)\n end", "def absolute_url(request, opts={})\n cdn_url(opts) || (request.protocol + request.host_with_port + public_filename)\n end", "def url(*args)\n super_url = super\n File.exists?(\"#{root}#{super_url}\") ? super_url : default_url\n end", "def to_relative_url\n to_relative_uri.to_s\n end", "def with_base_url(path)\n u = @url.dup\n u.path += Puppet::Util.uri_encode(path)\n u\n end", "def makeAbsolute(link, currURL)\n\t\tif not ( link =~ /http/ )\n\t\t\t# relative link: create absolute link\n\n\t\t\t# .edu/pigs/index.html should be treated as .edu/pigs\n\t\t\tdirectory = /(.*#{Regexp.escape(\"/\")})\\w+#{Regexp.escape(\".\")}\\w+$/.match(currURL)\n\t\t\tif directory\n\t\t\t\tcurrURL = directory[1]\n\t\t\tend\n\n\t\t\t# remove any trailing forward slash\n\t\t\tif currURL[-1] == \"/\"\n\t\t\t\tcurrURL = currURL[0..-2]\n\t\t\tend\n\n\t\t\t# if the link starts with \"/\", don't just append\n\t\t\tif ( link =~ /^#{Regexp.escape(\"/\")}/ )\n\t\t\t\tdomain = URI.parse(currURL).host\n\t\t\t\tlink = \"http://\" + domain + link\n\t\t\telse\n\t\t\t\t# is ../ the start?\n\t\t\t\tif ( link =~ /^..#{Regexp.escape(\"/\")}/ )\n\t\t\t\t\t# make sure you can actually go back a directory: look for bowdoin.edu/***/ at least\n\t\t\t\t\tif ( currURL =~ /.*bowdoin.edu#{Regexp.escape(\"/\")}.*#{Regexp.escape(\"/\")}?/ )\n\t\t\t\t\t\t# remove first instance of ../\n\t\t\t\t\t\tadjustedLink = link[3..-1]\n\t\t\t\t\t\tshortened = /.*#{Regexp.escape(\"/\")}/.match(currURL)\n\t\t\t\t\t\t# remove / at end (guaranteed if the regex matches)\n\t\t\t\t\t\tshortened = shortened[0][0..-2]\n\n\t\t\t\t\t\t# another instance of ../?\n\t\t\t\t\t\tif ( adjustedLink =~ /^..#{Regexp.escape(\"/\")}/ )\n\t\t\t\t\t\t\t# recurse on shortened URL\n\t\t\t\t\t\t\tresult = makeAbsolute(adjustedLink, shortened)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tresult = shortened + \"/\" + adjustedLink\n\t\t\t\t\t\t\treturn result\n\t\t\t\t\t\tend\t\t\t\t\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\t# normal relative link - add to end\n\t\t\t\t\tending = /.*#{Regexp.escape(\"/\")}([^#{Regexp.escape(\"/\")}]*)$/.match(currURL)\n\t\t\t\t\tif ending\n\t\t\t\t\t\ttoMatch = ending[1]\n\t\t\t\t\t\tif ( link =~ /^#{toMatch}/ )\n\t\t\t\t\t\t\tputs \"Repeats, avoiding \" + link\n\t\t\t\t\t\t\treturn currURL\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn currURL + \"/\" + link\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\treturn link\n\t\tend\n\tend", "def url\n return @url if @url\n\n url = permalink ?\n if site.config['relative_permalinks']\n File.join(@dir, permalink)\n else\n permalink\n end :\n {\n 'lang' => self.lang,\n 'categories' => self.categories,\n 'basename' => self.basename,\n }.inject(template) { |result, token|\n result.gsub(/:#{token.first}/, token.last)\n }.gsub(/\\/\\//, '/')\n\n # sanitize url\n @url = url.split('/').reject { |part| part =~ /^\\.+$/ }.join('/')\n @url += '/' if url =~ /\\/$/\n @url.gsub!(/\\A([^\\/])/, '/\\1')\n @url\n end", "def set_url(config_page_or_url)\n if Nav.is_url? config_page_or_url\n # Return the given URL if it alreadt is a valid URL\n return config_page_or_url\n else\n # Look for the URL in the config files\n path_or_url = get_url config_page_or_url\n if Nav.is_url? path_or_url\n # If it is a URL now, then return it\n return path_or_url\n else\n # Else add an expected 'root' to the path.\n return env('root') + path_or_url\n end\n end\n end", "def fill_url(site, page_or_post)\r\n url = 'https:' + site.config['url'] + site.config['baseurl'] + page_or_post.location_on_server(url)\r\n \r\n url\r\n end", "def relative_link(link)\n # REMEMBER TO ADD ROUTES TO HANDLE THESE LINKS\n link.gsub!(@base, \"\").gsub!(\".html\", \"\").gsub!(\"-\", \"_\")\n end", "def normalize_path(url); end", "def normalize_path(url); end", "def local_to_remote_url local\n local.match /#{config[:relative_dir_regex]}/\n subdir = $2\n basename = File.basename local\n File.join(config[:root_path], subdir, basename)\n end", "def url\n if @url\n @url\n else\n begin\n\n page_name = File.basename(self.name, '.*')\n config = @config['permalinks'][page_name]\n\n if config.is_a? String\n @url = config\n self.data['permalink'] = nil\n else\n @config['permalinks'][File.basename(self.name, '.*')] = self.data['permalink']\n end\n rescue; end\n\n super\n\n if @url && @url =~ /\\/$/\n if self.ext == '.xml'\n @url = File.join(@url, \"index.xml\")\n else\n @url = File.join(@url, \"index.html\")\n end\n end\n\n @url\n end\n end", "def make_absolute_uri(hash={})\n @urigen.make_absolute_uri(hash)\n end", "def make_relative_uri(hash={})\n @urigen.make_relative_uri(hash)\n end", "def base_url_path; end", "def create_absolute_url_from_context(potential_base, relative_url)\n puts \"Determine the absolute URL from context:\\n Known base: #{potential_base}, Relative path: #{relative_url}\" if @verbose\n\t\tbegin\n\t\t\tabsolute_url = nil\n\t\t\t# make relative URL naked by removing the beginning '/'\n\t\t\trelative_url.sub!(/^\\//,'')\n\t\t\tif potential_base =~ /\\/$/\n\t\t\t\tabsolute_url = potential_base+relative_url.strip\n\t\t\telse\n\t\t\t\tlast_index_of_slash = potential_base.rindex('/')\n\t\t\t\tif potential_base[last_index_of_slash-2, 2] == ':/'\n\t\t\t\t\tabsolute_url = potential_base+relative_url\n\t\t\t\telse\n\t\t\t\t\tlast_index_of_dot = potential_base.rindex('.')\n\t\t\t\t\tif last_index_of_dot < last_index_of_slash\n\t\t\t\t\t\tabsolute_url = potential_base.strip.chop+relative_url\n\t\t\t\t\telse\n\t\t\t\t\t\tabsolute_url = potential_base[0, last_index_of_slash+1] + relative_url\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs \"Found absolute URL: #{absolute_url}\" if @verbose\n\t\t\treturn absolute_url\n rescue => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n return nil\n end\n end", "def base_url\n base_href || url\n end", "def create_url(subpath='')\n paths = [ api_version, resources_path, subpath ]\n paths.select{|s| s != ''}.join('/')\n end", "def baseurl=(_arg0); end", "def absolute_url\n\t\treturn \"#{$domain}/#{self.photo.url}\"\n\tend", "def base_url\n current_base_href = base_href.to_s.strip.empty? ? nil : URL.absolutify(base_href, URL.new(url).root_url)\n current_base_href || url\n end", "def resolved_uri; end", "def url\n ::File.join \"/\", path.to_s\n end", "def full_url(url, path)\n if path.start_with?('http')\n path\n else\n url = url[0..1] if url.end_with?('/')\n path = path[1..-1] if path.start_with?('/')\n \"#{url}/#{path}\"\n end\n end", "def absolutize_url(url)\n url =~ /\\Ahttps?/ ? url : \"http://#{url}\"\n end", "def convert_relative_links(url)\n base_url = doc.css('base').present? ? doc.css('base')[0]['href'] : url.split('?').first \n return if base_url.blank?\n doc.css('a').each do |link|\n link['href'] = converted_link(base_url, link['href'])\n end\n end", "def goto relative_url\n destination = File.join(@site.origin, relative_url) \n @browser.goto destination\n end", "def relative_path_from(from); end", "def join_url(base_url, path)\n return path if(path.include?(':')) # Absolute URL contains ':'\n if(path[0..0] == '/')\n new_url = base_url.clone\n new_url.path = path\n new_url.to_s\n else\n (base_file_url + path).to_s\n end\n end", "def url(addr = nil, absolute = true, add_script_name = true)\n return addr if addr =~ /\\A[A-z][A-z0-9\\+\\.\\-]*:/\n uri = [host = \"\"]\n if absolute\n host << \"http#{'s' if request.secure?}://\"\n if request.forwarded? or request.port != (request.secure? ? 443 : 80)\n host << request.host_with_port\n else\n host << request.host\n end\n end\n uri << request.script_name.to_s if add_script_name\n uri << (addr ? addr : request.path_info).to_s\n File.join uri\n end", "def rewrite_local_urls(response_html) # :nodoc:\n if base_url\n doc = Nokogiri::HTML::Document.parse response_html\n if head = doc.xpath(\"//head\").first\n base = Nokogiri::HTML::DocumentFragment.parse \"<base href=\\\"#{base_url}\\\">\"\n head.child && head.child.add_previous_sibling(base)\n doc.to_html\n else\n response_html\n end\n elsif doc_root\n # TODO: replace with nokogiri calls\n response_html.gsub(/\"\\/([^\"]*)\"/, %{\"#{doc_root}} + '/\\1\"')\n else\n response_html\n end\n end", "def relative_path(from, to); end", "def process\n return nil unless link_url?\n url = @url.dup\n if url = parse(url)\n return parse_relative_url unless url.host\n url.scheme ||= @source_url.scheme\n if same_source_host? || external_asset_url?\n URI.unescape(url.to_s, '%7C')\n end\n end\n end", "def full_url(input)\n expand_url(input, site_url)\n end", "def absolute_url(name, *args)\n return web_controller.absolute_url(name, *args) if web_controller\n super\n end", "def absolute_url(url, options={})\n URL.new(env, url, options).to_absolute\n end", "def absolute_url?\n (self.include?('://') || self.start_with?('/')) ? true : false\n end", "def absolute_url(name, *args)\n return base_controller.absolute_url(name, *args) if base_controller\n super\n end", "def set_url\n self.update_column(:url, '/' + self.ancestry_url)\n end", "def absolute_url_from(page_url, current_url)\n return unless eligible_url?(page_url)\n parsed_uri = URI.join(current_url, page_url) rescue return\n return unless parsed_uri.hostname == @base_hostname\n parsed_uri.to_s\n end", "def set_url(url_value)\n @path = url_value.delete_prefix \"/\"\n @dir = File.dirname(@path)\n @url = url_value\n end", "def full_url(input)\n url = Ink.site.config['url']\n if url.nil?\n raise IOError.new \"Could not expand url in #{input}: Please add your site's published url to your _config.yml, eg url: http://example.com/\"\n else\n expand_url(input, url)\n end\n end", "def resolve_url_for(logical_path)\n url_join(\n Rails.application.config.action_controller.asset_host,\n Rails.application.config.assets.prefix,\n resolve(logical_path)\n )\n end", "def full_url(path)\n \"#{base_url}#{path}\"\n end", "def patched_url\n result = url\n return result if result.start_with?('/', 'http')\n \"/#{result}\"\n end", "def base_uri\t\t\t\n\t\tURI.parse( \"http://\" + @factory.site_name + \".\" + @factory.api_host_base + @path )\n\tend", "def absolute_url?(string); end", "def set_base_url\n uri = URI.parse(@page_url)\n @base_url = \"#{uri.scheme}://#{uri.host}\"\n end", "def site_url(href)\n path_resolver = (@path_resolver ||= PathResolver.new)\n base_dir = path_resolver.posixify(@document.base_dir)\n site_root = path_resolver.posixify(@document.attr('site-root', base_dir))\n unless path_resolver.is_root? site_root\n raise ::ArgumentError, %(site-root must be an absolute path: #{site_root})\n end\n base_dir_to_root = nil\n if (base_dir != site_root) && (base_dir.start_with? site_root)\n comp, root = path_resolver.partition_path(base_dir.slice(site_root.length + 1, base_dir.length))\n base_dir_to_root = '../' * comp.length\n end\n path_resolver.web_path(href, base_dir_to_root)\n end", "def target_url(target)\n File.join(\"/\", Pathname.new(target).relative_path_from(Pathname.new(DST_DIR)).to_s)\nend", "def expand_redirect_url(redirect_url, base_url)\n uri = URI.parse(redirect_url)\n uri = URI.parse(base_url) + redirect_url if uri.relative?\n uri\n end", "def relative_uri(uri)\n raise ArgumentError, \"relative_uri: uri may not be nil\" if uri.nil?\n uri = ensure_uri(uri)\n new_location = nil\n if uri.path[0...1] == '/'\n new_location = base.dup\n new_location.path = uri.path\n new_location.query = uri.query\n new_location\n else\n new_location = base.dup\n new_location.path = File.dirname(new_location.path) + '/' + uri.path\n new_location.query = uri.query\n new_location\n end\n new_location\n end", "def go_relative(uri)\n self.location = relative_uri(uri)\n end", "def relative_url(url)\n url.gsub(%r{\\Ahttp://[^/]*}, '')\n end", "def urlpath\n path = cleanpath\n path.blank? ? '/root' : '/' + path\n end", "def transform_automation_url(arg)\n return arg unless arg.start_with?(\"http\")\n\n remote_file = determine_remote_filename(arg)\n github_match = GITHUB_REGEX.match(arg)\n\n arg = if arg.start_with?(\"https://gist.github.com\")\n arg.sub( # rubocop:disable Style/StringConcatenation\n \"https://gist.github.com\", \"https://gist.githubusercontent.com\"\n ) + \"/raw\"\n elsif github_match\n new_url = arg.sub(GITHUB_REGEX, \"https://raw.githubusercontent.com\")\n github_tree_match = GITHUB_TREE_REGEX.match(arg)\n github_blob_match = GITHUB_BLOB_REGEX.match(arg)\n\n if github_tree_match\n new_url.sub(\"/tree/\", \"/\")\n elsif github_blob_match\n new_url.sub(\"/blob/\", \"/\")\n else\n \"#{new_url}/#{Bridgetown::Utils.default_github_branch_name(arg)}\"\n end\n else\n arg\n end\n\n \"#{arg}/#{remote_file}\"\n end", "def url=(_arg0); end", "def url=(_arg0); end", "def url=(_arg0); end", "def url=(_arg0); end" ]
[ "0.7633731", "0.7387293", "0.7387293", "0.7358139", "0.7341919", "0.7237988", "0.7223935", "0.72215563", "0.7171884", "0.71625245", "0.7158445", "0.70986104", "0.70831287", "0.7069311", "0.70651156", "0.70304567", "0.7025488", "0.7025488", "0.7025488", "0.7023712", "0.70146066", "0.6990535", "0.69493073", "0.69190216", "0.69178516", "0.6915952", "0.6894593", "0.6878309", "0.67610216", "0.67526704", "0.675096", "0.672122", "0.66861403", "0.6655085", "0.66004753", "0.6595242", "0.65814686", "0.654977", "0.6548691", "0.64858454", "0.6447954", "0.64477044", "0.64452446", "0.64342546", "0.6422262", "0.64218175", "0.63969225", "0.6387394", "0.63847196", "0.63847196", "0.6383094", "0.63726306", "0.6367549", "0.63632303", "0.6361295", "0.63542664", "0.6344775", "0.63447124", "0.63416874", "0.63338643", "0.6329932", "0.632886", "0.6297238", "0.62784886", "0.62714547", "0.62690425", "0.6260513", "0.625888", "0.6233085", "0.6232203", "0.6225971", "0.6216193", "0.62053174", "0.62021554", "0.61925954", "0.6183126", "0.61796194", "0.61795366", "0.61790615", "0.61772674", "0.61757827", "0.6170312", "0.61690336", "0.61603796", "0.6159818", "0.61579204", "0.6149244", "0.6146718", "0.6144478", "0.6144388", "0.61232203", "0.61203283", "0.61199504", "0.6089979", "0.6088278", "0.60857874", "0.60750926", "0.60750926", "0.60750926", "0.60750926" ]
0.6681234
33
setup proper file uri needed for any operations involving selenium.attach_file
def proper_file_uri(file) p("-- setting up proper file uri for file: [ #{file} ]") case RUBY_PLATFORM when /cygwin/, /mswin32/, /i386-mingw32/ new_path = file.gsub(/C:/,'') p("-- new_path (windows only) = #{new_path}") return "file://" + new_path else return "file://" + file end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_url\n file.attached? ? url_for(file) : ''\n end", "def file_url(attachment_name, style=nil); file_path(attachment_name, style); end", "def file_to_uri(file); end", "def file_to_uri(file); end", "def file_url\n end", "def fileUri(f)\n \"file://\" + f.gsub(\" \", \"%20\")\nend", "def attach_file(book, field,field_name)\n book.send(field_name).attach(io: open_file(book[field]), filename: field)\n url_for(book[field_name])\n end", "def file_url\n resource.send(mount_point).url\n end", "def upload_file_url\n \"file://#{upload_full_path}\"\n end", "def attach_file(input, file)\n path = File.expand_path(File.join(SUPPORT_DIR,\"attachments/#{file}\"))\n\n raise RuntimeError, \"file '#{path}' does not exists\" unless File.exists?(path)\n\n input.set(path)\n end", "def set_file_for_remote_storage\n set_resource_mounter_file open(original_resource_mounter.url)\n end", "def file_to_uri file\r\n \"file://#{URI.encode(file.gsub(/^([a-z]\\:)/i, '/\\1'))}\"\r\n end", "def file_uri_user\n File.absolute_path?(Rails.configuration.storagePath) ? download_url + \"&dmode=emb\" : DocumentHelper.get_file_uri(@file_name, false)\n end", "def file_link\n return \"#{SITE_URL}system/ufiles/#{id}/original/#{ufile_file_name}\"\n end", "def attach_image_to_lob(locator,pathtotheImage)\n\n page.attach_file(locator, File.absolute_path(pathtotheImage))\n\n end", "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", "def file_uri_scheme=(_arg0); end", "def bootstrap_attach_file(path, selector)\n\n # Selenium likes absolute paths when attaching a file.\n path = File.expand_path(path)\n\n # Do this to expose the file input field so it is clickable\n Capybara.current_session.driver.execute_script(\n \"$('#{selector}').css('position','relative').css('opacity','1').height(10).width(10)\")\n attach_file(selector[1..-1], path)\n Capybara.current_session.driver.execute_script(\"$('#upload-file').css('display','inline')\")\n\n end", "def file_url\n return nil if target_item.files.empty?\n target_item.files.last.uri.to_s\n end", "def attached_file\n=begin # TODO: remove when :json resolved\n file || (file_attacher.load_data(file_data) if file_data.present?)\n=end\n file || file_attacher_load\n end", "def uri_to_file uri\r\n URI.decode(uri).sub(/^file\\:\\/\\//, '').sub(/^\\/([a-z]\\:)/i, '\\1')\r\n end", "def url_for_file(filename, anchor = T.unsafe(nil)); end", "def file_url(remote_path)\n get_adapter.file_url(remote_path)\n end", "def attachment_from_url(url)\n self.attachment = open(url)\n end", "def download_url(**opt)\n opt[:expires_in] ||= ONE_TIME_USE_EXPIRATION\n attached_file&.url(**opt)\n end", "def uri_to_file(uri); end", "def uri_to_file(uri); end", "def prepare_file_path_to_download\n folder = ::EasyManageClient.configuration(profile).download_folder\n file_extension = ::EasyManageClient.configuration(profile).file_extension\n File.join(folder, \"#{response[:reference]}.#{file_extension}\")\n end", "def convert_source_url_to_external_storage\n return unless converting_activated_for_current_resource?\n\n endpoint = Rails.application.credentials.dig(:minio, :endpoint)\n return if endpoint.blank?\n return if source_url.blank? || source_url.url.blank?\n return if source_url.url.start_with?(endpoint)\n\n begin\n uri = URI.open(source_url.url)\n file = File.open(uri)\n attachment.attach(io: file, filename: File.basename(file))\n rescue StandardError\n return\n end\n\n source_url.url = attachment.service_url.sub(/\\?.*/, \"\")\n source_url.save\n end", "def file_set_url(file_set_id)\n \"https://#{ENV['SERVER_NAME']}/downloads/#{file_set_id}\"\n end", "def set_attachfile\n @attachfile = Attachfile.find(params[:id])\n end", "def localFile(f)\n fileUri(File::absolute_path(f))\nend", "def file_attachments_path\n ENV['IMPORT_PATH'] || '/opt/data'\n end", "def file_uri_scheme; end", "def attach_file(field_locator, path, content_type = nil)\n locate_field(field_locator, FileField).set(path, content_type)\n end", "def create_file_from_url(env, uri, file_name, auth_header = {})\n ::FileSet.new(import_url: uri.to_s, label: file_name) do |fs|\n actor = file_set_actor_class.new(fs, env.user)\n actor.create_metadata(visibility: env.curation_concern.visibility)\n actor.attach_to_work(env.curation_concern)\n fs.save!\n ordered_members << fs\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", "def url(options = {})\n file.path\n end", "def fetch_file_by_url\n if (self.url)\n self.file = self.url\n end\n end", "def upload_file(uploader, url)\n uri = URI.parse(url)\n if uri.host.nil?\n # Local, prepend url\n file = File.open(uploader.root + url)\n else\n # Add a scheme if the url is of the form \"//host.com/assets/\"\n uri.scheme = \"http\" if uri.scheme.nil?\n # Remote\n uploader.download!(uri.to_s)\n file = uploader.file\n end\n file\n end", "def file=(file)\n self.fileRef = file.uuid\n end", "def url(**options)\n file&.url(**options)\n end", "def local_path_to_file=(value)\n @attributes[:local_path_to_file] = value\n reset_attributes\n calculate_attributes\n value\n end", "def file_url= val\n return if val.blank?\n\n self.state = :pending\n self.server_data = val\n @file_last_action = __method__.to_sym\n end", "def aware_details\n @aware_details_url = \"#{DIL_CONFIG['dil_aware_detail_url']}#{params[:file_path]}\"\n end", "def aware_details\n @aware_details_url = \"#{DIL_CONFIG['dil_aware_detail_url']}#{params[:file_path]}\"\n end", "def attachment_path\n return unless attachment.attached?\n\n attachment.service_url\n end", "def url(options = {})\n if file.respond_to?(:url)\n tmp_url = file.method(:url).arity.zero? ? file.url : file.url(options)\n return tmp_url if tmp_url.present?\n end\n\n if file.respond_to?(:path)\n path = encode_path(file.path.sub(File.expand_path(root), ''))\n\n if (host = asset_host)\n if host.respond_to? :call\n \"#{host.call(file)}#{path}\"\n else\n \"#{host}#{path}\"\n end\n else\n (base_path || \"\") + path\n end\n end\n end", "def add_file(filename)\n step('I visit the new file page')\n fill_in(\"file_label\", with: filename)\n attach_file('file_file', filename)\n fill_in('file_description', with: sample_file_description(filename))\n click_link_or_button('Upload File')\n wait_for_ajax_complete\nend", "def attachment_path\n return unless attachment?\n\n case attachment.options[:storage]\n when :filesystem then attachment.path\n else attachment.url\n end\n end", "def simple_file_upload simple_file_upload_file\n absolut_path_file = Dir.pwd.gsub(/\\.tests/, 'tests/files') + '/' + simple_file_upload_file\n\n self.simple_file = absolut_path_file\n end", "def file_protocol_path(filepath)\n 'file://' + File.expand_path(filepath)\n end", "def send_file(path); end", "def external_download_url\n @file.external_bytestream_uri.to_s\n end", "def upload_local(path, **opt)\n File.open(path) do |io|\n file_attacher.attach(io, **opt)\n end\n rescue => error\n __output \"!!! #{__method__}: #{error.class}: #{error.message}\"\n raise error\n end", "def link_path\n File.join('/_attachment', @page_name, name)\n end", "def create_file_from_url_through_active_fedora(env, uri, file_name, auth_header)\n import_url = URI.decode_www_form_component(uri.to_s)\n ::FileSet.new(import_url: import_url, label: file_name) do |fs|\n actor = Hyrax::Actors::FileSetActor.new(fs, env.user)\n actor.create_metadata(visibility: env.curation_concern.visibility)\n actor.attach_to_work(env.curation_concern)\n fs.save!\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", "def web_file_path \n afilePath = building.web_path + SAVE_PATH + id.to_s\n if file_suffix != \"\" && file_suffix != nil\n afilePath = afilePath + \".\" + file_suffix \n end\n\n afilePath\n end", "def get_file_uri_path(uri)\n uri.sub(%r{\\Afile://}, '')\n end", "def get_file_uri_path(uri)\n uri.sub(%r{\\Afile://}, '')\n end", "def attachment_url(attachment_name)\n return unless has_attachment?(attachment_name)\n \"#{database.root}/#{self.id}/#{attachment_name}\"\n end", "def document_attachment\n \"#{Rails.root}/uploads/#{document.url}\"\n end", "def url\n # HACK: Revisit and make configurable separate from the connection options.\n \"http://#{@uploader.sftp_host}/#{path}\"\n end", "def choose_file=(file_name)\n frm.file_field(:name=>\"importPoolForm:_id6.upload\").set(File.expand_path(File.dirname(__FILE__)) + \"/../../data/sakai-cle-test-api/\" + file_name)\n end", "def sample_file(filename='sample_file.txt')\n File.new(\"test/fixtures/attachment-files/#{filename}\")\n end", "def attach_file(card_id, url, mime_type = nil, options = {})\n options = mime_type if mime_type.is_a?(Hash)\n\n uri = URI.parse(url)\n\n if uri.scheme =~ %r{https?}\n options.update url: uri.to_s, mime_type: mime_type\n else\n file = Faraday::UploadIO.new(uri.to_s, mime_type)\n options.update file: file, mime_type: file.content_type\n end\n\n create_card_resource card_id, \"attachments\", options\n end", "def local_url\n File.join(AssetSettings[:local_assets].assets_url_prefix, file_path)\n end", "def file_url\n if paperclip_attachment_attached?\n object.send(attribute_name).url(image_style)\n elsif activestorage_attachment_attached?\n attachment = object.send(attribute_name)\n\n if attachment.representable?\n attachment.representation(resize: \"400x150>\")\n else\n attachment.service_url\n end\n end\n end", "def url; \"file:#{@root}\"; end", "def url_for_userfile(userfile)\n File.join(url_for_browsing,userfile.name)\n end", "def raw_url(file_name)\n fail('Requires implementation')\n end", "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end", "def attach_files(files)\n # BY RIK\n files = [files] unless(files.is_a?(Array))\n files.each do |file|\n file.to_options!\n filename = file[:url]\n assit(filename)\n options = file[:options] || {}\n records = TaliaCore::DataTypes::FileRecord.create_from_url(filename, options)\n records.each {|rec| self.data_records << rec}\n end\n end", "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end", "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end", "def path\n file.url\n end", "def get_test_file_path(host, file_rel_path)\n File.join(@host_test_tmp_dirs[host.name], file_rel_path)\nend", "def get_test_file_path(host, file_rel_path)\n File.join(@host_test_tmp_dirs[host.name], file_rel_path)\nend", "def get_url_from_attachment(rally_attachment, filename)\r\n attachment_oid = rally_attachment[\"ObjectID\"].to_s\r\n return \"/slm/attachment/#{attachment_oid}/#{filename}\"\r\n end", "def data_uri\n data = Base64.encode64(File.open(@path, 'r').read).gsub(/\\n/, '')\n \"data:#{mime_type};base64,#{data}\"\n end", "def get_file_html_url(args_hash)\n attachment = args_hash[:attachment]\n image_name = args_hash.has_key?(:image_name) ? args_hash[:image_name] : 'myself'\n get_file_url(attachment, image_name) if attachment\n end", "def extract_url(resource)\n rails_blob_path(resource, disposition: 'attachment', only_path: true)\n end", "def file_path; end", "def file_url(uid, info = {}, content_type: nil, content_disposition: nil, **options)\n options[:response_content_type] ||= content_type\n options[:response_content_disposition] ||= content_disposition\n\n object(uid).presigned_url(:get, **options)\n end", "def upload_file(locator, file_path)\n if File.exist?(file_path)\n self.attach_file(locator, file_path)\n else\n raise \"File #{file_path} not found.\"\n end\n end", "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", "def download_url\n ActiveStorage::Current.host = Rails.application.routes.default_url_options[:host] if ActiveStorage::Current.host.blank?\n file.attached? ? file.blob.url : ''\n end", "def attachment_uri(attachment_name)\n return unless has_attachment?(attachment_name)\n \"#{database.uri}/#{self.id}/#{attachment_name}\"\n end", "def file=(a)\n @file = a\n @real_fname = a\n end", "def _set_file(name, contents)\n File.open(\"%s/%s\" % [uri, name], \"w\") { |io| io.write contents }\n end", "def direct_upload_url=(escaped_url)\n write_attribute(:direct_upload_url, (CGI.unescape(escaped_url) rescue nil))\n end", "def file_path\n end", "def response_uri(file)\n file.base_uri\n end", "def attach_files(files)\n files = [files] unless(files.is_a?(Array))\n files.each do |file|\n file.to_options!\n filename = file[:url]\n assit(filename)\n options = file[:options] || {}\n # BEGIN BY RIK\n talia_file = TaliaFile.new\n talia_file.assign_random_id\n talia_file[N::RDFS.label] << File.basename(filename)\n records = TaliaCore::DataTypes::FileRecord.create_from_url(filename, options)\n records.each do |rec|\n talia_file.data_records << rec\n end\n talia_file[N::TALIA.isFileOf] = self\n self[N::TALIA.hasFile] << talia_file\n # talia_file.save!\n # END BY RIK\n end\n end", "def migrate_user url, user\n \n # make sure the url contains file stack\n return unless url.start_with? 'https://cdn.filepicker.io'\n\n open('migrated.jpg', 'wb') do |file|\n \n file << open(url).read\n \n #upload the file to the user\n attachment = ActionDispatch::Http::UploadedFile.new(tempfile: file, filename: \"migrated\", type: \"image/jpg\")\n user.avatar_src = attachment\n user.save!\t\n end\nend", "def setFileName(path)\n end", "def swfupload_file=(data)\n self.photo_attach = data\n end", "def upload_file(element, file_path)\n puts file_path\n element.send_keys(file_path.tr('/', '\\\\'))\n end", "def create_file_from_url_through_valkyrie(env, uri, file_name, auth_header)\n import_url = URI.decode_www_form_component(uri.to_s)\n fs = Hyrax.persister.save(resource: Hyrax::FileSet.new(import_url: import_url, label: file_name))\n actor = Hyrax::Actors::FileSetActor.new(fs, env.user, use_valkyrie: true)\n actor.create_metadata(visibility: env.curation_concern.visibility)\n actor.attach_to_work(env.curation_concern)\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", "def get_attachment_path filename, event_id\n Rails.root.join('public', 'files', 'attachments', event_id, filename)\n end", "def initialize_file(safebox_guid, file_params)\n handle_error { sendsecure_connection.post(\"/api/v2/safeboxes/#{safebox_guid}/uploads\", file_params) }\n end" ]
[ "0.640523", "0.633322", "0.62844163", "0.62844163", "0.62150997", "0.61867374", "0.6148343", "0.6095905", "0.60837704", "0.5970621", "0.59636235", "0.5941506", "0.59170514", "0.58973026", "0.58905023", "0.58846337", "0.5863085", "0.58619845", "0.5849972", "0.5843298", "0.58366287", "0.58267796", "0.5771053", "0.574859", "0.57400805", "0.5688172", "0.5688172", "0.5683907", "0.5672629", "0.56692815", "0.5667636", "0.5664653", "0.56570977", "0.565609", "0.56483793", "0.5646597", "0.56395906", "0.56257874", "0.5604279", "0.55653566", "0.556424", "0.55637884", "0.5557445", "0.5532382", "0.5532382", "0.55267423", "0.55192626", "0.5515212", "0.5508916", "0.5500624", "0.5492465", "0.54884666", "0.54722995", "0.54625064", "0.5455446", "0.5445615", "0.5438008", "0.5431754", "0.54278487", "0.54030955", "0.5402769", "0.5396237", "0.5395652", "0.5390469", "0.53852355", "0.53847253", "0.53738314", "0.5373352", "0.5369663", "0.5356421", "0.5352862", "0.5352706", "0.5352629", "0.5352629", "0.53494793", "0.5343496", "0.5343496", "0.5340002", "0.5339551", "0.5316167", "0.53065574", "0.5303827", "0.53005284", "0.5293883", "0.5291367", "0.5283161", "0.52793616", "0.5276142", "0.5269971", "0.52665615", "0.5261144", "0.525435", "0.5254332", "0.5251966", "0.5250888", "0.5241466", "0.52365804", "0.52363795", "0.52348244", "0.5229575" ]
0.59422004
11
phase 2 time complexity= O(n) b/c iterating once through loop
def my_min(list) i = 0 min = list[0] while i < list.length - 1 if list[i + 1] < min min = list[i + 1] end i += 1 end min end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_then_iterate_two_sum(array, target)\n hash = {}\n array.each.with_index do |i, index|\n hash[i] = index\n end\n indexes = []\n array.each.with_index do |ii, index|\n complement = target - ii \n if hash.has_key?(complement) && hash.fetch(complement) != index\n indexes.push(index, hash.fetch(complement))\n return indexes\n end\n end\nend", "def lcs_phase_two(arr)\n return arr.max if arr.max < 0 #edge case\n\n current = 0\n largest = 0\n\n arr.each do |ele|\n current += ele\n current = 0 if current < 0 #bookmark\n largest = current if largest < current\n end\n\n largest\nend", "def phase_two(arr)\n min = arr[0]\n arr.each do |ele|\n if ele < min\n min = ele\n end\n end\n\n min\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend", "def two_sum\n output = []\n \n i = 0\n while i < self.length - 1\n j = i + 1\n while j < self.length\n output << [i, j] if self[i] + self[j] == 0\n j += 1 \n end\n i += 1\n end\n\n output.empty? ? nil : output\n end", "def one_pass_two_sum(array, target)\n hash = {}\n array.each.with_index do |i, index|\n complement = target - i\n if hash.has_key?(complement)\n return [hash.fetch(complement), index]\n end\n hash[i] = index\n end\nend", "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def brute_force_two_sum(array, target)\n indexes = []\n array.each.with_index do |n1, index1|\n array.each.with_index do |n2, index2|\n indexes.push(index1) if target - n1 == n2 && index1 != index2\n end\n end\n indexes\nend", "def solution(a)\n n = a.size\n passing_cars = 0\n\n suffix_sums = Array.new(n + 1, 0)\n\n a.reverse.each_with_index do |elem, i|\n suffix_sums[i + 1] = suffix_sums[i] + elem\n end\n suffix_sums.reverse!\n\n a.each_with_index do |car, i|\n if car == 0\n passing_cars += suffix_sums[i]\n end\n end\n\n passing_cars > 1_000_000_000 ? -1 : passing_cars\nend", "def two_sum_brute nums\n (0...nums.length).each do |i|\n ((i + 1)...nums.length).each do |j|\n if nums[i] + nums[j] == 0\n return i, j\n end\n end\n end\n nil\nend", "def two_sum\n i = 0\n return_array = []\n (i...self.count - 1).each do |index_one|\n (i + 1...self.count).each do |index_two|\n el_one = self[index_one]\n el_two = self[index_two]\n if el_one != 0 && el_two != 0\n return_array << [index_one, index_two] if el_one + el_two == 0\n end\n end\n end\n return_array\n end", "def sorted_squares(nums)\n # This takes O(n)\n nums.map! { |num| num**2 }\n # This can take Ο(n logn)\n bubble_sort(nums)\nend", "def two\n first = 1\n second = 2\n third = 0\n acc = second #initialized to first even term\n begin\n third = first + second\n if third > 4000000\n break\n end\n puts third\n if third%2 == 0\n acc+=third\n end\n first = second\n second = third\n end while true\n acc\nend", "def solution(a)\n # write your code in Ruby 2.2\n\n # sort a\n a = a.sort\n odd = 0\n\n # loop over the array\n (0..(a.length-1)).step(2) do |i|\n if((i+1 >= a.length) || ((i+1 < a.length) && (a[i] != a[i+1])))\n odd = a[i]\n break\n end\n end\n\n odd\nend", "def move_zeros(array)\n zero_count = 0\n # O(n)\n array.each do |num|\n\n zero_count += 1 if num == 0\n end\n\n # O(n)\n array = array.select { |num| num != 0 }\n \n # O(1)\n zero_count.times do\n array += [0]\n end\n\n array\nend", "def iterativeMap(list)\n list.each do |i|\n list[i-1] = list[i-1] * 2\n end\n return list\nend", "def find_amicables(n)\n pairs = []\n sum = 0\n for i in 0..n do \n next if pairs.include? i\n d = sum_proper_divisors(i)\n next if d == i\n p = sum_proper_divisors(d)\n if p == i \n pairs << d\n pairs << i\n sum += d + i\n end\n end\n return sum\nend", "def two_sum(nums, target)\n # i,j = 0, nums.length-1\n i = 0\n j = nums.length-1\n output = []\n while i < nums.length-1\n while j > i\n if nums[i] + nums[j] == target\n output << i << j\n end\n j-=1\n end\n i+=1\nend\nreturn output #returning index\nend", "def lAS(n: 0)\n array = [1]\n puts \"#{array.inspect}\"\n previous = array.first\n new_array = []\n counter = 0\n \n n.times do\n previous = array.first\n counter = 0\n new_array = []\n \n array.each do |element|\n if(element == previous)\n counter = counter + 1\n else\n new_array << counter\n new_array << previous\n counter = 1\n previous = element\n end\n end\n \n new_array << counter\n new_array << previous\n array = new_array.dup\n puts \"#{array.inspect}\"\n end\nend", "def findDiffSquares(n)\n sum = 0\n (1..n).each { |i|\n (1..n).each { |j|\n sum += i*j unless i == j\n }\n }\n sum\nend", "def three_sum_fastest(arr)\n count = 0\n\n (0..arr.length - 2).each { |i|\n set = Set.new\n\n (i + 1..arr.length - 1).each { |j|\n if set.include?(-arr[i] - arr[j])\n count += 1\n end\n\n set.add(arr[j])\n }\n }\n count\nend", "def two_sum(array)\n pairs = []\n\n array.count.times do |i1|\n (i1 + 1).upto(array.count - 1) do |i2|\n pairs << [i1, i2] if array[i1] + array[i2] == 0\n end\n end\n\n pairs\nend", "def two_sum(arr) #o(ns)\n set = Set.new\n arr.each{|el| set << el}\n arr.select{|el| set.include?(-1 * el)}\nend", "def two_sum(nums)\n if nums.length <2\n return nil\n end\n i = 0\n while i<nums.length\n b = i+1\n while b < nums.length\n if nums[i] + nums[b] == 0\n return [i,b]\n end\n b +=1\n end \n i+=1\n end\n return nil\nend", "def two_sum(nums)\n\titer = 0\n\tsum = 0\n\twhile iter < nums.length\n\t\titer2 = iter + 1\n\t\twhile iter2 <nums.length\n\t\t\tif nums[iter] + nums[iter2] == 0\n\t\t\t\treturn [iter, iter2]\n\t\t\tend\n\t\t\titer2+=1\n\t\tend\n\t\titer+=1\n\tend\n\n\treturn nil\nend", "def solution(m, a)\n n = a.count\n result = 0\n front = 0\n numbers = Array.new(m + 1, false)\n n.times { |back|\n while front < n and not numbers[a[front] - 1]\n numbers[a[front] - 1] = true\n front += 1\n result += front - back\n return 1_000_000_000 if result >= 1_000_000_000\n end\n numbers[a[back] - 1] = false\n }\n result\nend", "def running_time(array)\n cnt = 0\n (1...(array.length)).each do |x|\n y = x\n while y.positive?\n break unless array[y - 1] > array[y]\n\n temp_num = array[y]\n array[y] = array[y - 1]\n array[y - 1] = temp_num\n cnt += 1\n y -= 1\n end\n end\n cnt\nend", "def solution(a)\n # write your code in Ruby 2.2 \n frecuencies = a.each_with_object(Hash.new(0)) { |key, value| value[key] += 1 } \n \n frecuencies.each do |key, value|\n if value.odd? then return key end\n end\nend", "def icecreamParlor(m, arr)\n # Complete this function\n res = []\n arr.each_index do |i|\n if i + 1 !=nil\n j = i + 1\n while j <= arr.length - 1\n if arr[i]+arr[j] == m\n res.push([i+1,j+1])\n end\n j+=1\n end\n end\n end\n res\nend", "def two_sum(arr)\n output = []\n (0...arr.length).each do |idx1|\n (idx1+1...arr.length).each do |idx2|\n output << [idx1, idx2] if arr[idx1] + arr[idx2] == 0\n end\n end\n output\nend", "def moveZeroes(nums)\n slow = fast = 0\n while fast<nums.size do\n if not nums[slow]==0 then\n slow += 1\n elsif nums[fast]!=0 then\n nums[slow] ^= nums[fast]\n nums[fast] ^= nums[slow]\n nums[slow] ^= nums[fast]\n slow += 1\n end\n fast += 1\n end\n nums\nend", "def two_sum(nums, target)\n results = []\n i = 1\n while i < nums.length\n diff = target - nums[i - 1]\n if nums[i..-1].include?(diff)\n idx = nums[i..-1].index(diff)\n results << i - 1 << idx + i\n end\n\n i += 1\n end\n\n results\nend", "def solution(a)\n n = a.size\n return 0 unless n > 2\n a.sort!\n\n (2..n - 1).each do |i|\n return 1 if a[i - 2] + a[i - 1] > a[i]\n end\n\n return 0\nend", "def two_sum(nums, target)\n table = {}\n i = 0\n while i < nums.length\n table[target - nums[i]] = i\n i += 1\n end\n \n j = 0\n while j < nums.length\n if table.key?(nums[j]) && j != table[nums[j]]\n return [j, table[nums[j]]] \n end\n j += 1\n end\nend", "def two_sum?(array, target)\n #O(n)\n hash = Hash.new(0)\n i = 1\n array.each do |ele|\n hash[ele] = i \n i += 1\n end\n hash.each_key do |k|\n return true if hash.has_key?(target - k) && hash[k] != hash[target - k]\n end\n false \nend", "def three_sum_fast(arr)\n arr = merge_sort(arr)\n count = 0\n\n (0..arr.length - 1).each { |i|\n (i + 1..arr.length - 1).each { |j|\n if bin_search(arr, -arr[i] - arr[j]) > j\n count += 1\n end\n }\n }\n count\nend", "def solution(a)\n cars_going_east = [0]\n\n a.each do |direction|\n next_counter = direction.zero? ? cars_going_east.last + 1 : cars_going_east.last\n cars_going_east << next_counter\n end\n\n passings = 0\n a.each_with_index do |direction, index|\n passings += cars_going_east[index] if direction == 1\n end\n\n return -1 if passings > 1000000000\n passings\nend", "def odd_occurances_in_array(a)\n res = 0\n a.each { |el| res ^= el }\n res\nend", "def two_sum(nums)\n output = []\n nums.size.times do |idx|\n 1.upto(nums.size - (idx + 1)) do |plus_idx|\n if nums[idx] + nums[idx + plus_idx] == 0\n output += [idx, idx + plus_idx]\n end\n end\n end\n output.empty? ? nil : output\nend", "def determine_pair(main_code)\n #double for loop?\n test_code = main_code.clone\n\n for i in (0..99) do\n\n test_code[1] = i\n\n for i in (0..99) do\n test_code[2] = i\n computed = test_code.clone\n computer(computed)\n if computed[0]==19690720\n puts \"When origin=19690720, noun= #{test_code[1]}, verb=#{test_code[2]}\"\n\n end\n\n end\n\n end\n\nend", "def bf_inversions arr\n count = 0\n (0...arr.size).each do |i|\n ((i+1)...arr.size).each do |j|\n count+=1 if arr[i] > arr[j]\n end\n end\n count\nend", "def part_two(input)\n found = false\n cleaned = input.each_with_index.map { |v, i| [v, i] unless v == 'x' }.compact\n iter = cleaned.map(&:first).max\n index = cleaned.map(&:first).find_index(iter)\n t = iter\n until found\n t += iter\n puts \"#{t}\"\n found = true\n v = t - index\n cleaned.each do |bus, i|\n if (v + i) % bus != 0\n found = false\n break\n end\n end\n end\n t\nend", "def find_it(seq)\n seq.each do |e|\n a = seq.count(e)\n e if (a % 2).odd?\n end\nend", "def pairs_to_zero(nums)\n\n count = 0\n newArr = []\n\n for i in 0..nums.length do\n for j in 1..nums.length do\n if nums[i].to_i + nums[j].to_i == 0\n count = count + 1\n end\n end\n end\n return count-2\nend", "def josephus_survivor(n,k)\n result = 1\n for i in 1...n + 1\n result = (result + k - 1) % i + 1\n end\n \n result\nend", "def solution_slow_2(n, p, q)\n sieve = sieve_of_erathosteneses(n)\n # puts \"sieve:#{sieve}\"\n semi = semiprimes(n, sieve)\n # puts \"sp:#{semi}\"\n prefix = [0,0,0,0,1]\n 5.upto(n) do |x|\n if semi.include? x \n prefix << prefix.last + 1\n else\n prefix << prefix.last\n end\n end\n # puts \"prefix:#{prefix}\"\n\n queries = [p,q].transpose\n\n\n res = queries.map do |query|\n prefix[query.last] - prefix[query.first - 1]\n end\n\n # puts \"res:#{res}\"\n\n res\n end", "def even_sum(arr)\n arr.each_with_object([]){|elem, array|array<< elem.reverse if elem.length % 2 == 0}\nend", "def two_sum(nums, target)\r\n numsLen = nums.size\r\n returnArr = Array.new(2,0)\r\n myHashTable = {nums[0]=>0}\r\n temp = 0\r\n \r\n if numsLen < 2\r\n return returnArr\r\n else\r\n for i in 1..numsLen-1\r\n temp = target - nums[i]\r\n if myHashTable.has_key?(temp) == true\r\n returnArr[0] = myHashTable[temp]\r\n returnArr[1] = i\r\n break\r\n else\r\n myHashTable.store(nums[i],i)\r\n end\r\n end\r\n end\r\n return returnArr\r\nend", "def two_sum(num)\n\n i = 0\n arr = []\n \n while i < num.length\n \t\n num.each do |a|\n \n if a + num[i] == 0\n \t arr.push(num.index(a))\n end\n \n end\n \t\n i += 1\nend\n\t if arr.length > 0\n \t return arr.reverse\n else\n \t return nil\n end\n \nend", "def phase_ii(s1, s2)\n del_dex = []\n s1 = s1.chars\n s2 = s2.chars\n s1.each_with_index do |el, idx|\n if s2.include?(el)\n del_dex << idx\n s2.delete_at(s2.index(el))\n end\n end\n del_dex.each { |i| s1[i] = nil }\n return s1.select { |el| !el.nil? }.empty? && s2.empty?\nend", "def solution(a)\n # write your code in Ruby 2.2\n num_of_elements=a.length\n num_of_zeros=0\n tot_num_car_pairs=0\n a.each do |element|\n if element == 0\n num_of_zeros+=1\n else\n tot_num_car_pairs+=num_of_zeros\n end\n end\n return tot_num_car_pairs>1_000_000_000?-1:tot_num_car_pairs\nend", "def two_sum(nums)\n idx1 = 0\n while idx1 < nums.length\n idx2 = idx1 + 1\n while idx2 < nums.length\n if nums[idx1] + nums[idx2] == 0\n return [idx1, idx2]\n end\n\n idx2 += 1\n end\n\n idx1 += 1\n end\n\n return nil\nend", "def two_sum(nums)\n idx1 = 0\n while idx1 < nums.length\n idx2 = idx1 + 1\n while idx2 < nums.length\n if nums[idx1] + nums[idx2] == 0\n return [idx1, idx2]\n end\n\n idx2 += 1\n end\n\n idx1 += 1\n end\n\n return nil\nend", "def two_sum(nums)\n idx1 = 0\n while idx1 < nums.length\n idx2 = idx1 + 1\n while idx2 < nums.length\n if nums[idx1] + nums[idx2] == 0\n return [idx1, idx2]\n end\n\n idx2 += 1\n end\n\n idx1 += 1\n end\n\n return nil\nend", "def two_sum(nums, target)\n\tnum_len = nums.length\n\tdic = {}\n\ti = 0 \n while i < num_len\t\n \tnumber = nums[i]\n \tif number == target / 2 && dic[number]\n \t\treturn [dic[number],i]\n \tend\n \tdic[number] = i\n \tmaybe = dic[target-number]\n \tif maybe && maybe != i\n \t\treturn [maybe,i]\n \t\tbreak\n \tend\n i += 1\n end\nend", "def find_even_index(arr)\n i = 0\n a = 0\n b = 1\n for i in 0...arr.length\n a = arr.slice(0, i).sum\n b = arr.slice(i + 1, arr.length - 1).sum\n if a != b && i == arr.length - 1\n return -1\n elsif a != b\n i += 1\n else\n return i\n end\n end\nend", "def test(arr)\n arr.map do |el|\n arr.inject(1) do |memo, el2|\n next memo if arr.index(el2) == arr.index(el)\n memo * el2\n end\n end\nend", "def f(n)\n # your code here\n result = []\n possibles = (2..n).flat_map{ |s| [*2..n].combination(s).map(&:join).to_a }\n p possibles\n possibles.each do |i|\n x = 0\n temp_arr = []\n temp = i.split('').map { |j| j.to_i }\n p temp\n while x < temp.length do \n if i[x + 1] != i[x] + 1 || i[x + 1] == nil\n temp_arr << i[x]\n end\n x += 1\n end\n result << temp_arr\n end\n result.length\nend", "def true_two_sum(arr, targ)\n\n arr_hash = Hash.new\n\n arr.each { |el| arr_hash[n] = true }\n\n arr.each { |el| return arr_hash[targ - el] if arr_hash[targ - el] }\n false \nend", "def two_sum(nums, target)\n indices_array = []\n i = 0\n while i < nums.length\n j = i + 1\n while j < nums.length\n if nums[i] + nums[j] == target\n indices_array << i\n indices_array << j\n end\n j += 1\n end\n i += 1\n end\n return indices_array\nend", "def sluggish_octopus!(array)\n sorted = false\n until sorted\n sorted = true\n array.each_index do |index|\n index_2 = index + 1\n next if index_2 == array.length\n if array[index].length > array[index_2].length\n array[index],array[index_2] = array[index_2],array[index]\n sorted = false\n end\n end\n end\n array[-1]\nend", "def hash_two_sum(arr,target_sum)\n #creates a new hash with each element that is satisfying the target_sum\n hash = Hash.new(0) #{|h,k| h[k] = []}\n (0...arr.length).each { |i| hash[i] = arr[i]} #O(n)\nend", "def pairSumSequence(n)\n sum = 0\n\n for i in 0..n\n # pairSum calls do not exist simultabeously on\n # the call stack, so you only need O(1) space\n sum += pairSum(i, i + 1)\n puts \"sum += (#{i + i + 1}) #{i} + #{i} + 1 \"\n end\n\n return sum\nend", "def two_sums(nums)\n output = []\n idx = 0\n idx2 = idx + 1\n\n while idx < nums.length\n idx2 = idx + 1\n while idx2 < nums.length\n output += [idx, idx2] if nums[idx] + nums[idx2] == 0\n idx2 += 1\n end\n idx += 1\n end\n\n output.empty? ? nil : output\nend", "def my_min2 # O(n) time complexity\n smallest = self.first\n self.each do |num|\n sleep(1)\n smallest = num if num < smallest \n end\n smallest\n end", "def solution2(a)\n\n counts = Hash.new(0)\n\n a.each do |int|\n counts[int] += 1\n end\n\n non_divisors = []\n\n a.each do |int|\n div_count = 0\n for i in 1..int do\n div_count += counts[i] if int % i == 0\n end\n non_divisors << a.length - div_count\n end\n\n non_divisors\n\nend", "def two_sum(numbers, target)\n ##set hash\n hash = {}\n ##set array\n arr = []\n\n numbers.each_with_index do |val, idx|\n if hash.key?(target - val)\n arr.push(hash[target - val])\n arr.push(idx + 1)\n break\n else\n hash[val] = idx + 1\n end\n end\n\n arr\nend", "def odd_even(a)\n\tlen = a.length - 1\n\tis_sorted = 0\n\twhile is_sorted == 0\n\t\tis_sorted = 1\n\t(0..len).step(2) do |j|\n\t\tif (j+1) <= len \n\t\t\tif a[j] > a[j+1]\n\t\t\t\ttemp = a[j]\n\t\t\t\ta[j] = a[j+1]\n\t\t\t\ta[j+1] = temp\n\t\t\t\tis_sorted = 0\n\t\t\tend\n\t\tend\n\tp a,j, \"even\", \"sorted?\", is_sorted\n\tend\n\t(1..len).step(2) do |j|\n\t\tif (j+1) <= len \n\t\t\tif a[j] > a[j+1]\n\t\t\t\ttemp = a[j]\n\t\t\t\ta[j] = a[j+1]\n\t\t\t\ta[j+1] = temp\n\t\t\t\tis_sorted = 0\n\t\t\tend\n\t\tend\n\tp a,j,\"odd\"\n\tend\n\tend\n\treturn a\n\nend", "def freed_prisoners(arr)\n counter = 0\n return counter if arr[0] == 0\n arr.each do |cell|\n if cell == 1\n counter += 1\n arr.map! do |switch|\n if switch == 1\n switch = 0\n else\n swith = 1\n end\n end\n else\n next\n end\n end\n counter\nend", "def caterpillar_method\n result=[]\n i=0\n while(i<self.size/2)\n j=i+1\n while (self[j] && (yield self[i],self[j]))\n result<<[self[i],self[j]]\n j+=1\n end\n i+=1\n end\n return result\n end", "def iter\n f1,f2,k = 1,1,2\n f1,f2,k = f2,f1+f2,k+1 while f2.to_s.size < 1000\n puts k\nend", "def adds_up(nums, target)\n\n i = 0\n while i < nums.length\n j = i + 1\n while j < nums.length\n if nums[i] == target - nums[j]\n return [i, j]\n end\n\n j += 1\n end\n\n i += 1\n end\n\n return []\nend", "def two_sum(nums)\n special = []\n count = 0\n x = nums.length\n i = 0\n j = 1\n while (i < x) && (i + j) < x\n \n if nums[i] + nums[i + j] == 0\n special[count] = i\n count += 1\n special[count] = i + j\n count += 1\n if i + j + 1 < x\n j = j + 1\n else \n i += 1\n j = 1\n end\n \n elsif nums[i] + nums[i+j] != 0 && (i + j + 1) < x\n j = j + 1\n \n elsif nums[i] + nums[i+j] != 0 && (i + j + 1) >= x && (i + 2) < x\n i += 1\n j = 1\n \n elsif i+2 == x && special.length != 0\n i += 3 \n elsif i+2 == x && special.length == 0\n return nil\n end \n end \n return special\nend", "def find3(a, X)\n # scan through array\n # build hash storing complement in each key\n complements = {}\n a.each_with_index do |val, ind|\n if complements[X - val]\n complements[X - val].push(ind)\n else\n complements[X - val] = [ind]\n end\n end\n\n # scan through the array again\n # get complement\n # for each value scan the remainder of the arrray\n # for a value such taht a + b = the complement\n\n # for each character we have built a dictionary such that, we can find\n # x = a + complement\n\n # [1, 2, 3]\n # 1 + 2 = 3\n # 1 + 3 = 4 =>\n\n # for each value in the array (a) look at all following values (b) and see if a + b\n # is in the dictionary, if it is, check that their indices do not collide with the index\n # stored at dict(a+b)\n\n a.each_with_index do |va, i|\n a.each_with_index do |vb, j|\n break if i == j\n\n complement = va + vb\n indices = complements[complement]\n\n indices.each do |z|\n # every index is unique\n return [i, j, z] unless z == i || z == j\n end\n end\n end\n\n return nil\nend", "def two_sum(nums)\n nums.each_with_index do |x, ix|\n nums.each_with_index do |y, iy|\n if ix != iy\n if x + y == 0\n return [ix, iy]\n end\n end\n end\n end\n nil\nend", "def problem3 n\n 2.step(n,1).each do |x|\n return x-1 if n == 1\n n /= x if x.prime? && (n % x == 0)\n end\nend", "def two_sum(nums)\n idx1 = 0\n \n while idx1 < nums.length\n idx2 = idx1 + 1\n \n while idx2 < nums.length\n if nums[idx1] + nums[idx2] == 0\n return [idx1, idx2]\n end\n \n idx2 += 1\n end\n \n idx1 += 1\n end\n \n return nil\n end", "def solution(a)\n return 1 if a.empty?\n a.sort!\n return 1 if a.first > 1\n return a.first + 1 if a.length <2\n (0..(a.length)).each do |index|\n return a[index] + 1 if a[index] + 1 != a[index + 1]\n end\n return a.last + 1\nend", "def two_sum(array, target_sum)\n hash = {}\n array.each do |ele|\n hash[target_sum - ele] = ele\n end \n array.each do |ele|\n # debugger\n return true if !(hash[ele].nil? || hash[ele] == ele) \n end \n false \nend", "def solution(a)\n s= a.sort\n 0.step(s.size - 1).inject(0) do |result, x|\n z= x+2\n (x+1).step(s.size - 1).inject(result) do |acc, y|\n z+=1 while z < s.size && s[x] + s[y] > s[z]\n acc += z-y-1\n end\n end\nend", "def two_sum_to_zero?(array)\n # len = array.length - 1\n # len.times do |i|\n # (i + 1).upto(len) do |j|\n # return true if array[i] + array[j] == 0\n # end\n # end\n # false\n nums_hash = {}\n array.each do |el|\n return true if nums_hash[-(el)]\n nums_hash[el] = true\n end\n false\nend", "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", "def my_min_2(array)#O(n)\n array.inject do |acc, ele|#O(n)\n if acc < ele\n acc\n else\n ele\n end\n end\nend", "def solution(a)\n counter = Hash.new(0)\n a.each do |elem|\n counter[elem] += 1\n end\n\n (1..a.size).each do |number|\n return 0 if counter[number] != 1\n end\n\n 1\nend", "def three_sum(nums)\n n = nums.length\n result = []\n for i in 0...n-2\n req_sum = 0\n hsh = Hash.new\n curr_sum = req_sum - nums[i]\n \n for j in (i+1)...n\n num = curr_sum - nums[j]\n if hsh[num]\n elements = [nums[i], num, nums[j]].sort\n result << elements unless result.include?(elements)\n end\n hsh[nums[j]] = true\n end \n end\n result\nend", "def solution(a)\r\n a.each do |num|\r\n if (a.count(num) % 2) != 0\r\n return num\r\n end\r\n end\r\nend", "def two_sum(nums)\n\n idx1 = 0\n idx2 = 1\n \n while idx1 < nums.length\n idx2 = idx1 + 1 #------>missed this line to increment idx2 for the next round or position\n while idx2 < nums.length\n sum = nums[idx1] + nums[idx2]\n if sum == 0\n return [idx1, idx2]\n end\n idx2 = idx2 + 1\n \n end\n idx1 = idx1 + 1\n \n end\n return nil\n \nend", "def remove_duplicates_two(nums)\n return 0 if nums.empty?\n i = 0\n j = 1\n while j < nums.length\n if nums[i] != nums[j]\n i += 1\n nums[i] = nums[j]\n end\n j += 1\n end\n print nums\n i+1\nend", "def bubble_sort_by(array)\n\tfinal_list = array.clone\n\titerations = (array.length - 1) ** 2\n\ti = 0\n\n\titerations.times do |x|\n\n swap = yield(final_list[i], final_list[i+1])\n \tif swap == -1\n \t\tif i >= array.length - 2\n \t\t i = 0\n \t\telse\n \t\t\ti += 1\n \t end\n \telsif swap == 1\n \t\tfinal_list[i], final_list[i+1] = final_list[i+1], final_list[i]\n \t\t\tif i >= array.length - 2\n \t\t \ti = 0\n \t\t\telse\n \t\t\t\ti += 1\n \t\t\tend\n \telse\n \t if i >= array.length - 2\n \t\t i = 0\n \t\telse\n \t\t\ti += 1\n \t\tend\n \tend\n end\n puts final_list\nend", "def solution(arr)\n zeros = 0\n pass_cars = 0\n\n (0...arr.size).each do |idx|\n arr[idx] == 0 ? zeros += 1 : pass_cars += zeros\n\n return -1 if pass_cars > 1000000000\n end\n\n pass_cars\nend", "def two_sum(numbers, target)\n n_index = {} \n (0...numbers.length).each do |i1|\n i2 = n_index[target - numbers[i1]]\n return [i1 + 1, i2 + 1].sort if i2 && i2 != i1 \n n_index[numbers[i1]] = i1\n end\nend", "def running_total_3(array)\n #total = 0\n #array_new = []\n array.each_with_object([]) do |i,x|\n next if i == 0\n x += array[i-1]\n end\nend", "def solution(a)\n n = a.size\n a.sort!\n\n count = 0\n for i in 0...n-2 do\n k = i+2\n for j in i+1...n-1 do\n while k < n and a[i] + a[j] > a[k] do\n k += 1\n end\n count += k - j - 1\n end\n end\n count\nend", "def collisions(arr)\n new_arr = []\n result = []\n arr.each do |i|\n if i > 0\n new_arr << i\n else\n if new_arr.empty?\n result << i\n else\n if new_arr[-1] == -(i)\n new_arr.pop\n else\n while !new_arr.empty? && new_arr[-1] < -(i)\n new_arr.pop\n end\n if new_arr.empty?\n result << i\n end\n end\n end\n end\n end\n return (result.concat(new_arr))\nend", "def solution(a)\n # write your code in Ruby 2.2\n n = a.length\n \n counter = Array.new(n+1, 0)\n \n a.each do |x|\n counter[x-1] += 1\n end\n \n return counter.index { |x| x == 0 } + 1\nend", "def solution(a)\n len = a.size\n unique = {}\n i = 0\n while i < len\n item = a[i]\n if unique.has_key?(item)\n unique[item] += 1\n else\n unique[item] = 1\n end\n i += 1\n end\n pairs = 0\n unique.each do |key,count|\n (1...count).step {|n| pairs += n }\n end\n return pairs > 1_000_000_000 ? 1_000_000_000 : pairs\nend", "def three_sum(nums)\n return [] if !nums || nums.size < 3\n ans = []\n i = 0 \n size = nums.size\n nums = nums.sort\n while i < size do \n if nums[i] == nums[i - 1] && i > 0 \n i += 1\n next\n end\n\n a = nums[i]\n target = -1 * a\n two_sum(nums[(i + 1)...size], target, a, ans)\n i += 1\n end\n ans\nend", "def pair_sum(arr, target)\n # basic approach is nested loops scanning each element checking if its == to target\n result = []\n i = 0\n j = i + 1\n while i < arr.length\n while j < arr.length\n p i, j\n if i != j && arr[i] + arr[j] == target\n result << [i, j]\n end\n j += 1\n end\n i += 1\n j = i + 1\n end\n result\nend", "def two_sum_zero(array)\n \n i = 0\n while i < array.length - 1\n \n j = i + 1\n while j < array.length\n if array[i] + array[j] == 0\n return true\n end\n \n j += 1\n end\n \n i += 1\n end\n return false\nend", "def two_sum(nums)\n\n\tpositions = []\n\t(0..nums.length-1).each do |n1|\n\t\t(1..nums.length).each do |n2|\n\t\t\tif n1 + n2 == 0\n\t\t\t\tpositions << [n1,n2]\n\t\t\tend\n\t\tend\n\tend\n\n\tpositions\n\nend", "def two_sum(nums, target)\n index_of_complement = {}\n (0...nums.size).each do |i|\n if index_of_complement.key?(nums[i]) \n return [index_of_complement[nums[i]], i] \n else\n index_of_complement[target - nums[i]] = i\n end\n end\nend" ]
[ "0.6220414", "0.60307246", "0.60144436", "0.5946644", "0.5867412", "0.58618104", "0.5859785", "0.5846517", "0.5846439", "0.5836396", "0.58059937", "0.5803444", "0.5802831", "0.5777269", "0.57598317", "0.5749091", "0.5745194", "0.57386845", "0.57141775", "0.5694705", "0.56698954", "0.56696385", "0.5664306", "0.56554914", "0.5638841", "0.56232065", "0.5608295", "0.5607951", "0.56023616", "0.5596276", "0.559394", "0.55883807", "0.5570553", "0.5569244", "0.5567489", "0.5562353", "0.5559909", "0.55540687", "0.55292135", "0.55267715", "0.55123526", "0.55092263", "0.5507227", "0.5507044", "0.5505681", "0.5503985", "0.54994965", "0.5497621", "0.5496445", "0.54917234", "0.5484103", "0.54811263", "0.54811263", "0.54811263", "0.5479138", "0.5477618", "0.5477449", "0.5476995", "0.54767734", "0.5476461", "0.54736197", "0.5463591", "0.54622436", "0.5461161", "0.54571205", "0.54569674", "0.5456243", "0.5454247", "0.5453419", "0.54488164", "0.54469997", "0.54417074", "0.54383165", "0.54379296", "0.54375935", "0.5434947", "0.5433442", "0.54244214", "0.5423429", "0.5419764", "0.5419319", "0.5416417", "0.54148155", "0.5414778", "0.54122514", "0.5411811", "0.5410305", "0.5408949", "0.54082173", "0.5403067", "0.54018486", "0.5401749", "0.5398415", "0.5391279", "0.53887427", "0.53844637", "0.5384298", "0.5376395", "0.5376228", "0.53757244", "0.5369796" ]
0.0
-1
Phase 1 : O(n^3) because using .sum on sub_arr, which is n^2
def largest_contiguous_subsum_one(list) sub_arr = [] sum = 0 list.each_with_index do |ele, i| (i...list.length).each do |i2| sub_arr << list[i..i2] end end sub_arr.each do |arr| if arr.sum > sum sum = arr.sum end end sum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bad_contig_subsum(arr)\n # n! || n^3 ?\n sub_arrays = []\n arr.each_index do |i|\n (i...arr.length).each do |j|\n sub_arrays << arr[i..j]\n end\n end\n\n # above * n^2 ? << bottleneck\n max = sub_arrays.first.inject(&:+)\n sub_arrays.each do |sub_arr|\n sub_sum = sub_arr.inject(&:+)\n max = sub_sum if sub_sum > max\n end\n max\nend", "def sub_sum2(array)\n arr = []\n sum = 0\n array.each do |el|\n arr << [el] \n end\n array.each do |el|\n array.shift\n arr << array\n end\n # p arr\n result = 0\n arr.each do |set|\n if set.reduce(:+) > result\n result = set.reduce(:+)\n end \n end \n result\nend", "def contig_subarrs_that_sum_to_k(k, arr) # so this problem worked with contiguous subarrays that sum to a value k\n # for example, arr[j] - arr[i] vs. arr[j]\n # if you do a running sum, any difference that equals k is what we're looking for.\n # then we can increment a counter, we can save j - i for a max size, or we can even grab the subarray.\n running_sum = 0\n arr.each_with_index do |el, index|\n end\nend", "def better_contig_subsum(arr)\n max_sum = arr.inject(&:+) # O(n)\n temp_sum = max_sum\n\n loop do # O(n)\n left = temp_sum - arr.first\n right = temp_sum - arr.last\n\n if arr.length == 1\n if arr.first > max_sum\n return arr.first\n else\n return max_sum\n end\n end\n\n if right >= left\n max_sum = right if right >= max_sum\n temp_sum = right\n arr.pop\n else\n max_sum = left if left >= max_sum\n temp_sum = left\n arr.shift\n end\n end\n\n max_sum\nend", "def largest_contiguous_subsum(arr)\n\n\nend", "def better_subsum(arr) # o(n)\n largest = 0 \n sum = 0 \n i = 0 \n j = 0\n\n while i != arr.length-1\n largest += arr[j]\n sum = largest if largest > sum \n if j == arr.length-1 \n i+=1 \n j = i \n largest = 0 \n else\n j+=1\n end \n end \n sum \n end", "def largest_contiguous_subsum(arr)\r\n all_sub_arrays = [] # space : O(n^2)\r\n\r\n (0...arr.length).each do |i|\r\n (i...arr.length).each do |i2|\r\n all_sub_arrays << arr[i..i2] # slice makes n^3\r\n end\r\n end\r\n\r\n all_sub_arrays.map { |sub_arr| sub_arr.sum }.max # O(n^2)\r\nend", "def largest_contiguous_subsum_slow(arr)\n res = arr.first\n (0...arr.length - 1).each do |i|\n (i+1...arr.length).each do |j|\n tmp_sum = arr[i..j].reduce(:+)\n res = tmp_sum if tmp_sum > res\n end\n end\n return res\nend", "def large_contig_subsum2(arr)\n timestart = Time.now\n max_sum = 0\n curr_sum = 0\n i = 0\n while i < arr.length\n if arr[i] + curr_sum > 0\n curr_sum += arr[i]\n max_sum = curr_sum if curr_sum > max_sum\n else\n curr_sum = 0\n end\n i += 1\n end\n\n p (Time.now - timestart) * 1000\n max_sum\nend", "def total_in_subarr(arr)\n sum = 0\n for item in arr do\n sum += item\n end\n sum\nend", "def subs_sums(arr)\n new_arr = []\n i = 0 \n while i < arr.length \n x = i \n sub_arr = []\n\n while x < arr.length \n sub_arr << arr[i..x]\n x += 1\n end\n new_arr += sub_arr\n i += 1 \n end\n\n big = arr.min \n\n new_arr.each do |sub_arr|\n \n if sub_arr.sum > big\n big = sub_arr.sum\n end\n end\n big\nend", "def sub_sum(list)\n sub_arr = []\n (0...list.length).each do |i| #O(n)\n (i...list.length).each do |j| #O(n)\n sub_arr << list[i..j] if i <= j\n end\n end\n largest_continuous_sub_sum1(sub_arr)\nend", "def sub_sum(array)\n sums = []\n i = 0\n j = 0\n\n while i < array.length\n while j < array.length\n sums << array[i..j]\n j += 1\n end\n i += 1\n j = i\n end\n sums.sort_by{|x| x.reduce(:+)}.last.reduce(:+)\n end", "def generic_sub_array_with_sum(arr, sum)\n sum_array = Array.new(arr.size+1) { Array.new(sum+1) } \n sub_array(arr, 0, sum, sum_array)\nend", "def largest_contiguous_subsum_v2(arr) # O(n)\n\n largest_sum = arr[0]\n current_sum = arr[0]\n \n (1...arr.length).each do |i|\n if current_sum < 0\n if current_sum < arr[i]\n current_sum = arr[i]\n end\n else\n current_sum += arr[i]\n end\n if current_sum > largest_sum\n largest_sum = current_sum\n end\n end\n largest_sum\nend", "def large_contig_subsum1(arr)\n timestart = Time.now\n sub_arrs = []\n\n\n arr.each_with_index do |el, idx|\n\n count = 0\n while idx+count < arr.length\n sub_arrs << arr[idx..idx+count]\n count+=1\n end\n end\n\n\n sum_arr = []\n sub_arrs.each do | sub_arr |\n sum_arr << sub_arr.reduce(:+)\n end\n\n max = sum_arr.max\n p (Time.now - timestart) * 1000\n max\nend", "def largest_contiguous_subsum1(array)\n sub_array = []\n\n array.each_index do |i|\n array.each_index do |j|\n next if i > j\n sub_array << array[i..j]\n end\n end\n sum = sub_array.first.inject(:+)\n sub_array.each do |el|\n sum = el.inject(:+) if el.inject(:+) > sum\n end\n sum\nend", "def largest_contiguous_sub_sum1(arr)\n subarrays = []\n arr.each_with_index do |num1, i|\n arr.each_with_index do |num2, j|\n subarrays << arr[i..j] if i <= j\n end\n end\n\n subarrays.map! do |subarray|\n subarray.sum\n end\n\n subarrays.sort[-1]\nend", "def largest_contiguous_subsum2(arr)\n answer = arr[0]\n current_sum = arr[0] \n arr.each_with_index do |ele,idx|\n if idx == 0 \n current_sum = arr[idx]\n answer = current_sum\n elsif current_sum > 0 \n current_sum += arr[idx] \n answer = current_sum unless answer > current_sum \n else\n current_sum = arr[idx]\n end\n end\n answer\nend", "def largest_contiguous_subsum(arr)\r\n # sub_arr = []\r\n # (0...arr.length).each do |idx|\r\n # (idx...arr.length).each do |idx_2| \r\n # sub_arr << arr[idx..idx_2]\r\n # end\r\n # end\r\n # p sub_arr.length \r\n # sub_arr.map {|sub| sub.sum }.max\r\n max = arr.first #8\r\n curr = arr.first #8\r\n arr.drop(1).each do |ele| \r\n curr = 0 if curr < 0\r\n curr += ele\r\n max = curr if curr > max\r\n end\r\n max\r\nend", "def largest_contiguous_subsum(arr)\n \n curr_sum = arr.first\n largest_sum = arr.first\n (1...arr.length).each do |i| \n if curr_sum < 0\n curr_sum = 0 #reset\n end\n\n curr_sum += arr[i] \n \n if curr_sum > largest_sum \n largest_sum = curr_sum\n end\n end\n largest_sum\nend", "def contiguous_sub_array_sum(array, target)\n sum = 0\n last_value = array.first\n n = array.length\n (1..(n - 1)).each do |i|\n \n end\nend", "def contig_subsum(array)\n sub_arrays = []\n i = 0\n j = 0\n while i < array.length do\n while j < array.length do\n sub_arrays << array[i..j]\n j += 1\n end\n i += 1\n j = i\n end\n\n max_sum = 0\n arr = []\n\n sub_arrays.each do |sub|\n arr << sub.inject(:+)\n end\n\n arr.uniq.sort.last\n\nend", "def largest_contiguous_subsum(arry)\n sums = 0\n size = arry.length\n\n (0..size - 1).each do | i|\n sub = []\n (i + 1..size).each do |j|\n sub = arry[i..j]\n if sub.sum > sums\n sums = sub.sum \n end\n end\n end\n sums\nend", "def largest_contiguous_subsum2(array)\n largest_sum = array.first\n current_sum = array.first\n\n (1..array.length-1).each do |i|\n current_sum = 0 if current_sum < 0\n current_sum += array[i]\n largest_sum = current_sum if current_sum > largest_sum\n end\n largest_sum\n \nend", "def largest_contiguous_subsum_v1(arr)\n subs = [] # ( +2 )\n\n (0...arr.length).each do |idx1| # ( n )\n (idx1..arr.length - 1).each do |idx2| # ( n )\n subs << arr[idx1..idx2].sum # ( n * ( 1 + ))\n end\n end\n\n subs.max # ( n )\nend", "def sub_sum_2(list)\r\n largest_sum = list.first\r\n current_sum = list.first\r\n \r\n # one loop only\r\n # need to get all subarr\r\n i = 1\r\n while i < list.length #loop to create subarr\r\n if current_sum < 0\r\n current_sum = 0\r\n end \r\n current_sum += list[i]\r\n if current_sum > largest_sum\r\n largest_sum = current_sum\r\n end\r\n i += 1\r\n end\r\n largest_sum\r\n end", "def largest_contiguous_subsum(arr)\n answer = []\n arr.each_with_index do |ele1,idx1|\n arr.each_with_index do |ele2,idx2|\n answer << arr[idx1..idx2].sum \n end\n end\n answer.sort[-1]\nend", "def largest_contiguous_subsum(arr) #BigO of O(n)\n max = 0 \n current_sum = 0\n arr.each_with_index do |el,idx|\n if current_sum + el >= el \n current_sum += el \n else \n current_sum = el \n end \n max = current_sum if current_sum > max \n end \n max\nend", "def largest_contiguous_subsum(arr)\n sum = arr.first\n\n (0...(arr.length - 1)).each do |idx1|\n (idx1..(arr.length - 1)).each do |idx2|\n if idx1 == idx2\n ss = arr[idx1]\n else\n ss = arr[idx1..idx2].reduce(:+)\n end\n sum = ss if ss > sum\n end\n end\n sum\nend", "def better_subsum(arr)\n largest_sum = arr.first\n current_sum = arr.first\n\n \n # return arr[0] if arr.length == 1\n \n # current_sum = better_subsum(arr[1..-1])+ arr[0]\n\n # if current_sum > largest_sum\n # largest_sum = current_sum\n # end\n\n # largest_sum\n\n # i = 0\n # j = arr.length\n # while i < arr.length\n\n # arr[i..j].sum\n # j-=1\n # i+=1\n # end\n \n (1...arr.length).each do |idx|\n if arr[idx] + current_sum > 0\n current_sum += arr[idx]\n largest_sum = current_sum if current_sum > largest_sum\n else\n current_sum = 0\n end\n end\n\n largest_sum\nend", "def largest_contiguous_sub_sum2(arr)\n #one varable tracks largest sum\n #one variable tracks current sum\n #O(n) + O(1)\n # list = [2, 3, -6, 7, -6, 7]\n\n # largest_sum= arr.first\n\n # i = 0\n # arr_end = true\n\n # while arr_end\n # current_sum = arr[i]\n # if arr[i+1] == nil\n # arr_end = false\n # puts \"This is current sum: #{current_sum}\"\n # else\n # if current_sum > largest_sum\n # current_sum += arr[i+1]\n # largest_sum = current_sum\n # end\n # end\n # if i < arr.length\n # arr_end = true\n # i += 1\n # end\n # end\n # largest_sum\n \n\n\n # arr.each_with_index do |ele, idx|\n # if ele > largest_sum\n # largest_sum = ele\n # end\n\n # i = idx\n # sum = ele\n # while i < arr.length - 1\n # if sum <= sum + arr[i+1]\n # largest_sum = sum + arr[i+1]\n # end\n # sum = sum + arr[i+1]\n # i+=1\n # end\n # end\n # largest_sum\n\nend", "def largest_contiguous_subsum(arr)\n global_sum = arr.first\n # p \"global = #{global_sum}\"\n i = 0\n pot = 0\n while i < arr.length\n pot += arr[i]\n global_sum = pot if global_sum < pot\n pot = 0 if pot < 0\n i += 1\n end\n global_sum\nend", "def better_largest_contiguous_subsum(arr)\n largest_sum = 0\n current_sum = 0\n i = 0\n while i < arr.length\n if arr[i] + current_sum >= 0\n current_sum += arr[i]\n else\n current_sum = 0\n end \n largest_sum = current_sum if current_sum > largest_sum \n i += 1\n end\n largest_sum\n end", "def largest_contiguous_subsum2(array)\r\n largest = array[0]\r\n current_sum = array[0]\r\n\r\n (1...array.length).each do |i|\r\n current_sum = 0 if current_sum < 0\r\n num = array[i]\r\n current_sum += num\r\n if current_sum > largest\r\n largest = current_sum\r\n end\r\n end\r\n\r\n largest\r\nend", "def largest_contiguous_subsum_once(arr)\n largest_subsum = 0\n current = 0\n\n arr.each do |elm|\n current += elm\n if largest_subsum < current\n largest_subsum = current\n elsif current < 0\n current = 0 \n end \n end \n\n # (0...arr.count).each do |i|\n # current_subsum = (largest_subsum + arr[i])\n # if current_subsum > largest_subsum \n # largest_subsum = current_subsum \n # elsif current_subsum < 0 \n # largest_subsum = 0 \n # end\n # end \n\n largest_subsum \nend", "def largest_contiguous_sub_sum(arr)\n subarrs = [] #O(1)\n\n (0...arr.length).each do |idx| #O(n)\n (idx...arr.length).each do |jdx| #O(n/2)\n subarrs << arr[idx..jdx] #O(n)\n end\n end \n\n subarrs.map! do |array| #O(n)\n array.reduce(:+) #O(n)\n end \n\n subarrs.max #O(n)\nend", "def largest_contiguous_subsum(arr)\n i = 0\n subs = []\n while i < arr.length\n j = i\n\n while j < arr.length\n subs << arr[i..j]\n\n j += 1\n end\n\n i += 1\n end\n\n\n return (subs.max {|a, b| a.sum <=> b.sum}).sum\n\nend", "def largest_sub_sum1 #0(n^2)\n result = []\n (0...self.length).each do |idx1|\n (idx1...self.length).each do |idx2|\n subarray_result = self[idx1..idx2]\n result << subarray_result\n end\n end\n\n largest_sum = result[0][0]\n result.each do |arr|\n largest_sum = arr.sum if arr.sum > largest_sum\n end\n largest_sum\n end", "def largest_contiguous_subsum(arr)\n max = 0\n\n (0...arr.count).each do |i|\n sum = arr[i]\n (i + 1...arr.count).each do |j|\n sum += arr[j]\n max = sum if max < sum \n end \n end \n\n max\nend", "def largest_contiguous_subsum(list)\n new_arr = []\n\n (0...list.length).each do |idx1| #O(n)\n (0...list.length).each do |idx2| #O(n)\n if idx2 >= idx1 #O(1)\n new_arr << list[idx1..idx2].sum #O(1)\n end \n end \n \n end \n \n return new_arr.max #O(n)\nend", "def phase_2_largest_contiguous_sum(arr)\n\n return [[]] if arr.empty?\n subs = arr.take(arr.count-1).phase_2_largest_contiguous_sum\n subs.concat(subs.map {|sub| sub + [last]})\n\n largest_sum = subs.first.sum \n\n subs.each do |sub|\n current_sum = sub.sum \n if current_sum > largest_sum\n largest_sum = current_sum\n end\n end\n\n largest_sum\n\nend", "def largest_contiguous_subsum(array)\n sums_list = []\n sums = []\n\n idx1 = 0\n\n while idx1 < array.length #O(n)\n idx2 = idx1 #O(1)\n while idx2 < array.length #O(n)\n sums_list << array[idx1..idx2] #O(n)\n idx2 += 1\n end\n idx1 += 1\n end\n\n sums_list.each do |list| #O(n)\n sums << list.reduce {|sum, num| sum + num} #O(n)\n end\n sums.max\nend", "def contiguous_sub_sum2(arr)\n max = arr.first\n curr_sum = 0\n arr.each do |num|\n curr_sum += num\n max = curr_sum if curr_sum > max\n curr_sum = 0 if curr_sum < 0\n end\n max\nend", "def largest_contiguous_subsum_n_2(arr)\n subs = []\n arr.each_with_index do |el1, i|\n arr.each_with_index do |el2, j|\n if j > i \n subs << arr[i..j]\n end\n end\n end\n subs\n x = subs.max_by {|arr| arr.sum}\n x.sum\nend", "def largest_contiguous_subsum(arr) # n^2\n subs = []\n (0...arr.length).each do |start_i|\n (start_i...arr.length).each do |end_i|\n subs << arr[start_i..end_i]\n end\n end\n\n subs.map { |sub| sub.inject(:+) }.max\nend", "def largest_contiguous_subsum(arr)\n subs = []\n l = arr.length\n (0...l).each do |i|\n (0...l).each do |j| \n subs << arr[i..j] if arr[i..j].length > 0 # n*n *( n) == n^3 + n\n end\n end\n subs.map(&:sum).max\nend", "def largest_contiguous_subsum(array)\n current_sum = array.first\n largest_sum = array.first\n array.each do |num|\n current_sum += num\n if largest_sum < current_sum\n largest_sum = current_sum\n end\n end\n largest_sum\nend", "def efficient_contiguous_subsum(list)\n current_sum = list[0] #0\n largest_sum = list[0] #5\n # debugger\n (1...list.length).each do |i| \n if current_sum + list[i] > 0 \n current_sum += list[i] \n largest_sum = current_sum if current_sum > largest_sum\n else \n current_sum = 0\n end \n end \n largest_sum\nend", "def largest_contiguous_subsum_1(arr)\n res = []\n i = 0\n while i < arr.length\n j = i\n while j < arr.length\n res << arr[i..j].reduce(:+)\n j += 1\n end\n i += 1\n end\n res.max\nend", "def largest_contiguous_subsum(arr)\n max_sum = arr.first\n\n (0...arr.length).each do |start|\n (start...arr.length).each do |ending|\n sum = arr[start..ending].sum\n max_sum = sum if sum > max_sum\n end\n end\n\n max_sum\nend", "def subarray_sum(nums, k)\n\n hash = {0 => 1}\n sum = 0\n count = 0\n\n for num in nums\n sum += num\n count += hash[sum - k] if !hash[sum -k].nil?\n hash[sum] ||= 0\n hash[sum] += 1\n end\n count\nend", "def linear_subsum(arr)\n largest = arr[0] # 5\n current = 0 # -4\n\n (0...arr.length).each do |idx| # 1\n current += arr[idx]\n largest = current if current >= largest\n current = 0 if current < 0\n end\n largest\nend", "def largest_contiguous_subsum(arry)\n bigone = arry.first || 0\n actual_sum = 0\n\n arry.each do |number|\n actual_sum += number\n if actual_sum > bigone\n bigone = actual_sum \n end\n if actual_sum < 0\n actual_sum = 0 \n end\n end\n return bigone\nend", "def largest_contiguous_subsum(arr)\n sums = []\n\n (0...arr.length).each do |idx1|\n (idx1+1...arr.length).each do |idx2|\n sums << arr[idx1..idx2].sum\n end\n end\n\n sums.max\nend", "def largest_contiguous_subsum(arr)\n result = []\n\n arr.each_with_index do |el1, idx1|\n i = idx1\n while i < arr.length\n result << arr[idx1..i]\n i += 1\n end\n end\n\n largest_sum = result.first.inject(:+)\n result.each do |sub_arr|\n curr_sum = sub_arr.inject(:+)\n largest_sum = curr_sum if curr_sum > largest_sum\n end\n largest_sum\nend", "def largest_contiguous_subsum(array)\n arr = []\n (0...array.length).each do |i|\n (i + 1...array.length).each do |j|\n arr << array[i] + array[j] \n end\n end\n arr.max\n \nend", "def largest_contiguous_subsum_1(list) \n subs = [] #O(1)\n (0...list.length).each do |start_num| #O(n)\n (start_num...list.length).each do |end_num| #O(n)\n subs << list[start_num..end_num] #O(n)\n end\n end\n subs_sum = [] #O(1)\n subs.each do |sub| #O(n**2)\n sub_sum = 0 #O(1)\n sub.each {|s| sub_sum += s} #O(n)\n subs_sum << sub_sum #O(1)\n end\n subs_sum.inject do |acc,el| #O(n)\n if acc > el #O(1)\n acc #O(1)\n else\n el #O(1)\n end\n end\n end", "def largest_contiguous_subsum2(array)\n # return [list[0]] if list.count == 1\n #\n # start_num = list.shift\n # large_sum = start_num\n #\n # other_list = list.dup\n #\n # idx = 0\n # while idx < list.count\n # sum = list[0..idx].inject(:+)\n # if large_sum < start_num + sum\n # large_sum = start_num + sum\n # end\n # idx += 1\n # end\n #\n # [large_sum] + largest_contiguous_subsum2(other_list)\n\n largest = nil\n current = 0\n\n array.each do |el|\n current += el\n if largest.nil? || current > largest\n largest = current\n end\n current = 0 if current < 0\n end\n\n largest\n\nend", "def find_unsorted_subarray(nums)\n \nend", "def largest_contiguous_subsum_1(arr)\n largest = []\n (0...arr.length).each do |i|\n (i...arr.length).each do |j|\n largest << arr[i..j]\n end\n end\n sums = largest.map do |sub_array|\n sub_array.sum\n end\n sums.max\nend", "def subsum_fast(arr)\n max_subsum = arr.first\n last = nil\n\n arr.all? { |n| return arr.max if n < 1 }\n arr[1..-1].each do |n|\n if last\n if last < 0\n last = n\n elsif last > 0\n last = last + n\n end\n\n if last > max_subsum\n max_subsum = last\n last = nil\n end\n\n else\n checking = max_subsum + n\n if checking >= max_subsum\n max_subsum = checking\n elsif checking != 0\n last = checking\n end\n end\n end\n\n max_subsum\nend", "def largest_contiguous_subsum_2(arr)\n sum = 0\n max = 0\n arr.each do |num|\n sum += num\n if sum > 0\n max = sum if sum > max\n else\n sum = 0\n end\n end\n max\nend", "def sub_sum(list)\n array = []\n (0...list.length).each do |idx1|\n (idx1...list.length).each do |idx2|\n array << list[idx1..idx2] #O(n)\n end\n end \n array.map {|sub| sub.length > 1 ? sub.sum : sub.first}.max\nend", "def largest_contiguous_subsum2(arr)\n max = arr[0]\n current = arr[0]\n arr.drop(1).each do |num|\n current += num\n max = current if current > max\n current = 0 if current < 0\n end\n max\nend", "def largest_contiguous_subsum1(array)\r\n subset = []\r\n array.each_index do |i| # make subets, store into 'subset' array\r\n (i...array.length).each do |j| # o(n^2)\r\n subset << array[i..j] # o(n^3) cause slicing\r\n end\r\n end\r\n\r\n subset_sum = []\r\n subset.each do |ele|\r\n subset_sum << ele.sum\r\n end\r\n subset_sum.max\r\nend", "def largest_contiguous_subsum(array)\n previous_sum = 0\n current_sum = 0\n array.each_with_index do |el, i|\n\n current_sum = previous_sum + el\n if previous_sum < 0\n if el < previous_sum\n current_sum = previous_sum\n else\n current_sum = el\n end\n end\n\n previous_sum = current_sum\n end\n\n current_sum\nend", "def largest_contiguous_subsum(array)\r\n max = array.first \r\n current_sum = 0\r\n array.each do |ele|\r\n current_sum += ele\r\n max = current_sum if current_sum > max\r\n current_sum = 0 if current_sum < 0\r\n end\r\n max\r\nend", "def largest_contiguous_sub_sum3(arr)\n\n largest_sum = arr.first\n current_sum = arr.first\n\n (1...arr.length).each do |index|\n current_num = arr[index]\n prev_num = arr[index-1]\n\n if largest_sum < current_num\n largest_sum = current_num\n end\n\n current_sum = current_sum + current_num\n prev_sum = prev_num + current_num\n\n if prev_sum > current_sum\n current_sum = prev_sum\n end\n\n if largest_sum < current_sum\n largest_sum = current_sum\n end\n end\n largest_sum\nend", "def largest_contiguous_subsum_fast(array)\n curr_sum = array.first\n largest_sum = array.first\n\n return array.max if array.all?{|val| val < 0} # O(n)\n\n array.drop(1).each_with_index do |val, i|\n if val > 0 # add val to curr_sum and largest_sum if it's positive\n curr_sum += val\n largest_sum = curr_sum\n elsif val < 0\n temp_sum = curr_sum + val\n\n if val + curr_sum > 0\n curr_sum += val\n elsif array[i + 1] + temp_sum < array[i + 1]\n curr_sum = 0\n largest_sum = array[i + 1]\n else\n largest_sum = temp_sum + array[i + 1]\n end\n end\n\n end\n largest_sum\nend", "def largest_contiguous_subsum(arr)\n max = arr.first\n arr.each_index do |idx1|\n (idx1+1..arr.length).each do |idx2|\n sub_arr = arr[idx1...idx2]\n sum = sub_arr.reduce(:+)\n max = sum if max < sum \n end\n\n end\n max\nend", "def largest_contiguous_subsum_2(arr)\n (1...arr.length).each do |i|\n if arr[i] + arr[i - 1] > 0\n arr[i] = arr[i] + arr[i - 1]\n elsif arr[i] < 0 && arr[i-1] < 0\n arr[i] = [arr[i-1], arr[i]].max\n else\n arr[i] = 0\n end\n end\n\n arr.max\nend", "def largest_contiguous_subsum(arr)\n max = arr[0]\n current = 0\n (0...arr.length).each do |i|\n current += arr[i]\n max = current if current > max\n current = 0 if current < 0\n end\n max\nend", "def largest_contiguous_subsum_1(list)\r\n subarrays = [] #1\r\n list.each_with_index do |ele1, i| #n\r\n list[i...list.length].each_with_index do |ele2,i2| #(n-1)\r\n subarrays << list[i..i2+i] #k \r\n end\r\n end # n^2\r\n subarrays.map { |subarray| subarray.sum}.max # n^x\r\nend", "def largest_contiguous_subsum_2(list)# [2, 3, -6, 7, -6, 7]\n largest_num = list[0]#2 O(1)\n running_sum = list[0]#2 - 5 after entering loop. O(1)\n\n (1...list.length).each do |i| #O(n) \n running_sum = 0 if running_sum < 0 #O(1)\n running_sum += list[i] #O(1)\n largest_num = running_sum if running_sum > largest_num #O(1)\n end\n return largest_num #O(1)\nend", "def largest_contiguous_subsum(list) # O(n^2)\n array = []\n list.each_with_index do |ele1, i1| # O(n^2)\n (i1...list.length).each do |i2|\n array << list[i1..i2]\n end\n end\n\n max_sum = array.first.sum\n array[1..-1].each do |subarr| # O(n^2)\n sum = subarr.sum\n if sum > max_sum\n max_sum = sum\n end\n end\n\n max_sum\n\nend", "def largest_contiguous_subsum(array)\n new_arr = []\n (0...array.length).each do |idx1|\n sum = [array[idx1]]\n new_arr << sum\n (idx1+1...array.length).each do |idx2|\n sum += [array[idx2]]\n new_arr << sum\n end\n end\n\n sums = []\n new_arr.each do |pair|\n sums << pair.sum\n end\n\n sums.max\nend", "def find_unsorted_subarray(nums)\n sum = 0\n index = 0\n sorted = nums.sort\n while index < nums.length\n if nums[index] == sorted[index]\n sum += 1\n else\n break\n end\n index += 1\n end\n return 0 if sum == nums.length\n index = nums.length - 1\n while index >= 0\n if nums[index] == sorted[index]\n sum += 1\n else\n break\n end\n index -= 1\n end\n nums.length - sum\nend", "def largest_contiguous_subsum(arr)\n largest = current = arr.first\n \n return arr.max if arr.all? { |num| num < 0 }\n\n arr.drop(1).each do |num|\n current = 0 if current < 0\n current += num\n largest = current if current > largest \n end\n\n largest\nend", "def largest_contiguous_subsum(arr)\n sum = 0\n arr_indices = []\n running_sums = []\n arr.each_with_index do |num,idx|\n sum += num \n arr_indices << idx \n running_sums << sum\n end \n running_sums.max\n\nend", "def largest_contiguous_subsum_fast(arr)\n global_max = arr.first\n prev_max = arr.first\n\n arr.drop(1).each do |el|\n curr_max = (prev_max + el > el) ? (prev_max + el) : el\n prev_max = curr_max\n global_max = curr_max if curr_max > global_max\n end\n global_max\nend", "def largest_contiguous_subsum1(list)\n p Time.now\n sub_arrays = []\n list.each_index do |i|\n list.each_index do |j|\n next if j < i\n sub_arrays << list[i..j]\n end\n end\n sub_arrays.map{|numbers| numbers.inject(:+)}.max\n p Time.now\nend", "def subsum(array, first_index = 0, last_index = -1)\n unless array == nil\n array = array[first_index..last_index]\n array.reduce(:+)\n end\nend", "def largest_contiguous_subsum(list)\r\n sub_arr = []\r\n list.each_with_index do |ele1,idx1|\r\n list.each_with_index do |ele2,idx2|\r\n sub_arr<< list[idx1..idx2] if idx2>=idx1\r\n end\r\n end\r\n p sub_arr.size\r\n sub_arr.map{ |sub| sub.sum}.max\r\n #(O(n^2 + m)\r\nend", "def largest_contiguous_subsum(arr)\n current_sum = arr.first \n max_sum = arr.first \n (0...arr.length-1).each do |i|\n if current_sum < 0 \n current_sum = [current_sum, arr[i+1]].max\n max_sum = current_sum\n else \n current_sum += arr[i+1]\n max_sum = [current_sum, max_sum].max\n end \n end \n max_sum\nend", "def largest_contiguous_subsum(arr)\n subsets = []\n\n (0...arr.length).each do |idx1|\n (idx1...arr.length).each do |idx2|\n subsets << arr[idx1..idx2]\n end\n end \n\n largest_sum = subsets.first.sum\n\n subsets.each do |subset|\n if subset.sum > largest_sum\n largest_sum = subset.sum\n end\n end\n\n print subsets\nend", "def optimized_largest_subsum(arr)\n max = arr.first\n sum = arr.first \n arr.shift\n arr.each do |el|\n sum += el\n if el > max && el > sum \n max = el \n sum = el \n elsif sum > max\n max = sum\n end \n end \n max\nend", "def sum_of_sums(arr)\n total_sum = 0\n idx = 0\n elements = 1\n while elements - 1 < arr.size\n total_sum += arr.slice(idx, elements).reduce(:+)\n elements += 1\n end\n total_sum\nend", "def largest_contiguous_subsum(arr)\n largest = arr.first\n current_sum = arr.first\n i = 1\n while i < arr.length\n if arr[i] < 0\n largest = current_sum if current_sum > largest\n largest = arr[i] if arr[i] > largest\n if current_sum + arr[i] > 0\n current_sum += arr[i]\n else\n current_sum = 0 unless current_sum < 0\n end\n else\n current_sum += arr[i]\n end\n i+=1\n end\n largest = current_sum if current_sum > largest\n largest\nend", "def largest_continguous_subsum(arr)\n largest_sum = arr.first\n current_sum = arr.first\n \n (1...arr.length).each do |i|\n current_sum += arr[i]\n if current_sum > largest_sum\n largest_sum = current_sum\n elsif current_sum < 0\n current_sum = 0\n end\n end\n largest_sum\nend", "def largest_contiguous_subsum(arr)\n subsets = [] \n\n (0...arr.length).each do |i| \n (i...arr.length).each do |j| \n subsets << arr[i..j]\n end \n end \n \n subsets.map {|sub| sub.sum}.max \nend", "def largest_cont_subsum_fast(list)\n # for constant size to be true, you cant create any variables\n # whose memory size depends on the size of the input\n curr_sum = list[0]\n largest_sum = list[0]\n\n # we know there are n^2 potential, so if we ever check all of them\n # it must be n^2\n\n # there must be a way to find the max without checking every subarray\n list[1..-1].each do |ele|\n # debugger\n if curr_sum > largest_sum\n largest_sum = curr_sum\n end\n\n if curr_sum < 0\n curr_sum = 0\n end\n\n curr_sum += ele\n\n end\n\n # debugger\n return [largest_sum, curr_sum].max\n\nend", "def largest_contiguous_subsum2(list)\n # O(N) ==> Time\n # O(1) ==> Space\n largest = list.first\n curr = list.first\n\n len = list.length\n (1...len).each do |i|\n curr = 0 if curr < 0 \n curr += list[i]\n largest = curr if curr > largest\n end\n largest\nend", "def best_largest_contiguous_subsum(arr)\n return arr.max if arr.max < 0\n largest = 0\n current = 0\n\n\n (0..(arr.length-1)).each do |idx1|\n if current + arr[idx1] < 0\n current = arr[idx1]\n else\n current += arr[idx1]\n end\n\n largest = current if current > largest\n end\n largest\nend", "def is_subset_sum(arr,sum)\n\tsol = MultiArray::build(sum + 1, arr.length + 1)\n\n\tsol[0][0] = 1\n\tfor i in 1..(arr.length)\n\t\tsol[0][i] = 1\n\tend\n\n\tfor i in 1..sum\n\t\tfor j in 1..(arr.length)\n\t\t\tsol[i][j] = sol[i][j - 1]\n\t\t\tif i - arr[j - 1] >= 0 && sol[i - arr[j - 1]][j - 1] == 1\n\t\t\t\tsol[i][j] = sol[i - arr[j - 1]][j - 1]\n\t\t\tend\n\t\tend\n\tend\n\n\tsol\nend", "def largest_contiguous_subsum(array)\n sub_arrs = []\n array.each_index do |ind1|\n array[ind1..-1].each_index do |ind2|\n sub_arrs.push(array[ind1..ind2+ind1])\n end\n end\n max_sum = sub_arrs.first.sum\n sub_arrs.each {|sub| max_sum = sub.sum if sub.sum >= max_sum }\n return max_sum\nend", "def largest_contig_subsum_lin(nums)\n # debugger\n largest_sum = nums[0]\n current_sum = 0\n i, j, = 0, 0\n while j < nums.length \n current_sum += nums[j] \n \n if nums[j] > current_sum \n i = j \n current_sum = nums[j]\n end \n\n largest_sum = current_sum if current_sum > largest_sum \n\n j += 1\n end\n largest_sum\nend", "def sub_array_sum(nums)\n greatest_sum = nums.first\n current_sum = 0\n nums.each do |num|\n current_sum += num\n greatest_sum = current_sum if current_sum > greatest_sum\n current_sum = 0 if current_sum < 0\n end\n greatest_sum\nend", "def long_subarrays(arr)\n res =[]\n window = arr.length\n while window>=1\n idx = 0\n while idx+window<=arr.length\n sub_arr = arr.slice(idx, window)\n p sub_arr\n res << sub_arr\n idx += 1\n end\n window -= 1\n end\n res.map{|el| el.inject(0){|acc, el2| acc+el2}}.sort.last\nend", "def subarray_sum(nums, k)\n subarray_count = 0\n map = {0 => 1}\n sum = 0\n \n nums.each_with_index do |n, idx|\n \n new_sum = sum += n\n # newsum = 1\n \n # if key exists\n if map[new_sum - k]\n \n subarray_count += map[new_sum - k]\n end\n \n map[new_sum].nil? ? map[new_sum] = 1 : map[new_sum] += 1\n \n sum = new_sum\n end\n \n return subarray_count\nend" ]
[ "0.7657547", "0.7573456", "0.755591", "0.7534317", "0.7493759", "0.74923325", "0.74523807", "0.7445718", "0.74379426", "0.7435504", "0.74056447", "0.73941773", "0.7378644", "0.7373692", "0.735482", "0.73370665", "0.73364407", "0.7327034", "0.730906", "0.7296776", "0.7286539", "0.7273439", "0.7269565", "0.72637045", "0.72538126", "0.7226052", "0.7213419", "0.7192538", "0.7192269", "0.7184122", "0.71807593", "0.7179609", "0.7177608", "0.71365917", "0.7130445", "0.7125043", "0.71183187", "0.71108824", "0.71039736", "0.71018827", "0.70935047", "0.708608", "0.70820343", "0.70701814", "0.7066562", "0.7057206", "0.7057168", "0.7054739", "0.70342284", "0.7032876", "0.70044255", "0.6999975", "0.6988121", "0.6964523", "0.69625247", "0.69505405", "0.69382507", "0.6931596", "0.69285774", "0.69283766", "0.6923137", "0.6916331", "0.6915341", "0.6914523", "0.6902117", "0.68999165", "0.68932", "0.68918604", "0.6888813", "0.68885326", "0.68879753", "0.68829435", "0.68792766", "0.68700707", "0.68520135", "0.685022", "0.6842142", "0.6840132", "0.6837053", "0.6831644", "0.6825469", "0.68221456", "0.68187296", "0.68179816", "0.68174136", "0.6786638", "0.6784442", "0.6782694", "0.6782443", "0.67788893", "0.6760673", "0.67576134", "0.6748088", "0.6738217", "0.67328846", "0.67224306", "0.6702224", "0.6697969", "0.6690358", "0.6683864" ]
0.6828449
80
O(n) time b/c interation done once
def largest_contiguous_subsum_two(list) largest_sum = list[0] current_sum = 0 # list.inject {|acc, ele| acc + ele} list.each do |ele| current_sum = [ele, current_sum + ele].max largest_sum = [largest_sum, current_sum].max end largest_sum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_min2 # O(n) time complexity\n smallest = self.first\n self.each do |num|\n sleep(1)\n smallest = num if num < smallest \n end\n smallest\n end", "def cache_intersection2(nums1, nums2)\n outer_cache = {}\n nums1.each do |n|\n next if outer_cache[n]\n outer_cache[n] = true\n end\n array = []\n inner_cache = {}\n nums2.each do |n|\n next if inner_cache[n]\n array << n if outer_cache[n]\n inner_cache[n] = true\n end\n array\nend", "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def cache_intersection(nums1, nums2)\n array = []\n outer_cache = {}\n inner_cache = {}\n nums1.each do |outer|\n next if outer_cache[outer]\n outer_cache[outer] = true\n nums2.each do |inner| \n next if inner_cache[inner]\n if outer == inner \n array << inner\n inner_cache[inner] = true\n end\n end\n end\n array\nend", "def fast_intersection(array_one, array_two)\n count = {}\n array_one.each do |el|\n if count[el]\n count[el] += 1\n else\n count[el] = 1\n end\n end\n int = []\n array_two.each do |el|\n if count[el] && count[el] > 0\n count[el] -= 1\n int << el\n end\n end\n int\nend", "def my_min_2(list)\r\n min = 0 # O(1)\r\n \r\n list.each do |ele| # O(n) \r\n if ele < min # O(1)\r\n min = ele # O(1)\r\n end\r\n end\r\n min # O(1) \r\nend", "def slow\n (1..10).inject({}){|h, e| h.merge(e => e)}\nend", "def my_min_2(array)#O(n)\n array.inject do |acc, ele|#O(n)\n if acc < ele\n acc\n else\n ele\n end\n end\nend", "def intersect nums1, nums2\n result = []\n return result if nums1.size == 0 or nums2.size == 0\n\n counter_cache = {}\n counter_cache = nums1.inject({}) { |result, n|\n result[n] ||= 0\n result[n] += 1\n result\n }\n\n nums2.each do |n|\n if counter_cache[n] and counter_cache[n] > 0\n result << n\n counter_cache[n] -= 1\n end\n end\n result\nend", "def slow_dance(tile, array)\n array.each_with_index do |el, i|\n return i if el == tile\n end\nend", "def solution(m, a)\n n = a.count\n result = 0\n front = 0\n numbers = Array.new(m + 1, false)\n n.times { |back|\n while front < n and not numbers[a[front] - 1]\n numbers[a[front] - 1] = true\n front += 1\n result += front - back\n return 1_000_000_000 if result >= 1_000_000_000\n end\n numbers[a[back] - 1] = false\n }\n result\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend", "def test(arr)\n arr.map do |el|\n arr.inject(1) do |memo, el2|\n next memo if arr.index(el2) == arr.index(el)\n memo * el2\n end\n end\nend", "def map_then_iterate_two_sum(array, target)\n hash = {}\n array.each.with_index do |i, index|\n hash[i] = index\n end\n indexes = []\n array.each.with_index do |ii, index|\n complement = target - ii \n if hash.has_key?(complement) && hash.fetch(complement) != index\n indexes.push(index, hash.fetch(complement))\n return indexes\n end\n end\nend", "def if_ins(i,spl); end", "def find_it(seq)\n uniqueInts=seq.uniq\n\n uniqueInts.each do |value|\n k=0\n seq.each do |mainSeq|\n k+=1 if mainSeq==value\n end\n return value if k%2==1\n end\nend", "def bitonic_merge(array, low, count, direction)\n return if count <= 1\n\n mid = count / 2\n (low...low + mid).each do |i|\n compare_and_swap(array, i, i + mid, direction)\n end\n bitonic_merge(array, low, mid, direction)\n bitonic_merge(array, low + mid, mid, direction)\nend", "def checkSrepIntersection\n (0..$sreps.length-1).each do |j|\n (0..$sreps.length-1).each do |i|\n if i != j\n $sreps[j].checkIntersection($sreps[i])\n end\n end\n end\n end", "def equal(arr)\n size = arr.size\n hash = Hash.new{|h,k| h[k] = []}\n (0...size).each do |i|\n (i + 1...size - 1).each do |j|\n sum = arr[i] + arr[j]\n if hash.has_key?(sum)\n values = hash[sum]\n values << i\n values << j\n return values\n else\n hash[sum] = [i, j]\n end\n end\n end\nend", "def each_identity; end", "def fast_intersection(array_one, array_two)\n\nend", "def fast_intersection(array_one, array_two)\n result = []\n hash = {};\n\n array_one.each do |num1|\n hash[num1] = true\n end\n\n array_two.each do |num2|\n if hash[num2]\n result << num2\n end\n end\n\n result\nend", "def equil_idcs(a)\n left = 0\n sum = a.inject(:+)\n equils = []\n a.each_with_index do |num, idx|\n sum -= num\n equils << idx if left == sum\n left += num\n end\n equils.empty? ? -1 : equils\nend", "def bf_inversions arr\n count = 0\n (0...arr.size).each do |i|\n ((i+1)...arr.size).each do |j|\n count+=1 if arr[i] > arr[j]\n end\n end\n count\nend", "def find_duplicate(nums)\n if !nums or nums.size == 0\n return nil\n else\n fast = nums[ 0 ]\n slow = nums[ 0 ]\n while true\n fast = nums[ fast ]\n fast = nums[ fast ]\n slow = nums[ slow ]\n if fast == slow\n new_node = nums[ 0 ]\n while new_node != slow\n new_node = nums[ new_node ]\n slow = nums[ slow ]\n end\n return slow\n end\n end\n end\nend", "def find_duplicate(nums)\n intersection = find_first_meeting(nums)\n find_cycle_start(nums,intersection)\nend", "def my_min(list) \n\n list.each_with_index do |ele, i| #O(n)\n compare_arr = list[0...i] + list[i+1..-1] # O(2n) \n return ele if compare_arr.all? { |ele2| ele < ele2 } #O(n)\n end\n\n #time complexity = O(n^2) + O(2n)\n\nend", "def fast_dance(tile_direction, new_tiles_data_structure)\n new_tiles_data_structure.each do |ele|\n return new_tiles_data_structure.index(ele) if ele == tile_direction\n end\nend", "def stones(n, a, b)\n ar=[0]\n (n-1).times do |val|\n tmp=[]\n ar.each do |v|\n tmp << v+a if !tmp.include?(v+a)\n tmp << v+b if !tmp.include?(v+b)\n end\n ar=tmp\n end\n ar.sort\nend", "def slow_dance(tile_direction, tiles_array)\n tiles_array.inject do |acc, el|\n if acc == tile_direction\n return tiles_array.index(acc)\n elsif el == tile_direction\n return tiles_array.index(el)\n else\n nil \n end\n end\nend", "def find_unique(array)\n unique_id = 0\n\n array.each do |num|\n unique_id ^= num\n end\n\n unique_id\nend", "def span(list)\n j = 1\n i = 0\n once = 0\n span1 = 0\n span2 = 0\n (list.length - 1).times do\n while j < list.length && once == 0\n if list[i] == list[j]\n span1 = j - i\n end\n j += 1\n end\n once = 1\n j = 0\n i += 1\n while j < list.length && once == 1\n if list[i] == list[j]\n span2 = j - i\n end\n j += 1\n end \n once = 0\n if span1 > span2\n span1 = span2\n span2 = 0\n else\n span1 = span1\n span2 = 0\n end\n end\nend", "def my_min_2(arr) #O(N)\n min_num = arr.first\n \n arr.each { |num| min_num = num if num < min_num }\n \n min_num\n end", "def icecreamParlor(m, arr)\n # Complete this function\n res = []\n arr.each_index do |i|\n if i + 1 !=nil\n j = i + 1\n while j <= arr.length - 1\n if arr[i]+arr[j] == m\n res.push([i+1,j+1])\n end\n j+=1\n end\n end\n end\n res\nend", "def fast_intersection(array_one, array_two)\nend", "def solution(a)\n accessed = Array.new(a.size + 1, nil)\n caterpillar_back = 0\n count = 0\n\n a.each_with_index do |x, caterpillar_front|\n if accessed[x] == nil\n accessed[x] = caterpillar_front\n else\n new_caterpillar_back = accessed[x] + 1\n first_part_size = caterpillar_front - caterpillar_back\n second_part_size = caterpillar_front - new_caterpillar_back\n count += first_part_size * (first_part_size + 1) / 2\n count -= (second_part_size) * (second_part_size + 1) / 2\n caterpillar_back.upto(new_caterpillar_back - 1) { |n| accessed[a[n]] = nil}\n accessed[x] = caterpillar_front\n caterpillar_back = new_caterpillar_back\n end\n end\n\n remaining_size = a.size - caterpillar_back\n count += (remaining_size) * (remaining_size + 1) / 2\n end", "def find3(a, X)\n # scan through array\n # build hash storing complement in each key\n complements = {}\n a.each_with_index do |val, ind|\n if complements[X - val]\n complements[X - val].push(ind)\n else\n complements[X - val] = [ind]\n end\n end\n\n # scan through the array again\n # get complement\n # for each value scan the remainder of the arrray\n # for a value such taht a + b = the complement\n\n # for each character we have built a dictionary such that, we can find\n # x = a + complement\n\n # [1, 2, 3]\n # 1 + 2 = 3\n # 1 + 3 = 4 =>\n\n # for each value in the array (a) look at all following values (b) and see if a + b\n # is in the dictionary, if it is, check that their indices do not collide with the index\n # stored at dict(a+b)\n\n a.each_with_index do |va, i|\n a.each_with_index do |vb, j|\n break if i == j\n\n complement = va + vb\n indices = complements[complement]\n\n indices.each do |z|\n # every index is unique\n return [i, j, z] unless z == i || z == j\n end\n end\n end\n\n return nil\nend", "def answer(n, a)\n count = 0\n n.times do |nn|\n next if a[nn] != nn + 1\n a[nn], a[nn + 1] = a[nn + 1], a[nn]\n count += 1\n end\n count\nend", "def compute_cache\n\n\t\t# cache of equality will be stored on @equals\n\t\t# we store if a number if equal to the successor\n\t\t@equals = Array.new( @sequence.size )\n\n\t\t# for every number on the list\n\t\ti = 0\n\t\t@sequence.reduce do |left,right|\n\n\t\t\t# We compute and store the equality\n\t\t\t@equals[i] = ( left === right )\n\n\t\t\t# next number!!!\n\t\t\ti += 1\n\n\t\t\t# we return right to continue the reduce\n\t\t\tright\n\t\tend\n\n\t\t# The last number is NOT equal to the successor\n\t\t@equals[ i ] = false\n\tend", "def naive(a, target)\n\ta.each do |ie, i|\n\t\ta.each do |je, j|\n\t\t\tnext if i == j # cant be the same, i assume\n\t\t\treturn true if ie + je == target\n\t\tend\n\tend\n\treturn false\nend", "def solution(a)\n len = a.size\n unique = {}\n i = 0\n while i < len\n item = a[i]\n if unique.has_key?(item)\n unique[item] += 1\n else\n unique[item] = 1\n end\n i += 1\n end\n pairs = 0\n unique.each do |key,count|\n (1...count).step {|n| pairs += n }\n end\n return pairs > 1_000_000_000 ? 1_000_000_000 : pairs\nend", "def lAS(n: 0)\n array = [1]\n puts \"#{array.inspect}\"\n previous = array.first\n new_array = []\n counter = 0\n \n n.times do\n previous = array.first\n counter = 0\n new_array = []\n \n array.each do |element|\n if(element == previous)\n counter = counter + 1\n else\n new_array << counter\n new_array << previous\n counter = 1\n previous = element\n end\n end\n \n new_array << counter\n new_array << previous\n array = new_array.dup\n puts \"#{array.inspect}\"\n end\nend", "def solution(a)\n # write your code in Ruby 2.2\n seen = {}\n\n a.each do |number|\n seen[number] = true\n end\n\n max = a.max\n\n for i in 1..(max + 1)\n return i unless seen[i]\n end\n\n 1\nend", "def slow_dance(tile, tiles_array)\n tiles_array.each_with_index do |direction, idx|\n return idx if direction == tile\n end\nend", "def my_min_2(arr)\n\n smallest_value = arr[0] # O(1)\n\n arr.each do |ele1| # [ 0, 3, 5, 4, -5, 10, 1, 90 ] O(n)\n smallest_value = ele1 if ele1 <= smallest_value #O(1)\n end\n\n smallest_value #O(1)\n\nend", "def fibonacci(n)\n return fib_helper([0, 1], 2, n)\n # if you'd like to test what i THINK is an O(1) space complexity solution.....\n # i did run this through the tests and it SHOULD work:\n # return faster_fib_helper([0, 1], 2, n)\nend", "def elide_repeated_subsequences &compare_block\n compare_block ||= lambda{|a,b| a == b}\n i = 0\n while i < size # Need to re-evaluate size on each loop - the array shrinks.\n j = i\n #puts \"Looking for repetitions of #{self[i]}@[#{i}]\"\n while tail = self[j+1..-1] and k = tail.index(self[i], &compare_block)\n length = j+1+k-i\n #puts \"Found at #{j+1+k} (subsequence of length #{j+1+k-i}), will need to repeat to #{j+k+length}\"\n if j+k+1+length <= size && compare_block[self[i, length], self[j+k+1, length]]\n #puts \"Subsequence from #{i}..#{j+k} repeats immediately at #{j+k+1}..#{j+k+length}\"\n slice!(j+k+1, length)\n j = i\n else\n j += k+1\n end\n end\n i += 1\n end\n self\n end", "def solution(a)\n # write your code in Ruby 2.2 \n frecuencies = a.each_with_object(Hash.new(0)) { |key, value| value[key] += 1 } \n \n frecuencies.each do |key, value|\n if value.odd? then return key end\n end\nend", "def magic_slow(arr)\n arr.each_with_index do |val, index|\n return index if val === index\n end\nend", "def merge(array1, array2)\n results = []\n\n results = array1 + array2\n\n 10.times do\n n = -1\n\n 10.times do\n if results[n].to_i < results[n - 1].to_i\n results[n], results[n - 1] = results[n - 1], results[n]\n end\n\n n -= 1\n end\n end\n\n results\nend", "def solution_slow_2(n, p, q)\n sieve = sieve_of_erathosteneses(n)\n # puts \"sieve:#{sieve}\"\n semi = semiprimes(n, sieve)\n # puts \"sp:#{semi}\"\n prefix = [0,0,0,0,1]\n 5.upto(n) do |x|\n if semi.include? x \n prefix << prefix.last + 1\n else\n prefix << prefix.last\n end\n end\n # puts \"prefix:#{prefix}\"\n\n queries = [p,q].transpose\n\n\n res = queries.map do |query|\n prefix[query.last] - prefix[query.first - 1]\n end\n\n # puts \"res:#{res}\"\n\n res\n end", "def ri(p,i,n,a,s)\n j = 0\n v = nil\n h = nil\n k = nil\n while i > 0\n k = n-j-1\n h = b(k)\n v = b(j) * h\n i -= v\n j += 1\n end\n i += v\n j -= 1\n p[a-1] = j + 1 + s\n y = (i-1-((i-1)/h)*h) + 1\n w = (i-y) / h + 1\n\n if j > 1\n ri(p,w,j,a+1,s) \n elsif j == 1\n p[a] = s+1\n end\n\n if k > 1\n ri(p,y,k,a+j+1,s+j+1)\n elsif k==1\n p[a+j] = s+j+2\n end\n end", "def find_intersection(a1, a2)\n a1_hash = {}\n \n a1.each do |num|\n if a1_hash[num]\n a1_hash[num] +=1\n else\n a1_hash[num] = 1\n end\n end\n \n intersection = []\n \n a2.each do |num|\n if a1_hash[num] && a1_hash[num] > 0\n a1_hash[num] -= 1\n intersection << num\n end\n end\n \n return intersection\nend", "def three_sum_fast(arr)\n arr = merge_sort(arr)\n count = 0\n\n (0..arr.length - 1).each { |i|\n (i + 1..arr.length - 1).each { |j|\n if bin_search(arr, -arr[i] - arr[j]) > j\n count += 1\n end\n }\n }\n count\nend", "def solution(a)\n # write your code in Ruby 2.2\n n = a.length\n \n counter = Array.new(n+1, 0)\n \n a.each do |x|\n counter[x-1] += 1\n end\n \n return counter.index { |x| x == 0 } + 1\nend", "def phase_two(arr)\n min = arr[0]\n arr.each do |ele|\n if ele < min\n min = ele\n end\n end\n\n min\nend", "def find_it(seq)\n hash = {}\n seq.each do |element|\n hash[element] ? hash[element] += 1 : hash[element] = 1\n end\n hash.find do |key, value|\n return key if value.odd?\n end \nend", "def josephus_survivor(n,k)\n result = 1\n for i in 1...n + 1\n result = (result + k - 1) % i + 1\n end\n \n result\nend", "def fast_hash_additive_find(arr, target)\n lookup_table = Hash.new\n\n arr.each do |element|\n return true if lookup_table[target - element]\n if lookup_table[element]\n lookup_table[element] += 1\n else\n lookup_table[element] = 1\n end\n end\n\n return false\n end", "def fifth_anagram?(word1, word2) # O(n)\n \n p \"Running fifth_anagram...\" \n\n start = Time.now\n \n hash1 = Hash.new(0)\n # hash2 = Hash.new(0)\n\n word1.each_char {|char| hash1[char] += 1}\n word2.each_char {|char| hash1[char] += 1}\n\n hash1.values.all? {|v| v.even?}\n\n\n # puts \"Took #{Time.now - start} seconds\"\n\n \nend", "def solution(a)\n n = a.size\n passing_cars = 0\n\n suffix_sums = Array.new(n + 1, 0)\n\n a.reverse.each_with_index do |elem, i|\n suffix_sums[i + 1] = suffix_sums[i] + elem\n end\n suffix_sums.reverse!\n\n a.each_with_index do |car, i|\n if car == 0\n passing_cars += suffix_sums[i]\n end\n end\n\n passing_cars > 1_000_000_000 ? -1 : passing_cars\nend", "def merge(nums1, m, nums2, n)\n last = m + n - 1\n infinity = -2 ** (0.size * 8 - 1)\n m -= 1\n n -= 1\n while last >= 0\n first = m < 0 ? infinity : nums1[m]\n second = n < 0 ? infinity : nums2[n]\n if first > second\n nums1[last] = nums1[m]\n m -= 1\n else\n nums1[last] = nums2[n]\n n -= 1\n end\n \n last -= 1\n end\nend", "def find_it(seq)\n h = {}\n seq.each { |i| h[i] ? h[i] = h[i] + 1 : h[i] = 1 }\n h.select { |k, v| v.odd? }.keys.first\nend", "def my_min_2(nums) # O(n)\n smallest = 0\n nums.each do |num|\n smallest = num if num < smallest\n end\n smallest\nend", "def solution(a)\n counter = Hash.new(0)\n a.each do |elem|\n counter[elem] += 1\n end\n\n (1..a.size).each do |number|\n return 0 if counter[number] != 1\n end\n\n 1\nend", "def solution(a)\r\n # write your code in Ruby 2.2\r\n \r\n arr =[]\r\n a.each_with_index{|el,i|\r\n \r\n if !arr.index(el) \r\n arr << el\r\n end\r\n \r\n }\r\n arr.count\r\nend", "def true_two_sum(arr, targ)\n\n arr_hash = Hash.new\n\n arr.each { |el| arr_hash[n] = true }\n\n arr.each { |el| return arr_hash[targ - el] if arr_hash[targ - el] }\n false \nend", "def iter\n f1,f2,k = 1,1,2\n f1,f2,k = f2,f1+f2,k+1 while f2.to_s.size < 1000\n puts k\nend", "def find_it(seq)\n # hash = Hash.new\n \n # seq.each do |num|\n # if hash[num].nil?\n # hash[num] = 1\n # else\n # hash[num] += 1\n # end\n # end\n \n hash = Hash.new(0)\n seq.each { |num| hash[num] += 1 }\n \n hash.each { |k, v| return k if v.odd? }\nend", "def slow_dance(direction, arr)\n arr.each_with_index do |el, i|\n return i if el == direction\n end\nend", "def second_anagram?(word_1, word_2) #O(n^2)\n matching_word = word_2.split(\"\")\n\n word_1.each_char do |ele|\n if matching_word.index(ele) #evaluating the conditional\n matching_word.delete_at(matching_word.index(ele)) #n many times, do this\n end\n end\n\n matching_word.empty? #constant O(1)\nend", "def check_for_implication_loops\n # actually this is tricky\n end", "def my_min(arr)\n l = arr.length - 1 # constant\n # min = 0 # is this more efficient than swapping? \n (0...l).each do |i| # n times1\n if arr[i] < arr[i+1] # 1\n arr[i], arr[i+1] = arr[i+1], arr[i] # 1\n end\n end\n\n arr.last # 1\nend", "def unique_in_order(iterable)\n arr = []\n \n 0.upto(iterable.size - 1) do |x|\n arr << iterable[x]\n end\n \n final_arr = []\n 0.upto(arr.size - 1) do |y|\n final_arr << arr[y] if arr[y] != arr[y + 1]\n end\n \n final_arr\nend", "def find_it(seq)\n seq.each do |e|\n a = seq.count(e)\n e if (a % 2).odd?\n end\nend", "def slow_dance(move, tiles_array)\n tiles_array.each_with_index {|tile, i| return i if tile == move}\nend", "def two_sum?(array, target)\n #O(n)\n hash = Hash.new(0)\n i = 1\n array.each do |ele|\n hash[ele] = i \n i += 1\n end\n hash.each_key do |k|\n return true if hash.has_key?(target - k) && hash[k] != hash[target - k]\n end\n false \nend", "def solution(h)\n n = h.size\n return 0 if n == 0\n stack = [h.first]\n blocks = 0\n (1...n).each { |y|\n if h[y] != stack.last\n while !stack.empty? && h[y] < stack.last\n stack.pop\n blocks += 1\n end\n stack << h[y] unless stack.last == h[y]\n end # != last\n }\n blocks += stack.count\nend", "def awesome(arr, target)\n hash = Hash.new(0)\n i = 0\n j = i + 1\n while i < arr.size\n hash[arr[i] + arr[j]] += 1 \n if j < arr.size\n j += 1\n else\n i += 1\n if j = i + 1 > arr.length\n j = i \n else\n j = i + 1\n \n end\n\n end\n \n end\n return true if hash[target] >= 1\n false\nend", "def josephus_survivor(n,k)\n arr = (1..n).to_a\n\n while arr.length > 1\n idx = k % arr.length\n\n if arr.length > k\n arr = arr.drop(k) + arr.take(k - 1)\n elsif arr.length == k \n arr = arr[0...-1]\n else\n arr = arr.drop(idx) + arr.take(idx - 1)\n end\n end\n \n arr[0]\nend", "def count_next_index()\n if @operation == :pour\n if @second_index + 1 >= @original_state.size\n @second_index = 0\n @first_index += 1\n else\n @second_index += @second_index + 1 == @first_index ? 2 : 1\n end\n if @first_index + 1 == @original_state.size && @second_index + 1 >= @original_state.size\n @operation = :nop\n end\n else\n if @first_index + 1 < @original_state.size\n @first_index += 1\n else\n @first_index = 0\n @operation = @operation == :fill ? :empty : :pour\n end\n end\n end", "def visit_all_rooms?(array) \n visited = {}\n queue = [] \n\n first = array.shift \n\n \n first.each do |key|\n queue << key //3, 0\n end\n\n\n # O(n) * o(m) => O(nm)\n while queue.length > 0 //O(n)\n current_key = queue.shift\n visited[current_key] = true\n array[current_key].each do |key| \n queue << key unless visited[key] == false // 3,0,1 \n end\n end\n\n visited.keys.length == array.length\n\nend", "def better_sum1(arr, target) # this one is going to return true or false\n pairs = Set.new\n\n arr.each do |ele|\n if pairs.include?(ele)\n return true\n else\n pairs << target - ele\n end\n end\n false\nend", "def first_duplicate2(a)\n found = {}\n a.each do |x|\n return x if found[x]\n found[x] = true\n end\n -1\nend", "def sorted_squares(nums)\n # This takes O(n)\n nums.map! { |num| num**2 }\n # This can take Ο(n logn)\n bubble_sort(nums)\nend", "def slow_dance(target_tile, tiles_array)\n tiles_array.each_with_index do |tile, index|\n return index if target_tile == tile\n end\n\n nil\nend", "def amicable_numbers(n)\r\n numbers = Array.new\r\n 2.upto(n) do |x|\r\n y = d(x)\r\n if !numbers.include?(y)\r\n numbers.push(x,y) if d(y) == x && y != x\r\n end\r\n end\r\n return numbers\r\nend", "def one_pass_two_sum(array, target)\n hash = {}\n array.each.with_index do |i, index|\n complement = target - i\n if hash.has_key?(complement)\n return [hash.fetch(complement), index]\n end\n hash[i] = index\n end\nend", "def optimize\n left.ne(right.first)\n end", "def problem_106\n a = [1,2,3,4]\n a = [1,2,3,4,5,6,7]\n a = [1,2,3,4,5,6,7,8,9,10,11,12] \n \n num = 0\n seen = {}\n # Don't do length of 1, they are ordered\n # Because they are size ordered, and 2 smalls are bigger than a large\n 2.upto(a.length/2) do |n|\n puts \"n = #{n}\"\n a.combination(n) do |set_a|\n b = a - set_a\n break if b.length < n\n b.combination(n) do |set_b|\n key = [set_a,set_b].sort\n next if seen[key]\n seen[key] = true\n index = 0\n state = 0\n 0.upto(set_a.length-1) do |i|\n break unless set_b[i] && set_a[i]\n if set_a[i] < set_b[i]\n state -= 1\n else\n state += 1\n end\n end\n\n# print \"#{set_a.inspect} #{set_b.inspect} #{state}\"\n if state.abs <= (set_a.length - 2) ||\n (state < 0 && set_a.last > set_b.last) ||\n (state > 0 && set_a.first < set_b.first)\n# puts \" good\"\n num += 1\n else\n# puts \"\"\n end\n end\n end\n end\n num\nend", "def fibo(n)\n (1..n).inject([]) { |memo, i| [1, 2].include?(i) ? memo << i : memo << (memo.last + i) }\nend", "def okay_two_sum?(arr, target)\n arr = arr.sort #n log n\n (0...arr.length).each do |i| #n\n search = bsearch(arr, target-arr[i]) # log n\n return true unless search.nil?\n end #n log n\n false\nend", "def solution(a)\n # write your code in Ruby 2.2\n binding.pry\n trips = Hash.new {|h,k| h[k]=0}\n start = 0\n ending = 0\n min = nil\n a.each_with_index do |trip,i|\n ending = i\n\n if trips[trip] == 0\n min = ending - start\n end\n trips[trip] += 1\n\n while start < ending\n break if trips[a[start]] - 1 == 0\n trips[start] -= 1\n start += 1\n min = ending - start if ending-start < min\n end\n end\n min\nend", "def iterativeMap(list)\n list.each do |i|\n list[i-1] = list[i-1] * 2\n end\n return list\nend", "def o1\n hasher = {}\n (0...@n).each do |n|\n sym = n.to_s.to_sym\n hasher[sym] = n\n end\n\n print_header('O(1) examples')\n\n hash_count = hasher.count\n do_benchmark(\"O(1) - Hash with #{hash_count} items\") do\n hasher[hash_count.to_s.to_sym]\n end\n\n self\n end", "def my_min(list)\n\n # phase 1\n # min = list.first\n # list.each_with_index do |ele_1, i_1|\n # list.each_with_index do |ele_2, i_2|\n # if i_2 != i_1\n # if min > ele_2\n # min = ele_2\n # end\n # end\n # end\n # end\n # min\n\n # phase 2\n min = list.first\n list[1..-1].each do |ele|\n if min > ele\n min = ele\n end\n end\n min\nend", "def three_sum_fastest(arr)\n count = 0\n\n (0..arr.length - 2).each { |i|\n set = Set.new\n\n (i + 1..arr.length - 1).each { |j|\n if set.include?(-arr[i] - arr[j])\n count += 1\n end\n\n set.add(arr[j])\n }\n }\n count\nend", "def move_zeros(array)\n zero_count = 0\n # O(n)\n array.each do |num|\n\n zero_count += 1 if num == 0\n end\n\n # O(n)\n array = array.select { |num| num != 0 }\n \n # O(1)\n zero_count.times do\n array += [0]\n end\n\n array\nend", "def largest_contiguous_subsum_2(list)# [2, 3, -6, 7, -6, 7]\n largest_num = list[0]#2 O(1)\n running_sum = list[0]#2 - 5 after entering loop. O(1)\n\n (1...list.length).each do |i| #O(n) \n running_sum = 0 if running_sum < 0 #O(1)\n running_sum += list[i] #O(1)\n largest_num = running_sum if running_sum > largest_num #O(1)\n end\n return largest_num #O(1)\nend", "def brute_force_two_sum(array, target)\n indexes = []\n array.each.with_index do |n1, index1|\n array.each.with_index do |n2, index2|\n indexes.push(index1) if target - n1 == n2 && index1 != index2\n end\n end\n indexes\nend", "def efficient_contiguous_subsum(list)\n current_sum = list[0] #0\n largest_sum = list[0] #5\n # debugger\n (1...list.length).each do |i| \n if current_sum + list[i] > 0 \n current_sum += list[i] \n largest_sum = current_sum if current_sum > largest_sum\n else \n current_sum = 0\n end \n end \n largest_sum\nend" ]
[ "0.617888", "0.5981844", "0.5961592", "0.5759934", "0.57177943", "0.5694345", "0.56548035", "0.5639155", "0.5561465", "0.55609524", "0.5540044", "0.5538744", "0.5538509", "0.5523373", "0.55189", "0.5513113", "0.55106086", "0.5510591", "0.5497293", "0.5452903", "0.5441648", "0.54300666", "0.54295385", "0.54256785", "0.54248405", "0.54149735", "0.53932476", "0.5379595", "0.53795415", "0.5375047", "0.53745043", "0.53713477", "0.53640354", "0.5363755", "0.53635377", "0.53556144", "0.5355354", "0.5354138", "0.5347544", "0.5338408", "0.53372896", "0.5327533", "0.53252596", "0.53210086", "0.5309919", "0.5308923", "0.53083974", "0.5307584", "0.52959716", "0.52898383", "0.5287011", "0.52860427", "0.5284667", "0.52834207", "0.52821726", "0.5281335", "0.52811086", "0.5281055", "0.5280421", "0.52746606", "0.52730334", "0.5271163", "0.5269596", "0.5267762", "0.5250662", "0.52491117", "0.524767", "0.5243894", "0.52431417", "0.5236459", "0.52360594", "0.523596", "0.5233987", "0.5233852", "0.52249515", "0.52224046", "0.52171445", "0.5211208", "0.52092665", "0.5205454", "0.5205254", "0.52051884", "0.52047336", "0.5197592", "0.51956856", "0.51941776", "0.5185872", "0.5184366", "0.51835394", "0.518291", "0.51809806", "0.5179689", "0.5172988", "0.51711273", "0.51661855", "0.51639265", "0.5160682", "0.51584893", "0.51565915", "0.51500994", "0.51442885" ]
0.0
-1
Returns the org associated with this user
def org client.org(org_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org\n user_id.present? ? User.includes(:org).find_by(id: user_id).org : nil\n end", "def org_id\n @org_id ||= query_org_id # lazy query org_id when not set by login response\n end", "def org_name\n (org = self.organization) && org.name\n end", "def org\n object.user.org&.handle\n end", "def current_org\n current_user&.org\n end", "def orgname\n @orgname ||= begin\n base = User.construct_username(@user.first_name, @user.last_name)\n @orgname_generator.call(base)\n end\n end", "def organization\n if documentable.respond_to? :organization\n documentable.organization\n else\n creator.organization\n end\n end", "def organization\n _get(\"/account/organization\") { |json| json }\n end", "def org_name\n self.org.try(:name).to_s\n end", "def org_node\n @org_node ||= UCB::LDAP::Org.find_by_ou(deptid)\n end", "def org\n @org_resource ||= Org.new(@client)\n end", "def organization\n self[:O]\n end", "def retrieve_organization(name = nil)\n name ||= organization_name\n org = Organization.find_by(name: name)\n halt_with_json_response(404, INVALID_ORG, 'organization does not exist') \\\n if org.nil?\n return org\n end", "def org(id = \"my\", params = {})\n object_from_response(Code42::Org, :get, \"org/#{id}\", params)\n end", "def org_name\n raw_info['org_name']\n end", "def organization\n return @organization if @organization\n @organization = Organization.find(organization_id)\n end", "def current_user_oganizations\n endpoint = '/api/user/orgs'\n @logger.debug(\"Getting current user organizations (GET #{endpoint})\") if @debug\n get(endpoint)\n end", "def get(org_login)\n org_data = @connection.get(\"/orgs/#{org_login}\")\n GitHubApi::Org.new_with_all_data(self, org_data)\n end", "def current_organisation()\n begin\n organisation = (\n Thread.current[:organisation_id].blank? ?\n nil :\n Organisation.find( Thread.current[:organisation_id] )\n )\n\n return organisation\n\n rescue ActiveRecord::RecordNotFound\n return nil\n end \n end", "def org_id\n query('select id from Organization').first['Id']\n end", "def account_organization\n get('account/organization')\n end", "def org_name\n @org_name ||= opts[:org]&.resource&.name\n end", "def get_user_organizations(user_id)\n raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?\n\n get \"#{users_path}/#{user_id}/organizations\"\n end", "def user_or_org\n self.is_user? ? 'user' : 'organization'\n end", "def GetOrg id\n\n APICall(path: \"organizations/#{id}.json\")\n\n end", "def organization_name(org)\n Hardmode.get(\"/orgs/#{org}\", :headers => @auth)\n end", "def associated_organization\n user_sports.first.user.organization \n end", "def list_organizations\r\n Organization.organizations_by_user(self)\r\n end", "def organisation_name\n return if partnership?\n\n organisation.name\n end", "def organisation_name_fetch\n @organisation.try(:organisation_name)\n end", "def exchange_organization\n return @exchange_organization\n end", "def show\n @organization = current_user.organization\n end", "def find_org_by_name(name, params = {})\n search_orgs(name, params).select { |o| o.name == name }.first\n end", "def orgs(params = {})\n params.merge!(key: 'orgs')\n objects_from_response(Code42::Org, :get, 'org', params)\n end", "def get_organization_by_name(org_name)\n org = @client.organizations.find { |cc_org|\n cc_org.name == org_name\n }\n\n org\n rescue Exception => ex\n raise \"#{ex.inspect}, #{ex.backtrace}\"\n end", "def organization_id\n self.organization.id if self.organization && self.organization.is_a?(Organization)\n end", "def wanted_org(name)\n debug(\"Name: #{name}\")\n r = Regexp.new(/(?<org_name>\\A[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)\\/*/)\n @wanted_org ||= r.match(name) && r.match(name)[:org_name]\n debug(\"Wanted org: #{@wanted_org}\")\n @wanted_org\n end", "def org_type\n\t\torg_type = organisation.organisation_type.name\n\t\treturn org_type\n\tend", "def organization_by_name(name)\n @organizations[name]\n end", "def organizational_unit\n self[:OU]\n end", "def role(organization)\n assoc = OrganizationUser.find_by(user_id: self.id, organization_id: organization.id) || OrganizationUser.new()\n assoc.role\n end", "def list\n @connection.get('/user/orgs').map do |org_data|\n GitHubApi::Org.new(self, org_data)\n end\n end", "def org_name\n test_org.name\n end", "def get_user_github_organizations(github_orgs_url)\n uri = URI.parse(github_orgs_url)\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == 'https'\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n response = http.request(Net::HTTP::Get.new(uri.request_uri))\n\n user_organizations = JSON.parse(response.body)\n user_organizations.map { |o| o['login'] }\n end", "def set_organization\n @organization = current_user.organizations.where(id: params[:id]).first\n end", "def get_organizations\n params = {\n 'method' => :get,\n 'command' => '/org'\n }\n\n response, headers = send_request(params)\n orgs = response.css('OrgList Org')\n\n results = {}\n orgs.each do |org|\n results[org['name']] = org['href'].gsub(\"#{@api_url}/org/\", \"\")\n end\n results\n end", "def current_organization\n Organization.find(params[:organization_id])\n end", "def organization\n @organization ||= Github::Organization.new(client, @options[:owner])\n end", "def profile_route\n \"/organization/#{self.id}\"\n end", "def find_organizations(opts = {})\n data, status_code, headers = find_organizations_with_http_info(opts)\n return data\n end", "def organisation=(new_org)\n org_id = new_org.id unless new_org.nil?\n end", "def current_organization\n fog_model_interface.current_organization\n end", "def set_organization\n if current_user.is_admin?\n @organization = Organization.where(id: params[:id]).first\n else\n @organization = current_user.organizations.where(id: params[:id]).first\n end\n \n end", "def organization\n capital_project.organization\n end", "def get(org_name, params={})\n _validate_presence_of org_name\n normalize! params\n get_request(\"/orgs/#{org_name}\", params)\n end", "def get_repos_by_orga(orga) \n\t\treturn self.fetch(\"repos?owner_name=#{orga}\")\n\tend", "def role(organization = nil)\n # Return cached version if available\n return self.read_attribute(:role) if !organization\n \n org = self.organizations.to_a.find { |o| o.id.to_s == organization.id.to_s }\n org ? org.role : nil\n end", "def organization\n if solo_run?\n # configurable fake organization name for chef-solo users\n Chef::Config[:data_collector][:organization]\n else\n Chef::Config[:chef_server_url].match(%r{/+organizations/+([^\\s/]+)}).nil? ? \"unknown_organization\" : $1\n end\n end", "def organization\n id = if params[:organization_id]\n params[:organization_id]\n elsif params.dig(:q, :parent_id_eq)\n params[:q][:parent_id_eq]\n elsif params.dig(model.name.underscore.to_sym, :organization_id)\n params[model.name.underscore.to_sym][:organization_id]\n end\n Organization.where(id: id).first || @record&.organization || OpenStruct.new(id: nil)\n end", "def process_org!(user: nil, managed_only: false, namespace: nil)\n name = name_from_params(namespace: namespace)\n return nil if name.blank?\n\n # check the Orgs table first\n org = Org.where('LOWER(name) = ?', name.downcase).first\n # If we are expecting managed_only do not return it if it is not managed!\n return org if org.present? && (!managed_only || (managed_only && org.managed?))\n\n # Skip if restrict_orgs is set to true! (unless its a Super Admin)\n if (user.present? && user.can_super_admin?) || !Rails.configuration.x.application.restrict_orgs\n # fetch from the ror table\n registry_org = RegistryOrg.where('LOWER(name) = ?', name.downcase).first\n\n # If managed_only make sure the org is managed!\n return nil if managed_only &&\n (registry_org.nil? || registry_org&.org&.nil? || !registry_org&.org&.managed?)\n\n # Convert the RegistryOrg to an Org, save it and then update the RegistryOrg if its ok\n org = ::Org.from_registry_org!(registry_org: registry_org)\n return org if org.present?\n end\n\n # We only want to create it if the user provided a custom name\n return nil if in_list?(namespace: namespace)\n\n # otherwise initialize a new org\n create_org!(name: name)\n end", "def organization\n id = Location.where(id: self.id).joins(:visits).select([:organization_id])\n Organization.where(id: id).select([:name]).first\n end", "def get(*args)\n arguments(args, required: [:org_name])\n\n get_request(\"/orgs/#{arguments.org_name}\", arguments.params)\n end", "def parse_org\n if raw_event.has_key?('repository') && raw_event['repository'].has_key?('organization')\n @org = { 'login' => raw_event['repository']['organization'] }\n else\n @org = parse_field('org', %w{id login gravatar_id avatar_url url})\n end\n end", "def to_org\n return org if org.present?\n\n # If the record has a fundref id then it is a funder\n funder = fundref_id.present?\n # If the record is marked as Education then it is an institution\n institution = types.include?('Education')\n\n org = Org.new(\n name: name,\n contact_email: Org.default_contact_email,\n contact_name: Org.default_contact_name,\n is_other: false,\n links: { org: [{ link: home_page, text: 'Home Page' }] },\n managed: false,\n target_url: home_page,\n funder: funder,\n institution: institution,\n organisation: !funder && !institution\n )\n org.abbreviation = acronyms.any? ? acronyms.first&.upcase : org.name_to_abbreviation\n org\n end", "def organization\n matches = SlashDeploy::GITHUB_REPO_REGEX.match(name)\n matches[1]\n end", "def owner\n get_user owner_id\n end", "def getorganizationname()\r\n return getvalue(SVTags::ORGANIZATION_NAME)\r\n end", "def get_org_information(name)\n begin\n github_api_setup.orgs.get(name)\n rescue Exception => e\n logger.error \"Github #get_org_information error #{e}\"\n end\n end", "def rol\n if !current_login.nil?\n @user = User.find_by(User_Email: current_login[:email])\n @organization = Organization.find_by(Organization_Email: current_login[:email])\n end\n end", "def set_orgao\n @orgao = Orgao.accessible_by(current_ability).find(params[:id])\n end", "def current_organisation_id()\n return Thread.current[:organisation_id]\n end", "def get_organization_by_id(id)\n require_relative 'telerivet/organization'\n Organization.new(self, self.do_request(\"GET\", get_base_api_path() + \"/organizations/#{id}\"))\n end", "def org\n @user = User.find(session[:user_id])\n @organizers = Organizer.find(:all, :conditions => ['user_id=?', session[:user_id]])\n @org = Organizer.new\n @events = nil\n @site = SiteSetting.find(:first)\n render :template => 'users/profile'\n end", "def find_all_organizations\n get_url(\"https://api.github.com/users/#{current_user.username}/orgs\")\n end", "def own_organizations\n api.org_memberships.select { |org| org[:role] == \"admin\"}\n end", "def owner\n collaborators.where(role: \"owner\").first.user\n end", "def base_org\n if self.customization_of.present?\n return Template.where(family_id: self.customization_of).first.org\n else\n return self.org\n end\n end", "def organizations_by_user(user)\n @organizations.values.select { |org| org.is_member?(user) }\n end", "def read_organization(ned_id, opts = {})\n data, status_code, headers = read_organization_with_http_info(ned_id, opts)\n return data\n end", "def org_users\n synchronize { return @org_users if @org_users }\n\n users = {}\n orgs = settings.github_orgs || []\n orgs.each do |org|\n octokit.organization_members(org).each do |user|\n if users.has_key?(user.login)\n users[user.login][:orgs] << org\n else\n users[user.login] = user.to_h\n users[user.login][:mfa_enabled] = true\n users[user.login][:orgs] = [org]\n end\n end\n end\n orgs.each do |org|\n octokit.organization_members(org, filter: '2fa_disabled').each do |user|\n users[user.login][:mfa_enabled] = false\n end\n end\n\n synchronize { @org_users = users }\n end", "def set_orgn\n @orgn = Orgn.find(params[:id])\n end", "def associated_organisation_name_for_solr\n return FinderHelper.strip(role.organisation.organisation_name) if !role.organisation.blank?\n end", "def set_org\n @org = Organization.find(params[:id])\n end", "def orgs(enterprise = 'default')\n @api.orgs enterprise\n end", "def require_org\n # If no working org is set, just use the first one in the visible list.\n # For non-admins this will be their one and only org.\n if working_org.nil?\n self.working_org = @visible_orgs[0]\n end\n true\n end", "def get_organization\n return \"NSBE\" if affiliation == 1\n \"SHPE\"\n end", "def create\n @org = authed_user.orgs.build(org_params)\n\n respond_to do |format|\n if @org.save\n format.html { redirect_to @org, notice: 'Org was successfully created.' }\n format.json { render :show, status: :created, location: @org }\n else\n format.html { render :new }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end", "def org\n self.check.org\n end", "def org\n self.check.org\n end", "def read_organization_by_uid(uid_type, uid_value, opts = {})\n data, status_code, headers = read_organization_by_uid_with_http_info(uid_type, uid_value, opts)\n return data\n end", "def Organization()\r\n ret = _getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def org_endpoint(session)\n \"#{FABRIC_ORGANIZATIONS_ENDPOINT}/#{session.organization_id}\"\n end", "def org_tree_node(o = nil)\n orgs = {}\n @org_ids ||= {}\n (o ? o.children : Organization.find(Organization.find(organization_id).parent).children).order('name').each do |org|\n # collect roles associated with each org\n @org_ids[org.id] ||= {}\n orgs[org.id] = org_tree_node(org)\n end\n orgs\n end", "def organization(name, params = {})\n http.get \"/organization/#{name}\", params\n end", "def organization(name, params = {})\n http.get \"/organization/#{name}\", params\n end", "def role\n return :admin unless organization\n if has_role?(:admin, organization)\n return :admin\n elsif organization.owner_id == self.id\n return :owner\n else\n return :member\n end\n end", "def parent\n raise \"undefined parent Organization\" unless organization?\n organization\n end", "def get_organization_by_name(name)\n result = nil\n\n # Fetch all organizations\n organizations = get_organizations()\n\n organizations.each do |organization|\n if organization[0].downcase == name.downcase\n result = get_organization(organization[1])\n end\n end\n result\n end", "def owner\n build_object attributes['owner'], default_class: Role\n end" ]
[ "0.77694297", "0.69544786", "0.67598236", "0.6711798", "0.66783273", "0.6647725", "0.66399705", "0.6588948", "0.6556434", "0.6502643", "0.64989173", "0.6468849", "0.6464093", "0.64638823", "0.6455913", "0.64344126", "0.6394215", "0.63721603", "0.6369164", "0.6354608", "0.6321952", "0.6294688", "0.62555516", "0.62553", "0.6180564", "0.6138959", "0.60711974", "0.59573877", "0.5941449", "0.5900561", "0.58914477", "0.58887047", "0.588406", "0.58821887", "0.5871036", "0.58693993", "0.58544177", "0.5850605", "0.58495784", "0.58427185", "0.58166087", "0.5800899", "0.5795307", "0.57918435", "0.5791477", "0.5787702", "0.5756193", "0.5742941", "0.57373554", "0.5735483", "0.5714824", "0.5713093", "0.5706452", "0.5686261", "0.5674232", "0.5668924", "0.5663492", "0.5654735", "0.56437045", "0.56336963", "0.56289476", "0.5616596", "0.56085306", "0.55933213", "0.55862707", "0.5579706", "0.5572625", "0.5550884", "0.5538596", "0.5524455", "0.55221164", "0.5518701", "0.5517713", "0.55150783", "0.54858977", "0.54792017", "0.5473085", "0.5469839", "0.5447712", "0.5442906", "0.5432842", "0.54291797", "0.5426801", "0.5420614", "0.54162335", "0.54125947", "0.5401941", "0.5396575", "0.5396575", "0.5385871", "0.5384666", "0.5383938", "0.5370819", "0.53684485", "0.53684485", "0.5367144", "0.53599423", "0.5353898", "0.5348225" ]
0.7242927
2
Returns the roles associated with this user
def roles client.user_roles(id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roles\r\n @roles ||= user_roles.map(&:name)\r\n end", "def roles\n roles_from_users\n end", "def the_roles\n roles.each.map{|_r| User::ROLES[_r.to_sym] }\n end", "def roles\n users.map { |item| item['roles'] }.flatten.uniq\n end", "def roles\n User.valid_roles\n end", "def roles\n response[\"roles\"]\n end", "def roles_from_users\n Role.for_resource(self)\n end", "def roles\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Role)\n end", "def roles_for_user(user)\n role_ids = self.chorus_object_roles.where(:user_id => user.id).map(&:role_id)\n Role.find(role_ids)\n end", "def get_user_roles\n @roles = @user.roles.pluck(:name)\n render json: @roles\n end", "def roles\n self.class.roles.map do |name|\n __send__(name)\n end\n end", "def roles\n Jak.role_klass.where(id: grants.pluck(:role_ids).compact.flatten)\n end", "def roles\n Role.group_roles_from_cache(self)\n end", "def roles\n return [] if !subject.respond_to?(roles_list_meth) || roles_of(subject).blank?\n roles_of(subject).flatten\n end", "def roles\n @users = User.order(\"user_name\").all\n end", "def roles\n roles_as_editor + roles_as_reviewer + role_as_admin\n end", "def roles\n self.dig_for_array(\"roles\")\n end", "def get_roles(opts = {})\n data, _status_code, _headers = get_roles_with_http_info(opts)\n data\n end", "def get_roles_list()\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['apiSecret'] = @api_secret\n\n resource_path = 'identity/v2/manage/role'\n get_request(resource_path, query_parameters, nil)\n end", "def hubssolib_get_user_roles\n user = self.hubssolib_current_user\n user ? user.user_roles.to_authenticated_roles : nil\n end", "def roles\n @resource_roles\n end", "def roles_for_user login\n cu = config['user']\n role_alias = cu[login] || cu[nil]\n role_alias = [ role_alias ] unless Array === role_alias\n roles = [ ]\n role_alias.each do | ra |\n roles.concat config['roles'][ra] || [ ra ]\n end\n roles.uniq!\n roles\n end", "def roles\n tmp = client.get @json['user']['links']['roles']\n tmp['associatedRoles']['roles'].pmap do |role_uri|\n role = client.get role_uri\n client.factory.create(GoodData::ProjectRole, role)\n end\n end", "def accessible_roles\n index = ROLES.index(self.role)\n roles = User::ROLES[0..index].map{|x| [x.humanize, x]} if index\n return roles\n end", "def roles\n (properties[:roles] || []).map { |r| r.is_a?(Link) ? r : Link.new(r, nil, client) }\n end", "def roles_for(user)\n user ||= Authorization.current_user\n raise AuthorizationUsageError, \"User object doesn't respond to roles (#{user.inspect})\" \\\n if !user.respond_to?(:role_symbols) && !user.respond_to?(:roles)\n\n Rails.logger.info('The use of user.roles is deprecated. Please add a method ' \\\n 'role_symbols to your User model.') if defined?(Rails) && Rails.respond_to?(:logger) && !user.respond_to?(:role_symbols)\n\n roles = user.respond_to?(:role_symbols) ? user.role_symbols : user.roles\n\n raise AuthorizationUsageError, \"User.#{user.respond_to?(:role_symbols) ? 'role_symbols' : 'roles'} \" \\\n \"doesn't return an Array of Symbols (#{roles.inspect})\" \\\n if !roles.is_a?(Array) || (!roles.empty? && !roles[0].is_a?(Symbol))\n\n (roles.empty? ? [Authorization.default_role] : roles)\n end", "def pass_on_roles\n r = self.all_roles\n if self.has_access?(:superadmin)\n r = Role.get(Access.roles(:all_users))\n elsif self.has_access?(:admin)\n r = Role.get(Access.roles(:admin_roles))\n elsif self.has_access?(:centeradm)\n r = Role.get(Access.roles(:center_users))\n end\n return (r.is_a?(Array) ? r : [r])\n end", "def pass_on_roles\n r = self.all_roles\n if self.has_access?(:superadmin)\n r = Role.get(Access.roles(:all_users))\n elsif self.has_access?(:admin)\n r = Role.get(Access.roles(:admin_roles))\n elsif self.has_access?(:centeradm)\n r = Role.get(Access.roles(:center_users))\n end\n return (r.is_a?(Array) ? r : [r])\n end", "def users\n Role.users id\n end", "def roles\n raise \"#{subject.inspect} should have a #{roles_list_meth} method\" if !subject.respond_to?(roles_list_meth)\n subj_roles = subject.send(roles_list_meth)\n return [] if subj_roles.blank?\n subj_roles.flatten\n end", "def all\n data = []\n conn = @ec2_main.environment.iam_connection\n if conn != nil\n begin\n response = conn.list_roles()\n if response.status == 200\n data = response.body[\"Roles\"]\n end\n rescue\n puts \"ERROR: getting all roles #{$!}\"\n end\n end\n return data\n end", "def roles\n # rocking this in memory because eager-loading\n roles = object.paper_roles.select { |role|\n role.user_id == scoped_user.id\n }.map(&:description)\n roles << \"My Paper\" if object.user_id == scoped_user.id\n roles\n end", "def list\n @roles = Role.all(:include => [:groups, :users])\n end", "def my_roles(user)\n user.roles & self.design_review_results.collect { |drr| drr.role }\n end", "def pass_on_roles\n r = self.roles.to_a\n if self.has_access?(:superadmin)\n r = Role.get(Access.roles(:all_users)).to_a\n elsif self.has_access?(:admin)\n r = Role.get(Access.roles(:admin_roles)).to_a\n elsif self.has_access?(:centeradm)\n r = Role.get(Access.roles(:center_users)).to_a\n end\n return (r.is_a?(Array) ? r : [r])\n end", "def user_roles\n roles.collect(&:name).join(', ').split(', ').map(&:capitalize).join(', ')#.capitalize\n end", "def roles\n groups.find(:all, :conditions => {:context => Group::GroupType::ROLE})\n end", "def list_review_roles\n\n @review_roles = Role.get_review_roles\n\n end", "def roles\n # we can't use abilities as those are not defined when creating a new operator that is not yet saved\n #result = abilities.collect(&:name)\n authorizations.collect{|auth| auth.ability.try(:name)}\n end", "def roles\n # we can't use abilities as those are not defined when creating a new operator that is not yet saved\n #result = abilities.collect(&:name)\n authorizations.collect{|auth| auth.ability.try(:name)}\n end", "def all_roles\n _role_ids_ = (account_groups.map(&:role_ids) + role_ids).flatten.uniq\n Role.where(id: _role_ids_)\n end", "def role_list \n @role_list ||= begin\n (store.display_roles | group_store.display_roles)\n end\n end", "def roles(reload = false)\n @roles = nil if reload\n @roles ||=\n Role.find_by_sql ['select * from roles where id in ' +\n self.class.role_assigned_cond(':id'),\n {:id => id}]\n end", "def list_roles(options={})\n request({\n 'Action' => 'ListRoles',\n :parser => Fog::Parsers::AWS::IAM::ListRoles.new\n }.merge!(options))\n end", "def roles\n @roles = Role.order(\"name\")\n\t@rights = Right.order(\"name\").map {|r| [r.name, r.id] }\n end", "def roles(options = {})\n headers = extract_headers!(options)\n json = client.list(\"/v1/auth/approle/role\", options, headers)\n return Secret.decode(json).data[:keys] || []\n rescue HTTPError => e\n return [] if e.code == 404\n raise\n end", "def roles\n return proposed_snapshot.roles if proposed? \n return active_snapshot.roles if active?\n []\n end", "def resource_roles\n return @resource_roles\n end", "def get_user_roles(user_id, options = {})\n raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?\n path = \"#{users_path}/#{user_id}/roles\"\n request_params = {\n per_page: options.fetch(:per_page, nil),\n page: options.fetch(:page, nil),\n include_totals: options.fetch(:include_totals, nil)\n }\n get(path, request_params)\n end", "def current_user_role_names\n container.current_user_role_names\n end", "def roles_with_hierarchy_for(user)\n flatten_roles(roles_for(user))\n end", "def roles\n\t\t\t\tProxy.new connection, 'role-strategy/strategy'\n\t\t\tend", "def my_roles\n @my_roles ||= self.roles.map {|r| r.name}.flatten.freeze\n end", "def associated_roles\n data[:associated_roles]\n end", "def associated_roles\n data[:associated_roles]\n end", "def roles_list(role = nil)\n self.role_symbols\n end", "def role_select\n @@Roles.list\n end", "def my_assigned_roles(user)\n roles = []\n self.my_roles(user).each do |role|\n design_review_result = self.design_review_results.detect { |drr| drr.role == role }\n roles << role if design_review_result.reviewer == user\n end\n roles\n end", "def users\n Section.find_roles.pluck(:name).inject(Array.new) do |result, role|\n result += User.with_role(role, self)\n end.uniq\n end", "def current_user_role_names\n @current_user_role_names ||= Manage::Group.role_names_for current_user\n end", "def app_roles\n return @app_roles\n end", "def role_ids\n roles.pluck(:id)\n end", "def roles\n url = \"/gdc/projects/#{pid}/roles\"\n tmp = GoodData.get(url)\n tmp['projectRoles']['roles'].map do |role_url|\n json = GoodData.get role_url\n GoodData::ProjectRole.new(json)\n end\n end", "def cr_node_roles\n @node.roles\n end", "def list_roles\n Character.where(actor:self).map{|c|\"#{c.name} - #{c.show.name}\"}\n end", "def roles\n get_chef_files_absolute_paths roles_path\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability, :read)\n end", "def all_roles\n result = Array.new\n \n# for role in self.roles\n# result << role.ancestors_and_self\n# end\n \n for group in self.groups\n result << group.all_roles\n end\n \n result.flatten!\n result.uniq!\n \n return result\n end", "def list\n # We don't use pagination here since we want to display the roles in a\n # nice tree. Additionally, there won't be more than ~100 roles in a\n # normal scenario anyway - far less!\n @roles = Role.find(:all)\n end", "def get_roles(options = {})\n request_params = {\n per_page: options.fetch(:per_page, nil),\n page: options.fetch(:page, nil),\n include_totals: options.fetch(:include_totals, nil),\n name_filter: options.fetch(:name_filter, nil)\n }\n get roles_path, request_params\n end", "def conversation_member_roles\n return @conversation_member_roles\n end", "def to_authenticated_roles\n return self\n end", "def user_role\n r = Role.find_by_role(WFConsts::USER)\n r\n end", "def list\n\n @roles = Role.find(:all, :order => 'name')\n\n end", "def get_user_roles(user_id, opts = {})\n data, _status_code, _headers = get_user_roles_with_http_info(user_id, opts)\n return data\n end", "def claims\n get_all_roles\n end", "def claims\n get_all_roles\n end", "def role_assignments\n return @role_assignments\n end", "def load_roles\n @roles = service_user.identity.roles.keep_if do |role|\n ALLOWED_ROLES.include?(role.name) || user_has_beta_role?(role.name)\n end.sort_by(&:name)\n end", "def role_permissions\n return @role_permissions\n end", "def roles\n @declared_roles ||= Hash.new\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability, :read)\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability, :read)\n end", "def data_roles\n if current_user.has_role? :superadmin\n @roles = Role.only_super_admin.accessible_by(current_ability)\n else\n unless current_user.warehouse.blank?\n roles = \"customer\"\n else\n roles = \"supplier\"\n end\n @roles = Role.only_admin_group(roles)\n end\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "def secondary_roles\n user.secondary_role\n end", "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability)\n end", "def get_roles\n Role.all.select {|role| role.character == self}\n end", "def index\n @users_roles = UsersRole.all\n end", "def resources\n Typus::Configuration.roles[self.roles].compact\n end", "def roles(system, username)\n\n roles = []\n user = self.get_user\n\n if user.key? \"groups\" and user[\"groups\"].any?\n roles << group_roles\n end\n\n if user.key? \"roles\" and user[\"roles\"].any?\n roles << roles_for(username)\n end\n\n # Convert from [{\"api\":[\"sysadmin\"]},{\"api\":[\"reader\"]}]\n roles = roles.flatten.select {|r| r.key? system} \n roles = roles.map {|system_role| system_role[system]}.flatten.uniq\n # to [\"sysadmin\", \"reader\"]\n\n roles\n end", "def reviewer_roles\n\n members = []\n Role.get_open_reviewer_roles.each do |role|\n entry_user = self.board_design_entry_users.detect{ |eu| eu.role_id == role.id }\n members << { :role => role,\n :member_list => role.active_users,\n :member_id => entry_user ? entry_user.user_id : 0,\n :required => !entry_user || (entry_user && entry_user.required?) }\n end\n members\n end", "def possible_roles\n ([self.role] + DEFAULT_ROLES).uniq.compact.collect { |r| [ r.titleize, r ]}\n end", "def list_employee_roles(opts = {})\n data, _status_code, _headers = list_employee_roles_with_http_info(opts)\n return data\n end", "def super_and_admin_roles\n return roles_include(roles.keys[0..1])\n end" ]
[ "0.7938685", "0.79179275", "0.7800574", "0.7796106", "0.7716763", "0.76074106", "0.7597818", "0.74161816", "0.73145646", "0.7272813", "0.723718", "0.72232074", "0.7221851", "0.7189618", "0.71150357", "0.7105865", "0.706569", "0.70304334", "0.7020986", "0.6979606", "0.6966958", "0.6928351", "0.6925712", "0.69127995", "0.68828756", "0.6881222", "0.6874578", "0.6874578", "0.68269765", "0.6778498", "0.6732331", "0.67038774", "0.6687589", "0.66872364", "0.6649333", "0.66421604", "0.663514", "0.6612334", "0.66100323", "0.66100323", "0.66050607", "0.6583626", "0.6578979", "0.6571163", "0.65470546", "0.65365404", "0.65323853", "0.64991647", "0.64950174", "0.64908063", "0.6468919", "0.64631194", "0.64503294", "0.6430555", "0.6430555", "0.6430131", "0.6403517", "0.63926667", "0.6354275", "0.63495624", "0.63384384", "0.63338816", "0.6332382", "0.63312304", "0.6275482", "0.6270963", "0.6265734", "0.6246075", "0.62418705", "0.6229663", "0.6226299", "0.62195325", "0.6215444", "0.62121546", "0.6211438", "0.62054276", "0.62054276", "0.6199072", "0.6187824", "0.61828077", "0.61791414", "0.6171937", "0.6171937", "0.61642414", "0.61439455", "0.61439455", "0.61439455", "0.61439455", "0.61409944", "0.6137633", "0.61289227", "0.6119007", "0.6105832", "0.61007136", "0.60647476", "0.6047434", "0.6020852", "0.6014033", "0.6008799" ]
0.8289946
1
Assigns a role to this user
def assign_role(attrs = {}) attrs.merge!(user_id: id) client.assign_role(attrs) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_role\n self.add_role!(\"user\")\n end", "def assign_role\n UserRole.create!(user_id: self.id, role_id: 3)\n end", "def assign_role\n member_role = Role.find_by(name: \"member\")\n UserRole.create!(user_id: self.id, role_id: member_role[:id])\n end", "def assign_role(user_id, role_id)\n user_role = UserRole.new\n user_role.user_id = user_id\n user_role.role_id = role_id\n user_role.save\n end", "def assign_role(user, role_name)\n role = Role.find_by_name role_name\n user.role = role\n user.save!\nend", "def assign_role_to_user(id, options = {})\n post(\"/users/#{id}/roles\", options)\n end", "def set_role\n @role = role\n end", "def give_role(name)\n r = Role.new(:name => name, :user => self)\n self.roles << r\n save(false)\n end", "def assign(role:, type:, rsuser:)\n\t\t\t\t\tconnection.post(build_path('assignRole'), nil, roleName: role, type: type, sid: rsuser).\n\t\t\t\t\t\tcode == '200'\n\t\t\t\tend", "def set_role\n role = Spree::Role.find_by name:\"user\"\n self.spree_roles << role\n end", "def assign_role\n self.role = Role.find_by name: \"Aanvrager\" if self.role.nil?\n end", "def assign_role\n self.role = Role.find_by name: \"Regular\" if self.role.nil?\n end", "def set_role\n @role = RightManager::Role.find(params[:id])\n end", "def assign_role\n if self.organization\n self.add_role :organization if self.roles.blank?\n else\n self.add_role :standard if self.roles.blank?\n end\n end", "def set_user\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @project.id)\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_user_role(role)\n role_id = Role.where(role_type: role).first.id\n self.update_attributes(role_id: role_id) \n end", "def set_user\n @role = Role.find(params[:id])\n authorize @role\n end", "def assign_role\n\t\tself.role = Role.find_by role_name: \"PIC Pengadaan\" if self.role.nil?\n\tend", "def set_user_role\n role = Role.where({:name => \"system_user\"}).first\n raise RuntimeError, \"Error: unable to find role: system_user\" unless role\n user_role = UserRole.new\n user_role.role_id = role.id\n user_role.user_id = self.id\n user_role.save!\n end", "def set_user_to_role\n @user_to_role = UserToRole.find(params[:id])\n end", "def set_role(role, user)\n\t\tprivs = privileges(user)\n\t\tunless privs[:edit]\n\t\t\traise TinyException, TinyException::MESSAGES[TinyException::NOPRIVILEGES]\n\t\tend\n\t\t\n\t\tcase role\n\t\twhen \"student\"\n\t update_attribute(:role, Enrollment::ROLE_STUDENT)\n\t when \"instructor\"\n\t update_attribute(:role, Enrollment::ROLE_INSTRUCTOR)\n\t end\n\tend", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role(user, role)\n membership = membership_of(user)\n\n if membership\n if role.blank?\n membership.destroy\n else\n membership.update_attributes(:role => role)\n end\n elsif user and not role.blank?\n memberships.build(:user => user, :role => role)\n end\n end", "def grant_role\n @user = User.find_by_email(params[:email])\n @user.roles.append(Role.find_by_name(params[:role]))\n @user.save\n redirect_to action: :user_list\n end", "def create_user_role\n if self.role.blank?\n id = Role.select{|role| role.role_type == $roles[:user]}.map(&:id)\n self.update_attributes(:role_id => id[0])\n end\n end", "def role=(value)\n @role = value\n end", "def role=(value)\n self.user_type = ROLES[value]\n end", "def grant_role\n raise InvalidRole.new if current_user.user?\n end", "def set_role\n @role = Role.find(params[:id]) if params[:id].present?\n end", "def create_role(role_name, params = {})\n change_role_access(role_name, user_emails_to_ids(params), :post)\n end", "def set_users_role\n @users_role = Users::Role.find(params[:id])\n end", "def assign_role\n #self.role = Role.find_by name: '訪客' if self.role.nil?\n self.role = Role.find_by name: 'Guest' if self.role.nil?\n end", "def set_role\r\n @role = Role.find(params[:id])\r\n end", "def add_user_role\n user_role = Role.find_by_name(\"user\")\n self.roles << user_role if user_role and self.roles.empty?\n end", "def set_users_role\n @users_role = UsersRole.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @role = Role.find(params[:id])\n end", "def set_role\n @user = User.find(params[:id])\n @user.role_id = params[:role_id]\n if @user.save\n render :text => \"Updated\"\n else\n render :text => @user.errors.to_a.flatten.join(\", \")\n end\n end", "def add_user_role user, role\n user_role = ProjectRoleUser.new\n user_role.project = self\n user_role.user = user\n user_role.role = role\n user_role.save\n end", "def add_role!(role)\n role_obj = Role.find_or_create_by_name(role)\n self.add_role(role_obj.name)\n end", "def assign_role\n self.role = Role.find_by name: \"Survivor\" if self.role.nil?\n end", "def add_role(user, role_name)\n role = Role.new(name: role_name, user: user)\n self.roles << role\n return role\n end", "def add_to_role(rolename)\n @role_names = nil\n role = Role.find_or_create_by_rolename(rolename)\n self.roles << role if !self.roles.include?(role) # Make sure that the user can only be put into a role once\n end", "def set_user\n @user = User.find(params[:id])\n # automatically add user right when we see the user\n # /!\\ it add to every and single user visited!\n if !@user.is_user?\n @user.roles << Role.where(name: 'user').first_or_create\n end\n end", "def create\n if !grant_access(\"edit_roles\", current_user)\n head(403)\n end\n @role = Role.new(role_params)\n @role.user_id = current_user.id\n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end", "def assign_role\n \tdefault_role = Role.where(name: 'LeadGenerator').last\n \t self.role_id = default_role.id if self.role_id.blank? && default_role.present?\t\t\t\n end", "def assign_role\n if self.accountable_type.present?\n self.add_role self.accountable_type.to_s.tableize.singularize.to_sym\n else\n self.add_role \"JobSeeker\".tableize.singularize.to_sym\n end\n end", "def set_role\n new_role = params[:role]\n return render(nothing: true, status: :unauthorized) if new_role == 'superuser' && current_user.role != 'superuser'\n\n @user.role = new_role\n @user.save!\n respond_to do |format|\n format.js\n end\n end", "def assign_role(role = :villager)\n klass = role.to_s.classify.constantize\n if klass.new.is_a?(Player)\n self.update_attribute(:type, role.to_s.classify)\n klass.find(self.id)\n else\n false\n end\n end", "def assign_role(character)\n Role.new(self, character)\n end", "def set_role\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @project.id)\n if @role\n @role_level = (RoleLevel.find(@role.role_level_id)).name\n else\n @role_level = ''\n end\n end", "def assign_role(symbol)\n role = Role.find_by_symbol(symbol)\n\n if role == nil\n raise StandardError, \"Role not found\"\n end\n\n user_roles = UserRole.where(:user_id => self.id, :role_id => role.id)\n if user_roles.size > 0\n return true\n end\n\n user_role = UserRole.new\n user_role.user_id = self.id\n user_role.role_id = role.id\n user_role.save\n end", "def add_role(role_name)\n return false unless User.roles.keys.include?(role_name)\n r = User.roles[role_name]\n self.role |= (1 << r)\n self.save\n end", "def role= new_role\n @role = String new_role\n end", "def new_user\n if self.role_id.nil?\n self.role_id = 3\n end\n end", "def new_user\n if self.role_id.nil?\n self.role_id = 3\n end\n end", "def grant_role\n raise InvalidRole.new if current_user.manager?\n end", "def set_role\n role = Role.find_by_name(user_params[:role]) rescue nil\n role ? user_params_with_role(role) :\n (render json: { status: 400, error: \"Mention a proper Role for User\" })\n end", "def save_roles user\n user.add_role(params[:role_name])\n end", "def set_urole\n begin\n #@client.sobject_module = Salesforce #Using Salesforce Name, to avoid collision with my 'Order' Object in MongoDB.\n if self.user_role.nil?\n #self.user_role = UserRole.where(name: \"regular\").first\n self.user_role_id = Urole.where(name: \"regular\").first.id\n logger.info \"Setting this user '#{self.email}' to use 'regular' role @ #{Time.now}.\"\n else\n logger.info \"User '#{self.email}' is using '#{self.user_role.name}' role @ #{Time.now}.\"\n end\n rescue Exception => e\n logger.info 'Your DB has not been seeded. Please seed it first. ' + e.message\n end\n end", "def set_as_admin\n self.role = USER_ROLES[:admin]\n end", "def add_user(user)\n Role.add_user role_id: id, user_id: user.id\n end", "def assignrole(role)\n roles << role unless roles.exists?(role)\n end", "def admin_user_with_role(user)\n send user.role, user\n end", "def add_role(role)\n roles << role\n end", "def create_user_role_assignment(id:, **args)\n params = parameters(args) do\n required_params :role_id\n optional_params :role_id\n end\n request(:post, \"users/#{id}/roleAssignments\", params)\n end", "def assign_role(new_role)\n return false if role.present?\n\n Minion.transaction do\n # We set highstate to pending since we just assigned a new role\n update_columns(role: new_role, highstate: :pending)\n salt.assign_role new_role\n end\n true\n rescue Pharos::SaltApi::SaltConnectionException\n false\n end", "def with_role(role_name)\n self.role = Role.where(name: role_name).first_or_create\n self # returns the user\n end", "def role(role, options = {})\n append_role role, options\n @current_role = role\n yield\n ensure\n @current_role = nil\n end", "def role(role, options = {})\n append_role role, options\n @current_role = role\n yield\n ensure\n @current_role = nil\n end", "def set_role(role, agency)\n if !agency && !role\n raise \"Expecting values for role and agency\"\n end\n # Add role with an agency if applicable\n if role == \"superuser\"\n self.add_role(role)\n elsif agency == \"\"|| agency.nil?\n self.add_role(role)\n elsif staff_agency.nil?\n self.add_role(role,agency)\n elsif agency\n self.remove_role(self.roles.last.name.to_sym)\n self.add_role(role,agency)\n end\n end", "def set_role role\n set_ds_field role.to_s\n end", "def setup_role \n if self.role_ids.empty? \n self.role_ids = [Role.find_by_name(\"User\").id] \n end\n end", "def set_role_user\n @user = User.find(params[:id])\n\n respond_to do |format|\n @nav = 'show_nav'\n if (@local_manager.slave?)\n flash[:warning] = \"This action is prohibited on slave systems.\"\n format.html { redirect_to user_url(@user) }\n format.xml { render :xml => '<errors><error>This action is prohibited on slave systems.</error></errors>', :status => :not_acceptable }\n elsif (@user.id == @session_user.id)\n @user.errors.add_to_base(\"Users may not change their own role.\")\n format.html { render :action => :show }\n format.xml { render :xml => @user.errors, :status => :not_acceptable }\n else\n @user.user!\n @local_manager.log(:username => @session_user.username, :user_id=> @user.id, :message => \"Set role to 'user' for user #{@user.username}.\")\n format.html { redirect_to user_url(@user) }\n format.xml { head :ok }\n end\n end\n end", "def create\n @role = Role.new(role_params)\n\n respond_to do |format|\n if role.save\n current_user.add_role :admin, role\n format.html { redirect_to admin_role_path(role), notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: role }\n else\n format.html { render :new }\n format.json { render json: role.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_role\n @user = User.find( params[:id] )\n @user.update_attributes(params[:user])\n redirect_to users_path\n end", "def add_role(arg)\n raise ArgumentError, \"Invalid role: '#{arg}' (expected one of User::ROLES [#{ROLES.join(', ')}])\", caller if !ROLES.include?(arg)\n self.roles = \"#{self.roles.to_s} #{arg}\".strip if not has_role?(arg)\n end" ]
[ "0.8468781", "0.8467363", "0.78720623", "0.7769497", "0.7636212", "0.7557303", "0.7516128", "0.7388484", "0.7382249", "0.7308927", "0.7274297", "0.72372055", "0.7194168", "0.7148235", "0.71345395", "0.7104191", "0.70921385", "0.7081167", "0.7073458", "0.7069615", "0.7066159", "0.7065728", "0.7011179", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6973016", "0.6972235", "0.6945106", "0.6905003", "0.68991977", "0.68603146", "0.68482536", "0.68319273", "0.68281263", "0.6814482", "0.6810567", "0.6810183", "0.6799963", "0.6762974", "0.6723433", "0.67147535", "0.67147535", "0.67147535", "0.67147535", "0.67147535", "0.67147535", "0.67147535", "0.67147535", "0.67081", "0.66762316", "0.6670844", "0.6670664", "0.66507787", "0.66286254", "0.6616655", "0.6606458", "0.66050744", "0.6589703", "0.658606", "0.65714425", "0.6568166", "0.6546059", "0.65327966", "0.65271586", "0.6527139", "0.65271163", "0.65271163", "0.65054685", "0.6502136", "0.6493634", "0.64927155", "0.6457232", "0.64490193", "0.64439386", "0.6441853", "0.6439375", "0.6437018", "0.6435259", "0.64030695", "0.63859665", "0.63859665", "0.63769895", "0.63709855", "0.63564813", "0.6341022", "0.634019", "0.63223255", "0.6322298" ]
0.815165
3
end initialize randomly determine if this room will have an enemy
def assign_enemy @has_enemy = rand(1..2)==1 ? true : false #need an enemy value for the room. end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enemy_spawned\n enemy_chance = ENEMY_CHANCE_BASE + (@dungeon.level + ENEMY_CHANCE_MOD)\n enemy_chance > rand(100)\n end", "def initialize\n\t\t@enemy = Faker::Name.name\n\tend", "def populate_room\n unless @dungeon.first_room\n @enemy = Zarta::Enemy.new(@dungeon) if enemy_spawned\n end\n @dungeon.first_room = false\n @weapon = Zarta::Weapon.new(@dungeon) if weapon_spawned\n @stairs = stairs_spawned\n end", "def resetEnemyCounter\n\t\t@enemyCounter = 0 + rand(2)\n\tend", "def random_target_enemy_hp0\n return random_target_enemy(true)\n end", "def enemy_attack!\n begin\n cell = nil\n if @enemy_moves.any? && @enemy_moves.last.hit? && !@enemy_moves.last.ship.sunk?\n if @enemy_moves[-2].nil? || !@enemy_moves[-2].hit?\n orientation = Ship::ORIENTATIONS[(rand * 2).to_i]\n else\n orientation = @enemy_moves.last.row_index == @enemy_moves[-2].row_index ? :horizontal : :vertical\n end\n offset = 1 * ((rand * 2).to_i == 1 ? 1 : -1)\n if orientation == :horizontal\n offset *= -1 if [-1, Grid::WIDTH].include?(@enemy_moves.last.column_index + offset)\n cell = opposite_grid.cell_rows[@enemy_moves.last.row_index][@enemy_moves.last.column_index + offset]\n else\n offset *= -1 if [-1, Grid::HEIGHT].include?(@enemy_moves.last.row_index + offset)\n cell = opposite_grid.cell_rows[@enemy_moves.last.row_index + offset][@enemy_moves.last.column_index]\n end\n cell = nil if cell.hit?\n end\n if cell.nil?\n random_row_index = (rand * Grid::HEIGHT).to_i\n random_column_index = (rand * Grid::WIDTH).to_i\n cell = opposite_grid.cell_rows[random_row_index][random_column_index]\n end\n end until cell.hit.nil?\n attack!(cell.row_index, cell.column_index)\n @enemy_moves << cell\n end", "def initialize\n @enemies_direction = Array.new\n @captives_direction = Array.new\n @max_health = 20\n @health = 20\n @min_health = 15\n @retreat_health = 4\n @enemies = 0\n @captives = 0\n @binded = 0\n @enemies_binded = 0\n @bombs_used = 0\n @close_enemies = 0\n @captive_unit = nil\n @enemy_unit = nil\n @turn = 0\n end", "def random_target_enemy(hp0 = false)\n # Initialize roulette\n roulette = []\n # Loop\n for enemy in @enemies\n # If it fits the conditions\n if (not hp0 and enemy.exist?) or (hp0 and enemy.hp0?)\n # Add an enemy to the roulette\n roulette.push(enemy)\n end\n end\n # If roulette size is 0\n if roulette.size == 0\n return nil\n end\n # Spin the roulette, choose an enemy\n return roulette[rand(roulette.size)]\n end", "def ygg_enemy? ; return @ygg_enemy ; end", "def setupEnemyBoard\n ships = Ship.find(:all, :order => \"id\")\n ships.each do |ship|\n placed = false\n while !placed\n coords = []\n bow = findRandomBow\n coords << getIndex(bow[0], bow[1])\n if ship.length == 1\n placeShip(ship.id, coords, \"enemy\")\n placed = true\n else\n direction = rand(4)\n if placementClear(ship.length, direction, coords, \"enemy\")\n self.placeShip(ship.id, coords, \"enemy\")\n placed = true\n end\n end\n end\n end\n end", "def initialize\n @id = 0 ## event id\n @ai = 0\n @hp = 30\n @meele_damage = 30\n @range_damage = 10\n @last_attack = 0\n @cooldown = 3 * Graphics.frame_rate ### 3 seconds in frames\n @alive = false\n @index = 0\n @active = false\n @damage_taken = 0\n @initialized = false ## this turns true when Enemy is alive or dead\n \n end", "def initialize\n @rooms = { #defines the rooms available for use on each floor\n :upstairs => [\"Master Bedroom\", \"A Guest Room\", \"Tower\", \"Balcony\", \"Observatory\", \"The Hole Room\"],\n :main => [\"Kitchen\", \"Library\", \"Study\", \"Dining Room\", \"Living Room\", \"Vault\"],\n :downstairs => [\"Furnace Room\", \"Chapel\", \"Storage Room\", \"The Pit\"]\n }\n\n @used_rooms = []\n @omen_count = 0 #Omens are a game event that change the story line. Once the omen count reaches 10 the haunt starts\n @player = Character.new\n intro #script\n entry_hall(\"Main Hallway\")\n game\n end", "def enemy; end", "def choose_attack_direction\n @enemies_direction = Array.new\n Directions.each do |dir|\n if warrior.feel(dir).enemy? != nil\n @enemies_direction.push dir\n end\n end\n return false \n end", "def createRoom()\n\t\twidth = rand(@areaWidth * 0.5 .. @areaWidth * 0.7).floor\n\t\theight = rand(@areaHeight * 0.5 .. @areaHeight * 0.7).floor\n\t\t@room = [\n\t\t\trand(@areaX + @areaWidth * 0.15 .. @areaX + @areaWidth - width * 1.15).ceil,\n\t\t\trand(@areaY + @areaHeight * 0.15 .. @areaY + @areaHeight - height * 1.15).ceil,\n\t\t\twidth,\n\t\t\theight,\n\t\t]\n\tend", "def initialize(index, enemy_id)\n super()\n @index = index\n @enemy_id = enemy_id\n enemy = $data_enemies[@enemy_id]\n @original_name = enemy.name\n @letter = ''\n @plural = false\n @screen_x = 0\n @screen_y = 0\n @battler_name = enemy.battler_name\n @battler_hue = enemy.battler_hue\n @hp = maxhp\n @mp = maxmp\n end", "def initialize\n @e_tanks = 4\n\n # alive (true) ; defeated (false)\n @bubble_man = false\n @air_man = false\n @quick_man = false\n @wood_man = false\n @crash_man = false\n @flash_man = false\n @metal_man = false\n @heat_man = false\n end", "def decide_random_target_for_enemy\n # Diverge with effect scope\n if for_one_friend_hp0?\n battler = $game_troop.random_target_enemy_hp0\n elsif for_one_friend?\n battler = $game_troop.random_target_enemy\n else\n battler = $game_party.random_target_actor\n end\n # If a target exists, get an index, and if a target doesn't exist,\n # clear the action\n if battler != nil\n @target_index = battler.index\n else\n clear\n end\n end", "def add_defeated_enemies\n $game_troop.dead_members.each { |enemy| $game_party.add_enemy_defeated(enemy.enemy_id) }\n end", "def known_enemies\n defeated_enemies\n end", "def set_enemy\n @enemy = Enemy.find(params[:id])\n end", "def set_enemy\n @enemy = Enemy.find(params[:id])\n end", "def set_enemy\n @enemy = Enemy.find(params[:id])\n end", "def set_enemy\n @enemy = Enemy.find(params[:id])\n end", "def we_have_enemy_flag?\n @agents.any? do |a|\n a.tank.flag != \"none\" &&\n a.tank.flag != @my_color\n end\n end", "def create_enemy(pos, movement, enemy_type = :enemy1)\n sprite, life, amplitude, tags =\n case enemy_type\n when :enemy1 then [@screen.make_basic_enemy_sprite, 20, rand * 20, [:enemy]]\n when :enemy2 then [@screen.make_enemy2_enemy_sprite, 400, 40, [:enemy, :boss]]\n when :honda then [@screen.make_flying_honda, 1000, 0, [:enemy, :boss]]\n when :mario_kart_fish then [@screen.make_mario_kart_fish, 1000, 0, [:enemy, :boss, :rotating, :mario_kart_fish]]\n else fail enemy_type.to_s\n end\n traj = SinusoidalTraj.new(@clock, pos, movement, amplitude, rand * 0.05, rand)\n enemy = Enemy.new(sprite, traj).with(:life => life, :tags => tags)\n enemy.revolutions_per_second = 0 if enemy_type == :mario_kart_fish\n return enemy\n end", "def enemies_nearby?(warrior)\n warrior.feel(@@direction).enemy?\n end", "def set_enemies(enemies)\n @enemy_party = []\n for i in 0...enemies.size\n next if $game_self_switches[[$game_map.map_id, enemies[i][0], 'D']] or \n $game_map.events[enemies[i][0]].erased\n @enemy_party << enemies[i]\n end\n end", "def initialize(world=World.new, seeds=[])\n @world = world\n @seeds = seeds\n @total_generations = 1\n @generation = 0\n\n if @seeds.length == 0\n @world.populate!\n end\n\n @seeds.each do |row|\n @world.board[row[0]][row[1]].alive = true\n end\n end", "def setEnemy(enemy)\n @enemy=enemy\n end", "def next_to_enemy?\n Map::DIRECTIONS.any? { |dir| @warrior.feel(dir).enemy? }\n end", "def enemy?(id)\n return @enemies.include?(id)\n end", "def monk(level)\n @enemy_type = \"Monk\"\n @enemy_health_points = rand(150..250)*level\n @enemy_max_health = @enemy_health_points\n @enemy_attack = 40*level\n @enemy_armor_score = 12 + level\n end", "def setEnemy(enemy)\n @enemy = enemy\n end", "def init_enemysprites\r\n # Make enemy sprites\r\n @enemy_sprites = []\r\n for enemy in $game_troop.enemies.reverse\r\n @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))\r\n end\r\n end", "def set_enemy(enemy)\n text = enemy.name\n state_text = make_battler_state_text(enemy, 112, false)\n if state_text != \"\"\n text += \" \" + state_text\n end\n set_text(text, 1)\n end", "def initialize(enemy, allow_change = true)\n @contents_heights = Hash.new(0)\n @enemy = enemy.is_a?(Integer) ? Game_Enemy.new(1, enemy) : enemy\n @draw_y = 0\n @id = @enemy.enemy_id\n @allow_change_enemy = allow_change\n @battler_size = []\n gwidth = Graphics.width - standard_padding * 2\n gheight = Graphics.height - standard_padding * 2\n if BattlerSize[0] == :default then @battler_size << gwidth / 2\n else @battler_size << BattlerSize[0] end\n if BattlerSize[1] == :default then @battler_size << gheight / 2\n else @battler_size << BattlerSize[1] end\n super()\n end", "def mage(level)\n @enemy_type = \"Mage\"\n @enemy_health_points = rand(100..200)*level\n @enemy_max_health = @enemy_health_points\n @enemy_attack = 20*level\n @enemy_armor_score = 11\n end", "def spawn_enemy_balls\n # TODO\n end", "def initialize(type)\n super()\n @type = type\n case @type\n when 1\n @image = Gosu::Image['/spaceship/Enemy1.png']\n @zorder = -10\n @count = 1\n @health = 1\n when 2\n @image = Gosu::Image['/spaceship/MiniBoss1.png']\n @zorder = -20\n @count = 3\n @health = 5\n when 3\n @image = Gosu::Image['/spaceship/Boss1.png']\n @zorder = -30\n @count = 5\n @health = 10\n $boss = true\n end\n @angle = 180\n @x = $window.width + @image.width\n @y = rand(0..$window.height)\n end", "def decide_action(char)\n # temporary variables\n dir, x, y, ai = char.direction, char.x, char.y, char.ai\n pix = $BlizzABS.pixel\n # get alignment setup\n negative, positive = ai.negative, ai.positive\n # invert setup if confused\n negative, positive = positive, negative if char.restriction == 3\n # get all enemies in sight\n in_sight_e = ai.sight.find_all {|b| negative.include?(b.ai.group)}\n # if no enemies are available\n if in_sight_e.size == 0\n # initialize\n in_sight_a, in_range = [], ai.memory.keys\n # get all allies and enemies in range\n in_range.each {|b|\n in_sight_a.push(b) if positive.include?(b.ai.group)\n in_sight_e.push(b) if negative.include?(b.ai.group)}\n # if still no enemies are available\n if in_sight_e.size == 0\n # initialize again\n in_sight_a = []\n # get all allies and enemies from memory\n ai.memory.each_key {|b|\n in_sight_a.push(b) if positive.include?(b.ai.group)\n in_sight_e.push(b) if negative.include?(b.ai.group)}\n end\n else\n # get all allies in sight\n in_sight_a = ai.sight.find_all {|b| positive.include?(b.ai.group)}\n end\n # exit if no enemies are in sight\n return if in_sight_e.size == 0\n # if actor\n if char.is_a?(Map_Actor)\n # exit if \"no enemies\" are in sight\n return if in_sight_e.size == 0\n # get radius reach of player\n rad = $BlizzABS.util.get_player_radius\n # find all enemies within radius according to aggressiveness\n in_radius = in_sight_e.find_all {|e|\n Math.hypot(char.x / pix - e.x / pix, char.y / pix - e.y / pix) <=\n rad * char.ai.aggressive / 15}\n # check next trigger if action can't be executed\n return if in_radius.size == 0\n # add self as ally\n in_sight_a.push(char)\n # if confused or no trigger action was set up\n if char.restriction == 3 ||\n !trigger_actor_action(char, in_sight_a, in_sight_e)\n # set up advanced action based on Blizz-ABS AI\n advanced_actor_action(char)\n end\n # if enemy\n elsif char.is_a?(Map_Enemy)\n # if action attribute is not active\n if !ai.actions\n # decide normal action\n char.battler.make_action\n # temporary variable\n act = char.battler.current_action\n # set up the action in Blizz-ABS as normal action\n normal_action(char, in_sight_a, in_sight_e, (act.kind == 0),\n act.basic, rand(31) + 70, 80, act.skill_id)\n else\n # set up advanced action based on Blizz-ABS AI\n advanced_enemy_action(char)\n end\n end\n # if target doesn't exist or forced moving\n if ai.target == nil || !ai.target.valid?\n # reset action\n char.reset_action\n # if not being force moved\n elsif char.is_a?(Map_Enemy) && char.move_type != 3\n # set path request state\n ai.state = Request\n # turn toward the target not to lose it out of sight\n char.turn_toward(ai.target)\n # request a path\n request_path(char, ai.target)\n end\n end", "def initialize(human_player_name)\n\n @human_player = HumanPlayer.new(human_player_name)\n\n\n ennemy_1 = Player.new(\"Josiane\")\n ennemy_2 = Player.new(\"José\")\n ennemy_3 = Player.new(\"Jacky\")\n ennemy_4 = Player.new(\"Janine\")\n\n @ennemies = [ennemy_1, ennemy_2, ennemy_3, ennemy_4]\n end", "def initialize\n \t@grid_w = 50\n \t@grid_h = 40\n \t@grid = []\n\t\n\t\t@player_x = 0\n\t\t@player_y = 0\n\t\t@has_enviroment_rendered=false\n\t\t#setup and fill grid with walls\n \t@grid_w.times.with_index do |x|\n \t\t@grid[x] = []\n\t\t\t@grid_h.times.with_index do |y|\n \t\t\t@grid[x][y]= 1\n \t \tend\n \tend\n\t\tmin_rooms = 2\n\t\tmax_rooms = 10\n\t\t#setup number of rooms that will exist\n\t\t@n_rooms = rand(max_rooms - min_rooms) + min_rooms\n\t\tputs \"n rooms #{@n_rooms}\"\n\t\trooms = []\n\t\t#define the size of each room\n\t\t@n_rooms.times.with_index do |room|\n\t\t\trooms[room] = make_room 8,10\n\t\tend\n\t\n\t\t#clears the walls from where rooms will be \n\t\trooms.each_with_index do |r,i| \n\t\t\t(r[:x]..r[:x] + r[:w]).each do |x|\n\t\t\t\t(r[:y]..r[:y] + r[:h]).each do |y|\n\t\t\t\t\t@grid[x][y]= 0\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t#create pathways towards the next room\n\t\trooms.each_cons(2) do |(cur_room, next_room)|\n\t\t\t#find the center of each room \n\t\t\tcenter_x = cur_room[:x] + cur_room[:w].idiv(2)\n\t\t\tcenter_y = cur_room[:y] + cur_room[:h].idiv(2)\n\n\t\t\tnext_center_x = next_room[:x] + next_room[:w].idiv(2)\n\t\t\tnext_center_y = next_room[:y] + next_room[:h].idiv(2)\n\n\t\t\t#loops between each rooms X and Y positions \n\t\t\t#this can be approached differently\n\t\t\t(min(center_x,next_center_x)..max(center_x,next_center_x)).each do |x|\n\t\t\t\t(min(center_y,next_center_y)..max(center_y,next_center_y)).each do |y|\n\t\t\t\t\t#checking if this position is in-line with either rooms x or y centres\n\t\t\t\t\t@grid[x][y] = 0 if y == center_y || y == next_center_y || x == center_x || x == next_center_x\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@new_grid = []\n\t\t#set new grid to prune unneeded walls to improve performance\n\t\t@grid_w.times.with_index do |x|\n\t \t@new_grid[x] = []\n\t \t@grid_h.times.with_index do |y|\n \t\t\t@new_grid[x][y]= @grid[x][y]\n\t\t\tend\n\t end\n\t\t#set up values\n\t\t@grid_w.times.with_index do |x|\n \t\t@grid_h.times.with_index do |y|\n\t\t\t\t#if surrounded it should not be filled in\n\t\t\t\tif check_surrounding_tiles x,y\n\t\t\t\t\t@grid[x][y] = 0\n\t\t\t\tend\n \t\tend\n \tend\n\t\t#this will set the players starting position to a known safe area\n\t\t@player_x = rooms[0][:x] + rooms[0][:w].idiv(2)\n\t\t@player_y = rooms[0][:y] + rooms[0][:h].idiv(2)\n\t\t@grid[@player_x][@player_y] = 2\n\tend", "def initialize(world=World.new, seeds=[])\n @world = world\n @seeds = seeds\n\n seeds.each do |seed|\n world.cell_grid[seed[0]][seed[1]].alive = true\n end\n end", "def check_enemies\n colliding_enemies = @game_state.enemies.select { |enemy| enemy.alive? && enemy.collides?(self) }\n self.hit!(colliding_enemies[0]) if colliding_enemies.any?\n end", "def initialize\n puts \" -----------------------------------------------\"\n puts \"| |\"\n puts \"| Bienvenue sur 'ILS VEULENT TOUS MA POO' ! |\"\n puts \"| |\"\n puts \"|-----------------------------------------------|\"\n puts \"| |\"\n puts \"|Le but du jeu est d'être le dernier survivant !|\"\n puts \"| |\"\n puts \" -----------------------------------------------\"\n puts \"Nom du joueur?\"\n player1_input=gets.chomp\n puts \"\\n\"\n @player1=HumanPlayer.new(player1_input)\n @players_left=10\n @enemies_in_sight=[]\n\n \n \n end", "def initialize(world=World.new, seeds=[])\n @world = world\n seeds.each do |seed|\n world.cell_board[seed[0]][seed[1]].alive = true\n end\n end", "def brute(level)\n @enemy_type = \"Brute\"\n @enemy_health_points = rand(200..300)*level\n @enemy_max_health = @enemy_health_points\n @enemy_attack = 60*level\n @enemy_armor_score = 13\n end", "def any_enemy_alive?\n i = 0\n while i < $Enemies.length \n if $Enemies[i].alive\n return true\n break\n end\n i += 1\n end\n ### if no enemy is alive, return false\n return false\n end", "def initialize\n # Random number between 0 and 12\n @x = rand(12) + 1\n \n # We want vials and herbs to have higher chance to show up in rooms. \n if @x >= 8 and @x < 10\n @objX = $objs[4]\n @x = 4\n elsif @x >= 10\n @objX = $objs[7]\n @x = 7\n else\n @objX = $objs[@x]\n end\n end", "def initialize(seed = nil)\n srand(seed) if seed\n @players = %w[Alice Bob Cecil]\n @purses = @players.map { rand(2..4) }\n @in_penalty_box = @players.map { rand(2).zero? }\n @current_player = rand(@players.count)\n @is_getting_out_of_penalty_box = @in_penalty_box[@current_player] && rand(2).zero?\n end", "def enemy?(pos)\n if @board[pos] && @board[pos].color != color\n return true\n end\n false\n end", "def add_new_enemies_if_needed args\n return if args.state.enemies.length >= 10 # if 10 or more enemies, enemies are not added\n return unless args.state.bullets.length == 0 # if user has not yet shot bullet, no enemies are added\n\n args.state.enemies += (10 - args.state.enemies.length).map do # adds enemies so there are 10 total\n args.state.new_entity(:enemy) do |e| # each enemy is declared as a new entity\n e.x = 640 + 500 * rand # each enemy is given random position on screen\n e.y = 600 * rand + 50\n e.rect = [e.x, e.y, 130, 30] # sets definition for enemy's rect\n end\n end\nend", "def create_random_Ant\n\n myAnt = Ant.new\n\n myAnt.x = @x\n myAnt.y = @y\n myAnt.anthill = self\n rand_number = rand(3)\n if rand_number == 0\n myAnt = create_Forager(myAnt)\n elsif rand_number == 1\n myAnt = create_Builder(myAnt)\n else\n myAnt = create_Warrior(myAnt)\n \n end\n\n Meadow.instance.add_AntToCell(myAnt, @x, @y)\n @food -= 1 \n end", "def initialize(name)\n @human_player = HumanPlayer.new(name)\n @enemies = []\n \n for i in 0..4\n @enemies << Player.new('ENEMY ' + i.to_s)\n end\n end", "def randomize_entities\n valid_entities = @@data[:entities][:types].select { |e| e.random_spawn_chance > 0 }\n (0...@width).each do |x|\n (0...@height).each do |y|\n \n # Roll to see if any entities are created here\n chosen_entity = nil\n valid_entities.each do |e|\n roll = rand(100) / 100.0\n if roll < e.random_spawn_chance\n chosen_entity = e\n break\n end\n end\n\n # If an entity would be created here, add it to the world\n if chosen_entity\n @living_entities << chosen_entity.new(x, y)\n end\n\n end\n end\n end", "def enemy_any_valid_target(enemy)\n return true if !SceneManager.scene.is_a?(Scene_Battle)\n target = enemy.friends_unit \n target = enemy.opponents_unit if for_opponent?\n val_target = valid_target(target,enemy)\n return true if val_target.size > 0\n return false\n end", "def enemy?(pos)\n return false unless board.on_board?(pos)\n board[pos].color != color\n end", "def enemies_ahead?(warrior, direction = @@direction)\n not nearest_enemy(warrior, direction).nil?\n end", "def make_room max_w,max_h\n\t{\n\t\tx: rand(@grid_w - max_w - 1) + 1,\n\t\ty: rand(@grid_h - max_h - 1) + 1,\n\t\tw: rand(max_w) + 1,\n\t\th: rand(max_h) + 1,\n\t}\n\tend", "def initialize (humanplayer)\n @humanplayer = HumanPlayer.new(\"#{humanplayer}\",100,1)\n @player_1 = Player.new(\"Melee creep\", 10)\n @player_2 = Player.new(\"Ranged creep\", 10)\n @player_3 = Player.new(\"Siege creep\", 10)\n @player_4 = Player.new(\"Mega creep\", 10)\n @ennemies = [@player_1, @player_2, @player_3, @player_4]\n end", "def create_Ant_Room\n @rooms.each do |room|\n if food > 0\n myAnt = Ant.new\n myAnt.x = room.x\n myAnt.y = room.y\n myAnt.anthill = self\n\n if room.type == \"foreger\"\n myAnt = create_Forager(myAnt)\n elsif room.type == \"builder\"\n myAnt = create_Builder(myAnt)\n else\n myAnt = create_Warrior(myAnt)\n end\n\n Meadow.instance.add_AntToCell(myAnt, @x, @y)\n @food -= 1 \n else\n break\n end\n\n end\n\n end", "def create_random_world\n randomize_terrain\n randomize_entities\n end", "def can_attack?(enemy)\n !enemy.dead? && !dead?\n end", "def sorrounded?\n enemies_around > 2\n end", "def set_dead_enemies_self_switches\n for i in 0...$game_temp.enemy_troop.size\n event_id = $game_temp.event_troop[i]\n delete = $game_temp.event_delete[i]\n enemy = $game_troop.enemies[i]\n if enemy != nil and enemy.dead? and delete\n key = [$game_map.map_id, event_id, 'D']\n $game_self_switches[key] = true\n elsif enemy != nil and enemy.dead? and not delete\n $game_map.events[event_id].erase\n end\n end\n end", "def get_enemies_info\n @enemies = 0\n warrior.listen.each do |unit|\n if Enemies.include? unit.to_s.to_sym\n @enemies += 1\n end \n end\n return false\n end", "def random_encounter\n narrate(\"an enemy appears!\")\n a = Fight.new(@player, @enemy_list.sample)\n if a.now\n here\n else\n\n #here is where u die\n STDIN.getch\n puts\n puts \"There is only one god and his name is Death. And there is only one thing we say to Death: Not today.\"\n \n STDIN.getch\n puts\n\n\n start = Startup.new()\n start.start\n end\n end", "def setup_castle\r\n randomnums = Random.new\r\n zero_out\r\n treasures_allot\r\n terrors_allot\r\n set_at_room(4,6, 100 + randomnums.rand(1...100))\r\n set_at_room(16,6, 100 + randomnums.rand(1...100))\r\nend", "def initialize(index, enemy_id)\n bosses_initialize(index, enemy_id)\n enemy = $data_enemies[@enemy_id]\n @boss = enemy.boss\n @boss_bars = enemy.boss_bars\n end", "def count_enemies()\r\n _enemy_nb = 0\r\n for i in 0..3\r\n if @warrior.feel(DIRECTIONS[i]).enemy?\r\n _enemy_nb += 1\r\n end\r\n end\r\n return _enemy_nb\r\n end", "def place_room(w,h,room_id)\n \n max_tries = Dungeon::MAX_PLACEMENT_ITERATION\n c_try = 0\n while c_try < max_tries\n\n # Get the top left corner, must be even \n tli = (rand*@width).floor\n tli += 1 if tli.odd?\n tlj = (rand*@height).floor\n tlj += 1 if tlj.odd?\n\n # Check all the cells from this point are unallocated, \n # and an extra 1 width around for perimeter\n failed = false\n (tli..tli+w+1).each do |i|\n (tlj..tlj+h+1).each do |j|\n if !failed\n failed = true if @cells[i][j].type != Cell::UNALLOCATED\n end\n end\n end\n\n \n # if checks ok, build the room and the perimeter\n if !failed\n\t\t\t\t# Probability falls so there are an average of 2 doors per room\n\t\t\t\tper = 2*(w+h)\n\t\t\t\tdoor_chance = Dungeon::ROOM_DOORS/per\n\n\t\t\t\t# Prep for building a logical object ready for dead end removal\n\t\t\t\troom_cells = []\n\n (tli..tli+w+1).each do |i|\n (tlj..tlj+h+1).each do |j|\n @cells[i][j].type = Cell::ROOM\n @cells[i][j].room_id = room_id\n\t\t\t\t\t\t\t# If perimeter wall, assign door if random number is under the threshold\n \t\t\t\t\t\tif i == tli || i == tli+w+1 || j == tlj || j == tlj+h+1 \n @cells[i][j].type = Cell::PERIMETER \n\t\t\t\t\t\t\t\tif i.odd? || j.odd?\n\t\t @cells[i][j].type = Cell::ENTRANCE if rand < door_chance\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t# Store the room cells read for assignment to logical structure\n\t\t\t\t\t\t\troom_cells << @cells[i][j];\n end\n end\n # Meet loop criterea\n c_try = Dungeon::MAX_PLACEMENT_ITERATION\n\n\t\t\t\t# Build logical object and map entrance cells to the room\n\t\t\t\troom_obj = RoomBranch.new(room_cells)\n\t\t\t\troom_cells.each { |c| room_map[c] = room_obj if c.type == Cell::ENTRANCE }\n\n end\n \n c_try += 1\n end\n \n end", "def add_bestiary_enemy(enemy, defeated = false)\n @bestiary_known_data[:ene][enemy] ||= 0\n @bestiary_known_data[:ene][enemy] += 1 if defeated\n end", "def enemy_check?\n spaces_array = @warrior.look(@movement_direction)\n spaces_array.each do |space|\n if space.enemy?\n return true\n elsif space.captive?\n return false\n end\n end\n return false\n end", "def defeated_enemy_ids\n @defeated_enemies_count ||= {}\n @defeated_enemies_count.keys.sort\n #@defeated_enemies ||= BestiaryConfig.get_enemy_array\n end", "def initialize(troop_id, member_index, enemy_id = nil)\n super()\n @troop_id = troop_id\n @member_index = member_index\n troop = $data_troops[@troop_id]\n @enemy_id = enemy_id.nil? ? troop.members[@member_index].enemy_id : enemy_id\n enemy = $data_enemies[@enemy_id]\n @battler_name = enemy.battler_name\n @battler_hue = enemy.battler_hue\n @maxhp = maxhp\n @maxsp = maxsp\n @hp = @maxhp\n @sp = @maxsp\n @str = base_str\n @dex = base_dex\n @agi = base_agi\n @int = base_int\n @gold = gold\n @exp = exp\n @hidden = enemy_id.nil? ? troop.members[@member_index].hidden : false\n @immortal = enemy_id.nil? ? troop.members[@member_index].immortal : false\n @steal_items = Enemy_Steal[@enemy_id].to_a\n @steal_attempt = 0\n @moving = @sp_damage = false\n battler_position_setup\n end", "def initialize \n\t\t@alive #checking they're alive\n\t\t\tputs \"I am alive\"\n\t\t@health=150 #initialize that all mammals start at 150\n\t\tself\n\tend", "def initialize_position\n done = false\n pos = {:facing => Game::FACINGS[rand(4)]}\n while not done do\n start_at = rand(board_size * board_size)\n start_at = [start_at / board_size, start_at % board_size]\n done = players(:x_pos => start_at[0], :y_pos => start_at[1]).empty?\n end\n pos[:x] = start_at[0]\n pos[:y] = start_at[1]\n pos\n end", "def initialize level\n\t\t@tile_size = 32\n\t\t@level = level + 1\n\t\t@num_enemies = 0\n\t\tloadlevel\n\t\tloadgraphics\n\t\tinterpret\n\t\tcreate_tiles\n\t\tfind_player_index\n\t\t@travel = 0\n\tend", "def setup(troop_id)\n # Set array of enemies who are set as troops\n @enemies = []\n troop = $data_troops[troop_id]\n for i in 0...troop.members.size\n enemy = $data_enemies[troop.members[i].enemy_id]\n if enemy != nil\n @enemies.push(Game_Enemy.new(troop_id, i))\n end\n end\n end", "def enemy_shoot args\n # generate a random number from 0 to 99\n r = rand(100)\n # is the random number 0? that give a a 1 in 100 chance of shooting\n # is the enemy shooting? Only shoot if not already shooting.\n if r == 1 && args.state.enemy_bullet_shooting == false\n # set the enemy bullet position to the enemy position\n args.state.enemy_bullet_x = args.state.enemy_x + args.state.enemy_w / 2\n args.state.enemy_bullet_y = args.state.enemy_y\n # track state of enemy bullet\n args.state.enemy_bullet_shooting = true\n end\nend", "def outrun_zombie?\n random = rand(1..@@max_spd)\n if random > @spd\n return true\n else\n @@horde << self.class.new(@@max_spd, @@max_str)\n return false\n end\n end", "def set_item(enemy)\n enemy = nil unless $game_party.known_enemy?(enemy.id)\n super(enemy)\n end", "def map_change\n i = 0\n while i < $Enemies.length \n $Enemies[i] = Enemy.new\n $Enemies[i].set_index(i)\n i += 1\n end\n end", "def is_enemy?(id)\n # get enemies\n enemies = get_enemies(id)\n # return result\n return (enemies.size > 0 && enemies[0].is_a?(Map_Battler))\n end", "def place_room(w, h, room_id)\n\n max_tries = Dungeon::MAX_PLACEMENT_ITERATION\n c_try = 0\n while c_try < max_tries\n\n # Get the top left corner, must be even \n tli = (rand*@width).floor\n tli += 1 if tli.odd?\n tlj = (rand*@height).floor\n tlj += 1 if tlj.odd?\n\n # Check all the cells from this point are unallocated, \n # and an extra 1 width around for perimeter\n failed = false\n (tli..tli+w+1).each do |i|\n (tlj..tlj+h+1).each do |j|\n if !failed\n failed = true if @cells[i][j].type != Cell::UNALLOCATED\n end\n end\n end\n\n\n # if checks ok, build the room and the perimeter\n if !failed\n # Probability falls so there are an average of 2 doors per room\n per = 2*(w+h)\n door_chance = Dungeon::ROOM_DOORS/per\n\n # Prep for building a logical object ready for dead end removal\n room_cells = []\n\n (tli..tli+w+1).each do |i|\n (tlj..tlj+h+1).each do |j|\n @cells[i][j].type = Cell::ROOM\n @cells[i][j].room_id = room_id\n # If perimeter wall, assign door if random number is under the threshold\n if i == tli || i == tli+w+1 || j == tlj || j == tlj+h+1\n @cells[i][j].type = Cell::PERIMETER\n if i.odd? || j.odd?\n @cells[i][j].type = Cell::ENTRANCE if rand < door_chance\n end\n end\n\n # Store the room cells read for assignment to logical structure\n room_cells << @cells[i][j];\n end\n end\n # Meet loop criterea\n c_try = Dungeon::MAX_PLACEMENT_ITERATION\n\n # Build logical object and map entrance cells to the room\n room_obj = RoomBranch.new(room_cells)\n room_cells.each { |c| room_map[c] = room_obj if c.type == Cell::ENTRANCE }\n\n end\n\n c_try += 1\n end\n\n end", "def count_enemies\n @close_enemies = 0\n Directions.each do |dir|\n @close_enemies += 1 if Enemies.include? warrior.look(dir)[0].to_s.to_sym\n end\n end", "def pick_enemy_size\n\tenemy_sizes = ['small', 'med', 'big']\n\tenemy_size_number = rand(0...3)\n\tenemy_size = enemy_sizes[enemy_size_number]\n\tcase enemy_size\n\t\twhen \"small\"\n\t\t\tfight_small\n\t\twhen \"med\"\n\t\t\tfight_med\n\t\twhen \"big\"\n\t\t\tfight_big\n\tend\nend", "def initialize\r\n @player_number = 1\r\n @turn = 0\r\n @draw = false # set the game to a draw\r\n @finished = false # bool value to end the game\r\n $arr =[false,false,false,false,false,false,false,false,false] # array to hold which value is occupied in the grid\r\n $letter_grid =[['','',''],['','',''],['','','']] # grid so that letters can be placed inside by the user\r\n end", "def bind\n if @close_enemies > 2 and @enemies_binded < 3\n Directions.each do |dir|\n if warrior.feel(dir).enemy?\n puts \"Binding enemy #{warrior.look(dir)[0].to_s.to_sym} to the #{dir}\"\n @enemies_binded += 1 \n return warrior.bind! dir\n end \n end \n end\n return false\n end", "def set_enemy_battler(id)\n for enemy in $game_troop.enemies\n return enemy if enemy.id == id\n end\n return nil\n end", "def enemies_in_range(range)\n return case attacking_direction\n when :right\n @game_state.enemies.select do |e| \n (e.x > @x && e.x < (self.right + range)) && (e.bottom > @y || e.y < self.bottom)\n end\n when :left\n @game_state.enemies.select do |e| \n (e.right < @x && e.right > (@x - range)) && (e.bottom > @y || e.y < self.bottom)\n end\n when :up\n @game_state.enemies.select do |e| \n (e.bottom < @y && e.bottom > (@y - range)) && (e.right > @x && e.x < self.right)\n end\n when :down\n @game_state.enemies.select do |e| \n (e.y > self.bottom && e.y < (self.bottom + range)) && (e.right > @x && e.x < self.right)\n end\n end\n end", "def new_rooms\n min_rooms = MIN_NEXT_ROOMS\n max_rooms = MAX_NEXT_ROOMS\n rand(min_rooms..max_rooms).times do\n @next_rooms << Zarta::Room.new(@dungeon)\n end\n end", "def my_initialize\n\t\t@classes = 1\n\t\t@toys = 0\n\t\t@books = 0\t\t\n\t\tsrand seed.to_i\n\t\t@location = nil\n\t\tnext_spot()\n\t\t@random_number = 0\n\t\ttrue\n\tend", "def Inrange?\n ## check if enemy is in meele range (ahead of player or ahead and one step left or right)\n ## d : Direction (2,4,6,8) up left right buttom\n xmax = $game_player.real_x * 32 + 16\n xmin = $game_player.real_x * 32 - 16\n ymax = $game_player.real_y * 32 + 16\n ymin = $game_player.real_y * 32 - 16\n\n ## set hit range in relation to player facing direction\n if $game_player.direction == 8 then ## facing up\n xmin -= 32\n xmax += 32\n ymin -= 32\n ymax -= 32\n end\n \n if $game_player.direction == 2 then ## facing bottom\n xmin -= 32\n xmax += 32\n ymin += 32\n ymax += 32\n end\n \n if $game_player.direction == 4 then ## facing left\n xmin -= 32\n xmax -= 32\n ymin -= 32\n ymax += 32\n end \n \n if $game_player.direction == 6 then ## facing right\n xmin += 32\n xmax += 32\n ymin -= 32\n ymax += 32\n end\n \n ## check if enemy is in hit range\n if self.mapx < xmax && self.mapx > xmin && \\\n self.mapy < ymax && self.mapy > ymin then\n return true\n else\n return false \n end\n end", "def enemy_between?(destination)\n\t\tmiddle_row = (destination.first + position.first) / 2\n\t\tmiddle_col = (destination.last + position.last) / 2\n\t\thas_enemy?([middle_row, middle_col])\n\tend", "def is_above_ground_foundation_wall?()\n #p \"randomize is_above_ground_foundation_wall?\"\n srand();rand(2)\n end", "def decide_target(char, dmg, heal, neutral, attack, defend, escape)\n # temporary variables\n x, y, ai = char.x, char.y, char.ai\n # get alignment setup\n negative, positive = ai.negative, ai.positive\n # invert setup if confused\n negative, positive = positive, negative if char.restriction == 3\n # initialize arrays\n allies, enemies = [char], []\n # if enemy\n if char.is_a?(Map_Enemy)\n # find all allies and all enemies in memory\n ai.memory.each_key {|b|\n allies.push(b) if positive.include?(b.ai.group)\n enemies.push(b) if negative.include?(b.ai.group)}\n # if actor\n elsif char.is_a?(Map_Actor)\n # find all allies and all enemies in sight\n ai.sight.each {|b|\n allies.push(b) if positive.include?(b.ai.group)\n enemies.push(b) if negative.include?(b.ai.group)}\n end\n # find all allies who need healing\n to_heal = allies.find_all {|b| b.valid? && b.battler.hp < b.battler.maxhp}\n # if decided to heal\n if (heal.size > 0 && to_heal.size > 0 && (ai.healer || rand(3) == 0) &&\n rand(5) == 0)\n # find all skills that heal all allies\n allheal = heal.find_all {|id|\n $data_skills[id].scope == 2 || $data_skills[id].scope == 4 ||\n $data_skills[id].scope == 6}\n # test again flag\n test_again = true\n # if more than 1 ally who needs healing exists and allheal skills exist\n if to_heal.size > 1 && allheal.size > 0\n # initialize data\n decided, now, new = nil, [], []\n # iterate through all all-healing skills\n allheal.each {|id|\n # fake Blizz-ABS action setup\n ai.act.set(Skills.range(id), ACTSkill, id, Skills.type(id)[0],\n ai.delay_time)\n # all allies who can be targeted by this skill\n new = to_heal.find_all {|b| $BlizzABS.can_execute?(char, b, ai.act)}\n # if not decided yet\n if decided == nil\n # decide this skill and those allies\n decided, now = id, new\n # 50% chance\n elsif rand(2) == 0\n # intialize damage counters\n dmg1 = dmg2 = 0\n # sum up all damage for last decided targets\n now.each {|b| dmg1 += b.battler.maxhp - b.battler.hp}\n # sum up all damage for new targets\n new.each {|b| dmg2 += b.battler.maxhp - b.battler.hp}\n # decide this skill if it contains battlers with more damaged HP\n decided, now = id, new if dmg2 > dmg1\n # if more battlers would be affected by this skill\n elsif new.size > now.size\n # decide this skill and those allies\n decided, now = id, new\n end}\n # if more than one battler can be healed\n if now.size > 1\n # setup Blizz-ABS action\n ai.act.set(Skills.range(decided), ACTSkill, decided,\n Skills.type(decided)[0], ai.delay_time / 2)\n # don't test for one battler\n test_again = false\n end\n end\n # if should test for one battler\n if test_again\n # find all skills that heal one ally\n oneheal = heal.find_all {|id|\n $data_skills[id].scope == 1 || $data_skills[id].scope == 3 ||\n $data_skills[id].scope == 5}\n # if any skill exists\n if oneheal.size > 0\n # decided action\n decided = oneheal[rand(oneheal.size)]\n # decided target\n ai.target = to_heal[rand(to_heal.size)]\n else\n # decided action\n decided = heal[rand(heal.size)]\n end\n # stop execution if no skill decided\n return false if decided == nil\n # setup Blizz-ABS action\n ai.act.set(Skills.range(decided), ACTSkill, decided,\n Skills.type(decided)[0], ai.delay_time / 2)\n end\n # confirm execution\n return true\n end\n # not decided to escape yet\n escaping = false\n # if able to run away\n if escape && rand(5) == 0\n # if observation attribute is active\n if ai.observe && char.restriction != 3\n # iterate through all enemies\n enemies.each {|b|\n # if actor\n if b.is_a?(Map_Actor) && ai.observation[b.battler] != nil\n # get damage per second rate\n dps = get_observation(b.battler, ai.observation[b.battler].clone)\n # 20% chance or damage per second-distance rate high enough\n if rand(5) == 0 || dps * 128 / Math.hypot(b.real_x-\n char.real_x, b.real_y-char.real_y) > char.battler.hp / 2\n # set this battler as escape reference\n ai.target = b\n # running away\n escaping = true\n # abort iteration\n break\n end\n end}\n # 20% chance\n elsif rand(5) == 0\n # initialize minimum range\n min = nil\n # iterate through all enemies\n enemies.each {|b|\n # if closer than anybody else\n if (b.is_a?(Map_Actor) && (min == nil ||\n Math.hypot(b.real_x-char.real_x, b.real_y-char.real_y) < min))\n # set this battler as escape reference\n ai.target = b\n # set new minimum range\n min = Math.hypot(b.real_x-char.real_x, b.real_y-char.real_y)\n # running away\n escaping = true\n # abort iteration\n break\n end}\n end\n end\n # if decided to escape\n if escaping\n # set AI state\n ai.state = Escape\n # set action data\n ai.act.set(ai.view_range - 1, ACTEscape, 0, 0, 80)\n # confirm execution\n return true\n end\n # not decided to defend yet\n defending = false\n # if able to defend\n if defend && rand(5) == 0\n # probability factor if higher if defensive and reset defend flag\n factor = rand(ai.defensive ? 10 : 30)\n # if decided to defend\n if char.battler.hp * 100 / char.battler.maxhp < factor\n # if observation attribute is active\n if ai.observe && char.restriction != 3\n # iterate through all enemies\n enemies.each {|b|\n # if actor\n if b.is_a?(Map_Actor) && ai.observation[b.battler] != nil\n # get damage per second rate\n dps = get_observation(b.battler,\n ai.observation[b.battler].clone)\n # 20% chance or damage per second-distance rate high enough\n if rand(5) == 0 || dps * 128 / Math.hypot(b.real_x-\n char.real_x, b.real_y-char.real_y) > char.battler.hp / 3\n # defending\n defending = true\n # abort iteration\n break\n end\n end}\n # 33% chance\n elsif enemies.size > 0 && rand(5) == 0\n # decided to defend\n defending = true\n end\n end\n end\n # if decided to defend\n if defending\n # set AI state\n ai.state = Defend\n # target the closest enemy\n ai.target = enemies.min {|a, b|\n Math.hypot(x-b.x, y-b.y) <=> Math.hypot(x-a.x, y-a.y)}\n # turn toward the target if target exists and not being force moved\n char.turn_toward(ai.target) if ai.target != nil && char.move_type != 3\n # use defend action\n char.use_defend\n # set action data\n ai.act.set(3, ACTDefend, 0, 0, rand(31) + 70)\n # confirm execution\n return true\n end\n # number of skills\n skill_number = dmg.size + heal.size + neutral.size\n # if able to attack and chosen to attack\n if attack && (skill_number == 0 || rand(skill_number) == 0)\n # if enemy\n if char.is_a?(Map_Enemy)\n # set AI state\n ai.state = Ready\n # setup Blizz-ABS action\n ai.act.set(Enemies.range(char.battler_id), ACTAttack, 0,\n Enemies.type(char.battler_id), ai.delay_time)\n # if observing attribute and not confused\n if ai.observe && char.restriction != 3\n # decide a target based upon observation experience\n observation_target(char, ai, enemies)\n end\n # if actor\n elsif char.is_a?(Map_Actor)\n # set AI state\n ai.state = Ready\n # setup Blizz-ABS action\n ai.act.set(Weapons.range(char.battler.weapon_id), ACTAttack, 0,\n Weapons.type(char.battler.weapon_id), ai.delay_time)\n end\n # if no target exists\n if ai.target == nil || !ai.target.valid?\n # get any enemy\n ai.target = enemies[rand(enemies.size)]\n end\n # confirm execution\n return true\n end\n # decide a random skill action\n decided = (dmg + neutral)[rand(dmg.size + neutral.size)]\n # if action exists\n if decided != nil\n # if observing\n if ai.observe && char.restriction != 3\n # decide a target based upon observation experience\n observation_target(char, ai, enemies)\n end\n # if no target was decided\n if ai.target == nil || !ai.target.valid?\n # if targeting enemies\n if $data_skills[decided].scope == 0 ||\n $data_skills[decided].scope == 1 ||\n $data_skills[decided].scope == 2\n # select a random enemy target\n ai.target = enemies[rand(enemies.size)]\n else\n # select a random ally target\n ai.target = allies[rand(allies.size)]\n end\n end\n end\n # stop execution if no target selected\n return false if ai.target == nil || !ai.target.valid?\n # setup Blizz-ABS action\n ai.act.set(Skills.range(decided), ACTSkill, decided,\n Skills.type(decided)[0], ai.delay_time)\n # confirm execution\n return true\n end", "def attack(enemy)\n if enemy.dead\n puts \"#{enemy.name} is already dead\"\n return false\n end\n damage = (rand * 10 + 10).round(0) #=> random number\n enemy.take_damage(damage) #=> eneny takes damage using random damge\n end", "def enemies_close\n Directions.each do |dir|\n return true if Enemies.include? warrior.look(dir)[0].to_s.to_sym\n end\n return false\n end" ]
[ "0.69565105", "0.6906241", "0.6625656", "0.63867354", "0.63012457", "0.6231034", "0.6211345", "0.6169772", "0.6159238", "0.61444336", "0.60514855", "0.6046907", "0.6016638", "0.60012096", "0.59872174", "0.5908169", "0.58994263", "0.5892252", "0.5884431", "0.5868357", "0.5817112", "0.5817112", "0.5817112", "0.5817112", "0.58142453", "0.5799733", "0.57780534", "0.577026", "0.5747011", "0.5734656", "0.5728144", "0.5714197", "0.57099223", "0.57015544", "0.570153", "0.56976086", "0.56963885", "0.5670458", "0.5669769", "0.56688195", "0.56611025", "0.56460613", "0.56451404", "0.56417483", "0.5636612", "0.56219256", "0.5618286", "0.5609284", "0.55973834", "0.5572469", "0.5570415", "0.5537108", "0.55327946", "0.5531965", "0.5516594", "0.55132127", "0.55127037", "0.5483451", "0.54802936", "0.5463764", "0.54554147", "0.54466486", "0.54449767", "0.54442555", "0.54303277", "0.54038626", "0.54030114", "0.53986585", "0.5395792", "0.5383116", "0.5379962", "0.53756714", "0.5373405", "0.5369927", "0.536548", "0.5359312", "0.5342101", "0.53378564", "0.5336381", "0.5333886", "0.5332405", "0.53306884", "0.5321067", "0.53166646", "0.53154194", "0.53131473", "0.5310312", "0.5299655", "0.5287145", "0.5284048", "0.5282284", "0.5274491", "0.52701175", "0.5267818", "0.52637124", "0.52614063", "0.5261299", "0.52517843", "0.5247282", "0.5246129" ]
0.8208505
0
rubocop:enable Metrics/LineLength Creates the URL used for the request.
def url query_url = "#{@url}?q=#{@query}&locale=#{@locale}" query_url << @topics.map { |t| "&topic=#{t}" }.join unless @css_classnames.nil? query_url << "&css_classnames=#{@css_classnames}" end unless @html_attributes.nil? query_url << "&html_attributes=#{@html_attributes}" end query_url << "&highlight=#{@highlight}" unless @highlight.nil? query_url end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url\n connection.build_url(url_chunk, params).to_s\n end", "def url\n @url = \"#{@http_mode}://#{self.config.servers[0]}\"\n @url << \"/#{self.config.context}\" if(!self.config.context.empty?)\n #self.config.log.debug_msg(\"Request base URL: #{@url}\")\n @url\n end", "def build_request_url\n \"http://snipr.com/site/snip?r=simple&link=#{ensure_http}\"\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def formatted_url\n if @request.scheme == \"https\"\n @request.url.gsub(/:#{@request.port}/, '')\n else\n @request.url\n end\n end", "def url\n URI.parse(endpoint).join(path.to_s).to_s\n end", "def _http_url\n HTTPURI + _uri_path\n end", "def get_url\n \"http://#{self.domain}/#{self.path}#{self.params.it_keys_to_get_param}\"\n end", "def request_url\n query_builder.request_string\n end", "def build_url(action)\n \"#{@base_url}#{action}\"\n end", "def create_url\n uri = Addressable::URI.new\n uri.query_values = properties\n \"#{ BASE_URI }#{ Hubspotter.configuration.portal_id }#{ create_endpoint }#{ uri.query }\"\n end", "def build_url(path, params={})\n full_path = @uri.path + path\n full_url = \"#{@uri.scheme}://#{@uri.host}\"\n full_url += \":#{@uri.port}\" if @uri.port\n full_url += super(full_path, params, @uri.query)\n end", "def build_urlpath\n render_endpoint_request do\n erb = EndpointRequestBuilder.new(@endpoint)\n extra_params = erb.formatted_url_path(@arguments)\n render json: { success: extra_params }, status: 200\n end\n end", "def build_uri(resource)\n URI(\"#{API_URL}/#{resource}\")\n end", "def url\n @url ||= URL.new(\n template: template,\n placeholders: url_placeholders,\n permalink: permalink\n ).to_s\n end", "def url\n @url ||= URL.new(\n :template => url_template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end", "def request_uri\n calculate_uri(@http_request.url)\n end", "def url\n @parser.request_url\n end", "def url\n URI.escape(\"#{protocol}#{host}/#{path_prefix}#{key}\")\n end", "def url\n url = \"#{config.url[config.env]}/#{@path}\"\n url = \"#{url}?#{@params.to_param}\" unless @params.empty?\n url\n end", "def build_url(params)\n \"#{@base_url}?#{params.to_query}\"\n end", "def build_url(host)\n host.protocol + host.url\n end", "def build_url(base_url, queue_name)\n return \"#{base_url}/#{queue_name}\"\n end", "def full_url(req)\n \"#{url_base}#{case req; when String: req; else req.path; end}\"\n end", "def url\n uri.to_s\n end", "def url(params)\n \"%s%s\" % [config['endpoint'], query_string(params)]\n end", "def url\n @url ||= URL.new(\n :template => template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end", "def create url\n function = ''\n \n post_data = {}\n post_data[:url] = url\n\n request(@resource, function, nil, 'post', post_data)\n end", "def build_url(query_params: nil)\n url = [add_version(''), *@url_path].join('/')\n url = build_query_params(url, query_params) if query_params\n URI.parse(\"#{@host}#{url}\")\n end", "def format_url(request)\n \"#{@api_prefix}#{request}\"\n end", "def generate_url\n\t\tself.url ||= name.parameterize\n\tend", "def build_as_url\n URI(build_as_string)\n rescue Urb::InvalidUrl => e\n URI('/')\n end", "def url\n uri.to_s\n end", "def url\n '%s://%s%s' % [\n self.scheme,\n self.host,\n self.port_default? ? '' : (':%d' % self.port)\n ]\n end", "def create_url\n\t\tif self.url.blank?\n\t\t\tself.dev_stage.blank? ? dev_stage_string = \"\" : dev_stage_string = \"-\" + self.dev_stage + \"-\"\n\t\t\tcomponent_string = self.component.downcase.gsub(/[^a-zA-Z0-9]+/, \"-\").chomp(\"-\")\n\t\t\tversion_string = self.maj_version.to_s + \"-\" + self.min_version.to_s\n\t\t\tself.url = component_string + dev_stage_string + version_string\n\t\tend\n\tend", "def url\n \"http://#{self.domain}/#{self.path}\"\n end", "def _url path = request.path, options = {}\n\t\tstr = path\n\t\tunless options.empty?\n\t\t\tstr += '?'\n\t\t\toptions.each do | k, v |\n\t\t\t\tstr = str + k.to_s + '=' + v.to_s + '&'\n\t\t\tend\n\t\tend\n\t\tstr\n\tend", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def base_url\n 'http://ow.ly/api/1.1/url/shorten'\n end", "def onliner_url\n @url ||= (CONSTANT_URL + @options.to_query)\n end", "def build_url(product, options = nil)\n \"#{BASE_URL}#{product}#{build_query_string(options)}\"\n end", "def url\n ::URI.join(\"#{service.service_url}/\", ::URI.escape(url_chunk)).to_s\n end", "def build_url(url_suffix)\n return @base_url+url_suffix\nend", "def endpoint_url\n # @@api_base + @request.endpoint\n ApiBase + @endpoint\n end", "def final_url\n call_once\n last_request = context.get_attribute ExecutionContext::HTTP_REQUEST\n last_host = context.get_attribute ExecutionContext::HTTP_TARGET_HOST\n host = last_host.to_uri\n url = last_request.get_uri\n URI.join(host, url.to_s)\n end", "def request_url\n base_url = \"http://#{api_host}#{PATH}?\"\n base_url << \"appid=#{app_id}\"\n base_url << \"&callname=#{call_name}\"\n base_url << \"&siteid=#{site_id}\"\n base_url << \"&version=#{API_VERSION}\"\n base_url\n end", "def generate_url(url, params = {})\n uri = URI(url)\n\n res = \"#{uri.scheme}://#{uri.host}\"\n res += \":#{uri.port}\" if (uri.port and uri.port != 80 and uri.port != 443)\n res += \"#{uri.path}#\" if uri.path\n res += \"#{uri.fragment}\" if uri.fragment\n res += \"?#{params.to_query}\"\n\n return res\n end", "def url\n [ Configuration.url, @path ].join\n end", "def url\n @url.to_s\n end", "def build_request_url(path, params)\n\t\t\t\t\tURI::HTTP.build :host => API_SERVER,\n\t\t\t\t\t\t\t\t\t\t\t\t\t:path => \"#{API_BASE}/#{path}\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t:query => params.map {|k,v| \"#{k}=#{v}\"}.join('&')\n\t\t\t\tend", "def makeURL(path)\n \"#{self.api_endpt + path}?token=#{self.token}\"\n end", "def url\n endpoint+'?'+query_string\n end", "def api_url\n @api_url ||= URI.parse(\"#{super}?#{URI.encode_www_form(query_params)}\")\n end", "def url\n \"#{Rails.configuration.baseurl}#{creator_path(self)}\"\n end", "def url(request_url, delete_link: false)\n uri = URI.parse(request_url)\n if @once || delete_link\n uri.path = \"/once/#{key}/\"\n else\n uri.path = \"/clip/#{key}/\"\n end\n uri.query = nil\n uri.fragment = nil\n\n unless ['http', 'https'].include?(uri.scheme)\n raise ArgumentError.new(\"Bad URI scheme #{uri.inspect}\")\n end\n\n return uri.to_s\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def to_url\n port = @attrs[:port]\n url = \"#{@attrs[:protocol]}://#{@attrs[:host]}\"\n url << \":#{port}\" if port\n url << \"#{@attrs[:path]}?\"\n\n params_str = params.map {|name, value|\n \"#{CGI.escape(name)}=#{CGI.escape(value)}\"\n }.join('&')\n url << params_str\n end", "def url\n raise NotImplementedError, 'this should be overridden by subclass'\n end", "def build_url path, params={}\n full_path = @uri.path + path\n super full_path, params, @uri.query\n end", "def build_url path, params={}\n full_path = @uri.path + path\n super full_path, params, @uri.query\n end", "def build_url path, params={}\n full_path = @uri.path + path\n super full_path, params, @uri.query\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def build_url(path, params = {})\n \"#{self.class.endpoint}#{path}?#{Rack::Utils.build_query(params.merge(:key => api_key.to_s))}\"\n end", "def build_url(path, params={})\n full_path = @uri.path + path\n\n super full_path, params, @uri.query\n end", "def construct_url\n @@API_URL + city + @@API_KEY\n end", "def construct_url(uri)\n \"#{uri.scheme}://#{uri.host}#{uri.path}\"\n end", "def generate_url(url, params = {})\n uri = URI(url)\n uri.query = params.to_query\n uri.to_s\n end", "def url\n end", "def generate_url(url, params = {})\n uri = URI(url)\n\n res = \"#{uri.scheme}://#{uri.host}\"\n res += \":#{uri.port}\" if (uri.port and uri.port != 80 and uri.port != 443)\n res += \"#{uri.path}\" if uri.path\n res += \"#{uri.fragment}\" if uri.fragment\n res += \"?#{params.to_query}\"\n\n return res\n end", "def make_url(path, params, feed='')\n feed = '/' + feed unless feed.empty?\n \"#{BASE_URL}#{path}#{feed}?#{URI.encode_www_form(params)}\"\nend", "def create_uri\n end", "def build_url(action, query=nil)\n url = URI.parse($base_url).merge(action).to_s\n url = OpenID::Util.append_args(url, query) unless query.nil?\n return url\n end", "def to_url\n\t\t\tto_uri.to_s\n\t\tend", "def url\n @url ||= \"http://#{host}:#{port}\"\n end", "def url\n if @service_url.nil?\n @service_url = @protocol + '://' + @host + '/' +\n (@path_prefix.empty? ? '' : (@path_prefix + '/')) + @key + '/'\n end\n @service_url\n end", "def build_url(params_hash)\n param_string = '?' + params_hash.merge(:LicenseKey => @license_key).map { |k, v| \"#{::CGI.escape(k.to_s)}=#{::CGI.escape(v.to_s)}\" }.sort.join('&')\n URI.parse(File.join(endpoint_url, @name + param_string))\n end", "def url\n Addressable::URI.new :scheme => 'http',\n :host => endpoint.host,\n :path => '/onca/xml',\n :query_values => parameters\n end", "def url\n ''\n end", "def url\n @url ||= build_url\n\n if @url.is_a?(Hash)\n { only_path: true }.merge(@url)\n elsif @url.respond_to?(:call)\n @url.call\n else\n @url\n end\n end", "def url(path = nil, params = nil)\n path = path[1..-1] if path&.chr == '/'\n \"https://#{URI.parse(beyond_api_url).host}/#{path}#{'?' +params&.to_query if params.present?}\"\n end", "def url\n return @url if @url\n\n case environment\n when :production\n PRODUCTION_API_ENDPOINT\n when :sandbox\n SANDBOX_API_ENDPOINT\n end\n end", "def url\n id = self['id']\n unless id\n fail InvalidRequestError.new(\n \"Could not determine which URL to request: #{self.class} instance has \" \\\n \"invalid ID: #{id.inspect}\", 'id')\n end\n \"#{self.class.url}/#{CGI.escape id}\"\n end", "def url\n id = self['id']\n unless id\n fail InvalidRequestError.new(\n \"Could not determine which URL to request: #{self.class} instance has \" \\\n \"invalid ID: #{id.inspect}\", 'id')\n end\n \"#{self.class.url}/#{CGI.escape id}\"\n end", "def build_uri\n URI.parse(base_url + \"?\" + query_params)\n end", "def url_to(*args, **options)\n\t\t\t\tpath = build_path_for_url(*args, **options)\n\t\t\t\tAddressable::URI.join(request.base_url, path).to_s\n\t\t\tend", "def request_uri; end", "def to_uri\n build_uri\n end", "def generated_url; end", "def url\n ::File.join \"/\", path.to_s\n end", "def url\n unless new_record?\n Engine.routes.url_helpers.quickie_url(self, :host => Kublog.default_url_options[:host])\n end\n end", "def url_to *args\n path = path_to(*args)\n\n return path if path =~ /\\A[A-z][A-z0-9\\+\\.\\-]*:/\n\n uri = [host = \"\"]\n host << \"http#{'s' if @request.ssl?}://\"\n\n if @request.forwarded? || @request.port != (@request.ssl? ? 443 : 80)\n host << @request.host_with_port\n else\n host << @request.host\n end\n\n uri << @request.script_name.to_s\n uri << path\n File.join uri\n end", "def api_create_url\n \"#{self.name.split(\"::\").last.downcase}\"\n end", "def build_call_url(word)\r\n\t\t\tURI.parse(URI.escape(base_url + word))\r\n\t\tend", "def base_url\n URI::HTTPS.build(host: @server, port: @port, path: @api)\n end", "def to_url\n to_uri.to_s\n end", "def make_url(apipath)\n @base_url + \"/api/open-v1.0/\" + apipath\n end", "def url( path, opts = {} )\n u = signature_plaintext( path, opts )\n h = OpenSSL::Digest::MD5.hexdigest(self.secret + u)\n ret = 'http://' + self.hostname\n p = path\n p = cn_adjusted_path( path ) if cn?\n ret << p\n ret << url_query_parameters( opts ) + '&h=' + h\n ret\n end", "def url\n @url ||= params['url']\n end", "def plan_url(request)\n build_url(request[:from], request[:to], request[:trip_time], request[:arrive_by], request[:options] || {})\n end", "def url\n \"#{File.join(job.url, number.to_s)}/\"\n end", "def api_url\n base_url.concat api_query_parameter\n end" ]
[ "0.79256886", "0.76372886", "0.7559733", "0.7554872", "0.74251467", "0.740126", "0.73417807", "0.73393553", "0.7303162", "0.7298028", "0.7280037", "0.7277138", "0.72542083", "0.72521514", "0.7232481", "0.72272193", "0.72254086", "0.72081095", "0.7190887", "0.7185013", "0.71580964", "0.71551865", "0.712986", "0.71245235", "0.7124393", "0.7120868", "0.7117282", "0.7111674", "0.71083087", "0.7104238", "0.7097695", "0.7093625", "0.7087614", "0.70819396", "0.7081295", "0.70796996", "0.706802", "0.7063219", "0.7061278", "0.7057048", "0.70465356", "0.7039948", "0.70393497", "0.7020737", "0.6988473", "0.6964655", "0.6953444", "0.6951966", "0.69465345", "0.6944447", "0.694342", "0.69397616", "0.6936014", "0.69173795", "0.69166106", "0.6911353", "0.69033164", "0.6901225", "0.69005054", "0.69005054", "0.69005054", "0.6891069", "0.6880734", "0.6877289", "0.68668216", "0.6863705", "0.6862346", "0.6858002", "0.6857202", "0.68509406", "0.68252915", "0.6821325", "0.6817288", "0.6811534", "0.68066883", "0.6803612", "0.6801472", "0.6800063", "0.6799858", "0.6795034", "0.6793507", "0.6784978", "0.6784978", "0.67840844", "0.6778131", "0.6772955", "0.6761512", "0.6748733", "0.6746111", "0.67425525", "0.67277783", "0.67277104", "0.67205006", "0.6714505", "0.671431", "0.67085916", "0.67067194", "0.67003924", "0.669966", "0.6688712", "0.6684114" ]
0.0
-1
Executes the search request.
def execute @result = MdnQuery::SearchResult.from_url(url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search\n send_request\n parse_response\n end", "def execute\n @model_class.search(KEYWORD)\n end", "def search\n request.write_attributes request_attributes\n @search ||= request.call\n end", "def execute_search(query)\n search_resource.retrieve(query)\n end", "def perform(params)\n if use_with_connection\n with_connection { search(params) }\n else\n search(params)\n end\n end", "def search(query); end", "def search(params={})\n rpc_call :search, params\n end", "def search\n end", "def execute_search\n variables = @search_stack.map { |el| el[0] }\n searches = @search_stack.map { |el| el[1] }\n @hits = Algolia.multiple_queries(searches)['results']\n variables.each_with_index do |variable, index|\n instance_variable_set \"@#{variable}\", SearchResults.new(@hits[index])\n end\n end", "def search\n end", "def search\n end", "def search\n end", "def search\n end", "def search\n end", "def search\n end", "def search\n end", "def search\n end", "def search\n end", "def search\n end", "def perform\n raise ArgumentError, \"Need phrase to perform search\" unless @phrase\n uri = Addressable::URI.parse(FT.conf[:url])\n uri.query_values = {\n key: FT.conf[:key],\n phrase: @phrase,\n extension: ( @ext ? @ext : nil ),\n page: ( @page ? @page : nil )\n }\n\n http = Curl.get(uri.to_s)\n \n Crack::XML.parse(http.body_str)\n end", "def search\n unless params[:query].blank?\n @listings = custom_search(params[:query])\n #print \"\\n\\n\\n***203 #{@listings}***\\n\\n\\n\"\n @header_type = \"Search for \\\"\" + params[:query] + \"\\\"\"\n \n #will render search.rhtml by default\n else\n browse\n end\n end", "def search \n\n end", "def search\n\n end", "def perform_search\n if self.class == Alchemy::Admin::PagesController && params[:query].blank?\n params[:query] = 'lorem'\n end\n return if params[:query].blank?\n @search_results = search_results\n if paginate_per\n @search_results = @search_results.page(params[:page]).per(paginate_per)\n end\n end", "def search; end", "def send_request(args)\n set_settings(args[:settings])\n\n XingApi::Job.search(args[:keywords], {:limit => args[:page_size], :offset => 0})\n rescue XingApi::Error => e\n {:code => e.status_code, :msg => e.text}\n end", "def search\n\n end", "def search\n engine = BentoSearch.get_engine(params[:engine_id])\n # put it in an iVar mainly for testing purposes.\n @engine = engine\n\n\n unless engine.configuration.allow_routable_results == true\n raise AccessDenied.new(\"engine needs to be registered with :allow_routable_results => true\")\n end\n\n @results = engine.search safe_search_args(engine, params)\n # template name of a partial with 'yield' to use to wrap the results\n @partial_wrapper = @results.display_configuration.lookup!(\"ajax.wrapper_template\")\n\n # partial HTML results\n render \"bento_search/search/search\", :layout => false\n\n end", "def search\r\nend", "def search params = {}\n send_and_receive search_path(params), params.reverse_merge(qt: blacklight_config.qt)\n end", "def search(*args)\n search_internal([\"SEARCH\"], *args)\n end", "def search(query)\n @search_svc.search query\n end", "def search\n unless params[:search].blank?\n @search = Sunspot.search(KyuEntry) do\n fulltext params[:search]\n end\n @kyu = @search.results\n end\n end", "def perform_search\n terms = { vehicle_year: 2006,\n vehicle_brand: \"Yamaha\",\n vehicle_model: \"Yz250\",\n vehicle_submodel: \"-- Base\",\n category_name: \"Complete Wheel Assembly\" }\n perform_search(terms)\n end", "def search\n @search = Sunspot.search(Job) do\n keywords(params[:searchterm])\n end\n end", "def search\nend", "def perform\n @response = Configuration.client.get(self.url + self.params, self.to_json)\n if @response.failure?\n STDERR.puts \"[REQUEST FAILED] #{self.to_curl}\\n\"\n raise SearchRequestFailed, @response.to_s\n end\n @json = MultiJson.decode(@response.body)\n @results = @json['responses'].map {|response| Results::Collection.new(response, @options)}\n return self\n ensure\n logged\n end", "def run(query,*args)\n with_query(query,*args) do\n if self.search_method\n run_custom_search\n else\n run_default_search\n end\n end\n end", "def Search query\n \n APICall(path: \"search.json?query=#{query}\",method: 'GET')\n \n end", "def search(params)\n raise NotImplementedError\n end", "def search\n @query = params[:keywords].nil? ? \"\" : params[:keywords]\n\n # prepare filters\n filters = apply_filters\n\n # do the search itself\n ultrasphinx_search(filters)\n params[:filter] = false;\n\n respond_to do |format|\n format.html { render :partial => 'dt/projects/search_results', :layout => 'layouts/dt_application'}\n end\n end", "def execute\n reset\n params = @query.to_params\n @solr_result = @connection.request(\"/#{request_handler}\", params, {:header => {'Content-Type' => 'application/x-www-form-urlencoded'}})\n self\n end", "def search(url_params = nil, eds_params = nil)\n send_and_receive(url_params, eds_params)\n end", "def search_request(params)\n result = @client.connection.get PATH, params\n Error.check_for_error(result)\n result\n end", "def index\n @search = params[\"search\"]\n if @search.present?\n client = Client.new(@search)\n response = client.call\n\n new_results = StoreSearch.new(@search, response).run\n if new_results\n scope_to_use = client.find_search_key || \"random\"\n\n if scope_to_use == \"category\"\n searches = Search.with_category(@search[\"category\"])\n @searches = Search.paginate(page: params[:page], per_page: 5).where(id: searches.map(&:id))\n # TODO recover former sintax\n # @searches = Search.paginate(page: params[:page], per_page: 5)\n # .with_category(@search[\"category\"])\n elsif scope_to_use == \"text\"\n @searches = Search.paginate(page: params[:page], per_page: 5)\n .with_text(@search[\"text\"])\n elsif scope_to_use == \"random\"\n @searches = Search.paginate(page: params[:page], per_page: 5)\n .created_randomly\n else\n @searches = Search.paginate(page: params[:page], per_page: 5)\n end\n else\n @searches = Search.paginate(page: params[:page], per_page: 5)\n end\n end\n \n @searches ||= Search.paginate(page: params[:page], per_page: 5)\n @search = Search.new()\n end", "def index \n unless(params[:search==nil]) \n @requests = Request.search(params[:search]) \n end \n end", "def search\n @term = sname = request.query_parameters[\"search\"].to_s.downcase\n @data = search_term(sname)\n render partial: \"shared/search\"\n end", "def run\n self.prominence!\n return self.send_results if @query.any?\n\n self.fuzzy_match\n self.apply_narrowing_filters\n self.apply_limit\n self.load_and_sort_by_matches\n self.send_results\n end", "def search_for(*args, &block)\n __elasticsearch__.search(*args, &block)\n end", "def run_search\n agent = Mechanize.new\n agent.get('http://www.indeed.com/')\n fill_out_search_form(agent)\n search_and_create_job_application(agent)\n end", "def handle_search\n if request.id == 'csv'\n csv(:search_results)\n elsif request.id\n table_page(*model.search_results(normalized_type, request))\n else\n page do\n Forme.form(model.new(nil, request), form_attributes(:action=>url_for(\"search/1\"), :method=>:get), form_opts) do |f|\n model.columns_for(:search_form, request).each do |column|\n col_opts = column_options_for(:search_form, request, f.obj, column).merge(:name=>column, :id=>column)\n if html = model.edit_html_for(f.obj, column, :search_form, request)\n col_opts[:html] = html\n end\n f.input(column, col_opts)\n end\n f.button(:value=>'Search', :class=>'btn btn-primary')\n end\n end\n end\n end", "def handle_search(query)\n @results = search query unless query.empty?\n\n prompt_for_selection(query)\nend", "def execute\n reset\n params = @query.to_params\n @solr_result = @connection.post \"#{request_handler}\", :data => params\n self\n end", "def search_request(params)\n result = @client.connection.get(PATH, params)\n Yelp::Fusion::Error.check_for_error(result)\n result\n end", "def search(query)\n params = { key: self.api_key, cx: self.search_engine_id, q: query }\n uri = URI(BASE_URL)\n uri.query = URI.encode_www_form(params)\n request = build_request(uri)\n\n response = self.execute_search(uri, request)\n format_response(response)\n end", "def search(*args)\n search_provider.search(*args)\n end", "def search(params = {})\n Search.new(params).execute\n end", "def search(params = {})\n Search.new(params).execute\n end", "def do_search\n @search_text = params[:q]\n\n # Doctoring for the view to find matches:\n @q = @search_text\n @q.chop! if params[:q] =~ /\\*$/\n @q = @q[1..-1] if params[:q] =~ /^\\*/\n\n # TODO: we'll want some whitelist filtering here later:\n # params[:q] = \"#{@q}*\" unless params[:q] =~ /\\*$/ or params[:q] =~ /^[-+]/ or params[:q] =~ /\\s/\n params[:q] = I18n.transliterate(params[:q]).downcase\n\n # TODO: This search suggestions block is large; extract.\n\n # First step (and, yes, this will be slow—we will optimize later), look for\n # search suggestions that match the query:\n words = params[:q].split # TODO: we might want to remove words with ^-\n # TODO: we might also want to remove stopwords e.g.: https://github.com/brenes/stopwords-filter\n suggestions = []\n # YUCK! This is the best way to do this in Searchkick at the moment, though.\n # :S\n words.each do |word|\n word_search = SearchSuggestion.search(word, fields: [{ match: :exact }])\n suggestions += word_search.results if word_search.respond_to?(:results)\n end\n\n # If we only found one thing and they only asked for one thing:\n if suggestions.size == 1 && params[:q] !~ /\\s/\n Rails.logger.warn(\"One suggestion.\")\n # TODO: move this to a helper? It can't go on the model...\n suggestion = suggestions.first\n suggestion = suggestion.synonym_of if suggestion.synonym_of\n where = case suggestion.type\n when :page\n suggestion.page\n when :object_term\n term_records_path(uri: suggestion.object_term, object: true)\n when :path\n suggestion.path\n when :wkt_string\n flash[:notice] = \"Unimplemented, sorry.\"\n \"/\"\n end\n return redirect_to(where)\n elsif suggestions.size >= 2 && params[:q] =~ /\\s/\n Rails.logger.warn(\"Multiple suggestions.\")\n groups = suggestions.group_by(&:type)\n # Easier to handle:\n groups[:page] ||= []\n groups[:object_term] ||= []\n groups[:path] ||= []\n groups[:wkt_string] ||= []\n if groups[:page].size > 1\n Rails.logger.warn(\"Multiple PAGE suggestions.\")\n # We can't use suggestions if there's more than one species. Sorry.\n flash[:notice] = t(\"search.flash.more_than_one_species\",\n species: groups[:page].map(&:match).to_sentence)\n else\n Rails.logger.warn(\"0 or 1 Page suggestions.\")\n clade = groups[:page].try(:first).try(:page_id)\n Rails.logger.warn(\"Page suggestion: #{clade}\") if clade\n if groups[:object_term].size > 2\n Rails.logger.warn(\"Over two TERM suggestions.\")\n flash[:notice] = t(\"search.flash.more_than_two_terms\",\n terms: groups[:object_term].map(&:match).to_sentence)\n elsif groups[:path].size > 0\n Rails.logger.warn(\"...had PATH suggestions.\")\n flash[:notice] = t(\"search.flash.cannot_combine_paths\",\n path: groups[:path].map(&:match).to_sentence)\n else # NOTE: this assumes we only have OBJECT term suggestions, not predicates.\n Rails.logger.warn(\"Usable suggestions...\")\n (first, second) = groups[:object_term] # Arbitrary which is first...\n Rails.logger.warn(\"First term: #{first.object_term}\")\n Rails.logger.warn(\"Second term: #{second.object_term}\") if second\n return redirect_to(term_records_path(uri: first.object_term, object: true,\n and_object: second.try(:object_term), clade: clade))\n end\n end\n end\n\n @clade = if params[:clade]\n puts \"*\" * 100\n puts \"** Filtering by clade #{params[:clade]}\"\n # It doesn't make sense to filter some things by clade:\n params[:only] = if params[:only]\n Array(params[:only]) - [:collections, :users, :predicates, :object_terms]\n else\n [:pages, :media]\n end\n puts \"Only param should now be: #{params[:only]}\"\n Page.find(params[:clade])\n else\n nil\n end\n\n default = params.has_key?(:only)? false : true\n @types = {}\n [ :pages, :collections, :articles, :images, :videos, :videos, :sounds, :links, :users, :predicates, :object_terms ].\n each do |sym|\n @types[sym] = default\n end\n\n @types[params[:only].to_sym] = true if params.has_key?(:only)\n\n # if params.has_key?(:only)\n # Array(params[:only]).each { |type| @types[type.to_sym] = true }\n # elsif params.has_key?(:except)\n # Array(params[:except]).each { |type| @types[type.to_sym] = false }\n # end\n\n # NOTE: no search is performed unless the @types hash indicates a search for\n # that class is required:\n\n @pages = if @types[:pages]\n fields = %w[preferred_vernacular_strings^20 vernacular_strings^20 preferred_scientific_names^10 scientific_name^10 synonyms^10 providers resource_pks]\n match = words.size == 1 ? :text_start : :phrase\n basic_search(Page, boost_by: [:page_richness, :specificity, :depth], match: match, fields: fields,\n where: @clade ? { ancestry_ids: @clade.id } : nil,\n includes: [:preferred_vernaculars, :medium, { native_node: { node_ancestors: :ancestor } }])\n else\n nil\n end\n\n\n @collections = if @types[:collections]\n basic_search(Collection, fields: [\"name^5\", \"description\"])\n else\n nil\n end\n\n @articles = if @types[:articles]\n basic_search(Searchkick,\n fields: [\"name^5\", \"resource_pk^10\", \"owner\", \"description^2\"],\n where: @clade ? { ancestry_ids: @clade.id } : nil,\n index_name: [Article])\n else\n nil\n end\n\n @images = if @types[:images]\n media_search(\"image\")\n else\n nil\n end\n\n @videos = if @types[:videos]\n media_search(\"video\")\n else\n nil\n end\n\n @sounds = if @types[:sounds]\n media_search(\"sound\")\n else\n nil\n end\n\n # @links = if @types[:links]\n # basic_search(Searchkick,\n # fields: [\"name^5\", \"resource_pk^10\", \"owner\", \"description^2\"],\n # where: @clade ? { ancestry_ids: @clade.id } : nil,\n # index_name: [Link])\n # else\n # nil\n # end\n\n @users = if @types[:users]\n basic_search(User, fields: [\"username^6\", \"name^4\", \"tag_line\", \"bio^2\"])\n else\n nil\n end\n\n Searchkick.multi_search([@pages, @articles, @images, @videos, @sounds, @collections, @users].compact)\n\n @pages = PageSearchDecorator.decorate_collection(@pages) if @pages\n @articles = ArticleSearchDecorator.decorate_collection(@articles) if @articles\n @images = ImageSearchDecorator.decorate_collection(@images) if @images\n @videos = VideoSearchDecorator.decorate_collection(@videos) if @videos\n @sounds = SoundSearchDecorator.decorate_collection(@sounds) if @sounds\n @collections = CollectionSearchDecorator.decorate_collection(@collections) if @collections\n @users = UserSearchDecorator.decorate_collection(@users) if @users\n\n # if @types[:predicates]\n # @predicates_count = TraitBank.count_predicate_terms(@q)\n # # NOTE we use @q here because it has no wildcard.\n # @predicates = Kaminari.paginate_array(\n # TraitBank.search_predicate_terms(@q, params[:page], params[:per_page]),\n # total_count: @predicates_count\n # ).page(params[:page]).per(params[:per_page] || 50)\n # end\n #\n # if @types[:object_terms]\n # @object_terms_count = TraitBank.count_object_terms(@q)\n # # NOTE we use @q here because it has no wildcard.\n # @object_terms = Kaminari.paginate_array(\n # TraitBank.search_object_terms(@q, params[:page], params[:per_page]),\n # total_count: @object_terms_count\n # ).page(params[:page]).per(params[:per_page] || 50)\n # end\n\n respond_to do |fmt|\n fmt.html do\n @page_title = t(:page_title_search, query: @q)\n end\n\n fmt.js { }\n\n # TODO: JSON results for other types! TODO: move; this is view logic...\n fmt.json do\n render json: JSON.pretty_generate(@pages.results.as_json(\n except: :native_node_id,\n methods: :scientific_name,\n include: {\n preferred_vernaculars: { only: [:string],\n include: { language: { only: :code } } },\n # NOTE I'm excluding a lot more for search than you would want for\n # the basic page json:\n top_media: { only: [ :id, :guid, :owner, :name ],\n methods: [:small_icon_url, :medium_icon_url],\n include: { provider: { only: [:id, :name] },\n license: { only: [:id, :name, :icon_url] } } }\n }\n ))\n end\n end\n end", "def getResultsFromSearch(query, type, guts, ppOverride)\n request('getResultsFromSearch', {'query' => query, 'type' => type, 'guts' => guts, 'ppOverride' => ppOverride})\nend", "def search( args={} )\n response = request( :method => 'post', :url => @url, :query => generate_xml(args) )\n result = process_tsv( args, response )\n result = conv_results_to_a_of_h( result ) if args[:process_results]\n return result\n end", "def search params = {}\n send_and_receive blacklight_config.solr_path, params.reverse_merge(qt: blacklight_config.qt)\n end", "def search\n @hits = []\n\n if params[:query]\n search = DesignMethod.solr_search do\n fulltext params[:query] do\n highlight\n minimum_match 0\n end\n end\n store_location\n @hits = search.hits\n @results = search.results\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @results }\n end\n end", "def search\n url = @@url\n url.query = Addressable::URI.form_encode(\n 'v' => '1.0',\n 'q' => (@args[:site]) ? @query + \" site:#{ @args[:site] }\" : @query ,\n 'key' => @google_api_key,\n 'userip' => @ip_number\n )\n results = JSON.parse(open(url, 'Referer' => @referrer_site).read) rescue {}\n \n @response_details = results['responseDetails'] # => nil,\n @response_status = results['responseStatus' ] # => 200\n \n @cursor = Cursor.new(results['responseData']['cursor'])\n \n results['responseData']['results']\n end", "def execute_search(&on_result)\n Fast.public_send(search_method_name,\n expression,\n @files,\n parallel: parallel?,\n on_result: on_result)\n end", "def search\n query = params[:q]\n works = ActiveFedora::SolrService.query(query, fq: @fq, fl: @fl, df: @df, rows: @max_rows) \n format_solr_keys(works)\n render(json: works)\n end", "def search\n @results = Tool.ordered_by(params[:order])\n\n if params[:q].present?\n @results = @results.search(params[:q])\n end\n\n if Tool::ALLOWED_TYPES.include?(params[:type])\n @results = @results.where(type: params[:type])\n end\n\n @results = @results.offset(@start).limit(@items)\n\n @total = @results.count(:all)\n end", "def do_search(params)\n\n # This first section sets up basic search parameters based on what was requested.\n\n format = params[:format].present? ? params[:format] : 'none'\n\n order = params[:order].present? ? {field: params[:order].split[0], direction: params[:order].split[1]} : {}\n limit = params[:limit].present? ? params[:limit].to_i : 50\n page = params[:limit] ? (params[:offset].to_i / params[:limit].to_i) + 1 : 1\n s_op = params[:op].present? ? params[:op] : 'AND'\n role = params[:role].present? ? params[:role] : 'guest'\n\n linking_tool = params[:linking_tool].present?\n\n options = options_for_search(params)\n\n reviewed = params[:reviewed] && params[:reviewed] == \"1\" ? false : nil\n\n # Each model has a custom version of these functions (and a list of valid fields) to permit only the\n # appropriate search fields for each model. \n\n # \"Params\" are any fulltext fields\n # \"Filters\" are all non-fulltext fields (numbers, booleans, exact string matches)\n # \"Dates\" are specifically for fields that need to allow date comparison\n\n filters = filters_for_search(params)\n dates = dates_for_search(params)\n params = params_for_search(params)\n \n s = self.search do\n \n # Fulltext search is defined as a lambda function, since it needs to be able to be combined with non-fulltext\n # search options as the user decides.\n\n fulltext_search = lambda { |p, o| \n if params.present?\n p.each do |field, value|\n\n # Since there are unlimited rows for the advanced search, the user can submit multiple values for the same field\n # i.e. \"Title\" for an Entry could be \"Bible\" and \"Book\" separately. So, they are iterated over:\n\n value = Array(value)\n if value.kind_of? Array\n value.each do |v|\n\n # Each search field can also be qualified in various ways\n\n op = Array(options[field + \"_option\"]).shift\n \n # If searching for this 'without' the term, right now just add a '-' to the beginning of query to negate it\n \n if op && op == 'does not contain'\n fulltext \"-\" + v.gsub(' ', '+'), :fields => [field]\n elsif op && op == 'blank'\n with field.gsub('_search', ''), nil\n elsif op && op == 'not blank'\n without field.gsub('_search', ''), nil\n elsif op && op == 'before'\n with(field).less_than v\n elsif op && op == 'after'\n with(field).greater_than v\n else\n fulltext v, :fields => [field]\n end\n end\n end\n end\n end\n }\n\n if not reviewed.nil?\n with :reviewed, false\n end\n\n # The same process for exact-match fields, but this time the search is being run and narrowed (i.e. it is not\n # using a lambda function)\n\n if filters.present?\n filters.each do |field, value|\n value = Array(value)\n value.each do |v|\n op = Array(options[field + \"_option\"]).shift\n if op && op == 'blank'\n with field, nil\n elsif op && op == 'not blank'\n without field, nil\n elsif v.blank? # ignore blank\n elsif op && op == 'less than'\n with(field).less_than v\n elsif op && op == 'greater than'\n with(field).greater_than v\n elsif op && op == 'without'\n without field, v\n elsif v.kind_of?(Array) && v.all? { |v2| v2.blank? } # make sure it's not an array of blanks \n else\n if ['true', 'false'].include? v\n v = (v == 'true')\n end\n with field, v\n end\n end\n end\n end\n\n # The same process for Dates, but with different interpretations of the search field options to correspond\n # with date-based searching\n\n if dates.present?\n dates.each do |field, value|\n value = Array(value)\n value.each do |v|\n v = v.split(/[-\\/]/).join(\"\").ljust(8, '01')\n op = Array(options[field + \"_option\"]).shift\n begin\n if op && op == 'before'\n with(field).between(Date.new(0,1,1)..Date.parse(v))\n elsif op && op == 'after'\n with(field).between(Date.parse(v)..Date.today)\n elsif op && op == 'near'\n d = Date.parse(v)\n with(field).between((d - 1.month)..(d + 1.month))\n elsif op && op == 'exact'\n with(field, v)\n end\n rescue ArgumentError\n @error = \"Error in Date Search - please use format YYYY/MM/DD or similar\"\n end\n end\n end\n end\n\n # In order to use SUNSPOT'S 'and'/'or' options together with non-fulltext fields,\n # we create a lambda function for fulltext searching (above)\n\n # ( This may be an idiosycracy of Sunspot only, but that is the reason for this roundabout approach ) \n\n if s_op == 'OR'\n any do\n fulltext_search.call(params, options)\n end\n else\n all do\n fulltext_search.call(params, options)\n end\n end\n\n # Unfortunately, sunspot does not natively support MIXING fulltext and exact searches using the \"OR\" operator \n # - so we do that manually\n # \n # params[:fq] refer to 'filter queries', or queries that refer to a fixed set of objects (exact strings, numbers, etc.)\n # params[:q] refers to fulltext queries\n\n # What this block of code does is check whether the 'OR' operator is used, and if it has been added by sunspot correctly\n # to the Solr query - if not, it is added in the proper place\n\n adjust_solr_params do |params|\n new_q = []\n p_fq = []\n params[:fq].each do |fq|\n if not fq.include? \"type\"\n new_q.push('_query_:\"{!edismax} ' + fq + '\"')\n else\n p_fq.push(fq)\n end\n end\n params[:fq] = p_fq\n if params[:q].blank?\n # nothing here...\n elsif not params[:q].include? s_op\n params[:q] = '(_query_:\"{!edismax qf=\\'' + params[:qf] + '\\'}' + params[:q].gsub('\"', '\\\"') + '\")'\n params.delete(:qf)\n end\n if params[:q].blank?\n if new_q.length > 0\n params[:q] = new_q.join(\" #{s_op} \")\n else\n params[:q] = \"*\"\n end\n else\n params[:q] = ([params[:q]] + new_q).join(\" #{s_op} \")\n end\n if linking_tool\n # NOTE: remove 'approved' thing here to make unapproved records show up in linking tool...\n params[:q] = '(' + params[:q] + ') AND (_query_:\"{!edismax qf=\\'deprecated\\'}false\") AND (_query_:\"{!edismax qf=\\'draft\\'}false\")'\n elsif role != \"admin\" && self.model_name.to_s == 'Entry'\n params[:q] = '(' + params[:q] + ') AND (_query_:\"{!edismax qf=\\'draft\\'}false\")'\n end\n end\n\n # Finally, page number, count and order_by field are accounted for, and the search results are returned\n\n paginate :per_page => limit, :page => page\n\n order.present? ? order_by(order[:field], order[:direction]) : order_by(:score, :desc)\n\n end\n\n return s\n end", "def search(args)\n args = validate_search_args!(args)\n\n response = remote_call(:search, args)\n\n if response.respond_to?(:records)\n serialize_records(response.records)\n else\n response\n end\n end", "def search(user, query, collection, wiki)\n end", "def search(*args)\n end", "def base_search(params, query)\n log.debug(\"Processing by #{self.class}#search\")\n log.debug(\" Parameters: #{params.inspect}\")\n log.debug(\" Query: #{query.inspect}\")\n end", "def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end", "def searches\n wrapping!(\n search(\n root_uri,\n data_raw.to_s.gsub('=>', ':')\n )\n )\n end", "def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end", "def search(query, options = {}); end", "def search(query, options={})\n self.perform_get(\"/search\", {\n :q => query\n }.merge(options|| {}))\n end", "def search\n if params[:key] == AUTHORIZATION_TOKEN && params[:q] == \"discover\"\n @google_places = discover\n @places = PLACES.select do |place|\n (place[:coordinates][:latitude].between?(average_location - 0.01, average_location + 0.01))\n end\n elsif params[:key] == AUTHORIZATION_TOKEN && params[:q]\n params_hash = {\n q: params[:q],\n type: params[:type] || \"bar\"\n }\n @google_places = call(params_hash)\n @places = PLACES.select do |place|\n (place[:name].downcase.include? (params[:q].downcase)) || (place[:coordinates][:latitude].between?(average_location - 0.01, average_location + 0.01))\n end\n\n render_error(\"empty\") if @google_places.empty? && @places.empty?\n elsif params[:q]\n render_error\n else\n render_error(\"missing_params\")\n end\n end", "def search(options={})\n params = []\n options.each do |key, value|\n params << \"#{key}=#{value}\"\n end\n ethon = ethon_easy_json_requester\n ethon.url = uri_escape(\"#{base_api_url}search/query?#{params.join('&')}\")\n ethon.perform\n check_and_raise_failure(ethon)\n server_responded_at = Time.now\n {\n requested_url: ethon.url,\n server_responded_at: server_responded_at,\n results: parse_search_response(ethon.response_body)\n }\n end", "def search\n @documents = api.form(\"everything\")\n .query(%([[:d = fulltext(document, \"#{params[:q]}\")]]))\n .page(params[:page] ? params[:page] : \"1\")\n .page_size(params[:page_size] ? params[:page_size] : \"20\")\n .submit(ref)\n end", "def srch(opts={})\n\t\t\t\tsrch_client.search(opts)\n\t\t\tend", "def execute\n # build the query string\n # run the query\n # return the results\n end", "def handle(input)\n search(input)\n end", "def search(search_builder = {}, eds_params = {})\n send_and_receive(blacklight_config.solr_path, search_builder, eds_params)\n end", "def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end", "def search\n query = params['query'] # query sent by user\n searchtype = params['searchtype'] # what type of search is this\n \n # based on search type, call the appropriate search function\n\n case searchtype\n when 'boolean' then @articles = search_bool(query)\n when 'tf' then @articles = search_TF(query)\n when 'tfidf' then @articles = search_TFIDF(query)\n when 'pagerank' then @articles = search_pagerank(query)\n when 'pageranktfidf' then @articles = search_TFIDF_pagerank(query)\n else @articles = nil\n end\n\n ap @articles\n @found = 1\n if @articles.nil?\n @msg = \"None found, try again...\"\n @found = 0\n @articles = []\n end\n render \"articles\"\n \n end", "def search(query_or_payload, models=[], options={})\n models = Multimodel.new(models)\n request = Searching::SearchRequest.new(models, query_or_payload, options)\n Response::Response.new(models, request)\n end", "def search(index, body)\n handler.search index: index, body: body\n end", "def execute\n @response ||= begin\n Config[:instrumenter].instrument(\"request.search_flip\", index: target, request: request) do |payload|\n response = execute!\n\n payload[:response] = response\n\n response\n end\n end\n end", "def search\n @results = Cookbook.search(\n params.fetch(:q, nil)\n ).offset(@start).limit(@items)\n end", "def search_result\n # user specified that they want to search questions?\n # user specified that they want to search courses ?\n \n if params[:search_for] == \"question\"\n if !search_params[\"question_keyword\"].nil? and search_params[\"question_keyword\"].include?(',')\n search_params[\"question_keyword\"] = search_params[\"question_keyword\"].tr(',', '').strip #scrub any commas in our search\n end\n\n db = Search.search_questions(search_params.to_h)\n @results = JSON.parse(db.to_json)\n elsif params[:search_for] == \"course\"\n db = Search.search_courses(search_params.to_h)\n @results = JSON.parse(db.to_json)\n end\n\n end", "def execute(from = 0, size = SEARCH_SIZE)\n self.query[:body][:from] = from\n self.query[:body][:size] = size\n response = search(query)\n SearchLogResult.new(response, from, size, self)\n end", "def search_implementation(args)\n scrape_url = construct_search_url(args)\n response = http_client.get(scrape_url)\n\n unless response.ok?\n error = BentoSearch::Results.new\n error.error = {\n status: response.status,\n response: response.body\n }\n fill_in_search_metadata_for(error, args)\n\n return error\n end\n\n document = Nokogiri::HTML(response.body)\n\n results = BentoSearch::Results.new\n if single_result_page?(document)\n results.total_items = extract_single_total_items(document)\n item = SingleItemExtractor.new(document, configuration).extract\n if item\n # best we can do for link is the search URL we scraped...\n item.link ||= scrape_url\n results << item\n end\n else\n results.total_items = extract_multi_total_items(document)\n\n extractor = MultiItemExtractor.new(document, configuration)\n results.concat extractor.extract\n end\n\n return results\n end", "def run_query(terms)\n return Book.run_search(terms)\nend", "def search(params = {})\n http.get(\"/nfse\", params: filter(params)) do |response|\n respond_with_collection(response)\n end\n end", "def index_request( params={} )\n res = @http_client.post_form( URI.parse(\"#{self.url}/select\"), params.update({ \"wt\" => \"ruby\" }) )\n\n if res.code.to_i != 200\n raise IndexSearchError, \"Index Search Error: #{res.body}\"\n else\n return eval(res.body)\n end\n end", "def search(search_params = {})\n artifacts.search(search_params)\n end", "def search!(\n query, case_sensitive: false, whole_sentence: true,\n limit: 10, skip: 0, sentence_limit: 80\n )\n results = search(\n query,\n case_sensitive: case_sensitive,\n whole_sentence: whole_sentence,\n limit: limit,\n skip: skip\n )\n\n results.each do |doc|\n doc.search!(\n query,\n case_sensitive: case_sensitive,\n whole_sentence: whole_sentence,\n sentence_limit: sentence_limit\n )\n yield(doc) if block_given?\n end\n\n results\n end", "def search(params = {})\n @api.get(\"api.json\", params)\n end", "def call_search(search, input, list)\n Rc.send(\"#{search}_search\", input || '', list)\n rescue\n message = $!.is_a?(NoMethodError) && !Rc.respond_to?(\"#{search}_search\") ?\n \"Completion search '#{search}' doesn't exist.\" :\n \"Failed during completion search with '#{$!.message}'.\"\n raise FailedMissionError.new(self), message\n end", "def search\n\t authorize! :search, Book\n\n\t query = params[:search] || \"\"\n page = params[:page] ? params[:page].to_i : 1\n \n @conditions = Condition.all\n\t @result = Book.search(query, page)\n @result = Book.calculate_hidden(@result, session[:user_id])\n\n\tend" ]
[ "0.77357465", "0.7695561", "0.7516592", "0.7478814", "0.7317463", "0.7143135", "0.7113031", "0.7112886", "0.70571756", "0.70462066", "0.70462066", "0.70462066", "0.70462066", "0.70462066", "0.70462066", "0.70462066", "0.70462066", "0.70462066", "0.70462066", "0.70382786", "0.7032222", "0.70210135", "0.7000773", "0.69987345", "0.69331586", "0.6931274", "0.6929084", "0.69183946", "0.69022703", "0.6893944", "0.68838835", "0.6876805", "0.6866761", "0.6866341", "0.68398815", "0.6825973", "0.6794582", "0.67757124", "0.67514193", "0.674724", "0.6745092", "0.6740505", "0.6736987", "0.6725807", "0.6674538", "0.6673411", "0.666049", "0.66563153", "0.6653836", "0.6649439", "0.6649178", "0.6646928", "0.6633011", "0.6630656", "0.6624167", "0.6614831", "0.6589487", "0.6589487", "0.65667504", "0.6559751", "0.65597236", "0.6554835", "0.6541624", "0.6535519", "0.65332615", "0.6514301", "0.6512628", "0.6506853", "0.649768", "0.6496498", "0.6491569", "0.64852273", "0.64831966", "0.64813703", "0.6481236", "0.6478925", "0.6473605", "0.64719045", "0.6463492", "0.64618355", "0.6461229", "0.6447683", "0.644582", "0.64312696", "0.64220876", "0.6418139", "0.63984793", "0.6394569", "0.63909465", "0.6372235", "0.63717145", "0.6370895", "0.63691765", "0.6367896", "0.6356244", "0.63561827", "0.6353181", "0.63506395", "0.63493854", "0.6348294", "0.63471943" ]
0.0
-1
Opens the search in the default web browser.
def open html_url = url.sub('.json?', '?') Launchy.open(html_url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_browser_with_search(url)\n Launchy.open(url)\nend", "def open_url(term)\n Defcli.open_in_browser search_url(term, :api => false)\n end", "def launch_google_search\n\tLaunchy.open(build_google_search_url)\nend", "def open\n @url = @@youtube_search_base_url + CGI.escape(@keyword)\n @url += \"&page=#{@page}\" if not @page == nil\n @url += \"&search_sort=#{@sort}\" if not @sort == nil\n @html = Kernel.open(@url).read\n replace_document_write_javascript\n @search_result = Hpricot.parse(@html)\n end", "def open_in_browser\n puts url\n `#{open} #{url}`\n end", "def browse(url)\n if RUBY_PLATFORM =~ /darwin/\n `open #{url}`\n elsif RUBY_PLATFORM =~ /linux/\n `#{ENV['BROWSER']} #{url}`\n elsif ENV['OS'] == 'Windows_NT' or\n RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i\n `start \"\" \"#{url}\"`\n end\n end", "def show_search_index \n WebView.navigate(url_for(:action => :search, :controller => :SearchContacts, :query => {:show_results => 'true'}), Constants::TAB_INDEX['Contacts'])\n end", "def open_in_browser\n link = \"http://www.bandsintown.com/cities/pittsburgh-pa\"\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n system \"start #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n system \"open #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system \"xdg-open #{link}\"\n end\n end", "def open_home_page\n open(configuration.browser_url)\n end", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n run \"open #{url}\"\n else\n # Ubuntu\n run \"xdg-open #{url}\"\n end\n end\n end\n end", "def browse(url)\n if RUBY_PLATFORM =~ /darwin/\n `open #{url}`\n elsif ENV['OS'] == 'Windows_NT' or\n RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i\n `start \"\" \"#{url}\"`\n end\n end", "def open(url = @url)\n @browser.goto(url)\n wait_for_page_to_load\n end", "def open_my_site_by_name(name)\n unless @browser.title=~/#{name}/\n @browser.link(:text, 'More Sites').click\n @browser.text_field(id: 'txtSearch').set name[0..5]\n @browser.div(id: 'selectSite').link(title: name).click\n end\n end", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n `open #{url}`\n else\n # Ubuntu\n `xdg-open #{url}`\n end\n end\n end\n end", "def launch_browser(url)\n case RUBY_PLATFORM\n when /darwin/\n system \"open\", url\n when /mswin|mingw|cygwin/\n system \"start\", url\n else\n system \"xdg-open\", url\n end\n end", "def open\n @browser.goto @@site_url + \"/login.php\"\n\tWatir::Wait.until { self.loaded? LoginPage.title}\n self\n end", "def run_search\n agent = Mechanize.new\n agent.get('http://www.indeed.com/')\n fill_out_search_form(agent)\n search_and_create_job_application(agent)\n end", "def browse url\n @@headless = Headless.new\n @@headless.start\n @@browser = Watir::Browser.start url\n end", "def open_browser(base_url = nil, options = {})\n base_url ||= $ITEST2_PROJECT_BASE_URL\n base_url ||= $BASE_URL\n raise \"base_url must be set\" if base_url.nil?\n\n default_options = {:speed => \"fast\",\n :visible => true,\n :highlight_colour => 'yellow',\n :close_others => true,\n :start_new => false, \t# start a new browser always\n :go => true}\n\n options = default_options.merge options\n options[:firefox] = true if \"Firefox\" == $ITEST2_BROWSER || \"Firefox\" == $BROWSER\n ($ITEST2_HIDE_BROWSER) ? $HIDE_IE = true : $HIDE_IE = false\n\n if base_url =~ /^file:/\n uri_base = base_url\n else\n uri = URI.parse(base_url)\n uri_base = \"#{uri.scheme}://#{uri.host}:#{uri.port}\"\n end\n\n if options[:start_new]\n @web_browser = WebBrowser.new(uri_base, nil, options)\n else\n @web_browser = WebBrowser.reuse(uri_base, options) # Reuse existing browser\n end\n\n if base_url =~ /^file:/\n goto_url(base_url) # for files, no base url\n else\n (uri.path.length == 0) ? begin_at(\"/\") : begin_at(uri.path) if options[:go]\n end\n\n return @web_browser\n end", "def browse(number)\n request = get_request_by_number(number)\n Launchy.open(request.html_url)\n end", "def click_search\n search_button.click\n end", "def go()\n\t@selenium.open @url\n end", "def open url\r\n command 'open', url_arg(url)\r\n end", "def open url\r\n command 'open', url_arg(url)\r\n end", "def open_browser_by_watir(options = {})\r\n\r\n begin\r\n support_unicode\r\n rescue => e\r\n puts \"Unicode may not work in IE, #{e}\"\r\n end\r\n\r\n\t\t\tif options && options.class == String\r\n\t\t\t options = {:base_url => options.to_s }\r\n\t\t\tend\r\n\t\t\t \r\n\t\t\tif options && options.class == Hash && options[:base_url]\r\n \tbase_url ||= options[:base_url]\r\n\t\t\tend\r\n\t\t\t\r\n\t\t\tbase_url = options[:base_url] rescue nil \r\n\t\t\tbase_url ||= $TESTWISE_PROJECT_BASE_URL\t\t\t\r\n base_url ||= $BASE_URL\r\n \r\n raise \"base_url must be set\" if base_url.nil?\r\n\r\n default_options = {:speed => \"fast\",\r\n :visible => true,\r\n :highlight_colour => 'yellow',\r\n :close_others => true,\r\n :start_new => false, # start a new browser always\r\n :go => true}\r\n\r\n options = default_options.merge options\r\n ($TESTWISE_HIDE_BROWSER) ? $HIDE_IE = true : $HIDE_IE = false\r\n\r\n if base_url =~ /^file:/\r\n uri_base = base_url\r\n else\r\n uri = URI.parse(base_url)\r\n uri_base = \"#{uri.scheme}://#{uri.host}:#{uri.port}\"\r\n end\r\n\r\n if options[:start_new]\r\n @web_browser = WebBrowser.new(uri_base, nil, options)\r\n else\r\n @web_browser = WebBrowser.reuse(uri_base, options) # Reuse existing browser\r\n end\r\n\r\n if base_url =~ /^file:/\r\n goto_url(base_url) # for files, no base url\r\n else\r\n (uri.path.length == 0) ? begin_at(\"/\") : begin_at(uri.path) if options[:go]\r\n end\r\n\r\n return @web_browser\r\n end", "def search_watir\n # data validation\n # if no ARGV, print errormessage and shut the prog\n if ARGV.empty?\n abort(\"Missing input. \\nPlease explict your question.\")\n else\n question = ARGV.join(' ')\n end\n\n # open browser\n browser = Watir::Browser.new:chrome\n\n # equivalence type the address of searching engine\n browser.goto 'google.com'\n\n # equivalence finding the search bar\n search_bar = browser.text_field(class:'gsfi')\n\n # equivalence tying the word\n search_bar.set(question)\n\n # pressing the searching button\n search_bar.send_keys(:enter)\n browser.button(type:\"submit\").click\nend", "def search\n unless params[:query].blank?\n @listings = custom_search(params[:query])\n #print \"\\n\\n\\n***203 #{@listings}***\\n\\n\\n\"\n @header_type = \"Search for \\\"\" + params[:query] + \"\\\"\"\n \n #will render search.rhtml by default\n else\n browse\n end\n end", "def open()\n \n #note we would want to check for the browser bing open already\n #so we don't annoy people\n \n event(\"Pre\")\n require 'launchy'\n Launchy.open(\"http://local.general.dev/info.php\") #note this should be from setting file\n event(\"Post\")\n end", "def open\n @title = action_synonym.titleize\n do_search_kases(@kases)\n render :template => 'kases/index' unless request.xhr?\n end", "def dynamic_search\n # require 'selenium-webdriver'\n #\n # options = Selenium::WebDriver::Chrome::Options.new(args: ['headless'])\n # driver = Selenium::WebDriver.for(:chrome, options: options)\n # driver.get('http://stackoverflow.com/')\n # puts driver.title\n # driver.quit\n end", "def open()\n \n #note we would want to check for the browser being open already\n #so we don't annoy people\n \n event(\"Pre\")\n require 'launchy'\n Launchy.open(\"http://store.mage.dev/admin\") #note this should be from setting file\n event(\"Post\")\n end", "def open_search\n @open_search ||= OpenSearch.new(@doc)\n end", "def open_search\n @open_search ||= OpenSearch.new(@doc)\n end", "def search_query_window\n app.search_query_window\n end", "def open_in_browser\n selection = @list_view.selection\n if iter = selection.selected\n selected_category = iter.parent[0]\n task_index = iter[3]\n url = todo_data.get_trac_url(task_index)\n Launchy.open(url)\n end\n end", "def start_browser(url, browser = 'firefox')\n self.open_browser browser\n @browser.goto url\n return @browser\n end", "def browser_open_linux(url)\n system(\"xdg-open\", url)\n end", "def open_research(name)\n name_link(name).click\n sleep 1\n self.wait_for_ajax\n self.execute_script(\"$('#joinrequestbuttons_widget').css({display: 'block'})\")\n ResearchIntro.new @browser\n end", "def xbrowse\n _params = params.dup\n return browse(_params, false)\n end", "def go_to(url)\n @browser.goto(url)\n end", "def open_research(name)\n name_link(name).click\n sleep 1\n wait_for_ajax\n self.execute_script(\"$('#joinrequestbuttons_widget').css({display: 'block'})\")\n ResearchIntro.new @browser\n end", "def perform\n\tinstruct_and_abort_if_user_gave_no_input\n\tlaunch_google_search\nend", "def go_to_browse\n redirect_to \"/browse/search\"\n end", "def go_to_url (url)\n\t\t@browser.goto (url)\n\tend", "def submit_search\n click SEARCH_SUBMIT_BUTTON\n end", "def open_page(name)\n name_link(name).click\n self.wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end", "def open\r\n visit \"/\"\r\n end", "def open_page(name)\n name_link(name).click \n wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end", "def open_link(head)\n if head == \"Search\"\n show_search\n elsif @sections.has_key? head\n open_section(head)\n elsif @methods.has_key? head\n open_methods(head)\n elsif @mindex.has_key? head\n head, sub = @mindex[head]\n open_methods(head, nil, sub)\n elsif head =~ /^http:\\/\\//\n debug head\n visit head\n end\n end", "def open(url)\n driver.get(url)\n end", "def open_home_page\n selenium.open(context.browser_url)\n wait_for_page_to_load\n end", "def open_in_browser?(job)\n puts \"\\nURL: #{job.full_url}\"\n # print \"Open job page in browser?(yes/no): \".blue\n # response = gets.chomp.downcase\n\n response = @prompt.yes?(\"Open job page in browser?\")\n\n if response == \"y\" || response == \"yes\"\n system(\"xdg-open #{job.full_url}\")\n end\n end", "def go_to(url)\n @browser.navigate.to url\n end", "def get(search_url)\n @mechanize.get(search_url)\n end", "def search_google\n options = Selenium::WebDriver::Chrome::Options.new(args: ['-headless'])\n driver = Selenium::WebDriver.for(:chrome, options: options)\n driver.get \"https://www.google.com/search?q=#{@keyword}\"\n\n driver\n end", "def focus_onto_search_input\n click NAVBAR_SEARCH_INPUT_LOCATOR\n end", "def search_for_example\n visit('/locations?keyword=alpha%20app')\n end", "def browse(params={}, &proc)\n self.browser(params) {|b| b.each(params, &proc)}\n end", "def open(browser, url=\"\")\n case browser\n when 'chrome'\n `open -a '/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome' #{url}`\n when 'firefox'\n `open -a 'Firefox' #{url}`\n when 'safari'\n `open -a 'Safari' #{url}`\n end\nend", "def fetch_via_mechanize(search)\n\t\tagent = Mechanize.new\n\t\tpage = agent.get(GOOGLE_SEARCH_URL)\n\t\tsearch_form = page.form_with(:name => \"f\")\n\t\tsearch_form.field_with(:name => \"q\").value = search \n\t\tagent.submit(search_form)\n\tend", "def explore\n get('explore').body\n end", "def open_browser(base_url, options = {})\n default_options = {:resynchronize => false, :firefox => false } \n options = default_options.merge(options)\n options[:firefox] ||= (ENV['LOADWISE_PREVIEW'] || $LOADWISE_PREVIEW)\n RWebSpec::WebBrowser.new(base_url, nil, options)\n end", "def visit\n @browser.goto(URL)\n end", "def search(keyword)\n $logger.info(\"HomePage: search for #{keyword}\")\n search_field.send_keys keyword\n search_field.submit\n FreelancerSearchResultsPage.new(@driver, $logger)\n end", "def load_page(uri) # searchText, type\n Nokogiri::HTML(Net::HTTP.get(URI(uri)))\n end", "def browse_page(search)\n\t\tresponse = fetch_via_mechanize(search)\n\t\trequest_successful(response) ? parse_page(response) : false\n\tend", "def open_browser (browser)\n\t\tloop do\n\t\t print \"Input browser (IE or FF or Chrome): \"\n\t\t browser = gets.chomp\n\n\t\t if browser.empty?\n\t\t\tputs \"No input.\"\n\t\t elsif (browser == 'IE') or (browser == 'FF') or (browser == 'Chrome')\n\t\t\tbreak\n\t\t else\n\t\t\tputs \"Invalid input. Input IE or FF or Chrome as indicated.\"\n\t\t end\n\t\tend\n\n\t\tcase \n\t\t\twhen browser == 'IE'\n\t\t\t\tself.open_browser_ie\n\t\t\twhen browser == 'FF'\n\t\t\t\tself.open_browser_ff\n\t\t\telse browser == 'Chrome'\n\t\t\t\tself.open_browser_chrome\n\t\tend\n\tend", "def search query\n # Create headless browser and navigate to https://rubygems.org\n options = Selenium::WebDriver::Chrome::Options.new\n options.add_argument('--headless')\n options.add_argument('--no-sandbox')\n browser = Selenium::WebDriver.for :chrome, options: options\n browser.navigate.to \"https://rubygems.org\"\n\n # Get the search form\n form = browser.find_element css: 'form[action=\"/search\"]'\n\n # Search the query input and set it's value\n query_field = form.find_element name: 'query'\n browser.execute_script \"return arguments[0].value = '#{query}'\", query_field\n\n # Submit the form\n form.submit\n\n # Extract results from HTML and return\n browser.page_source.scan /gems__gem__name[^\\>]+\\>\\s+(.+?)\\s+\\</i\nend", "def browser_open_darwin(url)\n system(\"open\", \"-a\", \"chrome\", url)\n end", "def open_browser_ff\n\t\trequire 'watir-webdriver'\n\t\t@browser = Watir::Browser.new :ff\n\tend", "def search\r\n\t\t\t$browser.text_field(:id => 'sb_form_q')\r\n\t\tend", "def goto_url(url)\n @web_browser.goto_url url\n end", "def go_to(url)\n driver.get url\n end", "def crawler_page\n open(crawler_url)\n end", "def goto_url(url)\r\n @web_browser.goto_url url\r\n end", "def focus_file_search\n @search_window.focus_file_search if @search_window\n end", "def open_url(url)\n if RbConfig::CONFIG['host_os'] =~ /darwin/\n system %(open \"#{url}\")\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system %(xdg-open \"#{url}\")\n else\n puts 'Not Supported OS!'.red\n end\n end", "def search_web_page(base_url,company)\n @agent.get(\"#{base_url}#{CGI::escape(company)}\")\n end", "def browser\n if @browser.nil?\n # puts '[BrowserOperator] Create Internet Explorer'\n @browser = Watir::Browser.new\n @browser.activate\n end\n @browser\n end", "def click_view_website\n view_website_link.click\n end", "def open_compare_page\n cli.copy_to_clipboard compare_url\n cli.open compare_url\n end", "def goto_base_url\n @browser.goto base_url\n end", "def google_search(word)\r\n\r\n # self.search_box.set \"#{word}\"\r\n # self.button.click\r\n @browser.div(:class => 'a4bIc').input(:xpath => '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div/div[2]/input').send_keys(\"#{word}\")\r\n @browser.div(:class => 'a4bIc').input(:xpath => '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div/div[2]/input').send_keys(:tab)\r\n @browser.div(:class => 'FPdoLc tfB0Bf').click\r\n # @browser.div(:class => 'badge-link__btn-wrap').when_present(15).visible?\r\n\r\n\r\n end", "def open\n require \"launchy\"\n\n Launchy.open(BASE_URL)\n end", "def searchGeoShellDocs( nick, uhost, handle, chan, arg )\n searchSite( nick, uhost, handle, chan, arg, \"docs.geoshell.com\" )\n end", "def use_current_browser(how = :title, what = /.*/)\n @web_browser = WebBrowser.attach_browser(how, what)\n end", "def go_to_page(url)\n Logbook.step(\"Open start page #{url} :)\")\n @browser.get url\n sleep 2\n\n @browser\n end", "def open_viewer(urn,access_token)\n path = File.expand_path(File.dirname(__FILE__))\n url = \"file://#{path}/viewer.html?token=#{access_token}&urn=#{urn}\"\n text_to_print_in_color = \"Please open the following url in your favorite browser:\\n#{url}\"\n puts(\"\\e[7m#{text_to_print_in_color}\\e[27m\")\n\nend", "def goto_url(url)\r\n @browser.navigate.to url\r\n end", "def goto(url)\r\n #set_defaults()\r\n get_window_number()\r\n set_browser_document()\r\n # Load the given url.\r\n $jssh_socket.send(\"#{BROWSER_VAR}.loadURI(\\\"#{url}\\\");\\n\" , 0)\r\n read_socket()\r\n\r\n wait()\r\n end", "def show_other_sites\n frm.link(:text=>\"Show other sites\").click\n end", "def submit_search\n @page.click_button('searchButton')\n end", "def open_browser_chrome\n\t\trequire 'watir-webdriver'\n\t\t@browser = Watir::Browser.new :chrome\n\tend", "def open_random\n Defcli.open_in_browser random_url(:api => false)\n end", "def open_browser_ie \n\t\trequire 'watir-webdriver'\n\t\t@browser = Watir::Browser.new :ie\n\tend", "def search(terms)\n agent = Mechanize.new\n agent.get 'https://eztv.ch'\n search_form = agent.page.form('search')\n search_form.SearchString1 = terms\n search_form.submit\n parse_html(agent.page)\n end", "def open_url(url)\n @ole.OpenURL(url)\n end", "def navigate_to(url)\n self.visit url\n end", "def open_browser\n `open #{@report_file.path}`\n end", "def index\n\t\trequire 'mechanize'\n\t\trequire 'open-uri'\n\t\trequire 'nokogiri'\n\t\trequire 'selenium-webdriver'\n\t\trequire 'pp'\n\t\t#driver = Selenium::WebDriver.for :firefox # ブラウザ起動\n\t\tua = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36\"\n\t\tcaps = Selenium::WebDriver::Remote::Capabilities.chrome(\"chromeOptions\" => {binary: '/usr/bin/google-chrome-beta', args: [\"--headless\", \"--disable-gpu\", \"--user-agent=#{ua}\", \"window-size=1280x800\"]})\n\t\tdriver = Selenium::WebDriver.for :chrome, desired_capabilities: caps\n\t\tdriver.navigate.to 'https://rakuma.rakuten.co.jp/home/' # URLを開く\n\t\t#driver.switch_to.frame(1) # 1つめの子フレームに移動\n\t\t#driver.switch_to.frame(\"frameid\") # フレームのnameを指定して移動\n\t\t#\n\t\tputs element.text\n\t\t#agent = Mechanize.new\n\t\t#page = agent.get(\"https://rakuma.rakuten.co.jp/search/?keyword=mac\")\n\t\t#p page\n\t\t#nokogiri--------------------------------------\n\t\t#require 'open-uri'\n\t\t#require 'nokogiri'\n\t\t#url = 'https://rakuma.rakuten.co.jp/home/'\n\t\t#charset = nil\n\t\t#html = open(url) do |f|\n\t\t#\t charset = f.charset # 文字種別を取得\n\t\t#\t\t f.read # htmlを読み込んで変数htmlに渡す\n\t\t#end\n\t\t# htmlをパース(解析)してオブジェクトを生成\n\t\t#doc = Nokogiri::HTML.parse(html, nil, charset)\n\t\t# タイトルを表示\n\t\t#puts \"----------------------\"\n\t\t#p doc.title\n\t\t##------------------------------------------------\n @tops = Top.all\n end" ]
[ "0.79448956", "0.75041556", "0.71196944", "0.711244", "0.6867619", "0.6844488", "0.6661564", "0.66269666", "0.649552", "0.6479327", "0.646072", "0.6459731", "0.64449185", "0.6431792", "0.6350298", "0.62809044", "0.6280005", "0.626477", "0.62639666", "0.62571853", "0.621979", "0.6201095", "0.61849475", "0.61849475", "0.61711967", "0.6142192", "0.6117025", "0.60852253", "0.6082221", "0.60531634", "0.6050798", "0.6047572", "0.6047572", "0.5989498", "0.5969239", "0.5958882", "0.5955411", "0.594918", "0.5937707", "0.59174824", "0.59153706", "0.5894815", "0.5892963", "0.5890601", "0.5880207", "0.58555555", "0.583873", "0.5830206", "0.581757", "0.58164114", "0.57938474", "0.5793384", "0.5772234", "0.57548773", "0.57518834", "0.5721483", "0.57171905", "0.5705425", "0.57012105", "0.5699429", "0.569787", "0.5687762", "0.5685951", "0.5682379", "0.5674325", "0.5667935", "0.5660336", "0.5654425", "0.56514645", "0.56490415", "0.5640845", "0.5639899", "0.56373703", "0.5635309", "0.56351274", "0.5610061", "0.5602192", "0.558679", "0.5583109", "0.5571977", "0.5557942", "0.55539024", "0.5548462", "0.5548105", "0.5542422", "0.5541883", "0.5538017", "0.5520799", "0.55196697", "0.5511739", "0.5509504", "0.5507634", "0.5502473", "0.5487519", "0.54829556", "0.54806703", "0.5479439", "0.546161", "0.5460863", "0.54561144" ]
0.54774517
97
This makes it easier to spit debugging output to the console. I know I should probably raise exceptions and rescue them, but this is easier. Sue me. Lifted it from jCaster by Jahmaican.
def debug(message) puts "#{Time.now.strftime("%H:%M:%S.%L")} - \t#{message}" if DEBUG end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debug(s) if $DEBUG then $stderr.print(\"#{s}\\n\") end end", "def debug(text)\n\t\t\tputs text\n\t\t\tnil\n\t\tend", "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", "def debug()\n # =========================================\n # DEBUG CODE FOR STEPPING\n # =========================================\n puts \"Curr char is: #{@curr_char}\"\n puts \"PC direction is: #{@curr_direction}\"\n puts \"Stack contents are: #{@stack}\"\n puts \"Skip is: #{@skip}\"\n puts \"Ascii_Mode is: #{@ascii_mode}\"\n prompt()\n STDIN.gets\n\n # =========================================\n # END DEBUG CODE\n # =========================================\n\n end", "def debug(str)\n $stderr.puts(str) if @debug\n end", "def debug(msg)\n #puts msg\n end", "def debug_msg( str )\n puts str if @debug == true\n end", "def debug(s)\n\t#puts \"DEBUG: #{s}\"\nend", "def output_debug(string)\n if Command.ui\n Command.ui.debug string\n else\n $stderr.puts \"DEBUG: #{string}\"\n end\n end", "def debug1(text) debug text, 1 end", "def puts(*strs); $stdout.puts(*strs) if ENV['DEBUG'] end", "def debug(message)\n puts message if debug?\n end", "def debug(message)\n $stderr.puts(message) if @options[:debug]\nend", "def debug(object)\n puts \"<pre>\"\n puts object.pretty_inspect.gsub('<', '&lt;').gsub('>', '&gt;')\n puts \"</pre>\"\nend", "def debug_print(thing, title = nil, print_path = false)\n return if !%w[test development].include?(Rails.env)\n\n divider = \"#{\"-\" * 80}\"\n\n puts divider\n if title.present?\n puts %Q(#{title} (#{thing.class.name}))\n else\n puts thing.class.name\n end\n pp thing\n\n if print_path\n puts caller.first[0..caller.first.index(\":in\") - 1]\n end\n\n puts divider\n\n puts\n end", "def debug; end", "def debug; end", "def debug; end", "def debug; end", "def debug(depth = 0)\n if debug?\n debug_info = yield\n debug_info = debug_info.inspect unless debug_info.is_a?(String)\n debug_info = debug_info.split(\"\\n\").map { |s| \":#{depth.to_s.rjust 4}: #{s}\" }\n output.puts debug_info\n end\n end", "def debug!\n @client.debug_dev = STDOUT\n end", "def dprint(s)\n print s if $DEBUG\nend", "def debug(*args); puts(*args) if $test; end", "def debug(info)\n puts(info) if @debug\n end", "def print_debug(msg)\n puts msg if (@debug) \n STDOUT.flush\n end", "def debug(msg)\n STDERR.puts msg if @debug\n end", "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend", "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend", "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend", "def debug?; end", "def debug?; end", "def debug_msg msg\n puts msg if @options[:debug]\n end", "def debug(*info)\n puts(info) if debug_mode?\n end", "def debug_print(output, debug)\n\tif debug\n\t\tputs \"[*] #{output}\".red\n\tend\nend", "def debug(*args); end", "def debug(*args); end", "def debug(*args); end", "def debug_print(str)\n return unless Rails.env.development? && @debug\n str = str.inspect unless str.instance_of? String\n @debugscr.move(@cur_debug_line, 0)\n @debugscr.clrtoeol\n @debugscr.mvaddstr(@cur_debug_line, 0, str)\n @cur_debug_line = (@cur_debug_line + 1) % @lines\n @debugscr.refresh\n end", "def debug(msg)\n STDERR.puts msg if options.key? :debug\n end", "def debug_print(returnedData, debug=\"false\")\n if debug == \"true\" then\n puts \"\\r\\n[DEBUG]\\r\\n\"\n pp(returnedData) \n end\nend", "def build_debug_msg\n message = []\n stds = { @stdout => \"Standard output: \", @stderr => \"Standard error: \" }\n stds.each do |std, name|\n message << tabify(name) << tabify(std) unless std.blank?\n end\n message.join(\"\\n\")\n # Return nil if empty\n end", "def puts_debug(msg)\r\n if (self.debug) \r\n puts msg\r\n end # end debug\r\n end", "def puts_debug(msg)\r\n if (self.debug) \r\n puts msg\r\n end # end debug\r\n end", "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", "def debug(message)\n $stdout.puts \"D #{message}\" if @debug\n end", "def debug(msg, &block)\n result = yield\n puts \"-- #{msg} #{'-' * (74 - msg.length)}\" if $debug\n result\n end", "def debug(message)\n ostream.puts message if $DEBUG\n end", "def dprint(str)\n if ANSIBLE_DEBUG\n print str\n end\nend", "def log(s)\n puts \"[Debug]: #{s}\"\nend", "def log(s)\n puts \"[Debug]: #{s}\"\nend", "def debug(text)\n puts \"#{text}\".foreground(:yellow)\n end", "def debug(stuff)\n puts \"DEBUG: #{stuff}\"\nend", "def debug string\n puts string if $DEBUG\nend", "def cmd_debug_error(ex)\n if $verbose\n $stderr.puts \"error: #{$!.class}: #{$!.to_s}\"\n $!.backtrace.each {|b|\n $stderr.puts \" #{b}\"\n }\n $stderr.puts \"\"\n end\n end", "def cmd_debug_error(ex)\n if $verbose\n $stderr.puts \"error: #{$!.class}: #{$!.to_s}\"\n $!.backtrace.each {|b|\n $stderr.puts \" #{b}\"\n }\n $stderr.puts \"\"\n end\n end", "def debug(msg)\n return unless Fizzy::CFG.debug\n caller_info = caller\n .map { |c| c[/`.*'/][1..-2].split(\" \").first }\n .uniq[0..2]\n .join(\" → \")\n tell \"{m{⚫}}#{✏ caller_info, %w({b{<}} {b{>}})}{w{: #{msg}}}\"\n end", "def print_debug\n\t\tprint_divider\n\t\tputs \"Root Node: \\n\" + root.to_s\n\t\tprint_divider\n\t\t\n\t\tputs \"Current Node: \\n\" + @current_node.to_s\n\t\tprint_divider\n\t\t\n\t\tputs \"Attributes: \\n\" + attributes.to_s\n\t\tprint_divider\n\t\t\n\t\tputs \"Children: \\n\" + children.to_xml\n\t\tprint_divider\n\tend", "def debug(message)\n stdout.print(\"#{message}\\n\") if ENV['DEBUG']\n end", "def debug(msg) log(DEBUG, \"DEBUG \" << format(msg) << \", \" << caller[0][caller[0].rindex(\"/\").nil? ? 0 : caller[0].rindex(\"/\") + 1 .. -1]); end", "def debug_msg(msg)\n if(@options[:debug])\n @log.puts(msg)\n puts msg\n end\nend", "def print_debug_info\n puts \"Programmer #{name}:\"\n puts \"\\tSpeed: #{speed}\"\n puts \"\\tDaily wage: #{daily_wage}\"\n puts \"\\tProject: #{project_name}\"\n end", "def debug(*args)\n $stderr.puts(sprintf(*args)) if @debug\n end", "def debug_repl\n $stderr.puts(\"Debug REPL active. Type :eof to abort\")\n while true\n line = $stdin.readline\n break if line.strip == \":eof\"\n begin\n puts eval(line).inspect\n rescue\n puts $!\n end\n end\nend", "def debug(msg)\n end", "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", "def debug(msg) log(7, msg); end", "def debug_str(inspect_method = :inspect)\n \"Current Date: #{self.input_date.readable}\\nCurrent Time: #{self.input_time.readable}\\n\\nQuery: #{self.query}\\nStandardized Query: #{self.nlp_query}\\nQuery changed in: #{self.nlp_query.changed_in.inspect}\\n\\nConstructs Found: #{s = \"\\n\"; self.construct_finder.constructs.each{|x| s << x.send(inspect_method) + \"\\n\"}; s}\\n\\n@construct_interpreter: #{self.construct_interpreter.send(inspect_method)}\"\n end", "def set_debug_output(arg); end", "def do_debug\n # debugging = true\n debugging = false\n puts yield if debugging\n end", "def dputs str=\"\"\n\t\tputs str if debug?\n\tend", "def debug(msg)\n puts \"[watchr debug] #{msg}\" if options.debug\n end", "def puts_debug(*print_string)\n debug_code = true\n puts *print_string if debug_code\n end", "def debug(msg, thread = nil)\n return nil unless $opt[:debug]\n function = (thread ? \"#{thread}.\" : '') + \\\n (caller[0][/`.*'/] ? caller[0][/`.*'/][1..-2].split(' ').last : 'core');\n puts \"#{function}#{(function.split(/\\.([^.]*)$/).last == 'core' ? '' : '()')}: #{msg}\".white\nend", "def write_debug( f )\n f.puts( $debug_buf )\n $debug_buf = \"\"\nend", "def dmsg(msg)\n if $DEBUG\n case msg\n when String\n puts msg\n else\n puts msg.inspect\n end\n end\n end", "def dmsg(msg)\n if $DEBUG\n case msg\n when String\n puts msg\n else\n puts msg.inspect\n end\n end\n end", "def dmsg(msg)\n if $DEBUG\n case msg\n when String\n puts msg\n else\n puts msg.inspect\n end\n end\n end", "def console\n puts 'Entering debug console.'\n if RUBY_VERSION == '2.0.0'\n require 'byebug'\n byebug\n else\n require 'ruby-debug'\n Debugger.start\n debugger\n end\n puts 'Leaving debug console.'\n end", "def debug?\n puts \"Debug mode is #{@shell_debug ? 'ON' : 'OFF'}\\n\\n\"\n nil\nend", "def debug(current_resolver_depth)\n # debug info will be returned if you call yield here, but it seems to be\n # broken in current Molinillo\n nil\n end", "def say_debug(message)\n puts yellow(message) if self.debug\n end", "def debug_print_wrapper(title = nil, print_path = true, &block)\n return if !%w[test development].include?(Rails.env)\n\n start_divider = \"#{\">\" * 80}\"\n end_divider = \"#{\"<\" * 80}\"\n\n\n if title.present?\n puts \" #{title} \".upcase.center(80, start_divider[0])\n else\n puts start_divider\n end\n\n block.call\n\n if print_path\n puts \" Wrapped from block call at: \".center(80, \"-\")\n puts caller.first[0..caller.first.index(\":in\") - 1]\n end\n\n puts end_divider\n puts\n end", "def debug (what)\n ap what\n exit 2\nend", "def output_debug(params)\n Rails.logger.debug(\"\\n\\n\\n\\n------------------------------------------------\\n\")\n Rails.logger.debug(params.inspect)\n Rails.logger.debug(\"\\n------------------------------------------------\\n\\n\\n\\n\")\n end", "def dumpDebugState\n\t\tif(@hasMore)\n\t\t\tputs 'Has more solutions\\n'\n\t\telse\n\t\t\tputs 'No more solutions\\n'\n\t\tend\n\n\t\tputs \"availProofs #{@availProofs}\\n\"\n\t\tputs \"pengine #{@p.getID}\"\n\tend", "def debug_puts(puts_text)\n if Debug_Mode == true\n puts \"#{puts_text}\"\n end\n end", "def debug(str, ret = false)\r\n puts str if @debug\r\n return ret\r\n end", "def debug_output=(arg); end", "def pdebug(string, opcode)\n printf(\"pc: %4x\\t#{string}\\t\\topcode: %4x\\n\",@pc, opcode) \n printf(\"####### @ir = 0x0%4x #########\\n\", @ir)\nend", "def debug_msg(msg=\"\")\n if(@config.debug)\n puts(\"Debug: #{msg}\")\n @file.puts(\"Debug: #{msg}\")\n end\n end", "def log_to_console\n location = @location[1..-1] # remove file_descriptor\n details = @details.first(2) # remove additional details\n [\n ' ',\n location.join(', ').ljust(33),\n details.join(': ')\n ].join\n end", "def debug_message(string)\n caller_method = caller_locations(1..1).first.label\n $stdout.puts(Time.now.strftime('%Y-%m-%d %H:%M:%S: ').concat(\"#{caller_method}: \").concat(string))\nend", "def testCommandLineDebugShort\n # Make sure we don't break debug\n lDebugMode = debug_activated?\n begin\n executeSlave( [ '-d' ] )\n rescue Exception\n activate_log_debug(lDebugMode)\n raise\n end\n activate_log_debug(lDebugMode)\n end", "def debug(options = T.unsafe(nil)); end", "def debug msg\n if debug?\n return debug_writer.write msg if debug_writer.respond_to? :write\n return debug_writer.call(msg) if debug_writer.respond_to? :call\n raise \"No debug_writer set!\"\n end\n end", "def debug_msg( *msg )\n\t\treturn unless $DEBUG\n\t\t$stderr.puts( *msg )\n\tend", "def debug_msg( *msg )\n\t\treturn unless $DEBUG\n\t\t$stderr.puts( *msg )\n\tend", "def debugMsg( msg )\n\treturn unless $DEBUG\n\t$stderr.print \"#{msg}\\n\"\nend", "def print_debug_info\n puts \"Company #{name}, day #{days}:\"\n puts \"\\tState: #{state}\"\n puts \"\\tCurrent cash flow: #{budget}\"\n puts \"\\tDaily expenses: #{daily_expenses}\"\n puts \"\\tCapacity: #{capacity}\"\n puts \"\\tProgrammers: #{programmers.collect { |programmer| programmer.name + \" (\" + programmer.project_name + \")\" }.join(\", \")}\"\n puts \"\\tPROJECTS WAITING: #{projects_waiting.collect { |project| project.name }.join(\", \")}\"\n puts \"\\tPROJECTS CURRENT:\"\n projects_current.each { |project| project.print_debug_info }\n puts \"\\tPROJECTS DONE:\"\n projects_done.each { |project| project.print_debug_info }\n end", "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" ]
[ "0.7503434", "0.72581583", "0.714772", "0.7105997", "0.70850897", "0.70751613", "0.70411223", "0.7024826", "0.7006772", "0.69851106", "0.6956015", "0.69428015", "0.6932931", "0.6926794", "0.69198", "0.69165254", "0.69165254", "0.69165254", "0.69165254", "0.69093454", "0.69001585", "0.6873224", "0.68513435", "0.6843738", "0.6835055", "0.6833546", "0.6816079", "0.6816079", "0.6816079", "0.68148774", "0.68148774", "0.68143576", "0.6802502", "0.67398846", "0.67366135", "0.67366135", "0.67366135", "0.6727351", "0.6704925", "0.6682366", "0.6680692", "0.6626625", "0.6626625", "0.6626187", "0.6612904", "0.6572052", "0.65661085", "0.6564078", "0.6561358", "0.6561358", "0.6544677", "0.6543739", "0.6542926", "0.6535815", "0.6535815", "0.65342", "0.6525469", "0.6520731", "0.65162367", "0.64772713", "0.6459265", "0.64534783", "0.64480054", "0.6440696", "0.6440374", "0.6433195", "0.6431354", "0.642188", "0.64171374", "0.641573", "0.64032006", "0.63962156", "0.6392244", "0.6386012", "0.63717115", "0.63717115", "0.63717115", "0.63710636", "0.63672006", "0.63584644", "0.63542074", "0.6349868", "0.6317069", "0.6312307", "0.62860775", "0.627724", "0.62680775", "0.6262033", "0.62530786", "0.6251297", "0.62433785", "0.62337816", "0.62295353", "0.6201891", "0.6197912", "0.6197869", "0.6197869", "0.61937153", "0.6186075", "0.6175124" ]
0.699691
9
Theese are clever and Spooner is a clever man. Also handsome I presume.
def image(name) File.expand_path("tex/#{name}", File.dirname(__FILE__)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spice; end", "def slop!; end", "def slop!; end", "def sharp; accidental; end", "def silly_adjective; end", "def anchored; end", "def buzzword; end", "def buzzword; end", "def most_interesting_man_in_the_world; end", "def sittinae_hooey(scrawny_appulsion, termly)\n end", "def king_richard_iii; end", "def singular_siegler; end", "def superweening_adorningly(counterstand_pyrenomycetales)\n end", "def loose_fish_when_bear_takes_it(fish)\n\n end", "def cherty_hottish(define, henchboy, systematically_youthen)\n sprag_squamaceous(demilitarize)\n osiridean_seedily(coopering_frenzelite, columellia)\n end", "def tongue_twister; end", "def complex_super_heroe\n heroes = [\"iron man\", \"hulk\", \"black widow\", \"thor\", \"captain marvel\"]\n\n heroes.first { |hero| hero.match /\\w\\s\\w/ }\nend", "def sluggish_octopus(the_sea)\n the_sea.each_with_index do |fish1, idx|\n longest = true\n\n the_sea.each_with_index do |fish2, idx2|\n next if idx == idx2\n longest = false if fish1.length > fish2.length\n end\n\n return fish1 if longest\n end\nend", "def jack_handey; end", "def hornlike(adet_mortification, hyperconscious)\n shadowiness_priceable(disinterment, pericellular_homogenization)\n counterbreastwork_knickerbockered()\n subspecialty_universalian(whereon, ciliated_papaverous, eurhodine)\n end", "def spoonerize(words)\n #...aaaaand SPOONERIZE!\nend", "def skip_the_sugar(drinks)\n\ttoo_much = ['cola', 'fanta']\n\tdrinks.select! { |n| !too_much.include? n}\n\tdrinks\nend", "def short\n # this are short words\n assert PorterStemmer::Porter2.short?(\"bed\")\n assert PorterStemmer::Porter2.short?(\"shed\")\n assert PorterStemmer::Porter2.short?(\"shred\")\n\n # this are not short words\n assert !PorterStemmer::Porter2.short?(\"bead\")\n assert !PorterStemmer::Porter2.short?(\"embed\")\n assert !PorterStemmer::Porter2.short?(\"beds\")\n end", "def sluggish_octopus\n\n big_fish = \"\"\n\n (0..FISH.length-2).each do |idx1|\n\n found_biggest = true\n (idx1+1..FISH.length-1).each do |idx2|\n if FISH[idx2].length > FISH[idx1].length\n found_biggest = false\n big_fish = FISH[idx2]\n end\n\n return big_fish if found_biggest\n end\n\n end\n\nend", "def dangerous_snake_head(bram, other_snake)\n other_snake.length >= bram.length ? other_snake.possible_heads : []\nend", "def handle_typos_1(doors)\n\tputs \"Man you should make a proper decision or learn how to type!\".upcase\n\tputs \"Try again\"\n\tputs \"> \"\n\tdoor_choose(doors)\nend", "def speak_to_grandma(thing_said)\n return thing_said==thing_said.upcase ? \"NO, NOT SINCE 1938!\" : \"HUH?! SPEAK UP, SONNY!\"\nend", "def romeo_and_juliet; end", "def make_it_swim(duck)\n duck.swim\nend", "def ninety_nine_bottles_of_beer\nend", "def ninety_nine_bottles_of_beer\nend", "def ninety_nine_bottles_of_beer\nend", "def sluggish_octopus(fish)\n longest_fish = fish[0]\n fish.each.with_index do |fish1, i1|\n fish.each.with_index do |fish2, i2|\n next if fish1.length < fish2.length\n longest_fish = fish1 if fish1.length > longest_fish.length\n end\n end\n longest_fish\nend", "def mercedes\n woo(\"It turns out to be a self-driving car and drops you off at home.\")\nend", "def treasure\n [\"ring\", \"necklace\", \"dagger\", \"amulet\", \"ruby\", \"sapphire\", \"piece of jade\", \"human skull\", \"tarask skull\"].sample\nend", "def mermithization_unstrictured_hersed()\n technonomy(wrangler)\n sock_reassociate_supratemporal(jacket_gloomingly, metrometer, urtica_siegecraft)\n end", "def troop; end", "def sluggish_octopus(fish)\n longest_fish = fish.first\n\n fish.each do |current_fish|\n\n fish.each do |other_fish|\n if current_fish.length > other_fish.length\n longest_fish = current_fish\n else\n longest_fish = other_fish\n end\n end\n end\n\n longest_fish\nend", "def stylish_chef\n best_hairstyle = \"Guy Fieri\"\n return \"Martha Stewart\"\n \"Guy Fieri\"\nend", "def awesomesauce_infusion(strings)\n i = 0\n infused_strings = []\n strings.length.times do\n infused_strings << strings[i]\n if i < strings.length - 1\n infused_strings << \"awesomesauce\"\n end\n i += 1\n end\n return infused_strings\nend", "def grill_cheese(bread, cheese, cheese_num, melt)\n # If cheese_num is greater than 3 cheese slices you want it extra cheesy.\n if cheese_num > 3\n # Patty melt instead of grilled cheese sando.\n if melt == true\n puts \"We got one extra cheesy #{cheese} patty melt on #{bread}, coming right up!\"\n else\n puts \"We got one extra cheesy #{cheese} grilled cheese on #{bread}, coming right up!\"\n end\n # For less cheesey sandwich\n else\n # Patty melt instead of grilled cheese sando.\n if melt == true\n puts \"We got one cheesy #{cheese} patty melt on #{bread}, coming right up!\"\n else\n puts \"We got one cheesy #{cheese} grilled cheese on #{bread}, coming right up!\"\n end\n end\nend", "def spouse; end", "def good_pokemon # :not_very_effective AND :no_effect_on\n good_pokemon = []\n @type.not_very_effective.each {|pokemon| good_pokemon << pokemon}\n @type.no_effect_on.each {|pokemon| good_pokemon << pokemon if !good_pokemon.include?(pokemon)}\n \n if good_pokemon.count > 0\n puts \"\"\n puts \"USE POKEMON OF THESE TYPE(S)\"\n good_pokemon.each_with_index {|pokemon, index| puts \"#{index +1}. #{pokemon.name}\"}\n end\n end", "def powered_by\n random_and_sane [\n \"Diet Pepsi\",\n \"the funny voice he uses to talk to dogs\",\n \"the love of his life, <a href=\\\"http://thebluesunshine.com/\\\">Lizza</a>\",\n \"hoagies from <a href=\\\"https://foursquare.com/v/sarcones-deli/4a9b035ef964a520fc3320e3\\\">Sarcone's Deli</a>\",\n \"his sweet tooth for #{random_and_sane ['Nerds rope','Mike and Ikes','Peppermint Patties']}\",\n \"any and all potatoes\",\n \"rays of sunshine trickling through his backyard fig tree\"\n ]\n end", "def purr (owner)\n puts \"The cat purrs when #{owner} gives her a loving pat!\"\n end", "def extracosmic_expansive_onstand(lymphatolysis_fissure, french, whauve_diapophysial)\n unsuckled_catsup(apterygota, unfightable_phoneticist)\n end", "def clever_octopus(fishes)\r\n biggest_fish = fishes.first\r\n \r\n fishes.each do |fish|\r\n if fish.length > biggest_fish.length\r\n biggest_fish = fish\r\n end\r\n end\r\n \r\n biggest_fish\r\n \r\n end", "def find_the_cheese(snacks)\n cheeses = %w(gouda cheddar camembert)\n snacks.find do |maybe_cheese|\n cheeses.include?(maybe_cheese)\n end\nend", "def find_the_cheese(potentially_cheesy_items)\n cheeses = %w(gouda cheddar camembert)\n\n potentially_cheesy_items.find do |maybe_cheese|\n cheeses.include?(maybe_cheese)\n end\nend", "def sluggish_octopus(fishes)\n fishes.length.times do |i|\n longest_fish = fishes[i]\n\n fishes.length.times do |j|\n next if i == j\n longest_fish = nil if fishes[j].length > fishes[i].length\n end\n\n return longest_fish if longest_fish\n end\nend", "def sell_pets #Owner can sell all its pets, which make them nervous\n # fido = Dog.new(\"Fido\")\n # tabby = Cat.new(\"Tabby\")\n # nemo = Fish.new(\"Nemo\")\n # [fido, tabby, nemo].each {|o| o.mood = \"happy\" }\n # owner.pets = {\n # :dogs => [fido, Dog.new(\"Daisy\")],\n # :fishes => [nemo],\n # :cats => [Cat.new(\"Mittens\"), tabby]\n # }\n # owner.sell_pets\n # owner.pets.each {|type, pets| expect(pets.empty?).to eq(true) }\n # [fido, tabby, nemo].each { |o| expect(o.mood).to eq(\"nervous\") }\n pets.each do |type, animals|\n animals.each do |animal|\n animal.mood = \"nervous\"\n end\n animals.clear\n end\n end", "def shoulders_stretch \n \"Raise both shoulders at once up toward the ears. Drop them and repeat 10 times each direction.\"\nend", "def food_and_drink; end", "def unusual_sport; end", "def weird_stuff\n puts \"Mussolini apparently liked to eat raw garlic, although he suffered\n from severe stomach ulcers. He also had many Jewish friends, and didn't like\n Hitler very much. Yeah right!\"\n #sleep(20)\n puts \"Idi Amin gave himself the title His Excellency, President for Life Field\n Marshall Al Hadj Doctor Idi Amin Dada, VC, DSO, MC, Lord of all the Beasts\n of the Earth and Fishes of the Sea and Conqueror of the British Empire in\n Africa in General and Uganda in particular.\"\n #sleep(20)\n puts \"Adolf Hitler thought of himself as a pacifist. He was a vegetarian.\n It is said that he injured his groin during World War I, and his left\n testicle was removed. Hitler enjoyed watching Charley Chaplin, who made fun\n of Hitler.\"\n #sleep(20)\n puts \"Stalin was also the man behind the most wicked practical joke ever\n played. Being a very private man he gave the order that no person should\n enter his bed chambers on pain of death. Later, while in his chambers he\n decided to test whether his guards had listened to this instruction.\n Pretending to scream in pain, he called for the guards stationed outside\n the door. Fearing that their leader was in trouble the guards burst into\n the room. Stalin had them executed for failing to follow his standing orders.\n This little prank soon backfired, however, when Stalin suffered a seizure\n while alone in his bedroom. The guards were too afraid to enter, finding\n him hours later laid in a puddle of stale urine. He died three days later.\"\n #sleep(30)\n puts \"Niyazov loved to rename things. For example, he renamed the month of\n January Turkmenbashi, which means Father of the Turkmen, a name he gave\n himself. He also 'legislated' the renaming of the days of the week to ones\n that translate to 'Young Day', 'Spirituality Day', etc. He even renamed the\n word 'bread', Gurbansoltan, after his own mother. Niyazov outlawed beards on\n men and cosmetics on TV anchors, and prohibited both chewing tobacco and lip-\n syncing on Turkmenistan soil. In a society of smokers, Niyazov recommended\n that people chew on bones, which he argued would strengthen their teeth. He\n authored a book, the Book of the Soul, and ordered students in schools and\n mosques to read and study it, and in the case of mosques, to give it equal\n respect to the Quran (and if not, the mosque would be demolished). To get a\n driver's license, people had to memorize the contents of the book. Finally,\n Niyazov told everyone that he had made a pact with G-d that anyone who read\n his book three times would go to heaven. In 2005, he ordered a copy of his\n book to be sent to outer space.\"\n #sleep(60)\n puts \"Mussolini apparently liked to eat raw garlic, although he suffered\n from severe stomach ulcers. He also had many Jewish friends, and didn't like\n Hitler very much. Yeah right!\"\n #sleep(10)\n puts \"He gave himself the title His Excellency, President for Life Field\n Marshall Al Hadj Doctor Idi Amin Dada, VC, DSO, MC, Lord of all the Beasts\n of the Earth and Fishes of the Sea and Conqueror of the British Empire in\n Africa in General and Uganda in particular.\"\n end", "def sluggish_octopus(fish)\n\n (0...fish.length-1).each do |idx1|\n (idx1+1...fish.length).each do |idx2|\n if fish[idx1].length > fish[idx2].length\n fish[idx1], fish[idx2] = fish[idx2], fish[idx1]\n end\n end\n end\n fish\nend", "def clever_octopus(the_sea)\n longest = the_sea[0]\n\n the_sea.each do |fish|\n if fish.length > longest.length\n longest = fish\n end\n end\n\n longest\nend", "def cracklepop1\n def aux x\n /[A-Z]+/i.match(x.to_s).to_s\n end\n (1..100).map do |i|\n x = i%3==0 ? 'crackle' : i\n i%5==0 ? (aux(x)+'pop') : x\n end\nend", "def take_a_drink\n soda.drink_a_soda\n puts \"You drank your soda!\"\n end", "def solo5(arr)\n\tarr.delete_if {|sup| sup.include?(\" \")} \n\t#p zombie_apocalypse_supplies\nend", "def complex_super_heroe\n heroes = [\"iron man\", \"hulk\", \"black widow\", \"thor\", \"captain marvel\"]\nend", "def sluggish_octopus(fishes)\n fishes.each_with_index do |fish1, idx1|\n longest = true\n\n fishes.each_with_index do |fish2, idx2|\n next if idx1 == idx2\n longest = false if fish2.length > fish1.length\n end\n\n return fish1 if fish1 = longest\n end\n\nend", "def beauty_hidden(honest_beauty, trust_beauty)\n puts honest_beauty\n puts trust_beauty\nend", "def chop!() end", "def chop!() end", "def sluggish_octopus(fishes) \n fishes.each_with_index do |fish1, i1|\n max_length = true\n fishes.each_with_index do |fish2, i2|\n next if i1 == i2\n # puts \"#{fish1} --- #{fish2}\"\n max_length = false if fish1.length < fish2.length\n end\n\n return fish1 if max_length == true\n end\nend", "def remanet(concupiscibleness, torve_resack)\n seeker(bloomery, crumbcloth_lacepod, inspirant_inalterably)\n antispadix_provencalize(galactophthysis, saintlike)\n japheth(auresca, squamatine, vitalist_pheal)\n end", "def best_hand\n raise\n end", "def scientist; end", "def sluggish_octopus(fishes)\r\n biggest_fish = \"\"\r\n\r\n fishes.each_with_index do |fish1, idx1|\r\n fishes.each_with_index do |fish2, idx2|\r\n if idx2 > idx1\r\n if fish2.length > biggest_fish.length\r\n biggest_fish << fish2\r\n end\r\n end\r\n end\r\n end\r\n return biggest_fish\r\nend", "def selective_tweet_shortener(tweet)\n # Checks to see if the tweet is longer than 140 characters\n if tweet.length > 140\n return word_substituter(tweet)\n # If the tweet is 140 characters or less, return the original tweet as is\n else\n return tweet\n end # Checks to see if the tweet is longer than 140 characters\nend", "def silly_talk(str)\n vows = \"aeiou\"\n\n new_talk = str.split(\" \").map do |wrd|\n if vows.include?(wrd[-1].downcase)\n wrd + wrd[-1]\n else\n silly = wrd.split(\"\").map do |char|\n if vows.include?(char)\n char + \"b\" + char\n else\n char\n end\n end\n silly.join(\"\")\n end\n end\n\n new_talk.join(\" \")\nend", "def suivre; end", "def herald; end", "def pour_contents_into_baking_dish\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n value = nil\n pour_contents_into_baking_dish_start_index = @input.index\n b = nil\n d = 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 value\n end\n # at line 123:5: pour WS contents WS of ( WS the )? ( WS b= ordinal )? WS mixing WS bowl WS into ( WS the )? ( WS d= ordinal )? WS baking WS dish EOF\n @state.following.push( TOKENS_FOLLOWING_pour_IN_pour_contents_into_baking_dish_325 )\n pour\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_327 )\n @state.following.push( TOKENS_FOLLOWING_contents_IN_pour_contents_into_baking_dish_329 )\n contents\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_331 )\n @state.following.push( TOKENS_FOLLOWING_of_IN_pour_contents_into_baking_dish_333 )\n of\n @state.following.pop\n # at line 123:28: ( WS the )?\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == WS )\n look_6_1 = @input.peek( 2 )\n\n if ( look_6_1.between?( T__16, T__17 ) )\n alt_6 = 1\n end\n end\n case alt_6\n when 1\n # at line 123:29: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_336 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_pour_contents_into_baking_dish_338 )\n the\n @state.following.pop\n\n end\n # at line 123:38: ( WS b= ordinal )?\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == WS )\n look_7_1 = @input.peek( 2 )\n\n if ( look_7_1.between?( ST, TH ) )\n alt_7 = 1\n end\n end\n case alt_7\n when 1\n # at line 123:39: WS b= ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_343 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_pour_contents_into_baking_dish_347 )\n b = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_351 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_pour_contents_into_baking_dish_353 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_355 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_pour_contents_into_baking_dish_357 )\n bowl\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_359 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_pour_contents_into_baking_dish_365 )\n into\n @state.following.pop\n # at line 124:10: ( WS the )?\n alt_8 = 2\n look_8_0 = @input.peek( 1 )\n\n if ( look_8_0 == WS )\n look_8_1 = @input.peek( 2 )\n\n if ( look_8_1.between?( T__16, T__17 ) )\n alt_8 = 1\n end\n end\n case alt_8\n when 1\n # at line 124:11: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_368 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_pour_contents_into_baking_dish_370 )\n the\n @state.following.pop\n\n end\n # at line 124:20: ( WS d= ordinal )?\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0 == WS )\n look_9_1 = @input.peek( 2 )\n\n if ( look_9_1.between?( ST, TH ) )\n alt_9 = 1\n end\n end\n case alt_9\n when 1\n # at line 124:21: WS d= ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_375 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_pour_contents_into_baking_dish_379 )\n d = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_383 )\n @state.following.push( TOKENS_FOLLOWING_baking_IN_pour_contents_into_baking_dish_385 )\n baking\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_pour_contents_into_baking_dish_387 )\n @state.following.push( TOKENS_FOLLOWING_dish_IN_pour_contents_into_baking_dish_389 )\n dish\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_pour_contents_into_baking_dish_391 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :pour_contents_into_baking_dish,\n :args => {:mixing_bowl => b.to_i, :baking_dish => d.to_i}\n }\n \n # <-- action\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__, 4 )\n memoize( __method__, pour_contents_into_baking_dish_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end", "def my_pets_name(a)\n a.each do |name|\n if name[0] == \"S\" \n puts \"My name starts with an S for super!\"\n else\n puts \"I'm still pretty special too!\"\n end\n end\nend", "def war_sword # todo: check this matches when 5 are bought\n Regexp.new s_to_h(<<-S)\n B1 96 B1 D3 ED AE 5F 92 02 66 03 01 .. FF FF FF\n FF .. .. .. .. 31 19 01 0B 01 00 00 00 10 00 00\n 00 4E 00 00 00 00 00 00 00 01 00 00 00 00 00 00\n 00 02 00 00 00 02 00 00 00 99 32 C5 C4 CC 57 6D\n 43 9F 6B 03 01 FF FF FF FF 99 32 C5 C4 CC 57 6D\n 43 27 9E 00 01 FF FF FF FF 01 00 00 00 99 32 C5\n C4 CC 57 6D 43 27 9E 00 01 FF FF FF FF 13 00 00\n 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n 00 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00\n 00\n S\nend", "def kids_musical; end", "def find_SuperMan(s)\n s.gsub(/[^superman]/i, '*').split(/\\*+/).delete_if { |i| i.size != 1 || i.empty? }.uniq.size == 8 \\\n ? \"Hi, SuperMan!\" : \"Are you crazy?\"\nend", "def test_espresso_more_effective\n hipster = Human.new \"Hipster\"\n espresso = Espresso.new \"Espresso\"\n\n hipster.buy espresso\n assert espresso.drinks_before_empty == 1\n\n hipster.drink!\n assert (hipster.alertness > 0.4)\n\n end", "def clever_octopus(fish)\n longest_fish = fish[0]\n fish.each { |fishy| longest_fish = fishy if fishy.length > longest_fish.length }\n longest_fish\nend", "def sluggish_octopus(fish)\n longest_fish = fish.first\n\n (0...fish.length).each do |start|\n (start...fish.length).each do |ending|\n if fish[ending].length > fish[start].length \n longest_fish = fish[ending]\n else\n longest_fish = fish[start]\n end\n end\n end\n\n longest_fish\nend", "def terpene; end", "def clever_octopus(fishes)\n biggest_fish = fishes.first\n\n fishes.each do |fish|\n\n if fish.length > biggest_fish.length\n biggest_fish = fish\n end\n end\n\n biggest_fish\nend", "def whos_your_sidekick(sidekick)\n if sidekick == \"Robin\"\n say \"#{sidekick}: Holy rusted metal, Batman!\"\n elsif sidekick == \"Batgirl\"\n say \"#{sidekick}: Suit me up, Uncle Alfred.\"\n else\n say \"Fine, I'll pick one for you.\"\n sidekick = \"Robin\"\n end\n\n sidekick\nend", "def too_many_hops?; end", "def monkey_trouble(a_smile, b_smile)\n # Please write your code in here\nend", "def difficultly(qoph_ridding, fadedness_santalaceae)\n biopsychologist_hamidian_tachardiinae()\n inigo()\n huddock_konde(phrenitic, mistake, condurango_cymoscope)\n end", "def bogo_private\n return self if length < 2\n\n shuffled = self\n shuffled = shuffle while shuffled != sort\n end", "def selective_tweet_shortener (tweet)\n if(tweet.length > 140)\n word_substituter(tweet)\n else\n tweet\n end\n\nend", "def sluggish_octopus\n # O(N^2)\n longest_fish = \"\"\n Fishes.each do |fish1|\n Fishes.each do |fish2|\n longest_fish = fish2 if fish2.length > fish1.length\n end\n end\n longest_fish\nend", "def clever_octopus(fishes)\n longest_fish = fishes.first\n\n fishes[1..-1].each do |fish|\n longest_fish = fish if fish.length > longest_fish.length\n end\n\n longest_fish\nend", "def selective_tweet_shortener(tweet)\n if tweet.length > 140 \n word_substituter(tweet)\n #\"...\"\n else\n tweet\n end\nend", "def unheard\n 'HUH?! SPEAK UP, SONNY!'\n end", "def selective_tweet_shortener(tweet)\n if tweet.length > 140\n word_substituter(tweet)\n else\n tweet\n end\nend", "def hungry? # method names can end in ? (usually used if returns true or false)\n\t\t@stuff_in_belly <= 2\n\tend", "def clever_octopus(fishes)\n longest_fish = fishes[0]\n\n fishes.each do |fish|\n longest_fish = fish if fish.length > longest_fish.length\n end\n\n longest_fish\nend", "def goose_filter(birds)\n geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"]\n birds - geese\nend", "def sluggish_octopus(fishes)\n length = fishes.length - 1\n\n\n (0..(length)).each do |i|\n longest = true\n\n ((i + 1)..length).each do |j|\n longest = false if fishes[j].length > fishes[i].length\n end\n\n return fishes[i] if longest == true\n end\nend", "def sluggish_octopus_2(fishes) \n prc = Proc.new { |a, b| a <=> b }\n\n bubble_sort(&prc).first\nend", "def play_dealer(hand, shoe, odds, upcard_result)\n case decide(hand)\n when :stand\n upcard_result[result(hand)] += odds\n when :hit\n CARDS.each do |card|\n next unless shoe.any?(card)\n card_odds = shoe.odds_of(card)\n\n hand.push(card)\n shoe.consume(card)\n\n play_dealer(hand, shoe, odds * card_odds , upcard_result)\n\n shoe.replace(card)\n hand.pop\n end\n else\n raise \"error, illegal hand action\"\n end\nend" ]
[ "0.6379332", "0.63596606", "0.63596606", "0.63306624", "0.6174131", "0.6155675", "0.6152491", "0.6152491", "0.60627466", "0.60491794", "0.59868675", "0.59827286", "0.5967649", "0.5907232", "0.587368", "0.5872149", "0.58635366", "0.5839072", "0.5833563", "0.58112806", "0.5795515", "0.57907647", "0.57772386", "0.575739", "0.5754424", "0.5754179", "0.5748926", "0.5745363", "0.57319844", "0.57289124", "0.57289124", "0.57289124", "0.57212293", "0.57161945", "0.5705246", "0.5693812", "0.56917095", "0.5688618", "0.56856626", "0.56849957", "0.56829476", "0.56821287", "0.5669804", "0.56641215", "0.5659946", "0.5652604", "0.5649617", "0.5640981", "0.563624", "0.56323624", "0.5627608", "0.56228393", "0.561473", "0.55978197", "0.55943227", "0.5593361", "0.5590343", "0.5589938", "0.5589413", "0.558675", "0.55833405", "0.5564349", "0.5564272", "0.55618376", "0.55618376", "0.5558936", "0.5552967", "0.5542701", "0.55349594", "0.5522807", "0.55153644", "0.55139506", "0.5499022", "0.5490672", "0.5489877", "0.5489856", "0.5481718", "0.54801476", "0.54789317", "0.5478053", "0.5470897", "0.54647315", "0.54634106", "0.54620117", "0.5454836", "0.54512095", "0.54357886", "0.54226696", "0.54217273", "0.54150575", "0.54101765", "0.5408885", "0.5408134", "0.5403978", "0.5395086", "0.53913563", "0.53905314", "0.53882957", "0.53859", "0.5383414", "0.5381649" ]
0.0
-1
Hate programs that hide the cursor.
def needs_cursor? true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide_cursor(&blk)\n out = esc_code(\"?25l\")\n out << (yield + show_cursor) if block_given?\n out\n end", "def hide_cursor!\n Vedeu.bind(:_hide_cursor_) do |name|\n Vedeu::Cursors::Cursor.hide_cursor(name)\n end\n\n Vedeu.bind_alias(:_cursor_hide_, :_hide_cursor_)\n end", "def without_cursor\n # tell the terminal to hide the cursor\n print `tput civis`\n begin\n # run the block\n yield\n ensure\n # tell the terminal to show the cursor\n print `tput cnorm`\n end\n end", "def show_cursor; puts \"\\e[?25h\" end", "def restore_cursor; puts \"\\e[u\" end", "def hide\n ConsoleGlitter.escape(\"?25l\")\n end", "def clear_to_cursor; print \"\\e[1K\" end", "def clear_up_to_cursor; puts \"\\e[1J\" end", "def show\n @cursor.call(0)\n @visible=true\n end", "def test_cursor_hidden\n w = Window_Selectable_Implemented.new(320,0,160,128,$data_items.compact, 24, false)\n @windows.push(w)\n end", "def hide_command!\n Rails::Command.hidden_commands << self\n end", "def hide_windows\n end", "def set_cursor_mode\n output(Esc.string('show_cursor')) unless raw_mode?\n end", "def update_cursor\n super\n cursor_rect.empty if @cursor_hide\n end", "def silent_command(&cmd)\n system \"stty -echo\" \n yield\n system \"stty echo\"\n puts\n end", "def no_cursor!\n cursor(false)\n end", "def no_cursor!\n cursor(false)\n end", "def off\n %x{stty -raw} rescue nil\n end", "def readline prompt='>'\n clear_last_line\n print \"\\r\"\n # do we need to clear till end of line, see ask_regex commented\n # unhide cursor\n print \"\\e[?25h\"\n system 'stty echo'\n begin\n if prompt.length > 40\n puts prompt\n prompt = '>'\n end\n target = Readline.readline(prompt, true)\n rescue Interrupt\n return nil\n ensure\n # hide cursor\n # NO LONGER HIDING cursor 2019-03-29 -\n # print \"\\e[?25l\"\n system 'stty -echo'\n end\n target.chomp\nend", "def shownext\n if @session.current_screen and @session.current_screen.stdin\n display @session.current_screen\n @session.next\n else\n print Paint[\"... \", :cyan]\n @playprompt = false\n @lastelapsed = 0\n end\nend", "def cursor_y\n return 2\n end", "def without_readline_completion; end", "def show_cursor!\n Vedeu.bind(:_show_cursor_) do |name|\n Vedeu::Cursors::Cursor.show_cursor(name)\n end\n\n Vedeu.bind_alias(:_cursor_show_, :_show_cursor_)\n end", "def raw_no_echo_mode\n FFI::NCurses.initscr\n FFI::NCurses.cbreak\n end", "def hide\n call Screen.setColor(false)\n call draw\n end", "def console(&blk); end", "def console(&blk); end", "def raw_no_echo_mode\n @state = `stty -g`\n system \"stty raw -echo cbreak isig\"\n end", "def echo_off\n system \"stty -echo\"\n end", "def _restore_cursor\n\t\tfalse\n\tend", "def invisible(stream = $stdout)\n stream.print(hide)\n yield\n ensure\n stream.print(show)\n end", "def cancel_attack\n @windows[Win_Status].clear_dmg_preview\n @cursor.active = true \n end", "def restore_cursor_position() set_cursor_position(@event[\"line\"], @event[\"column\"]) end", "def turn_off\n STDOUT.puts \"\\e]2;\\a\"\n end", "def cursor_movable?\n return false\n end", "def partial_reset_terminal\n # Reset the terminal to a useable state (undo all changes).\n # '\\e[?7h': Re-enable line wrapping.\n # '\\e[?25h': Unhide the cursor.\n # '\\e[2J': Clear the terminal.\n # '\\e[;r': Set the scroll region to its default value.\n # Also sets cursor to (0,0).\n # '\\e[?1049l: Restore main screen buffer.\n print \"\\e[?7h\\e[?25h\\e[;r\\e[?1049l\"\n\n # Show user input.\n system 'stty echo'\nend", "def off\n %x{stty -raw} if TTY::Platform.unix?\n end", "def undocumented_commands_hidden?\n self.class.hide_undocumented_commands \n end", "def restore_mouse(technique=1)\n\n # Hack #1 \n # Do a quick right click on an application menu and close, which\n # triggers a repaint or something that restores AV Foundation's \n # ability to record the cursor. \n # - Only works when there is an application menu \n # - Only works when the context menu that appears remains \n # outside the recorded area. \n # + doesn't cause any flicker in the screencast\n if technique == 1\n pos = run \"cliclick p\"\n pos = /\\d+,\\d+/.match(pos)[0] \n run \"cliclick kd:ctrl c:900,30 ku:ctrl c:900,30\"\n pause 1\n run \"cliclick m:#{pos}\" # restore the location\n\n # Hack #2\n # Trigger a repaint by quickly switching between apps with \n # two quick CMD-Tab presses. \n # - causes a flicker in the input focus in your screencast\n # + more reliable & general than Hack #1\n else \n \n execute_applescript(%Q'\n tell application \"System Events\"\n key code 48 using {command down}\n key code 48 using {command down}\n end tell\n ') \n end \n\n end", "def home()\n\t\t@cursor_y = 0\n\t\t@cursor_x = 0\n\tend", "def cursor_pagedown\n end", "def cursor_pagedown\n end", "def disable_player_control\n @windows[Menu_Actor].active = false\n @cursor.mode = nil\n @cursor.active = false\n end", "def hide; end", "def hide; end", "def defeat_screen\n system \"clear\"\n c = Artii::Base.new\n # puts\n puts \"------------------------------- DEFEATED --------------------------------\"\n puts\n puts c.asciify(\" YOU LOST !\")\n puts \"------------------------ PRESS ANY KEY TO CONTINUE --------------------------\"\n STDIN.getch\n print \" \\r\" # extra space to overwrite in case next sentence is short\nend", "def cursor_pagedown\r\n end", "def shell(*) end", "def cursor_bol\n # copy of C-a - start of line\n @repaint_required = true if @pcol > 0\n @pcol = 0\n @curpos = 0\n end", "def exit_command_select\n hide_turn_dir_window\n hide_tb_command_window_tb\n hide_unit_hud\n @tb_event.flash_soft_tb = false unless !@tb_event\n TactBattleManager.selecting(false)\n end", "def raw_no_echo_mode\n @state = `stty -g`\n system \"stty raw -echo -icanon isig\"\n end", "def cursor!\n cursor(true)\n end", "def cursor!\n cursor(true)\n end", "def throw_away_meaningless_line\n\t\tputs \"I have no idea what you are talking about\"\n\tend", "def reset_cursor\n c = get_cursor_pos\n print_area_to_buffer(@main_buffer, c[0], c[1], @last_chars)\n @last_chars = cache_area(@main_buffer,\n c[0], 1,\n c[1], 1)\n @cursor = [\"\\u2588\"]\n print_area_to_buffer(@main_buffer, c[0], c[1], @cursor)\n\n return\n end", "def toggle_pause()\n %x{#{echo} pause > #{fifo()}} if running?\n system \"stty #{$app.old_stty}\" # restore stty settings\n end", "def dim\n execute_applescript(%Q`\n tell application \"Mousepose\"\n stop effect\n end\n `)\n end", "def cancel_command()\n @command_window.active = true\n end", "def cursor_down(wrap = false)\n Sound.play_cursor\n Input.update\n deactivate\n call_handler(:down)\n end", "def hide_hid!\n @hide_hid = true\n end", "def render_cursor\n # This is necessary to handle characters that render\n # as more or less than 1 character, such as e.g. tabs.\n y = cursor.row\n x = editor.model.cursor_x(y, cursor.col-@xoff)+text_xoff\n\n # Make cursor visible even if currently no character\n # FIXME: Update AnsiTerm w/function to allow forcing a space\n # w/out this\n l = @out.lines[cursor.row-@top]\n if !l || !l[x]\n @out.move_cursor(x,cursor.row-@top)\n @out.print(\" \")\n end\n l = @out.lines[cursor.row-@top]\n l.set_attr(x..x, @cursor_attr)\n end", "def clearScreen\n puts \"\\e[H\\e[2J\"\nend", "def shell_out command=nil\n $shell_history ||= []\n command ||= get_string(\"Enter system command:\", :maxlen => 50) do |f|\n require 'canis/core/include/rhistory'\n f.extend(FieldHistory)\n f.history($shell_history)\n end\n ##w = @window || @form.window\n #w.hide\n Ncurses.endwin\n ret = system command\n Ncurses.refresh\n #Ncurses.curs_set 0 # why ?\n #w.show\n return ret\n end", "def victory_screen\n system \"clear\"\n b = Artii::Base.new\n # puts\n puts \"------------------------------ VICTORY -------------------------------\"\n puts\n puts b.asciify(\" YOU WON !\")\n puts \"------------------------ PRESS ANY KEY TO CONTINUE --------------------------\"\n STDIN.getch\n print \" \\r\" # extra space to overwrite in case next sentence is short\nend", "def clear_screen\n puts \"\\e[H\\e[2J\"\n end", "def throw_away_meaningless_line\n puts \"I have no idea what you are talking about\"\n end", "def cursor_no_select\n if Input.trigger?(Input::B)\n check_area \n return true\n elsif Input.trigger?(Input::C) \n clear_tr_sprites\n if @ATB_Active\n atb_press_valid\n else#TEAM Mode\n team_mode_press_valid\n end\n return true\n end \n end", "def clear_screen\n\tputs \"\\e[2J\" \n print \"\\e[H\"\nend", "def clearscreen\n system('cls')\nend", "def clear\n puts \"\\n\" # pour certaines méthodes\n puts \"\\033c\"\nend", "def handle_fell_off_screen\n end", "def hide_window\n end", "def show_return_option\n puts \"\\n000 - Return to main Screen\"\n print \":>\"\n end", "def hide_secret\n @is_showing_secret = false\n # TODO secret should be using a JPanel or something, not a dialog.\n end", "def clear_screen\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\n puts\r\nend", "def Edit_NoSetFocus(hwndCtl) send_edit_message(hwndCtl, :NOSETFOCUS) end", "def cursor_pageup\n end", "def cursor_pageup\n end", "def only_cursor_moved flag=true\n @cursor_movement = flag\nend", "def hide_info_windows\n @info_window.smooth_move(Graphics.width, @info_window.y)\n @equip_window.smooth_move(Graphics.width, @equip_window.y)\n @keys_window.smooth_move(0, Graphics.height)\n end", "def test_block_cursor\n w = Window_Selectable_Implemented.new(480,128,160,128,$data_items.compact)\n w.block_cursor = true;\n @windows.push(w)\n end", "def back_to_main()\n prompt = TTY::Prompt.new\n user_input = prompt.keypress(\n \"Press space or enter to return to main menu\", keys: [:space, :return]\n )\n system(\"clear\")\nend", "def clearConsole()\n system \"clear\" or system \"cls\"\nend", "def clearConsole()\n system \"clear\" or system \"cls\"\nend", "def setup_terminal\n # Setup the terminal for the TUI.\n # '\\e[?1049h': Use alternative screen buffer. smcup\n # '\\e[?7l': Disable line wrapping.\n # '\\e[?25l': Hide the cursor.\n # '\\e[2J': Clear the screen.\n # '\\e[1;Nr': Limit scrolling to scrolling area.\n # Also sets cursor to (0,0).\n # printf(\"\\e[?1049h\\e[?7l\\e[?25l\\e[2J\\e[1;%sr\", @glines)\n # 2019-03-29 - XXX temporarily not hiding cursor to see if we can place it.\n printf(\"\\e[?1049h\\e[?7l\\e[?25h\\e[2J\\e[1;%sr\", @glines)\n # earlier glines was grows\n\n # Hide echoing of user input\n system 'stty -echo'\nend", "def clear_screen\n \"\\e[2J\\e[H\"\nend", "def cursor_home\n @curpos = 0\n @pcol = 0\n set_form_col 0\n end", "def cursor\n try_set_screen\n\t ptr = ::FFI::MemoryPointer.new(:int)\n Klass.getCursonOn(@handle, ptr)\n (ptr.get_int(0) == 0) ? false : true\n end", "def active_cursor_move\n @cursor.range = draw_ranges(@active_battler, 3)\n @windows[Menu_Actor].deactivate\n @windows[Menu_Actor].hide\n @windows[Win_Help].hide\n @drawn = false\n @cursor.mode = TBS_Cursor::Move\n end", "def clear_screen\n print \"\\e[2J\"\nend", "def cursor_pageup\r\n end", "def process_handling\n super\n #return unless cursor_movable?\n #return process_confirm if handle?(:confirm) && Input.trigger?(:X)\n end", "def clear_screen\n print \"\\e[2J\\e[f\"\nend", "def cancel_skill \n @windows[Win_Confirm].reset_commands \n @cursor.active = true\n end", "def hide\n self.visible = false\n self.active = false\n Input.text_input = false if $MKXP\n end", "def reset_terminal\n # Reset the terminal to a useable state (undo all changes).\n # '\\e[?7h': Re-enable line wrapping.\n # '\\e[?25h': Unhide the cursor.\n # '\\e[2J': Clear the terminal.\n # '\\e[;r': Set the scroll region to its default value.\n # Also sets cursor to (0,0).\n # '\\e[?1049l: Restore main screen buffer.\n print \"\\e[?7h\\e[?25h\\e[2J\\e[;r\\e[?1049l\"\n\n # Show user input.\n system 'stty echo'\nend", "def suspend clear=true\n return unless block_given?\n Ncurses.def_prog_mode\n if clear\n Ncurses.endwin \n # NOTE: avoid false since screen remains half off\n # too many issues\n else\n system \"/bin/stty sane\"\n end\n yield if block_given?\n Ncurses.reset_prog_mode\n if !clear\n # Hope we don't screw your terminal up with this constantly.\n Canis::stop_ncurses\n Canis::start_ncurses \n #@form.reset_all # not required\n end\n @form.repaint\n @window.wrefresh\n Ncurses::Panel.update_panels\n end", "def clear_screen_down\n CSI + 'J'\n end", "def before_exit\n system 'tput reset; stty icanon; stty echo; clear'\n end", "def clear_screen\n print \"\\e[2J\"\nend", "def clear_screen\n print \"\\e[2J\"\nend" ]
[ "0.777212", "0.7412854", "0.740636", "0.691776", "0.68918735", "0.6876815", "0.6553782", "0.6486334", "0.6366664", "0.6337149", "0.6320831", "0.6273997", "0.62441057", "0.6241223", "0.6221764", "0.6200152", "0.6200152", "0.61964744", "0.61131525", "0.6094207", "0.6084147", "0.6077713", "0.607632", "0.6050461", "0.6018547", "0.6007632", "0.6007632", "0.59901166", "0.5949379", "0.5929382", "0.5911572", "0.5907664", "0.58911884", "0.5876862", "0.5859073", "0.58482045", "0.5841388", "0.5818845", "0.5813985", "0.58067256", "0.5781599", "0.5781599", "0.5771934", "0.5770704", "0.5770704", "0.5766736", "0.576657", "0.5761897", "0.5756993", "0.57510895", "0.5735514", "0.5732675", "0.5732675", "0.57060003", "0.57054627", "0.5698686", "0.56980306", "0.56971204", "0.5689813", "0.5684163", "0.56693596", "0.5665188", "0.5663073", "0.56497204", "0.5632046", "0.5628943", "0.56286156", "0.56279993", "0.56198484", "0.5609869", "0.5603938", "0.5603191", "0.5598064", "0.55720365", "0.5564841", "0.55548245", "0.5553062", "0.5553062", "0.55375475", "0.55342185", "0.55312943", "0.55295044", "0.55249643", "0.55249643", "0.5523064", "0.5518745", "0.5516492", "0.5515268", "0.5509439", "0.55066913", "0.55034393", "0.55033505", "0.5486906", "0.54856354", "0.5481606", "0.54810494", "0.54791653", "0.5477397", "0.547568", "0.5474733", "0.5474733" ]
0.0
-1
I'm aware that a lot of these could be oneline'd. I'll probably do that once I'm done.
def button_down(id) # Exit on escape if id == Gosu::KbEscape close end # Cursor Movement # NSEW = 0123 if id == Gosu::KbUp @player.move(0) end if id == Gosu::KbDown @player.move(1) end if id == Gosu::KbRight @player.move(2) end if id == Gosu::KbLeft @player.move(3) end # Camera Movement # These should probably be farther from the load/save keys heh if id == Gosu::KbI if @zoom @camera_y -= 16 * 4 else @camera_y -= 16 end end if id == Gosu::KbK if @zoom @camera_y += 16 * 4 else @camera_y += 16 end end if id == Gosu::KbJ if @zoom @camera_x -= 16 * 4 else @camera_x -= 16 end end if id == Gosu::KbL if @zoom @camera_x += 16 * 4 else @camera_x += 16 end end if id == Gosu::KbM # Toggle lame, janky zoom @zoom = !@zoom # If we're turning zoom on, set the camera so it zooms # to the area the cursor is at, if we're turning zoom off # then just reset the camera to show the full editor field. if @zoom @camera_x = @player.x @camera_y = @player.y else @camera_x = 0 @camera_y = 0 end end # Editor Functions if id == Gosu::KbQ # Scroll left through sprites @player.change(1) end if id == Gosu::KbW # Scroll right through sprites @player.change(2) end if id == Gosu::KbA # Place a tile as a world tile @player.place(1) end if id == Gosu::KbS # Place a tile as a prop, draw above world tiles @player.place(2) end if id == Gosu::KbD # Clear a tiles world/prop/collision info, setting it to nil @player.place(3) end if id == Gosu::KbZ # Mark a tile for collision, only drawn in the editor @player.place(4) end if id == Gosu::KbX # Turn on/off drawing of the red cross-circle that shows where colliders are @map.draw_colliders? end # Save / Load Functions (Still Experimental, but working) # Make sure that the file you're trying to load was made # by the same version of Tyle you're using now, else oddness. if id == Gosu::KbO and DEBUG @map.save(FILENAME) end if id == Gosu::KbP and DEBUG @map.load(FILENAME) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probers; end", "def anchored; end", "def leading; end", "def offences_by; end", "def prev_line=(_arg0); end", "def _reduce_279(val, _values, result)\n result = lexer.line\n \n result\nend", "def lines_of_code; end", "def lines_of_code; end", "def _reduce_273(val, _values, result)\n result = lexer.line\n \n result\nend", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def line; end", "def preproc; end", "def line_cache; end", "def line=(_arg0); end", "def single_line?; end", "def next!() end", "def current_line_number; end", "def never_lines; end", "def never_lines; end", "def _reduce_526(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def fresh_line?; end", "def missed_lines; end", "def missed_lines; end", "def private; end", "def run_line_length_cop; end", "def _reduce_529(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def first_line; end", "def source_line=(_); end", "def offences_by=(_arg0); end", "def first_part_of_call_chain(node); end", "def first_part_of_call_chain(node); end", "def _reduce_528(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_528(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_528(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_528(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_285(val, _values, result)\n result = lexer.line\n \n result\nend", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def _reduce_657(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def next() end", "def next() end", "def runnables; end", "def _reduce_534(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def line_number; end", "def line_number; end", "def line_number; end", "def line_number; end", "def line_number; end", "def line_number; end", "def line_number; end", "def _reduce_533(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def source_line; end", "def caller\n %x{\n function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n }\n\n\n var err = getErrorObject();\n }\n stack = `err.stack`\n caller_lines = stack.split(\"\\n\")[4..-1]\n caller_lines.reject! { |l| l.strip.empty? }\n\n result_formatter = lambda do |filename, line, method=nil|\n \"#{filename}:#{line} in `(#{method ? method : 'unknown method'})'\"\n end\n\n caller_lines.map do |raw_line|\n if match = /\\s*at (.*) \\((\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # catch phantom/no 2nd line/col #\n elsif match = /\\s*at (.*) \\((\\S+):(\\d+)/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (.*):(\\d+)/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # Firefox - Opal.modules[\"rspec/core/metadata\"]/</</</</def.$populate@http://192.168.59.103:9292/assets/rspec/core/metadata.self.js?body=1:102:13\n elsif match = /(.*?)@(\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n # webkit - http://192.168.59.103:9292/assets/opal/rspec/sprockets_runner.js:45117:314\n elsif match = /(\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n else\n \"#{filename}:-1 in `(can't parse this stack trace)`\"\n end\n end\n end", "def _reduce_270(val, _values, result)\n result = lexer.line\n \n result\nend", "def terpene; end", "def line_num; end", "def _reduce_317(val, _values, result)\n (msg, line), = val\n result = new_call nil, msg.to_sym\n result.line line\n\n result\nend", "def leading=(_); end", "def original_line; end", "def lines; end", "def lines; end", "def prev_line; end", "def test_non_tail_position_blocks_cannot_have_tailcalls\n tails_found = 0\n tcompile 'defn foo() {{9; %g}; 99}'\n visit_tree @tc.ast, tailcall:->(x) {tails_found += 1 }\n assert tails_found.zero?, \"Expected to not find any tail calls, but found #{tails_found} instead\" \n end", "def _reduce_531(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_531(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_531(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_531(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_531(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def _reduce_631(val, _values, result)\n result = s(:nil).line lexer.lineno\n result\nend", "def probers=(_arg0); end", "def line=(_); end", "def line=(_); end", "def lineno; end", "def lineno; end", "def lineno; end", "def input_lines; end", "def caller; end" ]
[ "0.6078793", "0.5748514", "0.56736916", "0.5663739", "0.56608784", "0.5620129", "0.558306", "0.558306", "0.5547612", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.55468225", "0.5536225", "0.55245143", "0.5484773", "0.54700536", "0.54582745", "0.5447983", "0.54293823", "0.54293823", "0.54280967", "0.5394807", "0.53926075", "0.53926075", "0.53858453", "0.5383576", "0.5377812", "0.5377782", "0.5377782", "0.5377782", "0.5377782", "0.5377782", "0.5377782", "0.5377782", "0.5377782", "0.5377782", "0.5377782", "0.53591347", "0.5336563", "0.53360885", "0.53360885", "0.5327798", "0.5327798", "0.5327798", "0.5327798", "0.5310847", "0.53093266", "0.53093266", "0.53093266", "0.53093266", "0.53090566", "0.5300311", "0.5300311", "0.5300252", "0.52973276", "0.529437", "0.529437", "0.529437", "0.529437", "0.529437", "0.529437", "0.529437", "0.5293675", "0.528249", "0.5267132", "0.5263981", "0.5258453", "0.52482677", "0.5240073", "0.52341795", "0.5223944", "0.5222395", "0.5222395", "0.5213841", "0.5203087", "0.5187625", "0.5187625", "0.5187625", "0.5187625", "0.5187625", "0.5183296", "0.51828927", "0.51790375", "0.51790375", "0.51782966", "0.51782966", "0.51782966", "0.51758915", "0.51736486" ]
0.0
-1
extensions gets ticket info for a customer
def tickets sql = "SELECT * FROM tickets" values = [] tickets = SqlRunner.run(sql, values) result = tickets.map { |ticket| Ticket.new( ticket ) } return result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ticket\n @ticket ||= @api.get_ticket['ticket']\n end", "def show_ticket_details(ticket_id)\n url = \"https://alanli1.zendesk.com/api/v2/tickets/#{ticket_id}.json\"\n\n res = ApiHelper.make_req_to_api(url)\n @ticket = find_ticket_details(res)\n @ticket.requester_name = get_user_name(@ticket.requester_id)\n return @ticket\n end", "def get_payment_ticket\n end", "def get_ticket\n ticket_details = self.class.get(\"/rest/api/2/issue/\", :verify => false)\n File.open(\"custom.txt\", 'w') {|f| f.write(ticket_details) }\n end", "def account_info_edit\n result = ChargeBee::Customer.retrieve(@customer_id)\n @customer = result.customer\n end", "def show_ticket\n end", "def customer_info(customer)\n return customer\n end", "def ticket\n end", "def get_ticket(ticket_id:)\n ZendeskAPI::Ticket.find(client, id: ticket_id)\n end", "def get_customers\n \n # Go to the Customers tool\n goto_tool 'redetrack/bin/manager'\n \n # Extract the table as a RubyExcel::Sheet\n s = RubyExcel::Workbook.new.load( Nokogiri::HTML( agent.page.body ).css( 'tr' ).map { |row| row.css('th,td').map { |cell| cell.nil? ? nil : cell.text.gsub( /\\s+/, ' ' ).strip } } )\n \n # Remove the buttons and blank rows\n s.row(2).delete\n s.compact!\n \n # Store the account details in a Hash by :name and :customer\n h = Hash.new({})\n s.rows(2) do |row|\n name = ( row['D'].empty? ? 'Other' : row['D'] )\n customer = ( row['E'].empty? ? 'Other' : row['E'] )\n h[ row['C'].upcase ] = { name: name, customer: customer }\n end\n h\n end", "def get_ticket_details( session_key, ticket_id)\n response_xml = self.call( :get_ticket_details, message: {\n api_key: session_key,\n ticket: ticket_id\n })\n response = IssueCentre::Response.parse( response_xml)\n end", "def customer_support(question, email)\n new_ticket = Slack::Notifier.new ENV['slack_webhook_url'],\n channel: \"#customer-support\",\n username: self.username\n message = \"#{self.username} asks #{question}. Email: #{email}\"\n new_ticket.ping message\n\n message\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def show\n @custom_ticket = CustomTicket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @custom_ticket }\n end\n end", "def customer(customer_id)\n client.get \"customers/#{inst_id}/#{customer_id}\"\n end", "def customers\n Easybill::Api::Customers\n end", "def ticket_created(ticket)\n @ticket = ticket\n\n mail to: @ticket.customer_email, subject: \"Support team start working on your ticket\"\n end", "def show\n @tickets_count = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).active.count\n @ticket = Helpdesk::Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ticket }\n end\n end", "def getDetails id\n\t\tticket = @tickets.read ['id', 'pid', 'title', 'description', 'tracker', 'creator', 'created', 'status'], ['id', id]\n\t\tticket = ticket[0]\n\tend", "def retreive_customer_info(options)\n requires!(options, :subscription_id, :order_id)\n commit(build_retreive_customer_info(options), options)\n end", "def show\n Labtech.get_token\n @last_ticket = Labtech.last_labticket\n end", "def updated_ticket\n SubscriberNotifications.updated_ticket\n end", "def technical_contact\n get_user technical_contact_id\n end", "def overall_tickets\n\n end", "def print_invited_customers\n\t\t@invited_customers.each do |customer|\n\t\t\tputs \"ID:#{customer[\"user_id\"]} Name:#{customer[\"name\"]}\"\n\t\tend\n\tend", "def GetTicket id\n\n APICall(path: \"tickets/#{id}.json\")\n\n end", "def ticket(*options)\n options.insert(0, id) if options.length > 0\n easy_finder(provider_parent(self.class)::Ticket, :first, options, 1)\n end", "def retrieve_ticket\n resp = HTTParty.get('https://localhost/identity/restv1/api/v1/groups')\n\n resp.headers['www-authenticate']\n .split(', ')\n .find { |e| e =~ %r{^ticket} }\n .split('=')[1]\n end", "def customer\n @customer ||= fetcher.get(Customer, customer_id)\n end", "def get_customer(email)\n MerchantPluginProvider.api_not_implemented(self)\n end", "def show\r\n # @ticket = Contact::Ticket.find_by_uuid(params[:id])\r\n raise UnknowsAction\r\n end", "def show\n @diagnostic = @ticket.diagnostics.new\n @diagnostics = @ticket.diagnostics\n #@issues = @ticket.issues\n @client = @ticket.client.id\n @computers = @ticket.computers\n #@computer - @ticket.computers\n \n end", "def show\n @ticket_details = @ticket.ticket_details\n end", "def find\n sanitizers = {\n :type => Proc.new{ |x| x.to_s },\n :status => Proc.new{ |st| st.is_a?(Array) ? st.map(&:to_i) : st.to_i },\n :customer_id => Proc.new{ |x| x.to_i },\n :customer_ext_id => Proc.new{ |x| x.to_i }\n }\n c = {}\n params.each do |k,v|\n k = k.to_sym\n c[k] = sanitizers[k].call(v) if sanitizers[k]\n end\n if c.key?(:customer_ext_id)\n if cust = Customer.find_by_external_id(c[:customer_ext_id])\n c.delete :customer_ext_id\n c[:customer_id] = cust.id\n else\n c = nil # disallow Ticket.first call\n r['error'] = \"Cannot find customer by ext_id = #{c[:customer_ext_id]}\"\n end\n end\n\n r = {}; @ticket = nil\n\n @ticket = Ticket.first(\n :conditions => c,\n :order => \"created_at DESC\"\n ) if c\n\n respond_to do |format|\n format.yaml {\n r['ticket'] = @ticket && @ticket.attributes.reject{ |k,v| v.blank? }\n render :text => r.ya2yaml\n }\n end\n end", "def customer(options = nil)\n request = Request.new(@client)\n path = \"/authorization-requests/\" + CGI.escape(@id) + \"/customers\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"customer\"]\n customer = Customer(self._client)\n return_values.push(customer.fill_with_data(body))\n\n \n return_values[0]\n end", "def ticketexport tid,count\n\n begin\n ticket = ZendeskAPI::Ticket.find($client, :id => tid, :include => :users)\n rescue\n puts \"The call to the Zendesk API failed for ticket #{tid}, moving on.\"\n end\n\n if ticket.nil?\n puts \"No ticket at #{tid}\"\n return\n elsif ticket.organization.nil?\n puts \"No organization on ticket #{tid}\"\n return\n elsif ticket.requester.nil?\n puts \"No requester on ticket #{tid}\"\n return\n #elsif ticket.status.to_s != \"closed\" \n # puts \"Ticket status is not closed\"\n # return\n end\n\n\n #if ticket.requester.nil?\n # return \"No requester on ticket #{tid}\"\n #else ticket.organization.nil?\n # return \"No organization on ticket #{tid}\"\n #end\n puts ticket.id\n puts ticket.to_json\n\n #puts ticket.status\n #puts ticket.url\n #puts ticket.date\n puts \"Company: #{ticket.organization.name}\"\n puts \"Requester: #{ticket.requester.name}\"\n puts \"Requester Email: #{ticket.requester.email}\"\n puts \"Requester Alias: #{ticket.requester.alias}\"\n #puts ticket.subject\n #puts ticket.description\n\n ctime = Time.parse(\"#{ticket.created_at}\")\n cdate = ctime.in_timezone 'America/Chicago'\n cwtime = ctime.strftime(\"%m/%d/%Y\")\n\n #puts cdate\n begin\n audits = ticket.audits.each\n rescue\n puts \"Collecting audits failed, trying again in 30 seconds.\"\n sleep 30\n audits = ticket.audits.each\n end\n # puts audits.to_json\n # This is a UNC PATH where we will put all of the files\n # On a Windows server.\n # This is NOT ideal, but is a side effect of using a janky import process.\n # It works, but it's a dirty hack.\n path = '\\\\\\\\share.somedomain.com\\cw\\\\'\n\n $pubc = \"\\n\\n################################\\n\\nThese were Zendesk Public Comments.\\n\\n\"\n $pubc << \"Zendesk Ticket URL: https://zen.somedomain.com/tickets/#{ticket.id}\\n\\n\"\n $privc = \"\\n\\n################################\\n\\nThese Were Zendesk Private Comments.\\n\\n\"\n # $pubc << \"Full text: #{path}#{ticket.id}\\\\FullThread.txt\\n\\n\"\n \n\n\n audits.each do |i|\n \n t = Time.parse(\"#{i.created_at}\")\n $localtime = t.in_timezone 'America/Chicago'\n $endtime = t.strftime(\"%m/%d/%Y\")\n i.events.each do |e|\n #if e.body =~ /Ticket \\{\\{ticket\\.id\\}\\}/\n #puts e.attachments\n if e.attachments\n if ! File.directory?(\"./cw/#{ticket.id}\")\n dir = Dir.mkdir(\"./cw/#{ticket.id}\")\n #dir = Dir.mkdir(\"./cw/#{ticket.id}/msgs\")\n end\n e.attachments.each do |att|\n begin\n afile = att.file_name.gsub(/\\//, '-')\n afile = afile.gsub(/^\\./, '')\n puts afile\n $pubc << \"\\n\\nAttachment: #{path}#{ticket.id}\\\\#{afile}\\n\\n\"\n # File.write(\"./cw/#{ticket.id}/#{att.file_name}\", Net::HTTP.get(URI.parse(\"#{att.content_url}\"))) \n File.write(\"./cw/#{ticket.id}/#{afile}\", fetchData(\"#{att.content_url}\"))\n rescue\n puts \"There was a problem writing the attachment #{afile}\"\n end\n end\n end \n if e.type.to_s == \"Comment\"\n if e.public.to_s == 'false'\n # puts \"This is a \" + ( e.public.to_s == 'false' ? \"PRIVATE comment.\\n\" : \"PUBLIC comment.\\n\" )\n $privc << \"\\n\\n################################\\n\\n\"\n $privc << \"At #{$localtime}, #{i.author.email} said:\\n\\n\" rescue \"There was an error here\"\n #out = e.body[0..30000]\n $privc << e.body\n #if e.attachments\n else\n # puts \"This is a \" + ( e.public.to_s == 'false' ? \"PRIVATE comment.\\n\" : \"PUBLIC comment.\\n\" )\n $pubc << \"\\n\\n################################\\n\\n\"\n $pubc << \"At #{$localtime}, #{i.author.email} said:\\n\\n\" rescue \"There was an error here\"\n #out = e.body[0..30000]\n $pubc << e.body\n $pubc + \"\\n\\n\"\n \n end\n\n else\n next\n end\n end \n end\n\n $pubc << ticket.description\n # Per connectwise, we have to strip out the pipes from the descriptions\n $privc.gsub!('|','*pipe character was removed here*')\n #puts $privc\n\n $pubc.gsub!('|', '*pipe character was removed here*')\n #puts $pubc\n\n #puts $privc\n #puts $pubc\n\n #fulltext = FILE.open(\"./cw/#{ticket.id}/FullThread.txt\", \"w\") do |ffile|\n # ffile << $privc\n # ffile <<pubc\n #end\n\n headers = %w{SrBoard CompanyName ContactName SrStatus SrType SrSubType SrItem SrSource SrLocation SrPriority Summary DetailDescription InternalAnalysis Resolution AssignedBy DateEntered DateCompleted ConfigName ResourceMember}\n\n output = [{\n 'SrBoard' => \"Service Desk\",\n 'CompanyName' => \"#{ticket.organization.name}\",\n 'ContactName' => \"#{ticket.requester.alias}\",\n 'SrStatus' => \"Closed\",\n 'SrType' => \"\",\n 'SrSubType' => \"\",\n 'SrItem' => \"\",\n 'SrSource' => \"Zendesk\",\n 'SrLocation' => \"Remote\",\n 'SrPriority' => \"Priority 5 - No SLA\",\n 'Summary' => \"#{ticket.subject}\",\n 'DetailDescription' => \"#{$pubc}\",\n 'InternalAnalysis' => \"#{$privc}\",\n 'Resolution' => \"\",\n 'AssignedBy' => \"zadmin\",\n 'DateEntered' => \"#{cwtime}\",\n 'DateCompleted' => \"#{$endtime}\",\n 'ConfigName' => \"\",\n 'ResourceMember' => \"\"\n }]\n\n cols = output.first.keys\n excsv cols,output,count,tid\nend", "def show\n company = Company.find(1)\n @suppliers = company.get_suppliers\n @telecredito_details = @telecredito.telecredito_details\n\n end", "def customer(customer_id)\n perform_get_request(\"/customer/#{customer_id}\")\n end", "def employee_wotc_info(employee_id)\n get(\"employees/#{employee_id}/wotc\")\n end", "def ticket_status_updated(ticket)\n\t@ticket = ticket\n\n mail to: @ticket.customer_email, subject: \"You ticket updated\"\n end", "def show\n @seats = @customer.seats\n @tickets = @customer.tickets\n @orders = @customer.reservations\n end", "def name_of_person_of_ticket\n self.viewer.name\n \n end", "def billing_info_edit\n result = ChargeBee::Customer.retrieve(@customer_id)\n @customer = result.customer\n @billing_address = result.customer.billing_address\n @country_codes = get_country_codes\n end", "def ticket\r\n TicketController.instance\r\n end", "def ticket\n case eventable_class\n when \"Ticket\"\n Ticket.get(eventable_id)\n when \"TicketUpdate\"\n TicketUpdate.get(eventable_id).ticket\n when \"Milestone\"\n Milestone.get(eventable_id)\n end\n end", "def customer_list\n perform_get_request('/customer/list')\n end", "def ticket_params\n params.require(:ticket).permit( :customernetid, :customermavid, :customername, :customerphone, :customeremail, :problem, :category, :resolution, :notes, :user, :page, :description, :task_id, :note_id)\n end", "def login_ticket\n LoginTicket\n end", "def customer(customer)\n id = epages_id(customer)\n perform_get_with_object(\"/customers/#{id}\", {}, Epages::Customer)\n end", "def ticket_params\n params[:ticket]\n end", "def tickets()\n sql = \"SELECT * FROM tickets where customer_id = $1\"\n values = [@id]\n ticket_data = SqlRunner.run(sql, values)\n return ticket_data.map{|ticket| Ticket.new(ticket)}\n end", "def find(id)\n info(\"https://jrcodn.zendesk.com/api/v2/tickets/#{id}\")[:ticket]\n rescue\n @view.id_error\n end", "def show\n @admin_ticket = Ticket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_ticket }\n end\n end", "def show\n #@ticket = @support.tickets.new\n @tickets = @support.tickets\n \n end", "def get_upload_ticket\n send_method(:get_upload_ticket).at(:upload_ticket).inner_html\n end", "def get_ticket(ticket)\n @tickets << ticket\nend", "def index\n @tickets = @customer ? @customer.tickets : Ticket.all\n end", "def customer() #in the tickets (join) table so we can grab customer_id easily, the _id's are already bundled in this table\n sql = \"SELECT * FROM customers WHERE id = $1\"\n values = [@customer_id]\n customer = SqlRunner.run(sql, values).first\n return Customer.new(customer)\n end", "def get_customer(id)\n get(\"customers/#{id}\")\n end", "def get_customer(id)\n get(\"customers/#{id}\")\n end", "def GetTickets params = {}\n\n params = params.merge(path: 'tickets.json')\n APICall(params)\n\n end", "def get_customer_profile\n authenticate_request!\n json_response(current_customer)\n end", "def as_chargebee_customer\n ChargeBee::Customer.retrieve(chargebee_id).customer\n end", "def ticket number\n Geera::Ticket.new self, number\n end", "def get_customers\n return ShopifyAPI::Customer.all\n end", "def show\n # Get the current user\n @user = User.find(current_user.id)\n # Define arrays to hold open and closed tickets\n @open_tickets = []\n @closed_tickets = []\n # For each request the person has made:\n @user.help_requests.each do |request|\n # If the request is open...\n if request.open?\n # ...add it to the array of open tickets\n @open_tickets << request\n # Else if the ticket is closed...\n elsif !request.open?\n # Add it to the list of closed tickets\n @closed_tickets << request\n end\n end\n end", "def customer_comments\n end", "def send_recipt(ticket)\n @ticket = ticket\n\n mail to: ticket.email\n end", "def authenticate_customer \n label = request_label(:authenticate_customer, customer_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/authenticate_customer\", \n :get,\n head: headers,\n query: { provider_id: provider_id, customer_id: customer_id, customer_token: customer_token }\n ).status!(label)\n end", "def search_shopify_customer(context)\n customer_emails = context_customer_emails(context)\n shopify_customer = nil\n\n customer_emails.each do |customer_email|\n shopify_customer = ShopifyAPI::Customer.search(query: customer_email).first\n break if shopify_customer\n end\n\n return shopify_customer\nend", "def show\n render json: @ticket.to_json(include: :conversations), status: 200\n end", "def ticket_before\n @flight.ticket_before\n end", "def create_intervention_ticket\n #Call zendesk API create new client method\n client = ZendeskAPI::Client.new do |config|\n #Get config parameters from application.yml \n #These parameters are ignored by git \n config.url = ENV['ZENDESK_URL']\n config.username = ENV['ZENDESK_USERNAME']\n config.token = ENV['ZENDESK_TOKEN']\n end\n #create the ticket \n ZendeskAPI::Ticket.create!(client,\n #define subject with the current user name \n :subject => \"NEW INTERVENTION created by : \" + @currentusername.to_s ,\n #Requirements : \n # The Requester\n # The Customer (Company Name)\n # Building ID\n # The Battery ID\n # The Column ID if specified\n # Elevator ID if specified\n # The employee to be assigned to the task\n # Description of the request for intervention\n\n :comment => \"The customer ID : #{params[:customer]} \n Building ID : #{params[:building]} \n Battery ID : #{params[:battery]} \n Column ID : #{params[:column]} \n Elevator ID : #{params[:elevator]} \n Affected employee ID : #{params[:employee]} \n Description : #{params[:report]} \",\n #Set the priority \n :priority => \"urgent\",\n #Set the type \n :type => \"question\")\n end", "def tickets(*options)\n options.insert 0, id\n easy_finder(provider_parent(self.class)::Ticket, :all, options, 1)\n end", "def ticket_params\n params.require(:ticket).permit(:customer_name, :customer_email, :subject, :uniq_reference, :ticket_status, :ticket_interface, :ownership, :ticket_body, :response)\n end", "def index\n @tickets = get_current_user_ticket_list(@user)\n end", "def service\n softlayer_client[:User_Customer].object_with_id(self.id)\n end", "def customer_by_ref(customer_ref)\n client.get \"customers/#{inst_id}/byRef?merchantRef=#{customer_ref}\"\n end", "def list\n display_customers\n end", "def customers\n ShopifyAPI::Customer.all\n end", "def show_ticket(ticket)\n puts \"-\"*80\n puts \"Estamos muy felices de que hayas reservado con nosotros!!!\"\n puts \"-\"*80\n puts \n puts \"El costo total es de $ #{ticket[0]} pesos\"\n booking = ticket[1]\n puts \"Y tu ID de reservación es la siguiente: #{booking.id} \"\n puts \"-\"*80\n end", "def task_customer_tip(customer)\n values = []\n values << [ _(\"Contact Name\"), customer.contact_name ]\n values << [ _(\"Contact Email\"), customer.contact_email ]\n customer.custom_attribute_values.each do |cav|\n values << [ cav.custom_attribute.display_name, cav.to_s ]\n end\n\n return task_tooltip(values)\n end", "def getXMLTicket(path)\n resp2 = @@conn.get do |req|\n req.url path\n req.headers['Authorization'] = 'Basic aHIuc2VsbGVydEBnbWFpbC5jb206c2VzMTEy' #@TODO make this a param\n req.headers['Content-Type'] = 'application/xml'\n end\n # puts \"Responce : \" + resp2['body'].inspect\n # puts \"Responce2 : \" + resp2.body.to_s()\n \n return resp2.body.to_s()\n end", "def context_customer_emails(context)\n context = JSON.parse(context)\n customer_emails = context['context']['environment']['customer']['emailAddresses']\n customer_emails = customer_emails.map {|x| x[\"value\"]}\nend", "def show\n @ticket = Ticket.find(params[:id])\n \n end", "def customer\n self.customer\n end", "def edit_customer_details\n end", "def show\n @ticket_action = TicketAction.find(params[:id])\n @ticket_display_str = Ticket.display_str(@ticket_action.ticket_id)\n @user_display_str = User.display_str(@ticket_action.add_user_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ticket_action }\n end\n end", "def load_customer_info(customer)\n self.customer_id = customer.id\n self.cardholder_email = customer.email\n\n customer_card = get_default_card(customer)\n\n self.cardholder_name = customer_card.name\n self.card_type = customer_card.type\n self.last4 = customer_card.last4\n self.expiration = customer_card.exp_month.to_s +\n '/' + customer_card.exp_year.to_s\n end", "def display_details()\n puts \"Customer id #@cust_id\"\n puts \"Customer name #@cust_name\"\n puts \"Customer address #@cust_addr\"\n end", "def customer(id)\n response = get(\"customers/#{id}\")\n response.customer\n end", "def create\n @ticket = @customer.tickets.create(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to edit_customer_path(@customer), notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_logger_tickets\n @tickets = Ticket.find_all_by_job_id_and_paid_to_logger(params[:id], false, :order => \"number\")\n render \"get_tickets.html.erb\"\n end", "def show\n @ticket = @project.tickets.find_by_scoped_id!(params[:id])\n @ticket_comment = @ticket.ticket_comments.new\n @ticket_comment.status_to = @ticket.status\n @ticket_comment.responsible_id_to = @ticket.responsible_id\n @ticket_comment.priority_to = @ticket.priority\n @assets = @project.assets.where(:attachable_type=>[Ticket.to_s, TicketComment.to_s]).where(:attachable_id=>([@ticket.id]|@ticket.ticket_comments.all.map{|tc|tc.id})).order('updated_at desc').all\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ticket }\n end\n end", "def display_details()\n puts \"Customer name: #@cust_name\"\n puts \"Customer ID: #@cust_id\"\n puts \"Customer address: #@cust_addr\"\n end", "def show\n @req = @company.implementer_requests\n end", "def show\n @ticket_attachments = @ticket.ticket_attachments.all\n end", "def customer_id\n @booking_profile.try(:external_user_id)\n end", "def info &block\n em_get( \"/clients/#{uuid}\" ) { |response| block.call( response ) }\n end", "def show\n if @ticket.present?\n @ticket_replies = @ticket.ticket_replies\n @ticket_reply = TicketReply.new\n end\n end", "def index\n @tickets = current_user.tickets\n end" ]
[ "0.6394352", "0.62665135", "0.6226859", "0.61970973", "0.61841875", "0.6138204", "0.61339986", "0.60128057", "0.5964505", "0.5924771", "0.575046", "0.572894", "0.5717856", "0.570582", "0.56874347", "0.5683602", "0.56818885", "0.56806976", "0.56692535", "0.5665405", "0.5626412", "0.55927306", "0.55642796", "0.5551311", "0.5546262", "0.554038", "0.55330664", "0.5519644", "0.5519198", "0.5506056", "0.55006766", "0.5494746", "0.5492199", "0.5489765", "0.54742014", "0.5465697", "0.5428189", "0.53909814", "0.53835195", "0.5372091", "0.53709936", "0.53596723", "0.5358245", "0.53552616", "0.5346259", "0.53420043", "0.5340522", "0.53401077", "0.5338005", "0.5337082", "0.53127766", "0.5310157", "0.5309214", "0.5307512", "0.52987206", "0.52978146", "0.529472", "0.5289261", "0.5280183", "0.5280183", "0.52681774", "0.5262007", "0.5261705", "0.52537876", "0.52421254", "0.52419764", "0.5237112", "0.5234616", "0.52151996", "0.52090764", "0.52011096", "0.5177264", "0.51721704", "0.516178", "0.51617235", "0.51599884", "0.51587117", "0.51378536", "0.51281", "0.51267076", "0.51081675", "0.5107533", "0.51074576", "0.51060784", "0.51044005", "0.5098649", "0.50962937", "0.5093899", "0.5086454", "0.5086347", "0.50826585", "0.5066938", "0.506586", "0.5051262", "0.50509197", "0.50488234", "0.5047276", "0.5034992", "0.50284266", "0.5023895", "0.5018696" ]
0.0
-1
counts tickets using ticket info array
def count_tickets tickets = self.tickets total_tickets = tickets.count return total_tickets end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ticket_count()\n sql = \"SELECT * FROM tickets WHERE customer_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values).count\n end", "def ticket_status_count\n @ticket_status_count ||= begin\n counts = { \"a\" => 0, \"t\" => 0, \"f\" => 0 }\n counts.merge! assigned_tickets.joins(:status).sum(1, group: 'ticket_statuses.open')\n counts.each{ |k,v| counts[k] = v.to_i; counts[\"a\"] += counts[k] }\n end\n end", "def num_of_tickets()\n result = films()\n @number_of_tickets = result.count\n end", "def ticket_count()\n sql = \"SELECT COUNT(*) FROM tickets WHERE cust_id = $1\"\n values = [@id]\n count = SqlRunner.run(sql, values)\n return count[0]['count'].to_i\n end", "def how_many_tickets()\n sql = \"SELECT * FROM tickets WHERE screening_id = $1;\"\n values = [@id]\n tickets = SqlRunner.run(sql, values)\n result = Ticket.map_tickets(tickets).count\n end", "def how_many_tickets\n sql = 'SELECT COUNT(customer_id) FROM tickets WHERE customer_id = $1'\n values = [@id]\n SqlRunner.run(sql, values)[0]['count'].to_i\n end", "def ticket_count()\n sql = \"SELECT COUNT (tickets.*) FROM tickets\n WHERE tickets.customer_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)[0].first\n return result\n end", "def count_tickets()\n sql = \"SELECT films.* FROM films\n INNER JOIN tickets ON\n tickets.film_id = films.id\n WHERE customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = films.map{|film| Film.new(film)}\n return result.count\n end", "def tickets()\n sql = \"SELECT * FROM tickets WHERE film_id = $1;\"\n values = [@id]\n tickets = SqlRunner.run(sql, values)\n return Ticket.map_items(tickets).count\n end", "def tickets_bought\n sql = \"SELECT COUNT(*)\n FROM tickets\n WHERE tickets.customer_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)[0][\"count\"].to_i\n end", "def total_tickets\n respond_with json_response('total_tickets', Ticket.count)\n end", "def joke_count # {{{\n\n @log.message :debug, \"Entering count function\"\n\n jokes = Joke.all\n sources = Hash.new\n\n sources[ \"Total\" ] = jokes.length\n sources[ \"Manually Entered\" ] = 0\n\n jokes.each do |j|\n source = j.source\n\n if( source == nil )\n sources[ \"Manually Entered\" ] += 1\n else\n sources[ source ] = 0 if sources[ source ].nil?\n sources[ source ] += 1\n end\n end\n\n sources\n end", "def ticket_count()\n return self.booked_films.count\n end", "def tickets()\n return films().count()\n end", "def ticket_count\n self.user.tickets < self.attraction.tickets\n end", "def tickets_purchased\n return film().count\n end", "def tester_device_in_bugs_count(testerId, deviceId, bugs_array)\n\tcount = bugs_array.select {|bug| bug['deviceId'] == deviceId && bug['testerId'] == testerId}.count\n\t{\"testerId\" => testerId, \"deviceId\" => deviceId, \"count\" => count}\n\nend", "def number_of_tickets_bought() # working in terminal - console (eg.: customer1.number_of_tickets_bought)\n return films.count\n end", "def tally_votes\n tallies = {}\n if vote_tallies.present?\n vote_tallies.each do |vote_tally|\n tallies[vote_tally.candidacy] = vote_tally.vote_count\n end\n else\n votes.each do |vote|\n candidacy = vote.candidacy\n tallies[candidacy] ||= 0\n tallies[candidacy] += 1\n end\n end\n\n tallies\n end", "def counts\n count = Hash.new(0)\n self.each{|ele| count[ele] += 1}\n count\n end", "def tickets_bought()\n tickets_array = films()\n number_of_tickets = tickets_array.count\n return \"#{@name} has bought #{number_of_tickets} tickets.\"\n end", "def tickets()\n sql = \"SELECT tickets.* FROM films INNER JOIN screenings ON films.id = screenings.film_id INNER JOIN tickets ON screenings.id = tickets.screening_id WHERE film_id = $1;\"\n values = [@id]\n films_hash = SqlRunner.run(sql, values)\n return Film.map_films(films_hash).count\n end", "def occurences_count\n\t\t\t\t\t\tHash.new(0).tap do |result|\n\t\t\t\t\t\t each { |item| result[item] += 1 }\n\t\t\t\t\t\tend\n\t\t\t\tend", "def count_occurrences(vehicles)\n vehicles.each_with_object(Hash.new(0)) do |vehicle, memo|\n memo[vehicle] += 1\n end\nend", "def count_occurence(array)\n counts = Hash.new(0)\n array.each { |name| counts[name] += 1 }\n puts counts\n\n price_calculator=PriceCalculator.new\n price_calculator.sepitem_quantity(counts)\n\n end", "def c_count events\n events.map(&:committer).uniq.count\nend", "def counts\r\n @counts\r\n end", "def vote_counts\n counts = {\n :option1 => 0,\n :option2 => 0,\n :option3 => 0,\n :option4 => 0,\n :option5 => 0,\n :option6 => 0\n }\n\n self.votes.each do |vote|\n if vote.option_num == \"1\"\n counts[:option1] += 1\n elsif vote.option_num == \"2\"\n counts[:option2] += 1\n elsif vote.option_num == \"3\"\n counts[:option3] += 1\n elsif vote.option_num == \"4\"\n counts[:option4] += 1\n elsif vote.option_num == \"5\"\n counts[:option5] += 1\n elsif vote.option_num == \"6\"\n counts[:option6] += 1\n end\n end\n\n return counts\nend", "def buy_tickets\n tally = films().map {|ticket| ticket.price.to_f}\n tally.each {|price| @wallet -= price}\n num_of_tickets\n screenings = tickets().map{|ticket| ticket.screening}\n screenings_flat = screenings.flatten\n screenings_flat.map {|screening| screening.tickets_available -= 1}\n screenings_flat.each {|screening| p screening.update }\n update()\n end", "def count_occurrences(vehicles)\n occurences = {}\n\n vehicles.each do |vehicle|\n occurences[vehicle] = vehicles.count(vehicle)\n end\n\n occurences.each do |vehicle, count|\n puts \"#{vehicle} => #{count}\"\n end\nend", "def count\n count = 0\n each do |data|\n count += 1\n end\n count\n end", "def tickets_per_screening()\n sql = \"SELECT t.* FROM tickets t INNER JOIN films f ON t.film_id=f.id INNER JOIN screenings s ON s.film_id=f.id WHERE s.id = #{@id};\"\n shows_array = SqlRunner.run(sql)\n result = shows_array.map {|show| Screening.new(show)}\n fin_result = result.length()\n return fin_result\n end", "def add_item_counts(cart:[])\n cart.each do |item|\n item.map { |food_item, info| info[:count] = count_item(food_item, cart) }\n end\nend", "def count_items(electives)\n electives.length #counts number of items in the array\nend", "def stock_count(stock_count_array)\n stock_count_array[:pets].count\nend", "def count_freq(array)\n array.each_with_object(Hash.new(0)) { |obj, counts| counts[obj] += 1 }\n end", "def Occurrence_count(arr)\n\th1={}\n\tarr.each do |element|\n\t\th1[\"#{element}\"].nil? ? h1[\"#{element}\"]=1 : h1[\"#{element}\"]+=1\n\tend\n\th1.each do |key,value|\n\t\tputs \"\tOccurrence of #{ key } in the array is #{value} times \"\n\tend\t\nend", "def get_counts(commits)\n commits.reduce([[], []]) do |counts, commit|\n classification = self.classify(commit)\n if classification == 'Good'\n counts[0] << commit\n else\n counts[1] << commit\n end\n counts\n end\n end", "def count_occurrences(array)\n\toccurences = {}\n\n\tarray.each do |element|\n\t\toccurences[element] = array.count(element)\n\tend\n\n\toccurences.each do |element, count|\n\t\tputs \"#{element} => #{count}\"\n\tend\t\nend", "def number_of_films()\n sql = \"SELECT * FROM tickets where customer_id = $1\"\n values = [@id]\n ticket_data = SqlRunner.run(sql, values)\n return ticket_data.count\n end", "def service_count_for_hashes(hash_array)\n hash_array.collect(&:service).collect(&:id).uniq.size\n end", "def tickets_looper(email_body, section, type, file, statuses, tickets, ticket_details)\n i = 0\n\n File.open(file).readlines.each do |cLine|\n # Check if the file has been added\n if cLine.include?(type) && statuses.inject(false) { |memo, status| cLine.downcase.include?(status.downcase) || memo }\n unless $tickets_list.include?(cLine.split(\"\\t\")[1]) || $tickets_list.include?(cLine.split(\"\\t\")[1] + \" <span style='color: #FF6A77'>⇨ \" + cLine.split(\"\\t\")[4] + \"</span>\")\n if cLine.split(\"\\t\")[4].downcase == \"done\"\n tickets << cLine.split(\"\\t\")[1]\n else\n tickets << cLine.split(\"\\t\")[1] + \" <span style='color: #FF6A77'>⇨ \" + cLine.split(\"\\t\")[4] + \"</span>\"\n end\n\n i = i + 1\n end\n end\n end\n\n if i > 0\n $tickets_list = tickets + ($tickets_list - tickets)\n ticket_details[:nb_tickets] = i\n end\nend", "def hit_count()\n #This is a stub, used for indexing\n end", "def count_basket(basket)\n basket.each do |item_id|\n increase_item_count(item_id)\n end\n end", "def count_items\n @baskets.rows.each do |basket|\n count_basket(basket)\n end\n end", "def count(list)\n list.each do |hash|\n total += 1\n end\n return total\n end", "def count_occurrences(vehicles)\n occurrences = Hash.new(0)\n vehicles.each { |vehicle| occurrences[vehicle] += 1 }\n occurrences.each { |key, value| puts \"#{key} => #{value}\" }\nend", "def count_occurrences(array)\n result = {}\n array.each do |x|\n result[x] = if !result.key?(x)\n 1\n else\n result.fetch(x) + 1\n end\n end\n result.each do |k, count|\n p \"#{k} => #{count}\"\n end\nend", "def count_occurrences(vehicles)\n occurences = {}\n uniq_vehicles = Array.new(vehicles.uniq)\n\n uniq_vehicles.each do |vehicle|\n occurences[vehicle] = vehicles.count(vehicle)\n end\n occurences.each { |k, v| puts \"#{k} => #{v}\"}\nend", "def sentiments_counts\n #This will get the sentiments related to each instance\n x = self.sentiments\n\n #These two lines are instantiated for the while loop below\n y = 0\n sentiments_count = []\n\n #This is a loop taking 'positive', 'negative', or 'neutral' from the instances\n while y < x.count\n sentiments_count << x[y][:sentiment]\n y += 1\n end\n\n #This creates a hash and counts each of the words' occurrences in the array\n #The output will look something like:\n # {\"Positive\" => 2, \"Neutral\" => 1, \"Negative\" => 3}\n hash = sentiments_count.each_with_object(Hash.new(0)) { |word,counts| counts[word] += 1 }\n hash.map {|key, value| puts \"#{key} - #{value}\"}\n end", "def index\n @project = Project.find(params[:project_id])\n @ticket = @project.tickets.new\n\n @tags = Ticket.tag_counts_on(:tags)\n\n if params[:tags]\n @tickets = {}\n @tickets[:both] = [params[:tags].gsub(', ', ',').split(',').map(&:capitalize).join(', '), @project.tickets.tagged_with(params[:tags])]\n @tickets[:other] = params[:tags].gsub(', ', ',').split(',').map do |tag|\n [tag.capitalize, (@project.tickets.tagged_with(tag) - @tickets[:both][1])]\n end\n else\n @tickets = @project.tickets\n end\n end", "def count_results(result_array)\n results = empty_counter\n result_array.each do |topic|\n topic.keys.each {|key| results[key] += topic[key]}\n end\n results\n end", "def count_occurrences(vehicles)\n occur_count = Hash.new(0)\n vehicles.each { |str| occur_count[str.to_sym] += 1 }\n occur_count.each { |vehicle, count| puts \"#{vehicle} => #{count}\" }\nend", "def all_customers_alt() # Read film1.all_customers_alt\n sql = \"SELECT COUNT(id) FROM tickets WHERE film_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n count_hash = result[0]\n return count_hash['count']\n end", "def ticket_values(ticket)\n ticket.split(',').map(&:to_i)\n end", "def update_kept_request_count\n new_kept_data = kept.map do |kept_data|\n parsed = Hanami::Utils::Json.parse(kept_data)\n parsed['count'] += 1 if is_hash?(parsed) && parsed['count'].is_a?(Integer)\n Hanami::Utils::Json.generate(parsed)\n end\n\n update_kept(new_kept_data)\n end", "def count_occurrences(array)\n return puts('Invalid Array') unless array.is_a?(Array)\n return puts('There is nothing to count') if array.empty?\n\n counts = array.each_with_object(Hash.new(0)) do |word, hash|\n hash[word] += 1\n end\n\n counts.each do |word, count|\n puts \"#{word} => #{count}\"\n end\nend", "def fix_counts_for_actions(action_ids, real_action_array, stubbed_action_array)\n action_ids.each do |action_id|\n real_action_hash=real_action_array.detect {|a| a[\"id\"] == action_id}\n stubbed_action_hash=stubbed_action_array.detect {|a| a[\"id\"] == action_id}\n real_action_hash[\"count\"] = stubbed_action_hash[\"count\"]\n end \n end", "def count; end", "def count; end", "def count; end", "def show\n @num = @ticket.number_of_tickets\n end", "def count_elements(array)\n newArray = []\n array.each do |obj|\n newArray.push(obj)\n obj[:count] = 0\n #if newArray.length > 0\n newArray.each do |obj|\n if obj.include?(:count)\n obj[:count] += 1\n else\n obj[:count] = 1\n end\n #binding.pry\n end\n #end\n end\n newArray.shift\n return newArray\nend", "def ticket_params\n params.permit(:count)\n end", "def count(array)\n hash = {}\n array.each do |item|\n hash[item] = array.count(item)\n end\n hash\nend", "def check_in_count()\n return @guests.length #guests array length\n end", "def count_elements(array)\n new_hash = {}\n count = 0\n array.each do |x|\n if new_hash.key? x\n new_hash[x] = new_hash[x] + 1\n #binding.pry\n else\n new_hash[x] = 1\n end\n end\n new_hash\n # code goes here\nend", "def count_occurrences(array)\n count = Hash.new\n counter = 0\n array.each { |i| \n if count[i] == nil\n count[i] = 1\n else\n count[i] = count[i] += 1\n end\n counter += 1\n }\n count.each_pair { |k, v| puts \"#{k} => #{v}\"}\nend", "def offense_counts; end", "def offense_counts; end", "def get_counts_for_all_entities\n @tracker.counts\n end", "def count(summary='', product=\"\", component=\"\")\n url = \"#{@url}/buglist.cgi?product=#{product}&component=#{component}&short_desc=#{CGI.escape(summary)}&short_desc_type=allwordssubstr\"\n @log.debug url\n page = @agent.get(url)\n if page.search(\".//td[@id='error_msg']\").empty?\n @log.debug \"Authenticated successfully\"\n @log.debug page.search(\"//span[@class='bz_result_count']\")[0].content\n count = page.search(\"//table[@class='bz_buglist']/tr\").length\n count -= 1 if count > 0\n return count\n else\n @log.error page.search(\".//td[@id='error_msg']\")[0].content.strip\n end\n return 0\n end", "def photos_count(info_count)\n x = info_count.inject(Hash.new(0)) { |h, e| h[e] += 1 ; h }\nend", "def issue_count\n issue_count = 0\n self.sections.each { | section| issue_count += section.issue_count }\n issue_count\n end", "def count_tokens()\n @counts = Hash.new(0)\n @tokens.each do |token|\n @counts[token] += 1\n end\n @counts\n end", "def get_vote_count(postid_array)\n values = Array.new\n postid_array.each do |x|\n values << get_votes_for_post(x)\n end\n values.inject{|sum,y| sum + y }\n end", "def update_tickets\n new_ticket_count = self.user.tickets - self.attraction.tickets\n self.user.tickets = new_ticket_count\n self.user.save\n end", "def tag_counts\n if @tag_counts.nil?\n @tag_counts = {}\n tasks.each do |task|\n task.tags.each do |tag|\n @tag_counts[tag] = (@tag_counts[tag] || 0) + 1\n end\n end\n end\n\n return @tag_counts\n end", "def count(category)\n count = 0\n self.votes.each do |v|\n if v.category == category\n count+=1\n end\n end\n count\n end", "def cat_count\n total_arr = []\n counter = 0\n #cat_array1 = [\"Characters\", \"Films\", \"Planets\", \"Starships\", \"Species\"]\n\n 5.times do\n #x = cat_array1[0]\n url_array = [\"http://www.swapi.co/api/people\", \"http://www.swapi.co/api/films\",\n \"http://www.swapi.co/api/planets\", \"http://www.swapi.co/api/starships\",\n \"http://www.swapi.co/api/species\"]\n response_string = RestClient.get(url_array[counter])\n response_hash = JSON.parse(response_string)\n total = response_hash[\"count\"]\n total_arr << total\n counter = counter + 1\n end\n total_arr\nend", "def counts_one_line(array)\n array.each_with_object(hello = Hash.new(0)) {|x, counts| counts[x] += 1}\n hello\nend", "def count(chr = nil, start = nil, stop = nil) \n num = 0\n self.each(chr, start, stop) { |entry| num += 1 }\n num\n end", "def count_hash(arr)\n count = {}\n arr.each {|e|\n count[e] ||= 0\n count[e] += 1\n }\n count\n end", "def count_contestants_by_hometown(data, hometown)\n counter = 0 # COUNTER VALUE HAS TO BE HERE\n data.each do |season, season_array|\n season_array.each do |into_array|\n if into_array[\"hometown\"] == hometown\n counter += 1\n # binding.pry\n end \n end \n end\n counter\nend", "def t_counts (conn, log, t)\n log.d(\"Checking counts.\");\n q = \"SELECT COUNT(*) AS c FROM #{t}\";\n log.d(q);\n conn.query(q) do |r|\n log.d(r[:c]);\n end\nend", "def count_items(elective_array)\n return elective_array.length\nend", "def count\n end", "def count\n end", "def count_occurrences(array)\n count = ''\n output = { }\n\n array.each do |item|\n count = array.count(item)\n output[item] = count\n end\n output.each do |key, value|\n puts \"#{key} => #{value}\"\n end\nend", "def customer_pet_count(customer_array)\n customer_array[:pets].count\nend", "def count_classes\n case object.notices_count\n when 0..1 then [\"count-one\"]\n when 2..5 then [\"count-two\"]\n when 5..16 then [\"count-five\"]\n when 16..64 then [\"count-sixteen\"]\n when 64..128 then [\"count-sixty-four\"]\n else [\"count-very-many\"]\n end\n end", "def count_occ(usages_list)\n count = 0\n usages_list.each do |k,v|\n if k['location']['type'] == 'pipeline'\n count += 1\n end\n end\n return count\nend", "def count_stuff\n @members.each do |member|\n if member.active\n @active += 1\n if member.paymentstatus && member.membershipyear.to_i == Time.now.year.to_i\n @paidthisyear += 1\n end\n\n if !member.membergroup.onetimefee || member.membershipyear.to_i == Time.now.year.to_i\n @total += member.membergroup.fee\n end\n\n if @membergroups[member.membergroup.name.to_sym]\n @membergroups[member.membergroup.name.to_sym] = @membergroups[member.membergroup.name.to_sym] + 1\n else\n @membergroups[member.membergroup.name.to_sym] = 1\n end\n\n if @municipalities[member.municipality.to_sym]\n @municipalities[member.municipality.to_sym] = @municipalities[member.municipality.to_sym] + 1\n else\n @municipalities[member.municipality.to_sym] = 1\n end\n\n else\n @deleted += 1\n end\n\n end\n @municipalities = @municipalities.sort_by { |key, value| value }.reverse\n end", "def count_elements(arr)\n counter = Array.new\n counter_helper = Array.new\n arr.each do |element|\n if counter_helper.include?(element)\n counter[counter_helper.find_index(element)][:count] += 1\n else\n counter_helper.push(element.clone)\n element[:count] = 1\n counter.push(element)\n end\n end\n counter\nend", "def getCounts (coins, sums, array, hash)\n for a in array\n if coins.include? a\n hash[a] == nil ? hash[a] = 1 : hash[a] += 1\n else\n otherCoins = sums[a][0]\n getCounts(coins, sums, otherCoins, hash)\n end\n end\nend", "def count_occurrences(arr)\n answer = Hash.new(0)\n arr.each { |item| answer[item] += 1}\n answer.each {|key, value| puts \"#{key} => #{value}\" }\nend", "def count\n @monkeys.count\n end", "def count(key)\n @counter[key]\n end", "def counts\n @counts ||=\n begin\n h = {}\n by_label.each do |label, notes|\n h[label] = notes.size\n end\n h\n end\n end", "def element_count(arr)\n\n # initialize 0 as needed to count\n count = Hash.new(0)\n arr.each do |c|\n count[c] += 1 \n end\n return count\n\nend" ]
[ "0.7177721", "0.7157538", "0.6958222", "0.6901622", "0.68093836", "0.6690278", "0.66766125", "0.6598204", "0.6578278", "0.6473234", "0.6434859", "0.63869476", "0.6377115", "0.636177", "0.6310528", "0.6284032", "0.62742954", "0.6266023", "0.6170504", "0.61330384", "0.6131447", "0.61035496", "0.60921603", "0.60834235", "0.60576683", "0.59829766", "0.598284", "0.59011394", "0.58952886", "0.58896834", "0.5887671", "0.5887444", "0.5859232", "0.5851708", "0.5823776", "0.58133435", "0.5801873", "0.58018607", "0.577304", "0.5764901", "0.5760445", "0.5749153", "0.5743611", "0.5724117", "0.571943", "0.5716074", "0.57160485", "0.5715277", "0.5708987", "0.5708955", "0.57026243", "0.57025284", "0.57016057", "0.5700095", "0.5699065", "0.5695818", "0.5685399", "0.5679506", "0.5673938", "0.5673938", "0.5673938", "0.56705195", "0.56693286", "0.5667327", "0.5661538", "0.5659627", "0.5656408", "0.5647993", "0.5644432", "0.5644432", "0.5640779", "0.56404084", "0.563582", "0.5633696", "0.5628001", "0.5626414", "0.5622683", "0.5618273", "0.56134367", "0.5609565", "0.5607864", "0.5603567", "0.56005824", "0.5594273", "0.5593897", "0.55820316", "0.5578556", "0.5578556", "0.55745345", "0.5567299", "0.5540912", "0.5539475", "0.55392116", "0.5536557", "0.5528564", "0.55257165", "0.55186206", "0.5514982", "0.5512842", "0.55057365" ]
0.7386948
0
finds films a customer has tickets for
def find_films_for_each_customer() sql = "SELECT films.* FROM films INNER JOIN tickets ON tickets.film_id = films.id WHERE customer_id = $1" values = [@id] films = SqlRunner.run(sql, values) result = films.map {|film| Film.new(film)} return result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.cust_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n return films.map{|film| Film.new(film)}\n end", "def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON tickets.film_id = films.id WHERE customer_id = $1\"\n values = [@id]\n film_data = SqlRunner.run(sql, values)\n return Film.map_items(film_data)\n end", "def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n return films.map {|film| Film.new(film)}\n end", "def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.customer_id = $1;\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n return films.map{|film| Film.new(film)}\n end", "def films\n sql = \"SELECT films.*\n FROM films\n INNER JOIN tickets\n ON films.id = tickets.film_id\n WHERE tickets.customer_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values).map { |film_hash| Film.new(film_hash) }\n end", "def tickets()\n return films().count()\n end", "def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON\n films.id = tickets.film_id WHERE tickets.customer_id = $1;\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = Film.map_films(films)\n end", "def films()\n sql = \"SELECT films.* FROM films\n INNER JOIN tickets ON tickets.film_id = films.id\n WHERE tickets.customer_id = $1\"\n values = [@id]\n film_array = SqlRunner.run(sql, values)\n result = film_array.map { |film| Film.new( film ) }\n return result\n end", "def customers_for_film()\n sql = \"SELECT name FROM customers\n INNER JOIN tickets ON customers.id = tickets.customer_id\n WHERE film_id = $1 ORDER BY name\"\n values = [@id]\n customer_data = SqlRunner.run(sql, values)\n return Customer.map_items(customer_data)\n end", "def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n films_array = SqlRunner.run(sql, values)\n films = films_array.map { |film_hash| Film.new(film_hash)}\n return films\n end", "def tickets()\n sql = \"SELECT tickets.* FROM films INNER JOIN screenings ON films.id = screenings.film_id INNER JOIN tickets ON screenings.id = tickets.screening_id WHERE film_id = $1;\"\n values = [@id]\n films_hash = SqlRunner.run(sql, values)\n return Film.map_films(films_hash).count\n end", "def films()\n sql = \"\n SELECT films.* FROM films\n INNER JOIN tickets ON tickets.film_id =\n films.id WHERE customer_id = $1\n \"\n values = [@id]\n result = SqlRunner.run(sql, values)\n\n return nil if result.count == 0\n return result.map {|film| Film.new(film)}\n end", "def films_customer_sees()\n sql = \"SELECT * FROM films INNER JOIN tickets\n ON films.id = tickets.film_id WHERE customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = films.map {|film_hash| Film.new(film_hash)}\n return result\nend", "def count_tickets()\n sql = \"SELECT films.* FROM films\n INNER JOIN tickets ON\n tickets.film_id = films.id\n WHERE customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = films.map{|film| Film.new(film)}\n return result.count\n end", "def films()\n sql = \"SELECT DISTINCT films.* FROM films\n INNER JOIN screenings ON films.id = screenings.film_id\n INNER JOIN tickets ON screenings.id = tickets.screening_id\n WHERE tickets.customer_id = $1;\"\n values = [@id]\n films_array = SqlRunner.run(sql, values)\n return Film.map_to_objects(films_array)\n end", "def booked_films()\n # sql\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE customer_id = $1;\"\n # values\n values = [@id]\n # sql runner\n results = SqlRunner.run(sql, \"get_all_booked_films\", values)\n # return\n return results.map {|film| Film.new(film)}\n end", "def how_many_films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON\n films.id = tickets.film_id WHERE tickets.customer_id = $1;\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = Film.map_films(films).count\n end", "def number_of_films()\n sql = \"SELECT * FROM tickets where customer_id = $1\"\n values = [@id]\n ticket_data = SqlRunner.run(sql, values)\n return ticket_data.count\n end", "def how_many_films()\n return have_ticket_for_which_films().size()\n end", "def show_films\n sql = \"SELECT films.* FROM films INNER JOIN screenings ON screenings.film_id = films.id INNER JOIN tickets on screenings.id = tickets.screening_id INNER JOIN customers on customers.id = tickets.customer_id WHERE customers.id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n return result.map {|film| Film.new(film)}\n end", "def tickets()\n sql = \"SELECT * FROM tickets WHERE film_id = $1;\"\n values = [@id]\n tickets = SqlRunner.run(sql, values)\n return Ticket.map_items(tickets).count\n end", "def booked_films()\n sql = \"SELECT films.* FROM films\n INNER JOIN screenings\n\t ON films.id = screenings.film_id\n INNER JOIN tickets\n ON screenings.id = tickets.screening_id\n WHERE tickets.customer_id = $1\n ORDER BY films.id;\"\n values = [@id]\n result = SqlRunner.run(sql, values) # array of hashes.\n booked_films = result.map { |film| Film.new(film) }\n return booked_films.uniq # no duplicates.\n end", "def films\n sql = \"SELECT films.* FROM films\n INNER JOIN tickets\n ON tickets.film_id = films.id\n WHERE tickets.customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n return films.map{|film| Film.new(film)}\nend", "def show_customers\n sql = \"SELECT customers.* FROM films INNER JOIN screenings ON films.id = screenings.film_id INNER JOIN tickets ON screenings.id = tickets.screening_id INNER JOIN customers on tickets.customer_id = customers.id WHERE films.id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n return result.map {|customer| Customer.new(customer)}\n end", "def customers\n sql = \"SELECT customers.* FROM customers INNER JOIN tickets ON tickets.customer_id = customers.id WHERE tickets.film_id = #{@id};\"\n return Customer.map_items(sql) \n end", "def customers()\n sql = \"SELECT customers.* FROM customers INNER JOIN tickets ON customers.id = tickets.customer_id WHERE film_id = $1\"\n values = [@id]\n customer_data = SqlRunner.run(sql, values)\n return Customer.map_items(customer_data)\n end", "def all_customers() # RETURN film1.all_customers (returns all customers attending that film)\n sql = \"SELECT customers.* FROM customers INNER JOIN tickets ON customers.id = tickets.customer_id\n WHERE tickets.film_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n result = customers.map { |customer| Customer.new(customer) }\n return result\n end", "def customers_at_film()\n sql = \"SELECT * FROM customers INNER JOIN tickets\n ON customers.id = tickets.customer_id WHERE film_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n result = customers.map {|customer_hash| Customer.new(customer_hash)}\nend", "def number_of_tickets_bought() # working in terminal - console (eg.: customer1.number_of_tickets_bought)\n return films.count\n end", "def customers()\n sql = \"SELECT customers.*\n FROM customers\n INNER JOIN tickets\n ON customers.id = tickets.customer_id\n WHERE film_id = $1\"\n values = [@id]\n star_data = SqlRunner.run(sql, values)\n return Star.map_items(star_data)\n end", "def customers()\n sql = \"SELECT DISTINCT customers.*\n FROM customers\n INNER JOIN tickets\n ON tickets.customer_id = customers.id\n WHERE film_id = $1\"\n values = [@id]\n customer_hash = SqlRunner.run(sql, values)\n result = customer_hash.map {|customer| Customer.new(customer) }\n return result\n end", "def customers()\n sql = \"SELECT customers.* FROM customers INNER JOIN tickets ON customers.id = tickets.cust_id WHERE tickets.film_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n return customers.map{|cust| Customer.new(cust)}\n end", "def count_of_customers_watching_film()\n sql = \"SELECT COUNT(*) FROM customers INNER JOIN tickets ON customers.id = tickets.cust_id WHERE tickets.film_id = $1\"\n # sql = \"SELECT COUNT(*) FROM tickets where film_id = $1\"\n values = [@id]\n cust_count = SqlRunner.run(sql, values)\n return cust_count[0]['count'].to_i\n end", "def all_tickets()\n sql = \"SELECT customers.name, films.title, tickets.id\n FROM tickets\n INNER JOIN customers\n ON tickets.customer_id = customers.id\n INNER JOIN screenings\n ON tickets.screening_id = screenings.id\n INNER JOIN films\n ON screenings.film_id = films.id\n WHERE customers.id = $1\"\n values = [@id]\n result = Sqlrunner.run(sql, values)\n return result.each {|info| p info}\n end", "def customers()\n sql = \"SELECT customers.* FROM customers INNER JOIN tickets ON customers.id = tickets.customer_id INNER JOIN screenings ON screenings.id = tickets.screening_id INNER JOIN films ON films.id = screenings.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n return Customer.map_customers(customers)\n end", "def find_number_of_customers\n sql = \"SELECT customers.*\n FROM customers\n INNER JOIN tickets\n ON tickets.customer_id = customers.id\n WHERE film_id = $1\"\n values = [@id]\n customers_array = SqlRunner.run(sql, values)\n customer_objects = customers_array.count\n return customer_objects\n end", "def customers()\n sql = \"SELECT DISTINCT customers.* FROM customers\n INNER JOIN tickets ON customers.id = tickets.customer_id\n INNER JOIN screenings ON tickets.screening_id = screenings.id\n WHERE screenings.film_id = $1;\"\n values = [@id]\n customers_array = SqlRunner.run(sql, values)\n return Customer.map_to_objects(customers_array)\n end", "def tickets_purchased\n return film().count\n end", "def all_customers()\n sql = \"SELECT customers.* FROM customers\n INNER JOIN tickets on customers.id = tickets.customer_id\n WHERE tickets.film_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values) #array of hashes\n booked_customers = result.map { |customer| Customer.new(customer)}\n return booked_customers\n end", "def customer()\n sql = \"SELECT customers.* from customers INNER JOIN tickets on\n customers.id = tickets.customer_id WHERE film_id = $1 \"\n values = [@id]\n results = SqlRunner.run(sql, values)\n results.map {|result| Customer.new(result)}\n end", "def customers\n sql = \"SELECT customers.* FROM customers\n INNER JOIN tickets ON customers.id = tickets.customer_id\n WHERE tickets.film_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n array_of_customer_objects = result.map {|row_hash| Customer.new(row_hash)}\n return array_of_customer_objects\n end", "def number_of_customers()\n sql = 'SELECT title, SUM(CASE WHEN customer_id is NULL then 0 else 1 END) FROM tickets FULL OUTER JOIN screenings on tickets.screening_id = screenings.id FULL OUTER JOIN films on screenings.film_id = films.id WHERE films.id = $1 group by films.title'\n values = [@id]\n result = SqlRunner.run(sql, values)[0]['sum'].to_i\n end", "def ticket_count()\n return self.booked_films.count\n end", "def customer_count\n sql = \"SELECT c.* FROM customers c INNER JOIN tickets t ON t.customer_id = c.id WHERE t.film_id = #{@id};\"\n customers = SqlRunner.run(sql)\n return customers.count\nend", "def tickets_bought()\n tickets_array = films()\n number_of_tickets = tickets_array.count\n return \"#{@name} has bought #{number_of_tickets} tickets.\"\n end", "def tickets_per_screening()\n sql = \"SELECT t.* FROM tickets t INNER JOIN films f ON t.film_id=f.id INNER JOIN screenings s ON s.film_id=f.id WHERE s.id = #{@id};\"\n shows_array = SqlRunner.run(sql)\n result = shows_array.map {|show| Screening.new(show)}\n fin_result = result.length()\n return fin_result\n end", "def customers\n sql = \"SELECT customers.*\n FROM customers INNER JOIN tickets\n ON tickets.customer_id = customers.id\n WHERE film_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n return customers.map {|customer_hash| Customer.new(customer_hash)}\nend", "def kent_supporting_actor_films\n MovieDatabase.execute(<<-SQL)\n SELECT \n movies.title,\n actors.name\n FROM\n movies\n INNER JOIN\n castings ON movies.id = castings.movie_id\n INNER JOIN \n actors ON castings.actor_id = actors.id\n WHERE \n actors.name LIKE '% Kent'AND castings.ord != 1\n ORDER BY movies.title;\n SQL\nend", "def buy_film_ticket(film, screening)\n # Checks if seat available, if so creates ticket, reduces customer's wallet by\n # price of film and returns new ticket.\n\n # #screening = Screening.find_screening(film.id, date, time)\n\n available_seats = screening.check_available_seats()\n\n if available_seats == 0\n return nil\n end\n\n new_ticket = Ticket.new({'customer_id' => @id, 'film_id' => film.id,\n 'screening_id' => screening.id})\n\n new_ticket.save()\n\n #update tickets sold by 1\n\n screening.increase_tickets_sold()\n\n @funds -= film.price\n\n update()\n\n return new_ticket\n end", "def showtimes(movie)\n self.showings.select do |showing|\n showing.movie == movie\n end\n end", "def customers\n sql = \"SELECT customers.* FROM customers\n INNER JOIN tickets ON tickets.customer_id = customers.id\n WHERE tickets.film_id = $1\"\n values = [@id]\n customer_array = SqlRunner.run(sql, values)\n result = customer_array.map { |customer| Customer.new( customer ) }\n return result\n end", "def tickets()\n # Customer buys a ticket, and price of ticket is subtracted from customer funds\n sql = \"SELECT SUM(films.price) FROM films INNER JOIN tickets\n ON films.id = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values).first\n return @funds - result['sum'].to_i()\n end", "def num_of_tickets()\n result = films()\n @number_of_tickets = result.count\n end", "def screenings()\n sql = \"SELECT screenings.*\n FROM screenings\n INNER JOIN tickets\n ON screenings.id = tickets.screening_id\n WHERE tickets.customer_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return nil if results.count == 0\n found_screenings = results.map{|film| Screening.new(film)}\n return found_screenings\n\n end", "def all_customers_alt() # Read film1.all_customers_alt\n sql = \"SELECT COUNT(id) FROM tickets WHERE film_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n count_hash = result[0]\n return count_hash['count']\n end", "def actors\n\n # 1) get all film_actors (from the join table)\n # 2) get their actors\n film_actors = FilmActor.where film_id: film_id\n Actor.where actor_id: film_actors.pluck(:actor_id)\n\n # Actor.where actor_id: [3, 22, 38, ...]\n\n # Actor.where film_id:\n end", "def find_castings_by_movie\n sql = \"SELECT fee FROM castings\n WHERE movie_id = $1 \"\n values = [@id]\n movie_casting_info = SqlRunner.run(sql, values)\n return movie_casting_info.map { |casting| Casting.new(casting)}\n # fees_array.each { |casting, fee| casting['fee'] }\n # fees_only = fees_array\n end", "def films\n self.screenings.map do |screening|\n screening.festival.title\n end\n end", "def tickets_bought()\n sql = \"SELECT * FROM tickets WHERE customer_id = $1;\"\n values = [@id]\n ticket_hash = SqlRunner.run(sql, values)\n result = Ticket.map_tickets(ticket_hash)\n end", "def buy_tickets(film)\n if @funds >= film.price\n @funds -= film.price\n return @funds\n else\n return \"Insufficient funds!\"\n end\n end", "def buy_ticket(film_to_see, screen)\n if (@funds >= film_to_see.price) && (screen.tickets_sold < screen.tickets_limit) # Limit the available tickets for screenings.\n new_ticket = Ticket.new({'cust_id' => @id, 'film_id' => film_to_see.id, 'screen_id' => screen.id})\n new_ticket.save()\n @funds -= film_to_see.price\n update()\n screen.tickets_sold += 1 #count of tickets sold of particular screen\n screen.update()\n return new_ticket\n end\n return nil\n end", "def tickets()\n sql = \"SELECT * FROM tickets where customer_id = $1\"\n values = [@id]\n ticket_data = SqlRunner.run(sql, values)\n return ticket_data.map{|ticket| Ticket.new(ticket)}\n end", "def tickets\n where(:_type => TicketCategory.name)\n end", "def twenty_roles\n MovieDatabase.execute(<<-SQL)\n select 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\n group by actor.name\n having count(movie.id) = 20\n SQL\nend", "def most_popular_screening_film\n most_popular = nil\n unsold_tickets = 2 #max capacity of the cinema\n screenings = return_film_screenings\n screenings.each do |screening|\n if screening.tickets_left.to_i < unsold_tickets\n most_popular = screening\n end\n end\n return most_popular\n end", "def tickets\n sql = \"\n SELECT * FROM tickets\n WHERE customer_id = $1\n \"\n values = [@id]\n result = SqlRunner.run(sql, values)\n return nil if result.count == 0\n return result.map {|ticket| Ticket.new(ticket)}\n end", "def tickets_bought\n sql = \"SELECT COUNT(*)\n FROM tickets\n WHERE tickets.customer_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)[0][\"count\"].to_i\n end", "def reviews\n Review.all.select {|review| review.customer == self}\n end", "def charge_customer()\n array = find_films()\n # charge = ticket_cost\n for film in array\n result = @funds - film.price\n @funds = result\n end\n update\n end", "def customers()\n sql = \"SELECT DISTINCT customers.* FROM customers\n INNER JOIN tickets\n ON customers.id = tickets.customer_id\n WHERE tickets.screening_id = $1;\"\n values = [@id]\n customers_array = SqlRunner.run(sql, values)\n return Customer.map_to_objects(customers_array)\n end", "def viewers(m, set=@trainingSet)\n (set.data.select {|item| item[@MOVIE_ID].to_i == m}).collect {|item| item[@USER_ID].to_i}\n end", "def customer\n @@all.select {|review| self.restaurant.customers}\n end", "def tsui_hark_films\n MovieDatabase.execute(<<-SQL)\n SELECT\n movies.title\n FROM\n movies\n JOIN castings ON castings.movie_id = movies.id\n JOIN actors ON actors.id = castings.actor_id\n WHERE\n movies.director = (\n SELECT\n id\n FROM\n actors\n WHERE\n name = 'Tsui Hark'\n )\n GROUP BY\n movies.title\n ORDER BY\n movies.title\n SQL\nend", "def buys_ticket(film, show_time)\n viewing = film.find_specific_screening(show_time)\n admission_price = viewing[0].price\n if self.check_funds(admission_price) == true\n @funds -= viewing[0].price\n new_ticket = Ticket.new({\n 'film_id' => film.id,\n 'customer_id' => self.id,\n 'screening_id' => viewing[0].id\n })\n new_ticket.save\n self.update\n else\n return \"No Sale\"\n end\n end", "def meals\r\n Meal.all.select do |meal|\r\n meal.customer == self\r\n end\r\n end", "def buy_tickets\n tally = films().map {|ticket| ticket.price.to_f}\n tally.each {|price| @wallet -= price}\n num_of_tickets\n screenings = tickets().map{|ticket| ticket.screening}\n screenings_flat = screenings.flatten\n screenings_flat.map {|screening| screening.tickets_available -= 1}\n screenings_flat.each {|screening| p screening.update }\n update()\n end", "def meals\n Meal.all.select {|m| m.customer == self}\n end", "def retrieve_film_reviews(film_name)\n api_key = ENV['REVIEW_API_KEY']\n @latest_film_data = JSON.parse(self.class.get(\"/svc/movies/v2/reviews/search.json?query=#{film_name}&api-key=#{api_key}\").body)\n end", "def bearded_films\n MovieDatabase.execute(<<-SQL)\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 = 'Chuck Norris'\n SQL\nend", "def buy()\n #films the customer has tickets to\n all_films = films()\n #sum the films (as there can be more than one) and from each film add the price up and assign it to price\n price = all_films.sum{|film| film.price}\n remaining_funds = @funds - price\n @funds = remaining_funds\n update() #update the customer's funds!\n end", "def tickets\n Ticket.all.select do |ticket|\n ticket.event == self\n end\n end", "def capacity_check(film)\n if film.num_customers_in_film < @capacity\n return \"tickets available\"\n else\n return \"this showing is full\"\n end\n end", "def actors\n Actor.where(:movie_id => id)\n end", "def customers()\n sql = \"SELECT customers.* FROM customers\n INNER JOIN tickets\n ON tickets.customer_id = customers.id\n WHERE tickets.screening_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n return customers.map{|customer| Customer.new(customer)}\nend", "def find_frequently_reviewed_restaurants(topic, reviewer)\n restaurants = reviewer.subscribed_restaurants.by_topic(topic.id)\n frequency_with_restaurants = {}\n restaurants.each do |restaurant|\n frequency_with_restaurants[restaurant] ||= 0\n frequency_with_restaurants[restaurant] += 1\n end\n\n sorted = frequency_with_restaurants.sort{|v1, v2| v2.last <=> v1.last}\n\n # Take top 5 restaurants\n sorted[0..5]\n end", "def meals\n Meal.all.select do |meal|\n meal.customer == self\n end\n end", "def viewers(m)\n\t\tviewer_list = []\n\t\ttraining_set.each do |row|\n\t\t\tif row[\"movie_id\"] == m\n\t\t\t\tviewer_list.push({\"user_id\"=>row[\"user_id\"],\"rating\"=>row[\"rating\"]})\n\t\t\tend\n\t\tend\n\t\treturn viewer_list\n\tend", "def buy_ticket()\n sql = \"SELECT SUM (films.price) FROM films INNER JOIN tickets ON films.price = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values).first\n return @funds - result['sum'].to_i\n end", "def meals\n Meal.all.select do |meal|\n meal.customer == self\n end \n end", "def costars(name)\n # List the names of the actors that the named actor has ever\n # appeared with.\n # Hint: use a subquery\n movielist = Movie.joins(:actors).where('actors.name = ?', name).pluck(:id)\n Actor.joins(:movies).where('movies.id IN (?) AND name != ?', movielist, name).pluck(:name).uniq\nend", "def meals\n Meal.all.select {|meal| meal.customer == self}\n end", "def meals\n Meal.all.select {|meal| meal.customer == self}\n end", "def customers\n self.reviews.collect do |review|\n review.customer\n end\n end", "def get_film_urls(character)\n character_hash = look_up('http://www.swapi.co/api/people/')\n film_urls = character_hash[\"results\"].find do |element|\n element[\"name\"].downcase == character\n end[\"films\"]\nend", "def doctors\n doctors = []\n appointments.each do |appt|\n doctors << appt.doctor if !doctors.include?(appt.doctor)\n end\n doctors\n end", "def tickets()\n sql = \"SELECT * FROM tickets\n WHERE customer_id = $1\"\n values = [@id]\n tickets = SqlRunner.run(sql, values)\n return tickets.map{|ticket|Ticket.new(ticket)}\nend", "def tickets\n Ticket.find_all_by_project_id_and_milestone_id(project_id, id)\n end", "def find_by_action(id)\n user.film_actions.where(action: id)\n end", "def index\n @tickets = @customer ? @customer.tickets : Ticket.all\n end", "def frequent_foods\n get(\"/user/#{@user_id}/foods/log/frequent.json\")\n end" ]
[ "0.7041169", "0.701063", "0.6978453", "0.6934411", "0.693054", "0.6916352", "0.6895286", "0.6894089", "0.68539536", "0.68207324", "0.6804413", "0.66908926", "0.665471", "0.6647484", "0.6644531", "0.65750116", "0.64996165", "0.6306582", "0.62558943", "0.6215381", "0.6206336", "0.6182275", "0.61662996", "0.6126263", "0.6066796", "0.60137326", "0.60030115", "0.59968257", "0.5894262", "0.58622617", "0.5858214", "0.58516115", "0.58292884", "0.58251375", "0.5819618", "0.56685287", "0.5609422", "0.5601461", "0.55950993", "0.5592163", "0.558906", "0.5562253", "0.5542345", "0.5490254", "0.5464273", "0.5456279", "0.545592", "0.54322726", "0.5428831", "0.54125935", "0.5411263", "0.5388424", "0.5369998", "0.5317038", "0.5265488", "0.52630556", "0.5227674", "0.52052605", "0.51971024", "0.5191651", "0.517197", "0.51628983", "0.51332223", "0.5108263", "0.5092599", "0.5062178", "0.50463265", "0.5043005", "0.5032279", "0.50102055", "0.49861148", "0.49830085", "0.49783728", "0.49528575", "0.49366692", "0.49340007", "0.49339616", "0.49205473", "0.49169177", "0.49153033", "0.49078703", "0.4895398", "0.48736897", "0.486733", "0.48655593", "0.48621857", "0.486218", "0.4860439", "0.4857017", "0.4846466", "0.48424882", "0.48424882", "0.48321036", "0.4831196", "0.48273236", "0.48068222", "0.47848776", "0.47618496", "0.47604156", "0.47585428" ]
0.73953915
0
this finds the prices for films for a given customer and deducts the total from the customers funds
def remaining_funds() films = self.find_films_for_each_customer() film_fees = films.map{|film| film.price} combined_fees = film_fees.sum return @funds - combined_fees end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charge_customer()\n array = find_films()\n # charge = ticket_cost\n for film in array\n result = @funds - film.price\n @funds = result\n end\n update\n end", "def buy()\n #films the customer has tickets to\n all_films = films()\n #sum the films (as there can be more than one) and from each film add the price up and assign it to price\n price = all_films.sum{|film| film.price}\n remaining_funds = @funds - price\n @funds = remaining_funds\n update() #update the customer's funds!\n end", "def update_customer_funds()\n film_cost = Film.find_film_cost(@film_id)\n\n sql = \"UPDATE customers SET funds = (funds - $1) WHERE customers.id = $2\"\n values = [film_cost, @customer_id]\n\n SqlRunner.run(sql, values)\n end", "def decrease_funds(film)\n new_funds = @funds.to_i() - film.price.to_i()\n return new_funds\n end", "def tickets()\n # Customer buys a ticket, and price of ticket is subtracted from customer funds\n sql = \"SELECT SUM(films.price) FROM films INNER JOIN tickets\n ON films.id = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values).first\n return @funds - result['sum'].to_i()\n end", "def buy_ticket()\n sql = \"SELECT SUM (films.price) FROM films INNER JOIN tickets ON films.price = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values).first\n return @funds - result['sum'].to_i\n end", "def revenue_and_profit(cust_id, start_date = nil, end_date = nil)\n\n start_date = Date.parse('0000-01-01') if (start_date.nil?)\n end_date = Date.parse('3000-01-01') if (end_date.nil?)\n\n order_data = CustomerOrder.find_by_sql(\"SELECT SUM(price) AS total,\n COUNT(1) AS copies,\n COUNT(DISTINCT(orders.orderID)) AS orders\n FROM orders, lineItem\n WHERE orders.customer_id = #{cust_id}\n AND orders.orderID = lineItem.orderID\n AND lineItem.live = 1\n AND orderDate >= '#{start_date.to_s}'\n AND orderDate <= '#{end_date.to_s}'\")[0]\n\n revenue = order_data.total.to_f\n copies = order_data.copies.to_f\n orders = order_data.orders.to_f\n\n costs = 0.0\n\n ##############################################\n # Processing costs, as percent of total inflow\n ##############################################\n\n # 2.19% credit card processing fees\n processing_fee_perc = 0.0219\n\n costs += revenue * processing_fee_perc\n\n #################\n # Per order costs\n #################\n\n # $0.49 per-transaction credit card processing fee\n processing_fee_flat = 0.49\n\n costs += orders * processing_fee_flat\n\n ###############\n # Per DVD costs\n ###############\n\n # $1.50 / DVD depreciation\n depreciation = 1.50\n\n # $0.50 / DVD shipping labor\n shipping_labor = 0.50\n\n costs += copies * (depreciation + shipping_labor)\n\n ####################\n # Per shipment costs\n ####################\n\n # $0.04 outgoing label (label and laser)\n outgoing_label = 0.04\n\n # $0.05 return label\n return_label = 0.05\n\n # $0.06 instructions\n instructions = 0.06\n\n # $0.11 adhesive tabs\n adhesive_tabs = 0.11\n\n # $0.13 postage machine rental and ink\n postage_machine = 0.13\n\n # Mail shipping rates, based on number of DVDs\n shipping_rates = { 1 => 0.87, 2 => 0.87, 3 => 1.11, 4 => 1.35, 5 => 1.83,\n 6 => 2.07, 7 => 2.31, 8 => 2.31, 9 => 2.55, 10 => 2.79 }\n\n # Shipping containers, based on number of DVDs\n shipping_containers = { 1 => 0.46, 2 => 0.46, 3 => 0.46, 4 => 0.46 }\n # Everything not 1-4 costs 0.60\n shipping_containers.default = 0.60\n\n # lookup table for cost per shipment, based on shipment size\n\n shipment_costs = Hash.new(10.00) # default for customers with > 10 items left to ship, might be low?\n\n shipping_rates.each_key do |size|\n shipment_costs[size] = (shipping_rates[size] * 2) + shipping_containers[size] + outgoing_label +\n return_label + instructions + adhesive_tabs + postage_machine\n end\n\n # Note: this assumes all unshipped items will be bundled together\n shipments = CustomerOrder.find_by_sql(\"SELECT shipmentID, count(1) as size\n FROM orders, lineItem\n WHERE orders.customer_id = #{cust_id}\n AND orders.orderID = lineItem.orderID\n AND lineItem.live = 1\n AND orderDate >= '#{start_date.to_s}'\n AND orderDate <= '#{end_date.to_s}'\n GROUP BY shipmentID\")\n\n shipments.each { |shipment| costs += shipment_costs[shipment.size.to_i] }\n\n # We don't need to include reship rate, since reshipments have line\n # items that are included here, with $0.00 revenue attached\n\n profit = revenue - costs\n\n return revenue, profit, copies, orders, shipments.size.to_i\n\nend", "def donated_amount\n self.fees.purchased.sum(:amount).to_f\n end", "def calculateCoffeeDiscount(totalCF1Count, totalPrice, priceOfProduct)\n\t\tif totalCF1Count >= 3\n\t\t\ttotalPriceCF1 = totalCF1Count * priceOfProduct\n\t\t\tdiscount = totalPriceCF1 * 2 / 3\n\t\t\tdifferenceOfPrice = totalPriceCF1 - discount\n\t\t\ttotalPrice -= differenceOfPrice\n\t\t\ttotalPrice.round(2)\n\t\tend\n\t\ttotalPrice.round(2)\n\tend", "def price_for_customer(customer)\n price\n end", "def get_ticket_price\n sql =\n \"SELECT films.price, customers.funds FROM films\n INNER JOIN tickets\n ON tickets.film_id = films.id\n INNER JOIN customers\n ON customer_id = customers.id\n WHERE tickets.id = $1\"\n values = [@id]\n ticket_price_and_funds = SqlRunner.run(sql, values)[0]\n remaining_funds = ticket_price_and_funds.map { |price, funds| funds.to_i - price.to_i}\n return remaining_funds[1] - remaining_funds[0]\n end", "def tot_deposits_made\n Rails.logger.debug(\"*** tot_deposits_made\")\n # note cannot use database sum because big_deposit is not native to database\n dep_result = 0.0\n EmployeeBenefit.where(\n \"employee_id = ? and eff_month = ? and eff_year = ? and deposited_at IS NOT NULL\",\n self.employee_id.to_s,\n self.eff_month.to_s,\n self.eff_year.to_s\n ).each do |eb|\n dep_result += round_money(eb.deposit)\n end\n Rails.logger.debug(\"*** dep_result: #{dep_result.inspect}\")\n return dep_result\n end", "def get_customer_payments2(moneda,fecha1,fecha2)\n \n \n @facturas = Factura.find_by_sql([\"\n SELECT year_mounth as year_month,\n customer_id,\n SUM(balance) as balance \n FROM facturas\n WHERE moneda_id = ? and round(cast(balance as numeric),2) > 0 and fecha >= ? and fecha <= ? and document_id <> 2 \n GROUP BY 2,1\n ORDER BY 2,1 \", moneda,\"#{fecha1} 00:00:00\",\"#{fecha2} 23:59:59\" ]) \n \n \n @facturas2 = Factura.find_by_sql([\"\n SELECT year_mounth as year_month,\n customer_id,\n SUM(balance) as balance \n FROM facturas\n WHERE moneda_id = ? and round(cast(balance as numeric),2) < 0 and fecha >= ? and fecha <= ? and document_id = 2 \n GROUP BY 2,1\n ORDER BY 2,1 \", moneda,\"#{fecha1} 00:00:00\",\"#{fecha2} 23:59:59\" ]) \n \n Tempfactura.delete_all\n \n \n for f in @facturas\n if f.customer_id != nil\n b = Tempfactura.new(year_month: f.year_month , customer_id: f.customer_id,balance: f.balance)\n b.save \n end \n end \n \n for c in @facturas2\n \n lcBalance= 0 \n \n tf = Tempfactura.find_by(year_month: c.year_month, customer_id: c.customer_id)\n puts \"cliente nc\"\n puts c.customer_id\n puts c.year_month\n puts c.balance\n \n if tf \n tf.balance += c.balance \n tf.save \n else\n lcbalance = c.balance\n puts \"cliente \"\n puts c.customer_id \n a= Tempfactura.new(:year_month=> c.year_month,:customer_id => c.customer_id,:balance=>lcbalance)\n a.save \n end\n \n end \n \n @facturas = Tempfactura.order(:customer_id,:year_month) \n \n if @facturas.last != nil \n return @facturas\n else\n return nil \n end \n end", "def total_cash\n services.select{|i| i[:btype] && i[:btype] == CASH_BILLING}.sum{|s| s[:fee]} rescue 0\n end", "def total_price\r\n total = 0\r\n\r\n #Adds the prices of the orders up\r\n order_items.each do |order_item|\r\n total += order_item.item.price*order_item.quantity\r\n end\r\n\r\n #Applies any discounts\r\n if(campaign)\r\n discount = campaign.campaign_type.percentage_reduced\r\n if discount != 100\r\n total -= (total * discount / 100)\r\n elsif discount == 100\r\n i = []\r\n order_items.each do |order_item|\r\n i.push(order_item.item.price)\r\n end\r\n total -= i.min\r\n end\r\n end\r\n return total\r\n end", "def get_customer_payments2(moneda,fecha1,fecha2)\n \n \n @facturas = Factura.find_by_sql([\"\n SELECT year_mounth as year_month,\n customer_id,\n SUM(balance) as balance \n FROM facturas\n WHERE moneda_id = ? and balance>0 and fecha >= ? and fecha <= ? and document_id <> 2 \n GROUP BY 2,1\n ORDER BY 2,1 \", moneda,\"#{fecha1} 00:00:00\",\"#{fecha2} 23:59:59\" ]) \n \n \n @facturas2 = Factura.find_by_sql([\"\n SELECT year_mounth as year_month,\n customer_id,\n SUM(balance) as balance \n FROM facturas\n WHERE moneda_id = ? and balance>0 and fecha >= ? and fecha <= ? and document_id = 2 \n GROUP BY 2,1\n ORDER BY 2,1 \", moneda,\"#{fecha1} 00:00:00\",\"#{fecha2} 23:59:59\" ]) \n \n Tempfactura.delete_all\n \n \n for f in @facturas\n if f.customer_id != nil\n b = Tempfactura.new(year_month: f.year_month , customer_id: f.customer_id,balance: f.balance)\n b.save \n end \n end \n \n for c in @facturas2\n \n lcBalance= 0 \n \n tf = Tempfactura.find_by(year_month: c.year_month, customer_id: c.customer_id)\n \n if tf \n tf.balance -= c.balance \n tf.save \n else\n lcbalance = c.balance * -1\n puts \"cliente \"\n puts c.customerid \n a= Tempfactura.new(:year_month=> c.year_month,:customer_id => c.customer_id,:balance=>lcBalance)\n a.save \n end\n \n end \n \n @facturas = Tempfactura.order(:customer_id,:year_month) \n \n if @facturas.last != nil \n return @facturas\n else\n return nil \n end \n end", "def calculate_billing_price\n show_items\n self.discount.get_discount(self)\n print_billing_details\n self\n end", "def charged_fee(amount)\n (amount * merchant.fee)\n end", "def remove_customer_cash(customers, amount)\n customers[:cash] -= amount\nend", "def update_customer_total\n \t current_total = self.customer.total_repair\n \t repair = Repair.find(self.id)\n \t customer = self.customer\n \tif current_total\n \t\tcustomer.total_repair -= repair.total_charge\n \tend\n \tcustomer.save\n end", "def remove_customer_cash(customer, cost)\n return customer[:cash] -= cost\nend", "def calcTotalCustomerValue\n\t\t\n\tend", "def calc_budget_deduction\n # calc deduction\n sql = \"SELECT castings.fee FROM castings INNER JOIN moviestars\n ON castings.moviestar_id = moviestars.id\n WHERE castings.movie_id = $1\"\n values = [@movie_id]\n result = SqlRunner.run(sql, values)\n fee_array = result.map{|movie| movie['fee'].to_i}\n deduction = if fee_array.length > 0\n fee_array.sum\n else\n 0\n end\n return deduction\n end", "def ticket_discount(user, paid: false)\n ticket_purchases.by_user(user).where(paid: paid).sum{ |tp| (tp.discount_value || 0) + (tp.discount_percent || 0) }\n end", "def total_unpaid_visits\n next_cutoff_date = Claim.order(date_paid: :desc).limit(1).pluck(:date_paid).first + 3.days rescue Date.today \n prev_cutoff_date = next_cutoff_date - 45.days \n @total_unpaid = Visit.where(status: BILLED).where(\"entry_ts > ?\", prev_cutoff_date).where(\"entry_ts <?\", next_cutoff_date).sum{|v| v.total_fee}\n flash[:info] = \"Current total of billed claims for all doctors for period ending #{next_cutoff_date} is: #{ sprintf \"$%.0f\", @total_unpaid}\"\n end", "def buy_tickets(film)\n if @funds >= film.price\n @funds -= film.price\n return @funds\n else\n return \"Insufficient funds!\"\n end\n end", "def balance_owed\n discounted_price - amount_paid\n end", "def total_insured_fees\n services.select{|i| i[:btype] && i[:btype] < CASH_BILLING}.sum{|s| s[:fee]} rescue 0\n end", "def total_revenue_after_discounts\n total_revenue.first.to_f - total_discount.to_f\n end", "def total_funds\n self.collect{ |cs| cs.amount.to_f}.inject(0, :+)\n end", "def remove_customer_cash(customer, ammount)\n customer[:cash] -= ammount\nend", "def get_discount(billing)\n percentage_discountable_total_price = 0\n billing.billing_items.each do |billing_category, billing_item_with_price|\n non_discount_category = Discount.non_discount_category.include?(billing_category)\n billing_item_with_price.each do |billing_item, price|\n percentage_discountable_total_price += price unless non_discount_category\n billing.total_price += price\n end\n end\n get_percentage_discount_price(percentage_discountable_total_price, billing)\n self.total_net_discount_price += self.percentage_discounted_price\n self.total_net_discount_price += get_every_hundred_discount(billing.total_price)\n billing.net_payable_price = (billing.total_price - total_net_discount_price)\n end", "def remove_customer_cash(customer, amount)\n return customer[:cash] -= amount\nend", "def remove_customer_cash(customer, amount)\n return customer[:cash] -= amount\nend", "def remove_customer_cash(customer, amount_to_be_removed)\ncustomer[:cash] -= amount_to_be_removed\nend", "def coupDiscounts\n\t\t@new_cart.each do |item, details|\n\t\t\tcase\n\t\t\t\twhen item == \"CHEESE\" && details[:coups] == 1 && details[:count] > 2\n\t\t\t\t\tdetails[:cost] = (((details[:count] / 3) * 15) + ((details[:count] % 3) * details[:price]))\n\t\t\t\twhen item == \"AVOCADO\" && details[:coups] == 1 && details[:count] > 1\n\t\t\t\t\tdetails[:cost] = (((details[:count] / 2) * 5) + ((details[:count] % 2) * details[:price]))\n\t\t\t\twhen item == \"BEER\" && details[:coups] == 1 && details[:count] > 1\n\t\t\t\t\tdetails[:cost] = (((details[:count] / 2) * 20) + ((details[:count] % 2) * details[:price]))\n\t\t\t\tend\t\t\t\t\n\t\tend\n\tend", "def sell\n self.save\n customer_name = self.find_customer_name\n customer_funds = self.find_customer_funds\n customer_funds -= self.find_price\n if customer_funds < 0 || !self.tickets_available?\n self.delete\n return\n end\n sql = 'UPDATE customers\n SET name = $1, funds = $2\n WHERE id = $3'\n values = [ customer_name, customer_funds, @customer_id ]\n SqlRunner.run( sql, values )\n end", "def monthly_costs_toward_getting_out_dh\n\t$costs_toward_dh = []\n\n\t$pokitdok_call.each do |drug|\t\n\t\t#Patient pays no more than 45% of ⇒ plan’s cost for covered brand-name prescription drugs + pharmacy’s dispensing fee\n\t\tif drug['tier'] == 1\n\t\t\t$costs_toward_dh << drug['retail']['total_cost_30_day']['amount'].to_f * 0.58\n\n\t\t#patient pays 58% of cost, 58% of cost goes toward geting out of donut hole\t\t\t\n\t\telsif drug['tier'] == 2\n\t\t\t$costs_toward_dh << drug['retail']['total_cost_30_day']['amount'].to_f * 0.45\n\n\t\telsif drug['tier'] == 3\n\t\t\t$costs_toward_dh << drug['retail']['total_cost_30_day']['amount'].to_f * 0.45\n\t\tend\n\tend\n\n\t$costs_toward_dh.inject(:+).round(2)\nend", "def remove_customer_cash(customer, cash_remove)\n customer[:cash] -= cash_remove\n end", "def collection_discount(total)\n (discount * total) / 100\n end", "def price(rental)\n car_id = rental[\"car_id\"]\n car = @cars.select{ |car| car[\"id\"] == car_id }[0]\n\n price_per_day = car[\"price_per_day\"]\n price_per_km = car[\"price_per_km\"]\n\n start_date = DateTime.parse(rental[\"start_date\"])\n end_date = DateTime.parse(rental[\"end_date\"])\n duration = (end_date - start_date).to_i + 1\n\n distance = rental[\"distance\"]\n\n # price per day discount : 10% after 1 day, 30% after 4 days, 50% after 10 days\n duration_price = if duration == 1\n price_per_day\n elsif duration > 1 && duration < 5\n price_per_day + price_per_day * (duration - 1) * 90 / 100\n elsif duration > 4 && duration < 11\n price_per_day + price_per_day * 3 * 90 / 100 + price_per_day * (duration - 4) * 70 / 100\n else\n price_per_day + price_per_day * 3 * 90 / 100 + price_per_day * 6 * 70 / 100 + price_per_day * (duration - 10) * 50 / 100\n end\n\n rental_price = duration_price + price_per_km * distance\nend", "def price(rental)\n car_id = rental[\"car_id\"]\n car = @cars.select{ |car| car[\"id\"] == car_id }[0]\n\n price_per_day = car[\"price_per_day\"]\n price_per_km = car[\"price_per_km\"]\n\n start_date = DateTime.parse(rental[\"start_date\"])\n end_date = DateTime.parse(rental[\"end_date\"])\n duration = (end_date - start_date).to_i + 1\n\n distance = rental[\"distance\"]\n\n # price per day discount : 10% after 1 day, 30% after 4 days, 50% after 10 days\n duration_price = if duration == 1\n price_per_day\n elsif duration > 1 && duration < 5\n price_per_day + price_per_day * (duration - 1) * 90 / 100\n elsif duration > 4 && duration < 11\n price_per_day + price_per_day * 3 * 90 / 100 + price_per_day * (duration - 4) * 70 / 100\n else\n price_per_day + price_per_day * 3 * 90 / 100 + price_per_day * 6 * 70 / 100 + price_per_day * (duration - 10) * 50 / 100\n end\n\n rental_price = duration_price + price_per_km * distance\nend", "def price(rental)\n car_id = rental[\"car_id\"]\n car = @cars.select{ |car| car[\"id\"] == car_id }[0]\n\n price_per_day = car[\"price_per_day\"]\n price_per_km = car[\"price_per_km\"]\n\n start_date = DateTime.parse(rental[\"start_date\"])\n end_date = DateTime.parse(rental[\"end_date\"])\n duration = (end_date - start_date).to_i + 1\n\n distance = rental[\"distance\"]\n\n # price per day discount : 10% after 1 day, 30% after 4 days, 50% after 10 days\n duration_price = if duration == 1\n price_per_day\n elsif duration > 1 && duration < 5\n price_per_day + price_per_day * (duration - 1) * 90 / 100\n elsif duration > 4 && duration < 11\n price_per_day + price_per_day * 3 * 90 / 100 + price_per_day * (duration - 4) * 70 / 100\n else\n price_per_day + price_per_day * 3 * 90 / 100 + price_per_day * 6 * 70 / 100 + price_per_day * (duration - 10) * 50 / 100\n end\n\n rental_price = duration_price + price_per_km * distance\nend", "def apply_discount\n\t\t@total -= @discount\n\t\tputs \"Total price expected: £ #{@total.round(3)}\"\n\tend", "def remove_customer_cash(customer,amount)\n customer[:cash] -= amount\nend", "def calculate_total\n\t\t@total_items.each do |element|\n\t\t\tif element.class==Apples\n\t\t\t\t@apple_count=@apple_count+1\n\t\t\t\tif @apple_count==2\n\t\t\t\t\t@apple_count=0\n\t\t\t\t\t@apple_discounts = @apple_discounts+1\n\t\t\t\telse\n\t\t\t\t\t@total = @total + element.price\n\t\t\t\tend\n\n\t\t\telsif ((@today.wday==6 || @today.wday==0) && element.class==Watermelons)\n\t\t\t\t@total = @total + (element.price*0.9) #10% on watermelons on weekends\n\t\t\t\t@weekendWatermelon = true\n\t\t\t\t\n\t\t\telse\n\t\t\t@total = @total + element.price\n\t\t\tend\n\n\n\t\tend\n\n\t\t#Checks for Weekend Watermelon discount applied\n\t\tif @weekendWatermelon\n\t\t\tputs \"10% discount on Watermelons on weekends!\"\n\t\tend\n\n\t\t#Count number of 2x1's applied\n\t\tif (discountApple)>0\n\t\t\tputs \"Congratulations! You received #{@apple_discounts} 2x1's on apples and saved #{@apple_discounts*10} euros!\"\n\t\tend\n\t\t#Check for 10 euro discount\n\t\tif (discount100(@total))\n\t\t\t@total = @total-10\n\t\t\tputs \"Congratulations! You received a 10 euro discount for buying more than 100 euros worth of fruit!\"\n\t\tend\n\n\t\t#Check for 5% discount\n\t\tif (discount5)\n\t\t\t@total = @total*0.95\n\t\t\tputs \"Congratulations! You received a 5% discount for buying more than 5 items!\"\n\t\tend\n\t\treturn @total\n\tend", "def total_revenue_generation\n items_by_merchant.each do |merchant, items|\n total_revenue = 0\n items.each do |item|\n invoice_items.each do |invoice_item|\n if invoice_item.item_id === item.id\n total_revenue += invoice_item.quantity * invoice_item.unit_price\n end\n end\n end\n merchant.total_revenue = total_revenue\n end\n end", "def benefits\n self.ticket_price * self.spectators\n end", "def monthly_costs_toward_getting_out_dh\n\t\t$costs_toward_dh = []\n\n\t\t$pokitdok_call.each do |drug|\n\t\t\t#Patient pays no more than 45% of ⇒ plan’s cost for covered brand-name prescription drugs + pharmacy’s dispensing fee\n\t\t\tif drug['tier'] == 1\n\t\t\t\t$costs_toward_dh << drug['retail']['total_cost_30_day']['amount'].to_f * 0.58\n\t\t\t\tif $costs_toward_dh == 0\n\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t$costs_toward_dh.inject(:+).round(2)\n\t\t\t\tend\n\n\t\t\t#patient pays 58% of cost, 58% of cost goes toward geting out of donut hole\n\t\t\telsif drug['tier'] == 2\n\t\t\t\t$costs_toward_dh << drug['retail']['total_cost_30_day']['amount'].to_f * 0.45\n\t\t\t\tif $costs_toward_dh == 0\n\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t$costs_toward_dh.inject(:+).round(2)\n\t\t\t\tend\n\n\t\t\telsif drug['tier'] == 3\n\t\t\t\t$costs_toward_dh << drug['retail']['total_cost_30_day']['amount'].to_f * 0.45\n\t\t\t\t$costs_toward_dh.inject(:+).round(2)\n\t\t\telse\n\t\t\t\t$costs_toward_dh = 0\n\t\t\tend\n\t\tend\n\n\t\t$costs_toward_dh\n\tend", "def discounted_total\n line_items = line_items_total\n fees = [item_fees_in_cents].sum\n credits = [customer_credits_total, promo_code_total].sum\n discounts = [membership_discount_total, quantity_discount_total].sum\n\n total = line_items + fees - credits - discounts\n [total, 0].max\n end", "def sell_pet_to_customer(pet_store, bought_pet, customer)\n if bought_pet != nil && (customer[:cash] >= bought_pet[:price])\n add_pet_to_customer(customer, bought_pet)\n increase_pets_sold(pet_store, 1)\n remove_customer_cash(customer, bought_pet[:price])\n add_or_remove_cash(pet_store, bought_pet[:price])\n end\nend", "def total_affiliate_fee\n total = 0.0\n @lines.each {|line| total += (line.li_aff_fee * line.li_qty) }\n total\n end", "def calculate_price(discount_price)\n _, size, provider = extract_values\n shipping_price = shipping_rate(provider, size)\n total = total_discount_given_in_month\n\n if total >= TOTAL_DISCOUNT_LIMIT\n [shipping_price, DEFAULT_DISCOUNT]\n elsif total <= TOTAL_DISCOUNT_LIMIT\n final_discount = final_discount_price(discount_price, total)\n reduced_price = reduced_shipment_price(shipping_price, final_discount)\n [reduced_price, final_discount]\n end\n end", "def charge_fee\r\n\t\tif_member = Participant.find_by(participantID: participantID)\r\n\t\tif_course = Course.find_by(courseID: courseID)\r\n\t\t\r\n\t\tif if_course != nil && if_member != nil\r\n\t\t\tearlyBirdTime = if_course.startDate.months_ago(1)\r\n\t\t\tif if_member.expirydate > Date.today\r\n\t\t\t\tif Date.today >= earlyBirdTime && Date.today < if_course.startDate\r\n\t\t\t\t\treturn if_course.earlybirdPrice\r\n\t\t\t\telse\r\n\t\t\t\t\treturn if_course.memberPrice\r\n\t\t\t\tend\r\n\t\t\telse\r\n\t\t\t\treturn if_course.nonmemberPrice\r\n\t\t\tend\r\n\t\tend\r\n\tend", "def total_dietaryFiber\n food.dietaryFiber * quantity\n end", "def sell_pet_to_customer(pet_shop, pet, customer)\n\n\n if pet != nil && customer_can_afford_pet(customer, pet)\n\n add_pet_to_customer(customer, pet)\n customer_pet_count(customer)\n\n\n increase_pets_sold(pet_shop, customer_pet_count(customer))\n pets_sold(pet_shop)\n\n\n remove_customer_cash(customer, pet[:price])\n customer_cash(customer)\n\n add_or_remove_cash(pet_shop, pet[:price])\n total_cash(pet_shop)\n\n end\n\nend", "def apply_fees\n remove_fees\n unless waive_fees\n #CHALKLE\n self.chalkle_gst_number = Finance::CHALKLE_GST_NUMBER\n self.chalkle_fee = course.chalkle_fee_no_tax\n self.chalkle_gst = course.chalkle_fee_with_tax - chalkle_fee\n \n self.processing_fee = course.processing_fee\n self.processing_gst = course.processing_fee*3/23\n self.processing_fee = course.processing_fee-self.processing_gst\n\n #TEACHER FEE\n if provider_pays_teacher?\n self.teacher_fee = 0\n self.teacher_gst = 0\n else\n if fee_per_attendee?\n self.teacher_fee = course.teacher_cost\n elsif flat_fee?\n confirmed_booking_count = course.bookings.fees_not_waived.paid.confirmed.count\n if confirmed_booking_count > 0\n self.teacher_fee = course.teacher_cost / confirmed_booking_count\n else\n self.teacher_fee = course.teacher_cost\n end\n end\n end\n\n #TEACHER TAX\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst_number = course.teacher.tax_number\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n else\n self.teacher_gst = 0\n self.teacher_gst_number = nil\n end\n\n #PROVIDER\n self.provider_fee = course.provider_fee\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n\n #adjust in case calc_cost is not course cost, should only happen if flat_fee\n difference = course.cost - calc_cost\n if difference != 0\n self.provider_fee = course.provider_fee + difference\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n end\n\n #adjust in case payment has been made already\n difference = cost - calc_cost\n if difference != 0\n #adjust processing_fee\n self.processing_fee = cost * course.provider_plan.processing_fee_percent\n self.processing_gst = self.processing_fee*3/23\n self.processing_fee = self.processing_fee-self.processing_gst\n\n #reset difference to adjust for processing_fee changes\n difference = cost - calc_cost\n\n #if payment exists then adjust provider fee to ensure the payment amount matches calc_cost\n adjustment_for_provider = difference\n adjustment_for_teacher = 0\n\n if provider_fee+provider_gst+difference < 0\n #if adjusted provider_fee is negative then deduct that negative amount from teacher_fee and make provider_fee 0\n adjustment_for_teacher = provider_fee+provider_gst+difference \n self.provider_fee = 0\n self.provider_gst = 0\n else\n self.provider_fee = provider_fee+provider_gst+adjustment_for_provider\n if provider.tax_registered?\n self.provider_gst = provider_fee*3/23\n self.provider_fee = provider_fee - provider_gst\n end\n end\n \n if adjustment_for_teacher != 0\n self.teacher_fee = teacher_fee+teacher_gst+adjustment_for_teacher\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n end\n end\n end\n end\n cost\n end", "def total(bill)\n sum=0.0\n bill.items.each do |i|\n sum += i.price\n end\n return sum\n end", "def calculator(list)\r\n profit = total_price(list) - total_cost(list) \r\n return profit\r\nend", "def cleanse(deposit, ratios)\n sumtotal = 0\n\n deposit.map do |money|\n unit = money.match(/^[\\D|$]{2,3}/).to_s\n\n rate = ratios[unit].to_f\n\n gsubber(money)\n\n money = ((money.to_f)*rate).round(2)\n\n sumtotal = sumtotal + money\n\n puts_subtotal(unit,money,rate,sumtotal)\n\n end\n\n puts_grandtotal(sumtotal)\n\n end", "def benefits_transfers\n self.offers_as_seller.accepted.inject(0) {|sum, offer| sum += offer.pay}\n end", "def remove_customer_cash(customer, cash_amount)\n customer[:cash] -= cash_amount\nend", "def calculate_trial_debt\n\n\t\tsales_tax = self.country.sales_tax\n\t\tday_number = Time.now.day\n \tmonth_number = Time.now.month\n \tmonth_days = Time.now.days_in_month\n\n\t\tdebt_proportion = (month_days - day_number + 1).to_f/month_days.to_f\n\n\t\t#debt = self.plan.plan_countries.find_by(country_id: self.country.id).price.to_f * debt_proportion * ( 1 + sales_tax)\n\t\tdebt = self.company_plan_setting.base_price * self.computed_multiplier * debt_proportion * (1 + sales_tax)\n\n\t\treturn debt\n\n\tend", "def discount_amount\n all_discounts = line_items.collect { |li| li.discounts }.flatten\n mapping = all_discounts.map(&:price_extend)\n # when we create the discount items, we need to set calculate their price_extend value\n mapping.sum\n end", "def existing_clients_new_revenue \n existing_clients.where(new_money: true).sum(:first_year_comp)\nend", "def cost_of(program, date, quantity, excluded = 0)\n food_item_purchases = purchases_between(program, program.start_date, date).order('date DESC')\n # food_item_purchases = Purchase.for_program(program).after(program.start_date).before(date).order('date DESC')\n\n costs = []\n quantity = quantity.unit.to(base_unit).abs \n excluded = excluded.unit.to(base_unit).abs\n\n food_item_purchases.each do |food_item_purchase|\n amount_available = food_item_purchase.total_base_units\n if(excluded > 0)\n to_debit = [excluded, amount_available].min \n excluded -= to_debit\n amount_available -= to_debit\n end\n \n if(quantity > 0)\n to_debit = [quantity, amount_available].min\n quantity -= to_debit\n costs << [to_debit, food_item_purchase.price_per_base_unit]\n end\n end\n\n denom = (costs.collect {|e| e[0] }).sum\n num = (costs.inject(0) { |result, element| result + element[0].unit * element[1] }) \n denom == 0 ? 0.u : num / denom\n end", "def total_discount(items)\n 0\n end", "def remove_customer_cash(customer, value)\n customer[:cash] -= value\nend", "def revenue_after_subtotal_by_party party, invoiced=nil, document_id=nil\n sub_total = revenue_subtotal_by_party(party)\n accum = Money.new(0)\n\n filter_invoiced(line_items, invoiced, document_id).each do |li|\n if li.after_subtotal\n\n if li.billable_party == party\n accum += li.percentage_of_subtotal ? li.revenue_total_with_percentage(sub_total) : li.revenue_total\n end\n\n if li.payable_party == party\n accum -= li.percentage_of_subtotal ? li.expense_total_with_percentage(sub_total) : li.expense_total\n end\n\n end\n\n end\n accum\n end", "def deduct\n @balance -= @journey_log.fare\n end", "def applyDiscount\n # get all rules with an item code\n rules = @rules.select { |obj| obj.getCode != \"total\" } \n rules.each do |rule|\n # find the minimum threshold for the rule to apply\n size = @items.select { |item| item.getCode == rule.getCode }.size \n # if threshold is not exceeded\n unless rule.getThreshold > size \n @items.each do |item| \n # if item code matches the rule code\n if(item.getCode == rule.getCode) \n # reset the price to the initial price to revert modifications\n item.refreshPrice \n # compute discount price based on rule\n item.setPrice(rule.getPercent ? item.getPrice * (1-rule.getValue) : item.getPrice - rule.getValue) \n end\n end\n end\n end\n end", "def calculate_product_total(items_bought)\n result = items_bought * @price\n if @discount\n result -= @discount.apply(self, items_bought)\n end\n result \n end", "def calculateStrawberryDiscount(totalSR1Count, totalPrice)\n\t\tif totalSR1Count >= 3\n\t\t\ttotalPrice -= (totalSR1Count * 0.50) \n\t\t\ttotalPrice.round(2)\n\t\tend\n\t\ttotalPrice.round(2)\n\t\t\n\tend", "def total_non_insured_fees\n total_fee - total_insured_fees\n end", "def total_revenue()\n total_revenue = 0\n fee = 1.65\n trip_history = self.trips\n trip_history.each do |trip|\n if (trip.cost != nil) && (trip.cost > fee)\n total_revenue += (trip.cost - fee) * 0.8\n end\n end\n return total_revenue\n end", "def final_total\n fees = [ticket_fees_in_cents, delivery_fee_in_cents].sum\n reductions = [reduction_code_credit_total].sum\n\n discounted_total + fees - reductions\n end", "def money_spent\n self.purchases.map { |p| p.price }.sum\n end", "def calculate_points(item)\n if @customers.include?(item[\"customer\"])\n time_of_order = DateTime.parse(item[\"timestamp\"])\n customer = @customers[item[\"customer\"]]\n customer[:total_amount]= customer[:total_amount] + item[\"amount\"]\n\n # Reward points calculation based on the schedule\n if (time_of_order.hour >= 12 && time_of_order.hour < 13)\n temp_points = (item[\"amount\"]/3).ceil\n elsif (time_of_order.hour >= 11 && time_of_order.hour < 12) || (time_of_order.hour >= 13 && time_of_order.hour < 14)\n temp_points = (item[\"amount\"]/2).ceil\n elsif (time_of_order.hour >= 10 && time_of_order.hour < 11) || (time_of_order.hour >= 14 && time_of_order.hour < 15)\n temp_points = (item[\"amount\"]).ceil\n else\n temp_points = (item[\"amount\"]*0.25).ceil\n end\n if (temp_points >= 3 && temp_points < 21)\n customer[:orders] = customer[:orders] + 1\n customer[:points] = customer[:points] + temp_points\n end\n \n customer[:average_points] = (customer[:points]/customer[:orders])\n else\n add_customer(item)\n end\n end", "def sell_pet_to_customer(shop,pet,customer)\n if pet != nil && customer_can_afford_pet(customer,pet) == true\n for animal in shop[:pets]\n if animal[:name] == pet[:name]\n amount = pet[:price]\n add_pet_to_customer(customer,pet)\n customer_pet_count(customer)\n increase_pets_sold(shop,1)\n remove_customer_cash(customer,amount)\n add_or_remove_cash(shop,amount)\n end\n end\n end\nend", "def cf\n\t\tself.buy ? (-self.amount-self.fee) : (self.amount - self.fee)\n\tend", "def sum_attorney_fees\n (invoice_lines.sum(:total_attorney_fee)).round(2)\n end", "def revenue #returns the the sum of all of the vendor's sales (in cents) ##WORKS\n\t \tmy_revenue = 0\n\t \tmy_revenue_generators = sales\n\n\t \tmy_revenue_generators.each do |sale|\n\t \t\tmy_revenue += sale.amount\n\t \tend\n\t \ttotal_sales_in_cents = my_revenue * 100\n\t \t# puts total_sales_in_cents.to_s + \" cents. can you believe it?\"\n\t\treturn total_sales_in_cents\n\tend", "def customer_total_cash(customer)\n return customer[:cash]\nend", "def compute_unit_rental_price\n per_time_fee + per_mileage_fee\n end", "def cost_cal(items)\r\n price = 0\r\n items.item.each do |h|\r\n price += h[:num] * h[:price]\r\n end\r\n #profit = '%.2f' % profit\r\n puts \"Order total: $#{'%.2f' % price}\"\r\n return nil\r\nend", "def profit\n revenue - total_costs\n end", "def get_average_discount(toy)\n\treturn get_retail_price(toy) - get_average_price(toy)\nend", "def calculate_calories(fid, calories, type)\n\n\t\t@food=Food.find(fid)\n\t\ttimes=calories/@food.energ_kcal\n\t\tif !@food.custom\n\n\t\tcase type\n\t\t\n\t\twhen 'fat'\n\t\tcalories = (@food.lipid_tot.to_f * times)\n\t\twhen 'carbohydrt'\n\t\tcalories = (@food.carbohydrt.to_f * times) \n\t\twhen 'protein'\n\t\tcalories = (@food.protein.to_f * times) \t\t\t\t\t\t\n\t\tend\n\n\t\telse\n\t\t\n\t\ttimes=calories/@food.energ_kcal\n\t\tcase type\n\t\t\n\t\twhen 'calorie'\n\t\tcalories = @food.energ_kcal.to_f* times\n\t\twhen 'fat'\n\t\tcalories = @food.total_fat.to_f * times\n\t\twhen 'carbohydrt'\n\t\tcalories = @food.carbohydrt.to_f * times\n\t\twhen 'protein'\n\t\tcalories = @food.protein.to_f * times\n\t\twhen 'fiber_td'\n\t\tcalories = @food.fiber_td.to_f * times\n\t\tend\n\t\tend\n\t\treturn calories.round(2) unless calories.nil? \n\n\t\tend", "def final_price\n price * (100 - discount) / 100\n end", "def expense_after_subtotal_by_party party, invoiced=nil, document_id=nil\n sub_total = expense_subtotal_by_party(party)\n accum = Money.new(0)\n\n filter_invoiced(line_items, invoiced, document_id).each do |li|\n if li.after_subtotal\n\n if li.billable_party == party\n accum -= li.percentage_of_subtotal ? li.revenue_total_with_percentage(sub_total) : li.revenue_total\n end\n\n if li.payable_party == party\n accum += li.percentage_of_subtotal ? li.expense_total_with_percentage(sub_total) : li.expense_total\n end\n\n end\n\n end\n accum\n end", "def fees(period = (Time.now.beginning_of_month - 1).beginning_of_month .. (Time.now.beginning_of_month - 1).end_of_month)\n subscription_payments.where({ :created_at => period }).collect(&:affiliate_amount).sum\n end", "def total_discounted_price\n # convert to array so it doesn't try to do sum on database directly\n line_items.to_a.sum(&:total_discounted_price)\n end", "def calc_daily_credit_debit\n credit = Transaction.sum(:amount, :conditions => \"date IS '#{Date.current}' AND sign IS 'c' \") # change this to transactiontype_id 1\n debit = Transaction.sum(:amount, :conditions => \"date IS '#{Date.current}' AND sign IS 'd' \") # change this to transactiontype_id 4 (2 + 5)\n @dailytotal = credit - debit\n return @dailytotal\n end", "def show_discounts(prices)\n prices.each do |price|\n amount_off = price / 3.0\n puts format(\"Your discount: $%.2f\", amount_off)\n end\nend", "def total_revenue\n total = 0.00\n self.my_orders.each do |order|\n total += order.merchant_subtotal(self.id)\n end\n return total\n end", "def sell_pet_to_customer(pet_shop, pet, customer)\n if ((pet != nil) && customer_can_afford_pet(customer, pet))\n add_pet_to_customer(customer, pet)\n increase_pets_sold(pet_shop, customer[:pets].count())\n add_or_remove_cash(pet_shop, pet[:price])\n end\nend", "def discounted_total\n line_item.total_in_cents - discount_amount\n end", "def sell_pet_to_customer(pet_shop, pet, customer)\n for l_pet_shop in pet_shop[:pets]\n if l_pet_shop == pet\n if customer_can_afford_pet(customer, pet) == true\n remove_customer_cash(customer, pet[:price])\n add_or_remove_cash(pet_shop, pet[:price])\n add_pet_to_customer(customer, pet)\n increase_pets_sold(pet_shop, 1)\n end\n end\n end\nend", "def discount\n\t\t@basket.each do |code, quantity|\n\t\t\tif code == :SR1 && quantity >= 3\n\t\t\t\t@discount = 4.50\n\t\t\t\tputs \"your strawberry has been reduced of 4.50\"\n\t\t\tend\n\n\t\t\tif code == :GR1 && quantity >=2\n\t\t\t\t@discount = @pricing_rules[code]\n\t\t\t\tputs \"Buy one green tea get one free!\"\n\t\t\tend\n\t\tend\n\t\tapply_discount\n\tend", "def discount_bill(key,value,v)\n puts v\n\n quotient=value/v['disc_item'].to_f\n tot1=quotient*v['disc_price'].to_f\n\n remainder=value/v[\"disc_item\"].to_f\n tot2=remainder*v[\"unit_price\"].to_f\n\n @discount_total=tot1+tot2\n\n display_result(key,value,@discount_total)\n end" ]
[ "0.7474738", "0.69729006", "0.67230946", "0.62753093", "0.621499", "0.6142677", "0.6037939", "0.60324466", "0.59905887", "0.59789115", "0.59513146", "0.59442306", "0.58459556", "0.58428806", "0.5828465", "0.58105665", "0.5749559", "0.57456857", "0.57196444", "0.5707163", "0.57001317", "0.5690267", "0.56708145", "0.5663486", "0.56449604", "0.564297", "0.5641588", "0.5639102", "0.5636736", "0.5599298", "0.5580139", "0.55662704", "0.55626744", "0.55626744", "0.556173", "0.5555191", "0.5552566", "0.554916", "0.55461466", "0.5542195", "0.5537906", "0.5537906", "0.5537906", "0.5527176", "0.5522748", "0.5520582", "0.5517348", "0.5500025", "0.54843915", "0.5480265", "0.5478449", "0.5477161", "0.54736316", "0.54733187", "0.5461957", "0.544237", "0.54139495", "0.5409714", "0.54048467", "0.5404511", "0.53993833", "0.5397633", "0.5386993", "0.5385754", "0.538132", "0.53801906", "0.537833", "0.53717774", "0.53623563", "0.5361199", "0.5361198", "0.5352756", "0.5349361", "0.53467655", "0.5346141", "0.53454787", "0.5343867", "0.53428215", "0.534267", "0.53379035", "0.53372586", "0.53359336", "0.53305197", "0.5325822", "0.53177804", "0.5307441", "0.5307374", "0.53069264", "0.53063375", "0.5301627", "0.5300085", "0.52997166", "0.52996033", "0.529244", "0.52898794", "0.52898145", "0.52894944", "0.52849007", "0.52833796", "0.5276926" ]
0.7547074
0
GET /distbutors GET /distbutors.json
def index @distbutors = Distbutor.page(params[:page]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "def index\n @distros = getmydata(\"Distro\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distros }\n end\n end", "def show\n @distraction = Distraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distraction }\n end\n end", "def index\n @distributions = current_user.distributions\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distributions }\n end\n end", "def dresses\n render json: { collections: Collection.published_dresses }\n end", "def index\n @distribuidors = Distribuidor.all\n end", "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "def index\n @distros = Distro.all\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def get_distribution_list(options = {})\n request({\n :expects => 200,\n :idempotent => true,\n :method => 'GET',\n :parser => Fog::Parsers::AWS::CDN::GetDistributionList.new,\n :path => \"/distribution\",\n :query => options\n })\n end", "def index\n @cognitive_distortions = CognitiveDistortion.all\n end", "def index\n Rails.logger.info('👻 Disraptor: Showing available routes.')\n\n routes = Disraptor::Route.find_all()\n\n render json: { 'disraptor/routes': routes }\n end", "def doors\n sample(fetch_all('vehicle.doors'))\n end", "def show\n @denuncium = Denuncium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncium }\n end\n end", "def index\n @ordens = Orden.all\n render json: @ordens\n end", "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend", "def index\n @denominations = Denomination.all\n end", "def index\n @destinations = Destination.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @destinations }\n end\n end", "def index\n @distributors = Distributor.all\n end", "def index\n if (params[:redirect] == \"on\")\n sql = <<-SQL\n WITH src AS (SELECT id, daughters(id)\n FROM kine WHERE owner_id = #{params[:search_owner]})\n SELECT json_agg(src) FROM src;\n SQL\n render json: ActiveRecord::Base.connection.select_value(sql)\n else\n @daughters = Daughter.all\n end\n end", "def index\n @odists = Odist.all\n end", "def index\n @dossiers = Dossier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dossiers }\n end\n end", "def index\n @distributions = @foyer.distributions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @distributions }\n end\n end", "def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end", "def index\n @ped_strategies = PedStrategy.order(\"hierarchy\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_strategies }\n end\n end", "def index *_\n @trades = owned_trades_view\n\n render json: @trades\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "def index\n @vendedors = Vendedor.all\n end", "def index\n @torrents = Torrents.new(:url => \"http://newt.local:9091/transmission/rpc\").load\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @torrents }\n end\n end", "def show\n @distribution = current_user.distributions.find(params[:id])\n @letters = @distribution.letters\n @recipients = @distribution.recipients\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distribution }\n end\n end", "def directions(origin, destination)\n directions = []\n\n request = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/directions/json\",\n :query_values => {\n :origin => origin.join(','),\n :destination => destination.join(','),\n :sensor => \"false\",\n :mode => \"walking\"\n }\n )\n\n response = RestClient.get(request.to_s)\n\n parsed_response = JSON.parse(response)\n\n parsed_response[\"routes\"][0][\"legs\"][0][\"steps\"].each do |step|\n parsed_html = Nokogiri::HTML(step[\"html_instructions\"])\n directions << parsed_html.text\n end\n\n directions\nend", "def index\n @therapists = Therapist.all\n end", "def index\n @therapists = Therapist.all\n end", "def index\n @therapists = Therapist.all\n end", "def index\n @therapists = Therapist.all\n end", "def show\n @therapist = Therapist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @therapist }\n end\n end", "def index\n @mirrors = Mirror.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mirrors }\n end\n end", "def show\n @destination = Destination.find(params[:id])\n setup_show_data\n\n client = TwitterHelper.get_client\n @twitter_data = client.search(\"to: #{@destination.city}, travel\", :result_type => \"recent\").take(3)\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @destination }\n end\n end", "def index\n getProfile\n @consents = TherapistConsent.where('therapist_id = ? ', @therapist.id)\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render :status => 200, :json => { action: 'index', consents: @consents }}\n end\n end", "def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end", "def index\n\t\t[:s, :f].each do |k|\n\t\t\tunless params[k].nil?\n\t\t\t\tn = params[k]\n\t\t\t\t(@p ||= {})[k] = Target.get_from_id_type( n[:id], n[:type] ) unless n[:id].nil? || n[:type].nil?\n\t\t\t\t@p[k] ||= Yard.where( :city => n[:city] ) if n[:type] == \"yard\"\n\t\t\tend # unless no k\n\t\tend # each k\n\t\tunless @p.nil?\n\t\t\t@trucks = Truck.to_and_from( @p[:f], @p[:s] ) unless @p[:f].nil? || @p[:s].nil?\n\t\t\t@trucks ||= Truck.from(@p[:s]) unless @p[:s].nil?\n\t\t\t@trucks ||= Truck.to(@p[:f]) unless @p[:f].nil?\n\t\t\t# raise \"NO TRUCK ERROR\" if @trucks.empty?\n\t\t\t@trucks.each do |truck|\n\t\t\t\traise \"why nil? #{truck.to_json}\" if truck.destination.at.nil?\t\n\t\t\tend # each nil check\n\t\telse\n\t\t\t@trucks ||= Truck.order(\"price ASC\").limit(10)\n\t\tend # unless p nil\n\t\trespond_to do |f|\n\t\t\tf.json { render \"truck\", :handler => [\"json_builder\"] }\n\t\t\tf.js\n\t\tend # respond_to f\n\tend", "def index\n @chargers = Charger.all\n render json: @chargers\n end", "def index\n @tailors = Tailor.all\n respond_to do |format|\n format.html\n format.json { render json: @tailors}\n end\n end", "def index\n @normas = Norma.all\n render json: @normas\n end", "def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend", "def index_hosting\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.hosted_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end", "def index\n @disabilities = Disability.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disabilities }\n end\n end", "def index\n @daps = @farmer.daps.page(params[:page]).per(20)\n end", "def index\n @dog_walks = DogWalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dog_walks }\n end\n \n end", "def new\n @distraction = Distraction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distraction }\n end\n end", "def index\n @setors = Setor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @setors }\n end\n end", "def index\n @dnas = Dna.all\n\n render json: @dnas\n end", "def index\n @uchronists = Uchronist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronists }\n end\n end", "def index\n @recipe_directions = @recipe.directions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipe_directions }\n format.json { render :json => @recipe_directions }\n end\n end", "def find_districts\n organization_id = params[:district_desired_org_id]\n districts = FtaAgency.find_by(id: organization_id).districts\n\n result = []\n districts.each { |d|\n entry = []\n entry << d.id\n entry << d.to_s\n result << entry\n }\n\n @organization_distrcits = result\n respond_to do |format|\n format.json { render json: result.to_json }\n end\n end", "def set_distbutor\n @distbutor = Distbutor.find(params[:id])\n end", "def index\n @distrito_origens = DistritoOrigen.all\n end", "def index\n @breeds = Breed.all\n\n render json: @breeds\n end", "def show\n @dteor = Dteor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dteor }\n end\n end", "def index\n @direccionts = Direcciont.all\n end", "def index\n @duers = Duer.all\n end", "def index\n @dteors = Dteor.all\n @thems = get_tem\n respond_to do |format|\n if get_tem\n format.html # index.html.erb\n format.json { render json: @dteors } \n else\n format.html { redirect_to new_student_path, notice: t(:vvedit_dani)}\n end\n \n end\n end", "def get_district_list ( year )\n get_api_resource \"#{@@api_base_url}districts/#{year}\"\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def index\n @upcoming_harvests = Harvest.upcoming\n @past_harvests = Harvest.past\n\n if params[:person_id]\n @person = Person.find(params[:person_id])\n @upcoming_harvests = @person.upcoming_harvests\n @past_harvests = @person.past_harvests\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvests }\n end\n end", "def show\n @denomination = Denomination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denomination }\n end\n end", "def index\n\n @directions = Direction.all\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @directions }\n format.xml { render :xml => @directions }\n end\n end", "def index\n @direccions = Direccion.recientes.all\n end", "def index\n puts \"user: #{@current_user.json_hash[:id]}\"\n hosted_dinners = []\n attended_dinners = []\n @hosted_dinners = @current_user.hosted_dinners.where('starts_at >= ?', \"#{Time.now}\").order(starts_at: :asc).each do |dinner|\n hosted_dinners << dinner.all_info\n end\n @attended_dinners = @current_user.attended_dinners.where('starts_at >= ?', \"#{Time.now}\").order(starts_at: :asc).each do |dinner|\n attended_dinners << dinner.all_info\n end\n render json: {\n hosting: hosted_dinners,\n attending: attended_dinners\n }\n end", "def index\n @dte_directions = DteDirection.all\n end", "def index\n @servants = Servant.all\n end", "def index\n @dolgnosts = Dolgnost.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dolgnosts }\n end\n end", "def index\n # return restaurants in nearby area\n # needs to be implemented later--for now just return all globally available restaurants\n # max_distance = params[:maxDistance]\n # location = { latitude: params[:latitude], longitude: params[:longitude] }\n\n # Restaurant.all.select do |restaurant|\n # restaurant.distance_to(location) <= max_distance\n # end\n\n @restaurants = Restaurant.all\n\n render json: @restaurants\n end", "def index\n @consents = Consent.all\n render json: @consents\n end", "def show\n dinosaurs = Dinosaur.filter_by_species(params[:species])\n\n if dinosaurs\n render json: dinosaurs\n else\n render json: dinosaurs.errors, status: :unprocessable_entity\n end\n end", "def index\n @laws = Law.ordered_roots\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laws }\n end\n end", "def perform\n get_all_the_urls_of_val_doise_townhalls\n end", "def index\n @diciplinas = Diciplina.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @diciplinas }\n end\n end", "def index\n @transfers = Transfer.all\n render json: @transfers\n end", "def index\n @space = Space.find(params[:space_id])\n @leases = Lease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leases }\n end\n end", "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index\n @treks = Trek.all\n @title = \"Trekking routes and destinations\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treks }\n end\n end", "def show\n @farmer = Farmer.find(params[:id])\n\t\t@dispensals = @farmer.dispensals.all.paginate(:page => params[:page], :order => 'updated_at DESC', :per_page => 5)\n\t\t@donations = @farmer.donations.all.paginate(:page => params[:page], :order => 'updated_at DESC', :per_page => 5)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @farmer }\n end\n end", "def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end", "def index\n @docters = Docter.all\n end", "def index\n @drone_attacks = DroneAttack.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :layout => 'blank'}\n end\n end", "def index\n sanitized = whitelist(params, :index)\n\n # Extract travels\n if sanitized[:user_id]\n # As to Rails 4 doesn't have support for OR operator\n # @travels = Travels::Travel.submitted.where(\"customer_id = ? OR performer_id = ?\", sanitized[:user_id], sanitized[:user_id])\n @travels = Travels::Travel.of(current_user)\n else\n @travels = Travels::Travel.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { as_json @travels }\n end\n end", "def index\n authorize! :admin, Coordenador\n \n @coordenadores = Coordenador.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenadores }\n end\n end", "def index\n @travel_destinations = TravelDestination.all\n end", "def show\n @distribution = @foyer.distributions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @distribution }\n end\n end", "def index\n @task_doers = TaskDoer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @task_doers }\n end\n end", "def index\n @relay_destinations = @relay.relay_destinations.order(base_url: :asc).all\n end", "def show\n @districtclass = Districtclass.find(params[:id])\n @districts = @districtclass.districts.all(:order => 'district_name')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @districtclass }\n end\n end", "def index\n @dormitories = Dormitory.all\n end", "def destroy\n @distbutor.included_countries.destroy_all\n @distbutor.included_states.destroy_all\n @distbutor.included_cities.destroy_all\n @distbutor.excluded_states.destroy_all\n @distbutor.excluded_cities.destroy_all\n @distbutor.destroy\n respond_to do |format|\n format.html { redirect_to distbutors_url, notice: 'Distbutor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def index\n @trackers = Tracker.where(public: true)\n\n render json: @trackers\n end", "def index\n @cargo_manifests = CargoManifest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cargo_manifests }\n end\n end", "def index\n @distribuitors = Distribuitor.all\n end" ]
[ "0.62634605", "0.61989284", "0.6035241", "0.5979277", "0.5971823", "0.59544146", "0.5891396", "0.58873403", "0.5730069", "0.5730069", "0.5672024", "0.5668034", "0.5627325", "0.5575577", "0.55638367", "0.5561043", "0.5556489", "0.55507624", "0.55352765", "0.55317676", "0.55277365", "0.55086863", "0.54686743", "0.54651487", "0.54494447", "0.54468775", "0.54190516", "0.54056746", "0.5402347", "0.54002804", "0.53936964", "0.53878605", "0.5385885", "0.5384876", "0.5384876", "0.5384876", "0.5384876", "0.537256", "0.5347136", "0.5334165", "0.5333689", "0.53213936", "0.5316212", "0.53095204", "0.5308142", "0.53018665", "0.52841115", "0.52777964", "0.5267971", "0.526746", "0.5253556", "0.52526695", "0.5252377", "0.5249423", "0.52419287", "0.5232986", "0.5232679", "0.5226896", "0.5224064", "0.52229017", "0.52212125", "0.5216968", "0.521488", "0.5210552", "0.5209568", "0.5205275", "0.5204839", "0.5202006", "0.52013004", "0.5199561", "0.51958877", "0.51953554", "0.5192377", "0.51879376", "0.51844674", "0.51774645", "0.51768845", "0.5176765", "0.5163501", "0.51631194", "0.5157684", "0.51480836", "0.5144716", "0.51374394", "0.51366717", "0.5135221", "0.51334083", "0.5127027", "0.5117999", "0.511785", "0.5117017", "0.51168394", "0.51112145", "0.51064026", "0.5101811", "0.51009", "0.5100474", "0.50983053", "0.5089203", "0.5088449" ]
0.6895203
0
GET /distbutors/1 GET /distbutors/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @distbutors = Distbutor.page(params[:page])\n end", "def show\n @distraction = Distraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distraction }\n end\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end", "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "def index\n @distros = getmydata(\"Distro\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distros }\n end\n end", "def show\n @denuncium = Denuncium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncium }\n end\n end", "def index\n @distributions = current_user.distributions\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distributions }\n end\n end", "def show\n @therapist = Therapist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @therapist }\n end\n end", "def index\n @distros = Distro.all\n end", "def dresses\n render json: { collections: Collection.published_dresses }\n end", "def index\n @distribuidors = Distribuidor.all\n end", "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "def show\n @dteor = Dteor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dteor }\n end\n end", "def show\n @distribution = @foyer.distributions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @distribution }\n end\n end", "def show\n @denomination = Denomination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denomination }\n end\n end", "def show\n @distribution = current_user.distributions.find(params[:id])\n @letters = @distribution.letters\n @recipients = @distribution.recipients\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distribution }\n end\n end", "def new\n @distraction = Distraction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distraction }\n end\n end", "def show\n @torrent = Torrents.new(:url => \"http://newt.local:9091/transmission/rpc\").find(Integer(params[:id]))\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @torrent }\n end\n end", "def show\n @hot_water_distribution = HotWaterDistribution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hot_water_distribution }\n end\n end", "def index\n @dossiers = Dossier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dossiers }\n end\n end", "def index\n @ordens = Orden.all\n render json: @ordens\n end", "def show\n @cdist_type = CdistType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cdist_type }\n end\n end", "def show\n @traffic = Traffic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @traffic }\n end\n end", "def index\n @distributions = @foyer.distributions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @distributions }\n end\n end", "def index\n getProfile\n @consents = TherapistConsent.where('therapist_id = ? ', @therapist.id)\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render :status => 200, :json => { action: 'index', consents: @consents }}\n end\n end", "def set_distbutor\n @distbutor = Distbutor.find(params[:id])\n end", "def index\n @destinations = Destination.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @destinations }\n end\n end", "def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end", "def index\n @mirrors = Mirror.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mirrors }\n end\n end", "def show\n @destination = Destination.find(params[:id])\n setup_show_data\n\n client = TwitterHelper.get_client\n @twitter_data = client.search(\"to: #{@destination.city}, travel\", :result_type => \"recent\").take(3)\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @destination }\n end\n end", "def index\n @distributors = Distributor.all\n end", "def index\n @cognitive_distortions = CognitiveDistortion.all\n end", "def index\n @torrents = Torrents.new(:url => \"http://newt.local:9091/transmission/rpc\").load\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @torrents }\n end\n end", "def index\n @denominations = Denomination.all\n end", "def show\n @dress = Dress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dress }\n end\n end", "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index\n Rails.logger.info('👻 Disraptor: Showing available routes.')\n\n routes = Disraptor::Route.find_all()\n\n render json: { 'disraptor/routes': routes }\n end", "def show\n @ref_sanatorium = Ref::Sanatorium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ref_sanatorium }\n end\n end", "def show\n @crust = Crust.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crust }\n end\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "def index *_\n @trades = owned_trades_view\n\n render json: @trades\n end", "def index\n @chargers = Charger.all\n render json: @chargers\n end", "def show\n @orden = Orden.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orden }\n end\n end", "def show\n @orden = Orden.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orden }\n end\n end", "def index\n @dog_walks = DogWalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dog_walks }\n end\n \n end", "def show\n @derpu = Derpu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @derpu }\n end\n end", "def show\n render json: @dna\n end", "def index\n @therapists = Therapist.all\n end", "def index\n @therapists = Therapist.all\n end", "def index\n @therapists = Therapist.all\n end", "def index\n @therapists = Therapist.all\n end", "def show\n @farmer = Farmer.find(params[:id])\n\t\t@dispensals = @farmer.dispensals.all.paginate(:page => params[:page], :order => 'updated_at DESC', :per_page => 5)\n\t\t@donations = @farmer.donations.all.paginate(:page => params[:page], :order => 'updated_at DESC', :per_page => 5)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @farmer }\n end\n end", "def show\n @thermo_oil_distribution_year = ThermoOilDistributionYear.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thermo_oil_distribution_year }\n end\n end", "def show\n @coordinador = Coordinador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coordinador }\n end\n end", "def show\n @portion = Portion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @portion }\n end\n end", "def show\n @dinosaur = Dinosaur.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dinosaur }\n end\n end", "def index\n if (params[:redirect] == \"on\")\n sql = <<-SQL\n WITH src AS (SELECT id, daughters(id)\n FROM kine WHERE owner_id = #{params[:search_owner]})\n SELECT json_agg(src) FROM src;\n SQL\n render json: ActiveRecord::Base.connection.select_value(sql)\n else\n @daughters = Daughter.all\n end\n end", "def index\n @recipe_directions = @recipe.directions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipe_directions }\n format.json { render :json => @recipe_directions }\n end\n end", "def show\n dog = Dog.find(params[:id])\n render json: dog\n end", "def show\n travels = Travel.find(params[:id])\n render json: travels, status: :ok\n end", "def show\n @dog_walk = DogWalk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dog_walk }\n end\n end", "def show\n @drip = Drip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drip }\n end\n end", "def index\n @tailors = Tailor.all\n respond_to do |format|\n format.html\n format.json { render json: @tailors}\n end\n end", "def show\n @warrior = Warrior.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @warrior }\n end\n end", "def show\n @warrior = Warrior.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @warrior }\n end\n end", "def index\n @drone_attacks = DroneAttack.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :layout => 'blank'}\n end\n end", "def show\n @diapo = current_church.diapos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diapo }\n end\n end", "def show\n @torso = Torso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @torso }\n end\n end", "def new\n @distribution = Distribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distribution }\n end\n end", "def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end", "def index\n @disabilities = Disability.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disabilities }\n end\n end", "def show\n @uchronist = Uchronist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uchronist }\n end\n end", "def index\n @odists = Odist.all\n end", "def show\n @dolgnost = Dolgnost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dolgnost }\n end\n end", "def show\n dinosaurs = Dinosaur.filter_by_species(params[:species])\n\n if dinosaurs\n render json: dinosaurs\n else\n render json: dinosaurs.errors, status: :unprocessable_entity\n end\n end", "def index\n @breeds = Breed.all\n\n render json: @breeds\n end", "def index\n @uchronists = Uchronist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronists }\n end\n end", "def index\n @normas = Norma.all\n render json: @normas\n end", "def show\n @dart = Dart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dart }\n end\n end", "def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end", "def show\n @districtclass = Districtclass.find(params[:id])\n @districts = @districtclass.districts.all(:order => 'district_name')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @districtclass }\n end\n end", "def index\n @dnas = Dna.all\n\n render json: @dnas\n end", "def show\n @commander = Commander.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commander }\n end\n end", "def show\n donation = Donation.find_by(id: params[:id])\n render json: donation.as_json\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def index\n @ped_strategies = PedStrategy.order(\"hierarchy\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_strategies }\n end\n end", "def show\n # @donor = Donor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donor }\n end\n end", "def show\n @neighborhood = Neighborhood.find(params[:id])\n\n render json: @neighborhood\n end", "def show\n @governor = Governor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @governor }\n end\n end", "def show\n @brother = Brother.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brother }\n end\n end", "def show\n @drone_attack = DroneAttack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :layout => 'blank' }\n end\n end", "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend", "def view\n res = @client.get(path)\n @attributes = res.json if res.success?\n end", "def show\n @persons_release = PersonsRelease.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @persons_release }\n end\n end", "def show\n @medium_road = MediumRoad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medium_road }\n end\n end", "def index\n @servants = Servant.all\n end", "def index\n @setors = Setor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @setors }\n end\n end", "def index\n @transfers = Transfer.all\n render json: @transfers\n end", "def show\n @admin_doubt = Doubt.includes(:author, :user).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_doubt }\n end\n end" ]
[ "0.68222576", "0.65873146", "0.6289365", "0.6289365", "0.62845737", "0.6253436", "0.6049037", "0.5935956", "0.5915018", "0.5870223", "0.58035475", "0.57883215", "0.5718036", "0.5692167", "0.5684572", "0.56815994", "0.5675257", "0.56667966", "0.5650225", "0.5612822", "0.5606738", "0.5590662", "0.5539289", "0.5524757", "0.552323", "0.5521412", "0.5519271", "0.5515685", "0.55093956", "0.54981357", "0.5489389", "0.54867125", "0.54846054", "0.5482501", "0.5479406", "0.54597956", "0.5458062", "0.5448206", "0.54419625", "0.54413104", "0.5437155", "0.5423452", "0.5419076", "0.54179597", "0.5415109", "0.5415109", "0.5406974", "0.54051673", "0.54037", "0.54025793", "0.54025793", "0.54025793", "0.54025793", "0.5402159", "0.5401677", "0.53904665", "0.53902423", "0.53842497", "0.53840744", "0.5383696", "0.5379306", "0.5375766", "0.53754514", "0.5372323", "0.5359832", "0.53591514", "0.53591514", "0.53538597", "0.5348817", "0.53476685", "0.53470844", "0.53460425", "0.53367096", "0.5332686", "0.53321135", "0.5331237", "0.53305215", "0.533019", "0.53289664", "0.53258604", "0.5321729", "0.53212583", "0.5318556", "0.5316949", "0.5314301", "0.5312754", "0.53095657", "0.53020847", "0.5302061", "0.53000873", "0.5299096", "0.5290961", "0.5289701", "0.5287609", "0.52861583", "0.5283564", "0.5283443", "0.527867", "0.52769524", "0.5272493", "0.5270362" ]
0.0
-1
POST /distbutors POST /distbutors.json
def create permision_ok = true distbutor_save = false @distbutor = Distbutor.new(distbutor_params) unless params[:distbutor][:primary_dist_id].nil? params[:distbutor][:included_cities].each do |city_id| if city_id != "" city = City.find_by(id: city_id) state_id = city.state_id country_id = city.state.country_id permision_ok = false unless check_premisions(params[:distbutor][:primary_dist_id], country_id, state_id,city_id) end end if permision_ok params[:distbutor][:included_states].each do |state_id| if state_id != "" country_id = State.find_by(id: state_id).country_id permision_ok = false unless check_premisions(params[:distbutor][:primary_dist_id], country_id, state_id,"") end end end if permision_ok params[:distbutor][:included_countries].each do |country_id| if country_id != "" permision_ok = false unless check_premisions(params[:distbutor][:primary_dist_id], country_id, "","") end end end end (params[:distbutor][:included_countries] - State.where(id: params[:distbutor][:included_states]).pluck(:country_id).uniq).each{ |country_id| @distbutor.included_countries.build country_id: country_id if country_id != ""} (params[:distbutor][:included_states] - City.where(id: params[:distbutor][:included_cities]).pluck(:state_id).uniq).each{ |state_id| @distbutor.included_states.build state_id: state_id if state_id != ""} params[:distbutor][:included_cities].each{ |city_id| @distbutor.included_cities.build city_id: city_id if city_id != ""} (params[:distbutor][:excluded_states] - City.where(id: params[:distbutor][:excluded_cities]).pluck(:state_id).uniq).each{ |state_id| @distbutor.excluded_states.build state_id: state_id if state_id != ""} params[:distbutor][:excluded_cities].each{ |city_id| @distbutor.excluded_cities.build city_id: city_id if city_id != ""} respond_to do |format| if permision_ok distbutor_save = @distbutor.save end if distbutor_save format.html { redirect_to @distbutor, notice: 'Distbutor was successfully created.' } format.json { render :show, status: :created, location: @distbutor } else format.html { render :new } format.json { render json: @distbutor.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @distraction = Distraction.new(params[:distraction])\n\n respond_to do |format|\n if @distraction.save\n format.html { redirect_to @distraction, notice: 'Distraction was successfully created.' }\n format.json { render json: @distraction, status: :created, location: @distraction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @distraction.errors, status: :unprocessable_entity }\n end\n end\n end", "def distbutor_params\n params.require(:distbutor).permit(:name)\n end", "def create\n @distributor = Distributor.new(params[:distributor])\n\n respond_to do |format|\n if @distributor.save\n format.html { redirect_to distributors_url }\n format.json { render json: @distributor, status: :created, location: @distributor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @distributor.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @distribuidor = Distribuidor.new(distribuidor_params)\n\n respond_to do |format|\n if @distribuidor.save\n format.html { redirect_to @distribuidor, notice: 'El distribuidor a sido creado.' }\n format.json { render :show, status: :created, location: @distribuidor }\n else\n format.html { render :new }\n format.json { render json: @distribuidor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @odist = Odist.new(odist_params)\n\n respond_to do |format|\n if @odist.save\n format.html { redirect_to @odist, notice: 'Odist was successfully created.' }\n format.json { render :show, status: :created, location: @odist }\n else\n format.html { render :new }\n format.json { render json: @odist.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @distro = Distro.new(distro_params)\n\n respond_to do |format|\n if @distro.save\n format.html { redirect_to @distro, notice: 'Distro was successfully created.' }\n format.json { render action: 'show', status: :created, location: @distro }\n else\n format.html { render action: 'new' }\n format.json { render json: @distro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @denuncium = Denuncium.new(params[:denuncium])\n\n respond_to do |format|\n if @denuncium.save\n format.html { redirect_to @denuncium, notice: 'Denuncium was successfully created.' }\n format.json { render json: @denuncium, status: :created, location: @denuncium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denuncium.errors, status: :unprocessable_entity }\n end\n end\n end", "def denunciation_params\n params.require(:denunciation).permit(:survivor_id, :sender_id)\n end", "def create\n \n @distribution = @foyer.distributions.build(params[:distribution])\n\n respond_to do |format|\n if @distribution.save\n flash[:notice] = 'Distribution a bien été crée.'\n format.html { redirect_to foyer_distributions_url(@foyer) }\n format.xml { render :xml => @distribution, :status => :created, :location => @distribution }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @distribution.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @asserted_distribution = AssertedDistribution.new(asserted_distribution_params)\n respond_to do |format|\n if @asserted_distribution.save\n format.html { redirect_to @asserted_distribution, notice: 'Asserted distribution was successfully created.' }\n format.json { render :show, status: :created, location: @asserted_distribution }\n else\n format.html { render :new }\n format.json { render json: @asserted_distribution.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @therapist = Therapist.new(therapist_params)\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to @therapist, notice: 'Therapist was successfully created.' }\n format.json { render :show, status: :created, location: @therapist }\n else\n format.html { render :new }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @therapist = Therapist.new(therapist_params)\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to @therapist, notice: 'Therapist was successfully created.' }\n format.json { render :show, status: :created, location: @therapist }\n else\n format.html { render :new }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @therapist = Therapist.new(params[:therapist])\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to @therapist, notice: 'Therapist was successfully created.' }\n format.json { render json: @therapist, status: :created, location: @therapist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(path, **args); end", "def create\n @doctor = Doctor.new(params[:doctor])\n\n if @doctor.save\n render json: @doctor, status: :created, location: @doctor\n else\n render json: @doctor.errors, status: :unprocessable_entity\n end\n end", "def create\n @distribuidora = Distribuidora.new(params[:distribuidora])\n\n respond_to do |format|\n if @distribuidora.save\n format.html { redirect_to(@distribuidora, :notice => 'Distribuidora was successfully created.') }\n format.xml { render :xml => @distribuidora, :status => :created, :location => @distribuidora }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @distribuidora.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: 'Vendedor was successfully created.' }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: 'Vendedor was successfully created.' }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @distributor = Distributor.new(distributor_params)\n\n respond_to do |format|\n if @distributor.save\n format.js { render_js_for_form @distributor,distributors_path, '创建成功!' }\n else\n format.js { render_js_for_form @distributor }\n end\n end\n end", "def create\n @d_dungeoneer = DDungeoneer.new(d_dungeoneer_params)\n\n ActiveRecord::Base.transaction do\n respond_to do |format|\n if @d_dungeoneer.save\n format.html { redirect_to @d_dungeoneer, notice: 'D dungeoneer was successfully created.' }\n format.json { render :show, status: :created, location: @d_dungeoneer }\n else\n format.html { render :new }\n format.json { render json: @d_dungeoneer.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end", "def create\n @user_distributor = UserDistributor.new(user_distributor_params)\n\n respond_to do |format|\n if @user_distributor.save\n format.html { redirect_to @user_distributor, notice: 'User distributor was successfully created.' }\n format.json { render :show, status: :created, location: @user_distributor }\n else\n format.html { render :new }\n format.json { render json: @user_distributor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dte_direction = DteDirection.new(dte_direction_params)\n\n respond_to do |format|\n if @dte_direction.save\n format.html { redirect_to @dte_direction, notice: 'Dte direction was successfully created.' }\n format.json { render :show, status: :created, location: @dte_direction }\n else\n format.html { render :new }\n format.json { render json: @dte_direction.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @distro = Distro.new(params[:distro])\n @distro.account_id = @oeaccount.id\n respond_to do |format|\n if @distro.save\n\taddtoaccount(\"distros\", @distro)\n format.html { redirect_to distros_url, notice: 'Distro was successfully created.' }\n format.json { render json: @distro, status: :created, location: @distro }\n else\n format.html { render action: \"new\" }\n format.json { render json: @distro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dteor = Dteor.new(params[:dteor])\n\n respond_to do |format|\n if @dteor.save\n format.html { redirect_to @dteor, notice: t(:created) }\n format.json { render json: @dteor, status: :created, location: @dteor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dteor.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_tenant_to_specified_shard(args = {}) \n post(\"/tenants.json/shard/#{args[:shardId]}\", args)\nend", "def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end", "def create\n @distrito_origen = DistritoOrigen.new(distrito_origen_params)\n\n respond_to do |format|\n if @distrito_origen.save\n format.html { redirect_to @distrito_origen, notice: 'Distrito origen was successfully created.' }\n format.json { render :show, status: :created, location: @distrito_origen }\n else\n format.html { render :new }\n format.json { render json: @distrito_origen.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dress = Dress.new(params[:dress])\n\n respond_to do |format|\n if @dress.save\n format.html { redirect_to @dress, notice: 'Dress was successfully created.' }\n format.json { render json: @dress, status: :created, location: @dress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dress.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @therapist = Therapist.new(therapist_params)\n @therapist.user_id = current_user.id\n @therapist.specialty_ids = params[:therapist][:specialty_ids]\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to root_path, notice: \"Therapist was successfully created.\" }\n else\n format.html { render :new }\n end\n end\n end", "def create\n @dress = Dress.new(params[:dress])\n\n respond_to do |format|\n if @dress.save\n format.html { redirect_to @dress, notice: 'Vestido criado com sucesso.' }\n format.json { render json: @dress, status: :created, location: @dress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dress.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @denomination = Denomination.new(params[:denomination])\n\n respond_to do |format|\n if @denomination.save\n format.html { redirect_to @denomination, notice: 'Denomination was successfully created.' }\n format.json { render json: @denomination, status: :created, location: @denomination }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denomination.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @route = Route.new(params[:route])\n \n waypoints = params[:waypoints]\n creator = params[:creator]\n updated_at = params[:updated_at]\n name = params[:name]\n\n @route = Route.new(waypoints: waypoints, creator: creator, updated_at: updated_at, name: name)\n \n @route.save\n\n render json: @route\n\n # @vote_creator = VoteCreator.new(vote_params)\n # @vote = @vote_creator.vote\n # if @vote_creator.save\n # render json: @vote, status: :created, location: @vote\n # else\n # render json: @vote.errors, status: :unprocessable_entity\n # end\n end", "def create\n @hot_water_distribution = HotWaterDistribution.new(params[:hot_water_distribution])\n\n respond_to do |format|\n if @hot_water_distribution.save\n format.html { redirect_to @hot_water_distribution, notice: 'Hot water distribution was successfully created.' }\n format.json { render json: @hot_water_distribution, status: :created, location: @hot_water_distribution }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hot_water_distribution.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @duer = Duer.new(duer_params)\n\n respond_to do |format|\n if @duer.save\n format.html { redirect_to @duer, notice: 'Duer was successfully created.' }\n format.json { render :show, status: :created, location: @duer }\n else\n format.html { render :new }\n format.json { render json: @duer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @docter = Docter.new(docter_params)\n\n respond_to do |format|\n if @docter.save\n format.html { redirect_to @docter, notice: \"Docter was successfully created.\" }\n format.json { render :show, status: :created, location: @docter }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @docter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dater = Dater.new(dater_params)\n\n respond_to do |format|\n if @dater.save\n format.html { redirect_to @dater, notice: 'Dater was successfully created.' }\n format.json { render :show, status: :created, location: @dater }\n else\n format.html { render :new }\n format.json { render json: @dater.errors, status: :unprocessable_entity }\n end\n end\n end", "def post operation, data={}\n body = case data\n when String\n body = data\n else\n Yajl::Encoder.encode(data)\n end\n\n request = new_request operation, body\n request.sign sts\n hydra.queue request\n hydra.run\n response = request.response\n puts response.inspect if @debug\n\n if response.code == 200\n Yajl::Parser.parse response.body\n else\n raise_error response\n end\n end", "def create\n @daw_representante = DawRepresentante.new(daw_representante_params)\n\n respond_to do |format|\n if @daw_representante.save\n format.html { redirect_to @daw_representante, notice: 'Daw representante was successfully created.' }\n format.json { render :show, status: :created, location: @daw_representante }\n else\n format.html { render :new }\n format.json { render json: @daw_representante.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tree = Tree.new(params[:tree])\n @tree.synclatlon\n respond_to do |format|\n if @tree.save\n format.html { redirect_to @tree, notice: 'Tree was successfully created.' }\n format.json { render json: @tree, status: :created, location: @tree }\n else\n format.html { render 'new' }\n format.json { render json: @tree.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipo_distribucion = TipoDistribucion.new(tipo_distribucion_params)\n\n respond_to do |format|\n if @tipo_distribucion.save\n format.html { redirect_to @tipo_distribucion, notice: 'Tipo distribucion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tipo_distribucion }\n else\n format.html { render action: 'new' }\n format.json { render json: @tipo_distribucion.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_distbutor\n @distbutor = Distbutor.find(params[:id])\n end", "def create\n @denomination = Denomination.new(denomination_params)\n\n respond_to do |format|\n if @denomination.save\n format.html { redirect_to @denomination, notice: 'Denomination was successfully created.' }\n format.json { render :show, status: :created, location: @denomination }\n else\n format.html { render :new }\n format.json { render json: @denomination.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dna = Dna.new(dna_params)\n\n if @dna.save\n render json: @dna, status: :created, location: @dna\n else\n render json: @dna.errors, status: :unprocessable_entity\n end\n end", "def create\n @distribuitor = Distribuitor.new(distribuitor_params)\n\n respond_to do |format|\n if @distribuitor.save\n format.html { redirect_to @distribuitor, notice: 'Distribuitor was successfully created.' }\n format.json { render :show, status: :created, location: @distribuitor }\n else\n format.html { render :new }\n format.json { render json: @distribuitor.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @distraction = Distraction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distraction }\n end\n end", "def create\n res = self.class.post('/', body: attrs)\n res.created?\n end", "def create\n @orden = Orden.new(params[:orden])\n\n respond_to do |format|\n if @orden.save\n format.html { redirect_to @orden, notice: 'Orden was successfully created.' }\n format.json { render json: @orden, status: :created, location: @orden }\n else\n format.html { render action: \"new\" }\n format.json { render json: @orden.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end", "def create\n @trnodo = Trnodo.new(params[:trnodo])\n\n respond_to do |format|\n if @trnodo.save\n format.html { redirect_to @trnodo, notice: 'Trnodo was successfully created.' }\n format.json { render json: @trnodo, status: :created, location: @trnodo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trnodo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @district = District.new(district_params)\n\n respond_to do |format|\n if @district.save\n format.html { redirect_to @district, notice: 'District was successfully created.' }\n format.json { render :show, status: :created, location: @district }\n else\n format.html { render :new }\n format.json { render json: @district.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @district = District.new(district_params)\n\n respond_to do |format|\n if @district.save\n format.html { redirect_to @district, notice: 'District was successfully created.' }\n format.json { render :show, status: :created, location: @district }\n else\n format.html { render :new }\n format.json { render json: @district.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n dive = Dive.new(dive_params)\n if dive.save\n render json: dive\n else\n render json: {message: dive.errors}, status: 400\n end\n end", "def create\n @dinosaur = Dinosaur.new(params[:dinosaur])\n\n respond_to do |format|\n if @dinosaur.save\n format.html { redirect_to @dinosaur, notice: 'Dinosaur was successfully created.' }\n format.json { render json: @dinosaur, status: :created, location: @dinosaur }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dinosaur.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dinosaur = Dinosaur.new(dinosaur_params)\n\n respond_to do |format|\n if @dinosaur.save\n format.html { redirect_to @dinosaur, notice: \"Dinosaur was successfully created.\" }\n format.json { render :show, status: :created, location: @dinosaur }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @dinosaur.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: t('.sucesso') }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end", "def distribution_params\n params.require(:distribution).permit(:name)\n end", "def create\n @ordinateur = Ordinateur.new(ordinateur_params)\n\n respond_to do |format|\n if @ordinateur.save\n format.html { redirect_to @ordinateur, notice: 'Ordinateur was successfully created.' }\n format.json { render :show, status: :created, location: @ordinateur }\n else\n format.html { render :new }\n format.json { render json: @ordinateur.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admins_district = Admins::District.new(admins_district_params)\n\n respond_to do |format|\n if @admins_district.save\n format.html { redirect_to @admins_district, notice: 'District was successfully created.' }\n format.json { render :show, status: :created, location: @admins_district }\n else\n format.html { render :new }\n format.json { render json: @admins_district.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n TargetsForm.new(target_params).save\n\n respond_to do |format|\n format.html { redirect_to after_write_path, notice: 'Targets were successfully created.' }\n format.json { render :show, status: :created, location: @target }\n end\n end", "def create\n @department = Department.find(params[:department_id])\n @town = @department.towns.new(town_params)\n respond_to do |format|\n if @town.save\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", "def create\n @persons_release = PersonsRelease.new(params[:persons_release])\n\n respond_to do |format|\n if @persons_release.save\n format.html { redirect_to @persons_release, notice: 'Persons release was successfully created.' }\n format.json { render json: @persons_release, status: :created, location: @persons_release }\n else\n format.html { render action: \"new\" }\n format.json { render json: @persons_release.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cognitive_distortion = CognitiveDistortion.new(cognitive_distortion_params)\n\n respond_to do |format|\n if @cognitive_distortion.save\n format.html { redirect_to @cognitive_distortion, notice: 'Cognitive distortion was successfully created.' }\n format.json { render :show, status: :created, location: @cognitive_distortion }\n else\n format.html { render :new }\n format.json { render json: @cognitive_distortion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dino = Dino.new(dino_params)\n\n respond_to do |format|\n if @dino.save\n format.html { redirect_to @dino, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @dino }\n else\n format.html { render :new }\n format.json{ render json: @dino.errors, status: :unprocessable_entity }\n end\n end\nend", "def create\n @derp = Derp.new(derp_params)\n\n respond_to do |format|\n if @derp.save\n format.html { redirect_to @derp, notice: 'Derp was successfully created.' }\n format.json { render :show, status: :created, location: @derp }\n else\n format.html { render :new }\n format.json { render json: @derp.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @calendar = Calendar.new(params[:calendar])\n @calendar.update_attribute :user_id, current_user.id\n\n params[:doors].each_value do |door|\n @calendar.doors.build(door)\n end\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render json: @calendar, status: :created, location: @calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @electoral_district = ElectoralDistrict.new(params[:electoral_district])\n\n respond_to do |format|\n if @electoral_district.save\n format.html { redirect_to @electoral_district, notice: 'Electoral district was successfully created.' }\n format.json { render json: @electoral_district, status: :created, location: @electoral_district }\n else\n format.html { render action: \"new\" }\n format.json { render json: @electoral_district.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ref_sanatorium = Ref::Sanatorium.new(params[:ref_sanatorium])\n\n respond_to do |format|\n if @ref_sanatorium.save\n format.html { redirect_to ref_sanatoria_path, notice: I18n.t(:record_created) }\n format.json { render json: @ref_sanatorium, status: :created, location: @ref_sanatorium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ref_sanatorium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @destination = @organism.destinations.new(params[:destination])\n\n respond_to do |format|\n if @destination.save\n format.html { redirect_to admin_organism_destinations_path(@organism),\n notice: \"L'activité #{@destination.name} a été créée.\" }\n \n format.json { render json: @destination, status: :created, location: @destination }\n else\n format.html { render action: \"new\" }\n format.json { render json: @destination.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trein_coord_pedag = TreinCoordPedag.new(trein_coord_pedag_params)\n\n respond_to do |format|\n if @trein_coord_pedag.save\n format.html { redirect_to @trein_coord_pedag, notice: 'Trein coord pedag was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trein_coord_pedag }\n else\n format.html { render action: 'new' }\n format.json { render json: @trein_coord_pedag.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @track_dress = TrackDress.new(params[:track_dress])\n\n respond_to do |format|\n if @track_dress.save\n format.html { redirect_to @track_dress, notice: 'Track dress was successfully created.' }\n format.json { render json: @track_dress, status: :created, location: @track_dress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @track_dress.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dinosaur = Dinosaur.new(dinosaur_params)\n\n respond_to do |format|\n if @dinosaur.save\n format.html { redirect_to @dinosaur, notice: 'Dinosaur was successfully created.' }\n format.json { render :show, status: :created, location: @dinosaur }\n else\n format.html { render :new }\n format.json { render json: @dinosaur.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @derpu = Derpu.new(params[:derpu])\n\n respond_to do |format|\n if @derpu.save\n format.html { redirect_to @derpu, notice: 'Derpu was successfully created.' }\n format.json { render json: @derpu, status: :created, location: @derpu }\n else\n format.html { render action: \"new\" }\n format.json { render json: @derpu.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @door_tag = DoorTag.new(door_tag_params)\n\n respond_to do |format|\n if @door_tag.save\n format.html { redirect_to @door_tag, notice: 'Door tag was successfully created.' }\n format.json { render :show, status: :created, location: @door_tag }\n else\n format.html { render :new }\n format.json { render json: @door_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(*args)\n request(:post, *args)\n end", "def create\n @tour = Tour.find(params[:tour_id])\n @attraction_tour = AttractionTour.new(params[:attraction_tour])\n\n respond_to do |format|\n if @attraction_tour.save\n format.html { redirect_to @tour, notice: 'Attraction tour was successfully created.' }\n # format.json { render json: @attraction_tour, status: :created, location: @attraction_tour }\n else\n # format.html { render action: \"new\" }\n # format.json { render json: @attraction_tour.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @direcciont = Direcciont.new(direcciont_params)\n\n respond_to do |format|\n if @direcciont.save\n format.html { redirect_to @direcciont, notice: 'Direcciont was successfully created.' }\n format.json { render :show, status: :created, location: @direcciont }\n else\n format.html { render :new }\n format.json { render json: @direcciont.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @distbutors = Distbutor.page(params[:page])\n end", "def create\n init = params[:distrik][:name][0]\n distributor = Distributor.find_by_name(params[:distributor_id])\n distrik_number = Distrik.create_number(params)\n @distrik = Distrik.new(distrik_params.merge(:distributor_id => (distributor.id rescue nil)))\n if @distrik.save\n flash[:notice] = t(:successfully_created)\n redirect_to distriks_path\n else\n flash[:error] = @distrik.errors.full_messages.join('<br/>')\n render \"new\"\n end\n end", "def create\n # @cord = Cord.new(cord_params)\n @cord = @racquet.cords.new(cord_params)\n @cord.user = current_user\n respond_to do |format|\n if @cord.save\n format.html { redirect_to @cord, notice: t('cords.create.success') }\n format.json { render :show, status: :created, location: @cord }\n else\n format.html { render :new }\n format.json { render json: @cord.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @fornecedor = Fornecedor.new(fornecedor_params)\n\n respond_to do |format|\n if @fornecedor.save\n format.html { redirect_to @fornecedor, notice: 'Fornecedor was successfully created.' }\n format.json { render :show, status: :created, location: @fornecedor }\n else\n format.html { render :new }\n format.json { render json: @fornecedor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dor_master = DorMaster.new(dor_master_params)\n\n respond_to do |format|\n if @dor_master.save\n format.html { redirect_to @dor_master, notice: 'Dor master was successfully created.' }\n format.json { render :show, status: :created, location: @dor_master }\n else\n format.html { render :new }\n format.json { render json: @dor_master.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @realtor = Realtor.new(realtor_params)\n\n respond_to do |format|\n if @realtor.save\n format.html { redirect_to @realtor, notice: 'Realtor was successfully created.' }\n format.json { render :show, status: :created, location: @realtor }\n else\n format.html { render :new }\n format.json { render json: @realtor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @orden = Orden.new(orden_params)\n\t\tset_options_for_selects(@vendedor)\n\n respond_to do |format|\n if current_user.tiene_permiso_sobre?(@orden) && @orden.save\n format.html { redirect_to @orden, notice: 'La orden se creó exitosamente.' }\n format.json { render :show, status: :created, location: @orden }\n else\n format.html { render :new }\n format.json { render json: @orden.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(*args)\n post(*args)\n end", "def create(*args)\n post(*args)\n end", "def create\n @dino = Dino.new(dino_params)\n\n if @dino.save\n render json: @dino, status: :created, location: @dino\n else\n render json: @dino.errors, status: :unprocessable_entity\n end\n end", "def create\n @uder = Uder.new(uder_params)\n\n respond_to do |format|\n if @uder.save\n format.html { redirect_to @uder, notice: 'Uder was successfully created.' }\n format.json { render action: 'show', status: :created, location: @uder }\n else\n format.html { render action: 'new' }\n format.json { render json: @uder.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @scrapping_datum = ScrappingDatum.new(scrapping_datum_params)\n\n respond_to do |format|\n if @scrapping_datum.save\n format.html { redirect_to @scrapping_datum, notice: 'Scrapping datum was successfully created.' }\n format.json { render :show, status: :created, location: @scrapping_datum }\n else\n format.html { render :new }\n format.json { render json: @scrapping_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account_balance_distribution = AccountBalanceDistribution.new(account_balance_distribution_params)\n\n respond_to do |format|\n if @account_balance_distribution.save\n format.html { redirect_to @account_balance_distribution, notice: 'Account balance distribution was successfully created.' }\n format.json { render :show, status: :created, location: @account_balance_distribution }\n else\n format.html { render :new }\n format.json { render json: @account_balance_distribution.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trash_wheel = TrashWheel.new(trash_wheel_params)\n\n respond_to do |format|\n if @trash_wheel.save\n format.html { redirect_to @trash_wheel, notice: 'Trash wheel was successfully created.' }\n format.json { render :show, status: :created, location: @trash_wheel }\n else\n format.html { render :new }\n format.json { render json: @trash_wheel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @denuncia_tipo = DenunciaTipo.new(params[:denuncia_tipo])\n\n respond_to do |format|\n if @denuncia_tipo.save\n format.html { redirect_to @denuncia_tipo, notice: 'Denuncia tipo was successfully created.' }\n format.json { render json: @denuncia_tipo, status: :created, location: @denuncia_tipo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denuncia_tipo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dolgnost = Dolgnost.new(params[:dolgnost])\n\n respond_to do |format|\n if @dolgnost.save\n format.html { redirect_to @dolgnost, notice: 'Dolgnost was successfully created.' }\n format.json { render json: @dolgnost, status: :created, location: @dolgnost }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dolgnost.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @donante = Donante.new(donante_params)\n\n respond_to do |format|\n if @donante.save\n format.html { redirect_to @donante, notice: 'Donante was successfully created.' }\n format.json { render action: 'show', status: :created, location: @donante }\n else\n format.html { render action: 'new' }\n format.json { render json: @donante.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @distortion_pattern = DistortionPattern.new(distortion_pattern_params)\n\n respond_to do |format|\n if @distortion_pattern.save\n format.html { redirect_to @distortion_pattern, notice: 'Distortion pattern was successfully created.' }\n format.json { render :show, status: :created, location: @distortion_pattern }\n else\n format.html { render :new }\n format.json { render json: @distortion_pattern.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @therapist = Therapist.new(therapist_params.merge({code: create_code}))\n if @therapist.save\n render :json => {\n id: @therapist.id,\n email: @therapist.email,\n firstName: @therapist.first_name,\n lastName: @therapist.last_name,\n prefix: @therapist.prefix,\n profession: @therapist.profession,\n code: @therapist.code,\n token: get_token(@therapist)\n }\n else\n render json: @therapist.errors, status: :unprocessable_entity\n # render json: @therapist.errors, status: :unprocessable_entity\n end\n end", "def create\n\n # process the dob\n params[:actor][:dob] = DateSelectHelper.to_datetime(params[:selected_date])\n\n @actor = Actor.new(params[:actor])\n\n # check for new dvds\n @dvd_ids = params[:dvds] ? params[:dvds][\"ids\"] : nil\n if @dvd_ids\n @dvd_ids.shift\n @actor.dvds << Dvd.find(@dvd_ids)\n end\n\n respond_to do |format|\n if @actor.save\n format.html { redirect_to @actor, notice: 'Actor was successfully created.' }\n format.json { render json: @actor, status: :created, location: @actor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @actor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dn = Dn.new(dn_params)\n\n respond_to do |format|\n if @dn.save\n format.html { redirect_to @dn, notice: 'Dn was successfully created.' }\n format.json { render :show, status: :created, location: @dn }\n else\n format.html { render :new }\n format.json { render json: @dn.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @distbutor.included_countries.destroy_all\n @distbutor.included_states.destroy_all\n @distbutor.included_cities.destroy_all\n @distbutor.excluded_states.destroy_all\n @distbutor.excluded_cities.destroy_all\n @distbutor.destroy\n respond_to do |format|\n format.html { redirect_to distbutors_url, notice: 'Distbutor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @verb = Verb.new(verb_params)\n\n if @verb.save\n render json: @verb, status: :created, location: @verb\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end" ]
[ "0.61072874", "0.5995997", "0.58573854", "0.5799921", "0.57047284", "0.56995595", "0.56933165", "0.566171", "0.5570877", "0.5405011", "0.5402178", "0.5346824", "0.5346824", "0.5345333", "0.532258", "0.53208166", "0.531193", "0.5310517", "0.5310517", "0.530808", "0.5288895", "0.52859885", "0.5281137", "0.5268417", "0.5240691", "0.52387637", "0.52325046", "0.5232196", "0.5224682", "0.5223035", "0.5218941", "0.5216363", "0.52073693", "0.52002", "0.5179217", "0.5174132", "0.51725316", "0.5172369", "0.51708376", "0.516395", "0.51622903", "0.5162168", "0.5159773", "0.5133728", "0.51299775", "0.5129499", "0.51266843", "0.5126463", "0.5125011", "0.5123077", "0.5121458", "0.5121458", "0.51176214", "0.51124614", "0.51100236", "0.5101661", "0.51011044", "0.5098743", "0.5097471", "0.5096036", "0.5092425", "0.50911075", "0.5083511", "0.5079531", "0.5067846", "0.5067683", "0.50658625", "0.5063755", "0.50637114", "0.5063006", "0.5062517", "0.5062234", "0.5061561", "0.5048598", "0.50451535", "0.50401825", "0.5039056", "0.5038426", "0.5029812", "0.502857", "0.5028405", "0.50280416", "0.50170434", "0.50162715", "0.50106215", "0.50106215", "0.50089955", "0.49983227", "0.49963295", "0.49943298", "0.49917698", "0.4990709", "0.49874306", "0.4987331", "0.49831742", "0.49785528", "0.49766102", "0.49749509", "0.49742284", "0.4973011" ]
0.5391399
11
DELETE /distbutors/1 DELETE /distbutors/1.json
def destroy @distbutor.included_countries.destroy_all @distbutor.included_states.destroy_all @distbutor.included_cities.destroy_all @distbutor.excluded_states.destroy_all @distbutor.excluded_cities.destroy_all @distbutor.destroy respond_to do |format| format.html { redirect_to distbutors_url, notice: 'Distbutor was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @distraction = Distraction.find(params[:id])\n @distraction.destroy\n\n respond_to do |format|\n format.html { redirect_to distractions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @distro = Distro.find(params[:id])\n @distro.destroy\n\n respond_to do |format|\n format.html { redirect_to distros_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @distro.destroy\n respond_to do |format|\n format.html { redirect_to distros_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @distro = Distro.find(params[:id])\n removefromaccount(\"distros\", @distro)\n @distro.destroy\n\n respond_to do |format|\n format.html { redirect_to distros_url }\n format.json { head :ok }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete\n @delete ||= Verb.new do |verb|\n verb.entity :trip, :air, :lodging, :car, :profile, :rail, \\\n :transport, :cruise, :restaurant, :activity, :note, :map, \\\n :directions \\\n do |entity, id|\n do_request('delete', entity, {:id=>id}, nil)\n end\n end\n end", "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", "def destroy\n @therapist = Therapist.find(params[:id])\n @therapist.destroy\n\n respond_to do |format|\n format.html { redirect_to therapists_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def orchio_delete\n response = client.send_request :delete, inst_args\n orchio_status response, 204\n end", "def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def destroy\n @denuncium = Denuncium.find(params[:id])\n @denuncium.destroy\n\n respond_to do |format|\n format.html { redirect_to denuncia_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @distribuidor.destroy\n respond_to do |format|\n format.html { redirect_to distribuidors_url, notice: 'El distribuidor a sido eliminado.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @dteor = Dteor.find(params[:id])\n @dteor.destroy\n\n respond_to do |format|\n format.html { redirect_to dteors_url }\n format.json { head :no_content }\n end\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def destroy\n @distrito_origen.destroy\n respond_to do |format|\n format.html { redirect_to distrito_origens_url, notice: 'Distrito origen was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subway.destroy\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @district_chief = DistrictChief.find(params[:id])\n @district_chief.destroy\n\n respond_to do |format|\n format.html { redirect_to district_chiefs_url }\n format.json { head :no_content }\n end\n end", "def delete(*args)\n request(:delete, *args)\n end", "def destroy\n @hydrant = Hydrant.find(params[:id])\n @hydrant.destroy\n\n respond_to do |format|\n format.html { redirect_to(hydrants_url) }\n format.xml { head :ok }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @dart = Dart.find(params[:id])\n @dart.destroy\n\n respond_to do |format|\n format.html { redirect_to darts_url }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @odist.destroy\n respond_to do |format|\n format.html { redirect_to odists_url, notice: 'Odist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @distributor = Distributor.find(params[:id])\n @distributor.destroy\n\n respond_to do |format|\n format.html { redirect_to distributors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @conductor = Conductor.find(params[:id])\n @conductor.destroy\n\n respond_to do |format|\n format.html { redirect_to conductors_url }\n format.json { head :no_content }\n end\n end", "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", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @dinosaur = Dinosaur.find(params[:id])\n @dinosaur.destroy\n\n respond_to do |format|\n format.html { redirect_to dinosaurs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @diapo = current_church.diapos.find(params[:id])\n @diapo.destroy\n\n respond_to do |format|\n format.html { redirect_to diapos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @crust = Crust.find(params[:id])\n @crust.destroy\n\n respond_to do |format|\n format.html { redirect_to crusts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stone = Stone.find(params[:id])\n @stone.destroy\n\n respond_to do |format|\n format.html { redirect_to stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cordinator.destroy\n respond_to do |format|\n format.html { redirect_to cordinators_url, notice: 'El cordinador se ha eliminado correctamente' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subway = Subway.find(params[:id])\n @subway.destroy\n\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :ok }\n end\n end", "def delete_pathway\n pathway = Pathway.find(params[:pathway_par])\n current_user.pathways.delete(pathway)\n if current_user.pathways.size < 1\n respond_to do |format|\n format.html { redirect_to '/saved#pathways' }\n format.json { head :no_content }\n end\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @medium_road = MediumRoad.find(params[:id])\n @medium_road.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_roads_url }\n format.json { head :no_content }\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def destroy\n @verb.destroy\n respond_to do |format|\n format.html { redirect_to verbs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dress = Dress.find(params[:id])\n @dress.destroy\n\n respond_to do |format|\n format.html { redirect_to dresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dress = Dress.find(params[:id])\n @dress.destroy\n\n respond_to do |format|\n format.html { redirect_to dresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @orphan.destroy\n respond_to do |format|\n format.html { redirect_to orphans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @club_path = ClubPath.find(params[:id])\n @club_path.destroy\n\n respond_to do |format|\n format.html { redirect_to club_paths_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @uchronist = Uchronist.find(params[:id])\n @uchronist.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trnodo = Trnodo.find(params[:id])\n @trnodo.destroy\n\n respond_to do |format|\n format.html { redirect_to trnodos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ref_sanatorium = Ref::Sanatorium.find(params[:id])\n @ref_sanatorium.destroy\n\n respond_to do |format|\n format.html { redirect_to ref_sanatoria_url }\n format.json { head :ok }\n end\n end", "def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n head :no_content\n end", "def destroy\n @direcciont.destroy\n respond_to do |format|\n format.html { redirect_to direccionts_url, notice: 'Direcciont was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @distribution = current_user.distributions.find(params[:id])\n @distribution.destroy\n\n respond_to do |format|\n format.html { redirect_to distributions_url }\n format.json { head :no_content }\n end\n end", "def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end", "def cfdelete(dist_id) # cf://DIST_ID\n send_command \"cfdelete\", dist_id\n end", "def destroy\n @coordinador = Coordinador.find(params[:id])\n @coordinador.destroy\n\n respond_to do |format|\n format.html { redirect_to coordinadors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @verb.destroy\n\n head :no_content\n end", "def destroy\n @therapist.destroy\n respond_to do |format|\n format.html { redirect_to therapists_url, notice: 'Therapist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @therapist.destroy\n respond_to do |format|\n format.html { redirect_to therapists_url, notice: 'Therapist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @therapist.destroy\n respond_to do |format|\n format.html { redirect_to therapists_url, notice: 'Therapist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @moonwalk.destroy\n respond_to do |format|\n format.html { redirect_to moonwalks_url }\n format.json { head :no_content }\n end\n end", "def delete!\n request! :delete\n end", "def destroy\n @bustour.destroy\n respond_to do |format|\n format.html { redirect_to bustours_url }\n format.json { head :no_content }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n @dragon = Dragon.find(params[:id])\n @dragon.destroy\n\n respond_to do |format|\n format.html { redirect_to dragons_url }\n format.json { head :ok }\n end\n end", "def destroy\n @drip = Drip.find(params[:id])\n @drip.destroy\n\n respond_to do |format|\n format.html { redirect_to drips_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @d_dungeoneer.destroy\n respond_to do |format|\n format.html { redirect_to d_dungeoneers_url, notice: 'D dungeoneer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n delete_from_server single_url\n end", "def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tangent.destroy\n respond_to do |format|\n format.html { redirect_to tangents_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @click_thru = ClickThru.find(params[:id])\n @click_thru.destroy\n\n respond_to do |format|\n format.html { redirect_to click_thrus_url }\n format.json { head :no_content }\n end\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end", "def destroy\n @drone_attack = DroneAttack.find(params[:id])\n @drone_attack.destroy\n\n respond_to do |format|\n format.html { redirect_to drone_attacks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dinosaur.destroy\n head :no_content\n end", "def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @director = Director.find(params[:id])\n @director.destroy\n\n respond_to do |format|\n format.html { redirect_to directors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stall.destroy\n respond_to do |format|\n format.html { redirect_to stalls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @attraction_tour = AttractionTour.find(params[:id])\n @tour = @attraction_tour.tour\n @attraction_tour.destroy\n\n respond_to do |format|\n format.html { redirect_to @tour }\n format.json { head :no_content }\n end\n end", "def destroy\n @patron_merge.destroy\n\n respond_to do |format|\n format.html { redirect_to(patron_merges_url) }\n format.json { head :no_content }\n end\n end", "def destroy\n @hot_water_distribution = HotWaterDistribution.find(params[:id])\n @hot_water_distribution.destroy\n\n respond_to do |format|\n format.html { redirect_to hot_water_distributions_url }\n format.json { head :no_content }\n end\n end", "def delete\n \n end", "def delete(path)\n request 'DELETE', path\n end", "def destroy\r\n @antenne = Antenne.find(params[:id])\r\n @antenne.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to antennes_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @forest.destroy\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @direccion.destroy\n respond_to do |format|\n format.html { redirect_to direcciones_url, notice: 'Direccion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @traffic = Traffic.find(params[:id])\n @traffic.destroy\n\n respond_to do |format|\n format.html { redirect_to traffics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @forest = Forest.find(params[:id])\n @forest.destroy\n\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.6996186", "0.6981359", "0.69567233", "0.69200337", "0.68614525", "0.6808126", "0.6790421", "0.6625706", "0.6623951", "0.659913", "0.6594662", "0.65899205", "0.658851", "0.6575037", "0.65534484", "0.65463495", "0.6545203", "0.6527783", "0.65192175", "0.651793", "0.6515166", "0.6469156", "0.6468078", "0.6463261", "0.6460121", "0.64595485", "0.6452149", "0.64459306", "0.6430254", "0.64195937", "0.6419403", "0.6415674", "0.64143836", "0.6412934", "0.6409984", "0.6409338", "0.6405072", "0.63988674", "0.63918954", "0.6390743", "0.6389662", "0.6387576", "0.6385699", "0.63839775", "0.63839775", "0.63834417", "0.63831943", "0.6375284", "0.637389", "0.6368072", "0.63601404", "0.6355327", "0.63538176", "0.63531816", "0.6352954", "0.63451916", "0.634478", "0.634374", "0.63425434", "0.6342204", "0.63420165", "0.63420165", "0.63420165", "0.6340314", "0.6335151", "0.6332837", "0.6327961", "0.6327731", "0.6326499", "0.63224685", "0.6321734", "0.6317833", "0.631422", "0.63131493", "0.6312279", "0.63090694", "0.6306524", "0.63051933", "0.63004243", "0.62985456", "0.62969136", "0.62964064", "0.6293534", "0.6293375", "0.6293375", "0.6293375", "0.6293375", "0.629256", "0.6292364", "0.62921214", "0.6289077", "0.62884223", "0.6282664", "0.62818485", "0.6276348", "0.6274736", "0.6274159", "0.627367", "0.6269823", "0.6269448" ]
0.66952485
7
Use callbacks to share common setup or constraints between actions.
def set_distbutor @distbutor = Distbutor.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "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", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def distbutor_params params.require(:distbutor).permit(:name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "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", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "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", "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", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "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", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "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", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "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", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "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", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "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", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "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", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "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", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "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", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "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", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "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", "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", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "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", "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", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "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", "def secure_params\n params.require(:location).permit(:name)\n end", "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", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "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", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "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", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "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", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
41 is length of longest name 40 is it's index
def list_attractions RhodyAttractions::Attraction.all.each do |attraction| attraction.print_description("short") puts "" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longest_prefix(name)\n @symbols.longest_prefix(to_name(name))\n end", "def player_with_longest_name\n longestName.max_by(&:length)\nend", "def player_with_longest_name\n max_name = 0\n player_name = ''\n game_hash.keys.each do |location|\n game_hash[location][:players].keys.each do |name|\n if name.length > max_name\n max_name = name.length\n player_name = name\n end\n end\n end\n player_name\nend", "def index_name_length\n IDENTIFIER_MAX_LENGTH\n end", "def player_with_longest_name\n players.keys.sort_by { |name| name.length }[-1]\nend", "def get_longest_snp_name\n name = \"\"\n\t\tmax_length = 0\n chromhash.each_value do |chrom|\n if chrom.get_max_snp_name > max_length\n max_length = chrom.get_max_snp_name\n\t\t\t\tname = chrom.get_longest_snp_name\n end\n end\n return name\t\t\n\tend", "def index_name_length\n 31\n end", "def longest_string\nend", "def longest_string \nend", "def player_with_longest_name\n array = []\n array2 = []\n max_name = \"\"\n game_hash.collect do |location, team_data|\n team_data[:players].keys.collect do |name|\n array << name\n array2 << name.length\n end\n end\n\t max = array2.max\n array.collect do |name|\n if \tname.length == max\n max_name = name\n end\n end\n max_name\n end", "def index_letter\n last_name[0..0]\n end", "def longest_element_name_using_inject\n collection.inject do |memo, element|\n memo[:name].length > element[:name].length ? memo : element\n end\n end", "def player_with_longest_name\n name_size = 0\n result = \"\"\n game_hash.each do |team, about|\n about[:players].each do |name , stats|\n if name_size < name.size\n result = name\n end\n end\n end\n result\nend", "def longest_name(game)\nmax_length = 0\nmax_length_player = \"\"\ngame.each do |team, team_contents|\n team_contents[:roster].each do |player, player_contents| \n if player_contents[:player_name].length > max_length\n max_length = player_contents[:player_name].length\n max_length_player = player_contents[:player_name]\n elsif player_contents[:player_name].length == max_length\n max_length_player += max_length_player \" and #{player_contents[:player_name]}\"\n end\n end\nend\nmax_length_player\nend", "def player_with_longest_name\n longest = ''\n longest_length = 0\n game_hash.each do |home_away, keys|\n keys[:players].each do |player|\n name_length = player[:player_name].length\n longest, longest_length = player[:player_name], name_length if name_length > longest_length\n end\n end\n return longest\nend", "def name_length\n name.length\n end", "def player_with_longest_name\r\n result={}\r\n game_hash.each do |k, v|\r\n v.each do| p, d|\r\n if p==:players\r\n d.each do |i, j|\r\n result[i]=i.length\r\n end\r\n end\r\n end\r\n end\r\n result.max_by {|name, len| len}[0].to_s\r\n end", "def longestName\n players.collect do|name, stats|\n name\n end\nend", "def da_last_name\n %w(Ahmed Ali Andersen Andersson Andreasen Andreassen Andresen Asmussen Bach Bak Bang Bech Beck Bendtsen Berg Bertelsen Berthelsen Bjerre Bjerregård Bjerregaard Bonde Brandt Brodersen Bruun Buch Bundgaard Bundgård Carlsen Carstensen Christensen Christiansen Christoffersen Clausen Dahl Dalgaard Dalgård Dalsgård Dalsgaard Dam Damgaard Damgård Danielsen Davidsen Enevoldsen Eriksen Eskildsen Fischer Frandsen Frederiksen Friis Frost Gade Gregersen Hald Hansen Hedegård Hedegaard Hemmingsen Henningsen Henriksen Hermansen Hjorth Hoffmann Holm Holst Hougård Hougaard Ibsen Iversen Jacobsen Jakobsen Jensen Jeppesen Jepsen Jespersen Jessen Johannesen Johannsen Johansen Johansson Johnsen Juhl Justesen Juul Jønsson Jørgensen Karlsen Kirkegaard Kirkegård Kjeldsen Kjær Kjærgaard Kjærgård Klausen Knudsen Koch Kofoed Kragh Kristensen Kristiansen Kristoffersen Krog Krogh Kruse Lange Larsen Lassen Lauridsen Lauritsen Lauritzen Laursen Laustsen Leth Lind Lorentzen Lorenzen Lund Madsen Markussen Mathiasen Mathiesen Meyer Michelsen Mikkelsen Mogensen Mortensen Munk Müller Mølgård Mølgaard Møller Nguyen Nielsen Nikolajsen Nilsson Nissen Nygaard Nygård Nørgård Nørgaard Olesen Olsen Olsson Overgaard Overgård Paulsen Pedersen Persson Petersen Poulsen Rasmussen Ravn Riis Schmidt Schou Schrøder Schultz Simonsen Skov Sommer Steffensen Svendsen Svensson Søgård Søgaard Søndergård Søndergaard Sørensen Thomassen Thomsen Thorsen Thygesen Thøgersen Toft Vestergaard Vestergård Villadsen Vinther Winther Østergaard Østergård Ågård Ågaard Aagård Aagaard).rand\n end", "def key_length(name); end", "def longest_string\n walker.push(revision)\n shas = walker.map(&:oid)\n Shamazing.string_from_array(shas)\n end", "def title(name, len=3)\r\n name[0,len]\r\nend", "def get_longest_string\n current_longest = {@data[0] => @data[0].length}\n longest_value = @data[0] # BUG should read @data[0].length\n @data.each do |word|\n if word.length > longest_value\n current_longest = {word => word.length}\n longest_value = word.length\n end\n end\n current_longest\n end", "def full_name_24_length\n full = \"#{self.name} #{self.last_name}\"\n full[0,24]\n end", "def longest_string ar\n\tar.max_by(&:length)\nend", "def player_with_longest_name()\ncount = 0\nresult = \"\"\n\ngame_hash.each do |side,team|\n team.each do |specs,info|\n if specs == :players\n info.each do |player|\n\n if player[:player_name].length > count\n count = player[:player_name].length\n result = player[:player_name]\n\n end\n end\n end\n end\nend\nresult\nend", "def player_with_longest_name\n longest_name = 0\n the_player = \"\"\n\n game_hash.each do |location, team_data|\n team_data[:players].each do |name,stats|\n if (name.size > the_player.size)\n the_player = name\n end #if\n end #team_data\n end #game_hash\n the_player\n\nend", "def player_with_longest_name\n longest_name = \"\"\n game_hash.each do |k, team|\n team[:players].each do |e|\n if e[:player_name].length > longest_name.length\n longest_name = e[:player_name]\n end\n end\n end\n longest_name\nend", "def longest_prefix(strings)\n # raise NotImplementedError, \"Not implemented yet\"\n longest_prefix = \"\"\n idx = 0\n letter = strings[0][idx]\n\n until letter == nil\n strings.each do |string|\n if string[idx] != letter\n return longest_prefix\n end\n end\n longest_prefix += letter\n idx += 1\n letter = strings[0][idx]\n end\n return longest_prefix\nend", "def player_with_longest_name\n longest_name = 0\n longest_player_name = nil\n game_hash.each do |team, team_stats|\n team_stats[:players].each do |player_stats|\n if longest_name < player_stats[:player_name].length\n longest_name = player_stats[:player_name].length\n longest_player_name = player_stats[:player_name]\n end\n end\n end\n longest_player_name\nend", "def longest_string ar\n return ar.max_by(&:length)\nend", "def longest_prefix(strings)\n min = strings.min \n max = strings.max\n string_pre = min.size.times do |i| \n break i if min[i] != max[i]\n end\n min[0...string_pre]\nend", "def longest_word(sen)\n words = sen.split\n words.map! { |word| word.delete('^A-Za-z1-9_\\'') }\n longest = words.first\n words.each_with_index do |word, idx|\n next if idx >= words.size - 1\n longest = longest.size < words[idx + 1].size ? words[idx + 1] : longest\n end\n longest\nend", "def linear_longest_word(arr)\n max_length=0\n max_str=arr[0]\n arr.each do |str| \n curr_length=str.length\n if curr_length>max_length\n max_length=curr_length\n max_str=str\n end\n end\n max_str\nend", "def longest_string array\n\tarray.max_by(&:length)\nend", "def player_with_longest_name\n long_name = \"\"\n name = []\n \n game_hash.each do |key, value|\n players = value[:players]\n players.each do |element|\n name << element[:player_name]\n end\n end\n long_name = name.max\nend", "def three_word_name; end", "def player_with_longest_name\nlongest_name = \"\"\ngame_hash.each do |team,info|\n info.each do |team_info,team_data|\n if team_data.is_a? (Array) \n if team_info != :colors\n team_data.each do |player_index|\n if longest_name == \"\" || player_index[:player_name] > longest_name \n longest_name = player_index[:player_name]\n longest_name = player_index[:player_name]\n end\n end\n end\n end\n end\nend\nlongest_name\nend", "def full_name_length(length)\n \n full = \"#{self.name} #{self.last_name}\"\n \n if full.length <= length.to_i\n full\n else\n full[0,length.to_i]+\"...\"\n end\n end", "def find_longest_word(string)\n array = string.split(\" \")\n p array\n array.max_by(&:length) \nend", "def longest_string array\n array.max_by(&:length)\nend", "def longest_prefix(str, pos= 0, len= -1, match_prefix= false)\n end", "def longest_word(sentence)\nend", "def longest_word(sentence)\nend", "def longest_prefix(strings)\n same = true\n index = 0\n\n while same \n array_characters = strings.map do |string|\n string[index]\n end\n\n current = 0\n until array_characters.length - 1 < current\n if array_characters[current] == array_characters[0]\n current += 1\n else\n same = false\n end\n end\n index += 1\n end \n\n if same == true\n return strings.first[0..index]\n else\n return strings.first[0...index] \n end\nend", "def longest_word(sentence)\n # Write your code here\n splt = sentence.split(\" \")\n len_arr =splt.map {|val| val.length}\n p len_arr\n splt[len_arr.index(len_arr.max)] #return me index of max in array\n #ONE LINE\n \nend", "def longest_length(validwords)\n validwords = validwords.sort_by(&:length).reverse\n validwords[0].length\nend", "def longest_word(sen)\n tmp_arr = sen.split(\" \")\n tmp_longest = 0\n tmp_arr.each do |i|\n tmp_longest = i.size if i.size > tmp_longest\n end\n\n tmp_arr.select { |i| i.size == tmp_longest }.first\nend", "def longest\n @strings.max { |a,b| a.length <=> b.length}\n end", "def longest str\n\tstr.max_by(&:length)\nend", "def print_short_names(names, max_letters=12)\n\n puts \"All names shorter than %i characters\" % max_letters\n names.select {|anyname| anyname[:name].length < max_letters}.each_with_index do |name, index|\n print_name(name, index)\n end\nend", "def longest_entry(words)\n return words.max_by(&:length)\n end", "def name_max\n @header_data.read_int(HDR_MAXINDEX_)\n end", "def longest_string(arr)\n arr.max_by { |word| word.length }\nend", "def longestSub(str)\n\n\nend", "def LongestWord(sen)\n words = sen.split(' ').map do |i|\n /[a-zA-Z0-9]+/.match(i)\n end\n\n longest = words.max_by.each do |i|\n i.to_s.length\n end\n\n longest\n\nend", "def next_cons(name)\n cons=\"bcdfghjklmnpqrstvwxyz\"\n\tindex = 0\n\twhile index < name.length\n\t i_name = name[index]\n\t\tif ( cons.index(\"#{i_name}\") != nil ) and ( cons.index(\"#{i_name}\") != 20 )\n\t\t\tname[index] = cons[cons.index(\"#{i_name}\") + 1]\n\t\t\tindex += 1\n\t\telsif cons.index(\"#{i_name}\") == 20\n\t\t\tname[index] = cons[0]\n\t\t\tindex += 1\n\t\telse\n\t\t\tindex += 1\n\t\tend\n\tend\n\treturn name\nend", "def longest_prefix(strings)\n word_array = strings[0].split(\"\")\n length = strings.length\n\n prefix = \"\"\n\n word_array.each_with_index do |letter,letter_index|\n count_words_with_letter = 0\n\n (length - 1).times do |i|\n if (strings[i+1].split(\"\"))[letter_index] == letter \n count_words_with_letter += 1\n else\n return prefix\n end\n end\n\n if count_words_with_letter = length-1\n prefix += letter\n end\n end\n\n return prefix\nend", "def next_letter(full_name)\r\n\tidx = 0\r\n\twhile idx < full_name.length\r\n\t\tname = full_name.split('')\r\n\t\tname.map! { |letter| letter.next }\r\n\t\tidx += 1\r\n\tend\r\n\tname\r\nend", "def player_with_longest_name\n player_collection.reduce { |longest_name, next_player|\n longest_name[:player_name].length > next_player[:player_name].length ? longest_name : next_player; \n }[:player_name]; \n #probably easier to read to declare variable, however, good to know this works. \nend", "def longest_prefix(strings)\n words = strings.length\n min_characters = (strings.min_by{|string|string.length}).length\n prefix = \"\"\n\n min_characters.times do |j|\n letter = strings[0][j]\n\n words.times do |i|\n return prefix if strings[i][j] != letter\n end\n\n prefix += letter\n end\n\n return prefix\nend", "def longest_string(array)\n\tarray.max_by(&:length)\nend", "def player_longest_name(game)\n player_names = []\n game[:home_team][:players].each do |player_hash|\n player_names << player_hash[:player_name]\n end\n game[:away_team][:players].each do |player_hash|\n player_names << player_hash[:player_name]\n end\n longest_name = player_names.max_by { |name| name.length }\nend", "def two_word_name; end", "def longest_string(list_of_words)\n list_of_words.max { |a,b| a.size <=> b.size }\n\nend", "def most_frequent_letter(string)\nend", "def longest_string(list_of_words)\n # Your code goes here!\n word_hash = Hash.new\n list_of_words.each do |word|\n word_hash[word] = word.length\n end\n word_length = Array.new\n word_hash.each_value do |value|\n word_length.push(value)\n end\n length_sorted = word_length.sort\n tall_one = length_sorted.last\n word_hash.key(tall_one)\nend", "def longest_prefix(strings)\n # raise NotImplementedError, \"Not implemented yet\"\n common_prefix = \"\"\n if strings.empty?\n return common_prefix\n end\n\n strings[0].each_char.with_index do |char, index|\n (1...strings.size).each do |arr_position|\n if char != strings[arr_position][index]\n return common_prefix\n end\n end\n common_prefix << char\n end\n\n return common_prefix\nend", "def longest_prefix(strings)\n longest_prefix = \"\"\n num_letters = strings[0].length\n \n num_letters.times do |i|\n status = true\n check_letter = strings[0][i]\n strings.each do |string|\n if string[i] != check_letter\n status = false\n end\n end\n if status == true\n longest_prefix += check_letter\n end\n end\n \n return longest_prefix\nend", "def longest_prefix(strings)\n arr_length = strings.length\n word_length = strings[0].length\n \n result = \"\"\n \n word_length.times do |i|\n \n current_letter = strings[0][i]\n \n arr_length.times do |j|\n if strings[j][i] != current_letter\n return result\n end\n end\n \n result << current_letter # for future reference: push is O(1)\n end\n \n return result\nend", "def high x \n letters = ('a'..'z').to_a\n indexes = (1..26).to_a\n obj = letters.zip(indexes)\n highest_count = 0\n highest_word = ''\n\n word_arr = x.split(' ')\n word_arr.each do |word|\n current_count = 0\n letter_arr = word.split('')\n letter_arr.each do |l|\n obj.each do |o|\n if l == o[0]\n current_count += o[1]\n end\n end\n end\n if current_count > highest_count\n highest_count = current_count\n highest_word = word \n end\n end\n return highest_word\nend", "def fake_name_c2(real_name)\n\treal_full_name = real_name.split(\" \")\n\treal_first_name = real_full_name[0] \n\treal_last_name = real_full_name[1]\n\ti = 0\n\tfake_first_name = \"\"\n\tfake_last_name = \"\"\n\tvowel_index = \"\"\n\tlength_first = real_first_name.length\n\tlength_last = real_last_name.length \n\t\twhile i < length_last\n\t\tif real_last_name[i] == \"z\"\n\t\t\tfake_last_name += \"a\"\n\t\telsif real_last_name[i] == \"a\" || real_last_name[i] ==\"e\" || \n\t\t\t real_last_name[i] == \"i\" || real_last_name[i] == \"o\" || \n\t\t\t real_last_name[i] == \"u\"\n\t\t\tfake_last_name += real_last_name[i] \n\t\telse \n\t\t\tfake_last_name += real_last_name[i].next \n\t\tend \n\t\ti+=1\n\tend\n\tfake_last_name\nend", "def select_name_and_motto_of_char_with_longest_motto\n \"SELECT characters.name, characters.motto\n FROM characters\n ORDER BY LENGTH(characters.motto) DESC LIMIT 1;\"\nend", "def find_longest_word(input)\n array = input.split(\" \")\n array.sort! { |x, y| y.length <=> x.length }\n array[0]\nend", "def longest_string(list_of_words)\n list_of_word = list_of_words.sort_by { |x| x.length }\n return list_of_word[-1]\nend", "def longest_string(list_of_words)\n # Your code goes here!\nend", "def old_longest_word(str)\n words = str.split\n longest_word = \"\"\n\n words.each do |word|\n if word.length > longest_word.length\n longest_word = word\n end\n end\n\n longest_word\nend", "def get_the_longest_word(str)\n words = str.split()\n longest = [0, \"\"]\n\n for word in words\n if word.length > longest[0]\n longest[0] = word.length\n longest[1] = word\n end\n end\n\n print(longest[1])\n return longest[1]\nend", "def length_of_longest_substring(str) ## Does not pass LeetCode Test\n max_longest = ''\n current_longest = ''\n str.each_char do |letter|\n current_longest = \"\" if current_longest.index(letter)\n current_longest << letter \n max_longest = current_longest if current_longest.length > max_longest.length \n end\n max_longest.length \nend", "def sequence_name_length\n IDENTIFIER_MAX_LENGTH\n end", "def combined_name_too_long_label\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.span.id(\"/valNameLengthLast$/\"), format_method(__method__))\n end", "def create_index3(word)\n word.split('').sort!.join\n end", "def longest_prefix(strings)\n loops = (strings.length) - 1\n comparison_word = strings[0]\n \n loops.times do |i|\n prefix = \"\"\n counter = 0\n \n strings[i + 1].each_char do |letter|\n if letter == comparison_word[counter]\n prefix<<(letter)\n end\n counter += 1\n end\n comparison_word = prefix\n end\n \n return comparison_word\nend", "def longest_prefix(strings)\n initial_match = ''\n length = strings[0].length\n length.times do |letter|\n if strings[0][letter] == strings[1][letter]\n initial_match.concat(strings[0][letter])\n end\n end\n \n strings.each do |word|\n match = ''\n initial_match.length.times do |letter|\n if initial_match[letter] == word[letter]\n match.concat(word[letter])\n end\n end\n initial_match = match\n end\n \n return initial_match\nend", "def longest_prefix(strings)\n temp = strings[0].chars\n \n strings.each_with_index do |value, i|\n value.length.times do |i|\n if value[i] != temp[i]\n temp[i] = nil\n end\n end\n end\n \n nil_location = temp.index(nil) || temp.length\n return temp.take(nil_location).join\nend", "def longest_prefix(strings)\n strings.each do |string|\n if string.length == 0\n return \"\"\n end \n end \n prefix = strings[0]\n (1...strings.length).each do |n|\n (0...prefix.length).each do |i|\n if strings[n][i] != prefix[i]\n if i == 0\n prefix = \"\"\n break\n else \n prefix = prefix[0...i]\n break\n end \n end \n end \n end \n return prefix\nend", "def find_longest_word(sentence)\n words = sentence.split\n # x = 0\n # y = words[x]\n z = words[0]\n\n words.each do |word|\n\n if word.length > z.length\n z = word\n end\n # x += 1\n end\n z\nend", "def longest_prefix(strings)\n length = strings.min_by { |string| string.length }.length\n strings = strings.sort!\n substring = \"\"\n \n i = 0\n while i <= length\n if strings[0][0..i] == strings[-1][0..i]\n substring = strings[0][0..i]\n end\n i += 1\n end\n \n return substring\nend", "def all_deputies_last_names(full_names)\n last_names = []\n\n full_names.each_with_index do |name, index|\n last_names << name if index.even?\n end\n\n last_names\nend", "def max_position\n @words.first[1].length\n end", "def longest_string string \n\tar = ['One','Two','Three','Four','Five']\n\tar.max_by(&:length)\nend", "def longest_string(list_of_words)\n if list_of_words == []\n p nil\n else\n words_and_lengths = {}\n list_of_words.each do |word|\n words_and_lengths[word.length] = word\n end\n p words_and_lengths\n longest_length = list_of_words[0].length\n words_and_lengths.each do|length, word|\n if length > longest_length\n longest_length = length\n end\n end\n p words_and_lengths[longest_length]\n end\nend", "def longest_string(string_array)\n string_array.max_by(&:length)\nend", "def longest_prefix(strings)\n prefix = \"\"\n\n i = 0\n char = strings[0][i]\n\n while char != nil\n strings.each do |string|\n if string[i] != char\n return prefix\n end\n end\n\n prefix += char\n i += 1\n char = strings[0][i]\n end\n \n return prefix\nend", "def create_index1(word)\n word.chars.sort!.join\n end", "def longest_word(string)\n\t\n\tsplitted_string = string.split(\" \")\n\tword_length = []\n\t\n\tsplitted_string.each { |word| word_length << word.length }\n\t\n\tmax = word_length.max\n\tidx = word_length.index(max)\n\tsplitted_string[idx]\n\t\nend", "def longest (string)\n length_string = getlength(string)\n string.each do |word|\n if word.length == length_string.max\n puts word\n end\n end\nend", "def longest_prefix(strings)\n template = strings[0]\n i = 0\n \n until template[i].nil? do\n comparison_result = true\n strings[1..].each do |word|\n \n if word[i] != template[i]\n comparison_result = false\n break\n end \n\n end\n\n if comparison_result\n i += 1\n else \n break\n end\n end\n return template[0, i]\nend", "def column_name_length\n 31\n end", "def longest_string(list_of_words)\n index = 0\n counter = 1\n if list_of_words == []\n return nil\n end\n until counter == list_of_words.length\n if list_of_words[index].length > list_of_words[counter].length\n counter += 1\n else\n index = counter\n counter += 1\n end\n end\n return list_of_words[index]\nend", "def longest_word(sentence)\n\n arr = sentence.split\n idx = arr.length\n cmp = []\n\n n = idx\n while n >= 0\n\n word = arr[n].to_s\n word_length_string = word.length\n word_length_integer = word_length_string.to_i\n cmp.unshift(word_length_integer)\n\n n = n - 1\n end\n\n n = 0\n longest_length = 0\n position = 0\n while n < cmp.length\n if cmp[n] > longest_length\n longest_length = cmp[n]\n position = n\n end\n n = n + 1\n end\n\nreturn arr[position]\n\nend" ]
[ "0.7096635", "0.7046407", "0.70287293", "0.69985527", "0.69791913", "0.69025165", "0.68990815", "0.68937486", "0.6845222", "0.6801561", "0.6721561", "0.6589064", "0.6568624", "0.65534824", "0.6535399", "0.6535027", "0.6529037", "0.65270656", "0.65081954", "0.6500504", "0.6484568", "0.6461018", "0.6451976", "0.6449556", "0.6421473", "0.64177597", "0.64151096", "0.636364", "0.63589185", "0.6336579", "0.6330444", "0.6325419", "0.6323317", "0.6321447", "0.6311873", "0.630391", "0.62802476", "0.6276671", "0.62747085", "0.62729764", "0.62572306", "0.62508905", "0.6246065", "0.6246065", "0.62444663", "0.62327015", "0.6226909", "0.62238353", "0.6216987", "0.62163764", "0.62115127", "0.6206544", "0.6200775", "0.61945176", "0.6182312", "0.6169736", "0.61655647", "0.6151869", "0.61396974", "0.6139575", "0.6134047", "0.61315304", "0.6114238", "0.6105587", "0.6061503", "0.60537827", "0.6046501", "0.60441494", "0.6037215", "0.60349107", "0.60338366", "0.60336614", "0.60280305", "0.6027032", "0.60217685", "0.6015248", "0.6015172", "0.6003994", "0.5995926", "0.59944206", "0.5987705", "0.59867686", "0.59831953", "0.59820104", "0.59808403", "0.59776706", "0.59761333", "0.5969508", "0.5968086", "0.5963673", "0.59624016", "0.5960484", "0.59592336", "0.595697", "0.5950635", "0.5950033", "0.5949537", "0.5946705", "0.59457123", "0.5943014", "0.59420997" ]
0.0
-1